diff --git a/.github/disabled-workflows/publish.yml b/.github/disabled-workflows/publish.yml new file mode 100644 index 000000000..6bd81a350 --- /dev/null +++ b/.github/disabled-workflows/publish.yml @@ -0,0 +1,105 @@ +name: Publish Build Artifacts + +on: push + +jobs: + publish_images: + # Optionally publish container images, guarded by the GitHub secret + # QUAY_PUBLISH. + # To set this up, sign up for quay.io (you can connect it to your github) + # then create a robot user with write access user called "bcc_buildbot", + # and add the secret token for it to GitHub secrets as: + # - QUAY_TOKEN = + name: Publish to quay.io + runs-on: ubuntu-latest + strategy: + matrix: + env: + - NAME: xenial-release + OS_RELEASE: 16.04 + - NAME: bionic-release + OS_RELEASE: 18.04 + - NAME: focal-release + OS_RELEASE: 20.04 + steps: + + - uses: actions/checkout@v1 + + - name: Initialize workflow variables + id: vars + shell: bash + run: | + if [ -n "${QUAY_TOKEN}" ];then + echo "Quay token is set, will push an image" + echo ::set-output name=QUAY_PUBLISH::true + else + echo "Quay token not set, skipping" + fi + + env: + QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} + + - name: Authenticate with quay.io docker registry + if: > + steps.vars.outputs.QUAY_PUBLISH + env: + QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} + run: ./scripts/docker/auth.sh ${{ github.repository }} + + - name: Package docker image and push to quay.io + if: > + steps.vars.outputs.QUAY_PUBLISH + run: > + ./scripts/docker/push.sh + ${{ github.repository }} + ${{ github.ref }} + ${{ github.sha }} + ${{ matrix.env['NAME'] }} + ${{ matrix.env['OS_RELEASE'] }} + + # Uploads the packages built in docker to the github build as an artifact for convenience + - uses: actions/upload-artifact@v1 + if: > + steps.vars.outputs.QUAY_PUBLISH + with: + name: ${{ matrix.env['NAME'] }} + path: output + + # Optionally publish container images to custom docker repository, + # guarded by presence of all required github secrets. + # GitHub secrets can be configured as follows: + # - DOCKER_IMAGE = docker.io/myorg/bcc + # - DOCKER_USERNAME = username + # - DOCKER_PASSWORD = password + publish_dockerhub: + name: Publish To Dockerhub + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v1 + + - name: Initialize workflow variables + id: vars + shell: bash + run: | + if [ -n "${DOCKER_IMAGE}" ] && \ + [ -n "${DOCKER_USERNAME}" ] && \ + [ -n "${DOCKER_PASSWORD}" ];then + echo "Custom docker credentials set, will push an image" + echo ::set-output name=DOCKER_PUBLISH::true + else + echo "Custom docker credentials not, skipping" + fi + + - name: Build container image and publish to registry + id: publish-registry + uses: elgohr/Publish-Docker-Github-Action@2.8 + if: ${{ steps.vars.outputs.DOCKER_PUBLISH }} + with: + name: ${{ secrets.DOCKER_IMAGE }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + workdir: . + dockerfile: Dockerfile.ubuntu + snapshot: true + cache: ${{ github.event_name != 'schedule' }} diff --git a/.gitignore b/.gitignore index 14994d761..18a6f5a74 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ debian/**/*.log *critical.log obj-x86_64-linux-gnu examples/cgroupid/cgroupid + +# Output from docker builds +scripts/docker/output/ +/output/ diff --git a/CMakeLists.txt b/CMakeLists.txt index f1916b55c..74fe4f193 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,10 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "path to install" FORCE) +endif() + enable_testing() # populate submodules (libbpf) @@ -15,6 +19,14 @@ if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/cc/libbpf/src) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) endif() +# It's possible to use other kernel headers with +# KERNEL_INCLUDE_DIRS build variable, like: +# $ cd +# $ make INSTALL_HDR_PATH=/tmp/headers headers_install +# $ cd +# $ cmake -DKERNEL_INCLUDE_DIRS=/tmp/headers/include/ ... +include_directories(${KERNEL_INCLUDE_DIRS}) + include(cmake/GetGitRevisionDescription.cmake) include(cmake/version.cmake) include(CMakeDependentOption) @@ -51,19 +63,19 @@ endif() # clang is linked as a library, but the library path searching is # primitively supported, unlike libLLVM set(CLANG_SEARCH "/opt/local/llvm/lib;/usr/lib/llvm-3.7/lib;${LLVM_LIBRARY_DIRS}") -find_library(libclangAnalysis NAMES clangAnalysis HINTS ${CLANG_SEARCH}) -find_library(libclangAST NAMES clangAST HINTS ${CLANG_SEARCH}) -find_library(libclangBasic NAMES clangBasic HINTS ${CLANG_SEARCH}) -find_library(libclangCodeGen NAMES clangCodeGen HINTS ${CLANG_SEARCH}) -find_library(libclangDriver NAMES clangDriver HINTS ${CLANG_SEARCH}) -find_library(libclangEdit NAMES clangEdit HINTS ${CLANG_SEARCH}) -find_library(libclangFrontend NAMES clangFrontend HINTS ${CLANG_SEARCH}) -find_library(libclangLex NAMES clangLex HINTS ${CLANG_SEARCH}) -find_library(libclangParse NAMES clangParse HINTS ${CLANG_SEARCH}) -find_library(libclangRewrite NAMES clangRewrite HINTS ${CLANG_SEARCH}) -find_library(libclangSema NAMES clangSema HINTS ${CLANG_SEARCH}) -find_library(libclangSerialization NAMES clangSerialization HINTS ${CLANG_SEARCH}) -find_library(libclangASTMatchers NAMES clangASTMatchers HINTS ${CLANG_SEARCH}) +find_library(libclangAnalysis NAMES clangAnalysis clang-cpp HINTS ${CLANG_SEARCH}) +find_library(libclangAST NAMES clangAST clang-cpp HINTS ${CLANG_SEARCH}) +find_library(libclangBasic NAMES clangBasic clang-cpp HINTS ${CLANG_SEARCH}) +find_library(libclangCodeGen NAMES clangCodeGen clang-cpp HINTS ${CLANG_SEARCH}) +find_library(libclangDriver NAMES clangDriver clang-cpp HINTS ${CLANG_SEARCH}) +find_library(libclangEdit NAMES clangEdit clang-cpp HINTS ${CLANG_SEARCH}) +find_library(libclangFrontend NAMES clangFrontend clang-cpp HINTS ${CLANG_SEARCH}) +find_library(libclangLex NAMES clangLex clang-cpp HINTS ${CLANG_SEARCH}) +find_library(libclangParse NAMES clangParse clang-cpp HINTS ${CLANG_SEARCH}) +find_library(libclangRewrite NAMES clangRewrite clang-cpp HINTS ${CLANG_SEARCH}) +find_library(libclangSema NAMES clangSema clang-cpp HINTS ${CLANG_SEARCH}) +find_library(libclangSerialization NAMES clangSerialization clang-cpp HINTS ${CLANG_SEARCH}) +find_library(libclangASTMatchers NAMES clangASTMatchers clang-cpp HINTS ${CLANG_SEARCH}) if(libclangBasic STREQUAL "libclangBasic-NOTFOUND") message(FATAL_ERROR "Unable to find clang libraries") endif() diff --git a/Dockerfile.tests b/Dockerfile.tests index b4bff710d..251eb5317 100644 --- a/Dockerfile.tests +++ b/Dockerfile.tests @@ -1,19 +1,19 @@ -# Using ubuntu 19.04 for newer `unshare` command used in tests -FROM ubuntu:19.04 +FROM ubuntu:18.04 ARG LLVM_VERSION="8" ENV LLVM_VERSION=$LLVM_VERSION RUN apt-get update && apt-get install -y curl gnupg &&\ llvmRepository="\n\ -deb http://apt.llvm.org/disco/ llvm-toolchain-disco main\n\ -deb-src http://apt.llvm.org/disco/ llvm-toolchain-disco main\n\ -deb http://apt.llvm.org/disco/ llvm-toolchain-disco-${LLVM_VERSION} main\n\ -deb-src http://apt.llvm.org/disco/ llvm-toolchain-disco-${LLVM_VERSION} main\n" &&\ +deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main\n\ +deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic main\n\ +deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-${LLVM_VERSION} main\n\ +deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-${LLVM_VERSION} main\n" &&\ echo $llvmRepository >> /etc/apt/sources.list && \ curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - RUN apt-get update && apt-get install -y \ + util-linux \ bison \ binutils-dev \ cmake \ diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index 71d025d52..1aeb84182 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -1,4 +1,9 @@ -FROM ubuntu:bionic +ARG OS_TAG=18.04 +FROM ubuntu:${OS_TAG} as builder + +ARG OS_TAG +ARG BUILD_TYPE=release +ARG DEBIAN_FRONTEND=noninteractive MAINTAINER Brenden Blanco @@ -10,4 +15,13 @@ COPY ./ /root/bcc WORKDIR /root/bcc RUN /usr/lib/pbuilder/pbuilder-satisfydepends && \ - ./scripts/build-deb.sh + ./scripts/build-deb.sh ${BUILD_TYPE} + +FROM ubuntu:${OS_TAG} + +COPY --from=builder /root/bcc/*.deb /root/bcc/ + +RUN \ + apt-get update -y && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y python python3 binutils libelf1 kmod && \ + dpkg -i /root/bcc/*.deb diff --git a/INSTALL.md b/INSTALL.md index 80063f006..76ac16f98 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,13 +2,16 @@ * [Kernel Configuration](#kernel-configuration) * [Packages](#packages) + - [Debian](#debian--binary) - [Ubuntu](#ubuntu---binary) - [Fedora](#fedora---binary) - - [Arch](#arch---aur) + - [Arch](#arch---binary) - [Gentoo](#gentoo---portage) - [openSUSE](#opensuse---binary) - [RHEL](#rhel---binary) - [Amazon Linux 1](#Amazon-Linux-1---Binary) + - [Amazon Linux 2](#Amazon-Linux-2---Binary) + - [Alpine](#alpine---binary) * [Source](#source) - [Debian](#debian---source) - [Ubuntu](#ubuntu---source) @@ -16,6 +19,7 @@ - [openSUSE](#opensuse---source) - [Centos](#centos---source) - [Amazon Linux](#amazon-linux---source) + - [Alpine](#alpine---source) * [Older Instructions](#older-instructions) ## Kernel Configuration @@ -55,24 +59,30 @@ Kernel compile flags can usually be checked by looking at `/proc/config.gz` or # Packages -## Ubuntu - Binary +## Debian - Binary -**Ubuntu Packages** +`bcc` and its tools are available in the standard Debian main repository, from the source package [bpfcc](https://packages.debian.org/source/sid/bpfcc) under the names `bpfcc-tools`, `python-bpfcc`, `libbpfcc` and `libbpfcc-dev`. + +## Ubuntu - Binary Versions of bcc are available in the standard Ubuntu -multiverse repository. The Ubuntu packages have slightly different names: where iovisor +Universe repository, as well in iovisor's PPA. The Ubuntu packages have slightly different names: where iovisor packages use `bcc` in the name (e.g. `bcc-tools`), Ubuntu packages use `bpfcc` (e.g. -`bpfcc-tools`). Source packages and the binary packages produced from them can be +`bpfcc-tools`). + +Currently, BCC packages for both the Ubuntu Universe, and the iovisor builds are outdated. This is a known and tracked in: +- [Universe - Ubuntu Launchpad](https://bugs.launchpad.net/ubuntu/+source/bpfcc/+bug/1848137) +- [iovisor - BCC GitHub Issues](https://github.com/iovisor/bcc/issues/2678) +Currently, [building from source](#ubuntu---source) is currently the only way to get up to date packaged version of bcc. + +**Ubuntu Packages** +Source packages and the binary packages produced from them can be found at [packages.ubuntu.com](https://packages.ubuntu.com/search?suite=default§ion=all&arch=any&keywords=bpfcc&searchon=sourcenames). ```bash sudo apt-get install bpfcc-tools linux-headers-$(uname -r) ``` -Some of the BCC tools are currently broken due to outdated packages. This is a -[known bug](https://bugs.launchpad.net/ubuntu/+source/bpfcc/+bug/1848137). -Therefore [building from source](#ubuntu---source) is currently the only way to get fully working tools. - The tools are installed in `/sbin` (`/usr/sbin` in Ubuntu 18.04) with a `-bpfcc` extension. Try running `sudo opensnoop-bpfcc`. **_Note_**: the Ubuntu packages have different names but the package contents, in most cases, conflict @@ -86,7 +96,7 @@ which declares a dependency on `libbpfcc` while the upstream `libbcc` package is `foo` should install without trouble as `libbcc` declares that it provides `libbpfcc`. That said, one should always test such a configuration in case of version incompatibilities. -**Upstream Stable and Signed Packages** +**iovisor packages (Upstream Stable and Signed Packages)** ```bash sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4052245BD4284CDD @@ -118,7 +128,7 @@ sudo dnf install bcc **Note**: if you keep getting `Failed to load program: Operation not permitted` when trying to run the `hello_world.py` example as root then you might need to lift -the so-called kernel lockdown (cf. +the so-called kernel lockdown (cf. [FAQ](https://github.com/iovisor/bcc/blob/c00d10d4552f647491395e326d2e4400f3a0b6c5/FAQ.txt#L24), [background article](https://gehrcke.de/2019/09/running-an-ebpf-program-may-require-lifting-the-kernel-lockdown)). @@ -155,15 +165,12 @@ echo -e '[iovisor]\nbaseurl=https://repo.iovisor.org/yum/main/f27/$basearch\nena sudo dnf install bcc-tools kernel-devel-$(uname -r) kernel-headers-$(uname -r) ``` -## Arch - AUR - -Upgrade the kernel to minimum 4.3.1-1 first; the ```CONFIG_BPF_SYSCALL=y``` configuration was not added until [this kernel release](https://bugs.archlinux.org/task/47008). +## Arch - Binary -Install these packages using any AUR helper such as [pacaur](https://aur.archlinux.org/packages/pacaur), [yaourt](https://aur.archlinux.org/packages/yaourt), [cower](https://aur.archlinux.org/packages/cower), etc.: +bcc is available in the standard Arch repos, so it can be installed with the `pacman` command: ``` -bcc bcc-tools python-bcc +# pacman -S bcc bcc-tools python-bcc ``` -All build and install dependencies are listed [in the PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=bcc) and should install automatically. ## Gentoo - Portage @@ -221,6 +228,45 @@ sudo yum install kernel-devel-$(uname -r | cut -d'.' -f1-5) sudo yum install bcc ``` +## Amazon Linux 2 - Binary +Use case 1. Install BCC for your AMI's default kernel (no reboot required): + Tested on Amazon Linux AMI release 2020.03 (kernel 4.14.154-128.181.amzn2.x86_64) +``` +sudo amazon-linux-extras enable BCC +sudo yum install kernel-devel-$(uname -r) +sudo yum install bcc +``` + +## Alpine - Binary + +As of Alpine 3.11, bcc binaries are available in the community repository: + +``` +sudo apk add bcc-tools bcc-doc +``` + +The tools are installed in `/usr/share/bcc/tools`. + +**Python Compatibility** + +The binary packages include bindings for Python 3 only. The Python-based tools assume that a `python` binary is available at `/usr/bin/python`, but that may not be true on recent versions of Alpine. If you encounter errors like `: not found`, you can try creating a symlink to the Python 3.x binary like so: + +``` +sudo ln -s $(which python3) /usr/bin/python +``` + +**Containers** + +Alpine Linux is often used as a base system for containers. `bcc` can be used in such an environment by launching the container in privileged mode with kernel modules available through bind mounts: + +``` +sudo docker run --rm -it --privileged \ + -v /lib/modules:/lib/modules:ro \ + -v /sys:/sys:ro \ + -v /usr/src:/usr/src:ro \ + alpine:3.12 +``` + # Source ## libbpf Submodule @@ -339,7 +385,7 @@ sudo apt-get update sudo apt-get -y install bison build-essential cmake flex git libedit-dev \ libllvm6.0 llvm-6.0-dev libclang-6.0-dev python zlib1g-dev libelf-dev -# For Eon (19.10) +# For Eoan (19.10) sudo apt install -y bison build-essential cmake flex git libedit-dev \ libllvm7 llvm-7-dev libclang-7-dev python zlib1g-dev libelf-dev @@ -352,12 +398,18 @@ sudo apt-get -y install luajit luajit-5.1-dev ``` ### Install and compile BCC + ``` git clone https://github.com/iovisor/bcc.git mkdir bcc/build; cd bcc/build -cmake .. -DCMAKE_INSTALL_PREFIX=/usr +cmake .. +make +sudo make install +cmake -DPYTHON_CMD=python3 .. # build python3 binding +pushd src/python/ make sudo make install +popd ``` ## Fedora - Source @@ -393,7 +445,7 @@ sudo dnf install -y clang clang-devel llvm llvm-devel llvm-static ncurses-devel ``` git clone https://github.com/iovisor/bcc.git mkdir bcc/build; cd bcc/build -cmake .. -DCMAKE_INSTALL_PREFIX=/usr +cmake .. make sudo make install ``` @@ -414,8 +466,7 @@ sudo zypper in lua51-luajit-devel # for lua support in openSUSE Tumbleweed ``` git clone https://github.com/iovisor/bcc.git mkdir bcc/build; cd bcc/build -cmake -DCMAKE_INSTALL_PREFIX=/usr \ - -DLUAJIT_INCLUDE_DIR=`pkg-config --variable=includedir luajit` \ # for lua support +cmake -DLUAJIT_INCLUDE_DIR=`pkg-config --variable=includedir luajit` \ # for lua support .. make sudo make install @@ -455,13 +506,13 @@ mkdir llvm-build cd llvm-build cmake3 -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../llvm-7.0.1.src + -DCMAKE_BUILD_TYPE=Release ../llvm-7.0.1.src make sudo make install cd ../clang-build cmake3 -G "Unix Makefiles" -DLLVM_TARGETS_TO_BUILD="BPF;X86" \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ../cfe-7.0.1.src + -DCMAKE_BUILD_TYPE=Release ../cfe-7.0.1.src make sudo make install cd .. @@ -483,12 +534,12 @@ For permanently enable scl environment, please check https://access.redhat.com/s ``` git clone https://github.com/iovisor/bcc.git mkdir bcc/build; cd bcc/build -cmake .. -DCMAKE_INSTALL_PREFIX=/usr +cmake3 .. make sudo make install ``` -## Amazon Linux - Source +## Amazon Linux 1 - Source Tested on Amazon Linux AMI release 2018.03 (kernel 4.14.47-56.37.amzn1.x86_64) @@ -516,7 +567,7 @@ tar xf clang* git clone https://github.com/iovisor/bcc.git pushd . mkdir bcc/build; cd bcc/build -cmake3 .. -DCMAKE_INSTALL_PREFIX=/usr +cmake3 .. time make sudo make install popd @@ -533,6 +584,75 @@ sudo mount -t debugfs debugfs /sys/kernel/debug sudo /usr/share/bcc/tools/execsnoop ``` +## Amazon Linux 2 - Source + +``` +# enable epel to get iperf, luajit, luajit-devel, cmake3 (cmake3 is required to support c++11) +sudo yum-config-manager --enable epel + +sudo yum install -y bison cmake3 ethtool flex git iperf libstdc++-static python-netaddr gcc gcc-c++ make zlib-devel elfutils-libelf-devel +sudo yum install -y luajit luajit-devel +sudo yum install -y http://repo.iovisor.org/yum/extra/mageia/cauldron/x86_64/netperf-2.7.0-1.mga6.x86_64.rpm +sudo pip install pyroute2 +sudo yum install -y ncurses-devel +``` + +### Install clang +``` +yum install -y clang llvm llvm-devel llvm-static clang-devel clang-libs +``` + +### Build bcc +``` +git clone https://github.com/iovisor/bcc.git +pushd . +mkdir bcc/build; cd bcc/build +cmake3 .. +time make +sudo make install +popd +``` + +### Setup required to run the tools +``` +sudo yum -y install kernel-devel-$(uname -r) +sudo mount -t debugfs debugfs /sys/kernel/debug +``` + +### Test +``` +sudo /usr/share/bcc/tools/execsnoop +``` + +## Alpine - Source + +### Install packages required for building + +``` +sudo apk add tar git build-base iperf linux-headers llvm10-dev llvm10-static \ + clang-dev clang-static cmake python3 flex-dev bison luajit-dev elfutils-dev \ + zlib-dev +``` + +### Build bcc + +``` +git clone https://github.com/iovisor/bcc.git +mkdir bcc/build; cd bcc/build +# python2 can be substituted here, depending on your environment +cmake -DPYTHON_CMD=python3 .. +make && sudo make install + +# Optional, but needed if you don't have /usr/bin/python on your system +ln -s $(which python3) /usr/bin/python +``` + +### Test + +``` +sudo /usr/share/bcc/tools/execsnoop +``` + # Older Instructions ## Build LLVM and Clang development libs diff --git a/README.md b/README.md index bc3639ca2..e5af60e3f 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ pair of .c and .py files, and some are directories of files. - tools/[argdist](tools/argdist.py): Display function parameter values as a histogram or frequency count. [Examples](tools/argdist_example.txt). - tools/[bashreadline](tools/bashreadline.py): Print entered bash commands system wide. [Examples](tools/bashreadline_example.txt). +- tools/[bindsnoop](tools/bindsnoop.py): Trace IPv4 and IPv6 bind() system calls (bind()). [Examples](tools/bindsnoop_example.txt). - tools/[biolatency](tools/biolatency.py): Summarize block device I/O latency as a histogram. [Examples](tools/biolatency_example.txt). - tools/[biotop](tools/biotop.py): Top for disks: Summarize block device I/O by process. [Examples](tools/biotop_example.txt). - tools/[biosnoop](tools/biosnoop.py): Trace block device I/O with PID and latency. [Examples](tools/biosnoop_example.txt). @@ -104,6 +105,7 @@ pair of .c and .py files, and some are directories of files. - tools/[dcsnoop](tools/dcsnoop.py): Trace directory entry cache (dcache) lookups. [Examples](tools/dcsnoop_example.txt). - tools/[dcstat](tools/dcstat.py): Directory entry cache (dcache) stats. [Examples](tools/dcstat_example.txt). - tools/[deadlock](tools/deadlock.py): Detect potential deadlocks on a running process. [Examples](tools/deadlock_example.txt). +- tools/[dirtop](tools/dirtop.py): File reads and writes by directory. Top for directories. [Examples](tools/dirtop_example.txt). - tools/[drsnoop](tools/drsnoop.py): Trace direct reclaim events with PID and latency. [Examples](tools/drsnoop_example.txt). - tools/[execsnoop](tools/execsnoop.py): Trace new processes via exec() syscalls. [Examples](tools/execsnoop_example.txt). - tools/[exitsnoop](tools/exitsnoop.py): Trace process termination (exit and fatal signals). [Examples](tools/exitsnoop_example.txt). @@ -113,6 +115,7 @@ pair of .c and .py files, and some are directories of files. - tools/[fileslower](tools/fileslower.py): Trace slow synchronous file reads and writes. [Examples](tools/fileslower_example.txt). - tools/[filetop](tools/filetop.py): File reads and writes by filename and process. Top for files. [Examples](tools/filetop_example.txt). - tools/[funccount](tools/funccount.py): Count kernel function calls. [Examples](tools/funccount_example.txt). +- tools/[funcinterval](tools/funcinterval.py): Time interval between the same function as a histogram. [Examples](tools/funcinterval_example.txt). - tools/[funclatency](tools/funclatency.py): Time functions and show their latency distribution. [Examples](tools/funclatency_example.txt). - tools/[funcslower](tools/funcslower.py): Trace slow kernel or user function calls. [Examples](tools/funcslower_example.txt). - tools/[gethostlatency](tools/gethostlatency.py): Show latency for getaddrinfo/gethostbyname[2] calls. [Examples](tools/gethostlatency_example.txt). @@ -125,6 +128,7 @@ pair of .c and .py files, and some are directories of files. - tools/[memleak](tools/memleak.py): Display outstanding memory allocations to find memory leaks. [Examples](tools/memleak_example.txt). - tools/[mountsnoop](tools/mountsnoop.py): Trace mount and umount syscalls system-wide. [Examples](tools/mountsnoop_example.txt). - tools/[mysqld_qslower](tools/mysqld_qslower.py): Trace MySQL server queries slower than a threshold. [Examples](tools/mysqld_qslower_example.txt). +- tools/[netqtop](tools/netqtop.py) tools/[netqtop.c](tools/netqtop.c): Trace and display packets distribution on NIC queues. [Examples](tools/netqtop_example.txt). - tools/[nfsslower](tools/nfsslower.py): Trace slow NFS operations. [Examples](tools/nfsslower_example.txt). - tools/[nfsdist](tools/nfsdist.py): Summarize NFS operation latency distribution as a histogram. [Examples](tools/nfsdist_example.txt). - tools/[offcputime](tools/offcputime.py): Summarize off-CPU time by kernel stack trace. [Examples](tools/offcputime_example.txt). @@ -133,6 +137,7 @@ pair of .c and .py files, and some are directories of files. - tools/[opensnoop](tools/opensnoop.py): Trace open() syscalls. [Examples](tools/opensnoop_example.txt). - tools/[pidpersec](tools/pidpersec.py): Count new processes (via fork). [Examples](tools/pidpersec_example.txt). - tools/[profile](tools/profile.py): Profile CPU usage by sampling stack traces at a timed interval. [Examples](tools/profile_example.txt). +- tools/[readahead](tools/readahead.py): Show performance of read-ahead cache [Examples](tools/readahead_example.txt). - tools/[reset-trace](tools/reset-trace.sh): Reset the state of tracing. Maintenance tool only. [Examples](tools/reset-trace_example.txt). - tools/[runqlat](tools/runqlat.py): Run queue (scheduler) latency as a histogram. [Examples](tools/runqlat_example.txt). - tools/[runqlen](tools/runqlen.py): Run queue length as a histogram. [Examples](tools/runqlen_example.txt). @@ -144,6 +149,7 @@ pair of .c and .py files, and some are directories of files. - tools/[solisten](tools/solisten.py): Trace TCP socket listen. [Examples](tools/solisten_example.txt). - tools/[sslsniff](tools/sslsniff.py): Sniff OpenSSL written and readed data. [Examples](tools/sslsniff_example.txt). - tools/[stackcount](tools/stackcount.py): Count kernel function calls and their stack traces. [Examples](tools/stackcount_example.txt). +- tools/[swapin](tools/swapin.py): Count swapins by process. [Examples](tools/swapin_example.txt). - tools/[syncsnoop](tools/syncsnoop.py): Trace sync() syscall. [Examples](tools/syncsnoop_example.txt). - tools/[syscount](tools/syscount.py): Summarize syscall counts and latencies. [Examples](tools/syscount_example.txt). - tools/[tcpaccept](tools/tcpaccept.py): Trace TCP passive connections (accept()). [Examples](tools/tcpaccept_example.txt). @@ -152,10 +158,13 @@ pair of .c and .py files, and some are directories of files. - tools/[tcpdrop](tools/tcpdrop.py): Trace kernel-based TCP packet drops with details. [Examples](tools/tcpdrop_example.txt). - tools/[tcplife](tools/tcplife.py): Trace TCP sessions and summarize lifespan. [Examples](tools/tcplife_example.txt). - tools/[tcpretrans](tools/tcpretrans.py): Trace TCP retransmits and TLPs. [Examples](tools/tcpretrans_example.txt). +- tools/[tcprtt](tools/tcprtt.py): Trace TCP round trip time. [Examples](tools/tcprtt_example.txt). - tools/[tcpstates](tools/tcpstates.py): Trace TCP session state changes with durations. [Examples](tools/tcpstates_example.txt). - tools/[tcpsubnet](tools/tcpsubnet.py): Summarize and aggregate TCP send by subnet. [Examples](tools/tcpsubnet_example.txt). +- tools/[tcpsynbl](tools/tcpsynbl.py): Show TCP SYN backlog. [Examples](tools/tcpsynbl_example.txt). - tools/[tcptop](tools/tcptop.py): Summarize TCP send/recv throughput by host. Top for TCP. [Examples](tools/tcptop_example.txt). - tools/[tcptracer](tools/tcptracer.py): Trace TCP established connections (connect(), accept(), close()). [Examples](tools/tcptracer_example.txt). +- tools/[threadsnoop](tools/threadsnoop.py): List new thread creation. [Examples](tools/threadsnoop_example.txt). - tools/[tplist](tools/tplist.py): Display kernel tracepoints or USDT probes and their formats. [Examples](tools/tplist_example.txt). - tools/[trace](tools/trace.py): Trace arbitrary functions, with filters. [Examples](tools/trace_example.txt). - tools/[ttysnoop](tools/ttysnoop.py): Watch live output from a tty or pts device. [Examples](tools/ttysnoop_example.txt). diff --git a/debian/changelog b/debian/changelog index 8728038f7..ce63b7f93 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,55 @@ +bcc (0.16.0-1) unstable; urgency=low + + * Support for kernel up to 5.8 + * trace.py: support kprobe/uprobe func offset + * support raw perf config for perf_event_open in python + * add BPFQueueStackTable support + * added Ringbuf support support + * libbpf-tools: readahead, biosnoop, bitesize, tcpconnlat, biopattern, biostacks + * bug fixes and some additional arguments for tools + + -- Yonghong Song Sat, 22 Aug 2020 17:00:00 +0000 + +bcc (0.15.0-1) unstable; urgency=low + + * Support for kernel up to 5.7 + * new tools: funcinterval.py, dirtop.py + * support lsm bpf programs + * support multiple pid/tids for offwaketime + * usdt: add helpers to set semaphore values + * turn off x86 jump table optimization during jit compilation + * add support to use bpf_probe_read[_str_}{_user,kernel} in all bpf + * programs, fail back to old bpf_probe_read[_str] for old kernels + * tools: add filtering by mount namespace + * libbpf-tools: cpudist, syscount, execsnoop, vfsstat + * lots of bug fixes and a few additional arguments for tools + + -- Yonghong Song Mon, 19 Jun 2020 17:00:00 +0000 + +bcc (0.14.0-1) unstable; urgency=low + + * Support for kernel up to 5.6 + * new tools: biolatpcts.py + * libbpf-tools: tools based on CORE and libbpf library directly + * add --cgroupmap to various tools, filtering based cgroup + * support kfunc (faster kprobe) for vfsstat, klockstat and opensnoop + * lots of bug fixes and a few additional arguments for tools + + -- Yonghong Song Mon, 20 Apr 2020 17:00:00 +0000 + +bcc (0.13.0-1) unstable; urgency=low + + * Support for kernel up to 5.5 + * bindsnoop tool to track tcp/udp bind information + * added compile-once run-everywhere based libbpf-tools, currently + only runqslower is implemented. + * new map support: sockhash, sockmap, sk_storage, cgroup_storage + * enable to run github actions on the diff + * cgroupmap based cgroup filtering for opensnoop, execsnoop and bindsnoop. + * lots of bug fixes. + + -- Yonghong Song Wed, 19 Feb 2020 17:00:00 +0000 + bcc (0.12.0-1) unstable; urgency=low * Support for kernel up to 5.4 diff --git a/debian/control b/debian/control index 272b9b965..bb799173a 100644 --- a/debian/control +++ b/debian/control @@ -4,12 +4,12 @@ Section: misc Priority: optional Standards-Version: 3.9.5 Build-Depends: debhelper (>= 9), cmake, - libllvm3.7 [!arm64] | libllvm3.8 [!arm64] | libllvm6.0, - llvm-3.7-dev [!arm64] | llvm-3.8-dev [!arm64] | llvm-6.0-dev, - libclang-3.7-dev [!arm64] | libclang-3.8-dev [!arm64] | libclang-6.0-dev, - clang-format | clang-format-3.7 [!arm64] | clang-format-3.8 [!arm64] | clang-format-6.0, + libllvm9 | libllvm8.0 | libllvm6.0 | libllvm3.8 [!arm64] | libllvm3.7 [!arm64], + llvm-9-dev | llvm-8.0-dev | llvm-6.0-dev | llvm-3.8-dev [!arm64] | llvm-3.7-dev [!arm64], + libclang-9-dev | libclang-8.0-dev | libclang-6.0-dev | libclang-3.8-dev [!arm64] | libclang-3.7-dev [!arm64], + clang-format-9 | clang-format-8.0 | clang-format-6.0 | clang-format-3.8 [!arm64] | clang-format-3.7 [!arm64] | clang-format, libelf-dev, bison, flex, libfl-dev, libedit-dev, zlib1g-dev, git, - python (>= 2.7), python-netaddr, python-pyroute2, luajit, + python (>= 2.7), python-netaddr, python-pyroute2 | python3-pyroute2, luajit, libluajit-5.1-dev, arping, inetutils-ping | iputils-ping, iperf, netperf, ethtool, devscripts, python3, dh-python Homepage: https://github.com/iovisor/bcc diff --git a/docs/kernel-versions.md b/docs/kernel-versions.md index 8732ddb60..288fb0772 100644 --- a/docs/kernel-versions.md +++ b/docs/kernel-versions.md @@ -24,6 +24,8 @@ Sparc64 | 4.12 | [`7a12b5031c6b`](https://git.kernel.org/cgit/linux/kernel/git/t MIPS | 4.13 | [`f381bf6d82f0`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=f381bf6d82f032b7410185b35d000ea370ac706b) ARM32 | 4.14 | [`39c13c204bb1`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=39c13c204bb1150d401e27d41a9d8b332be47c49) x86\_32 | 4.18 | [`03f5781be2c7`](https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=03f5781be2c7b7e728d724ac70ba10799cc710d7) +RISC-V RV64G | 5.1 | [`2353ecc6f91f`](https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=2353ecc6f91fd15b893fa01bf85a1c7a823ee4f2) +RISC-V RV32G | 5.7 | [`5f316b65e99f`](https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=5f316b65e99f109942c556dc8790abd4c75bcb34) ## Main features @@ -78,9 +80,12 @@ BPF flow dissector | 4.20 | [`d58e468b1112`](https://github.com/torvalds/linux/c BPF cgroup sysctl | 5.2 | [`7b146cebe30c`](https://github.com/torvalds/linux/commit/7b146cebe30cb481b0f70d85779da938da818637) BPF raw tracepoint writable | 5.2 | [`9df1c28bb752`](https://github.com/torvalds/linux/commit/9df1c28bb75217b244257152ab7d788bb2a386d0) BPF trampoline | 5.5 | [`fec56f5890d9`](https://github.com/torvalds/linux/commit/fec56f5890d93fc2ed74166c397dc186b1c25951) +BPF LSM hook | 5.7 | [`fc611f47f218`](https://github.com/torvalds/linux/commit/fc611f47f2188ade2b48ff6902d5cce8baac0c58) [`641cd7b06c91`](https://github.com/torvalds/linux/commit/641cd7b06c911c5935c34f24850ea18690649917) ## Tables (_a.k.a._ Maps) +### Table types + The list of map types supported in your kernel can be found in file [`include/uapi/linux/bpf.h`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/bpf.h): @@ -95,14 +100,13 @@ Perf events | 4.3 | [`ea317b267e9d`](https://git.kernel.org/cgit/linux/kernel/gi Per-CPU hash | 4.6 | [`824bd0ce6c7c`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=824bd0ce6c7c43a9e1e210abf124958e54d88342) Per-CPU array | 4.6 | [`a10423b87a7e`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a10423b87a7eae75da79ce80a8d9475047a674ee) Stack trace | 4.6 | [`d5a3b1f69186`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d5a3b1f691865be576c2bffa708549b8cdccda19) -Pre-alloc maps memory | 4.6 | [`6c9059817432`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6c90598174322b8888029e40dd84a4eb01f56afe) cgroup array | 4.8 | [`4ed8ec521ed5`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4ed8ec521ed57c4e207ad464ca0388776de74d4b) LRU hash | 4.10 | [`29ba732acbee`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=29ba732acbeece1e34c68483d1ec1f3720fa1bb3) [`3a08c2fd7634`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=3a08c2fd763450a927d1130de078d6f9e74944fb) LRU per-CPU hash | 4.10 | [`8f8449384ec3`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=8f8449384ec364ba2a654f11f94e754e4ff719e0) [`961578b63474`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=961578b63474d13ad0e2f615fcc2901c5197dda6) LPM trie (longest-prefix match) | 4.11 | [`b95a5c4db09b`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b95a5c4db09bc7c253636cb84dc9b12c577fd5a0) Array of maps | 4.12 | [`56f668dfe00d`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=56f668dfe00dcf086734f1c42ea999398fad6572) Hash of maps | 4.12 | [`bcc6b1b7ebf8`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=bcc6b1b7ebf857a9fe56202e2be3361131588c15) -Netdevice references | 4.14 | [`546ac1ffb70d`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=546ac1ffb70d25b56c1126940e5ec639c4dd7413) +Netdevice references (array) | 4.14 | [`546ac1ffb70d`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=546ac1ffb70d25b56c1126940e5ec639c4dd7413) Socket references (array) | 4.14 | [`174a79ff9515`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=174a79ff9515f400b9a6115643dafd62a635b7e6) CPU references | 4.15 | [`6710e1126934`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6710e1126934d8b4372b4d2f9ae1646cd3f151bf) AF_XDP socket (XSK) references | 4.18 | [`fbfc504a24f5`](https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=fbfc504a24f53f7ebe128ab55cb5dba634f4ece8) @@ -113,6 +117,36 @@ precpu cgroup storage | 4.20 | [`b741f1630346`](https://github.com/torvalds/linu queue | 4.20 | [`f1a2e44a3aec`](https://github.com/torvalds/linux/commit/f1a2e44a3aeccb3ff18d3ccc0b0203e70b95bd92) stack | 4.20 | [`f1a2e44a3aec`](https://github.com/torvalds/linux/commit/f1a2e44a3aeccb3ff18d3ccc0b0203e70b95bd92) socket local storage | 5.2 | [`6ac99e8f23d4`](https://github.com/torvalds/linux/commit/6ac99e8f23d4b10258406ca0dd7bffca5f31da9d) +Netdevice references (hashmap) | 5.4 | [`6f9d451ab1a3`](https://github.com/torvalds/linux/commit/6f9d451ab1a33728adb72d7ff66a7b374d665176) +struct ops | 5.6 | [`85d33df357b6`](https://github.com/torvalds/linux/commit/85d33df357b634649ddbe0a20fd2d0fc5732c3cb) +ring buffer | 5.8 | [`457f44363a88`](https://github.com/torvalds/linux/commit/457f44363a8894135c85b7a9afd2bd8196db24ab) + +### Table userspace API + +Some (but not all) of these *API features* translate to a subcommand beginning with `BPF_MAP_`. +The list of subcommands supported in your kernel can be found in file +[`include/uapi/linux/bpf.h`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/bpf.h): + + git grep -W 'bpf_cmd {' include/uapi/linux/bpf.h + +Feature | Kernel version | Commit +--------|----------------|------- +Basic operations (lookup, update, delete, `GET_NEXT_KEY`) | 3.18 | [`db20fd2b0108`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=db20fd2b01087bdfbe30bce314a198eefedcc42e) +Pass flags to `UPDATE_ELEM` | 3.19 | [`3274f52073d8`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3274f52073d88b62f3c5ace82ae9d48546232e72) +Pre-alloc map memory by default | 4.6 | [`6c9059817432`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6c90598174322b8888029e40dd84a4eb01f56afe) +Pass `NULL` to `GET_NEXT_KEY` | 4.12 | [`8fe45924387b`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8fe45924387be6b5c1be59a7eb330790c61d5d10) +Creation: select NUMA node | 4.14 | [`96eabe7a40aa`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=96eabe7a40aa17e613cf3db2c742ee8b1fc764d0) +Restrict access from syscall side | 4.15 | [`6e71b04a8224`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6e71b04a82248ccf13a94b85cbc674a9fefe53f5) +Creation: specify map name | 4.15 | [`ad5b177bd73f`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ad5b177bd73f5107d97c36f56395c4281fb6f089) +`LOOKUP_AND_DELETE_ELEM` | 4.20 | [`bd513cd08f10`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bd513cd08f10cbe28856f99ae951e86e86803861) +Creation: `BPF_F_ZERO_SEED` | 5.0 | [`96b3b6c9091d`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=96b3b6c9091d23289721350e32c63cc8749686be) +`BPF_F_LOCK` flag for lookup / update | 5.1 | [`96049f3afd50`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=96049f3afd50fe8db69fa0068cdca822e747b1e4) +Restrict access from BPF side | 5.2 | [`591fe9888d78`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=591fe9888d7809d9ee5c828020b6c6ae27c37229) +`FREEZE` | 5.2 | [`87df15de441b`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=87df15de441bd4add7876ef584da8cabdd9a042a) +mmap() support for array maps | 5.5 | [`fc9702273e2e`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fc9702273e2edb90400a34b3be76f7b08fa3344b) +`LOOKUP_BATCH` | 5.6 | [`cb4d03ab499d`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cb4d03ab499d4c040f4ab6fd4389d2b49f42b5a5) +`UPDATE_BATCH`, `DELETE_BATCH` | 5.6 | [`aa2e93b8e58e`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=aa2e93b8e58e18442edfb2427446732415bc215e) +`LOOKUP_AND_DELETE_BATCH` | 5.6 | [`057996380a42`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=057996380a42bb64ccc04383cfa9c0ace4ea11f0) ## XDP @@ -145,6 +179,11 @@ Intel `ixgbevf` driver | 4.17 | [`c7aec59657b6`](https://git.kernel.org/cgit/lin Freescale `dpaa2` driver | 5.0 | [`7e273a8ebdd3`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7e273a8ebdd3b83f94eb8b49fc8ee61464f47cc2) Socionext `netsec` driver | 5.3 | [`ba2b232108d3`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ba2b232108d3c2951bab02930a00f23b0cffd5af) TI `cpsw` driver | 5.3 | [`9ed4050c0d75`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9ed4050c0d75768066a07cf66eef4f8dc9d79b52) +Intel `ice` driver |5.5| [`efc2214b6047`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=efc2214b6047b6f5b4ca53151eba62521b9452d6) +Solarflare `sfc` driver | 5.5 | [`eb9a36be7f3e`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=eb9a36be7f3ec414700af9a616f035eda1f1e63e) +Marvell `mvneta` driver | 5.5 | [`0db51da7a8e9`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=0db51da7a8e99f0803ec3a8e25c1a66234a219cb) +Microsoft `hv_netvsc` driver | 5.6 | [`351e1581395f`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=351e1581395fcc7fb952bbd7dda01238f69968fd) +Amazon `ena` driver | 5.6 | [`838c93dc5449`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=838c93dc5449e5d6378bae117b0a65a122cf7361) Intel `e1000` driver | | [Not upstream yet](https://git.kernel.org/pub/scm/linux/kernel/git/ast/bpf.git/commit/?h=xdp&id=0afee87cfc800bf3317f4dc8847e6f36539b820c) Intel `e1000e` driver | | [Not planned for upstream at this time](https://github.com/adjavon/e1000e_xdp) @@ -159,12 +198,16 @@ Alphabetical order Helper | Kernel version | License | Commit | -------|----------------|---------|--------| -`BPF_FUNC_bind()` | 4.17 | | [`d74bad4e74ee`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d74bad4e74ee373787a9ae24197c17b7cdc428d5) | +`BPF_FUNC_bind()` | 4.17 | | [`d74bad4e74ee`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d74bad4e74ee373787a9ae24197c17b7cdc428d5) | `BPF_FUNC_clone_redirect()` | 4.2 | | [`3896d655f4d4`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=3896d655f4d491c67d669a15f275a39f713410f8) +`BPF_FUNC_copy_from_user()` | 5.10 | | [`07be4c4a3e7a`](https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit?id=07be4c4a3e7a0db148e44b16c5190e753d1c8569) `BPF_FUNC_csum_diff()` | 4.6 | | [`7d672345ed29`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7d672345ed295b1356a5d9f7111da1d1d7d65867) +`BPF_FUNC_csum_level()` | 5.7 | | [`7cdec54f9713`](https://github.com/torvalds/linux/commit/7cdec54f9713256bb170873a1fc5c75c9127c9d2) `BPF_FUNC_csum_update()` | 4.9 | | [`36bbef52c7eb`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=36bbef52c7eb646ed6247055a2acd3851e317857) `BPF_FUNC_current_task_under_cgroup()` | 4.9 | | [`60d20f9195b2`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=60d20f9195b260bdf0ac10c275ae9f6016f9c069) +`BPF_FUNC_d_path()` | 5.10 | | [`6e22ab9da793`](https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit?id=6e22ab9da79343532cd3cde39df25e5a5478c692) `BPF_FUNC_fib_lookup()` | 4.18 | GPL | [`87f5fc7e48dd`](https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=87f5fc7e48dd3175b30dd03b41564e1a8e136323) +`BPF_FUNC_get_current_ancestor_cgroup_id()` | 5.6 | | [`b4490c5c4e02`](https://github.com/torvalds/linux/commit/b4490c5c4e023f09b7d27c9a9d3e7ad7d09ea6bf) `BPF_FUNC_get_cgroup_classid()` | 4.3 | | [`8d20aabe1c76`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=8d20aabe1c76cccac544d9fcc3ad7823d9e98a2d) `BPF_FUNC_get_current_cgroup_id()` | 4.18 | | [`bf6fa2c893c5`](https://github.com/torvalds/linux/commit/bf6fa2c893c5237b48569a13fa3c673041430b6c) `BPF_FUNC_get_current_comm()` | 4.2 | | [`ffeedafbf023`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ffeedafbf0236f03aeb2e8db273b3e5ae5f5bc89) @@ -174,6 +217,8 @@ Helper | Kernel version | License | Commit | `BPF_FUNC_get_hash_recalc()` | 4.8 | | [`13c5c240f789`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=13c5c240f789bbd2bcacb14a23771491485ae61f) `BPF_FUNC_get_listener_sock()` | 5.1 | | [`dbafd7ddd623`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/davem/net-next/+/dbafd7ddd62369b2f3926ab847cbf8fc40e800b7) `BPF_FUNC_get_local_storage()` | 4.19 | | [`cd3394317653`](https://github.com/torvalds/linux/commit/cd3394317653837e2eb5c5d0904a8996102af9fc) +`BPF_FUNC_get_netns_cookie()` | 5.6 | | [`b4490c5c4e02`](https://github.com/torvalds/linux/commit/b4490c5c4e023f09b7d27c9a9d3e7ad7d09ea6bf) +`BPF_FUNC_get_ns_current_pid_tgid()` | 5.6 | | [`b4490c5c4e02`](https://github.com/torvalds/linux/commit/b4490c5c4e023f09b7d27c9a9d3e7ad7d09ea6bf) `BPF_FUNC_get_numa_node_id()` | 4.10 | | [`2d0e30c30f84`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2d0e30c30f84d08dc16f0f2af41f1b8a85f0755e) `BPF_FUNC_get_prandom_u32()` | 4.1 | | [`03e69b508b6f`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=03e69b508b6f7c51743055c9f61d1dfeadf4b635) `BPF_FUNC_get_route_realm()` | 4.4 | | [`c46646d0484f`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c46646d0484f5d08e2bede9b45034ba5b8b489cc) @@ -182,11 +227,16 @@ Helper | Kernel version | License | Commit | `BPF_FUNC_get_socket_uid()` | 4.12 | | [`6acc5c291068`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6acc5c2910689fc6ee181bf63085c5efff6a42bd) `BPF_FUNC_get_stack()` | 4.18 | GPL | [`de2ff05f48af`](https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=de2ff05f48afcde816ff4edb217417f62f624ab5) `BPF_FUNC_get_stackid()` | 4.6 | GPL | [`d5a3b1f69186`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d5a3b1f691865be576c2bffa708549b8cdccda19) +`BPF_FUNC_get_task_stack()` | 5.9 | | [`fa28dcb82a38`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next/+/fa28dcb82a38f8e3993b0fae9106b1a80b59e4f0) `BPF_FUNC_getsockopt()` | 4.15 | | [`cd86d1fd2102`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=cd86d1fd21025fdd6daf23d1288da405e7ad0ec6) +`BPF_FUNC_inode_storage_delete()` | 5.10 | | [`8ea636848aca`](https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit?id=8ea636848aca35b9f97c5b5dee30225cf2dd0fe6) +`BPF_FUNC_inode_storage_get()` | 5.10 | | [`8ea636848aca`](https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit?id=8ea636848aca35b9f97c5b5dee30225cf2dd0fe6) `BPF_FUNC_jiffies64()` | 5.5 | | [`5576b991e9c1`](https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=5576b991e9c1a11d2cc21c4b94fc75ec27603896) +`BPF_FUNC_ktime_get_boot_ns()` | 5.7 | GPL | [`71d19214776e`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next/+/71d19214776e61b33da48f7c1b46e522c7f78221) `BPF_FUNC_ktime_get_ns()` | 4.1 | GPL | [`d9847d310ab4`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d9847d310ab4003725e6ed1822682e24bd406908) `BPF_FUNC_l3_csum_replace()` | 4.1 | | [`91bc4822c3d6`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=91bc4822c3d61b9bb7ef66d3b77948a4f9177954) `BPF_FUNC_l4_csum_replace()` | 4.1 | | [`91bc4822c3d6`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=91bc4822c3d61b9bb7ef66d3b77948a4f9177954) +`BPF_FUNC_load_hdr_opt()` | 5.10 | | [`0813a841566f`](https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit?id=0813a841566f0962a5551be7749b43c45f0022a0) `BPF_FUNC_lwt_push_encap()` | 4.18 | | [`fe94cc290f53`](https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=fe94cc290f535709d3c5ebd1e472dfd0aec7ee79) `BPF_FUNC_lwt_seg6_action()` | 4.18 | | [`fe94cc290f53`](https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=fe94cc290f535709d3c5ebd1e472dfd0aec7ee79) `BPF_FUNC_lwt_seg6_adjust_srh()` | 4.18 | | [`fe94cc290f53`](https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=fe94cc290f535709d3c5ebd1e472dfd0aec7ee79) @@ -218,13 +268,27 @@ Helper | Kernel version | License | Commit | `BPF_FUNC_rc_keydown()` | 4.18 | GPL | [`f4364dcfc86d`](https://git.kernel.org/cgit/linux/kernel/git/bpf/bpf-next.git/commit/?id=f4364dcfc86df7c1ca47b256eaf6b6d0cdd0d936) `BPF_FUNC_rc_pointer_rel()` | 5.0 | GPL | [`01d3240a04f4`](https://github.com/torvalds/linux/commit/01d3240a04f4c09392e13c77b54d4423ebce2d72) `BPF_FUNC_rc_repeat()` | 4.18 | GPL | [`f4364dcfc86d`](https://git.kernel.org/cgit/linux/kernel/git/bpf/bpf-next.git/commit/?id=f4364dcfc86df7c1ca47b256eaf6b6d0cdd0d936) +`BPF_FUNC_read_branch_records()` | 5.6 | GPL | [`fff7b64355ea`](https://github.com/torvalds/linux/commit/fff7b64355eac6e29b50229ad1512315bc04b44e) `BPF_FUNC_redirect()` | 4.4 | | [`27b29f63058d`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=27b29f63058d26c6c1742f1993338280d5a41dc6) `BPF_FUNC_redirect_map()` | 4.14 | | [`97f91a7cf04f`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=97f91a7cf04ff605845c20948b8a80e54cbd3376) +`BPF_FUNC_redirect_neigh()` | 5.10 | | [`b4ab31414970`](https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=b4ab31414970a7a03a5d55d75083f2c101a30592) +`BPF_FUNC_reserve_hdr_opt()` | 5.10 | | [`0813a841566f`](https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit?id=0813a841566f0962a5551be7749b43c45f0022a0) +`BPF_FUNC_ringbuf_discard()` | 5.8 | | [`457f44363a88`](https://github.com/torvalds/linux/commit/457f44363a8894135c85b7a9afd2bd8196db24ab) +`BPF_FUNC_ringbuf_output()` | 5.8 | | [`457f44363a88`](https://github.com/torvalds/linux/commit/457f44363a8894135c85b7a9afd2bd8196db24ab) +`BPF_FUNC_ringbuf_query()` | 5.8 | | [`457f44363a88`](https://github.com/torvalds/linux/commit/457f44363a8894135c85b7a9afd2bd8196db24ab) +`BPF_FUNC_ringbuf_reserve()` | 5.8 | | [`457f44363a88`](https://github.com/torvalds/linux/commit/457f44363a8894135c85b7a9afd2bd8196db24ab) +`BPF_FUNC_ringbuf_submit()` | 5.8 | | [`457f44363a88`](https://github.com/torvalds/linux/commit/457f44363a8894135c85b7a9afd2bd8196db24ab) `BPF_FUNC_send_signal()` | 5.3 | | [`8b401f9ed244`](https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=8b401f9ed2441ad9e219953927a842d24ed051fc) `BPF_FUNC_send_signal_thread()` | 5.5 | | [`8482941f0906`](https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=8482941f09067da42f9c3362e15bfb3f3c19d610) +`BPF_FUNC_seq_printf()` | 5.7 | GPL | [`492e639f0c22`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next/+/492e639f0c222784e2e0f121966375f641c61b15) +`BPF_FUNC_seq_printf_btf()` | 5.10 | | [`eb411377aed9`](https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=eb411377aed9e27835e77ee0710ee8f4649958f3) +`BPF_FUNC_seq_write()` | 5.7 | GPL | [`492e639f0c22`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next/+/492e639f0c222784e2e0f121966375f641c61b15) `BPF_FUNC_set_hash()` | 4.13 | | [`ded092cd73c2`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ded092cd73c2c56a394b936f86897f29b2e131c0) `BPF_FUNC_set_hash_invalid()` | 4.9 | | [`7a4b28c6cc9f`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7a4b28c6cc9ffac50f791b99cc7e46106436e5d8) `BPF_FUNC_setsockopt()` | 4.13 | | [`8c4b4c7e9ff0`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=8c4b4c7e9ff0447995750d9329949fa082520269) +`BPF_FUNC_sk_ancestor_cgroup_id()` | 5.7 | | [`f307fa2cb4c9`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next/+/f307fa2cb4c935f7f1ff0aeb880c7b44fb9a642b) +`BPF_FUNC_sk_assign()` | 5.6 | | [`cf7fbe660f2d`](https://github.com/torvalds/linux/commit/cf7fbe660f2dbd738ab58aea8e9b0ca6ad232449) +`BPF_FUNC_sk_cgroup_id()` | 5.7 | | [`f307fa2cb4c9`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next/+/f307fa2cb4c935f7f1ff0aeb880c7b44fb9a642b) `BPF_FUNC_sk_fullsock()` | 5.1 | | [`46f8bc92758c`](https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=46f8bc92758c6259bcf945e9216098661c1587cd) `BPF_FUNC_sk_lookup_tcp()` | 4.20 | | [`6acc9b432e67`](https://github.com/torvalds/linux/commit/6acc9b432e6714d72d7d77ec7c27f6f8358d0c71) `BPF_FUNC_sk_lookup_udp()` | 4.20 | | [`6acc9b432e67`](https://github.com/torvalds/linux/commit/6acc9b432e6714d72d7d77ec7c27f6f8358d0c71) @@ -240,6 +304,7 @@ Helper | Kernel version | License | Commit | `BPF_FUNC_skb_change_proto()` | 4.8 | | [`6578171a7ff0`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6578171a7ff0c31dc73258f93da7407510abf085) `BPF_FUNC_skb_change_tail()` | 4.9 | | [`5293efe62df8`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5293efe62df81908f2e90c9820c7edcc8e61f5e9) `BPF_FUNC_skb_change_type()` | 4.8 | | [`d2485c4242a8`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d2485c4242a826fdf493fd3a27b8b792965b9b9e) +`BPF_FUNC_skb_cgroup_classid()` | 5.10 | | [`b426ce83baa7`](https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=b426ce83baa7dff947fb354118d3133f2953aac8) `BPF_FUNC_skb_cgroup_id()` | 4.18 | | [`cb20b08ead40`](https://github.com/torvalds/linux/commit/cb20b08ead401fd17627a36f035c0bf5bfee5567) `BPF_FUNC_skb_ecn_set_ce()` | 5.1 | | [`f7c917ba11a6`](https://github.com/torvalds/linux/commit/f7c917ba11a67632a8452ea99fe132f626a7a2cc) `BPF_FUNC_skb_get_tunnel_key()` | 4.3 | | [`d3aa45ce6b94`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d3aa45ce6b94c65b83971257317867db13e5f492) @@ -256,10 +321,17 @@ Helper | Kernel version | License | Commit | `BPF_FUNC_skb_vlan_pop()` | 4.3 | | [`4e10df9a60d9`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4e10df9a60d96ced321dd2af71da558c6b750078) `BPF_FUNC_skb_vlan_push()` | 4.3 | | [`4e10df9a60d9`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4e10df9a60d96ced321dd2af71da558c6b750078) `BPF_FUNC_skc_lookup_tcp()` | 5.2 | | [`edbf8c01de5a`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/davem/net-next/+/edbf8c01de5a104a71ed6df2bf6421ceb2836a8e) +`BPF_FUNC_skc_to_tcp_sock()` | 5.9 | | [`478cfbdf5f13`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next/+/478cfbdf5f13dfe09cfd0b1cbac821f5e27f6108) +`BPF_FUNC_skc_to_tcp_request_sock()` | 5.9 | | [`478cfbdf5f13`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next/+/478cfbdf5f13dfe09cfd0b1cbac821f5e27f6108) +`BPF_FUNC_skc_to_tcp_timewait_sock()` | 5.9 | | [`478cfbdf5f13`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next/+/478cfbdf5f13dfe09cfd0b1cbac821f5e27f6108) +`BPF_FUNC_skc_to_tcp6_sock()` | 5.9 | | [`af7ec1383361`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next/+/af7ec13833619e17f03aa73a785a2f871da6d66b) +`BPF_FUNC_skc_to_udp6_sock()` | 5.9 | | [`0d4fad3e57df`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next/+/0d4fad3e57df2bf61e8ffc8d12a34b1caf9b8835) +`BPF_FUNC_snprintf_btf()` | 5.10 | | [`c4d0bfb45068`](https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=c4d0bfb45068d853a478b9067a95969b1886a30f) `BPF_FUNC_sock_hash_update()` | 4.18 | | [`81110384441a`](https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=81110384441a59cff47430f20f049e69b98c17f4) `BPF_FUNC_sock_map_update()` | 4.14 | | [`174a79ff9515`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=174a79ff9515f400b9a6115643dafd62a635b7e6) `BPF_FUNC_spin_lock()` | 5.1 | | [`d83525ca62cf`](https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=d83525ca62cf8ebe3271d14c36fb900c294274a2) `BPF_FUNC_spin_unlock()` | 5.1 | | [`d83525ca62cf`](https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=d83525ca62cf8ebe3271d14c36fb900c294274a2) +`BPF_FUNC_store_hdr_opt()` | 5.10 | | [`0813a841566f`](https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit?id=0813a841566f0962a5551be7749b43c45f0022a0) `BPF_FUNC_strtol()` | 5.2 | | [`d7a4cb9b6705`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/davem/net-next/+/d7a4cb9b6705a89937d12c8158a35a3145dc967a) `BPF_FUNC_strtoul()` | 5.2 | | [`d7a4cb9b6705`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/davem/net-next/+/d7a4cb9b6705a89937d12c8158a35a3145dc967a) `BPF_FUNC_sysctl_get_current_value()` | 5.2 | | [`1d11b3016cec`](https://kernel.googlesource.com/pub/scm/linux/kernel/git/davem/net-next/+/1d11b3016cec4ed9770b98e82a61708c8f4926e7) @@ -275,6 +347,7 @@ Helper | Kernel version | License | Commit | `BPF_FUNC_xdp_adjust_head()` | 4.10 | | [`17bedab27231`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=17bedab2723145d17b14084430743549e6943d03) `BPF_FUNC_xdp_adjust_meta()` | 4.15 | | [`de8f3a83b0a0`](https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=de8f3a83b0a0fddb2cf56e7a718127e9619ea3da) `BPF_FUNC_xdp_adjust_tail()` | 4.18 | | [`b32cc5b9a346`](https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=b32cc5b9a346319c171e3ad905e0cddda032b5eb) +`BPF_FUNC_xdp_output()` | 5.6 | GPL | [`d831ee84bfc9`](https://github.com/torvalds/linux/commit/d831ee84bfc9173eecf30dbbc2553ae81b996c60) `BPF_FUNC_override_return()` | 4.16 | GPL | [`9802d86585db`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9802d86585db91655c7d1929a4f6bbe0952ea88e) `BPF_FUNC_sock_ops_cb_flags_set()` | 4.16 | | [`b13d88072172`](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b13d880721729384757f235166068c315326f4a1) @@ -299,7 +372,7 @@ The list of program types and supported helper functions can be retrieved with: |`BPF_PROG_TYPE_SOCKET_FILTER`|`BPF_FUNC_skb_load_bytes()`
`BPF_FUNC_skb_load_bytes_relative()`
`BPF_FUNC_get_socket_cookie()`
`BPF_FUNC_get_socket_uid()`
`BPF_FUNC_perf_event_output()`
`Base functions`| |`BPF_PROG_TYPE_KPROBE`|`BPF_FUNC_perf_event_output()`
`BPF_FUNC_get_stackid()`
`BPF_FUNC_get_stack()`
`BPF_FUNC_perf_event_read_value()`
`BPF_FUNC_override_return()`
`Tracing functions`| |`BPF_PROG_TYPE_SCHED_CLS`
`BPF_PROG_TYPE_SCHED_ACT`|`BPF_FUNC_skb_store_bytes()`
`BPF_FUNC_skb_load_bytes()`
`BPF_FUNC_skb_load_bytes_relative()`
`BPF_FUNC_skb_pull_data()`
`BPF_FUNC_csum_diff()`
`BPF_FUNC_csum_update()`
`BPF_FUNC_l3_csum_replace()`
`BPF_FUNC_l4_csum_replace()`
`BPF_FUNC_clone_redirect()`
`BPF_FUNC_get_cgroup_classid()`
`BPF_FUNC_skb_vlan_push()`
`BPF_FUNC_skb_vlan_pop()`
`BPF_FUNC_skb_change_proto()`
`BPF_FUNC_skb_change_type()`
`BPF_FUNC_skb_adjust_room()`
`BPF_FUNC_skb_change_tail()`
`BPF_FUNC_skb_get_tunnel_key()`
`BPF_FUNC_skb_set_tunnel_key()`
`BPF_FUNC_skb_get_tunnel_opt()`
`BPF_FUNC_skb_set_tunnel_opt()`
`BPF_FUNC_redirect()`
`BPF_FUNC_get_route_realm()`
`BPF_FUNC_get_hash_recalc()`
`BPF_FUNC_set_hash_invalid()`
`BPF_FUNC_set_hash()`
`BPF_FUNC_perf_event_output()`
`BPF_FUNC_get_smp_processor_id()`
`BPF_FUNC_skb_under_cgroup()`
`BPF_FUNC_get_socket_cookie()`
`BPF_FUNC_get_socket_uid()`
`BPF_FUNC_fib_lookup()`
`BPF_FUNC_skb_get_xfrm_state()`
`BPF_FUNC_skb_cgroup_id()`
`Base functions`| -|`BPF_PROG_TYPE_TRACEPOINT`|`BPF_FUNC_perf_event_output()`
`BPF_FUNC_get_stackid()`
`BPF_FUNC_get_stack()`
`Tracing functions`| +|`BPF_PROG_TYPE_TRACEPOINT`|`BPF_FUNC_perf_event_output()`
`BPF_FUNC_get_stackid()`
`BPF_FUNC_get_stack()`
`BPF_FUNC_d_path()`
`Tracing functions`| |`BPF_PROG_TYPE_XDP`| `BPF_FUNC_perf_event_output()`
`BPF_FUNC_get_smp_processor_id()`
`BPF_FUNC_csum_diff()`
`BPF_FUNC_xdp_adjust_head()`
`BPF_FUNC_xdp_adjust_meta()`
`BPF_FUNC_redirect()`
`BPF_FUNC_redirect_map()`
`BPF_FUNC_xdp_adjust_tail()`
`BPF_FUNC_fib_lookup()`
`Base functions`| |`BPF_PROG_TYPE_PERF_EVENT`| `BPF_FUNC_perf_event_output()`
`BPF_FUNC_get_stackid()`
`BPF_FUNC_get_stack()`
`BPF_FUNC_perf_prog_read_value()`
`Tracing functions`| |`BPF_PROG_TYPE_CGROUP_SKB`|`BPF_FUNC_skb_load_bytes()`
`BPF_FUNC_skb_load_bytes_relative()`
`BPF_FUNC_get_socket_cookie()`
`BPF_FUNC_get_socket_uid()`
`Base functions`| @@ -320,6 +393,6 @@ The list of program types and supported helper functions can be retrieved with: |Function Group| Functions| |------------------|-------| -|`Base functions`| `BPF_FUNC_map_lookup_elem()`
`BPF_FUNC_map_update_elem()`
`BPF_FUNC_map_delete_elem()`
`BPF_FUNC_map_peek_elem()`
`BPF_FUNC_map_pop_elem()`
`BPF_FUNC_map_push_elem()`
`BPF_FUNC_get_prandom_u32()`
`BPF_FUNC_get_smp_processor_id()`
`BPF_FUNC_get_numa_node_id()`
`BPF_FUNC_tail_call()`
`BPF_FUNC_ktime_get_ns()`
`BPF_FUNC_trace_printk()`
`BPF_FUNC_spin_lock()`
`BPF_FUNC_spin_unlock()` | -|`Tracing functions`|`BPF_FUNC_map_lookup_elem()`
`BPF_FUNC_map_update_elem()`
`BPF_FUNC_map_delete_elem()`
`BPF_FUNC_probe_read()`
`BPF_FUNC_ktime_get_ns()`
`BPF_FUNC_tail_call()`
`BPF_FUNC_get_current_pid_tgid()`
`BPF_FUNC_get_current_task()`
`BPF_FUNC_get_current_uid_gid()`
`BPF_FUNC_get_current_comm()`
`BPF_FUNC_trace_printk()`
`BPF_FUNC_get_smp_processor_id()`
`BPF_FUNC_get_numa_node_id()`
`BPF_FUNC_perf_event_read()`
`BPF_FUNC_probe_write_user()`
`BPF_FUNC_current_task_under_cgroup()`
`BPF_FUNC_get_prandom_u32()`
`BPF_FUNC_probe_read_str()`
`BPF_FUNC_get_current_cgroup_id()`
`BPF_FUNC_send_signal()`
`BPF_FUNC_probe_read_kernel()`
`BPF_FUNC_probe_read_kernel_str()`
`BPF_FUNC_probe_read_user()`
`BPF_FUNC_probe_read_user_str()`
`BPF_FUNC_send_signal_thread()`| +|`Base functions`| `BPF_FUNC_map_lookup_elem()`
`BPF_FUNC_map_update_elem()`
`BPF_FUNC_map_delete_elem()`
`BPF_FUNC_map_peek_elem()`
`BPF_FUNC_map_pop_elem()`
`BPF_FUNC_map_push_elem()`
`BPF_FUNC_get_prandom_u32()`
`BPF_FUNC_get_smp_processor_id()`
`BPF_FUNC_get_numa_node_id()`
`BPF_FUNC_tail_call()`
`BPF_FUNC_ktime_get_boot_ns()`
`BPF_FUNC_ktime_get_ns()`
`BPF_FUNC_trace_printk()`
`BPF_FUNC_spin_lock()`
`BPF_FUNC_spin_unlock()` | +|`Tracing functions`|`BPF_FUNC_map_lookup_elem()`
`BPF_FUNC_map_update_elem()`
`BPF_FUNC_map_delete_elem()`
`BPF_FUNC_probe_read()`
`BPF_FUNC_ktime_get_boot_ns()`
`BPF_FUNC_ktime_get_ns()`
`BPF_FUNC_tail_call()`
`BPF_FUNC_get_current_pid_tgid()`
`BPF_FUNC_get_current_task()`
`BPF_FUNC_get_current_uid_gid()`
`BPF_FUNC_get_current_comm()`
`BPF_FUNC_trace_printk()`
`BPF_FUNC_get_smp_processor_id()`
`BPF_FUNC_get_numa_node_id()`
`BPF_FUNC_perf_event_read()`
`BPF_FUNC_probe_write_user()`
`BPF_FUNC_current_task_under_cgroup()`
`BPF_FUNC_get_prandom_u32()`
`BPF_FUNC_probe_read_str()`
`BPF_FUNC_get_current_cgroup_id()`
`BPF_FUNC_send_signal()`
`BPF_FUNC_probe_read_kernel()`
`BPF_FUNC_probe_read_kernel_str()`
`BPF_FUNC_probe_read_user()`
`BPF_FUNC_probe_read_user_str()`
`BPF_FUNC_send_signal_thread()`
`BPF_FUNC_get_ns_current_pid_tgid()`
`BPF_FUNC_xdp_output()`
`BPF_FUNC_get_task_stack()`| |`LWT functions`| `BPF_FUNC_skb_load_bytes()`
`BPF_FUNC_skb_pull_data()`
`BPF_FUNC_csum_diff()`
`BPF_FUNC_get_cgroup_classid()`
`BPF_FUNC_get_route_realm()`
`BPF_FUNC_get_hash_recalc()`
`BPF_FUNC_perf_event_output()`
`BPF_FUNC_get_smp_processor_id()`
`BPF_FUNC_skb_under_cgroup()`| diff --git a/docs/reference_guide.md b/docs/reference_guide.md index 9080deee6..3315b8c13 100644 --- a/docs/reference_guide.md +++ b/docs/reference_guide.md @@ -16,9 +16,13 @@ This guide is incomplete. If something feels missing, check the bcc and kernel s - [6. USDT probes](#6-usdt-probes) - [7. Raw Tracepoints](#7-raw-tracepoints) - [8. system call tracepoints](#8-system-call-tracepoints) + - [9. kfuncs](#9-kfuncs) + - [10. kretfuncs](#10-kretfuncs) + - [11. lsm probes](#11-lsm-probes) + - [12. bpf iterators](#12-bpf-iterators) - [Data](#data) - - [1. bpf_probe_read()](#1-bpf_probe_read) - - [2. bpf_probe_read_str()](#2-bpf_probe_read_str) + - [1. bpf_probe_read_kernel()](#1-bpf_probe_read_kernel) + - [2. bpf_probe_read_kernel_str()](#2-bpf_probe_read_kernel_str) - [3. bpf_ktime_get_ns()](#3-bpf_ktime_get_ns) - [4. bpf_get_current_pid_tgid()](#4-bpf_get_current_pid_tgid) - [5. bpf_get_current_uid_gid()](#5-bpf_get_current_uid_gid) @@ -26,12 +30,20 @@ This guide is incomplete. If something feels missing, check the bcc and kernel s - [7. bpf_get_current_task()](#7-bpf_get_current_task) - [8. bpf_log2l()](#8-bpf_log2l) - [9. bpf_get_prandom_u32()](#9-bpf_get_prandom_u32) + - [10. bpf_probe_read_user()](#10-bpf_probe_read_user) + - [11. bpf_probe_read_user_str()](#11-bpf_probe_read_user_str) + - [12. bpf_get_ns_current_pid_tgid()](#12-bpf_get_ns_current_pid_tgid) - [Debugging](#debugging) - [1. bpf_override_return()](#1-bpf_override_return) - [Output](#output) - [1. bpf_trace_printk()](#1-bpf_trace_printk) - [2. BPF_PERF_OUTPUT](#2-bpf_perf_output) - [3. perf_submit()](#3-perf_submit) + - [4. BPF_RINGBUF_OUTPUT](#4-bpf_ringbuf_output) + - [5. ringbuf_output()](#5-ringbuf_output) + - [6. ringbuf_reserve()](#6-ringbuf_reserve) + - [7. ringbuf_submit()](#7-ringbuf_submit) + - [8. ringbuf_discard()](#8-ringbuf_submit) - [Maps](#maps) - [1. BPF_TABLE](#1-bpf_table) - [2. BPF_HASH](#2-bpf_hash) @@ -45,17 +57,25 @@ This guide is incomplete. If something feels missing, check the bcc and kernel s - [10. BPF_DEVMAP](#10-bpf_devmap) - [11. BPF_CPUMAP](#11-bpf_cpumap) - [12. BPF_XSKMAP](#12-bpf_xskmap) - - [13. map.lookup()](#13-maplookup) - - [14. map.lookup_or_try_init()](#14-maplookup_or_try_init) - - [15. map.delete()](#15-mapdelete) - - [16. map.update()](#16-mapupdate) - - [17. map.insert()](#17-mapinsert) - - [18. map.increment()](#18-mapincrement) - - [19. map.get_stackid()](#19-mapget_stackid) - - [20. map.perf_read()](#20-mapperf_read) - - [21. map.call()](#21-mapcall) - - [22. map.redirect_map()](#22-mapredirect_map) + - [13. BPF_ARRAY_OF_MAPS](#13-bpf_array_of_maps) + - [14. BPF_HASH_OF_MAPS](#14-bpf_hash_of_maps) + - [15. BPF_STACK](#15-bpf_stack) + - [16. BPF_QUEUE](#16-bpf_queue) + - [17. map.lookup()](#17-maplookup) + - [18. map.lookup_or_try_init()](#18-maplookup_or_try_init) + - [19. map.delete()](#19-mapdelete) + - [20. map.update()](#20-mapupdate) + - [21. map.insert()](#21-mapinsert) + - [22. map.increment()](#22-mapincrement) + - [23. map.get_stackid()](#23-mapget_stackid) + - [24. map.perf_read()](#24-mapperf_read) + - [25. map.call()](#25-mapcall) + - [26. map.redirect_map()](#26-mapredirect_map) + - [27. map.push()](#27-mappush) + - [28. map.pop()](#28-mappop) + - [29. map.peek()](#29-mappeek) - [Licensing](#licensing) + - [Rewriter](#rewriter) - [bcc Python](#bcc-python) - [Initialization](#initialization) @@ -74,6 +94,8 @@ This guide is incomplete. If something feels missing, check the bcc and kernel s - [2. trace_fields()](#2-trace_fields) - [Output](#output) - [1. perf_buffer_poll()](#1-perf_buffer_poll) + - [2. ring_buffer_poll()](#2-ring_buffer_poll) + - [3. ring_buffer_consume()](#3-ring_buffer_consume) - [Maps](#maps) - [1. get_table()](#1-get_table) - [2. open_perf_buffer()](#2-open_perf_buffer) @@ -81,7 +103,11 @@ This guide is incomplete. If something feels missing, check the bcc and kernel s - [4. values()](#4-values) - [5. clear()](#5-clear) - [6. print_log2_hist()](#6-print_log2_hist) - - [7. print_linear_hist()](#6-print_linear_hist) + - [7. print_linear_hist()](#7-print_linear_hist) + - [8. open_ring_buffer()](#8-open_ring_buffer) + - [9. push()](#9-push) + - [10. pop()](#10-pop) + - [11. peek()](#11-peek) - [Helpers](#helpers) - [1. ksym()](#1-ksym) - [2. ksymname()](#2-ksymname) @@ -192,7 +218,7 @@ For example: ```C int count(struct pt_regs *ctx) { char buf[64]; - bpf_probe_read(&buf, sizeof(buf), (void *)PT_REGS_PARM1(ctx)); + bpf_probe_read_user(&buf, sizeof(buf), (void *)PT_REGS_PARM1(ctx)); bpf_trace_printk("%s %d", buf, PT_REGS_PARM2(ctx)); return(0); } @@ -238,7 +264,7 @@ int do_trace(struct pt_regs *ctx) { uint64_t addr; char path[128]; bpf_usdt_readarg(6, ctx, &addr); - bpf_probe_read(&path, sizeof(path), (void *)addr); + bpf_probe_read_user(&path, sizeof(path), (void *)addr); bpf_trace_printk("path:%s\\n", path); return 0; }; @@ -271,8 +297,8 @@ RAW_TRACEPOINT_PROBE(sched_switch) struct task_struct *next= (struct task_struct *)ctx->args[2]; s32 prev_tgid, next_tgid; - bpf_probe_read(&prev_tgid, sizeof(prev->tgid), &prev->tgid); - bpf_probe_read(&next_tgid, sizeof(next->tgid), &next->tgid); + bpf_probe_read_kernel(&prev_tgid, sizeof(prev->tgid), &prev->tgid); + bpf_probe_read_kernel(&next_tgid, sizeof(next->tgid), &next->tgid); bpf_trace_printk("%d -> %d\\n", prev_tgid, next_tgid); } ``` @@ -286,7 +312,7 @@ Examples in situ: Syntax: ```syscall__SYSCALLNAME``` -```syscall__``` is a special prefix that creates a kprobe for the system call name provided as the remainder. You can use it by declaring a normal C function, then using the Python ```BPF.get_syscall_name(SYSCALLNAME)``` and ```BPF.attach_kprobe()``` to associate it. +```syscall__``` is a special prefix that creates a kprobe for the system call name provided as the remainder. You can use it by declaring a normal C function, then using the Python ```BPF.get_syscall_fnname(SYSCALLNAME)``` and ```BPF.attach_kprobe()``` to associate it. Arguments are specified on the function declaration: ```syscall__SYSCALLNAME(struct pt_regs *ctx, [, argument1 ...])```. @@ -308,41 +334,148 @@ The first argument is always ```struct pt_regs *```, the remainder are the argum Corresponding Python code: ```Python b = BPF(text=bpf_text) -execve_fnname = b.get_syscall_name("execve") +execve_fnname = b.get_syscall_fnname("execve") b.attach_kprobe(event=execve_fnname, fn_name="syscall__execve") ``` Examples in situ: [code](https://github.com/iovisor/bcc/blob/552658edda09298afdccc8a4b5e17311a2d8a771/tools/execsnoop.py#L101) ([output](https://github.com/iovisor/bcc/blob/552658edda09298afdccc8a4b5e17311a2d8a771/tools/execsnoop_example.txt#L8)) +### 9. kfuncs + +Syntax: KFUNC_PROBE(*function*, typeof(arg1) arg1, typeof(arg2) arge ...) + +This is a macro that instruments the kernel function via trampoline +*before* the function is executed. It's defined by *function* name and +the function arguments defined as *argX*. + +For example: +```C +KFUNC_PROBE(do_sys_open, int dfd, const char *filename, int flags, int mode) +{ + ... +``` + +This instruments the do_sys_open kernel function and make its arguments +accessible as standard argument values. + +Examples in situ: +[search /tools](https://github.com/iovisor/bcc/search?q=KFUNC_PROBE+path%3Atools&type=Code) + +### 10. kretfuncs + +Syntax: KRETFUNC_PROBE(*event*, typeof(arg1) arg1, typeof(arg2) arge ..., int ret) + +This is a macro that instruments the kernel function via trampoline +*after* the function is executed. It's defined by *function* name and +the function arguments defined as *argX*. + +The last argument of the probe is the return value of the instrumented function. + +For example: +```C +KRETFUNC_PROBE(do_sys_open, int dfd, const char *filename, int flags, int mode, int ret) +{ + ... +``` + +This instruments the do_sys_open kernel function and make its arguments +accessible as standard argument values together with its return value. + +Examples in situ: +[search /tools](https://github.com/iovisor/bcc/search?q=KRETFUNC_PROBE+path%3Atools&type=Code) + + +### 11. LSM Probes + +Syntax: LSM_PROBE(*hook*, typeof(arg1) arg1, typeof(arg2) arg2 ...) + +This is a macro that instruments an LSM hook as a BPF program. It can be +used to audit security events and implement MAC security policies in BPF. +It is defined by specifying the hook name followed by its arguments. + +Hook names can be found in +[include/linux/security.h](https://github.com/torvalds/linux/tree/master/include/linux/security.h#L254) +by taking functions like `security_hookname` and taking just the `hookname` part. +For example, `security_bpf` would simply become `bpf`. + +Unlike other BPF program types, the return value specified in an LSM probe +matters. A return value of 0 allows the hook to succeed, whereas +any non-zero return value will cause the hook to fail and deny the +security operation. + +The following example instruments a hook that denies all future BPF operations: +```C +LSM_PROBE(bpf, int cmd, union bpf_attr *attr, unsigned int size) +{ + return -EPERM; +} +``` + +This instruments the `security_bpf` hook and causes it to return `-EPERM`. +Changing `return -EPERM` to `return 0` would cause the BPF program +to allow the operation instead. + +LSM probes require at least a 5.7+ kernel with the following configuation options set: +- `CONFIG_BPF_LSM=y` +- `CONFIG_LSM` comma separated string must contain "bpf" (for example, + `CONFIG_LSM="lockdown,yama,bpf"`) + +Examples in situ: +[search /tests](https://github.com/iovisor/bcc/search?q=LSM_PROBE+path%3Atests&type=Code) + +### 12. BPF ITERATORS + +Syntax: BPF_ITER(target) + +This is a macro to define a program signature for a bpf iterator program. The argument *target* specifies what to iterate for the program. + +Currently, kernel does not have interface to discover what targets are supported. A good place to find what is supported is in [tools/testing/selftests/bpf/prog_test/bpf_iter.c](https://github.com/torvalds/linux/blob/master/tools/testing/selftests/bpf/prog_tests/bpf_iter.c) and some sample bpf iter programs are in [tools/testing/selftests/bpf/progs](https://github.com/torvalds/linux/tree/master/tools/testing/selftests/bpf/progs) with file name prefix *bpf_iter*. + +The following example defines a program for target *task*, which traverses all tasks in the kernel. +```C +BPF_ITER(task) +{ + struct seq_file *seq = ctx->meta->seq; + struct task_struct *task = ctx->task; + + if (task == (void *)0) + return 0; + + ... task->pid, task->tgid, task->comm, ... + return 0; +} +``` + +BPF iterators are introduced in 5.8 kernel for task, task_file, bpf_map, netlink_sock and ipv6_route . In 5.9, support is added to tcp/udp sockets and bpf map element (hashmap, arraymap and sk_local_storage_map) traversal. ## Data -### 1. bpf_probe_read() +### 1. bpf_probe_read_kernel() -Syntax: ```int bpf_probe_read(void *dst, int size, const void *src)``` +Syntax: ```int bpf_probe_read_kernel(void *dst, int size, const void *src)``` Return: 0 on success -This copies a memory location to the BPF stack, so that BPF can later operate on it. For safety, all memory reads must pass through bpf_probe_read(). This happens automatically in some cases, such as dereferencing kernel variables, as bcc will rewrite the BPF program to include the necessary bpf_probe_reads(). +This copies size bytes from kernel address space to the BPF stack, so that BPF can later operate on it. For safety, all kernel memory reads must pass through bpf_probe_read_kernel(). This happens automatically in some cases, such as dereferencing kernel variables, as bcc will rewrite the BPF program to include the necessary bpf_probe_read_kernel(). Examples in situ: -[search /examples](https://github.com/iovisor/bcc/search?q=bpf_probe_read+path%3Aexamples&type=Code), -[search /tools](https://github.com/iovisor/bcc/search?q=bpf_probe_read+path%3Atools&type=Code) +[search /examples](https://github.com/iovisor/bcc/search?q=bpf_probe_read_kernel+path%3Aexamples&type=Code), +[search /tools](https://github.com/iovisor/bcc/search?q=bpf_probe_read_kernel+path%3Atools&type=Code) -### 2. bpf_probe_read_str() +### 2. bpf_probe_read_kernel_str() -Syntax: ```int bpf_probe_read_str(void *dst, int size, const void *src)``` +Syntax: ```int bpf_probe_read_kernel_str(void *dst, int size, const void *src)``` Return: - \> 0 length of the string including the trailing NULL on success - \< 0 error -This copies a `NULL` terminated string from memory location to BPF stack, so that BPF can later operate on it. In case the string length is smaller than size, the target is not padded with further `NULL` bytes. In case the string length is larger than size, just `size - 1` bytes are copied and the last byte is set to `NULL`. +This copies a `NULL` terminated string from kernel address space to the BPF stack, so that BPF can later operate on it. In case the string length is smaller than size, the target is not padded with further `NULL` bytes. In case the string length is larger than size, just `size - 1` bytes are copied and the last byte is set to `NULL`. Examples in situ: -[search /examples](https://github.com/iovisor/bcc/search?q=bpf_probe_read_str+path%3Aexamples&type=Code), -[search /tools](https://github.com/iovisor/bcc/search?q=bpf_probe_read_str+path%3Atools&type=Code) +[search /examples](https://github.com/iovisor/bcc/search?q=bpf_probe_read_kernel_str+path%3Aexamples&type=Code), +[search /tools](https://github.com/iovisor/bcc/search?q=bpf_probe_read_kernel_str+path%3Atools&type=Code) ### 3. bpf_ktime_get_ns() @@ -442,6 +575,50 @@ Example in situ: [search /examples](https://github.com/iovisor/bcc/search?q=bpf_get_prandom_u32+path%3Aexamples&type=Code), [search /tools](https://github.com/iovisor/bcc/search?q=bpf_get_prandom_u32+path%3Atools&type=Code) +### 10. bpf_probe_read_user() + +Syntax: ```int bpf_probe_read_user(void *dst, int size, const void *src)``` + +Return: 0 on success + +This attempts to safely read size bytes from user address space to the BPF stack, so that BPF can later operate on it. For safety, all user address space memory reads must pass through bpf_probe_read_user(). + +Examples in situ: +[search /examples](https://github.com/iovisor/bcc/search?q=bpf_probe_read_user+path%3Aexamples&type=Code), +[search /tools](https://github.com/iovisor/bcc/search?q=bpf_probe_read_user+path%3Atools&type=Code) + +### 11. bpf_probe_read_user_str() + +Syntax: ```int bpf_probe_read_user_str(void *dst, int size, const void *src)``` + +Return: + - \> 0 length of the string including the trailing NULL on success + - \< 0 error + +This copies a `NULL` terminated string from user address space to the BPF stack, so that BPF can later operate on it. In case the string length is smaller than size, the target is not padded with further `NULL` bytes. In case the string length is larger than size, just `size - 1` bytes are copied and the last byte is set to `NULL`. + +Examples in situ: +[search /examples](https://github.com/iovisor/bcc/search?q=bpf_probe_read_user_str+path%3Aexamples&type=Code), +[search /tools](https://github.com/iovisor/bcc/search?q=bpf_probe_read_user_str+path%3Atools&type=Code) + + +### 12. bpf_get_ns_current_pid_tgid() + +Syntax: ```u32 bpf_get_ns_current_pid_tgid(u64 dev, u64 ino, struct bpf_pidns_info* nsdata, u32 size)``` + +Values for *pid* and *tgid* as seen from the current *namespace* will be returned in *nsdata*. + +Return 0 on success, or one of the following in case of failure: + +- **-EINVAL** if dev and inum supplied don't match dev_t and inode number with nsfs of current task, or if dev conversion to dev_t lost high bits. + +- **-ENOENT** if pidns does not exists for the current task. + +Examples in situ: +[search /examples](https://github.com/iovisor/bcc/search?q=bpf_get_ns_current_pid_tgid+path%3Aexamples&type=Code), +[search /tools](https://github.com/iovisor/bcc/search?q=bpf_get_ns_current_pid_tgid+path%3Atools&type=Code) + + ## Debugging ### 1. bpf_override_return() @@ -531,6 +708,131 @@ Examples in situ: [search /examples](https://github.com/iovisor/bcc/search?q=perf_submit+path%3Aexamples&type=Code), [search /tools](https://github.com/iovisor/bcc/search?q=perf_submit+path%3Atools&type=Code) +### 4. BPF_RINGBUF_OUTPUT + +Syntax: ```BPF_RINGBUF_OUTPUT(name, page_cnt)``` + +Creates a BPF table for pushing out custom event data to user space via a ringbuf ring buffer. +```BPF_RINGBUF_OUTPUT``` has several advantages over ```BPF_PERF_OUTPUT```, summarized as follows: + +- Buffer is shared across all CPUs, meaning no per-CPU allocation +- Supports two APIs for BPF programs + - ```map.ringbuf_output()``` works like ```map.perf_submit()``` (covered in [ringbuf_output](#5-ringbuf_output)) + - ```map.ringbuf_reserve()```/```map.ringbuf_submit()```/```map.ringbuf_discard()``` + split the process of reserving buffer space and submitting events into two steps + (covered in [ringbuf_reserve](#6-ringbuf_reserve), [ringbuf_submit](#7-ringbuf_submit), [ringbuf_discard](#8-ringbuf_submit)) +- BPF APIs do not require access to a CPU ctx argument +- Superior performance and latency in userspace thanks to a shared ring buffer manager +- Supports two ways of consuming data in userspace + +Starting in Linux 5.8, this should be the preferred method for pushing per-event data to user space. + +Example of both APIs: + +```C +struct data_t { + u32 pid; + u64 ts; + char comm[TASK_COMM_LEN]; +}; + +// Creates a ringbuf called events with 8 pages of space, shared across all CPUs +BPF_RINGBUF_OUTPUT(events, 8); + +int first_api_example(struct pt_regs *ctx) { + struct data_t data = {}; + + data.pid = bpf_get_current_pid_tgid(); + data.ts = bpf_ktime_get_ns(); + bpf_get_current_comm(&data.comm, sizeof(data.comm)); + + events.ringbuf_output(&data, sizeof(data), 0 /* flags */); + + return 0; +} + +int second_api_example(struct pt_regs *ctx) { + struct data_t *data = events.ringbuf_reserve(sizeof(struct data_t)); + if (!data) { // Failed to reserve space + return 1; + } + + data->pid = bpf_get_current_pid_tgid(); + data->ts = bpf_ktime_get_ns(); + bpf_get_current_comm(&data->comm, sizeof(data->comm)); + + events.ringbuf_submit(data, 0 /* flags */); + + return 0; +} +``` + +The output table is named ```events```. Data is allocated via ```events.ringbuf_reserve()``` and pushed to it via ```events.ringbuf_submit()```. + +Examples in situ: +[search /examples](https://github.com/iovisor/bcc/search?q=BPF_RINGBUF_OUTPUT+path%3Aexamples&type=Code), + +### 5. ringbuf_output() + +Syntax: ```int ringbuf_output((void *)data, u64 data_size, u64 flags)``` + +Return: 0 on success + +Flags: + - ```BPF_RB_NO_WAKEUP```: Do not sent notification of new data availability + - ```BPF_RB_FORCE_WAKEUP```: Send notification of new data availability unconditionally + +A method of the BPF_RINGBUF_OUTPUT table, for submitting custom event data to user space. This method works like ```perf_submit()```, +although it does not require a ctx argument. + +Examples in situ: +[search /examples](https://github.com/iovisor/bcc/search?q=ringbuf_output+path%3Aexamples&type=Code), + +### 6. ringbuf_reserve() + +Syntax: ```void* ringbuf_reserve(u64 data_size)``` + +Return: Pointer to data struct on success, NULL on failure + +A method of the BPF_RINGBUF_OUTPUT table, for reserving space in the ring buffer and simultaenously +allocating a data struct for output. Must be used with one of ```ringbuf_submit``` or ```ringbuf_discard```. + +Examples in situ: +[search /examples](https://github.com/iovisor/bcc/search?q=ringbuf_reserve+path%3Aexamples&type=Code), + +### 7. ringbuf_submit() + +Syntax: ```void ringbuf_submit((void *)data, u64 flags)``` + +Return: Nothing, always succeeds + +Flags: + - ```BPF_RB_NO_WAKEUP```: Do not sent notification of new data availability + - ```BPF_RB_FORCE_WAKEUP```: Send notification of new data availability unconditionally + +A method of the BPF_RINGBUF_OUTPUT table, for submitting custom event data to user space. Must be preceded by a call to +```ringbuf_reserve()``` to reserve space for the data. + +Examples in situ: +[search /examples](https://github.com/iovisor/bcc/search?q=ringbuf_submit+path%3Aexamples&type=Code), + +### 8. ringbuf_discard() + +Syntax: ```void ringbuf_discard((void *)data, u64 flags)``` + +Return: Nothing, always succeeds + +Flags: + - ```BPF_RB_NO_WAKEUP```: Do not sent notification of new data availability + - ```BPF_RB_FORCE_WAKEUP```: Send notification of new data availability unconditionally + +A method of the BPF_RINGBUF_OUTPUT table, for discarding custom event data; userspace +ignores the data associated with the discarded event. Must be preceded by a call to +```ringbuf_reserve()``` to reserve space for the data. + +Examples in situ: +[search /examples](https://github.com/iovisor/bcc/search?q=ringbuf_submit+path%3Aexamples&type=Code), + ## Maps Maps are BPF data stores, and are the basis for higher level object types including tables, hashes, and histograms. @@ -802,7 +1104,47 @@ BPF_ARRAY(ex2, int, 1024); BPF_HASH_OF_MAPS(maps_hash, "ex1", 10); ``` -### 15. map.lookup() +### 15. BPF_STACK + +Syntax: ```BPF_STACK(name, leaf_type, max_entries[, flags])``` + +Creates a stack named ```name``` with value type ```leaf_type``` and max entries ```max_entries```. +Stack and Queue maps are only available from Linux 4.20+. + +For example: + +```C +BPF_STACK(stack, struct event, 10240); +``` + +This creates a stack named ```stack``` where the value type is ```struct event```, that holds up to 10240 entries. + +Methods (covered later): map.push(), map.pop(), map.peek(). + +Examples in situ: +[search /tests](https://github.com/iovisor/bcc/search?q=BPF_STACK+path%3Atests&type=Code), + +### 16. BPF_QUEUE + +Syntax: ```BPF_QUEUE(name, leaf_type, max_entries[, flags])``` + +Creates a queue named ```name``` with value type ```leaf_type``` and max entries ```max_entries```. +Stack and Queue maps are only available from Linux 4.20+. + +For example: + +```C +BPF_QUEUE(queue, struct event, 10240); +``` + +This creates a queue named ```queue``` where the value type is ```struct event```, that holds up to 10240 entries. + +Methods (covered later): map.push(), map.pop(), map.peek(). + +Examples in situ: +[search /tests](https://github.com/iovisor/bcc/search?q=BPF_QUEUE+path%3Atests&type=Code), + +### 17. map.lookup() Syntax: ```*val map.lookup(&key)``` @@ -812,7 +1154,7 @@ Examples in situ: [search /examples](https://github.com/iovisor/bcc/search?q=lookup+path%3Aexamples&type=Code), [search /tools](https://github.com/iovisor/bcc/search?q=lookup+path%3Atools&type=Code) -### 16. map.lookup_or_try_init() +### 18. map.lookup_or_try_init() Syntax: ```*val map.lookup_or_try_init(&key, &zero)``` @@ -825,7 +1167,7 @@ Examples in situ: Note: The old map.lookup_or_init() may cause return from the function, so lookup_or_try_init() is recommended as it does not have this side effect. -### 17. map.delete() +### 19. map.delete() Syntax: ```map.delete(&key)``` @@ -835,7 +1177,7 @@ Examples in situ: [search /examples](https://github.com/iovisor/bcc/search?q=delete+path%3Aexamples&type=Code), [search /tools](https://github.com/iovisor/bcc/search?q=delete+path%3Atools&type=Code) -### 18. map.update() +### 20. map.update() Syntax: ```map.update(&key, &val)``` @@ -845,7 +1187,7 @@ Examples in situ: [search /examples](https://github.com/iovisor/bcc/search?q=update+path%3Aexamples&type=Code), [search /tools](https://github.com/iovisor/bcc/search?q=update+path%3Atools&type=Code) -### 19. map.insert() +### 21. map.insert() Syntax: ```map.insert(&key, &val)``` @@ -855,7 +1197,7 @@ Examples in situ: [search /examples](https://github.com/iovisor/bcc/search?q=insert+path%3Aexamples&type=Code), [search /tools](https://github.com/iovisor/bcc/search?q=insert+path%3Atools&type=Code) -### 20. map.increment() +### 22. map.increment() Syntax: ```map.increment(key[, increment_amount])``` @@ -865,7 +1207,7 @@ Examples in situ: [search /examples](https://github.com/iovisor/bcc/search?q=increment+path%3Aexamples&type=Code), [search /tools](https://github.com/iovisor/bcc/search?q=increment+path%3Atools&type=Code) -### 21. map.get_stackid() +### 23. map.get_stackid() Syntax: ```int map.get_stackid(void *ctx, u64 flags)``` @@ -875,7 +1217,7 @@ Examples in situ: [search /examples](https://github.com/iovisor/bcc/search?q=get_stackid+path%3Aexamples&type=Code), [search /tools](https://github.com/iovisor/bcc/search?q=get_stackid+path%3Atools&type=Code) -### 22. map.perf_read() +### 24. map.perf_read() Syntax: ```u64 map.perf_read(u32 cpu)``` @@ -884,7 +1226,7 @@ This returns the hardware performance counter as configured in [5. BPF_PERF_ARRA Examples in situ: [search /tests](https://github.com/iovisor/bcc/search?q=perf_read+path%3Atests&type=Code) -### 23. map.call() +### 25. map.call() Syntax: ```void map.call(void *ctx, int index)``` @@ -923,7 +1265,7 @@ Examples in situ: [search /examples](https://github.com/iovisor/bcc/search?l=C&q=call+path%3Aexamples&type=Code), [search /tests](https://github.com/iovisor/bcc/search?l=C&q=call+path%3Atests&type=Code) -### 24. map.redirect_map() +### 26. map.redirect_map() Syntax: ```int map.redirect_map(int index, int flags)``` @@ -961,6 +1303,39 @@ b.attach_xdp("eth1", out_fn, 0) Examples in situ: [search /examples](https://github.com/iovisor/bcc/search?l=C&q=redirect_map+path%3Aexamples&type=Code), +### 27. map.push() + +Syntax: ```int map.push(&val, int flags)``` + +Push an element onto a Stack or Queue table. +Passing BPF_EXIST as a flag causes the Queue or Stack to discard the oldest element if it is full. +Returns 0 on success, negative error on failure. + +Examples in situ: +[search /tests](https://github.com/iovisor/bcc/search?q=push+path%3Atests&type=Code), + +### 28. map.pop() + +Syntax: ```int map.pop(&val)``` + +Pop an element from a Stack or Queue table. ```*val``` is populated with the result. +Unlike peeking, popping removes the element. +Returns 0 on success, negative error on failure. + +Examples in situ: +[search /tests](https://github.com/iovisor/bcc/search?q=pop+path%3Atests&type=Code), + +### 29. map.peek() + +Syntax: ```int map.peek(&val)``` + +Peek an element at the head of a Stack or Queue table. ```*val``` is populated with the result. +Unlike popping, peeking does not remove the element. +Returns 0 on success, negative error on failure. + +Examples in situ: +[search /tests](https://github.com/iovisor/bcc/search?q=peek+path%3Atests&type=Code), + ## Licensing Depending on which [BPF helpers](kernel-versions.md#helpers) are used, a GPL-compatible license is required. @@ -983,6 +1358,10 @@ Check the [BPF helpers reference](kernel-versions.md#helpers) to see which helpe **If the macro is not specified, BCC will automatically define the license of the program as GPL.** +## Rewriter + +One of jobs for rewriter is to turn implicit memory accesses to explicit ones using kernel helpers. Recent kernel introduced a config option ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE which will be set for architectures who user address space and kernel address are disjoint. x86 and arm has this config option set while s390 does not. If ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE is not set, the bpf old helper `bpf_probe_read()` will not be available. Some existing users may have implicit memory accesses to access user memory, so using `bpf_probe_read_kernel()` will cause their application to fail. Therefore, for non-s390, the rewriter will use `bpf_probe_read()` for these implicit memory accesses. For s390, `bpf_probe_read_kernel()` is used as default and users should use `bpf_probe_read_user()` explicitly when accessing user memories. + # bcc Python ## Initialization @@ -1335,6 +1714,55 @@ Examples in situ: [search /examples](https://github.com/iovisor/bcc/search?q=perf_buffer_poll+path%3Aexamples+language%3Apython&type=Code), [search /tools](https://github.com/iovisor/bcc/search?q=perf_buffer_poll+path%3Atools+language%3Apython&type=Code) +### 2. ring_buffer_poll() + +Syntax: ```BPF.ring_buffer_poll(timeout=T)``` + +This polls from all open ringbuf ring buffers, calling the callback function that was provided when calling open_ring_buffer for each entry. + +The timeout parameter is optional and measured in milliseconds. In its absence, polling continues until +there is no more data or the callback returns a negative value. + +Example: + +```Python +# loop with callback to print_event +b["events"].open_ring_buffer(print_event) +while 1: + try: + b.ring_buffer_poll(30) + except KeyboardInterrupt: + exit(); +``` + +Examples in situ: +[search /examples](https://github.com/iovisor/bcc/search?q=ring_buffer_poll+path%3Aexamples+language%3Apython&type=Code), + +### 3. ring_buffer_consume() + +Syntax: ```BPF.ring_buffer_consume()``` + +This consumes from all open ringbuf ring buffers, calling the callback function that was provided when calling open_ring_buffer for each entry. + +Unlike ```ring_buffer_poll```, this method **does not poll for data** before attempting to consume. +This reduces latency at the expense of higher CPU consumption. If you are unsure which to use, +use ```ring_buffer_poll```. + +Example: + +```Python +# loop with callback to print_event +b["events"].open_ring_buffer(print_event) +while 1: + try: + b.ring_buffer_consume() + except KeyboardInterrupt: + exit(); +``` + +Examples in situ: +[search /examples](https://github.com/iovisor/bcc/search?q=ring_buffer_consume+path%3Aexamples+language%3Apython&type=Code), + ## Maps Maps are BPF data stores, and are used in bcc to implement a table, and then higher level objects on top of tables, including hashes and histograms. @@ -1486,7 +1914,7 @@ Example: b = BPF(text=""" BPF_HISTOGRAM(dist); -int kprobe__blk_account_io_completion(struct pt_regs *ctx, struct request *req) +int kprobe__blk_account_io_done(struct pt_regs *ctx, struct request *req) { dist.increment(bpf_log2l(req->__data_len / 1024)); return 0; @@ -1537,7 +1965,7 @@ Example: b = BPF(text=""" BPF_HISTOGRAM(dist); -int kprobe__blk_account_io_completion(struct pt_regs *ctx, struct request *req) +int kprobe__blk_account_io_done(struct pt_regs *ctx, struct request *req) { dist.increment(req->__data_len / 1024); return 0; @@ -1578,6 +2006,99 @@ Examples in situ: [search /examples](https://github.com/iovisor/bcc/search?q=print_linear_hist+path%3Aexamples+language%3Apython&type=Code), [search /tools](https://github.com/iovisor/bcc/search?q=print_linear_hist+path%3Atools+language%3Apython&type=Code) +### 8. open_ring_buffer() + +Syntax: ```table.open_ring_buffer(callback, ctx=None)``` + +This operates on a table as defined in BPF as BPF_RINGBUF_OUTPUT(), and associates the callback Python function ```callback``` to be called when data is available in the ringbuf ring buffer. This is part of the new (Linux 5.8+) recommended mechanism for transferring per-event data from kernel to user space. Unlike perf buffers, ringbuf sizes are specified within the BPF program, as part of the ```BPF_RINGBUF_OUTPUT``` macro. If the callback is not processing data fast enough, some submitted data may be lost. In this case, the events should be polled more frequently and/or the size of the ring buffer should be increased. + +Example: + +```Python +# process event +def print_event(ctx, data, size): + event = ct.cast(data, ct.POINTER(Data)).contents + [...] + +# loop with callback to print_event +b["events"].open_ring_buffer(print_event) +while 1: + try: + b.ring_buffer_poll() + except KeyboardInterrupt: + exit() +``` + +Note that the data structure transferred will need to be declared in C in the BPF program. For example: + +```C +// define output data structure in C +struct data_t { + u32 pid; + u64 ts; + char comm[TASK_COMM_LEN]; +}; +BPF_RINGBUF_OUTPUT(events, 8); +[...] +``` + +In Python, you can either let bcc generate the data structure from C declaration automatically (recommended): + +```Python +def print_event(ctx, data, size): + event = b["events"].event(data) +[...] +``` + +or define it manually: + +```Python +# define output data structure in Python +TASK_COMM_LEN = 16 # linux/sched.h +class Data(ct.Structure): + _fields_ = [("pid", ct.c_ulonglong), + ("ts", ct.c_ulonglong), + ("comm", ct.c_char * TASK_COMM_LEN)] + +def print_event(ctx, data, size): + event = ct.cast(data, ct.POINTER(Data)).contents +[...] +``` + +Examples in situ: +[search /examples](https://github.com/iovisor/bcc/search?q=open_ring_buffer+path%3Aexamples+language%3Apython&type=Code), + +### 9. push() + +Syntax: ```table.push(leaf, flags=0)``` + +Push an element onto a Stack or Queue table. Raises an exception if the operation does not succeed. +Passing QueueStack.BPF_EXIST as a flag causes the Queue or Stack to discard the oldest element if it is full. + +Examples in situ: +[search /tests](https://github.com/iovisor/bcc/search?q=push+path%3Atests+language%3Apython&type=Code), + +### 10. pop() + +Syntax: ```leaf = table.pop()``` + +Pop an element from a Stack or Queue table. Unlike ```peek()```, ```pop()``` +removes the element from the table before returning it. +Raises a KeyError exception if the operation does not succeed. + +Examples in situ: +[search /tests](https://github.com/iovisor/bcc/search?q=pop+path%3Atests+language%3Apython&type=Code), + +### 11. peek() + +Syntax: ```leaf = table.peek()``` + +Peek the element at the head of a Stack or Queue table. Unlike ```pop()```, ```peek()``` +does not remove the element from the table. Raises an exception if the operation does not succeed. + +Examples in situ: +[search /tests](https://github.com/iovisor/bcc/search?q=peek+path%3Atests+language%3Apython&type=Code), + ## Helpers Some helper methods provided by bcc. Note that since we're in Python, we can import any Python library and their methods, including, for example, the libraries: argparse, collections, ctypes, datetime, re, socket, struct, subprocess, sys, and time. @@ -1673,7 +2194,7 @@ See the "Understanding eBPF verifier messages" section in the kernel source unde ## 1. Invalid mem access -This can be due to trying to read memory directly, instead of operating on memory on the BPF stack. All memory reads must be passed via bpf_probe_read() to copy memory into the BPF stack, which can be automatic by the bcc rewriter in some cases of simple dereferencing. bpf_probe_read() does all the required checks. +This can be due to trying to read memory directly, instead of operating on memory on the BPF stack. All kernel memory reads must be passed via bpf_probe_read_kernel() to copy kernel memory into the BPF stack, which can be automatic by the bcc rewriter in some cases of simple dereferencing. bpf_probe_read_kernel() does all the required checks. Example: diff --git a/docs/filtering_by_cgroups.md b/docs/special_filtering.md similarity index 54% rename from docs/filtering_by_cgroups.md rename to docs/special_filtering.md index 1c711a240..9b15260ca 100644 --- a/docs/filtering_by_cgroups.md +++ b/docs/special_filtering.md @@ -1,4 +1,10 @@ -# Demonstrations of filtering by cgroups +# Special Filtering + +Some tools have special filtering capabitilies, the main use case is to trace +processes running in containers, but those mechanisms are generic and could +be used in other cases as well. + +## Filtering by cgroups Some tools have an option to filter by cgroup by referencing a pinned BPF hash map managed externally. @@ -8,6 +14,9 @@ Examples of commands: ``` # ./opensnoop --cgroupmap /sys/fs/bpf/test01 # ./execsnoop --cgroupmap /sys/fs/bpf/test01 +# ./tcpconnect --cgroupmap /sys/fs/bpf/test01 +# ./tcpaccept --cgroupmap /sys/fs/bpf/test01 +# ./tcptracer --cgroupmap /sys/fs/bpf/test01 ``` The commands above will only display results from processes that belong to one @@ -63,3 +72,54 @@ map, bcc tools will display results from this shell. Cgroups can be added and removed from the BPF hash map without restarting the bcc tool. This feature is useful for integrating bcc tools in external projects. + +## Filtering by mount by namespace + +The BPF hash map can be created by: + +``` +# bpftool map create /sys/fs/bpf/mnt_ns_set type hash key 8 value 4 entries 128 \ + name mnt_ns_set flags 0 +``` + +Execute the `execsnoop` tool filtering only the mount namespaces +in `/sys/fs/bpf/mnt_ns_set`: + +``` +# tools/execsnoop.py --mntnsmap /sys/fs/bpf/mnt_ns_set +``` + +Start a terminal in a new mount namespace: + +``` +# unshare -m bash +``` + +Update the hash map with the mount namespace ID of the terminal above: + +``` +FILE=/sys/fs/bpf/mnt_ns_set +if [ $(printf '\1' | od -dAn) -eq 1 ]; then + HOST_ENDIAN_CMD=tac +else + HOST_ENDIAN_CMD=cat +fi + +NS_ID_HEX="$(printf '%016x' $(stat -Lc '%i' /proc/self/ns/mnt) | sed 's/.\{2\}/&\n/g' | $HOST_ENDIAN_CMD)" +bpftool map update pinned $FILE key hex $NS_ID_HEX value hex 00 00 00 00 any +``` + +Execute a command in this terminal: + +``` +# ping kinvolk.io +``` + +You'll see how on the `execsnoop` terminal you started above the call is logged: + +``` +# tools/execsnoop.py --mntnsmap /sys/fs/bpf/mnt_ns_set +[sudo] password for mvb: +PCOMM PID PPID RET ARGS +ping 8096 7970 0 /bin/ping kinvolk.io +``` diff --git a/docs/tutorial_bcc_python_developer.md b/docs/tutorial_bcc_python_developer.md index a06f4b7f0..bf068e29b 100644 --- a/docs/tutorial_bcc_python_developer.md +++ b/docs/tutorial_bcc_python_developer.md @@ -48,7 +48,7 @@ Improve it by printing "Tracing sys_sync()... Ctrl-C to end." when the program f ### Lesson 3. hello_fields.py -This program is in [examples/tracing/hello_fields.py](../examples/tracing/trace_fields.py). Sample output (run commands in another session): +This program is in [examples/tracing/hello_fields.py](../examples/tracing/hello_fields.py). Sample output (run commands in another session): ``` # ./examples/tracing/hello_fields.py @@ -128,7 +128,7 @@ int do_trace(struct pt_regs *ctx) { // attempt to read stored timestamp tsp = last.lookup(&key); - if (tsp != 0) { + if (tsp != NULL) { delta = bpf_ktime_get_ns() - *tsp; if (delta < 1000000000) { // output if time is less than 1 second @@ -163,6 +163,7 @@ Things to learn: 1. ```BPF_HASH(last)```: Creates a BPF map object that is a hash (associative array), called "last". We didn't specify any further arguments, so it defaults to key and value types of u64. 1. ```key = 0```: We'll only store one key/value pair in this hash, where the key is hardwired to zero. 1. ```last.lookup(&key)```: Lookup the key in the hash, and return a pointer to its value if it exists, else NULL. We pass the key in as an address to a pointer. +1. ```if (tsp != NULL) {```: The verifier requires that pointer values derived from a map lookup must be checked for a null value before they can be dereferenced and used. 1. ```last.delete(&key)```: Delete the key from the hash. This is currently required because of [a kernel bug in `.update()`](https://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=a6ed3ea65d9868fdf9eff84e6fe4f666b8d14b02). 1. ```last.update(&key, &ts)```: Associate the value in the 2nd argument to the key, overwriting any previous value. This records the timestamp. @@ -219,7 +220,7 @@ void trace_completion(struct pt_regs *ctx, struct request *req) { b.attach_kprobe(event="blk_start_request", fn_name="trace_start") b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_start") -b.attach_kprobe(event="blk_account_io_completion", fn_name="trace_completion") +b.attach_kprobe(event="blk_account_io_done", fn_name="trace_completion") [...] ``` @@ -228,7 +229,7 @@ Things to learn: 1. ```REQ_WRITE```: We're defining a kernel constant in the Python program because we'll use it there later. If we were using REQ_WRITE in the BPF program, it should just work (without needing to be defined) with the appropriate #includes. 1. ```trace_start(struct pt_regs *ctx, struct request *req)```: This function will later be attached to kprobes. The arguments to kprobe functions are ```struct pt_regs *ctx```, for registers and BPF context, and then the actual arguments to the function. We'll attach this to blk_start_request(), where the first argument is ```struct request *```. 1. ```start.update(&req, &ts)```: We're using the pointer to the request struct as a key in our hash. What? This is commonplace in tracing. Pointers to structs turn out to be great keys, as they are unique: two structs can't have the same pointer address. (Just be careful about when it gets free'd and reused.) So what we're really doing is tagging the request struct, which describes the disk I/O, with our own timestamp, so that we can time it. There's two common keys used for storing timestamps: pointers to structs, and, thread IDs (for timing function entry to return). -1. ```req->__data_len```: We're dereferencing members of ```struct request```. See its definition in the kernel source for what members are there. bcc actually rewrites these expressions to be a series of ```bpf_probe_read()``` calls. Sometimes bcc can't handle a complex dereference, and you need to call ```bpf_probe_read()``` directly. +1. ```req->__data_len```: We're dereferencing members of ```struct request```. See its definition in the kernel source for what members are there. bcc actually rewrites these expressions to be a series of ```bpf_probe_read_kernel()``` calls. Sometimes bcc can't handle a complex dereference, and you need to call ```bpf_probe_read_kernel()``` directly. This is a pretty interesting program, and if you can understand all the code, you'll understand many important basics. We're still using the bpf_trace_printk() hack, so let's fix that next. @@ -350,7 +351,7 @@ b = BPF(text=""" BPF_HISTOGRAM(dist); -int kprobe__blk_account_io_completion(struct pt_regs *ctx, struct request *req) +int kprobe__blk_account_io_done(struct pt_regs *ctx, struct request *req) { dist.increment(bpf_log2l(req->__data_len / 1024)); return 0; @@ -373,7 +374,7 @@ b["dist"].print_log2_hist("kbytes") A recap from earlier lessons: - ```kprobe__```: This prefix means the rest will be treated as a kernel function name that will be instrumented using kprobe. -- ```struct pt_regs *ctx, struct request *req```: Arguments to kprobe. The ```ctx``` is registers and BPF context, the ```req``` is the first argument to the instrumented function: ```blk_account_io_completion()```. +- ```struct pt_regs *ctx, struct request *req```: Arguments to kprobe. The ```ctx``` is registers and BPF context, the ```req``` is the first argument to the instrumented function: ```blk_account_io_done()```. - ```req->__data_len```: Dereferencing that member. New things to learn: @@ -556,7 +557,7 @@ int count(struct pt_regs *ctx) { struct key_t key = {}; u64 zero = 0, *val; - bpf_probe_read(&key.c, sizeof(key.c), (void *)PT_REGS_PARM1(ctx)); + bpf_probe_read_user(&key.c, sizeof(key.c), (void *)PT_REGS_PARM1(ctx)); // could also use `counts.increment(key)` val = counts.lookup_or_try_init(&key, &zero); if (val) { @@ -620,7 +621,7 @@ int do_trace(struct pt_regs *ctx) { uint64_t addr; char path[128]={0}; bpf_usdt_readarg(6, ctx, &addr); - bpf_probe_read(&path, sizeof(path), (void *)addr); + bpf_probe_read_user(&path, sizeof(path), (void *)addr); bpf_trace_printk("path:%s\\n", path); return 0; }; @@ -640,7 +641,7 @@ b = BPF(text=bpf_text, usdt_contexts=[u]) Things to learn: 1. ```bpf_usdt_readarg(6, ctx, &addr)```: Read the address of argument 6 from the USDT probe into ```addr```. -1. ```bpf_probe_read(&path, sizeof(path), (void *)addr)```: Now the string ```addr``` points to into our ```path``` variable. +1. ```bpf_probe_read_user(&path, sizeof(path), (void *)addr)```: Now the string ```addr``` points to into our ```path``` variable. 1. ```u = USDT(pid=int(pid))```: Initialize USDT tracing for the given PID. 1. ```u.enable_probe(probe="http__server__request", fn_name="do_trace")```: Attach our ```do_trace()``` BPF C function to the Node.js ```http__server__request``` USDT probe. 1. ```b = BPF(text=bpf_text, usdt_contexts=[u])```: Need to pass in our USDT object, ```u```, to BPF object creation. @@ -713,7 +714,7 @@ These programs can be found in the files [examples/tracing/task_switch.c](../exa For further study, see Sasha Goldshtein's [linux-tracing-workshop](https://github.com/goldshtn/linux-tracing-workshop), which contains additional labs. There are also many tools in bcc /tools to study. -Please read [CONTRIBUTING-SCRIPTS.md](../CONTRIBUTING-SCRIPTS.md) if you wish to contrubite tools to bcc. At the bottom of the main [README.md](../README.md), you'll also find methods for contacting us. Good luck, and happy tracing! +Please read [CONTRIBUTING-SCRIPTS.md](../CONTRIBUTING-SCRIPTS.md) if you wish to contribute tools to bcc. At the bottom of the main [README.md](../README.md), you'll also find methods for contacting us. Good luck, and happy tracing! ## Networking diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt index c801cc9f9..dae0e9ce7 100644 --- a/examples/cpp/CMakeLists.txt +++ b/examples/cpp/CMakeLists.txt @@ -1,10 +1,14 @@ # Copyright (c) Facebook, Inc. # Licensed under the Apache License, Version 2.0 (the "License") +include_directories(${CMAKE_BINARY_DIR}/src/cc) include_directories(${CMAKE_SOURCE_DIR}/src/cc) include_directories(${CMAKE_SOURCE_DIR}/src/cc/api) include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + option(INSTALL_CPP_EXAMPLES "Install C++ examples. Those binaries are statically linked and can take plenty of disk space" OFF) add_executable(HelloWorld HelloWorld.cc) @@ -34,6 +38,12 @@ target_link_libraries(UseExternalMap bcc-static) add_executable(CGroupTest CGroupTest.cc) target_link_libraries(CGroupTest bcc-static) +add_executable(TaskIterator TaskIterator.cc) +target_link_libraries(TaskIterator bcc-static) + +add_executable(SkLocalStorageIterator SkLocalStorageIterator.cc) +target_link_libraries(SkLocalStorageIterator bcc-static) + if(INSTALL_CPP_EXAMPLES) install (TARGETS HelloWorld DESTINATION share/bcc/examples/cpp) install (TARGETS CPUDistribution DESTINATION share/bcc/examples/cpp) diff --git a/examples/cpp/FollyRequestContextSwitch.cc b/examples/cpp/FollyRequestContextSwitch.cc index a1692e661..d2ff02c54 100644 --- a/examples/cpp/FollyRequestContextSwitch.cc +++ b/examples/cpp/FollyRequestContextSwitch.cc @@ -98,7 +98,7 @@ int main(int argc, char** argv) { return 1; } - auto attach_res = bpf->attach_usdt(u); + auto attach_res = bpf->attach_usdt_all(); if (attach_res.code() != 0) { std::cerr << attach_res.msg() << std::endl; return 1; @@ -114,7 +114,7 @@ int main(int argc, char** argv) { shutdown_handler = [&](int s) { std::cerr << "Terminating..." << std::endl; - bpf->detach_usdt(u); + bpf->detach_usdt_all(); delete bpf; exit(0); }; diff --git a/examples/cpp/HelloWorld.cc b/examples/cpp/HelloWorld.cc index 05e5509ee..e229ced32 100644 --- a/examples/cpp/HelloWorld.cc +++ b/examples/cpp/HelloWorld.cc @@ -8,6 +8,7 @@ #include #include +#include "bcc_version.h" #include "BPF.h" const std::string BPF_PROGRAM = R"( @@ -35,6 +36,8 @@ int main() { return 1; } + std::cout << "Starting HelloWorld with BCC " << LIBBCC_VERSION << std::endl; + while (true) { if (std::getline(pipe, line)) { std::cout << line << std::endl; diff --git a/examples/cpp/RandomRead.cc b/examples/cpp/RandomRead.cc index 8e38596c3..4851ddec6 100644 --- a/examples/cpp/RandomRead.cc +++ b/examples/cpp/RandomRead.cc @@ -24,14 +24,6 @@ const std::string BPF_PROGRAM = R"( #define CGROUP_FILTER 0 #endif -struct urandom_read_args { - // See /sys/kernel/debug/tracing/events/random/urandom_read/format - uint64_t common__unused; - int got_bits; - int pool_left; - int input_left; -}; - struct event_t { int pid; char comm[16]; @@ -42,7 +34,7 @@ struct event_t { BPF_PERF_OUTPUT(events); BPF_CGROUP_ARRAY(cgroup, 1); -int on_urandom_read(struct urandom_read_args* attr) { +int on_urandom_read(struct bpf_raw_tracepoint_args *ctx) { if (CGROUP_FILTER && (cgroup.check_current_task(0) != 1)) return 0; @@ -50,9 +42,11 @@ int on_urandom_read(struct urandom_read_args* attr) { event.pid = bpf_get_current_pid_tgid(); bpf_get_current_comm(&event.comm, sizeof(event.comm)); event.cpu = bpf_get_smp_processor_id(); - event.got_bits = attr->got_bits; + // from include/trace/events/random.h: + // TP_PROTO(int got_bits, int pool_left, int input_left) + event.got_bits = ctx->args[0]; - events.perf_submit(attr, &event, sizeof(event)); + events.perf_submit(ctx, &event, sizeof(event)); return 0; } )"; @@ -126,7 +120,7 @@ int main(int argc, char** argv) { } auto attach_res = - bpf->attach_tracepoint("random:urandom_read", "on_urandom_read"); + bpf->attach_raw_tracepoint("urandom_read", "on_urandom_read"); if (attach_res.code() != 0) { std::cerr << attach_res.msg() << std::endl; return 1; diff --git a/examples/cpp/RecordMySQLQuery.cc b/examples/cpp/RecordMySQLQuery.cc index 09233ac7c..6d49eee9b 100644 --- a/examples/cpp/RecordMySQLQuery.cc +++ b/examples/cpp/RecordMySQLQuery.cc @@ -34,7 +34,7 @@ int probe_mysql_query(struct pt_regs *ctx, void* thd, char* query, size_t len) { key.ts = bpf_ktime_get_ns(); key.pid = bpf_get_current_pid_tgid(); - bpf_probe_read_str(&key.query, sizeof(key.query), query); + bpf_probe_read_user_str(&key.query, sizeof(key.query), query); int one = 1; queries.update(&key, &one); diff --git a/examples/cpp/SkLocalStorageIterator.cc b/examples/cpp/SkLocalStorageIterator.cc new file mode 100644 index 000000000..fdcf1d5f0 --- /dev/null +++ b/examples/cpp/SkLocalStorageIterator.cc @@ -0,0 +1,183 @@ +/* + * Copyright (c) Facebook, Inc. + * Licensed under the Apache License, Version 2.0 (the "License") + * + * Usage: + * ./SkLocalStorageIterator + * + * BPF socket local storage map iterator supported is added in 5.9. + * But since it takes locks during iterating, it may have performance + * implication if in parallel some other bpf program or user space + * is doing map update/delete for sockets in the same bucket. The issue + * is fixed in 5.10 with the following patch which uses rcu lock instead: + * https://lore.kernel.org/bpf/20200916224645.720172-1-yhs@fb.com + * + * This example shows how to dump local storage data from all sockets + * associated with one socket local storage map. + * An example output likes below: + * family prot val + * 2 17 20 + * 2 17 10 + */ + +#include +#include +#include +#include +#include + +#include "bcc_version.h" +#include "BPF.h" + +const std::string BPF_PROGRAM = R"( + +#include +#include +#include + +/* the structure is defined in .c file, so explicitly define + * the structure here. + */ +struct bpf_iter__bpf_sk_storage_map { + union { + struct bpf_iter_meta *meta; + }; + union { + struct bpf_map *map; + }; + union { + struct sock *sk; + }; + union { + void *value; + }; +}; + +BPF_SK_STORAGE(sk_data_map, __u64); + +struct info_t { + __u32 family; + __u32 protocol; + __u64 val; +}; + +BPF_ITER(bpf_sk_storage_map) { + struct seq_file *seq = ctx->meta->seq; + struct sock *sk = ctx->sk; + __u64 *val = ctx->value; + struct info_t info = {}; + + if (sk == (void *)0 || val == (void *)0) + return 0; + + info.family = sk->sk_family; + info.protocol = sk->sk_protocol; + info.val = *val; + bpf_seq_write(seq, &info, sizeof(info)); + + return 0; +} +)"; + +struct info_t { + unsigned family; + unsigned protocol; + unsigned long long val; +}; + +int main() { + ebpf::BPF bpf; + auto res = bpf.init(BPF_PROGRAM); + if (res.code() != 0) { + std::cerr << res.msg() << std::endl; + return 1; + } + + // create two sockets + int sockfd1 = socket(AF_INET, SOCK_DGRAM, 0); + if (sockfd1 < 0) { + std::cerr << "socket1 create failure: " << sockfd1 << std::endl; + return 1; + } + + int sockfd2 = socket(AF_INET, SOCK_DGRAM, 0); + if (sockfd2 < 0) { + std::cerr << "socket2 create failure: " << sockfd2 << std::endl; + close(sockfd1); + return 1; + } + + unsigned long long v1 = 10, v2 = 20; + auto sk_table = bpf.get_sk_storage_table("sk_data_map"); + + res = sk_table.update_value(sockfd1, v1); + if (res.code() != 0) { + std::cerr << "sk_data_map sockfd1 update failure: " << res.msg() << std::endl; + close(sockfd2); + close(sockfd1); + return 1; + } + + res = sk_table.update_value(sockfd2, v2); + if (res.code() != 0) { + std::cerr << "sk_data_map sockfd2 update failure: " << res.msg() << std::endl; + close(sockfd2); + close(sockfd1); + return 1; + } + + int prog_fd; + res = bpf.load_func("bpf_iter__bpf_sk_storage_map", BPF_PROG_TYPE_TRACING, prog_fd); + if (res.code() != 0) { + std::cerr << res.msg() << std::endl; + return 1; + } + + union bpf_iter_link_info link_info = {}; + link_info.map.map_fd = sk_table.get_fd(); + int link_fd = bcc_iter_attach(prog_fd, &link_info, sizeof(union bpf_iter_link_info)); + if (link_fd < 0) { + std::cerr << "bcc_iter_attach failed: " << link_fd << std::endl; + close(sockfd2); + close(sockfd1); + return 1; + } + + int iter_fd = bcc_iter_create(link_fd); + if (iter_fd < 0) { + std::cerr << "bcc_iter_create failed: " << iter_fd << std::endl; + close(link_fd); + close(sockfd2); + close(sockfd1); + return 1; + } + + // Header. + printf("family\tprot\tval\n"); + + struct info_t info[20]; + int len, leftover = 0, info_size = 20 * sizeof(struct info_t); + while ((len = read(iter_fd, (char *)info + leftover, info_size - leftover))) { + if (len < 0) { + if (len == -EAGAIN) + continue; + std::cerr << "read failed: " << len << std::endl; + break; + } + + int num_info = len / sizeof(struct info_t); + for (int i = 0; i < num_info; i++) { + printf("%d\t%d\t%lld\n", info[i].family, info[i].protocol, info[i].val); + } + + leftover = len % sizeof(struct info_t); + if (num_info > 0) + memcpy(info, (void *)&info[num_info], leftover); + } + + close(iter_fd); + close(link_fd); + close(sockfd2); + close(sockfd1); + return 0; +} diff --git a/examples/cpp/TaskIterator.cc b/examples/cpp/TaskIterator.cc new file mode 100644 index 000000000..3815e3aa1 --- /dev/null +++ b/examples/cpp/TaskIterator.cc @@ -0,0 +1,141 @@ +/* + * Copyright (c) Facebook, Inc. + * Licensed under the Apache License, Version 2.0 (the "License") + * + * Usage: + * ./TaskIterator + * + * BPF task iterator is available since linux 5.8. + * This example shows how to dump all threads in the system with + * bpf iterator. An example output likes below: + * tid comm + * 1 systemd + * 2 kthreadd + * 3 rcu_gp + * 4 rcu_par_gp + * 6 kworker/0:0H + * ... + * 2613386 sleep + * 2613474 GetCountersCPU6 + * 2613587 GetCountersCPU7 + * 2613621 CPUThreadPool69 + * 2613906 GetCountersCPU5 + * 2614140 GetCountersCPU2 + * 2614193 CfgrExtension56 + * 2614449 ruby-timer-thr + * 2614529 chef-client + * 2615122 systemd-hostnam + * ... + * 2608477 sudo + * 2608478 TaskIterator + */ + +#include +#include +#include +#include + +#include "bcc_version.h" +#include "BPF.h" + +const std::string BPF_PROGRAM = R"( +#include +#include +#include + +/* the structure is defined in .c file, so explicitly define + * the structure here. + */ +struct bpf_iter__task { + union { + struct bpf_iter_meta *meta; + }; + union { + struct task_struct *task; + }; +}; + +struct info_t { + int tid; + char comm[TASK_COMM_LEN]; +}; + +BPF_ITER(task) { + struct seq_file *seq = ctx->meta->seq; + struct task_struct *task = ctx->task; + struct info_t info = {}; + + if (task == (void *)0) + return 0; + + info.tid = task->pid; + __builtin_memcpy(&info.comm, task->comm, sizeof(info.comm)); + bpf_seq_write(seq, &info, sizeof(info)); + + return 0; +} +)"; + +// linux/sched.h +#define TASK_COMM_LEN 16 + +struct info_t { + int tid; + char comm[TASK_COMM_LEN]; +}; + +int main() { + ebpf::BPF bpf; + auto res = bpf.init(BPF_PROGRAM); + if (res.code() != 0) { + std::cerr << res.msg() << std::endl; + return 1; + } + + int prog_fd; + res = bpf.load_func("bpf_iter__task", BPF_PROG_TYPE_TRACING, prog_fd); + if (res.code() != 0) { + std::cerr << res.msg() << std::endl; + return 1; + } + + int link_fd = bcc_iter_attach(prog_fd, NULL, 0); + if (link_fd < 0) { + std::cerr << "bcc_iter_attach failed: " << link_fd << std::endl; + return 1; + } + + int iter_fd = bcc_iter_create(link_fd); + if (iter_fd < 0) { + std::cerr << "bcc_iter_create failed: " << iter_fd << std::endl; + close(link_fd); + return 1; + } + + // Header. + printf("tid\tcomm\n"); + + struct info_t info[20]; + int len, leftover = 0, info_size = 20 * sizeof(struct info_t); + while ((len = read(iter_fd, (char *)info + leftover, info_size - leftover))) { + if (len < 0) { + if (len == -EAGAIN) + continue; + std::cerr << "read failed: " << len << std::endl; + break; + } + + int num_info = len / sizeof(struct info_t); + for (int i = 0; i < num_info; i++) { + printf("%d\t%s\n", info[i].tid, info[i].comm); + } + + leftover = len % sizeof(struct info_t); + if (num_info > 0) + memcpy(info, (void *)&info[num_info], leftover); + } + + close(iter_fd); + close(link_fd); + return 0; +} diff --git a/examples/cpp/pyperf/PyPerfBPFProgram.cc b/examples/cpp/pyperf/PyPerfBPFProgram.cc index e04f743ee..c2a2c862e 100644 --- a/examples/cpp/pyperf/PyPerfBPFProgram.cc +++ b/examples/cpp/pyperf/PyPerfBPFProgram.cc @@ -139,7 +139,7 @@ static inline __attribute__((__always_inline__)) void* get_thread_state( // p *(PyThreadState*)((struct pthread*)pthread_self())-> // specific_1stblock[autoTLSkey]->data int key; - bpf_probe_read(&key, sizeof(key), (void*)pid_data->tls_key_addr); + bpf_probe_read_user(&key, sizeof(key), (void*)pid_data->tls_key_addr); // This assumes autoTLSkey < 32, which means that the TLS is stored in // pthread->specific_1stblock[autoTLSkey] // 0x310 is offsetof(struct pthread, specific_1stblock), @@ -148,7 +148,7 @@ static inline __attribute__((__always_inline__)) void* get_thread_state( // 'struct pthread' is not in the public API so we have to hardcode // the offsets here void* thread_state; - bpf_probe_read( + bpf_probe_read_user( &thread_state, sizeof(thread_state), tls_base + 0x310 + key * 0x10 + 0x08); @@ -206,7 +206,7 @@ static inline __attribute__((__always_inline__)) int get_gil_state( int gil_locked = 0; void* gil_thread_state = 0; - if (bpf_probe_read( + if (bpf_probe_read_user( &gil_locked, sizeof(gil_locked), (void*)pid_data->gil_locked_addr)) { return GIL_STATE_ERROR; } @@ -218,7 +218,7 @@ static inline __attribute__((__always_inline__)) int get_gil_state( return GIL_STATE_NOT_LOCKED; case 1: // GIL is held by some Thread - bpf_probe_read( + bpf_probe_read_user( &gil_thread_state, sizeof(void*), (void*)pid_data->gil_last_holder_addr); @@ -244,7 +244,7 @@ get_pthread_id_match(void* thread_state, void* tls_base, PidData* pid_data) { uint64_t pthread_self, pthread_created; - bpf_probe_read( + bpf_probe_read_user( &pthread_created, sizeof(pthread_created), thread_state + pid_data->offsets.PyThreadState_thread); @@ -253,7 +253,7 @@ get_pthread_id_match(void* thread_state, void* tls_base, PidData* pid_data) { } // 0x10 = offsetof(struct pthread, header.self) - bpf_probe_read(&pthread_self, sizeof(pthread_self), tls_base + 0x10); + bpf_probe_read_user(&pthread_self, sizeof(pthread_self), tls_base + 0x10); if (pthread_self == 0) { return PTHREAD_ID_ERROR; } @@ -287,7 +287,7 @@ int on_event(struct pt_regs* ctx) { // Get pointer of global PyThreadState, which should belong to the Thread // currently holds the GIL void* global_current_thread = (void*)0; - bpf_probe_read( + bpf_probe_read_user( &global_current_thread, sizeof(global_current_thread), (void*)pid_data->current_state_addr); @@ -331,7 +331,7 @@ int on_event(struct pt_regs* ctx) { if (thread_state != 0) { // Get pointer to top frame from PyThreadState - bpf_probe_read( + bpf_probe_read_user( &state->frame_ptr, sizeof(void*), thread_state + pid_data->offsets.PyThreadState_frame); @@ -356,11 +356,11 @@ static inline __attribute__((__always_inline__)) void get_names( // the name. This is not perfect but there is no better way to figure this // out from the code object. void* args_ptr; - bpf_probe_read( + bpf_probe_read_user( &args_ptr, sizeof(void*), code_ptr + offsets->PyCodeObject_varnames); - bpf_probe_read( + bpf_probe_read_user( &args_ptr, sizeof(void*), args_ptr + offsets->PyTupleObject_item); - bpf_probe_read_str( + bpf_probe_read_user_str( &symbol->name, sizeof(symbol->name), args_ptr + offsets->String_data); // compare strings as ints to save instructions @@ -382,26 +382,26 @@ static inline __attribute__((__always_inline__)) void get_names( // Read class name from $frame->f_localsplus[0]->ob_type->tp_name. if (first_self || first_cls) { void* ptr; - bpf_probe_read( + bpf_probe_read_user( &ptr, sizeof(void*), cur_frame + offsets->PyFrameObject_localsplus); if (first_self) { // we are working with an instance, first we need to get type - bpf_probe_read(&ptr, sizeof(void*), ptr + offsets->PyObject_type); + bpf_probe_read_user(&ptr, sizeof(void*), ptr + offsets->PyObject_type); } - bpf_probe_read(&ptr, sizeof(void*), ptr + offsets->PyTypeObject_name); - bpf_probe_read_str(&symbol->classname, sizeof(symbol->classname), ptr); + bpf_probe_read_user(&ptr, sizeof(void*), ptr + offsets->PyTypeObject_name); + bpf_probe_read_user_str(&symbol->classname, sizeof(symbol->classname), ptr); } void* pystr_ptr; // read PyCodeObject's filename into symbol - bpf_probe_read( + bpf_probe_read_user( &pystr_ptr, sizeof(void*), code_ptr + offsets->PyCodeObject_filename); - bpf_probe_read_str( + bpf_probe_read_user_str( &symbol->file, sizeof(symbol->file), pystr_ptr + offsets->String_data); // read PyCodeObject's name into symbol - bpf_probe_read( + bpf_probe_read_user( &pystr_ptr, sizeof(void*), code_ptr + offsets->PyCodeObject_name); - bpf_probe_read_str( + bpf_probe_read_user_str( &symbol->name, sizeof(symbol->name), pystr_ptr + offsets->String_data); } @@ -419,7 +419,7 @@ static inline __attribute__((__always_inline__)) bool get_frame_data( } void* code_ptr; // read PyCodeObject first, if that fails, then no point reading next frame - bpf_probe_read( + bpf_probe_read_user( &code_ptr, sizeof(void*), cur_frame + offsets->PyFrameObject_code); if (!code_ptr) { return false; @@ -428,7 +428,7 @@ static inline __attribute__((__always_inline__)) bool get_frame_data( get_names(cur_frame, code_ptr, offsets, symbol, ctx); // read next PyFrameObject pointer, update in place - bpf_probe_read( + bpf_probe_read_user( frame_ptr, sizeof(void*), cur_frame + offsets->PyFrameObject_back); return true; diff --git a/examples/lua/bashreadline.c b/examples/lua/bashreadline.c index fad33d7dd..917f944d8 100644 --- a/examples/lua/bashreadline.c +++ b/examples/lua/bashreadline.c @@ -15,7 +15,8 @@ int printret(struct pt_regs *ctx) return 0; pid = bpf_get_current_pid_tgid(); data.pid = pid; - bpf_probe_read(&data.str, sizeof(data.str), (void *)PT_REGS_RC(ctx)); + bpf_probe_read_user(&data.str, sizeof(data.str), + (void *)PT_REGS_RC(ctx)); events.perf_submit(ctx, &data, sizeof(data)); return 0; }; diff --git a/examples/lua/kprobe-latency.lua b/examples/lua/kprobe-latency.lua index 60ac2c1c7..98464e5c2 100644 --- a/examples/lua/kprobe-latency.lua +++ b/examples/lua/kprobe-latency.lua @@ -30,7 +30,7 @@ local lat_map = bpf.map('array', bins) local trace_start = bpf.kprobe('myprobe:blk_start_request', function (ptregs) map[ptregs.parm1] = time() end, false, -1, 0) -local trace_end = bpf.kprobe('myprobe2:blk_account_io_completion', function (ptregs) +local trace_end = bpf.kprobe('myprobe2:blk_account_io_done', function (ptregs) -- The lines below are computing index -- using log10(x)*10 = log2(x)*10/log2(10) = log2(x)*3 -- index = 29 ~ 1 usec diff --git a/examples/lua/strlen_count.lua b/examples/lua/strlen_count.lua index 553d043e7..5a6b00091 100755 --- a/examples/lua/strlen_count.lua +++ b/examples/lua/strlen_count.lua @@ -26,7 +26,7 @@ int printarg(struct pt_regs *ctx) { if (pid != PID) return 0; char str[128] = {}; - bpf_probe_read(&str, sizeof(str), (void *)PT_REGS_PARM1(ctx)); + bpf_probe_read_user(&str, sizeof(str), (void *)PT_REGS_PARM1(ctx)); bpf_trace_printk("strlen(\"%s\")\n", &str); return 0; }; diff --git a/examples/lua/usdt_ruby.lua b/examples/lua/usdt_ruby.lua index 5b5df2d0f..94c059c28 100755 --- a/examples/lua/usdt_ruby.lua +++ b/examples/lua/usdt_ruby.lua @@ -22,7 +22,7 @@ int trace_method(struct pt_regs *ctx) { bpf_usdt_readarg(2, ctx, &addr); char fn_name[128] = {}; - bpf_probe_read(&fn_name, sizeof(fn_name), (void *)addr); + bpf_probe_read_user(&fn_name, sizeof(fn_name), (void *)addr); bpf_trace_printk("%s(...)\n", fn_name); return 0; diff --git a/examples/networking/http_filter/http-parse-complete.c b/examples/networking/http_filter/http-parse-complete.c index 01a234ea2..61cee0fba 100644 --- a/examples/networking/http_filter/http-parse-complete.c +++ b/examples/networking/http_filter/http-parse-complete.c @@ -138,7 +138,7 @@ int http_filter(struct __sk_buff *skb) { } goto DROP; - //keep the packet and send it to userspace retruning -1 + //keep the packet and send it to userspace returning -1 HTTP_MATCH: //if not already present, insert into map sessions.lookup_or_try_init(&key,&zero); diff --git a/examples/networking/http_filter/http-parse-complete.py b/examples/networking/http_filter/http-parse-complete.py index 0f9951051..324232d54 100644 --- a/examples/networking/http_filter/http-parse-complete.py +++ b/examples/networking/http_filter/http-parse-complete.py @@ -1,86 +1,82 @@ #!/usr/bin/python # -#Bertrone Matteo - Polytechnic of Turin -#November 2015 +# Bertrone Matteo - Polytechnic of Turin +# November 2015 # -#eBPF application that parses HTTP packets -#and extracts (and prints on screen) the URL contained in the GET/POST request. +# eBPF application that parses HTTP packets +# and extracts (and prints on screen) the URL +# contained in the GET/POST request. # -#eBPF program http_filter is used as SOCKET_FILTER attached to eth0 interface. -#only packet of type ip and tcp containing HTTP GET/POST are returned to userspace, others dropped +# eBPF program http_filter is used as SOCKET_FILTER attached to eth0 interface. +# Only packets of type ip and tcp containing HTTP GET/POST are +# returned to userspace, others dropped # -#python script uses bcc BPF Compiler Collection by iovisor (https://github.com/iovisor/bcc) -#and prints on stdout the first line of the HTTP GET/POST request containing the url +# Python script uses bcc BPF Compiler Collection by +# iovisor (https://github.com/iovisor/bcc) and prints on stdout the first +# line of the HTTP GET/POST request containing the url from __future__ import print_function from bcc import BPF -from ctypes import * -from struct import * from sys import argv -import sys import socket import os -import struct import binascii import time -CLEANUP_N_PACKETS = 50 #run cleanup every CLEANUP_N_PACKETS packets received -MAX_URL_STRING_LEN = 8192 #max url string len (usually 8K) -MAX_AGE_SECONDS = 30 #max age entry in bpf_sessions map +CLEANUP_N_PACKETS = 50 # cleanup every CLEANUP_N_PACKETS packets received +MAX_URL_STRING_LEN = 8192 # max url string len (usually 8K) +MAX_AGE_SECONDS = 30 # max age entry in bpf_sessions map -#convert a bin string into a string of hex char -#helper function to print raw packet in hex + +# convert a bin string into a string of hex char +# helper function to print raw packet in hex def toHex(s): - lst = [] + lst = "" for ch in s: hv = hex(ord(ch)).replace('0x', '') if len(hv) == 1: - hv = '0'+hv - lst.append(hv) - - return reduce(lambda x,y:x+y, lst) - -#print str until CR+LF -def printUntilCRLF(str): - for k in range (0,len(str)-1): - if (str[k] == '\n'): - if (str[k-1] == '\r'): - print ("") - return - print ("%c" % (str[k]), end = "") - print("") - return + hv = '0' + hv + lst = lst + hv + return lst + -#cleanup function +# print str until CR+LF +def printUntilCRLF(s): + print(s.split(b'\r\n')[0].decode()) + + +# cleanup function def cleanup(): - #get current time in seconds + # get current time in seconds current_time = int(time.time()) - #looking for leaf having: - #timestap == 0 --> update with current timestamp - #AGE > MAX_AGE_SECONDS --> delete item - for key,leaf in bpf_sessions.items(): - try: - current_leaf = bpf_sessions[key] - #set timestamp if timestamp == 0 - if (current_leaf.timestamp == 0): - bpf_sessions[key] = bpf_sessions.Leaf(current_time) - else: - #delete older entries - if (current_time - current_leaf.timestamp > MAX_AGE_SECONDS): - del bpf_sessions[key] - except: - print("cleanup exception.") + # looking for leaf having: + # timestap == 0 --> update with current timestamp + # AGE > MAX_AGE_SECONDS --> delete item + for key, leaf in bpf_sessions.items(): + try: + current_leaf = bpf_sessions[key] + # set timestamp if timestamp == 0 + if (current_leaf.timestamp == 0): + bpf_sessions[key] = bpf_sessions.Leaf(current_time) + else: + # delete older entries + if (current_time - current_leaf.timestamp > MAX_AGE_SECONDS): + del bpf_sessions[key] + except: + print("cleanup exception.") return -#args + +# args def usage(): print("USAGE: %s [-i ]" % argv[0]) print("") print("Try '%s -h' for more options." % argv[0]) exit() -#help + +# help def help(): print("USAGE: %s [-i ]" % argv[0]) print("") @@ -93,206 +89,218 @@ def help(): print(" http-parse -i wlan0 # bind socket to wlan0") exit() -#arguments -interface="eth0" + +# arguments +interface = "eth0" if len(argv) == 2: - if str(argv[1]) == '-h': - help() - else: - usage() + if str(argv[1]) == '-h': + help() + else: + usage() if len(argv) == 3: - if str(argv[1]) == '-i': - interface = argv[2] - else: - usage() + if str(argv[1]) == '-i': + interface = argv[2] + else: + usage() if len(argv) > 3: - usage() + usage() -print ("binding socket to '%s'" % interface) +print("binding socket to '%s'" % interface) # initialize BPF - load source code from http-parse-complete.c -bpf = BPF(src_file = "http-parse-complete.c",debug = 0) +bpf = BPF(src_file="http-parse-complete.c", debug=0) -#load eBPF program http_filter of type SOCKET_FILTER into the kernel eBPF vm -#more info about eBPF program types -#http://man7.org/linux/man-pages/man2/bpf.2.html +# load eBPF program http_filter of type SOCKET_FILTER into the kernel eBPF vm +# more info about eBPF program types +# http://man7.org/linux/man-pages/man2/bpf.2.html function_http_filter = bpf.load_func("http_filter", BPF.SOCKET_FILTER) -#create raw socket, bind it to interface -#attach bpf program to socket created +# create raw socket, bind it to interface +# attach bpf program to socket created BPF.attach_raw_socket(function_http_filter, interface) -#get file descriptor of the socket previously created inside BPF.attach_raw_socket +# get file descriptor of the socket previously +# created inside BPF.attach_raw_socket socket_fd = function_http_filter.sock -#create python socket object, from the file descriptor -sock = socket.fromfd(socket_fd,socket.PF_PACKET,socket.SOCK_RAW,socket.IPPROTO_IP) -#set it as blocking socket +# create python socket object, from the file descriptor +sock = socket.fromfd(socket_fd, socket.PF_PACKET, + socket.SOCK_RAW, socket.IPPROTO_IP) +# set it as blocking socket sock.setblocking(True) -#get pointer to bpf map of type hash +# get pointer to bpf map of type hash bpf_sessions = bpf.get_table("sessions") -#packets counter +# packets counter packet_count = 0 -#dictionary containing association -#if url is not entirely contained in only one packet, save the firt part of it in this local dict -#when I find \r\n in a next pkt, append and print all the url +# dictionary containing association +# . +# if url is not entirely contained in only one packet, +# save the firt part of it in this local dict +# when I find \r\n in a next pkt, append and print the whole url local_dictionary = {} while 1: - #retrieve raw packet from socket - packet_str = os.read(socket_fd,4096) #set packet length to max packet length on the interface - packet_count += 1 - - #DEBUG - print raw packet in hex format - #packet_hex = toHex(packet_str) - #print ("%s" % packet_hex) - - #convert packet into bytearray - packet_bytearray = bytearray(packet_str) - - #ethernet header length - ETH_HLEN = 14 - - #IP HEADER - #https://tools.ietf.org/html/rfc791 - # 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - # |Version| IHL |Type of Service| Total Length | - # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - # - #IHL : Internet Header Length is the length of the internet header - #value to multiply * 4 byte - #e.g. IHL = 5 ; IP Header Length = 5 * 4 byte = 20 byte - # - #Total length: This 16-bit field defines the entire packet size, - #including header and data, in bytes. - - #calculate packet total length - total_length = packet_bytearray[ETH_HLEN + 2] #load MSB - total_length = total_length << 8 #shift MSB - total_length = total_length + packet_bytearray[ETH_HLEN+3] #add LSB - - #calculate ip header length - ip_header_length = packet_bytearray[ETH_HLEN] #load Byte - ip_header_length = ip_header_length & 0x0F #mask bits 0..3 - ip_header_length = ip_header_length << 2 #shift to obtain length - - #retrieve ip source/dest - ip_src_str = packet_str[ETH_HLEN+12:ETH_HLEN+16] #ip source offset 12..15 - ip_dst_str = packet_str[ETH_HLEN+16:ETH_HLEN+20] #ip dest offset 16..19 - - ip_src = int(toHex(ip_src_str),16) - ip_dst = int(toHex(ip_dst_str),16) - - #TCP HEADER - #https://www.rfc-editor.org/rfc/rfc793.txt - # 12 13 14 15 - # 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 - # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - # | Data | |U|A|P|R|S|F| | - # | Offset| Reserved |R|C|S|S|Y|I| Window | - # | | |G|K|H|T|N|N| | - # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - # - #Data Offset: This indicates where the data begins. - #The TCP header is an integral number of 32 bits long. - #value to multiply * 4 byte - #e.g. DataOffset = 5 ; TCP Header Length = 5 * 4 byte = 20 byte - - #calculate tcp header length - tcp_header_length = packet_bytearray[ETH_HLEN + ip_header_length + 12] #load Byte - tcp_header_length = tcp_header_length & 0xF0 #mask bit 4..7 - tcp_header_length = tcp_header_length >> 2 #SHR 4 ; SHL 2 -> SHR 2 - - #retrieve port source/dest - port_src_str = packet_str[ETH_HLEN+ip_header_length:ETH_HLEN+ip_header_length+2] - port_dst_str = packet_str[ETH_HLEN+ip_header_length+2:ETH_HLEN+ip_header_length+4] - - port_src = int(toHex(port_src_str),16) - port_dst = int(toHex(port_dst_str),16) - - #calculate payload offset - payload_offset = ETH_HLEN + ip_header_length + tcp_header_length - - #payload_string contains only packet payload - payload_string = packet_str[(payload_offset):(len(packet_bytearray))] - - #CR + LF (substring to find) - crlf = "\r\n" - - #current_Key contains ip source/dest and port source/map - #useful for direct bpf_sessions map access - current_Key = bpf_sessions.Key(ip_src,ip_dst,port_src,port_dst) - - #looking for HTTP GET/POST request - if ((payload_string[:3] == "GET") or (payload_string[:4] == "POST") or (payload_string[:4] == "HTTP") \ - or ( payload_string[:3] == "PUT") or (payload_string[:6] == "DELETE") or (payload_string[:4] == "HEAD") ): - #match: HTTP GET/POST packet found - if (crlf in payload_string): - #url entirely contained in first packet -> print it all - printUntilCRLF(payload_string) - - #delete current_Key from bpf_sessions, url already printed. current session not useful anymore - try: - del bpf_sessions[current_Key] - except: - print ("error during delete from bpf map ") - else: - #url NOT entirely contained in first packet - #not found \r\n in payload. - #save current part of the payload_string in dictionary - local_dictionary[binascii.hexlify(current_Key)] = payload_string - else: - #NO match: HTTP GET/POST NOT found - - #check if the packet belong to a session saved in bpf_sessions - if (current_Key in bpf_sessions): - #check id the packet belong to a session saved in local_dictionary - #(local_dictionary maintains HTTP GET/POST url not printed yet because split in N packets) - if (binascii.hexlify(current_Key) in local_dictionary): - #first part of the HTTP GET/POST url is already present in local dictionary (prev_payload_string) - prev_payload_string = local_dictionary[binascii.hexlify(current_Key)] - #looking for CR+LF in current packet. + # retrieve raw packet from socket + packet_str = os.read(socket_fd, 4096) # set packet length to max packet length on the interface + packet_count += 1 + + # DEBUG - print raw packet in hex format + # packet_hex = toHex(packet_str) + # print ("%s" % packet_hex) + + # convert packet into bytearray + packet_bytearray = bytearray(packet_str) + + # ethernet header length + ETH_HLEN = 14 + + # IP HEADER + # https://tools.ietf.org/html/rfc791 + # 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + # |Version| IHL |Type of Service| Total Length | + # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + # + # IHL : Internet Header Length is the length of the internet header + # value to multiply * 4 byte + # e.g. IHL = 5 ; IP Header Length = 5 * 4 byte = 20 byte + # + # Total length: This 16-bit field defines the entire packet size, + # including header and data, in bytes. + + # calculate packet total length + total_length = packet_bytearray[ETH_HLEN + 2] # load MSB + total_length = total_length << 8 # shift MSB + total_length = total_length + packet_bytearray[ETH_HLEN + 3] # add LSB + + # calculate ip header length + ip_header_length = packet_bytearray[ETH_HLEN] # load Byte + ip_header_length = ip_header_length & 0x0F # mask bits 0..3 + ip_header_length = ip_header_length << 2 # shift to obtain length + + # retrieve ip source/dest + ip_src_str = packet_str[ETH_HLEN + 12: ETH_HLEN + 16] # ip source offset 12..15 + ip_dst_str = packet_str[ETH_HLEN + 16:ETH_HLEN + 20] # ip dest offset 16..19 + + ip_src = int(toHex(ip_src_str), 16) + ip_dst = int(toHex(ip_dst_str), 16) + + # TCP HEADER + # https://www.rfc-editor.org/rfc/rfc793.txt + # 12 13 14 15 + # 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + # | Data | |U|A|P|R|S|F| | + # | Offset| Reserved |R|C|S|S|Y|I| Window | + # | | |G|K|H|T|N|N| | + # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + # + # Data Offset: This indicates where the data begins. + # The TCP header is an integral number of 32 bits long. + # value to multiply * 4 byte + # e.g. DataOffset = 5 ; TCP Header Length = 5 * 4 byte = 20 byte + + # calculate tcp header length + tcp_header_length = packet_bytearray[ETH_HLEN + ip_header_length + 12] # load Byte + tcp_header_length = tcp_header_length & 0xF0 # mask bit 4..7 + tcp_header_length = tcp_header_length >> 2 # SHR 4 ; SHL 2 -> SHR 2 + + # retrieve port source/dest + port_src_str = packet_str[ETH_HLEN + ip_header_length:ETH_HLEN + ip_header_length + 2] + port_dst_str = packet_str[ETH_HLEN + ip_header_length + 2:ETH_HLEN + ip_header_length + 4] + + port_src = int(toHex(port_src_str), 16) + port_dst = int(toHex(port_dst_str), 16) + + # calculate payload offset + payload_offset = ETH_HLEN + ip_header_length + tcp_header_length + + # payload_string contains only packet payload + payload_string = packet_str[(payload_offset):(len(packet_bytearray))] + # CR + LF (substring to find) + crlf = b'\r\n' + + # current_Key contains ip source/dest and port source/map + # useful for direct bpf_sessions map access + current_Key = bpf_sessions.Key(ip_src, ip_dst, port_src, port_dst) + + # looking for HTTP GET/POST request + if ((payload_string[:3] == b'GET') or (payload_string[:4] == b'POST') + or (payload_string[:4] == b'HTTP') or (payload_string[:3] == b'PUT') + or (payload_string[:6] == b'DELETE') or (payload_string[:4] == b'HEAD')): + # match: HTTP GET/POST packet found if (crlf in payload_string): - #last packet. containing last part of HTTP GET/POST url split in N packets. - #append current payload - prev_payload_string += payload_string - #print HTTP GET/POST url - printUntilCRLF(prev_payload_string) - #clean bpf_sessions & local_dictionary - try: - del bpf_sessions[current_Key] - del local_dictionary[binascii.hexlify(current_Key)] - except: - print ("error deleting from map or dictionary") - else: - #NOT last packet. containing part of HTTP GET/POST url split in N packets. - #append current payload - prev_payload_string += payload_string - #check if not size exceeding (usually HTTP GET/POST url < 8K ) - if (len(prev_payload_string) > MAX_URL_STRING_LEN): - print("url too long") + # url entirely contained in first packet -> print it all + printUntilCRLF(payload_string) + + # delete current_Key from bpf_sessions, url already printed. + # current session not useful anymore try: - del bpf_sessions[current_Key] - del local_dictionary[binascii.hexlify(current_Key)] + del bpf_sessions[current_Key] except: - print ("error deleting from map or dict") - #update dictionary - local_dictionary[binascii.hexlify(current_Key)] = prev_payload_string - else: - #first part of the HTTP GET/POST url is NOT present in local dictionary - #bpf_sessions contains invalid entry -> delete it - try: - del bpf_sessions[current_Key] - except: - print ("error del bpf_session") - - #check if dirty entry are present in bpf_sessions - if (((packet_count) % CLEANUP_N_PACKETS) == 0): - cleanup() + print("error during delete from bpf map ") + else: + # url NOT entirely contained in first packet + # not found \r\n in payload. + # save current part of the payload_string in dictionary + # + local_dictionary[binascii.hexlify(current_Key)] = payload_string + else: + # NO match: HTTP GET/POST NOT found + + # check if the packet belong to a session saved in bpf_sessions + if (current_Key in bpf_sessions): + # check id the packet belong to a session saved in local_dictionary + # (local_dictionary maintains HTTP GET/POST url not + # printed yet because split in N packets) + if (binascii.hexlify(current_Key) in local_dictionary): + # first part of the HTTP GET/POST url is already present in + # local dictionary (prev_payload_string) + prev_payload_string = local_dictionary[binascii.hexlify(current_Key)] + # looking for CR+LF in current packet. + if (crlf in payload_string): + # last packet. containing last part of HTTP GET/POST + # url split in N packets. Append current payload + prev_payload_string += payload_string + # print HTTP GET/POST url + printUntilCRLF(prev_payload_string) + # clean bpf_sessions & local_dictionary + try: + del bpf_sessions[current_Key] + del local_dictionary[binascii.hexlify(current_Key)] + except: + print("error deleting from map or dictionary") + else: + # NOT last packet. Containing part of HTTP GET/POST url + # split in N packets. + # Append current payload + prev_payload_string += payload_string + # check if not size exceeding + # (usually HTTP GET/POST url < 8K ) + if (len(prev_payload_string) > MAX_URL_STRING_LEN): + print("url too long") + try: + del bpf_sessions[current_Key] + del local_dictionary[binascii.hexlify(current_Key)] + except: + print("error deleting from map or dict") + # update dictionary + local_dictionary[binascii.hexlify(current_Key)] = prev_payload_string + else: + # first part of the HTTP GET/POST url is + # NOT present in local dictionary + # bpf_sessions contains invalid entry -> delete it + try: + del bpf_sessions[current_Key] + except: + print("error del bpf_session") + + # check if dirty entry are present in bpf_sessions + if (((packet_count) % CLEANUP_N_PACKETS) == 0): + cleanup() diff --git a/examples/networking/http_filter/http-parse-simple.c b/examples/networking/http_filter/http-parse-simple.c index 6ec53023e..292cb7b44 100644 --- a/examples/networking/http_filter/http-parse-simple.c +++ b/examples/networking/http_filter/http-parse-simple.c @@ -103,7 +103,7 @@ int http_filter(struct __sk_buff *skb) { //no HTTP match goto DROP; - //keep the packet and send it to userspace retruning -1 + //keep the packet and send it to userspace returning -1 KEEP: return -1; diff --git a/examples/networking/http_filter/http-parse-simple.py b/examples/networking/http_filter/http-parse-simple.py index b702393d1..9d1e9aab0 100644 --- a/examples/networking/http_filter/http-parse-simple.py +++ b/examples/networking/http_filter/http-parse-simple.py @@ -144,7 +144,7 @@ def help(): #print first line of the HTTP GET/POST request #line ends with 0xOD 0xOA (\r\n) #(if we want to print all the header print until \r\n\r\n) - for i in range (payload_offset-1,len(packet_bytearray)-1): + for i in range (payload_offset,len(packet_bytearray)-1): if (packet_bytearray[i]== 0x0A): if (packet_bytearray[i-1] == 0x0D): break diff --git a/examples/networking/net_monitor.py b/examples/networking/net_monitor.py new file mode 100644 index 000000000..969ca284f --- /dev/null +++ b/examples/networking/net_monitor.py @@ -0,0 +1,133 @@ +#!/usr/bin/python +# +# net_monitor.py Aggregates incoming network traffic +# outputs source ip, destination ip, the number of their network traffic, and current time +# how to use : net_monitor.py +# +# Copyright (c) 2020 YoungEun Choe + +from bcc import BPF +import time +from ast import literal_eval +import sys + +def help(): + print("execute: {0} ".format(sys.argv[0])) + print("e.g.: {0} eno1\n".format(sys.argv[0])) + exit(1) + +if len(sys.argv) != 2: + help() +elif len(sys.argv) == 2: + INTERFACE = sys.argv[1] + +bpf_text = """ + +#include +#include +#include +#include + +#define IP_TCP 6 +#define IP_UDP 17 +#define IP_ICMP 1 +#define ETH_HLEN 14 + +BPF_PERF_OUTPUT(skb_events); +BPF_HASH(packet_cnt, u64, long, 256); + +int packet_monitor(struct __sk_buff *skb) { + u8 *cursor = 0; + u32 saddr, daddr; + long* count = 0; + long one = 1; + u64 pass_value = 0; + + struct ethernet_t *ethernet = cursor_advance(cursor, sizeof(*ethernet)); + + struct ip_t *ip = cursor_advance(cursor, sizeof(*ip)); + if (ip->nextp != IP_TCP) + { + if (ip -> nextp != IP_UDP) + { + if (ip -> nextp != IP_ICMP) + return 0; + } + } + + saddr = ip -> src; + daddr = ip -> dst; + + pass_value = saddr; + pass_value = pass_value << 32; + pass_value = pass_value + daddr; + + count = packet_cnt.lookup(&pass_value); + if (count) // check if this map exists + *count += 1; + else // if the map for the key doesn't exist, create one + { + packet_cnt.update(&pass_value, &one); + } + return -1; +} + +""" + +from ctypes import * +import ctypes as ct +import sys +import socket +import os +import struct + +OUTPUT_INTERVAL = 1 + +bpf = BPF(text=bpf_text) + +function_skb_matching = bpf.load_func("packet_monitor", BPF.SOCKET_FILTER) + +BPF.attach_raw_socket(function_skb_matching, INTERFACE) + + # retrieeve packet_cnt map +packet_cnt = bpf.get_table('packet_cnt') # retrieeve packet_cnt map + +def decimal_to_human(input_value): + input_value = int(input_value) + hex_value = hex(input_value)[2:] + pt3 = literal_eval((str('0x'+str(hex_value[-2:])))) + pt2 = literal_eval((str('0x'+str(hex_value[-4:-2])))) + pt1 = literal_eval((str('0x'+str(hex_value[-6:-4])))) + pt0 = literal_eval((str('0x'+str(hex_value[-8:-6])))) + result = str(pt0)+'.'+str(pt1)+'.'+str(pt2)+'.'+str(pt3) + return result + +try: + while True : + time.sleep(OUTPUT_INTERVAL) + packet_cnt_output = packet_cnt.items() + output_len = len(packet_cnt_output) + print('\n') + for i in range(0,output_len): + if (len(str(packet_cnt_output[i][0]))) != 30: + continue + temp = int(str(packet_cnt_output[i][0])[8:-2]) # initial output omitted from the kernel space program + temp = int(str(bin(temp))[2:]) # raw file + src = int(str(temp)[:32],2) # part1 + dst = int(str(temp)[32:],2) + pkt_num = str(packet_cnt_output[i][1])[7:-1] + + monitor_result = 'source address : ' + decimal_to_human(str(src)) + ' ' + 'destination address : ' + \ + decimal_to_human(str(dst)) + ' ' + pkt_num + ' ' + 'time : ' + str(time.localtime()[0])+\ + ';'+str(time.localtime()[1]).zfill(2)+';'+str(time.localtime()[2]).zfill(2)+';'+\ + str(time.localtime()[3]).zfill(2)+';'+str(time.localtime()[4]).zfill(2)+';'+\ + str(time.localtime()[5]).zfill(2) + print(monitor_result) + + # time.time() outputs time elapsed since 00:00 hours, 1st, Jan., 1970. + packet_cnt.clear() # delete map entires after printing output. confiremd it deletes values and keys too + +except KeyboardInterrupt: + sys.stdout.close() + pass + diff --git a/examples/networking/vlan_filter/data-plane-tracing.c b/examples/networking/vlan_filter/data-plane-tracing.c index 8b725a517..59c292d0e 100644 --- a/examples/networking/vlan_filter/data-plane-tracing.c +++ b/examples/networking/vlan_filter/data-plane-tracing.c @@ -44,11 +44,11 @@ int vlan_filter(struct __sk_buff *skb) { default: goto DROP; } - //keep the packet and send it to userspace retruning -1 + //keep the packet and send it to userspace returning -1 KEEP: return -1; //drop the packet returning 0 DROP: return 0; -} \ No newline at end of file +} diff --git a/examples/networking/xdp/xdp_drop_count.py b/examples/networking/xdp/xdp_drop_count.py index f03273e90..512e0a20f 100755 --- a/examples/networking/xdp/xdp_drop_count.py +++ b/examples/networking/xdp/xdp_drop_count.py @@ -52,7 +52,6 @@ def usage(): # load BPF program b = BPF(text = """ -#define KBUILD_MODNAME "foo" #include #include #include diff --git a/examples/networking/xdp/xdp_macswap_count.py b/examples/networking/xdp/xdp_macswap_count.py index 0e2b21caa..770ce8ca0 100755 --- a/examples/networking/xdp/xdp_macswap_count.py +++ b/examples/networking/xdp/xdp_macswap_count.py @@ -50,7 +50,6 @@ def usage(): # load BPF program b = BPF(text = """ -#define KBUILD_MODNAME "foo" #include #include #include diff --git a/examples/networking/xdp/xdp_redirect_cpu.py b/examples/networking/xdp/xdp_redirect_cpu.py index 15b0d09b8..470079f43 100755 --- a/examples/networking/xdp/xdp_redirect_cpu.py +++ b/examples/networking/xdp/xdp_redirect_cpu.py @@ -30,7 +30,6 @@ def usage(): # load BPF program b = BPF(text = """ -#define KBUILD_MODNAME "foo" #include #include #include diff --git a/examples/networking/xdp/xdp_redirect_map.py b/examples/networking/xdp/xdp_redirect_map.py index 4a6227236..4936ac1eb 100755 --- a/examples/networking/xdp/xdp_redirect_map.py +++ b/examples/networking/xdp/xdp_redirect_map.py @@ -29,7 +29,6 @@ def usage(): # load BPF program b = BPF(text = """ -#define KBUILD_MODNAME "foo" #include #include #include diff --git a/examples/perf/ipc.py b/examples/perf/ipc.py new file mode 100755 index 000000000..51d15f6c0 --- /dev/null +++ b/examples/perf/ipc.py @@ -0,0 +1,180 @@ +#!/usr/bin/python +# IPC - Instructions Per Cycles using Perf Events and +# uprobes +# 24-Apr-2020 Saleem Ahmad Created this. + +from bcc import BPF, utils +from optparse import OptionParser + +# load BPF program +code=""" +#include + +struct perf_delta { + u64 clk_delta; + u64 inst_delta; + u64 time_delta; +}; + +/* +Perf Arrays to read counter values for open +perf events. +*/ +BPF_PERF_ARRAY(clk, MAX_CPUS); +BPF_PERF_ARRAY(inst, MAX_CPUS); + +// Perf Output +BPF_PERF_OUTPUT(output); + +// Per Cpu Data to store start values +BPF_PERCPU_ARRAY(data, u64); + +#define CLOCK_ID 0 +#define INSTRUCTION_ID 1 +#define TIME_ID 2 + +void trace_start(struct pt_regs *ctx) { + u32 clk_k = CLOCK_ID; + u32 inst_k = INSTRUCTION_ID; + u32 time = TIME_ID; + + int cpu = bpf_get_smp_processor_id(); + /* + perf_read may return negative values for errors. + If cpu id is greater than BPF_PERF_ARRAY size, + counters values will be very large negative number. + NOTE: Use bpf_perf_event_value is recommended over + bpf_perf_event_read or map.perf_read() due to + issues in ABI. map.perf_read_value() need to be + implemented in future. + */ + u64 clk_start = clk.perf_read(cpu); + u64 inst_start = inst.perf_read(cpu); + u64 time_start = bpf_ktime_get_ns(); + + u64* kptr = NULL; + kptr = data.lookup(&clk_k); + if (kptr) { + data.update(&clk_k, &clk_start); + } else { + data.insert(&clk_k, &clk_start); + } + + kptr = data.lookup(&inst_k); + if (kptr) { + data.update(&inst_k, &inst_start); + } else { + data.insert(&inst_k, &inst_start); + } + + kptr = data.lookup(&time); + if (kptr) { + data.update(&time, &time_start); + } else { + data.insert(&time, &time_start); + } +} + +void trace_end(struct pt_regs* ctx) { + u32 clk_k = CLOCK_ID; + u32 inst_k = INSTRUCTION_ID; + u32 time = TIME_ID; + + int cpu = bpf_get_smp_processor_id(); + /* + perf_read may return negative values for errors. + If cpu id is greater than BPF_PERF_ARRAY size, + counters values will be very large negative number. + NOTE: Use bpf_perf_event_value is recommended over + bpf_perf_event_read or map.perf_read() due to + issues in ABI. map.perf_read_value() need to be + implemented in future. + */ + u64 clk_end = clk.perf_read(cpu); + u64 inst_end = inst.perf_read(cpu); + u64 time_end = bpf_ktime_get_ns(); + + struct perf_delta perf_data = {} ; + u64* kptr = NULL; + kptr = data.lookup(&clk_k); + + // Find elements in map, if not found return + if (kptr) { + perf_data.clk_delta = clk_end - *kptr; + } else { + return; + } + + kptr = data.lookup(&inst_k); + if (kptr) { + perf_data.inst_delta = inst_end - *kptr; + } else { + return; + } + + kptr = data.lookup(&time); + if (kptr) { + perf_data.time_delta = time_end - *kptr; + } else { + return; + } + + output.perf_submit(ctx, &perf_data, sizeof(struct perf_delta)); +} +""" + +usage='Usage: ipc.py [options]\nexample ./ipc.py -l c -s strlen' +parser = OptionParser(usage) +parser.add_option('-l', '--lib', dest='lib_name', help='lib name containing symbol to trace, e.g. c for libc', type=str) +parser.add_option('-s', '--sym', dest='sym', help='symbol to trace', type=str) + +(options, args) = parser.parse_args() +if (not options.lib_name or not options.sym): + parser.print_help() + exit() + +num_cpus = len(utils.get_online_cpus()) + +b = BPF(text=code, cflags=['-DMAX_CPUS=%s' % str(num_cpus)]) + +# Attach Probes at start and end of the trace function +# NOTE: When attaching to a function for tracing, during runtime relocation +# stage by linker, function will be called once to return a different function +# address, which will be called by the process. e.g. in case of strlen +# after relocation stage, __strlen_sse2 is called instread of strlen. +# NOTE: There will be a context switch from userspace to kernel space, +# on caputring counters on USDT probes, so actual IPC might be slightly different. +# This example is to give a reference on how to use perf events with tracing. +b.attach_uprobe(name=options.lib_name, sym=options.sym, fn_name="trace_start") +b.attach_uretprobe(name=options.lib_name, sym=options.sym, fn_name="trace_end") + +def print_data(cpu, data, size): + e = b["output"].event(data) + print("%-8d %-12d %-8.2f %-8s %d" % (e.clk_delta, e.inst_delta, + 1.0* e.inst_delta/e.clk_delta, str(round(e.time_delta * 1e-3, 2)) + ' us', cpu)) + +print("Counters Data") +print("%-8s %-12s %-8s %-8s %s" % ('CLOCK', 'INSTRUCTION', 'IPC', 'TIME', 'CPU')) + +b["output"].open_perf_buffer(print_data) + +# Perf Event for Unhalted Cycles, The hex value is +# combination of event, umask and cmask. Read Intel +# Doc to find the event and cmask. Or use +# perf list --details to get event, umask and cmask +# NOTE: Events can be multiplexed by kernel in case the +# number of counters is greater than supported by CPU +# performance monitoring unit, which can result in inaccurate +# results. Counter values need to be normalized for a more +# accurate value. +PERF_TYPE_RAW = 4 +# Unhalted Clock Cycles +b["clk"].open_perf_event(PERF_TYPE_RAW, 0x0000003C) +# Instruction Retired +b["inst"].open_perf_event(PERF_TYPE_RAW, 0x000000C0) + +while True: + try: + b.perf_buffer_poll() + except KeyboardInterrupt: + exit() diff --git a/examples/ringbuf/ringbuf_output.py b/examples/ringbuf/ringbuf_output.py new file mode 100755 index 000000000..6e3cc0d5c --- /dev/null +++ b/examples/ringbuf/ringbuf_output.py @@ -0,0 +1,53 @@ +#!/usr/bin/python3 + +import sys +import time + +from bcc import BPF + +src = r""" +BPF_RINGBUF_OUTPUT(buffer, 1 << 4); + +struct event { + char filename[16]; + int dfd; + int flags; + int mode; +}; + +TRACEPOINT_PROBE(syscalls, sys_enter_openat) { + int zero = 0; + + struct event event = {}; + + bpf_probe_read_user_str(event.filename, sizeof(event.filename), args->filename); + + event.dfd = args->dfd; + event.flags = args->flags; + event.mode = args->mode; + + buffer.ringbuf_output(&event, sizeof(event), 0); + + return 0; +} +""" + +b = BPF(text=src) + +def callback(ctx, data, size): + event = b['buffer'].event(data) + print("%-16s %10d %10d %10d" % (event.filename.decode('utf-8'), event.dfd, event.flags, event.mode)) + +b['buffer'].open_ring_buffer(callback) + +print("Printing openat() calls, ctrl-c to exit.") + +print("%-16s %10s %10s %10s" % ("FILENAME", "DIR_FD", "FLAGS", "MODE")) + +try: + while 1: + b.ring_buffer_poll() + # or b.ring_buffer_consume() + time.sleep(0.5) +except KeyboardInterrupt: + sys.exit() diff --git a/examples/ringbuf/ringbuf_submit.py b/examples/ringbuf/ringbuf_submit.py new file mode 100755 index 000000000..53e28086d --- /dev/null +++ b/examples/ringbuf/ringbuf_submit.py @@ -0,0 +1,56 @@ +#!/usr/bin/python3 + +import sys +import time + +from bcc import BPF + +src = r""" +BPF_RINGBUF_OUTPUT(buffer, 1 << 4); + +struct event { + char filename[64]; + int dfd; + int flags; + int mode; +}; + +TRACEPOINT_PROBE(syscalls, sys_enter_openat) { + int zero = 0; + + struct event *event = buffer.ringbuf_reserve(sizeof(struct event)); + if (!event) { + return 1; + } + + bpf_probe_read_user_str(event->filename, sizeof(event->filename), args->filename); + + event->dfd = args->dfd; + event->flags = args->flags; + event->mode = args->mode; + + buffer.ringbuf_submit(event, 0); + // or, to discard: buffer.ringbuf_discard(event, 0); + + return 0; +} +""" + +b = BPF(text=src) + +def callback(ctx, data, size): + event = b['buffer'].event(data) + print("%-64s %10d %10d %10d" % (event.filename.decode('utf-8'), event.dfd, event.flags, event.mode)) + +b['buffer'].open_ring_buffer(callback) + +print("Printing openat() calls, ctrl-c to exit.") + +print("%-64s %10s %10s %10s" % ("FILENAME", "DIR_FD", "FLAGS", "MODE")) + +try: + while 1: + b.ring_buffer_consume() + time.sleep(0.5) +except KeyboardInterrupt: + sys.exit() diff --git a/examples/tracing/biolatpcts.py b/examples/tracing/biolatpcts.py new file mode 100755 index 000000000..c9bb834e5 --- /dev/null +++ b/examples/tracing/biolatpcts.py @@ -0,0 +1,124 @@ +#!/usr/bin/python +# +# biolatpcts.py IO latency percentile calculation example +# +# Copyright (C) 2020 Tejun Heo +# Copyright (C) 2020 Facebook + +from __future__ import print_function +from bcc import BPF +from time import sleep + +bpf_source = """ +#include +#include +#include + +BPF_PERCPU_ARRAY(lat_100ms, u64, 100); +BPF_PERCPU_ARRAY(lat_1ms, u64, 100); +BPF_PERCPU_ARRAY(lat_10us, u64, 100); + +void kprobe_blk_account_io_done(struct pt_regs *ctx, struct request *rq, u64 now) +{ + unsigned int cmd_flags; + u64 dur; + size_t base, slot; + + if (!rq->io_start_time_ns) + return; + + dur = now - rq->io_start_time_ns; + + slot = min_t(size_t, div_u64(dur, 100 * NSEC_PER_MSEC), 99); + lat_100ms.increment(slot); + if (slot) + return; + + slot = min_t(size_t, div_u64(dur, NSEC_PER_MSEC), 99); + lat_1ms.increment(slot); + if (slot) + return; + + slot = min_t(size_t, div_u64(dur, 10 * NSEC_PER_USEC), 99); + lat_10us.increment(slot); +} +""" + +bpf = BPF(text=bpf_source) +bpf.attach_kprobe(event='blk_account_io_done', fn_name='kprobe_blk_account_io_done') + +cur_lat_100ms = bpf['lat_100ms'] +cur_lat_1ms = bpf['lat_1ms'] +cur_lat_10us = bpf['lat_10us'] + +last_lat_100ms = [0] * 100 +last_lat_1ms = [0] * 100 +last_lat_10us = [0] * 100 + +lat_100ms = [0] * 100 +lat_1ms = [0] * 100 +lat_10us = [0] * 100 + +def find_pct(req, total, slots, idx, counted): + while idx > 0: + idx -= 1 + if slots[idx] > 0: + counted += slots[idx] + if (counted / total) * 100 >= 100 - req: + break + return (idx, counted) + +def calc_lat_pct(req_pcts, total, lat_100ms, lat_1ms, lat_10us): + pcts = [0] * len(req_pcts) + + if total == 0: + return pcts + + data = [(100 * 1000, lat_100ms), (1000, lat_1ms), (10, lat_10us)] + data_sel = 0 + idx = 100 + counted = 0 + + for pct_idx in reversed(range(len(req_pcts))): + req = float(req_pcts[pct_idx]) + while True: + last_counted = counted + (gran, slots) = data[data_sel] + (idx, counted) = find_pct(req, total, slots, idx, counted) + if idx > 0 or data_sel == len(data) - 1: + break + counted = last_counted + data_sel += 1 + idx = 100 + + pcts[pct_idx] = gran * idx + gran / 2 + + return pcts + +print('Block I/O latency percentile example. See tools/biolatpcts.py for the full utility.') + +while True: + sleep(3) + + lat_total = 0; + + for i in range(100): + v = cur_lat_100ms.sum(i).value + lat_100ms[i] = max(v - last_lat_100ms[i], 0) + last_lat_100ms[i] = v + + v = cur_lat_1ms.sum(i).value + lat_1ms[i] = max(v - last_lat_1ms[i], 0) + last_lat_1ms[i] = v + + v = cur_lat_10us.sum(i).value + lat_10us[i] = max(v - last_lat_10us[i], 0) + last_lat_10us[i] = v + + lat_total += lat_100ms[i] + + target_pcts = [50, 75, 90, 99] + pcts = calc_lat_pct(target_pcts, lat_total, lat_100ms, lat_1ms, lat_10us); + for i in range(len(target_pcts)): + print('p{}={}us '.format(target_pcts[i], int(pcts[i])), end='') + print() diff --git a/examples/tracing/biolatpcts_example.txt b/examples/tracing/biolatpcts_example.txt new file mode 100644 index 000000000..f8e858fc7 --- /dev/null +++ b/examples/tracing/biolatpcts_example.txt @@ -0,0 +1,17 @@ +Demonstrations of biolatpcts.py, the Linux eBPF/bcc version. + + +This traces block I/O and uses layered percpu arrays to bucket the completion +latencies. Latency percentiles are calculated periodically from the buckets. + +# ./biolatpcts.py +p50=595.0us p75=685.0us p90=1500.0us p99=2500.0us +p50=55.0us p75=95.0us p90=305.0us p99=2500.0us +p50=385.0us p75=655.0us p90=1500.0us p99=2500.0us +[...] + +The latency is measured from I/O request to the device, to the device +completion. This excludes latency spent queued in the OS. + +This is a simplified example to demonstrate the calculation of latency +percentiles. See tools/biolatpcts.py for the full utility. diff --git a/examples/tracing/bitehist.py b/examples/tracing/bitehist.py index 4d7c7958b..89ceb307b 100755 --- a/examples/tracing/bitehist.py +++ b/examples/tracing/bitehist.py @@ -25,7 +25,7 @@ BPF_HISTOGRAM(dist); BPF_HISTOGRAM(dist_linear); -int kprobe__blk_account_io_completion(struct pt_regs *ctx, struct request *req) +int kprobe__blk_account_io_done(struct pt_regs *ctx, struct request *req) { dist.increment(bpf_log2l(req->__data_len / 1024)); dist_linear.increment(req->__data_len / 1024); diff --git a/examples/tracing/dddos.py b/examples/tracing/dddos.py index fe1afd726..09e9f6d86 100755 --- a/examples/tracing/dddos.py +++ b/examples/tracing/dddos.py @@ -53,7 +53,7 @@ * test a real case attack using hping3. However; if regular network * traffic increases above predefined detection settings, a false * positive alert will be triggered (an example would be the - case of large file downloads). + * case of large file downloads). */ rcv_packets_nb_ptr = rcv_packets.lookup(&rcv_packets_nb_index); rcv_packets_ts_ptr = rcv_packets.lookup(&rcv_packets_ts_index); @@ -86,7 +86,7 @@ class DetectionTimestamp(ct.Structure): _fields_ = [("nb_ddos_packets", ct.c_ulonglong)] -# Show message when ePBF stats +# Show message when ePBF starts print("DDOS detector started ... Hit Ctrl-C to end!") print("%-26s %-10s" % ("TIME(s)", "MESSAGE")) diff --git a/examples/tracing/disksnoop.py b/examples/tracing/disksnoop.py index 1101e6f26..a35e1abd2 100755 --- a/examples/tracing/disksnoop.py +++ b/examples/tracing/disksnoop.py @@ -46,7 +46,7 @@ if BPF.get_kprobe_functions(b'blk_start_request'): b.attach_kprobe(event="blk_start_request", fn_name="trace_start") b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_start") -b.attach_kprobe(event="blk_account_io_completion", fn_name="trace_completion") +b.attach_kprobe(event="blk_account_io_done", fn_name="trace_completion") # header print("%-18s %-2s %-7s %8s" % ("TIME(s)", "T", "BYTES", "LAT(ms)")) diff --git a/examples/tracing/hello_perf_output_using_ns.py b/examples/tracing/hello_perf_output_using_ns.py new file mode 100755 index 000000000..cc7eb9df9 --- /dev/null +++ b/examples/tracing/hello_perf_output_using_ns.py @@ -0,0 +1,75 @@ +#!/usr/bin/python +# Carlos Neira +# This is a Hello World example that uses BPF_PERF_OUTPUT. +# in this example bpf_get_ns_current_pid_tgid(), this helper +# works inside pid namespaces. +# bpf_get_current_pid_tgid() only returns the host pid outside any +# namespace and this will not work when the script is run inside a pid namespace. + +from bcc import BPF +from bcc.utils import printb +import sys, os +from stat import * + +# define BPF program +prog = """ +#include + +// define output data structure in C +struct data_t { + u32 pid; + u64 ts; + char comm[TASK_COMM_LEN]; +}; +BPF_PERF_OUTPUT(events); + +int hello(struct pt_regs *ctx) { + struct data_t data = {}; + struct bpf_pidns_info ns = {}; + + if(bpf_get_ns_current_pid_tgid(DEV, INO, &ns, sizeof(struct bpf_pidns_info))) + return 0; + data.pid = ns.pid; + data.ts = bpf_ktime_get_ns(); + bpf_get_current_comm(&data.comm, sizeof(data.comm)); + + events.perf_submit(ctx, &data, sizeof(data)); + + return 0; +} +""" + +devinfo = os.stat("/proc/self/ns/pid") +for r in (("DEV", str(devinfo.st_dev)), ("INO", str(devinfo.st_ino))): + prog = prog.replace(*r) + +# load BPF program +b = BPF(text=prog) +b.attach_kprobe(event=b.get_syscall_fnname("clone"), fn_name="hello") + +# header +print("%-18s %-16s %-6s %s" % ("TIME(s)", "COMM", "PID", "MESSAGE")) + +# process event +start = 0 + + +def print_event(cpu, data, size): + global start + event = b["events"].event(data) + if start == 0: + start = event.ts + time_s = (float(event.ts - start)) / 1000000000 + printb( + b"%-18.9f %-16s %-6d %s" + % (time_s, event.comm, event.pid, b"Hello, perf_output!") + ) + + +# loop with callback to print_event +b["events"].open_perf_buffer(print_event) +while 1: + try: + b.perf_buffer_poll() + except KeyboardInterrupt: + exit() diff --git a/examples/tracing/mallocstacks.py b/examples/tracing/mallocstacks.py index 4b10e6c29..15706db33 100755 --- a/examples/tracing/mallocstacks.py +++ b/examples/tracing/mallocstacks.py @@ -67,5 +67,6 @@ for k, v in reversed(sorted(calls.items(), key=lambda c: c[1].value)): print("%d bytes allocated at:" % v.value) - for addr in stack_traces.walk(k.value): - printb(b"\t%s" % b.sym(addr, pid, show_offset=True)) + if k.value > 0 : + for addr in stack_traces.walk(k.value): + printb(b"\t%s" % b.sym(addr, pid, show_offset=True)) diff --git a/examples/tracing/mysqld_query.py b/examples/tracing/mysqld_query.py index ace07150d..2f857277b 100755 --- a/examples/tracing/mysqld_query.py +++ b/examples/tracing/mysqld_query.py @@ -34,7 +34,7 @@ * see: https://dev.mysql.com/doc/refman/5.7/en/dba-dtrace-ref-query.html */ bpf_usdt_readarg(1, ctx, &addr); - bpf_probe_read(&query, sizeof(query), (void *)addr); + bpf_probe_read_user(&query, sizeof(query), (void *)addr); bpf_trace_printk("%s\\n", query); return 0; }; diff --git a/examples/tracing/nflatency.py b/examples/tracing/nflatency.py new file mode 100755 index 000000000..c201930a0 --- /dev/null +++ b/examples/tracing/nflatency.py @@ -0,0 +1,237 @@ +#!/usr/bin/python3 +# +# nflatency Trace netfilter hook latency. +# +# This attaches a kprobe and kretprobe to nf_hook_slow. +# 2020-04-03 Casey Callendrello / + +import argparse +import sys +import time + +from bcc import BPF + +BPF_SRC = """ +#include +#include +#include +#include +#include +#include + +static struct tcphdr *skb_to_tcphdr(const struct sk_buff *skb) +{ + // unstable API. verify logic in tcp_hdr() -> skb_transport_header(). + return (struct tcphdr *)(skb->head + skb->transport_header); +} + +static inline struct iphdr *skb_to_iphdr(const struct sk_buff *skb) +{ + // unstable API. verify logic in ip_hdr() -> skb_network_header(). + return (struct iphdr *)(skb->head + skb->network_header); +} + +static inline struct ipv6hdr *skb_to_ip6hdr(const struct sk_buff *skb) +{ + // unstable API. verify logic in ip_hdr() -> skb_network_header(). + return (struct ipv6hdr *)(skb->head + skb->network_header); +} + +// for correlating between kprobe and kretprobe +struct start_data { + u8 hook; + u8 pf; // netfilter protocol + u8 tcp_state; + u64 ts; +}; +BPF_PERCPU_ARRAY(sts, struct start_data, 1); + +// the histogram keys +typedef struct nf_lat_key { + u8 proto; // see netfilter.h + u8 hook; + u8 tcp_state; +} nf_lat_key_t; + +typedef struct hist_key { + nf_lat_key_t key; + u64 slot; +} hist_key_t; +BPF_HISTOGRAM(dist, hist_key_t); + + +int kprobe__nf_hook_slow(struct pt_regs *ctx, struct sk_buff *skb, struct nf_hook_state *state) { + struct start_data data = {}; + data.ts = bpf_ktime_get_ns(); + data.hook = state->hook; + data.pf = state->pf; + + COND + + u8 ip_proto; + if (skb->protocol == htons(ETH_P_IP)) { + struct iphdr *ip = skb_to_iphdr(skb); + ip_proto = ip->protocol; + + } else if (skb->protocol == htons(ETH_P_IPV6)) { + struct ipv6hdr *ip = skb_to_ip6hdr(skb); + ip_proto = ip->nexthdr; + } + + data.tcp_state = 0; + if (ip_proto == 0x06) { //tcp + struct tcphdr *tcp = skb_to_tcphdr(skb); + u8 tcpflags = ((u_int8_t *)tcp)[13]; + + // FIN or RST + if (((tcpflags & 1) + (tcpflags & 4)) > 0) { + data.tcp_state = 3; + } + // SYN / SACK + else if ((tcpflags & 0x02) > 0) { + data.tcp_state = 1; + if ((tcpflags & 16) > 0) { // ACK + data.tcp_state = 2; + } + } + } + + u32 idx = 0; + sts.update(&idx, &data); + return 0; +} + +int kretprobe__nf_hook_slow(struct pt_regs *ctx) { + u32 idx = 0; + struct start_data *s; + s = sts.lookup(&idx); + if (!s || s->ts == 0) { + return 0; + } + + s->ts = bpf_ktime_get_ns() - s->ts; + + hist_key_t key = {}; + key.key.hook = s->hook; + key.key.proto = s->pf; + key.key.tcp_state = s->tcp_state; + key.slot = bpf_log2l(s->ts / FACTOR ); + dist.increment(key); + + s->ts = 0; + sts.update(&idx, s); + + return 0; +} +""" + +# constants from netfilter.h +NF_HOOKS = { + 0: "PRE_ROUTING", + 1: "LOCAL_IN", + 2: "FORWARD", + 3: "LOCAL_OUT", + 4: "POST_ROUTING", +} + +NF_PROTOS = { + 0: "UNSPEC", + 1: "INET", + 2: "IPV4", + 3: "ARP", + 5: "NETDEV", + 7: "BRIDGE", + 10: "IPV6", + 12: "DECNET", +} + +TCP_FLAGS = { + 0: "other", + 1: "SYN", + 2: "SACK", + 3: "FIN", +} + +EXAMPLES = """examples: + nflatency # print netfilter latency histograms, 1 second refresh + nflatency -p IPV4 -p IPV6 # print only for ipv4 and ipv6 + nflatency -k PRE_ROUTING # only record the PRE_ROUTING hook + nflatency -i 5 -d 10 # run for 10 seconds, printing every 5 +""" + + +parser = argparse.ArgumentParser( + description="Track latency added by netfilter hooks. Where possible, interesting TCP flags are included", + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=EXAMPLES) +parser.add_argument("-p", "--proto", + action='append', + help="record this protocol only (multiple parameters allowed)", + choices=NF_PROTOS.values()) +parser.add_argument("-k", "--hook", + action='append', + help="record this netfilter hook only (multiple parameters allowed)", + choices=NF_HOOKS.values()) +parser.add_argument("-i", "--interval", type=int, + help="summary interval, in seconds. Default is 10, unless --duration is supplied") +parser.add_argument("-d", "--duration", type=int, + help="total duration of trace, in seconds") +parser.add_argument("--nano", action="store_true", + help="bucket by nanoseconds instead of milliseconds") + +def main(): + args = parser.parse_args() + + src = build_src(args) + b = BPF(text=src) + dist = b.get_table("dist") + + seconds = 0 + interval = 0 + if not args.interval: + interval = 1 + if args.duration: + interval = args.duration + else: + interval = args.interval + + sys.stderr.write("Tracing netfilter hooks... Hit Ctrl-C to end.\n") + while 1: + try: + dist.print_log2_hist( + section_header="Bucket", + bucket_fn=lambda k: (k.proto, k.hook, k.tcp_state), + section_print_fn=bucket_desc) + if args.duration and seconds >= args.duration: + sys.exit(0) + seconds += interval + time.sleep(interval) + except KeyboardInterrupt: + sys.exit(1) + + +def build_src(args): + cond_src = "" + if args.proto: + predicate = " || ".join(map(lambda x: "data.pf == NFPROTO_%s" % x, args.proto)) + cond_src = "if (!(%s)) { return 0; }\n" % predicate + if args.hook: + predicate = " || ".join(map(lambda x: "data.hook == NF_INET_%s" % x, args.hook)) + cond_src = "%s if (!(%s)) { return 0;}\n" % (cond_src, predicate) + + factor = "1000" + if args.nano: + factor = "1" + + return BPF_SRC.replace('COND', cond_src).replace('FACTOR', factor) + + +def bucket_desc(bucket): + return "%s %s (tcp %s)" % ( + NF_PROTOS[bucket[0]], + NF_HOOKS[bucket[1]], + TCP_FLAGS[bucket[2]]) + + +if __name__ == "__main__": + main() diff --git a/examples/tracing/nodejs_http_server.py b/examples/tracing/nodejs_http_server.py index a86ca956c..e32a26ea6 100755 --- a/examples/tracing/nodejs_http_server.py +++ b/examples/tracing/nodejs_http_server.py @@ -26,7 +26,7 @@ uint64_t addr; char path[128]={0}; bpf_usdt_readarg(6, ctx, &addr); - bpf_probe_read(&path, sizeof(path), (void *)addr); + bpf_probe_read_user(&path, sizeof(path), (void *)addr); bpf_trace_printk("path:%s\\n", path); return 0; }; diff --git a/examples/tracing/strlen_count.py b/examples/tracing/strlen_count.py index f1bb1b7ef..8432f5935 100755 --- a/examples/tracing/strlen_count.py +++ b/examples/tracing/strlen_count.py @@ -31,7 +31,7 @@ struct key_t key = {}; u64 zero = 0, *val; - bpf_probe_read(&key.c, sizeof(key.c), (void *)PT_REGS_PARM1(ctx)); + bpf_probe_read_user(&key.c, sizeof(key.c), (void *)PT_REGS_PARM1(ctx)); // could also use `counts.increment(key)` val = counts.lookup_or_try_init(&key, &zero); if (val) { diff --git a/examples/tracing/strlen_hist_ifunc.py b/examples/tracing/strlen_hist_ifunc.py new file mode 100755 index 000000000..605907c67 --- /dev/null +++ b/examples/tracing/strlen_hist_ifunc.py @@ -0,0 +1,132 @@ +#!/usr/bin/python +# +# strlen_hist_ifunc.py Histogram of system-wide strlen return values. +# This can be used instead of strlen_hist.py if strlen is indirect function. + +from __future__ import print_function +from bcc import BPF +from bcc.libbcc import lib, bcc_symbol, bcc_symbol_option + +import ctypes as ct +import sys +import time + +NAME = 'c' +SYMBOL = 'strlen' +STT_GNU_IFUNC = 1 << 10 + +HIST_BPF_TEXT = """ +#include +BPF_HISTOGRAM(dist); +int count(struct pt_regs *ctx) { + dist.increment(bpf_log2l(PT_REGS_RC(ctx))); + return 0; +} +""" + +SUBMIT_FUNC_ADDR_BPF_TEXT = """ +#include + +BPF_PERF_OUTPUT(impl_func_addr); +void submit_impl_func_addr(struct pt_regs *ctx) { + u64 addr = PT_REGS_RC(ctx); + impl_func_addr.perf_submit(ctx, &addr, sizeof(addr)); +} + + +BPF_PERF_OUTPUT(resolv_func_addr); +int submit_resolv_func_addr(struct pt_regs *ctx) { + u64 rip = PT_REGS_IP(ctx); + resolv_func_addr.perf_submit(ctx, &rip, sizeof(rip)); + return 0; +} +""" + + +def get_indirect_function_sym(module, symname): + sym = bcc_symbol() + sym_op = bcc_symbol_option() + sym_op.use_debug_file = 1 + sym_op.check_debug_file_crc = 1 + sym_op.lazy_symbolize = 1 + sym_op.use_symbol_type = STT_GNU_IFUNC + if lib.bcc_resolve_symname( + module.encode(), + symname.encode(), + 0x0, + 0, + ct.byref(sym_op), + ct.byref(sym), + ) < 0: + return None + else: + return sym + + +def set_impl_func_addr(cpu, data, size): + addr = ct.cast(data, ct.POINTER(ct.c_uint64)).contents.value + global impl_func_addr + impl_func_addr = addr + + +def set_resolv_func_addr(cpu, data, size): + addr = ct.cast(data, ct.POINTER(ct.c_uint64)).contents.value + global resolv_func_addr + resolv_func_addr = addr + + +def find_impl_func_offset(ifunc_symbol): + b = BPF(text=SUBMIT_FUNC_ADDR_BPF_TEXT) + b.attach_uprobe(name=NAME, sym=SYMBOL, fn_name=b'submit_resolv_func_addr') + b['resolv_func_addr'].open_perf_buffer(set_resolv_func_addr) + b.attach_uretprobe(name=NAME, sym=SYMBOL, fn_name=b"submit_impl_func_addr") + b['impl_func_addr'].open_perf_buffer(set_impl_func_addr) + + print('wait for the first {} call'.format(SYMBOL)) + while True: + try: + if resolv_func_addr and impl_func_addr: + b.detach_uprobe(name=NAME, sym=SYMBOL) + b.detach_uretprobe(name=NAME, sym=SYMBOL) + b.cleanup() + break + b.perf_buffer_poll() + except KeyboardInterrupt: + exit() + print('IFUNC resolution of {} is performed'.format(SYMBOL)) + print('resolver function address: {:#x}'.format(resolv_func_addr)) + print('resolver function offset: {:#x}'.format(ifunc_symbol.offset)) + print('function implementation address: {:#x}'.format(impl_func_addr)) + impl_func_offset = impl_func_addr - resolv_func_addr + ifunc_symbol.offset + print('function implementation offset: {:#x}'.format(impl_func_offset)) + return impl_func_offset + + +def main(): + ifunc_symbol = get_indirect_function_sym(NAME, SYMBOL) + if not ifunc_symbol: + sys.stderr.write('{} is not an indirect function. abort!\n'.format(SYMBOL)) + exit(1) + + impl_func_offset = find_impl_func_offset(ifunc_symbol) + + b = BPF(text=HIST_BPF_TEXT) + b.attach_uretprobe(name=ct.cast(ifunc_symbol.module, ct.c_char_p).value, + addr=impl_func_offset, + fn_name=b'count') + dist = b['dist'] + try: + while True: + time.sleep(1) + print('%-8s\n' % time.strftime('%H:%M:%S'), end='') + dist.print_log2_hist(SYMBOL + ' return:') + dist.clear() + + except KeyboardInterrupt: + pass + + +resolv_func_addr = 0 +impl_func_addr = 0 + +main() diff --git a/examples/tracing/strlen_snoop.py b/examples/tracing/strlen_snoop.py index c3c7199eb..5b70f66a3 100755 --- a/examples/tracing/strlen_snoop.py +++ b/examples/tracing/strlen_snoop.py @@ -34,7 +34,7 @@ return 0; char str[80] = {}; - bpf_probe_read(&str, sizeof(str), (void *)PT_REGS_PARM1(ctx)); + bpf_probe_read_user(&str, sizeof(str), (void *)PT_REGS_PARM1(ctx)); bpf_trace_printk("%s\\n", &str); return 0; diff --git a/examples/tracing/sync_timing.py b/examples/tracing/sync_timing.py index 1d89ce554..face2b46f 100755 --- a/examples/tracing/sync_timing.py +++ b/examples/tracing/sync_timing.py @@ -23,7 +23,7 @@ // attempt to read stored timestamp tsp = last.lookup(&key); - if (tsp != 0) { + if (tsp != NULL) { delta = bpf_ktime_get_ns() - *tsp; if (delta < 1000000000) { // output if time is less than 1 second diff --git a/examples/usdt_sample/scripts/bpf_text_shared.c b/examples/usdt_sample/scripts/bpf_text_shared.c index d8e7464cb..41d8c9871 100644 --- a/examples/usdt_sample/scripts/bpf_text_shared.c +++ b/examples/usdt_sample/scripts/bpf_text_shared.c @@ -10,7 +10,7 @@ static inline bool filter(char const* inputString) { char needle[] = "FILTER_STRING"; ///< The FILTER STRING is replaced by python code. char haystack[sizeof(needle)] = {}; - bpf_probe_read(&haystack, sizeof(haystack), (void*)inputString); + bpf_probe_read_user(&haystack, sizeof(haystack), (void*)inputString); for (int i = 0; i < sizeof(needle) - 1; ++i) { if (needle[i] != haystack[i]) { return false; diff --git a/examples/usdt_sample/usdt_sample.md b/examples/usdt_sample/usdt_sample.md index c6b5a0702..fd5b527b3 100644 --- a/examples/usdt_sample/usdt_sample.md +++ b/examples/usdt_sample/usdt_sample.md @@ -93,6 +93,11 @@ input 4 arg2 = pf_6 4 arg2 = pf_23 5 arg2 = pf_24 + +Should that command fail with the error message "HINT: Binary path usdt_sample_lib1 should be absolute", try instead: + +sudo python tools/argdist.py -p 47575 -i 5 -C 'u:ABSOLUTE-PATH-TO-BCC-REPO/bcc/examples/usdt_sample/build/usdt_sample_lib1/libusdt_sample_lib1.so:operation_start():char*:arg2#input' -z 32 + ``` Use latency.py to trace the operation latencies: diff --git a/introspection/CMakeLists.txt b/introspection/CMakeLists.txt index c5983b20d..4328ee117 100644 --- a/introspection/CMakeLists.txt +++ b/introspection/CMakeLists.txt @@ -6,8 +6,14 @@ include_directories(${CMAKE_SOURCE_DIR}/src/cc/api) include_directories(${CMAKE_SOURCE_DIR}/src/cc/libbpf/include/uapi) option(INSTALL_INTROSPECTION "Install BPF introspection tools" ON) +option(BPS_LINK_RT "Pass -lrt to linker when linking bps tool" ON) + +set(bps_libs_to_link bpf-static elf z) +if(BPS_LINK_RT) +list(APPEND bps_libs_to_link rt) +endif() add_executable(bps bps.c) -target_link_libraries(bps bpf-static elf rt z) +target_link_libraries(bps ${bps_libs_to_link}) install (TARGETS bps DESTINATION share/bcc/introspection) diff --git a/introspection/bps.c b/introspection/bps.c index c5984c459..b5595442f 100644 --- a/introspection/bps.c +++ b/introspection/bps.c @@ -45,6 +45,8 @@ static const char * const prog_type_strings[] = { [BPF_PROG_TYPE_TRACING] = "tracing", [BPF_PROG_TYPE_STRUCT_OPS] = "struct_ops", [BPF_PROG_TYPE_EXT] = "ext", + [BPF_PROG_TYPE_LSM] = "lsm", + [BPF_PROG_TYPE_SK_LOOKUP] = "sk_lookup", }; static const char * const map_type_strings[] = { @@ -74,6 +76,8 @@ static const char * const map_type_strings[] = { [BPF_MAP_TYPE_SK_STORAGE] = "sk_storage", [BPF_MAP_TYPE_DEVMAP_HASH] = "devmap_hash", [BPF_MAP_TYPE_STRUCT_OPS] = "struct_ops", + [BPF_MAP_TYPE_RINGBUF] = "ringbuf", + [BPF_MAP_TYPE_INODE_STORAGE] = "inode_storage", }; #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) diff --git a/libbpf-tools/.gitignore b/libbpf-tools/.gitignore index 404942cc9..795c529dc 100644 --- a/libbpf-tools/.gitignore +++ b/libbpf-tools/.gitignore @@ -1,2 +1,24 @@ /.output +/biolatency +/biopattern +/biosnoop +/biostacks +/bitesize +/cpudist +/drsnoop +/execsnoop +/filelife +/hardirqs +/llcstat +/numamove +/opensnoop +/readahead +/runqlat +/runqlen /runqslower +/softirqs +/syscount +/tcpconnect +/tcpconnlat +/vfsstat +/xfsslower diff --git a/libbpf-tools/Makefile b/libbpf-tools/Makefile index cf7f8afe9..8559b2dac 100644 --- a/libbpf-tools/Makefile +++ b/libbpf-tools/Makefile @@ -6,9 +6,41 @@ BPFTOOL ?= bin/bpftool LIBBPF_SRC := $(abspath ../src/cc/libbpf/src) LIBBPF_OBJ := $(abspath $(OUTPUT)/libbpf.a) INCLUDES := -I$(OUTPUT) -CFLAGS := -g -Wall +CFLAGS := -g -O2 -Wall +ARCH := $(shell uname -m | sed 's/x86_64/x86/') -APPS = runqslower +APPS = \ + biolatency \ + biopattern \ + biosnoop \ + biostacks \ + bitesize \ + cpudist \ + drsnoop \ + execsnoop \ + filelife \ + hardirqs \ + llcstat \ + numamove \ + opensnoop \ + readahead \ + runqlat \ + runqlen \ + runqslower \ + softirqs \ + syscount \ + tcpconnect \ + tcpconnlat \ + vfsstat \ + xfsslower \ + # + +COMMON_OBJ = \ + $(OUTPUT)/trace_helpers.o \ + $(OUTPUT)/syscall_helpers.o \ + $(OUTPUT)/errno_helpers.o \ + $(OUTPUT)/map_helpers.o \ + # .PHONY: all all: $(APPS) @@ -31,11 +63,13 @@ $(OUTPUT) $(OUTPUT)/libbpf: $(call msg,MKDIR,$@) $(Q)mkdir -p $@ -$(APPS): %: $(OUTPUT)/%.o $(LIBBPF_OBJ) | $(OUTPUT) +$(APPS): %: $(OUTPUT)/%.o $(LIBBPF_OBJ) $(COMMON_OBJ) | $(OUTPUT) $(call msg,BINARY,$@) $(Q)$(CC) $(CFLAGS) $^ -lelf -lz -o $@ -$(OUTPUT)/%.o: %.c $(OUTPUT)/%.skel.h $(wildcard %.h) | $(OUTPUT) +$(patsubst %,$(OUTPUT)/%.o,$(APPS)): %.o: %.skel.h + +$(OUTPUT)/%.o: %.c $(wildcard %.h) | $(OUTPUT) $(call msg,CC,$@) $(Q)$(CC) $(CFLAGS) $(INCLUDES) -c $(filter %.c,$^) -o $@ @@ -45,8 +79,8 @@ $(OUTPUT)/%.skel.h: $(OUTPUT)/%.bpf.o | $(OUTPUT) $(OUTPUT)/%.bpf.o: %.bpf.c $(LIBBPF_OBJ) $(wildcard %.h) vmlinux.h | $(OUTPUT) $(call msg,BPF,$@) - $(Q)$(CLANG) -g -O2 -target bpf $(INCLUDES) \ - -c $(filter %.c,$^) -o $@ && \ + $(Q)$(CLANG) -g -O2 -target bpf -D__TARGET_ARCH_$(ARCH) \ + $(INCLUDES) -c $(filter %.c,$^) -o $@ && \ $(LLVM_STRIP) -g $@ # Build libbpf.a diff --git a/libbpf-tools/README.md b/libbpf-tools/README.md index 8f1492bf9..d439e05cf 100644 --- a/libbpf-tools/README.md +++ b/libbpf-tools/README.md @@ -1,3 +1,9 @@ +Useful links +------------ + +- [BPF Portability and CO-RE](https://facebookmicrosites.github.io/bpf/blog/2020/02/19/bpf-portability-and-co-re.html) +- [HOWTO: BCC to libbpf conversion](https://facebookmicrosites.github.io/bpf/blog/2020/02/20/bcc-to-libbpf-howto-guide.html) + Building ------- @@ -40,7 +46,7 @@ For more reproducible builds, vmlinux.h header file is pre-generated and checked in along the other sources. This is done to avoid dependency on specific user/build server's kernel configuration, because vmlinux.h generation depends on having a kernel with BTF type information built-in -(which is enabled by `CONFIG_DEBUG_INFO_BTF=y` Kconfig option). +(which is enabled by `CONFIG_DEBUG_INFO_BTF=y` Kconfig option See below). vmlinux.h is generated from upstream Linux version at particular minor version tag. E.g., `vmlinux_505.h` is generated from v5.5 tag. Exact set of @@ -67,3 +73,19 @@ Given bpftool package can't yet be expected to be available widely across many distributions, bpftool binary is checked in into BCC repository in bin/ subdirectory. Once bpftool package is more widely available, this can be changed in favor of using pre-packaged version of bpftool. + + +Re-compiling your Kernel with CONFIG_DEBUG_INFO_BTF=y +----------------------------------------------------- +libbpf probes to see if your sys fs exports the file `/sys/kernel/btf/vmlinux` (from Kernel 5.5+) or if you have the ELF version in your system [`code`](https://github.com/libbpf/libbpf/blob/master/src/btf.c) +Please note the ELF file could exist without the BTF info in it. Your Kconfig should contain the options below + +1. Compile options +```code +CONFIG_DEBUG_INFO_BTF=y +CONFIG_DEBUG_INFO=y +``` +2. Also, make sure that you have pahole 1.13 (or preferably 1.16+) during the +kernel build (it comes from dwarves package). Without it, BTF won't be +generated, and on older kernels you'd get only warning, but still would +build kernel successfully diff --git a/libbpf-tools/bin/bpftool b/libbpf-tools/bin/bpftool index a58ab1abf..eed0c1d90 100755 Binary files a/libbpf-tools/bin/bpftool and b/libbpf-tools/bin/bpftool differ diff --git a/libbpf-tools/biolatency.bpf.c b/libbpf-tools/biolatency.bpf.c new file mode 100644 index 000000000..808c40800 --- /dev/null +++ b/libbpf-tools/biolatency.bpf.c @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include +#include "biolatency.h" +#include "bits.bpf.h" + +#define MAX_ENTRIES 10240 + +const volatile bool targ_per_disk = false; +const volatile bool targ_per_flag = false; +const volatile bool targ_queued = false; +const volatile bool targ_ms = false; +const volatile dev_t targ_dev = -1; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct request *); + __type(value, u64); + __uint(map_flags, BPF_F_NO_PREALLOC); +} start SEC(".maps"); + +static struct hist initial_hist; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct hist_key); + __type(value, struct hist); + __uint(map_flags, BPF_F_NO_PREALLOC); +} hists SEC(".maps"); + +static __always_inline +int trace_rq_start(struct request *rq) +{ + u64 ts = bpf_ktime_get_ns(); + + if (targ_dev != -1) { + struct gendisk *disk = BPF_CORE_READ(rq, rq_disk); + dev_t dev; + + dev = disk ? MKDEV(BPF_CORE_READ(disk, major), + BPF_CORE_READ(disk, first_minor)) : 0; + if (targ_dev != dev) + return 0; + } + bpf_map_update_elem(&start, &rq, &ts, 0); + return 0; +} + +SEC("tp_btf/block_rq_insert") +int BPF_PROG(block_rq_insert, struct request_queue *q, struct request *rq) +{ + return trace_rq_start(rq); +} + +SEC("tp_btf/block_rq_issue") +int BPF_PROG(block_rq_issue, struct request_queue *q, struct request *rq) +{ + if (targ_queued && BPF_CORE_READ(q, elevator)) + return 0; + return trace_rq_start(rq); +} + +SEC("tp_btf/block_rq_complete") +int BPF_PROG(block_rq_complete, struct request *rq, int error, + unsigned int nr_bytes) +{ + u64 slot, *tsp, ts = bpf_ktime_get_ns(); + struct hist_key hkey = {}; + struct hist *histp; + s64 delta; + + tsp = bpf_map_lookup_elem(&start, &rq); + if (!tsp) + return 0; + delta = (s64)(ts - *tsp); + if (delta < 0) + goto cleanup; + + if (targ_per_disk) { + struct gendisk *disk = BPF_CORE_READ(rq, rq_disk); + + hkey.dev = disk ? MKDEV(BPF_CORE_READ(disk, major), + BPF_CORE_READ(disk, first_minor)) : 0; + } + if (targ_per_flag) + hkey.cmd_flags = rq->cmd_flags; + + histp = bpf_map_lookup_elem(&hists, &hkey); + if (!histp) { + bpf_map_update_elem(&hists, &hkey, &initial_hist, 0); + histp = bpf_map_lookup_elem(&hists, &hkey); + if (!histp) + goto cleanup; + } + + if (targ_ms) + delta /= 1000000U; + else + delta /= 1000U; + slot = log2l(delta); + if (slot >= MAX_SLOTS) + slot = MAX_SLOTS - 1; + __sync_fetch_and_add(&histp->slots[slot], 1); + +cleanup: + bpf_map_delete_elem(&start, &rq); + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/biolatency.c b/libbpf-tools/biolatency.c new file mode 100644 index 000000000..3bd8672ae --- /dev/null +++ b/libbpf-tools/biolatency.c @@ -0,0 +1,336 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on biolatency(8) from BCC by Brendan Gregg. +// 15-Jun-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include +#include "blk_types.h" +#include "biolatency.h" +#include "biolatency.skel.h" +#include "trace_helpers.h" + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) + +static struct env { + char *disk; + time_t interval; + int times; + bool timestamp; + bool queued; + bool per_disk; + bool per_flag; + bool milliseconds; + bool verbose; +} env = { + .interval = 99999999, + .times = 99999999, +}; + +static volatile bool exiting; + +const char *argp_program_version = "biolatency 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Summarize block device I/O latency as a histogram.\n" +"\n" +"USAGE: biolatency [--help] [-T] [-m] [-Q] [-D] [-F] [-d] [interval] [count]\n" +"\n" +"EXAMPLES:\n" +" biolatency # summarize block I/O latency as a histogram\n" +" biolatency 1 10 # print 1 second summaries, 10 times\n" +" biolatency -mT 1 # 1s summaries, milliseconds, and timestamps\n" +" biolatency -Q # include OS queued time in I/O time\n" +" biolatency -D # show each disk device separately\n" +" biolatency -F # show I/O flags separately\n" +" biolatency -d sdc # Trace sdc only\n"; + +static const struct argp_option opts[] = { + { "timestamp", 'T', NULL, 0, "Include timestamp on output" }, + { "milliseconds", 'm', NULL, 0, "Millisecond histogram" }, + { "queued", 'Q', NULL, 0, "Include OS queued time in I/O time" }, + { "disk", 'D', NULL, 0, "Print a histogram per disk device" }, + { "flag", 'F', NULL, 0, "Print a histogram per set of I/O flags" }, + { "disk", 'd', "DISK", 0, "Trace this disk only" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'm': + env.milliseconds = true; + break; + case 'Q': + env.queued = true; + break; + case 'D': + env.per_disk = true; + break; + case 'F': + env.per_flag = true; + break; + case 'T': + env.timestamp = true; + break; + case 'd': + env.disk = arg; + if (strlen(arg) + 1 > DISK_NAME_LEN) { + fprintf(stderr, "invaild disk name: too long\n"); + argp_usage(state); + } + break; + case ARGP_KEY_ARG: + errno = 0; + if (pos_args == 0) { + env.interval = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid internal\n"); + argp_usage(state); + } + } else if (pos_args == 1) { + env.times = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid times\n"); + argp_usage(state); + } + } else { + fprintf(stderr, + "unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + pos_args++; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void sig_handler(int sig) +{ + exiting = true; +} + +static void print_cmd_flags(int cmd_flags) +{ + static struct { int bit; const char *str; } flags[] = { + { REQ_NOWAIT, "NoWait-" }, + { REQ_BACKGROUND, "Background-" }, + { REQ_RAHEAD, "ReadAhead-" }, + { REQ_PREFLUSH, "PreFlush-" }, + { REQ_FUA, "FUA-" }, + { REQ_INTEGRITY, "Integrity-" }, + { REQ_IDLE, "Idle-" }, + { REQ_NOMERGE, "NoMerge-" }, + { REQ_PRIO, "Priority-" }, + { REQ_META, "Metadata-" }, + { REQ_SYNC, "Sync-" }, + }; + static const char *ops[] = { + [REQ_OP_READ] = "Read", + [REQ_OP_WRITE] = "Write", + [REQ_OP_FLUSH] = "Flush", + [REQ_OP_DISCARD] = "Discard", + [REQ_OP_SECURE_ERASE] = "SecureErase", + [REQ_OP_ZONE_RESET] = "ZoneReset", + [REQ_OP_WRITE_SAME] = "WriteSame", + [REQ_OP_ZONE_RESET_ALL] = "ZoneResetAll", + [REQ_OP_WRITE_ZEROES] = "WriteZeroes", + [REQ_OP_ZONE_OPEN] = "ZoneOpen", + [REQ_OP_ZONE_CLOSE] = "ZoneClose", + [REQ_OP_ZONE_FINISH] = "ZoneFinish", + [REQ_OP_SCSI_IN] = "SCSIIn", + [REQ_OP_SCSI_OUT] = "SCSIOut", + [REQ_OP_DRV_IN] = "DrvIn", + [REQ_OP_DRV_OUT] = "DrvOut", + }; + int i; + + printf("flags = "); + + for (i = 0; i < ARRAY_SIZE(flags); i++) { + if (cmd_flags & flags[i].bit) + printf("%s", flags[i].str); + } + + if ((cmd_flags & REQ_OP_MASK) < ARRAY_SIZE(ops)) + printf("%s", ops[cmd_flags & REQ_OP_MASK]); + else + printf("Unknown"); +} + +static +int print_log2_hists(struct bpf_map *hists, struct partitions *partitions) +{ + struct hist_key lookup_key = { .cmd_flags = -1 }, next_key; + const char *units = env.milliseconds ? "msecs" : "usecs"; + const struct partition *partition; + int err, fd = bpf_map__fd(hists); + struct hist hist; + + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_lookup_elem(fd, &next_key, &hist); + if (err < 0) { + fprintf(stderr, "failed to lookup hist: %d\n", err); + return -1; + } + if (env.per_disk) { + partition = partitions__get_by_dev(partitions, + next_key.dev); + printf("\ndisk = %s\t", partition ? partition->name : + "Unknown"); + } + if (env.per_flag) + print_cmd_flags(next_key.cmd_flags); + printf("\n"); + print_log2_hist(hist.slots, MAX_SLOTS, units); + lookup_key = next_key; + } + + lookup_key.cmd_flags = -1; + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_delete_elem(fd, &next_key); + if (err < 0) { + fprintf(stderr, "failed to cleanup hist : %d\n", err); + return -1; + } + lookup_key = next_key; + } + + return 0; +} + +int main(int argc, char **argv) +{ + struct partitions *partitions = NULL; + const struct partition *partition; + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct biolatency_bpf *obj; + struct tm *tm; + char ts[32]; + time_t t; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = biolatency_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF ojbect\n"); + return 1; + } + + partitions = partitions__load(); + if (!partitions) { + fprintf(stderr, "failed to load partitions info\n"); + goto cleanup; + } + + /* initialize global data (filtering options) */ + if (env.disk) { + partition = partitions__get_by_name(partitions, env.disk); + if (!partition) { + fprintf(stderr, "invaild partition name: not exist\n"); + goto cleanup; + } + obj->rodata->targ_dev = partition->dev; + } + obj->rodata->targ_per_disk = env.per_disk; + obj->rodata->targ_per_flag = env.per_flag; + obj->rodata->targ_ms = env.milliseconds; + obj->rodata->targ_queued = env.queued; + + err = biolatency_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + if (env.queued) { + obj->links.block_rq_insert = + bpf_program__attach(obj->progs.block_rq_insert); + err = libbpf_get_error(obj->links.block_rq_insert); + if (err) { + fprintf(stderr, "failed to attach: %s\n", strerror(-err)); + goto cleanup; + } + } + obj->links.block_rq_issue = + bpf_program__attach(obj->progs.block_rq_issue); + err = libbpf_get_error(obj->links.block_rq_issue); + if (err) { + fprintf(stderr, "failed to attach: %s\n", strerror(-err)); + goto cleanup; + } + obj->links.block_rq_complete = + bpf_program__attach(obj->progs.block_rq_complete); + err = libbpf_get_error(obj->links.block_rq_complete); + if (err) { + fprintf(stderr, "failed to attach: %s\n", strerror(-err)); + goto cleanup; + } + + signal(SIGINT, sig_handler); + + printf("Tracing block device I/O... Hit Ctrl-C to end.\n"); + + /* main: poll */ + while (1) { + sleep(env.interval); + printf("\n"); + + if (env.timestamp) { + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + printf("%-8s\n", ts); + } + + err = print_log2_hists(obj->maps.hists, partitions); + if (err) + break; + + if (exiting || --env.times == 0) + break; + } + +cleanup: + biolatency_bpf__destroy(obj); + partitions__free(partitions); + + return err != 0; +} diff --git a/libbpf-tools/biolatency.h b/libbpf-tools/biolatency.h new file mode 100644 index 000000000..e12515bbb --- /dev/null +++ b/libbpf-tools/biolatency.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __BIOLATENCY_H +#define __BIOLATENCY_H + +#define DISK_NAME_LEN 32 +#define MAX_SLOTS 27 + +#define MINORBITS 20 +#define MINORMASK ((1U << MINORBITS) - 1) + +#define MKDEV(ma, mi) (((ma) << MINORBITS) | (mi)) + +struct hist_key { + __u32 cmd_flags; + __u32 dev; +}; + +struct hist { + __u32 slots[MAX_SLOTS]; +}; + +#endif /* __BIOLATENCY_H */ diff --git a/libbpf-tools/biopattern.bpf.c b/libbpf-tools/biopattern.bpf.c new file mode 100644 index 000000000..835936b3f --- /dev/null +++ b/libbpf-tools/biopattern.bpf.c @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include "biopattern.h" +#include "maps.bpf.h" + +const volatile dev_t targ_dev = -1; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 64); + __type(key, dev_t); + __type(value, struct counter); + __uint(map_flags, BPF_F_NO_PREALLOC); +} counters SEC(".maps"); + +SEC("tracepoint/block/block_rq_complete") +int handle__block_rq_complete(struct trace_event_raw_block_rq_complete *ctx) +{ + sector_t *last_sectorp, sector = ctx->sector; + struct counter *counterp, zero = {}; + u32 nr_sector = ctx->nr_sector; + dev_t dev = ctx->dev; + + if (targ_dev != -1 && targ_dev != dev) + return 0; + + counterp = bpf_map_lookup_or_try_init(&counters, &dev, &zero); + if (!counterp) + return 0; + if (counterp->last_sector) { + if (counterp->last_sector == sector) + __sync_fetch_and_add(&counterp->sequential, 1); + else + __sync_fetch_and_add(&counterp->random, 1); + __sync_fetch_and_add(&counterp->bytes, nr_sector * 512); + } + counterp->last_sector = sector + nr_sector; + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/biopattern.c b/libbpf-tools/biopattern.c new file mode 100644 index 000000000..121e5f8e1 --- /dev/null +++ b/libbpf-tools/biopattern.c @@ -0,0 +1,239 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on biopattern(8) from BPF-Perf-Tools-Book by Brendan Gregg. +// 17-Jun-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include "biopattern.h" +#include "biopattern.skel.h" +#include "trace_helpers.h" + +static struct env { + char *disk; + time_t interval; + bool timestamp; + bool verbose; + int times; +} env = { + .interval = 99999999, + .times = 99999999, +}; + +static volatile bool exiting; + +const char *argp_program_version = "biopattern 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Show block device I/O pattern.\n" +"\n" +"USAGE: biopattern [--help] [-T] [-d] [interval] [count]\n" +"\n" +"EXAMPLES:\n" +" biopattern # show block I/O pattern\n" +" biopattern 1 10 # print 1 second summaries, 10 times\n" +" biopattern -T 1 # 1s summaries with timestamps\n" +" biopattern -d sdc # trace sdc only\n"; + +static const struct argp_option opts[] = { + { "timestamp", 'T', NULL, 0, "Include timestamp on output" }, + { "disk", 'd', "DISK", 0, "Trace this disk only" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'd': + env.disk = arg; + if (strlen(arg) + 1 > DISK_NAME_LEN) { + fprintf(stderr, "invaild disk name: too long\n"); + argp_usage(state); + } + break; + case 'T': + env.timestamp = true; + break; + case ARGP_KEY_ARG: + errno = 0; + if (pos_args == 0) { + env.interval = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid internal\n"); + argp_usage(state); + } + } else if (pos_args == 1) { + env.times = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid times\n"); + argp_usage(state); + } + } else { + fprintf(stderr, + "unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + pos_args++; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void sig_handler(int sig) +{ + exiting = true; +} + +static int print_map(struct bpf_map *counters, struct partitions *partitions) +{ + __u32 total, lookup_key = -1, next_key; + int err, fd = bpf_map__fd(counters); + const struct partition *partition; + struct counter counter; + struct tm *tm; + char ts[32]; + time_t t; + + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_lookup_elem(fd, &next_key, &counter); + if (err < 0) { + fprintf(stderr, "failed to lookup counters: %d\n", err); + return -1; + } + lookup_key = next_key; + total = counter.sequential + counter.random; + if (!total) + continue; + if (env.timestamp) { + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + printf("%-9s ", ts); + } + partition = partitions__get_by_dev(partitions, next_key); + printf("%-7s %5ld %5ld %8d %10lld\n", + partition ? partition->name : "Unknown", + counter.random * 100L / total, + counter.sequential * 100L / total, total, + counter.bytes / 1024); + } + + lookup_key = -1; + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_delete_elem(fd, &next_key); + if (err < 0) { + fprintf(stderr, "failed to cleanup counters: %d\n", err); + return -1; + } + lookup_key = next_key; + } + + return 0; +} + +int main(int argc, char **argv) +{ + struct partitions *partitions = NULL; + const struct partition *partition; + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct biopattern_bpf *obj; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = biopattern_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF ojbect\n"); + return 1; + } + + partitions = partitions__load(); + if (!partitions) { + fprintf(stderr, "failed to load partitions info\n"); + goto cleanup; + } + + /* initialize global data (filtering options) */ + if (env.disk) { + partition = partitions__get_by_name(partitions, env.disk); + if (!partition) { + fprintf(stderr, "invaild partition name: not exist\n"); + goto cleanup; + } + obj->rodata->targ_dev = partition->dev; + } + + err = biopattern_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + err = biopattern_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs\n"); + goto cleanup; + } + + signal(SIGINT, sig_handler); + + printf("Tracing block device I/O requested seeks... Hit Ctrl-C to " + "end.\n"); + if (env.timestamp) + printf("%-9s ", "TIME"); + printf("%-7s %5s %5s %8s %10s\n", "DISK", "%RND", "%SEQ", + "COUNT", "KBYTES"); + + /* main: poll */ + while (1) { + sleep(env.interval); + + err = print_map(obj->maps.counters, partitions); + if (err) + break; + + if (exiting || --env.times == 0) + break; + } + +cleanup: + biopattern_bpf__destroy(obj); + partitions__free(partitions); + + return err != 0; +} diff --git a/libbpf-tools/biopattern.h b/libbpf-tools/biopattern.h new file mode 100644 index 000000000..18860a53e --- /dev/null +++ b/libbpf-tools/biopattern.h @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +#ifndef __BIOPATTERN_H +#define __BIOPATTERN_H + +#define DISK_NAME_LEN 32 + +struct counter { + __u64 last_sector; + __u64 bytes; + __u32 sequential; + __u32 random; +}; + +#endif /* __BIOPATTERN_H */ diff --git a/libbpf-tools/biosnoop.bpf.c b/libbpf-tools/biosnoop.bpf.c new file mode 100644 index 000000000..20f0c7788 --- /dev/null +++ b/libbpf-tools/biosnoop.bpf.c @@ -0,0 +1,152 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include +#include "biosnoop.h" + +#define MAX_ENTRIES 10240 + +const volatile bool targ_queued = false; +const volatile dev_t targ_dev = -1; + +struct piddata { + char comm[TASK_COMM_LEN]; + u32 pid; +}; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct request *); + __type(value, struct piddata); + __uint(map_flags, BPF_F_NO_PREALLOC); +} infobyreq SEC(".maps"); + +struct stage { + u64 insert; + u64 issue; + dev_t dev; +}; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct request *); + __type(value, struct stage); +} start SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); + __uint(key_size, sizeof(u32)); + __uint(value_size, sizeof(u32)); +} events SEC(".maps"); + +static __always_inline +int trace_pid(struct request *rq) +{ + u64 id = bpf_get_current_pid_tgid(); + struct piddata piddata = {}; + + piddata.pid = id; + bpf_get_current_comm(&piddata.comm, sizeof(&piddata.comm)); + bpf_map_update_elem(&infobyreq, &rq, &piddata, 0); + return 0; +} + +SEC("fentry/blk_account_io_start") +int BPF_PROG(blk_account_io_start, struct request *rq) +{ + return trace_pid(rq); +} + +SEC("kprobe/blk_account_io_merge_bio") +int BPF_KPROBE(blk_account_io_merge_bio, struct request *rq) +{ + return trace_pid(rq); +} + +static __always_inline +int trace_rq_start(struct request *rq, bool insert) +{ + struct stage *stagep, stage = {}; + u64 ts = bpf_ktime_get_ns(); + + stagep = bpf_map_lookup_elem(&start, &rq); + if (!stagep) { + struct gendisk *disk = BPF_CORE_READ(rq, rq_disk); + + stage.dev = disk ? MKDEV(BPF_CORE_READ(disk, major), + BPF_CORE_READ(disk, first_minor)) : 0; + if (targ_dev != -1 && targ_dev != stage.dev) + return 0; + stagep = &stage; + } + if (insert) + stagep->insert = ts; + else + stagep->issue = ts; + if (stagep == &stage) + bpf_map_update_elem(&start, &rq, stagep, 0); + return 0; +} + +SEC("tp_btf/block_rq_insert") +int BPF_PROG(block_rq_insert, struct request_queue *q, struct request *rq) +{ + return trace_rq_start(rq, true); +} + +SEC("tp_btf/block_rq_issue") +int BPF_PROG(block_rq_issue, struct request_queue *q, struct request *rq) +{ + return trace_rq_start(rq, false); +} + +SEC("tp_btf/block_rq_complete") +int BPF_PROG(block_rq_complete, struct request *rq, int error, + unsigned int nr_bytes) +{ + u64 slot, ts = bpf_ktime_get_ns(); + struct piddata *piddatap; + struct event event = {}; + struct stage *stagep; + s64 delta; + + stagep = bpf_map_lookup_elem(&start, &rq); + if (!stagep) + return 0; + delta = (s64)(ts - stagep->issue); + if (delta < 0) + goto cleanup; + piddatap = bpf_map_lookup_elem(&infobyreq, &rq); + if (!piddatap) { + event.comm[0] = '?'; + } else { + __builtin_memcpy(&event.comm, piddatap->comm, + sizeof(event.comm)); + event.pid = piddatap->pid; + } + event.delta = delta; + if (targ_queued && BPF_CORE_READ(rq, q, elevator)) { + if (!stagep->insert) + event.qdelta = -1; /* missed or don't insert entry */ + else + event.qdelta = stagep->issue - stagep->insert; + } + event.ts = ts; + event.sector = rq->__sector; + event.len = rq->__data_len; + event.cmd_flags = rq->cmd_flags; + event.dev = stagep->dev; + bpf_perf_event_output(ctx, &events, BPF_F_CURRENT_CPU, &event, + sizeof(event)); + +cleanup: + bpf_map_delete_elem(&start, &rq); + bpf_map_delete_elem(&infobyreq, &rq); + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/biosnoop.c b/libbpf-tools/biosnoop.c new file mode 100644 index 000000000..3bdfd8c6d --- /dev/null +++ b/libbpf-tools/biosnoop.c @@ -0,0 +1,306 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on biosnoop(8) from BCC by Brendan Gregg. +// 29-Jun-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include "blk_types.h" +#include "biosnoop.h" +#include "biosnoop.skel.h" +#include "trace_helpers.h" + +#define PERF_BUFFER_PAGES 16 +#define PERF_POLL_TIMEOUT_MS 100 + +static struct env { + char *disk; + int duration; + bool timestamp; + bool queued; + bool verbose; +} env = {}; + +static volatile __u64 start_ts; + +const char *argp_program_version = "biosnoop 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Trace block I/O.\n" +"\n" +"USAGE: biosnoop [--help] [-d] [-Q]\n" +"\n" +"EXAMPLES:\n" +" biosnoop # trace all block I/O\n" +" biosnoop -Q # include OS queued time in I/O time\n" +" biosnoop 10 # trace for 10 seconds only\n" +" biosnoop -d sdc # trace sdc only\n"; + +static const struct argp_option opts[] = { + { "queued", 'Q', NULL, 0, "Include OS queued time in I/O time" }, + { "disk", 'd', "DISK", 0, "Trace this disk only" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'Q': + env.queued = true; + break; + case 'd': + env.disk = arg; + if (strlen(arg) + 1 > DISK_NAME_LEN) { + fprintf(stderr, "invaild disk name: too long\n"); + argp_usage(state); + } + break; + case ARGP_KEY_ARG: + if (pos_args++) { + fprintf(stderr, + "unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + errno = 0; + env.duration = strtoll(arg, NULL, 10); + if (errno || env.duration <= 0) { + fprintf(stderr, "invalid delay (in us): %s\n", arg); + argp_usage(state); + } + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void blk_fill_rwbs(char *rwbs, unsigned int op) +{ + int i = 0; + + if (op & REQ_PREFLUSH) + rwbs[i++] = 'F'; + + switch (op & REQ_OP_MASK) { + case REQ_OP_WRITE: + case REQ_OP_WRITE_SAME: + rwbs[i++] = 'W'; + break; + case REQ_OP_DISCARD: + rwbs[i++] = 'D'; + break; + case REQ_OP_SECURE_ERASE: + rwbs[i++] = 'D'; + rwbs[i++] = 'E'; + break; + case REQ_OP_FLUSH: + rwbs[i++] = 'F'; + break; + case REQ_OP_READ: + rwbs[i++] = 'R'; + break; + default: + rwbs[i++] = 'N'; + } + + if (op & REQ_FUA) + rwbs[i++] = 'F'; + if (op & REQ_RAHEAD) + rwbs[i++] = 'A'; + if (op & REQ_SYNC) + rwbs[i++] = 'S'; + if (op & REQ_META) + rwbs[i++] = 'M'; + + rwbs[i] = '\0'; +} + +static struct partitions *partitions; + +void handle_event(void *ctx, int cpu, void *data, __u32 data_sz) +{ + const struct partition *partition; + const struct event *e = data; + char rwbs[RWBS_LEN]; + + if (!start_ts) + start_ts = e->ts; + blk_fill_rwbs(rwbs, e->cmd_flags); + partition = partitions__get_by_dev(partitions, e->dev); + printf("%-11.6f %-14.14s %-6d %-7s %-4s %-10lld %-7d ", + (e->ts - start_ts) / 1000000000.0, + e->comm, e->pid, partition ? partition->name : "Unknown", rwbs, + e->sector, e->len); + if (env.queued) + printf("%7.3f ", e->qdelta != -1 ? + e->qdelta / 1000000.0 : -1); + printf("%7.3f\n", e->delta / 1000000.0); +} + +void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt) +{ + fprintf(stderr, "lost %llu events on CPU #%d\n", lost_cnt, cpu); +} + +int main(int argc, char **argv) +{ + const struct partition *partition; + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct perf_buffer_opts pb_opts; + struct perf_buffer *pb = NULL; + struct ksyms *ksyms = NULL; + struct biosnoop_bpf *obj; + __u64 time_end = 0; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = biosnoop_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF ojbect\n"); + return 1; + } + + partitions = partitions__load(); + if (!partitions) { + fprintf(stderr, "failed to load partitions info\n"); + goto cleanup; + } + + /* initialize global data (filtering options) */ + if (env.disk) { + partition = partitions__get_by_name(partitions, env.disk); + if (!partition) { + fprintf(stderr, "invaild partition name: not exist\n"); + goto cleanup; + } + } + obj->rodata->targ_queued = env.queued; + + err = biosnoop_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + obj->links.blk_account_io_start = + bpf_program__attach(obj->progs.blk_account_io_start); + err = libbpf_get_error(obj->links.blk_account_io_start); + if (err) { + fprintf(stderr, "failed to attach blk_account_io_start: %s\n", + strerror(err)); + goto cleanup; + } + ksyms = ksyms__load(); + if (!ksyms) { + fprintf(stderr, "failed to load kallsyms\n"); + goto cleanup; + } + if (ksyms__get_symbol(ksyms, "blk_account_io_merge_bio")) { + obj->links.blk_account_io_merge_bio = + bpf_program__attach(obj->progs.blk_account_io_merge_bio); + err = libbpf_get_error(obj->links.blk_account_io_merge_bio); + if (err) { + fprintf(stderr, "failed to attach " + "blk_account_io_merge_bio: %s\n", + strerror(err)); + goto cleanup; + } + } + if (env.queued) { + obj->links.block_rq_insert = + bpf_program__attach(obj->progs.block_rq_insert); + err = libbpf_get_error(obj->links.block_rq_insert); + if (err) { + fprintf(stderr, "failed to attach block_rq_insert: %s\n", + strerror(err)); + goto cleanup; + } + } + obj->links.block_rq_issue = + bpf_program__attach(obj->progs.block_rq_issue); + err = libbpf_get_error(obj->links.block_rq_issue); + if (err) { + fprintf(stderr, "failed to attach block_rq_issue: %s\n", + strerror(err)); + goto cleanup; + } + obj->links.block_rq_complete = + bpf_program__attach(obj->progs.block_rq_complete); + err = libbpf_get_error(obj->links.block_rq_complete); + if (err) { + fprintf(stderr, "failed to attach block_rq_complete: %s\n", + strerror(err)); + goto cleanup; + } + + pb_opts.sample_cb = handle_event; + pb_opts.lost_cb = handle_lost_events; + pb = perf_buffer__new(bpf_map__fd(obj->maps.events), PERF_BUFFER_PAGES, + &pb_opts); + err = libbpf_get_error(pb); + if (err) { + pb = NULL; + fprintf(stderr, "failed to open perf buffer: %d\n", err); + goto cleanup; + } + + printf("%-11s %-14s %-6s %-7s %-4s %-10s %-7s ", + "TIME(s)", "COMM", "PID", "DISK", "T", "SECTOR", "BYTES"); + if (env.queued) + printf("%7s ", "QUE(ms)"); + printf("%7s\n", "LAT(ms)"); + + /* setup duration */ + if (env.duration) + time_end = get_ktime_ns() + env.duration * NSEC_PER_SEC; + + /* main: poll */ + while (1) { + if ((err = perf_buffer__poll(pb, PERF_POLL_TIMEOUT_MS)) < 0) + break; + if (env.duration && get_ktime_ns() > time_end) + goto cleanup; + } + printf("error polling perf buffer: %d\n", err); + +cleanup: + biosnoop_bpf__destroy(obj); + ksyms__free(ksyms); + partitions__free(partitions); + + return err != 0; +} diff --git a/libbpf-tools/biosnoop.h b/libbpf-tools/biosnoop.h new file mode 100644 index 000000000..ffa149c9b --- /dev/null +++ b/libbpf-tools/biosnoop.h @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +#ifndef __BIOSNOOP_H +#define __BIOSNOOP_H + +#define DISK_NAME_LEN 32 +#define TASK_COMM_LEN 16 +#define RWBS_LEN 8 + +#define MINORBITS 20 +#define MINORMASK ((1U << MINORBITS) - 1) + +#define MKDEV(ma, mi) (((ma) << MINORBITS) | (mi)) + +struct event { + char comm[TASK_COMM_LEN]; + __u64 delta; + __u64 qdelta; + __u64 ts; + __u64 sector; + __u32 len; + __u32 pid; + __u32 cmd_flags; + __u32 dev; +}; + +#endif /* __BIOSNOOP_H */ diff --git a/libbpf-tools/biostacks.bpf.c b/libbpf-tools/biostacks.bpf.c new file mode 100644 index 000000000..f3d159abd --- /dev/null +++ b/libbpf-tools/biostacks.bpf.c @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include +#include "biostacks.h" +#include "bits.bpf.h" +#include "maps.bpf.h" + +#define MAX_ENTRIES 10240 +#define NULL 0 + +const volatile bool targ_ms = false; +const volatile dev_t targ_dev = -1; + +struct internal_rqinfo { + u64 start_ts; + struct rqinfo rqinfo; +}; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct request *); + __type(value, struct internal_rqinfo); + __uint(map_flags, BPF_F_NO_PREALLOC); +} rqinfos SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct rqinfo); + __type(value, struct hist); + __uint(map_flags, BPF_F_NO_PREALLOC); +} hists SEC(".maps"); + +static struct hist zero; + +static __always_inline +int trace_start(void *ctx, struct request *rq, bool merge_bio) +{ + struct internal_rqinfo *i_rqinfop = NULL, i_rqinfo = {}; + struct gendisk *disk = BPF_CORE_READ(rq, rq_disk); + dev_t dev; + + dev = disk ? MKDEV(BPF_CORE_READ(disk, major), + BPF_CORE_READ(disk, first_minor)) : 0; + if (targ_dev != -1 && targ_dev != dev) + return 0; + + if (merge_bio) + i_rqinfop = bpf_map_lookup_elem(&rqinfos, &rq); + if (!i_rqinfop) + i_rqinfop = &i_rqinfo; + + i_rqinfop->start_ts = bpf_ktime_get_ns(); + i_rqinfop->rqinfo.pid = bpf_get_current_pid_tgid(); + i_rqinfop->rqinfo.kern_stack_size = + bpf_get_stack(ctx, i_rqinfop->rqinfo.kern_stack, + sizeof(i_rqinfop->rqinfo.kern_stack), 0); + bpf_get_current_comm(&i_rqinfop->rqinfo.comm, + sizeof(&i_rqinfop->rqinfo.comm)); + i_rqinfop->rqinfo.dev = dev; + + if (i_rqinfop == &i_rqinfo) + bpf_map_update_elem(&rqinfos, &rq, i_rqinfop, 0); + return 0; +} + +SEC("fentry/blk_account_io_start") +int BPF_PROG(blk_account_io_start, struct request *rq) +{ + return trace_start(ctx, rq, false); +} + +SEC("kprobe/blk_account_io_merge_bio") +int BPF_KPROBE(blk_account_io_merge_bio, struct request *rq) +{ + return trace_start(ctx, rq, true); +} + +SEC("fentry/blk_account_io_done") +int BPF_PROG(blk_account_io_done, struct request *rq) +{ + u64 slot, ts = bpf_ktime_get_ns(); + struct internal_rqinfo *i_rqinfop; + struct rqinfo *rqinfop; + struct hist *histp; + s64 delta; + + i_rqinfop = bpf_map_lookup_elem(&rqinfos, &rq); + if (!i_rqinfop) + return 0; + delta = (s64)(ts - i_rqinfop->start_ts); + if (delta < 0) + goto cleanup; + histp = bpf_map_lookup_or_try_init(&hists, &i_rqinfop->rqinfo, &zero); + if (!histp) + goto cleanup; + if (targ_ms) + delta /= 1000000U; + else + delta /= 1000U; + slot = log2l(delta); + if (slot >= MAX_SLOTS) + slot = MAX_SLOTS - 1; + __sync_fetch_and_add(&histp->slots[slot], 1); + +cleanup: + bpf_map_delete_elem(&rqinfos, &rq); + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/biostacks.c b/libbpf-tools/biostacks.c new file mode 100644 index 000000000..3d25d2c2a --- /dev/null +++ b/libbpf-tools/biostacks.c @@ -0,0 +1,229 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on biostacks(8) from BPF-Perf-Tools-Book by Brendan Gregg. +// 10-Aug-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include "biostacks.h" +#include "biostacks.skel.h" +#include "trace_helpers.h" + +static struct env { + char *disk; + int duration; + bool milliseconds; + bool verbose; +} env = { + .duration = -1, +}; + +const char *argp_program_version = "biostacks 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Tracing block I/O with init stacks.\n" +"\n" +"USAGE: biostacks [--help] [-d disk] [-m] [duration]\n" +"\n" +"EXAMPLES:\n" +" biostacks # trace block I/O with init stacks.\n" +" biostacks 1 # trace for 1 seconds only\n" +" biostacks -d sdc # trace sdc only\n"; + +static const struct argp_option opts[] = { + { "disk", 'd', "DISK", 0, "Trace this disk only" }, + { "milliseconds", 'm', NULL, 0, "Millisecond histogram" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'd': + env.disk = arg; + if (strlen(arg) + 1 > DISK_NAME_LEN) { + fprintf(stderr, "invaild disk name: too long\n"); + argp_usage(state); + } + break; + case 'm': + env.milliseconds = true; + break; + case ARGP_KEY_ARG: + if (pos_args++) { + fprintf(stderr, + "unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + errno = 0; + env.duration = strtoll(arg, NULL, 10); + if (errno || env.duration <= 0) { + fprintf(stderr, "invalid delay (in us): %s\n", arg); + argp_usage(state); + } + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void sig_handler(int sig) +{ +} + +static +void print_map(struct ksyms *ksyms, struct partitions *partitions, int fd) +{ + const char *units = env.milliseconds ? "msecs" : "usecs"; + struct rqinfo lookup_key = {}, next_key; + const struct partition *partition; + const struct ksym *ksym; + int num_stack, i, err; + struct hist hist; + + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_lookup_elem(fd, &next_key, &hist); + if (err < 0) { + fprintf(stderr, "failed to lookup hist: %d\n", err); + return; + } + partition = partitions__get_by_dev(partitions, next_key.dev); + printf("%-14.14s %-6d %-7s\n", + next_key.comm, next_key.pid, + partition ? partition->name : "Unknown"); + num_stack = next_key.kern_stack_size / + sizeof(next_key.kern_stack[0]); + for (i = 0; i < num_stack; i++) { + ksym = ksyms__map_addr(ksyms, next_key.kern_stack[i]); + printf("%s\n", ksym ? ksym->name : "Unknown"); + } + print_log2_hist(hist.slots, MAX_SLOTS, units); + printf("\n"); + lookup_key = next_key; + } + + return; +} + +int main(int argc, char **argv) +{ + struct partitions *partitions = NULL; + const struct partition *partition; + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct ksyms *ksyms = NULL; + struct biostacks_bpf *obj; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = biostacks_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF ojbect\n"); + return 1; + } + + partitions = partitions__load(); + if (!partitions) { + fprintf(stderr, "failed to load partitions info\n"); + goto cleanup; + } + + /* initialize global data (filtering options) */ + if (env.disk) { + partition = partitions__get_by_name(partitions, env.disk); + if (!partition) { + fprintf(stderr, "invaild partition name: not exist\n"); + goto cleanup; + } + obj->rodata->targ_dev = partition->dev; + } + + obj->rodata->targ_ms = env.milliseconds; + + err = biostacks_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + obj->links.blk_account_io_start = + bpf_program__attach(obj->progs.blk_account_io_start); + err = libbpf_get_error(obj->links.blk_account_io_start); + if (err) { + fprintf(stderr, "failed to attach blk_account_io_start: %s\n", + strerror(err)); + goto cleanup; + } + ksyms = ksyms__load(); + if (!ksyms) { + fprintf(stderr, "failed to load kallsyms\n"); + goto cleanup; + } + if (ksyms__get_symbol(ksyms, "blk_account_io_merge_bio")) { + obj->links.blk_account_io_merge_bio = + bpf_program__attach(obj-> + progs.blk_account_io_merge_bio); + err = libbpf_get_error(obj-> + links.blk_account_io_merge_bio); + if (err) { + fprintf(stderr, "failed to attach " + "blk_account_io_merge_bio: %s\n", + strerror(err)); + goto cleanup; + } + } + obj->links.blk_account_io_done = + bpf_program__attach(obj->progs.blk_account_io_done); + err = libbpf_get_error(obj->links.blk_account_io_done); + if (err) { + fprintf(stderr, "failed to attach blk_account_io_done: %s\n", + strerror(err)); + goto cleanup; + } + + signal(SIGINT, sig_handler); + + printf("Tracing block I/O with init stacks. Hit Ctrl-C to end.\n"); + sleep(env.duration); + print_map(ksyms, partitions, bpf_map__fd(obj->maps.hists)); + +cleanup: + biostacks_bpf__destroy(obj); + ksyms__free(ksyms); + partitions__free(partitions); + + return err != 0; +} diff --git a/libbpf-tools/biostacks.h b/libbpf-tools/biostacks.h new file mode 100644 index 000000000..9917fb1d9 --- /dev/null +++ b/libbpf-tools/biostacks.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __BIOSTACKS_H +#define __BIOSTACKS_H + +#define DISK_NAME_LEN 32 +#define TASK_COMM_LEN 16 +#define MAX_SLOTS 20 +#define MAX_STACK 20 + +#define MINORBITS 20 +#define MINORMASK ((1U << MINORBITS) - 1) + +#define MKDEV(ma, mi) (((ma) << MINORBITS) | (mi)) + +struct rqinfo { + __u32 pid; + int kern_stack_size; + __u64 kern_stack[MAX_STACK]; + char comm[TASK_COMM_LEN]; + __u32 dev; +}; + +struct hist { + __u32 slots[MAX_SLOTS]; +}; + +#endif /* __BIOSTACKS_H */ diff --git a/libbpf-tools/bitesize.bpf.c b/libbpf-tools/bitesize.bpf.c new file mode 100644 index 000000000..faa69acc5 --- /dev/null +++ b/libbpf-tools/bitesize.bpf.c @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include +#include "bitesize.h" +#include "bits.bpf.h" + +const volatile char targ_comm[TASK_COMM_LEN] = {}; +const volatile dev_t targ_dev = -1; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 10240); + __type(key, struct hist_key); + __type(value, struct hist); + __uint(map_flags, BPF_F_NO_PREALLOC); +} hists SEC(".maps"); + +static struct hist initial_hist; + +static __always_inline bool comm_allowed(const char *comm) +{ + int i; + + for (i = 0; targ_comm[i] != '\0' && i < TASK_COMM_LEN; i++) { + if (comm[i] != targ_comm[i]) + return false; + } + return true; +} + +SEC("tp_btf/block_rq_issue") +int BPF_PROG(block_rq_issue, struct request_queue *q, struct request *rq) +{ + struct hist_key hkey; + struct hist *histp; + u64 slot; + + if (targ_dev != -1) { + struct gendisk *disk = BPF_CORE_READ(rq, rq_disk); + dev_t dev; + + dev = disk ? MKDEV(BPF_CORE_READ(disk, major), + BPF_CORE_READ(disk, first_minor)) : 0; + if (targ_dev != dev) + return 0; + } + bpf_get_current_comm(&hkey.comm, sizeof(hkey.comm)); + if (!comm_allowed(hkey.comm)) + return 0; + + histp = bpf_map_lookup_elem(&hists, &hkey); + if (!histp) { + bpf_map_update_elem(&hists, &hkey, &initial_hist, 0); + histp = bpf_map_lookup_elem(&hists, &hkey); + if (!histp) + return 0; + } + slot = log2l(rq->__data_len / 1024); + if (slot >= MAX_SLOTS) + slot = MAX_SLOTS - 1; + __sync_fetch_and_add(&histp->slots[slot], 1); + + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/bitesize.c b/libbpf-tools/bitesize.c new file mode 100644 index 000000000..967bf80a3 --- /dev/null +++ b/libbpf-tools/bitesize.c @@ -0,0 +1,241 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on bitesize(8) from BCC by Brendan Gregg. +// 16-Jun-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include "bitesize.h" +#include "bitesize.skel.h" +#include "trace_helpers.h" + +static struct env { + char *disk; + char *comm; + int comm_len; + time_t interval; + bool timestamp; + bool verbose; + int times; +} env = { + .interval = 99999999, + .times = 99999999, +}; + +static volatile bool exiting; + +const char *argp_program_version = "bitesize 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Summarize block device I/O size as a histogram.\n" +"\n" +"USAGE: bitesize [--help] [-T] [-c] [-d] [interval] [count]\n" +"\n" +"EXAMPLES:\n" +" bitesize # summarize block I/O latency as a histogram\n" +" bitesize 1 10 # print 1 second summaries, 10 times\n" +" bitesize -T 1 # 1s summaries with timestamps\n" +" bitesize -c fio # trace fio only\n"; + +static const struct argp_option opts[] = { + { "timestamp", 'T', NULL, 0, "Include timestamp on output" }, + { "comm", 'c', "COMM", 0, "Trace this comm only" }, + { "disk", 'd', "DISK", 0, "Trace this disk only" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args, len; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'c': + env.comm = arg; + len = strlen(arg) + 1; + env.comm_len = len > TASK_COMM_LEN ? TASK_COMM_LEN : len; + break; + case 'd': + env.disk = arg; + if (strlen(arg) + 1 > DISK_NAME_LEN) { + fprintf(stderr, "invaild disk name: too long\n"); + argp_usage(state); + } + break; + case 'T': + env.timestamp = true; + break; + case ARGP_KEY_ARG: + errno = 0; + if (pos_args == 0) { + env.interval = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid internal\n"); + argp_usage(state); + } + } else if (pos_args == 1) { + env.times = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid times\n"); + argp_usage(state); + } + } else { + fprintf(stderr, + "unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + pos_args++; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void sig_handler(int sig) +{ + exiting = true; +} + +static int print_log2_hists(int fd) +{ + struct hist_key lookup_key, next_key; + struct hist hist; + int err; + + memset(lookup_key.comm, '?', sizeof(lookup_key.comm)); + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_lookup_elem(fd, &next_key, &hist); + if (err < 0) { + fprintf(stderr, "failed to lookup hist: %d\n", err); + return -1; + } + printf("\nProcess Name = %s\n", next_key.comm); + print_log2_hist(hist.slots, MAX_SLOTS, "Kbytes"); + lookup_key = next_key; + } + + memset(lookup_key.comm, '?', sizeof(lookup_key.comm)); + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_delete_elem(fd, &next_key); + if (err < 0) { + fprintf(stderr, "failed to cleanup hist : %d\n", err); + return -1; + } + lookup_key = next_key; + } + + return 0; +} + +int main(int argc, char **argv) +{ + struct partitions *partitions = NULL; + const struct partition *partition; + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct bitesize_bpf *obj; + struct tm *tm; + char ts[32]; + int fd, err; + time_t t; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = bitesize_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF ojbect\n"); + return 1; + } + + partitions = partitions__load(); + if (!partitions) { + fprintf(stderr, "failed to load partitions info\n"); + goto cleanup; + } + + /* initialize global data (filtering options) */ + if (env.comm) + strncpy((char*)obj->rodata->targ_comm, env.comm, env.comm_len); + if (env.disk) { + partition = partitions__get_by_name(partitions, env.disk); + if (!partition) { + fprintf(stderr, "invaild partition name: not exist\n"); + goto cleanup; + } + obj->rodata->targ_dev = partition->dev; + } + + err = bitesize_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + err = bitesize_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs\n"); + goto cleanup; + } + + fd = bpf_map__fd(obj->maps.hists); + + signal(SIGINT, sig_handler); + + printf("Tracing block device I/O... Hit Ctrl-C to end.\n"); + + /* main: poll */ + while (1) { + sleep(env.interval); + printf("\n"); + + if (env.timestamp) { + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + printf("%-8s\n", ts); + } + + err = print_log2_hists(fd); + if (err) + break; + + if (exiting || --env.times == 0) + break; + } + +cleanup: + bitesize_bpf__destroy(obj); + partitions__free(partitions); + + return err != 0; +} diff --git a/libbpf-tools/bitesize.h b/libbpf-tools/bitesize.h new file mode 100644 index 000000000..2b4543e41 --- /dev/null +++ b/libbpf-tools/bitesize.h @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +#ifndef __BITESIZE_H +#define __BITESIZE_H + +#define TASK_COMM_LEN 16 +#define DISK_NAME_LEN 32 +#define MAX_SLOTS 20 + +#define MINORBITS 20 +#define MINORMASK ((1U << MINORBITS) - 1) + +#define MKDEV(ma, mi) (((ma) << MINORBITS) | (mi)) + +struct hist_key { + char comm[TASK_COMM_LEN]; +}; + +struct hist { + __u32 slots[MAX_SLOTS]; +}; + +#endif /* __BITESIZE_H */ diff --git a/libbpf-tools/bits.bpf.h b/libbpf-tools/bits.bpf.h new file mode 100644 index 000000000..e1511c0b5 --- /dev/null +++ b/libbpf-tools/bits.bpf.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __BITS_BPF_H +#define __BITS_BPF_H + +static __always_inline u64 log2(u32 v) +{ + u32 shift, r; + + r = (v > 0xFFFF) << 4; v >>= r; + shift = (v > 0xFF) << 3; v >>= shift; r |= shift; + shift = (v > 0xF) << 2; v >>= shift; r |= shift; + shift = (v > 0x3) << 1; v >>= shift; r |= shift; + r |= (v >> 1); + + return r; +} + +static __always_inline u64 log2l(u64 v) +{ + u32 hi = v >> 32; + + if (hi) + return log2(hi) + 32; + else + return log2(v); +} + +#endif /* __BITS_BPF_H */ diff --git a/libbpf-tools/blk_types.h b/libbpf-tools/blk_types.h new file mode 100644 index 000000000..3fc8a4945 --- /dev/null +++ b/libbpf-tools/blk_types.h @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __BLK_TYPES_H +#define __BLK_TYPES_H + +/* From include/linux/blk_types.h */ + +/* + * Operations and flags common to the bio and request structures. + * We use 8 bits for encoding the operation, and the remaining 24 for flags. + * + * The least significant bit of the operation number indicates the data + * transfer direction: + * + * - if the least significant bit is set transfers are TO the device + * - if the least significant bit is not set transfers are FROM the device + * + * If a operation does not transfer data the least significant bit has no + * meaning. + */ +#define REQ_OP_BITS 8 +#define REQ_OP_MASK ((1 << REQ_OP_BITS) - 1) +#define REQ_FLAG_BITS 24 + +enum req_opf { + /* read sectors from the device */ + REQ_OP_READ = 0, + /* write sectors to the device */ + REQ_OP_WRITE = 1, + /* flush the volatile write cache */ + REQ_OP_FLUSH = 2, + /* discard sectors */ + REQ_OP_DISCARD = 3, + /* securely erase sectors */ + REQ_OP_SECURE_ERASE = 5, + /* reset a zone write pointer */ + REQ_OP_ZONE_RESET = 6, + /* write the same sector many times */ + REQ_OP_WRITE_SAME = 7, + /* reset all the zone present on the device */ + REQ_OP_ZONE_RESET_ALL = 8, + /* write the zero filled sector many times */ + REQ_OP_WRITE_ZEROES = 9, + /* Open a zone */ + REQ_OP_ZONE_OPEN = 10, + /* Close a zone */ + REQ_OP_ZONE_CLOSE = 11, + /* Transition a zone to full */ + REQ_OP_ZONE_FINISH = 12, + + /* SCSI passthrough using struct scsi_request */ + REQ_OP_SCSI_IN = 32, + REQ_OP_SCSI_OUT = 33, + /* Driver private requests */ + REQ_OP_DRV_IN = 34, + REQ_OP_DRV_OUT = 35, + + REQ_OP_LAST, +}; + +enum req_flag_bits { + __REQ_FAILFAST_DEV = /* no driver retries of device errors */ + REQ_OP_BITS, + __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ + __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ + __REQ_SYNC, /* request is sync (sync write or read) */ + __REQ_META, /* metadata io request */ + __REQ_PRIO, /* boost priority in cfq */ + __REQ_NOMERGE, /* don't touch this for merging */ + __REQ_IDLE, /* anticipate more IO after this one */ + __REQ_INTEGRITY, /* I/O includes block integrity payload */ + __REQ_FUA, /* forced unit access */ + __REQ_PREFLUSH, /* request for cache flush */ + __REQ_RAHEAD, /* read ahead, can fail anytime */ + __REQ_BACKGROUND, /* background IO */ + __REQ_NOWAIT, /* Don't wait if request will block */ + __REQ_NOWAIT_INLINE, /* Return would-block error inline */ + /* + * When a shared kthread needs to issue a bio for a cgroup, doing + * so synchronously can lead to priority inversions as the kthread + * can be trapped waiting for that cgroup. CGROUP_PUNT flag makes + * submit_bio() punt the actual issuing to a dedicated per-blkcg + * work item to avoid such priority inversions. + */ + __REQ_CGROUP_PUNT, + + /* command specific flags for REQ_OP_WRITE_ZEROES: */ + __REQ_NOUNMAP, /* do not free blocks when zeroing */ + + __REQ_HIPRI, + + /* for driver use */ + __REQ_DRV, + __REQ_SWAP, /* swapping request. */ + __REQ_NR_BITS, /* stops here */ +}; + +#define REQ_FAILFAST_DEV (1ULL << __REQ_FAILFAST_DEV) +#define REQ_FAILFAST_TRANSPORT (1ULL << __REQ_FAILFAST_TRANSPORT) +#define REQ_FAILFAST_DRIVER (1ULL << __REQ_FAILFAST_DRIVER) +#define REQ_SYNC (1ULL << __REQ_SYNC) +#define REQ_META (1ULL << __REQ_META) +#define REQ_PRIO (1ULL << __REQ_PRIO) +#define REQ_NOMERGE (1ULL << __REQ_NOMERGE) +#define REQ_IDLE (1ULL << __REQ_IDLE) +#define REQ_INTEGRITY (1ULL << __REQ_INTEGRITY) +#define REQ_FUA (1ULL << __REQ_FUA) +#define REQ_PREFLUSH (1ULL << __REQ_PREFLUSH) +#define REQ_RAHEAD (1ULL << __REQ_RAHEAD) +#define REQ_BACKGROUND (1ULL << __REQ_BACKGROUND) +#define REQ_NOWAIT (1ULL << __REQ_NOWAIT) +#define REQ_NOWAIT_INLINE (1ULL << __REQ_NOWAIT_INLINE) +#define REQ_CGROUP_PUNT (1ULL << __REQ_CGROUP_PUNT) + +#define REQ_NOUNMAP (1ULL << __REQ_NOUNMAP) +#define REQ_HIPRI (1ULL << __REQ_HIPRI) + +#define REQ_DRV (1ULL << __REQ_DRV) +#define REQ_SWAP (1ULL << __REQ_SWAP) + +#define REQ_FAILFAST_MASK \ + (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) + +#define REQ_NOMERGE_FLAGS \ + (REQ_NOMERGE | REQ_PREFLUSH | REQ_FUA) + +#endif /* __BLK_TYPES_H */ diff --git a/libbpf-tools/cpudist.bpf.c b/libbpf-tools/cpudist.bpf.c new file mode 100644 index 000000000..af0cc81f6 --- /dev/null +++ b/libbpf-tools/cpudist.bpf.c @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include +#include "cpudist.h" +#include "bits.bpf.h" + +#define TASK_RUNNING 0 + +const volatile bool targ_per_process = false; +const volatile bool targ_per_thread = false; +const volatile bool targ_offcpu = false; +const volatile bool targ_ms = false; +const volatile pid_t targ_tgid = -1; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __type(key, u32); + __type(value, u64); +} start SEC(".maps"); + +static struct hist initial_hist; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __type(key, u32); + __type(value, struct hist); +} hists SEC(".maps"); + +static __always_inline void store_start(u32 tgid, u32 pid, u64 ts) +{ + if (targ_tgid != -1 && targ_tgid != tgid) + return; + bpf_map_update_elem(&start, &pid, &ts, 0); +} + +static __always_inline void update_hist(struct task_struct *task, + u32 tgid, u32 pid, u64 ts) +{ + u64 delta, *tsp, slot; + struct hist *histp; + u32 id; + + if (targ_tgid != -1 && targ_tgid != tgid) + return; + + tsp = bpf_map_lookup_elem(&start, &pid); + if (!tsp || ts < *tsp) + return; + + if (targ_per_process) + id = tgid; + else if (targ_per_thread) + id = pid; + else + id = -1; + histp = bpf_map_lookup_elem(&hists, &id); + if (!histp) { + bpf_map_update_elem(&hists, &id, &initial_hist, 0); + histp = bpf_map_lookup_elem(&hists, &id); + if (!histp) + return; + BPF_CORE_READ_STR_INTO(&histp->comm, task, comm); + } + delta = ts - *tsp; + if (targ_ms) + delta /= 1000000; + else + delta /= 1000; + slot = log2l(delta); + if (slot >= MAX_SLOTS) + slot = MAX_SLOTS - 1; + __sync_fetch_and_add(&histp->slots[slot], 1); +} + +SEC("kprobe/finish_task_switch") +int BPF_KPROBE(finish_task_switch, struct task_struct *prev) +{ + u32 prev_tgid = BPF_CORE_READ(prev, tgid); + u32 prev_pid = BPF_CORE_READ(prev, pid); + u64 id = bpf_get_current_pid_tgid(); + u32 tgid = id >> 32, pid = id; + u64 ts = bpf_ktime_get_ns(); + + if (targ_offcpu) { + store_start(prev_tgid, prev_pid, ts); + update_hist((void*)bpf_get_current_task(), tgid, pid, ts); + } else { + if (BPF_CORE_READ(prev, state) == TASK_RUNNING) + update_hist(prev, prev_tgid, prev_pid, ts); + store_start(tgid, pid, ts); + } + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/cpudist.c b/libbpf-tools/cpudist.c new file mode 100644 index 000000000..2315fb55b --- /dev/null +++ b/libbpf-tools/cpudist.c @@ -0,0 +1,271 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on cpudist(8) from BCC by Brendan Gregg & Dina Goldshtein. +// 8-May-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include "cpudist.h" +#include "cpudist.skel.h" +#include "trace_helpers.h" + +static struct env { + time_t interval; + pid_t pid; + int times; + bool offcpu; + bool timestamp; + bool per_process; + bool per_thread; + bool milliseconds; + bool verbose; +} env = { + .interval = 99999999, + .pid = -1, + .times = 99999999, +}; + +static volatile bool exiting; + +const char *argp_program_version = "cpudist 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Summarize on-CPU time per task as a histogram.\n" +"\n" +"USAGE: cpudist [--help] [-O] [-T] [-m] [-P] [-L] [-p PID] [interval] [count]\n" +"\n" +"EXAMPLES:\n" +" cpudist # summarize on-CPU time as a histogram" +" cpudist -O # summarize off-CPU time as a histogram" +" cpudist 1 10 # print 1 second summaries, 10 times" +" cpudist -mT 1 # 1s summaries, milliseconds, and timestamps" +" cpudist -P # show each PID separately" +" cpudist -p 185 # trace PID 185 only"; + +static const struct argp_option opts[] = { + { "offcpu", 'O', NULL, 0, "Measure off-CPU time" }, + { "timestamp", 'T', NULL, 0, "Include timestamp on output" }, + { "milliseconds", 'm', NULL, 0, "Millisecond histogram" }, + { "pids", 'P', NULL, 0, "Print a histogram per process ID" }, + { "tids", 'L', NULL, 0, "Print a histogram per thread ID" }, + { "pid", 'p', "PID", 0, "Trace this PID only" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'm': + env.milliseconds = true; + break; + case 'p': + errno = 0; + env.pid = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid PID: %s\n", arg); + argp_usage(state); + } + break; + case 'O': + env.offcpu = true; + break; + case 'P': + env.per_process = true; + break; + case 'L': + env.per_thread = true; + break; + case 'T': + env.timestamp = true; + break; + case ARGP_KEY_ARG: + errno = 0; + if (pos_args == 0) { + env.interval = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid internal\n"); + argp_usage(state); + } + } else if (pos_args == 1) { + env.times = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid times\n"); + argp_usage(state); + } + } else { + fprintf(stderr, + "unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + pos_args++; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static int get_pid_max(void) +{ + int pid_max; + FILE *f; + + f = fopen("/proc/sys/kernel/pid_max", "r"); + if (!f) + return -1; + if (fscanf(f, "%d\n", &pid_max) != 1) + pid_max = -1; + fclose(f); + return pid_max; +} + +static void sig_handler(int sig) +{ + exiting = true; +} + +static int print_log2_hists(int fd) +{ + char *units = env.milliseconds ? "msecs" : "usecs"; + __u32 lookup_key = -2, next_key; + struct hist hist; + int err; + + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_lookup_elem(fd, &next_key, &hist); + if (err < 0) { + fprintf(stderr, "failed to lookup hist: %d\n", err); + return -1; + } + if (env.per_process) + printf("\npid = %d %s\n", next_key, hist.comm); + if (env.per_thread) + printf("\ntid = %d %s\n", next_key, hist.comm); + print_log2_hist(hist.slots, MAX_SLOTS, units); + lookup_key = next_key; + } + + lookup_key = -2; + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_delete_elem(fd, &next_key); + if (err < 0) { + fprintf(stderr, "failed to cleanup hist : %d\n", err); + return -1; + } + lookup_key = next_key; + } + return 0; +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct cpudist_bpf *obj; + int pid_max, fd, err; + struct tm *tm; + char ts[32]; + time_t t; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = cpudist_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF ojbect\n"); + return 1; + } + + /* initialize global data (filtering options) */ + obj->rodata->targ_per_process = env.per_process; + obj->rodata->targ_per_thread = env.per_thread; + obj->rodata->targ_ms = env.milliseconds; + obj->rodata->targ_offcpu = env.offcpu; + obj->rodata->targ_tgid = env.pid; + + pid_max = get_pid_max(); + if (pid_max < 0) { + fprintf(stderr, "failed to get pid_max\n"); + return 1; + } + + bpf_map__resize(obj->maps.start, pid_max); + if (!env.per_process && !env.per_thread) + bpf_map__resize(obj->maps.hists, 1); + else + bpf_map__resize(obj->maps.hists, pid_max); + + err = cpudist_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + err = cpudist_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs\n"); + goto cleanup; + } + + fd = bpf_map__fd(obj->maps.hists); + + signal(SIGINT, sig_handler); + + printf("Tracing %s-CPU time... Hit Ctrl-C to end.\n", env.offcpu ? "off" : "on"); + + /* main: poll */ + while (1) { + sleep(env.interval); + printf("\n"); + + if (env.timestamp) { + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + printf("%-8s\n", ts); + } + + err = print_log2_hists(fd); + if (err) + break; + + if (exiting || --env.times == 0) + break; + } + +cleanup: + cpudist_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/cpudist.h b/libbpf-tools/cpudist.h new file mode 100644 index 000000000..2da5a5767 --- /dev/null +++ b/libbpf-tools/cpudist.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __CPUDIST_H +#define __CPUDIST_H + +#define TASK_COMM_LEN 16 +#define MAX_SLOTS 36 + +struct hist { + __u32 slots[MAX_SLOTS]; + char comm[TASK_COMM_LEN]; +}; + +#endif // __CPUDIST_H diff --git a/libbpf-tools/drsnoop.bpf.c b/libbpf-tools/drsnoop.bpf.c new file mode 100644 index 000000000..5f9ff8490 --- /dev/null +++ b/libbpf-tools/drsnoop.bpf.c @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include "drsnoop.h" + +const volatile pid_t targ_pid = 0; +const volatile pid_t targ_tgid = 0; +const volatile __u64 vm_zone_stat_kaddr = 0; + +struct piddata { + u64 ts; + u64 nr_free_pages; +}; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 8192); + __type(key, u32); + __type(value, struct piddata); +} start SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); + __uint(key_size, sizeof(u32)); + __uint(value_size, sizeof(u32)); +} events SEC(".maps"); + +SEC("tp_btf/mm_vmscan_direct_reclaim_begin") +int BPF_PROG(direct_reclaim_begin) +{ + u64 *vm_zone_stat_kaddrp = (u64*)vm_zone_stat_kaddr; + u64 id = bpf_get_current_pid_tgid(); + struct piddata piddata = {}; + u32 tgid = id >> 32; + u32 pid = id; + + if (targ_tgid && targ_tgid != tgid) + return 0; + if (targ_pid && targ_pid != pid) + return 0; + + piddata.ts = bpf_ktime_get_ns(); + if (vm_zone_stat_kaddrp) { + bpf_probe_read_kernel(&piddata.nr_free_pages, + sizeof(*vm_zone_stat_kaddrp), + &vm_zone_stat_kaddrp[NR_FREE_PAGES]); + } + + bpf_map_update_elem(&start, &pid, &piddata, 0); + return 0; +} + +SEC("tp_btf/mm_vmscan_direct_reclaim_end") +int BPF_PROG(direct_reclaim_end, unsigned long nr_reclaimed) +{ + u64 id = bpf_get_current_pid_tgid(); + struct piddata *piddatap; + struct event event = {}; + u32 tgid = id >> 32; + u32 pid = id; + s64 delta_ns; + + if (targ_tgid && targ_tgid != tgid) + return 0; + if (targ_pid && targ_pid != pid) + return 0; + + /* fetch timestamp and calculate delta */ + piddatap = bpf_map_lookup_elem(&start, &pid); + if (!piddatap) + return 0; /* missed entry */ + + delta_ns = bpf_ktime_get_ns() - piddatap->ts; + if (delta_ns < 0) + goto cleanup; + + event.pid = pid; + event.nr_reclaimed = nr_reclaimed; + event.delta_ns = delta_ns; + event.nr_free_pages = piddatap->nr_free_pages; + bpf_get_current_comm(&event.task, TASK_COMM_LEN); + + /* output */ + bpf_perf_event_output(ctx, &events, BPF_F_CURRENT_CPU, + &event, sizeof(event)); + +cleanup: + bpf_map_delete_elem(&start, &pid); + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/drsnoop.c b/libbpf-tools/drsnoop.c new file mode 100644 index 000000000..68903a7f2 --- /dev/null +++ b/libbpf-tools/drsnoop.c @@ -0,0 +1,234 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on drsnoop(8) from BCC by Wenbo Zhang. +// 28-Feb-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include +#include "drsnoop.h" +#include "drsnoop.skel.h" +#include "trace_helpers.h" + +#define PERF_BUFFER_PAGES 16 +#define PERF_POLL_TIMEOUT_MS 100 + +static struct env { + pid_t pid; + pid_t tid; + time_t duration; + bool extended; + bool verbose; +} env = { }; + +const char *argp_program_version = "drsnoop 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Trace direct reclaim latency.\n" +"\n" +"USAGE: drsnoop [--help] [-p PID] [-t TID] [-d DURATION] [-e]\n" +"\n" +"EXAMPLES:\n" +" drsnoop # trace all direct reclaim events\n" +" drsnoop -p 123 # trace pid 123\n" +" drsnoop -t 123 # trace tid 123 (use for threads only)\n" +" drsnoop -d 10 # trace for 10 seconds only\n" +" drsnoop -e # trace all direct reclaim events with extended faileds\n"; + +static const struct argp_option opts[] = { + { "duration", 'd', "DURATION", 0, "Total duration of trace in seconds" }, + { "extended", 'e', NULL, 0, "Extended fields output" }, + { "pid", 'p', "PID", 0, "Process PID to trace" }, + { "tid", 't', "TID", 0, "Thread TID to trace" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static int page_size; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + time_t duration; + int pid; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'd': + errno = 0; + duration = strtol(arg, NULL, 10); + if (errno || duration <= 0) { + fprintf(stderr, "invalid DURATION: %s\n", arg); + argp_usage(state); + } + env.duration = duration; + break; + case 'e': + env.extended = true; + break; + case 'p': + errno = 0; + pid = strtol(arg, NULL, 10); + if (errno || pid <= 0) { + fprintf(stderr, "invalid PID: %s\n", arg); + argp_usage(state); + } + env.pid = pid; + break; + case 't': + errno = 0; + pid = strtol(arg, NULL, 10); + if (errno || pid <= 0) { + fprintf(stderr, "invalid TID: %s\n", arg); + argp_usage(state); + } + env.tid = pid; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +void handle_event(void *ctx, int cpu, void *data, __u32 data_sz) +{ + const struct event *e = data; + struct tm *tm; + char ts[32]; + time_t t; + + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + printf("%-8s %-16s %-6d %8.3f %5lld", + ts, e->task, e->pid, e->delta_ns / 1000000.0, + e->nr_reclaimed); + if (env.extended) + printf(" %8llu", e->nr_free_pages * page_size / 1024); + printf("\n"); +} + +void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt) +{ + fprintf(stderr, "lost %llu events on CPU #%d\n", lost_cnt, cpu); +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct perf_buffer_opts pb_opts; + struct perf_buffer *pb = NULL; + struct ksyms *ksyms = NULL; + const struct ksym *ksym; + struct drsnoop_bpf *obj; + __u64 time_end = 0; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = drsnoop_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF object\n"); + return 1; + } + + /* initialize global data (filtering options) */ + obj->rodata->targ_tgid = env.pid; + obj->rodata->targ_pid = env.tid; + if (env.extended) { + ksyms = ksyms__load(); + if (!ksyms) { + fprintf(stderr, "failed to load kallsyms\n"); + goto cleanup; + } + ksym = ksyms__get_symbol(ksyms, "vm_zone_stat"); + if (!ksym) { + fprintf(stderr, "failed to get vm_zone_stat's addr\n"); + goto cleanup; + } + obj->rodata->vm_zone_stat_kaddr = ksym->addr; + page_size = sysconf(_SC_PAGESIZE); + } + + err = drsnoop_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + err = drsnoop_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs\n"); + goto cleanup; + } + + printf("Tracing direct reclaim events"); + if (env.duration) + printf(" for %ld secs.\n", env.duration); + else + printf("... Hit Ctrl-C to end.\n"); + printf("%-8s %-16s %-6s %8s %5s", + "TIME", "COMM", "TID", "LAT(ms)", "PAGES"); + if (env.extended) + printf(" %8s", "FREE(KB)"); + printf("\n"); + + pb_opts.sample_cb = handle_event; + pb_opts.lost_cb = handle_lost_events; + pb = perf_buffer__new(bpf_map__fd(obj->maps.events), PERF_BUFFER_PAGES, + &pb_opts); + err = libbpf_get_error(pb); + if (err) { + pb = NULL; + fprintf(stderr, "failed to open perf buffer: %d\n", err); + goto cleanup; + } + + /* setup duration */ + if (env.duration) + time_end = get_ktime_ns() + env.duration * NSEC_PER_SEC; + + /* main: poll */ + while (1) { + if ((err = perf_buffer__poll(pb, PERF_POLL_TIMEOUT_MS)) < 0) + break; + if (env.duration && get_ktime_ns() > time_end) + goto cleanup; + } + printf("error polling perf buffer: %d\n", err); + +cleanup: + perf_buffer__free(pb); + drsnoop_bpf__destroy(obj); + ksyms__free(ksyms); + + return err != 0; +} diff --git a/libbpf-tools/drsnoop.h b/libbpf-tools/drsnoop.h new file mode 100644 index 000000000..28826d262 --- /dev/null +++ b/libbpf-tools/drsnoop.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __DRSNOOP_H +#define __DRSNOOP_H + +#define TASK_COMM_LEN 16 + +struct event { + char task[TASK_COMM_LEN]; + __u64 delta_ns; + __u64 nr_reclaimed; + __u64 nr_free_pages; + pid_t pid; +}; + +#endif /* __DRSNOOP_H */ diff --git a/libbpf-tools/drsnoop_example.txt b/libbpf-tools/drsnoop_example.txt new file mode 100644 index 000000000..44c014cb4 --- /dev/null +++ b/libbpf-tools/drsnoop_example.txt @@ -0,0 +1,71 @@ +Demonstrations of drsnoop, the Linux BPF CO-RE version. + + +drsnoop traces the direct reclaim system-wide, and prints various details. +Example output: + +# drsnoop + +Tracing direct reclaim events... Hit Ctrl-C to end. +TIME COMM TID LAT(ms) PAGES +14:56:43 in:imklog 268 106.637 39 +14:56:43 systemd-udevd 232 110.708 53 +14:56:43 systemd-journal 19531 106.083 62 +^C + +While tracing, the processes alloc pages due to insufficient memory available +in the system, direct reclaim events happened, which will increase the waiting +delay of the processes. + +drsnoop can be useful for discovering when allocstall(/proc/vmstat) continues +to increase, whether it is caused by some critical processes or not. + +The -p option can be used to filter on a PID, which is filtered in-kernel. + +# drsnoop -p 17491 + +Tracing direct reclaim events... Hit Ctrl-C to end. +TIME COMM TID LAT(ms) PAGES +14:59:56 summond 17491 0.24 50 +14:59:56 summond 17491 0.26 38 +14:59:56 summond 17491 0.36 72 +^C + +This shows the summond process allocs pages, and direct reclaim events happening, +and the delays are not affected much. + +A maximum tracing duration can be set with the -d option. For example, to trace +for 2 seconds: + +# drsnoop -d 2 + +Tracing direct reclaim events for 2 secs. +TIME COMM TID LAT(ms) PAGES +15:02:16 head 21715 0.15 195 + +USAGE message: + +# drsnoop --help + +Usage: drsnoop [OPTION...] +Trace direct reclaim latency. + +USAGE: drsnoop [--help] [-p PID] [-t TID] [-d DURATION] [-e] + +EXAMPLES: + drsnoop # trace all direct reclaim events + drsnoop -p 123 # trace pid 123 + drsnoop -t 123 # trace tid 123 (use for threads only) + drsnoop -d 10 # trace for 10 seconds only + drsnoop -e # trace all direct reclaim events with extended faileds + + -d, --duration=DURATION Total duration of trace in seconds + -e, --extended Extended fields output + -p, --pid=PID Process PID to trace + -t, --tid=TID Thread TID to trace + -v, --verbose Verbose debug output + -?, --help Give this help list + --usage Give a short usage message + -V, --version Print program version + +Report bugs to . diff --git a/libbpf-tools/errno_helpers.c b/libbpf-tools/errno_helpers.c new file mode 100644 index 000000000..786d2e98f --- /dev/null +++ b/libbpf-tools/errno_helpers.c @@ -0,0 +1,232 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Anton Protopopov +#include +#include +#include +#include +#include + +#define warn(...) fprintf(stderr, __VA_ARGS__) + +#ifdef __x86_64__ +static int errno_by_name_x86_64(const char *errno_name) +{ + +#define strcase(X, N) if (!strcmp(errno_name, (X))) return N + + strcase("EPERM", 1); + strcase("ENOENT", 2); + strcase("ESRCH", 3); + strcase("EINTR", 4); + strcase("EIO", 5); + strcase("ENXIO", 6); + strcase("E2BIG", 7); + strcase("ENOEXEC", 8); + strcase("EBADF", 9); + strcase("ECHILD", 10); + strcase("EAGAIN", 11); + strcase("EWOULDBLOCK", 11); + strcase("ENOMEM", 12); + strcase("EACCES", 13); + strcase("EFAULT", 14); + strcase("ENOTBLK", 15); + strcase("EBUSY", 16); + strcase("EEXIST", 17); + strcase("EXDEV", 18); + strcase("ENODEV", 19); + strcase("ENOTDIR", 20); + strcase("EISDIR", 21); + strcase("EINVAL", 22); + strcase("ENFILE", 23); + strcase("EMFILE", 24); + strcase("ENOTTY", 25); + strcase("ETXTBSY", 26); + strcase("EFBIG", 27); + strcase("ENOSPC", 28); + strcase("ESPIPE", 29); + strcase("EROFS", 30); + strcase("EMLINK", 31); + strcase("EPIPE", 32); + strcase("EDOM", 33); + strcase("ERANGE", 34); + strcase("EDEADLK", 35); + strcase("EDEADLOCK", 35); + strcase("ENAMETOOLONG", 36); + strcase("ENOLCK", 37); + strcase("ENOSYS", 38); + strcase("ENOTEMPTY", 39); + strcase("ELOOP", 40); + strcase("ENOMSG", 42); + strcase("EIDRM", 43); + strcase("ECHRNG", 44); + strcase("EL2NSYNC", 45); + strcase("EL3HLT", 46); + strcase("EL3RST", 47); + strcase("ELNRNG", 48); + strcase("EUNATCH", 49); + strcase("ENOCSI", 50); + strcase("EL2HLT", 51); + strcase("EBADE", 52); + strcase("EBADR", 53); + strcase("EXFULL", 54); + strcase("ENOANO", 55); + strcase("EBADRQC", 56); + strcase("EBADSLT", 57); + strcase("EBFONT", 59); + strcase("ENOSTR", 60); + strcase("ENODATA", 61); + strcase("ETIME", 62); + strcase("ENOSR", 63); + strcase("ENONET", 64); + strcase("ENOPKG", 65); + strcase("EREMOTE", 66); + strcase("ENOLINK", 67); + strcase("EADV", 68); + strcase("ESRMNT", 69); + strcase("ECOMM", 70); + strcase("EPROTO", 71); + strcase("EMULTIHOP", 72); + strcase("EDOTDOT", 73); + strcase("EBADMSG", 74); + strcase("EOVERFLOW", 75); + strcase("ENOTUNIQ", 76); + strcase("EBADFD", 77); + strcase("EREMCHG", 78); + strcase("ELIBACC", 79); + strcase("ELIBBAD", 80); + strcase("ELIBSCN", 81); + strcase("ELIBMAX", 82); + strcase("ELIBEXEC", 83); + strcase("EILSEQ", 84); + strcase("ERESTART", 85); + strcase("ESTRPIPE", 86); + strcase("EUSERS", 87); + strcase("ENOTSOCK", 88); + strcase("EDESTADDRREQ", 89); + strcase("EMSGSIZE", 90); + strcase("EPROTOTYPE", 91); + strcase("ENOPROTOOPT", 92); + strcase("EPROTONOSUPPORT", 93); + strcase("ESOCKTNOSUPPORT", 94); + strcase("ENOTSUP", 95); + strcase("EOPNOTSUPP", 95); + strcase("EPFNOSUPPORT", 96); + strcase("EAFNOSUPPORT", 97); + strcase("EADDRINUSE", 98); + strcase("EADDRNOTAVAIL", 99); + strcase("ENETDOWN", 100); + strcase("ENETUNREACH", 101); + strcase("ENETRESET", 102); + strcase("ECONNABORTED", 103); + strcase("ECONNRESET", 104); + strcase("ENOBUFS", 105); + strcase("EISCONN", 106); + strcase("ENOTCONN", 107); + strcase("ESHUTDOWN", 108); + strcase("ETOOMANYREFS", 109); + strcase("ETIMEDOUT", 110); + strcase("ECONNREFUSED", 111); + strcase("EHOSTDOWN", 112); + strcase("EHOSTUNREACH", 113); + strcase("EALREADY", 114); + strcase("EINPROGRESS", 115); + strcase("ESTALE", 116); + strcase("EUCLEAN", 117); + strcase("ENOTNAM", 118); + strcase("ENAVAIL", 119); + strcase("EISNAM", 120); + strcase("EREMOTEIO", 121); + strcase("EDQUOT", 122); + strcase("ENOMEDIUM", 123); + strcase("EMEDIUMTYPE", 124); + strcase("ECANCELED", 125); + strcase("ENOKEY", 126); + strcase("EKEYEXPIRED", 127); + strcase("EKEYREVOKED", 128); + strcase("EKEYREJECTED", 129); + strcase("EOWNERDEAD", 130); + strcase("ENOTRECOVERABLE", 131); + strcase("ERFKILL", 132); + strcase("EHWPOISON", 133); + +#undef strcase + + return -1; + +} +#endif + +/* Try to find the errno number using the errno(1) program */ +static int errno_by_name_dynamic(const char *errno_name) +{ + int len = strlen(errno_name); + int err, number = -1; + char buf[128]; + char cmd[64]; + char *end; + long val; + FILE *f; + + /* sanity check to not call popen with random input */ + for (int i = 0; i < len; i++) { + if (errno_name[i] < 'A' || errno_name[i] > 'Z') { + warn("errno_name contains invalid char 0x%02x: %s\n", + errno_name[i], errno_name); + return -1; + } + } + + snprintf(cmd, sizeof(cmd), "errno %s", errno_name); + f = popen(cmd, "r"); + if (!f) { + warn("popen: %s: %s\n", cmd, strerror(errno)); + return -1; + } + + if (!fgets(buf, sizeof(buf), f)) { + goto close; + } else if (ferror(f)) { + warn("fgets: %s\n", strerror(errno)); + goto close; + } + + // expecting " " + if (strncmp(errno_name, buf, len) || strlen(buf) < len+2) { + warn("expected '%s': %s\n", errno_name, buf); + goto close; + } + errno = 0; + val = strtol(buf+len+2, &end, 10); + if (errno || end == (buf+len+2) || number < 0 || number > INT_MAX) { + warn("can't parse the second column, expected int: %s\n", buf); + goto close; + } + number = val; + +close: + err = pclose(f); + if (err < 0) + warn("pclose: %s\n", strerror(errno)); +#ifndef __x86_64__ + /* Ignore the error for x86_64 where we have a table compiled in */ + else if (err && WEXITSTATUS(err) == 127) { + warn("errno(1) required for errno name/number mapping\n"); + } else if (err) { + warn("errno(1) exit status (see wait(2)): 0x%x\n", err); + } +#endif + return number; +} + +int errno_by_name(const char *errno_name) +{ +#ifdef __x86_64__ + int err; + + err = errno_by_name_x86_64(errno_name); + if (err >= 0) + return err; +#endif + + return errno_by_name_dynamic(errno_name); +} diff --git a/libbpf-tools/errno_helpers.h b/libbpf-tools/errno_helpers.h new file mode 100644 index 000000000..4c154fb6a --- /dev/null +++ b/libbpf-tools/errno_helpers.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __ERRNO_HELPERS_H +#define __ERRNO_HELPERS_H + +int errno_by_name(const char *errno_name); + +#endif /* __ERRNO_HELPERS_H */ diff --git a/libbpf-tools/execsnoop.bpf.c b/libbpf-tools/execsnoop.bpf.c new file mode 100644 index 000000000..e6bc7c06a --- /dev/null +++ b/libbpf-tools/execsnoop.bpf.c @@ -0,0 +1,129 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +#include "vmlinux.h" +#include +#include +#include "execsnoop.h" + +const volatile bool ignore_failed = true; +const volatile uid_t targ_uid = INVALID_UID; +const volatile int max_args = DEFAULT_MAXARGS; + +static const struct event empty_event = {}; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 10240); + __type(key, pid_t); + __type(value, struct event); +} execs SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); + __uint(key_size, sizeof(u32)); + __uint(value_size, sizeof(u32)); +} events SEC(".maps"); + +static __always_inline bool valid_uid(uid_t uid) { + return uid != INVALID_UID; +} + +SEC("tracepoint/syscalls/sys_enter_execve") +int tracepoint__syscalls__sys_enter_execve(struct trace_event_raw_sys_enter* ctx) +{ + u64 id; + pid_t pid, tgid; + unsigned int ret; + struct event *event; + struct task_struct *task; + const char **args = (const char **)(ctx->args[1]); + const char *argp; + uid_t uid = (u32)bpf_get_current_uid_gid(); + + if (valid_uid(targ_uid) && targ_uid != uid) + return 0; + + id = bpf_get_current_pid_tgid(); + pid = (pid_t)id; + tgid = id >> 32; + if (bpf_map_update_elem(&execs, &pid, &empty_event, BPF_NOEXIST)) + return 0; + + event = bpf_map_lookup_elem(&execs, &pid); + if (!event) + return 0; + + event->pid = pid; + event->tgid = tgid; + event->uid = uid; + task = (struct task_struct*)bpf_get_current_task(); + event->ppid = (pid_t)BPF_CORE_READ(task, real_parent, tgid); + event->args_count = 0; + event->args_size = 0; + + ret = bpf_probe_read_str(event->args, ARGSIZE, (const char*)ctx->args[0]); + if (ret <= ARGSIZE) { + event->args_size += ret; + } else { + /* write an empty string */ + event->args[0] = '\0'; + event->args_size++; + } + + event->args_count++; + #pragma unroll + for (int i = 1; i < TOTAL_MAX_ARGS && i < max_args; i++) { + bpf_probe_read(&argp, sizeof(argp), &args[i]); + if (!argp) + return 0; + + if (event->args_size > LAST_ARG) + return 0; + + ret = bpf_probe_read_str(&event->args[event->args_size], ARGSIZE, argp); + if (ret > ARGSIZE) + return 0; + + event->args_count++; + event->args_size += ret; + } + /* try to read one more argument to check if there is one */ + bpf_probe_read(&argp, sizeof(argp), &args[max_args]); + if (!argp) + return 0; + + /* pointer to max_args+1 isn't null, asume we have more arguments */ + event->args_count++; + return 0; +} + +SEC("tracepoint/syscalls/sys_exit_execve") +int tracepoint__syscalls__sys_exit_execve(struct trace_event_raw_sys_exit* ctx) +{ + u64 id; + pid_t pid; + int ret; + struct event *event; + u32 uid = (u32)bpf_get_current_uid_gid(); + + if (valid_uid(targ_uid) && targ_uid != uid) + return 0; + id = bpf_get_current_pid_tgid(); + pid = (pid_t)id; + event = bpf_map_lookup_elem(&execs, &pid); + if (!event) + return 0; + ret = ctx->ret; + if (ignore_failed && ret < 0) + goto cleanup; + + event->retval = ret; + bpf_get_current_comm(&event->comm, sizeof(event->comm)); + size_t len = EVENT_SIZE(event); + if (len <= sizeof(*event)) + bpf_perf_event_output(ctx, &events, BPF_F_CURRENT_CPU, event, len); +cleanup: + bpf_map_delete_elem(&execs, &pid); + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/execsnoop.c b/libbpf-tools/execsnoop.c new file mode 100644 index 000000000..417e41040 --- /dev/null +++ b/libbpf-tools/execsnoop.c @@ -0,0 +1,329 @@ +// Based on execsnoop(8) from BCC by Brendan Gregg and others. +// +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "execsnoop.h" +#include "execsnoop.skel.h" +#include "trace_helpers.h" + +#define PERF_BUFFER_PAGES 64 +#define NSEC_PRECISION (NSEC_PER_SEC / 1000) +#define MAX_ARGS_KEY 259 + +static struct env { + bool time; + bool timestamp; + bool fails; + uid_t uid; + bool quote; + const char *name; + const char *line; + bool print_uid; + bool verbose; + int max_args; +} env = { + .max_args = DEFAULT_MAXARGS, + .uid = INVALID_UID +}; + +static struct timespec start_time; + +const char *argp_program_version = "execsnoop 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Trace open family syscalls\n" +"\n" +"USAGE: execsnoop [-h] [-T] [-t] [-x] [-u UID] [-q] [-n NAME] [-l LINE] [-U]\n" +" [--max-args MAX_ARGS]\n" +"\n" +"EXAMPLES:\n" +" ./execsnoop # trace all exec() syscalls\n" +" ./execsnoop -x # include failed exec()s\n" +" ./execsnoop -T # include time (HH:MM:SS)\n" +" ./execsnoop -U # include UID\n" +" ./execsnoop -u 1000 # only trace UID 1000\n" +" ./execsnoop -t # include timestamps\n" +" ./execsnoop -q # add \"quotemarks\" around arguments\n" +" ./execsnoop -n main # only print command lines containing \"main\"\n" +" ./execsnoop -l tpkg # only print command where arguments contains \"tpkg\""; + +static const struct argp_option opts[] = { + { "time", 'T', NULL, 0, "include time column on output (HH:MM:SS)"}, + { "timestamp", 't', NULL, 0, "include timestamp on output"}, + { "fails", 'x', NULL, 0, "include failed exec()s"}, + { "uid", 'u', "UID", 0, "trace this UID only"}, + { "quote", 'q', NULL, 0, "Add quotemarks (\") around arguments"}, + { "name", 'n', "NAME", 0, "only print commands matching this name, any arg"}, + { "line", 'l', "LINE", 0, "only print commands where arg contains this line"}, + { "print-uid", 'U', NULL, 0, "print UID column"}, + { "max-args", MAX_ARGS_KEY, "MAX_ARGS", 0, + "maximum number of arguments parsed and displayed, defaults to 20"}, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + long int uid, max_args; + + switch (key) { + case 'h': + argp_usage(state); + break; + case 'T': + env.time = true; + break; + case 't': + env.timestamp = true; + break; + case 'x': + env.fails = true; + break; + case 'u': + errno = 0; + uid = strtol(arg, NULL, 10); + if (errno || uid < 0 || uid >= INVALID_UID) { + fprintf(stderr, "Invalid UID %s\n", arg); + argp_usage(state); + } + env.uid = uid; + break; + case 'q': + env.quote = true; + break; + case 'n': + env.name = arg; + break; + case 'l': + env.line = arg; + break; + case 'U': + env.print_uid = true; + break; + case 'v': + env.verbose = true; + break; + case MAX_ARGS_KEY: + errno = 0; + max_args = strtol(arg, NULL, 10); + if (errno || max_args < 1 || max_args > TOTAL_MAX_ARGS) { + fprintf(stderr, "Invalid MAX_ARGS %s, should be in [1, %d] range\n", + arg, TOTAL_MAX_ARGS); + + argp_usage(state); + } + env.max_args = max_args; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void time_since_start() +{ + long nsec, sec; + static struct timespec cur_time; + double time_diff; + + clock_gettime(CLOCK_MONOTONIC, &cur_time); + nsec = cur_time.tv_nsec - start_time.tv_nsec; + sec = cur_time.tv_sec - start_time.tv_sec; + if (nsec < 0) { + nsec += NSEC_PER_SEC; + sec--; + } + time_diff = sec + (double)nsec / NSEC_PER_SEC; + printf("%-8.3f", time_diff); +} + +static void inline quoted_symbol(char c) { + switch(c) { + case '"': + putchar('\\'); + putchar('"'); + break; + case '\t': + putchar('\\'); + putchar('t'); + break; + case '\n': + putchar('\\'); + putchar('n'); + break; + default: + putchar(c); + break; + } +} + +static void print_args(const struct event *e, bool quote) +{ + int args_counter = 0; + + if (env.quote) + putchar('"'); + + for (int i = 0; i < e->args_size && args_counter < e->args_count; i++) { + char c = e->args[i]; + if (env.quote) { + if (c == '\0') { + args_counter++; + putchar('"'); + putchar(' '); + if (args_counter < e->args_count) { + putchar('"'); + } + } else { + quoted_symbol(c); + } + } else { + if (c == '\0') { + args_counter++; + putchar(' '); + } else { + putchar(c); + } + } + } + if (e->args_count == env.max_args + 1) { + fputs(" ...", stdout); + } +} + +void handle_event(void *ctx, int cpu, void *data, __u32 data_sz) +{ + const struct event *e = data; + time_t t; + struct tm *tm; + char ts[32]; + + /* TODO: use pcre lib */ + if (env.name && strstr(e->comm, env.name) == NULL) + return; + + /* TODO: use pcre lib */ + if (env.line && strstr(e->comm, env.line) == NULL) + return; + + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + + if (env.time) { + printf("%-8s ", ts); + } + if (env.timestamp) { + time_since_start(); + } + + if (env.print_uid) + printf("%-6d", e->uid); + + printf("%-16s %-6d %-6d %3d ", e->comm, e->pid, e->ppid, e->retval); + print_args(e, env.quote); + putchar('\n'); +} + +void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt) +{ + fprintf(stderr, "Lost %llu events on CPU #%d!\n", lost_cnt, cpu); +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct perf_buffer_opts pb_opts; + struct perf_buffer *pb = NULL; + struct execsnoop_bpf *obj; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = execsnoop_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF object\n"); + return 1; + } + + /* initialize global data (filtering options) */ + obj->rodata->ignore_failed = !env.fails; + obj->rodata->targ_uid = env.uid; + obj->rodata->max_args = env.max_args; + + err = execsnoop_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + clock_gettime(CLOCK_MONOTONIC, &start_time); + err = execsnoop_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs\n"); + goto cleanup; + } + /* print headers */ + if (env.time) { + printf("%-9s", "TIME"); + } + if (env.timestamp) { + printf("%-8s ", "TIME(s)"); + } + if (env.print_uid) { + printf("%-6s ", "UID"); + } + + printf("%-16s %-6s %-6s %3s %s\n", "PCOMM", "PID", "PPID", "RET", "ARGS"); + + /* setup event callbacks */ + pb_opts.sample_cb = handle_event; + pb_opts.lost_cb = handle_lost_events; + pb = perf_buffer__new(bpf_map__fd(obj->maps.events), PERF_BUFFER_PAGES, &pb_opts); + err = libbpf_get_error(pb); + if (err) { + pb = NULL; + fprintf(stderr, "failed to open perf buffer: %d\n", err); + goto cleanup; + } + + /* main: poll */ + while ((err = perf_buffer__poll(pb, 100)) >= 0) + ; + printf("Error polling perf buffer: %d\n", err); + +cleanup: + perf_buffer__free(pb); + execsnoop_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/execsnoop.h b/libbpf-tools/execsnoop.h new file mode 100644 index 000000000..b0b50dedd --- /dev/null +++ b/libbpf-tools/execsnoop.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __EXECSNOOP_H +#define __EXECSNOOP_H + +#define ARGSIZE 128 +#define TASK_COMM_LEN 16 +#define TOTAL_MAX_ARGS 60 +#define DEFAULT_MAXARGS 20 +#define FULL_MAX_ARGS_ARR (TOTAL_MAX_ARGS * ARGSIZE) +#define INVALID_UID ((uid_t)-1) +#define BASE_EVENT_SIZE (size_t)(&((struct event*)0)->args) +#define EVENT_SIZE(e) (BASE_EVENT_SIZE + e->args_size) +#define LAST_ARG (FULL_MAX_ARGS_ARR - ARGSIZE) + +struct event { + char comm[TASK_COMM_LEN]; + pid_t pid; + pid_t tgid; + pid_t ppid; + uid_t uid; + int retval; + int args_count; + unsigned int args_size; + char args[FULL_MAX_ARGS_ARR]; +}; + +#endif /* __EXECSNOOP_H */ diff --git a/libbpf-tools/filelife.bpf.c b/libbpf-tools/filelife.bpf.c new file mode 100644 index 000000000..b066565ff --- /dev/null +++ b/libbpf-tools/filelife.bpf.c @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include +#include "filelife.h" + +const volatile pid_t targ_tgid = 0; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 8192); + __type(key, struct dentry *); + __type(value, u64); +} start SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); + __uint(key_size, sizeof(u32)); + __uint(value_size, sizeof(u32)); +} events SEC(".maps"); + +static __always_inline int +probe_create(struct inode *dir, struct dentry *dentry) +{ + u64 id = bpf_get_current_pid_tgid(); + u32 tgid = id >> 32; + u64 ts; + + if (targ_tgid && targ_tgid != tgid) + return 0; + + ts = bpf_ktime_get_ns(); + bpf_map_update_elem(&start, &dentry, &ts, 0); + return 0; +} + +SEC("kprobe/vfs_create") +int BPF_KPROBE(vfs_create, struct inode *dir, struct dentry *dentry) +{ + return probe_create(dir, dentry); +} + +SEC("kprobe/security_inode_create") +int BPF_KPROBE(security_inode_create, struct inode *dir, + struct dentry *dentry) +{ + return probe_create(dir, dentry); +} + +SEC("kprobe/vfs_unlink") +int BPF_KPROBE(vfs_unlink, struct inode *dir, struct dentry *dentry) +{ + u64 id = bpf_get_current_pid_tgid(); + struct event event = {}; + const u8 *qs_name_ptr; + u32 tgid = id >> 32; + u64 *tsp, delta_ns; + u32 qs_len; + + tsp = bpf_map_lookup_elem(&start, &dentry); + if (!tsp) + return 0; // missed entry + + delta_ns = bpf_ktime_get_ns() - *tsp; + bpf_map_delete_elem(&start, &dentry); + + qs_name_ptr = BPF_CORE_READ(dentry, d_name.name); + qs_len = BPF_CORE_READ(dentry, d_name.len); + bpf_probe_read_kernel_str(&event.file, sizeof(event.file), qs_name_ptr); + bpf_get_current_comm(&event.task, sizeof(event.task)); + event.delta_ns = delta_ns; + event.tgid = tgid; + + /* output */ + bpf_perf_event_output(ctx, &events, BPF_F_CURRENT_CPU, + &event, sizeof(event)); + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/filelife.c b/libbpf-tools/filelife.c new file mode 100644 index 000000000..22028412a --- /dev/null +++ b/libbpf-tools/filelife.c @@ -0,0 +1,162 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on filelife(8) from BCC by Brendan Gregg & Allan McAleavy. +// 20-Mar-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include +#include "filelife.h" +#include "filelife.skel.h" +#include "trace_helpers.h" + +#define PERF_BUFFER_PAGES 16 +#define PERF_POLL_TIMEOUT_MS 100 + +static struct env { + pid_t pid; + bool verbose; +} env = { }; + +const char *argp_program_version = "filelife 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Trace the lifespan of short-lived files.\n" +"\n" +"USAGE: filelife [--help] [-p PID]\n" +"\n" +"EXAMPLES:\n" +" filelife # trace all events\n" +" filelife -p 123 # trace pid 123\n"; + +static const struct argp_option opts[] = { + { "pid", 'p', "PID", 0, "Process PID to trace" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + int pid; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'p': + errno = 0; + pid = strtol(arg, NULL, 10); + if (errno || pid <= 0) { + fprintf(stderr, "invalid PID: %s\n", arg); + argp_usage(state); + } + env.pid = pid; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +void handle_event(void *ctx, int cpu, void *data, __u32 data_sz) +{ + const struct event *e = data; + struct tm *tm; + char ts[32]; + time_t t; + + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + printf("%-8s %-6d %-16s %-7.2f %s\n", + ts, e->tgid, e->task, (double)e->delta_ns / 1000000000, + e->file); +} + +void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt) +{ + fprintf(stderr, "lost %llu events on CPU #%d\n", lost_cnt, cpu); +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct perf_buffer_opts pb_opts; + struct perf_buffer *pb = NULL; + struct filelife_bpf *obj; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = filelife_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF object\n"); + return 1; + } + + /* initialize global data (filtering options) */ + obj->rodata->targ_tgid = env.pid; + + err = filelife_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + err = filelife_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs\n"); + goto cleanup; + } + + printf("Tracing the lifespan of short-lived files ... Hit Ctrl-C to end.\n"); + printf("%-8s %-6s %-16s %-7s %s\n", "TIME", "PID", "COMM", "AGE(s)", "FILE"); + + pb_opts.sample_cb = handle_event; + pb_opts.lost_cb = handle_lost_events; + pb = perf_buffer__new(bpf_map__fd(obj->maps.events), PERF_BUFFER_PAGES, + &pb_opts); + err = libbpf_get_error(pb); + if (err) { + pb = NULL; + fprintf(stderr, "failed to open perf buffer: %d\n", err); + goto cleanup; + } + + while ((err = perf_buffer__poll(pb, PERF_POLL_TIMEOUT_MS)) >= 0) + ; + fprintf(stderr, "error polling perf buffer: %d\n", err); + +cleanup: + perf_buffer__free(pb); + filelife_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/filelife.h b/libbpf-tools/filelife.h new file mode 100644 index 000000000..d1040cc54 --- /dev/null +++ b/libbpf-tools/filelife.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __FILELIFE_H +#define __FILELIFE_H + +#define DNAME_INLINE_LEN 32 +#define TASK_COMM_LEN 16 + +struct event { + char file[DNAME_INLINE_LEN]; + char task[TASK_COMM_LEN]; + __u64 delta_ns; + pid_t tgid; +}; + +#endif /* __FILELIFE_H */ diff --git a/libbpf-tools/hardirqs.bpf.c b/libbpf-tools/hardirqs.bpf.c new file mode 100644 index 000000000..ce3f97d33 --- /dev/null +++ b/libbpf-tools/hardirqs.bpf.c @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include "hardirqs.h" +#include "bits.bpf.h" +#include "maps.bpf.h" + +#define MAX_ENTRIES 256 + +const volatile bool targ_dist = false; +const volatile bool targ_ns = false; + +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __uint(max_entries, 1); + __type(key, u32); + __type(value, u64); +} start SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct irq_key); + __type(value, struct info); +} infos SEC(".maps"); + +static struct info zero; + +SEC("tracepoint/irq/irq_handler_entry") +int handle__irq_handler(struct trace_event_raw_irq_handler_entry *ctx) +{ + struct irq_key key = {}; + struct info *info; + + bpf_probe_read_kernel_str(&key.name, sizeof(key.name), ctx->__data); + info = bpf_map_lookup_or_try_init(&infos, &key, &zero); + if (!info) + return 0; + info->count += 1; + return 0; +} + +SEC("tp_btf/irq_handler_entry") +int BPF_PROG(irq_handler_entry) +{ + u64 ts = bpf_ktime_get_ns(); + u32 key = 0; + + bpf_map_update_elem(&start, &key, &ts, 0); + return 0; +} + +SEC("tp_btf/irq_handler_exit") +int BPF_PROG(irq_handler_exit_exit, int irq, struct irqaction *action) +{ + struct irq_key ikey = {}; + struct info *info; + u32 key = 0; + s64 delta; + u64 *tsp; + + tsp = bpf_map_lookup_elem(&start, &key); + if (!tsp || !*tsp) + return 0; + + delta = bpf_ktime_get_ns() - *tsp; + if (delta < 0) + return 0; + if (!targ_ns) + delta /= 1000U; + + bpf_probe_read_kernel_str(&ikey.name, sizeof(ikey.name), action->name); + info = bpf_map_lookup_or_try_init(&infos, &ikey, &zero); + if (!info) + return 0; + + if (!targ_dist) { + info->count += delta; + } else { + u64 slot; + + slot = log2(delta); + if (slot >= MAX_SLOTS) + slot = MAX_SLOTS - 1; + info->slots[slot]++; + } + + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/hardirqs.c b/libbpf-tools/hardirqs.c new file mode 100644 index 000000000..8366e2088 --- /dev/null +++ b/libbpf-tools/hardirqs.c @@ -0,0 +1,269 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on hardirq(8) from BCC by Brendan Gregg. +// 31-Aug-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "hardirqs.h" +#include "hardirqs.skel.h" +#include "trace_helpers.h" + +struct env { + bool count; + bool distributed; + bool nanoseconds; + time_t interval; + int times; + bool timestamp; + bool verbose; +} env = { + .interval = 99999999, + .times = 99999999, +}; + +static volatile bool exiting; + +const char *argp_program_version = "hardirqs 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Summarize hard irq event time as histograms.\n" +"\n" +"USAGE: hardirqs [--help] [-T] [-N] [-d] [interval] [count]\n" +"\n" +"EXAMPLES:\n" +" hardirqs # sum hard irq event time\n" +" hardirqs -d # show hard irq event time as histograms\n" +" hardirqs 1 10 # print 1 second summaries, 10 times\n" +" hardirqs -NT 1 # 1s summaries, nanoseconds, and timestamps\n"; + +static const struct argp_option opts[] = { + { "count", 'C', NULL, 0, "Show event counts instead of timing" }, + { "distributed", 'd', NULL, 0, "Show distributions as histograms" }, + { "timestamp", 'T', NULL, 0, "Include timestamp on output" }, + { "nanoseconds", 'N', NULL, 0, "Output in nanoseconds" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'd': + env.distributed = true; + break; + case 'C': + env.count = true; + break; + case 'N': + env.nanoseconds = true; + break; + case 'T': + env.timestamp = true; + break; + case ARGP_KEY_ARG: + errno = 0; + if (pos_args == 0) { + env.interval = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid internal\n"); + argp_usage(state); + } + } else if (pos_args == 1) { + env.times = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid times\n"); + argp_usage(state); + } + } else { + fprintf(stderr, + "unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + pos_args++; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void sig_handler(int sig) +{ + exiting = true; +} + +static int print_map(struct bpf_map *map) +{ + struct irq_key lookup_key = {}, next_key; + struct info info; + int fd, err; + + if (env.count) { + printf("%-26s %11s\n", "HARDIRQ", "TOTAL_count"); + } else if (!env.distributed) { + const char *units = env.nanoseconds ? "nsecs" : "usecs"; + + printf("%-26s %6s%5s\n", "HARDIRQ", "TOTAL_", units); + } + + fd = bpf_map__fd(map); + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_lookup_elem(fd, &next_key, &info); + if (err < 0) { + fprintf(stderr, "failed to lookup infos: %d\n", err); + return -1; + } + if (!env.distributed) + printf("%-26s %11llu\n", next_key.name, info.count); + else { + const char *units = env.nanoseconds ? "nsecs" : "usecs"; + + printf("hardirq = %s\n", next_key.name); + print_log2_hist(info.slots, MAX_SLOTS, units); + } + lookup_key = next_key; + } + + memset(&lookup_key, 0, sizeof(lookup_key)); + + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_delete_elem(fd, &next_key); + if (err < 0) { + fprintf(stderr, "failed to cleanup infos: %d\n", err); + return -1; + } + lookup_key = next_key; + } + + return 0; +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct hardirqs_bpf *obj; + struct tm *tm; + char ts[32]; + time_t t; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + if (env.count && env.distributed) { + fprintf(stderr, "count, distributed cann't be used together.\n"); + return 1; + } + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = hardirqs_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF object\n"); + return 1; + } + + /* initialize global data (filtering options) */ + if (!env.count) { + obj->rodata->targ_dist = env.distributed; + obj->rodata->targ_ns = env.nanoseconds; + } + + err = hardirqs_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + if (env.count) { + obj->links.handle__irq_handler = + bpf_program__attach(obj->progs.handle__irq_handler); + err = libbpf_get_error(obj->links.handle__irq_handler); + if (err) { + fprintf(stderr, + "failed to attach irq/irq_handler_entry: %s\n", + strerror(err)); + } + } else { + obj->links.irq_handler_entry = + bpf_program__attach(obj->progs.irq_handler_entry); + err = libbpf_get_error(obj->links.irq_handler_entry); + if (err) { + fprintf(stderr, + "failed to attach irq_handler_entry: %s\n", + strerror(err)); + } + obj->links.irq_handler_exit_exit = + bpf_program__attach(obj->progs.irq_handler_exit_exit); + err = libbpf_get_error(obj->links.irq_handler_exit_exit); + if (err) { + fprintf(stderr, + "failed to attach irq_handler_exit: %s\n", + strerror(err)); + } + } + + signal(SIGINT, sig_handler); + + if (env.count) + printf("Tracing hard irq events... Hit Ctrl-C to end.\n"); + else + printf("Tracing hard irq event time... Hit Ctrl-C to end.\n"); + + /* main: poll */ + while (1) { + sleep(env.interval); + printf("\n"); + + if (env.timestamp) { + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + printf("%-8s\n", ts); + } + + err = print_map(obj->maps.infos); + if (err) + break; + + if (exiting || --env.times == 0) + break; + } + +cleanup: + hardirqs_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/hardirqs.h b/libbpf-tools/hardirqs.h new file mode 100644 index 000000000..97fec1809 --- /dev/null +++ b/libbpf-tools/hardirqs.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __HARDIRQS_H +#define __HARDIRQS_H + +#define MAX_SLOTS 20 + +struct irq_key { + char name[32]; +}; + +struct info { + __u64 count; + __u32 slots[MAX_SLOTS]; +}; + +#endif /* __HARDIRQS_H */ diff --git a/libbpf-tools/kernel.config b/libbpf-tools/kernel.config new file mode 100644 index 000000000..1b93a3b7f --- /dev/null +++ b/libbpf-tools/kernel.config @@ -0,0 +1,4814 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux/x86 5.5.0 Kernel Configuration +# + +# +# Compiler: gcc (GCC) 7.x 20200121 (Facebook) 8.x +# +CONFIG_CC_IS_GCC=y +CONFIG_GCC_VERSION=70300 +CONFIG_CLANG_VERSION=0 +CONFIG_CC_CAN_LINK=y +CONFIG_CC_HAS_ASM_GOTO=y +CONFIG_CC_HAS_ASM_INLINE=y +CONFIG_CC_HAS_WARN_MAYBE_UNINITIALIZED=y +CONFIG_IRQ_WORK=y +CONFIG_BUILDTIME_EXTABLE_SORT=y +CONFIG_THREAD_INFO_IN_TASK=y + +# +# General setup +# +CONFIG_INIT_ENV_ARG_LIMIT=32 +# CONFIG_COMPILE_TEST is not set +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_BUILD_SALT="" +CONFIG_HAVE_KERNEL_GZIP=y +CONFIG_HAVE_KERNEL_BZIP2=y +CONFIG_HAVE_KERNEL_LZMA=y +CONFIG_HAVE_KERNEL_XZ=y +CONFIG_HAVE_KERNEL_LZO=y +CONFIG_HAVE_KERNEL_LZ4=y +CONFIG_KERNEL_GZIP=y +# CONFIG_KERNEL_BZIP2 is not set +# CONFIG_KERNEL_LZMA is not set +# CONFIG_KERNEL_XZ is not set +# CONFIG_KERNEL_LZO is not set +# CONFIG_KERNEL_LZ4 is not set +CONFIG_DEFAULT_HOSTNAME="(none)" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +CONFIG_CROSS_MEMORY_ATTACH=y +CONFIG_USELIB=y +CONFIG_AUDIT=y +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +CONFIG_AUDITSYSCALL=y + +# +# IRQ subsystem +# +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_IRQ_MSI_IOMMU=y +CONFIG_GENERIC_IRQ_MATRIX_ALLOCATOR=y +CONFIG_GENERIC_IRQ_RESERVATION_MODE=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_SPARSE_IRQ=y +# CONFIG_GENERIC_IRQ_DEBUGFS is not set +# end of IRQ subsystem + +CONFIG_CLOCKSOURCE_WATCHDOG=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_CLOCKSOURCE_INIT=y +CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y +CONFIG_GENERIC_CMOS_UPDATE=y + +# +# Timers subsystem +# +CONFIG_TICK_ONESHOT=y +CONFIG_NO_HZ_COMMON=y +# CONFIG_HZ_PERIODIC is not set +CONFIG_NO_HZ_IDLE=y +# CONFIG_NO_HZ_FULL is not set +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +# end of Timers subsystem + +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_VOLUNTARY=y +# CONFIG_PREEMPT is not set + +# +# CPU/Task time and stats accounting +# +CONFIG_TICK_CPU_ACCOUNTING=y +# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set +# CONFIG_IRQ_TIME_ACCOUNTING is not set +CONFIG_BSD_PROCESS_ACCT=y +# CONFIG_BSD_PROCESS_ACCT_V3 is not set +CONFIG_TASKSTATS=y +CONFIG_TASK_DELAY_ACCT=y +CONFIG_TASK_XACCT=y +CONFIG_TASK_IO_ACCOUNTING=y +# CONFIG_PSI is not set +# end of CPU/Task time and stats accounting + +CONFIG_CPU_ISOLATION=y + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +# CONFIG_RCU_EXPERT is not set +CONFIG_SRCU=y +CONFIG_TREE_SRCU=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_RCU_NEED_SEGCBLIST=y +# end of RCU Subsystem + +# CONFIG_IKCONFIG is not set +# CONFIG_IKHEADERS is not set +CONFIG_LOG_BUF_SHIFT=18 +CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 +CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y + +# +# Scheduler features +# +# end of Scheduler features + +CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y +CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y +CONFIG_CC_HAS_INT128=y +CONFIG_ARCH_SUPPORTS_INT128=y +# CONFIG_NUMA_BALANCING is not set +CONFIG_CGROUPS=y +# CONFIG_MEMCG is not set +# CONFIG_BLK_CGROUP is not set +CONFIG_CGROUP_SCHED=y +CONFIG_FAIR_GROUP_SCHED=y +# CONFIG_CFS_BANDWIDTH is not set +# CONFIG_RT_GROUP_SCHED is not set +# CONFIG_CGROUP_PIDS is not set +# CONFIG_CGROUP_RDMA is not set +CONFIG_CGROUP_FREEZER=y +# CONFIG_CGROUP_HUGETLB is not set +CONFIG_CPUSETS=y +CONFIG_PROC_PID_CPUSET=y +# CONFIG_CGROUP_DEVICE is not set +CONFIG_CGROUP_CPUACCT=y +# CONFIG_CGROUP_PERF is not set +CONFIG_CGROUP_BPF=y +# CONFIG_CGROUP_DEBUG is not set +CONFIG_SOCK_CGROUP_DATA=y +CONFIG_NAMESPACES=y +CONFIG_UTS_NS=y +CONFIG_IPC_NS=y +# CONFIG_USER_NS is not set +CONFIG_PID_NS=y +CONFIG_NET_NS=y +# CONFIG_CHECKPOINT_RESTORE is not set +# CONFIG_SCHED_AUTOGROUP is not set +# CONFIG_SYSFS_DEPRECATED is not set +CONFIG_RELAY=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_RD_GZIP=y +CONFIG_RD_BZIP2=y +CONFIG_RD_LZMA=y +CONFIG_RD_XZ=y +CONFIG_RD_LZO=y +CONFIG_RD_LZ4=y +CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SYSCTL=y +CONFIG_HAVE_UID16=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_HAVE_PCSPKR_PLATFORM=y +CONFIG_BPF=y +# CONFIG_EXPERT is not set +CONFIG_UID16=y +CONFIG_MULTIUSER=y +CONFIG_SGETMASK_SYSCALL=y +CONFIG_SYSFS_SYSCALL=y +CONFIG_FHANDLE=y +CONFIG_POSIX_TIMERS=y +CONFIG_PRINTK=y +CONFIG_PRINTK_NMI=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_PCSPKR_PLATFORM=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_FUTEX_PI=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y +CONFIG_IO_URING=y +CONFIG_ADVISE_SYSCALLS=y +CONFIG_MEMBARRIER=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_ALL is not set +CONFIG_KALLSYMS_ABSOLUTE_PERCPU=y +CONFIG_KALLSYMS_BASE_RELATIVE=y +CONFIG_BPF_SYSCALL=y +# CONFIG_BPF_JIT_ALWAYS_ON is not set +# CONFIG_USERFAULTFD is not set +CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y +CONFIG_RSEQ=y +# CONFIG_EMBEDDED is not set +CONFIG_HAVE_PERF_EVENTS=y + +# +# Kernel Performance Events And Counters +# +CONFIG_PERF_EVENTS=y +# CONFIG_DEBUG_PERF_USE_VMALLOC is not set +# end of Kernel Performance Events And Counters + +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_SLUB_DEBUG=y +# CONFIG_COMPAT_BRK is not set +# CONFIG_SLAB is not set +CONFIG_SLUB=y +CONFIG_SLAB_MERGE_DEFAULT=y +# CONFIG_SLAB_FREELIST_RANDOM is not set +# CONFIG_SLAB_FREELIST_HARDENED is not set +# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set +CONFIG_SLUB_CPU_PARTIAL=y +CONFIG_SYSTEM_DATA_VERIFICATION=y +CONFIG_PROFILING=y +CONFIG_TRACEPOINTS=y +# end of General setup + +CONFIG_64BIT=y +CONFIG_X86_64=y +CONFIG_X86=y +CONFIG_INSTRUCTION_DECODER=y +CONFIG_OUTPUT_FORMAT="elf64-x86-64" +CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_MMU=y +CONFIG_ARCH_MMAP_RND_BITS_MIN=28 +CONFIG_ARCH_MMAP_RND_BITS_MAX=32 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_ARCH_HAS_CPU_RELAX=y +CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y +CONFIG_ARCH_HAS_FILTER_PGPROT=y +CONFIG_HAVE_SETUP_PER_CPU_AREA=y +CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y +CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ZONE_DMA32=y +CONFIG_AUDIT_ARCH=y +CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y +CONFIG_HAVE_INTEL_TXT=y +CONFIG_X86_64_SMP=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_PGTABLE_LEVELS=5 +CONFIG_CC_HAS_SANE_STACKPROTECTOR=y + +# +# Processor type and features +# +CONFIG_ZONE_DMA=y +CONFIG_SMP=y +CONFIG_X86_FEATURE_NAMES=y +CONFIG_X86_MPPARSE=y +# CONFIG_GOLDFISH is not set +CONFIG_RETPOLINE=y +# CONFIG_X86_CPU_RESCTRL is not set +CONFIG_X86_EXTENDED_PLATFORM=y +# CONFIG_X86_VSMP is not set +# CONFIG_X86_GOLDFISH is not set +# CONFIG_X86_INTEL_MID is not set +# CONFIG_X86_INTEL_LPSS is not set +# CONFIG_X86_AMD_PLATFORM_DEVICE is not set +CONFIG_IOSF_MBI=y +# CONFIG_IOSF_MBI_DEBUG is not set +CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y +CONFIG_SCHED_OMIT_FRAME_POINTER=y +# CONFIG_HYPERVISOR_GUEST is not set +# CONFIG_MK8 is not set +# CONFIG_MPSC is not set +# CONFIG_MCORE2 is not set +# CONFIG_MATOM is not set +CONFIG_GENERIC_CPU=y +CONFIG_X86_INTERNODE_CACHE_SHIFT=6 +CONFIG_X86_L1_CACHE_SHIFT=6 +CONFIG_X86_TSC=y +CONFIG_X86_CMPXCHG64=y +CONFIG_X86_CMOV=y +CONFIG_X86_MINIMUM_CPU_FAMILY=64 +CONFIG_X86_DEBUGCTLMSR=y +CONFIG_CPU_SUP_INTEL=y +CONFIG_CPU_SUP_AMD=y +CONFIG_CPU_SUP_HYGON=y +CONFIG_CPU_SUP_CENTAUR=y +CONFIG_CPU_SUP_ZHAOXIN=y +CONFIG_HPET_TIMER=y +CONFIG_HPET_EMULATE_RTC=y +CONFIG_DMI=y +# CONFIG_GART_IOMMU is not set +# CONFIG_MAXSMP is not set +CONFIG_NR_CPUS_RANGE_BEGIN=2 +CONFIG_NR_CPUS_RANGE_END=512 +CONFIG_NR_CPUS_DEFAULT=64 +CONFIG_NR_CPUS=64 +CONFIG_SCHED_SMT=y +CONFIG_SCHED_MC=y +CONFIG_SCHED_MC_PRIO=y +CONFIG_X86_LOCAL_APIC=y +CONFIG_X86_IO_APIC=y +CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y +CONFIG_X86_MCE=y +# CONFIG_X86_MCELOG_LEGACY is not set +CONFIG_X86_MCE_INTEL=y +CONFIG_X86_MCE_AMD=y +CONFIG_X86_MCE_THRESHOLD=y +# CONFIG_X86_MCE_INJECT is not set +CONFIG_X86_THERMAL_VECTOR=y + +# +# Performance monitoring +# +CONFIG_PERF_EVENTS_INTEL_UNCORE=y +CONFIG_PERF_EVENTS_INTEL_RAPL=y +CONFIG_PERF_EVENTS_INTEL_CSTATE=y +# CONFIG_PERF_EVENTS_AMD_POWER is not set +# end of Performance monitoring + +CONFIG_X86_16BIT=y +CONFIG_X86_ESPFIX64=y +CONFIG_X86_VSYSCALL_EMULATION=y +CONFIG_X86_IOPL_IOPERM=y +# CONFIG_I8K is not set +CONFIG_MICROCODE=y +CONFIG_MICROCODE_INTEL=y +CONFIG_MICROCODE_AMD=y +# CONFIG_MICROCODE_OLD_INTERFACE is not set +CONFIG_X86_MSR=y +CONFIG_X86_CPUID=y +CONFIG_X86_5LEVEL=y +CONFIG_X86_DIRECT_GBPAGES=y +# CONFIG_X86_CPA_STATISTICS is not set +# CONFIG_AMD_MEM_ENCRYPT is not set +CONFIG_NUMA=y +CONFIG_AMD_NUMA=y +CONFIG_X86_64_ACPI_NUMA=y +CONFIG_NODES_SPAN_OTHER_NODES=y +# CONFIG_NUMA_EMU is not set +CONFIG_NODES_SHIFT=6 +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SPARSEMEM_DEFAULT=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_PROC_KCORE_TEXT=y +CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 +# CONFIG_X86_PMEM_LEGACY is not set +CONFIG_X86_CHECK_BIOS_CORRUPTION=y +CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y +CONFIG_X86_RESERVE_LOW=64 +CONFIG_MTRR=y +# CONFIG_MTRR_SANITIZER is not set +CONFIG_X86_PAT=y +CONFIG_ARCH_USES_PG_UNCACHED=y +CONFIG_ARCH_RANDOM=y +CONFIG_X86_SMAP=y +CONFIG_X86_UMIP=y +# CONFIG_X86_INTEL_MPX is not set +CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y +CONFIG_X86_INTEL_TSX_MODE_OFF=y +# CONFIG_X86_INTEL_TSX_MODE_ON is not set +# CONFIG_X86_INTEL_TSX_MODE_AUTO is not set +CONFIG_EFI=y +CONFIG_EFI_STUB=y +CONFIG_EFI_MIXED=y +CONFIG_SECCOMP=y +# CONFIG_HZ_100 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_300 is not set +CONFIG_HZ_1000=y +CONFIG_HZ=1000 +CONFIG_SCHED_HRTICK=y +CONFIG_KEXEC=y +# CONFIG_KEXEC_FILE is not set +CONFIG_CRASH_DUMP=y +# CONFIG_KEXEC_JUMP is not set +CONFIG_PHYSICAL_START=0x1000000 +CONFIG_RELOCATABLE=y +CONFIG_RANDOMIZE_BASE=y +CONFIG_X86_NEED_RELOCS=y +CONFIG_PHYSICAL_ALIGN=0x200000 +CONFIG_DYNAMIC_MEMORY_LAYOUT=y +CONFIG_RANDOMIZE_MEMORY=y +CONFIG_RANDOMIZE_MEMORY_PHYSICAL_PADDING=0x0 +CONFIG_HOTPLUG_CPU=y +# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set +# CONFIG_DEBUG_HOTPLUG_CPU0 is not set +# CONFIG_COMPAT_VDSO is not set +# CONFIG_LEGACY_VSYSCALL_EMULATE is not set +CONFIG_LEGACY_VSYSCALL_XONLY=y +# CONFIG_LEGACY_VSYSCALL_NONE is not set +# CONFIG_CMDLINE_BOOL is not set +CONFIG_MODIFY_LDT_SYSCALL=y +CONFIG_HAVE_LIVEPATCH=y +# end of Processor type and features + +CONFIG_ARCH_HAS_ADD_PAGES=y +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y +CONFIG_USE_PERCPU_NUMA_NODE_ID=y +CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y +CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y + +# +# Power management and ACPI options +# +CONFIG_ARCH_HIBERNATION_HEADER=y +CONFIG_SUSPEND=y +CONFIG_SUSPEND_FREEZER=y +CONFIG_HIBERNATE_CALLBACKS=y +CONFIG_HIBERNATION=y +CONFIG_PM_STD_PARTITION="" +CONFIG_PM_SLEEP=y +CONFIG_PM_SLEEP_SMP=y +# CONFIG_PM_AUTOSLEEP is not set +# CONFIG_PM_WAKELOCKS is not set +CONFIG_PM=y +CONFIG_PM_DEBUG=y +# CONFIG_PM_ADVANCED_DEBUG is not set +# CONFIG_PM_TEST_SUSPEND is not set +CONFIG_PM_SLEEP_DEBUG=y +CONFIG_PM_TRACE=y +CONFIG_PM_TRACE_RTC=y +CONFIG_PM_CLK=y +# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set +# CONFIG_ENERGY_MODEL is not set +CONFIG_ARCH_SUPPORTS_ACPI=y +CONFIG_ACPI=y +CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y +CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y +CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y +# CONFIG_ACPI_DEBUGGER is not set +CONFIG_ACPI_SPCR_TABLE=y +CONFIG_ACPI_LPIT=y +CONFIG_ACPI_SLEEP=y +# CONFIG_ACPI_PROCFS_POWER is not set +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y +# CONFIG_ACPI_EC_DEBUGFS is not set +CONFIG_ACPI_AC=y +CONFIG_ACPI_BATTERY=y +CONFIG_ACPI_BUTTON=y +CONFIG_ACPI_VIDEO=y +CONFIG_ACPI_FAN=y +# CONFIG_ACPI_TAD is not set +CONFIG_ACPI_DOCK=y +CONFIG_ACPI_CPU_FREQ_PSS=y +CONFIG_ACPI_PROCESSOR_CSTATE=y +CONFIG_ACPI_PROCESSOR_IDLE=y +CONFIG_ACPI_CPPC_LIB=y +CONFIG_ACPI_PROCESSOR=y +CONFIG_ACPI_HOTPLUG_CPU=y +# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set +CONFIG_ACPI_THERMAL=y +CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y +CONFIG_ACPI_TABLE_UPGRADE=y +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_PCI_SLOT is not set +CONFIG_ACPI_CONTAINER=y +CONFIG_ACPI_HOTPLUG_IOAPIC=y +# CONFIG_ACPI_SBS is not set +# CONFIG_ACPI_HED is not set +# CONFIG_ACPI_CUSTOM_METHOD is not set +CONFIG_ACPI_BGRT=y +# CONFIG_ACPI_NFIT is not set +CONFIG_ACPI_NUMA=y +# CONFIG_ACPI_HMAT is not set +CONFIG_HAVE_ACPI_APEI=y +CONFIG_HAVE_ACPI_APEI_NMI=y +# CONFIG_ACPI_APEI is not set +# CONFIG_DPTF_POWER is not set +# CONFIG_ACPI_EXTLOG is not set +# CONFIG_PMIC_OPREGION is not set +# CONFIG_ACPI_CONFIGFS is not set +CONFIG_X86_PM_TIMER=y +# CONFIG_SFI is not set + +# +# CPU Frequency scaling +# +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +# CONFIG_CPU_FREQ_STAT is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set +# CONFIG_CPU_FREQ_GOV_SCHEDUTIL is not set + +# +# CPU frequency scaling drivers +# +CONFIG_X86_INTEL_PSTATE=y +# CONFIG_X86_PCC_CPUFREQ is not set +CONFIG_X86_ACPI_CPUFREQ=y +CONFIG_X86_ACPI_CPUFREQ_CPB=y +# CONFIG_X86_POWERNOW_K8 is not set +# CONFIG_X86_AMD_FREQ_SENSITIVITY is not set +# CONFIG_X86_SPEEDSTEP_CENTRINO is not set +# CONFIG_X86_P4_CLOCKMOD is not set + +# +# shared options +# +# end of CPU Frequency scaling + +# +# CPU Idle +# +CONFIG_CPU_IDLE=y +# CONFIG_CPU_IDLE_GOV_LADDER is not set +CONFIG_CPU_IDLE_GOV_MENU=y +# CONFIG_CPU_IDLE_GOV_TEO is not set +# end of CPU Idle + +# CONFIG_INTEL_IDLE is not set +# end of Power management and ACPI options + +# +# Bus options (PCI etc.) +# +CONFIG_PCI_DIRECT=y +CONFIG_PCI_MMCONFIG=y +CONFIG_MMCONF_FAM10H=y +CONFIG_ISA_DMA_API=y +CONFIG_AMD_NB=y +# CONFIG_X86_SYSFB is not set +# end of Bus options (PCI etc.) + +# +# Binary Emulations +# +CONFIG_IA32_EMULATION=y +# CONFIG_X86_X32 is not set +CONFIG_COMPAT_32=y +CONFIG_COMPAT=y +CONFIG_COMPAT_FOR_U64_ALIGNMENT=y +CONFIG_SYSVIPC_COMPAT=y +# end of Binary Emulations + +# +# Firmware Drivers +# +# CONFIG_EDD is not set +CONFIG_FIRMWARE_MEMMAP=y +CONFIG_DMIID=y +# CONFIG_DMI_SYSFS is not set +CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y +# CONFIG_FW_CFG_SYSFS is not set +# CONFIG_GOOGLE_FIRMWARE is not set + +# +# EFI (Extensible Firmware Interface) Support +# +CONFIG_EFI_VARS=y +CONFIG_EFI_ESRT=y +CONFIG_EFI_RUNTIME_MAP=y +# CONFIG_EFI_FAKE_MEMMAP is not set +CONFIG_EFI_RUNTIME_WRAPPERS=y +# CONFIG_EFI_BOOTLOADER_CONTROL is not set +# CONFIG_EFI_CAPSULE_LOADER is not set +# CONFIG_EFI_TEST is not set +# CONFIG_APPLE_PROPERTIES is not set +# CONFIG_RESET_ATTACK_MITIGATION is not set +# CONFIG_EFI_RCI2_TABLE is not set +# end of EFI (Extensible Firmware Interface) Support + +CONFIG_EFI_EARLYCON=y + +# +# Tegra firmware driver +# +# end of Tegra firmware driver +# end of Firmware Drivers + +CONFIG_HAVE_KVM=y +CONFIG_VIRTUALIZATION=y +# CONFIG_KVM is not set +# CONFIG_VHOST_NET is not set +# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set + +# +# General architecture-dependent options +# +CONFIG_CRASH_CORE=y +CONFIG_KEXEC_CORE=y +CONFIG_HOTPLUG_SMT=y +# CONFIG_OPROFILE is not set +CONFIG_HAVE_OPROFILE=y +CONFIG_OPROFILE_NMI_TIMER=y +CONFIG_KPROBES=y +CONFIG_JUMP_LABEL=y +# CONFIG_STATIC_KEYS_SELFTEST is not set +CONFIG_OPTPROBES=y +CONFIG_UPROBES=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_KRETPROBES=y +CONFIG_HAVE_IOREMAP_PROT=y +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_KPROBES_ON_FTRACE=y +CONFIG_HAVE_FUNCTION_ERROR_INJECTION=y +CONFIG_HAVE_NMI=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_ARCH_HAS_FORTIFY_SOURCE=y +CONFIG_ARCH_HAS_SET_MEMORY=y +CONFIG_ARCH_HAS_SET_DIRECT_MAP=y +CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y +CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y +CONFIG_HAVE_ASM_MODVERSIONS=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_RSEQ=y +CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_HW_BREAKPOINT=y +CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y +CONFIG_HAVE_USER_RETURN_NOTIFIER=y +CONFIG_HAVE_PERF_EVENTS_NMI=y +CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y +CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y +CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y +CONFIG_HAVE_CMPXCHG_LOCAL=y +CONFIG_HAVE_CMPXCHG_DOUBLE=y +CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y +CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_STACKLEAK=y +CONFIG_HAVE_STACKPROTECTOR=y +CONFIG_CC_HAS_STACKPROTECTOR_NONE=y +CONFIG_STACKPROTECTOR=y +CONFIG_STACKPROTECTOR_STRONG=y +CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_MOVE_PMD=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y +CONFIG_HAVE_ARCH_HUGE_VMAP=y +CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y +CONFIG_HAVE_ARCH_SOFT_DIRTY=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_MODULES_USE_ELF_RELA=y +CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_HAVE_ARCH_MMAP_RND_BITS=y +CONFIG_HAVE_EXIT_THREAD=y +CONFIG_ARCH_MMAP_RND_BITS=28 +CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y +CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8 +CONFIG_HAVE_ARCH_COMPAT_MMAP_BASES=y +CONFIG_HAVE_COPY_THREAD_TLS=y +CONFIG_HAVE_STACK_VALIDATION=y +CONFIG_HAVE_RELIABLE_STACKTRACE=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_COMPAT_OLD_SIGACTION=y +CONFIG_COMPAT_32BIT_TIME=y +CONFIG_HAVE_ARCH_VMAP_STACK=y +CONFIG_VMAP_STACK=y +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +CONFIG_STRICT_KERNEL_RWX=y +CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y +CONFIG_STRICT_MODULE_RWX=y +CONFIG_HAVE_ARCH_PREL32_RELOCATIONS=y +CONFIG_ARCH_USE_MEMREMAP_PROT=y +# CONFIG_LOCK_EVENT_COUNTS is not set +CONFIG_ARCH_HAS_MEM_ENCRYPT=y + +# +# GCOV-based kernel profiling +# +# CONFIG_GCOV_KERNEL is not set +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +# end of GCOV-based kernel profiling + +CONFIG_PLUGIN_HOSTCC="" +CONFIG_HAVE_GCC_PLUGINS=y +# end of General architecture-dependent options + +CONFIG_RT_MUTEXES=y +CONFIG_BASE_SMALL=0 +CONFIG_MODULES=y +# CONFIG_MODULE_FORCE_LOAD is not set +CONFIG_MODULE_UNLOAD=y +CONFIG_MODULE_FORCE_UNLOAD=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +# CONFIG_MODULE_SIG is not set +# CONFIG_MODULE_COMPRESS is not set +# CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_TRIM_UNUSED_KSYMS is not set +CONFIG_MODULES_TREE_LOOKUP=y +CONFIG_BLOCK=y +CONFIG_BLK_SCSI_REQUEST=y +CONFIG_BLK_DEV_BSG=y +# CONFIG_BLK_DEV_BSGLIB is not set +# CONFIG_BLK_DEV_INTEGRITY is not set +# CONFIG_BLK_DEV_ZONED is not set +# CONFIG_BLK_CMDLINE_PARSER is not set +# CONFIG_BLK_WBT is not set +CONFIG_BLK_DEBUG_FS=y +# CONFIG_BLK_SED_OPAL is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +CONFIG_EFI_PARTITION=y +# end of Partition Types + +CONFIG_BLOCK_COMPAT=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_PM=y + +# +# IO Schedulers +# +CONFIG_MQ_IOSCHED_DEADLINE=y +CONFIG_MQ_IOSCHED_KYBER=y +# CONFIG_IOSCHED_BFQ is not set +# end of IO Schedulers + +CONFIG_ASN1=y +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +CONFIG_INLINE_READ_UNLOCK=y +CONFIG_INLINE_READ_UNLOCK_IRQ=y +CONFIG_INLINE_WRITE_UNLOCK=y +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_ARCH_USE_QUEUED_RWLOCKS=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_ARCH_HAS_SYNC_CORE_BEFORE_USERMODE=y +CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y +CONFIG_FREEZER=y + +# +# Executable file formats +# +CONFIG_BINFMT_ELF=y +CONFIG_COMPAT_BINFMT_ELF=y +CONFIG_ELFCORE=y +CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y +CONFIG_BINFMT_SCRIPT=y +CONFIG_BINFMT_MISC=y +CONFIG_COREDUMP=y +# end of Executable file formats + +# +# Memory Management options +# +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_SPARSEMEM_MANUAL=y +CONFIG_SPARSEMEM=y +CONFIG_NEED_MULTIPLE_NODES=y +CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_SPARSEMEM_EXTREME=y +CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y +CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_HAVE_FAST_GUP=y +# CONFIG_MEMORY_HOTPLUG is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 +CONFIG_COMPACTION=y +CONFIG_MIGRATION=y +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_BOUNCE=y +CONFIG_VIRT_TO_BUS=y +CONFIG_MMU_NOTIFIER=y +# CONFIG_KSM is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y +# CONFIG_MEMORY_FAILURE is not set +# CONFIG_TRANSPARENT_HUGEPAGE is not set +CONFIG_ARCH_WANTS_THP_SWAP=y +# CONFIG_CLEANCACHE is not set +# CONFIG_FRONTSWAP is not set +# CONFIG_CMA is not set +# CONFIG_ZPOOL is not set +# CONFIG_ZBUD is not set +# CONFIG_ZSMALLOC is not set +CONFIG_GENERIC_EARLY_IOREMAP=y +# CONFIG_DEFERRED_STRUCT_PAGE_INIT is not set +# CONFIG_IDLE_PAGE_TRACKING is not set +CONFIG_ARCH_HAS_PTE_DEVMAP=y +CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y +CONFIG_ARCH_HAS_PKEYS=y +# CONFIG_PERCPU_STATS is not set +# CONFIG_GUP_BENCHMARK is not set +CONFIG_ARCH_HAS_PTE_SPECIAL=y +# end of Memory Management options + +CONFIG_NET=y +CONFIG_NET_INGRESS=y +CONFIG_SKB_EXTENSIONS=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_DIAG is not set +CONFIG_UNIX=y +CONFIG_UNIX_SCM=y +# CONFIG_UNIX_DIAG is not set +# CONFIG_TLS is not set +CONFIG_XFRM=y +CONFIG_XFRM_ALGO=y +CONFIG_XFRM_USER=y +# CONFIG_XFRM_INTERFACE is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +# CONFIG_NET_KEY is not set +CONFIG_XDP_SOCKETS=y +CONFIG_XDP_SOCKETS_DIAG=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_ADVANCED_ROUTER=y +# CONFIG_IP_FIB_TRIE_STATS is not set +CONFIG_IP_MULTIPLE_TABLES=y +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_RARP=y +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE_DEMUX is not set +CONFIG_NET_IP_TUNNEL=y +CONFIG_IP_MROUTE_COMMON=y +CONFIG_IP_MROUTE=y +# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +CONFIG_SYN_COOKIES=y +# CONFIG_NET_IPVTI is not set +# CONFIG_NET_FOU is not set +# CONFIG_NET_FOU_IP_TUNNELS is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +CONFIG_INET_TUNNEL=y +# CONFIG_INET_DIAG is not set +CONFIG_TCP_CONG_ADVANCED=y +# CONFIG_TCP_CONG_BIC is not set +CONFIG_TCP_CONG_CUBIC=y +# CONFIG_TCP_CONG_WESTWOOD is not set +# CONFIG_TCP_CONG_HTCP is not set +# CONFIG_TCP_CONG_HSTCP is not set +# CONFIG_TCP_CONG_HYBLA is not set +# CONFIG_TCP_CONG_VEGAS is not set +# CONFIG_TCP_CONG_NV is not set +# CONFIG_TCP_CONG_SCALABLE is not set +# CONFIG_TCP_CONG_LP is not set +# CONFIG_TCP_CONG_VENO is not set +# CONFIG_TCP_CONG_YEAH is not set +# CONFIG_TCP_CONG_ILLINOIS is not set +# CONFIG_TCP_CONG_DCTCP is not set +# CONFIG_TCP_CONG_CDG is not set +# CONFIG_TCP_CONG_BBR is not set +CONFIG_DEFAULT_CUBIC=y +# CONFIG_DEFAULT_RENO is not set +CONFIG_DEFAULT_TCP_CONG="cubic" +CONFIG_TCP_MD5SIG=y +CONFIG_IPV6=y +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +CONFIG_INET6_AH=y +CONFIG_INET6_ESP=y +# CONFIG_INET6_ESP_OFFLOAD is not set +# CONFIG_INET6_IPCOMP is not set +# CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6_ILA is not set +# CONFIG_IPV6_VTI is not set +CONFIG_IPV6_SIT=y +# CONFIG_IPV6_SIT_6RD is not set +CONFIG_IPV6_NDISC_NODETYPE=y +# CONFIG_IPV6_TUNNEL is not set +CONFIG_IPV6_MULTIPLE_TABLES=y +# CONFIG_IPV6_SUBTREES is not set +# CONFIG_IPV6_MROUTE is not set +CONFIG_IPV6_SEG6_LWTUNNEL=y +# CONFIG_IPV6_SEG6_HMAC is not set +CONFIG_IPV6_SEG6_BPF=y +CONFIG_NETLABEL=y +CONFIG_NETWORK_SECMARK=y +CONFIG_NET_PTP_CLASSIFY=y +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +CONFIG_NETFILTER=y +CONFIG_NETFILTER_ADVANCED=y + +# +# Core Netfilter Configuration +# +CONFIG_NETFILTER_INGRESS=y +CONFIG_NETFILTER_NETLINK=y +# CONFIG_NETFILTER_NETLINK_ACCT is not set +# CONFIG_NETFILTER_NETLINK_QUEUE is not set +CONFIG_NETFILTER_NETLINK_LOG=y +# CONFIG_NETFILTER_NETLINK_OSF is not set +CONFIG_NF_CONNTRACK=y +CONFIG_NF_LOG_COMMON=m +# CONFIG_NF_LOG_NETDEV is not set +# CONFIG_NF_CONNTRACK_MARK is not set +CONFIG_NF_CONNTRACK_SECMARK=y +# CONFIG_NF_CONNTRACK_ZONES is not set +CONFIG_NF_CONNTRACK_PROCFS=y +# CONFIG_NF_CONNTRACK_EVENTS is not set +# CONFIG_NF_CONNTRACK_TIMEOUT is not set +# CONFIG_NF_CONNTRACK_TIMESTAMP is not set +# CONFIG_NF_CONNTRACK_LABELS is not set +CONFIG_NF_CT_PROTO_DCCP=y +CONFIG_NF_CT_PROTO_SCTP=y +CONFIG_NF_CT_PROTO_UDPLITE=y +# CONFIG_NF_CONNTRACK_AMANDA is not set +CONFIG_NF_CONNTRACK_FTP=y +# CONFIG_NF_CONNTRACK_H323 is not set +CONFIG_NF_CONNTRACK_IRC=y +# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set +# CONFIG_NF_CONNTRACK_SNMP is not set +# CONFIG_NF_CONNTRACK_PPTP is not set +# CONFIG_NF_CONNTRACK_SANE is not set +CONFIG_NF_CONNTRACK_SIP=y +# CONFIG_NF_CONNTRACK_TFTP is not set +CONFIG_NF_CT_NETLINK=y +# CONFIG_NETFILTER_NETLINK_GLUE_CT is not set +CONFIG_NF_NAT=y +CONFIG_NF_NAT_FTP=y +CONFIG_NF_NAT_IRC=y +CONFIG_NF_NAT_SIP=y +CONFIG_NF_NAT_MASQUERADE=y +# CONFIG_NF_TABLES is not set +CONFIG_NETFILTER_XTABLES=y + +# +# Xtables combined modules +# +CONFIG_NETFILTER_XT_MARK=m +# CONFIG_NETFILTER_XT_CONNMARK is not set + +# +# Xtables targets +# +# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set +# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set +# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set +# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set +CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y +# CONFIG_NETFILTER_XT_TARGET_DSCP is not set +# CONFIG_NETFILTER_XT_TARGET_HL is not set +# CONFIG_NETFILTER_XT_TARGET_HMARK is not set +# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set +# CONFIG_NETFILTER_XT_TARGET_LED is not set +CONFIG_NETFILTER_XT_TARGET_LOG=m +# CONFIG_NETFILTER_XT_TARGET_MARK is not set +CONFIG_NETFILTER_XT_NAT=m +# CONFIG_NETFILTER_XT_TARGET_NETMAP is not set +CONFIG_NETFILTER_XT_TARGET_NFLOG=y +# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set +# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set +# CONFIG_NETFILTER_XT_TARGET_REDIRECT is not set +CONFIG_NETFILTER_XT_TARGET_MASQUERADE=m +# CONFIG_NETFILTER_XT_TARGET_TEE is not set +# CONFIG_NETFILTER_XT_TARGET_TPROXY is not set +CONFIG_NETFILTER_XT_TARGET_SECMARK=y +CONFIG_NETFILTER_XT_TARGET_TCPMSS=y +# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set + +# +# Xtables matches +# +CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m +CONFIG_NETFILTER_XT_MATCH_BPF=y +# CONFIG_NETFILTER_XT_MATCH_CGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set +# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set +# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set +# CONFIG_NETFILTER_XT_MATCH_CONNLABEL is not set +# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set +CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y +# CONFIG_NETFILTER_XT_MATCH_CPU is not set +# CONFIG_NETFILTER_XT_MATCH_DCCP is not set +# CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set +# CONFIG_NETFILTER_XT_MATCH_ECN is not set +# CONFIG_NETFILTER_XT_MATCH_ESP is not set +# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_HELPER is not set +# CONFIG_NETFILTER_XT_MATCH_HL is not set +# CONFIG_NETFILTER_XT_MATCH_IPCOMP is not set +# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set +# CONFIG_NETFILTER_XT_MATCH_L2TP is not set +# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set +# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_MAC is not set +# CONFIG_NETFILTER_XT_MATCH_MARK is not set +# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set +# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set +# CONFIG_NETFILTER_XT_MATCH_OSF is not set +# CONFIG_NETFILTER_XT_MATCH_OWNER is not set +CONFIG_NETFILTER_XT_MATCH_POLICY=y +# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set +# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set +# CONFIG_NETFILTER_XT_MATCH_REALM is not set +# CONFIG_NETFILTER_XT_MATCH_RECENT is not set +# CONFIG_NETFILTER_XT_MATCH_SCTP is not set +# CONFIG_NETFILTER_XT_MATCH_SOCKET is not set +CONFIG_NETFILTER_XT_MATCH_STATE=y +# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set +# CONFIG_NETFILTER_XT_MATCH_STRING is not set +# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set +# CONFIG_NETFILTER_XT_MATCH_TIME is not set +# CONFIG_NETFILTER_XT_MATCH_U32 is not set +# end of Core Netfilter Configuration + +# CONFIG_IP_SET is not set +# CONFIG_IP_VS is not set + +# +# IP: Netfilter Configuration +# +CONFIG_NF_DEFRAG_IPV4=y +# CONFIG_NF_SOCKET_IPV4 is not set +# CONFIG_NF_TPROXY_IPV4 is not set +# CONFIG_NF_DUP_IPV4 is not set +CONFIG_NF_LOG_ARP=m +CONFIG_NF_LOG_IPV4=m +CONFIG_NF_REJECT_IPV4=y +CONFIG_IP_NF_IPTABLES=y +# CONFIG_IP_NF_MATCH_AH is not set +# CONFIG_IP_NF_MATCH_ECN is not set +# CONFIG_IP_NF_MATCH_RPFILTER is not set +# CONFIG_IP_NF_MATCH_TTL is not set +CONFIG_IP_NF_FILTER=y +CONFIG_IP_NF_TARGET_REJECT=y +# CONFIG_IP_NF_TARGET_SYNPROXY is not set +CONFIG_IP_NF_NAT=m +CONFIG_IP_NF_TARGET_MASQUERADE=m +# CONFIG_IP_NF_TARGET_NETMAP is not set +# CONFIG_IP_NF_TARGET_REDIRECT is not set +CONFIG_IP_NF_MANGLE=y +# CONFIG_IP_NF_TARGET_CLUSTERIP is not set +# CONFIG_IP_NF_TARGET_ECN is not set +# CONFIG_IP_NF_TARGET_TTL is not set +# CONFIG_IP_NF_RAW is not set +# CONFIG_IP_NF_SECURITY is not set +# CONFIG_IP_NF_ARPTABLES is not set +# end of IP: Netfilter Configuration + +# +# IPv6: Netfilter Configuration +# +# CONFIG_NF_SOCKET_IPV6 is not set +# CONFIG_NF_TPROXY_IPV6 is not set +# CONFIG_NF_DUP_IPV6 is not set +CONFIG_NF_REJECT_IPV6=y +CONFIG_NF_LOG_IPV6=m +CONFIG_IP6_NF_IPTABLES=y +# CONFIG_IP6_NF_MATCH_AH is not set +# CONFIG_IP6_NF_MATCH_EUI64 is not set +# CONFIG_IP6_NF_MATCH_FRAG is not set +# CONFIG_IP6_NF_MATCH_OPTS is not set +# CONFIG_IP6_NF_MATCH_HL is not set +CONFIG_IP6_NF_MATCH_IPV6HEADER=y +# CONFIG_IP6_NF_MATCH_MH is not set +# CONFIG_IP6_NF_MATCH_RPFILTER is not set +# CONFIG_IP6_NF_MATCH_RT is not set +# CONFIG_IP6_NF_MATCH_SRH is not set +# CONFIG_IP6_NF_TARGET_HL is not set +CONFIG_IP6_NF_FILTER=y +CONFIG_IP6_NF_TARGET_REJECT=y +# CONFIG_IP6_NF_TARGET_SYNPROXY is not set +CONFIG_IP6_NF_MANGLE=y +# CONFIG_IP6_NF_RAW is not set +# CONFIG_IP6_NF_SECURITY is not set +# CONFIG_IP6_NF_NAT is not set +# end of IPv6: Netfilter Configuration + +CONFIG_NF_DEFRAG_IPV6=y +# CONFIG_NF_CONNTRACK_BRIDGE is not set +CONFIG_BPFILTER=y +CONFIG_BPFILTER_UMH=m +# CONFIG_IP_DCCP is not set +# CONFIG_IP_SCTP is not set +# CONFIG_RDS is not set +# CONFIG_TIPC is not set +# CONFIG_ATM is not set +# CONFIG_L2TP is not set +# CONFIG_BRIDGE is not set +CONFIG_HAVE_NET_DSA=y +# CONFIG_NET_DSA is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_PHONET is not set +# CONFIG_6LOWPAN is not set +# CONFIG_IEEE802154 is not set +CONFIG_NET_SCHED=y + +# +# Queueing/Scheduling +# +# CONFIG_NET_SCH_CBQ is not set +# CONFIG_NET_SCH_HTB is not set +# CONFIG_NET_SCH_HFSC is not set +# CONFIG_NET_SCH_PRIO is not set +# CONFIG_NET_SCH_MULTIQ is not set +# CONFIG_NET_SCH_RED is not set +# CONFIG_NET_SCH_SFB is not set +# CONFIG_NET_SCH_SFQ is not set +# CONFIG_NET_SCH_TEQL is not set +# CONFIG_NET_SCH_TBF is not set +# CONFIG_NET_SCH_CBS is not set +# CONFIG_NET_SCH_ETF is not set +# CONFIG_NET_SCH_TAPRIO is not set +# CONFIG_NET_SCH_GRED is not set +# CONFIG_NET_SCH_DSMARK is not set +# CONFIG_NET_SCH_NETEM is not set +# CONFIG_NET_SCH_DRR is not set +# CONFIG_NET_SCH_MQPRIO is not set +# CONFIG_NET_SCH_SKBPRIO is not set +# CONFIG_NET_SCH_CHOKE is not set +# CONFIG_NET_SCH_QFQ is not set +# CONFIG_NET_SCH_CODEL is not set +# CONFIG_NET_SCH_FQ_CODEL is not set +# CONFIG_NET_SCH_CAKE is not set +# CONFIG_NET_SCH_FQ is not set +# CONFIG_NET_SCH_HHF is not set +# CONFIG_NET_SCH_PIE is not set +# CONFIG_NET_SCH_INGRESS is not set +# CONFIG_NET_SCH_PLUG is not set +# CONFIG_NET_SCH_DEFAULT is not set + +# +# Classification +# +CONFIG_NET_CLS=y +# CONFIG_NET_CLS_BASIC is not set +# CONFIG_NET_CLS_TCINDEX is not set +# CONFIG_NET_CLS_ROUTE4 is not set +# CONFIG_NET_CLS_FW is not set +# CONFIG_NET_CLS_U32 is not set +# CONFIG_NET_CLS_RSVP is not set +# CONFIG_NET_CLS_RSVP6 is not set +# CONFIG_NET_CLS_FLOW is not set +# CONFIG_NET_CLS_CGROUP is not set +CONFIG_NET_CLS_BPF=y +# CONFIG_NET_CLS_FLOWER is not set +# CONFIG_NET_CLS_MATCHALL is not set +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_STACK=32 +# CONFIG_NET_EMATCH_CMP is not set +# CONFIG_NET_EMATCH_NBYTE is not set +# CONFIG_NET_EMATCH_U32 is not set +# CONFIG_NET_EMATCH_META is not set +# CONFIG_NET_EMATCH_TEXT is not set +# CONFIG_NET_EMATCH_IPT is not set +CONFIG_NET_CLS_ACT=y +# CONFIG_NET_ACT_POLICE is not set +# CONFIG_NET_ACT_GACT is not set +# CONFIG_NET_ACT_MIRRED is not set +# CONFIG_NET_ACT_SAMPLE is not set +# CONFIG_NET_ACT_IPT is not set +# CONFIG_NET_ACT_NAT is not set +# CONFIG_NET_ACT_PEDIT is not set +# CONFIG_NET_ACT_SIMP is not set +# CONFIG_NET_ACT_SKBEDIT is not set +# CONFIG_NET_ACT_CSUM is not set +# CONFIG_NET_ACT_MPLS is not set +# CONFIG_NET_ACT_VLAN is not set +CONFIG_NET_ACT_BPF=y +# CONFIG_NET_ACT_SKBMOD is not set +# CONFIG_NET_ACT_IFE is not set +# CONFIG_NET_ACT_TUNNEL_KEY is not set +# CONFIG_NET_ACT_CT is not set +# CONFIG_NET_TC_SKB_EXT is not set +CONFIG_NET_SCH_FIFO=y +# CONFIG_DCB is not set +CONFIG_DNS_RESOLVER=y +# CONFIG_BATMAN_ADV is not set +# CONFIG_OPENVSWITCH is not set +# CONFIG_VSOCKETS is not set +# CONFIG_NETLINK_DIAG is not set +# CONFIG_MPLS is not set +# CONFIG_NET_NSH is not set +# CONFIG_HSR is not set +# CONFIG_NET_SWITCHDEV is not set +# CONFIG_NET_L3_MASTER_DEV is not set +# CONFIG_NET_NCSI is not set +CONFIG_RPS=y +CONFIG_RFS_ACCEL=y +CONFIG_XPS=y +# CONFIG_CGROUP_NET_PRIO is not set +# CONFIG_CGROUP_NET_CLASSID is not set +CONFIG_NET_RX_BUSY_POLL=y +CONFIG_BQL=y +CONFIG_BPF_JIT=y +CONFIG_BPF_STREAM_PARSER=y +CONFIG_NET_FLOW_LIMIT=y + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_NET_DROP_MONITOR is not set +# end of Network testing +# end of Networking options + +CONFIG_HAMRADIO=y + +# +# Packet Radio protocols +# +# CONFIG_AX25 is not set +# CONFIG_CAN is not set +# CONFIG_BT is not set +# CONFIG_AF_RXRPC is not set +# CONFIG_AF_KCM is not set +CONFIG_STREAM_PARSER=y +CONFIG_FIB_RULES=y +CONFIG_WIRELESS=y +CONFIG_CFG80211=y +# CONFIG_NL80211_TESTMODE is not set +# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set +CONFIG_CFG80211_REQUIRE_SIGNED_REGDB=y +CONFIG_CFG80211_USE_KERNEL_REGDB_KEYS=y +CONFIG_CFG80211_DEFAULT_PS=y +# CONFIG_CFG80211_DEBUGFS is not set +CONFIG_CFG80211_CRDA_SUPPORT=y +# CONFIG_CFG80211_WEXT is not set +CONFIG_MAC80211=y +CONFIG_MAC80211_HAS_RC=y +CONFIG_MAC80211_RC_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y +CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" +# CONFIG_MAC80211_MESH is not set +CONFIG_MAC80211_LEDS=y +# CONFIG_MAC80211_DEBUGFS is not set +# CONFIG_MAC80211_MESSAGE_TRACING is not set +# CONFIG_MAC80211_DEBUG_MENU is not set +CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 +# CONFIG_WIMAX is not set +CONFIG_RFKILL=y +CONFIG_RFKILL_LEDS=y +CONFIG_RFKILL_INPUT=y +# CONFIG_NET_9P is not set +# CONFIG_CAIF is not set +# CONFIG_CEPH_LIB is not set +# CONFIG_NFC is not set +# CONFIG_PSAMPLE is not set +# CONFIG_NET_IFE is not set +CONFIG_LWTUNNEL=y +CONFIG_LWTUNNEL_BPF=y +CONFIG_DST_CACHE=y +CONFIG_GRO_CELLS=y +CONFIG_NET_SOCK_MSG=y +# CONFIG_FAILOVER is not set +CONFIG_HAVE_EBPF_JIT=y + +# +# Device Drivers +# +CONFIG_HAVE_EISA=y +# CONFIG_EISA is not set +CONFIG_HAVE_PCI=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCIEPORTBUS=y +# CONFIG_HOTPLUG_PCI_PCIE is not set +CONFIG_PCIEAER=y +# CONFIG_PCIEAER_INJECT is not set +# CONFIG_PCIE_ECRC is not set +CONFIG_PCIEASPM=y +CONFIG_PCIEASPM_DEFAULT=y +# CONFIG_PCIEASPM_POWERSAVE is not set +# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set +# CONFIG_PCIEASPM_PERFORMANCE is not set +CONFIG_PCIE_PME=y +# CONFIG_PCIE_DPC is not set +# CONFIG_PCIE_PTM is not set +# CONFIG_PCIE_BW is not set +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_PCI_QUIRKS=y +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_STUB is not set +CONFIG_PCI_ATS=y +CONFIG_PCI_LOCKLESS_CONFIG=y +# CONFIG_PCI_IOV is not set +CONFIG_PCI_PRI=y +CONFIG_PCI_PASID=y +CONFIG_PCI_LABEL=y +CONFIG_HOTPLUG_PCI=y +# CONFIG_HOTPLUG_PCI_ACPI is not set +# CONFIG_HOTPLUG_PCI_CPCI is not set +# CONFIG_HOTPLUG_PCI_SHPC is not set + +# +# PCI controller drivers +# +# CONFIG_VMD is not set + +# +# DesignWare PCI Core Support +# +# CONFIG_PCIE_DW_PLAT_HOST is not set +# CONFIG_PCI_MESON is not set +# end of DesignWare PCI Core Support + +# +# Cadence PCIe controllers support +# +# end of Cadence PCIe controllers support +# end of PCI controller drivers + +# +# PCI Endpoint +# +# CONFIG_PCI_ENDPOINT is not set +# end of PCI Endpoint + +# +# PCI switch controller drivers +# +# CONFIG_PCI_SW_SWITCHTEC is not set +# end of PCI switch controller drivers + +CONFIG_PCCARD=y +CONFIG_PCMCIA=y +CONFIG_PCMCIA_LOAD_CIS=y +CONFIG_CARDBUS=y + +# +# PC-card bridges +# +CONFIG_YENTA=y +CONFIG_YENTA_O2=y +CONFIG_YENTA_RICOH=y +CONFIG_YENTA_TI=y +CONFIG_YENTA_ENE_TUNE=y +CONFIG_YENTA_TOSHIBA=y +# CONFIG_PD6729 is not set +# CONFIG_I82092 is not set +CONFIG_PCCARD_NONSTATIC=y +# CONFIG_RAPIDIO is not set + +# +# Generic Driver Options +# +# CONFIG_UEVENT_HELPER is not set +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y + +# +# Firmware loader +# +CONFIG_FW_LOADER=y +CONFIG_EXTRA_FIRMWARE="" +# CONFIG_FW_LOADER_USER_HELPER is not set +# CONFIG_FW_LOADER_COMPRESS is not set +CONFIG_FW_CACHE=y +# end of Firmware loader + +CONFIG_ALLOW_DEV_COREDUMP=y +# CONFIG_DEBUG_DRIVER is not set +CONFIG_DEBUG_DEVRES=y +# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set +# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_CPU_VULNERABILITIES=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_DMA_SHARED_BUFFER=y +# CONFIG_DMA_FENCE_TRACE is not set +# end of Generic Driver Options + +# +# Bus devices +# +# end of Bus devices + +CONFIG_CONNECTOR=y +CONFIG_PROC_EVENTS=y +# CONFIG_GNSS is not set +# CONFIG_MTD is not set +# CONFIG_OF is not set +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +# CONFIG_PARPORT is not set +CONFIG_PNP=y +CONFIG_PNP_DEBUG_MESSAGES=y + +# +# Protocols +# +CONFIG_PNPACPI=y +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_NULL_BLK is not set +# CONFIG_BLK_DEV_FD is not set +CONFIG_CDROM=y +# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set +# CONFIG_BLK_DEV_UMEM is not set +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_DRBD is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_SKD is not set +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_BLK_DEV_RBD is not set +# CONFIG_BLK_DEV_RSXX is not set + +# +# NVME Support +# +# CONFIG_BLK_DEV_NVME is not set +# CONFIG_NVME_FC is not set +# end of NVME Support + +# +# Misc devices +# +# CONFIG_AD525X_DPOT is not set +# CONFIG_DUMMY_IRQ is not set +# CONFIG_IBM_ASM is not set +# CONFIG_PHANTOM is not set +# CONFIG_TIFM_CORE is not set +# CONFIG_ICS932S401 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_HP_ILO is not set +# CONFIG_APDS9802ALS is not set +# CONFIG_ISL29003 is not set +# CONFIG_ISL29020 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_SENSORS_BH1770 is not set +# CONFIG_SENSORS_APDS990X is not set +# CONFIG_HMC6352 is not set +# CONFIG_DS1682 is not set +# CONFIG_SRAM is not set +# CONFIG_PCI_ENDPOINT_TEST is not set +# CONFIG_XILINX_SDFEC is not set +# CONFIG_PVPANIC is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +# CONFIG_EEPROM_93CX6 is not set +# CONFIG_EEPROM_IDT_89HPESX is not set +# CONFIG_EEPROM_EE1004 is not set +# end of EEPROM support + +# CONFIG_CB710_CORE is not set + +# +# Texas Instruments shared transport line discipline +# +# end of Texas Instruments shared transport line discipline + +# CONFIG_SENSORS_LIS3_I2C is not set +# CONFIG_ALTERA_STAPL is not set +# CONFIG_INTEL_MEI is not set +# CONFIG_INTEL_MEI_ME is not set +# CONFIG_INTEL_MEI_TXE is not set +# CONFIG_INTEL_MEI_HDCP is not set +# CONFIG_VMWARE_VMCI is not set + +# +# Intel MIC & related support +# +# CONFIG_INTEL_MIC_BUS is not set +# CONFIG_SCIF_BUS is not set +# CONFIG_VOP_BUS is not set +# end of Intel MIC & related support + +# CONFIG_GENWQE is not set +# CONFIG_ECHO is not set +# CONFIG_MISC_ALCOR_PCI is not set +# CONFIG_MISC_RTSX_PCI is not set +# CONFIG_MISC_RTSX_USB is not set +# CONFIG_HABANA_AI is not set +# end of Misc devices + +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_RAID_ATTRS is not set +CONFIG_SCSI=y +CONFIG_SCSI_DMA=y +CONFIG_SCSI_PROC_FS=y + +# +# SCSI support type (disk, tape, CD-ROM) +# +CONFIG_BLK_DEV_SD=y +# CONFIG_CHR_DEV_ST is not set +CONFIG_BLK_DEV_SR=y +CONFIG_BLK_DEV_SR_VENDOR=y +CONFIG_CHR_DEV_SG=y +# CONFIG_CHR_DEV_SCH is not set +CONFIG_SCSI_CONSTANTS=y +# CONFIG_SCSI_LOGGING is not set +# CONFIG_SCSI_SCAN_ASYNC is not set + +# +# SCSI Transports +# +CONFIG_SCSI_SPI_ATTRS=y +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_SAS_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +# end of SCSI Transports + +# CONFIG_SCSI_LOWLEVEL is not set +# CONFIG_SCSI_DH is not set +# end of SCSI device support + +CONFIG_ATA=y +CONFIG_ATA_VERBOSE_ERROR=y +CONFIG_ATA_ACPI=y +# CONFIG_SATA_ZPODD is not set +CONFIG_SATA_PMP=y + +# +# Controllers with non-SFF native interface +# +CONFIG_SATA_AHCI=y +CONFIG_SATA_MOBILE_LPM_POLICY=0 +# CONFIG_SATA_AHCI_PLATFORM is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_ACARD_AHCI is not set +# CONFIG_SATA_SIL24 is not set +CONFIG_ATA_SFF=y + +# +# SFF controllers with custom DMA interface +# +# CONFIG_PDC_ADMA is not set +# CONFIG_SATA_QSTOR is not set +# CONFIG_SATA_SX4 is not set +CONFIG_ATA_BMDMA=y + +# +# SATA SFF controllers with BMDMA +# +CONFIG_ATA_PIIX=y +# CONFIG_SATA_DWC is not set +# CONFIG_SATA_MV is not set +# CONFIG_SATA_NV is not set +# CONFIG_SATA_PROMISE is not set +# CONFIG_SATA_SIL is not set +# CONFIG_SATA_SIS is not set +# CONFIG_SATA_SVW is not set +# CONFIG_SATA_ULI is not set +# CONFIG_SATA_VIA is not set +# CONFIG_SATA_VITESSE is not set + +# +# PATA SFF controllers with BMDMA +# +# CONFIG_PATA_ALI is not set +CONFIG_PATA_AMD=y +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_ATP867X is not set +# CONFIG_PATA_CMD64X is not set +# CONFIG_PATA_CYPRESS is not set +# CONFIG_PATA_EFAR is not set +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +# CONFIG_PATA_IT8213 is not set +# CONFIG_PATA_IT821X is not set +# CONFIG_PATA_JMICRON is not set +# CONFIG_PATA_MARVELL is not set +# CONFIG_PATA_NETCELL is not set +# CONFIG_PATA_NINJA32 is not set +# CONFIG_PATA_NS87415 is not set +CONFIG_PATA_OLDPIIX=y +# CONFIG_PATA_OPTIDMA is not set +# CONFIG_PATA_PDC2027X is not set +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_RADISYS is not set +# CONFIG_PATA_RDC is not set +CONFIG_PATA_SCH=y +# CONFIG_PATA_SERVERWORKS is not set +# CONFIG_PATA_SIL680 is not set +# CONFIG_PATA_SIS is not set +# CONFIG_PATA_TOSHIBA is not set +# CONFIG_PATA_TRIFLEX is not set +# CONFIG_PATA_VIA is not set +# CONFIG_PATA_WINBOND is not set + +# +# PIO-only SFF controllers +# +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_MPIIX is not set +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_PCMCIA is not set +# CONFIG_PATA_RZ1000 is not set + +# +# Generic fallback / legacy drivers +# +# CONFIG_PATA_ACPI is not set +# CONFIG_ATA_GENERIC is not set +# CONFIG_PATA_LEGACY is not set +CONFIG_MD=y +CONFIG_BLK_DEV_MD=y +CONFIG_MD_AUTODETECT=y +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID10 is not set +# CONFIG_MD_RAID456 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_MD_FAULTY is not set +# CONFIG_BCACHE is not set +CONFIG_BLK_DEV_DM_BUILTIN=y +CONFIG_BLK_DEV_DM=y +# CONFIG_DM_DEBUG is not set +# CONFIG_DM_UNSTRIPED is not set +# CONFIG_DM_CRYPT is not set +# CONFIG_DM_SNAPSHOT is not set +# CONFIG_DM_THIN_PROVISIONING is not set +# CONFIG_DM_CACHE is not set +# CONFIG_DM_WRITECACHE is not set +# CONFIG_DM_ERA is not set +# CONFIG_DM_CLONE is not set +CONFIG_DM_MIRROR=y +# CONFIG_DM_LOG_USERSPACE is not set +# CONFIG_DM_RAID is not set +CONFIG_DM_ZERO=y +# CONFIG_DM_MULTIPATH is not set +# CONFIG_DM_DELAY is not set +# CONFIG_DM_DUST is not set +# CONFIG_DM_INIT is not set +# CONFIG_DM_UEVENT is not set +# CONFIG_DM_FLAKEY is not set +# CONFIG_DM_VERITY is not set +# CONFIG_DM_SWITCH is not set +# CONFIG_DM_LOG_WRITES is not set +# CONFIG_DM_INTEGRITY is not set +# CONFIG_TARGET_CORE is not set +# CONFIG_FUSION is not set + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_FIREWIRE is not set +# CONFIG_FIREWIRE_NOSY is not set +# end of IEEE 1394 (FireWire) support + +CONFIG_MACINTOSH_DRIVERS=y +CONFIG_MAC_EMUMOUSEBTN=y +CONFIG_NETDEVICES=y +CONFIG_MII=y +CONFIG_NET_CORE=y +# CONFIG_BONDING is not set +# CONFIG_DUMMY is not set +# CONFIG_EQUALIZER is not set +# CONFIG_NET_FC is not set +# CONFIG_IFB is not set +# CONFIG_NET_TEAM is not set +# CONFIG_MACVLAN is not set +# CONFIG_IPVLAN is not set +# CONFIG_VXLAN is not set +# CONFIG_GENEVE is not set +# CONFIG_GTP is not set +# CONFIG_MACSEC is not set +CONFIG_NETCONSOLE=y +CONFIG_NETPOLL=y +CONFIG_NET_POLL_CONTROLLER=y +# CONFIG_TUN is not set +# CONFIG_TUN_VNET_CROSS_LE is not set +# CONFIG_VETH is not set +# CONFIG_NLMON is not set +# CONFIG_ARCNET is not set + +# +# Distributed Switch Architecture drivers +# +# end of Distributed Switch Architecture drivers + +CONFIG_ETHERNET=y +CONFIG_NET_VENDOR_3COM=y +# CONFIG_PCMCIA_3C574 is not set +# CONFIG_PCMCIA_3C589 is not set +# CONFIG_VORTEX is not set +# CONFIG_TYPHOON is not set +CONFIG_NET_VENDOR_ADAPTEC=y +# CONFIG_ADAPTEC_STARFIRE is not set +CONFIG_NET_VENDOR_AGERE=y +# CONFIG_ET131X is not set +CONFIG_NET_VENDOR_ALACRITECH=y +# CONFIG_SLICOSS is not set +CONFIG_NET_VENDOR_ALTEON=y +# CONFIG_ACENIC is not set +# CONFIG_ALTERA_TSE is not set +CONFIG_NET_VENDOR_AMAZON=y +# CONFIG_ENA_ETHERNET is not set +CONFIG_NET_VENDOR_AMD=y +# CONFIG_AMD8111_ETH is not set +# CONFIG_PCNET32 is not set +# CONFIG_PCMCIA_NMCLAN is not set +# CONFIG_AMD_XGBE is not set +CONFIG_NET_VENDOR_AQUANTIA=y +# CONFIG_AQTION is not set +CONFIG_NET_VENDOR_ARC=y +CONFIG_NET_VENDOR_ATHEROS=y +# CONFIG_ATL2 is not set +# CONFIG_ATL1 is not set +# CONFIG_ATL1E is not set +# CONFIG_ATL1C is not set +# CONFIG_ALX is not set +CONFIG_NET_VENDOR_AURORA=y +# CONFIG_AURORA_NB8800 is not set +CONFIG_NET_VENDOR_BROADCOM=y +# CONFIG_B44 is not set +# CONFIG_BCMGENET is not set +# CONFIG_BNX2 is not set +# CONFIG_CNIC is not set +CONFIG_TIGON3=y +CONFIG_TIGON3_HWMON=y +# CONFIG_BNX2X is not set +# CONFIG_SYSTEMPORT is not set +# CONFIG_BNXT is not set +CONFIG_NET_VENDOR_BROCADE=y +# CONFIG_BNA is not set +CONFIG_NET_VENDOR_CADENCE=y +# CONFIG_MACB is not set +CONFIG_NET_VENDOR_CAVIUM=y +# CONFIG_THUNDER_NIC_PF is not set +# CONFIG_THUNDER_NIC_VF is not set +# CONFIG_THUNDER_NIC_BGX is not set +# CONFIG_THUNDER_NIC_RGX is not set +# CONFIG_CAVIUM_PTP is not set +# CONFIG_LIQUIDIO is not set +# CONFIG_LIQUIDIO_VF is not set +CONFIG_NET_VENDOR_CHELSIO=y +# CONFIG_CHELSIO_T1 is not set +# CONFIG_CHELSIO_T3 is not set +# CONFIG_CHELSIO_T4 is not set +# CONFIG_CHELSIO_T4VF is not set +CONFIG_NET_VENDOR_CISCO=y +# CONFIG_ENIC is not set +CONFIG_NET_VENDOR_CORTINA=y +# CONFIG_CX_ECAT is not set +# CONFIG_DNET is not set +CONFIG_NET_VENDOR_DEC=y +CONFIG_NET_TULIP=y +# CONFIG_DE2104X is not set +# CONFIG_TULIP is not set +# CONFIG_DE4X5 is not set +# CONFIG_WINBOND_840 is not set +# CONFIG_DM9102 is not set +# CONFIG_ULI526X is not set +# CONFIG_PCMCIA_XIRCOM is not set +CONFIG_NET_VENDOR_DLINK=y +# CONFIG_DL2K is not set +# CONFIG_SUNDANCE is not set +CONFIG_NET_VENDOR_EMULEX=y +# CONFIG_BE2NET is not set +CONFIG_NET_VENDOR_EZCHIP=y +CONFIG_NET_VENDOR_FUJITSU=y +# CONFIG_PCMCIA_FMVJ18X is not set +CONFIG_NET_VENDOR_GOOGLE=y +# CONFIG_GVE is not set +CONFIG_NET_VENDOR_HUAWEI=y +# CONFIG_HINIC is not set +CONFIG_NET_VENDOR_I825XX=y +CONFIG_NET_VENDOR_INTEL=y +CONFIG_E100=y +CONFIG_E1000=y +CONFIG_E1000E=y +CONFIG_E1000E_HWTS=y +# CONFIG_IGB is not set +# CONFIG_IGBVF is not set +# CONFIG_IXGB is not set +# CONFIG_IXGBE is not set +# CONFIG_IXGBEVF is not set +# CONFIG_I40E is not set +# CONFIG_I40EVF is not set +# CONFIG_ICE is not set +# CONFIG_FM10K is not set +# CONFIG_IGC is not set +# CONFIG_JME is not set +CONFIG_NET_VENDOR_MARVELL=y +# CONFIG_MVMDIO is not set +# CONFIG_SKGE is not set +CONFIG_SKY2=y +# CONFIG_SKY2_DEBUG is not set +CONFIG_NET_VENDOR_MELLANOX=y +# CONFIG_MLX4_EN is not set +# CONFIG_MLX5_CORE is not set +# CONFIG_MLXSW_CORE is not set +# CONFIG_MLXFW is not set +CONFIG_NET_VENDOR_MICREL=y +# CONFIG_KS8842 is not set +# CONFIG_KS8851_MLL is not set +# CONFIG_KSZ884X_PCI is not set +CONFIG_NET_VENDOR_MICROCHIP=y +# CONFIG_LAN743X is not set +CONFIG_NET_VENDOR_MICROSEMI=y +CONFIG_NET_VENDOR_MYRI=y +# CONFIG_MYRI10GE is not set +# CONFIG_FEALNX is not set +CONFIG_NET_VENDOR_NATSEMI=y +# CONFIG_NATSEMI is not set +# CONFIG_NS83820 is not set +CONFIG_NET_VENDOR_NETERION=y +# CONFIG_S2IO is not set +# CONFIG_VXGE is not set +CONFIG_NET_VENDOR_NETRONOME=y +# CONFIG_NFP is not set +CONFIG_NET_VENDOR_NI=y +# CONFIG_NI_XGE_MANAGEMENT_ENET is not set +CONFIG_NET_VENDOR_8390=y +# CONFIG_PCMCIA_AXNET is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_PCMCIA_PCNET is not set +CONFIG_NET_VENDOR_NVIDIA=y +CONFIG_FORCEDETH=y +CONFIG_NET_VENDOR_OKI=y +# CONFIG_ETHOC is not set +CONFIG_NET_VENDOR_PACKET_ENGINES=y +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +CONFIG_NET_VENDOR_PENSANDO=y +# CONFIG_IONIC is not set +CONFIG_NET_VENDOR_QLOGIC=y +# CONFIG_QLA3XXX is not set +# CONFIG_QLCNIC is not set +# CONFIG_NETXEN_NIC is not set +# CONFIG_QED is not set +CONFIG_NET_VENDOR_QUALCOMM=y +# CONFIG_QCOM_EMAC is not set +# CONFIG_RMNET is not set +CONFIG_NET_VENDOR_RDC=y +# CONFIG_R6040 is not set +CONFIG_NET_VENDOR_REALTEK=y +# CONFIG_8139CP is not set +CONFIG_8139TOO=y +CONFIG_8139TOO_PIO=y +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139TOO_8129 is not set +# CONFIG_8139_OLD_RX_RESET is not set +CONFIG_R8169=y +CONFIG_NET_VENDOR_RENESAS=y +CONFIG_NET_VENDOR_ROCKER=y +CONFIG_NET_VENDOR_SAMSUNG=y +# CONFIG_SXGBE_ETH is not set +CONFIG_NET_VENDOR_SEEQ=y +CONFIG_NET_VENDOR_SOLARFLARE=y +# CONFIG_SFC is not set +# CONFIG_SFC_FALCON is not set +CONFIG_NET_VENDOR_SILAN=y +# CONFIG_SC92031 is not set +CONFIG_NET_VENDOR_SIS=y +# CONFIG_SIS900 is not set +# CONFIG_SIS190 is not set +CONFIG_NET_VENDOR_SMSC=y +# CONFIG_PCMCIA_SMC91C92 is not set +# CONFIG_EPIC100 is not set +# CONFIG_SMSC911X is not set +# CONFIG_SMSC9420 is not set +CONFIG_NET_VENDOR_SOCIONEXT=y +CONFIG_NET_VENDOR_STMICRO=y +# CONFIG_STMMAC_ETH is not set +CONFIG_NET_VENDOR_SUN=y +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set +# CONFIG_CASSINI is not set +# CONFIG_NIU is not set +CONFIG_NET_VENDOR_SYNOPSYS=y +# CONFIG_DWC_XLGMAC is not set +CONFIG_NET_VENDOR_TEHUTI=y +# CONFIG_TEHUTI is not set +CONFIG_NET_VENDOR_TI=y +# CONFIG_TI_CPSW_PHY_SEL is not set +# CONFIG_TLAN is not set +CONFIG_NET_VENDOR_VIA=y +# CONFIG_VIA_RHINE is not set +# CONFIG_VIA_VELOCITY is not set +CONFIG_NET_VENDOR_WIZNET=y +# CONFIG_WIZNET_W5100 is not set +# CONFIG_WIZNET_W5300 is not set +CONFIG_NET_VENDOR_XILINX=y +# CONFIG_XILINX_AXI_EMAC is not set +# CONFIG_XILINX_LL_TEMAC is not set +CONFIG_NET_VENDOR_XIRCOM=y +# CONFIG_PCMCIA_XIRC2PS is not set +CONFIG_FDDI=y +# CONFIG_DEFXX is not set +# CONFIG_SKFP is not set +# CONFIG_HIPPI is not set +# CONFIG_NET_SB1000 is not set +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_BUS=y +# CONFIG_MDIO_BCM_UNIMAC is not set +# CONFIG_MDIO_BITBANG is not set +# CONFIG_MDIO_MSCC_MIIM is not set +# CONFIG_MDIO_THUNDER is not set +CONFIG_PHYLIB=y +# CONFIG_LED_TRIGGER_PHY is not set + +# +# MII PHY device drivers +# +# CONFIG_ADIN_PHY is not set +# CONFIG_AMD_PHY is not set +# CONFIG_AQUANTIA_PHY is not set +# CONFIG_AX88796B_PHY is not set +# CONFIG_BCM7XXX_PHY is not set +# CONFIG_BCM87XX_PHY is not set +# CONFIG_BROADCOM_PHY is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_CORTINA_PHY is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_DP83822_PHY is not set +# CONFIG_DP83TC811_PHY is not set +# CONFIG_DP83848_PHY is not set +# CONFIG_DP83867_PHY is not set +# CONFIG_DP83869_PHY is not set +# CONFIG_FIXED_PHY is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_INTEL_XWAY_PHY is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_LXT_PHY is not set +# CONFIG_MARVELL_PHY is not set +# CONFIG_MARVELL_10G_PHY is not set +# CONFIG_MICREL_PHY is not set +# CONFIG_MICROCHIP_PHY is not set +# CONFIG_MICROCHIP_T1_PHY is not set +# CONFIG_MICROSEMI_PHY is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_NXP_TJA11XX_PHY is not set +# CONFIG_QSEMI_PHY is not set +CONFIG_REALTEK_PHY=y +# CONFIG_RENESAS_PHY is not set +# CONFIG_ROCKCHIP_PHY is not set +# CONFIG_SMSC_PHY is not set +# CONFIG_STE10XP is not set +# CONFIG_TERANETICS_PHY is not set +# CONFIG_VITESSE_PHY is not set +# CONFIG_XILINX_GMII2RGMII is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +CONFIG_USB_NET_DRIVERS=y +# CONFIG_USB_CATC is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_RTL8152 is not set +# CONFIG_USB_LAN78XX is not set +# CONFIG_USB_USBNET is not set +# CONFIG_USB_HSO is not set +# CONFIG_USB_IPHETH is not set +CONFIG_WLAN=y +CONFIG_WLAN_VENDOR_ADMTEK=y +# CONFIG_ADM8211 is not set +CONFIG_WLAN_VENDOR_ATH=y +# CONFIG_ATH_DEBUG is not set +# CONFIG_ATH5K is not set +# CONFIG_ATH5K_PCI is not set +# CONFIG_ATH9K is not set +# CONFIG_ATH9K_HTC is not set +# CONFIG_CARL9170 is not set +# CONFIG_ATH6KL is not set +# CONFIG_AR5523 is not set +# CONFIG_WIL6210 is not set +# CONFIG_ATH10K is not set +# CONFIG_WCN36XX is not set +CONFIG_WLAN_VENDOR_ATMEL=y +# CONFIG_ATMEL is not set +# CONFIG_AT76C50X_USB is not set +CONFIG_WLAN_VENDOR_BROADCOM=y +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +# CONFIG_BRCMSMAC is not set +# CONFIG_BRCMFMAC is not set +CONFIG_WLAN_VENDOR_CISCO=y +# CONFIG_AIRO is not set +# CONFIG_AIRO_CS is not set +CONFIG_WLAN_VENDOR_INTEL=y +# CONFIG_IPW2100 is not set +# CONFIG_IPW2200 is not set +# CONFIG_IWL4965 is not set +# CONFIG_IWL3945 is not set +# CONFIG_IWLWIFI is not set +CONFIG_WLAN_VENDOR_INTERSIL=y +# CONFIG_HOSTAP is not set +# CONFIG_HERMES is not set +# CONFIG_P54_COMMON is not set +# CONFIG_PRISM54 is not set +CONFIG_WLAN_VENDOR_MARVELL=y +# CONFIG_LIBERTAS is not set +# CONFIG_LIBERTAS_THINFIRM is not set +# CONFIG_MWIFIEX is not set +# CONFIG_MWL8K is not set +CONFIG_WLAN_VENDOR_MEDIATEK=y +# CONFIG_MT7601U is not set +# CONFIG_MT76x0U is not set +# CONFIG_MT76x0E is not set +# CONFIG_MT76x2E is not set +# CONFIG_MT76x2U is not set +# CONFIG_MT7603E is not set +# CONFIG_MT7615E is not set +CONFIG_WLAN_VENDOR_RALINK=y +# CONFIG_RT2X00 is not set +CONFIG_WLAN_VENDOR_REALTEK=y +# CONFIG_RTL8180 is not set +# CONFIG_RTL8187 is not set +CONFIG_RTL_CARDS=y +# CONFIG_RTL8192CE is not set +# CONFIG_RTL8192SE is not set +# CONFIG_RTL8192DE is not set +# CONFIG_RTL8723AE is not set +# CONFIG_RTL8723BE is not set +# CONFIG_RTL8188EE is not set +# CONFIG_RTL8192EE is not set +# CONFIG_RTL8821AE is not set +# CONFIG_RTL8192CU is not set +# CONFIG_RTL8XXXU is not set +# CONFIG_RTW88 is not set +CONFIG_WLAN_VENDOR_RSI=y +# CONFIG_RSI_91X is not set +CONFIG_WLAN_VENDOR_ST=y +# CONFIG_CW1200 is not set +CONFIG_WLAN_VENDOR_TI=y +# CONFIG_WL1251 is not set +# CONFIG_WL12XX is not set +# CONFIG_WL18XX is not set +# CONFIG_WLCORE is not set +CONFIG_WLAN_VENDOR_ZYDAS=y +# CONFIG_USB_ZD1201 is not set +# CONFIG_ZD1211RW is not set +CONFIG_WLAN_VENDOR_QUANTENNA=y +# CONFIG_QTNFMAC_PCIE is not set +# CONFIG_PCMCIA_RAYCS is not set +# CONFIG_PCMCIA_WL3501 is not set +# CONFIG_MAC80211_HWSIM is not set +# CONFIG_USB_NET_RNDIS_WLAN is not set +# CONFIG_VIRT_WIFI is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_VMXNET3 is not set +# CONFIG_FUJITSU_ES is not set +# CONFIG_NETDEVSIM is not set +# CONFIG_NET_FAILOVER is not set +# CONFIG_ISDN is not set +# CONFIG_NVM is not set + +# +# Input device support +# +CONFIG_INPUT=y +CONFIG_INPUT_LEDS=y +CONFIG_INPUT_FF_MEMLESS=y +CONFIG_INPUT_POLLDEV=y +CONFIG_INPUT_SPARSEKMAP=y +# CONFIG_INPUT_MATRIXKMAP is not set + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ADP5588 is not set +# CONFIG_KEYBOARD_ADP5589 is not set +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_QT1050 is not set +# CONFIG_KEYBOARD_QT1070 is not set +# CONFIG_KEYBOARD_QT2160 is not set +# CONFIG_KEYBOARD_DLINK_DIR685 is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_TCA6416 is not set +# CONFIG_KEYBOARD_TCA8418 is not set +# CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_LM8333 is not set +# CONFIG_KEYBOARD_MAX7359 is not set +# CONFIG_KEYBOARD_MCS is not set +# CONFIG_KEYBOARD_MPR121 is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_OPENCORES is not set +# CONFIG_KEYBOARD_SAMSUNG is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_TM2_TOUCHKEY is not set +# CONFIG_KEYBOARD_XTKBD is not set +CONFIG_INPUT_MOUSE=y +CONFIG_MOUSE_PS2=y +CONFIG_MOUSE_PS2_ALPS=y +CONFIG_MOUSE_PS2_BYD=y +CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y +CONFIG_MOUSE_PS2_CYPRESS=y +CONFIG_MOUSE_PS2_LIFEBOOK=y +CONFIG_MOUSE_PS2_TRACKPOINT=y +# CONFIG_MOUSE_PS2_ELANTECH is not set +# CONFIG_MOUSE_PS2_SENTELIC is not set +# CONFIG_MOUSE_PS2_TOUCHKIT is not set +CONFIG_MOUSE_PS2_FOCALTECH=y +CONFIG_MOUSE_PS2_SMBUS=y +# CONFIG_MOUSE_SERIAL is not set +# CONFIG_MOUSE_APPLETOUCH is not set +# CONFIG_MOUSE_BCM5974 is not set +# CONFIG_MOUSE_CYAPA is not set +# CONFIG_MOUSE_ELAN_I2C is not set +# CONFIG_MOUSE_VSXXXAA is not set +# CONFIG_MOUSE_SYNAPTICS_I2C is not set +# CONFIG_MOUSE_SYNAPTICS_USB is not set +CONFIG_INPUT_JOYSTICK=y +# CONFIG_JOYSTICK_ANALOG is not set +# CONFIG_JOYSTICK_A3D is not set +# CONFIG_JOYSTICK_ADI is not set +# CONFIG_JOYSTICK_COBRA is not set +# CONFIG_JOYSTICK_GF2K is not set +# CONFIG_JOYSTICK_GRIP is not set +# CONFIG_JOYSTICK_GRIP_MP is not set +# CONFIG_JOYSTICK_GUILLEMOT is not set +# CONFIG_JOYSTICK_INTERACT is not set +# CONFIG_JOYSTICK_SIDEWINDER is not set +# CONFIG_JOYSTICK_TMDC is not set +# CONFIG_JOYSTICK_IFORCE is not set +# CONFIG_JOYSTICK_WARRIOR is not set +# CONFIG_JOYSTICK_MAGELLAN is not set +# CONFIG_JOYSTICK_SPACEORB is not set +# CONFIG_JOYSTICK_SPACEBALL is not set +# CONFIG_JOYSTICK_STINGER is not set +# CONFIG_JOYSTICK_TWIDJOY is not set +# CONFIG_JOYSTICK_ZHENHUA is not set +# CONFIG_JOYSTICK_AS5011 is not set +# CONFIG_JOYSTICK_JOYDUMP is not set +# CONFIG_JOYSTICK_XPAD is not set +# CONFIG_JOYSTICK_PXRC is not set +# CONFIG_JOYSTICK_FSIA6B is not set +CONFIG_INPUT_TABLET=y +# CONFIG_TABLET_USB_ACECAD is not set +# CONFIG_TABLET_USB_AIPTEK is not set +# CONFIG_TABLET_USB_GTCO is not set +# CONFIG_TABLET_USB_HANWANG is not set +# CONFIG_TABLET_USB_KBTAB is not set +# CONFIG_TABLET_USB_PEGASUS is not set +# CONFIG_TABLET_SERIAL_WACOM4 is not set +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_PROPERTIES=y +# CONFIG_TOUCHSCREEN_AD7879 is not set +# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set +# CONFIG_TOUCHSCREEN_BU21013 is not set +# CONFIG_TOUCHSCREEN_BU21029 is not set +# CONFIG_TOUCHSCREEN_CHIPONE_ICN8505 is not set +# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set +# CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set +# CONFIG_TOUCHSCREEN_DYNAPRO is not set +# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set +# CONFIG_TOUCHSCREEN_EETI is not set +# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set +# CONFIG_TOUCHSCREEN_EXC3000 is not set +# CONFIG_TOUCHSCREEN_FUJITSU is not set +# CONFIG_TOUCHSCREEN_HIDEEP is not set +# CONFIG_TOUCHSCREEN_ILI210X is not set +# CONFIG_TOUCHSCREEN_S6SY761 is not set +# CONFIG_TOUCHSCREEN_GUNZE is not set +# CONFIG_TOUCHSCREEN_EKTF2127 is not set +# CONFIG_TOUCHSCREEN_ELAN is not set +# CONFIG_TOUCHSCREEN_ELO is not set +# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set +# CONFIG_TOUCHSCREEN_WACOM_I2C is not set +# CONFIG_TOUCHSCREEN_MAX11801 is not set +# CONFIG_TOUCHSCREEN_MCS5000 is not set +# CONFIG_TOUCHSCREEN_MMS114 is not set +# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set +# CONFIG_TOUCHSCREEN_MTOUCH is not set +# CONFIG_TOUCHSCREEN_INEXIO is not set +# CONFIG_TOUCHSCREEN_MK712 is not set +# CONFIG_TOUCHSCREEN_PENMOUNT is not set +# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set +# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set +# CONFIG_TOUCHSCREEN_TOUCHWIN is not set +# CONFIG_TOUCHSCREEN_PIXCIR is not set +# CONFIG_TOUCHSCREEN_WDT87XX_I2C is not set +# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set +# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set +# CONFIG_TOUCHSCREEN_TSC_SERIO is not set +# CONFIG_TOUCHSCREEN_TSC2004 is not set +# CONFIG_TOUCHSCREEN_TSC2007 is not set +# CONFIG_TOUCHSCREEN_SILEAD is not set +# CONFIG_TOUCHSCREEN_ST1232 is not set +# CONFIG_TOUCHSCREEN_STMFTS is not set +# CONFIG_TOUCHSCREEN_SX8654 is not set +# CONFIG_TOUCHSCREEN_TPS6507X is not set +# CONFIG_TOUCHSCREEN_ZET6223 is not set +# CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set +# CONFIG_TOUCHSCREEN_IQS5XX is not set +CONFIG_INPUT_MISC=y +# CONFIG_INPUT_AD714X is not set +# CONFIG_INPUT_BMA150 is not set +# CONFIG_INPUT_E3X0_BUTTON is not set +# CONFIG_INPUT_MSM_VIBRATOR is not set +# CONFIG_INPUT_PCSPKR is not set +# CONFIG_INPUT_MMA8450 is not set +# CONFIG_INPUT_APANEL is not set +# CONFIG_INPUT_ATLAS_BTNS is not set +# CONFIG_INPUT_ATI_REMOTE2 is not set +# CONFIG_INPUT_KEYSPAN_REMOTE is not set +# CONFIG_INPUT_KXTJ9 is not set +# CONFIG_INPUT_POWERMATE is not set +# CONFIG_INPUT_YEALINK is not set +# CONFIG_INPUT_CM109 is not set +# CONFIG_INPUT_UINPUT is not set +# CONFIG_INPUT_PCF8574 is not set +# CONFIG_INPUT_ADXL34X is not set +# CONFIG_INPUT_IMS_PCU is not set +# CONFIG_INPUT_CMA3000 is not set +# CONFIG_INPUT_IDEAPAD_SLIDEBAR is not set +# CONFIG_INPUT_DRV2665_HAPTICS is not set +# CONFIG_INPUT_DRV2667_HAPTICS is not set +# CONFIG_RMI4_CORE is not set + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_SERPORT=y +# CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_PCIPS2 is not set +CONFIG_SERIO_LIBPS2=y +# CONFIG_SERIO_RAW is not set +# CONFIG_SERIO_ALTERA_PS2 is not set +# CONFIG_SERIO_PS2MULT is not set +# CONFIG_SERIO_ARC_PS2 is not set +# CONFIG_USERIO is not set +# CONFIG_GAMEPORT is not set +# end of Hardware I/O ports +# end of Input device support + +# +# Character devices +# +CONFIG_TTY=y +CONFIG_VT=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_CONSOLE_SLEEP=y +CONFIG_HW_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_UNIX98_PTYS=y +# CONFIG_LEGACY_PTYS is not set +CONFIG_SERIAL_NONSTANDARD=y +# CONFIG_ROCKETPORT is not set +# CONFIG_CYCLADES is not set +# CONFIG_MOXA_INTELLIO is not set +# CONFIG_MOXA_SMARTIO is not set +# CONFIG_SYNCLINK is not set +# CONFIG_SYNCLINKMP is not set +# CONFIG_SYNCLINK_GT is not set +# CONFIG_NOZOMI is not set +# CONFIG_ISI is not set +# CONFIG_N_HDLC is not set +# CONFIG_N_GSM is not set +# CONFIG_TRACE_SINK is not set +# CONFIG_NULL_TTY is not set +CONFIG_LDISC_AUTOLOAD=y +CONFIG_DEVMEM=y +# CONFIG_DEVKMEM is not set + +# +# Serial drivers +# +CONFIG_SERIAL_EARLYCON=y +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y +CONFIG_SERIAL_8250_PNP=y +# CONFIG_SERIAL_8250_FINTEK is not set +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_DMA=y +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_EXAR=y +# CONFIG_SERIAL_8250_CS is not set +CONFIG_SERIAL_8250_NR_UARTS=32 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_8250_DETECT_IRQ=y +CONFIG_SERIAL_8250_RSA=y +CONFIG_SERIAL_8250_DWLIB=y +# CONFIG_SERIAL_8250_DW is not set +# CONFIG_SERIAL_8250_RT288X is not set +CONFIG_SERIAL_8250_LPSS=y +CONFIG_SERIAL_8250_MID=y + +# +# Non-8250 serial port support +# +# CONFIG_SERIAL_UARTLITE is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_SCCNXP is not set +# CONFIG_SERIAL_SC16IS7XX is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_ARC is not set +# CONFIG_SERIAL_RP2 is not set +# CONFIG_SERIAL_FSL_LPUART is not set +# CONFIG_SERIAL_FSL_LINFLEXUART is not set +# end of Serial drivers + +# CONFIG_SERIAL_DEV_BUS is not set +# CONFIG_IPMI_HANDLER is not set +CONFIG_HW_RANDOM=y +# CONFIG_HW_RANDOM_TIMERIOMEM is not set +# CONFIG_HW_RANDOM_INTEL is not set +# CONFIG_HW_RANDOM_AMD is not set +CONFIG_HW_RANDOM_VIA=y +CONFIG_NVRAM=y +# CONFIG_APPLICOM is not set + +# +# PCMCIA character devices +# +# CONFIG_SYNCLINK_CS is not set +# CONFIG_CARDMAN_4000 is not set +# CONFIG_CARDMAN_4040 is not set +# CONFIG_SCR24X is not set +# CONFIG_IPWIRELESS is not set +# end of PCMCIA character devices + +# CONFIG_MWAVE is not set +# CONFIG_RAW_DRIVER is not set +CONFIG_HPET=y +# CONFIG_HPET_MMAP is not set +# CONFIG_HANGCHECK_TIMER is not set +# CONFIG_TCG_TPM is not set +# CONFIG_TELCLOCK is not set +CONFIG_DEVPORT=y +# CONFIG_XILLYBUS is not set +# end of Character devices + +# CONFIG_RANDOM_TRUST_CPU is not set +# CONFIG_RANDOM_TRUST_BOOTLOADER is not set + +# +# I2C support +# +CONFIG_I2C=y +CONFIG_ACPI_I2C_OPREGION=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_COMPAT=y +# CONFIG_I2C_CHARDEV is not set +# CONFIG_I2C_MUX is not set +CONFIG_I2C_HELPER_AUTO=y +CONFIG_I2C_SMBUS=y +CONFIG_I2C_ALGOBIT=y + +# +# I2C Hardware Bus support +# + +# +# PC SMBus host controller drivers +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_AMD_MP2 is not set +CONFIG_I2C_I801=y +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_ISMT is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_NVIDIA_GPU is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set + +# +# ACPI drivers +# +# CONFIG_I2C_SCMI is not set + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_DESIGNWARE_PLATFORM is not set +# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_EMEV2 is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_XILINX is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_ROBOTFUZZ_OSIF is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_TINY_USB is not set + +# +# Other I2C/SMBus bus drivers +# +# CONFIG_I2C_MLXCPLD is not set +# end of I2C Hardware Bus support + +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_SLAVE is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# end of I2C support + +# CONFIG_I3C is not set +# CONFIG_SPI is not set +# CONFIG_SPMI is not set +# CONFIG_HSI is not set +CONFIG_PPS=y +# CONFIG_PPS_DEBUG is not set + +# +# PPS clients support +# +# CONFIG_PPS_CLIENT_KTIMER is not set +# CONFIG_PPS_CLIENT_LDISC is not set +# CONFIG_PPS_CLIENT_GPIO is not set + +# +# PPS generators support +# + +# +# PTP clock support +# +CONFIG_PTP_1588_CLOCK=y + +# +# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. +# +# CONFIG_PTP_1588_CLOCK_IDTCM is not set +# end of PTP clock support + +# CONFIG_PINCTRL is not set +# CONFIG_GPIOLIB is not set +# CONFIG_W1 is not set +# CONFIG_POWER_AVS is not set +# CONFIG_POWER_RESET is not set +CONFIG_POWER_SUPPLY=y +# CONFIG_POWER_SUPPLY_DEBUG is not set +CONFIG_POWER_SUPPLY_HWMON=y +# CONFIG_PDA_POWER is not set +# CONFIG_TEST_POWER is not set +# CONFIG_CHARGER_ADP5061 is not set +# CONFIG_BATTERY_DS2780 is not set +# CONFIG_BATTERY_DS2781 is not set +# CONFIG_BATTERY_DS2782 is not set +# CONFIG_BATTERY_SBS is not set +# CONFIG_CHARGER_SBS is not set +# CONFIG_BATTERY_BQ27XXX is not set +# CONFIG_BATTERY_MAX17040 is not set +# CONFIG_BATTERY_MAX17042 is not set +# CONFIG_CHARGER_MAX8903 is not set +# CONFIG_CHARGER_LP8727 is not set +# CONFIG_CHARGER_BQ2415X is not set +# CONFIG_CHARGER_SMB347 is not set +# CONFIG_BATTERY_GAUGE_LTC2941 is not set +CONFIG_HWMON=y +# CONFIG_HWMON_DEBUG_CHIP is not set + +# +# Native drivers +# +# CONFIG_SENSORS_ABITUGURU is not set +# CONFIG_SENSORS_ABITUGURU3 is not set +# CONFIG_SENSORS_AD7414 is not set +# CONFIG_SENSORS_AD7418 is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1029 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ADM9240 is not set +# CONFIG_SENSORS_ADT7410 is not set +# CONFIG_SENSORS_ADT7411 is not set +# CONFIG_SENSORS_ADT7462 is not set +# CONFIG_SENSORS_ADT7470 is not set +# CONFIG_SENSORS_ADT7475 is not set +# CONFIG_SENSORS_AS370 is not set +# CONFIG_SENSORS_ASC7621 is not set +# CONFIG_SENSORS_K8TEMP is not set +# CONFIG_SENSORS_K10TEMP is not set +# CONFIG_SENSORS_FAM15H_POWER is not set +# CONFIG_SENSORS_APPLESMC is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_ASPEED is not set +# CONFIG_SENSORS_ATXP1 is not set +# CONFIG_SENSORS_DS620 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_DELL_SMM is not set +# CONFIG_SENSORS_I5K_AMB is not set +# CONFIG_SENSORS_F71805F is not set +# CONFIG_SENSORS_F71882FG is not set +# CONFIG_SENSORS_F75375S is not set +# CONFIG_SENSORS_FSCHMD is not set +# CONFIG_SENSORS_FTSTEUTATES is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_GL520SM is not set +# CONFIG_SENSORS_G760A is not set +# CONFIG_SENSORS_G762 is not set +# CONFIG_SENSORS_HIH6130 is not set +# CONFIG_SENSORS_I5500 is not set +# CONFIG_SENSORS_CORETEMP is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_JC42 is not set +# CONFIG_SENSORS_POWR1220 is not set +# CONFIG_SENSORS_LINEAGE is not set +# CONFIG_SENSORS_LTC2945 is not set +# CONFIG_SENSORS_LTC2947_I2C is not set +# CONFIG_SENSORS_LTC2990 is not set +# CONFIG_SENSORS_LTC4151 is not set +# CONFIG_SENSORS_LTC4215 is not set +# CONFIG_SENSORS_LTC4222 is not set +# CONFIG_SENSORS_LTC4245 is not set +# CONFIG_SENSORS_LTC4260 is not set +# CONFIG_SENSORS_LTC4261 is not set +# CONFIG_SENSORS_MAX16065 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_MAX1668 is not set +# CONFIG_SENSORS_MAX197 is not set +# CONFIG_SENSORS_MAX6621 is not set +# CONFIG_SENSORS_MAX6639 is not set +# CONFIG_SENSORS_MAX6642 is not set +# CONFIG_SENSORS_MAX6650 is not set +# CONFIG_SENSORS_MAX6697 is not set +# CONFIG_SENSORS_MAX31790 is not set +# CONFIG_SENSORS_MCP3021 is not set +# CONFIG_SENSORS_TC654 is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM73 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_LM92 is not set +# CONFIG_SENSORS_LM93 is not set +# CONFIG_SENSORS_LM95234 is not set +# CONFIG_SENSORS_LM95241 is not set +# CONFIG_SENSORS_LM95245 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_PC87427 is not set +# CONFIG_SENSORS_NTC_THERMISTOR is not set +# CONFIG_SENSORS_NCT6683 is not set +# CONFIG_SENSORS_NCT6775 is not set +# CONFIG_SENSORS_NCT7802 is not set +# CONFIG_SENSORS_NCT7904 is not set +# CONFIG_SENSORS_NPCM7XX is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_PMBUS is not set +# CONFIG_SENSORS_SHT21 is not set +# CONFIG_SENSORS_SHT3x is not set +# CONFIG_SENSORS_SHTC1 is not set +# CONFIG_SENSORS_SIS5595 is not set +# CONFIG_SENSORS_DME1737 is not set +# CONFIG_SENSORS_EMC1403 is not set +# CONFIG_SENSORS_EMC2103 is not set +# CONFIG_SENSORS_EMC6W201 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_SMSC47M192 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_SCH5627 is not set +# CONFIG_SENSORS_SCH5636 is not set +# CONFIG_SENSORS_STTS751 is not set +# CONFIG_SENSORS_SMM665 is not set +# CONFIG_SENSORS_ADC128D818 is not set +# CONFIG_SENSORS_ADS7828 is not set +# CONFIG_SENSORS_AMC6821 is not set +# CONFIG_SENSORS_INA209 is not set +# CONFIG_SENSORS_INA2XX is not set +# CONFIG_SENSORS_INA3221 is not set +# CONFIG_SENSORS_TC74 is not set +# CONFIG_SENSORS_THMC50 is not set +# CONFIG_SENSORS_TMP102 is not set +# CONFIG_SENSORS_TMP103 is not set +# CONFIG_SENSORS_TMP108 is not set +# CONFIG_SENSORS_TMP401 is not set +# CONFIG_SENSORS_TMP421 is not set +# CONFIG_SENSORS_TMP513 is not set +# CONFIG_SENSORS_VIA_CPUTEMP is not set +# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_VT1211 is not set +# CONFIG_SENSORS_VT8231 is not set +# CONFIG_SENSORS_W83773G is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83791D is not set +# CONFIG_SENSORS_W83792D is not set +# CONFIG_SENSORS_W83793 is not set +# CONFIG_SENSORS_W83795 is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83L786NG is not set +# CONFIG_SENSORS_W83627HF is not set +# CONFIG_SENSORS_W83627EHF is not set +# CONFIG_SENSORS_XGENE is not set + +# +# ACPI drivers +# +# CONFIG_SENSORS_ACPI_POWER is not set +# CONFIG_SENSORS_ATK0110 is not set +CONFIG_THERMAL=y +# CONFIG_THERMAL_STATISTICS is not set +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_WRITABLE_TRIPS=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set +# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set +# CONFIG_THERMAL_GOV_FAIR_SHARE is not set +CONFIG_THERMAL_GOV_STEP_WISE=y +# CONFIG_THERMAL_GOV_BANG_BANG is not set +CONFIG_THERMAL_GOV_USER_SPACE=y +# CONFIG_THERMAL_EMULATION is not set + +# +# Intel thermal drivers +# +# CONFIG_INTEL_POWERCLAMP is not set +CONFIG_X86_PKG_TEMP_THERMAL=m +# CONFIG_INTEL_SOC_DTS_THERMAL is not set + +# +# ACPI INT340X thermal drivers +# +# CONFIG_INT340X_THERMAL is not set +# end of ACPI INT340X thermal drivers + +# CONFIG_INTEL_PCH_THERMAL is not set +# end of Intel thermal drivers + +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_CORE is not set +# CONFIG_WATCHDOG_NOWAYOUT is not set +CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y +CONFIG_WATCHDOG_OPEN_TIMEOUT=0 +# CONFIG_WATCHDOG_SYSFS is not set + +# +# Watchdog Pretimeout Governors +# + +# +# Watchdog Device Drivers +# +# CONFIG_SOFT_WATCHDOG is not set +# CONFIG_WDAT_WDT is not set +# CONFIG_XILINX_WATCHDOG is not set +# CONFIG_ZIIRAVE_WATCHDOG is not set +# CONFIG_CADENCE_WATCHDOG is not set +# CONFIG_DW_WATCHDOG is not set +# CONFIG_MAX63XX_WATCHDOG is not set +# CONFIG_ACQUIRE_WDT is not set +# CONFIG_ADVANTECH_WDT is not set +# CONFIG_ALIM1535_WDT is not set +# CONFIG_ALIM7101_WDT is not set +# CONFIG_EBC_C384_WDT is not set +# CONFIG_F71808E_WDT is not set +# CONFIG_SP5100_TCO is not set +# CONFIG_SBC_FITPC2_WATCHDOG is not set +# CONFIG_EUROTECH_WDT is not set +# CONFIG_IB700_WDT is not set +# CONFIG_IBMASR is not set +# CONFIG_WAFER_WDT is not set +# CONFIG_I6300ESB_WDT is not set +# CONFIG_IE6XX_WDT is not set +# CONFIG_ITCO_WDT is not set +# CONFIG_IT8712F_WDT is not set +# CONFIG_IT87_WDT is not set +# CONFIG_HP_WATCHDOG is not set +# CONFIG_SC1200_WDT is not set +# CONFIG_PC87413_WDT is not set +# CONFIG_NV_TCO is not set +# CONFIG_60XX_WDT is not set +# CONFIG_CPU5_WDT is not set +# CONFIG_SMSC_SCH311X_WDT is not set +# CONFIG_SMSC37B787_WDT is not set +# CONFIG_TQMX86_WDT is not set +# CONFIG_VIA_WDT is not set +# CONFIG_W83627HF_WDT is not set +# CONFIG_W83877F_WDT is not set +# CONFIG_W83977F_WDT is not set +# CONFIG_MACHZ_WDT is not set +# CONFIG_SBC_EPX_C3_WATCHDOG is not set +# CONFIG_NI903X_WDT is not set +# CONFIG_NIC7018_WDT is not set + +# +# PCI-based Watchdog Cards +# +# CONFIG_PCIPCWATCHDOG is not set +# CONFIG_WDTPCI is not set + +# +# USB-based Watchdog Cards +# +# CONFIG_USBPCWATCHDOG is not set +CONFIG_SSB_POSSIBLE=y +# CONFIG_SSB is not set +CONFIG_BCMA_POSSIBLE=y +# CONFIG_BCMA is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_AS3711 is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_MFD_BCM590XX is not set +# CONFIG_MFD_BD9571MWV is not set +# CONFIG_MFD_AXP20X_I2C is not set +# CONFIG_MFD_MADERA is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_MFD_DA9052_I2C is not set +# CONFIG_MFD_DA9055 is not set +# CONFIG_MFD_DA9062 is not set +# CONFIG_MFD_DA9063 is not set +# CONFIG_MFD_DA9150 is not set +# CONFIG_MFD_DLN2 is not set +# CONFIG_MFD_MC13XXX_I2C is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set +# CONFIG_LPC_ICH is not set +# CONFIG_LPC_SCH is not set +# CONFIG_MFD_INTEL_LPSS_ACPI is not set +# CONFIG_MFD_INTEL_LPSS_PCI is not set +# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_KEMPLD is not set +# CONFIG_MFD_88PM800 is not set +# CONFIG_MFD_88PM805 is not set +# CONFIG_MFD_88PM860X is not set +# CONFIG_MFD_MAX14577 is not set +# CONFIG_MFD_MAX77693 is not set +# CONFIG_MFD_MAX77843 is not set +# CONFIG_MFD_MAX8907 is not set +# CONFIG_MFD_MAX8925 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX8998 is not set +# CONFIG_MFD_MT6397 is not set +# CONFIG_MFD_MENF21BMC is not set +# CONFIG_MFD_VIPERBOARD is not set +# CONFIG_MFD_RETU is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_RT5033 is not set +# CONFIG_MFD_RC5T583 is not set +# CONFIG_MFD_SEC_CORE is not set +# CONFIG_MFD_SI476X_CORE is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_MFD_SKY81452 is not set +# CONFIG_MFD_SMSC is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_MFD_SYSCON is not set +# CONFIG_MFD_TI_AM335X_TSCADC is not set +# CONFIG_MFD_LP3943 is not set +# CONFIG_MFD_LP8788 is not set +# CONFIG_MFD_TI_LMU is not set +# CONFIG_MFD_PALMAS is not set +# CONFIG_TPS6105X is not set +# CONFIG_TPS6507X is not set +# CONFIG_MFD_TPS65086 is not set +# CONFIG_MFD_TPS65090 is not set +# CONFIG_MFD_TI_LP873X is not set +# CONFIG_MFD_TPS6586X is not set +# CONFIG_MFD_TPS65912_I2C is not set +# CONFIG_MFD_TPS80031 is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_TWL6040_CORE is not set +# CONFIG_MFD_WL1273_CORE is not set +# CONFIG_MFD_LM3533 is not set +# CONFIG_MFD_TQMX86 is not set +# CONFIG_MFD_VX855 is not set +# CONFIG_MFD_ARIZONA_I2C is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM831X_I2C is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_WM8994 is not set +# end of Multifunction device drivers + +# CONFIG_REGULATOR is not set +# CONFIG_RC_CORE is not set +# CONFIG_MEDIA_SUPPORT is not set + +# +# Graphics support +# +CONFIG_AGP=y +CONFIG_AGP_AMD64=y +CONFIG_AGP_INTEL=y +# CONFIG_AGP_SIS is not set +# CONFIG_AGP_VIA is not set +CONFIG_INTEL_GTT=y +CONFIG_VGA_ARB=y +CONFIG_VGA_ARB_MAX_GPUS=16 +# CONFIG_VGA_SWITCHEROO is not set +CONFIG_DRM=y +CONFIG_DRM_MIPI_DSI=y +# CONFIG_DRM_DP_AUX_CHARDEV is not set +# CONFIG_DRM_DEBUG_MM is not set +# CONFIG_DRM_DEBUG_SELFTEST is not set +CONFIG_DRM_KMS_HELPER=y +CONFIG_DRM_KMS_FB_HELPER=y +CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 +# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set +# CONFIG_DRM_DP_CEC is not set + +# +# I2C encoder or helper chips +# +# CONFIG_DRM_I2C_CH7006 is not set +# CONFIG_DRM_I2C_SIL164 is not set +# CONFIG_DRM_I2C_NXP_TDA998X is not set +# CONFIG_DRM_I2C_NXP_TDA9950 is not set +# end of I2C encoder or helper chips + +# +# ARM devices +# +# end of ARM devices + +# CONFIG_DRM_RADEON is not set +# CONFIG_DRM_AMDGPU is not set + +# +# ACP (Audio CoProcessor) Configuration +# +# end of ACP (Audio CoProcessor) Configuration + +# CONFIG_DRM_NOUVEAU is not set +CONFIG_DRM_I915=y +# CONFIG_DRM_I915_ALPHA_SUPPORT is not set +CONFIG_DRM_I915_FORCE_PROBE="" +CONFIG_DRM_I915_CAPTURE_ERROR=y +CONFIG_DRM_I915_COMPRESS_ERROR=y +CONFIG_DRM_I915_USERPTR=y +# CONFIG_DRM_I915_GVT is not set +CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250 +CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500 +CONFIG_DRM_I915_PREEMPT_TIMEOUT=640 +CONFIG_DRM_I915_SPIN_REQUEST=5 +CONFIG_DRM_I915_STOP_TIMEOUT=100 +CONFIG_DRM_I915_TIMESLICE_DURATION=1 +# CONFIG_DRM_VGEM is not set +# CONFIG_DRM_VKMS is not set +# CONFIG_DRM_VMWGFX is not set +# CONFIG_DRM_GMA500 is not set +# CONFIG_DRM_UDL is not set +# CONFIG_DRM_AST is not set +# CONFIG_DRM_MGAG200 is not set +# CONFIG_DRM_CIRRUS_QEMU is not set +# CONFIG_DRM_QXL is not set +# CONFIG_DRM_BOCHS is not set +CONFIG_DRM_PANEL=y + +# +# Display Panels +# +# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set +# end of Display Panels + +CONFIG_DRM_BRIDGE=y +CONFIG_DRM_PANEL_BRIDGE=y + +# +# Display Interface Bridges +# +# CONFIG_DRM_ANALOGIX_ANX78XX is not set +# end of Display Interface Bridges + +# CONFIG_DRM_ETNAVIV is not set +# CONFIG_DRM_GM12U320 is not set +# CONFIG_DRM_VBOXVIDEO is not set +# CONFIG_DRM_LEGACY is not set +CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y + +# +# Frame buffer Devices +# +CONFIG_FB_CMDLINE=y +CONFIG_FB_NOTIFY=y +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_IMAGEBLIT=y +# CONFIG_FB_FOREIGN_ENDIAN is not set +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y + +# +# Frame buffer hardware drivers +# +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_ARC is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_VGA16 is not set +# CONFIG_FB_UVESA is not set +# CONFIG_FB_VESA is not set +CONFIG_FB_EFI=y +# CONFIG_FB_N411 is not set +# CONFIG_FB_HGA is not set +# CONFIG_FB_OPENCORES is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_I740 is not set +# CONFIG_FB_LE80578 is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_NEOMAGIC is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_CARMINE is not set +# CONFIG_FB_SMSCUFX is not set +# CONFIG_FB_UDL is not set +# CONFIG_FB_IBM_GXT4500 is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_SIMPLE is not set +# CONFIG_FB_SM712 is not set +# end of Frame buffer Devices + +# +# Backlight & LCD device support +# +# CONFIG_LCD_CLASS_DEVICE is not set +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_GENERIC=y +# CONFIG_BACKLIGHT_APPLE is not set +# CONFIG_BACKLIGHT_QCOM_WLED is not set +# CONFIG_BACKLIGHT_SAHARA is not set +# CONFIG_BACKLIGHT_ADP8860 is not set +# CONFIG_BACKLIGHT_ADP8870 is not set +# CONFIG_BACKLIGHT_LM3639 is not set +# CONFIG_BACKLIGHT_LV5207LP is not set +# CONFIG_BACKLIGHT_BD6107 is not set +# CONFIG_BACKLIGHT_ARCXCNN is not set +# end of Backlight & LCD device support + +CONFIG_HDMI=y + +# +# Console display driver support +# +CONFIG_VGA_CONSOLE=y +CONFIG_VGACON_SOFT_SCROLLBACK=y +CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 +# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_DUMMY_CONSOLE_COLUMNS=80 +CONFIG_DUMMY_CONSOLE_ROWS=25 +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER is not set +# end of Console display driver support + +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LOGO_LINUX_CLUT224=y +# end of Graphics support + +CONFIG_SOUND=y +CONFIG_SND=y +CONFIG_SND_TIMER=y +CONFIG_SND_PCM=y +CONFIG_SND_HWDEP=y +CONFIG_SND_SEQ_DEVICE=y +CONFIG_SND_JACK=y +CONFIG_SND_JACK_INPUT_DEV=y +# CONFIG_SND_OSSEMUL is not set +CONFIG_SND_PCM_TIMER=y +CONFIG_SND_HRTIMER=y +# CONFIG_SND_DYNAMIC_MINORS is not set +CONFIG_SND_SUPPORT_OLD_API=y +CONFIG_SND_PROC_FS=y +CONFIG_SND_VERBOSE_PROCFS=y +# CONFIG_SND_VERBOSE_PRINTK is not set +# CONFIG_SND_DEBUG is not set +CONFIG_SND_VMASTER=y +CONFIG_SND_DMA_SGBUF=y +CONFIG_SND_SEQUENCER=y +CONFIG_SND_SEQ_DUMMY=y +CONFIG_SND_SEQ_HRTIMER_DEFAULT=y +CONFIG_SND_DRIVERS=y +# CONFIG_SND_PCSP is not set +# CONFIG_SND_DUMMY is not set +# CONFIG_SND_ALOOP is not set +# CONFIG_SND_VIRMIDI is not set +# CONFIG_SND_MTPAV is not set +# CONFIG_SND_SERIAL_U16550 is not set +# CONFIG_SND_MPU401 is not set +CONFIG_SND_PCI=y +# CONFIG_SND_AD1889 is not set +# CONFIG_SND_ALS300 is not set +# CONFIG_SND_ALS4000 is not set +# CONFIG_SND_ALI5451 is not set +# CONFIG_SND_ASIHPI is not set +# CONFIG_SND_ATIIXP is not set +# CONFIG_SND_ATIIXP_MODEM is not set +# CONFIG_SND_AU8810 is not set +# CONFIG_SND_AU8820 is not set +# CONFIG_SND_AU8830 is not set +# CONFIG_SND_AW2 is not set +# CONFIG_SND_AZT3328 is not set +# CONFIG_SND_BT87X is not set +# CONFIG_SND_CA0106 is not set +# CONFIG_SND_CMIPCI is not set +# CONFIG_SND_OXYGEN is not set +# CONFIG_SND_CS4281 is not set +# CONFIG_SND_CS46XX is not set +# CONFIG_SND_CTXFI is not set +# CONFIG_SND_DARLA20 is not set +# CONFIG_SND_GINA20 is not set +# CONFIG_SND_LAYLA20 is not set +# CONFIG_SND_DARLA24 is not set +# CONFIG_SND_GINA24 is not set +# CONFIG_SND_LAYLA24 is not set +# CONFIG_SND_MONA is not set +# CONFIG_SND_MIA is not set +# CONFIG_SND_ECHO3G is not set +# CONFIG_SND_INDIGO is not set +# CONFIG_SND_INDIGOIO is not set +# CONFIG_SND_INDIGODJ is not set +# CONFIG_SND_INDIGOIOX is not set +# CONFIG_SND_INDIGODJX is not set +# CONFIG_SND_EMU10K1 is not set +# CONFIG_SND_EMU10K1X is not set +# CONFIG_SND_ENS1370 is not set +# CONFIG_SND_ENS1371 is not set +# CONFIG_SND_ES1938 is not set +# CONFIG_SND_ES1968 is not set +# CONFIG_SND_FM801 is not set +# CONFIG_SND_HDSP is not set +# CONFIG_SND_HDSPM is not set +# CONFIG_SND_ICE1712 is not set +# CONFIG_SND_ICE1724 is not set +# CONFIG_SND_INTEL8X0 is not set +# CONFIG_SND_INTEL8X0M is not set +# CONFIG_SND_KORG1212 is not set +# CONFIG_SND_LOLA is not set +# CONFIG_SND_LX6464ES is not set +# CONFIG_SND_MAESTRO3 is not set +# CONFIG_SND_MIXART is not set +# CONFIG_SND_NM256 is not set +# CONFIG_SND_PCXHR is not set +# CONFIG_SND_RIPTIDE is not set +# CONFIG_SND_RME32 is not set +# CONFIG_SND_RME96 is not set +# CONFIG_SND_RME9652 is not set +# CONFIG_SND_SE6X is not set +# CONFIG_SND_SONICVIBES is not set +# CONFIG_SND_TRIDENT is not set +# CONFIG_SND_VIA82XX is not set +# CONFIG_SND_VIA82XX_MODEM is not set +# CONFIG_SND_VIRTUOSO is not set +# CONFIG_SND_VX222 is not set +# CONFIG_SND_YMFPCI is not set + +# +# HD-Audio +# +CONFIG_SND_HDA=y +CONFIG_SND_HDA_INTEL=y +CONFIG_SND_HDA_HWDEP=y +# CONFIG_SND_HDA_RECONFIG is not set +# CONFIG_SND_HDA_INPUT_BEEP is not set +# CONFIG_SND_HDA_PATCH_LOADER is not set +# CONFIG_SND_HDA_CODEC_REALTEK is not set +# CONFIG_SND_HDA_CODEC_ANALOG is not set +# CONFIG_SND_HDA_CODEC_SIGMATEL is not set +# CONFIG_SND_HDA_CODEC_VIA is not set +# CONFIG_SND_HDA_CODEC_HDMI is not set +# CONFIG_SND_HDA_CODEC_CIRRUS is not set +# CONFIG_SND_HDA_CODEC_CONEXANT is not set +# CONFIG_SND_HDA_CODEC_CA0110 is not set +# CONFIG_SND_HDA_CODEC_CA0132 is not set +# CONFIG_SND_HDA_CODEC_CMEDIA is not set +# CONFIG_SND_HDA_CODEC_SI3054 is not set +# CONFIG_SND_HDA_GENERIC is not set +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 +# end of HD-Audio + +CONFIG_SND_HDA_CORE=y +CONFIG_SND_HDA_COMPONENT=y +CONFIG_SND_HDA_I915=y +CONFIG_SND_HDA_PREALLOC_SIZE=64 +CONFIG_SND_INTEL_NHLT=y +CONFIG_SND_INTEL_DSP_CONFIG=y +CONFIG_SND_USB=y +# CONFIG_SND_USB_AUDIO is not set +# CONFIG_SND_USB_UA101 is not set +# CONFIG_SND_USB_USX2Y is not set +# CONFIG_SND_USB_CAIAQ is not set +# CONFIG_SND_USB_US122L is not set +# CONFIG_SND_USB_6FIRE is not set +# CONFIG_SND_USB_HIFACE is not set +# CONFIG_SND_BCD2000 is not set +# CONFIG_SND_USB_POD is not set +# CONFIG_SND_USB_PODHD is not set +# CONFIG_SND_USB_TONEPORT is not set +# CONFIG_SND_USB_VARIAX is not set +CONFIG_SND_PCMCIA=y +# CONFIG_SND_VXPOCKET is not set +# CONFIG_SND_PDAUDIOCF is not set +# CONFIG_SND_SOC is not set +CONFIG_SND_X86=y +# CONFIG_HDMI_LPE_AUDIO is not set + +# +# HID support +# +CONFIG_HID=y +# CONFIG_HID_BATTERY_STRENGTH is not set +CONFIG_HIDRAW=y +# CONFIG_UHID is not set +CONFIG_HID_GENERIC=y + +# +# Special HID drivers +# +CONFIG_HID_A4TECH=y +# CONFIG_HID_ACCUTOUCH is not set +# CONFIG_HID_ACRUX is not set +CONFIG_HID_APPLE=y +# CONFIG_HID_APPLEIR is not set +# CONFIG_HID_ASUS is not set +# CONFIG_HID_AUREAL is not set +CONFIG_HID_BELKIN=y +# CONFIG_HID_BETOP_FF is not set +# CONFIG_HID_BIGBEN_FF is not set +CONFIG_HID_CHERRY=y +CONFIG_HID_CHICONY=y +# CONFIG_HID_CORSAIR is not set +# CONFIG_HID_COUGAR is not set +# CONFIG_HID_MACALLY is not set +# CONFIG_HID_PRODIKEYS is not set +# CONFIG_HID_CMEDIA is not set +# CONFIG_HID_CREATIVE_SB0540 is not set +CONFIG_HID_CYPRESS=y +# CONFIG_HID_DRAGONRISE is not set +# CONFIG_HID_EMS_FF is not set +# CONFIG_HID_ELAN is not set +# CONFIG_HID_ELECOM is not set +# CONFIG_HID_ELO is not set +CONFIG_HID_EZKEY=y +# CONFIG_HID_GEMBIRD is not set +# CONFIG_HID_GFRM is not set +# CONFIG_HID_HOLTEK is not set +# CONFIG_HID_GT683R is not set +# CONFIG_HID_KEYTOUCH is not set +# CONFIG_HID_KYE is not set +# CONFIG_HID_UCLOGIC is not set +# CONFIG_HID_WALTOP is not set +# CONFIG_HID_VIEWSONIC is not set +CONFIG_HID_GYRATION=y +# CONFIG_HID_ICADE is not set +CONFIG_HID_ITE=y +# CONFIG_HID_JABRA is not set +# CONFIG_HID_TWINHAN is not set +CONFIG_HID_KENSINGTON=y +# CONFIG_HID_LCPOWER is not set +# CONFIG_HID_LED is not set +# CONFIG_HID_LENOVO is not set +CONFIG_HID_LOGITECH=y +# CONFIG_HID_LOGITECH_DJ is not set +# CONFIG_HID_LOGITECH_HIDPP is not set +CONFIG_LOGITECH_FF=y +# CONFIG_LOGIRUMBLEPAD2_FF is not set +# CONFIG_LOGIG940_FF is not set +CONFIG_LOGIWHEELS_FF=y +# CONFIG_HID_MAGICMOUSE is not set +# CONFIG_HID_MALTRON is not set +# CONFIG_HID_MAYFLASH is not set +CONFIG_HID_REDRAGON=y +CONFIG_HID_MICROSOFT=y +CONFIG_HID_MONTEREY=y +# CONFIG_HID_MULTITOUCH is not set +# CONFIG_HID_NTI is not set +CONFIG_HID_NTRIG=y +# CONFIG_HID_ORTEK is not set +CONFIG_HID_PANTHERLORD=y +CONFIG_PANTHERLORD_FF=y +# CONFIG_HID_PENMOUNT is not set +CONFIG_HID_PETALYNX=y +# CONFIG_HID_PICOLCD is not set +# CONFIG_HID_PLANTRONICS is not set +# CONFIG_HID_PRIMAX is not set +# CONFIG_HID_RETRODE is not set +# CONFIG_HID_ROCCAT is not set +# CONFIG_HID_SAITEK is not set +CONFIG_HID_SAMSUNG=y +CONFIG_HID_SONY=y +# CONFIG_SONY_FF is not set +# CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_STEAM is not set +# CONFIG_HID_STEELSERIES is not set +CONFIG_HID_SUNPLUS=y +# CONFIG_HID_RMI is not set +# CONFIG_HID_GREENASIA is not set +# CONFIG_HID_SMARTJOYPLUS is not set +# CONFIG_HID_TIVO is not set +CONFIG_HID_TOPSEED=y +# CONFIG_HID_THINGM is not set +# CONFIG_HID_THRUSTMASTER is not set +# CONFIG_HID_UDRAW_PS3 is not set +# CONFIG_HID_U2FZERO is not set +# CONFIG_HID_WACOM is not set +# CONFIG_HID_WIIMOTE is not set +# CONFIG_HID_XINMO is not set +# CONFIG_HID_ZEROPLUS is not set +# CONFIG_HID_ZYDACRON is not set +# CONFIG_HID_SENSOR_HUB is not set +# CONFIG_HID_ALPS is not set +# end of Special HID drivers + +# +# USB HID support +# +CONFIG_USB_HID=y +CONFIG_HID_PID=y +CONFIG_USB_HIDDEV=y +# end of USB HID support + +# +# I2C HID support +# +# CONFIG_I2C_HID is not set +# end of I2C HID support + +# +# Intel ISH HID support +# +# CONFIG_INTEL_ISH_HID is not set +# end of Intel ISH HID support +# end of HID support + +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +CONFIG_USB_SUPPORT=y +CONFIG_USB_COMMON=y +# CONFIG_USB_LED_TRIG is not set +# CONFIG_USB_ULPI_BUS is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB=y +CONFIG_USB_PCI=y +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y + +# +# Miscellaneous USB options +# +CONFIG_USB_DEFAULT_PERSIST=y +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_OTG is not set +# CONFIG_USB_OTG_WHITELIST is not set +# CONFIG_USB_LEDS_TRIGGER_USBPORT is not set +CONFIG_USB_AUTOSUSPEND_DELAY=2 +CONFIG_USB_MON=y + +# +# USB Host Controller Drivers +# +# CONFIG_USB_C67X00_HCD is not set +CONFIG_USB_XHCI_HCD=y +# CONFIG_USB_XHCI_DBGCAP is not set +CONFIG_USB_XHCI_PCI=y +# CONFIG_USB_XHCI_PLATFORM is not set +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_EHCI_ROOT_HUB_TT is not set +CONFIG_USB_EHCI_TT_NEWSCHED=y +CONFIG_USB_EHCI_PCI=y +# CONFIG_USB_EHCI_FSL is not set +# CONFIG_USB_EHCI_HCD_PLATFORM is not set +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_FOTG210_HCD is not set +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PCI=y +# CONFIG_USB_OHCI_HCD_PLATFORM is not set +CONFIG_USB_UHCI_HCD=y +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_R8A66597_HCD is not set +# CONFIG_USB_HCD_TEST_MODE is not set + +# +# USB Device Class drivers +# +# CONFIG_USB_ACM is not set +CONFIG_USB_PRINTER=y +# CONFIG_USB_WDM is not set +# CONFIG_USB_TMC is not set + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# + +# +# also be needed; see USB_STORAGE Help for more info +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_REALTEK is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_USBAT is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_ALAUDA is not set +# CONFIG_USB_STORAGE_ONETOUCH is not set +# CONFIG_USB_STORAGE_KARMA is not set +# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set +# CONFIG_USB_STORAGE_ENE_UB6250 is not set +# CONFIG_USB_UAS is not set + +# +# USB Imaging devices +# +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USBIP_CORE is not set +# CONFIG_USB_CDNS3 is not set +# CONFIG_USB_MUSB_HDRC is not set +# CONFIG_USB_DWC3 is not set +# CONFIG_USB_DWC2 is not set +# CONFIG_USB_CHIPIDEA is not set +# CONFIG_USB_ISP1760 is not set + +# +# USB port drivers +# +# CONFIG_USB_SERIAL is not set + +# +# USB Miscellaneous drivers +# +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_ADUTUX is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_APPLEDISPLAY is not set +# CONFIG_USB_SISUSBVGA is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_EHSET_TEST_FIXTURE is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_YUREX is not set +# CONFIG_USB_EZUSB_FX2 is not set +# CONFIG_USB_HUB_USB251XB is not set +# CONFIG_USB_HSIC_USB3503 is not set +# CONFIG_USB_HSIC_USB4604 is not set +# CONFIG_USB_LINK_LAYER_TEST is not set +# CONFIG_USB_CHAOSKEY is not set + +# +# USB Physical Layer drivers +# +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_USB_ISP1301 is not set +# end of USB Physical Layer drivers + +# CONFIG_USB_GADGET is not set +# CONFIG_TYPEC is not set +# CONFIG_USB_ROLE_SWITCH is not set +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +# CONFIG_LEDS_CLASS_FLASH is not set +# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set + +# +# LED drivers +# +# CONFIG_LEDS_APU is not set +# CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_LM3532 is not set +# CONFIG_LEDS_LM3642 is not set +# CONFIG_LEDS_PCA9532 is not set +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP5521 is not set +# CONFIG_LEDS_LP5523 is not set +# CONFIG_LEDS_LP5562 is not set +# CONFIG_LEDS_LP8501 is not set +# CONFIG_LEDS_CLEVO_MAIL is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_PCA963X is not set +# CONFIG_LEDS_BD2802 is not set +# CONFIG_LEDS_INTEL_SS4200 is not set +# CONFIG_LEDS_TCA6507 is not set +# CONFIG_LEDS_TLC591XX is not set +# CONFIG_LEDS_LM355x is not set + +# +# LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM) +# +# CONFIG_LEDS_BLINKM is not set +# CONFIG_LEDS_MLXCPLD is not set +# CONFIG_LEDS_MLXREG is not set +# CONFIG_LEDS_USER is not set +# CONFIG_LEDS_NIC78BX is not set +# CONFIG_LEDS_TI_LMU_COMMON is not set + +# +# LED Triggers +# +CONFIG_LEDS_TRIGGERS=y +# CONFIG_LEDS_TRIGGER_TIMER is not set +# CONFIG_LEDS_TRIGGER_ONESHOT is not set +# CONFIG_LEDS_TRIGGER_DISK is not set +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_CPU is not set +# CONFIG_LEDS_TRIGGER_ACTIVITY is not set +# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set + +# +# iptables trigger is under Netfilter config (LED target) +# +# CONFIG_LEDS_TRIGGER_TRANSIENT is not set +# CONFIG_LEDS_TRIGGER_CAMERA is not set +# CONFIG_LEDS_TRIGGER_PANIC is not set +# CONFIG_LEDS_TRIGGER_NETDEV is not set +# CONFIG_LEDS_TRIGGER_PATTERN is not set +# CONFIG_LEDS_TRIGGER_AUDIO is not set +# CONFIG_ACCESSIBILITY is not set +# CONFIG_INFINIBAND is not set +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EDAC=y +CONFIG_EDAC_LEGACY_SYSFS=y +# CONFIG_EDAC_DEBUG is not set +CONFIG_EDAC_DECODE_MCE=y +# CONFIG_EDAC_AMD64 is not set +# CONFIG_EDAC_E752X is not set +# CONFIG_EDAC_I82975X is not set +# CONFIG_EDAC_I3000 is not set +# CONFIG_EDAC_I3200 is not set +# CONFIG_EDAC_IE31200 is not set +# CONFIG_EDAC_X38 is not set +# CONFIG_EDAC_I5400 is not set +# CONFIG_EDAC_I7CORE is not set +# CONFIG_EDAC_I5000 is not set +# CONFIG_EDAC_I5100 is not set +# CONFIG_EDAC_I7300 is not set +# CONFIG_EDAC_SBRIDGE is not set +# CONFIG_EDAC_SKX is not set +# CONFIG_EDAC_I10NM is not set +# CONFIG_EDAC_PND2 is not set +CONFIG_RTC_LIB=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_RTC_CLASS=y +# CONFIG_RTC_HCTOSYS is not set +CONFIG_RTC_SYSTOHC=y +CONFIG_RTC_SYSTOHC_DEVICE="rtc0" +# CONFIG_RTC_DEBUG is not set +CONFIG_RTC_NVMEM=y + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set +# CONFIG_RTC_DRV_TEST is not set + +# +# I2C RTC drivers +# +# CONFIG_RTC_DRV_ABB5ZES3 is not set +# CONFIG_RTC_DRV_ABEOZ9 is not set +# CONFIG_RTC_DRV_ABX80X is not set +# CONFIG_RTC_DRV_DS1307 is not set +# CONFIG_RTC_DRV_DS1374 is not set +# CONFIG_RTC_DRV_DS1672 is not set +# CONFIG_RTC_DRV_MAX6900 is not set +# CONFIG_RTC_DRV_RS5C372 is not set +# CONFIG_RTC_DRV_ISL1208 is not set +# CONFIG_RTC_DRV_ISL12022 is not set +# CONFIG_RTC_DRV_X1205 is not set +# CONFIG_RTC_DRV_PCF8523 is not set +# CONFIG_RTC_DRV_PCF85063 is not set +# CONFIG_RTC_DRV_PCF85363 is not set +# CONFIG_RTC_DRV_PCF8563 is not set +# CONFIG_RTC_DRV_PCF8583 is not set +# CONFIG_RTC_DRV_M41T80 is not set +# CONFIG_RTC_DRV_BQ32K is not set +# CONFIG_RTC_DRV_S35390A is not set +# CONFIG_RTC_DRV_FM3130 is not set +# CONFIG_RTC_DRV_RX8010 is not set +# CONFIG_RTC_DRV_RX8581 is not set +# CONFIG_RTC_DRV_RX8025 is not set +# CONFIG_RTC_DRV_EM3027 is not set +# CONFIG_RTC_DRV_RV3028 is not set +# CONFIG_RTC_DRV_RV8803 is not set +# CONFIG_RTC_DRV_SD3078 is not set + +# +# SPI RTC drivers +# +CONFIG_RTC_I2C_AND_SPI=y + +# +# SPI and I2C RTC drivers +# +# CONFIG_RTC_DRV_DS3232 is not set +# CONFIG_RTC_DRV_PCF2127 is not set +# CONFIG_RTC_DRV_RV3029C2 is not set + +# +# Platform RTC drivers +# +CONFIG_RTC_DRV_CMOS=y +# CONFIG_RTC_DRV_DS1286 is not set +# CONFIG_RTC_DRV_DS1511 is not set +# CONFIG_RTC_DRV_DS1553 is not set +# CONFIG_RTC_DRV_DS1685_FAMILY is not set +# CONFIG_RTC_DRV_DS1742 is not set +# CONFIG_RTC_DRV_DS2404 is not set +# CONFIG_RTC_DRV_STK17TA8 is not set +# CONFIG_RTC_DRV_M48T86 is not set +# CONFIG_RTC_DRV_M48T35 is not set +# CONFIG_RTC_DRV_M48T59 is not set +# CONFIG_RTC_DRV_MSM6242 is not set +# CONFIG_RTC_DRV_BQ4802 is not set +# CONFIG_RTC_DRV_RP5C01 is not set +# CONFIG_RTC_DRV_V3020 is not set + +# +# on-CPU RTC drivers +# +# CONFIG_RTC_DRV_FTRTC010 is not set + +# +# HID Sensor RTC drivers +# +CONFIG_DMADEVICES=y +# CONFIG_DMADEVICES_DEBUG is not set + +# +# DMA Devices +# +CONFIG_DMA_ENGINE=y +CONFIG_DMA_VIRTUAL_CHANNELS=y +CONFIG_DMA_ACPI=y +# CONFIG_ALTERA_MSGDMA is not set +# CONFIG_INTEL_IDMA64 is not set +# CONFIG_INTEL_IOATDMA is not set +# CONFIG_QCOM_HIDMA_MGMT is not set +# CONFIG_QCOM_HIDMA is not set +CONFIG_DW_DMAC_CORE=y +# CONFIG_DW_DMAC is not set +# CONFIG_DW_DMAC_PCI is not set +# CONFIG_DW_EDMA is not set +# CONFIG_DW_EDMA_PCIE is not set +CONFIG_HSU_DMA=y +# CONFIG_SF_PDMA is not set + +# +# DMA Clients +# +# CONFIG_ASYNC_TX_DMA is not set +# CONFIG_DMATEST is not set + +# +# DMABUF options +# +CONFIG_SYNC_FILE=y +# CONFIG_SW_SYNC is not set +# CONFIG_UDMABUF is not set +# CONFIG_DMABUF_SELFTESTS is not set +# end of DMABUF options + +# CONFIG_AUXDISPLAY is not set +# CONFIG_UIO is not set +# CONFIG_VFIO is not set +# CONFIG_VIRT_DRIVERS is not set +CONFIG_VIRTIO_MENU=y +# CONFIG_VIRTIO_PCI is not set +# CONFIG_VIRTIO_MMIO is not set + +# +# Microsoft Hyper-V guest support +# +# end of Microsoft Hyper-V guest support + +# CONFIG_GREYBUS is not set +# CONFIG_STAGING is not set +CONFIG_X86_PLATFORM_DEVICES=y +# CONFIG_ACER_WIRELESS is not set +# CONFIG_ACERHDF is not set +# CONFIG_ASUS_LAPTOP is not set +# CONFIG_DCDBAS is not set +# CONFIG_DELL_SMBIOS is not set +# CONFIG_DELL_SMO8800 is not set +# CONFIG_DELL_RBTN is not set +# CONFIG_DELL_RBU is not set +# CONFIG_FUJITSU_LAPTOP is not set +# CONFIG_FUJITSU_TABLET is not set +# CONFIG_AMILO_RFKILL is not set +# CONFIG_GPD_POCKET_FAN is not set +# CONFIG_HP_ACCEL is not set +# CONFIG_HP_WIRELESS is not set +# CONFIG_MSI_LAPTOP is not set +# CONFIG_PANASONIC_LAPTOP is not set +# CONFIG_COMPAL_LAPTOP is not set +# CONFIG_SONY_LAPTOP is not set +# CONFIG_IDEAPAD_LAPTOP is not set +# CONFIG_THINKPAD_ACPI is not set +# CONFIG_SENSORS_HDAPS is not set +# CONFIG_INTEL_MENLOW is not set +CONFIG_EEEPC_LAPTOP=y +# CONFIG_ASUS_WIRELESS is not set +# CONFIG_ACPI_WMI is not set +# CONFIG_TOPSTAR_LAPTOP is not set +# CONFIG_TOSHIBA_BT_RFKILL is not set +# CONFIG_TOSHIBA_HAPS is not set +# CONFIG_ACPI_CMPC is not set +# CONFIG_INTEL_HID_EVENT is not set +# CONFIG_INTEL_VBTN is not set +# CONFIG_INTEL_IPS is not set +# CONFIG_INTEL_PMC_CORE is not set +# CONFIG_IBM_RTL is not set +# CONFIG_SAMSUNG_LAPTOP is not set +# CONFIG_INTEL_OAKTRAIL is not set +# CONFIG_SAMSUNG_Q10 is not set +# CONFIG_APPLE_GMUX is not set +# CONFIG_INTEL_RST is not set +# CONFIG_INTEL_SMARTCONNECT is not set +# CONFIG_INTEL_PMC_IPC is not set +# CONFIG_SURFACE_PRO3_BUTTON is not set +# CONFIG_INTEL_PUNIT_IPC is not set +# CONFIG_MLX_PLATFORM is not set +# CONFIG_INTEL_TURBO_MAX_3 is not set +# CONFIG_I2C_MULTI_INSTANTIATE is not set +# CONFIG_INTEL_ATOMISP2_PM is not set + +# +# Intel Speed Select Technology interface support +# +# CONFIG_INTEL_SPEED_SELECT_INTERFACE is not set +# end of Intel Speed Select Technology interface support + +# CONFIG_SYSTEM76_ACPI is not set +CONFIG_PMC_ATOM=y +# CONFIG_MFD_CROS_EC is not set +# CONFIG_CHROME_PLATFORMS is not set +# CONFIG_MELLANOX_PLATFORM is not set +CONFIG_CLKDEV_LOOKUP=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_COMMON_CLK=y + +# +# Common Clock Framework +# +# CONFIG_COMMON_CLK_MAX9485 is not set +# CONFIG_COMMON_CLK_SI5341 is not set +# CONFIG_COMMON_CLK_SI5351 is not set +# CONFIG_COMMON_CLK_SI544 is not set +# CONFIG_COMMON_CLK_CDCE706 is not set +# CONFIG_COMMON_CLK_CS2000_CP is not set +# end of Common Clock Framework + +# CONFIG_HWSPINLOCK is not set + +# +# Clock Source drivers +# +CONFIG_CLKEVT_I8253=y +CONFIG_I8253_LOCK=y +CONFIG_CLKBLD_I8253=y +# end of Clock Source drivers + +CONFIG_MAILBOX=y +CONFIG_PCC=y +# CONFIG_ALTERA_MBOX is not set +CONFIG_IOMMU_IOVA=y +CONFIG_IOMMU_API=y +CONFIG_IOMMU_SUPPORT=y + +# +# Generic IOMMU Pagetable Support +# +# end of Generic IOMMU Pagetable Support + +# CONFIG_IOMMU_DEBUGFS is not set +# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set +CONFIG_IOMMU_DMA=y +CONFIG_AMD_IOMMU=y +# CONFIG_AMD_IOMMU_V2 is not set +CONFIG_DMAR_TABLE=y +CONFIG_INTEL_IOMMU=y +# CONFIG_INTEL_IOMMU_SVM is not set +# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set +CONFIG_INTEL_IOMMU_FLOPPY_WA=y +# CONFIG_IRQ_REMAP is not set + +# +# Remoteproc drivers +# +# CONFIG_REMOTEPROC is not set +# end of Remoteproc drivers + +# +# Rpmsg drivers +# +# CONFIG_RPMSG_QCOM_GLINK_RPM is not set +# CONFIG_RPMSG_VIRTIO is not set +# end of Rpmsg drivers + +# CONFIG_SOUNDWIRE is not set + +# +# SOC (System On Chip) specific Drivers +# + +# +# Amlogic SoC drivers +# +# end of Amlogic SoC drivers + +# +# Aspeed SoC drivers +# +# end of Aspeed SoC drivers + +# +# Broadcom SoC drivers +# +# end of Broadcom SoC drivers + +# +# NXP/Freescale QorIQ SoC drivers +# +# end of NXP/Freescale QorIQ SoC drivers + +# +# i.MX SoC drivers +# +# end of i.MX SoC drivers + +# +# Qualcomm SoC drivers +# +# end of Qualcomm SoC drivers + +# CONFIG_SOC_TI is not set + +# +# Xilinx SoC drivers +# +# CONFIG_XILINX_VCU is not set +# end of Xilinx SoC drivers +# end of SOC (System On Chip) specific Drivers + +# CONFIG_PM_DEVFREQ is not set +# CONFIG_EXTCON is not set +# CONFIG_MEMORY is not set +# CONFIG_IIO is not set +# CONFIG_NTB is not set +# CONFIG_VME_BUS is not set +# CONFIG_PWM is not set + +# +# IRQ chip support +# +# end of IRQ chip support + +# CONFIG_IPACK_BUS is not set +# CONFIG_RESET_CONTROLLER is not set + +# +# PHY Subsystem +# +# CONFIG_GENERIC_PHY is not set +# CONFIG_BCM_KONA_USB2_PHY is not set +# CONFIG_PHY_PXA_28NM_HSIC is not set +# CONFIG_PHY_PXA_28NM_USB2 is not set +# end of PHY Subsystem + +# CONFIG_POWERCAP is not set +# CONFIG_MCB is not set + +# +# Performance monitor support +# +# end of Performance monitor support + +CONFIG_RAS=y +# CONFIG_THUNDERBOLT is not set + +# +# Android +# +# CONFIG_ANDROID is not set +# end of Android + +# CONFIG_LIBNVDIMM is not set +# CONFIG_DAX is not set +CONFIG_NVMEM=y +CONFIG_NVMEM_SYSFS=y + +# +# HW tracing support +# +# CONFIG_STM is not set +# CONFIG_INTEL_TH is not set +# end of HW tracing support + +# CONFIG_FPGA is not set +# CONFIG_UNISYS_VISORBUS is not set +# CONFIG_SIOX is not set +# CONFIG_SLIMBUS is not set +# CONFIG_INTERCONNECT is not set +# CONFIG_COUNTER is not set +# end of Device Drivers + +# +# File systems +# +CONFIG_DCACHE_WORD_ACCESS=y +# CONFIG_VALIDATE_FS_PARSER is not set +CONFIG_FS_IOMAP=y +# CONFIG_EXT2_FS is not set +# CONFIG_EXT3_FS is not set +CONFIG_EXT4_FS=y +CONFIG_EXT4_USE_FOR_EXT2=y +CONFIG_EXT4_FS_POSIX_ACL=y +CONFIG_EXT4_FS_SECURITY=y +# CONFIG_EXT4_DEBUG is not set +CONFIG_JBD2=y +# CONFIG_JBD2_DEBUG is not set +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_NILFS2_FS is not set +# CONFIG_F2FS_FS is not set +# CONFIG_FS_DAX is not set +CONFIG_FS_POSIX_ACL=y +CONFIG_EXPORTFS=y +# CONFIG_EXPORTFS_BLOCK_OPS is not set +CONFIG_FILE_LOCKING=y +CONFIG_MANDATORY_FILE_LOCKING=y +# CONFIG_FS_ENCRYPTION is not set +# CONFIG_FS_VERITY is not set +CONFIG_FSNOTIFY=y +CONFIG_DNOTIFY=y +CONFIG_INOTIFY_USER=y +# CONFIG_FANOTIFY is not set +CONFIG_QUOTA=y +CONFIG_QUOTA_NETLINK_INTERFACE=y +# CONFIG_PRINT_QUOTA_WARNING is not set +# CONFIG_QUOTA_DEBUG is not set +CONFIG_QUOTA_TREE=y +# CONFIG_QFMT_V1 is not set +CONFIG_QFMT_V2=y +CONFIG_QUOTACTL=y +CONFIG_QUOTACTL_COMPAT=y +CONFIG_AUTOFS4_FS=y +CONFIG_AUTOFS_FS=y +# CONFIG_FUSE_FS is not set +# CONFIG_OVERLAY_FS is not set + +# +# Caches +# +# CONFIG_FSCACHE is not set +# end of Caches + +# +# CD-ROM/DVD Filesystems +# +CONFIG_ISO9660_FS=y +CONFIG_JOLIET=y +CONFIG_ZISOFS=y +# CONFIG_UDF_FS is not set +# end of CD-ROM/DVD Filesystems + +# +# DOS/FAT/NT Filesystems +# +CONFIG_FAT_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_FAT_DEFAULT_UTF8 is not set +# CONFIG_NTFS_FS is not set +# end of DOS/FAT/NT Filesystems + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_PROC_VMCORE=y +# CONFIG_PROC_VMCORE_DEVICE_DUMP is not set +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_PAGE_MONITOR=y +# CONFIG_PROC_CHILDREN is not set +CONFIG_PROC_PID_ARCH_STATUS=y +CONFIG_KERNFS=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_TMPFS_XATTR=y +CONFIG_HUGETLBFS=y +CONFIG_HUGETLB_PAGE=y +CONFIG_MEMFD_CREATE=y +CONFIG_ARCH_HAS_GIGANTIC_PAGE=y +# CONFIG_CONFIGFS_FS is not set +CONFIG_EFIVAR_FS=m +# end of Pseudo filesystems + +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ORANGEFS_FS is not set +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_ECRYPT_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_CRAMFS is not set +# CONFIG_SQUASHFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_OMFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX6FS_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_PSTORE is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set +# CONFIG_EROFS_FS is not set +CONFIG_NETWORK_FILESYSTEMS=y +CONFIG_NFS_FS=y +CONFIG_NFS_V2=y +CONFIG_NFS_V3=y +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +# CONFIG_NFS_SWAP is not set +# CONFIG_NFS_V4_1 is not set +CONFIG_ROOT_NFS=y +# CONFIG_NFS_USE_LEGACY_DNS is not set +CONFIG_NFS_USE_KERNEL_DNS=y +# CONFIG_NFSD is not set +CONFIG_GRACE_PERIOD=y +CONFIG_LOCKD=y +CONFIG_LOCKD_V4=y +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +# CONFIG_SUNRPC_DEBUG is not set +# CONFIG_CEPH_FS is not set +# CONFIG_CIFS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set +CONFIG_NLS=y +CONFIG_NLS_DEFAULT="utf8" +CONFIG_NLS_CODEPAGE_437=y +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +CONFIG_NLS_ASCII=y +CONFIG_NLS_ISO8859_1=y +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_MAC_ROMAN is not set +# CONFIG_NLS_MAC_CELTIC is not set +# CONFIG_NLS_MAC_CENTEURO is not set +# CONFIG_NLS_MAC_CROATIAN is not set +# CONFIG_NLS_MAC_CYRILLIC is not set +# CONFIG_NLS_MAC_GAELIC is not set +# CONFIG_NLS_MAC_GREEK is not set +# CONFIG_NLS_MAC_ICELAND is not set +# CONFIG_NLS_MAC_INUIT is not set +# CONFIG_NLS_MAC_ROMANIAN is not set +# CONFIG_NLS_MAC_TURKISH is not set +CONFIG_NLS_UTF8=y +# CONFIG_UNICODE is not set +CONFIG_IO_WQ=y +# end of File systems + +# +# Security options +# +CONFIG_KEYS=y +# CONFIG_KEYS_REQUEST_CACHE is not set +# CONFIG_PERSISTENT_KEYRINGS is not set +# CONFIG_BIG_KEYS is not set +# CONFIG_ENCRYPTED_KEYS is not set +# CONFIG_KEY_DH_OPERATIONS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +CONFIG_SECURITY=y +CONFIG_SECURITY_WRITABLE_HOOKS=y +# CONFIG_SECURITYFS is not set +CONFIG_SECURITY_NETWORK=y +CONFIG_PAGE_TABLE_ISOLATION=y +# CONFIG_SECURITY_NETWORK_XFRM is not set +# CONFIG_SECURITY_PATH is not set +# CONFIG_INTEL_TXT is not set +CONFIG_LSM_MMAP_MIN_ADDR=65536 +CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y +# CONFIG_HARDENED_USERCOPY is not set +# CONFIG_FORTIFY_SOURCE is not set +# CONFIG_STATIC_USERMODEHELPER is not set +CONFIG_SECURITY_SELINUX=y +CONFIG_SECURITY_SELINUX_BOOTPARAM=y +CONFIG_SECURITY_SELINUX_DISABLE=y +CONFIG_SECURITY_SELINUX_DEVELOP=y +CONFIG_SECURITY_SELINUX_AVC_STATS=y +CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=0 +# CONFIG_SECURITY_SMACK is not set +# CONFIG_SECURITY_TOMOYO is not set +# CONFIG_SECURITY_APPARMOR is not set +# CONFIG_SECURITY_LOADPIN is not set +# CONFIG_SECURITY_YAMA is not set +# CONFIG_SECURITY_SAFESETID is not set +# CONFIG_SECURITY_LOCKDOWN_LSM is not set +CONFIG_INTEGRITY=y +# CONFIG_INTEGRITY_SIGNATURE is not set +CONFIG_INTEGRITY_AUDIT=y +# CONFIG_IMA is not set +# CONFIG_EVM is not set +CONFIG_DEFAULT_SECURITY_SELINUX=y +# CONFIG_DEFAULT_SECURITY_DAC is not set +CONFIG_LSM="lockdown,yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor" + +# +# Kernel hardening options +# + +# +# Memory initialization +# +CONFIG_INIT_STACK_NONE=y +# CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set +# CONFIG_INIT_ON_FREE_DEFAULT_ON is not set +# end of Memory initialization +# end of Kernel hardening options +# end of Security options + +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_SKCIPHER=y +CONFIG_CRYPTO_SKCIPHER2=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_AKCIPHER2=y +CONFIG_CRYPTO_AKCIPHER=y +CONFIG_CRYPTO_KPP2=y +CONFIG_CRYPTO_ACOMP2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +# CONFIG_CRYPTO_USER is not set +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +CONFIG_CRYPTO_GF128MUL=y +CONFIG_CRYPTO_NULL=y +CONFIG_CRYPTO_NULL2=y +# CONFIG_CRYPTO_PCRYPT is not set +# CONFIG_CRYPTO_CRYPTD is not set +CONFIG_CRYPTO_AUTHENC=y +# CONFIG_CRYPTO_TEST is not set + +# +# Public-key cryptography +# +CONFIG_CRYPTO_RSA=y +# CONFIG_CRYPTO_DH is not set +# CONFIG_CRYPTO_ECDH is not set +# CONFIG_CRYPTO_ECRDSA is not set +# CONFIG_CRYPTO_CURVE25519 is not set +# CONFIG_CRYPTO_CURVE25519_X86 is not set + +# +# Authenticated Encryption with Associated Data +# +CONFIG_CRYPTO_CCM=y +CONFIG_CRYPTO_GCM=y +# CONFIG_CRYPTO_CHACHA20POLY1305 is not set +# CONFIG_CRYPTO_AEGIS128 is not set +# CONFIG_CRYPTO_AEGIS128_AESNI_SSE2 is not set +CONFIG_CRYPTO_SEQIV=y +CONFIG_CRYPTO_ECHAINIV=y + +# +# Block modes +# +CONFIG_CRYPTO_CBC=y +# CONFIG_CRYPTO_CFB is not set +CONFIG_CRYPTO_CTR=y +# CONFIG_CRYPTO_CTS is not set +# CONFIG_CRYPTO_ECB is not set +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_OFB is not set +# CONFIG_CRYPTO_PCBC is not set +# CONFIG_CRYPTO_XTS is not set +# CONFIG_CRYPTO_KEYWRAP is not set +# CONFIG_CRYPTO_NHPOLY1305_SSE2 is not set +# CONFIG_CRYPTO_NHPOLY1305_AVX2 is not set +# CONFIG_CRYPTO_ADIANTUM is not set +# CONFIG_CRYPTO_ESSIV is not set + +# +# Hash modes +# +CONFIG_CRYPTO_CMAC=y +CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_VMAC is not set + +# +# Digest +# +CONFIG_CRYPTO_CRC32C=y +# CONFIG_CRYPTO_CRC32C_INTEL is not set +# CONFIG_CRYPTO_CRC32 is not set +# CONFIG_CRYPTO_CRC32_PCLMUL is not set +# CONFIG_CRYPTO_XXHASH is not set +# CONFIG_CRYPTO_BLAKE2B is not set +# CONFIG_CRYPTO_BLAKE2S is not set +# CONFIG_CRYPTO_BLAKE2S_X86 is not set +# CONFIG_CRYPTO_CRCT10DIF is not set +CONFIG_CRYPTO_GHASH=y +# CONFIG_CRYPTO_POLY1305 is not set +# CONFIG_CRYPTO_POLY1305_X86_64 is not set +# CONFIG_CRYPTO_MD4 is not set +CONFIG_CRYPTO_MD5=y +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +CONFIG_CRYPTO_SHA1=y +# CONFIG_CRYPTO_SHA1_SSSE3 is not set +# CONFIG_CRYPTO_SHA256_SSSE3 is not set +# CONFIG_CRYPTO_SHA512_SSSE3 is not set +CONFIG_CRYPTO_SHA256=y +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_SHA3 is not set +# CONFIG_CRYPTO_SM3 is not set +# CONFIG_CRYPTO_STREEBOG is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_WP512 is not set +# CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set + +# +# Ciphers +# +CONFIG_CRYPTO_AES=y +# CONFIG_CRYPTO_AES_TI is not set +# CONFIG_CRYPTO_AES_NI_INTEL is not set +# CONFIG_CRYPTO_ANUBIS is not set +# CONFIG_CRYPTO_ARC4 is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_BLOWFISH_X86_64 is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAMELLIA_X86_64 is not set +# CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 is not set +# CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST5_AVX_X86_64 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_CAST6_AVX_X86_64 is not set +CONFIG_CRYPTO_DES=y +# CONFIG_CRYPTO_DES3_EDE_X86_64 is not set +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_CHACHA20 is not set +# CONFIG_CRYPTO_CHACHA20_X86_64 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_SERPENT_SSE2_X86_64 is not set +# CONFIG_CRYPTO_SERPENT_AVX_X86_64 is not set +# CONFIG_CRYPTO_SERPENT_AVX2_X86_64 is not set +# CONFIG_CRYPTO_SM4 is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_TWOFISH is not set +# CONFIG_CRYPTO_TWOFISH_X86_64 is not set +# CONFIG_CRYPTO_TWOFISH_X86_64_3WAY is not set +# CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set + +# +# Compression +# +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_LZO is not set +# CONFIG_CRYPTO_842 is not set +# CONFIG_CRYPTO_LZ4 is not set +# CONFIG_CRYPTO_LZ4HC is not set +# CONFIG_CRYPTO_ZSTD is not set + +# +# Random Number Generation +# +# CONFIG_CRYPTO_ANSI_CPRNG is not set +CONFIG_CRYPTO_DRBG_MENU=y +CONFIG_CRYPTO_DRBG_HMAC=y +# CONFIG_CRYPTO_DRBG_HASH is not set +# CONFIG_CRYPTO_DRBG_CTR is not set +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_JITTERENTROPY=y +# CONFIG_CRYPTO_USER_API_HASH is not set +# CONFIG_CRYPTO_USER_API_SKCIPHER is not set +# CONFIG_CRYPTO_USER_API_RNG is not set +# CONFIG_CRYPTO_USER_API_AEAD is not set +CONFIG_CRYPTO_HASH_INFO=y + +# +# Crypto library routines +# +CONFIG_CRYPTO_LIB_AES=y +CONFIG_CRYPTO_LIB_ARC4=y +# CONFIG_CRYPTO_LIB_BLAKE2S is not set +# CONFIG_CRYPTO_LIB_CHACHA is not set +# CONFIG_CRYPTO_LIB_CURVE25519 is not set +CONFIG_CRYPTO_LIB_DES=y +CONFIG_CRYPTO_LIB_POLY1305_RSIZE=4 +# CONFIG_CRYPTO_LIB_POLY1305 is not set +# CONFIG_CRYPTO_LIB_CHACHA20POLY1305 is not set +CONFIG_CRYPTO_LIB_SHA256=y +CONFIG_CRYPTO_HW=y +# CONFIG_CRYPTO_DEV_PADLOCK is not set +# CONFIG_CRYPTO_DEV_ATMEL_ECC is not set +# CONFIG_CRYPTO_DEV_ATMEL_SHA204A is not set +# CONFIG_CRYPTO_DEV_CCP is not set +# CONFIG_CRYPTO_DEV_QAT_DH895xCC is not set +# CONFIG_CRYPTO_DEV_QAT_C3XXX is not set +# CONFIG_CRYPTO_DEV_QAT_C62X is not set +# CONFIG_CRYPTO_DEV_QAT_DH895xCCVF is not set +# CONFIG_CRYPTO_DEV_QAT_C3XXXVF is not set +# CONFIG_CRYPTO_DEV_QAT_C62XVF is not set +# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set +# CONFIG_CRYPTO_DEV_SAFEXCEL is not set +# CONFIG_CRYPTO_DEV_AMLOGIC_GXL is not set +CONFIG_ASYMMETRIC_KEY_TYPE=y +CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y +CONFIG_X509_CERTIFICATE_PARSER=y +# CONFIG_PKCS8_PRIVATE_KEY_PARSER is not set +CONFIG_PKCS7_MESSAGE_PARSER=y +# CONFIG_PKCS7_TEST_KEY is not set +# CONFIG_SIGNED_PE_FILE_VERIFICATION is not set + +# +# Certificates for signature checking +# +CONFIG_SYSTEM_TRUSTED_KEYRING=y +CONFIG_SYSTEM_TRUSTED_KEYS="" +# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set +# CONFIG_SECONDARY_TRUSTED_KEYRING is not set +# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set +# end of Certificates for signature checking + +CONFIG_BINARY_PRINTF=y + +# +# Library routines +# +# CONFIG_PACKING is not set +CONFIG_BITREVERSE=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_NET_UTILS=y +CONFIG_GENERIC_FIND_FIRST_BIT=y +# CONFIG_CORDIC is not set +CONFIG_RATIONAL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_IOMAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_HAS_FAST_MULTIPLIER=y +CONFIG_CRC_CCITT=y +CONFIG_CRC16=y +# CONFIG_CRC_T10DIF is not set +# CONFIG_CRC_ITU_T is not set +CONFIG_CRC32=y +# CONFIG_CRC32_SELFTEST is not set +CONFIG_CRC32_SLICEBY8=y +# CONFIG_CRC32_SLICEBY4 is not set +# CONFIG_CRC32_SARWATE is not set +# CONFIG_CRC32_BIT is not set +# CONFIG_CRC64 is not set +# CONFIG_CRC4 is not set +# CONFIG_CRC7 is not set +CONFIG_LIBCRC32C=y +# CONFIG_CRC8 is not set +# CONFIG_RANDOM32_SELFTEST is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_LZ4_DECOMPRESS=y +CONFIG_XZ_DEC=y +CONFIG_XZ_DEC_X86=y +CONFIG_XZ_DEC_POWERPC=y +CONFIG_XZ_DEC_IA64=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_ARMTHUMB=y +CONFIG_XZ_DEC_SPARC=y +CONFIG_XZ_DEC_BCJ=y +# CONFIG_XZ_DEC_TEST is not set +CONFIG_DECOMPRESS_GZIP=y +CONFIG_DECOMPRESS_BZIP2=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_DECOMPRESS_XZ=y +CONFIG_DECOMPRESS_LZO=y +CONFIG_DECOMPRESS_LZ4=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_INTERVAL_TREE=y +CONFIG_ASSOCIATIVE_ARRAY=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAS_DMA=y +CONFIG_NEED_SG_DMA_LENGTH=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_SWIOTLB=y +# CONFIG_DMA_API_DEBUG is not set +CONFIG_SGL_ALLOC=y +CONFIG_CHECK_SIGNATURE=y +CONFIG_CPU_RMAP=y +CONFIG_DQL=y +CONFIG_GLOB=y +# CONFIG_GLOB_SELFTEST is not set +CONFIG_NLATTR=y +CONFIG_CLZ_TAB=y +# CONFIG_IRQ_POLL is not set +CONFIG_MPILIB=y +CONFIG_OID_REGISTRY=y +CONFIG_UCS2_STRING=y +CONFIG_HAVE_GENERIC_VDSO=y +CONFIG_GENERIC_GETTIMEOFDAY=y +CONFIG_FONT_SUPPORT=y +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_SG_POOL=y +CONFIG_ARCH_HAS_PMEM_API=y +CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y +CONFIG_ARCH_HAS_UACCESS_MCSAFE=y +CONFIG_ARCH_STACKWALK=y +CONFIG_SBITMAP=y +# CONFIG_STRING_SELFTEST is not set +# end of Library routines + +# +# Kernel hacking +# + +# +# printk and dmesg options +# +CONFIG_PRINTK_TIME=y +# CONFIG_PRINTK_CALLER is not set +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 +CONFIG_CONSOLE_LOGLEVEL_QUIET=4 +CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 +# CONFIG_BOOT_PRINTK_DELAY is not set +# CONFIG_DYNAMIC_DEBUG is not set +CONFIG_SYMBOLIC_ERRNAME=y +CONFIG_DEBUG_BUGVERBOSE=y +# end of printk and dmesg options + +# +# Compile-time checks and compiler options +# +CONFIG_DEBUG_INFO=y +# CONFIG_DEBUG_INFO_REDUCED is not set +# CONFIG_DEBUG_INFO_SPLIT is not set +# CONFIG_DEBUG_INFO_DWARF4 is not set +CONFIG_DEBUG_INFO_BTF=y +# CONFIG_GDB_SCRIPTS is not set +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_FRAME_WARN=2048 +# CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_READABLE_ASM is not set +# CONFIG_HEADERS_INSTALL is not set +CONFIG_OPTIMIZE_INLINING=y +# CONFIG_DEBUG_SECTION_MISMATCH is not set +CONFIG_SECTION_MISMATCH_WARN_ONLY=y +CONFIG_STACK_VALIDATION=y +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# end of Compile-time checks and compiler options + +# +# Generic Kernel Debugging Instruments +# +CONFIG_MAGIC_SYSRQ=y +CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 +CONFIG_MAGIC_SYSRQ_SERIAL=y +CONFIG_DEBUG_FS=y +CONFIG_HAVE_ARCH_KGDB=y +# CONFIG_KGDB is not set +CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y +# CONFIG_UBSAN is not set +CONFIG_UBSAN_ALIGNMENT=y +# end of Generic Kernel Debugging Instruments + +CONFIG_DEBUG_KERNEL=y +CONFIG_DEBUG_MISC=y + +# +# Memory Debugging +# +# CONFIG_PAGE_EXTENSION is not set +# CONFIG_DEBUG_PAGEALLOC is not set +# CONFIG_PAGE_OWNER is not set +# CONFIG_PAGE_POISONING is not set +# CONFIG_DEBUG_PAGE_REF is not set +# CONFIG_DEBUG_RODATA_TEST is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_SLUB_STATS is not set +CONFIG_HAVE_DEBUG_KMEMLEAK=y +# CONFIG_DEBUG_KMEMLEAK is not set +CONFIG_DEBUG_STACK_USAGE=y +# CONFIG_SCHED_STACK_END_CHECK is not set +# CONFIG_DEBUG_VM is not set +CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y +# CONFIG_DEBUG_VIRTUAL is not set +CONFIG_DEBUG_MEMORY_INIT=y +# CONFIG_DEBUG_PER_CPU_MAPS is not set +CONFIG_HAVE_ARCH_KASAN=y +CONFIG_HAVE_ARCH_KASAN_VMALLOC=y +CONFIG_CC_HAS_KASAN_GENERIC=y +# CONFIG_KASAN is not set +CONFIG_KASAN_STACK=1 +# end of Memory Debugging + +# CONFIG_DEBUG_SHIRQ is not set + +# +# Debug Oops, Lockups and Hangs +# +# CONFIG_PANIC_ON_OOPS is not set +CONFIG_PANIC_ON_OOPS_VALUE=0 +CONFIG_PANIC_TIMEOUT=0 +# CONFIG_SOFTLOCKUP_DETECTOR is not set +CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y +# CONFIG_HARDLOCKUP_DETECTOR is not set +# CONFIG_DETECT_HUNG_TASK is not set +# CONFIG_WQ_WATCHDOG is not set +# end of Debug Oops, Lockups and Hangs + +# +# Scheduler Debugging +# +# CONFIG_SCHED_DEBUG is not set +CONFIG_SCHED_INFO=y +CONFIG_SCHEDSTATS=y +# end of Scheduler Debugging + +# CONFIG_DEBUG_TIMEKEEPING is not set + +# +# Lock Debugging (spinlocks, mutexes, etc...) +# +CONFIG_LOCK_DEBUGGING_SUPPORT=y +# CONFIG_PROVE_LOCKING is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set +# CONFIG_DEBUG_RWSEMS is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_LOCK_TORTURE_TEST is not set +# CONFIG_WW_MUTEX_SELFTEST is not set +# end of Lock Debugging (spinlocks, mutexes, etc...) + +CONFIG_STACKTRACE=y +# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set +# CONFIG_DEBUG_KOBJECT is not set + +# +# Debug kernel data structures +# +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_PLIST is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_BUG_ON_DATA_CORRUPTION is not set +# end of Debug kernel data structures + +# CONFIG_DEBUG_CREDENTIALS is not set + +# +# RCU Debugging +# +# CONFIG_RCU_PERF_TEST is not set +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_RCU_CPU_STALL_TIMEOUT=21 +CONFIG_RCU_TRACE=y +# CONFIG_RCU_EQS_DEBUG is not set +# end of RCU Debugging + +# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set +# CONFIG_LATENCYTOP is not set +CONFIG_USER_STACKTRACE_SUPPORT=y +CONFIG_NOP_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_FENTRY=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_TRACE_CLOCK=y +CONFIG_RING_BUFFER=y +CONFIG_EVENT_TRACING=y +CONFIG_CONTEXT_SWITCH_TRACER=y +CONFIG_TRACING=y +CONFIG_GENERIC_TRACER=y +CONFIG_TRACING_SUPPORT=y +CONFIG_FTRACE=y +# CONFIG_FUNCTION_TRACER is not set +# CONFIG_PREEMPTIRQ_EVENTS is not set +# CONFIG_IRQSOFF_TRACER is not set +# CONFIG_SCHED_TRACER is not set +# CONFIG_HWLAT_TRACER is not set +# CONFIG_FTRACE_SYSCALLS is not set +# CONFIG_TRACER_SNAPSHOT is not set +CONFIG_BRANCH_PROFILE_NONE=y +# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set +# CONFIG_PROFILE_ALL_BRANCHES is not set +# CONFIG_STACK_TRACER is not set +CONFIG_BLK_DEV_IO_TRACE=y +CONFIG_KPROBE_EVENTS=y +CONFIG_UPROBE_EVENTS=y +CONFIG_BPF_EVENTS=y +CONFIG_DYNAMIC_EVENTS=y +CONFIG_PROBE_EVENTS=y +CONFIG_BPF_KPROBE_OVERRIDE=y +# CONFIG_FTRACE_STARTUP_TEST is not set +# CONFIG_MMIOTRACE is not set +# CONFIG_HIST_TRIGGERS is not set +# CONFIG_TRACE_EVENT_INJECT is not set +# CONFIG_TRACEPOINT_BENCHMARK is not set +# CONFIG_RING_BUFFER_BENCHMARK is not set +# CONFIG_RING_BUFFER_STARTUP_TEST is not set +# CONFIG_PREEMPTIRQ_DELAY_TEST is not set +# CONFIG_TRACE_EVAL_MAP_FILE is not set +CONFIG_PROVIDE_OHCI1394_DMA_INIT=y +# CONFIG_SAMPLES is not set +CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y +CONFIG_STRICT_DEVMEM=y +# CONFIG_IO_STRICT_DEVMEM is not set + +# +# x86 Debugging +# +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_EARLY_PRINTK_USB=y +CONFIG_X86_VERBOSE_BOOTUP=y +CONFIG_EARLY_PRINTK=y +CONFIG_EARLY_PRINTK_DBGP=y +# CONFIG_EARLY_PRINTK_USB_XDBC is not set +# CONFIG_X86_PTDUMP is not set +# CONFIG_EFI_PGT_DUMP is not set +# CONFIG_DEBUG_WX is not set +CONFIG_DOUBLEFAULT=y +# CONFIG_DEBUG_TLBFLUSH is not set +CONFIG_HAVE_MMIOTRACE_SUPPORT=y +# CONFIG_X86_DECODER_SELFTEST is not set +CONFIG_IO_DELAY_0X80=y +# CONFIG_IO_DELAY_0XED is not set +# CONFIG_IO_DELAY_UDELAY is not set +# CONFIG_IO_DELAY_NONE is not set +CONFIG_DEBUG_BOOT_PARAMS=y +# CONFIG_CPA_DEBUG is not set +# CONFIG_DEBUG_ENTRY is not set +# CONFIG_DEBUG_NMI_SELFTEST is not set +CONFIG_X86_DEBUG_FPU=y +# CONFIG_PUNIT_ATOM_DEBUG is not set +CONFIG_UNWINDER_ORC=y +# CONFIG_UNWINDER_FRAME_POINTER is not set +# end of x86 Debugging + +# +# Kernel Testing and Coverage +# +# CONFIG_KUNIT is not set +# CONFIG_NOTIFIER_ERROR_INJECTION is not set +CONFIG_FUNCTION_ERROR_INJECTION=y +# CONFIG_FAULT_INJECTION is not set +CONFIG_ARCH_HAS_KCOV=y +CONFIG_CC_HAS_SANCOV_TRACE_PC=y +# CONFIG_KCOV is not set +CONFIG_RUNTIME_TESTING_MENU=y +# CONFIG_LKDTM is not set +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_TEST_SORT is not set +# CONFIG_KPROBES_SANITY_TEST is not set +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_RBTREE_TEST is not set +# CONFIG_REED_SOLOMON_TEST is not set +# CONFIG_INTERVAL_TREE_TEST is not set +# CONFIG_PERCPU_TEST is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_TEST_HEXDUMP is not set +# CONFIG_TEST_STRING_HELPERS is not set +# CONFIG_TEST_STRSCPY is not set +# CONFIG_TEST_KSTRTOX is not set +# CONFIG_TEST_PRINTF is not set +# CONFIG_TEST_BITMAP is not set +# CONFIG_TEST_BITFIELD is not set +# CONFIG_TEST_UUID is not set +# CONFIG_TEST_XARRAY is not set +# CONFIG_TEST_OVERFLOW is not set +# CONFIG_TEST_RHASHTABLE is not set +# CONFIG_TEST_HASH is not set +# CONFIG_TEST_IDA is not set +# CONFIG_TEST_LKM is not set +# CONFIG_TEST_VMALLOC is not set +# CONFIG_TEST_USER_COPY is not set +# CONFIG_TEST_BPF is not set +# CONFIG_TEST_BLACKHOLE_DEV is not set +# CONFIG_FIND_BIT_BENCHMARK is not set +# CONFIG_TEST_FIRMWARE is not set +# CONFIG_TEST_SYSCTL is not set +# CONFIG_TEST_UDELAY is not set +# CONFIG_TEST_STATIC_KEYS is not set +# CONFIG_TEST_KMOD is not set +# CONFIG_TEST_MEMCAT_P is not set +# CONFIG_TEST_STACKINIT is not set +# CONFIG_TEST_MEMINIT is not set +# CONFIG_MEMTEST is not set +# end of Kernel Testing and Coverage +# end of Kernel hacking diff --git a/libbpf-tools/llcstat.bpf.c b/libbpf-tools/llcstat.bpf.c new file mode 100644 index 000000000..e514e135b --- /dev/null +++ b/libbpf-tools/llcstat.bpf.c @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include "llcstat.h" + +#define MAX_ENTRIES 10240 + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, u64); + __type(value, struct info); +} infos SEC(".maps"); + +static __always_inline +int trace_event(__u64 sample_period, bool miss) +{ + u64 pid = bpf_get_current_pid_tgid(); + u32 cpu = bpf_get_smp_processor_id(); + struct info *infop, info = {}; + u64 key = pid << 32 | cpu; + + infop = bpf_map_lookup_elem(&infos, &key); + if (!infop) { + bpf_get_current_comm(info.comm, sizeof(info.comm)); + infop = &info; + } + if (miss) + infop->miss += sample_period; + else + infop->ref += sample_period; + if (infop == &info) + bpf_map_update_elem(&infos, &key, infop, 0); + return 0; +} + +SEC("perf_event/1") +int on_cache_miss(struct bpf_perf_event_data *ctx) +{ + return trace_event(ctx->sample_period, true); +} + +SEC("perf_event/2") +int on_cache_ref(struct bpf_perf_event_data *ctx) +{ + return trace_event(ctx->sample_period, false); +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/llcstat.c b/libbpf-tools/llcstat.c new file mode 100644 index 000000000..d6ec8636c --- /dev/null +++ b/libbpf-tools/llcstat.c @@ -0,0 +1,238 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on llcstat(8) from BCC by Teng Qin. +// 29-Sep-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "llcstat.h" +#include "llcstat.skel.h" +#include "trace_helpers.h" + +struct env { + int sample_period; + time_t duration; + bool verbose; +} env = { + .sample_period = 100, + .duration = 10, +}; + +static volatile bool exiting; + +const char *argp_program_version = "llcstat 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Summarize cache references and misses by PID.\n" +"\n" +"USAGE: llcstat [--help] [-c SAMPLE_PERIOD] [duration]\n"; + +static const struct argp_option opts[] = { + { "sample_period", 'c', "SAMPLE_PERIOD", 0, "Sample one in this many " + "number of cache reference / miss events" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'c': + errno = 0; + env.sample_period = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid sample period\n"); + argp_usage(state); + } + break; + case ARGP_KEY_ARG: + if (pos_args++) { + fprintf(stderr, + "unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + errno = 0; + env.duration = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid duration\n"); + argp_usage(state); + } + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +static int nr_cpus; + +static int open_and_attach_perf_event(__u64 config, int period, + struct bpf_program *prog, + struct bpf_link *links[]) +{ + struct perf_event_attr attr = { + .type = PERF_TYPE_HARDWARE, + .freq = 0, + .sample_period = period, + .config = config, + }; + int i, fd; + + for (i = 0; i < nr_cpus; i++) { + fd = syscall(__NR_perf_event_open, &attr, -1, i, -1, 0); + if (fd < 0) { + fprintf(stderr, "failed to init perf sampling: %s\n", + strerror(errno)); + return -1; + } + links[i] = bpf_program__attach_perf_event(prog, fd); + if (libbpf_get_error(links[i])) { + fprintf(stderr, "failed to attach perf event on cpu: " + "%d\n", i); + links[i] = NULL; + close(fd); + return -1; + } + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void sig_handler(int sig) +{ + exiting = true; +} + +static void print_map(struct bpf_map *map) +{ + __u64 total_ref = 0, total_miss = 0, total_hit, hit; + __u64 lookup_key = -1, next_key; + int err, fd = bpf_map__fd(map); + struct info info; + __u32 pid, cpu; + + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_lookup_elem(fd, &next_key, &info); + if (err < 0) { + fprintf(stderr, "failed to lookup infos: %d\n", err); + return; + } + hit = info.ref > info.miss ? info.ref - info.miss : 0; + pid = next_key >> 32; + cpu = next_key; + printf("%-8u %-16s %-4u %12llu %12llu %6.2f%%\n", pid, info.comm, + cpu, info.ref, info.miss, info.ref > 0 ? + hit * 1.0 / info.ref * 100 : 0); + total_miss += info.miss; + total_ref += info.ref; + lookup_key = next_key; + } + total_hit = total_ref > total_miss ? total_ref - total_miss : 0; + printf("Total References: %llu Total Misses: %llu Hit Rate: %.2f%%\n", + total_ref, total_miss, total_ref > 0 ? + total_hit * 1.0 / total_ref * 100 : 0); + + lookup_key = -1; + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_delete_elem(fd, &next_key); + if (err < 0) { + fprintf(stderr, "failed to cleanup infos: %d\n", err); + return; + } + lookup_key = next_key; + } +} + +int main(int argc, char **argv) +{ + struct bpf_link **rlinks = NULL, **mlinks = NULL; + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct llcstat_bpf *obj; + int err, i; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = llcstat_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF object\n"); + return 1; + } + + nr_cpus = libbpf_num_possible_cpus(); + mlinks = calloc(nr_cpus, sizeof(*mlinks)); + rlinks = calloc(nr_cpus, sizeof(*rlinks)); + if (!mlinks || !rlinks) { + fprintf(stderr, "failed to alloc mlinks or rlinks\n"); + goto cleanup; + } + + err = llcstat_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + if (open_and_attach_perf_event(PERF_COUNT_HW_CACHE_MISSES, + env.sample_period, + obj->progs.on_cache_miss, mlinks)) + goto cleanup; + if (open_and_attach_perf_event(PERF_COUNT_HW_CACHE_REFERENCES, + env.sample_period, + obj->progs.on_cache_ref, rlinks)) + goto cleanup; + + printf("Running for %ld seconds or Hit Ctrl-C to end.\n", env.duration); + + signal(SIGINT, sig_handler); + + sleep(env.duration); + + printf("%-8s %-16s %-4s %12s %12s %7s\n", + "PID", "NAME", "CPU", "REFERENCE", "MISS", "HIT%"); + + print_map(obj->maps.infos); + +cleanup: + for (i = 0; i < nr_cpus; i++) { + bpf_link__destroy(mlinks[i]); + bpf_link__destroy(rlinks[i]); + } + free(mlinks); + free(rlinks); + llcstat_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/llcstat.h b/libbpf-tools/llcstat.h new file mode 100644 index 000000000..8123cd7d9 --- /dev/null +++ b/libbpf-tools/llcstat.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __LLCSTAT_H +#define __LLCSTAT_H + +#define TASK_COMM_LEN 16 + +struct info { + __u64 ref; + __u64 miss; + char comm[TASK_COMM_LEN]; +}; + +#endif /* __LLCSTAT_H */ diff --git a/libbpf-tools/map_helpers.c b/libbpf-tools/map_helpers.c new file mode 100644 index 000000000..5b562a295 --- /dev/null +++ b/libbpf-tools/map_helpers.c @@ -0,0 +1,106 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Anton Protopopov +#include +#include +#include + +#include "map_helpers.h" + +#define warn(...) fprintf(stderr, __VA_ARGS__) + +static bool batch_map_ops = true; /* hope for the best */ + +static int +dump_hash_iter(int map_fd, void *keys, __u32 key_size, + void *values, __u32 value_size, __u32 *count, + void *invalid_key) +{ + __u8 key[key_size], next_key[key_size]; + __u32 n = 0; + int err; + + /* First get keys */ + __builtin_memcpy(key, invalid_key, key_size); + while (n < *count) { + err = bpf_map_get_next_key(map_fd, key, next_key); + if (err && errno != ENOENT) { + return -1; + } else if (err) { + break; + } + __builtin_memcpy(key, next_key, key_size); + __builtin_memcpy(keys + key_size * n, next_key, key_size); + n++; + } + + /* Now read values */ + for (int i = 0; i < n; i++) { + err = bpf_map_lookup_elem(map_fd, keys + key_size * i, + values + value_size * i); + if (err) + return -1; + } + + *count = n; + return 0; +} + +static int +dump_hash_batch(int map_fd, void *keys, __u32 key_size, + void *values, __u32 value_size, __u32 *count) +{ + void *in = NULL, *out; + __u32 n, n_read = 0; + int err = 0; + + while (n_read < *count && !err) { + n = *count - n_read; + err = bpf_map_lookup_batch(map_fd, &in, &out, + keys + n_read * key_size, + values + n_read * value_size, + &n, NULL); + if (err && errno != ENOENT) { + return -1; + } + n_read += n; + in = out; + } + + *count = n_read; + return 0; +} + +int dump_hash(int map_fd, + void *keys, __u32 key_size, + void *values, __u32 value_size, + __u32 *count, void *invalid_key) +{ + int err; + + if (!keys || !values || !count || !key_size || !value_size) { + errno = EINVAL; + return -1; + } + + if (batch_map_ops) { + err = dump_hash_batch(map_fd, keys, key_size, + values, value_size, count); + if (err) { + if (errno != EINVAL) { + return -1; + + /* assume that batch operations are not + * supported and try non-batch mode */ + batch_map_ops = false; + } + } + } + + if (!invalid_key) { + errno = EINVAL; + return -1; + } + + return dump_hash_iter(map_fd, keys, key_size, + values, value_size, count, invalid_key); +} diff --git a/libbpf-tools/map_helpers.h b/libbpf-tools/map_helpers.h new file mode 100644 index 000000000..2d5cb0227 --- /dev/null +++ b/libbpf-tools/map_helpers.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +/* Copyright (c) 2020 Anton Protopopov */ +#ifndef __MAP_HELPERS_H +#define __MAP_HELPERS_H + +#include + +int dump_hash(int map_fd, void *keys, __u32 key_size, + void *values, __u32 value_size, __u32 *count, void *invalid_key); + +#endif /* __MAP_HELPERS_H */ diff --git a/libbpf-tools/maps.bpf.h b/libbpf-tools/maps.bpf.h new file mode 100644 index 000000000..51d1012b5 --- /dev/null +++ b/libbpf-tools/maps.bpf.h @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Anton Protopopov +#ifndef __MAPS_BPF_H +#define __MAPS_BPF_H + +#include +#include + +static __always_inline void * +bpf_map_lookup_or_try_init(void *map, const void *key, const void *init) +{ + void *val; + long err; + + val = bpf_map_lookup_elem(map, key); + if (val) + return val; + + err = bpf_map_update_elem(map, key, init, BPF_NOEXIST); + if (err && err != -EEXIST) + return 0; + + return bpf_map_lookup_elem(map, key); +} + +#endif /* __MAPS_BPF_H */ diff --git a/libbpf-tools/numamove.bpf.c b/libbpf-tools/numamove.bpf.c new file mode 100644 index 000000000..f4f0d5461 --- /dev/null +++ b/libbpf-tools/numamove.bpf.c @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 10240); + __type(key, u32); + __type(value, u64); + __uint(map_flags, BPF_F_NO_PREALLOC); +} start SEC(".maps"); + +__u64 latency = 0; +__u64 num = 0; + +SEC("fentry/migrate_misplaced_page") +int BPF_PROG(migrate_misplaced_page) +{ + u32 pid = bpf_get_current_pid_tgid(); + u64 ts = bpf_ktime_get_ns(); + + bpf_map_update_elem(&start, &pid, &ts, 0); + return 0; +} + +SEC("fexit/migrate_misplaced_page") +int BPF_PROG(migrate_misplaced_page_exit) +{ + u32 pid = bpf_get_current_pid_tgid(); + u64 *tsp, ts = bpf_ktime_get_ns(); + s64 delta; + + tsp = bpf_map_lookup_elem(&start, &pid); + if (!tsp) + return 0; + delta = (s64)(ts - *tsp); + if (delta < 0) + goto cleanup; + __sync_fetch_and_add(&latency, delta / 1000000U); + __sync_fetch_and_add(&num, 1); + +cleanup: + bpf_map_delete_elem(&start, &pid); + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/numamove.c b/libbpf-tools/numamove.c new file mode 100644 index 000000000..fa4fa1355 --- /dev/null +++ b/libbpf-tools/numamove.c @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on numamove(8) from from BPF-Perf-Tools-Book by Brendan Gregg. +// 8-Jun-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include "numamove.skel.h" +#include "trace_helpers.h" + +static struct env { + bool verbose; +} env; + +static volatile bool exiting; + +const char *argp_program_version = "numamove 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Show page migrations of type NUMA misplaced per second.\n" +"\n" +"USAGE: numamove [--help]\n" +"\n" +"EXAMPLES:\n" +" numamove # Show page migrations' count and latency"; + +static const struct argp_option opts[] = { + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + switch (key) { + case 'v': + env.verbose = true; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void sig_handler(int sig) +{ + exiting = true; +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct numamove_bpf *obj; + struct tm *tm; + char ts[32]; + time_t t; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = numamove_bpf__open_and_load(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF object\n"); + return 1; + } + + err = numamove_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs\n"); + goto cleanup; + } + + signal(SIGINT, sig_handler); + + printf("%-10s %18s %18s\n", "TIME", "NUMA_migrations", + "NUMA_migrations_ms"); + while (!exiting) { + sleep(1); + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + printf("%-10s %18lld %18lld\n", ts, + __atomic_exchange_n(&obj->bss->num, 0, + __ATOMIC_RELAXED), + __atomic_exchange_n(&obj->bss->latency, 0, + __ATOMIC_RELAXED)); + } + +cleanup: + numamove_bpf__destroy(obj); + return err != 0; +} diff --git a/libbpf-tools/opensnoop.bpf.c b/libbpf-tools/opensnoop.bpf.c new file mode 100644 index 000000000..eb8516d97 --- /dev/null +++ b/libbpf-tools/opensnoop.bpf.c @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2019 Facebook +// Copyright (c) 2020 Netflix +#include "vmlinux.h" +#include +#include "opensnoop.h" + +#define TASK_RUNNING 0 + +const volatile __u64 min_us = 0; +const volatile pid_t targ_pid = 0; +const volatile pid_t targ_tgid = 0; +const volatile uid_t targ_uid = 0; +const volatile bool targ_failed = false; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 10240); + __type(key, u32); + __type(value, struct args_t); +} start SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); + __uint(key_size, sizeof(u32)); + __uint(value_size, sizeof(u32)); +} events SEC(".maps"); + +static __always_inline bool valid_uid(uid_t uid) { + return uid != INVALID_UID; +} + +static __always_inline +bool trace_allowed(u32 tgid, u32 pid) +{ + u32 uid; + + /* filters */ + if (targ_tgid && targ_tgid != tgid) + return false; + if (targ_pid && targ_pid != pid) + return false; + if (valid_uid(targ_uid)) { + uid = (u32)bpf_get_current_uid_gid(); + if (targ_uid != uid) { + return false; + } + } + return true; +} + +SEC("tracepoint/syscalls/sys_enter_open") +int tracepoint__syscalls__sys_enter_open(struct trace_event_raw_sys_enter* ctx) +{ + u64 id = bpf_get_current_pid_tgid(); + /* use kernel terminology here for tgid/pid: */ + u32 tgid = id >> 32; + u32 pid = id; + + /* store arg info for later lookup */ + if (trace_allowed(tgid, pid)) { + struct args_t args = {}; + args.fname = (const char *)ctx->args[0]; + args.flags = (int)ctx->args[1]; + bpf_map_update_elem(&start, &pid, &args, 0); + } + return 0; +} + +SEC("tracepoint/syscalls/sys_enter_openat") +int tracepoint__syscalls__sys_enter_openat(struct trace_event_raw_sys_enter* ctx) +{ + u64 id = bpf_get_current_pid_tgid(); + /* use kernel terminology here for tgid/pid: */ + u32 tgid = id >> 32; + u32 pid = id; + + /* store arg info for later lookup */ + if (trace_allowed(tgid, pid)) { + struct args_t args = {}; + args.fname = (const char *)ctx->args[1]; + args.flags = (int)ctx->args[2]; + bpf_map_update_elem(&start, &pid, &args, 0); + } + return 0; +} + +static __always_inline +int trace_exit(struct trace_event_raw_sys_exit* ctx) +{ + struct event event = {}; + struct args_t *ap; + int ret; + u32 pid = bpf_get_current_pid_tgid(); + + ap = bpf_map_lookup_elem(&start, &pid); + if (!ap) + return 0; /* missed entry */ + ret = ctx->ret; + if (targ_failed && ret >= 0) + goto cleanup; /* want failed only */ + + /* event data */ + event.pid = bpf_get_current_pid_tgid() >> 32; + event.uid = bpf_get_current_uid_gid(); + bpf_get_current_comm(&event.comm, sizeof(event.comm)); + bpf_probe_read_user_str(&event.fname, sizeof(event.fname), ap->fname); + event.flags = ap->flags; + event.ret = ret; + + /* emit event */ + bpf_perf_event_output(ctx, &events, BPF_F_CURRENT_CPU, + &event, sizeof(event)); + +cleanup: + bpf_map_delete_elem(&start, &pid); + return 0; +} + +SEC("tracepoint/syscalls/sys_exit_open") +int tracepoint__syscalls__sys_exit_open(struct trace_event_raw_sys_exit* ctx) +{ + return trace_exit(ctx); +} + +SEC("tracepoint/syscalls/sys_exit_openat") +int tracepoint__syscalls__sys_exit_openat(struct trace_event_raw_sys_exit* ctx) +{ + return trace_exit(ctx); +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/opensnoop.c b/libbpf-tools/opensnoop.c new file mode 100644 index 000000000..37c3f50df --- /dev/null +++ b/libbpf-tools/opensnoop.c @@ -0,0 +1,297 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2019 Facebook +// Copyright (c) 2020 Netflix +// +// Based on opensnoop(8) from BCC by Brendan Gregg and others. +// 14-Feb-2020 Brendan Gregg Created this. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "opensnoop.h" +#include "opensnoop.skel.h" +#include "trace_helpers.h" + +/* Tune the buffer size and wakeup rate. These settings cope with roughly + * 50k opens/sec. + */ +#define PERF_BUFFER_PAGES 64 +#define PERF_BUFFER_TIME_MS 10 + +/* Set the poll timeout when no events occur. This can affect -d accuracy. */ +#define PERF_POLL_TIMEOUT_MS 100 + +#define NSEC_PER_SEC 1000000000ULL + +static struct env { + pid_t pid; + pid_t tid; + uid_t uid; + int duration; + bool verbose; + bool timestamp; + bool print_uid; + bool extended; + bool failed; + char *name; +} env = { + .uid = INVALID_UID +}; + +const char *argp_program_version = "opensnoop 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Trace open family syscalls\n" +"\n" +"USAGE: opensnoop [-h] [-T] [-U] [-x] [-p PID] [-t TID] [-u UID] [-d DURATION]\n" +" [-n NAME] [-e]\n" +"\n" +"EXAMPLES:\n" +" ./opensnoop # trace all open() syscalls\n" +" ./opensnoop -T # include timestamps\n" +" ./opensnoop -U # include UID\n" +" ./opensnoop -x # only show failed opens\n" +" ./opensnoop -p 181 # only trace PID 181\n" +" ./opensnoop -t 123 # only trace TID 123\n" +" ./opensnoop -u 1000 # only trace UID 1000\n" +" ./opensnoop -d 10 # trace for 10 seconds only\n" +" ./opensnoop -n main # only print process names containing \"main\"\n" +" ./opensnoop -e # show extended fields\n"; + +static const struct argp_option opts[] = { + { "duration", 'd', "DURATION", 0, "Duration to trace"}, + { "extended-fields", 'e', NULL, 0, "Print extended fields"}, + { NULL, 'h', NULL, OPTION_HIDDEN, "Show the full help"}, + { "name", 'n', "NAME", 0, "Trace process names containing this"}, + { "pid", 'p', "PID", 0, "Process ID to trace"}, + { "tid", 't', "TID", 0, "Thread ID to trace"}, + { "timestamp", 'T', NULL, 0, "Print timestamp"}, + { "uid", 'u', "UID", 0, "User ID to trace"}, + { "print-uid", 'U', NULL, 0, "Print UID"}, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + { "failed", 'x', NULL, 0, "Failed opens only"}, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args; + long int pid, uid, duration; + + switch (key) { + case 'e': + env.extended = true; + break; + case 'h': + argp_usage(state); + break; + case 'T': + env.timestamp = true; + break; + case 'U': + env.print_uid = true; + break; + case 'v': + env.verbose = true; + break; + case 'x': + env.failed = true; + break; + case 'd': + errno = 0; + duration = strtol(arg, NULL, 10); + if (errno || duration <= 0) { + fprintf(stderr, "Invalid duration: %s\n", arg); + argp_usage(state); + } + env.duration = duration; + break; + case 'n': + errno = 0; + env.name = arg; + break; + case 'p': + errno = 0; + pid = strtol(arg, NULL, 10); + if (errno || pid <= 0) { + fprintf(stderr, "Invalid PID: %s\n", arg); + argp_usage(state); + } + env.pid = pid; + break; + case 't': + errno = 0; + pid = strtol(arg, NULL, 10); + if (errno || pid <= 0) { + fprintf(stderr, "Invalid TID: %s\n", arg); + argp_usage(state); + } + env.tid = pid; + break; + case 'u': + errno = 0; + uid = strtol(arg, NULL, 10); + if (errno || uid < 0 || uid >= INVALID_UID) { + fprintf(stderr, "Invalid UID %s\n", arg); + argp_usage(state); + } + env.uid = uid; + break; + case ARGP_KEY_ARG: + if (pos_args++) { + fprintf(stderr, + "Unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + errno = 0; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +void handle_event(void *ctx, int cpu, void *data, __u32 data_sz) +{ + const struct event *e = data; + struct tm *tm; + char ts[32]; + time_t t; + int fd, err; + + /* name filtering is currently done in user space */ + if (env.name && strstr(e->comm, env.name) == NULL) + return; + + /* prepare fields */ + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + if (e->ret >= 0) { + fd = e->ret; + err = 0; + } else { + fd = -1; + err = - e->ret; + } + + /* print output */ + if (env.timestamp) + printf("%-8s ", ts); + if (env.print_uid) + printf("%-6d ", e->uid); + printf("%-6d %-16s %3d %3d ", e->pid, e->comm, fd, err); + if (env.extended) + printf("%08o ", e->flags); + printf("%s\n", e->fname); +} + +void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt) +{ + fprintf(stderr, "Lost %llu events on CPU #%d!\n", lost_cnt, cpu); +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct perf_buffer_opts pb_opts; + struct perf_buffer *pb = NULL; + struct opensnoop_bpf *obj; + __u64 time_end = 0; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = opensnoop_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF object\n"); + return 1; + } + + /* initialize global data (filtering options) */ + obj->rodata->targ_tgid = env.pid; + obj->rodata->targ_pid = env.tid; + obj->rodata->targ_uid = env.uid; + obj->rodata->targ_failed = env.failed; + + err = opensnoop_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + err = opensnoop_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs\n"); + goto cleanup; + } + + /* print headers */ + if (env.timestamp) + printf("%-8s ", "TIME"); + if (env.print_uid) + printf("%-6s ", "UID"); + printf("%-6s %-16s %3s %3s ", "PID", "COMM", "FD", "ERR"); + if (env.extended) + printf("%-8s ", "FLAGS"); + printf("%s\n", "PATH"); + + /* setup event callbacks */ + pb_opts.sample_cb = handle_event; + pb_opts.lost_cb = handle_lost_events; + pb = perf_buffer__new(bpf_map__fd(obj->maps.events), PERF_BUFFER_PAGES, + &pb_opts); + err = libbpf_get_error(pb); + if (err) { + pb = NULL; + fprintf(stderr, "failed to open perf buffer: %d\n", err); + goto cleanup; + } + + /* setup duration */ + if (env.duration) + time_end = get_ktime_ns() + env.duration * NSEC_PER_SEC; + + /* main: poll */ + while (1) { + usleep(PERF_BUFFER_TIME_MS * 1000); + if ((err = perf_buffer__poll(pb, PERF_POLL_TIMEOUT_MS)) < 0) + break; + if (env.duration && get_ktime_ns() > time_end) + goto cleanup; + } + printf("Error polling perf buffer: %d\n", err); + +cleanup: + perf_buffer__free(pb); + opensnoop_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/opensnoop.h b/libbpf-tools/opensnoop.h new file mode 100644 index 000000000..70bfdfc06 --- /dev/null +++ b/libbpf-tools/opensnoop.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __OPENSNOOP_H +#define __OPENSNOOP_H + +#define TASK_COMM_LEN 16 +#define NAME_MAX 255 +#define INVALID_UID ((uid_t)-1) + +struct args_t { + const char *fname; + int flags; +}; + +struct event { + /* user terminology for pid: */ + __u64 ts; + pid_t pid; + uid_t uid; + int ret; + int flags; + char comm[TASK_COMM_LEN]; + char fname[NAME_MAX]; +}; + +#endif /* __OPENSNOOP_H */ diff --git a/libbpf-tools/readahead.bpf.c b/libbpf-tools/readahead.bpf.c new file mode 100644 index 000000000..4f4e5eee9 --- /dev/null +++ b/libbpf-tools/readahead.bpf.c @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include "readahead.h" +#include "bits.bpf.h" + +#define MAX_ENTRIES 10240 + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, u32); + __type(value, u64); + __uint(map_flags, BPF_F_NO_PREALLOC); +} in_readahead SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct page *); + __type(value, u64); + __uint(map_flags, BPF_F_NO_PREALLOC); +} birth SEC(".maps"); + +static struct hist hist; + +SEC("fentry/__do_page_cache_readahead") +int BPF_PROG(do_page_cache_readahead) +{ + u32 pid = bpf_get_current_pid_tgid(); + u64 one = 1; + + bpf_map_update_elem(&in_readahead, &pid, &one, 0); + return 0; +} + +SEC("fexit/__page_cache_alloc") +int BPF_PROG(page_cache_alloc_ret, gfp_t gfp, struct page *ret) +{ + u32 pid = bpf_get_current_pid_tgid(); + u64 ts; + + if (!bpf_map_lookup_elem(&in_readahead, &pid)) + return 0; + + ts = bpf_ktime_get_ns(); + bpf_map_update_elem(&birth, &ret, &ts, 0); + __sync_fetch_and_add(&hist.unused, 1); + __sync_fetch_and_add(&hist.total, 1); + + return 0; +} + +SEC("fexit/__do_page_cache_readahead") +int BPF_PROG(do_page_cache_readahead_ret) +{ + u32 pid = bpf_get_current_pid_tgid(); + + bpf_map_delete_elem(&in_readahead, &pid); + return 0; +} + +SEC("fentry/mark_page_accessed") +int BPF_PROG(mark_page_accessed, struct page *page) +{ + u64 *tsp, slot, ts = bpf_ktime_get_ns(); + s64 delta; + + tsp = bpf_map_lookup_elem(&birth, &page); + if (!tsp) + return 0; + delta = (s64)(ts - *tsp); + if (delta < 0) + goto update_and_cleanup; + slot = log2l(delta / 1000000U); + if (slot >= MAX_SLOTS) + slot = MAX_SLOTS - 1; + __sync_fetch_and_add(&hist.slots[slot], 1); + +update_and_cleanup: + __sync_fetch_and_add(&hist.unused, -1); + bpf_map_delete_elem(&birth, &page); + + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/readahead.c b/libbpf-tools/readahead.c new file mode 100644 index 000000000..f2460af8b --- /dev/null +++ b/libbpf-tools/readahead.c @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on readahead(8) from from BPF-Perf-Tools-Book by Brendan Gregg. +// 8-Jun-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include "readahead.h" +#include "readahead.skel.h" +#include "trace_helpers.h" + +static struct env { + int duration; + bool verbose; +} env = { + .duration = -1 +}; + +static volatile bool exiting; + +const char *argp_program_version = "readahead 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Show fs automatic read-ahead usage.\n" +"\n" +"USAGE: readahead [--help] [-d DURATION]\n" +"\n" +"EXAMPLES:\n" +" readahead # summarize on-CPU time as a histogram" +" readahead -d 10 # trace for 10 seconds only\n"; + +static const struct argp_option opts[] = { + { "duration", 'd', "DURATION", 0, "Duration to trace"}, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + switch (key) { + case 'v': + env.verbose = true; + break; + case 'd': + errno = 0; + env.duration = strtol(arg, NULL, 10); + if (errno || env.duration <= 0) { + fprintf(stderr, "Invalid duration: %s\n", arg); + argp_usage(state); + } + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void sig_handler(int sig) +{ + exiting = true; +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct readahead_bpf *obj; + struct hist *histp; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = readahead_bpf__open_and_load(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF ojbect\n"); + return 1; + } + + err = readahead_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs\n"); + goto cleanup; + } + + signal(SIGINT, sig_handler); + + printf("Tracing fs read-ahead ... Hit Ctrl-C to end.\n"); + + sleep(env.duration); + printf("\n"); + + histp = &obj->bss->hist; + + printf("Readahead unused/total pages: %d/%d\n", + histp->unused, histp->total); + print_log2_hist(histp->slots, MAX_SLOTS, "msecs"); + +cleanup: + readahead_bpf__destroy(obj); + return err != 0; +} diff --git a/libbpf-tools/readahead.h b/libbpf-tools/readahead.h new file mode 100644 index 000000000..15dc02647 --- /dev/null +++ b/libbpf-tools/readahead.h @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +#ifndef __READAHEAD_H +#define __READAHEAD_H + +#define MAX_SLOTS 20 + +struct hist { + __u32 unused; + __u32 total; + __u32 slots[MAX_SLOTS]; +}; + +#endif /* __READAHEAD_H */ diff --git a/libbpf-tools/runqlat.bpf.c b/libbpf-tools/runqlat.bpf.c new file mode 100644 index 000000000..258407cbc --- /dev/null +++ b/libbpf-tools/runqlat.bpf.c @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include +#include "runqlat.h" +#include "bits.bpf.h" +#include "maps.bpf.h" + +#define MAX_ENTRIES 10240 +#define TASK_RUNNING 0 + +const volatile bool targ_per_process = false; +const volatile bool targ_per_thread = false; +const volatile bool targ_per_pidns = false; +const volatile bool targ_ms = false; +const volatile pid_t targ_tgid = 0; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, u32); + __type(value, u64); +} start SEC(".maps"); + +static struct hist zero; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, u32); + __type(value, struct hist); +} hists SEC(".maps"); + +static __always_inline +int trace_enqueue(u32 tgid, u32 pid) +{ + u64 ts; + + if (!pid) + return 0; + if (targ_tgid && targ_tgid != tgid) + return 0; + + ts = bpf_ktime_get_ns(); + bpf_map_update_elem(&start, &pid, &ts, 0); + return 0; +} + +SEC("tp_btf/sched_wakeup") +int BPF_PROG(sched_wakeup, struct task_struct *p) +{ + return trace_enqueue(p->tgid, p->pid); +} + +SEC("tp_btf/sched_wakeup_new") +int BPF_PROG(sched_wakeup_new, struct task_struct *p) +{ + return trace_enqueue(p->tgid, p->pid); +} + +SEC("tp_btf/sched_switch") +int BPF_PROG(sched_swith, bool preempt, struct task_struct *prev, + struct task_struct *next) +{ + struct hist *histp; + u64 *tsp, slot; + u32 pid, hkey; + s64 delta; + + if (prev->state == TASK_RUNNING) + trace_enqueue(prev->tgid, prev->pid); + + pid = next->pid; + + tsp = bpf_map_lookup_elem(&start, &pid); + if (!tsp) + return 0; + delta = bpf_ktime_get_ns() - *tsp; + if (delta < 0) + goto cleanup; + + if (targ_per_process) + hkey = next->tgid; + else if (targ_per_thread) + hkey = pid; + else if (targ_per_pidns) + hkey = next->nsproxy->pid_ns_for_children->ns.inum; + else + hkey = -1; + histp = bpf_map_lookup_or_try_init(&hists, &hkey, &zero); + if (!histp) + goto cleanup; + if (!histp->comm[0]) + bpf_probe_read_kernel_str(&histp->comm, sizeof(histp->comm), + next->comm); + if (targ_ms) + delta /= 1000000U; + else + delta /= 1000U; + slot = log2l(delta); + if (slot >= MAX_SLOTS) + slot = MAX_SLOTS - 1; + __sync_fetch_and_add(&histp->slots[slot], 1); + +cleanup: + bpf_map_delete_elem(&start, &pid); + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/runqlat.c b/libbpf-tools/runqlat.c new file mode 100644 index 000000000..12cc40081 --- /dev/null +++ b/libbpf-tools/runqlat.c @@ -0,0 +1,253 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on runqlat(8) from BCC by Bredan Gregg. +// 10-Aug-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "runqlat.h" +#include "runqlat.skel.h" +#include "trace_helpers.h" + +struct env { + time_t interval; + pid_t pid; + int times; + bool milliseconds; + bool per_process; + bool per_thread; + bool per_pidns; + bool timestamp; + bool verbose; +} env = { + .interval = 99999999, + .times = 99999999, +}; + +static volatile bool exiting; + +const char *argp_program_version = "runqlat 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Summarize run queue (scheduler) latency as a histogram.\n" +"\n" +"USAGE: runqlat [--help] [-T] [-m] [--pidnss] [-L] [-P] [-p PID] [interval] [count]\n" +"\n" +"EXAMPLES:\n" +" runqlat # summarize run queue latency as a histogram\n" +" runqlat 1 10 # print 1 second summaries, 10 times\n" +" runqlat -mT 1 # 1s summaries, milliseconds, and timestamps\n" +" runqlat -P # show each PID separately\n" +" runqlat -p 185 # trace PID 185 only\n"; + +#define OPT_PIDNSS 1 /* --pidnss */ + +static const struct argp_option opts[] = { + { "timestamp", 'T', NULL, 0, "Include timestamp on output" }, + { "milliseconds", 'm', NULL, 0, "Millisecond histogram" }, + { "pidnss", OPT_PIDNSS, NULL, 0, "Print a histogram per PID namespace" }, + { "pids", 'P', NULL, 0, "Print a histogram per process ID" }, + { "tids", 'L', NULL, 0, "Print a histogram per thread ID" }, + { "pid", 'p', "PID", 0, "Trace this PID only" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'm': + env.milliseconds = true; + break; + case 'p': + errno = 0; + env.pid = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid PID: %s\n", arg); + argp_usage(state); + } + break; + case 'L': + env.per_thread = true; + break; + case 'P': + env.per_process = true; + break; + case OPT_PIDNSS: + env.per_pidns = true; + break; + case 'T': + env.timestamp = true; + break; + case ARGP_KEY_ARG: + errno = 0; + if (pos_args == 0) { + env.interval = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid internal\n"); + argp_usage(state); + } + } else if (pos_args == 1) { + env.times = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid times\n"); + argp_usage(state); + } + } else { + fprintf(stderr, + "unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + pos_args++; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void sig_handler(int sig) +{ + exiting = true; +} + +static int print_log2_hists(struct bpf_map *hists) +{ + const char *units = env.milliseconds ? "msecs" : "usecs"; + int err, fd = bpf_map__fd(hists); + __u32 lookup_key = -2, next_key; + struct hist hist; + + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_lookup_elem(fd, &next_key, &hist); + if (err < 0) { + fprintf(stderr, "failed to lookup hist: %d\n", err); + return -1; + } + if (env.per_process) + printf("\npid = %d %s\n", next_key, hist.comm); + else if (env.per_thread) + printf("\ntid = %d %s\n", next_key, hist.comm); + else if (env.per_pidns) + printf("\npidns = %u %s\n", next_key, hist.comm); + print_log2_hist(hist.slots, MAX_SLOTS, units); + lookup_key = next_key; + } + + lookup_key = -2; + while (!bpf_map_get_next_key(fd, &lookup_key, &next_key)) { + err = bpf_map_delete_elem(fd, &next_key); + if (err < 0) { + fprintf(stderr, "failed to cleanup hist : %d\n", err); + return -1; + } + lookup_key = next_key; + } + return 0; +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct runqlat_bpf *obj; + struct tm *tm; + char ts[32]; + time_t t; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + if ((env.per_thread && (env.per_process || env.per_pidns)) || + (env.per_process && env.per_pidns)) { + fprintf(stderr, "pidnss, pids, tids cann't be used together.\n"); + return 1; + } + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = runqlat_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF object\n"); + return 1; + } + + /* initialize global data (filtering options) */ + obj->rodata->targ_per_process = env.per_process; + obj->rodata->targ_per_thread = env.per_thread; + obj->rodata->targ_per_pidns = env.per_pidns; + obj->rodata->targ_ms = env.milliseconds; + obj->rodata->targ_tgid = env.pid; + + err = runqlat_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + err = runqlat_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs\n"); + goto cleanup; + } + + printf("Tracing run queue latency... Hit Ctrl-C to end.\n"); + + signal(SIGINT, sig_handler); + + /* main: poll */ + while (1) { + sleep(env.interval); + printf("\n"); + + if (env.timestamp) { + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + printf("%-8s\n", ts); + } + + err = print_log2_hists(obj->maps.hists); + if (err) + break; + + if (exiting || --env.times == 0) + break; + } + +cleanup: + runqlat_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/runqlat.h b/libbpf-tools/runqlat.h new file mode 100644 index 000000000..6a7ac9f3f --- /dev/null +++ b/libbpf-tools/runqlat.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __RUNQLAT_H +#define __RUNQLAT_H + +#define TASK_COMM_LEN 16 +#define MAX_SLOTS 26 + +struct hist { + __u32 slots[MAX_SLOTS]; + char comm[TASK_COMM_LEN]; +}; + +#endif /* __RUNQLAT_H */ diff --git a/libbpf-tools/runqlen.bpf.c b/libbpf-tools/runqlen.bpf.c new file mode 100644 index 000000000..ae2493b29 --- /dev/null +++ b/libbpf-tools/runqlen.bpf.c @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include +#include "runqlen.h" + +const volatile bool targ_per_cpu = false; + +struct hist hists[MAX_CPU_NR] = {}; + +SEC("perf_event") +int do_sample(struct bpf_perf_event_data *ctx) +{ + struct task_struct *task; + struct hist *hist; + u64 slot, cpu = 0; + + task = (void*)bpf_get_current_task(); + slot = BPF_CORE_READ(task, se.cfs_rq, nr_running); + /* + * Calculate run queue length by subtracting the currently running task, + * if present. len 0 == idle, len 1 == one running task. + */ + if (slot > 0) + slot--; + if (targ_per_cpu) { + cpu = bpf_get_smp_processor_id(); + /* + * When the program is started, the user space will immediately + * exit when it detects this situation, here just to pass the + * verifier's check. + */ + if (cpu >= MAX_CPU_NR) + return 0; + } + hist = &hists[cpu]; + if (slot >= MAX_SLOTS) + slot = MAX_SLOTS - 1; + if (targ_per_cpu) + hist->slots[slot]++; + else + __sync_fetch_and_add(&hist->slots[slot], 1); + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/runqlen.c b/libbpf-tools/runqlen.c new file mode 100644 index 000000000..e1a2445fc --- /dev/null +++ b/libbpf-tools/runqlen.c @@ -0,0 +1,286 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on runqlen(8) from BCC by Brendan Gregg. +// 11-Sep-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "runqlen.h" +#include "runqlen.skel.h" +#include "trace_helpers.h" + +#define FREQ 99 + +#define max(x, y) ({ \ + typeof(x) _max1 = (x); \ + typeof(y) _max2 = (y); \ + (void) (&_max1 == &_max2); \ + _max1 > _max2 ? _max1 : _max2; }) + +struct env { + bool per_cpu; + bool runqocc; + bool timestamp; + time_t interval; + int times; + bool verbose; +} env = { + .interval = 99999999, + .times = 99999999, +}; + +static volatile bool exiting; + +const char *argp_program_version = "runqlen 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Summarize scheduler run queue length as a histogram.\n" +"\n" +"USAGE: runqlen [--help] [-C] [-O] [-T] [interval] [count]\n" +"\n" +"EXAMPLES:\n" +" runqlen # summarize run queue length as a histogram\n" +" runqlen 1 10 # print 1 second summaries, 10 times\n" +" runqlen -T 1 # 1s summaries and timestamps\n" +" runqlen -O # report run queue occupancy\n" +" runqlen -C # show each CPU separately\n"; + +static const struct argp_option opts[] = { + { "cpus", 'C', NULL, 0, "Print output for each CPU separately" }, + { "runqocc", 'O', NULL, 0, "Report run queue occupancy" }, + { "timestamp", 'T', NULL, 0, "Include timestamp on output" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'C': + env.per_cpu = true; + break; + case 'O': + env.runqocc = true; + break; + case 'T': + env.timestamp = true; + break; + case ARGP_KEY_ARG: + errno = 0; + if (pos_args == 0) { + env.interval = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid internal\n"); + argp_usage(state); + } + } else if (pos_args == 1) { + env.times = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid times\n"); + argp_usage(state); + } + } else { + fprintf(stderr, + "unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + pos_args++; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +static int nr_cpus; + +static int open_and_attach_perf_event(int freq, struct bpf_program *prog, + struct bpf_link *links[]) +{ + struct perf_event_attr attr = { + .type = PERF_TYPE_SOFTWARE, + .freq = 1, + .sample_period = freq, + .config = PERF_COUNT_SW_CPU_CLOCK, + }; + int i, fd; + + for (i = 0; i < nr_cpus; i++) { + fd = syscall(__NR_perf_event_open, &attr, -1, i, -1, 0); + if (fd < 0) { + fprintf(stderr, "failed to init perf sampling: %s\n", + strerror(errno)); + return -1; + } + links[i] = bpf_program__attach_perf_event(prog, fd); + if (libbpf_get_error(links[i])) { + fprintf(stderr, "failed to attach perf event on cpu: " + "%d\n", i); + links[i] = NULL; + close(fd); + return -1; + } + } + + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void sig_handler(int sig) +{ + exiting = true; +} + +static struct hist zero; + +static void print_runq_occupancy(struct runqlen_bpf__bss *bss) +{ + __u64 samples, idle = 0, queued = 0; + struct hist hist; + int slot, i = 0; + float runqocc; + + do { + hist = bss->hists[i]; + bss->hists[i] = zero; + for (slot = 0; slot < MAX_SLOTS; slot++) { + __u64 val = hist.slots[slot]; + + if (slot == 0) + idle += val; + else + queued += val; + } + samples = idle + queued; + runqocc = queued * 1.0 / max(1ULL, samples); + if (env.per_cpu) + printf("runqocc, CPU %-3d %6.2f%%\n", i, + 100 * runqocc); + else + printf("runqocc: %0.2f%%\n", 100 * runqocc); + } while (env.per_cpu && ++i < nr_cpus); +} + +static void print_linear_hists(struct runqlen_bpf__bss *bss) +{ + struct hist hist; + int i = 0; + + do { + hist = bss->hists[i]; + bss->hists[i] = zero; + if (env.per_cpu) + printf("cpu = %d\n", i); + print_linear_hist(hist.slots, MAX_SLOTS, "runqlen"); + } while (env.per_cpu && ++i < nr_cpus); +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct bpf_link **links = NULL; + struct runqlen_bpf *obj; + struct tm *tm; + char ts[32]; + int err, i; + time_t t; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = runqlen_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF object\n"); + return 1; + } + + nr_cpus = libbpf_num_possible_cpus(); + if (nr_cpus > MAX_CPU_NR) { + fprintf(stderr, "The number of cpu cores is too much, please " + "increase MAX_CPU_NR's value and recompile"); + return 1; + } + links = calloc(nr_cpus, sizeof(*links)); + if (!links) { + fprintf(stderr, "failed to alloc links\n"); + goto cleanup; + } + + /* initialize global data (filtering options) */ + obj->rodata->targ_per_cpu = env.per_cpu; + + err = runqlen_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + if (open_and_attach_perf_event(FREQ, obj->progs.do_sample, links)) + goto cleanup; + + printf("Sampling run queue length... Hit Ctrl-C to end.\n"); + + signal(SIGINT, sig_handler); + + while (1) { + sleep(env.interval); + printf("\n"); + + if (env.timestamp) { + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + printf("%-8s\n", ts); + } + + if (env.runqocc) + print_runq_occupancy(obj->bss); + else + print_linear_hists(obj->bss); + + if (exiting || --env.times == 0) + break; + } + +cleanup: + for (i = 0; i < nr_cpus; i++) + bpf_link__destroy(links[i]); + free(links); + runqlen_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/runqlen.h b/libbpf-tools/runqlen.h new file mode 100644 index 000000000..605272898 --- /dev/null +++ b/libbpf-tools/runqlen.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __RUNQLEN_H +#define __RUNQLEN_H + +#define MAX_CPU_NR 128 +#define MAX_SLOTS 32 + +struct hist { + __u32 slots[MAX_SLOTS]; +}; + +#endif /* __RUNQLEN_H */ diff --git a/libbpf-tools/runqslower.bpf.c b/libbpf-tools/runqslower.bpf.c index 09abab252..12e26888f 100644 --- a/libbpf-tools/runqslower.bpf.c +++ b/libbpf-tools/runqslower.bpf.c @@ -4,10 +4,7 @@ #include #include "runqslower.h" -#define TASK_RUNNING 0 - -#define BPF_F_INDEX_MASK 0xffffffffULL -#define BPF_F_CURRENT_CPU BPF_F_INDEX_MASK +#define TASK_RUNNING 0 const volatile __u64 min_us = 0; const volatile pid_t targ_pid = 0; @@ -92,7 +89,7 @@ int handle__sched_switch(u64 *ctx) event.pid = pid; event.delta_us = delta_us; - bpf_probe_read_str(&event.task, sizeof(event.task), next->comm); + bpf_probe_read_kernel_str(&event.task, sizeof(event.task), next->comm); /* output */ bpf_perf_event_output(ctx, &events, BPF_F_CURRENT_CPU, diff --git a/libbpf-tools/runqslower.c b/libbpf-tools/runqslower.c index 5b1a97435..7c598a5a5 100644 --- a/libbpf-tools/runqslower.c +++ b/libbpf-tools/runqslower.c @@ -7,12 +7,12 @@ #include #include #include -#include #include #include #include #include "runqslower.h" #include "runqslower.skel.h" +#include "trace_helpers.h" struct env { pid_t pid; @@ -99,16 +99,6 @@ int libbpf_print_fn(enum libbpf_print_level level, return vfprintf(stderr, format, args); } -static int bump_memlock_rlimit(void) -{ - struct rlimit rlim_new = { - .rlim_cur = RLIM_INFINITY, - .rlim_max = RLIM_INFINITY, - }; - - return setrlimit(RLIMIT_MEMLOCK, &rlim_new); -} - void handle_event(void *ctx, int cpu, void *data, __u32 data_sz) { const struct event *e = data; diff --git a/libbpf-tools/softirqs.bpf.c b/libbpf-tools/softirqs.bpf.c new file mode 100644 index 000000000..44812ce82 --- /dev/null +++ b/libbpf-tools/softirqs.bpf.c @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include "softirqs.h" +#include "bits.bpf.h" +#include "maps.bpf.h" + +const volatile bool targ_dist = false; +const volatile bool targ_ns = false; + +struct { + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); + __uint(max_entries, 1); + __type(key, u32); + __type(value, u64); +} start SEC(".maps"); + +__u64 counts[NR_SOFTIRQS] = {}; +struct hist hists[NR_SOFTIRQS] = {}; + +SEC("tp_btf/softirq_entry") +int BPF_PROG(softirq_entry, unsigned int vec_nr) +{ + u64 ts = bpf_ktime_get_ns(); + u32 key = 0; + + bpf_map_update_elem(&start, &key, &ts, 0); + return 0; +} + +SEC("tp_btf/softirq_exit") +int BPF_PROG(softirq_exit, unsigned int vec_nr) +{ + u32 key = 0; + s64 delta; + u64 *tsp; + + if (vec_nr >= NR_SOFTIRQS) + return 0; + tsp = bpf_map_lookup_elem(&start, &key); + if (!tsp || !*tsp) + return 0; + delta = bpf_ktime_get_ns() - *tsp; + if (delta < 0) + return 0; + if (!targ_ns) + delta /= 1000U; + + if (!targ_dist) { + __sync_fetch_and_add(&counts[vec_nr], delta); + } else { + struct hist *hist; + u64 slot; + + hist = &hists[vec_nr]; + slot = log2(delta); + if (slot >= MAX_SLOTS) + slot = MAX_SLOTS - 1; + __sync_fetch_and_add(&hist->slots[slot], 1); + } + + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/softirqs.c b/libbpf-tools/softirqs.c new file mode 100644 index 000000000..b23bfa163 --- /dev/null +++ b/libbpf-tools/softirqs.c @@ -0,0 +1,255 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on softirq(8) from BCC by Brendan Gregg & Sasha Goldshtein. +// 15-Aug-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "softirqs.h" +#include "softirqs.skel.h" +#include "trace_helpers.h" + +struct env { + bool distributed; + bool nanoseconds; + time_t interval; + int times; + bool timestamp; + bool verbose; +} env = { + .interval = 99999999, + .times = 99999999, +}; + +static volatile bool exiting; + +const char *argp_program_version = "softirqs 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Summarize soft irq event time as histograms.\n" +"\n" +"USAGE: softirqs [--help] [-T] [-N] [-d] [interval] [count]\n" +"\n" +"EXAMPLES:\n" +" softirqss # sum soft irq event time\n" +" softirqss -d # show soft irq event time as histograms\n" +" softirqss 1 10 # print 1 second summaries, 10 times\n" +" softirqss -NT 1 # 1s summaries, nanoseconds, and timestamps\n"; + +static const struct argp_option opts[] = { + { "distributed", 'd', NULL, 0, "Show distributions as histograms" }, + { "timestamp", 'T', NULL, 0, "Include timestamp on output" }, + { "nanoseconds", 'N', NULL, 0, "Output in nanoseconds" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'd': + env.distributed = true; + break; + case 'N': + env.nanoseconds = true; + break; + case 'T': + env.timestamp = true; + break; + case ARGP_KEY_ARG: + errno = 0; + if (pos_args == 0) { + env.interval = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid internal\n"); + argp_usage(state); + } + } else if (pos_args == 1) { + env.times = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid times\n"); + argp_usage(state); + } + } else { + fprintf(stderr, + "unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + pos_args++; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static void sig_handler(int sig) +{ + exiting = true; +} + +enum { + HI_SOFTIRQ = 0, + TIMER_SOFTIRQ = 1, + NET_TX_SOFTIRQ = 2, + NET_RX_SOFTIRQ = 3, + BLOCK_SOFTIRQ = 4, + IRQ_POLL_SOFTIRQ = 5, + TASKLET_SOFTIRQ = 6, + SCHED_SOFTIRQ = 7, + HRTIMER_SOFTIRQ = 8, + RCU_SOFTIRQ = 9, + NR_SOFTIRQS = 10, +}; + +static char *vec_names[] = { + [HI_SOFTIRQ] = "hi", + [TIMER_SOFTIRQ] = "timer", + [NET_TX_SOFTIRQ] = "net_tx", + [NET_RX_SOFTIRQ] = "net_rx", + [BLOCK_SOFTIRQ] = "block", + [IRQ_POLL_SOFTIRQ] = "irq_poll", + [TASKLET_SOFTIRQ] = "tasklet", + [SCHED_SOFTIRQ] = "sched", + [HRTIMER_SOFTIRQ] = "hrtimer", + [RCU_SOFTIRQ] = "rcu", +}; + +static int print_count(struct softirqs_bpf__bss *bss) +{ + const char *units = env.nanoseconds ? "nsecs" : "usecs"; + __u64 count; + __u32 vec; + + printf("%-16s %6s%5s\n", "SOFTIRQ", "TOTAL_", units); + + for (vec = 0; vec < NR_SOFTIRQS; vec++) { + count = __atomic_exchange_n(&bss->counts[vec], 0, + __ATOMIC_RELAXED); + if (count > 0) + printf("%-16s %11llu\n", vec_names[vec], count); + } + + return 0; +} + +static struct hist zero; + +static int print_hist(struct softirqs_bpf__bss *bss) +{ + const char *units = env.nanoseconds ? "nsecs" : "usecs"; + __u32 vec; + + for (vec = 0; vec < NR_SOFTIRQS; vec++) { + struct hist hist = bss->hists[vec]; + + bss->hists[vec] = zero; + if (!memcmp(&zero, &hist, sizeof(hist))) + continue; + printf("softirq = %s\n", vec_names[vec]); + print_log2_hist(hist.slots, MAX_SLOTS, units); + printf("\n"); + } + + return 0; +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct softirqs_bpf *obj; + struct tm *tm; + char ts[32]; + time_t t; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = softirqs_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF object\n"); + return 1; + } + + /* initialize global data (filtering options) */ + obj->rodata->targ_dist = env.distributed; + obj->rodata->targ_ns = env.nanoseconds; + + err = softirqs_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + err = softirqs_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs\n"); + goto cleanup; + } + + signal(SIGINT, sig_handler); + + printf("Tracing soft irq event time... Hit Ctrl-C to end.\n"); + + /* main: poll */ + while (1) { + sleep(env.interval); + printf("\n"); + + if (env.timestamp) { + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + printf("%-8s\n", ts); + } + + if (!env.distributed) + err = print_count(obj->bss); + else + err = print_hist(obj->bss); + if (err) + break; + + if (exiting || --env.times == 0) + break; + } + +cleanup: + softirqs_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/softirqs.h b/libbpf-tools/softirqs.h new file mode 100644 index 000000000..efc02a425 --- /dev/null +++ b/libbpf-tools/softirqs.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __SOFTIRQS_H +#define __SOFTIRQS_H + +#define MAX_SLOTS 20 + +struct hist { + __u32 slots[MAX_SLOTS]; +}; + +#endif /* __SOFTIRQS_H */ diff --git a/libbpf-tools/syscall_helpers.c b/libbpf-tools/syscall_helpers.c new file mode 100644 index 000000000..c72a17097 --- /dev/null +++ b/libbpf-tools/syscall_helpers.c @@ -0,0 +1,526 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Anton Protopopov +#include +#include +#include +#include +#include + +static const char **syscall_names; +static size_t syscall_names_size; + +#define warn(...) fprintf(stderr, __VA_ARGS__) +#define MAX(x, y) (((x) > (y)) ? (x) : (y)) + +static const char *parse_syscall(const char *buf, int *number) +{ + char *end; + long x; + + errno = 0; + x = strtol(buf, &end, 10); + if (errno) { + warn("strtol(%s): %s\n", buf, strerror(errno)); + return NULL; + } else if (end == buf) { + warn("strtol(%s): no digits found\n", buf); + return NULL; + } else if (x < 0 || x > INT_MAX) { + warn("strtol(%s): bad syscall number: %ld\n", buf, x); + return NULL; + } + if (*end != '\t') { + warn("bad input: %s (expected \t)\n", buf); + return NULL; + } + + *number = x; + return ++end; +} + +void init_syscall_names(void) +{ + size_t old_size, size = 1024; + const char *name; + char buf[64]; + int number; + int err; + FILE *f; + + f = popen("ausyscall --dump 2>/dev/null", "r"); + if (!f) { + warn("popen: ausyscall --dump: %s\n", strerror(errno)); + return; + } + + syscall_names = calloc(size, sizeof(char *)); + if (!syscall_names) { + warn("calloc: %s\n", strerror(errno)); + goto close; + } + + /* skip the header */ + fgets(buf, sizeof(buf), f); + + while (fgets(buf, sizeof(buf), f)) { + if (buf[strlen(buf) - 1] == '\n') + buf[strlen(buf) - 1] = '\0'; + + name = parse_syscall(buf, &number); + if (!name || !name[0]) + goto close; + + /* In a rare case when syscall number is > than initial 1024 */ + if (number >= size) { + old_size = size; + size = 1024 * (1 + number / 1024); + syscall_names = realloc(syscall_names, + size * sizeof(char *)); + if (!syscall_names) { + warn("realloc: %s\n", strerror(errno)); + goto close; + } + memset(syscall_names+old_size, 0, + (size - old_size) * sizeof(char *)); + } + + if (syscall_names[number]) { + warn("duplicate number: %d (stored: %s)", + number, syscall_names[number]); + goto close; + } + + syscall_names[number] = strdup(name); + if (!syscall_names[number]) { + warn("strdup: %s\n", strerror(errno)); + goto close; + } + syscall_names_size = MAX(number+1, syscall_names_size); + } + + if (ferror(f)) + warn("fgets: %s\n", strerror(errno)); +close: + err = pclose(f); + if (err < 0) + warn("pclose: %s\n", strerror(errno)); +#ifndef __x86_64__ + /* Ignore the error for x86_64 where we have a table compiled in */ + else if (err && WEXITSTATUS(err) == 127) { + warn("ausyscall required for syscalls number/name mapping\n"); + } else if (err) { + warn("ausyscall exit status (see wait(2)): 0x%x\n", err); + } +#endif +} + +void free_syscall_names(void) +{ + for (size_t i = 0; i < syscall_names_size; i++) + free((void *) syscall_names[i]); + free(syscall_names); +} + +/* + * Syscall table for Linux x86_64. + * + * Semi-automatically generated from strace/linux/x86_64/syscallent.h and + * linux/syscallent-common.h using the following commands: + * + * awk -F\" '/SEN/{printf("%d %s\n", substr($0,2,3), $(NF-1));}' syscallent.h + * awk '/SEN/ { printf("%d %s\n", $3, $9); }' syscallent-common.h + * + * (The idea is taken from src/python/bcc/syscall.py.) + */ +#ifdef __x86_64__ +static const char *syscall_names_x86_64[] = { + [0] = "read", + [1] = "write", + [2] = "open", + [3] = "close", + [4] = "stat", + [5] = "fstat", + [6] = "lstat", + [7] = "poll", + [8] = "lseek", + [9] = "mmap", + [10] = "mprotect", + [11] = "munmap", + [12] = "brk", + [13] = "rt_sigaction", + [14] = "rt_sigprocmask", + [15] = "rt_sigreturn", + [16] = "ioctl", + [17] = "pread64", + [18] = "pwrite64", + [19] = "readv", + [20] = "writev", + [21] = "access", + [22] = "pipe", + [23] = "select", + [24] = "sched_yield", + [25] = "mremap", + [26] = "msync", + [27] = "mincore", + [28] = "madvise", + [29] = "shmget", + [30] = "shmat", + [31] = "shmctl", + [32] = "dup", + [33] = "dup2", + [34] = "pause", + [35] = "nanosleep", + [36] = "getitimer", + [37] = "alarm", + [38] = "setitimer", + [39] = "getpid", + [40] = "sendfile", + [41] = "socket", + [42] = "connect", + [43] = "accept", + [44] = "sendto", + [45] = "recvfrom", + [46] = "sendmsg", + [47] = "recvmsg", + [48] = "shutdown", + [49] = "bind", + [50] = "listen", + [51] = "getsockname", + [52] = "getpeername", + [53] = "socketpair", + [54] = "setsockopt", + [55] = "getsockopt", + [56] = "clone", + [57] = "fork", + [58] = "vfork", + [59] = "execve", + [60] = "exit", + [61] = "wait4", + [62] = "kill", + [63] = "uname", + [64] = "semget", + [65] = "semop", + [66] = "semctl", + [67] = "shmdt", + [68] = "msgget", + [69] = "msgsnd", + [70] = "msgrcv", + [71] = "msgctl", + [72] = "fcntl", + [73] = "flock", + [74] = "fsync", + [75] = "fdatasync", + [76] = "truncate", + [77] = "ftruncate", + [78] = "getdents", + [79] = "getcwd", + [80] = "chdir", + [81] = "fchdir", + [82] = "rename", + [83] = "mkdir", + [84] = "rmdir", + [85] = "creat", + [86] = "link", + [87] = "unlink", + [88] = "symlink", + [89] = "readlink", + [90] = "chmod", + [91] = "fchmod", + [92] = "chown", + [93] = "fchown", + [94] = "lchown", + [95] = "umask", + [96] = "gettimeofday", + [97] = "getrlimit", + [98] = "getrusage", + [99] = "sysinfo", + [100] = "times", + [101] = "ptrace", + [102] = "getuid", + [103] = "syslog", + [104] = "getgid", + [105] = "setuid", + [106] = "setgid", + [107] = "geteuid", + [108] = "getegid", + [109] = "setpgid", + [110] = "getppid", + [111] = "getpgrp", + [112] = "setsid", + [113] = "setreuid", + [114] = "setregid", + [115] = "getgroups", + [116] = "setgroups", + [117] = "setresuid", + [118] = "getresuid", + [119] = "setresgid", + [120] = "getresgid", + [121] = "getpgid", + [122] = "setfsuid", + [123] = "setfsgid", + [124] = "getsid", + [125] = "capget", + [126] = "capset", + [127] = "rt_sigpending", + [128] = "rt_sigtimedwait", + [129] = "rt_sigqueueinfo", + [130] = "rt_sigsuspend", + [131] = "sigaltstack", + [132] = "utime", + [133] = "mknod", + [134] = "uselib", + [135] = "personality", + [136] = "ustat", + [137] = "statfs", + [138] = "fstatfs", + [139] = "sysfs", + [140] = "getpriority", + [141] = "setpriority", + [142] = "sched_setparam", + [143] = "sched_getparam", + [144] = "sched_setscheduler", + [145] = "sched_getscheduler", + [146] = "sched_get_priority_max", + [147] = "sched_get_priority_min", + [148] = "sched_rr_get_interval", + [149] = "mlock", + [150] = "munlock", + [151] = "mlockall", + [152] = "munlockall", + [153] = "vhangup", + [154] = "modify_ldt", + [155] = "pivot_root", + [156] = "_sysctl", + [157] = "prctl", + [158] = "arch_prctl", + [159] = "adjtimex", + [160] = "setrlimit", + [161] = "chroot", + [162] = "sync", + [163] = "acct", + [164] = "settimeofday", + [165] = "mount", + [166] = "umount2", + [167] = "swapon", + [168] = "swapoff", + [169] = "reboot", + [170] = "sethostname", + [171] = "setdomainname", + [172] = "iopl", + [173] = "ioperm", + [174] = "create_module", + [175] = "init_module", + [176] = "delete_module", + [177] = "get_kernel_syms", + [178] = "query_module", + [179] = "quotactl", + [180] = "nfsservctl", + [181] = "getpmsg", + [182] = "putpmsg", + [183] = "afs_syscall", + [184] = "tuxcall", + [185] = "security", + [186] = "gettid", + [187] = "readahead", + [188] = "setxattr", + [189] = "lsetxattr", + [190] = "fsetxattr", + [191] = "getxattr", + [192] = "lgetxattr", + [193] = "fgetxattr", + [194] = "listxattr", + [195] = "llistxattr", + [196] = "flistxattr", + [197] = "removexattr", + [198] = "lremovexattr", + [199] = "fremovexattr", + [200] = "tkill", + [201] = "time", + [202] = "futex", + [203] = "sched_setaffinity", + [204] = "sched_getaffinity", + [205] = "set_thread_area", + [206] = "io_setup", + [207] = "io_destroy", + [208] = "io_getevents", + [209] = "io_submit", + [210] = "io_cancel", + [211] = "get_thread_area", + [212] = "lookup_dcookie", + [213] = "epoll_create", + [214] = "epoll_ctl_old", + [215] = "epoll_wait_old", + [216] = "remap_file_pages", + [217] = "getdents64", + [218] = "set_tid_address", + [219] = "restart_syscall", + [220] = "semtimedop", + [221] = "fadvise64", + [222] = "timer_create", + [223] = "timer_settime", + [224] = "timer_gettime", + [225] = "timer_getoverrun", + [226] = "timer_delete", + [227] = "clock_settime", + [228] = "clock_gettime", + [229] = "clock_getres", + [230] = "clock_nanosleep", + [231] = "exit_group", + [232] = "epoll_wait", + [233] = "epoll_ctl", + [234] = "tgkill", + [235] = "utimes", + [236] = "vserver", + [237] = "mbind", + [238] = "set_mempolicy", + [239] = "get_mempolicy", + [240] = "mq_open", + [241] = "mq_unlink", + [242] = "mq_timedsend", + [243] = "mq_timedreceive", + [244] = "mq_notify", + [245] = "mq_getsetattr", + [246] = "kexec_load", + [247] = "waitid", + [248] = "add_key", + [249] = "request_key", + [250] = "keyctl", + [251] = "ioprio_set", + [252] = "ioprio_get", + [253] = "inotify_init", + [254] = "inotify_add_watch", + [255] = "inotify_rm_watch", + [256] = "migrate_pages", + [257] = "openat", + [258] = "mkdirat", + [259] = "mknodat", + [260] = "fchownat", + [261] = "futimesat", + [262] = "newfstatat", + [263] = "unlinkat", + [264] = "renameat", + [265] = "linkat", + [266] = "symlinkat", + [267] = "readlinkat", + [268] = "fchmodat", + [269] = "faccessat", + [270] = "pselect6", + [271] = "ppoll", + [272] = "unshare", + [273] = "set_robust_list", + [274] = "get_robust_list", + [275] = "splice", + [276] = "tee", + [277] = "sync_file_range", + [278] = "vmsplice", + [279] = "move_pages", + [280] = "utimensat", + [281] = "epoll_pwait", + [282] = "signalfd", + [283] = "timerfd_create", + [284] = "eventfd", + [285] = "fallocate", + [286] = "timerfd_settime", + [287] = "timerfd_gettime", + [288] = "accept4", + [289] = "signalfd4", + [290] = "eventfd2", + [291] = "epoll_create1", + [292] = "dup3", + [293] = "pipe2", + [294] = "inotify_init1", + [295] = "preadv", + [296] = "pwritev", + [297] = "rt_tgsigqueueinfo", + [298] = "perf_event_open", + [299] = "recvmmsg", + [300] = "fanotify_init", + [301] = "fanotify_mark", + [302] = "prlimit64", + [303] = "name_to_handle_at", + [304] = "open_by_handle_at", + [305] = "clock_adjtime", + [306] = "syncfs", + [307] = "sendmmsg", + [308] = "setns", + [309] = "getcpu", + [310] = "process_vm_readv", + [311] = "process_vm_writev", + [312] = "kcmp", + [313] = "finit_module", + [314] = "sched_setattr", + [315] = "sched_getattr", + [316] = "renameat2", + [317] = "seccomp", + [318] = "getrandom", + [319] = "memfd_create", + [320] = "kexec_file_load", + [321] = "bpf", + [322] = "execveat", + [323] = "userfaultfd", + [324] = "membarrier", + [325] = "mlock2", + [326] = "copy_file_range", + [327] = "preadv2", + [328] = "pwritev2", + [329] = "pkey_mprotect", + [330] = "pkey_alloc", + [331] = "pkey_free", + [332] = "statx", + [333] = "io_pgetevents", + [334] = "rseq", + [424] = "pidfd_send_signal", + [425] = "io_uring_setup", + [426] = "io_uring_enter", + [427] = "io_uring_register", + [428] = "open_tree", + [429] = "move_mount", + [430] = "fsopen", + [431] = "fsconfig", + [432] = "fsmount", + [433] = "fspick", + [434] = "pidfd_open", + [435] = "clone3", + [437] = "openat2", + [438] = "pidfd_getfd", +}; +size_t syscall_names_x86_64_size = sizeof(syscall_names_x86_64)/sizeof(char*); +#endif + +void syscall_name(unsigned n, char *buf, size_t size) +{ + const char *name = NULL; + + if (n < syscall_names_size) + name = syscall_names[n]; +#ifdef __x86_64__ + else if (n < syscall_names_x86_64_size) + name = syscall_names_x86_64[n]; +#endif + + if (name) + strncpy(buf, name, size-1); + else + snprintf(buf, size, "[unknown: %u]", n); +} + +int list_syscalls(void) +{ + const char **list = syscall_names; + size_t size = syscall_names_size; + +#ifdef __x86_64__ + if (!size) { + size = syscall_names_x86_64_size; + list = syscall_names_x86_64; + } +#endif + + for (size_t i = 0; i < size; i++) { + if (list[i]) + printf("%3zd: %s\n", i, list[i]); + } + + return (!list || !size); +} + diff --git a/libbpf-tools/syscall_helpers.h b/libbpf-tools/syscall_helpers.h new file mode 100644 index 000000000..06f296555 --- /dev/null +++ b/libbpf-tools/syscall_helpers.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __SYSCALL_HELPERS_H +#define __SYSCALL_HELPERS_H + +#include + +void init_syscall_names(void); +void free_syscall_names(void); +void list_syscalls(void); +void syscall_name(unsigned n, char *buf, size_t size); + +#endif /* __SYSCALL_HELPERS_H */ diff --git a/libbpf-tools/syscount.bpf.c b/libbpf-tools/syscount.bpf.c new file mode 100644 index 000000000..98b77efa2 --- /dev/null +++ b/libbpf-tools/syscount.bpf.c @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Anton Protopopov +// +// Based on syscount(8) from BCC by Sasha Goldshtein +#include "vmlinux.h" +#include +#include +#include +#include "syscount.h" +#include "maps.bpf.h" + +const volatile bool count_by_process = false; +const volatile bool measure_latency = false; +const volatile bool filter_failed = false; +const volatile int filter_errno = false; +const volatile pid_t filter_pid = 0; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, u32); + __type(value, u64); + __uint(map_flags, BPF_F_NO_PREALLOC); +} start SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, u32); + __type(value, struct data_t); + __uint(map_flags, BPF_F_NO_PREALLOC); +} data SEC(".maps"); + +static __always_inline +void save_proc_name(struct data_t *val) +{ + struct task_struct *current = (void *)bpf_get_current_task(); + + /* We should save the process name every time because it can be + * changed (e.g., by exec). This can be optimized later by managing + * this field with the help of tp/sched/sched_process_exec and + * raw_tp/task_rename. */ + BPF_CORE_READ_STR_INTO(&val->comm, current, group_leader, comm); +} + +SEC("tracepoint/raw_syscalls/sys_enter") +int sys_enter(struct trace_event_raw_sys_enter *args) +{ + u64 id = bpf_get_current_pid_tgid(); + pid_t pid = id >> 32; + u32 tid = id; + u64 ts; + + if (filter_pid && pid != filter_pid) + return 0; + + ts = bpf_ktime_get_ns(); + bpf_map_update_elem(&start, &tid, &ts, 0); + return 0; +} + +SEC("tracepoint/raw_syscalls/sys_exit") +int sys_exit(struct trace_event_raw_sys_exit *args) +{ + struct task_struct *current; + u64 id = bpf_get_current_pid_tgid(); + static const struct data_t zero; + pid_t pid = id >> 32; + struct data_t *val; + u64 *start_ts; + u32 tid = id; + u32 key; + + /* this happens when there is an interrupt */ + if (args->id == -1) + return 0; + + if (filter_pid && pid != filter_pid) + return 0; + if (filter_failed && args->ret >= 0) + return 0; + if (filter_errno && args->ret != -filter_errno) + return 0; + + if (measure_latency) { + start_ts = bpf_map_lookup_elem(&start, &tid); + if (!start_ts) + return 0; + } + + key = (count_by_process) ? pid : args->id; + val = bpf_map_lookup_or_try_init(&data, &key, &zero); + if (val) { + val->count++; + if (count_by_process) + save_proc_name(val); + if (measure_latency) + val->total_ns += bpf_ktime_get_ns() - *start_ts; + } + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/syscount.c b/libbpf-tools/syscount.c new file mode 100644 index 000000000..3ccf7ab43 --- /dev/null +++ b/libbpf-tools/syscount.c @@ -0,0 +1,472 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Anton Protopopov +// +// Based on syscount(8) from BCC by Sasha Goldshtein +#include +#include +#include +#include +#include +#include +#include "syscount.h" +#include "syscount.skel.h" +#include "errno_helpers.h" +#include "syscall_helpers.h" +#include "trace_helpers.h" + +/* This structure extends data_t by adding a key item which should be sorted + * together with the count and total_ns fields */ +struct data_ext_t { + __u64 count; + __u64 total_ns; + char comm[TASK_COMM_LEN]; + __u32 key; +}; + + +#define warn(...) fprintf(stderr, __VA_ARGS__) + +const char *argp_program_version = "syscount 0.1"; +const char *argp_program_bug_address = ""; +static const char argp_program_doc[] = +"\nsyscount: summarize syscall counts and latencies\n" +"\n" +"EXAMPLES:\n" +" syscount # print top 10 syscalls by count every second\n" +" syscount -p $(pidof dd) # look only at a particular process\n" +" syscount -L # measure and sort output by latency\n" +" syscount -P # group statistics by pid, not by syscall\n" +" syscount -x -i 5 # count only failed syscalls\n" +" syscount -e ENOENT -i 5 # count only syscalls failed with a given errno" +; + +static const struct argp_option opts[] = { + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + { "pid", 'p', "PID", 0, "Process PID to trace" }, + { "interval", 'i', "INTERVAL", 0, "Print summary at this interval" + " (seconds), 0 for infinite wait (default)" }, + { "duration", 'd', "DURATION", 0, "Total tracing duration (seconds)" }, + { "top", 'T', "TOP", 0, "Print only the top syscalls (default 10)" }, + { "failures", 'x', NULL, 0, "Trace only failed syscalls" }, + { "latency", 'L', NULL, 0, "Collect syscall latency" }, + { "milliseconds", 'm', NULL, 0, "Display latency in milliseconds" + " (default: microseconds)" }, + { "process", 'P', NULL, 0, "Count by process and not by syscall" }, + { "errno", 'e', "ERRNO", 0, "Trace only syscalls that return this error" + "(numeric or EPERM, etc.)" }, + { "list", 'l', NULL, 0, "Print list of recognized syscalls and exit" }, + {}, +}; + +static struct env { + bool list_syscalls; + bool milliseconds; + bool failures; + bool verbose; + bool latency; + bool process; + int filter_errno; + int interval; + int duration; + int top; + pid_t pid; +} env = { + .top = 10, +}; + +static int get_int(const char *arg, int *ret, int min, int max) +{ + char *end; + long val; + + errno = 0; + val = strtol(arg, &end, 10); + if (errno) { + warn("strtol: %s: %s\n", arg, strerror(errno)); + return -1; + } else if (end == arg || val < min || val > max) { + return -1; + } + if (ret) + *ret = val; + return 0; +} + +static int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + + return vfprintf(stderr, format, args); +} + +static int compar_count(const void *dx, const void *dy) +{ + __u64 x = ((struct data_ext_t *) dx)->count; + __u64 y = ((struct data_ext_t *) dy)->count; + return x > y ? -1 : !(x == y); +} + +static int compar_latency(const void *dx, const void *dy) +{ + __u64 x = ((struct data_ext_t *) dx)->total_ns; + __u64 y = ((struct data_ext_t *) dy)->total_ns; + return x > y ? -1 : !(x == y); +} + +static const char *agg_col(struct data_ext_t *val, char *buf, size_t size) +{ + if (env.process) { + snprintf(buf, size, "%-6u %-15s", val->key, val->comm); + } else { + syscall_name(val->key, buf, size); + } + return buf; +} + +static const char *agg_colname(void) +{ + return (env.process) ? "PID COMM" : "SYSCALL"; +} + +static const char *time_colname(void) +{ + return (env.milliseconds) ? "TIME (ms)" : "TIME (us)"; +} + +static void print_latency_header(void) +{ + printf("%-22s %8s %16s\n", agg_colname(), "COUNT", time_colname()); +} + +static void print_count_header(void) +{ + printf("%-22s %8s\n", agg_colname(), "COUNT"); +} + +static void print_latency(struct data_ext_t *vals, size_t count) +{ + double div = env.milliseconds ? 1000000.0 : 1000.0; + char buf[2 * TASK_COMM_LEN]; + + print_latency_header(); + for (int i = 0; i < count && i < env.top; i++) + printf("%-22s %8llu %16.3lf\n", + agg_col(&vals[i], buf, sizeof(buf)), + vals[i].count, vals[i].total_ns / div); + printf("\n"); +} + +static void print_count(struct data_ext_t *vals, size_t count) +{ + char buf[2 * TASK_COMM_LEN]; + + print_count_header(); + for (int i = 0; i < count && i < env.top; i++) + printf("%-22s %8llu\n", + agg_col(&vals[i], buf, sizeof(buf)), vals[i].count); + printf("\n"); +} + +static void print_timestamp() +{ + time_t now = time(NULL); + struct tm tm; + + if (localtime_r(&now, &tm)) + printf("[%02d:%02d:%02d]\n", tm.tm_hour, tm.tm_min, tm.tm_sec); + else + warn("localtime_r: %s", strerror(errno)); +} + +static bool batch_map_ops = true; /* hope for the best */ + +static bool read_vals_batch(int fd, struct data_ext_t *vals, __u32 *count) +{ + struct data_t orig_vals[*count]; + void *in = NULL, *out; + __u32 n, n_read = 0; + __u32 keys[*count]; + int err = 0; + + while (n_read < *count && !err) { + n = *count - n_read; + err = bpf_map_lookup_and_delete_batch(fd, &in, &out, + keys + n_read, orig_vals + n_read, &n, NULL); + if (err && errno != ENOENT) { + /* we want to propagate EINVAL upper, so that + * the batch_map_ops flag is set to false */ + if (errno != EINVAL) + warn("bpf_map_lookup_and_delete_batch: %s\n", + strerror(-err)); + return false; + } + n_read += n; + in = out; + } + + for (__u32 i = 0; i < n_read; i++) { + vals[i].count = orig_vals[i].count; + vals[i].total_ns = orig_vals[i].total_ns; + vals[i].key = keys[i]; + strncpy(vals[i].comm, orig_vals[i].comm, TASK_COMM_LEN); + } + + *count = n_read; + return true; +} + +static bool read_vals(int fd, struct data_ext_t *vals, __u32 *count) +{ + __u32 keys[MAX_ENTRIES]; + struct data_t val; + __u32 key = -1; + __u32 next_key; + int i = 0; + int err; + + if (batch_map_ops) { + bool ok = read_vals_batch(fd, vals, count); + if (!ok && errno == EINVAL) { + /* fall back to a racy variant */ + batch_map_ops = false; + } else { + return ok; + } + } + + if (!vals || !count || !*count) + return true; + + for (key = -1; i < *count; ) { + err = bpf_map_get_next_key(fd, &key, &next_key); + if (err && errno != ENOENT) { + warn("failed to get next key: %s\n", strerror(errno)); + return false; + } else if (err) { + break; + } + key = keys[i++] = next_key; + } + + for (int j = 0; j < i; j++) { + err = bpf_map_lookup_elem(fd, &keys[j], &val); + if (err && errno != ENOENT) { + warn("failed to lookup element: %s\n", strerror(errno)); + return false; + } + vals[j].count = val.count; + vals[j].total_ns = val.total_ns; + vals[j].key = keys[j]; + memcpy(vals[j].comm, val.comm, TASK_COMM_LEN); + } + + /* There is a race here: system calls which are represented by keys + * above and happened between lookup and delete will be ignored. This + * will be fixed in future by using bpf_map_lookup_and_delete_batch, + * but this function is too fresh to use it in bcc. */ + + for (int j = 0; j < i; j++) { + err = bpf_map_delete_elem(fd, &keys[j]); + if (err) { + warn("failed to delete element: %s\n", strerror(errno)); + return false; + } + } + + *count = i; + return true; +} + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + int number; + int err; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'x': + env.failures = true; + break; + case 'L': + env.latency = true; + break; + case 'm': + env.milliseconds = true; + break; + case 'P': + env.process = true; + break; + case 'p': + err = get_int(arg, &env.pid, 1, INT_MAX); + if (err) { + warn("invalid PID: %s\n", arg); + argp_usage(state); + } + break; + case 'i': + err = get_int(arg, &env.interval, 0, INT_MAX); + if (err) { + warn("invalid INTERVAL: %s\n", arg); + argp_usage(state); + } + break; + case 'd': + err = get_int(arg, &env.duration, 1, INT_MAX); + if (err) { + warn("invalid DURATION: %s\n", arg); + argp_usage(state); + } + break; + case 'T': + err = get_int(arg, &env.top, 1, INT_MAX); + if (err) { + warn("invalid TOP: %s\n", arg); + argp_usage(state); + } + break; + case 'e': + err = get_int(arg, &number, 1, INT_MAX); + if (err) { + number = errno_by_name(arg); + if (number < 0) { + warn("invalid errno: %s (bad, or can't " + "parse dynamically; consider using " + "numeric value and/or installing the " + "errno program from moreutils)\n", arg); + argp_usage(state); + } + } + env.filter_errno = number; + break; + case 'l': + env.list_syscalls = true; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +static volatile sig_atomic_t hang_on = 1; + +void sig_int(int signo) +{ + hang_on = 0; +} + +int main(int argc, char **argv) +{ + void (*print)(struct data_ext_t *, size_t); + int (*compar)(const void *, const void *); + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct data_ext_t vals[MAX_ENTRIES]; + struct syscount_bpf *obj; + int seconds = 0; + __u32 count; + int err; + + init_syscall_names(); + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + goto free_names; + + if (env.list_syscalls) { + list_syscalls(); + goto free_names; + } + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + warn("failed to increase rlimit: %s\n", strerror(errno)); + goto free_names; + } + + obj = syscount_bpf__open(); + if (!obj) { + warn("failed to open and/or load BPF object\n"); + err = 1; + goto free_names; + } + + if (env.pid) + obj->rodata->filter_pid = env.pid; + if (env.failures) + obj->rodata->filter_failed = true; + if (env.latency) + obj->rodata->measure_latency = true; + if (env.process) + obj->rodata->count_by_process = true; + if (env.filter_errno) + obj->rodata->filter_errno = env.filter_errno; + + err = syscount_bpf__load(obj); + if (err) { + warn("failed to load BPF object: %s\n", strerror(-err)); + goto cleanup_obj; + } + + obj->links.sys_exit = bpf_program__attach(obj->progs.sys_exit); + err = libbpf_get_error(obj->links.sys_exit); + if (err) { + warn("failed to attach sys_exit program: %s\n", + strerror(-err)); + goto cleanup_obj; + } + if (env.latency) { + obj->links.sys_enter = bpf_program__attach(obj->progs.sys_enter); + err = libbpf_get_error(obj->links.sys_enter); + if (err) { + warn("failed to attach sys_enter programs: %s\n", + strerror(-err)); + goto cleanup_obj; + } + } + + if (signal(SIGINT, sig_int) == SIG_ERR) { + warn("can't set signal handler: %s\n", strerror(errno)); + goto cleanup_obj; + } + + compar = env.latency ? compar_latency : compar_count; + print = env.latency ? print_latency : print_count; + + printf("Tracing syscalls, printing top %d... Ctrl+C to quit.\n", env.top); + while (hang_on) { + sleep(env.interval ?: 1); + if (env.duration) { + seconds += env.interval ?: 1; + if (seconds >= env.duration) + hang_on = 0; + } + if (hang_on && !env.interval) + continue; + + count = MAX_ENTRIES; + if (!read_vals(bpf_map__fd(obj->maps.data), vals, &count)) + break; + if (!count) + continue; + + qsort(vals, count, sizeof(vals[0]), compar); + print_timestamp(); + print(vals, count); + } + +cleanup_obj: + syscount_bpf__destroy(obj); +free_names: + free_syscall_names(); + + return err != 0; +} diff --git a/libbpf-tools/syscount.h b/libbpf-tools/syscount.h new file mode 100644 index 000000000..148305a94 --- /dev/null +++ b/libbpf-tools/syscount.h @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Anton Protopopov +#ifndef __SYSCOUNT_H +#define __SYSCOUNT_H + +#define MAX_ENTRIES 8192 + +#define TASK_COMM_LEN 16 + +struct data_t { + __u64 count; + __u64 total_ns; + char comm[TASK_COMM_LEN]; +}; + +#endif /* __SYSCOUNT_H */ diff --git a/libbpf-tools/tcpconnect.bpf.c b/libbpf-tools/tcpconnect.bpf.c new file mode 100644 index 000000000..9fbe6f09c --- /dev/null +++ b/libbpf-tools/tcpconnect.bpf.c @@ -0,0 +1,218 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Anton Protopopov +// +// Based on tcpconnect(8) from BCC by Brendan Gregg +#include "vmlinux.h" + +#include +#include +#include + +#include "maps.bpf.h" +#include "tcpconnect.h" + +SEC(".rodata") int filter_ports[MAX_PORTS]; +const volatile int filter_ports_len = 0; +const volatile uid_t filter_uid = -1; +const volatile pid_t filter_pid = 0; +const volatile bool do_count = 0; + +/* Define here, because there are conflicts with include files */ +#define AF_INET 2 +#define AF_INET6 10 + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, u32); + __type(value, struct sock *); + __uint(map_flags, BPF_F_NO_PREALLOC); +} sockets SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct ipv4_flow_key); + __type(value, u64); + __uint(map_flags, BPF_F_NO_PREALLOC); +} ipv4_count SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, MAX_ENTRIES); + __type(key, struct ipv6_flow_key); + __type(value, u64); + __uint(map_flags, BPF_F_NO_PREALLOC); +} ipv6_count SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); + __uint(key_size, sizeof(u32)); + __uint(value_size, sizeof(u32)); +} events SEC(".maps"); + +static __always_inline bool filter_port(__u16 port) +{ + if (filter_ports_len == 0) + return false; + + for (int i = 0; i < filter_ports_len; i++) { + if (port == filter_ports[i]) + return false; + } + return true; +} + +static __always_inline int +enter_tcp_connect(struct pt_regs *ctx, struct sock *sk) +{ + __u64 pid_tgid = bpf_get_current_pid_tgid(); + __u32 pid = pid_tgid >> 32; + __u32 tid = pid_tgid; + __u32 uid; + + if (filter_pid && pid != filter_pid) + return 0; + + uid = bpf_get_current_uid_gid(); + if (filter_uid != (uid_t) -1 && uid != filter_uid) + return 0; + + bpf_map_update_elem(&sockets, &tid, &sk, 0); + return 0; +} + +static __always_inline void count_v4(struct sock *sk, __u16 dport) +{ + struct ipv4_flow_key key = {}; + static __u64 zero; + __u64 *val; + + BPF_CORE_READ_INTO(&key.saddr, sk, __sk_common.skc_rcv_saddr); + BPF_CORE_READ_INTO(&key.daddr, sk, __sk_common.skc_daddr); + key.dport = dport; + val = bpf_map_lookup_or_try_init(&ipv4_count, &key, &zero); + if (val) + __atomic_add_fetch(val, 1, __ATOMIC_RELAXED); +} + +static __always_inline void count_v6(struct sock *sk, __u16 dport) +{ + struct ipv6_flow_key key = {}; + static const __u64 zero; + __u64 *val; + + BPF_CORE_READ_INTO(&key.saddr, sk, + __sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); + BPF_CORE_READ_INTO(&key.daddr, sk, + __sk_common.skc_v6_daddr.in6_u.u6_addr32); + key.dport = dport; + + val = bpf_map_lookup_or_try_init(&ipv6_count, &key, &zero); + if (val) + __atomic_add_fetch(val, 1, __ATOMIC_RELAXED); +} + +static __always_inline void +trace_v4(struct pt_regs *ctx, pid_t pid, struct sock *sk, __u16 dport) +{ + struct event event = {}; + + event.af = AF_INET; + event.pid = pid; + event.uid = bpf_get_current_uid_gid(); + event.ts_us = bpf_ktime_get_ns() / 1000; + BPF_CORE_READ_INTO(&event.saddr_v4, sk, __sk_common.skc_rcv_saddr); + BPF_CORE_READ_INTO(&event.daddr_v4, sk, __sk_common.skc_daddr); + event.dport = dport; + bpf_get_current_comm(event.task, sizeof(event.task)); + + bpf_perf_event_output(ctx, &events, BPF_F_CURRENT_CPU, + &event, sizeof(event)); +} + +static __always_inline void +trace_v6(struct pt_regs *ctx, pid_t pid, struct sock *sk, __u16 dport) +{ + struct event event = {}; + + event.af = AF_INET6; + event.pid = pid; + event.uid = bpf_get_current_uid_gid(); + event.ts_us = bpf_ktime_get_ns() / 1000; + BPF_CORE_READ_INTO(&event.saddr_v6, sk, + __sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); + BPF_CORE_READ_INTO(&event.daddr_v6, sk, + __sk_common.skc_v6_daddr.in6_u.u6_addr32); + event.dport = dport; + bpf_get_current_comm(event.task, sizeof(event.task)); + + bpf_perf_event_output(ctx, &events, BPF_F_CURRENT_CPU, + &event, sizeof(event)); +} + +static __always_inline int +exit_tcp_connect(struct pt_regs *ctx, int ret, int ip_ver) +{ + __u64 pid_tgid = bpf_get_current_pid_tgid(); + __u32 pid = pid_tgid >> 32; + __u32 tid = pid_tgid; + struct sock **skpp; + struct sock *sk; + __u16 dport; + + skpp = bpf_map_lookup_elem(&sockets, &tid); + if (!skpp) + return 0; + + if (ret) + goto end; + + sk = *skpp; + + BPF_CORE_READ_INTO(&dport, sk, __sk_common.skc_dport); + if (filter_port(dport)) + goto end; + + if (do_count) { + if (ip_ver == 4) + count_v4(sk, dport); + else + count_v6(sk, dport); + } else { + if (ip_ver == 4) + trace_v4(ctx, pid, sk, dport); + else + trace_v6(ctx, pid, sk, dport); + } + +end: + bpf_map_delete_elem(&sockets, &tid); + return 0; +} + +SEC("kprobe/tcp_v4_connect") +int BPF_KPROBE(tcp_v4_connect, struct sock *sk) +{ + return enter_tcp_connect(ctx, sk); +} + +SEC("kretprobe/tcp_v4_connect") +int BPF_KRETPROBE(tcp_v4_connect_ret, int ret) +{ + return exit_tcp_connect(ctx, ret, 4); +} + +SEC("kprobe/tcp_v6_connect") +int BPF_KPROBE(tcp_v6_connect, struct sock *sk) +{ + return enter_tcp_connect(ctx, sk); +} + +SEC("kretprobe/tcp_v6_connect") +int BPF_KRETPROBE(tcp_v6_connect_ret, int ret) +{ + return exit_tcp_connect(ctx, ret, 6); +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/tcpconnect.c b/libbpf-tools/tcpconnect.c new file mode 100644 index 000000000..ccee3e554 --- /dev/null +++ b/libbpf-tools/tcpconnect.c @@ -0,0 +1,421 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Anton Protopopov +// +// Based on tcpconnect(8) from BCC by Brendan Gregg +#include +#include +#include +#include +#include +#include +#include +#include +#include "tcpconnect.h" +#include "tcpconnect.skel.h" +#include "trace_helpers.h" +#include "map_helpers.h" + +#define warn(...) fprintf(stderr, __VA_ARGS__) + +const char *argp_program_version = "tcpconnect 0.1"; +const char *argp_program_bug_address = ""; +static const char argp_program_doc[] = + "\ntcpconnect: Count/Trace active tcp connections\n" + "\n" + "EXAMPLES:\n" + " tcpconnect # trace all TCP connect()s\n" + " tcpconnect -t # include timestamps\n" + " tcpconnect -p 181 # only trace PID 181\n" + " tcpconnect -P 80 # only trace port 80\n" + " tcpconnect -P 80,81 # only trace port 80 and 81\n" + " tcpconnect -U # include UID\n" + " tcpconnect -u 1000 # only trace UID 1000\n" + " tcpconnect -c # count connects per src, dest, port\n" + " tcpconnect --C mappath # only trace cgroups in the map\n" + " tcpconnect --M mappath # only trace mount namespaces in the map\n" + ; + +static int get_int(const char *arg, int *ret, int min, int max) +{ + char *end; + long val; + + errno = 0; + val = strtol(arg, &end, 10); + if (errno) { + warn("strtol: %s: %s\n", arg, strerror(errno)); + return -1; + } else if (end == arg || val < min || val > max) { + return -1; + } + if (ret) + *ret = val; + return 0; +} + +static int get_ints(const char *arg, int *size, int *ret, int min, int max) +{ + const char *argp = arg; + int max_size = *size; + int sz = 0; + char *end; + long val; + + while (sz < max_size) { + errno = 0; + val = strtol(argp, &end, 10); + if (errno) { + warn("strtol: %s: %s\n", arg, strerror(errno)); + return -1; + } else if (end == arg || val < min || val > max) { + return -1; + } + ret[sz++] = val; + if (*end == 0) + break; + argp = end + 1; + } + + *size = sz; + return 0; +} + +static int get_uint(const char *arg, unsigned int *ret, + unsigned int min, unsigned int max) +{ + char *end; + long val; + + errno = 0; + val = strtoul(arg, &end, 10); + if (errno) { + warn("strtoul: %s: %s\n", arg, strerror(errno)); + return -1; + } else if (end == arg || val < min || val > max) { + return -1; + } + if (ret) + *ret = val; + return 0; +} + +static const struct argp_option opts[] = { + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + { "timestamp", 't', NULL, 0, "Include timestamp on output" }, + { "count", 'c', NULL, 0, "Count connects per src ip and dst ip/port" }, + { "print-uid", 'U', NULL, 0, "Include UID on output" }, + { "pid", 'p', "PID", 0, "Process PID to trace" }, + { "uid", 'u', "UID", 0, "Process UID to trace" }, + { "port", 'P', "PORTS", 0, + "Comma-separated list of destination ports to trace" }, + { "cgroupmap", 'C', "PATH", 0, "trace cgroups in this map" }, + { "mntnsmap", 'M', "PATH", 0, "trace mount namespaces in this map" }, + {}, +}; + +static struct env { + bool verbose; + bool count; + bool print_timestamp; + bool print_uid; + pid_t pid; + uid_t uid; + int nports; + int ports[MAX_PORTS]; +} env = { + .uid = (uid_t) -1, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + int err; + int nports; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'c': + env.count = true; + break; + case 't': + env.print_timestamp = true; + break; + case 'U': + env.print_uid = true; + break; + case 'p': + err = get_int(arg, &env.pid, 1, INT_MAX); + if (err) { + warn("invalid PID: %s\n", arg); + argp_usage(state); + } + break; + case 'u': + err = get_uint(arg, &env.uid, 0, (uid_t) -2); + if (err) { + warn("invalid UID: %s\n", arg); + argp_usage(state); + } + break; + case 'P': + nports = MAX_PORTS; + err = get_ints(arg, &nports, env.ports, 1, 65535); + if (err) { + warn("invalid PORT_LIST: %s\n", arg); + argp_usage(state); + } + env.nports = nports; + break; + case 'C': + warn("not implemented: --cgroupmap"); + break; + case 'M': + warn("not implemented: --mntnsmap"); + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +static int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static volatile sig_atomic_t hang_on = 1; + +static void sig_int(int signo) +{ + hang_on = 0; +} + +static void print_count_ipv4(int map_fd) +{ + static struct ipv4_flow_key keys[MAX_ENTRIES]; + __u32 value_size = sizeof(__u64); + __u32 key_size = sizeof(keys[0]); + static struct ipv4_flow_key zero; + static __u64 counts[MAX_ENTRIES]; + char s[INET_ADDRSTRLEN]; + char d[INET_ADDRSTRLEN]; + __u32 n = MAX_ENTRIES; + struct in_addr src; + struct in_addr dst; + + if (dump_hash(map_fd, keys, key_size, counts, value_size, &n, &zero)) { + warn("dump_hash: %s", strerror(errno)); + return; + } + + for (__u32 i = 0; i < n; i++) { + src.s_addr = keys[i].saddr; + dst.s_addr = keys[i].daddr; + + printf("%-25s %-25s %-20d %-10llu\n", + inet_ntop(AF_INET, &src, s, sizeof(s)), + inet_ntop(AF_INET, &dst, d, sizeof(d)), + ntohs(keys[i].dport), counts[i]); + } +} + +static void print_count_ipv6(int map_fd) +{ + static struct ipv6_flow_key keys[MAX_ENTRIES]; + __u32 value_size = sizeof(__u64); + __u32 key_size = sizeof(keys[0]); + static struct ipv6_flow_key zero; + static __u64 counts[MAX_ENTRIES]; + char s[INET6_ADDRSTRLEN]; + char d[INET6_ADDRSTRLEN]; + __u32 n = MAX_ENTRIES; + struct in6_addr src; + struct in6_addr dst; + + if (dump_hash(map_fd, keys, key_size, counts, value_size, &n, &zero)) { + warn("dump_hash: %s", strerror(errno)); + return; + } + + for (__u32 i = 0; i < n; i++) { + memcpy(src.s6_addr, keys[i].saddr, sizeof(src.s6_addr)); + memcpy(dst.s6_addr, keys[i].daddr, sizeof(src.s6_addr)); + + printf("%-25s %-25s %-20d %-10llu\n", + inet_ntop(AF_INET6, &src, s, sizeof(s)), + inet_ntop(AF_INET6, &dst, d, sizeof(d)), + ntohs(keys[i].dport), counts[i]); + } +} + +static void print_count(int map_fd_ipv4, int map_fd_ipv6) +{ + static const char *header_fmt = "\n%-25s %-25s %-20s %-10s\n"; + + while (hang_on) + pause(); + + printf(header_fmt, "LADDR", "RADDR", "RPORT", "CONNECTS"); + print_count_ipv4(map_fd_ipv4); + print_count_ipv6(map_fd_ipv6); +} + +static void print_events_header() +{ + if (env.print_timestamp) + printf("%-9s", "TIME(s)"); + if (env.print_uid) + printf("%-6s", "UID"); + printf("%-6s %-12s %-2s %-16s %-16s %-4s\n", + "PID", "COMM", "IP", "SADDR", "DADDR", "DPORT"); +} + +static void handle_event(void *ctx, int cpu, void *data, __u32 data_sz) +{ + const struct event *event = data; + char src[INET6_ADDRSTRLEN]; + char dst[INET6_ADDRSTRLEN]; + union { + struct in_addr x4; + struct in6_addr x6; + } s, d; + static __u64 start_ts; + + if (event->af == AF_INET) { + s.x4.s_addr = event->saddr_v4; + d.x4.s_addr = event->daddr_v4; + } else if (event->af == AF_INET6) { + memcpy(&s.x6.s6_addr, event->saddr_v6, sizeof(s.x6.s6_addr)); + memcpy(&d.x6.s6_addr, event->daddr_v6, sizeof(d.x6.s6_addr)); + } else { + warn("broken event: event->af=%d", event->af); + return; + } + + if (env.print_timestamp) { + if (start_ts == 0) + start_ts = event->ts_us; + printf("%-9.3f", (event->ts_us - start_ts) / 1000000.0); + } + + if (env.print_uid) + printf("%-6d", event->uid); + + printf("%-6d %-12.12s %-2d %-16s %-16s %-4d\n", + event->pid, event->task, + event->af == AF_INET ? 4 : 6, + inet_ntop(event->af, &s, src, sizeof(src)), + inet_ntop(event->af, &d, dst, sizeof(dst)), + ntohs(event->dport)); +} + +static void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt) +{ + warn("Lost %llu events on CPU #%d!\n", lost_cnt, cpu); +} + +static void print_events(int perf_map_fd) +{ + struct perf_buffer_opts pb_opts = { + .sample_cb = handle_event, + .lost_cb = handle_lost_events, + }; + struct perf_buffer *pb = NULL; + int err; + + pb = perf_buffer__new(perf_map_fd, 128, &pb_opts); + err = libbpf_get_error(pb); + if (err) { + pb = NULL; + warn("failed to open perf buffer: %d\n", err); + goto cleanup; + } + + print_events_header(); + while (hang_on) { + err = perf_buffer__poll(pb, 100); + if (err < 0 && errno != EINTR) { + warn("Error polling perf buffer: %d\n", err); + goto cleanup; + } + } + +cleanup: + perf_buffer__free(pb); +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + .args_doc = NULL, + }; + struct tcpconnect_bpf *obj; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + warn("failed to increase rlimit: %s\n", strerror(errno)); + return 1; + } + + obj = tcpconnect_bpf__open(); + if (!obj) { + warn("failed to open BPF object\n"); + return 1; + } + + if (env.count) + obj->rodata->do_count = true; + if (env.pid) + obj->rodata->filter_pid = env.pid; + if (env.uid != (uid_t) -1) + obj->rodata->filter_uid = env.uid; + if (env.nports > 0) { + obj->rodata->filter_ports_len = env.nports; + for (int i = 0; i < env.nports; i++) { + obj->rodata->filter_ports[i] = htons(env.ports[i]); + } + } + + err = tcpconnect_bpf__load(obj); + if (err) { + warn("failed to load BPF object: %d\n", err); + goto cleanup; + } + + err = tcpconnect_bpf__attach(obj); + if (err) { + warn("failed to attach BPF programs: %s\n", strerror(-err)); + goto cleanup; + } + + if (signal(SIGINT, sig_int) == SIG_ERR) { + warn("can't set signal handler: %s\n", strerror(-errno)); + goto cleanup; + } + + if (env.count) { + print_count(bpf_map__fd(obj->maps.ipv4_count), + bpf_map__fd(obj->maps.ipv6_count)); + } else { + print_events(bpf_map__fd(obj->maps.events)); + } + +cleanup: + tcpconnect_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/tcpconnect.h b/libbpf-tools/tcpconnect.h new file mode 100644 index 000000000..65b768fd8 --- /dev/null +++ b/libbpf-tools/tcpconnect.h @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Anton Protopopov +#ifndef __TCPCONNECT_H +#define __TCPCONNECT_H + +/* The maximum number of items in maps */ +#define MAX_ENTRIES 8192 + +/* The maximum number of ports to filter */ +#define MAX_PORTS 64 + +#define TASK_COMM_LEN 16 + +struct ipv4_flow_key { + __u32 saddr; + __u32 daddr; + __u16 dport; +}; + +struct ipv6_flow_key { + __u8 saddr[16]; + __u8 daddr[16]; + __u16 dport; +}; + +struct event { + union { + __u32 saddr_v4; + __u8 saddr_v6[16]; + }; + union { + __u32 daddr_v4; + __u8 daddr_v6[16]; + }; + char task[TASK_COMM_LEN]; + __u64 ts_us; + int af; // AF_INET or AF_INET6 + __u32 pid; + __u32 uid; + __u16 dport; +}; + +#endif /* __TCPCONNECT_H */ diff --git a/libbpf-tools/tcpconnlat.bpf.c b/libbpf-tools/tcpconnlat.bpf.c new file mode 100644 index 000000000..b0995a4bb --- /dev/null +++ b/libbpf-tools/tcpconnlat.bpf.c @@ -0,0 +1,107 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include +#include "tcpconnlat.h" + +#define AF_INET 2 +#define AF_INET6 10 + +const volatile __u64 targ_min_us = 0; +const volatile pid_t targ_tgid = 0; + +struct piddata { + char comm[TASK_COMM_LEN]; + u64 ts; + u32 tgid; +}; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 4096); + __type(key, struct sock *); + __type(value, struct piddata); +} start SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); + __uint(key_size, sizeof(u32)); + __uint(value_size, sizeof(u32)); +} events SEC(".maps"); + +static __always_inline int trace_connect(struct sock *sk) +{ + u32 tgid = bpf_get_current_pid_tgid() >> 32; + struct piddata piddata = {}; + + if (targ_tgid && targ_tgid != tgid) + return 0; + + bpf_get_current_comm(&piddata.comm, sizeof(piddata.comm)); + piddata.ts = bpf_ktime_get_ns(); + piddata.tgid = tgid; + bpf_map_update_elem(&start, &sk, &piddata, 0); + return 0; +} + +SEC("fentry/tcp_v4_connect") +int BPF_PROG(tcp_v4_connect, struct sock *sk) +{ + return trace_connect(sk); +} + +SEC("kprobe/tcp_v6_connect") +int BPF_KPROBE(tcp_v6_connect, struct sock *sk) +{ + return trace_connect(sk); +} + +SEC("fentry/tcp_rcv_state_process") +int BPF_PROG(tcp_rcv_state_process, struct sock *sk) +{ + struct piddata *piddatap; + struct event event = {}; + s64 delta; + u64 ts; + + if (sk->__sk_common.skc_state != TCP_SYN_SENT) + return 0; + + piddatap = bpf_map_lookup_elem(&start, &sk); + if (!piddatap) + return 0; + + ts = bpf_ktime_get_ns(); + delta = (s64)(ts - piddatap->ts); + if (delta < 0) + goto cleanup; + + event.delta_us = delta / 1000U; + if (targ_min_us && event.delta_us < targ_min_us) + goto cleanup; + __builtin_memcpy(&event.comm, piddatap->comm, + sizeof(event.comm)); + event.ts_us = ts / 1000; + event.tgid = piddatap->tgid; + event.dport = sk->__sk_common.skc_dport; + event.af = sk->__sk_common.skc_family; + if (event.af == AF_INET) { + event.saddr_v4 = sk->__sk_common.skc_rcv_saddr; + event.daddr_v4 = sk->__sk_common.skc_daddr; + } else { + BPF_CORE_READ_INTO(&event.saddr_v6, sk, + __sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); + BPF_CORE_READ_INTO(&event.daddr_v6, sk, + __sk_common.skc_v6_daddr.in6_u.u6_addr32); + } + bpf_perf_event_output(ctx, &events, BPF_F_CURRENT_CPU, + &event, sizeof(event)); + +cleanup: + bpf_map_delete_elem(&start, &sk); + return 0; +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/tcpconnlat.c b/libbpf-tools/tcpconnlat.c new file mode 100644 index 000000000..b53bf1e35 --- /dev/null +++ b/libbpf-tools/tcpconnlat.c @@ -0,0 +1,205 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on tcpconnlat(8) from BCC by Brendan Gregg. +// 11-Jul-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include "tcpconnlat.h" +#include "tcpconnlat.skel.h" +#include "trace_helpers.h" + +#define PERF_BUFFER_PAGES 16 +#define PERF_POLL_TIMEOUT_MS 100 + +static struct env { + __u64 min_us; + pid_t pid; + bool timestamp; + bool verbose; +} env; + +const char *argp_program_version = "tcpconnlat 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"\nTrace TCP connects and show connection latency.\n" +"\n" +"USAGE: tcpconnlat [--help] [-t] [-p PID]\n" +"\n" +"EXAMPLES:\n" +" tcpconnlat # summarize on-CPU time as a histogram" +" tcpconnlat 1 # trace connection latency slower than 1 ms" +" tcpconnlat 0.1 # trace connection latency slower than 100 us" +" tcpconnlat -t # 1s summaries, milliseconds, and timestamps" +" tcpconnlat -p 185 # trace PID 185 only"; + +static const struct argp_option opts[] = { + { "timestamp", 't', NULL, 0, "Include timestamp on output" }, + { "pid", 'p', "PID", 0, "Trace this PID only" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + static int pos_args; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'p': + errno = 0; + env.pid = strtol(arg, NULL, 10); + if (errno) { + fprintf(stderr, "invalid PID: %s\n", arg); + argp_usage(state); + } + break; + case 't': + env.timestamp = true; + break; + case ARGP_KEY_ARG: + if (pos_args++) { + fprintf(stderr, + "Unrecognized positional argument: %s\n", arg); + argp_usage(state); + } + errno = 0; + env.min_us = strtod(arg, NULL) * 1000; + if (errno || env.min_us <= 0) { + fprintf(stderr, "Invalid delay (in us): %s\n", arg); + argp_usage(state); + } + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +void handle_event(void *ctx, int cpu, void *data, __u32 data_sz) +{ + const struct event *e = data; + char src[INET6_ADDRSTRLEN]; + char dst[INET6_ADDRSTRLEN]; + union { + struct in_addr x4; + struct in6_addr x6; + } s, d; + static __u64 start_ts; + + if (env.timestamp) { + if (start_ts == 0) + start_ts = e->ts_us; + printf("%-9.3f ", (e->ts_us - start_ts) / 1000000.0); + } + if (e->af == AF_INET) { + s.x4.s_addr = e->saddr_v4; + d.x4.s_addr = e->daddr_v4; + } else if (e->af == AF_INET6) { + memcpy(&s.x6.s6_addr, e->saddr_v6, sizeof(s.x6.s6_addr)); + memcpy(&d.x6.s6_addr, e->daddr_v6, sizeof(d.x6.s6_addr)); + } else { + fprintf(stderr, "broken event: event->af=%d", e->af); + return; + } + + printf("%-6d %-12.12s %-2d %-16s %-16s %-5d %.2f\n", e->tgid, e->comm, + e->af == AF_INET ? 4 : 6, inet_ntop(e->af, &s, src, sizeof(src)), + inet_ntop(e->af, &d, dst, sizeof(dst)), ntohs(e->dport), + e->delta_us / 1000.0); +} + +void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt) +{ + fprintf(stderr, "lost %llu events on CPU #%d\n", lost_cnt, cpu); +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct perf_buffer_opts pb_opts; + struct perf_buffer *pb = NULL; + struct tcpconnlat_bpf *obj; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = tcpconnlat_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF ojbect\n"); + return 1; + } + + /* initialize global data (filtering options) */ + obj->rodata->targ_min_us = env.min_us; + obj->rodata->targ_tgid = env.pid; + + err = tcpconnlat_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + err = tcpconnlat_bpf__attach(obj); + if (err) { + goto cleanup; + } + + pb_opts.sample_cb = handle_event; + + pb_opts.lost_cb = handle_lost_events; + pb = perf_buffer__new(bpf_map__fd(obj->maps.events), PERF_BUFFER_PAGES, + &pb_opts); + err = libbpf_get_error(pb); + if (err) { + pb = NULL; + fprintf(stderr, "failed to open perf buffer: %d\n", err); + goto cleanup; + } + + if (env.timestamp) + printf("%-9s ", ("TIME(s)")); + printf("%-6s %-12s %-2s %-16s %-16s %-5s %s\n", + "PID", "COMM", "IP", "SADDR", "DADDR", "DPORT", "LAT(ms)"); + + /* main: poll */ + while (1) { + if ((err = perf_buffer__poll(pb, PERF_POLL_TIMEOUT_MS)) < 0) + break; + } + printf("error polling perf buffer: %d\n", err); + +cleanup: + tcpconnlat_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/tcpconnlat.h b/libbpf-tools/tcpconnlat.h new file mode 100644 index 000000000..208a71d12 --- /dev/null +++ b/libbpf-tools/tcpconnlat.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __TCPCONNLAT_H +#define __TCPCONNLAT_H + +#define TASK_COMM_LEN 16 + +struct event { + union { + __u32 saddr_v4; + __u8 saddr_v6[16]; + }; + union { + __u32 daddr_v4; + __u8 daddr_v6[16]; + }; + char comm[TASK_COMM_LEN]; + __u64 delta_us; + __u64 ts_us; + __u32 tgid; + int af; + __u16 dport; +}; + + +#endif /* __TCPCONNLAT_H_ */ diff --git a/libbpf-tools/trace_helpers.c b/libbpf-tools/trace_helpers.c new file mode 100644 index 000000000..ede618f99 --- /dev/null +++ b/libbpf-tools/trace_helpers.c @@ -0,0 +1,371 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +// Copyright (c) 2020 Wenbo Zhang +// +// Based on ksyms improvements from Andrii Nakryiko, add more helpers. +// 28-Feb-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include "trace_helpers.h" + +#define min(x, y) ({ \ + typeof(x) _min1 = (x); \ + typeof(y) _min2 = (y); \ + (void) (&_min1 == &_min2); \ + _min1 < _min2 ? _min1 : _min2; }) + +#define DISK_NAME_LEN 32 + +#define MINORBITS 20 +#define MINORMASK ((1U << MINORBITS) - 1) + +#define MKDEV(ma, mi) (((ma) << MINORBITS) | (mi)) + +struct ksyms { + struct ksym *syms; + int syms_sz; + int syms_cap; + char *strs; + int strs_sz; + int strs_cap; +}; + +static int ksyms__add_symbol(struct ksyms *ksyms, const char *name, unsigned long addr) +{ + size_t new_cap, name_len = strlen(name) + 1; + struct ksym *ksym; + void *tmp; + + if (ksyms->strs_sz + name_len > ksyms->strs_cap) { + new_cap = ksyms->strs_cap * 4 / 3; + if (new_cap < ksyms->strs_sz + name_len) + new_cap = ksyms->strs_sz + name_len; + if (new_cap < 1024) + new_cap = 1024; + tmp = realloc(ksyms->strs, new_cap); + if (!tmp) + return -1; + ksyms->strs = tmp; + ksyms->strs_cap = new_cap; + } + if (ksyms->syms_sz + 1 > ksyms->syms_cap) { + new_cap = ksyms->syms_cap * 4 / 3; + if (new_cap < 1024) + new_cap = 1024; + tmp = realloc(ksyms->syms, sizeof(*ksyms->syms) * new_cap); + if (!tmp) + return -1; + ksyms->syms = tmp; + ksyms->syms_cap = new_cap; + } + + ksym = &ksyms->syms[ksyms->syms_sz]; + /* while constructing, re-use pointer as just a plain offset */ + ksym->name = (void *)(unsigned long)ksyms->strs_sz; + ksym->addr = addr; + + memcpy(ksyms->strs + ksyms->strs_sz, name, name_len); + ksyms->strs_sz += name_len; + ksyms->syms_sz++; + + return 0; +} + +static int ksym_cmp(const void *p1, const void *p2) +{ + const struct ksym *s1 = p1, *s2 = p2; + + if (s1->addr == s2->addr) + return strcmp(s1->name, s2->name); + return s1->addr < s2->addr ? -1 : 1; +} + +struct ksyms *ksyms__load(void) +{ + char sym_type, sym_name[256]; + struct ksyms *ksyms; + unsigned long sym_addr; + int i, ret; + FILE *f; + + f = fopen("/proc/kallsyms", "r"); + if (!f) + return NULL; + + ksyms = calloc(1, sizeof(*ksyms)); + if (!ksyms) + goto err_out; + + while (true) { + ret = fscanf(f, "%lx %c %s%*[^\n]\n", + &sym_addr, &sym_type, sym_name); + if (ret == EOF && feof(f)) + break; + if (ret != 3) + goto err_out; + if (ksyms__add_symbol(ksyms, sym_name, sym_addr)) + goto err_out; + } + + /* now when strings are finalized, adjust pointers properly */ + for (i = 0; i < ksyms->syms_sz; i++) + ksyms->syms[i].name += (unsigned long)ksyms->strs; + + qsort(ksyms->syms, ksyms->syms_sz, sizeof(*ksyms->syms), ksym_cmp); + + fclose(f); + return ksyms; + +err_out: + ksyms__free(ksyms); + fclose(f); + return NULL; +} + +void ksyms__free(struct ksyms *ksyms) +{ + if (!ksyms) + return; + + free(ksyms->syms); + free(ksyms->strs); + free(ksyms); +} + +const struct ksym *ksyms__map_addr(const struct ksyms *ksyms, + unsigned long addr) +{ + int start = 0, end = ksyms->syms_sz - 1, mid; + unsigned long sym_addr; + + /* find largest sym_addr <= addr using binary search */ + while (start < end) { + mid = start + (end - start + 1) / 2; + sym_addr = ksyms->syms[mid].addr; + + if (sym_addr <= addr) + start = mid; + else + end = mid - 1; + } + + if (start == end && ksyms->syms[start].addr <= addr) + return &ksyms->syms[start]; + return NULL; +} + +const struct ksym *ksyms__get_symbol(const struct ksyms *ksyms, + const char *name) +{ + int i; + + for (i = 0; i < ksyms->syms_sz; i++) { + if (strcmp(ksyms->syms[i].name, name) == 0) + return &ksyms->syms[i]; + } + + return NULL; +} + +struct partitions { + struct partition *items; + int sz; +}; + +static int partitions__add_partition(struct partitions *partitions, + const char *name, unsigned int dev) +{ + struct partition *partition; + void *tmp; + + tmp = realloc(partitions->items, (partitions->sz + 1) * + sizeof(*partitions->items)); + if (!tmp) + return -1; + partitions->items = tmp; + partition = &partitions->items[partitions->sz]; + partition->name = strdup(name); + partition->dev = dev; + partitions->sz++; + + return 0; +} + +struct partitions *partitions__load(void) +{ + char part_name[DISK_NAME_LEN]; + unsigned int devmaj, devmin; + unsigned long long nop; + struct partitions *partitions; + char buf[64]; + FILE *f; + + f = fopen("/proc/partitions", "r"); + if (!f) + return NULL; + + partitions = calloc(1, sizeof(*partitions)); + if (!partitions) + goto err_out; + + while (fgets(buf, sizeof(buf), f) != NULL) { + /* skip heading */ + if (buf[0] != ' ' || buf[0] == '\n') + continue; + if (sscanf(buf, "%u %u %llu %s", &devmaj, &devmin, &nop, + part_name) != 4) + goto err_out; + if (partitions__add_partition(partitions, part_name, + MKDEV(devmaj, devmin))) + goto err_out; + } + + fclose(f); + return partitions; + +err_out: + partitions__free(partitions); + fclose(f); + return NULL; +} + +void partitions__free(struct partitions *partitions) +{ + int i; + + if (!partitions) + return; + + for (i = 0; i < partitions->sz; i++) + free(partitions->items[i].name); + free(partitions->items); + free(partitions); +} + +const struct partition * +partitions__get_by_dev(const struct partitions *partitions, unsigned int dev) +{ + int i; + + for (i = 0; i < partitions->sz; i++) { + if (partitions->items[i].dev == dev) + return &partitions->items[i]; + } + + return NULL; +} + +const struct partition * +partitions__get_by_name(const struct partitions *partitions, const char *name) +{ + int i; + + for (i = 0; i < partitions->sz; i++) { + if (strcmp(partitions->items[i].name, name) == 0) + return &partitions->items[i]; + } + + return NULL; +} + +static void print_stars(unsigned int val, unsigned int val_max, int width) +{ + int num_stars, num_spaces, i; + bool need_plus; + + num_stars = min(val, val_max) * width / val_max; + num_spaces = width - num_stars; + need_plus = val > val_max; + + for (i = 0; i < num_stars; i++) + printf("*"); + for (i = 0; i < num_spaces; i++) + printf(" "); + if (need_plus) + printf("+"); +} + +void print_log2_hist(unsigned int *vals, int vals_size, const char *val_type) +{ + int stars_max = 40, idx_max = -1; + unsigned int val, val_max = 0; + unsigned long long low, high; + int stars, width, i; + + for (i = 0; i < vals_size; i++) { + val = vals[i]; + if (val > 0) + idx_max = i; + if (val > val_max) + val_max = val; + } + + if (idx_max < 0) + return; + + printf("%*s%-*s : count distribution\n", idx_max <= 32 ? 5 : 15, "", + idx_max <= 32 ? 19 : 29, val_type); + + if (idx_max <= 32) + stars = stars_max; + else + stars = stars_max / 2; + + for (i = 0; i <= idx_max; i++) { + low = (1ULL << (i + 1)) >> 1; + high = (1ULL << (i + 1)) - 1; + if (low == high) + low -= 1; + val = vals[i]; + width = idx_max <= 32 ? 10 : 20; + printf("%*lld -> %-*lld : %-8d |", width, low, width, high, val); + print_stars(val, val_max, stars); + printf("|\n"); + } +} + +void print_linear_hist(unsigned int *vals, int vals_size, const char *val_type) +{ + int i, stars_max = 40, idx_max = -1; + unsigned int val, val_max = 0; + + for (i = 0; i < vals_size; i++) { + val = vals[i]; + if (val > 0) + idx_max = i; + if (val > val_max) + val_max = val; + } + + if (idx_max < 0) + return; + + printf(" %-13s : count distribution\n", val_type); + for (i = 0; i <= idx_max; i++) { + val = vals[i]; + printf(" %-10d : %-8d |", i, val); + print_stars(val, val_max, stars_max); + printf("|\n"); + } +} + +unsigned long long get_ktime_ns(void) +{ + struct timespec ts; + + clock_gettime(CLOCK_MONOTONIC, &ts); + return ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec; +} + +int bump_memlock_rlimit(void) +{ + struct rlimit rlim_new = { + .rlim_cur = RLIM_INFINITY, + .rlim_max = RLIM_INFINITY, + }; + + return setrlimit(RLIMIT_MEMLOCK, &rlim_new); +} diff --git a/libbpf-tools/trace_helpers.h b/libbpf-tools/trace_helpers.h new file mode 100644 index 000000000..486db5d1b --- /dev/null +++ b/libbpf-tools/trace_helpers.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __TRACE_HELPERS_H +#define __TRACE_HELPERS_H + +#define NSEC_PER_SEC 1000000000ULL + +struct ksym { + const char *name; + unsigned long addr; +}; + +struct ksyms; + +struct ksyms *ksyms__load(void); +void ksyms__free(struct ksyms *ksyms); +const struct ksym *ksyms__map_addr(const struct ksyms *ksyms, + unsigned long addr); +const struct ksym *ksyms__get_symbol(const struct ksyms *ksyms, + const char *name); + +struct partition { + char *name; + unsigned int dev; +}; + +struct partitions; + +struct partitions *partitions__load(void); +void partitions__free(struct partitions *partitions); +const struct partition * +partitions__get_by_dev(const struct partitions *partitions, unsigned int dev); +const struct partition * +partitions__get_by_name(const struct partitions *partitions, const char *name); + +void print_log2_hist(unsigned int *vals, int vals_size, const char *val_type); +void print_linear_hist(unsigned int *vals, int vals_size, const char *val_type); + +unsigned long long get_ktime_ns(void); +int bump_memlock_rlimit(void); + +#endif /* __TRACE_HELPERS_H */ diff --git a/libbpf-tools/vfsstat.bpf.c b/libbpf-tools/vfsstat.bpf.c new file mode 100644 index 000000000..414b8909f --- /dev/null +++ b/libbpf-tools/vfsstat.bpf.c @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Anton Protopopov +// +// Based on vfsstat(8) from BCC by Brendan Gregg +#include "vmlinux.h" +#include +#include +#include "vfsstat.h" + +__u64 stats[S_MAXSTAT] = {}; + +static __always_inline int inc_stats(int key) +{ + __atomic_add_fetch(&stats[key], 1, __ATOMIC_RELAXED); + return 0; +} + +SEC("kprobe/vfs_read") +int BPF_KPROBE(vfs_read) +{ + return inc_stats(S_READ); +} + +SEC("kprobe/vfs_write") +int BPF_KPROBE(vfs_write) +{ + return inc_stats(S_WRITE); +} + +SEC("kprobe/vfs_fsync") +int BPF_KPROBE(vfs_fsync) +{ + return inc_stats(S_FSYNC); +} + +SEC("kprobe/vfs_open") +int BPF_KPROBE(vfs_open) +{ + return inc_stats(S_OPEN); +} + +SEC("kprobe/vfs_create") +int BPF_KPROBE(vfs_create) +{ + return inc_stats(S_CREATE); +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/vfsstat.c b/libbpf-tools/vfsstat.c new file mode 100644 index 000000000..7fd42bd24 --- /dev/null +++ b/libbpf-tools/vfsstat.c @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Anton Protopopov +// +// Based on vfsstat(8) from BCC by Brendan Gregg +#include +#include +#include +#include +#include "vfsstat.h" +#include "vfsstat.skel.h" +#include "trace_helpers.h" + +const char *argp_program_version = "vfsstat 0.1"; +const char *argp_program_bug_address = ""; +static const char argp_program_doc[] = + "\nvfsstat: Count some VFS calls\n" + "\n" + "EXAMPLES:\n" + " vfsstat # interval one second\n" + " vfsstat 5 3 # interval five seconds, three output lines\n"; +static char args_doc[] = "[interval [count]]"; + +static const struct argp_option opts[] = { + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static struct env { + bool verbose; + int count; + int interval; +} env = { + .interval = 1, /* once a second */ +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + long interval; + long count; + + switch (key) { + case 'v': + env.verbose = true; + break; + case ARGP_KEY_ARG: + switch (state->arg_num) { + case 0: + errno = 0; + interval = strtol(arg, NULL, 10); + if (errno || interval <= 0 || interval > INT_MAX) { + fprintf(stderr, "invalid interval: %s\n", arg); + argp_usage(state); + } + env.interval = interval; + break; + case 1: + errno = 0; + count = strtol(arg, NULL, 10); + if (errno || count < 0 || count > INT_MAX) { + fprintf(stderr, "invalid count: %s\n", arg); + argp_usage(state); + } + env.count = count; + break; + default: + argp_usage(state); + break; + } + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +static int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +static const char *strftime_now(char *s, size_t max, const char *format) +{ + struct tm *tm; + time_t t; + + t = time(NULL); + tm = localtime(&t); + if (tm == NULL) { + fprintf(stderr, "localtime: %s\n", strerror(errno)); + return ""; + } + if (strftime(s, max, format, tm) == 0) { + fprintf(stderr, "strftime error\n"); + return ""; + } + return s; +} + +static const char *stat_types_names[] = { + [S_READ] = "READ", + [S_WRITE] = "WRITE", + [S_FSYNC] = "FSYNC", + [S_OPEN] = "OPEN", + [S_CREATE] = "CREATE", +}; + +static void print_header(void) +{ + printf("%-8s ", "TIME"); + for (int i = 0; i < S_MAXSTAT; i++) + printf(" %6s/s", stat_types_names[i]); + printf("\n"); +} + +static void print_and_reset_stats(__u64 stats[S_MAXSTAT]) +{ + char s[16]; + __u64 val; + + printf("%-8s: ", strftime_now(s, sizeof(s), "%H:%M:%S")); + for (int i = 0; i < S_MAXSTAT; i++) { + val = __atomic_exchange_n(&stats[i], 0, __ATOMIC_RELAXED); + printf(" %8llu", val / env.interval); + } + printf("\n"); +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + .args_doc = args_doc, + }; + struct vfsstat_bpf *obj; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %s\n", + strerror(errno)); + return 1; + } + + obj = vfsstat_bpf__open_and_load(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF object\n"); + return 1; + } + + err = vfsstat_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs: %s\n", + strerror(-err)); + goto cleanup; + } + + print_header(); + do { + sleep(env.interval); + print_and_reset_stats(obj->bss->stats); + } while (!env.count || --env.count); + +cleanup: + vfsstat_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/vfsstat.h b/libbpf-tools/vfsstat.h new file mode 100644 index 000000000..e5a3c16eb --- /dev/null +++ b/libbpf-tools/vfsstat.h @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Anton Protopopov +#ifndef __VFSSTAT_H +#define __VFSSTAT_H + +enum stat_types { + S_READ, + S_WRITE, + S_FSYNC, + S_OPEN, + S_CREATE, + S_MAXSTAT, +}; + +#endif /* __VFSSTAT_H */ diff --git a/libbpf-tools/vmlinux_505.h b/libbpf-tools/vmlinux_505.h index beed1f2fd..7c2aaa742 100644 --- a/libbpf-tools/vmlinux_505.h +++ b/libbpf-tools/vmlinux_505.h @@ -1,3 +1,6 @@ +#ifndef __VMLINUX_H__ +#define __VMLINUX_H__ + #ifndef BPF_NO_PRESERVE_ACCESS_INDEX #pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record) #endif @@ -136,6 +139,149 @@ struct callback_head { void (*func)(struct callback_head *); }; +typedef int initcall_entry_t; + +struct lock_class_key {}; + +struct fs_context; + +struct fs_parameter_description; + +struct dentry; + +struct super_block; + +struct module; + +struct file_system_type { + const char *name; + int fs_flags; + int (*init_fs_context)(struct fs_context *); + const struct fs_parameter_description *parameters; + struct dentry * (*mount)(struct file_system_type *, int, const char *, void *); + void (*kill_sb)(struct super_block *); + struct module *owner; + struct file_system_type *next; + struct hlist_head fs_supers; + struct lock_class_key s_lock_key; + struct lock_class_key s_umount_key; + struct lock_class_key s_vfs_rename_key; + struct lock_class_key s_writers_key[3]; + struct lock_class_key i_lock_key; + struct lock_class_key i_mutex_key; + struct lock_class_key i_mutex_dir_key; +}; + +typedef void *fl_owner_t; + +struct file; + +struct kiocb; + +struct iov_iter; + +struct dir_context; + +struct poll_table_struct; + +struct vm_area_struct; + +struct inode; + +struct file_lock; + +struct page; + +struct pipe_inode_info; + +struct seq_file; + +struct file_operations { + struct module *owner; + loff_t (*llseek)(struct file *, loff_t, int); + ssize_t (*read)(struct file *, char *, size_t, loff_t *); + ssize_t (*write)(struct file *, const char *, size_t, loff_t *); + ssize_t (*read_iter)(struct kiocb *, struct iov_iter *); + ssize_t (*write_iter)(struct kiocb *, struct iov_iter *); + int (*iopoll)(struct kiocb *, bool); + int (*iterate)(struct file *, struct dir_context *); + int (*iterate_shared)(struct file *, struct dir_context *); + __poll_t (*poll)(struct file *, struct poll_table_struct *); + long int (*unlocked_ioctl)(struct file *, unsigned int, long unsigned int); + long int (*compat_ioctl)(struct file *, unsigned int, long unsigned int); + int (*mmap)(struct file *, struct vm_area_struct *); + long unsigned int mmap_supported_flags; + int (*open)(struct inode *, struct file *); + int (*flush)(struct file *, fl_owner_t); + int (*release)(struct inode *, struct file *); + int (*fsync)(struct file *, loff_t, loff_t, int); + int (*fasync)(int, struct file *, int); + int (*lock)(struct file *, int, struct file_lock *); + ssize_t (*sendpage)(struct file *, struct page *, int, size_t, loff_t *, int); + long unsigned int (*get_unmapped_area)(struct file *, long unsigned int, long unsigned int, long unsigned int, long unsigned int); + int (*check_flags)(int); + int (*flock)(struct file *, int, struct file_lock *); + ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); + ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); + int (*setlease)(struct file *, long int, struct file_lock **, void **); + long int (*fallocate)(struct file *, int, loff_t, loff_t); + void (*show_fdinfo)(struct seq_file *, struct file *); + ssize_t (*copy_file_range)(struct file *, loff_t, struct file *, loff_t, size_t, unsigned int); + loff_t (*remap_file_range)(struct file *, loff_t, struct file *, loff_t, loff_t, unsigned int); + int (*fadvise)(struct file *, loff_t, loff_t, int); +}; + +struct qspinlock { + union { + atomic_t val; + struct { + u8 locked; + u8 pending; + }; + struct { + u16 locked_pending; + u16 tail; + }; + }; +}; + +typedef struct qspinlock arch_spinlock_t; + +struct raw_spinlock { + arch_spinlock_t raw_lock; +}; + +struct spinlock { + union { + struct raw_spinlock rlock; + }; +}; + +typedef struct spinlock spinlock_t; + +struct notifier_block; + +struct atomic_notifier_head { + spinlock_t lock; + struct notifier_block *head; +}; + +enum system_states { + SYSTEM_BOOTING = 0, + SYSTEM_SCHEDULING = 1, + SYSTEM_RUNNING = 2, + SYSTEM_HALT = 3, + SYSTEM_POWER_OFF = 4, + SYSTEM_RESTART = 5, + SYSTEM_SUSPEND = 6, +}; + +struct taint_flag { + char c_true; + char c_false; + bool module; +}; + struct jump_entry { s32 code; s32 target; @@ -153,6 +299,10 @@ struct static_key { }; }; +struct static_key_true { + struct static_key key; +}; + struct static_key_false { struct static_key key; }; @@ -164,6 +314,11 @@ struct __kernel_timespec { long long int tv_nsec; }; +struct timezone { + int tz_minuteswest; + int tz_dsttime; +}; + struct timespec64 { time64_t tv_sec; long int tv_nsec; @@ -214,494 +369,299 @@ struct restart_block { }; }; -struct screen_info { - __u8 orig_x; - __u8 orig_y; - __u16 ext_mem_k; - __u16 orig_video_page; - __u8 orig_video_mode; - __u8 orig_video_cols; - __u8 flags; - __u8 unused2; - __u16 orig_video_ega_bx; - __u16 unused3; - __u8 orig_video_lines; - __u8 orig_video_isVGA; - __u16 orig_video_points; - __u16 lfb_width; - __u16 lfb_height; - __u16 lfb_depth; - __u32 lfb_base; - __u32 lfb_size; - __u16 cl_magic; - __u16 cl_offset; - __u16 lfb_linelength; - __u8 red_size; - __u8 red_pos; - __u8 green_size; - __u8 green_pos; - __u8 blue_size; - __u8 blue_pos; - __u8 rsvd_size; - __u8 rsvd_pos; - __u16 vesapm_seg; - __u16 vesapm_off; - __u16 pages; - __u16 vesa_attributes; - __u32 capabilities; - __u32 ext_lfb_base; - __u8 _reserved[2]; -} __attribute__((packed)); - -struct apm_bios_info { - __u16 version; - __u16 cseg; - __u32 offset; - __u16 cseg_16; - __u16 dseg; - __u16 flags; - __u16 cseg_len; - __u16 cseg_16_len; - __u16 dseg_len; +struct thread_info { + long unsigned int flags; + u32 status; }; -struct edd_device_params { - __u16 length; - __u16 info_flags; - __u32 num_default_cylinders; - __u32 num_default_heads; - __u32 sectors_per_track; - __u64 number_of_sectors; - __u16 bytes_per_sector; - __u32 dpte_ptr; - __u16 key; - __u8 device_path_info_length; - __u8 reserved2; - __u16 reserved3; - __u8 host_bus_type[4]; - __u8 interface_type[8]; - union { - struct { - __u16 base_address; - __u16 reserved1; - __u32 reserved2; - } isa; - struct { - __u8 bus; - __u8 slot; - __u8 function; - __u8 channel; - __u32 reserved; - } pci; - struct { - __u64 reserved; - } ibnd; - struct { - __u64 reserved; - } xprs; - struct { - __u64 reserved; - } htpt; - struct { - __u64 reserved; - } unknown; - } interface_path; - union { - struct { - __u8 device; - __u8 reserved1; - __u16 reserved2; - __u32 reserved3; - __u64 reserved4; - } ata; - struct { - __u8 device; - __u8 lun; - __u8 reserved1; - __u8 reserved2; - __u32 reserved3; - __u64 reserved4; - } atapi; - struct { - __u16 id; - __u64 lun; - __u16 reserved1; - __u32 reserved2; - } __attribute__((packed)) scsi; - struct { - __u64 serial_number; - __u64 reserved; - } usb; - struct { - __u64 eui; - __u64 reserved; - } i1394; - struct { - __u64 wwid; - __u64 lun; - } fibre; - struct { - __u64 identity_tag; - __u64 reserved; - } i2o; - struct { - __u32 array_number; - __u32 reserved1; - __u64 reserved2; - } raid; - struct { - __u8 device; - __u8 reserved1; - __u16 reserved2; - __u32 reserved3; - __u64 reserved4; - } sata; - struct { - __u64 reserved1; - __u64 reserved2; - } unknown; - } device_path; - __u8 reserved4; - __u8 checksum; -} __attribute__((packed)); +struct refcount_struct { + atomic_t refs; +}; -struct edd_info { - __u8 device; - __u8 version; - __u16 interface_support; - __u16 legacy_max_cylinder; - __u8 legacy_max_head; - __u8 legacy_sectors_per_track; - struct edd_device_params params; -} __attribute__((packed)); +typedef struct refcount_struct refcount_t; -struct ist_info { - __u32 signature; - __u32 command; - __u32 event; - __u32 perf_level; +struct llist_node { + struct llist_node *next; }; -struct edid_info { - unsigned char dummy[128]; +struct load_weight { + long unsigned int weight; + u32 inv_weight; }; -struct setup_header { - __u8 setup_sects; - __u16 root_flags; - __u32 syssize; - __u16 ram_size; - __u16 vid_mode; - __u16 root_dev; - __u16 boot_flag; - __u16 jump; - __u32 header; - __u16 version; - __u32 realmode_swtch; - __u16 start_sys_seg; - __u16 kernel_version; - __u8 type_of_loader; - __u8 loadflags; - __u16 setup_move_size; - __u32 code32_start; - __u32 ramdisk_image; - __u32 ramdisk_size; - __u32 bootsect_kludge; - __u16 heap_end_ptr; - __u8 ext_loader_ver; - __u8 ext_loader_type; - __u32 cmd_line_ptr; - __u32 initrd_addr_max; - __u32 kernel_alignment; - __u8 relocatable_kernel; - __u8 min_alignment; - __u16 xloadflags; - __u32 cmdline_size; - __u32 hardware_subarch; - __u64 hardware_subarch_data; - __u32 payload_offset; - __u32 payload_length; - __u64 setup_data; - __u64 pref_address; - __u32 init_size; - __u32 handover_offset; - __u32 kernel_info_offset; -} __attribute__((packed)); +struct rb_node { + long unsigned int __rb_parent_color; + struct rb_node *rb_right; + struct rb_node *rb_left; +}; -struct sys_desc_table { - __u16 length; - __u8 table[14]; +struct sched_statistics { + u64 wait_start; + u64 wait_max; + u64 wait_count; + u64 wait_sum; + u64 iowait_count; + u64 iowait_sum; + u64 sleep_start; + u64 sleep_max; + s64 sum_sleep_runtime; + u64 block_start; + u64 block_max; + u64 exec_max; + u64 slice_max; + u64 nr_migrations_cold; + u64 nr_failed_migrations_affine; + u64 nr_failed_migrations_running; + u64 nr_failed_migrations_hot; + u64 nr_forced_migrations; + u64 nr_wakeups; + u64 nr_wakeups_sync; + u64 nr_wakeups_migrate; + u64 nr_wakeups_local; + u64 nr_wakeups_remote; + u64 nr_wakeups_affine; + u64 nr_wakeups_affine_attempts; + u64 nr_wakeups_passive; + u64 nr_wakeups_idle; }; -struct olpc_ofw_header { - __u32 ofw_magic; - __u32 ofw_version; - __u32 cif_handler; - __u32 irq_desc_table; +struct util_est { + unsigned int enqueued; + unsigned int ewma; }; -struct efi_info { - __u32 efi_loader_signature; - __u32 efi_systab; - __u32 efi_memdesc_size; - __u32 efi_memdesc_version; - __u32 efi_memmap; - __u32 efi_memmap_size; - __u32 efi_systab_hi; - __u32 efi_memmap_hi; +struct sched_avg { + u64 last_update_time; + u64 load_sum; + u64 runnable_load_sum; + u32 util_sum; + u32 period_contrib; + long unsigned int load_avg; + long unsigned int runnable_load_avg; + long unsigned int util_avg; + struct util_est util_est; }; -struct boot_e820_entry { - __u64 addr; - __u64 size; - __u32 type; -} __attribute__((packed)); +struct cfs_rq; -struct boot_params { - struct screen_info screen_info; - struct apm_bios_info apm_bios_info; - __u8 _pad2[4]; - __u64 tboot_addr; - struct ist_info ist_info; - __u64 acpi_rsdp_addr; - __u8 _pad3[8]; - __u8 hd0_info[16]; - __u8 hd1_info[16]; - struct sys_desc_table sys_desc_table; - struct olpc_ofw_header olpc_ofw_header; - __u32 ext_ramdisk_image; - __u32 ext_ramdisk_size; - __u32 ext_cmd_line_ptr; - __u8 _pad4[116]; - struct edid_info edid_info; - struct efi_info efi_info; - __u32 alt_mem_k; - __u32 scratch; - __u8 e820_entries; - __u8 eddbuf_entries; - __u8 edd_mbr_sig_buf_entries; - __u8 kbd_status; - __u8 secure_boot; - __u8 _pad5[2]; - __u8 sentinel; - __u8 _pad6[1]; - struct setup_header hdr; - __u8 _pad7[36]; - __u32 edd_mbr_sig_buffer[16]; - struct boot_e820_entry e820_table[128]; - __u8 _pad8[48]; - struct edd_info eddbuf[6]; - __u8 _pad9[276]; -} __attribute__((packed)); +struct sched_entity { + struct load_weight load; + long unsigned int runnable_weight; + struct rb_node run_node; + struct list_head group_node; + unsigned int on_rq; + u64 exec_start; + u64 sum_exec_runtime; + u64 vruntime; + u64 prev_sum_exec_runtime; + u64 nr_migrations; + struct sched_statistics statistics; + int depth; + struct sched_entity *parent; + struct cfs_rq *cfs_rq; + struct cfs_rq *my_q; + long: 64; + long: 64; + long: 64; + struct sched_avg avg; +}; -enum x86_hardware_subarch { - X86_SUBARCH_PC = 0, - X86_SUBARCH_LGUEST = 1, - X86_SUBARCH_XEN = 2, - X86_SUBARCH_INTEL_MID = 3, - X86_SUBARCH_CE4100 = 4, - X86_NR_SUBARCHS = 5, +struct sched_rt_entity { + struct list_head run_list; + long unsigned int timeout; + long unsigned int watchdog_stamp; + unsigned int time_slice; + short unsigned int on_rq; + short unsigned int on_list; + struct sched_rt_entity *back; }; -struct pt_regs { - long unsigned int r15; - long unsigned int r14; - long unsigned int r13; - long unsigned int r12; - long unsigned int bp; - long unsigned int bx; - long unsigned int r11; - long unsigned int r10; - long unsigned int r9; - long unsigned int r8; - long unsigned int ax; - long unsigned int cx; - long unsigned int dx; - long unsigned int si; - long unsigned int di; - long unsigned int orig_ax; - long unsigned int ip; - long unsigned int cs; - long unsigned int flags; - long unsigned int sp; - long unsigned int ss; +typedef s64 ktime_t; + +struct timerqueue_node { + struct rb_node node; + ktime_t expires; }; -struct math_emu_info { - long int ___orig_eip; - struct pt_regs *regs; +enum hrtimer_restart { + HRTIMER_NORESTART = 0, + HRTIMER_RESTART = 1, }; -typedef long unsigned int pteval_t; +struct hrtimer_clock_base; -typedef long unsigned int pmdval_t; +struct hrtimer { + struct timerqueue_node node; + ktime_t _softexpires; + enum hrtimer_restart (*function)(struct hrtimer *); + struct hrtimer_clock_base *base; + u8 state; + u8 is_rel; + u8 is_soft; + u8 is_hard; +}; -typedef long unsigned int pudval_t; +struct sched_dl_entity { + struct rb_node rb_node; + u64 dl_runtime; + u64 dl_deadline; + u64 dl_period; + u64 dl_bw; + u64 dl_density; + s64 runtime; + u64 deadline; + unsigned int flags; + unsigned int dl_throttled: 1; + unsigned int dl_boosted: 1; + unsigned int dl_yielded: 1; + unsigned int dl_non_contending: 1; + unsigned int dl_overrun: 1; + struct hrtimer dl_timer; + struct hrtimer inactive_timer; +}; -typedef long unsigned int p4dval_t; +struct cpumask { + long unsigned int bits[1]; +}; -typedef long unsigned int pgdval_t; +typedef struct cpumask cpumask_t; -typedef long unsigned int pgprotval_t; +struct sched_info { + long unsigned int pcount; + long long unsigned int run_delay; + long long unsigned int last_arrival; + long long unsigned int last_queued; +}; -typedef struct { - pteval_t pte; -} pte_t; +struct plist_node { + int prio; + struct list_head prio_list; + struct list_head node_list; +}; -struct pgprot { - pgprotval_t pgprot; +struct vmacache { + u64 seqnum; + struct vm_area_struct *vmas[4]; }; -typedef struct pgprot pgprot_t; +struct task_rss_stat { + int events; + int count[4]; +}; -typedef struct { - pgdval_t pgd; -} pgd_t; +typedef struct raw_spinlock raw_spinlock_t; -typedef struct { - p4dval_t p4d; -} p4d_t; +struct prev_cputime { + u64 utime; + u64 stime; + raw_spinlock_t lock; +}; -typedef struct { - pudval_t pud; -} pud_t; +struct rb_root { + struct rb_node *rb_node; +}; -typedef struct { - pmdval_t pmd; -} pmd_t; +struct rb_root_cached { + struct rb_root rb_root; + struct rb_node *rb_leftmost; +}; -struct page; +struct timerqueue_head { + struct rb_root_cached rb_root; +}; -typedef struct page *pgtable_t; +struct posix_cputimer_base { + u64 nextevt; + struct timerqueue_head tqhead; +}; -struct qspinlock { - union { - atomic_t val; - struct { - u8 locked; - u8 pending; - }; - struct { - u16 locked_pending; - u16 tail; - }; - }; +struct posix_cputimers { + struct posix_cputimer_base bases[3]; + unsigned int timers_active; + unsigned int expiry_active; }; -typedef struct qspinlock arch_spinlock_t; +struct sem_undo_list; -struct raw_spinlock { - arch_spinlock_t raw_lock; +struct sysv_sem { + struct sem_undo_list *undo_list; }; -struct spinlock { - union { - struct raw_spinlock rlock; - }; +struct sysv_shm { + struct list_head shm_clist; }; -typedef struct spinlock spinlock_t; +typedef struct { + long unsigned int sig[1]; +} sigset_t; -struct address_space; +struct sigpending { + struct list_head list; + sigset_t signal; +}; -struct kmem_cache; +typedef struct { + uid_t val; +} kuid_t; -struct mm_struct; +struct seccomp_filter; -struct dev_pagemap; +struct seccomp { + int mode; + struct seccomp_filter *filter; +}; -struct page { - long unsigned int flags; - union { - struct { - struct list_head lru; - struct address_space *mapping; - long unsigned int index; - long unsigned int private; - }; - struct { - dma_addr_t dma_addr; - }; - struct { - union { - struct list_head slab_list; - struct { - struct page *next; - int pages; - int pobjects; - }; - }; - struct kmem_cache *slab_cache; - void *freelist; - union { - void *s_mem; - long unsigned int counters; - struct { - unsigned int inuse: 16; - unsigned int objects: 15; - unsigned int frozen: 1; - }; - }; - }; - struct { - long unsigned int compound_head; - unsigned char compound_dtor; - unsigned char compound_order; - atomic_t compound_mapcount; - }; - struct { - long unsigned int _compound_pad_1; - long unsigned int _compound_pad_2; - struct list_head deferred_list; - }; - struct { - long unsigned int _pt_pad_1; - pgtable_t pmd_huge_pte; - long unsigned int _pt_pad_2; - union { - struct mm_struct *pt_mm; - atomic_t pt_frag_refcount; - }; - spinlock_t ptl; - }; - struct { - struct dev_pagemap *pgmap; - void *zone_device_data; - }; - struct callback_head callback_head; - }; - union { - atomic_t _mapcount; - unsigned int page_type; - unsigned int active; - int units; - }; - atomic_t _refcount; - long: 64; +struct wake_q_node { + struct wake_q_node *next; }; -typedef atomic64_t atomic_long_t; +struct task_io_accounting { + u64 rchar; + u64 wchar; + u64 syscr; + u64 syscw; + u64 read_bytes; + u64 write_bytes; + u64 cancelled_write_bytes; +}; -struct cpumask { +typedef struct { long unsigned int bits[1]; +} nodemask_t; + +struct seqcount { + unsigned int sequence; }; -typedef struct cpumask cpumask_t; +typedef struct seqcount seqcount_t; -typedef struct cpumask cpumask_var_t[1]; +typedef atomic64_t atomic_long_t; -struct tracepoint_func { - void *func; - void *data; - int prio; +struct optimistic_spin_queue { + atomic_t tail; }; -struct tracepoint { - const char *name; - struct static_key key; - int (*regfunc)(); - void (*unregfunc)(); - struct tracepoint_func *funcs; +struct mutex { + atomic_long_t owner; + spinlock_t wait_lock; + struct optimistic_spin_queue osq; + struct list_head wait_list; +}; + +struct arch_tlbflush_unmap_batch { + struct cpumask cpumask; +}; + +struct tlbflush_unmap_batch { + struct arch_tlbflush_unmap_batch arch; + bool flush_required; + bool writable; +}; + +struct page_frag { + struct page *page; + __u32 offset; + __u32 size; }; struct desc_struct { @@ -720,10 +680,9 @@ struct desc_struct { u16 base2: 8; }; -struct desc_ptr { - short unsigned int size; - long unsigned int address; -} __attribute__((packed)); +typedef struct { + long unsigned int seg; +} mm_segment_t; struct fregs_state { u32 cwd; @@ -765,6 +724,8 @@ struct fxregs_state { }; }; +struct math_emu_info; + struct swregs_state { u32 cwd; u32 swd; @@ -816,1116 +777,75 @@ struct fpu { union fpregs_state state; }; -struct cpuinfo_x86 { - __u8 x86; - __u8 x86_vendor; - __u8 x86_model; - __u8 x86_stepping; - int x86_tlbsize; - __u8 x86_virt_bits; - __u8 x86_phys_bits; - __u8 x86_coreid_bits; - __u8 cu_id; - __u32 extended_cpuid_level; - int cpuid_level; - union { - __u32 x86_capability[20]; - long unsigned int x86_capability_alignment; - }; - char x86_vendor_id[16]; - char x86_model_id[64]; - unsigned int x86_cache_size; - int x86_cache_alignment; - int x86_cache_max_rmid; - int x86_cache_occ_scale; - int x86_power; - long unsigned int loops_per_jiffy; - u16 x86_max_cores; - u16 apicid; - u16 initial_apicid; - u16 x86_clflush_size; - u16 booted_cores; - u16 phys_proc_id; - u16 logical_proc_id; - u16 cpu_core_id; - u16 cpu_die_id; - u16 logical_die_id; - u16 cpu_index; - u32 microcode; - u8 x86_cache_bits; - unsigned int initialized: 1; -}; - -struct x86_hw_tss { - u32 reserved1; - u64 sp0; - u64 sp1; - u64 sp2; - u64 reserved2; - u64 ist[7]; - u32 reserved3; - u32 reserved4; - u16 reserved5; - u16 io_bitmap_base; -} __attribute__((packed)); +struct perf_event; -struct x86_io_bitmap { - u64 prev_sequence; - unsigned int prev_max; - long unsigned int bitmap[1025]; - long unsigned int mapall[1025]; -}; +struct io_bitmap; -struct tss_struct { - struct x86_hw_tss x86_tss; - struct x86_io_bitmap io_bitmap; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct thread_struct { + struct desc_struct tls_array[3]; + long unsigned int sp; + short unsigned int es; + short unsigned int ds; + short unsigned int fsindex; + short unsigned int gsindex; + long unsigned int fsbase; + long unsigned int gsbase; + struct perf_event *ptrace_bps[4]; + long unsigned int debugreg6; + long unsigned int ptrace_dr7; + long unsigned int cr2; + long unsigned int trap_nr; + long unsigned int error_code; + struct io_bitmap *io_bitmap; + long unsigned int iopl_emul; + mm_segment_t addr_limit; + unsigned int sig_on_uaccess_err: 1; + unsigned int uaccess_err: 1; + long: 62; long: 64; long: 64; long: 64; long: 64; + struct fpu fpu; }; -struct fixed_percpu_data { - char gs_base[40]; - long unsigned int stack_canary; -}; +struct sched_class; -typedef struct { - long unsigned int seg; -} mm_segment_t; +struct task_group; -struct perf_event; +struct mm_struct; -struct io_bitmap; +struct pid; -struct thread_struct { - struct desc_struct tls_array[3]; - long unsigned int sp; - short unsigned int es; - short unsigned int ds; - short unsigned int fsindex; - short unsigned int gsindex; - long unsigned int fsbase; - long unsigned int gsbase; - struct perf_event *ptrace_bps[4]; - long unsigned int debugreg6; - long unsigned int ptrace_dr7; - long unsigned int cr2; - long unsigned int trap_nr; - long unsigned int error_code; - struct io_bitmap *io_bitmap; - long unsigned int iopl_emul; - mm_segment_t addr_limit; - unsigned int sig_on_uaccess_err: 1; - unsigned int uaccess_err: 1; - long: 62; - long: 64; - long: 64; - long: 64; - long: 64; - struct fpu fpu; -}; +struct completion; -struct thread_info { - long unsigned int flags; - u32 status; -}; +struct cred; -struct llist_node { - struct llist_node *next; -}; +struct key; -struct mpc_table { - char signature[4]; - short unsigned int length; - char spec; - char checksum; - char oem[8]; - char productid[12]; - unsigned int oemptr; - short unsigned int oemsize; - short unsigned int oemcount; - unsigned int lapic; - unsigned int reserved; -}; +struct nameidata; -struct mpc_cpu { - unsigned char type; - unsigned char apicid; - unsigned char apicver; - unsigned char cpuflag; - unsigned int cpufeature; - unsigned int featureflag; - unsigned int reserved[2]; -}; +struct fs_struct; -struct mpc_bus { - unsigned char type; - unsigned char busid; - unsigned char bustype[6]; -}; +struct files_struct; -struct x86_init_mpparse { - void (*mpc_record)(unsigned int); - void (*setup_ioapic_ids)(); - int (*mpc_apic_id)(struct mpc_cpu *); - void (*smp_read_mpc_oem)(struct mpc_table *); - void (*mpc_oem_pci_bus)(struct mpc_bus *); - void (*mpc_oem_bus_info)(struct mpc_bus *, char *); - void (*find_smp_config)(); - void (*get_smp_config)(unsigned int); -}; +struct nsproxy; -struct x86_init_resources { - void (*probe_roms)(); - void (*reserve_resources)(); - char * (*memory_setup)(); -}; +struct signal_struct; -struct x86_init_irqs { - void (*pre_vector_init)(); - void (*intr_init)(); - void (*trap_init)(); - void (*intr_mode_init)(); -}; +struct sighand_struct; -struct x86_init_oem { - void (*arch_setup)(); - void (*banner)(); -}; +struct audit_context; -struct x86_init_paging { - void (*pagetable_init)(); -}; +struct rt_mutex_waiter; -struct x86_init_timers { - void (*setup_percpu_clockev)(); - void (*timer_init)(); - void (*wallclock_init)(); -}; +struct bio_list; -struct x86_init_iommu { - int (*iommu_init)(); -}; +struct blk_plug; -struct x86_init_pci { - int (*arch_init)(); - int (*init)(); - void (*init_irq)(); - void (*fixup_irqs)(); -}; +struct reclaim_state; -struct x86_hyper_init { - void (*init_platform)(); - void (*guest_late_init)(); - bool (*x2apic_available)(); - void (*init_mem_mapping)(); - void (*init_after_bootmem)(); -}; - -struct x86_init_acpi { - void (*set_root_pointer)(u64); - u64 (*get_root_pointer)(); - void (*reduced_hw_early_init)(); -}; - -struct x86_init_ops { - struct x86_init_resources resources; - struct x86_init_mpparse mpparse; - struct x86_init_irqs irqs; - struct x86_init_oem oem; - struct x86_init_paging paging; - struct x86_init_timers timers; - struct x86_init_iommu iommu; - struct x86_init_pci pci; - struct x86_hyper_init hyper; - struct x86_init_acpi acpi; -}; - -struct x86_legacy_devices { - int pnpbios; -}; - -enum x86_legacy_i8042_state { - X86_LEGACY_I8042_PLATFORM_ABSENT = 0, - X86_LEGACY_I8042_FIRMWARE_ABSENT = 1, - X86_LEGACY_I8042_EXPECTED_PRESENT = 2, -}; - -struct x86_legacy_features { - enum x86_legacy_i8042_state i8042; - int rtc; - int warm_reset; - int no_vga; - int reserve_bios_regions; - struct x86_legacy_devices devices; -}; - -struct x86_hyper_runtime { - void (*pin_vcpu)(int); -}; - -struct x86_platform_ops { - long unsigned int (*calibrate_cpu)(); - long unsigned int (*calibrate_tsc)(); - void (*get_wallclock)(struct timespec64 *); - int (*set_wallclock)(const struct timespec64 *); - void (*iommu_shutdown)(); - bool (*is_untracked_pat_range)(u64, u64); - void (*nmi_init)(); - unsigned char (*get_nmi_reason)(); - void (*save_sched_clock_state)(); - void (*restore_sched_clock_state)(); - void (*apic_post_init)(); - struct x86_legacy_features legacy; - void (*set_legacy_features)(); - struct x86_hyper_runtime hyper; -}; - -struct x86_apic_ops { - unsigned int (*io_apic_read)(unsigned int, unsigned int); - void (*restore)(); -}; - -struct physid_mask { - long unsigned int mask[512]; -}; - -typedef struct physid_mask physid_mask_t; - -typedef struct { - long unsigned int bits[1]; -} nodemask_t; - -struct qrwlock { - union { - atomic_t cnts; - struct { - u8 wlocked; - u8 __lstate[3]; - }; - }; - arch_spinlock_t wait_lock; -}; - -typedef struct qrwlock arch_rwlock_t; - -struct lock_class_key {}; - -typedef struct raw_spinlock raw_spinlock_t; - -typedef struct { - arch_rwlock_t raw_lock; -} rwlock_t; - -struct optimistic_spin_queue { - atomic_t tail; -}; - -struct rw_semaphore { - atomic_long_t count; - atomic_long_t owner; - struct optimistic_spin_queue osq; - raw_spinlock_t wait_lock; - struct list_head wait_list; -}; - -struct mutex { - atomic_long_t owner; - spinlock_t wait_lock; - struct optimistic_spin_queue osq; - struct list_head wait_list; -}; - -struct refcount_struct { - atomic_t refs; -}; - -typedef struct refcount_struct refcount_t; - -struct load_weight { - long unsigned int weight; - u32 inv_weight; -}; - -struct rb_node { - long unsigned int __rb_parent_color; - struct rb_node *rb_right; - struct rb_node *rb_left; -}; - -struct sched_statistics { - u64 wait_start; - u64 wait_max; - u64 wait_count; - u64 wait_sum; - u64 iowait_count; - u64 iowait_sum; - u64 sleep_start; - u64 sleep_max; - s64 sum_sleep_runtime; - u64 block_start; - u64 block_max; - u64 exec_max; - u64 slice_max; - u64 nr_migrations_cold; - u64 nr_failed_migrations_affine; - u64 nr_failed_migrations_running; - u64 nr_failed_migrations_hot; - u64 nr_forced_migrations; - u64 nr_wakeups; - u64 nr_wakeups_sync; - u64 nr_wakeups_migrate; - u64 nr_wakeups_local; - u64 nr_wakeups_remote; - u64 nr_wakeups_affine; - u64 nr_wakeups_affine_attempts; - u64 nr_wakeups_passive; - u64 nr_wakeups_idle; -}; - -struct util_est { - unsigned int enqueued; - unsigned int ewma; -}; - -struct sched_avg { - u64 last_update_time; - u64 load_sum; - u64 runnable_load_sum; - u32 util_sum; - u32 period_contrib; - long unsigned int load_avg; - long unsigned int runnable_load_avg; - long unsigned int util_avg; - struct util_est util_est; -}; - -struct cfs_rq; - -struct sched_entity { - struct load_weight load; - long unsigned int runnable_weight; - struct rb_node run_node; - struct list_head group_node; - unsigned int on_rq; - u64 exec_start; - u64 sum_exec_runtime; - u64 vruntime; - u64 prev_sum_exec_runtime; - u64 nr_migrations; - struct sched_statistics statistics; - int depth; - struct sched_entity *parent; - struct cfs_rq *cfs_rq; - struct cfs_rq *my_q; - long: 64; - long: 64; - long: 64; - struct sched_avg avg; -}; - -struct sched_rt_entity { - struct list_head run_list; - long unsigned int timeout; - long unsigned int watchdog_stamp; - unsigned int time_slice; - short unsigned int on_rq; - short unsigned int on_list; - struct sched_rt_entity *back; -}; - -typedef s64 ktime_t; - -struct timerqueue_node { - struct rb_node node; - ktime_t expires; -}; - -enum hrtimer_restart { - HRTIMER_NORESTART = 0, - HRTIMER_RESTART = 1, -}; - -struct hrtimer_clock_base; - -struct hrtimer { - struct timerqueue_node node; - ktime_t _softexpires; - enum hrtimer_restart (*function)(struct hrtimer *); - struct hrtimer_clock_base *base; - u8 state; - u8 is_rel; - u8 is_soft; - u8 is_hard; -}; - -struct sched_dl_entity { - struct rb_node rb_node; - u64 dl_runtime; - u64 dl_deadline; - u64 dl_period; - u64 dl_bw; - u64 dl_density; - s64 runtime; - u64 deadline; - unsigned int flags; - unsigned int dl_throttled: 1; - unsigned int dl_boosted: 1; - unsigned int dl_yielded: 1; - unsigned int dl_non_contending: 1; - unsigned int dl_overrun: 1; - struct hrtimer dl_timer; - struct hrtimer inactive_timer; -}; - -struct sched_info { - long unsigned int pcount; - long long unsigned int run_delay; - long long unsigned int last_arrival; - long long unsigned int last_queued; -}; - -struct plist_node { - int prio; - struct list_head prio_list; - struct list_head node_list; -}; - -struct vm_area_struct; - -struct vmacache { - u64 seqnum; - struct vm_area_struct *vmas[4]; -}; - -struct task_rss_stat { - int events; - int count[4]; -}; - -struct prev_cputime { - u64 utime; - u64 stime; - raw_spinlock_t lock; -}; - -struct rb_root { - struct rb_node *rb_node; -}; - -struct rb_root_cached { - struct rb_root rb_root; - struct rb_node *rb_leftmost; -}; - -struct timerqueue_head { - struct rb_root_cached rb_root; -}; - -struct posix_cputimer_base { - u64 nextevt; - struct timerqueue_head tqhead; -}; - -struct posix_cputimers { - struct posix_cputimer_base bases[3]; - unsigned int timers_active; - unsigned int expiry_active; -}; - -struct sem_undo_list; - -struct sysv_sem { - struct sem_undo_list *undo_list; -}; - -struct sysv_shm { - struct list_head shm_clist; -}; - -typedef struct { - long unsigned int sig[1]; -} sigset_t; - -struct sigpending { - struct list_head list; - sigset_t signal; -}; - -typedef struct { - uid_t val; -} kuid_t; - -struct seccomp_filter; - -struct seccomp { - int mode; - struct seccomp_filter *filter; -}; - -struct wake_q_node { - struct wake_q_node *next; -}; - -struct task_io_accounting { - u64 rchar; - u64 wchar; - u64 syscr; - u64 syscw; - u64 read_bytes; - u64 write_bytes; - u64 cancelled_write_bytes; -}; - -struct seqcount { - unsigned int sequence; -}; - -typedef struct seqcount seqcount_t; - -struct arch_tlbflush_unmap_batch { - struct cpumask cpumask; -}; - -struct tlbflush_unmap_batch { - struct arch_tlbflush_unmap_batch arch; - bool flush_required; - bool writable; -}; - -struct page_frag { - struct page *page; - __u32 offset; - __u32 size; -}; - -struct sched_class; - -struct task_group; - -struct pid; - -struct completion; - -struct cred; - -struct key; - -struct nameidata; - -struct fs_struct; - -struct files_struct; - -struct nsproxy; - -struct signal_struct; - -struct sighand_struct; - -struct audit_context; - -struct rt_mutex_waiter; - -struct bio_list; - -struct blk_plug; - -struct reclaim_state; - -struct backing_dev_info; +struct backing_dev_info; struct io_context; @@ -1949,8 +869,6 @@ struct mempolicy; struct rseq; -struct pipe_inode_info; - struct task_delay_info; struct uprobe_task; @@ -2135,743 +1053,997 @@ struct task_struct { struct thread_struct thread; }; -struct vdso_image { - void *data; - long unsigned int size; - long unsigned int alt; - long unsigned int alt_len; - long int sym_vvar_start; - long int sym_vvar_page; - long int sym_pvclock_page; - long int sym_hvclock_page; - long int sym_VDSO32_NOTE_MASK; - long int sym___kernel_sigreturn; - long int sym___kernel_rt_sigreturn; - long int sym___kernel_vsyscall; - long int sym_int80_landing_pad; -}; - -struct ldt_struct; - -typedef struct { - u64 ctx_id; - atomic64_t tlb_gen; - struct rw_semaphore ldt_usr_sem; - struct ldt_struct *ldt; - short unsigned int ia32_compat; - struct mutex lock; - void *vdso; - const struct vdso_image *vdso_image; - atomic_t perf_rdpmc_allowed; - u16 pkey_allocation_map; - s16 execute_only_pkey; -} mm_context_t; +struct screen_info { + __u8 orig_x; + __u8 orig_y; + __u16 ext_mem_k; + __u16 orig_video_page; + __u8 orig_video_mode; + __u8 orig_video_cols; + __u8 flags; + __u8 unused2; + __u16 orig_video_ega_bx; + __u16 unused3; + __u8 orig_video_lines; + __u8 orig_video_isVGA; + __u16 orig_video_points; + __u16 lfb_width; + __u16 lfb_height; + __u16 lfb_depth; + __u32 lfb_base; + __u32 lfb_size; + __u16 cl_magic; + __u16 cl_offset; + __u16 lfb_linelength; + __u8 red_size; + __u8 red_pos; + __u8 green_size; + __u8 green_pos; + __u8 blue_size; + __u8 blue_pos; + __u8 rsvd_size; + __u8 rsvd_pos; + __u16 vesapm_seg; + __u16 vesapm_off; + __u16 pages; + __u16 vesa_attributes; + __u32 capabilities; + __u32 ext_lfb_base; + __u8 _reserved[2]; +} __attribute__((packed)); -struct vm_struct { - struct vm_struct *next; - void *addr; - long unsigned int size; - long unsigned int flags; - struct page **pages; - unsigned int nr_pages; - phys_addr_t phys_addr; - const void *caller; +struct apm_bios_info { + __u16 version; + __u16 cseg; + __u32 offset; + __u16 cseg_16; + __u16 dseg; + __u16 flags; + __u16 cseg_len; + __u16 cseg_16_len; + __u16 dseg_len; }; -struct real_mode_header { - u32 text_start; - u32 ro_end; - u32 trampoline_start; - u32 trampoline_header; - u32 trampoline_pgd; - u32 wakeup_start; - u32 wakeup_header; - u32 machine_real_restart_asm; - u32 machine_real_restart_seg; +struct apm_info { + struct apm_bios_info bios; + short unsigned int connection_version; + int get_power_status_broken; + int get_power_status_swabinminutes; + int allow_ints; + int forbid_idle; + int realmode_power_off; + int disabled; }; -enum fixed_addresses { - VSYSCALL_PAGE = 511, - FIX_DBGP_BASE = 512, - FIX_EARLYCON_MEM_BASE = 513, - FIX_OHCI1394_BASE = 514, - FIX_APIC_BASE = 515, - FIX_IO_APIC_BASE_0 = 516, - FIX_IO_APIC_BASE_END = 643, - __end_of_permanent_fixed_addresses = 644, - FIX_BTMAP_END = 1024, - FIX_BTMAP_BEGIN = 1535, - __end_of_fixed_addresses = 1536, -}; +struct edd_device_params { + __u16 length; + __u16 info_flags; + __u32 num_default_cylinders; + __u32 num_default_heads; + __u32 sectors_per_track; + __u64 number_of_sectors; + __u16 bytes_per_sector; + __u32 dpte_ptr; + __u16 key; + __u8 device_path_info_length; + __u8 reserved2; + __u16 reserved3; + __u8 host_bus_type[4]; + __u8 interface_type[8]; + union { + struct { + __u16 base_address; + __u16 reserved1; + __u32 reserved2; + } isa; + struct { + __u8 bus; + __u8 slot; + __u8 function; + __u8 channel; + __u32 reserved; + } pci; + struct { + __u64 reserved; + } ibnd; + struct { + __u64 reserved; + } xprs; + struct { + __u64 reserved; + } htpt; + struct { + __u64 reserved; + } unknown; + } interface_path; + union { + struct { + __u8 device; + __u8 reserved1; + __u16 reserved2; + __u32 reserved3; + __u64 reserved4; + } ata; + struct { + __u8 device; + __u8 lun; + __u8 reserved1; + __u8 reserved2; + __u32 reserved3; + __u64 reserved4; + } atapi; + struct { + __u16 id; + __u64 lun; + __u16 reserved1; + __u32 reserved2; + } __attribute__((packed)) scsi; + struct { + __u64 serial_number; + __u64 reserved; + } usb; + struct { + __u64 eui; + __u64 reserved; + } i1394; + struct { + __u64 wwid; + __u64 lun; + } fibre; + struct { + __u64 identity_tag; + __u64 reserved; + } i2o; + struct { + __u32 array_number; + __u32 reserved1; + __u64 reserved2; + } raid; + struct { + __u8 device; + __u8 reserved1; + __u16 reserved2; + __u32 reserved3; + __u64 reserved4; + } sata; + struct { + __u64 reserved1; + __u64 reserved2; + } unknown; + } device_path; + __u8 reserved4; + __u8 checksum; +} __attribute__((packed)); -struct vm_userfaultfd_ctx {}; +struct edd_info { + __u8 device; + __u8 version; + __u16 interface_support; + __u16 legacy_max_cylinder; + __u8 legacy_max_head; + __u8 legacy_sectors_per_track; + struct edd_device_params params; +} __attribute__((packed)); -struct anon_vma; +struct edd { + unsigned int mbr_signature[16]; + struct edd_info edd_info[6]; + unsigned char mbr_signature_nr; + unsigned char edd_info_nr; +}; -struct vm_operations_struct; +struct ist_info { + __u32 signature; + __u32 command; + __u32 event; + __u32 perf_level; +}; -struct file; +struct edid_info { + unsigned char dummy[128]; +}; -struct vm_area_struct { - long unsigned int vm_start; - long unsigned int vm_end; - struct vm_area_struct *vm_next; - struct vm_area_struct *vm_prev; - struct rb_node vm_rb; - long unsigned int rb_subtree_gap; - struct mm_struct *vm_mm; - pgprot_t vm_page_prot; - long unsigned int vm_flags; - struct { - struct rb_node rb; - long unsigned int rb_subtree_last; - } shared; - struct list_head anon_vma_chain; - struct anon_vma *anon_vma; - const struct vm_operations_struct *vm_ops; - long unsigned int vm_pgoff; - struct file *vm_file; - void *vm_private_data; - atomic_long_t swap_readahead_info; - struct mempolicy *vm_policy; - struct vm_userfaultfd_ctx vm_userfaultfd_ctx; +struct setup_header { + __u8 setup_sects; + __u16 root_flags; + __u32 syssize; + __u16 ram_size; + __u16 vid_mode; + __u16 root_dev; + __u16 boot_flag; + __u16 jump; + __u32 header; + __u16 version; + __u32 realmode_swtch; + __u16 start_sys_seg; + __u16 kernel_version; + __u8 type_of_loader; + __u8 loadflags; + __u16 setup_move_size; + __u32 code32_start; + __u32 ramdisk_image; + __u32 ramdisk_size; + __u32 bootsect_kludge; + __u16 heap_end_ptr; + __u8 ext_loader_ver; + __u8 ext_loader_type; + __u32 cmd_line_ptr; + __u32 initrd_addr_max; + __u32 kernel_alignment; + __u8 relocatable_kernel; + __u8 min_alignment; + __u16 xloadflags; + __u32 cmdline_size; + __u32 hardware_subarch; + __u64 hardware_subarch_data; + __u32 payload_offset; + __u32 payload_length; + __u64 setup_data; + __u64 pref_address; + __u32 init_size; + __u32 handover_offset; + __u32 kernel_info_offset; +} __attribute__((packed)); + +struct sys_desc_table { + __u16 length; + __u8 table[14]; }; -struct mm_rss_stat { - atomic_long_t count[4]; +struct olpc_ofw_header { + __u32 ofw_magic; + __u32 ofw_version; + __u32 cif_handler; + __u32 irq_desc_table; }; -struct wait_queue_head { - spinlock_t lock; - struct list_head head; +struct efi_info { + __u32 efi_loader_signature; + __u32 efi_systab; + __u32 efi_memdesc_size; + __u32 efi_memdesc_version; + __u32 efi_memmap; + __u32 efi_memmap_size; + __u32 efi_systab_hi; + __u32 efi_memmap_hi; }; -typedef struct wait_queue_head wait_queue_head_t; +struct boot_e820_entry { + __u64 addr; + __u64 size; + __u32 type; +} __attribute__((packed)); -struct completion { - unsigned int done; - wait_queue_head_t wait; +struct boot_params { + struct screen_info screen_info; + struct apm_bios_info apm_bios_info; + __u8 _pad2[4]; + __u64 tboot_addr; + struct ist_info ist_info; + __u64 acpi_rsdp_addr; + __u8 _pad3[8]; + __u8 hd0_info[16]; + __u8 hd1_info[16]; + struct sys_desc_table sys_desc_table; + struct olpc_ofw_header olpc_ofw_header; + __u32 ext_ramdisk_image; + __u32 ext_ramdisk_size; + __u32 ext_cmd_line_ptr; + __u8 _pad4[116]; + struct edid_info edid_info; + struct efi_info efi_info; + __u32 alt_mem_k; + __u32 scratch; + __u8 e820_entries; + __u8 eddbuf_entries; + __u8 edd_mbr_sig_buf_entries; + __u8 kbd_status; + __u8 secure_boot; + __u8 _pad5[2]; + __u8 sentinel; + __u8 _pad6[1]; + struct setup_header hdr; + __u8 _pad7[36]; + __u32 edd_mbr_sig_buffer[16]; + struct boot_e820_entry e820_table[128]; + __u8 _pad8[48]; + struct edd_info eddbuf[6]; + __u8 _pad9[276]; +} __attribute__((packed)); + +enum x86_hardware_subarch { + X86_SUBARCH_PC = 0, + X86_SUBARCH_LGUEST = 1, + X86_SUBARCH_XEN = 2, + X86_SUBARCH_INTEL_MID = 3, + X86_SUBARCH_CE4100 = 4, + X86_NR_SUBARCHS = 5, }; -struct xol_area; +struct range { + u64 start; + u64 end; +}; -struct uprobes_state { - struct xol_area *xol_area; +struct pt_regs { + long unsigned int r15; + long unsigned int r14; + long unsigned int r13; + long unsigned int r12; + long unsigned int bp; + long unsigned int bx; + long unsigned int r11; + long unsigned int r10; + long unsigned int r9; + long unsigned int r8; + long unsigned int ax; + long unsigned int cx; + long unsigned int dx; + long unsigned int si; + long unsigned int di; + long unsigned int orig_ax; + long unsigned int ip; + long unsigned int cs; + long unsigned int flags; + long unsigned int sp; + long unsigned int ss; }; -struct work_struct; +struct math_emu_info { + long int ___orig_eip; + struct pt_regs *regs; +}; -typedef void (*work_func_t)(struct work_struct *); +typedef long unsigned int pteval_t; -struct work_struct { - atomic_long_t data; - struct list_head entry; - work_func_t func; -}; +typedef long unsigned int pmdval_t; -struct linux_binfmt; +typedef long unsigned int pudval_t; -struct core_state; +typedef long unsigned int p4dval_t; -struct kioctx_table; +typedef long unsigned int pgdval_t; -struct user_namespace; +typedef long unsigned int pgprotval_t; -struct mmu_notifier_mm; +typedef struct { + pteval_t pte; +} pte_t; -struct mm_struct { - struct { - struct vm_area_struct *mmap; - struct rb_root mm_rb; - u64 vmacache_seqnum; - long unsigned int (*get_unmapped_area)(struct file *, long unsigned int, long unsigned int, long unsigned int, long unsigned int); - long unsigned int mmap_base; - long unsigned int mmap_legacy_base; - long unsigned int mmap_compat_base; - long unsigned int mmap_compat_legacy_base; - long unsigned int task_size; - long unsigned int highest_vm_end; - pgd_t *pgd; - atomic_t membarrier_state; - atomic_t mm_users; - atomic_t mm_count; - atomic_long_t pgtables_bytes; - int map_count; - spinlock_t page_table_lock; - struct rw_semaphore mmap_sem; - struct list_head mmlist; - long unsigned int hiwater_rss; - long unsigned int hiwater_vm; - long unsigned int total_vm; - long unsigned int locked_vm; - atomic64_t pinned_vm; - long unsigned int data_vm; - long unsigned int exec_vm; - long unsigned int stack_vm; - long unsigned int def_flags; - spinlock_t arg_lock; - long unsigned int start_code; - long unsigned int end_code; - long unsigned int start_data; - long unsigned int end_data; - long unsigned int start_brk; - long unsigned int brk; - long unsigned int start_stack; - long unsigned int arg_start; - long unsigned int arg_end; - long unsigned int env_start; - long unsigned int env_end; - long unsigned int saved_auxv[46]; - struct mm_rss_stat rss_stat; - struct linux_binfmt *binfmt; - mm_context_t context; - long unsigned int flags; - struct core_state *core_state; - spinlock_t ioctx_lock; - struct kioctx_table *ioctx_table; - struct user_namespace *user_ns; - struct file *exe_file; - struct mmu_notifier_mm *mmu_notifier_mm; - atomic_t tlb_flush_pending; - bool tlb_flush_batched; - struct uprobes_state uprobes_state; - atomic_long_t hugetlb_usage; - struct work_struct async_put_work; - }; - long unsigned int cpu_bitmap[0]; +struct pgprot { + pgprotval_t pgprot; }; -struct arch_uprobe_task { - long unsigned int saved_scratch_register; - unsigned int saved_trap_nr; - unsigned int saved_tf; -}; +typedef struct pgprot pgprot_t; -enum uprobe_task_state { - UTASK_RUNNING = 0, - UTASK_SSTEP = 1, - UTASK_SSTEP_ACK = 2, - UTASK_SSTEP_TRAPPED = 3, -}; +typedef struct { + pgdval_t pgd; +} pgd_t; -struct uprobe; +typedef struct { + p4dval_t p4d; +} p4d_t; -struct return_instance; +typedef struct { + pudval_t pud; +} pud_t; -struct uprobe_task { - enum uprobe_task_state state; +typedef struct { + pmdval_t pmd; +} pmd_t; + +typedef struct page *pgtable_t; + +struct address_space; + +struct kmem_cache; + +struct dev_pagemap; + +struct page { + long unsigned int flags; union { struct { - struct arch_uprobe_task autask; - long unsigned int vaddr; + struct list_head lru; + struct address_space *mapping; + long unsigned int index; + long unsigned int private; }; struct { - struct callback_head dup_xol_work; - long unsigned int dup_xol_addr; + dma_addr_t dma_addr; + }; + struct { + union { + struct list_head slab_list; + struct { + struct page *next; + int pages; + int pobjects; + }; + }; + struct kmem_cache *slab_cache; + void *freelist; + union { + void *s_mem; + long unsigned int counters; + struct { + unsigned int inuse: 16; + unsigned int objects: 15; + unsigned int frozen: 1; + }; + }; + }; + struct { + long unsigned int compound_head; + unsigned char compound_dtor; + unsigned char compound_order; + atomic_t compound_mapcount; + }; + struct { + long unsigned int _compound_pad_1; + long unsigned int _compound_pad_2; + struct list_head deferred_list; + }; + struct { + long unsigned int _pt_pad_1; + pgtable_t pmd_huge_pte; + long unsigned int _pt_pad_2; + union { + struct mm_struct *pt_mm; + atomic_t pt_frag_refcount; + }; + spinlock_t ptl; + }; + struct { + struct dev_pagemap *pgmap; + void *zone_device_data; }; + struct callback_head callback_head; }; - struct uprobe *active_uprobe; - long unsigned int xol_vaddr; - struct return_instance *return_instances; - unsigned int depth; + union { + atomic_t _mapcount; + unsigned int page_type; + unsigned int active; + int units; + }; + atomic_t _refcount; + long: 64; }; -struct return_instance { - struct uprobe *uprobe; - long unsigned int func; - long unsigned int stack; - long unsigned int orig_ret_vaddr; - bool chained; - struct return_instance *next; +typedef struct cpumask cpumask_var_t[1]; + +struct tracepoint_func { + void *func; + void *data; + int prio; }; -struct xarray { - spinlock_t xa_lock; - gfp_t xa_flags; - void *xa_head; -}; - -typedef u32 errseq_t; - -struct inode; - -struct address_space_operations; - -struct address_space { - struct inode *host; - struct xarray i_pages; - gfp_t gfp_mask; - atomic_t i_mmap_writable; - struct rb_root_cached i_mmap; - struct rw_semaphore i_mmap_rwsem; - long unsigned int nrpages; - long unsigned int nrexceptional; - long unsigned int writeback_index; - const struct address_space_operations *a_ops; - long unsigned int flags; - errseq_t wb_err; - spinlock_t private_lock; - struct list_head private_list; - void *private_data; -}; - -struct vmem_altmap { - const long unsigned int base_pfn; - const long unsigned int end_pfn; - const long unsigned int reserve; - long unsigned int free; - long unsigned int align; - long unsigned int alloc; -}; - -struct resource { - resource_size_t start; - resource_size_t end; +struct tracepoint { const char *name; - long unsigned int flags; - long unsigned int desc; - struct resource *parent; - struct resource *sibling; - struct resource *child; -}; - -struct percpu_ref; - -typedef void percpu_ref_func_t(struct percpu_ref *); - -struct percpu_ref { - atomic_long_t count; - long unsigned int percpu_count_ptr; - percpu_ref_func_t *release; - percpu_ref_func_t *confirm_switch; - bool force_atomic: 1; - bool allow_reinit: 1; - struct callback_head rcu; -}; - -enum memory_type { - MEMORY_DEVICE_PRIVATE = 1, - MEMORY_DEVICE_FS_DAX = 2, - MEMORY_DEVICE_DEVDAX = 3, - MEMORY_DEVICE_PCI_P2PDMA = 4, -}; - -struct dev_pagemap_ops; - -struct dev_pagemap { - struct vmem_altmap altmap; - struct resource res; - struct percpu_ref *ref; - struct percpu_ref internal_ref; - struct completion done; - enum memory_type type; - unsigned int flags; - const struct dev_pagemap_ops *ops; -}; - -struct vfsmount; - -struct dentry; - -struct path { - struct vfsmount *mnt; - struct dentry *dentry; -}; - -enum rw_hint { - WRITE_LIFE_NOT_SET = 0, - WRITE_LIFE_NONE = 1, - WRITE_LIFE_SHORT = 2, - WRITE_LIFE_MEDIUM = 3, - WRITE_LIFE_LONG = 4, - WRITE_LIFE_EXTREME = 5, -}; - -enum pid_type { - PIDTYPE_PID = 0, - PIDTYPE_TGID = 1, - PIDTYPE_PGID = 2, - PIDTYPE_SID = 3, - PIDTYPE_MAX = 4, -}; - -struct fown_struct { - rwlock_t lock; - struct pid *pid; - enum pid_type pid_type; - kuid_t uid; - kuid_t euid; - int signum; -}; - -struct file_ra_state { - long unsigned int start; - unsigned int size; - unsigned int async_size; - unsigned int ra_pages; - unsigned int mmap_miss; - loff_t prev_pos; -}; - -struct file_operations; - -struct file { - union { - struct llist_node fu_llist; - struct callback_head fu_rcuhead; - } f_u; - struct path f_path; - struct inode *f_inode; - const struct file_operations *f_op; - spinlock_t f_lock; - enum rw_hint f_write_hint; - atomic_long_t f_count; - unsigned int f_flags; - fmode_t f_mode; - struct mutex f_pos_lock; - loff_t f_pos; - struct fown_struct f_owner; - const struct cred *f_cred; - struct file_ra_state f_ra; - u64 f_version; - void *f_security; - void *private_data; - struct list_head f_ep_links; - struct list_head f_tfile_llink; - struct address_space *f_mapping; - errseq_t f_wb_err; -}; - -typedef unsigned int vm_fault_t; - -enum page_entry_size { - PE_SIZE_PTE = 0, - PE_SIZE_PMD = 1, - PE_SIZE_PUD = 2, -}; - -struct vm_fault; - -struct vm_operations_struct { - void (*open)(struct vm_area_struct *); - void (*close)(struct vm_area_struct *); - int (*split)(struct vm_area_struct *, long unsigned int); - int (*mremap)(struct vm_area_struct *); - vm_fault_t (*fault)(struct vm_fault *); - vm_fault_t (*huge_fault)(struct vm_fault *, enum page_entry_size); - void (*map_pages)(struct vm_fault *, long unsigned int, long unsigned int); - long unsigned int (*pagesize)(struct vm_area_struct *); - vm_fault_t (*page_mkwrite)(struct vm_fault *); - vm_fault_t (*pfn_mkwrite)(struct vm_fault *); - int (*access)(struct vm_area_struct *, long unsigned int, void *, int, int); - const char * (*name)(struct vm_area_struct *); - int (*set_policy)(struct vm_area_struct *, struct mempolicy *); - struct mempolicy * (*get_policy)(struct vm_area_struct *, long unsigned int); - struct page * (*find_special_page)(struct vm_area_struct *, long unsigned int); + struct static_key key; + int (*regfunc)(); + void (*unregfunc)(); + struct tracepoint_func *funcs; }; -struct core_thread { - struct task_struct *task; - struct core_thread *next; +struct idt_bits { + u16 ist: 3; + u16 zero: 5; + u16 type: 5; + u16 dpl: 2; + u16 p: 1; }; -struct core_state { - atomic_t nr_threads; - struct core_thread dumper; - struct completion startup; +struct gate_struct { + u16 offset_low; + u16 segment; + struct idt_bits bits; + u16 offset_middle; + u32 offset_high; + u32 reserved; }; -struct mem_cgroup; +typedef struct gate_struct gate_desc; -struct vm_fault { - struct vm_area_struct *vma; - unsigned int flags; - gfp_t gfp_mask; - long unsigned int pgoff; +struct desc_ptr { + short unsigned int size; long unsigned int address; - pmd_t *pmd; - pud_t *pud; - pte_t orig_pte; - struct page *cow_page; - struct mem_cgroup *memcg; - struct page *page; - pte_t *pte; - spinlock_t *ptl; - pgtable_t prealloc_pte; -}; - -struct apic { - void (*eoi_write)(u32, u32); - void (*native_eoi_write)(u32, u32); - void (*write)(u32, u32); - u32 (*read)(u32); - void (*wait_icr_idle)(); - u32 (*safe_wait_icr_idle)(); - void (*send_IPI)(int, int); - void (*send_IPI_mask)(const struct cpumask *, int); - void (*send_IPI_mask_allbutself)(const struct cpumask *, int); - void (*send_IPI_allbutself)(int); - void (*send_IPI_all)(int); - void (*send_IPI_self)(int); - u32 dest_logical; - u32 disable_esr; - u32 irq_delivery_mode; - u32 irq_dest_mode; - u32 (*calc_dest_apicid)(unsigned int); - u64 (*icr_read)(); - void (*icr_write)(u32, u32); - int (*probe)(); - int (*acpi_madt_oem_check)(char *, char *); - int (*apic_id_valid)(u32); - int (*apic_id_registered)(); - bool (*check_apicid_used)(physid_mask_t *, int); - void (*init_apic_ldr)(); - void (*ioapic_phys_id_map)(physid_mask_t *, physid_mask_t *); - void (*setup_apic_routing)(); - int (*cpu_present_to_apicid)(int); - void (*apicid_to_cpu_present)(int, physid_mask_t *); - int (*check_phys_apicid_present)(int); - int (*phys_pkg_id)(int, int); - u32 (*get_apic_id)(long unsigned int); - u32 (*set_apic_id)(unsigned int); - int (*wakeup_secondary_cpu)(int, long unsigned int); - void (*inquire_remote_apic)(int); - char *name; -}; - -struct smp_ops { - void (*smp_prepare_boot_cpu)(); - void (*smp_prepare_cpus)(unsigned int); - void (*smp_cpus_done)(unsigned int); - void (*stop_other_cpus)(int); - void (*crash_stop_other_cpus)(); - void (*smp_send_reschedule)(int); - int (*cpu_up)(unsigned int, struct task_struct *); - int (*cpu_disable)(); - void (*cpu_die)(unsigned int); - void (*play_dead)(); - void (*send_call_func_ipi)(const struct cpumask *); - void (*send_call_func_single_ipi)(int); -}; - -struct free_area { - struct list_head free_list[4]; - long unsigned int nr_free; -}; - -struct zone_padding { - char x[0]; -}; - -enum numa_stat_item { - NUMA_HIT = 0, - NUMA_MISS = 1, - NUMA_FOREIGN = 2, - NUMA_INTERLEAVE_HIT = 3, - NUMA_LOCAL = 4, - NUMA_OTHER = 5, - NR_VM_NUMA_STAT_ITEMS = 6, -}; - -enum zone_stat_item { - NR_FREE_PAGES = 0, - NR_ZONE_LRU_BASE = 1, - NR_ZONE_INACTIVE_ANON = 1, - NR_ZONE_ACTIVE_ANON = 2, - NR_ZONE_INACTIVE_FILE = 3, - NR_ZONE_ACTIVE_FILE = 4, - NR_ZONE_UNEVICTABLE = 5, - NR_ZONE_WRITE_PENDING = 6, - NR_MLOCK = 7, - NR_PAGETABLE = 8, - NR_KERNEL_STACK_KB = 9, - NR_BOUNCE = 10, - NR_FREE_CMA_PAGES = 11, - NR_VM_ZONE_STAT_ITEMS = 12, -}; - -enum node_stat_item { - NR_LRU_BASE = 0, - NR_INACTIVE_ANON = 0, - NR_ACTIVE_ANON = 1, - NR_INACTIVE_FILE = 2, - NR_ACTIVE_FILE = 3, - NR_UNEVICTABLE = 4, - NR_SLAB_RECLAIMABLE = 5, - NR_SLAB_UNRECLAIMABLE = 6, - NR_ISOLATED_ANON = 7, - NR_ISOLATED_FILE = 8, - WORKINGSET_NODES = 9, - WORKINGSET_REFAULT = 10, - WORKINGSET_ACTIVATE = 11, - WORKINGSET_RESTORE = 12, - WORKINGSET_NODERECLAIM = 13, - NR_ANON_MAPPED = 14, - NR_FILE_MAPPED = 15, - NR_FILE_PAGES = 16, - NR_FILE_DIRTY = 17, - NR_WRITEBACK = 18, - NR_WRITEBACK_TEMP = 19, - NR_SHMEM = 20, - NR_SHMEM_THPS = 21, - NR_SHMEM_PMDMAPPED = 22, - NR_FILE_THPS = 23, - NR_FILE_PMDMAPPED = 24, - NR_ANON_THPS = 25, - NR_UNSTABLE_NFS = 26, - NR_VMSCAN_WRITE = 27, - NR_VMSCAN_IMMEDIATE = 28, - NR_DIRTIED = 29, - NR_WRITTEN = 30, - NR_KERNEL_MISC_RECLAIMABLE = 31, - NR_VM_NODE_STAT_ITEMS = 32, -}; - -struct zone_reclaim_stat { - long unsigned int recent_rotated[2]; - long unsigned int recent_scanned[2]; -}; +} __attribute__((packed)); -struct lruvec { - struct list_head lists[5]; - struct zone_reclaim_stat reclaim_stat; - atomic_long_t inactive_age; - long unsigned int refaults; - long unsigned int flags; +struct cpuinfo_x86 { + __u8 x86; + __u8 x86_vendor; + __u8 x86_model; + __u8 x86_stepping; + int x86_tlbsize; + __u8 x86_virt_bits; + __u8 x86_phys_bits; + __u8 x86_coreid_bits; + __u8 cu_id; + __u32 extended_cpuid_level; + int cpuid_level; + union { + __u32 x86_capability[20]; + long unsigned int x86_capability_alignment; + }; + char x86_vendor_id[16]; + char x86_model_id[64]; + unsigned int x86_cache_size; + int x86_cache_alignment; + int x86_cache_max_rmid; + int x86_cache_occ_scale; + int x86_power; + long unsigned int loops_per_jiffy; + u16 x86_max_cores; + u16 apicid; + u16 initial_apicid; + u16 x86_clflush_size; + u16 booted_cores; + u16 phys_proc_id; + u16 logical_proc_id; + u16 cpu_core_id; + u16 cpu_die_id; + u16 logical_die_id; + u16 cpu_index; + u32 microcode; + u8 x86_cache_bits; + unsigned int initialized: 1; }; -typedef unsigned int isolate_mode_t; - -struct per_cpu_pages { - int count; - int high; - int batch; - struct list_head lists[3]; -}; +struct seq_file___2; -struct per_cpu_pageset { - struct per_cpu_pages pcp; - s8 expire; - u16 vm_numa_stat_diff[6]; - s8 stat_threshold; - s8 vm_stat_diff[12]; +struct seq_operations { + void * (*start)(struct seq_file___2 *, loff_t *); + void (*stop)(struct seq_file___2 *, void *); + void * (*next)(struct seq_file___2 *, void *, loff_t *); + int (*show)(struct seq_file___2 *, void *); }; -struct per_cpu_nodestat { - s8 stat_threshold; - s8 vm_node_stat_diff[32]; -}; +struct x86_hw_tss { + u32 reserved1; + u64 sp0; + u64 sp1; + u64 sp2; + u64 reserved2; + u64 ist[7]; + u32 reserved3; + u32 reserved4; + u16 reserved5; + u16 io_bitmap_base; +} __attribute__((packed)); -enum zone_type { - ZONE_DMA = 0, - ZONE_DMA32 = 1, - ZONE_NORMAL = 2, - ZONE_MOVABLE = 3, - __MAX_NR_ZONES = 4, +struct entry_stack { + long unsigned int words[64]; }; -struct pglist_data; - -struct zone { - long unsigned int _watermark[3]; - long unsigned int watermark_boost; - long unsigned int nr_reserved_highatomic; - long int lowmem_reserve[4]; - int node; - struct pglist_data *zone_pgdat; - struct per_cpu_pageset *pageset; - long unsigned int zone_start_pfn; - atomic_long_t managed_pages; - long unsigned int spanned_pages; - long unsigned int present_pages; - const char *name; - int initialized; - long: 32; +struct entry_stack_page { + struct entry_stack stack; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; long: 64; long: 64; long: 64; long: 64; long: 64; long: 64; - struct zone_padding _pad1_; - struct free_area free_area[11]; - long unsigned int flags; - spinlock_t lock; - long: 32; long: 64; long: 64; long: 64; - struct zone_padding _pad2_; - long unsigned int percpu_drift_mark; - long unsigned int compact_cached_free_pfn; - long unsigned int compact_cached_migrate_pfn[2]; - long unsigned int compact_init_migrate_pfn; - long unsigned int compact_init_free_pfn; - unsigned int compact_considered; - unsigned int compact_defer_shift; - int compact_order_failed; - bool compact_blockskip_flush; - bool contiguous; - short: 16; - struct zone_padding _pad3_; - atomic_long_t vm_stat[12]; - atomic_long_t vm_numa_stat[6]; long: 64; long: 64; long: 64; long: 64; long: 64; long: 64; -}; - -struct zoneref { - struct zone *zone; - int zone_idx; -}; - -struct zonelist { - struct zoneref _zonerefs[257]; -}; - -struct pglist_data { - struct zone node_zones[4]; - struct zonelist node_zonelists[2]; - int nr_zones; - long unsigned int node_start_pfn; - long unsigned int node_present_pages; - long unsigned int node_spanned_pages; - int node_id; - wait_queue_head_t kswapd_wait; - wait_queue_head_t pfmemalloc_wait; - struct task_struct *kswapd; - int kswapd_order; - enum zone_type kswapd_classzone_idx; - int kswapd_failures; - int kcompactd_max_order; - enum zone_type kcompactd_classzone_idx; - wait_queue_head_t kcompactd_wait; - struct task_struct *kcompactd; - long unsigned int totalreserve_pages; - long unsigned int min_unmapped_pages; - long unsigned int min_slab_pages; long: 64; long: 64; long: 64; long: 64; long: 64; long: 64; - struct zone_padding _pad1_; - spinlock_t lru_lock; - struct lruvec __lruvec; - long unsigned int flags; long: 64; long: 64; long: 64; long: 64; long: 64; - struct zone_padding _pad2_; - struct per_cpu_nodestat *per_cpu_nodestats; - atomic_long_t vm_stat[32]; long: 64; long: 64; long: 64; @@ -2879,1249 +2051,33 @@ struct pglist_data { long: 64; long: 64; long: 64; -}; - -struct mem_section_usage { - long unsigned int subsection_map[1]; - long unsigned int pageblock_flags[0]; -}; - -struct mem_section { - long unsigned int section_mem_map; - struct mem_section_usage *usage; -}; - -struct shrink_control { - gfp_t gfp_mask; - int nid; - long unsigned int nr_to_scan; - long unsigned int nr_scanned; - struct mem_cgroup *memcg; -}; - -struct shrinker { - long unsigned int (*count_objects)(struct shrinker *, struct shrink_control *); - long unsigned int (*scan_objects)(struct shrinker *, struct shrink_control *); - long int batch; - int seeks; - unsigned int flags; - struct list_head list; - atomic_long_t *nr_deferred; -}; - -struct dev_pagemap_ops { - void (*page_free)(struct page *); - void (*kill)(struct dev_pagemap *); - void (*cleanup)(struct dev_pagemap *); - vm_fault_t (*migrate_to_ram)(struct vm_fault *); -}; - -struct pid_namespace; - -struct upid { - int nr; - struct pid_namespace *ns; -}; - -struct pid { - refcount_t count; - unsigned int level; - struct hlist_head tasks[4]; - wait_queue_head_t wait_pidfd; - struct callback_head rcu; - struct upid numbers[1]; -}; - -typedef struct { - gid_t val; -} kgid_t; - -struct hrtimer_cpu_base; - -struct hrtimer_clock_base { - struct hrtimer_cpu_base *cpu_base; - unsigned int index; - clockid_t clockid; - seqcount_t seq; - struct hrtimer *running; - struct timerqueue_head active; - ktime_t (*get_time)(); - ktime_t offset; -}; - -struct hrtimer_cpu_base { - raw_spinlock_t lock; - unsigned int cpu; - unsigned int active_bases; - unsigned int clock_was_set_seq; - unsigned int hres_active: 1; - unsigned int in_hrtirq: 1; - unsigned int hang_detected: 1; - unsigned int softirq_activated: 1; - unsigned int nr_events; - short unsigned int nr_retries; - short unsigned int nr_hangs; - unsigned int max_hang_time; - ktime_t expires_next; - struct hrtimer *next_timer; - ktime_t softirq_expires_next; - struct hrtimer *softirq_next_timer; - struct hrtimer_clock_base clock_base[8]; -}; - -union sigval { - int sival_int; - void *sival_ptr; -}; - -typedef union sigval sigval_t; - -union __sifields { - struct { - __kernel_pid_t _pid; - __kernel_uid32_t _uid; - } _kill; - struct { - __kernel_timer_t _tid; - int _overrun; - sigval_t _sigval; - int _sys_private; - } _timer; - struct { - __kernel_pid_t _pid; - __kernel_uid32_t _uid; - sigval_t _sigval; - } _rt; - struct { - __kernel_pid_t _pid; - __kernel_uid32_t _uid; - int _status; - __kernel_clock_t _utime; - __kernel_clock_t _stime; - } _sigchld; - struct { - void *_addr; - union { - short int _addr_lsb; - struct { - char _dummy_bnd[8]; - void *_lower; - void *_upper; - } _addr_bnd; - struct { - char _dummy_pkey[8]; - __u32 _pkey; - } _addr_pkey; - }; - } _sigfault; - struct { - long int _band; - int _fd; - } _sigpoll; - struct { - void *_call_addr; - int _syscall; - unsigned int _arch; - } _sigsys; -}; - -struct kernel_siginfo { - struct { - int si_signo; - int si_errno; - int si_code; - union __sifields _sifields; - }; -}; - -struct rseq { - __u32 cpu_id_start; - __u32 cpu_id; - union { - __u64 ptr64; - __u64 ptr; - } rseq_cs; - __u32 flags; - long: 32; long: 64; -}; - -struct rq; - -struct rq_flags; - -struct sched_class { - const struct sched_class *next; - void (*enqueue_task)(struct rq *, struct task_struct *, int); - void (*dequeue_task)(struct rq *, struct task_struct *, int); - void (*yield_task)(struct rq *); - bool (*yield_to_task)(struct rq *, struct task_struct *, bool); - void (*check_preempt_curr)(struct rq *, struct task_struct *, int); - struct task_struct * (*pick_next_task)(struct rq *); - void (*put_prev_task)(struct rq *, struct task_struct *); - void (*set_next_task)(struct rq *, struct task_struct *, bool); - int (*balance)(struct rq *, struct task_struct *, struct rq_flags *); - int (*select_task_rq)(struct task_struct *, int, int, int); - void (*migrate_task_rq)(struct task_struct *, int); - void (*task_woken)(struct rq *, struct task_struct *); - void (*set_cpus_allowed)(struct task_struct *, const struct cpumask *); - void (*rq_online)(struct rq *); - void (*rq_offline)(struct rq *); - void (*task_tick)(struct rq *, struct task_struct *, int); - void (*task_fork)(struct task_struct *); - void (*task_dead)(struct task_struct *); - void (*switched_from)(struct rq *, struct task_struct *); - void (*switched_to)(struct rq *, struct task_struct *); - void (*prio_changed)(struct rq *, struct task_struct *, int); - unsigned int (*get_rr_interval)(struct rq *, struct task_struct *); - void (*update_curr)(struct rq *); - void (*task_change_group)(struct task_struct *, int); -}; - -struct kernel_cap_struct { - __u32 cap[2]; -}; - -typedef struct kernel_cap_struct kernel_cap_t; - -struct user_struct; - -struct group_info; - -struct cred { - atomic_t usage; - kuid_t uid; - kgid_t gid; - kuid_t suid; - kgid_t sgid; - kuid_t euid; - kgid_t egid; - kuid_t fsuid; - kgid_t fsgid; - unsigned int securebits; - kernel_cap_t cap_inheritable; - kernel_cap_t cap_permitted; - kernel_cap_t cap_effective; - kernel_cap_t cap_bset; - kernel_cap_t cap_ambient; - unsigned char jit_keyring; - struct key *session_keyring; - struct key *process_keyring; - struct key *thread_keyring; - struct key *request_key_auth; - void *security; - struct user_struct *user; - struct user_namespace *user_ns; - struct group_info *group_info; - union { - int non_rcu; - struct callback_head rcu; - }; -}; - -struct io_cq; - -struct io_context { - atomic_long_t refcount; - atomic_t active_ref; - atomic_t nr_tasks; - spinlock_t lock; - short unsigned int ioprio; - int nr_batch_requests; - long unsigned int last_waited; - struct xarray icq_tree; - struct io_cq *icq_hint; - struct hlist_head icq_list; - struct work_struct release_work; -}; - -struct hlist_bl_node; - -struct hlist_bl_head { - struct hlist_bl_node *first; -}; - -struct hlist_bl_node { - struct hlist_bl_node *next; - struct hlist_bl_node **pprev; -}; - -struct lockref { - union { - __u64 lock_count; - struct { - spinlock_t lock; - int count; - }; - }; -}; - -struct qstr { - union { - struct { - u32 hash; - u32 len; - }; - u64 hash_len; - }; - const unsigned char *name; -}; - -struct dentry_operations; - -struct super_block; - -struct dentry { - unsigned int d_flags; - seqcount_t d_seq; - struct hlist_bl_node d_hash; - struct dentry *d_parent; - struct qstr d_name; - struct inode *d_inode; - unsigned char d_iname[32]; - struct lockref d_lockref; - const struct dentry_operations *d_op; - struct super_block *d_sb; - long unsigned int d_time; - void *d_fsdata; - union { - struct list_head d_lru; - wait_queue_head_t *d_wait; - }; - struct list_head d_child; - struct list_head d_subdirs; - union { - struct hlist_node d_alias; - struct hlist_bl_node d_in_lookup_hash; - struct callback_head d_rcu; - } d_u; -}; - -struct posix_acl; - -struct inode_operations; - -struct file_lock_context; - -struct block_device; - -struct cdev; - -struct fsnotify_mark_connector; - -struct inode { - umode_t i_mode; - short unsigned int i_opflags; - kuid_t i_uid; - kgid_t i_gid; - unsigned int i_flags; - struct posix_acl *i_acl; - struct posix_acl *i_default_acl; - const struct inode_operations *i_op; - struct super_block *i_sb; - struct address_space *i_mapping; - void *i_security; - long unsigned int i_ino; - union { - const unsigned int i_nlink; - unsigned int __i_nlink; - }; - dev_t i_rdev; - loff_t i_size; - struct timespec64 i_atime; - struct timespec64 i_mtime; - struct timespec64 i_ctime; - spinlock_t i_lock; - short unsigned int i_bytes; - u8 i_blkbits; - u8 i_write_hint; - blkcnt_t i_blocks; - long unsigned int i_state; - struct rw_semaphore i_rwsem; - long unsigned int dirtied_when; - long unsigned int dirtied_time_when; - struct hlist_node i_hash; - struct list_head i_io_list; - struct list_head i_lru; - struct list_head i_sb_list; - struct list_head i_wb_list; - union { - struct hlist_head i_dentry; - struct callback_head i_rcu; - }; - atomic64_t i_version; - atomic_t i_count; - atomic_t i_dio_count; - atomic_t i_writecount; - atomic_t i_readcount; - union { - const struct file_operations *i_fop; - void (*free_inode)(struct inode *); - }; - struct file_lock_context *i_flctx; - struct address_space i_data; - struct list_head i_devices; - union { - struct pipe_inode_info *i_pipe; - struct block_device *i_bdev; - struct cdev *i_cdev; - char *i_link; - unsigned int i_dir_seq; - }; - __u32 i_generation; - __u32 i_fsnotify_mask; - struct fsnotify_mark_connector *i_fsnotify_marks; - void *i_private; -}; - -struct dentry_operations { - int (*d_revalidate)(struct dentry *, unsigned int); - int (*d_weak_revalidate)(struct dentry *, unsigned int); - int (*d_hash)(const struct dentry *, struct qstr *); - int (*d_compare)(const struct dentry *, unsigned int, const char *, const struct qstr *); - int (*d_delete)(const struct dentry *); - int (*d_init)(struct dentry *); - void (*d_release)(struct dentry *); - void (*d_prune)(struct dentry *); - void (*d_iput)(struct dentry *, struct inode *); - char * (*d_dname)(struct dentry *, char *, int); - struct vfsmount * (*d_automount)(struct path *); - int (*d_manage)(const struct path *, bool); - struct dentry * (*d_real)(struct dentry *, const struct inode *); long: 64; long: 64; long: 64; -}; - -struct mtd_info; - -typedef long long int qsize_t; - -struct quota_format_type; - -struct mem_dqinfo { - struct quota_format_type *dqi_format; - int dqi_fmt_id; - struct list_head dqi_dirty_list; - long unsigned int dqi_flags; - unsigned int dqi_bgrace; - unsigned int dqi_igrace; - qsize_t dqi_max_spc_limit; - qsize_t dqi_max_ino_limit; - void *dqi_priv; -}; - -struct quota_format_ops; - -struct quota_info { - unsigned int flags; - struct rw_semaphore dqio_sem; - struct inode *files[3]; - struct mem_dqinfo info[3]; - const struct quota_format_ops *ops[3]; -}; - -struct rcu_sync { - int gp_state; - int gp_count; - wait_queue_head_t gp_wait; - struct callback_head cb_head; -}; - -struct rcuwait { - struct task_struct *task; -}; - -struct percpu_rw_semaphore { - struct rcu_sync rss; - unsigned int *read_count; - struct rw_semaphore rw_sem; - struct rcuwait writer; - int readers_block; -}; - -struct sb_writers { - int frozen; - wait_queue_head_t wait_unfrozen; - struct percpu_rw_semaphore rw_sem[3]; -}; - -typedef struct { - __u8 b[16]; -} uuid_t; - -struct list_lru_node; - -struct list_lru { - struct list_lru_node *node; -}; - -struct file_system_type; - -struct super_operations; - -struct dquot_operations; - -struct quotactl_ops; - -struct export_operations; - -struct xattr_handler; - -struct workqueue_struct; - -struct super_block { - struct list_head s_list; - dev_t s_dev; - unsigned char s_blocksize_bits; - long unsigned int s_blocksize; - loff_t s_maxbytes; - struct file_system_type *s_type; - const struct super_operations *s_op; - const struct dquot_operations *dq_op; - const struct quotactl_ops *s_qcop; - const struct export_operations *s_export_op; - long unsigned int s_flags; - long unsigned int s_iflags; - long unsigned int s_magic; - struct dentry *s_root; - struct rw_semaphore s_umount; - int s_count; - atomic_t s_active; - void *s_security; - const struct xattr_handler **s_xattr; - struct hlist_bl_head s_roots; - struct list_head s_mounts; - struct block_device *s_bdev; - struct backing_dev_info *s_bdi; - struct mtd_info *s_mtd; - struct hlist_node s_instances; - unsigned int s_quota_types; - struct quota_info s_dquot; - struct sb_writers s_writers; - void *s_fs_info; - u32 s_time_gran; - time64_t s_time_min; - time64_t s_time_max; - __u32 s_fsnotify_mask; - struct fsnotify_mark_connector *s_fsnotify_marks; - char s_id[32]; - uuid_t s_uuid; - unsigned int s_max_links; - fmode_t s_mode; - struct mutex s_vfs_rename_mutex; - const char *s_subtype; - const struct dentry_operations *s_d_op; - int cleancache_poolid; - struct shrinker s_shrink; - atomic_long_t s_remove_count; - atomic_long_t s_fsnotify_inode_refs; - int s_readonly_remount; - struct workqueue_struct *s_dio_done_wq; - struct hlist_head s_pins; - struct user_namespace *s_user_ns; - struct list_lru s_dentry_lru; - struct list_lru s_inode_lru; - struct callback_head rcu; - struct work_struct destroy_work; - struct mutex s_sync_lock; - int s_stack_depth; - long: 32; long: 64; long: 64; long: 64; long: 64; long: 64; long: 64; - spinlock_t s_inode_list_lock; - struct list_head s_inodes; - spinlock_t s_inode_wblist_lock; - struct list_head s_inodes_wb; long: 64; long: 64; -}; - -struct kstat { - u32 result_mask; - umode_t mode; - unsigned int nlink; - uint32_t blksize; - u64 attributes; - u64 attributes_mask; - u64 ino; - dev_t dev; - dev_t rdev; - kuid_t uid; - kgid_t gid; - loff_t size; - struct timespec64 atime; - struct timespec64 mtime; - struct timespec64 ctime; - struct timespec64 btime; - u64 blocks; -}; - -struct list_lru_one { - struct list_head list; - long int nr_items; -}; - -struct list_lru_node { - spinlock_t lock; - struct list_lru_one lru; - long int nr_items; long: 64; long: 64; long: 64; }; -struct fiemap_extent { - __u64 fe_logical; - __u64 fe_physical; - __u64 fe_length; - __u64 fe_reserved64[2]; - __u32 fe_flags; - __u32 fe_reserved[3]; -}; - -enum migrate_mode { - MIGRATE_ASYNC = 0, - MIGRATE_SYNC_LIGHT = 1, - MIGRATE_SYNC = 2, - MIGRATE_SYNC_NO_COPY = 3, -}; - -struct delayed_call { - void (*fn)(void *); - void *arg; +struct x86_io_bitmap { + u64 prev_sequence; + unsigned int prev_max; + long unsigned int bitmap[1025]; + long unsigned int mapall[1025]; }; -typedef struct { - __u8 b[16]; -} guid_t; - -struct request_queue; - -struct io_cq { - struct request_queue *q; - struct io_context *ioc; - union { - struct list_head q_node; - struct kmem_cache *__rcu_icq_cache; - }; - union { - struct hlist_node ioc_node; - struct callback_head __rcu_head; - }; - unsigned int flags; -}; - -struct kiocb { - struct file *ki_filp; - loff_t ki_pos; - void (*ki_complete)(struct kiocb *, long int, long int); - void *private; - int ki_flags; - u16 ki_hint; - u16 ki_ioprio; - unsigned int ki_cookie; -}; - -struct iattr { - unsigned int ia_valid; - umode_t ia_mode; - kuid_t ia_uid; - kgid_t ia_gid; - loff_t ia_size; - struct timespec64 ia_atime; - struct timespec64 ia_mtime; - struct timespec64 ia_ctime; - struct file *ia_file; -}; - -struct percpu_counter { - raw_spinlock_t lock; - s64 count; - struct list_head list; - s32 *counters; -}; - -typedef __kernel_uid32_t projid_t; - -typedef struct { - projid_t val; -} kprojid_t; - -enum quota_type { - USRQUOTA = 0, - GRPQUOTA = 1, - PRJQUOTA = 2, -}; - -struct kqid { - union { - kuid_t uid; - kgid_t gid; - kprojid_t projid; - }; - enum quota_type type; -}; - -struct mem_dqblk { - qsize_t dqb_bhardlimit; - qsize_t dqb_bsoftlimit; - qsize_t dqb_curspace; - qsize_t dqb_rsvspace; - qsize_t dqb_ihardlimit; - qsize_t dqb_isoftlimit; - qsize_t dqb_curinodes; - time64_t dqb_btime; - time64_t dqb_itime; -}; - -struct dquot { - struct hlist_node dq_hash; - struct list_head dq_inuse; - struct list_head dq_free; - struct list_head dq_dirty; - struct mutex dq_lock; - spinlock_t dq_dqb_lock; - atomic_t dq_count; - struct super_block *dq_sb; - struct kqid dq_id; - loff_t dq_off; - long unsigned int dq_flags; - struct mem_dqblk dq_dqb; -}; - -struct module; - -struct quota_format_type { - int qf_fmt_id; - const struct quota_format_ops *qf_ops; - struct module *qf_owner; - struct quota_format_type *qf_next; -}; - -struct dqstats { - long unsigned int stat[8]; - struct percpu_counter counter[8]; -}; - -struct quota_format_ops { - int (*check_quota_file)(struct super_block *, int); - int (*read_file_info)(struct super_block *, int); - int (*write_file_info)(struct super_block *, int); - int (*free_file_info)(struct super_block *, int); - int (*read_dqblk)(struct dquot *); - int (*commit_dqblk)(struct dquot *); - int (*release_dqblk)(struct dquot *); - int (*get_next_id)(struct super_block *, struct kqid *); -}; - -struct dquot_operations { - int (*write_dquot)(struct dquot *); - struct dquot * (*alloc_dquot)(struct super_block *, int); - void (*destroy_dquot)(struct dquot *); - int (*acquire_dquot)(struct dquot *); - int (*release_dquot)(struct dquot *); - int (*mark_dirty)(struct dquot *); - int (*write_info)(struct super_block *, int); - qsize_t * (*get_reserved_space)(struct inode *); - int (*get_projid)(struct inode *, kprojid_t *); - int (*get_inode_usage)(struct inode *, qsize_t *); - int (*get_next_id)(struct super_block *, struct kqid *); -}; - -struct qc_dqblk { - int d_fieldmask; - u64 d_spc_hardlimit; - u64 d_spc_softlimit; - u64 d_ino_hardlimit; - u64 d_ino_softlimit; - u64 d_space; - u64 d_ino_count; - s64 d_ino_timer; - s64 d_spc_timer; - int d_ino_warns; - int d_spc_warns; - u64 d_rt_spc_hardlimit; - u64 d_rt_spc_softlimit; - u64 d_rt_space; - s64 d_rt_spc_timer; - int d_rt_spc_warns; -}; - -struct qc_type_state { - unsigned int flags; - unsigned int spc_timelimit; - unsigned int ino_timelimit; - unsigned int rt_spc_timelimit; - unsigned int spc_warnlimit; - unsigned int ino_warnlimit; - unsigned int rt_spc_warnlimit; - long long unsigned int ino; - blkcnt_t blocks; - blkcnt_t nextents; -}; - -struct qc_state { - unsigned int s_incoredqs; - struct qc_type_state s_state[3]; -}; - -struct qc_info { - int i_fieldmask; - unsigned int i_flags; - unsigned int i_spc_timelimit; - unsigned int i_ino_timelimit; - unsigned int i_rt_spc_timelimit; - unsigned int i_spc_warnlimit; - unsigned int i_ino_warnlimit; - unsigned int i_rt_spc_warnlimit; -}; - -struct quotactl_ops { - int (*quota_on)(struct super_block *, int, int, const struct path *); - int (*quota_off)(struct super_block *, int); - int (*quota_enable)(struct super_block *, unsigned int); - int (*quota_disable)(struct super_block *, unsigned int); - int (*quota_sync)(struct super_block *, int); - int (*set_info)(struct super_block *, int, struct qc_info *); - int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); - int (*get_nextdqblk)(struct super_block *, struct kqid *, struct qc_dqblk *); - int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); - int (*get_state)(struct super_block *, struct qc_state *); - int (*rm_xquota)(struct super_block *, unsigned int); -}; - -struct writeback_control; - -struct iov_iter; - -struct swap_info_struct; - -struct address_space_operations { - int (*writepage)(struct page *, struct writeback_control *); - int (*readpage)(struct file *, struct page *); - int (*writepages)(struct address_space *, struct writeback_control *); - int (*set_page_dirty)(struct page *); - int (*readpages)(struct file *, struct address_space *, struct list_head *, unsigned int); - int (*write_begin)(struct file *, struct address_space *, loff_t, unsigned int, unsigned int, struct page **, void **); - int (*write_end)(struct file *, struct address_space *, loff_t, unsigned int, unsigned int, struct page *, void *); - sector_t (*bmap)(struct address_space *, sector_t); - void (*invalidatepage)(struct page *, unsigned int, unsigned int); - int (*releasepage)(struct page *, gfp_t); - void (*freepage)(struct page *); - ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *); - int (*migratepage)(struct address_space *, struct page *, struct page *, enum migrate_mode); - bool (*isolate_page)(struct page *, isolate_mode_t); - void (*putback_page)(struct page *); - int (*launder_page)(struct page *); - int (*is_partially_uptodate)(struct page *, long unsigned int, long unsigned int); - void (*is_dirty_writeback)(struct page *, bool *, bool *); - int (*error_remove_page)(struct address_space *, struct page *); - int (*swap_activate)(struct swap_info_struct *, struct file *, sector_t *); - void (*swap_deactivate)(struct file *); -}; - -struct hd_struct; - -struct gendisk; - -struct block_device { - dev_t bd_dev; - int bd_openers; - struct inode *bd_inode; - struct super_block *bd_super; - struct mutex bd_mutex; - void *bd_claiming; - void *bd_holder; - int bd_holders; - bool bd_write_holder; - struct list_head bd_holder_disks; - struct block_device *bd_contains; - unsigned int bd_block_size; - u8 bd_partno; - struct hd_struct *bd_part; - unsigned int bd_part_count; - int bd_invalidated; - struct gendisk *bd_disk; - struct request_queue *bd_queue; - struct backing_dev_info *bd_bdi; - struct list_head bd_list; - long unsigned int bd_private; - int bd_fsfreeze_count; - struct mutex bd_fsfreeze_mutex; -}; - -typedef void *fl_owner_t; - -struct dir_context; - -struct poll_table_struct; - -struct file_lock; - -struct seq_file; - -struct file_operations { - struct module *owner; - loff_t (*llseek)(struct file *, loff_t, int); - ssize_t (*read)(struct file *, char *, size_t, loff_t *); - ssize_t (*write)(struct file *, const char *, size_t, loff_t *); - ssize_t (*read_iter)(struct kiocb *, struct iov_iter *); - ssize_t (*write_iter)(struct kiocb *, struct iov_iter *); - int (*iopoll)(struct kiocb *, bool); - int (*iterate)(struct file *, struct dir_context *); - int (*iterate_shared)(struct file *, struct dir_context *); - __poll_t (*poll)(struct file *, struct poll_table_struct *); - long int (*unlocked_ioctl)(struct file *, unsigned int, long unsigned int); - long int (*compat_ioctl)(struct file *, unsigned int, long unsigned int); - int (*mmap)(struct file *, struct vm_area_struct *); - long unsigned int mmap_supported_flags; - int (*open)(struct inode *, struct file *); - int (*flush)(struct file *, fl_owner_t); - int (*release)(struct inode *, struct file *); - int (*fsync)(struct file *, loff_t, loff_t, int); - int (*fasync)(int, struct file *, int); - int (*lock)(struct file *, int, struct file_lock *); - ssize_t (*sendpage)(struct file *, struct page *, int, size_t, loff_t *, int); - long unsigned int (*get_unmapped_area)(struct file *, long unsigned int, long unsigned int, long unsigned int, long unsigned int); - int (*check_flags)(int); - int (*flock)(struct file *, int, struct file_lock *); - ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); - ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); - int (*setlease)(struct file *, long int, struct file_lock **, void **); - long int (*fallocate)(struct file *, int, loff_t, loff_t); - void (*show_fdinfo)(struct seq_file *, struct file *); - ssize_t (*copy_file_range)(struct file *, loff_t, struct file *, loff_t, size_t, unsigned int); - loff_t (*remap_file_range)(struct file *, loff_t, struct file *, loff_t, loff_t, unsigned int); - int (*fadvise)(struct file *, loff_t, loff_t, int); -}; - -struct fiemap_extent_info; - -struct inode_operations { - struct dentry * (*lookup)(struct inode *, struct dentry *, unsigned int); - const char * (*get_link)(struct dentry *, struct inode *, struct delayed_call *); - int (*permission)(struct inode *, int); - struct posix_acl * (*get_acl)(struct inode *, int); - int (*readlink)(struct dentry *, char *, int); - int (*create)(struct inode *, struct dentry *, umode_t, bool); - int (*link)(struct dentry *, struct inode *, struct dentry *); - int (*unlink)(struct inode *, struct dentry *); - int (*symlink)(struct inode *, struct dentry *, const char *); - int (*mkdir)(struct inode *, struct dentry *, umode_t); - int (*rmdir)(struct inode *, struct dentry *); - int (*mknod)(struct inode *, struct dentry *, umode_t, dev_t); - int (*rename)(struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); - int (*setattr)(struct dentry *, struct iattr *); - int (*getattr)(const struct path *, struct kstat *, u32, unsigned int); - ssize_t (*listxattr)(struct dentry *, char *, size_t); - int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64, u64); - int (*update_time)(struct inode *, struct timespec64 *, int); - int (*atomic_open)(struct inode *, struct dentry *, struct file *, unsigned int, umode_t); - int (*tmpfile)(struct inode *, struct dentry *, umode_t); - int (*set_acl)(struct inode *, struct posix_acl *, int); - long: 64; - long: 64; - long: 64; -}; - -struct file_lock_context { - spinlock_t flc_lock; - struct list_head flc_flock; - struct list_head flc_posix; - struct list_head flc_lease; -}; - -struct file_lock_operations { - void (*fl_copy_lock)(struct file_lock *, struct file_lock *); - void (*fl_release_private)(struct file_lock *); -}; - -struct nlm_lockowner; - -struct nfs_lock_info { - u32 state; - struct nlm_lockowner *owner; - struct list_head list; -}; - -struct nfs4_lock_state; - -struct nfs4_lock_info { - struct nfs4_lock_state *owner; -}; - -struct fasync_struct; - -struct lock_manager_operations; - -struct file_lock { - struct file_lock *fl_blocker; - struct list_head fl_list; - struct hlist_node fl_link; - struct list_head fl_blocked_requests; - struct list_head fl_blocked_member; - fl_owner_t fl_owner; - unsigned int fl_flags; - unsigned char fl_type; - unsigned int fl_pid; - int fl_link_cpu; - wait_queue_head_t fl_wait; - struct file *fl_file; - loff_t fl_start; - loff_t fl_end; - struct fasync_struct *fl_fasync; - long unsigned int fl_break_time; - long unsigned int fl_downgrade_time; - const struct file_lock_operations *fl_ops; - const struct lock_manager_operations *fl_lmops; - union { - struct nfs_lock_info nfs_fl; - struct nfs4_lock_info nfs4_fl; - struct { - struct list_head link; - int state; - unsigned int debug_id; - } afs; - } fl_u; -}; - -struct lock_manager_operations { - fl_owner_t (*lm_get_owner)(fl_owner_t); - void (*lm_put_owner)(fl_owner_t); - void (*lm_notify)(struct file_lock *); - int (*lm_grant)(struct file_lock *, int); - bool (*lm_break)(struct file_lock *); - int (*lm_change)(struct file_lock *, int, struct list_head *); - void (*lm_setup)(struct file_lock *, void **); -}; - -struct fasync_struct { - rwlock_t fa_lock; - int magic; - int fa_fd; - struct fasync_struct *fa_next; - struct file *fa_file; - struct callback_head fa_rcu; -}; - -struct fs_context; - -struct fs_parameter_description; - -struct file_system_type { - const char *name; - int fs_flags; - int (*init_fs_context)(struct fs_context *); - const struct fs_parameter_description *parameters; - struct dentry * (*mount)(struct file_system_type *, int, const char *, void *); - void (*kill_sb)(struct super_block *); - struct module *owner; - struct file_system_type *next; - struct hlist_head fs_supers; - struct lock_class_key s_lock_key; - struct lock_class_key s_umount_key; - struct lock_class_key s_vfs_rename_key; - struct lock_class_key s_writers_key[3]; - struct lock_class_key i_lock_key; - struct lock_class_key i_mutex_key; - struct lock_class_key i_mutex_dir_key; -}; - -struct kstatfs; - -struct super_operations { - struct inode * (*alloc_inode)(struct super_block *); - void (*destroy_inode)(struct inode *); - void (*free_inode)(struct inode *); - void (*dirty_inode)(struct inode *, int); - int (*write_inode)(struct inode *, struct writeback_control *); - int (*drop_inode)(struct inode *); - void (*evict_inode)(struct inode *); - void (*put_super)(struct super_block *); - int (*sync_fs)(struct super_block *, int); - int (*freeze_super)(struct super_block *); - int (*freeze_fs)(struct super_block *); - int (*thaw_super)(struct super_block *); - int (*unfreeze_fs)(struct super_block *); - int (*statfs)(struct dentry *, struct kstatfs *); - int (*remount_fs)(struct super_block *, int *, char *); - void (*umount_begin)(struct super_block *); - int (*show_options)(struct seq_file *, struct dentry *); - int (*show_devname)(struct seq_file *, struct dentry *); - int (*show_path)(struct seq_file *, struct dentry *); - int (*show_stats)(struct seq_file *, struct dentry *); - ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); - ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); - struct dquot ** (*get_dquots)(struct inode *); - int (*bdev_try_to_free_page)(struct super_block *, struct page *, gfp_t); - long int (*nr_cached_objects)(struct super_block *, struct shrink_control *); - long int (*free_cached_objects)(struct super_block *, struct shrink_control *); -}; - -struct iomap; - -struct inode___2; - -struct dentry___2; - -struct super_block___2; - -struct fid; - -struct export_operations { - int (*encode_fh)(struct inode___2 *, __u32 *, int *, struct inode___2 *); - struct dentry___2 * (*fh_to_dentry)(struct super_block___2 *, struct fid *, int, int); - struct dentry___2 * (*fh_to_parent)(struct super_block___2 *, struct fid *, int, int); - int (*get_name)(struct dentry___2 *, char *, struct dentry___2 *); - struct dentry___2 * (*get_parent)(struct dentry___2 *); - int (*commit_metadata)(struct inode___2 *); - int (*get_uuid)(struct super_block___2 *, u8 *, u32 *, u64 *); - int (*map_blocks)(struct inode___2 *, loff_t, u64, struct iomap *, bool, u32 *); - int (*commit_blocks)(struct inode___2 *, struct iomap *, int, struct iattr *); -}; - -struct xattr_handler { - const char *name; - const char *prefix; - int flags; - bool (*list)(struct dentry *); - int (*get)(const struct xattr_handler *, struct dentry *, struct inode *, const char *, void *, size_t); - int (*set)(const struct xattr_handler *, struct dentry *, struct inode *, const char *, const void *, size_t, int); -}; - -struct fiemap_extent_info { - unsigned int fi_flags; - unsigned int fi_extents_mapped; - unsigned int fi_extents_max; - struct fiemap_extent *fi_extents_start; -}; - -typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64, unsigned int); - -struct dir_context { - filldir_t actor; - loff_t pos; -}; - -struct fs_parameter_spec; - -struct fs_parameter_enum; - -struct fs_parameter_description { - char name[16]; - const struct fs_parameter_spec *specs; - const struct fs_parameter_enum *enums; -}; - -typedef void compound_page_dtor(struct page *); - -enum vm_event_item { - PGPGIN = 0, - PGPGOUT = 1, - PSWPIN = 2, - PSWPOUT = 3, - PGALLOC_DMA = 4, - PGALLOC_DMA32 = 5, - PGALLOC_NORMAL = 6, - PGALLOC_MOVABLE = 7, - ALLOCSTALL_DMA = 8, - ALLOCSTALL_DMA32 = 9, - ALLOCSTALL_NORMAL = 10, - ALLOCSTALL_MOVABLE = 11, - PGSCAN_SKIP_DMA = 12, - PGSCAN_SKIP_DMA32 = 13, - PGSCAN_SKIP_NORMAL = 14, - PGSCAN_SKIP_MOVABLE = 15, - PGFREE = 16, - PGACTIVATE = 17, - PGDEACTIVATE = 18, - PGLAZYFREE = 19, - PGFAULT = 20, - PGMAJFAULT = 21, - PGLAZYFREED = 22, - PGREFILL = 23, - PGSTEAL_KSWAPD = 24, - PGSTEAL_DIRECT = 25, - PGSCAN_KSWAPD = 26, - PGSCAN_DIRECT = 27, - PGSCAN_DIRECT_THROTTLE = 28, - PGSCAN_ZONE_RECLAIM_FAILED = 29, - PGINODESTEAL = 30, - SLABS_SCANNED = 31, - KSWAPD_INODESTEAL = 32, - KSWAPD_LOW_WMARK_HIT_QUICKLY = 33, - KSWAPD_HIGH_WMARK_HIT_QUICKLY = 34, - PAGEOUTRUN = 35, - PGROTATED = 36, - DROP_PAGECACHE = 37, - DROP_SLAB = 38, - OOM_KILL = 39, - PGMIGRATE_SUCCESS = 40, - PGMIGRATE_FAIL = 41, - COMPACTMIGRATE_SCANNED = 42, - COMPACTFREE_SCANNED = 43, - COMPACTISOLATED = 44, - COMPACTSTALL = 45, - COMPACTFAIL = 46, - COMPACTSUCCESS = 47, - KCOMPACTD_WAKE = 48, - KCOMPACTD_MIGRATE_SCANNED = 49, - KCOMPACTD_FREE_SCANNED = 50, - HTLB_BUDDY_PGALLOC = 51, - HTLB_BUDDY_PGALLOC_FAIL = 52, - UNEVICTABLE_PGCULLED = 53, - UNEVICTABLE_PGSCANNED = 54, - UNEVICTABLE_PGRESCUED = 55, - UNEVICTABLE_PGMLOCKED = 56, - UNEVICTABLE_PGMUNLOCKED = 57, - UNEVICTABLE_PGCLEARED = 58, - UNEVICTABLE_PGSTRANDED = 59, - SWAP_RA = 60, - SWAP_RA_HIT = 61, - NR_VM_EVENT_ITEMS = 62, -}; - -struct vm_event_state { - long unsigned int event[62]; -}; - -enum memblock_flags { - MEMBLOCK_NONE = 0, - MEMBLOCK_HOTPLUG = 1, - MEMBLOCK_MIRROR = 2, - MEMBLOCK_NOMAP = 4, -}; - -struct memblock_region { - phys_addr_t base; - phys_addr_t size; - enum memblock_flags flags; - int nid; -}; - -struct memblock_type { - long unsigned int cnt; - long unsigned int max; - phys_addr_t total_size; - struct memblock_region *regions; - char *name; -}; - -struct memblock { - bool bottom_up; - phys_addr_t current_limit; - struct memblock_type memory; - struct memblock_type reserved; -}; - -struct gdt_page { - struct desc_struct gdt[16]; - long: 64; +struct tss_struct { + struct x86_hw_tss x86_tss; + struct x86_io_bitmap io_bitmap; long: 64; long: 64; long: 64; @@ -4619,558 +2575,263 @@ struct gdt_page { long: 64; }; -struct tlb_context { - u64 ctx_id; - u64 tlb_gen; +struct irq_stack { + char stack[16384]; }; -struct tlb_state { - struct mm_struct *loaded_mm; - union { - struct mm_struct *last_user_mm; - long unsigned int last_user_mm_ibpb; - }; - u16 loaded_mm_asid; - u16 next_asid; - bool is_lazy; - bool invalidate_other; - short unsigned int user_pcid_flush_mask; - long unsigned int cr4; - struct tlb_context ctxs[6]; +struct fixed_percpu_data { + char gs_base[40]; + long unsigned int stack_canary; }; -struct boot_params_to_save { - unsigned int start; - unsigned int len; +enum l1tf_mitigations { + L1TF_MITIGATION_OFF = 0, + L1TF_MITIGATION_FLUSH_NOWARN = 1, + L1TF_MITIGATION_FLUSH = 2, + L1TF_MITIGATION_FLUSH_NOSMT = 3, + L1TF_MITIGATION_FULL = 4, + L1TF_MITIGATION_FULL_FORCE = 5, }; -typedef s32 int32_t; +struct mpc_table { + char signature[4]; + short unsigned int length; + char spec; + char checksum; + char oem[8]; + char productid[12]; + unsigned int oemptr; + short unsigned int oemsize; + short unsigned int oemcount; + unsigned int lapic; + unsigned int reserved; +}; -typedef long unsigned int irq_hw_number_t; +struct mpc_cpu { + unsigned char type; + unsigned char apicid; + unsigned char apicver; + unsigned char cpuflag; + unsigned int cpufeature; + unsigned int featureflag; + unsigned int reserved[2]; +}; -struct kernel_symbol { - int value_offset; - int name_offset; - int namespace_offset; +struct mpc_bus { + unsigned char type; + unsigned char busid; + unsigned char bustype[6]; }; -typedef int (*initcall_t)(); +struct mpc_intsrc { + unsigned char type; + unsigned char irqtype; + short unsigned int irqflag; + unsigned char srcbus; + unsigned char srcbusirq; + unsigned char dstapic; + unsigned char dstirq; +}; -typedef int initcall_entry_t; +struct x86_init_mpparse { + void (*mpc_record)(unsigned int); + void (*setup_ioapic_ids)(); + int (*mpc_apic_id)(struct mpc_cpu *); + void (*smp_read_mpc_oem)(struct mpc_table *); + void (*mpc_oem_pci_bus)(struct mpc_bus *); + void (*mpc_oem_bus_info)(struct mpc_bus *, char *); + void (*find_smp_config)(); + void (*get_smp_config)(unsigned int); +}; -struct obs_kernel_param { - const char *str; - int (*setup_func)(char *); - int early; +struct x86_init_resources { + void (*probe_roms)(); + void (*reserve_resources)(); + char * (*memory_setup)(); }; -enum system_states { - SYSTEM_BOOTING = 0, - SYSTEM_SCHEDULING = 1, - SYSTEM_RUNNING = 2, - SYSTEM_HALT = 3, - SYSTEM_POWER_OFF = 4, - SYSTEM_RESTART = 5, - SYSTEM_SUSPEND = 6, +struct x86_init_irqs { + void (*pre_vector_init)(); + void (*intr_init)(); + void (*trap_init)(); + void (*intr_mode_init)(); }; -struct bug_entry { - int bug_addr_disp; - int file_disp; - short unsigned int line; - short unsigned int flags; +struct x86_init_oem { + void (*arch_setup)(); + void (*banner)(); }; -struct pollfd { - int fd; - short int events; - short int revents; +struct x86_init_paging { + void (*pagetable_init)(); }; -typedef const int tracepoint_ptr_t; +struct x86_init_timers { + void (*setup_percpu_clockev)(); + void (*timer_init)(); + void (*wallclock_init)(); +}; -struct orc_entry { - s16 sp_offset; - s16 bp_offset; - unsigned int sp_reg: 4; - unsigned int bp_reg: 4; - unsigned int type: 2; - unsigned int end: 1; -} __attribute__((packed)); +struct x86_init_iommu { + int (*iommu_init)(); +}; -enum perf_event_state { - PERF_EVENT_STATE_DEAD = -4, - PERF_EVENT_STATE_EXIT = -3, - PERF_EVENT_STATE_ERROR = -2, - PERF_EVENT_STATE_OFF = -1, - PERF_EVENT_STATE_INACTIVE = 0, - PERF_EVENT_STATE_ACTIVE = 1, +struct x86_init_pci { + int (*arch_init)(); + int (*init)(); + void (*init_irq)(); + void (*fixup_irqs)(); }; -typedef struct { - atomic_long_t a; -} local_t; +struct x86_hyper_init { + void (*init_platform)(); + void (*guest_late_init)(); + bool (*x2apic_available)(); + void (*init_mem_mapping)(); + void (*init_after_bootmem)(); +}; -typedef struct { - local_t a; -} local64_t; +struct x86_init_acpi { + void (*set_root_pointer)(u64); + u64 (*get_root_pointer)(); + void (*reduced_hw_early_init)(); +}; -struct perf_event_attr { - __u32 type; - __u32 size; - __u64 config; - union { - __u64 sample_period; - __u64 sample_freq; - }; - __u64 sample_type; - __u64 read_format; - __u64 disabled: 1; - __u64 inherit: 1; - __u64 pinned: 1; - __u64 exclusive: 1; - __u64 exclude_user: 1; - __u64 exclude_kernel: 1; - __u64 exclude_hv: 1; - __u64 exclude_idle: 1; - __u64 mmap: 1; - __u64 comm: 1; - __u64 freq: 1; - __u64 inherit_stat: 1; - __u64 enable_on_exec: 1; - __u64 task: 1; - __u64 watermark: 1; - __u64 precise_ip: 2; - __u64 mmap_data: 1; - __u64 sample_id_all: 1; - __u64 exclude_host: 1; - __u64 exclude_guest: 1; - __u64 exclude_callchain_kernel: 1; - __u64 exclude_callchain_user: 1; - __u64 mmap2: 1; - __u64 comm_exec: 1; - __u64 use_clockid: 1; - __u64 context_switch: 1; - __u64 write_backward: 1; - __u64 namespaces: 1; - __u64 ksymbol: 1; - __u64 bpf_event: 1; - __u64 aux_output: 1; - __u64 __reserved_1: 32; - union { - __u32 wakeup_events; - __u32 wakeup_watermark; - }; - __u32 bp_type; - union { - __u64 bp_addr; - __u64 kprobe_func; - __u64 uprobe_path; - __u64 config1; - }; - union { - __u64 bp_len; - __u64 kprobe_addr; - __u64 probe_offset; - __u64 config2; - }; - __u64 branch_sample_type; - __u64 sample_regs_user; - __u32 sample_stack_user; - __s32 clockid; - __u64 sample_regs_intr; - __u32 aux_watermark; - __u16 sample_max_stack; - __u16 __reserved_2; - __u32 aux_sample_size; - __u32 __reserved_3; +struct x86_init_ops { + struct x86_init_resources resources; + struct x86_init_mpparse mpparse; + struct x86_init_irqs irqs; + struct x86_init_oem oem; + struct x86_init_paging paging; + struct x86_init_timers timers; + struct x86_init_iommu iommu; + struct x86_init_pci pci; + struct x86_hyper_init hyper; + struct x86_init_acpi acpi; }; -struct hw_perf_event_extra { - u64 config; - unsigned int reg; - int alloc; - int idx; +struct x86_cpuinit_ops { + void (*setup_percpu_clockev)(); + void (*early_percpu_clock_init)(); + void (*fixup_cpu_id)(struct cpuinfo_x86 *, int); }; -struct arch_hw_breakpoint { - long unsigned int address; - long unsigned int mask; - u8 len; - u8 type; +struct x86_legacy_devices { + int pnpbios; }; -struct hw_perf_event { - union { - struct { - u64 config; - u64 last_tag; - long unsigned int config_base; - long unsigned int event_base; - int event_base_rdpmc; - int idx; - int last_cpu; - int flags; - struct hw_perf_event_extra extra_reg; - struct hw_perf_event_extra branch_reg; - }; - struct { - struct hrtimer hrtimer; - }; - struct { - struct list_head tp_list; - }; - struct { - u64 pwr_acc; - u64 ptsc; - }; - struct { - struct arch_hw_breakpoint info; - struct list_head bp_list; - }; - struct { - u8 iommu_bank; - u8 iommu_cntr; - u16 padding; - u64 conf; - u64 conf1; - }; - }; - struct task_struct *target; - void *addr_filters; - long unsigned int addr_filters_gen; - int state; - local64_t prev_count; - u64 sample_period; - u64 last_period; - local64_t period_left; - u64 interrupts_seq; - u64 interrupts; - u64 freq_time_stamp; - u64 freq_count_stamp; +enum x86_legacy_i8042_state { + X86_LEGACY_I8042_PLATFORM_ABSENT = 0, + X86_LEGACY_I8042_FIRMWARE_ABSENT = 1, + X86_LEGACY_I8042_EXPECTED_PRESENT = 2, }; -struct irq_work { - atomic_t flags; - struct llist_node llnode; - void (*func)(struct irq_work *); +struct x86_legacy_features { + enum x86_legacy_i8042_state i8042; + int rtc; + int warm_reset; + int no_vga; + int reserve_bios_regions; + struct x86_legacy_devices devices; }; -struct perf_addr_filters_head { - struct list_head list; - raw_spinlock_t lock; - unsigned int nr_file_filters; +struct x86_hyper_runtime { + void (*pin_vcpu)(int); }; -struct perf_sample_data; +struct x86_platform_ops { + long unsigned int (*calibrate_cpu)(); + long unsigned int (*calibrate_tsc)(); + void (*get_wallclock)(struct timespec64 *); + int (*set_wallclock)(const struct timespec64 *); + void (*iommu_shutdown)(); + bool (*is_untracked_pat_range)(u64, u64); + void (*nmi_init)(); + unsigned char (*get_nmi_reason)(); + void (*save_sched_clock_state)(); + void (*restore_sched_clock_state)(); + void (*apic_post_init)(); + struct x86_legacy_features legacy; + void (*set_legacy_features)(); + struct x86_hyper_runtime hyper; +}; -typedef void (*perf_overflow_handler_t)(struct perf_event *, struct perf_sample_data *, struct pt_regs *); +struct pci_dev; -struct pmu; +struct x86_msi_ops { + int (*setup_msi_irqs)(struct pci_dev *, int, int); + void (*teardown_msi_irq)(unsigned int); + void (*teardown_msi_irqs)(struct pci_dev *); + void (*restore_msi_irqs)(struct pci_dev *); +}; -struct ring_buffer; +struct x86_apic_ops { + unsigned int (*io_apic_read)(unsigned int, unsigned int); + void (*restore)(); +}; -struct perf_addr_filter_range; +struct physid_mask { + long unsigned int mask[512]; +}; -struct trace_event_call; +typedef struct physid_mask physid_mask_t; -struct event_filter; +struct qrwlock { + union { + atomic_t cnts; + struct { + u8 wlocked; + u8 __lstate[3]; + }; + }; + arch_spinlock_t wait_lock; +}; -struct perf_event { - struct list_head event_entry; - struct list_head sibling_list; - struct list_head active_list; - struct rb_node group_node; - u64 group_index; - struct list_head migrate_entry; - struct hlist_node hlist_entry; - struct list_head active_entry; - int nr_siblings; - int event_caps; - int group_caps; - struct perf_event *group_leader; - struct pmu *pmu; - void *pmu_private; - enum perf_event_state state; - unsigned int attach_state; - local64_t count; - atomic64_t child_count; - u64 total_time_enabled; - u64 total_time_running; - u64 tstamp; - u64 shadow_ctx_time; - struct perf_event_attr attr; - u16 header_size; - u16 id_header_size; - u16 read_size; - struct hw_perf_event hw; - struct perf_event_context *ctx; - atomic_long_t refcount; - atomic64_t child_total_time_enabled; - atomic64_t child_total_time_running; - struct mutex child_mutex; - struct list_head child_list; - struct perf_event *parent; - int oncpu; - int cpu; - struct list_head owner_entry; - struct task_struct *owner; - struct mutex mmap_mutex; - atomic_t mmap_count; - struct ring_buffer *rb; - struct list_head rb_entry; - long unsigned int rcu_batches; - int rcu_pending; - wait_queue_head_t waitq; - struct fasync_struct *fasync; - int pending_wakeup; - int pending_kill; - int pending_disable; - struct irq_work pending; - atomic_t event_limit; - struct perf_addr_filters_head addr_filters; - struct perf_addr_filter_range *addr_filter_ranges; - long unsigned int addr_filters_gen; - struct perf_event *aux_event; - void (*destroy)(struct perf_event *); - struct callback_head callback_head; - struct pid_namespace *ns; - u64 id; - u64 (*clock)(); - perf_overflow_handler_t overflow_handler; - void *overflow_handler_context; - struct trace_event_call *tp_event; - struct event_filter *filter; - void *security; - struct list_head sb_list; -}; - -struct lockdep_map {}; +typedef struct qrwlock arch_rwlock_t; typedef struct { - struct seqcount seqcount; - spinlock_t lock; -} seqlock_t; - -enum node_states { - N_POSSIBLE = 0, - N_ONLINE = 1, - N_NORMAL_MEMORY = 2, - N_HIGH_MEMORY = 2, - N_MEMORY = 3, - N_CPU = 4, - NR_NODE_STATES = 5, -}; - -struct timer_list { - struct hlist_node entry; - long unsigned int expires; - void (*function)(struct timer_list *); - u32 flags; -}; - -struct delayed_work { - struct work_struct work; - struct timer_list timer; - struct workqueue_struct *wq; - int cpu; -}; - -struct rcu_work { - struct work_struct work; - struct callback_head rcu; - struct workqueue_struct *wq; -}; - -struct rcu_segcblist { - struct callback_head *head; - struct callback_head **tails[4]; - long unsigned int gp_seq[4]; - long int len; - long int len_lazy; - u8 enabled; - u8 offloaded; -}; - -struct srcu_node; - -struct srcu_struct; - -struct srcu_data { - long unsigned int srcu_lock_count[2]; - long unsigned int srcu_unlock_count[2]; - long: 64; - long: 64; - long: 64; - long: 64; - spinlock_t lock; - struct rcu_segcblist srcu_cblist; - long unsigned int srcu_gp_seq_needed; - long unsigned int srcu_gp_seq_needed_exp; - bool srcu_cblist_invoking; - struct timer_list delay_work; - struct work_struct work; - struct callback_head srcu_barrier_head; - struct srcu_node *mynode; - long unsigned int grpmask; - int cpu; - struct srcu_struct *ssp; - long: 64; -}; - -struct srcu_node { - spinlock_t lock; - long unsigned int srcu_have_cbs[4]; - long unsigned int srcu_data_have_cbs[4]; - long unsigned int srcu_gp_seq_needed_exp; - struct srcu_node *srcu_parent; - int grplo; - int grphi; -}; - -struct srcu_struct { - struct srcu_node node[5]; - struct srcu_node *level[3]; - struct mutex srcu_cb_mutex; - spinlock_t lock; - struct mutex srcu_gp_mutex; - unsigned int srcu_idx; - long unsigned int srcu_gp_seq; - long unsigned int srcu_gp_seq_needed; - long unsigned int srcu_gp_seq_needed_exp; - long unsigned int srcu_last_gp_end; - struct srcu_data *sda; - long unsigned int srcu_barrier_seq; - struct mutex srcu_barrier_mutex; - struct completion srcu_barrier_completion; - atomic_t srcu_barrier_cpu_cnt; - struct delayed_work work; -}; - -struct anon_vma { - struct anon_vma *root; - struct rw_semaphore rwsem; - atomic_t refcount; - unsigned int degree; - struct anon_vma *parent; - struct rb_root_cached rb_root; -}; - -struct mempolicy { - atomic_t refcnt; - short unsigned int mode; - short unsigned int flags; - union { - short int preferred_node; - nodemask_t nodes; - } v; - union { - nodemask_t cpuset_mems_allowed; - nodemask_t user_nodemask; - } w; -}; - -struct linux_binprm; - -struct coredump_params; - -struct linux_binfmt { - struct list_head lh; - struct module *module; - int (*load_binary)(struct linux_binprm *); - int (*load_shlib)(struct file *); - int (*core_dump)(struct coredump_params *); - long unsigned int min_coredump; -}; - -struct uid_gid_extent { - u32 first; - u32 lower_first; - u32 count; -}; - -struct uid_gid_map { - u32 nr_extents; - union { - struct uid_gid_extent extent[5]; - struct { - struct uid_gid_extent *forward; - struct uid_gid_extent *reverse; - }; - }; -}; - -struct proc_ns_operations; - -struct ns_common { - atomic_long_t stashed; - const struct proc_ns_operations *ops; - unsigned int inum; -}; - -struct ctl_table; - -struct ctl_table_root; - -struct ctl_table_set; - -struct ctl_dir; - -struct ctl_node; - -struct ctl_table_header { - union { - struct { - struct ctl_table *ctl_table; - int used; - int count; - int nreg; - }; - struct callback_head rcu; - }; - struct completion *unregistering; - struct ctl_table *ctl_table_arg; - struct ctl_table_root *root; - struct ctl_table_set *set; - struct ctl_dir *parent; - struct ctl_node *node; - struct hlist_head inodes; -}; + arch_rwlock_t raw_lock; +} rwlock_t; -struct ctl_dir { - struct ctl_table_header header; - struct rb_root root; +struct rw_semaphore { + atomic_long_t count; + atomic_long_t owner; + struct optimistic_spin_queue osq; + raw_spinlock_t wait_lock; + struct list_head wait_list; }; -struct ctl_table_set { - int (*is_seen)(struct ctl_table_set *); - struct ctl_dir dir; +struct vdso_image { + void *data; + long unsigned int size; + long unsigned int alt; + long unsigned int alt_len; + long int sym_vvar_start; + long int sym_vvar_page; + long int sym_pvclock_page; + long int sym_hvclock_page; + long int sym_VDSO32_NOTE_MASK; + long int sym___kernel_sigreturn; + long int sym___kernel_rt_sigreturn; + long int sym___kernel_vsyscall; + long int sym_int80_landing_pad; }; -struct ucounts; - -struct user_namespace { - struct uid_gid_map uid_map; - struct uid_gid_map gid_map; - struct uid_gid_map projid_map; - atomic_t count; - struct user_namespace *parent; - int level; - kuid_t owner; - kgid_t group; - struct ns_common ns; - long unsigned int flags; - struct list_head keyring_name_list; - struct key *user_keyring_register; - struct rw_semaphore keyring_sem; - struct work_struct work; - struct ctl_table_set set; - struct ctl_table_header *sysctls; - struct ucounts *ucounts; - int ucount_max[9]; -}; +struct ldt_struct; -typedef struct pglist_data pg_data_t; +typedef struct { + u64 ctx_id; + atomic64_t tlb_gen; + struct rw_semaphore ldt_usr_sem; + struct ldt_struct *ldt; + short unsigned int ia32_compat; + struct mutex lock; + void *vdso; + const struct vdso_image *vdso_image; + atomic_t perf_rdpmc_allowed; + u16 pkey_allocation_map; + s16 execute_only_pkey; +} mm_context_t; struct fwnode_operations; @@ -5254,6 +2915,28 @@ struct pm_message { typedef struct pm_message pm_message_t; +struct wait_queue_head { + spinlock_t lock; + struct list_head head; +}; + +typedef struct wait_queue_head wait_queue_head_t; + +struct completion { + unsigned int done; + wait_queue_head_t wait; +}; + +struct work_struct; + +typedef void (*work_func_t)(struct work_struct *); + +struct work_struct { + atomic_long_t data; + struct list_head entry; + work_func_t func; +}; + enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, @@ -5418,2397 +3101,2453 @@ struct fwnode_reference_args { u64 args[8]; }; -typedef void (*smp_call_func_t)(void *); +struct vm_struct { + struct vm_struct *next; + void *addr; + long unsigned int size; + long unsigned int flags; + struct page **pages; + unsigned int nr_pages; + phys_addr_t phys_addr; + const void *caller; +}; -struct __call_single_data { - struct llist_node llist; - smp_call_func_t func; - void *info; - unsigned int flags; +struct real_mode_header { + u32 text_start; + u32 ro_end; + u32 trampoline_start; + u32 trampoline_header; + u32 trampoline_pgd; + u32 wakeup_start; + u32 wakeup_header; + u32 machine_real_restart_asm; + u32 machine_real_restart_seg; }; -typedef int proc_handler(struct ctl_table *, int, void *, size_t *, loff_t *); +enum fixed_addresses { + VSYSCALL_PAGE = 511, + FIX_DBGP_BASE = 512, + FIX_EARLYCON_MEM_BASE = 513, + FIX_OHCI1394_BASE = 514, + FIX_APIC_BASE = 515, + FIX_IO_APIC_BASE_0 = 516, + FIX_IO_APIC_BASE_END = 643, + __end_of_permanent_fixed_addresses = 644, + FIX_BTMAP_END = 1024, + FIX_BTMAP_BEGIN = 1535, + __end_of_fixed_addresses = 1536, +}; -struct ctl_table_poll; +struct vm_userfaultfd_ctx {}; -struct ctl_table { - const char *procname; - void *data; - int maxlen; - umode_t mode; - struct ctl_table *child; - proc_handler *proc_handler; - struct ctl_table_poll *poll; - void *extra1; - void *extra2; -}; +struct anon_vma; -struct ctl_table_poll { - atomic_t event; - wait_queue_head_t wait; -}; +struct vm_operations_struct; -struct ctl_node { - struct rb_node node; - struct ctl_table_header *header; +struct vm_area_struct { + long unsigned int vm_start; + long unsigned int vm_end; + struct vm_area_struct *vm_next; + struct vm_area_struct *vm_prev; + struct rb_node vm_rb; + long unsigned int rb_subtree_gap; + struct mm_struct *vm_mm; + pgprot_t vm_page_prot; + long unsigned int vm_flags; + struct { + struct rb_node rb; + long unsigned int rb_subtree_last; + } shared; + struct list_head anon_vma_chain; + struct anon_vma *anon_vma; + const struct vm_operations_struct *vm_ops; + long unsigned int vm_pgoff; + struct file *vm_file; + void *vm_private_data; + atomic_long_t swap_readahead_info; + struct mempolicy *vm_policy; + struct vm_userfaultfd_ctx vm_userfaultfd_ctx; }; -struct ctl_table_root { - struct ctl_table_set default_set; - struct ctl_table_set * (*lookup)(struct ctl_table_root *); - void (*set_ownership)(struct ctl_table_header *, struct ctl_table *, kuid_t *, kgid_t *); - int (*permissions)(struct ctl_table_header *, struct ctl_table *); +struct mm_rss_stat { + atomic_long_t count[4]; }; -enum umh_disable_depth { - UMH_ENABLED = 0, - UMH_FREEZING = 1, - UMH_DISABLED = 2, +struct xol_area; + +struct uprobes_state { + struct xol_area *xol_area; }; -typedef __u64 Elf64_Addr; +struct linux_binfmt; -typedef __u16 Elf64_Half; +struct core_state; -typedef __u32 Elf64_Word; +struct kioctx_table; -typedef __u64 Elf64_Xword; +struct user_namespace; -struct elf64_sym { - Elf64_Word st_name; - unsigned char st_info; - unsigned char st_other; - Elf64_Half st_shndx; - Elf64_Addr st_value; - Elf64_Xword st_size; +struct mmu_notifier_mm; + +struct mm_struct { + struct { + struct vm_area_struct *mmap; + struct rb_root mm_rb; + u64 vmacache_seqnum; + long unsigned int (*get_unmapped_area)(struct file *, long unsigned int, long unsigned int, long unsigned int, long unsigned int); + long unsigned int mmap_base; + long unsigned int mmap_legacy_base; + long unsigned int mmap_compat_base; + long unsigned int mmap_compat_legacy_base; + long unsigned int task_size; + long unsigned int highest_vm_end; + pgd_t *pgd; + atomic_t membarrier_state; + atomic_t mm_users; + atomic_t mm_count; + atomic_long_t pgtables_bytes; + int map_count; + spinlock_t page_table_lock; + struct rw_semaphore mmap_sem; + struct list_head mmlist; + long unsigned int hiwater_rss; + long unsigned int hiwater_vm; + long unsigned int total_vm; + long unsigned int locked_vm; + atomic64_t pinned_vm; + long unsigned int data_vm; + long unsigned int exec_vm; + long unsigned int stack_vm; + long unsigned int def_flags; + spinlock_t arg_lock; + long unsigned int start_code; + long unsigned int end_code; + long unsigned int start_data; + long unsigned int end_data; + long unsigned int start_brk; + long unsigned int brk; + long unsigned int start_stack; + long unsigned int arg_start; + long unsigned int arg_end; + long unsigned int env_start; + long unsigned int env_end; + long unsigned int saved_auxv[46]; + struct mm_rss_stat rss_stat; + struct linux_binfmt *binfmt; + mm_context_t context; + long unsigned int flags; + struct core_state *core_state; + spinlock_t ioctx_lock; + struct kioctx_table *ioctx_table; + struct user_namespace *user_ns; + struct file *exe_file; + struct mmu_notifier_mm *mmu_notifier_mm; + atomic_t tlb_flush_pending; + bool tlb_flush_batched; + struct uprobes_state uprobes_state; + atomic_long_t hugetlb_usage; + struct work_struct async_put_work; + }; + long unsigned int cpu_bitmap[0]; }; -typedef struct elf64_sym Elf64_Sym; +typedef struct { + struct seqcount seqcount; + spinlock_t lock; +} seqlock_t; -struct idr { - struct xarray idr_rt; - unsigned int idr_base; - unsigned int idr_next; +struct timer_list { + struct hlist_node entry; + long unsigned int expires; + void (*function)(struct timer_list *); + u32 flags; }; -struct kernfs_root; +typedef int (*notifier_fn_t)(struct notifier_block *, long unsigned int, void *); -struct kernfs_elem_dir { - long unsigned int subdirs; - struct rb_root children; - struct kernfs_root *root; +struct notifier_block { + notifier_fn_t notifier_call; + struct notifier_block *next; + int priority; }; -struct kernfs_syscall_ops; - -struct kernfs_root { - struct kernfs_node *kn; - unsigned int flags; - struct idr ino_idr; - u32 last_id_lowbits; - u32 id_highbits; - struct kernfs_syscall_ops *syscall_ops; - struct list_head supers; - wait_queue_head_t deactivate_waitq; +struct blocking_notifier_head { + struct rw_semaphore rwsem; + struct notifier_block *head; }; -struct kernfs_elem_symlink { - struct kernfs_node *target_kn; +struct arch_uprobe_task { + long unsigned int saved_scratch_register; + unsigned int saved_trap_nr; + unsigned int saved_tf; }; -struct kernfs_ops; - -struct kernfs_open_node; - -struct kernfs_elem_attr { - const struct kernfs_ops *ops; - struct kernfs_open_node *open; - loff_t size; - struct kernfs_node *notify_next; +enum uprobe_task_state { + UTASK_RUNNING = 0, + UTASK_SSTEP = 1, + UTASK_SSTEP_ACK = 2, + UTASK_SSTEP_TRAPPED = 3, }; -struct kernfs_iattrs; +struct uprobe; -struct kernfs_node { - atomic_t count; - atomic_t active; - struct kernfs_node *parent; - const char *name; - struct rb_node rb; - const void *ns; - unsigned int hash; +struct return_instance; + +struct uprobe_task { + enum uprobe_task_state state; union { - struct kernfs_elem_dir dir; - struct kernfs_elem_symlink symlink; - struct kernfs_elem_attr attr; + struct { + struct arch_uprobe_task autask; + long unsigned int vaddr; + }; + struct { + struct callback_head dup_xol_work; + long unsigned int dup_xol_addr; + }; }; - void *priv; - u64 id; - short unsigned int flags; - umode_t mode; - struct kernfs_iattrs *iattr; + struct uprobe *active_uprobe; + long unsigned int xol_vaddr; + struct return_instance *return_instances; + unsigned int depth; }; -struct kernfs_open_file; - -struct kernfs_ops { - int (*open)(struct kernfs_open_file *); - void (*release)(struct kernfs_open_file *); - int (*seq_show)(struct seq_file *, void *); - void * (*seq_start)(struct seq_file *, loff_t *); - void * (*seq_next)(struct seq_file *, void *, loff_t *); - void (*seq_stop)(struct seq_file *, void *); - ssize_t (*read)(struct kernfs_open_file *, char *, size_t, loff_t); - size_t atomic_write_len; - bool prealloc; - ssize_t (*write)(struct kernfs_open_file *, char *, size_t, loff_t); - __poll_t (*poll)(struct kernfs_open_file *, struct poll_table_struct *); - int (*mmap)(struct kernfs_open_file *, struct vm_area_struct *); +struct return_instance { + struct uprobe *uprobe; + long unsigned int func; + long unsigned int stack; + long unsigned int orig_ret_vaddr; + bool chained; + struct return_instance *next; }; -struct kernfs_syscall_ops { - int (*show_options)(struct seq_file *, struct kernfs_root *); - int (*mkdir)(struct kernfs_node *, const char *, umode_t); - int (*rmdir)(struct kernfs_node *); - int (*rename)(struct kernfs_node *, struct kernfs_node *, const char *); - int (*show_path)(struct seq_file *, struct kernfs_node *, struct kernfs_root *); +struct xarray { + spinlock_t xa_lock; + gfp_t xa_flags; + void *xa_head; }; -struct seq_operations; +typedef u32 errseq_t; -struct seq_file { - char *buf; - size_t size; - size_t from; - size_t count; - size_t pad_until; - loff_t index; - loff_t read_pos; - u64 version; - struct mutex lock; - const struct seq_operations *op; - int poll_event; - const struct file *file; - void *private; -}; +struct address_space_operations; -struct kernfs_open_file { - struct kernfs_node *kn; - struct file *file; - struct seq_file *seq_file; - void *priv; - struct mutex mutex; - struct mutex prealloc_mutex; - int event; - struct list_head list; - char *prealloc_buf; - size_t atomic_write_len; - bool mmapped: 1; - bool released: 1; - const struct vm_operations_struct *vm_ops; +struct address_space { + struct inode *host; + struct xarray i_pages; + gfp_t gfp_mask; + atomic_t i_mmap_writable; + struct rb_root_cached i_mmap; + struct rw_semaphore i_mmap_rwsem; + long unsigned int nrpages; + long unsigned int nrexceptional; + long unsigned int writeback_index; + const struct address_space_operations *a_ops; + long unsigned int flags; + errseq_t wb_err; + spinlock_t private_lock; + struct list_head private_list; + void *private_data; }; -typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_table_struct *); - -struct poll_table_struct { - poll_queue_proc _qproc; - __poll_t _key; +struct vmem_altmap { + const long unsigned int base_pfn; + const long unsigned int end_pfn; + const long unsigned int reserve; + long unsigned int free; + long unsigned int align; + long unsigned int alloc; }; -enum kobj_ns_type { - KOBJ_NS_TYPE_NONE = 0, - KOBJ_NS_TYPE_NET = 1, - KOBJ_NS_TYPES = 2, +struct resource { + resource_size_t start; + resource_size_t end; + const char *name; + long unsigned int flags; + long unsigned int desc; + struct resource *parent; + struct resource *sibling; + struct resource *child; }; -struct sock; +struct percpu_ref; -struct kobj_ns_type_operations { - enum kobj_ns_type type; - bool (*current_may_mount)(); - void * (*grab_current_ns)(); - const void * (*netlink_ns)(struct sock *); - const void * (*initial_ns)(); - void (*drop_ns)(void *); +typedef void percpu_ref_func_t(struct percpu_ref *); + +struct percpu_ref { + atomic_long_t count; + long unsigned int percpu_count_ptr; + percpu_ref_func_t *release; + percpu_ref_func_t *confirm_switch; + bool force_atomic: 1; + bool allow_reinit: 1; + struct callback_head rcu; }; -struct attribute { - const char *name; - umode_t mode; +enum memory_type { + MEMORY_DEVICE_PRIVATE = 1, + MEMORY_DEVICE_FS_DAX = 2, + MEMORY_DEVICE_DEVDAX = 3, + MEMORY_DEVICE_PCI_P2PDMA = 4, }; -struct bin_attribute; +struct dev_pagemap_ops; -struct attribute_group { - const char *name; - umode_t (*is_visible)(struct kobject *, struct attribute *, int); - umode_t (*is_bin_visible)(struct kobject *, struct bin_attribute *, int); - struct attribute **attrs; - struct bin_attribute **bin_attrs; +struct dev_pagemap { + struct vmem_altmap altmap; + struct resource res; + struct percpu_ref *ref; + struct percpu_ref internal_ref; + struct completion done; + enum memory_type type; + unsigned int flags; + const struct dev_pagemap_ops *ops; }; -struct bin_attribute { - struct attribute attr; - size_t size; - void *private; - ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t, size_t); - ssize_t (*write)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t, size_t); - int (*mmap)(struct file *, struct kobject *, struct bin_attribute *, struct vm_area_struct *); -}; +struct vfsmount; -struct sysfs_ops { - ssize_t (*show)(struct kobject *, struct attribute *, char *); - ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); +struct path { + struct vfsmount *mnt; + struct dentry *dentry; }; -struct kset_uevent_ops; +enum rw_hint { + WRITE_LIFE_NOT_SET = 0, + WRITE_LIFE_NONE = 1, + WRITE_LIFE_SHORT = 2, + WRITE_LIFE_MEDIUM = 3, + WRITE_LIFE_LONG = 4, + WRITE_LIFE_EXTREME = 5, +}; -struct kset { - struct list_head list; - spinlock_t list_lock; - struct kobject kobj; - const struct kset_uevent_ops *uevent_ops; +enum pid_type { + PIDTYPE_PID = 0, + PIDTYPE_TGID = 1, + PIDTYPE_PGID = 2, + PIDTYPE_SID = 3, + PIDTYPE_MAX = 4, }; -struct kobj_type { - void (*release)(struct kobject *); - const struct sysfs_ops *sysfs_ops; - struct attribute **default_attrs; - const struct attribute_group **default_groups; - const struct kobj_ns_type_operations * (*child_ns_type)(struct kobject *); - const void * (*namespace)(struct kobject *); - void (*get_ownership)(struct kobject *, kuid_t *, kgid_t *); +struct fown_struct { + rwlock_t lock; + struct pid *pid; + enum pid_type pid_type; + kuid_t uid; + kuid_t euid; + int signum; }; -struct kobj_uevent_env { - char *argv[3]; - char *envp[32]; - int envp_idx; - char buf[2048]; - int buflen; +struct file_ra_state { + long unsigned int start; + unsigned int size; + unsigned int async_size; + unsigned int ra_pages; + unsigned int mmap_miss; + loff_t prev_pos; }; -struct kset_uevent_ops { - int (* const filter)(struct kset *, struct kobject *); - const char * (* const name)(struct kset *, struct kobject *); - int (* const uevent)(struct kset *, struct kobject *, struct kobj_uevent_env *); +struct file { + union { + struct llist_node fu_llist; + struct callback_head fu_rcuhead; + } f_u; + struct path f_path; + struct inode *f_inode; + const struct file_operations *f_op; + spinlock_t f_lock; + enum rw_hint f_write_hint; + atomic_long_t f_count; + unsigned int f_flags; + fmode_t f_mode; + struct mutex f_pos_lock; + loff_t f_pos; + struct fown_struct f_owner; + const struct cred *f_cred; + struct file_ra_state f_ra; + u64 f_version; + void *f_security; + void *private_data; + struct list_head f_ep_links; + struct list_head f_tfile_llink; + struct address_space *f_mapping; + errseq_t f_wb_err; }; -struct kernel_param; +typedef unsigned int vm_fault_t; -struct kernel_param_ops { - unsigned int flags; - int (*set)(const char *, const struct kernel_param *); - int (*get)(char *, const struct kernel_param *); - void (*free)(void *); +enum page_entry_size { + PE_SIZE_PTE = 0, + PE_SIZE_PMD = 1, + PE_SIZE_PUD = 2, }; -struct kparam_string; - -struct kparam_array; +struct vm_fault; -struct kernel_param { - const char *name; - struct module *mod; - const struct kernel_param_ops *ops; - const u16 perm; - s8 level; - u8 flags; - union { - void *arg; - const struct kparam_string *str; - const struct kparam_array *arr; - }; +struct vm_operations_struct { + void (*open)(struct vm_area_struct *); + void (*close)(struct vm_area_struct *); + int (*split)(struct vm_area_struct *, long unsigned int); + int (*mremap)(struct vm_area_struct *); + vm_fault_t (*fault)(struct vm_fault *); + vm_fault_t (*huge_fault)(struct vm_fault *, enum page_entry_size); + void (*map_pages)(struct vm_fault *, long unsigned int, long unsigned int); + long unsigned int (*pagesize)(struct vm_area_struct *); + vm_fault_t (*page_mkwrite)(struct vm_fault *); + vm_fault_t (*pfn_mkwrite)(struct vm_fault *); + int (*access)(struct vm_area_struct *, long unsigned int, void *, int, int); + const char * (*name)(struct vm_area_struct *); + int (*set_policy)(struct vm_area_struct *, struct mempolicy *); + struct mempolicy * (*get_policy)(struct vm_area_struct *, long unsigned int); + struct page * (*find_special_page)(struct vm_area_struct *, long unsigned int); }; -struct kparam_string { - unsigned int maxlen; - char *string; +struct core_thread { + struct task_struct *task; + struct core_thread *next; }; -struct kparam_array { - unsigned int max; - unsigned int elemsize; - unsigned int *num; - const struct kernel_param_ops *ops; - void *elem; +struct core_state { + atomic_t nr_threads; + struct core_thread dumper; + struct completion startup; }; -enum module_state { - MODULE_STATE_LIVE = 0, - MODULE_STATE_COMING = 1, - MODULE_STATE_GOING = 2, - MODULE_STATE_UNFORMED = 3, +struct mem_cgroup; + +struct vm_fault { + struct vm_area_struct *vma; + unsigned int flags; + gfp_t gfp_mask; + long unsigned int pgoff; + long unsigned int address; + pmd_t *pmd; + pud_t *pud; + pte_t orig_pte; + struct page *cow_page; + struct mem_cgroup *memcg; + struct page *page; + pte_t *pte; + spinlock_t *ptl; + pgtable_t prealloc_pte; }; -struct module_param_attrs; +typedef struct { + u16 __softirq_pending; + unsigned int __nmi_count; + unsigned int apic_timer_irqs; + unsigned int irq_spurious_count; + unsigned int icr_read_retry_count; + unsigned int kvm_posted_intr_ipis; + unsigned int kvm_posted_intr_wakeup_ipis; + unsigned int kvm_posted_intr_nested_ipis; + unsigned int x86_platform_ipis; + unsigned int apic_perf_irqs; + unsigned int apic_irq_work_irqs; + unsigned int irq_resched_count; + unsigned int irq_call_count; + unsigned int irq_tlb_count; + unsigned int irq_thermal_count; + unsigned int irq_threshold_count; + unsigned int irq_deferred_error_count; + long: 32; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; +} irq_cpustat_t; -struct module_kobject { - struct kobject kobj; - struct module *mod; - struct kobject *drivers_dir; - struct module_param_attrs *mp; - struct completion *kobj_completion; +enum apic_intr_mode_id { + APIC_PIC = 0, + APIC_VIRTUAL_WIRE = 1, + APIC_VIRTUAL_WIRE_NO_CONFIG = 2, + APIC_SYMMETRIC_IO = 3, + APIC_SYMMETRIC_IO_NO_ROUTING = 4, }; -struct latch_tree_node { - struct rb_node node[2]; +struct apic { + void (*eoi_write)(u32, u32); + void (*native_eoi_write)(u32, u32); + void (*write)(u32, u32); + u32 (*read)(u32); + void (*wait_icr_idle)(); + u32 (*safe_wait_icr_idle)(); + void (*send_IPI)(int, int); + void (*send_IPI_mask)(const struct cpumask *, int); + void (*send_IPI_mask_allbutself)(const struct cpumask *, int); + void (*send_IPI_allbutself)(int); + void (*send_IPI_all)(int); + void (*send_IPI_self)(int); + u32 dest_logical; + u32 disable_esr; + u32 irq_delivery_mode; + u32 irq_dest_mode; + u32 (*calc_dest_apicid)(unsigned int); + u64 (*icr_read)(); + void (*icr_write)(u32, u32); + int (*probe)(); + int (*acpi_madt_oem_check)(char *, char *); + int (*apic_id_valid)(u32); + int (*apic_id_registered)(); + bool (*check_apicid_used)(physid_mask_t *, int); + void (*init_apic_ldr)(); + void (*ioapic_phys_id_map)(physid_mask_t *, physid_mask_t *); + void (*setup_apic_routing)(); + int (*cpu_present_to_apicid)(int); + void (*apicid_to_cpu_present)(int, physid_mask_t *); + int (*check_phys_apicid_present)(int); + int (*phys_pkg_id)(int, int); + u32 (*get_apic_id)(long unsigned int); + u32 (*set_apic_id)(unsigned int); + int (*wakeup_secondary_cpu)(int, long unsigned int); + void (*inquire_remote_apic)(int); + char *name; }; -struct mod_tree_node { - struct module *mod; - struct latch_tree_node node; +struct smp_ops { + void (*smp_prepare_boot_cpu)(); + void (*smp_prepare_cpus)(unsigned int); + void (*smp_cpus_done)(unsigned int); + void (*stop_other_cpus)(int); + void (*crash_stop_other_cpus)(); + void (*smp_send_reschedule)(int); + int (*cpu_up)(unsigned int, struct task_struct *); + int (*cpu_disable)(); + void (*cpu_die)(unsigned int); + void (*play_dead)(); + void (*send_call_func_ipi)(const struct cpumask *); + void (*send_call_func_single_ipi)(int); }; -struct module_layout { - void *base; - unsigned int size; - unsigned int text_size; - unsigned int ro_size; - unsigned int ro_after_init_size; - struct mod_tree_node mtn; +enum pcpu_fc { + PCPU_FC_AUTO = 0, + PCPU_FC_EMBED = 1, + PCPU_FC_PAGE = 2, + PCPU_FC_NR = 3, }; -struct mod_arch_specific { - unsigned int num_orcs; - int *orc_unwind_ip; - struct orc_entry *orc_unwind; +struct free_area { + struct list_head free_list[4]; + long unsigned int nr_free; }; -struct mod_kallsyms { - Elf64_Sym *symtab; - unsigned int num_symtab; - char *strtab; - char *typetab; +struct zone_padding { + char x[0]; }; -struct module_attribute; - -struct exception_table_entry; - -struct module_sect_attrs; - -struct module_notes_attrs; - -struct trace_eval_map; - -struct error_injection_entry; - -struct module { - enum module_state state; - struct list_head list; - char name[56]; - struct module_kobject mkobj; - struct module_attribute *modinfo_attrs; - const char *version; - const char *srcversion; - struct kobject *holders_dir; - const struct kernel_symbol *syms; - const s32 *crcs; - unsigned int num_syms; - struct mutex param_lock; - struct kernel_param *kp; - unsigned int num_kp; - unsigned int num_gpl_syms; - const struct kernel_symbol *gpl_syms; - const s32 *gpl_crcs; - bool async_probe_requested; - const struct kernel_symbol *gpl_future_syms; - const s32 *gpl_future_crcs; - unsigned int num_gpl_future_syms; - unsigned int num_exentries; - struct exception_table_entry *extable; - int (*init)(); - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - struct module_layout core_layout; - struct module_layout init_layout; - struct mod_arch_specific arch; - long unsigned int taints; - unsigned int num_bugs; - struct list_head bug_list; - struct bug_entry *bug_table; - struct mod_kallsyms *kallsyms; - struct mod_kallsyms core_kallsyms; - struct module_sect_attrs *sect_attrs; - struct module_notes_attrs *notes_attrs; - char *args; - void *percpu; - unsigned int percpu_size; - unsigned int num_tracepoints; - tracepoint_ptr_t *tracepoints_ptrs; - unsigned int num_srcu_structs; - struct srcu_struct **srcu_struct_ptrs; - struct jump_entry *jump_entries; - unsigned int num_jump_entries; - unsigned int num_trace_bprintk_fmt; - const char **trace_bprintk_fmt_start; - struct trace_event_call **trace_events; - unsigned int num_trace_events; - struct trace_eval_map **trace_evals; - unsigned int num_trace_evals; - struct list_head source_list; - struct list_head target_list; - void (*exit)(); - atomic_t refcnt; - struct error_injection_entry *ei_funcs; - unsigned int num_ei_funcs; +enum numa_stat_item { + NUMA_HIT = 0, + NUMA_MISS = 1, + NUMA_FOREIGN = 2, + NUMA_INTERLEAVE_HIT = 3, + NUMA_LOCAL = 4, + NUMA_OTHER = 5, + NR_VM_NUMA_STAT_ITEMS = 6, }; -struct error_injection_entry { - long unsigned int addr; - int etype; +enum zone_stat_item { + NR_FREE_PAGES = 0, + NR_ZONE_LRU_BASE = 1, + NR_ZONE_INACTIVE_ANON = 1, + NR_ZONE_ACTIVE_ANON = 2, + NR_ZONE_INACTIVE_FILE = 3, + NR_ZONE_ACTIVE_FILE = 4, + NR_ZONE_UNEVICTABLE = 5, + NR_ZONE_WRITE_PENDING = 6, + NR_MLOCK = 7, + NR_PAGETABLE = 8, + NR_KERNEL_STACK_KB = 9, + NR_BOUNCE = 10, + NR_FREE_CMA_PAGES = 11, + NR_VM_ZONE_STAT_ITEMS = 12, }; -struct module_attribute { - struct attribute attr; - ssize_t (*show)(struct module_attribute *, struct module_kobject *, char *); - ssize_t (*store)(struct module_attribute *, struct module_kobject *, const char *, size_t); - void (*setup)(struct module *, const char *); - int (*test)(struct module *); - void (*free)(struct module *); +enum node_stat_item { + NR_LRU_BASE = 0, + NR_INACTIVE_ANON = 0, + NR_ACTIVE_ANON = 1, + NR_INACTIVE_FILE = 2, + NR_ACTIVE_FILE = 3, + NR_UNEVICTABLE = 4, + NR_SLAB_RECLAIMABLE = 5, + NR_SLAB_UNRECLAIMABLE = 6, + NR_ISOLATED_ANON = 7, + NR_ISOLATED_FILE = 8, + WORKINGSET_NODES = 9, + WORKINGSET_REFAULT = 10, + WORKINGSET_ACTIVATE = 11, + WORKINGSET_RESTORE = 12, + WORKINGSET_NODERECLAIM = 13, + NR_ANON_MAPPED = 14, + NR_FILE_MAPPED = 15, + NR_FILE_PAGES = 16, + NR_FILE_DIRTY = 17, + NR_WRITEBACK = 18, + NR_WRITEBACK_TEMP = 19, + NR_SHMEM = 20, + NR_SHMEM_THPS = 21, + NR_SHMEM_PMDMAPPED = 22, + NR_FILE_THPS = 23, + NR_FILE_PMDMAPPED = 24, + NR_ANON_THPS = 25, + NR_UNSTABLE_NFS = 26, + NR_VMSCAN_WRITE = 27, + NR_VMSCAN_IMMEDIATE = 28, + NR_DIRTIED = 29, + NR_WRITTEN = 30, + NR_KERNEL_MISC_RECLAIMABLE = 31, + NR_VM_NODE_STAT_ITEMS = 32, }; -struct exception_table_entry { - int insn; - int fixup; - int handler; +struct zone_reclaim_stat { + long unsigned int recent_rotated[2]; + long unsigned int recent_scanned[2]; }; -struct trace_event_functions; - -struct trace_event { - struct hlist_node node; - struct list_head list; - int type; - struct trace_event_functions *funcs; +struct lruvec { + struct list_head lists[5]; + struct zone_reclaim_stat reclaim_stat; + atomic_long_t inactive_age; + long unsigned int refaults; + long unsigned int flags; }; -struct trace_event_class; - -struct bpf_prog_array; - -struct trace_event_call { - struct list_head list; - struct trace_event_class *class; - union { - char *name; - struct tracepoint *tp; - }; - struct trace_event event; - char *print_fmt; - struct event_filter *filter; - void *mod; - void *data; - int flags; - int perf_refcount; - struct hlist_head *perf_events; - struct bpf_prog_array *prog_array; - int (*perf_perm)(struct trace_event_call *, struct perf_event *); -}; +typedef unsigned int isolate_mode_t; -struct trace_eval_map { - const char *system; - const char *eval_string; - long unsigned int eval_value; +struct per_cpu_pages { + int count; + int high; + int batch; + struct list_head lists[3]; }; -struct fs_pin; - -struct pid_namespace { - struct kref kref; - struct idr idr; - struct callback_head rcu; - unsigned int pid_allocated; - struct task_struct *child_reaper; - struct kmem_cache *pid_cachep; - unsigned int level; - struct pid_namespace *parent; - struct vfsmount *proc_mnt; - struct dentry *proc_self; - struct dentry *proc_thread_self; - struct fs_pin *bacct; - struct user_namespace *user_ns; - struct ucounts *ucounts; - struct work_struct proc_work; - kgid_t pid_gid; - int hide_pid; - int reboot; - struct ns_common ns; +struct per_cpu_pageset { + struct per_cpu_pages pcp; + s8 expire; + u16 vm_numa_stat_diff[6]; + s8 stat_threshold; + s8 vm_stat_diff[12]; }; -struct rlimit { - __kernel_ulong_t rlim_cur; - __kernel_ulong_t rlim_max; +struct per_cpu_nodestat { + s8 stat_threshold; + s8 vm_node_stat_diff[32]; }; -struct task_cputime { - u64 stime; - u64 utime; - long long unsigned int sum_exec_runtime; +enum zone_type { + ZONE_DMA = 0, + ZONE_DMA32 = 1, + ZONE_NORMAL = 2, + ZONE_MOVABLE = 3, + __MAX_NR_ZONES = 4, }; -typedef void __signalfn_t(int); - -typedef __signalfn_t *__sighandler_t; - -typedef void __restorefn_t(); - -typedef __restorefn_t *__sigrestore_t; +struct pglist_data; -struct ratelimit_state { - raw_spinlock_t lock; - int interval; - int burst; - int printed; - int missed; - long unsigned int begin; +struct zone { + long unsigned int _watermark[3]; + long unsigned int watermark_boost; + long unsigned int nr_reserved_highatomic; + long int lowmem_reserve[4]; + int node; + struct pglist_data *zone_pgdat; + struct per_cpu_pageset *pageset; + long unsigned int zone_start_pfn; + atomic_long_t managed_pages; + long unsigned int spanned_pages; + long unsigned int present_pages; + const char *name; + int initialized; + long: 32; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + struct zone_padding _pad1_; + struct free_area free_area[11]; long unsigned int flags; + spinlock_t lock; + long: 32; + long: 64; + long: 64; + long: 64; + struct zone_padding _pad2_; + long unsigned int percpu_drift_mark; + long unsigned int compact_cached_free_pfn; + long unsigned int compact_cached_migrate_pfn[2]; + long unsigned int compact_init_migrate_pfn; + long unsigned int compact_init_free_pfn; + unsigned int compact_considered; + unsigned int compact_defer_shift; + int compact_order_failed; + bool compact_blockskip_flush; + bool contiguous; + short: 16; + struct zone_padding _pad3_; + atomic_long_t vm_stat[12]; + atomic_long_t vm_numa_stat[6]; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct user_struct { - refcount_t __count; - atomic_t processes; - atomic_t sigpending; - atomic_long_t epoll_watches; - long unsigned int mq_bytes; - long unsigned int locked_shm; - long unsigned int unix_inflight; - atomic_long_t pipe_bufs; - struct hlist_node uidhash_node; - kuid_t uid; - atomic_long_t locked_vm; - struct ratelimit_state ratelimit; +struct zoneref { + struct zone *zone; + int zone_idx; }; -struct sigaction { - __sighandler_t sa_handler; - long unsigned int sa_flags; - __sigrestore_t sa_restorer; - sigset_t sa_mask; +struct zonelist { + struct zoneref _zonerefs[257]; }; -struct k_sigaction { - struct sigaction sa; +struct pglist_data { + struct zone node_zones[4]; + struct zonelist node_zonelists[2]; + int nr_zones; + long unsigned int node_start_pfn; + long unsigned int node_present_pages; + long unsigned int node_spanned_pages; + int node_id; + wait_queue_head_t kswapd_wait; + wait_queue_head_t pfmemalloc_wait; + struct task_struct *kswapd; + int kswapd_order; + enum zone_type kswapd_classzone_idx; + int kswapd_failures; + int kcompactd_max_order; + enum zone_type kcompactd_classzone_idx; + wait_queue_head_t kcompactd_wait; + struct task_struct *kcompactd; + long unsigned int totalreserve_pages; + long unsigned int min_unmapped_pages; + long unsigned int min_slab_pages; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + struct zone_padding _pad1_; + spinlock_t lru_lock; + struct lruvec __lruvec; + long unsigned int flags; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + struct zone_padding _pad2_; + struct per_cpu_nodestat *per_cpu_nodestats; + atomic_long_t vm_stat[32]; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct cpu_itimer { - u64 expires; - u64 incr; +struct mem_section_usage { + long unsigned int subsection_map[1]; + long unsigned int pageblock_flags[0]; }; -struct task_cputime_atomic { - atomic64_t utime; - atomic64_t stime; - atomic64_t sum_exec_runtime; +struct mem_section { + long unsigned int section_mem_map; + struct mem_section_usage *usage; }; -struct thread_group_cputimer { - struct task_cputime_atomic cputime_atomic; +struct shrink_control { + gfp_t gfp_mask; + int nid; + long unsigned int nr_to_scan; + long unsigned int nr_scanned; + struct mem_cgroup *memcg; }; -struct pacct_struct { - int ac_flag; - long int ac_exitcode; - long unsigned int ac_mem; - u64 ac_utime; - u64 ac_stime; - long unsigned int ac_minflt; - long unsigned int ac_majflt; +struct shrinker { + long unsigned int (*count_objects)(struct shrinker *, struct shrink_control *); + long unsigned int (*scan_objects)(struct shrinker *, struct shrink_control *); + long int batch; + int seeks; + unsigned int flags; + struct list_head list; + atomic_long_t *nr_deferred; }; -struct tty_struct; - -struct taskstats; +struct dev_pagemap_ops { + void (*page_free)(struct page *); + void (*kill)(struct dev_pagemap *); + void (*cleanup)(struct dev_pagemap *); + vm_fault_t (*migrate_to_ram)(struct vm_fault *); +}; -struct tty_audit_buf; +struct pid_namespace; -struct signal_struct { - refcount_t sigcnt; - atomic_t live; - int nr_threads; - struct list_head thread_head; - wait_queue_head_t wait_chldexit; - struct task_struct *curr_target; - struct sigpending shared_pending; - struct hlist_head multiprocess; - int group_exit_code; - int notify_count; - struct task_struct *group_exit_task; - int group_stop_count; - unsigned int flags; - unsigned int is_child_subreaper: 1; - unsigned int has_child_subreaper: 1; - int posix_timer_id; - struct list_head posix_timers; - struct hrtimer real_timer; - ktime_t it_real_incr; - struct cpu_itimer it[2]; - struct thread_group_cputimer cputimer; - struct posix_cputimers posix_cputimers; - struct pid *pids[4]; - struct pid *tty_old_pgrp; - int leader; - struct tty_struct *tty; - seqlock_t stats_lock; - u64 utime; - u64 stime; - u64 cutime; - u64 cstime; - u64 gtime; - u64 cgtime; - struct prev_cputime prev_cputime; - long unsigned int nvcsw; - long unsigned int nivcsw; - long unsigned int cnvcsw; - long unsigned int cnivcsw; - long unsigned int min_flt; - long unsigned int maj_flt; - long unsigned int cmin_flt; - long unsigned int cmaj_flt; - long unsigned int inblock; - long unsigned int oublock; - long unsigned int cinblock; - long unsigned int coublock; - long unsigned int maxrss; - long unsigned int cmaxrss; - struct task_io_accounting ioac; - long long unsigned int sum_sched_runtime; - struct rlimit rlim[16]; - struct pacct_struct pacct; - struct taskstats *stats; - unsigned int audit_tty; - struct tty_audit_buf *tty_audit_buf; - bool oom_flag_origin; - short int oom_score_adj; - short int oom_score_adj_min; - struct mm_struct *oom_mm; - struct mutex cred_guard_mutex; +struct upid { + int nr; + struct pid_namespace *ns; }; -typedef int32_t key_serial_t; +struct pid { + refcount_t count; + unsigned int level; + struct hlist_head tasks[4]; + wait_queue_head_t wait_pidfd; + struct callback_head rcu; + struct upid numbers[1]; +}; -typedef uint32_t key_perm_t; +typedef struct { + gid_t val; +} kgid_t; -struct key_type; +struct hrtimer_cpu_base; -struct key_tag; +struct hrtimer_clock_base { + struct hrtimer_cpu_base *cpu_base; + unsigned int index; + clockid_t clockid; + seqcount_t seq; + struct hrtimer *running; + struct timerqueue_head active; + ktime_t (*get_time)(); + ktime_t offset; +}; -struct keyring_index_key { - long unsigned int hash; - union { - struct { - u16 desc_len; - char desc[6]; - }; - long unsigned int x; +struct hrtimer_cpu_base { + raw_spinlock_t lock; + unsigned int cpu; + unsigned int active_bases; + unsigned int clock_was_set_seq; + unsigned int hres_active: 1; + unsigned int in_hrtirq: 1; + unsigned int hang_detected: 1; + unsigned int softirq_activated: 1; + unsigned int nr_events; + short unsigned int nr_retries; + short unsigned int nr_hangs; + unsigned int max_hang_time; + ktime_t expires_next; + struct hrtimer *next_timer; + ktime_t softirq_expires_next; + struct hrtimer *softirq_next_timer; + struct hrtimer_clock_base clock_base[8]; +}; + +struct tick_device; + +union sigval { + int sival_int; + void *sival_ptr; +}; + +typedef union sigval sigval_t; + +union __sifields { + struct { + __kernel_pid_t _pid; + __kernel_uid32_t _uid; + } _kill; + struct { + __kernel_timer_t _tid; + int _overrun; + sigval_t _sigval; + int _sys_private; + } _timer; + struct { + __kernel_pid_t _pid; + __kernel_uid32_t _uid; + sigval_t _sigval; + } _rt; + struct { + __kernel_pid_t _pid; + __kernel_uid32_t _uid; + int _status; + __kernel_clock_t _utime; + __kernel_clock_t _stime; + } _sigchld; + struct { + void *_addr; + union { + short int _addr_lsb; + struct { + char _dummy_bnd[8]; + void *_lower; + void *_upper; + } _addr_bnd; + struct { + char _dummy_pkey[8]; + __u32 _pkey; + } _addr_pkey; + }; + } _sigfault; + struct { + long int _band; + int _fd; + } _sigpoll; + struct { + void *_call_addr; + int _syscall; + unsigned int _arch; + } _sigsys; +}; + +struct kernel_siginfo { + struct { + int si_signo; + int si_errno; + int si_code; + union __sifields _sifields; }; - struct key_type *type; - struct key_tag *domain_tag; - const char *description; }; -union key_payload { - void *rcu_data0; - void *data[4]; +struct rseq { + __u32 cpu_id_start; + __u32 cpu_id; + union { + __u64 ptr64; + __u64 ptr; + } rseq_cs; + __u32 flags; + long: 32; + long: 64; }; -struct assoc_array_ptr; +struct root_domain; -struct assoc_array { - struct assoc_array_ptr *root; - long unsigned int nr_leaves_on_tree; +struct rq; + +struct rq_flags; + +struct sched_class { + const struct sched_class *next; + void (*enqueue_task)(struct rq *, struct task_struct *, int); + void (*dequeue_task)(struct rq *, struct task_struct *, int); + void (*yield_task)(struct rq *); + bool (*yield_to_task)(struct rq *, struct task_struct *, bool); + void (*check_preempt_curr)(struct rq *, struct task_struct *, int); + struct task_struct * (*pick_next_task)(struct rq *); + void (*put_prev_task)(struct rq *, struct task_struct *); + void (*set_next_task)(struct rq *, struct task_struct *, bool); + int (*balance)(struct rq *, struct task_struct *, struct rq_flags *); + int (*select_task_rq)(struct task_struct *, int, int, int); + void (*migrate_task_rq)(struct task_struct *, int); + void (*task_woken)(struct rq *, struct task_struct *); + void (*set_cpus_allowed)(struct task_struct *, const struct cpumask *); + void (*rq_online)(struct rq *); + void (*rq_offline)(struct rq *); + void (*task_tick)(struct rq *, struct task_struct *, int); + void (*task_fork)(struct task_struct *); + void (*task_dead)(struct task_struct *); + void (*switched_from)(struct rq *, struct task_struct *); + void (*switched_to)(struct rq *, struct task_struct *); + void (*prio_changed)(struct rq *, struct task_struct *, int); + unsigned int (*get_rr_interval)(struct rq *, struct task_struct *); + void (*update_curr)(struct rq *); + void (*task_change_group)(struct task_struct *, int); }; -struct key_user; +struct kernel_cap_struct { + __u32 cap[2]; +}; -struct key_restriction; +typedef struct kernel_cap_struct kernel_cap_t; -struct key { - refcount_t usage; - key_serial_t serial; - union { - struct list_head graveyard_link; - struct rb_node serial_node; - }; - struct rw_semaphore sem; - struct key_user *user; +struct user_struct; + +struct group_info; + +struct cred { + atomic_t usage; + kuid_t uid; + kgid_t gid; + kuid_t suid; + kgid_t sgid; + kuid_t euid; + kgid_t egid; + kuid_t fsuid; + kgid_t fsgid; + unsigned int securebits; + kernel_cap_t cap_inheritable; + kernel_cap_t cap_permitted; + kernel_cap_t cap_effective; + kernel_cap_t cap_bset; + kernel_cap_t cap_ambient; + unsigned char jit_keyring; + struct key *session_keyring; + struct key *process_keyring; + struct key *thread_keyring; + struct key *request_key_auth; void *security; + struct user_struct *user; + struct user_namespace *user_ns; + struct group_info *group_info; union { - time64_t expiry; - time64_t revoked_at; + int non_rcu; + struct callback_head rcu; }; - time64_t last_used_at; - kuid_t uid; - kgid_t gid; - key_perm_t perm; - short unsigned int quotalen; - short unsigned int datalen; - short int state; - long unsigned int flags; +}; + +struct io_cq; + +struct io_context { + atomic_long_t refcount; + atomic_t active_ref; + atomic_t nr_tasks; + spinlock_t lock; + short unsigned int ioprio; + int nr_batch_requests; + long unsigned int last_waited; + struct xarray icq_tree; + struct io_cq *icq_hint; + struct hlist_head icq_list; + struct work_struct release_work; +}; + +struct hlist_bl_node; + +struct hlist_bl_head { + struct hlist_bl_node *first; +}; + +struct hlist_bl_node { + struct hlist_bl_node *next; + struct hlist_bl_node **pprev; +}; + +struct lockref { union { - struct keyring_index_key index_key; + __u64 lock_count; struct { - long unsigned int hash; - long unsigned int len_desc; - struct key_type *type; - struct key_tag *domain_tag; - char *description; + spinlock_t lock; + int count; }; }; +}; + +struct qstr { union { - union key_payload payload; struct { - struct list_head name_link; - struct assoc_array keys; + u32 hash; + u32 len; }; + u64 hash_len; }; - struct key_restriction *restrict_link; + const unsigned char *name; }; -struct uts_namespace; +struct dentry_stat_t { + long int nr_dentry; + long int nr_unused; + long int age_limit; + long int want_pages; + long int nr_negative; + long int dummy; +}; -struct ipc_namespace; +struct dentry_operations; -struct mnt_namespace; +struct dentry { + unsigned int d_flags; + seqcount_t d_seq; + struct hlist_bl_node d_hash; + struct dentry *d_parent; + struct qstr d_name; + struct inode *d_inode; + unsigned char d_iname[32]; + struct lockref d_lockref; + const struct dentry_operations *d_op; + struct super_block *d_sb; + long unsigned int d_time; + void *d_fsdata; + union { + struct list_head d_lru; + wait_queue_head_t *d_wait; + }; + struct list_head d_child; + struct list_head d_subdirs; + union { + struct hlist_node d_alias; + struct hlist_bl_node d_in_lookup_hash; + struct callback_head d_rcu; + } d_u; +}; -struct net; +struct posix_acl; -struct cgroup_namespace; +struct inode_operations; -struct nsproxy { - atomic_t count; - struct uts_namespace *uts_ns; - struct ipc_namespace *ipc_ns; - struct mnt_namespace *mnt_ns; - struct pid_namespace *pid_ns_for_children; - struct net *net_ns; - struct cgroup_namespace *cgroup_ns; +struct file_lock_context; + +struct block_device; + +struct cdev; + +struct fsnotify_mark_connector; + +struct inode { + umode_t i_mode; + short unsigned int i_opflags; + kuid_t i_uid; + kgid_t i_gid; + unsigned int i_flags; + struct posix_acl *i_acl; + struct posix_acl *i_default_acl; + const struct inode_operations *i_op; + struct super_block *i_sb; + struct address_space *i_mapping; + void *i_security; + long unsigned int i_ino; + union { + const unsigned int i_nlink; + unsigned int __i_nlink; + }; + dev_t i_rdev; + loff_t i_size; + struct timespec64 i_atime; + struct timespec64 i_mtime; + struct timespec64 i_ctime; + spinlock_t i_lock; + short unsigned int i_bytes; + u8 i_blkbits; + u8 i_write_hint; + blkcnt_t i_blocks; + long unsigned int i_state; + struct rw_semaphore i_rwsem; + long unsigned int dirtied_when; + long unsigned int dirtied_time_when; + struct hlist_node i_hash; + struct list_head i_io_list; + struct list_head i_lru; + struct list_head i_sb_list; + struct list_head i_wb_list; + union { + struct hlist_head i_dentry; + struct callback_head i_rcu; + }; + atomic64_t i_version; + atomic_t i_count; + atomic_t i_dio_count; + atomic_t i_writecount; + atomic_t i_readcount; + union { + const struct file_operations *i_fop; + void (*free_inode)(struct inode *); + }; + struct file_lock_context *i_flctx; + struct address_space i_data; + struct list_head i_devices; + union { + struct pipe_inode_info *i_pipe; + struct block_device *i_bdev; + struct cdev *i_cdev; + char *i_link; + unsigned int i_dir_seq; + }; + __u32 i_generation; + __u32 i_fsnotify_mask; + struct fsnotify_mark_connector *i_fsnotify_marks; + void *i_private; }; -struct sighand_struct { - spinlock_t siglock; - refcount_t count; - wait_queue_head_t signalfd_wqh; - struct k_sigaction action[64]; +struct dentry_operations { + int (*d_revalidate)(struct dentry *, unsigned int); + int (*d_weak_revalidate)(struct dentry *, unsigned int); + int (*d_hash)(const struct dentry *, struct qstr *); + int (*d_compare)(const struct dentry *, unsigned int, const char *, const struct qstr *); + int (*d_delete)(const struct dentry *); + int (*d_init)(struct dentry *); + void (*d_release)(struct dentry *); + void (*d_prune)(struct dentry *); + void (*d_iput)(struct dentry *, struct inode *); + char * (*d_dname)(struct dentry *, char *, int); + struct vfsmount * (*d_automount)(struct path *); + int (*d_manage)(const struct path *, bool); + struct dentry * (*d_real)(struct dentry *, const struct inode *); + long: 64; + long: 64; + long: 64; }; -struct bio; +struct mtd_info; -struct bio_list { - struct bio *head; - struct bio *tail; +typedef long long int qsize_t; + +struct quota_format_type; + +struct mem_dqinfo { + struct quota_format_type *dqi_format; + int dqi_fmt_id; + struct list_head dqi_dirty_list; + long unsigned int dqi_flags; + unsigned int dqi_bgrace; + unsigned int dqi_igrace; + qsize_t dqi_max_spc_limit; + qsize_t dqi_max_ino_limit; + void *dqi_priv; }; -struct blk_plug { - struct list_head mq_list; - struct list_head cb_list; - short unsigned int rq_count; - bool multiple_queues; +struct quota_format_ops; + +struct quota_info { + unsigned int flags; + struct rw_semaphore dqio_sem; + struct inode *files[3]; + struct mem_dqinfo info[3]; + const struct quota_format_ops *ops[3]; }; -struct reclaim_state { - long unsigned int reclaimed_slab; +struct rcu_sync { + int gp_state; + int gp_count; + wait_queue_head_t gp_wait; + struct callback_head cb_head; }; -typedef int congested_fn(void *, int); +struct rcuwait { + struct task_struct *task; +}; -struct fprop_local_percpu { - struct percpu_counter events; - unsigned int period; - raw_spinlock_t lock; +struct percpu_rw_semaphore { + struct rcu_sync rss; + unsigned int *read_count; + struct rw_semaphore rw_sem; + struct rcuwait writer; + int readers_block; }; -enum wb_reason { - WB_REASON_BACKGROUND = 0, - WB_REASON_VMSCAN = 1, - WB_REASON_SYNC = 2, - WB_REASON_PERIODIC = 3, - WB_REASON_LAPTOP_TIMER = 4, - WB_REASON_FREE_MORE_MEM = 5, - WB_REASON_FS_FREE_SPACE = 6, - WB_REASON_FORKER_THREAD = 7, - WB_REASON_FOREIGN_FLUSH = 8, - WB_REASON_MAX = 9, +struct sb_writers { + int frozen; + wait_queue_head_t wait_unfrozen; + struct percpu_rw_semaphore rw_sem[3]; }; -struct bdi_writeback_congested; +typedef struct { + __u8 b[16]; +} uuid_t; -struct bdi_writeback { - struct backing_dev_info *bdi; - long unsigned int state; - long unsigned int last_old_flush; - struct list_head b_dirty; - struct list_head b_io; - struct list_head b_more_io; - struct list_head b_dirty_time; - spinlock_t list_lock; - struct percpu_counter stat[4]; - struct bdi_writeback_congested *congested; - long unsigned int bw_time_stamp; - long unsigned int dirtied_stamp; - long unsigned int written_stamp; - long unsigned int write_bandwidth; - long unsigned int avg_write_bandwidth; - long unsigned int dirty_ratelimit; - long unsigned int balanced_dirty_ratelimit; - struct fprop_local_percpu completions; - int dirty_exceeded; - enum wb_reason start_all_reason; - spinlock_t work_lock; - struct list_head work_list; - struct delayed_work dwork; - long unsigned int dirty_sleep; - struct list_head bdi_node; -}; +struct list_lru_node; -struct backing_dev_info { - u64 id; - struct rb_node rb_node; - struct list_head bdi_list; - long unsigned int ra_pages; - long unsigned int io_pages; - congested_fn *congested_fn; - void *congested_data; - const char *name; - struct kref refcnt; - unsigned int capabilities; - unsigned int min_ratio; - unsigned int max_ratio; - unsigned int max_prop_frac; - atomic_long_t tot_write_bandwidth; - struct bdi_writeback wb; - struct list_head wb_list; - struct bdi_writeback_congested *wb_congested; - wait_queue_head_t wb_waitq; - struct device *dev; - struct device *owner; - struct timer_list laptop_mode_wb_timer; - struct dentry *debug_dir; +struct list_lru { + struct list_lru_node *node; }; -struct cgroup_subsys_state; +struct super_operations; -struct cgroup; +struct dquot_operations; -struct css_set { - struct cgroup_subsys_state *subsys[4]; - refcount_t refcount; - struct css_set *dom_cset; - struct cgroup *dfl_cgrp; - int nr_tasks; - struct list_head tasks; - struct list_head mg_tasks; - struct list_head dying_tasks; - struct list_head task_iters; - struct list_head e_cset_node[4]; - struct list_head threaded_csets; - struct list_head threaded_csets_node; - struct hlist_node hlist; - struct list_head cgrp_links; - struct list_head mg_preload_node; - struct list_head mg_node; - struct cgroup *mg_src_cgrp; - struct cgroup *mg_dst_cgrp; - struct css_set *mg_dst_cset; - bool dead; - struct callback_head callback_head; -}; - -struct perf_event_groups { - struct rb_root tree; - u64 index; -}; - -struct perf_event_context { - struct pmu *pmu; - raw_spinlock_t lock; - struct mutex mutex; - struct list_head active_ctx_list; - struct perf_event_groups pinned_groups; - struct perf_event_groups flexible_groups; - struct list_head event_list; - struct list_head pinned_active; - struct list_head flexible_active; - int nr_events; - int nr_active; - int is_active; - int nr_stat; - int nr_freq; - int rotate_disable; - int rotate_necessary; - refcount_t refcount; - struct task_struct *task; - u64 time; - u64 timestamp; - struct perf_event_context *parent_ctx; - u64 parent_gen; - u64 generation; - int pin_count; - void *task_ctx_data; - struct callback_head callback_head; -}; +struct quotactl_ops; -struct task_delay_info { - raw_spinlock_t lock; - unsigned int flags; - u64 blkio_start; - u64 blkio_delay; - u64 swapin_delay; - u32 blkio_count; - u32 swapin_count; - u64 freepages_start; - u64 freepages_delay; - u64 thrashing_start; - u64 thrashing_delay; - u32 freepages_count; - u32 thrashing_count; -}; +struct export_operations; -typedef unsigned int blk_qc_t; +struct xattr_handler; -typedef blk_qc_t make_request_fn(struct request_queue *, struct bio *); +struct workqueue_struct; -struct request; +struct super_block { + struct list_head s_list; + dev_t s_dev; + unsigned char s_blocksize_bits; + long unsigned int s_blocksize; + loff_t s_maxbytes; + struct file_system_type *s_type; + const struct super_operations *s_op; + const struct dquot_operations *dq_op; + const struct quotactl_ops *s_qcop; + const struct export_operations *s_export_op; + long unsigned int s_flags; + long unsigned int s_iflags; + long unsigned int s_magic; + struct dentry *s_root; + struct rw_semaphore s_umount; + int s_count; + atomic_t s_active; + void *s_security; + const struct xattr_handler **s_xattr; + struct hlist_bl_head s_roots; + struct list_head s_mounts; + struct block_device *s_bdev; + struct backing_dev_info *s_bdi; + struct mtd_info *s_mtd; + struct hlist_node s_instances; + unsigned int s_quota_types; + struct quota_info s_dquot; + struct sb_writers s_writers; + void *s_fs_info; + u32 s_time_gran; + time64_t s_time_min; + time64_t s_time_max; + __u32 s_fsnotify_mask; + struct fsnotify_mark_connector *s_fsnotify_marks; + char s_id[32]; + uuid_t s_uuid; + unsigned int s_max_links; + fmode_t s_mode; + struct mutex s_vfs_rename_mutex; + const char *s_subtype; + const struct dentry_operations *s_d_op; + int cleancache_poolid; + struct shrinker s_shrink; + atomic_long_t s_remove_count; + atomic_long_t s_fsnotify_inode_refs; + int s_readonly_remount; + struct workqueue_struct *s_dio_done_wq; + struct hlist_head s_pins; + struct user_namespace *s_user_ns; + struct list_lru s_dentry_lru; + struct list_lru s_inode_lru; + struct callback_head rcu; + struct work_struct destroy_work; + struct mutex s_sync_lock; + int s_stack_depth; + long: 32; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + spinlock_t s_inode_list_lock; + struct list_head s_inodes; + spinlock_t s_inode_wblist_lock; + struct list_head s_inodes_wb; + long: 64; + long: 64; +}; -typedef int dma_drain_needed_fn(struct request *); +struct kstat { + u32 result_mask; + umode_t mode; + unsigned int nlink; + uint32_t blksize; + u64 attributes; + u64 attributes_mask; + u64 ino; + dev_t dev; + dev_t rdev; + kuid_t uid; + kgid_t gid; + loff_t size; + struct timespec64 atime; + struct timespec64 mtime; + struct timespec64 ctime; + struct timespec64 btime; + u64 blocks; +}; -struct blk_rq_stat { - u64 mean; - u64 min; - u64 max; - u32 nr_samples; - u64 batch; +struct list_lru_one { + struct list_head list; + long int nr_items; }; -enum blk_zoned_model { - BLK_ZONED_NONE = 0, - BLK_ZONED_HA = 1, - BLK_ZONED_HM = 2, +struct list_lru_node { + spinlock_t lock; + struct list_lru_one lru; + long int nr_items; + long: 64; + long: 64; + long: 64; }; -struct queue_limits { - long unsigned int bounce_pfn; - long unsigned int seg_boundary_mask; - long unsigned int virt_boundary_mask; - unsigned int max_hw_sectors; - unsigned int max_dev_sectors; - unsigned int chunk_sectors; - unsigned int max_sectors; - unsigned int max_segment_size; - unsigned int physical_block_size; - unsigned int logical_block_size; - unsigned int alignment_offset; - unsigned int io_min; - unsigned int io_opt; - unsigned int max_discard_sectors; - unsigned int max_hw_discard_sectors; - unsigned int max_write_same_sectors; - unsigned int max_write_zeroes_sectors; - unsigned int discard_granularity; - unsigned int discard_alignment; - short unsigned int max_segments; - short unsigned int max_integrity_segments; - short unsigned int max_discard_segments; - unsigned char misaligned; - unsigned char discard_misaligned; - unsigned char raid_partial_stripes_expensive; - enum blk_zoned_model zoned; +struct fiemap_extent { + __u64 fe_logical; + __u64 fe_physical; + __u64 fe_length; + __u64 fe_reserved64[2]; + __u32 fe_flags; + __u32 fe_reserved[3]; }; -struct bsg_ops; +enum migrate_mode { + MIGRATE_ASYNC = 0, + MIGRATE_SYNC_LIGHT = 1, + MIGRATE_SYNC = 2, + MIGRATE_SYNC_NO_COPY = 3, +}; -struct bsg_class_device { - struct device *class_dev; - int minor; - struct request_queue *queue; - const struct bsg_ops *ops; +struct delayed_call { + void (*fn)(void *); + void *arg; }; -typedef void *mempool_alloc_t(gfp_t, void *); +typedef struct { + __u8 b[16]; +} guid_t; -typedef void mempool_free_t(void *, void *); +struct request_queue; -struct mempool_s { - spinlock_t lock; - int min_nr; - int curr_nr; - void **elements; - void *pool_data; - mempool_alloc_t *alloc; - mempool_free_t *free; - wait_queue_head_t wait; +struct io_cq { + struct request_queue *q; + struct io_context *ioc; + union { + struct list_head q_node; + struct kmem_cache *__rcu_icq_cache; + }; + union { + struct hlist_node ioc_node; + struct callback_head __rcu_head; + }; + unsigned int flags; }; -typedef struct mempool_s mempool_t; +struct files_stat_struct { + long unsigned int nr_files; + long unsigned int nr_free_files; + long unsigned int max_files; +}; -struct bio_set { - struct kmem_cache *bio_slab; - unsigned int front_pad; - mempool_t bio_pool; - mempool_t bvec_pool; - spinlock_t rescue_lock; - struct bio_list rescue_list; - struct work_struct rescue_work; - struct workqueue_struct *rescue_workqueue; +struct inodes_stat_t { + long int nr_inodes; + long int nr_unused; + long int dummy[5]; }; -struct elevator_queue; +struct kiocb { + struct file *ki_filp; + loff_t ki_pos; + void (*ki_complete)(struct kiocb *, long int, long int); + void *private; + int ki_flags; + u16 ki_hint; + u16 ki_ioprio; + unsigned int ki_cookie; +}; -struct blk_queue_stats; +struct iattr { + unsigned int ia_valid; + umode_t ia_mode; + kuid_t ia_uid; + kgid_t ia_gid; + loff_t ia_size; + struct timespec64 ia_atime; + struct timespec64 ia_mtime; + struct timespec64 ia_ctime; + struct file *ia_file; +}; -struct rq_qos; +struct percpu_counter { + raw_spinlock_t lock; + s64 count; + struct list_head list; + s32 *counters; +}; -struct blk_mq_ops; +typedef __kernel_uid32_t projid_t; -struct blk_mq_ctx; +typedef struct { + projid_t val; +} kprojid_t; -struct blk_mq_hw_ctx; +enum quota_type { + USRQUOTA = 0, + GRPQUOTA = 1, + PRJQUOTA = 2, +}; -struct blk_stat_callback; +struct kqid { + union { + kuid_t uid; + kgid_t gid; + kprojid_t projid; + }; + enum quota_type type; +}; -struct blk_trace; +struct mem_dqblk { + qsize_t dqb_bhardlimit; + qsize_t dqb_bsoftlimit; + qsize_t dqb_curspace; + qsize_t dqb_rsvspace; + qsize_t dqb_ihardlimit; + qsize_t dqb_isoftlimit; + qsize_t dqb_curinodes; + time64_t dqb_btime; + time64_t dqb_itime; +}; -struct blk_flush_queue; +struct dquot { + struct hlist_node dq_hash; + struct list_head dq_inuse; + struct list_head dq_free; + struct list_head dq_dirty; + struct mutex dq_lock; + spinlock_t dq_dqb_lock; + atomic_t dq_count; + struct super_block *dq_sb; + struct kqid dq_id; + loff_t dq_off; + long unsigned int dq_flags; + struct mem_dqblk dq_dqb; +}; -struct blk_mq_tag_set; +struct quota_format_type { + int qf_fmt_id; + const struct quota_format_ops *qf_ops; + struct module *qf_owner; + struct quota_format_type *qf_next; +}; -struct request_queue { - struct request *last_merge; - struct elevator_queue *elevator; - struct blk_queue_stats *stats; - struct rq_qos *rq_qos; - make_request_fn *make_request_fn; - dma_drain_needed_fn *dma_drain_needed; - const struct blk_mq_ops *mq_ops; - struct blk_mq_ctx *queue_ctx; - unsigned int queue_depth; - struct blk_mq_hw_ctx **queue_hw_ctx; - unsigned int nr_hw_queues; - struct backing_dev_info *backing_dev_info; - void *queuedata; - long unsigned int queue_flags; - atomic_t pm_only; - int id; - gfp_t bounce_gfp; - spinlock_t queue_lock; - struct kobject kobj; - struct kobject *mq_kobj; - struct device *dev; - int rpm_status; - unsigned int nr_pending; - long unsigned int nr_requests; - unsigned int dma_drain_size; - void *dma_drain_buffer; - unsigned int dma_pad_mask; - unsigned int dma_alignment; - unsigned int rq_timeout; - int poll_nsec; - struct blk_stat_callback *poll_cb; - struct blk_rq_stat poll_stat[16]; - struct timer_list timeout; - struct work_struct timeout_work; - struct list_head icq_list; - struct queue_limits limits; - unsigned int required_elevator_features; - unsigned int sg_timeout; - unsigned int sg_reserved_size; - int node; - struct blk_trace *blk_trace; - struct mutex blk_trace_mutex; - struct blk_flush_queue *fq; - struct list_head requeue_list; - spinlock_t requeue_lock; - struct delayed_work requeue_work; - struct mutex sysfs_lock; - struct mutex sysfs_dir_lock; - struct list_head unused_hctx_list; - spinlock_t unused_hctx_lock; - int mq_freeze_depth; - struct bsg_class_device bsg_dev; - struct callback_head callback_head; - wait_queue_head_t mq_freeze_wq; - struct mutex mq_freeze_lock; - struct percpu_ref q_usage_counter; - struct blk_mq_tag_set *tag_set; - struct list_head tag_set_list; - struct bio_set bio_split; - struct dentry *debugfs_dir; - struct dentry *sched_debugfs_dir; - struct dentry *rqos_debugfs_dir; - bool mq_sysfs_init_done; - size_t cmd_size; - struct work_struct release_work; - u64 write_hints[5]; +struct dqstats { + long unsigned int stat[8]; + struct percpu_counter counter[8]; }; -enum writeback_sync_modes { - WB_SYNC_NONE = 0, - WB_SYNC_ALL = 1, +struct quota_format_ops { + int (*check_quota_file)(struct super_block *, int); + int (*read_file_info)(struct super_block *, int); + int (*write_file_info)(struct super_block *, int); + int (*free_file_info)(struct super_block *, int); + int (*read_dqblk)(struct dquot *); + int (*commit_dqblk)(struct dquot *); + int (*release_dqblk)(struct dquot *); + int (*get_next_id)(struct super_block *, struct kqid *); }; -struct writeback_control { - long int nr_to_write; - long int pages_skipped; - loff_t range_start; - loff_t range_end; - enum writeback_sync_modes sync_mode; - unsigned int for_kupdate: 1; - unsigned int for_background: 1; - unsigned int tagged_writepages: 1; - unsigned int for_reclaim: 1; - unsigned int range_cyclic: 1; - unsigned int for_sync: 1; - unsigned int no_cgroup_owner: 1; - unsigned int punt_to_cgroup: 1; +struct dquot_operations { + int (*write_dquot)(struct dquot *); + struct dquot * (*alloc_dquot)(struct super_block *, int); + void (*destroy_dquot)(struct dquot *); + int (*acquire_dquot)(struct dquot *); + int (*release_dquot)(struct dquot *); + int (*mark_dirty)(struct dquot *); + int (*write_info)(struct super_block *, int); + qsize_t * (*get_reserved_space)(struct inode *); + int (*get_projid)(struct inode *, kprojid_t *); + int (*get_inode_usage)(struct inode *, qsize_t *); + int (*get_next_id)(struct super_block *, struct kqid *); }; -struct swap_cluster_info { - spinlock_t lock; - unsigned int data: 24; - unsigned int flags: 8; +struct qc_dqblk { + int d_fieldmask; + u64 d_spc_hardlimit; + u64 d_spc_softlimit; + u64 d_ino_hardlimit; + u64 d_ino_softlimit; + u64 d_space; + u64 d_ino_count; + s64 d_ino_timer; + s64 d_spc_timer; + int d_ino_warns; + int d_spc_warns; + u64 d_rt_spc_hardlimit; + u64 d_rt_spc_softlimit; + u64 d_rt_space; + s64 d_rt_spc_timer; + int d_rt_spc_warns; }; -struct swap_cluster_list { - struct swap_cluster_info head; - struct swap_cluster_info tail; +struct qc_type_state { + unsigned int flags; + unsigned int spc_timelimit; + unsigned int ino_timelimit; + unsigned int rt_spc_timelimit; + unsigned int spc_warnlimit; + unsigned int ino_warnlimit; + unsigned int rt_spc_warnlimit; + long long unsigned int ino; + blkcnt_t blocks; + blkcnt_t nextents; }; -struct percpu_cluster; +struct qc_state { + unsigned int s_incoredqs; + struct qc_type_state s_state[3]; +}; -struct swap_info_struct { - long unsigned int flags; - short int prio; - struct plist_node list; - signed char type; - unsigned int max; - unsigned char *swap_map; - struct swap_cluster_info *cluster_info; - struct swap_cluster_list free_clusters; - unsigned int lowest_bit; - unsigned int highest_bit; - unsigned int pages; - unsigned int inuse_pages; - unsigned int cluster_next; - unsigned int cluster_nr; - struct percpu_cluster *percpu_cluster; - struct rb_root swap_extent_root; - struct block_device *bdev; - struct file *swap_file; - unsigned int old_block_size; - spinlock_t lock; - spinlock_t cont_lock; - struct work_struct discard_work; - struct swap_cluster_list discard_clusters; - struct plist_node avail_lists[0]; +struct qc_info { + int i_fieldmask; + unsigned int i_flags; + unsigned int i_spc_timelimit; + unsigned int i_ino_timelimit; + unsigned int i_rt_spc_timelimit; + unsigned int i_spc_warnlimit; + unsigned int i_ino_warnlimit; + unsigned int i_rt_spc_warnlimit; }; -struct partition_meta_info; +struct quotactl_ops { + int (*quota_on)(struct super_block *, int, int, const struct path *); + int (*quota_off)(struct super_block *, int); + int (*quota_enable)(struct super_block *, unsigned int); + int (*quota_disable)(struct super_block *, unsigned int); + int (*quota_sync)(struct super_block *, int); + int (*set_info)(struct super_block *, int, struct qc_info *); + int (*get_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); + int (*get_nextdqblk)(struct super_block *, struct kqid *, struct qc_dqblk *); + int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); + int (*get_state)(struct super_block *, struct qc_state *); + int (*rm_xquota)(struct super_block *, unsigned int); +}; -struct disk_stats; +struct writeback_control; -struct hd_struct { - sector_t start_sect; - sector_t nr_sects; - seqcount_t nr_sects_seq; - sector_t alignment_offset; - unsigned int discard_alignment; - struct device __dev; - struct kobject *holder_dir; - int policy; - int partno; - struct partition_meta_info *info; - long unsigned int stamp; - struct disk_stats *dkstats; - struct percpu_ref ref; - struct rcu_work rcu_work; +struct swap_info_struct; + +struct address_space_operations { + int (*writepage)(struct page *, struct writeback_control *); + int (*readpage)(struct file *, struct page *); + int (*writepages)(struct address_space *, struct writeback_control *); + int (*set_page_dirty)(struct page *); + int (*readpages)(struct file *, struct address_space *, struct list_head *, unsigned int); + int (*write_begin)(struct file *, struct address_space *, loff_t, unsigned int, unsigned int, struct page **, void **); + int (*write_end)(struct file *, struct address_space *, loff_t, unsigned int, unsigned int, struct page *, void *); + sector_t (*bmap)(struct address_space *, sector_t); + void (*invalidatepage)(struct page *, unsigned int, unsigned int); + int (*releasepage)(struct page *, gfp_t); + void (*freepage)(struct page *); + ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *); + int (*migratepage)(struct address_space *, struct page *, struct page *, enum migrate_mode); + bool (*isolate_page)(struct page *, isolate_mode_t); + void (*putback_page)(struct page *); + int (*launder_page)(struct page *); + int (*is_partially_uptodate)(struct page *, long unsigned int, long unsigned int); + void (*is_dirty_writeback)(struct page *, bool *, bool *); + int (*error_remove_page)(struct address_space *, struct page *); + int (*swap_activate)(struct swap_info_struct *, struct file *, sector_t *); + void (*swap_deactivate)(struct file *); }; -struct disk_part_tbl; +struct hd_struct; -struct block_device_operations; +struct gendisk; -struct timer_rand_state; +struct block_device { + dev_t bd_dev; + int bd_openers; + struct inode *bd_inode; + struct super_block *bd_super; + struct mutex bd_mutex; + void *bd_claiming; + void *bd_holder; + int bd_holders; + bool bd_write_holder; + struct list_head bd_holder_disks; + struct block_device *bd_contains; + unsigned int bd_block_size; + u8 bd_partno; + struct hd_struct *bd_part; + unsigned int bd_part_count; + int bd_invalidated; + struct gendisk *bd_disk; + struct request_queue *bd_queue; + struct backing_dev_info *bd_bdi; + struct list_head bd_list; + long unsigned int bd_private; + int bd_fsfreeze_count; + struct mutex bd_fsfreeze_mutex; +}; -struct disk_events; +struct fiemap_extent_info; -struct badblocks; +struct inode_operations { + struct dentry * (*lookup)(struct inode *, struct dentry *, unsigned int); + const char * (*get_link)(struct dentry *, struct inode *, struct delayed_call *); + int (*permission)(struct inode *, int); + struct posix_acl * (*get_acl)(struct inode *, int); + int (*readlink)(struct dentry *, char *, int); + int (*create)(struct inode *, struct dentry *, umode_t, bool); + int (*link)(struct dentry *, struct inode *, struct dentry *); + int (*unlink)(struct inode *, struct dentry *); + int (*symlink)(struct inode *, struct dentry *, const char *); + int (*mkdir)(struct inode *, struct dentry *, umode_t); + int (*rmdir)(struct inode *, struct dentry *); + int (*mknod)(struct inode *, struct dentry *, umode_t, dev_t); + int (*rename)(struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); + int (*setattr)(struct dentry *, struct iattr *); + int (*getattr)(const struct path *, struct kstat *, u32, unsigned int); + ssize_t (*listxattr)(struct dentry *, char *, size_t); + int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64, u64); + int (*update_time)(struct inode *, struct timespec64 *, int); + int (*atomic_open)(struct inode *, struct dentry *, struct file *, unsigned int, umode_t); + int (*tmpfile)(struct inode *, struct dentry *, umode_t); + int (*set_acl)(struct inode *, struct posix_acl *, int); + long: 64; + long: 64; + long: 64; +}; -struct gendisk { - int major; - int first_minor; - int minors; - char disk_name[32]; - char * (*devnode)(struct gendisk *, umode_t *); - short unsigned int events; - short unsigned int event_flags; - struct disk_part_tbl *part_tbl; - struct hd_struct part0; - const struct block_device_operations *fops; - struct request_queue *queue; - void *private_data; - int flags; - struct rw_semaphore lookup_sem; - struct kobject *slave_dir; - struct timer_rand_state *random; - atomic_t sync_io; - struct disk_events *ev; - int node_id; - struct badblocks *bb; - struct lockdep_map lockdep_map; +struct file_lock_context { + spinlock_t flc_lock; + struct list_head flc_flock; + struct list_head flc_posix; + struct list_head flc_lease; }; -struct cdev { - struct kobject kobj; - struct module *owner; - const struct file_operations *ops; - struct list_head list; - dev_t dev; - unsigned int count; +struct file_lock_operations { + void (*fl_copy_lock)(struct file_lock *, struct file_lock *); + void (*fl_release_private)(struct file_lock *); }; -struct audit_names; +struct nlm_lockowner; -struct filename { - const char *name; - const char *uptr; - int refcnt; - struct audit_names *aname; - char iname[0]; +struct nfs_lock_info { + u32 state; + struct nlm_lockowner *owner; + struct list_head list; }; -typedef u8 blk_status_t; +struct nfs4_lock_state; -struct bvec_iter { - sector_t bi_sector; - unsigned int bi_size; - unsigned int bi_idx; - unsigned int bi_bvec_done; +struct nfs4_lock_info { + struct nfs4_lock_state *owner; }; -typedef void bio_end_io_t(struct bio *); +struct fasync_struct; -struct bio_vec { - struct page *bv_page; - unsigned int bv_len; - unsigned int bv_offset; -}; +struct lock_manager_operations; -struct bio { - struct bio *bi_next; - struct gendisk *bi_disk; - unsigned int bi_opf; - short unsigned int bi_flags; - short unsigned int bi_ioprio; - short unsigned int bi_write_hint; - blk_status_t bi_status; - u8 bi_partno; - atomic_t __bi_remaining; - struct bvec_iter bi_iter; - bio_end_io_t *bi_end_io; - void *bi_private; - union { }; - short unsigned int bi_vcnt; - short unsigned int bi_max_vecs; - atomic_t __bi_cnt; - struct bio_vec *bi_io_vec; - struct bio_set *bi_pool; - struct bio_vec bi_inline_vecs[0]; +struct file_lock { + struct file_lock *fl_blocker; + struct list_head fl_list; + struct hlist_node fl_link; + struct list_head fl_blocked_requests; + struct list_head fl_blocked_member; + fl_owner_t fl_owner; + unsigned int fl_flags; + unsigned char fl_type; + unsigned int fl_pid; + int fl_link_cpu; + wait_queue_head_t fl_wait; + struct file *fl_file; + loff_t fl_start; + loff_t fl_end; + struct fasync_struct *fl_fasync; + long unsigned int fl_break_time; + long unsigned int fl_downgrade_time; + const struct file_lock_operations *fl_ops; + const struct lock_manager_operations *fl_lmops; + union { + struct nfs_lock_info nfs_fl; + struct nfs4_lock_info nfs4_fl; + struct { + struct list_head link; + int state; + unsigned int debug_id; + } afs; + } fl_u; }; -struct linux_binprm { - struct vm_area_struct *vma; - long unsigned int vma_pages; - struct mm_struct *mm; - long unsigned int p; - long unsigned int argmin; - unsigned int called_set_creds: 1; - unsigned int cap_elevated: 1; - unsigned int secureexec: 1; - unsigned int recursion_depth; - struct file *file; - struct cred *cred; - int unsafe; - unsigned int per_clear; - int argc; - int envc; - const char *filename; - const char *interp; - unsigned int interp_flags; - unsigned int interp_data; - long unsigned int loader; - long unsigned int exec; - struct rlimit rlim_stack; - char buf[256]; +struct lock_manager_operations { + fl_owner_t (*lm_get_owner)(fl_owner_t); + void (*lm_put_owner)(fl_owner_t); + void (*lm_notify)(struct file_lock *); + int (*lm_grant)(struct file_lock *, int); + bool (*lm_break)(struct file_lock *); + int (*lm_change)(struct file_lock *, int, struct list_head *); + void (*lm_setup)(struct file_lock *, void **); }; -struct coredump_params { - const kernel_siginfo_t *siginfo; - struct pt_regs *regs; - struct file *file; - long unsigned int limit; - long unsigned int mm_flags; - loff_t written; - loff_t pos; +struct fasync_struct { + rwlock_t fa_lock; + int magic; + int fa_fd; + struct fasync_struct *fa_next; + struct file *fa_file; + struct callback_head fa_rcu; }; -struct key_tag { - struct callback_head rcu; - refcount_t usage; - bool removed; +struct kstatfs; + +struct super_operations { + struct inode * (*alloc_inode)(struct super_block *); + void (*destroy_inode)(struct inode *); + void (*free_inode)(struct inode *); + void (*dirty_inode)(struct inode *, int); + int (*write_inode)(struct inode *, struct writeback_control *); + int (*drop_inode)(struct inode *); + void (*evict_inode)(struct inode *); + void (*put_super)(struct super_block *); + int (*sync_fs)(struct super_block *, int); + int (*freeze_super)(struct super_block *); + int (*freeze_fs)(struct super_block *); + int (*thaw_super)(struct super_block *); + int (*unfreeze_fs)(struct super_block *); + int (*statfs)(struct dentry *, struct kstatfs *); + int (*remount_fs)(struct super_block *, int *, char *); + void (*umount_begin)(struct super_block *); + int (*show_options)(struct seq_file *, struct dentry *); + int (*show_devname)(struct seq_file *, struct dentry *); + int (*show_path)(struct seq_file *, struct dentry *); + int (*show_stats)(struct seq_file *, struct dentry *); + ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); + ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); + struct dquot ** (*get_dquots)(struct inode *); + int (*bdev_try_to_free_page)(struct super_block *, struct page *, gfp_t); + long int (*nr_cached_objects)(struct super_block *, struct shrink_control *); + long int (*free_cached_objects)(struct super_block *, struct shrink_control *); }; -typedef int (*key_restrict_link_func_t)(struct key *, const struct key_type *, const union key_payload *, struct key *); +struct iomap; -typedef int (*request_key_actor_t)(struct key *, void *); +struct inode___2; -struct key_preparsed_payload; +struct dentry___2; -struct key_match_data; +struct fid; -struct kernel_pkey_params; +struct iattr___2; -struct kernel_pkey_query; +struct export_operations { + int (*encode_fh)(struct inode___2 *, __u32 *, int *, struct inode___2 *); + struct dentry___2 * (*fh_to_dentry)(struct super_block *, struct fid *, int, int); + struct dentry___2 * (*fh_to_parent)(struct super_block *, struct fid *, int, int); + int (*get_name)(struct dentry___2 *, char *, struct dentry___2 *); + struct dentry___2 * (*get_parent)(struct dentry___2 *); + int (*commit_metadata)(struct inode___2 *); + int (*get_uuid)(struct super_block *, u8 *, u32 *, u64 *); + int (*map_blocks)(struct inode___2 *, loff_t, u64, struct iomap *, bool, u32 *); + int (*commit_blocks)(struct inode___2 *, struct iomap *, int, struct iattr___2 *); +}; -struct key_type { +struct xattr_handler { const char *name; - size_t def_datalen; - unsigned int flags; - int (*vet_description)(const char *); - int (*preparse)(struct key_preparsed_payload *); - void (*free_preparse)(struct key_preparsed_payload *); - int (*instantiate)(struct key *, struct key_preparsed_payload *); - int (*update)(struct key *, struct key_preparsed_payload *); - int (*match_preparse)(struct key_match_data *); - void (*match_free)(struct key_match_data *); - void (*revoke)(struct key *); - void (*destroy)(struct key *); - void (*describe)(const struct key *, struct seq_file *); - long int (*read)(const struct key *, char *, size_t); - request_key_actor_t request_key; - struct key_restriction * (*lookup_restriction)(const char *); - int (*asym_query)(const struct kernel_pkey_params *, struct kernel_pkey_query *); - int (*asym_eds_op)(struct kernel_pkey_params *, const void *, void *); - int (*asym_verify_signature)(struct kernel_pkey_params *, const void *, const void *); - struct list_head link; - struct lock_class_key lock_class; + const char *prefix; + int flags; + bool (*list)(struct dentry *); + int (*get)(const struct xattr_handler *, struct dentry *, struct inode *, const char *, void *, size_t); + int (*set)(const struct xattr_handler *, struct dentry *, struct inode *, const char *, const void *, size_t, int); }; -struct key_restriction { - key_restrict_link_func_t check; - struct key *key; - struct key_type *keytype; +struct fiemap_extent_info { + unsigned int fi_flags; + unsigned int fi_extents_mapped; + unsigned int fi_extents_max; + struct fiemap_extent *fi_extents_start; }; -struct group_info { - atomic_t usage; - int ngroups; - kgid_t gid[0]; -}; +typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64, unsigned int); -struct seq_operations { - void * (*start)(struct seq_file *, loff_t *); - void (*stop)(struct seq_file *, void *); - void * (*next)(struct seq_file *, void *, loff_t *); - int (*show)(struct seq_file *, void *); +struct dir_context { + filldir_t actor; + loff_t pos; }; -struct ring_buffer_event { - u32 type_len: 5; - u32 time_delta: 27; - u32 array[0]; -}; +struct fs_parameter_spec; -struct seq_buf { - char *buffer; - size_t size; - size_t len; - loff_t readpos; -}; +struct fs_parameter_enum; -struct trace_seq { - unsigned char buffer[4096]; - struct seq_buf seq; - int full; +struct fs_parameter_description { + const char name[16]; + const struct fs_parameter_spec *specs; + const struct fs_parameter_enum *enums; }; -enum perf_sw_ids { - PERF_COUNT_SW_CPU_CLOCK = 0, - PERF_COUNT_SW_TASK_CLOCK = 1, - PERF_COUNT_SW_PAGE_FAULTS = 2, - PERF_COUNT_SW_CONTEXT_SWITCHES = 3, - PERF_COUNT_SW_CPU_MIGRATIONS = 4, - PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, - PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, - PERF_COUNT_SW_ALIGNMENT_FAULTS = 7, - PERF_COUNT_SW_EMULATION_FAULTS = 8, - PERF_COUNT_SW_DUMMY = 9, - PERF_COUNT_SW_BPF_OUTPUT = 10, - PERF_COUNT_SW_MAX = 11, +struct attribute { + const char *name; + umode_t mode; }; -union perf_mem_data_src { - __u64 val; - struct { - __u64 mem_op: 5; - __u64 mem_lvl: 14; - __u64 mem_snoop: 5; - __u64 mem_lock: 2; - __u64 mem_dtlb: 7; - __u64 mem_lvl_num: 4; - __u64 mem_remote: 1; - __u64 mem_snoopx: 2; - __u64 mem_rsvd: 24; - }; +struct kobj_attribute { + struct attribute attr; + ssize_t (*show)(struct kobject *, struct kobj_attribute *, char *); + ssize_t (*store)(struct kobject *, struct kobj_attribute *, const char *, size_t); }; -struct perf_branch_entry { - __u64 from; - __u64 to; - __u64 mispred: 1; - __u64 predicted: 1; - __u64 in_tx: 1; - __u64 abort: 1; - __u64 cycles: 16; - __u64 type: 4; - __u64 reserved: 40; -}; +typedef void compound_page_dtor(struct page *); -struct taskstats { - __u16 version; - __u32 ac_exitcode; - __u8 ac_flag; - __u8 ac_nice; - __u64 cpu_count; - __u64 cpu_delay_total; - __u64 blkio_count; - __u64 blkio_delay_total; - __u64 swapin_count; - __u64 swapin_delay_total; - __u64 cpu_run_real_total; - __u64 cpu_run_virtual_total; - char ac_comm[32]; - __u8 ac_sched; - __u8 ac_pad[3]; - int: 32; - __u32 ac_uid; - __u32 ac_gid; - __u32 ac_pid; - __u32 ac_ppid; - __u32 ac_btime; - __u64 ac_etime; - __u64 ac_utime; - __u64 ac_stime; - __u64 ac_minflt; - __u64 ac_majflt; - __u64 coremem; - __u64 virtmem; - __u64 hiwater_rss; - __u64 hiwater_vm; - __u64 read_char; - __u64 write_char; - __u64 read_syscalls; - __u64 write_syscalls; - __u64 read_bytes; - __u64 write_bytes; - __u64 cancelled_write_bytes; - __u64 nvcsw; - __u64 nivcsw; - __u64 ac_utimescaled; - __u64 ac_stimescaled; - __u64 cpu_scaled_run_real_total; - __u64 freepages_count; - __u64 freepages_delay_total; - __u64 thrashing_count; - __u64 thrashing_delay_total; -}; - -struct new_utsname { - char sysname[65]; - char nodename[65]; - char release[65]; - char version[65]; - char machine[65]; - char domainname[65]; -}; - -struct uts_namespace { - struct kref kref; - struct new_utsname name; - struct user_namespace *user_ns; - struct ucounts *ucounts; - struct ns_common ns; -}; - -struct cgroup_namespace { - refcount_t count; - struct ns_common ns; - struct user_namespace *user_ns; - struct ucounts *ucounts; - struct css_set *root_cset; -}; - -struct proc_ns_operations { - const char *name; - const char *real_ns_name; - int type; - struct ns_common * (*get)(struct task_struct *); - void (*put)(struct ns_common *); - int (*install)(struct nsproxy *, struct ns_common *); - struct user_namespace * (*owner)(struct ns_common *); - struct ns_common * (*get_parent)(struct ns_common *); -}; - -struct ucounts { - struct hlist_node node; - struct user_namespace *ns; - kuid_t uid; - int count; - atomic_t ucount[9]; -}; - -struct dev_pm_ops { - int (*prepare)(struct device *); - void (*complete)(struct device *); - int (*suspend)(struct device *); - int (*resume)(struct device *); - int (*freeze)(struct device *); - int (*thaw)(struct device *); - int (*poweroff)(struct device *); - int (*restore)(struct device *); - int (*suspend_late)(struct device *); - int (*resume_early)(struct device *); - int (*freeze_late)(struct device *); - int (*thaw_early)(struct device *); - int (*poweroff_late)(struct device *); - int (*restore_early)(struct device *); - int (*suspend_noirq)(struct device *); - int (*resume_noirq)(struct device *); - int (*freeze_noirq)(struct device *); - int (*thaw_noirq)(struct device *); - int (*poweroff_noirq)(struct device *); - int (*restore_noirq)(struct device *); - int (*runtime_suspend)(struct device *); - int (*runtime_resume)(struct device *); - int (*runtime_idle)(struct device *); -}; - -struct pm_subsys_data { - spinlock_t lock; - unsigned int refcount; - struct list_head clock_list; -}; - -struct wakeup_source { - const char *name; - int id; - struct list_head entry; - spinlock_t lock; - struct wake_irq *wakeirq; - struct timer_list timer; - long unsigned int timer_expires; - ktime_t total_time; - ktime_t max_time; - ktime_t last_time; - ktime_t start_prevent_time; - ktime_t prevent_sleep_time; - long unsigned int event_count; - long unsigned int active_count; - long unsigned int relax_count; - long unsigned int expire_count; - long unsigned int wakeup_count; - struct device *dev; - bool active: 1; - bool autosleep_enabled: 1; -}; - -struct dev_pm_domain { - struct dev_pm_ops ops; - int (*start)(struct device *); - void (*detach)(struct device *, bool); - int (*activate)(struct device *); - void (*sync)(struct device *); - void (*dismiss)(struct device *); -}; - -struct iommu_ops; - -struct subsys_private; - -struct bus_type { - const char *name; - const char *dev_name; - struct device *dev_root; - const struct attribute_group **bus_groups; - const struct attribute_group **dev_groups; - const struct attribute_group **drv_groups; - int (*match)(struct device *, struct device_driver *); - int (*uevent)(struct device *, struct kobj_uevent_env *); - int (*probe)(struct device *); - void (*sync_state)(struct device *); - int (*remove)(struct device *); - void (*shutdown)(struct device *); - int (*online)(struct device *); - int (*offline)(struct device *); - int (*suspend)(struct device *, pm_message_t); - int (*resume)(struct device *); - int (*num_vf)(struct device *); - int (*dma_configure)(struct device *); - const struct dev_pm_ops *pm; - const struct iommu_ops *iommu_ops; - struct subsys_private *p; - struct lock_class_key lock_key; - bool need_parent_lock; -}; - -enum probe_type { - PROBE_DEFAULT_STRATEGY = 0, - PROBE_PREFER_ASYNCHRONOUS = 1, - PROBE_FORCE_SYNCHRONOUS = 2, -}; - -struct of_device_id; - -struct acpi_device_id; - -struct driver_private; - -struct device_driver { - const char *name; - struct bus_type *bus; - struct module *owner; - const char *mod_name; - bool suppress_bind_attrs; - enum probe_type probe_type; - const struct of_device_id *of_match_table; - const struct acpi_device_id *acpi_match_table; - int (*probe)(struct device *); - void (*sync_state)(struct device *); - int (*remove)(struct device *); - void (*shutdown)(struct device *); - int (*suspend)(struct device *, pm_message_t); - int (*resume)(struct device *); - const struct attribute_group **groups; - const struct attribute_group **dev_groups; - const struct dev_pm_ops *pm; - void (*coredump)(struct device *); - struct driver_private *p; -}; - -enum iommu_cap { - IOMMU_CAP_CACHE_COHERENCY = 0, - IOMMU_CAP_INTR_REMAP = 1, - IOMMU_CAP_NOEXEC = 2, -}; - -enum iommu_attr { - DOMAIN_ATTR_GEOMETRY = 0, - DOMAIN_ATTR_PAGING = 1, - DOMAIN_ATTR_WINDOWS = 2, - DOMAIN_ATTR_FSL_PAMU_STASH = 3, - DOMAIN_ATTR_FSL_PAMU_ENABLE = 4, - DOMAIN_ATTR_FSL_PAMUV1 = 5, - DOMAIN_ATTR_NESTING = 6, - DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE = 7, - DOMAIN_ATTR_MAX = 8, -}; - -enum iommu_dev_features { - IOMMU_DEV_FEAT_AUX = 0, - IOMMU_DEV_FEAT_SVA = 1, -}; - -struct iommu_domain; - -struct iommu_iotlb_gather; - -struct iommu_resv_region; - -struct of_phandle_args; - -struct iommu_sva; - -struct iommu_fault_event; - -struct iommu_page_response; - -struct iommu_cache_invalidate_info; - -struct iommu_gpasid_bind_data; - -struct iommu_ops { - bool (*capable)(enum iommu_cap); - struct iommu_domain * (*domain_alloc)(unsigned int); - void (*domain_free)(struct iommu_domain *); - int (*attach_dev)(struct iommu_domain *, struct device *); - void (*detach_dev)(struct iommu_domain *, struct device *); - int (*map)(struct iommu_domain *, long unsigned int, phys_addr_t, size_t, int, gfp_t); - size_t (*unmap)(struct iommu_domain *, long unsigned int, size_t, struct iommu_iotlb_gather *); - void (*flush_iotlb_all)(struct iommu_domain *); - void (*iotlb_sync_map)(struct iommu_domain *); - void (*iotlb_sync)(struct iommu_domain *, struct iommu_iotlb_gather *); - phys_addr_t (*iova_to_phys)(struct iommu_domain *, dma_addr_t); - int (*add_device)(struct device *); - void (*remove_device)(struct device *); - struct iommu_group * (*device_group)(struct device *); - int (*domain_get_attr)(struct iommu_domain *, enum iommu_attr, void *); - int (*domain_set_attr)(struct iommu_domain *, enum iommu_attr, void *); - void (*get_resv_regions)(struct device *, struct list_head *); - void (*put_resv_regions)(struct device *, struct list_head *); - void (*apply_resv_region)(struct device *, struct iommu_domain *, struct iommu_resv_region *); - int (*domain_window_enable)(struct iommu_domain *, u32, phys_addr_t, u64, int); - void (*domain_window_disable)(struct iommu_domain *, u32); - int (*of_xlate)(struct device *, struct of_phandle_args *); - bool (*is_attach_deferred)(struct iommu_domain *, struct device *); - bool (*dev_has_feat)(struct device *, enum iommu_dev_features); - bool (*dev_feat_enabled)(struct device *, enum iommu_dev_features); - int (*dev_enable_feat)(struct device *, enum iommu_dev_features); - int (*dev_disable_feat)(struct device *, enum iommu_dev_features); - int (*aux_attach_dev)(struct iommu_domain *, struct device *); - void (*aux_detach_dev)(struct iommu_domain *, struct device *); - int (*aux_get_pasid)(struct iommu_domain *, struct device *); - struct iommu_sva * (*sva_bind)(struct device *, struct mm_struct *, void *); - void (*sva_unbind)(struct iommu_sva *); - int (*sva_get_pasid)(struct iommu_sva *); - int (*page_response)(struct device *, struct iommu_fault_event *, struct iommu_page_response *); - int (*cache_invalidate)(struct iommu_domain *, struct device *, struct iommu_cache_invalidate_info *); - int (*sva_bind_gpasid)(struct iommu_domain *, struct device *, struct iommu_gpasid_bind_data *); - int (*sva_unbind_gpasid)(struct device *, int); - long unsigned int pgsize_bitmap; -}; - -struct device_type { - const char *name; - const struct attribute_group **groups; - int (*uevent)(struct device *, struct kobj_uevent_env *); - char * (*devnode)(struct device *, umode_t *, kuid_t *, kgid_t *); - void (*release)(struct device *); - const struct dev_pm_ops *pm; -}; - -struct of_device_id { - char name[32]; - char type[32]; - char compatible[128]; - const void *data; -}; - -typedef long unsigned int kernel_ulong_t; - -struct acpi_device_id { - __u8 id[9]; - kernel_ulong_t driver_data; - __u32 cls; - __u32 cls_msk; -}; - -struct class { - const char *name; - struct module *owner; - const struct attribute_group **class_groups; - const struct attribute_group **dev_groups; - struct kobject *dev_kobj; - int (*dev_uevent)(struct device *, struct kobj_uevent_env *); - char * (*devnode)(struct device *, umode_t *); - void (*class_release)(struct class *); - void (*dev_release)(struct device *); - int (*shutdown_pre)(struct device *); - const struct kobj_ns_type_operations *ns_type; - const void * (*namespace)(struct device *); - void (*get_ownership)(struct device *, kuid_t *, kgid_t *); - const struct dev_pm_ops *pm; - struct subsys_private *p; -}; - -struct device_dma_parameters { - unsigned int max_segment_size; - long unsigned int segment_boundary_mask; +enum vm_event_item { + PGPGIN = 0, + PGPGOUT = 1, + PSWPIN = 2, + PSWPOUT = 3, + PGALLOC_DMA = 4, + PGALLOC_DMA32 = 5, + PGALLOC_NORMAL = 6, + PGALLOC_MOVABLE = 7, + ALLOCSTALL_DMA = 8, + ALLOCSTALL_DMA32 = 9, + ALLOCSTALL_NORMAL = 10, + ALLOCSTALL_MOVABLE = 11, + PGSCAN_SKIP_DMA = 12, + PGSCAN_SKIP_DMA32 = 13, + PGSCAN_SKIP_NORMAL = 14, + PGSCAN_SKIP_MOVABLE = 15, + PGFREE = 16, + PGACTIVATE = 17, + PGDEACTIVATE = 18, + PGLAZYFREE = 19, + PGFAULT = 20, + PGMAJFAULT = 21, + PGLAZYFREED = 22, + PGREFILL = 23, + PGSTEAL_KSWAPD = 24, + PGSTEAL_DIRECT = 25, + PGSCAN_KSWAPD = 26, + PGSCAN_DIRECT = 27, + PGSCAN_DIRECT_THROTTLE = 28, + PGSCAN_ZONE_RECLAIM_FAILED = 29, + PGINODESTEAL = 30, + SLABS_SCANNED = 31, + KSWAPD_INODESTEAL = 32, + KSWAPD_LOW_WMARK_HIT_QUICKLY = 33, + KSWAPD_HIGH_WMARK_HIT_QUICKLY = 34, + PAGEOUTRUN = 35, + PGROTATED = 36, + DROP_PAGECACHE = 37, + DROP_SLAB = 38, + OOM_KILL = 39, + PGMIGRATE_SUCCESS = 40, + PGMIGRATE_FAIL = 41, + COMPACTMIGRATE_SCANNED = 42, + COMPACTFREE_SCANNED = 43, + COMPACTISOLATED = 44, + COMPACTSTALL = 45, + COMPACTFAIL = 46, + COMPACTSUCCESS = 47, + KCOMPACTD_WAKE = 48, + KCOMPACTD_MIGRATE_SCANNED = 49, + KCOMPACTD_FREE_SCANNED = 50, + HTLB_BUDDY_PGALLOC = 51, + HTLB_BUDDY_PGALLOC_FAIL = 52, + UNEVICTABLE_PGCULLED = 53, + UNEVICTABLE_PGSCANNED = 54, + UNEVICTABLE_PGRESCUED = 55, + UNEVICTABLE_PGMLOCKED = 56, + UNEVICTABLE_PGMUNLOCKED = 57, + UNEVICTABLE_PGCLEARED = 58, + UNEVICTABLE_PGSTRANDED = 59, + SWAP_RA = 60, + SWAP_RA_HIT = 61, + NR_VM_EVENT_ITEMS = 62, }; -enum irq_domain_bus_token { - DOMAIN_BUS_ANY = 0, - DOMAIN_BUS_WIRED = 1, - DOMAIN_BUS_GENERIC_MSI = 2, - DOMAIN_BUS_PCI_MSI = 3, - DOMAIN_BUS_PLATFORM_MSI = 4, - DOMAIN_BUS_NEXUS = 5, - DOMAIN_BUS_IPI = 6, - DOMAIN_BUS_FSL_MC_MSI = 7, - DOMAIN_BUS_TI_SCI_INTA_MSI = 8, - DOMAIN_BUS_WAKEUP = 9, +struct vm_event_state { + long unsigned int event[62]; }; -struct irq_domain_ops; - -struct irq_domain_chip_generic; - -struct irq_domain { - struct list_head link; - const char *name; - const struct irq_domain_ops *ops; - void *host_data; - unsigned int flags; - unsigned int mapcount; - struct fwnode_handle *fwnode; - enum irq_domain_bus_token bus_token; - struct irq_domain_chip_generic *gc; - struct irq_domain *parent; - irq_hw_number_t hwirq_max; - unsigned int revmap_direct_max_irq; - unsigned int revmap_size; - struct xarray revmap_tree; - struct mutex revmap_tree_mutex; - unsigned int linear_revmap[0]; +enum memblock_flags { + MEMBLOCK_NONE = 0, + MEMBLOCK_HOTPLUG = 1, + MEMBLOCK_MIRROR = 2, + MEMBLOCK_NOMAP = 4, }; -enum dma_data_direction { - DMA_BIDIRECTIONAL = 0, - DMA_TO_DEVICE = 1, - DMA_FROM_DEVICE = 2, - DMA_NONE = 3, +struct memblock_region { + phys_addr_t base; + phys_addr_t size; + enum memblock_flags flags; + int nid; }; -struct sg_table; - -struct scatterlist; - -struct dma_map_ops { - void * (*alloc)(struct device *, size_t, dma_addr_t *, gfp_t, long unsigned int); - void (*free)(struct device *, size_t, void *, dma_addr_t, long unsigned int); - int (*mmap)(struct device *, struct vm_area_struct *, void *, dma_addr_t, size_t, long unsigned int); - int (*get_sgtable)(struct device *, struct sg_table *, void *, dma_addr_t, size_t, long unsigned int); - dma_addr_t (*map_page)(struct device *, struct page *, long unsigned int, size_t, enum dma_data_direction, long unsigned int); - void (*unmap_page)(struct device *, dma_addr_t, size_t, enum dma_data_direction, long unsigned int); - int (*map_sg)(struct device *, struct scatterlist *, int, enum dma_data_direction, long unsigned int); - void (*unmap_sg)(struct device *, struct scatterlist *, int, enum dma_data_direction, long unsigned int); - dma_addr_t (*map_resource)(struct device *, phys_addr_t, size_t, enum dma_data_direction, long unsigned int); - void (*unmap_resource)(struct device *, dma_addr_t, size_t, enum dma_data_direction, long unsigned int); - void (*sync_single_for_cpu)(struct device *, dma_addr_t, size_t, enum dma_data_direction); - void (*sync_single_for_device)(struct device *, dma_addr_t, size_t, enum dma_data_direction); - void (*sync_sg_for_cpu)(struct device *, struct scatterlist *, int, enum dma_data_direction); - void (*sync_sg_for_device)(struct device *, struct scatterlist *, int, enum dma_data_direction); - void (*cache_sync)(struct device *, void *, size_t, enum dma_data_direction); - int (*dma_supported)(struct device *, u64); - u64 (*get_required_mask)(struct device *); - size_t (*max_mapping_size)(struct device *); - long unsigned int (*get_merge_boundary)(struct device *); +struct memblock_type { + long unsigned int cnt; + long unsigned int max; + phys_addr_t total_size; + struct memblock_region *regions; + char *name; }; -typedef u32 phandle; - -struct property; - -struct device_node { - const char *name; - phandle phandle; - const char *full_name; - struct fwnode_handle fwnode; - struct property *properties; - struct property *deadprops; - struct device_node *parent; - struct device_node *child; - struct device_node *sibling; - long unsigned int _flags; - void *data; +struct memblock { + bool bottom_up; + phys_addr_t current_limit; + struct memblock_type memory; + struct memblock_type reserved; }; -enum cpuhp_state { - CPUHP_INVALID = -1, - CPUHP_OFFLINE = 0, - CPUHP_CREATE_THREADS = 1, - CPUHP_PERF_PREPARE = 2, - CPUHP_PERF_X86_PREPARE = 3, - CPUHP_PERF_X86_AMD_UNCORE_PREP = 4, - CPUHP_PERF_POWER = 5, - CPUHP_PERF_SUPERH = 6, - CPUHP_X86_HPET_DEAD = 7, - CPUHP_X86_APB_DEAD = 8, - CPUHP_X86_MCE_DEAD = 9, - CPUHP_VIRT_NET_DEAD = 10, - CPUHP_SLUB_DEAD = 11, - CPUHP_MM_WRITEBACK_DEAD = 12, - CPUHP_MM_VMSTAT_DEAD = 13, - CPUHP_SOFTIRQ_DEAD = 14, - CPUHP_NET_MVNETA_DEAD = 15, - CPUHP_CPUIDLE_DEAD = 16, - CPUHP_ARM64_FPSIMD_DEAD = 17, - CPUHP_ARM_OMAP_WAKE_DEAD = 18, - CPUHP_IRQ_POLL_DEAD = 19, - CPUHP_BLOCK_SOFTIRQ_DEAD = 20, - CPUHP_ACPI_CPUDRV_DEAD = 21, - CPUHP_S390_PFAULT_DEAD = 22, - CPUHP_BLK_MQ_DEAD = 23, - CPUHP_FS_BUFF_DEAD = 24, - CPUHP_PRINTK_DEAD = 25, - CPUHP_MM_MEMCQ_DEAD = 26, - CPUHP_PERCPU_CNT_DEAD = 27, - CPUHP_RADIX_DEAD = 28, - CPUHP_PAGE_ALLOC_DEAD = 29, - CPUHP_NET_DEV_DEAD = 30, - CPUHP_PCI_XGENE_DEAD = 31, - CPUHP_IOMMU_INTEL_DEAD = 32, - CPUHP_LUSTRE_CFS_DEAD = 33, - CPUHP_AP_ARM_CACHE_B15_RAC_DEAD = 34, - CPUHP_WORKQUEUE_PREP = 35, - CPUHP_POWER_NUMA_PREPARE = 36, - CPUHP_HRTIMERS_PREPARE = 37, - CPUHP_PROFILE_PREPARE = 38, - CPUHP_X2APIC_PREPARE = 39, - CPUHP_SMPCFD_PREPARE = 40, - CPUHP_RELAY_PREPARE = 41, - CPUHP_SLAB_PREPARE = 42, - CPUHP_MD_RAID5_PREPARE = 43, - CPUHP_RCUTREE_PREP = 44, - CPUHP_CPUIDLE_COUPLED_PREPARE = 45, - CPUHP_POWERPC_PMAC_PREPARE = 46, - CPUHP_POWERPC_MMU_CTX_PREPARE = 47, - CPUHP_XEN_PREPARE = 48, - CPUHP_XEN_EVTCHN_PREPARE = 49, - CPUHP_ARM_SHMOBILE_SCU_PREPARE = 50, - CPUHP_SH_SH3X_PREPARE = 51, - CPUHP_NET_FLOW_PREPARE = 52, - CPUHP_TOPOLOGY_PREPARE = 53, - CPUHP_NET_IUCV_PREPARE = 54, - CPUHP_ARM_BL_PREPARE = 55, - CPUHP_TRACE_RB_PREPARE = 56, - CPUHP_MM_ZS_PREPARE = 57, - CPUHP_MM_ZSWP_MEM_PREPARE = 58, - CPUHP_MM_ZSWP_POOL_PREPARE = 59, - CPUHP_KVM_PPC_BOOK3S_PREPARE = 60, - CPUHP_ZCOMP_PREPARE = 61, - CPUHP_TIMERS_PREPARE = 62, - CPUHP_MIPS_SOC_PREPARE = 63, - CPUHP_BP_PREPARE_DYN = 64, - CPUHP_BP_PREPARE_DYN_END = 84, - CPUHP_BRINGUP_CPU = 85, - CPUHP_AP_IDLE_DEAD = 86, - CPUHP_AP_OFFLINE = 87, - CPUHP_AP_SCHED_STARTING = 88, - CPUHP_AP_RCUTREE_DYING = 89, - CPUHP_AP_IRQ_GIC_STARTING = 90, - CPUHP_AP_IRQ_HIP04_STARTING = 91, - CPUHP_AP_IRQ_ARMADA_XP_STARTING = 92, - CPUHP_AP_IRQ_BCM2836_STARTING = 93, - CPUHP_AP_IRQ_MIPS_GIC_STARTING = 94, - CPUHP_AP_ARM_MVEBU_COHERENCY = 95, - CPUHP_AP_MICROCODE_LOADER = 96, - CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING = 97, - CPUHP_AP_PERF_X86_STARTING = 98, - CPUHP_AP_PERF_X86_AMD_IBS_STARTING = 99, - CPUHP_AP_PERF_X86_CQM_STARTING = 100, - CPUHP_AP_PERF_X86_CSTATE_STARTING = 101, - CPUHP_AP_PERF_XTENSA_STARTING = 102, - CPUHP_AP_MIPS_OP_LOONGSON3_STARTING = 103, - CPUHP_AP_ARM_SDEI_STARTING = 104, - CPUHP_AP_ARM_VFP_STARTING = 105, - CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING = 106, - CPUHP_AP_PERF_ARM_HW_BREAKPOINT_STARTING = 107, - CPUHP_AP_PERF_ARM_ACPI_STARTING = 108, - CPUHP_AP_PERF_ARM_STARTING = 109, - CPUHP_AP_ARM_L2X0_STARTING = 110, - CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING = 111, - CPUHP_AP_ARM_ARCH_TIMER_STARTING = 112, - CPUHP_AP_ARM_GLOBAL_TIMER_STARTING = 113, - CPUHP_AP_JCORE_TIMER_STARTING = 114, - CPUHP_AP_ARM_TWD_STARTING = 115, - CPUHP_AP_QCOM_TIMER_STARTING = 116, - CPUHP_AP_TEGRA_TIMER_STARTING = 117, - CPUHP_AP_ARMADA_TIMER_STARTING = 118, - CPUHP_AP_MARCO_TIMER_STARTING = 119, - CPUHP_AP_MIPS_GIC_TIMER_STARTING = 120, - CPUHP_AP_ARC_TIMER_STARTING = 121, - CPUHP_AP_RISCV_TIMER_STARTING = 122, - CPUHP_AP_CSKY_TIMER_STARTING = 123, - CPUHP_AP_HYPERV_TIMER_STARTING = 124, - CPUHP_AP_KVM_STARTING = 125, - CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING = 126, - CPUHP_AP_KVM_ARM_VGIC_STARTING = 127, - CPUHP_AP_KVM_ARM_TIMER_STARTING = 128, - CPUHP_AP_DUMMY_TIMER_STARTING = 129, - CPUHP_AP_ARM_XEN_STARTING = 130, - CPUHP_AP_ARM_KVMPV_STARTING = 131, - CPUHP_AP_ARM_CORESIGHT_STARTING = 132, - CPUHP_AP_ARM64_ISNDEP_STARTING = 133, - CPUHP_AP_SMPCFD_DYING = 134, - CPUHP_AP_X86_TBOOT_DYING = 135, - CPUHP_AP_ARM_CACHE_B15_RAC_DYING = 136, - CPUHP_AP_ONLINE = 137, - CPUHP_TEARDOWN_CPU = 138, - CPUHP_AP_ONLINE_IDLE = 139, - CPUHP_AP_SMPBOOT_THREADS = 140, - CPUHP_AP_X86_VDSO_VMA_ONLINE = 141, - CPUHP_AP_IRQ_AFFINITY_ONLINE = 142, - CPUHP_AP_ARM_MVEBU_SYNC_CLOCKS = 143, - CPUHP_AP_X86_INTEL_EPB_ONLINE = 144, - CPUHP_AP_PERF_ONLINE = 145, - CPUHP_AP_PERF_X86_ONLINE = 146, - CPUHP_AP_PERF_X86_UNCORE_ONLINE = 147, - CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE = 148, - CPUHP_AP_PERF_X86_AMD_POWER_ONLINE = 149, - CPUHP_AP_PERF_X86_RAPL_ONLINE = 150, - CPUHP_AP_PERF_X86_CQM_ONLINE = 151, - CPUHP_AP_PERF_X86_CSTATE_ONLINE = 152, - CPUHP_AP_PERF_S390_CF_ONLINE = 153, - CPUHP_AP_PERF_S390_SF_ONLINE = 154, - CPUHP_AP_PERF_ARM_CCI_ONLINE = 155, - CPUHP_AP_PERF_ARM_CCN_ONLINE = 156, - CPUHP_AP_PERF_ARM_HISI_DDRC_ONLINE = 157, - CPUHP_AP_PERF_ARM_HISI_HHA_ONLINE = 158, - CPUHP_AP_PERF_ARM_HISI_L3_ONLINE = 159, - CPUHP_AP_PERF_ARM_L2X0_ONLINE = 160, - CPUHP_AP_PERF_ARM_QCOM_L2_ONLINE = 161, - CPUHP_AP_PERF_ARM_QCOM_L3_ONLINE = 162, - CPUHP_AP_PERF_ARM_APM_XGENE_ONLINE = 163, - CPUHP_AP_PERF_ARM_CAVIUM_TX2_UNCORE_ONLINE = 164, - CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE = 165, - CPUHP_AP_PERF_POWERPC_CORE_IMC_ONLINE = 166, - CPUHP_AP_PERF_POWERPC_THREAD_IMC_ONLINE = 167, - CPUHP_AP_PERF_POWERPC_TRACE_IMC_ONLINE = 168, - CPUHP_AP_WATCHDOG_ONLINE = 169, - CPUHP_AP_WORKQUEUE_ONLINE = 170, - CPUHP_AP_RCUTREE_ONLINE = 171, - CPUHP_AP_BASE_CACHEINFO_ONLINE = 172, - CPUHP_AP_ONLINE_DYN = 173, - CPUHP_AP_ONLINE_DYN_END = 203, - CPUHP_AP_X86_HPET_ONLINE = 204, - CPUHP_AP_X86_KVM_CLK_ONLINE = 205, - CPUHP_AP_ACTIVE = 206, - CPUHP_ONLINE = 207, -}; - -struct perf_regs { - __u64 abi; - struct pt_regs *regs; -}; - -struct kernel_cpustat { - u64 cpustat[10]; -}; - -struct kernel_stat { - long unsigned int irqs_sum; - unsigned int softirqs[10]; -}; - -struct u64_stats_sync {}; - -struct bpf_cgroup_storage; - -struct bpf_prog; - -struct bpf_prog_array_item { - struct bpf_prog *prog; - struct bpf_cgroup_storage *cgroup_storage[2]; -}; - -struct bpf_prog_array { - struct callback_head rcu; - struct bpf_prog_array_item items[0]; -}; - -struct cgroup_bpf {}; - -struct psi_group {}; - -struct cgroup_file { - struct kernfs_node *kn; - long unsigned int notified_at; - struct timer_list notify_timer; -}; - -struct cgroup_subsys; - -struct cgroup_subsys_state { - struct cgroup *cgroup; - struct cgroup_subsys *ss; - struct percpu_ref refcnt; - struct list_head sibling; - struct list_head children; - struct list_head rstat_css_node; - int id; - unsigned int flags; - u64 serial_nr; - atomic_t online_cnt; - struct work_struct destroy_work; - struct rcu_work destroy_rwork; - struct cgroup_subsys_state *parent; -}; - -struct cgroup_base_stat { - struct task_cputime cputime; -}; - -struct cgroup_freezer_state { - bool freeze; - int e_freeze; - int nr_frozen_descendants; - int nr_frozen_tasks; -}; - -struct cgroup_root; - -struct cgroup_rstat_cpu; - -struct cgroup { - struct cgroup_subsys_state self; - long unsigned int flags; - int level; - int max_depth; - int nr_descendants; - int nr_dying_descendants; - int max_descendants; - int nr_populated_csets; - int nr_populated_domain_children; - int nr_populated_threaded_children; - int nr_threaded_children; - struct kernfs_node *kn; - struct cgroup_file procs_file; - struct cgroup_file events_file; - u16 subtree_control; - u16 subtree_ss_mask; - u16 old_subtree_control; - u16 old_subtree_ss_mask; - struct cgroup_subsys_state *subsys[4]; - struct cgroup_root *root; - struct list_head cset_links; - struct list_head e_csets[4]; - struct cgroup *dom_cgrp; - struct cgroup *old_dom_cgrp; - struct cgroup_rstat_cpu *rstat_cpu; - struct list_head rstat_css_list; - struct cgroup_base_stat last_bstat; - struct cgroup_base_stat bstat; - struct prev_cputime prev_cputime; - struct list_head pidlists; - struct mutex pidlist_mutex; - wait_queue_head_t offline_waitq; - struct work_struct release_agent_work; - struct psi_group psi; - struct cgroup_bpf bpf; - atomic_t congestion_count; - struct cgroup_freezer_state freezer; - u64 ancestor_ids[0]; -}; - -struct cgroup_taskset; - -struct cftype; - -struct cgroup_subsys { - struct cgroup_subsys_state * (*css_alloc)(struct cgroup_subsys_state *); - int (*css_online)(struct cgroup_subsys_state *); - void (*css_offline)(struct cgroup_subsys_state *); - void (*css_released)(struct cgroup_subsys_state *); - void (*css_free)(struct cgroup_subsys_state *); - void (*css_reset)(struct cgroup_subsys_state *); - void (*css_rstat_flush)(struct cgroup_subsys_state *, int); - int (*css_extra_stat_show)(struct seq_file *, struct cgroup_subsys_state *); - int (*can_attach)(struct cgroup_taskset *); - void (*cancel_attach)(struct cgroup_taskset *); - void (*attach)(struct cgroup_taskset *); - void (*post_attach)(); - int (*can_fork)(struct task_struct *); - void (*cancel_fork)(struct task_struct *); - void (*fork)(struct task_struct *); - void (*exit)(struct task_struct *); - void (*release)(struct task_struct *); - void (*bind)(struct cgroup_subsys_state *); - bool early_init: 1; - bool implicit_on_dfl: 1; - bool threaded: 1; - bool broken_hierarchy: 1; - bool warned_broken_hierarchy: 1; - int id; - const char *name; - const char *legacy_name; - struct cgroup_root *root; - struct idr css_idr; - struct list_head cfts; - struct cftype *dfl_cftypes; - struct cftype *legacy_cftypes; - unsigned int depends_on; -}; - -struct cgroup_rstat_cpu { - struct u64_stats_sync bsync; - struct cgroup_base_stat bstat; - struct cgroup_base_stat last_bstat; - struct cgroup *updated_children; - struct cgroup *updated_next; -}; - -struct cgroup_root { - struct kernfs_root *kf_root; - unsigned int subsys_mask; - int hierarchy_id; - struct cgroup cgrp; - u64 cgrp_ancestor_id_storage; - atomic_t nr_cgrps; - struct list_head root_list; - unsigned int flags; - char release_agent_path[4096]; - char name[64]; -}; - -struct cftype { - char name[64]; - long unsigned int private; - size_t max_write_len; - unsigned int flags; - unsigned int file_offset; - struct cgroup_subsys *ss; - struct list_head node; - struct kernfs_ops *kf_ops; - int (*open)(struct kernfs_open_file *); - void (*release)(struct kernfs_open_file *); - u64 (*read_u64)(struct cgroup_subsys_state *, struct cftype *); - s64 (*read_s64)(struct cgroup_subsys_state *, struct cftype *); - int (*seq_show)(struct seq_file *, void *); - void * (*seq_start)(struct seq_file *, loff_t *); - void * (*seq_next)(struct seq_file *, void *, loff_t *); - void (*seq_stop)(struct seq_file *, void *); - int (*write_u64)(struct cgroup_subsys_state *, struct cftype *, u64); - int (*write_s64)(struct cgroup_subsys_state *, struct cftype *, s64); - ssize_t (*write)(struct kernfs_open_file *, char *, size_t, loff_t); - __poll_t (*poll)(struct kernfs_open_file *, struct poll_table_struct *); -}; - -struct perf_callchain_entry { - __u64 nr; - __u64 ip[0]; -}; - -typedef long unsigned int (*perf_copy_f)(void *, const void *, long unsigned int, long unsigned int); - -struct perf_raw_frag { - union { - struct perf_raw_frag *next; - long unsigned int pad; - }; - perf_copy_f copy; - void *data; - u32 size; -} __attribute__((packed)); - -struct perf_raw_record { - struct perf_raw_frag frag; - u32 size; -}; - -struct perf_branch_stack { - __u64 nr; - struct perf_branch_entry entries[0]; -}; - -struct perf_cpu_context; - -struct perf_output_handle; - -struct pmu { - struct list_head entry; - struct module *module; - struct device *dev; - const struct attribute_group **attr_groups; - const struct attribute_group **attr_update; - const char *name; - int type; - int capabilities; - int *pmu_disable_count; - struct perf_cpu_context *pmu_cpu_context; - atomic_t exclusive_cnt; - int task_ctx_nr; - int hrtimer_interval_ms; - unsigned int nr_addr_filters; - void (*pmu_enable)(struct pmu *); - void (*pmu_disable)(struct pmu *); - int (*event_init)(struct perf_event *); - void (*event_mapped)(struct perf_event *, struct mm_struct *); - void (*event_unmapped)(struct perf_event *, struct mm_struct *); - int (*add)(struct perf_event *, int); - void (*del)(struct perf_event *, int); - void (*start)(struct perf_event *, int); - void (*stop)(struct perf_event *, int); - void (*read)(struct perf_event *); - void (*start_txn)(struct pmu *, unsigned int); - int (*commit_txn)(struct pmu *); - void (*cancel_txn)(struct pmu *); - int (*event_idx)(struct perf_event *); - void (*sched_task)(struct perf_event_context *, bool); - size_t task_ctx_size; - void (*swap_task_ctx)(struct perf_event_context *, struct perf_event_context *); - void * (*setup_aux)(struct perf_event *, void **, int, bool); - void (*free_aux)(void *); - long int (*snapshot_aux)(struct perf_event *, struct perf_output_handle *, long unsigned int); - int (*addr_filters_validate)(struct list_head *); - void (*addr_filters_sync)(struct perf_event *); - int (*aux_output_match)(struct perf_event *); - int (*filter_match)(struct perf_event *); - int (*check_period)(struct perf_event *, u64); -}; - -struct perf_cpu_context { - struct perf_event_context ctx; - struct perf_event_context *task_ctx; - int active_oncpu; - int exclusive; - raw_spinlock_t hrtimer_lock; - struct hrtimer hrtimer; - ktime_t hrtimer_interval; - unsigned int hrtimer_active; - struct list_head sched_cb_entry; - int sched_cb_usage; - int online; -}; - -struct perf_output_handle { - struct perf_event *event; - struct ring_buffer *rb; - long unsigned int wakeup; - long unsigned int size; - u64 aux_flags; - union { - void *addr; - long unsigned int head; - }; - int page; -}; - -struct perf_addr_filter_range { - long unsigned int start; - long unsigned int size; -}; - -struct perf_sample_data { - u64 addr; - struct perf_raw_record *raw; - struct perf_branch_stack *br_stack; - u64 period; - u64 weight; - u64 txn; - union perf_mem_data_src data_src; - u64 type; - u64 ip; - struct { - u32 pid; - u32 tid; - } tid_entry; - u64 time; - u64 id; - u64 stream_id; - struct { - u32 cpu; - u32 reserved; - } cpu_entry; - struct perf_callchain_entry *callchain; - u64 aux_size; - struct perf_regs regs_user; - struct pt_regs regs_user_copy; - struct perf_regs regs_intr; - u64 stack_user_size; - u64 phys_addr; +struct debug_store { + u64 bts_buffer_base; + u64 bts_index; + u64 bts_absolute_maximum; + u64 bts_interrupt_threshold; + u64 pebs_buffer_base; + u64 pebs_index; + u64 pebs_absolute_maximum; + u64 pebs_interrupt_threshold; + u64 pebs_event_reset[12]; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; long: 64; long: 64; long: 64; @@ -7816,1836 +5555,1676 @@ struct perf_sample_data { long: 64; }; -struct trace_entry { - short unsigned int type; - unsigned char flags; - unsigned char preempt_count; - int pid; -}; - -struct trace_array; - -struct tracer; - -struct trace_buffer; - -struct ring_buffer_iter; - -struct trace_iterator { - struct trace_array *tr; - struct tracer *trace; - struct trace_buffer *trace_buffer; - void *private; - int cpu_file; - struct mutex mutex; - struct ring_buffer_iter **buffer_iter; - long unsigned int iter_flags; - struct trace_seq tmp_seq; - cpumask_var_t started; - bool snapshot; - struct trace_seq seq; - struct trace_entry *ent; - long unsigned int lost_events; - int leftover; - int ent_size; - int cpu; - u64 ts; - loff_t pos; - long int idx; -}; - -enum print_line_t { - TRACE_TYPE_PARTIAL_LINE = 0, - TRACE_TYPE_HANDLED = 1, - TRACE_TYPE_UNHANDLED = 2, - TRACE_TYPE_NO_CONSUME = 3, -}; - -typedef enum print_line_t (*trace_print_func)(struct trace_iterator *, int, struct trace_event *); - -struct trace_event_functions { - trace_print_func trace; - trace_print_func raw; - trace_print_func hex; - trace_print_func binary; -}; - -enum trace_reg { - TRACE_REG_REGISTER = 0, - TRACE_REG_UNREGISTER = 1, - TRACE_REG_PERF_REGISTER = 2, - TRACE_REG_PERF_UNREGISTER = 3, - TRACE_REG_PERF_OPEN = 4, - TRACE_REG_PERF_CLOSE = 5, - TRACE_REG_PERF_ADD = 6, - TRACE_REG_PERF_DEL = 7, +struct debug_store_buffers { + char bts_buffer[65536]; + char pebs_buffer[65536]; }; -struct trace_event_class { - const char *system; - void *probe; - void *perf_probe; - int (*reg)(struct trace_event_call *, enum trace_reg, void *); - int (*define_fields)(struct trace_event_call *); - struct list_head * (*get_fields)(struct trace_event_call *); - struct list_head fields; - int (*raw_init)(struct trace_event_call *); -}; - -struct trace_event_file; - -struct trace_event_buffer { - struct ring_buffer *buffer; - struct ring_buffer_event *event; - struct trace_event_file *trace_file; - void *entry; - long unsigned int flags; - int pc; -}; - -struct trace_subsystem_dir; - -struct trace_event_file { - struct list_head list; - struct trace_event_call *event_call; - struct event_filter *filter; - struct dentry *dir; - struct trace_array *tr; - struct trace_subsystem_dir *system; - struct list_head triggers; - long unsigned int flags; - atomic_t sm_ref; - atomic_t tm_ref; -}; - -enum { - TRACE_EVENT_FL_FILTERED_BIT = 0, - TRACE_EVENT_FL_CAP_ANY_BIT = 1, - TRACE_EVENT_FL_NO_SET_FILTER_BIT = 2, - TRACE_EVENT_FL_IGNORE_ENABLE_BIT = 3, - TRACE_EVENT_FL_TRACEPOINT_BIT = 4, - TRACE_EVENT_FL_KPROBE_BIT = 5, - TRACE_EVENT_FL_UPROBE_BIT = 6, -}; - -enum { - TRACE_EVENT_FL_FILTERED = 1, - TRACE_EVENT_FL_CAP_ANY = 2, - TRACE_EVENT_FL_NO_SET_FILTER = 4, - TRACE_EVENT_FL_IGNORE_ENABLE = 8, - TRACE_EVENT_FL_TRACEPOINT = 16, - TRACE_EVENT_FL_KPROBE = 32, - TRACE_EVENT_FL_UPROBE = 64, -}; - -enum { - EVENT_FILE_FL_ENABLED_BIT = 0, - EVENT_FILE_FL_RECORDED_CMD_BIT = 1, - EVENT_FILE_FL_RECORDED_TGID_BIT = 2, - EVENT_FILE_FL_FILTERED_BIT = 3, - EVENT_FILE_FL_NO_SET_FILTER_BIT = 4, - EVENT_FILE_FL_SOFT_MODE_BIT = 5, - EVENT_FILE_FL_SOFT_DISABLED_BIT = 6, - EVENT_FILE_FL_TRIGGER_MODE_BIT = 7, - EVENT_FILE_FL_TRIGGER_COND_BIT = 8, - EVENT_FILE_FL_PID_FILTER_BIT = 9, - EVENT_FILE_FL_WAS_ENABLED_BIT = 10, -}; - -enum { - EVENT_FILE_FL_ENABLED = 1, - EVENT_FILE_FL_RECORDED_CMD = 2, - EVENT_FILE_FL_RECORDED_TGID = 4, - EVENT_FILE_FL_FILTERED = 8, - EVENT_FILE_FL_NO_SET_FILTER = 16, - EVENT_FILE_FL_SOFT_MODE = 32, - EVENT_FILE_FL_SOFT_DISABLED = 64, - EVENT_FILE_FL_TRIGGER_MODE = 128, - EVENT_FILE_FL_TRIGGER_COND = 256, - EVENT_FILE_FL_PID_FILTER = 512, - EVENT_FILE_FL_WAS_ENABLED = 1024, -}; - -enum event_trigger_type { - ETT_NONE = 0, - ETT_TRACE_ONOFF = 1, - ETT_SNAPSHOT = 2, - ETT_STACKTRACE = 4, - ETT_EVENT_ENABLE = 8, - ETT_EVENT_HIST = 16, - ETT_HIST_ENABLE = 32, -}; - -enum { - FILTER_OTHER = 0, - FILTER_STATIC_STRING = 1, - FILTER_DYN_STRING = 2, - FILTER_PTR_STRING = 3, - FILTER_TRACE_FN = 4, - FILTER_COMM = 5, - FILTER_CPU = 6, -}; - -struct property { - char *name; - int length; - void *value; - struct property *next; -}; - -struct irq_fwspec { - struct fwnode_handle *fwnode; - int param_count; - u32 param[16]; -}; - -struct irq_data; - -struct irq_domain_ops { - int (*match)(struct irq_domain *, struct device_node *, enum irq_domain_bus_token); - int (*select)(struct irq_domain *, struct irq_fwspec *, enum irq_domain_bus_token); - int (*map)(struct irq_domain *, unsigned int, irq_hw_number_t); - void (*unmap)(struct irq_domain *, unsigned int); - int (*xlate)(struct irq_domain *, struct device_node *, const u32 *, unsigned int, long unsigned int *, unsigned int *); - int (*alloc)(struct irq_domain *, unsigned int, unsigned int, void *); - void (*free)(struct irq_domain *, unsigned int, unsigned int); - int (*activate)(struct irq_domain *, struct irq_data *, bool); - void (*deactivate)(struct irq_domain *, struct irq_data *); - int (*translate)(struct irq_domain *, struct irq_fwspec *, long unsigned int *, unsigned int *); -}; - -struct acpi_table_header { - char signature[4]; - u32 length; - u8 revision; - u8 checksum; - char oem_id[6]; - char oem_table_id[8]; - u32 oem_revision; - char asl_compiler_id[4]; - u32 asl_compiler_revision; -}; - -struct acpi_generic_address { - u8 space_id; - u8 bit_width; - u8 bit_offset; - u8 access_width; - u64 address; -} __attribute__((packed)); - -struct acpi_table_fadt { - struct acpi_table_header header; - u32 facs; - u32 dsdt; - u8 model; - u8 preferred_profile; - u16 sci_interrupt; - u32 smi_command; - u8 acpi_enable; - u8 acpi_disable; - u8 s4_bios_request; - u8 pstate_control; - u32 pm1a_event_block; - u32 pm1b_event_block; - u32 pm1a_control_block; - u32 pm1b_control_block; - u32 pm2_control_block; - u32 pm_timer_block; - u32 gpe0_block; - u32 gpe1_block; - u8 pm1_event_length; - u8 pm1_control_length; - u8 pm2_control_length; - u8 pm_timer_length; - u8 gpe0_block_length; - u8 gpe1_block_length; - u8 gpe1_base; - u8 cst_control; - u16 c2_latency; - u16 c3_latency; - u16 flush_size; - u16 flush_stride; - u8 duty_offset; - u8 duty_width; - u8 day_alarm; - u8 month_alarm; - u8 century; - u16 boot_flags; - u8 reserved; - u32 flags; - struct acpi_generic_address reset_register; - u8 reset_value; - u16 arm_boot_flags; - u8 minor_revision; - u64 Xfacs; - u64 Xdsdt; - struct acpi_generic_address xpm1a_event_block; - struct acpi_generic_address xpm1b_event_block; - struct acpi_generic_address xpm1a_control_block; - struct acpi_generic_address xpm1b_control_block; - struct acpi_generic_address xpm2_control_block; - struct acpi_generic_address xpm_timer_block; - struct acpi_generic_address xgpe0_block; - struct acpi_generic_address xgpe1_block; - struct acpi_generic_address sleep_control; - struct acpi_generic_address sleep_status; - u64 hypervisor_id; -} __attribute__((packed)); - -enum wb_stat_item { - WB_RECLAIMABLE = 0, - WB_WRITEBACK = 1, - WB_DIRTIED = 2, - WB_WRITTEN = 3, - NR_WB_STAT_ITEMS = 4, -}; - -struct bdi_writeback_congested { - long unsigned int state; - refcount_t refcnt; -}; - -enum stat_group { - STAT_READ = 0, - STAT_WRITE = 1, - STAT_DISCARD = 2, - STAT_FLUSH = 3, - NR_STAT_GROUPS = 4, -}; - -struct disk_stats { - u64 nsecs[4]; - long unsigned int sectors[4]; - long unsigned int ios[4]; - long unsigned int merges[4]; - long unsigned int io_ticks; - long unsigned int time_in_queue; - local_t in_flight[2]; -}; - -struct partition_meta_info { - char uuid[37]; - u8 volname[64]; -}; - -struct disk_part_tbl { - struct callback_head callback_head; - int len; - struct hd_struct *last_lookup; - struct hd_struct *part[0]; -}; - -struct blk_zone; - -typedef int (*report_zones_cb)(struct blk_zone *, unsigned int, void *); - -struct hd_geometry; - -struct pr_ops; - -struct block_device_operations { - int (*open)(struct block_device *, fmode_t); - void (*release)(struct gendisk *, fmode_t); - int (*rw_page)(struct block_device *, sector_t, struct page *, unsigned int); - int (*ioctl)(struct block_device *, fmode_t, unsigned int, long unsigned int); - int (*compat_ioctl)(struct block_device *, fmode_t, unsigned int, long unsigned int); - unsigned int (*check_events)(struct gendisk *, unsigned int); - int (*media_changed)(struct gendisk *); - void (*unlock_native_capacity)(struct gendisk *); - int (*revalidate_disk)(struct gendisk *); - int (*getgeo)(struct block_device *, struct hd_geometry *); - void (*swap_slot_free_notify)(struct block_device *, long unsigned int); - int (*report_zones)(struct gendisk *, sector_t, unsigned int, report_zones_cb, void *); - struct module *owner; - const struct pr_ops *pr_ops; -}; - -struct sg_io_v4 { - __s32 guard; - __u32 protocol; - __u32 subprotocol; - __u32 request_len; - __u64 request; - __u64 request_tag; - __u32 request_attr; - __u32 request_priority; - __u32 request_extra; - __u32 max_response_len; - __u64 response; - __u32 dout_iovec_count; - __u32 dout_xfer_len; - __u32 din_iovec_count; - __u32 din_xfer_len; - __u64 dout_xferp; - __u64 din_xferp; - __u32 timeout; - __u32 flags; - __u64 usr_ptr; - __u32 spare_in; - __u32 driver_status; - __u32 transport_status; - __u32 device_status; - __u32 retry_delay; - __u32 info; - __u32 duration; - __u32 response_len; - __s32 din_resid; - __s32 dout_resid; - __u64 generated_tag; - __u32 spare_out; - __u32 padding; -}; - -struct bsg_ops { - int (*check_proto)(struct sg_io_v4 *); - int (*fill_hdr)(struct request *, struct sg_io_v4 *, fmode_t); - int (*complete_rq)(struct request *, struct sg_io_v4 *); - void (*free_rq)(struct request *); -}; - -typedef __u32 req_flags_t; - -typedef void rq_end_io_fn(struct request *, blk_status_t); - -enum mq_rq_state { - MQ_RQ_IDLE = 0, - MQ_RQ_IN_FLIGHT = 1, - MQ_RQ_COMPLETE = 2, -}; - -struct request { - struct request_queue *q; - struct blk_mq_ctx *mq_ctx; - struct blk_mq_hw_ctx *mq_hctx; - unsigned int cmd_flags; - req_flags_t rq_flags; - int tag; - int internal_tag; - unsigned int __data_len; - sector_t __sector; - struct bio *bio; - struct bio *biotail; - struct list_head queuelist; - union { - struct hlist_node hash; - struct list_head ipi_list; - }; - union { - struct rb_node rb_node; - struct bio_vec special_vec; - void *completion_data; - int error_count; - }; - union { - struct { - struct io_cq *icq; - void *priv[2]; - } elv; - struct { - unsigned int seq; - struct list_head list; - rq_end_io_fn *saved_end_io; - } flush; - }; - struct gendisk *rq_disk; - struct hd_struct *part; - u64 start_time_ns; - u64 io_start_time_ns; - short unsigned int stats_sectors; - short unsigned int nr_phys_segments; - short unsigned int write_hint; - short unsigned int ioprio; - unsigned int extra_len; - enum mq_rq_state state; - refcount_t ref; - unsigned int timeout; - long unsigned int deadline; - union { - struct __call_single_data csd; - u64 fifo_time; - }; - rq_end_io_fn *end_io; - void *end_io_data; -}; - -struct blk_zone { - __u64 start; - __u64 len; - __u64 wp; - __u8 type; - __u8 cond; - __u8 non_seq; - __u8 reset; - __u8 reserved[36]; -}; - -enum elv_merge { - ELEVATOR_NO_MERGE = 0, - ELEVATOR_FRONT_MERGE = 1, - ELEVATOR_BACK_MERGE = 2, - ELEVATOR_DISCARD_MERGE = 3, -}; - -struct elevator_type; - -struct blk_mq_alloc_data; - -struct elevator_mq_ops { - int (*init_sched)(struct request_queue *, struct elevator_type *); - void (*exit_sched)(struct elevator_queue *); - int (*init_hctx)(struct blk_mq_hw_ctx *, unsigned int); - void (*exit_hctx)(struct blk_mq_hw_ctx *, unsigned int); - void (*depth_updated)(struct blk_mq_hw_ctx *); - bool (*allow_merge)(struct request_queue *, struct request *, struct bio *); - bool (*bio_merge)(struct blk_mq_hw_ctx *, struct bio *, unsigned int); - int (*request_merge)(struct request_queue *, struct request **, struct bio *); - void (*request_merged)(struct request_queue *, struct request *, enum elv_merge); - void (*requests_merged)(struct request_queue *, struct request *, struct request *); - void (*limit_depth)(unsigned int, struct blk_mq_alloc_data *); - void (*prepare_request)(struct request *, struct bio *); - void (*finish_request)(struct request *); - void (*insert_requests)(struct blk_mq_hw_ctx *, struct list_head *, bool); - struct request * (*dispatch_request)(struct blk_mq_hw_ctx *); - bool (*has_work)(struct blk_mq_hw_ctx *); - void (*completed_request)(struct request *, u64); - void (*requeue_request)(struct request *); - struct request * (*former_request)(struct request_queue *, struct request *); - struct request * (*next_request)(struct request_queue *, struct request *); - void (*init_icq)(struct io_cq *); - void (*exit_icq)(struct io_cq *); -}; - -struct elv_fs_entry; - -struct blk_mq_debugfs_attr; - -struct elevator_type { - struct kmem_cache *icq_cache; - struct elevator_mq_ops ops; - size_t icq_size; - size_t icq_align; - struct elv_fs_entry *elevator_attrs; - const char *elevator_name; - const char *elevator_alias; - const unsigned int elevator_features; - struct module *elevator_owner; - const struct blk_mq_debugfs_attr *queue_debugfs_attrs; - const struct blk_mq_debugfs_attr *hctx_debugfs_attrs; - char icq_cache_name[22]; - struct list_head list; -}; - -struct elevator_queue { - struct elevator_type *type; - void *elevator_data; - struct kobject kobj; - struct mutex sysfs_lock; - unsigned int registered: 1; - struct hlist_head hash[64]; -}; - -struct elv_fs_entry { - struct attribute attr; - ssize_t (*show)(struct elevator_queue *, char *); - ssize_t (*store)(struct elevator_queue *, const char *, size_t); -}; - -struct blk_mq_debugfs_attr { - const char *name; - umode_t mode; - int (*show)(void *, struct seq_file *); - ssize_t (*write)(void *, const char *, size_t, loff_t *); - const struct seq_operations *seq_ops; +struct cea_exception_stacks { + char DF_stack_guard[4096]; + char DF_stack[4096]; + char NMI_stack_guard[4096]; + char NMI_stack[4096]; + char DB2_stack_guard[4096]; + char DB2_stack[4096]; + char DB1_stack_guard[4096]; + char DB1_stack[4096]; + char DB_stack_guard[4096]; + char DB_stack[4096]; + char MCE_stack_guard[4096]; + char MCE_stack[4096]; + char IST_top_guard[4096]; }; -struct blk_mq_queue_data; - -typedef blk_status_t queue_rq_fn(struct blk_mq_hw_ctx *, const struct blk_mq_queue_data *); - -typedef void commit_rqs_fn(struct blk_mq_hw_ctx *); - -typedef bool get_budget_fn(struct blk_mq_hw_ctx *); - -typedef void put_budget_fn(struct blk_mq_hw_ctx *); - -enum blk_eh_timer_return { - BLK_EH_DONE = 0, - BLK_EH_RESET_TIMER = 1, +struct cpu_entry_area { + char gdt[4096]; + struct entry_stack_page entry_stack_page; + struct tss_struct tss; + struct cea_exception_stacks estacks; + struct debug_store cpu_debug_store; + struct debug_store_buffers cpu_debug_buffers; }; -typedef enum blk_eh_timer_return timeout_fn(struct request *, bool); - -typedef int poll_fn(struct blk_mq_hw_ctx *); - -typedef void complete_fn(struct request *); - -typedef int init_hctx_fn(struct blk_mq_hw_ctx *, void *, unsigned int); - -typedef void exit_hctx_fn(struct blk_mq_hw_ctx *, unsigned int); - -typedef int init_request_fn(struct blk_mq_tag_set *, struct request *, unsigned int, unsigned int); - -typedef void exit_request_fn(struct blk_mq_tag_set *, struct request *, unsigned int); +struct gdt_page { + struct desc_struct gdt[16]; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; +}; -typedef void cleanup_rq_fn(struct request *); +struct tlb_context { + u64 ctx_id; + u64 tlb_gen; +}; -typedef bool busy_fn(struct request_queue *); - -typedef int map_queues_fn(struct blk_mq_tag_set *); - -struct blk_mq_ops { - queue_rq_fn *queue_rq; - commit_rqs_fn *commit_rqs; - get_budget_fn *get_budget; - put_budget_fn *put_budget; - timeout_fn *timeout; - poll_fn *poll; - complete_fn *complete; - init_hctx_fn *init_hctx; - exit_hctx_fn *exit_hctx; - init_request_fn *init_request; - exit_request_fn *exit_request; - void (*initialize_rq_fn)(struct request *); - cleanup_rq_fn *cleanup_rq; - busy_fn *busy; - map_queues_fn *map_queues; - void (*show_rq)(struct seq_file *, struct request *); -}; - -enum pr_type { - PR_WRITE_EXCLUSIVE = 1, - PR_EXCLUSIVE_ACCESS = 2, - PR_WRITE_EXCLUSIVE_REG_ONLY = 3, - PR_EXCLUSIVE_ACCESS_REG_ONLY = 4, - PR_WRITE_EXCLUSIVE_ALL_REGS = 5, - PR_EXCLUSIVE_ACCESS_ALL_REGS = 6, -}; - -struct pr_ops { - int (*pr_register)(struct block_device *, u64, u64, u32); - int (*pr_reserve)(struct block_device *, u64, enum pr_type, u32); - int (*pr_release)(struct block_device *, u64, enum pr_type); - int (*pr_preempt)(struct block_device *, u64, u64, enum pr_type, bool); - int (*pr_clear)(struct block_device *, u64); +struct tlb_state { + struct mm_struct *loaded_mm; + union { + struct mm_struct *last_user_mm; + long unsigned int last_user_mm_ibpb; + }; + u16 loaded_mm_asid; + u16 next_asid; + bool is_lazy; + bool invalidate_other; + short unsigned int user_pcid_flush_mask; + long unsigned int cr4; + struct tlb_context ctxs[6]; }; -enum cpu_idle_type { - CPU_IDLE = 0, - CPU_NOT_IDLE = 1, - CPU_NEWLY_IDLE = 2, - CPU_MAX_IDLE_TYPES = 3, +enum e820_type { + E820_TYPE_RAM = 1, + E820_TYPE_RESERVED = 2, + E820_TYPE_ACPI = 3, + E820_TYPE_NVS = 4, + E820_TYPE_UNUSABLE = 5, + E820_TYPE_PMEM = 7, + E820_TYPE_PRAM = 12, + E820_TYPE_SOFT_RESERVED = 4026531839, + E820_TYPE_RESERVED_KERN = 128, }; -typedef long unsigned int efi_status_t; - -typedef u8 efi_bool_t; - -typedef u16 efi_char16_t; - -typedef u64 efi_physical_addr_t; - -typedef void *efi_handle_t; - -typedef guid_t efi_guid_t; - -typedef struct { - u64 signature; - u32 revision; - u32 headersize; - u32 crc32; - u32 reserved; -} efi_table_hdr_t; - -typedef struct { - u32 type; - u32 pad; - u64 phys_addr; - u64 virt_addr; - u64 num_pages; - u64 attribute; -} efi_memory_desc_t; - -typedef struct { - efi_guid_t guid; - u32 headersize; - u32 flags; - u32 imagesize; -} efi_capsule_header_t; - -typedef struct { - u16 year; - u8 month; - u8 day; - u8 hour; - u8 minute; - u8 second; - u8 pad1; - u32 nanosecond; - s16 timezone; - u8 daylight; - u8 pad2; -} efi_time_t; - -typedef struct { - u32 resolution; - u32 accuracy; - u8 sets_to_zero; -} efi_time_cap_t; - -typedef struct { - efi_table_hdr_t hdr; - void *raise_tpl; - void *restore_tpl; - efi_status_t (*allocate_pages)(int, int, long unsigned int, efi_physical_addr_t *); - efi_status_t (*free_pages)(efi_physical_addr_t, long unsigned int); - efi_status_t (*get_memory_map)(long unsigned int *, void *, long unsigned int *, long unsigned int *, u32 *); - efi_status_t (*allocate_pool)(int, long unsigned int, void **); - efi_status_t (*free_pool)(void *); - void *create_event; - void *set_timer; - void *wait_for_event; - void *signal_event; - void *close_event; - void *check_event; - void *install_protocol_interface; - void *reinstall_protocol_interface; - void *uninstall_protocol_interface; - efi_status_t (*handle_protocol)(efi_handle_t, efi_guid_t *, void **); - void *__reserved; - void *register_protocol_notify; - efi_status_t (*locate_handle)(int, efi_guid_t *, void *, long unsigned int *, efi_handle_t *); - void *locate_device_path; - efi_status_t (*install_configuration_table)(efi_guid_t *, void *); - void *load_image; - void *start_image; - void *exit; - void *unload_image; - efi_status_t (*exit_boot_services)(efi_handle_t, long unsigned int); - void *get_next_monotonic_count; - void *stall; - void *set_watchdog_timer; - void *connect_controller; - void *disconnect_controller; - void *open_protocol; - void *close_protocol; - void *open_protocol_information; - void *protocols_per_handle; - void *locate_handle_buffer; - efi_status_t (*locate_protocol)(efi_guid_t *, void *, void **); - void *install_multiple_protocol_interfaces; - void *uninstall_multiple_protocol_interfaces; - void *calculate_crc32; - void *copy_mem; - void *set_mem; - void *create_event_ex; -} efi_boot_services_t; - -typedef efi_status_t efi_get_time_t(efi_time_t *, efi_time_cap_t *); - -typedef efi_status_t efi_set_time_t(efi_time_t *); - -typedef efi_status_t efi_get_wakeup_time_t(efi_bool_t *, efi_bool_t *, efi_time_t *); - -typedef efi_status_t efi_set_wakeup_time_t(efi_bool_t, efi_time_t *); - -typedef efi_status_t efi_get_variable_t(efi_char16_t *, efi_guid_t *, u32 *, long unsigned int *, void *); - -typedef efi_status_t efi_get_next_variable_t(long unsigned int *, efi_char16_t *, efi_guid_t *); - -typedef efi_status_t efi_set_variable_t(efi_char16_t *, efi_guid_t *, u32, long unsigned int, void *); - -typedef efi_status_t efi_get_next_high_mono_count_t(u32 *); - -typedef void efi_reset_system_t(int, efi_status_t, long unsigned int, efi_char16_t *); +struct e820_entry { + u64 addr; + u64 size; + enum e820_type type; +} __attribute__((packed)); -typedef efi_status_t efi_set_virtual_address_map_t(long unsigned int, long unsigned int, u32, efi_memory_desc_t *); +struct e820_table { + __u32 nr_entries; + struct e820_entry entries[320]; +} __attribute__((packed)); -typedef efi_status_t efi_query_variable_info_t(u32, u64 *, u64 *, u64 *); +struct boot_params_to_save { + unsigned int start; + unsigned int len; +}; -typedef efi_status_t efi_update_capsule_t(efi_capsule_header_t **, long unsigned int, long unsigned int); +struct idr { + struct xarray idr_rt; + unsigned int idr_base; + unsigned int idr_next; +}; -typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **, long unsigned int, u64 *, int *); +struct kernfs_root; -typedef struct { - efi_table_hdr_t hdr; - efi_get_time_t *get_time; - efi_set_time_t *set_time; - efi_get_wakeup_time_t *get_wakeup_time; - efi_set_wakeup_time_t *set_wakeup_time; - efi_set_virtual_address_map_t *set_virtual_address_map; - void *convert_pointer; - efi_get_variable_t *get_variable; - efi_get_next_variable_t *get_next_variable; - efi_set_variable_t *set_variable; - efi_get_next_high_mono_count_t *get_next_high_mono_count; - efi_reset_system_t *reset_system; - efi_update_capsule_t *update_capsule; - efi_query_capsule_caps_t *query_capsule_caps; - efi_query_variable_info_t *query_variable_info; -} efi_runtime_services_t; +struct kernfs_elem_dir { + long unsigned int subdirs; + struct rb_root children; + struct kernfs_root *root; +}; -typedef struct { - efi_table_hdr_t hdr; - long unsigned int fw_vendor; - u32 fw_revision; - long unsigned int con_in_handle; - long unsigned int con_in; - long unsigned int con_out_handle; - long unsigned int con_out; - long unsigned int stderr_handle; - long unsigned int stderr; - efi_runtime_services_t *runtime; - efi_boot_services_t *boottime; - long unsigned int nr_tables; - long unsigned int tables; -} efi_system_table_t; +struct kernfs_syscall_ops; -struct efi_memory_map { - phys_addr_t phys_map; - void *map; - void *map_end; - int nr_map; - long unsigned int desc_version; - long unsigned int desc_size; - bool late; +struct kernfs_root { + struct kernfs_node *kn; + unsigned int flags; + struct idr ino_idr; + u32 last_id_lowbits; + u32 id_highbits; + struct kernfs_syscall_ops *syscall_ops; + struct list_head supers; + wait_queue_head_t deactivate_waitq; }; -struct efi { - efi_system_table_t *systab; - unsigned int runtime_version; - long unsigned int mps; - long unsigned int acpi; - long unsigned int acpi20; - long unsigned int smbios; - long unsigned int smbios3; - long unsigned int boot_info; - long unsigned int hcdp; - long unsigned int uga; - long unsigned int fw_vendor; - long unsigned int runtime; - long unsigned int config_table; - long unsigned int esrt; - long unsigned int properties_table; - long unsigned int mem_attr_table; - long unsigned int rng_seed; - long unsigned int tpm_log; - long unsigned int tpm_final_log; - long unsigned int mem_reserve; - efi_get_time_t *get_time; - efi_set_time_t *set_time; - efi_get_wakeup_time_t *get_wakeup_time; - efi_set_wakeup_time_t *set_wakeup_time; - efi_get_variable_t *get_variable; - efi_get_next_variable_t *get_next_variable; - efi_set_variable_t *set_variable; - efi_set_variable_t *set_variable_nonblocking; - efi_query_variable_info_t *query_variable_info; - efi_query_variable_info_t *query_variable_info_nonblocking; - efi_update_capsule_t *update_capsule; - efi_query_capsule_caps_t *query_capsule_caps; - efi_get_next_high_mono_count_t *get_next_high_mono_count; - efi_reset_system_t *reset_system; - efi_set_virtual_address_map_t *set_virtual_address_map; - struct efi_memory_map memmap; - long unsigned int flags; +struct kernfs_elem_symlink { + struct kernfs_node *target_kn; }; -struct percpu_cluster { - struct swap_cluster_info index; - unsigned int next; -}; +struct kernfs_ops; -struct trace_event_raw_initcall_level { - struct trace_entry ent; - u32 __data_loc_level; - char __data[0]; -}; +struct kernfs_open_node; -struct trace_event_raw_initcall_start { - struct trace_entry ent; - initcall_t func; - char __data[0]; +struct kernfs_elem_attr { + const struct kernfs_ops *ops; + struct kernfs_open_node *open; + loff_t size; + struct kernfs_node *notify_next; }; -struct trace_event_raw_initcall_finish { - struct trace_entry ent; - initcall_t func; - int ret; - char __data[0]; -}; +struct kernfs_iattrs; -struct trace_event_data_offsets_initcall_level { - u32 level; +struct kernfs_node { + atomic_t count; + atomic_t active; + struct kernfs_node *parent; + const char *name; + struct rb_node rb; + const void *ns; + unsigned int hash; + union { + struct kernfs_elem_dir dir; + struct kernfs_elem_symlink symlink; + struct kernfs_elem_attr attr; + }; + void *priv; + u64 id; + short unsigned int flags; + umode_t mode; + struct kernfs_iattrs *iattr; }; -struct trace_event_data_offsets_initcall_start {}; - -struct trace_event_data_offsets_initcall_finish {}; +struct kernfs_open_file; -struct blacklist_entry { - struct list_head next; - char *buf; +struct kernfs_ops { + int (*open)(struct kernfs_open_file *); + void (*release)(struct kernfs_open_file *); + int (*seq_show)(struct seq_file *, void *); + void * (*seq_start)(struct seq_file *, loff_t *); + void * (*seq_next)(struct seq_file *, void *, loff_t *); + void (*seq_stop)(struct seq_file *, void *); + ssize_t (*read)(struct kernfs_open_file *, char *, size_t, loff_t); + size_t atomic_write_len; + bool prealloc; + ssize_t (*write)(struct kernfs_open_file *, char *, size_t, loff_t); + __poll_t (*poll)(struct kernfs_open_file *, struct poll_table_struct *); + int (*mmap)(struct kernfs_open_file *, struct vm_area_struct *); }; -enum page_cache_mode { - _PAGE_CACHE_MODE_WB = 0, - _PAGE_CACHE_MODE_WC = 1, - _PAGE_CACHE_MODE_UC_MINUS = 2, - _PAGE_CACHE_MODE_UC = 3, - _PAGE_CACHE_MODE_WT = 4, - _PAGE_CACHE_MODE_WP = 5, - _PAGE_CACHE_MODE_NUM = 8, +struct kernfs_syscall_ops { + int (*show_options)(struct seq_file *, struct kernfs_root *); + int (*mkdir)(struct kernfs_node *, const char *, umode_t); + int (*rmdir)(struct kernfs_node *); + int (*rename)(struct kernfs_node *, struct kernfs_node *, const char *); + int (*show_path)(struct seq_file *, struct kernfs_node *, struct kernfs_root *); }; -enum { - UNAME26 = 131072, - ADDR_NO_RANDOMIZE = 262144, - FDPIC_FUNCPTRS = 524288, - MMAP_PAGE_ZERO = 1048576, - ADDR_COMPAT_LAYOUT = 2097152, - READ_IMPLIES_EXEC = 4194304, - ADDR_LIMIT_32BIT = 8388608, - SHORT_INODE = 16777216, - WHOLE_SECONDS = 33554432, - STICKY_TIMEOUTS = 67108864, - ADDR_LIMIT_3GB = 134217728, +struct kernfs_open_file { + struct kernfs_node *kn; + struct file *file; + struct seq_file *seq_file; + void *priv; + struct mutex mutex; + struct mutex prealloc_mutex; + int event; + struct list_head list; + char *prealloc_buf; + size_t atomic_write_len; + bool mmapped: 1; + bool released: 1; + const struct vm_operations_struct *vm_ops; }; -enum tlb_infos { - ENTRIES = 0, - NR_INFO = 1, +enum kobj_ns_type { + KOBJ_NS_TYPE_NONE = 0, + KOBJ_NS_TYPE_NET = 1, + KOBJ_NS_TYPES = 2, }; -enum { - MM_FILEPAGES = 0, - MM_ANONPAGES = 1, - MM_SWAPENTS = 2, - MM_SHMEMPAGES = 3, - NR_MM_COUNTERS = 4, +struct sock; + +struct kobj_ns_type_operations { + enum kobj_ns_type type; + bool (*current_may_mount)(); + void * (*grab_current_ns)(); + const void * (*netlink_ns)(struct sock *); + const void * (*initial_ns)(); + void (*drop_ns)(void *); }; -typedef __u32 Elf32_Word; +struct bin_attribute; -struct elf32_note { - Elf32_Word n_namesz; - Elf32_Word n_descsz; - Elf32_Word n_type; +struct attribute_group { + const char *name; + umode_t (*is_visible)(struct kobject *, struct attribute *, int); + umode_t (*is_bin_visible)(struct kobject *, struct bin_attribute *, int); + struct attribute **attrs; + struct bin_attribute **bin_attrs; }; -enum pcpu_fc { - PCPU_FC_AUTO = 0, - PCPU_FC_EMBED = 1, - PCPU_FC_PAGE = 2, - PCPU_FC_NR = 3, +struct bin_attribute { + struct attribute attr; + size_t size; + void *private; + ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t, size_t); + ssize_t (*write)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t, size_t); + int (*mmap)(struct file *, struct kobject *, struct bin_attribute *, struct vm_area_struct *); }; -enum hrtimer_base_type { - HRTIMER_BASE_MONOTONIC = 0, - HRTIMER_BASE_REALTIME = 1, - HRTIMER_BASE_BOOTTIME = 2, - HRTIMER_BASE_TAI = 3, - HRTIMER_BASE_MONOTONIC_SOFT = 4, - HRTIMER_BASE_REALTIME_SOFT = 5, - HRTIMER_BASE_BOOTTIME_SOFT = 6, - HRTIMER_BASE_TAI_SOFT = 7, - HRTIMER_MAX_CLOCK_BASES = 8, +struct sysfs_ops { + ssize_t (*show)(struct kobject *, struct attribute *, char *); + ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); }; -enum rseq_cs_flags_bit { - RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT = 0, - RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT = 1, - RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT = 2, -}; +struct kset_uevent_ops; -enum perf_event_task_context { - perf_invalid_context = -1, - perf_hw_context = 0, - perf_sw_context = 1, - perf_nr_task_contexts = 2, +struct kset { + struct list_head list; + spinlock_t list_lock; + struct kobject kobj; + const struct kset_uevent_ops *uevent_ops; }; -enum rseq_event_mask_bits { - RSEQ_EVENT_PREEMPT_BIT = 0, - RSEQ_EVENT_SIGNAL_BIT = 1, - RSEQ_EVENT_MIGRATE_BIT = 2, +struct kobj_type { + void (*release)(struct kobject *); + const struct sysfs_ops *sysfs_ops; + struct attribute **default_attrs; + const struct attribute_group **default_groups; + const struct kobj_ns_type_operations * (*child_ns_type)(struct kobject *); + const void * (*namespace)(struct kobject *); + void (*get_ownership)(struct kobject *, kuid_t *, kgid_t *); }; -enum { - PROC_ROOT_INO = 1, - PROC_IPC_INIT_INO = -268435457, - PROC_UTS_INIT_INO = -268435458, - PROC_USER_INIT_INO = -268435459, - PROC_PID_INIT_INO = -268435460, - PROC_CGROUP_INIT_INO = -268435461, +struct kobj_uevent_env { + char *argv[3]; + char *envp[32]; + int envp_idx; + char buf[2048]; + int buflen; }; -typedef __u16 __le16; +struct kset_uevent_ops { + int (* const filter)(struct kset *, struct kobject *); + const char * (* const name)(struct kset *, struct kobject *); + int (* const uevent)(struct kset *, struct kobject *, struct kobj_uevent_env *); +}; -typedef __u16 __be16; - -typedef __u32 __be32; - -typedef __u64 __be64; - -typedef __u32 __wsum; - -typedef unsigned int slab_flags_t; - -struct notifier_block; - -typedef int (*notifier_fn_t)(struct notifier_block *, long unsigned int, void *); - -struct notifier_block { - notifier_fn_t notifier_call; - struct notifier_block *next; - int priority; +struct dev_pm_ops { + int (*prepare)(struct device *); + void (*complete)(struct device *); + int (*suspend)(struct device *); + int (*resume)(struct device *); + int (*freeze)(struct device *); + int (*thaw)(struct device *); + int (*poweroff)(struct device *); + int (*restore)(struct device *); + int (*suspend_late)(struct device *); + int (*resume_early)(struct device *); + int (*freeze_late)(struct device *); + int (*thaw_early)(struct device *); + int (*poweroff_late)(struct device *); + int (*restore_early)(struct device *); + int (*suspend_noirq)(struct device *); + int (*resume_noirq)(struct device *); + int (*freeze_noirq)(struct device *); + int (*thaw_noirq)(struct device *); + int (*poweroff_noirq)(struct device *); + int (*restore_noirq)(struct device *); + int (*runtime_suspend)(struct device *); + int (*runtime_resume)(struct device *); + int (*runtime_idle)(struct device *); }; -struct raw_notifier_head { - struct notifier_block *head; +struct pm_subsys_data { + spinlock_t lock; + unsigned int refcount; + struct list_head clock_list; }; -struct llist_head { - struct llist_node *first; +struct wakeup_source { + const char *name; + int id; + struct list_head entry; + spinlock_t lock; + struct wake_irq *wakeirq; + struct timer_list timer; + long unsigned int timer_expires; + ktime_t total_time; + ktime_t max_time; + ktime_t last_time; + ktime_t start_prevent_time; + ktime_t prevent_sleep_time; + long unsigned int event_count; + long unsigned int active_count; + long unsigned int relax_count; + long unsigned int expire_count; + long unsigned int wakeup_count; + struct device *dev; + bool active: 1; + bool autosleep_enabled: 1; }; -typedef struct __call_single_data call_single_data_t; +struct dev_pm_domain { + struct dev_pm_ops ops; + int (*start)(struct device *); + void (*detach)(struct device *, bool); + int (*activate)(struct device *); + void (*sync)(struct device *); + void (*dismiss)(struct device *); +}; -typedef __u64 __addrpair; +struct ratelimit_state { + raw_spinlock_t lock; + int interval; + int burst; + int printed; + int missed; + long unsigned int begin; + long unsigned int flags; +}; -typedef __u32 __portpair; +struct iommu_ops; -typedef struct { - struct net *net; -} possible_net_t; +struct subsys_private; -struct in6_addr { - union { - __u8 u6_addr8[16]; - __be16 u6_addr16[8]; - __be32 u6_addr32[4]; - } in6_u; +struct bus_type { + const char *name; + const char *dev_name; + struct device *dev_root; + const struct attribute_group **bus_groups; + const struct attribute_group **dev_groups; + const struct attribute_group **drv_groups; + int (*match)(struct device *, struct device_driver *); + int (*uevent)(struct device *, struct kobj_uevent_env *); + int (*probe)(struct device *); + void (*sync_state)(struct device *); + int (*remove)(struct device *); + void (*shutdown)(struct device *); + int (*online)(struct device *); + int (*offline)(struct device *); + int (*suspend)(struct device *, pm_message_t); + int (*resume)(struct device *); + int (*num_vf)(struct device *); + int (*dma_configure)(struct device *); + const struct dev_pm_ops *pm; + const struct iommu_ops *iommu_ops; + struct subsys_private *p; + struct lock_class_key lock_key; + bool need_parent_lock; }; -struct hlist_nulls_node { - struct hlist_nulls_node *next; - struct hlist_nulls_node **pprev; +enum probe_type { + PROBE_DEFAULT_STRATEGY = 0, + PROBE_PREFER_ASYNCHRONOUS = 1, + PROBE_FORCE_SYNCHRONOUS = 2, }; -struct proto; +struct of_device_id; -struct inet_timewait_death_row; +struct acpi_device_id; -struct sock_common { - union { - __addrpair skc_addrpair; - struct { - __be32 skc_daddr; - __be32 skc_rcv_saddr; - }; - }; - union { - unsigned int skc_hash; - __u16 skc_u16hashes[2]; - }; - union { - __portpair skc_portpair; - struct { - __be16 skc_dport; - __u16 skc_num; - }; - }; - short unsigned int skc_family; - volatile unsigned char skc_state; - unsigned char skc_reuse: 4; - unsigned char skc_reuseport: 1; - unsigned char skc_ipv6only: 1; - unsigned char skc_net_refcnt: 1; - int skc_bound_dev_if; - union { - struct hlist_node skc_bind_node; - struct hlist_node skc_portaddr_node; - }; - struct proto *skc_prot; - possible_net_t skc_net; - struct in6_addr skc_v6_daddr; - struct in6_addr skc_v6_rcv_saddr; - atomic64_t skc_cookie; - union { - long unsigned int skc_flags; - struct sock *skc_listener; - struct inet_timewait_death_row *skc_tw_dr; - }; - int skc_dontcopy_begin[0]; - union { - struct hlist_node skc_node; - struct hlist_nulls_node skc_nulls_node; - }; - short unsigned int skc_tx_queue_mapping; - short unsigned int skc_rx_queue_mapping; - union { - int skc_incoming_cpu; - u32 skc_rcv_wnd; - u32 skc_tw_rcv_nxt; - }; - refcount_t skc_refcnt; - int skc_dontcopy_end[0]; - union { - u32 skc_rxhash; - u32 skc_window_clamp; - u32 skc_tw_snd_nxt; - }; +struct driver_private; + +struct device_driver { + const char *name; + struct bus_type *bus; + struct module *owner; + const char *mod_name; + bool suppress_bind_attrs; + enum probe_type probe_type; + const struct of_device_id *of_match_table; + const struct acpi_device_id *acpi_match_table; + int (*probe)(struct device *); + void (*sync_state)(struct device *); + int (*remove)(struct device *); + void (*shutdown)(struct device *); + int (*suspend)(struct device *, pm_message_t); + int (*resume)(struct device *); + const struct attribute_group **groups; + const struct attribute_group **dev_groups; + const struct dev_pm_ops *pm; + void (*coredump)(struct device *); + struct driver_private *p; }; -typedef struct { - spinlock_t slock; - int owned; - wait_queue_head_t wq; -} socket_lock_t; +enum iommu_cap { + IOMMU_CAP_CACHE_COHERENCY = 0, + IOMMU_CAP_INTR_REMAP = 1, + IOMMU_CAP_NOEXEC = 2, +}; -struct sk_buff; +enum iommu_attr { + DOMAIN_ATTR_GEOMETRY = 0, + DOMAIN_ATTR_PAGING = 1, + DOMAIN_ATTR_WINDOWS = 2, + DOMAIN_ATTR_FSL_PAMU_STASH = 3, + DOMAIN_ATTR_FSL_PAMU_ENABLE = 4, + DOMAIN_ATTR_FSL_PAMUV1 = 5, + DOMAIN_ATTR_NESTING = 6, + DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE = 7, + DOMAIN_ATTR_MAX = 8, +}; -struct sk_buff_head { - struct sk_buff *next; - struct sk_buff *prev; - __u32 qlen; - spinlock_t lock; +enum iommu_dev_features { + IOMMU_DEV_FEAT_AUX = 0, + IOMMU_DEV_FEAT_SVA = 1, }; -typedef u64 netdev_features_t; +struct iommu_domain; -struct sock_cgroup_data {}; +struct iommu_iotlb_gather; -struct sk_filter; +struct iommu_resv_region; -struct socket_wq; +struct of_phandle_args; -struct xfrm_policy; +struct iommu_sva; -struct dst_entry; +struct iommu_fault_event; -struct socket; +struct iommu_page_response; -struct sock_reuseport; +struct iommu_cache_invalidate_info; -struct sock { - struct sock_common __sk_common; - socket_lock_t sk_lock; - atomic_t sk_drops; - int sk_rcvlowat; - struct sk_buff_head sk_error_queue; - struct sk_buff *sk_rx_skb_cache; - struct sk_buff_head sk_receive_queue; - struct { - atomic_t rmem_alloc; - int len; - struct sk_buff *head; - struct sk_buff *tail; - } sk_backlog; - int sk_forward_alloc; - unsigned int sk_ll_usec; - unsigned int sk_napi_id; - int sk_rcvbuf; - struct sk_filter *sk_filter; - union { - struct socket_wq *sk_wq; - struct socket_wq *sk_wq_raw; - }; - struct xfrm_policy *sk_policy[2]; - struct dst_entry *sk_rx_dst; - struct dst_entry *sk_dst_cache; - atomic_t sk_omem_alloc; - int sk_sndbuf; - int sk_wmem_queued; - refcount_t sk_wmem_alloc; - long unsigned int sk_tsq_flags; - union { - struct sk_buff *sk_send_head; - struct rb_root tcp_rtx_queue; - }; - struct sk_buff *sk_tx_skb_cache; - struct sk_buff_head sk_write_queue; - __s32 sk_peek_off; - int sk_write_pending; - __u32 sk_dst_pending_confirm; - u32 sk_pacing_status; - long int sk_sndtimeo; - struct timer_list sk_timer; - __u32 sk_priority; - __u32 sk_mark; - long unsigned int sk_pacing_rate; - long unsigned int sk_max_pacing_rate; - struct page_frag sk_frag; - netdev_features_t sk_route_caps; - netdev_features_t sk_route_nocaps; - netdev_features_t sk_route_forced_caps; - int sk_gso_type; - unsigned int sk_gso_max_size; - gfp_t sk_allocation; - __u32 sk_txhash; - unsigned int __sk_flags_offset[0]; - unsigned int sk_padding: 1; - unsigned int sk_kern_sock: 1; - unsigned int sk_no_check_tx: 1; - unsigned int sk_no_check_rx: 1; - unsigned int sk_userlocks: 4; - unsigned int sk_protocol: 8; - unsigned int sk_type: 16; - u16 sk_gso_max_segs; - u8 sk_pacing_shift; - long unsigned int sk_lingertime; - struct proto *sk_prot_creator; - rwlock_t sk_callback_lock; - int sk_err; - int sk_err_soft; - u32 sk_ack_backlog; - u32 sk_max_ack_backlog; - kuid_t sk_uid; - struct pid *sk_peer_pid; - const struct cred *sk_peer_cred; - long int sk_rcvtimeo; - ktime_t sk_stamp; - u16 sk_tsflags; - u8 sk_shutdown; - u32 sk_tskey; - atomic_t sk_zckey; - u8 sk_clockid; - u8 sk_txtime_deadline_mode: 1; - u8 sk_txtime_report_errors: 1; - u8 sk_txtime_unused: 6; - struct socket *sk_socket; - void *sk_user_data; - void *sk_security; - struct sock_cgroup_data sk_cgrp_data; - struct mem_cgroup *sk_memcg; - void (*sk_state_change)(struct sock *); - void (*sk_data_ready)(struct sock *); - void (*sk_write_space)(struct sock *); - void (*sk_error_report)(struct sock *); - int (*sk_backlog_rcv)(struct sock *, struct sk_buff *); - void (*sk_destruct)(struct sock *); - struct sock_reuseport *sk_reuseport_cb; - struct callback_head sk_rcu; -}; +struct iommu_gpasid_bind_data; -struct rhash_head { - struct rhash_head *next; +struct iommu_ops { + bool (*capable)(enum iommu_cap); + struct iommu_domain * (*domain_alloc)(unsigned int); + void (*domain_free)(struct iommu_domain *); + int (*attach_dev)(struct iommu_domain *, struct device *); + void (*detach_dev)(struct iommu_domain *, struct device *); + int (*map)(struct iommu_domain *, long unsigned int, phys_addr_t, size_t, int, gfp_t); + size_t (*unmap)(struct iommu_domain *, long unsigned int, size_t, struct iommu_iotlb_gather *); + void (*flush_iotlb_all)(struct iommu_domain *); + void (*iotlb_sync_map)(struct iommu_domain *); + void (*iotlb_sync)(struct iommu_domain *, struct iommu_iotlb_gather *); + phys_addr_t (*iova_to_phys)(struct iommu_domain *, dma_addr_t); + int (*add_device)(struct device *); + void (*remove_device)(struct device *); + struct iommu_group * (*device_group)(struct device *); + int (*domain_get_attr)(struct iommu_domain *, enum iommu_attr, void *); + int (*domain_set_attr)(struct iommu_domain *, enum iommu_attr, void *); + void (*get_resv_regions)(struct device *, struct list_head *); + void (*put_resv_regions)(struct device *, struct list_head *); + void (*apply_resv_region)(struct device *, struct iommu_domain *, struct iommu_resv_region *); + int (*domain_window_enable)(struct iommu_domain *, u32, phys_addr_t, u64, int); + void (*domain_window_disable)(struct iommu_domain *, u32); + int (*of_xlate)(struct device *, struct of_phandle_args *); + bool (*is_attach_deferred)(struct iommu_domain *, struct device *); + bool (*dev_has_feat)(struct device *, enum iommu_dev_features); + bool (*dev_feat_enabled)(struct device *, enum iommu_dev_features); + int (*dev_enable_feat)(struct device *, enum iommu_dev_features); + int (*dev_disable_feat)(struct device *, enum iommu_dev_features); + int (*aux_attach_dev)(struct iommu_domain *, struct device *); + void (*aux_detach_dev)(struct iommu_domain *, struct device *); + int (*aux_get_pasid)(struct iommu_domain *, struct device *); + struct iommu_sva * (*sva_bind)(struct device *, struct mm_struct *, void *); + void (*sva_unbind)(struct iommu_sva *); + int (*sva_get_pasid)(struct iommu_sva *); + int (*page_response)(struct device *, struct iommu_fault_event *, struct iommu_page_response *); + int (*cache_invalidate)(struct iommu_domain *, struct device *, struct iommu_cache_invalidate_info *); + int (*sva_bind_gpasid)(struct iommu_domain *, struct device *, struct iommu_gpasid_bind_data *); + int (*sva_unbind_gpasid)(struct device *, int); + long unsigned int pgsize_bitmap; }; -struct rhashtable; - -struct rhashtable_compare_arg { - struct rhashtable *ht; - const void *key; +struct device_type { + const char *name; + const struct attribute_group **groups; + int (*uevent)(struct device *, struct kobj_uevent_env *); + char * (*devnode)(struct device *, umode_t *, kuid_t *, kgid_t *); + void (*release)(struct device *); + const struct dev_pm_ops *pm; }; -typedef u32 (*rht_hashfn_t)(const void *, u32, u32); - -typedef u32 (*rht_obj_hashfn_t)(const void *, u32, u32); - -typedef int (*rht_obj_cmpfn_t)(struct rhashtable_compare_arg *, const void *); - -struct rhashtable_params { - u16 nelem_hint; - u16 key_len; - u16 key_offset; - u16 head_offset; - unsigned int max_size; - u16 min_size; - bool automatic_shrinking; - rht_hashfn_t hashfn; - rht_obj_hashfn_t obj_hashfn; - rht_obj_cmpfn_t obj_cmpfn; +struct of_device_id { + char name[32]; + char type[32]; + char compatible[128]; + const void *data; }; -struct bucket_table; +typedef long unsigned int kernel_ulong_t; -struct rhashtable { - struct bucket_table *tbl; - unsigned int key_len; - unsigned int max_elems; - struct rhashtable_params p; - bool rhlist; - struct work_struct run_work; - struct mutex mutex; - spinlock_t lock; - atomic_t nelems; +struct acpi_device_id { + __u8 id[9]; + kernel_ulong_t driver_data; + __u32 cls; + __u32 cls_msk; }; -struct rhash_lock_head; - -struct bucket_table { - unsigned int size; - unsigned int nest; - u32 hash_rnd; - struct list_head walkers; - struct callback_head rcu; - struct bucket_table *future_tbl; - struct lockdep_map dep_map; - long: 64; - struct rhash_lock_head *buckets[0]; +struct class { + const char *name; + struct module *owner; + const struct attribute_group **class_groups; + const struct attribute_group **dev_groups; + struct kobject *dev_kobj; + int (*dev_uevent)(struct device *, struct kobj_uevent_env *); + char * (*devnode)(struct device *, umode_t *); + void (*class_release)(struct class *); + void (*dev_release)(struct device *); + int (*shutdown_pre)(struct device *); + const struct kobj_ns_type_operations *ns_type; + const void * (*namespace)(struct device *); + void (*get_ownership)(struct device *, kuid_t *, kgid_t *); + const struct dev_pm_ops *pm; + struct subsys_private *p; }; -struct fs_struct { - int users; - spinlock_t lock; - seqcount_t seq; - int umask; - int in_exec; - struct path root; - struct path pwd; +struct device_dma_parameters { + unsigned int max_segment_size; + long unsigned int segment_boundary_mask; }; -typedef u32 compat_uptr_t; - -struct compat_robust_list { - compat_uptr_t next; +enum dma_data_direction { + DMA_BIDIRECTIONAL = 0, + DMA_TO_DEVICE = 1, + DMA_FROM_DEVICE = 2, + DMA_NONE = 3, }; -typedef s32 compat_long_t; - -struct compat_robust_list_head { - struct compat_robust_list list; - compat_long_t futex_offset; - compat_uptr_t list_op_pending; -}; +struct sg_table; -struct pipe_buffer; +struct scatterlist; -struct pipe_inode_info { - struct mutex mutex; - wait_queue_head_t wait; - unsigned int head; - unsigned int tail; - unsigned int max_usage; - unsigned int ring_size; - unsigned int readers; - unsigned int writers; - unsigned int files; - unsigned int r_counter; - unsigned int w_counter; - struct page *tmp_page; - struct fasync_struct *fasync_readers; - struct fasync_struct *fasync_writers; - struct pipe_buffer *bufs; - struct user_struct *user; +struct dma_map_ops { + void * (*alloc)(struct device *, size_t, dma_addr_t *, gfp_t, long unsigned int); + void (*free)(struct device *, size_t, void *, dma_addr_t, long unsigned int); + int (*mmap)(struct device *, struct vm_area_struct *, void *, dma_addr_t, size_t, long unsigned int); + int (*get_sgtable)(struct device *, struct sg_table *, void *, dma_addr_t, size_t, long unsigned int); + dma_addr_t (*map_page)(struct device *, struct page *, long unsigned int, size_t, enum dma_data_direction, long unsigned int); + void (*unmap_page)(struct device *, dma_addr_t, size_t, enum dma_data_direction, long unsigned int); + int (*map_sg)(struct device *, struct scatterlist *, int, enum dma_data_direction, long unsigned int); + void (*unmap_sg)(struct device *, struct scatterlist *, int, enum dma_data_direction, long unsigned int); + dma_addr_t (*map_resource)(struct device *, phys_addr_t, size_t, enum dma_data_direction, long unsigned int); + void (*unmap_resource)(struct device *, dma_addr_t, size_t, enum dma_data_direction, long unsigned int); + void (*sync_single_for_cpu)(struct device *, dma_addr_t, size_t, enum dma_data_direction); + void (*sync_single_for_device)(struct device *, dma_addr_t, size_t, enum dma_data_direction); + void (*sync_sg_for_cpu)(struct device *, struct scatterlist *, int, enum dma_data_direction); + void (*sync_sg_for_device)(struct device *, struct scatterlist *, int, enum dma_data_direction); + void (*cache_sync)(struct device *, void *, size_t, enum dma_data_direction); + int (*dma_supported)(struct device *, u64); + u64 (*get_required_mask)(struct device *); + size_t (*max_mapping_size)(struct device *); + long unsigned int (*get_merge_boundary)(struct device *); }; -struct scatterlist { - long unsigned int page_link; - unsigned int offset; - unsigned int length; - dma_addr_t dma_address; - unsigned int dma_length; +struct node { + struct device dev; + struct list_head access_list; }; -struct iovec { - void *iov_base; - __kernel_size_t iov_len; +enum cpuhp_smt_control { + CPU_SMT_ENABLED = 0, + CPU_SMT_DISABLED = 1, + CPU_SMT_FORCE_DISABLED = 2, + CPU_SMT_NOT_SUPPORTED = 3, + CPU_SMT_NOT_IMPLEMENTED = 4, }; -struct kvec { - void *iov_base; - size_t iov_len; +struct cpu_signature { + unsigned int sig; + unsigned int pf; + unsigned int rev; }; -struct iov_iter { - unsigned int type; - size_t iov_offset; - size_t count; - union { - const struct iovec *iov; - const struct kvec *kvec; - const struct bio_vec *bvec; - struct pipe_inode_info *pipe; - }; - union { - long unsigned int nr_segs; - struct { - unsigned int head; - unsigned int start_head; - }; - }; +struct ucode_cpu_info { + struct cpu_signature cpu_sig; + int valid; + void *mc; }; -typedef short unsigned int __kernel_sa_family_t; +typedef long unsigned int pto_T__; -typedef __kernel_sa_family_t sa_family_t; +struct kobj_attribute___2; -struct sockaddr { - sa_family_t sa_family; - char sa_data[14]; -}; +struct file_system_type___2; -struct msghdr { - void *msg_name; - int msg_namelen; - struct iov_iter msg_iter; - void *msg_control; - __kernel_size_t msg_controllen; - unsigned int msg_flags; - struct kiocb *msg_iocb; -}; +struct atomic_notifier_head___2; -typedef struct { - unsigned int clock_rate; - unsigned int clock_type; - short unsigned int loopback; -} sync_serial_settings; +typedef s32 int32_t; -typedef struct { - unsigned int clock_rate; - unsigned int clock_type; - short unsigned int loopback; - unsigned int slot_map; -} te1_settings; +typedef long unsigned int irq_hw_number_t; -typedef struct { - short unsigned int encoding; - short unsigned int parity; -} raw_hdlc_proto; +struct kernel_symbol { + int value_offset; + int name_offset; + int namespace_offset; +}; -typedef struct { - unsigned int t391; - unsigned int t392; - unsigned int n391; - unsigned int n392; - unsigned int n393; - short unsigned int lmi; - short unsigned int dce; -} fr_proto; +typedef int (*initcall_t)(); -typedef struct { - unsigned int dlci; -} fr_proto_pvc; +struct obs_kernel_param { + const char *str; + int (*setup_func)(char *); + int early; +}; -typedef struct { - unsigned int dlci; - char master[16]; -} fr_proto_pvc_info; +enum ftrace_dump_mode { + DUMP_NONE = 0, + DUMP_ALL = 1, + DUMP_ORIG = 2, +}; -typedef struct { - unsigned int interval; - unsigned int timeout; -} cisco_proto; +struct bug_entry { + int bug_addr_disp; + int file_disp; + short unsigned int line; + short unsigned int flags; +}; -struct ifmap { - long unsigned int mem_start; - long unsigned int mem_end; - short unsigned int base_addr; - unsigned char irq; - unsigned char dma; - unsigned char port; +struct pollfd { + int fd; + short int events; + short int revents; }; -struct if_settings { - unsigned int type; - unsigned int size; - union { - raw_hdlc_proto *raw_hdlc; - cisco_proto *cisco; - fr_proto *fr; - fr_proto_pvc *fr_pvc; - fr_proto_pvc_info *fr_pvc_info; - sync_serial_settings *sync; - te1_settings *te1; - } ifs_ifsu; +typedef const int tracepoint_ptr_t; + +struct bpf_raw_event_map { + struct tracepoint *tp; + void *bpf_func; + u32 num_args; + u32 writable_size; + long: 64; }; -struct ifreq { - union { - char ifrn_name[16]; - } ifr_ifrn; - union { - struct sockaddr ifru_addr; - struct sockaddr ifru_dstaddr; - struct sockaddr ifru_broadaddr; - struct sockaddr ifru_netmask; - struct sockaddr ifru_hwaddr; - short int ifru_flags; - int ifru_ivalue; - int ifru_mtu; - struct ifmap ifru_map; - char ifru_slave[16]; - char ifru_newname[16]; - void *ifru_data; - struct if_settings ifru_settings; - } ifr_ifru; +struct orc_entry { + s16 sp_offset; + s16 bp_offset; + unsigned int sp_reg: 4; + unsigned int bp_reg: 4; + unsigned int type: 2; + unsigned int end: 1; +} __attribute__((packed)); + +struct seq_operations___2 { + void * (*start)(struct seq_file *, loff_t *); + void (*stop)(struct seq_file *, void *); + void * (*next)(struct seq_file *, void *, loff_t *); + int (*show)(struct seq_file *, void *); }; -struct vfsmount { - struct dentry *mnt_root; - struct super_block *mnt_sb; - int mnt_flags; +enum perf_event_state { + PERF_EVENT_STATE_DEAD = 4294967292, + PERF_EVENT_STATE_EXIT = 4294967293, + PERF_EVENT_STATE_ERROR = 4294967294, + PERF_EVENT_STATE_OFF = 4294967295, + PERF_EVENT_STATE_INACTIVE = 0, + PERF_EVENT_STATE_ACTIVE = 1, }; typedef struct { - size_t written; - size_t count; - union { - char *buf; - void *data; - } arg; - int error; -} read_descriptor_t; + atomic_long_t a; +} local_t; -struct posix_acl_entry { - short int e_tag; - short unsigned int e_perm; +typedef struct { + local_t a; +} local64_t; + +struct perf_event_attr { + __u32 type; + __u32 size; + __u64 config; union { - kuid_t e_uid; - kgid_t e_gid; + __u64 sample_period; + __u64 sample_freq; + }; + __u64 sample_type; + __u64 read_format; + __u64 disabled: 1; + __u64 inherit: 1; + __u64 pinned: 1; + __u64 exclusive: 1; + __u64 exclude_user: 1; + __u64 exclude_kernel: 1; + __u64 exclude_hv: 1; + __u64 exclude_idle: 1; + __u64 mmap: 1; + __u64 comm: 1; + __u64 freq: 1; + __u64 inherit_stat: 1; + __u64 enable_on_exec: 1; + __u64 task: 1; + __u64 watermark: 1; + __u64 precise_ip: 2; + __u64 mmap_data: 1; + __u64 sample_id_all: 1; + __u64 exclude_host: 1; + __u64 exclude_guest: 1; + __u64 exclude_callchain_kernel: 1; + __u64 exclude_callchain_user: 1; + __u64 mmap2: 1; + __u64 comm_exec: 1; + __u64 use_clockid: 1; + __u64 context_switch: 1; + __u64 write_backward: 1; + __u64 namespaces: 1; + __u64 ksymbol: 1; + __u64 bpf_event: 1; + __u64 aux_output: 1; + __u64 __reserved_1: 32; + union { + __u32 wakeup_events; + __u32 wakeup_watermark; }; + __u32 bp_type; + union { + __u64 bp_addr; + __u64 kprobe_func; + __u64 uprobe_path; + __u64 config1; + }; + union { + __u64 bp_len; + __u64 kprobe_addr; + __u64 probe_offset; + __u64 config2; + }; + __u64 branch_sample_type; + __u64 sample_regs_user; + __u32 sample_stack_user; + __s32 clockid; + __u64 sample_regs_intr; + __u32 aux_watermark; + __u16 sample_max_stack; + __u16 __reserved_2; + __u32 aux_sample_size; + __u32 __reserved_3; }; -struct posix_acl { - refcount_t a_refcount; - struct callback_head a_rcu; - unsigned int a_count; - struct posix_acl_entry a_entries[0]; +struct hw_perf_event_extra { + u64 config; + unsigned int reg; + int alloc; + int idx; }; -typedef unsigned char cc_t; - -typedef unsigned int speed_t; - -typedef unsigned int tcflag_t; +struct arch_hw_breakpoint { + long unsigned int address; + long unsigned int mask; + u8 len; + u8 type; +}; -struct ktermios { - tcflag_t c_iflag; - tcflag_t c_oflag; - tcflag_t c_cflag; - tcflag_t c_lflag; - cc_t c_line; - cc_t c_cc[19]; - speed_t c_ispeed; - speed_t c_ospeed; +struct hw_perf_event { + union { + struct { + u64 config; + u64 last_tag; + long unsigned int config_base; + long unsigned int event_base; + int event_base_rdpmc; + int idx; + int last_cpu; + int flags; + struct hw_perf_event_extra extra_reg; + struct hw_perf_event_extra branch_reg; + }; + struct { + struct hrtimer hrtimer; + }; + struct { + struct list_head tp_list; + }; + struct { + u64 pwr_acc; + u64 ptsc; + }; + struct { + struct arch_hw_breakpoint info; + struct list_head bp_list; + }; + struct { + u8 iommu_bank; + u8 iommu_cntr; + u16 padding; + u64 conf; + u64 conf1; + }; + }; + struct task_struct *target; + void *addr_filters; + long unsigned int addr_filters_gen; + int state; + local64_t prev_count; + u64 sample_period; + u64 last_period; + local64_t period_left; + u64 interrupts_seq; + u64 interrupts; + u64 freq_time_stamp; + u64 freq_count_stamp; }; -struct winsize { - short unsigned int ws_row; - short unsigned int ws_col; - short unsigned int ws_xpixel; - short unsigned int ws_ypixel; +struct irq_work { + atomic_t flags; + struct llist_node llnode; + void (*func)(struct irq_work *); }; -struct termiox { - __u16 x_hflag; - __u16 x_cflag; - __u16 x_rflag[5]; - __u16 x_sflag; +struct perf_addr_filters_head { + struct list_head list; + raw_spinlock_t lock; + unsigned int nr_file_filters; }; -struct tty_driver; +struct perf_sample_data; -struct serial_icounter_struct; +typedef void (*perf_overflow_handler_t)(struct perf_event *, struct perf_sample_data *, struct pt_regs *); -struct serial_struct; +struct pmu; -struct tty_operations { - struct tty_struct * (*lookup)(struct tty_driver *, struct file *, int); - int (*install)(struct tty_driver *, struct tty_struct *); - void (*remove)(struct tty_driver *, struct tty_struct *); - int (*open)(struct tty_struct *, struct file *); - void (*close)(struct tty_struct *, struct file *); - void (*shutdown)(struct tty_struct *); - void (*cleanup)(struct tty_struct *); - int (*write)(struct tty_struct *, const unsigned char *, int); - int (*put_char)(struct tty_struct *, unsigned char); - void (*flush_chars)(struct tty_struct *); - int (*write_room)(struct tty_struct *); - int (*chars_in_buffer)(struct tty_struct *); - int (*ioctl)(struct tty_struct *, unsigned int, long unsigned int); - long int (*compat_ioctl)(struct tty_struct *, unsigned int, long unsigned int); - void (*set_termios)(struct tty_struct *, struct ktermios *); - void (*throttle)(struct tty_struct *); - void (*unthrottle)(struct tty_struct *); - void (*stop)(struct tty_struct *); - void (*start)(struct tty_struct *); - void (*hangup)(struct tty_struct *); - int (*break_ctl)(struct tty_struct *, int); - void (*flush_buffer)(struct tty_struct *); - void (*set_ldisc)(struct tty_struct *); - void (*wait_until_sent)(struct tty_struct *, int); - void (*send_xchar)(struct tty_struct *, char); - int (*tiocmget)(struct tty_struct *); - int (*tiocmset)(struct tty_struct *, unsigned int, unsigned int); - int (*resize)(struct tty_struct *, struct winsize *); - int (*set_termiox)(struct tty_struct *, struct termiox *); - int (*get_icount)(struct tty_struct *, struct serial_icounter_struct *); - int (*get_serial)(struct tty_struct *, struct serial_struct *); - int (*set_serial)(struct tty_struct *, struct serial_struct *); - void (*show_fdinfo)(struct tty_struct *, struct seq_file *); - int (*proc_show)(struct seq_file *, void *); -}; +struct ring_buffer; -struct ld_semaphore { - atomic_long_t count; - raw_spinlock_t wait_lock; - unsigned int wait_readers; - struct list_head read_wait; - struct list_head write_wait; -}; +struct perf_addr_filter_range; -struct tty_ldisc; +struct bpf_prog; -struct tty_port; +struct trace_event_call; -struct tty_struct { - int magic; - struct kref kref; - struct device *dev; - struct tty_driver *driver; - const struct tty_operations *ops; - int index; - struct ld_semaphore ldisc_sem; - struct tty_ldisc *ldisc; - struct mutex atomic_write_lock; - struct mutex legacy_mutex; - struct mutex throttle_mutex; - struct rw_semaphore termios_rwsem; - struct mutex winsize_mutex; - spinlock_t ctrl_lock; - spinlock_t flow_lock; - struct ktermios termios; - struct ktermios termios_locked; - struct termiox *termiox; - char name[64]; - struct pid *pgrp; - struct pid *session; - long unsigned int flags; - int count; - struct winsize winsize; - long unsigned int stopped: 1; - long unsigned int flow_stopped: 1; - int: 30; - long unsigned int unused: 62; - int hw_stopped; - long unsigned int ctrl_status: 8; - long unsigned int packet: 1; - int: 23; - long unsigned int unused_ctrl: 55; - unsigned int receive_room; - int flow_change; - struct tty_struct *link; - struct fasync_struct *fasync; - wait_queue_head_t write_wait; - wait_queue_head_t read_wait; - struct work_struct hangup_work; - void *disc_data; - void *driver_data; - spinlock_t files_lock; - struct list_head tty_files; - int closing; - unsigned char *write_buf; - int write_cnt; - struct work_struct SAK_work; - struct tty_port *port; +struct event_filter; + +struct perf_event { + struct list_head event_entry; + struct list_head sibling_list; + struct list_head active_list; + struct rb_node group_node; + u64 group_index; + struct list_head migrate_entry; + struct hlist_node hlist_entry; + struct list_head active_entry; + int nr_siblings; + int event_caps; + int group_caps; + struct perf_event *group_leader; + struct pmu *pmu; + void *pmu_private; + enum perf_event_state state; + unsigned int attach_state; + local64_t count; + atomic64_t child_count; + u64 total_time_enabled; + u64 total_time_running; + u64 tstamp; + u64 shadow_ctx_time; + struct perf_event_attr attr; + u16 header_size; + u16 id_header_size; + u16 read_size; + struct hw_perf_event hw; + struct perf_event_context *ctx; + atomic_long_t refcount; + atomic64_t child_total_time_enabled; + atomic64_t child_total_time_running; + struct mutex child_mutex; + struct list_head child_list; + struct perf_event *parent; + int oncpu; + int cpu; + struct list_head owner_entry; + struct task_struct *owner; + struct mutex mmap_mutex; + atomic_t mmap_count; + struct ring_buffer *rb; + struct list_head rb_entry; + long unsigned int rcu_batches; + int rcu_pending; + wait_queue_head_t waitq; + struct fasync_struct *fasync; + int pending_wakeup; + int pending_kill; + int pending_disable; + struct irq_work pending; + atomic_t event_limit; + struct perf_addr_filters_head addr_filters; + struct perf_addr_filter_range *addr_filter_ranges; + long unsigned int addr_filters_gen; + struct perf_event *aux_event; + void (*destroy)(struct perf_event *); + struct callback_head callback_head; + struct pid_namespace *ns; + u64 id; + u64 (*clock)(); + perf_overflow_handler_t overflow_handler; + void *overflow_handler_context; + perf_overflow_handler_t orig_overflow_handler; + struct bpf_prog *prog; + struct trace_event_call *tp_event; + struct event_filter *filter; + void *security; + struct list_head sb_list; }; -struct proc_dir_entry; +struct lockdep_map {}; -struct tty_driver { - int magic; - struct kref kref; - struct cdev **cdevs; - struct module *owner; - const char *driver_name; - const char *name; - int name_base; - int major; - int minor_start; - unsigned int num; - short int type; - short int subtype; - struct ktermios init_termios; - long unsigned int flags; - struct proc_dir_entry *proc_entry; - struct tty_driver *other; - struct tty_struct **ttys; - struct tty_port **ports; - struct ktermios **termios; - void *driver_state; - const struct tty_operations *ops; - struct list_head tty_drivers; +struct uid_gid_extent { + u32 first; + u32 lower_first; + u32 count; }; -struct tty_buffer { +struct uid_gid_map { + u32 nr_extents; union { - struct tty_buffer *next; - struct llist_node free; + struct uid_gid_extent extent[5]; + struct { + struct uid_gid_extent *forward; + struct uid_gid_extent *reverse; + }; }; - int used; - int size; - int commit; - int read; - int flags; - long unsigned int data[0]; }; -struct tty_bufhead { - struct tty_buffer *head; - struct work_struct work; - struct mutex lock; - atomic_t priority; - struct tty_buffer sentinel; - struct llist_head free; - atomic_t mem_used; - int mem_limit; - struct tty_buffer *tail; +struct proc_ns_operations; + +struct ns_common { + atomic_long_t stashed; + const struct proc_ns_operations *ops; + unsigned int inum; }; -struct tty_port_operations; +struct ctl_table; -struct tty_port_client_operations; +struct ctl_table_root; -struct tty_port { - struct tty_bufhead buf; - struct tty_struct *tty; - struct tty_struct *itty; - const struct tty_port_operations *ops; - const struct tty_port_client_operations *client_ops; - spinlock_t lock; - int blocked_open; - int count; - wait_queue_head_t open_wait; - wait_queue_head_t delta_msr_wait; +struct ctl_table_set; + +struct ctl_dir; + +struct ctl_node; + +struct ctl_table_header { + union { + struct { + struct ctl_table *ctl_table; + int used; + int count; + int nreg; + }; + struct callback_head rcu; + }; + struct completion *unregistering; + struct ctl_table *ctl_table_arg; + struct ctl_table_root *root; + struct ctl_table_set *set; + struct ctl_dir *parent; + struct ctl_node *node; + struct hlist_head inodes; +}; + +struct ctl_dir { + struct ctl_table_header header; + struct rb_root root; +}; + +struct ctl_table_set { + int (*is_seen)(struct ctl_table_set *); + struct ctl_dir dir; +}; + +struct ucounts; + +struct user_namespace { + struct uid_gid_map uid_map; + struct uid_gid_map gid_map; + struct uid_gid_map projid_map; + atomic_t count; + struct user_namespace *parent; + int level; + kuid_t owner; + kgid_t group; + struct ns_common ns; long unsigned int flags; - long unsigned int iflags; - unsigned char console: 1; - unsigned char low_latency: 1; - struct mutex mutex; - struct mutex buf_mutex; - unsigned char *xmit_buf; - unsigned int close_delay; - unsigned int closing_wait; - int drain_delay; - struct kref kref; - void *client_data; + struct list_head keyring_name_list; + struct key *user_keyring_register; + struct rw_semaphore keyring_sem; + struct work_struct work; + struct ctl_table_set set; + struct ctl_table_header *sysctls; + struct ucounts *ucounts; + int ucount_max[9]; }; -struct tty_ldisc_ops { - int magic; - char *name; - int num; - int flags; - int (*open)(struct tty_struct *); - void (*close)(struct tty_struct *); - void (*flush_buffer)(struct tty_struct *); - ssize_t (*read)(struct tty_struct *, struct file *, unsigned char *, size_t); - ssize_t (*write)(struct tty_struct *, struct file *, const unsigned char *, size_t); - int (*ioctl)(struct tty_struct *, struct file *, unsigned int, long unsigned int); - int (*compat_ioctl)(struct tty_struct *, struct file *, unsigned int, long unsigned int); - void (*set_termios)(struct tty_struct *, struct ktermios *); - __poll_t (*poll)(struct tty_struct *, struct file *, struct poll_table_struct *); - int (*hangup)(struct tty_struct *); - void (*receive_buf)(struct tty_struct *, const unsigned char *, char *, int); - void (*write_wakeup)(struct tty_struct *); - void (*dcd_change)(struct tty_struct *, unsigned int); - int (*receive_buf2)(struct tty_struct *, const unsigned char *, char *, int); - struct module *owner; - int refcount; +enum node_states { + N_POSSIBLE = 0, + N_ONLINE = 1, + N_NORMAL_MEMORY = 2, + N_HIGH_MEMORY = 2, + N_MEMORY = 3, + N_CPU = 4, + NR_NODE_STATES = 5, }; -struct tty_ldisc { - struct tty_ldisc_ops *ops; - struct tty_struct *tty; +struct delayed_work { + struct work_struct work; + struct timer_list timer; + struct workqueue_struct *wq; + int cpu; }; -struct tty_port_operations { - int (*carrier_raised)(struct tty_port *); - void (*dtr_rts)(struct tty_port *, int); - void (*shutdown)(struct tty_port *); - int (*activate)(struct tty_port *, struct tty_struct *); - void (*destruct)(struct tty_port *); +struct rcu_work { + struct work_struct work; + struct callback_head rcu; + struct workqueue_struct *wq; }; -struct tty_port_client_operations { - int (*receive_buf)(struct tty_port *, const unsigned char *, const unsigned char *, size_t); - void (*write_wakeup)(struct tty_port *); +struct rcu_segcblist { + struct callback_head *head; + struct callback_head **tails[4]; + long unsigned int gp_seq[4]; + long int len; + long int len_lazy; + u8 enabled; + u8 offloaded; }; -struct prot_inuse; +struct srcu_node; -struct netns_core { - struct ctl_table_header *sysctl_hdr; - int sysctl_somaxconn; - int *sock_inuse; - struct prot_inuse *prot_inuse; +struct srcu_struct; + +struct srcu_data { + long unsigned int srcu_lock_count[2]; + long unsigned int srcu_unlock_count[2]; + long: 64; + long: 64; + long: 64; + long: 64; + spinlock_t lock; + struct rcu_segcblist srcu_cblist; + long unsigned int srcu_gp_seq_needed; + long unsigned int srcu_gp_seq_needed_exp; + bool srcu_cblist_invoking; + struct timer_list delay_work; + struct work_struct work; + struct callback_head srcu_barrier_head; + struct srcu_node *mynode; + long unsigned int grpmask; + int cpu; + struct srcu_struct *ssp; + long: 64; }; -struct tcp_mib; +struct srcu_node { + spinlock_t lock; + long unsigned int srcu_have_cbs[4]; + long unsigned int srcu_data_have_cbs[4]; + long unsigned int srcu_gp_seq_needed_exp; + struct srcu_node *srcu_parent; + int grplo; + int grphi; +}; -struct ipstats_mib; +struct srcu_struct { + struct srcu_node node[5]; + struct srcu_node *level[3]; + struct mutex srcu_cb_mutex; + spinlock_t lock; + struct mutex srcu_gp_mutex; + unsigned int srcu_idx; + long unsigned int srcu_gp_seq; + long unsigned int srcu_gp_seq_needed; + long unsigned int srcu_gp_seq_needed_exp; + long unsigned int srcu_last_gp_end; + struct srcu_data *sda; + long unsigned int srcu_barrier_seq; + struct mutex srcu_barrier_mutex; + struct completion srcu_barrier_completion; + atomic_t srcu_barrier_cpu_cnt; + struct delayed_work work; +}; -struct linux_mib; +struct anon_vma { + struct anon_vma *root; + struct rw_semaphore rwsem; + atomic_t refcount; + unsigned int degree; + struct anon_vma *parent; + struct rb_root_cached rb_root; +}; -struct udp_mib; +struct mempolicy { + atomic_t refcnt; + short unsigned int mode; + short unsigned int flags; + union { + short int preferred_node; + nodemask_t nodes; + } v; + union { + nodemask_t cpuset_mems_allowed; + nodemask_t user_nodemask; + } w; +}; -struct icmp_mib; +struct linux_binprm; -struct icmpmsg_mib; +struct coredump_params; -struct icmpv6_mib; +struct linux_binfmt { + struct list_head lh; + struct module *module; + int (*load_binary)(struct linux_binprm *); + int (*load_shlib)(struct file *); + int (*core_dump)(struct coredump_params *); + long unsigned int min_coredump; +}; -struct icmpv6msg_mib; +typedef void (*smp_call_func_t)(void *); -struct netns_mib { - struct tcp_mib *tcp_statistics; - struct ipstats_mib *ip_statistics; - struct linux_mib *net_statistics; - struct udp_mib *udp_statistics; - struct udp_mib *udplite_statistics; - struct icmp_mib *icmp_statistics; - struct icmpmsg_mib *icmpmsg_statistics; - struct proc_dir_entry *proc_net_devsnmp6; - struct udp_mib *udp_stats_in6; - struct udp_mib *udplite_stats_in6; - struct ipstats_mib *ipv6_statistics; - struct icmpv6_mib *icmpv6_statistics; - struct icmpv6msg_mib *icmpv6msg_statistics; +struct __call_single_data { + struct llist_node llist; + smp_call_func_t func; + void *info; + unsigned int flags; }; -struct netns_packet { - struct mutex sklist_lock; - struct hlist_head sklist; +typedef int proc_handler(struct ctl_table *, int, void *, size_t *, loff_t *); + +struct ctl_table_poll; + +struct ctl_table { + const char *procname; + void *data; + int maxlen; + umode_t mode; + struct ctl_table *child; + proc_handler *proc_handler; + struct ctl_table_poll *poll; + void *extra1; + void *extra2; }; -struct netns_unix { - int sysctl_max_dgram_qlen; - struct ctl_table_header *ctl; +struct ctl_table_poll { + atomic_t event; + wait_queue_head_t wait; }; -struct netns_nexthop { - struct rb_root rb_root; - struct hlist_head *devhash; - unsigned int seq; - u32 last_id_allocated; +struct ctl_node { + struct rb_node node; + struct ctl_table_header *header; }; -struct local_ports { - seqlock_t lock; - int range[2]; - bool warned; +struct ctl_table_root { + struct ctl_table_set default_set; + struct ctl_table_set * (*lookup)(struct ctl_table_root *); + void (*set_ownership)(struct ctl_table_header *, struct ctl_table *, kuid_t *, kgid_t *); + int (*permissions)(struct ctl_table_header *, struct ctl_table *); }; -struct inet_hashinfo; +enum umh_disable_depth { + UMH_ENABLED = 0, + UMH_FREEZING = 1, + UMH_DISABLED = 2, +}; -struct inet_timewait_death_row { - atomic_t tw_count; - long: 32; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - struct inet_hashinfo *hashinfo; - int sysctl_max_tw_buckets; - long: 32; - long: 64; +struct va_alignment { + int flags; + long unsigned int mask; + long unsigned int bits; long: 64; long: 64; long: 64; @@ -9653,6582 +7232,11544 @@ struct inet_timewait_death_row { long: 64; }; -struct ping_group_range { - seqlock_t lock; - kgid_t range[2]; -}; +typedef __u64 Elf64_Addr; -typedef struct { - u64 key[2]; -} siphash_key_t; +typedef __u16 Elf64_Half; -struct ipv4_devconf; +typedef __u32 Elf64_Word; -struct ip_ra_chain; +typedef __u64 Elf64_Xword; -struct fib_rules_ops; +typedef __s64 Elf64_Sxword; -struct fib_table; +typedef struct { + Elf64_Sxword d_tag; + union { + Elf64_Xword d_val; + Elf64_Addr d_ptr; + } d_un; +} Elf64_Dyn; -struct inet_peer_base; +struct elf64_sym { + Elf64_Word st_name; + unsigned char st_info; + unsigned char st_other; + Elf64_Half st_shndx; + Elf64_Addr st_value; + Elf64_Xword st_size; +}; -struct fqdir; +typedef struct elf64_sym Elf64_Sym; -struct xt_table; +struct seq_file { + char *buf; + size_t size; + size_t from; + size_t count; + size_t pad_until; + loff_t index; + loff_t read_pos; + u64 version; + struct mutex lock; + const struct seq_operations___2 *op; + int poll_event; + const struct file *file; + void *private; +}; -struct tcp_congestion_ops; +typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_table_struct *); -struct tcp_fastopen_context; +struct poll_table_struct { + poll_queue_proc _qproc; + __poll_t _key; +}; -struct mr_table; +struct kernel_param; -struct fib_notifier_ops; +struct kernel_param_ops { + unsigned int flags; + int (*set)(const char *, const struct kernel_param *); + int (*get)(char *, const struct kernel_param *); + void (*free)(void *); +}; -struct netns_ipv4 { - struct ctl_table_header *forw_hdr; - struct ctl_table_header *frags_hdr; - struct ctl_table_header *ipv4_hdr; - struct ctl_table_header *route_hdr; - struct ctl_table_header *xfrm4_hdr; - struct ipv4_devconf *devconf_all; - struct ipv4_devconf *devconf_dflt; - struct ip_ra_chain *ra_chain; - struct mutex ra_mutex; - struct fib_rules_ops *rules_ops; - bool fib_has_custom_rules; - unsigned int fib_rules_require_fldissect; - struct fib_table *fib_main; - struct fib_table *fib_default; - bool fib_has_custom_local_routes; - struct hlist_head *fib_table_hash; - bool fib_offload_disabled; - struct sock *fibnl; - struct sock **icmp_sk; - struct sock *mc_autojoin_sk; - struct inet_peer_base *peers; - struct sock **tcp_sk; - struct fqdir *fqdir; - struct xt_table *iptable_filter; - struct xt_table *iptable_mangle; - struct xt_table *iptable_raw; - struct xt_table *arptable_filter; - struct xt_table *iptable_security; - struct xt_table *nat_table; - int sysctl_icmp_echo_ignore_all; - int sysctl_icmp_echo_ignore_broadcasts; - int sysctl_icmp_ignore_bogus_error_responses; - int sysctl_icmp_ratelimit; - int sysctl_icmp_ratemask; - int sysctl_icmp_errors_use_inbound_ifaddr; - struct local_ports ip_local_ports; - int sysctl_tcp_ecn; - int sysctl_tcp_ecn_fallback; - int sysctl_ip_default_ttl; - int sysctl_ip_no_pmtu_disc; - int sysctl_ip_fwd_use_pmtu; - int sysctl_ip_fwd_update_priority; - int sysctl_ip_nonlocal_bind; - int sysctl_ip_dynaddr; - int sysctl_ip_early_demux; - int sysctl_tcp_early_demux; - int sysctl_udp_early_demux; - int sysctl_fwmark_reflect; - int sysctl_tcp_fwmark_accept; - int sysctl_tcp_mtu_probing; - int sysctl_tcp_mtu_probe_floor; - int sysctl_tcp_base_mss; - int sysctl_tcp_min_snd_mss; - int sysctl_tcp_probe_threshold; - u32 sysctl_tcp_probe_interval; - int sysctl_tcp_keepalive_time; - int sysctl_tcp_keepalive_probes; - int sysctl_tcp_keepalive_intvl; - int sysctl_tcp_syn_retries; - int sysctl_tcp_synack_retries; - int sysctl_tcp_syncookies; - int sysctl_tcp_reordering; - int sysctl_tcp_retries1; - int sysctl_tcp_retries2; - int sysctl_tcp_orphan_retries; - int sysctl_tcp_fin_timeout; - unsigned int sysctl_tcp_notsent_lowat; - int sysctl_tcp_tw_reuse; - int sysctl_tcp_sack; - int sysctl_tcp_window_scaling; - int sysctl_tcp_timestamps; - int sysctl_tcp_early_retrans; - int sysctl_tcp_recovery; - int sysctl_tcp_thin_linear_timeouts; - int sysctl_tcp_slow_start_after_idle; - int sysctl_tcp_retrans_collapse; - int sysctl_tcp_stdurg; - int sysctl_tcp_rfc1337; - int sysctl_tcp_abort_on_overflow; - int sysctl_tcp_fack; - int sysctl_tcp_max_reordering; - int sysctl_tcp_dsack; - int sysctl_tcp_app_win; - int sysctl_tcp_adv_win_scale; - int sysctl_tcp_frto; - int sysctl_tcp_nometrics_save; - int sysctl_tcp_moderate_rcvbuf; - int sysctl_tcp_tso_win_divisor; - int sysctl_tcp_workaround_signed_windows; - int sysctl_tcp_limit_output_bytes; - int sysctl_tcp_challenge_ack_limit; - int sysctl_tcp_min_tso_segs; - int sysctl_tcp_min_rtt_wlen; - int sysctl_tcp_autocorking; - int sysctl_tcp_invalid_ratelimit; - int sysctl_tcp_pacing_ss_ratio; - int sysctl_tcp_pacing_ca_ratio; - int sysctl_tcp_wmem[3]; - int sysctl_tcp_rmem[3]; - int sysctl_tcp_comp_sack_nr; - long unsigned int sysctl_tcp_comp_sack_delay_ns; - struct inet_timewait_death_row tcp_death_row; - int sysctl_max_syn_backlog; - int sysctl_tcp_fastopen; - const struct tcp_congestion_ops *tcp_congestion_control; - struct tcp_fastopen_context *tcp_fastopen_ctx; - spinlock_t tcp_fastopen_ctx_lock; - unsigned int sysctl_tcp_fastopen_blackhole_timeout; - atomic_t tfo_active_disable_times; - long unsigned int tfo_active_disable_stamp; - int sysctl_udp_wmem_min; - int sysctl_udp_rmem_min; - int sysctl_igmp_max_memberships; - int sysctl_igmp_max_msf; - int sysctl_igmp_llm_reports; - int sysctl_igmp_qrv; - struct ping_group_range ping_group_range; - atomic_t dev_addr_genid; - long unsigned int *sysctl_local_reserved_ports; - int sysctl_ip_prot_sock; - struct mr_table *mrt; - int sysctl_fib_multipath_use_neigh; - int sysctl_fib_multipath_hash_policy; - struct fib_notifier_ops *notifier_ops; - unsigned int fib_seq; - struct fib_notifier_ops *ipmr_notifier_ops; - unsigned int ipmr_seq; - atomic_t rt_genid; - siphash_key_t ip_id_key; - long: 64; - long: 64; -}; - -struct netns_sysctl_ipv6 { - struct ctl_table_header *hdr; - struct ctl_table_header *route_hdr; - struct ctl_table_header *icmp_hdr; - struct ctl_table_header *frags_hdr; - struct ctl_table_header *xfrm6_hdr; - int bindv6only; - int flush_delay; - int ip6_rt_max_size; - int ip6_rt_gc_min_interval; - int ip6_rt_gc_timeout; - int ip6_rt_gc_interval; - int ip6_rt_gc_elasticity; - int ip6_rt_mtu_expires; - int ip6_rt_min_advmss; - int multipath_hash_policy; - int flowlabel_consistency; - int auto_flowlabels; - int icmpv6_time; - int icmpv6_echo_ignore_all; - int icmpv6_echo_ignore_multicast; - int icmpv6_echo_ignore_anycast; - long unsigned int icmpv6_ratemask[4]; - long unsigned int *icmpv6_ratemask_ptr; - int anycast_src_echo_reply; - int ip_nonlocal_bind; - int fwmark_reflect; - int idgen_retries; - int idgen_delay; - int flowlabel_state_ranges; - int flowlabel_reflect; - int max_dst_opts_cnt; - int max_hbh_opts_cnt; - int max_dst_opts_len; - int max_hbh_opts_len; - int seg6_flowlabel; - bool skip_notify_on_dev_down; -}; - -struct net_device; +struct kparam_string; -struct neighbour; +struct kparam_array; -struct dst_ops { - short unsigned int family; - unsigned int gc_thresh; - int (*gc)(struct dst_ops *); - struct dst_entry * (*check)(struct dst_entry *, __u32); - unsigned int (*default_advmss)(const struct dst_entry *); - unsigned int (*mtu)(const struct dst_entry *); - u32 * (*cow_metrics)(struct dst_entry *, long unsigned int); - void (*destroy)(struct dst_entry *); - void (*ifdown)(struct dst_entry *, struct net_device *, int); - struct dst_entry * (*negative_advice)(struct dst_entry *); - void (*link_failure)(struct sk_buff *); - void (*update_pmtu)(struct dst_entry *, struct sock *, struct sk_buff *, u32, bool); - void (*redirect)(struct dst_entry *, struct sock *, struct sk_buff *); - int (*local_out)(struct net *, struct sock *, struct sk_buff *); - struct neighbour * (*neigh_lookup)(const struct dst_entry *, struct sk_buff *, const void *); - void (*confirm_neigh)(const struct dst_entry *, const void *); - struct kmem_cache *kmem_cachep; - struct percpu_counter pcpuc_entries; - long: 64; - long: 64; - long: 64; +struct kernel_param { + const char *name; + struct module *mod; + const struct kernel_param_ops *ops; + const u16 perm; + s8 level; + u8 flags; + union { + void *arg; + const struct kparam_string *str; + const struct kparam_array *arr; + }; }; -struct ipv6_devconf; - -struct fib6_info; - -struct rt6_info; - -struct rt6_statistics; - -struct fib6_table; - -struct seg6_pernet_data; - -struct netns_ipv6 { - struct netns_sysctl_ipv6 sysctl; - struct ipv6_devconf *devconf_all; - struct ipv6_devconf *devconf_dflt; - struct inet_peer_base *peers; - struct fqdir *fqdir; - struct xt_table *ip6table_filter; - struct xt_table *ip6table_mangle; - struct xt_table *ip6table_raw; - struct xt_table *ip6table_security; - struct xt_table *ip6table_nat; - struct fib6_info *fib6_null_entry; - struct rt6_info *ip6_null_entry; - struct rt6_statistics *rt6_stats; - struct timer_list ip6_fib_timer; - struct hlist_head *fib_table_hash; - struct fib6_table *fib6_main_tbl; - struct list_head fib6_walkers; - long: 64; - long: 64; - struct dst_ops ip6_dst_ops; - rwlock_t fib6_walker_lock; - spinlock_t fib6_gc_lock; - unsigned int ip6_rt_gc_expire; - long unsigned int ip6_rt_last_gc; - struct sock **icmp_sk; - struct sock *ndisc_sk; - struct sock *tcp_sk; - struct sock *igmp_sk; - struct sock *mc_autojoin_sk; - atomic_t dev_addr_genid; - atomic_t fib6_sernum; - struct seg6_pernet_data *seg6_data; - struct fib_notifier_ops *notifier_ops; - struct fib_notifier_ops *ip6mr_notifier_ops; - unsigned int ipmr_seq; - struct { - struct hlist_head head; - spinlock_t lock; - u32 seq; - } ip6addrlbl_table; - long: 64; +struct kparam_string { + unsigned int maxlen; + char *string; }; -struct nf_queue_handler; - -struct nf_logger; - -struct nf_hook_entries; - -struct netns_nf { - struct proc_dir_entry *proc_netfilter; - const struct nf_queue_handler *queue_handler; - const struct nf_logger *nf_loggers[13]; - struct ctl_table_header *nf_log_dir_header; - struct nf_hook_entries *hooks_ipv4[5]; - struct nf_hook_entries *hooks_ipv6[5]; - bool defrag_ipv4; - bool defrag_ipv6; +struct kparam_array { + unsigned int max; + unsigned int elemsize; + unsigned int *num; + const struct kernel_param_ops *ops; + void *elem; }; -struct netns_xt { - struct list_head tables[13]; - bool notrack_deprecated_warning; - bool clusterip_deprecated_warning; +enum module_state { + MODULE_STATE_LIVE = 0, + MODULE_STATE_COMING = 1, + MODULE_STATE_GOING = 2, + MODULE_STATE_UNFORMED = 3, }; -struct nf_ct_event_notifier; +struct module_param_attrs; -struct nf_exp_event_notifier; +struct module_kobject { + struct kobject kobj; + struct module *mod; + struct kobject *drivers_dir; + struct module_param_attrs *mp; + struct completion *kobj_completion; +}; -struct nf_generic_net { - unsigned int timeout; +struct latch_tree_node { + struct rb_node node[2]; }; -struct nf_tcp_net { - unsigned int timeouts[14]; - int tcp_loose; - int tcp_be_liberal; - int tcp_max_retrans; +struct mod_tree_node { + struct module *mod; + struct latch_tree_node node; }; -struct nf_udp_net { - unsigned int timeouts[2]; +struct module_layout { + void *base; + unsigned int size; + unsigned int text_size; + unsigned int ro_size; + unsigned int ro_after_init_size; + struct mod_tree_node mtn; }; -struct nf_icmp_net { - unsigned int timeout; +struct mod_arch_specific { + unsigned int num_orcs; + int *orc_unwind_ip; + struct orc_entry *orc_unwind; }; -struct nf_ip_net { - struct nf_generic_net generic; - struct nf_tcp_net tcp; - struct nf_udp_net udp; - struct nf_icmp_net icmp; - struct nf_icmp_net icmpv6; +struct mod_kallsyms { + Elf64_Sym *symtab; + unsigned int num_symtab; + char *strtab; + char *typetab; }; -struct ct_pcpu; +struct module_attribute; -struct ip_conntrack_stat; +struct exception_table_entry; -struct netns_ct { - atomic_t count; - unsigned int expect_count; - bool auto_assign_helper_warned; - struct ctl_table_header *sysctl_header; - unsigned int sysctl_log_invalid; - int sysctl_events; - int sysctl_acct; - int sysctl_auto_assign_helper; - int sysctl_tstamp; - int sysctl_checksum; - struct ct_pcpu *pcpu_lists; - struct ip_conntrack_stat *stat; - struct nf_ct_event_notifier *nf_conntrack_event_cb; - struct nf_exp_event_notifier *nf_expect_event_cb; - struct nf_ip_net nf_ct_proto; -}; +struct module_sect_attrs; -struct netns_nf_frag { - struct fqdir *fqdir; -}; +struct module_notes_attrs; -struct xfrm_policy_hash { - struct hlist_head *table; - unsigned int hmask; - u8 dbits4; - u8 sbits4; - u8 dbits6; - u8 sbits6; -}; +struct trace_eval_map; -struct xfrm_policy_hthresh { - struct work_struct work; - seqlock_t lock; - u8 lbits4; - u8 rbits4; - u8 lbits6; - u8 rbits6; -}; +struct error_injection_entry; -struct netns_xfrm { - struct list_head state_all; - struct hlist_head *state_bydst; - struct hlist_head *state_bysrc; - struct hlist_head *state_byspi; - unsigned int state_hmask; - unsigned int state_num; - struct work_struct state_hash_work; - struct list_head policy_all; - struct hlist_head *policy_byidx; - unsigned int policy_idx_hmask; - struct hlist_head policy_inexact[3]; - struct xfrm_policy_hash policy_bydst[3]; - unsigned int policy_count[6]; - struct work_struct policy_hash_work; - struct xfrm_policy_hthresh policy_hthresh; - struct list_head inexact_bins; - struct sock *nlsk; - struct sock *nlsk_stash; - u32 sysctl_aevent_etime; - u32 sysctl_aevent_rseqth; - int sysctl_larval_drop; - u32 sysctl_acq_expires; - struct ctl_table_header *sysctl_hdr; +struct module { + enum module_state state; + struct list_head list; + char name[56]; + struct module_kobject mkobj; + struct module_attribute *modinfo_attrs; + const char *version; + const char *srcversion; + struct kobject *holders_dir; + const struct kernel_symbol *syms; + const s32 *crcs; + unsigned int num_syms; + struct mutex param_lock; + struct kernel_param *kp; + unsigned int num_kp; + unsigned int num_gpl_syms; + const struct kernel_symbol *gpl_syms; + const s32 *gpl_crcs; + bool async_probe_requested; + const struct kernel_symbol *gpl_future_syms; + const s32 *gpl_future_crcs; + unsigned int num_gpl_future_syms; + unsigned int num_exentries; + struct exception_table_entry *extable; + int (*init)(); long: 64; long: 64; long: 64; long: 64; long: 64; - struct dst_ops xfrm4_dst_ops; - struct dst_ops xfrm6_dst_ops; - spinlock_t xfrm_state_lock; - spinlock_t xfrm_policy_lock; - struct mutex xfrm_cfg_mutex; + struct module_layout core_layout; + struct module_layout init_layout; + struct mod_arch_specific arch; + long unsigned int taints; + unsigned int num_bugs; + struct list_head bug_list; + struct bug_entry *bug_table; + struct mod_kallsyms *kallsyms; + struct mod_kallsyms core_kallsyms; + struct module_sect_attrs *sect_attrs; + struct module_notes_attrs *notes_attrs; + char *args; + void *percpu; + unsigned int percpu_size; + unsigned int num_tracepoints; + tracepoint_ptr_t *tracepoints_ptrs; + unsigned int num_srcu_structs; + struct srcu_struct **srcu_struct_ptrs; + unsigned int num_bpf_raw_events; + struct bpf_raw_event_map *bpf_raw_events; + struct jump_entry *jump_entries; + unsigned int num_jump_entries; + unsigned int num_trace_bprintk_fmt; + const char **trace_bprintk_fmt_start; + struct trace_event_call **trace_events; + unsigned int num_trace_events; + struct trace_eval_map **trace_evals; + unsigned int num_trace_evals; + struct list_head source_list; + struct list_head target_list; + void (*exit)(); + atomic_t refcnt; + struct error_injection_entry *ei_funcs; + unsigned int num_ei_funcs; + long: 32; + long: 64; + long: 64; + long: 64; long: 64; long: 64; long: 64; }; -struct uevent_sock; +struct error_injection_entry { + long unsigned int addr; + int etype; +}; -struct net_generic; +struct module_attribute { + struct attribute attr; + ssize_t (*show)(struct module_attribute *, struct module_kobject *, char *); + ssize_t (*store)(struct module_attribute *, struct module_kobject *, const char *, size_t); + void (*setup)(struct module *, const char *); + int (*test)(struct module *); + void (*free)(struct module *); +}; -struct net { - refcount_t passive; - refcount_t count; - spinlock_t rules_mod_lock; - unsigned int dev_unreg_count; - unsigned int dev_base_seq; - int ifindex; - spinlock_t nsid_lock; - atomic_t fnhe_genid; +struct exception_table_entry { + int insn; + int fixup; + int handler; +}; + +struct trace_event_functions; + +struct trace_event { + struct hlist_node node; struct list_head list; - struct list_head exit_list; - struct llist_node cleanup_list; - struct key_tag *key_domain; - struct user_namespace *user_ns; - struct ucounts *ucounts; - struct idr netns_ids; - struct ns_common ns; - struct list_head dev_base_head; - struct proc_dir_entry *proc_net; - struct proc_dir_entry *proc_net_stat; - struct ctl_table_set sysctls; - struct sock *rtnl; - struct sock *genl_sock; - struct uevent_sock *uevent_sock; - struct hlist_head *dev_name_head; - struct hlist_head *dev_index_head; - struct raw_notifier_head netdev_chain; - u32 hash_mix; - struct net_device *loopback_dev; - struct list_head rules_ops; - struct netns_core core; - struct netns_mib mib; - struct netns_packet packet; - struct netns_unix unx; - struct netns_nexthop nexthop; - long: 64; - struct netns_ipv4 ipv4; - struct netns_ipv6 ipv6; - struct netns_nf nf; - struct netns_xt xt; - struct netns_ct ct; - struct netns_nf_frag nf_frag; - struct ctl_table_header *nf_frag_frags_hdr; - struct sock *nfnl; - struct sock *nfnl_stash; - struct net_generic *gen; - struct bpf_prog *flow_dissector_prog; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - struct netns_xfrm xfrm; - struct sock *diag_nlsk; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; + int type; + struct trace_event_functions *funcs; }; -typedef struct { - local64_t v; -} u64_stats_t; +struct trace_event_class; -struct bpf_insn { - __u8 code; - __u8 dst_reg: 4; - __u8 src_reg: 4; - __s16 off; - __s32 imm; -}; +struct bpf_prog_array; -enum bpf_map_type { - BPF_MAP_TYPE_UNSPEC = 0, - BPF_MAP_TYPE_HASH = 1, - BPF_MAP_TYPE_ARRAY = 2, - BPF_MAP_TYPE_PROG_ARRAY = 3, - BPF_MAP_TYPE_PERF_EVENT_ARRAY = 4, - BPF_MAP_TYPE_PERCPU_HASH = 5, - BPF_MAP_TYPE_PERCPU_ARRAY = 6, - BPF_MAP_TYPE_STACK_TRACE = 7, - BPF_MAP_TYPE_CGROUP_ARRAY = 8, - BPF_MAP_TYPE_LRU_HASH = 9, - BPF_MAP_TYPE_LRU_PERCPU_HASH = 10, - BPF_MAP_TYPE_LPM_TRIE = 11, - BPF_MAP_TYPE_ARRAY_OF_MAPS = 12, - BPF_MAP_TYPE_HASH_OF_MAPS = 13, - BPF_MAP_TYPE_DEVMAP = 14, - BPF_MAP_TYPE_SOCKMAP = 15, - BPF_MAP_TYPE_CPUMAP = 16, - BPF_MAP_TYPE_XSKMAP = 17, - BPF_MAP_TYPE_SOCKHASH = 18, - BPF_MAP_TYPE_CGROUP_STORAGE = 19, - BPF_MAP_TYPE_REUSEPORT_SOCKARRAY = 20, - BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = 21, - BPF_MAP_TYPE_QUEUE = 22, - BPF_MAP_TYPE_STACK = 23, - BPF_MAP_TYPE_SK_STORAGE = 24, - BPF_MAP_TYPE_DEVMAP_HASH = 25, +struct trace_event_call { + struct list_head list; + struct trace_event_class *class; + union { + char *name; + struct tracepoint *tp; + }; + struct trace_event event; + char *print_fmt; + struct event_filter *filter; + void *mod; + void *data; + int flags; + int perf_refcount; + struct hlist_head *perf_events; + struct bpf_prog_array *prog_array; + int (*perf_perm)(struct trace_event_call *, struct perf_event *); }; -enum bpf_prog_type { - BPF_PROG_TYPE_UNSPEC = 0, - BPF_PROG_TYPE_SOCKET_FILTER = 1, - BPF_PROG_TYPE_KPROBE = 2, - BPF_PROG_TYPE_SCHED_CLS = 3, - BPF_PROG_TYPE_SCHED_ACT = 4, - BPF_PROG_TYPE_TRACEPOINT = 5, - BPF_PROG_TYPE_XDP = 6, - BPF_PROG_TYPE_PERF_EVENT = 7, - BPF_PROG_TYPE_CGROUP_SKB = 8, - BPF_PROG_TYPE_CGROUP_SOCK = 9, - BPF_PROG_TYPE_LWT_IN = 10, - BPF_PROG_TYPE_LWT_OUT = 11, - BPF_PROG_TYPE_LWT_XMIT = 12, - BPF_PROG_TYPE_SOCK_OPS = 13, - BPF_PROG_TYPE_SK_SKB = 14, - BPF_PROG_TYPE_CGROUP_DEVICE = 15, - BPF_PROG_TYPE_SK_MSG = 16, - BPF_PROG_TYPE_RAW_TRACEPOINT = 17, - BPF_PROG_TYPE_CGROUP_SOCK_ADDR = 18, - BPF_PROG_TYPE_LWT_SEG6LOCAL = 19, - BPF_PROG_TYPE_LIRC_MODE2 = 20, - BPF_PROG_TYPE_SK_REUSEPORT = 21, - BPF_PROG_TYPE_FLOW_DISSECTOR = 22, - BPF_PROG_TYPE_CGROUP_SYSCTL = 23, - BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE = 24, - BPF_PROG_TYPE_CGROUP_SOCKOPT = 25, - BPF_PROG_TYPE_TRACING = 26, +struct trace_eval_map { + const char *system; + const char *eval_string; + long unsigned int eval_value; }; -enum bpf_attach_type { - BPF_CGROUP_INET_INGRESS = 0, - BPF_CGROUP_INET_EGRESS = 1, - BPF_CGROUP_INET_SOCK_CREATE = 2, - BPF_CGROUP_SOCK_OPS = 3, - BPF_SK_SKB_STREAM_PARSER = 4, - BPF_SK_SKB_STREAM_VERDICT = 5, - BPF_CGROUP_DEVICE = 6, - BPF_SK_MSG_VERDICT = 7, - BPF_CGROUP_INET4_BIND = 8, - BPF_CGROUP_INET6_BIND = 9, - BPF_CGROUP_INET4_CONNECT = 10, - BPF_CGROUP_INET6_CONNECT = 11, - BPF_CGROUP_INET4_POST_BIND = 12, - BPF_CGROUP_INET6_POST_BIND = 13, - BPF_CGROUP_UDP4_SENDMSG = 14, - BPF_CGROUP_UDP6_SENDMSG = 15, - BPF_LIRC_MODE2 = 16, - BPF_FLOW_DISSECTOR = 17, - BPF_CGROUP_SYSCTL = 18, - BPF_CGROUP_UDP4_RECVMSG = 19, - BPF_CGROUP_UDP6_RECVMSG = 20, - BPF_CGROUP_GETSOCKOPT = 21, - BPF_CGROUP_SETSOCKOPT = 22, - BPF_TRACE_RAW_TP = 23, - BPF_TRACE_FENTRY = 24, - BPF_TRACE_FEXIT = 25, - __MAX_BPF_ATTACH_TYPE = 26, -}; +struct fs_pin; -union bpf_attr { - struct { - __u32 map_type; - __u32 key_size; - __u32 value_size; - __u32 max_entries; - __u32 map_flags; - __u32 inner_map_fd; - __u32 numa_node; - char map_name[16]; - __u32 map_ifindex; - __u32 btf_fd; - __u32 btf_key_type_id; - __u32 btf_value_type_id; - }; - struct { - __u32 map_fd; - __u64 key; - union { - __u64 value; - __u64 next_key; - }; - __u64 flags; - }; - struct { - __u32 prog_type; - __u32 insn_cnt; - __u64 insns; - __u64 license; - __u32 log_level; - __u32 log_size; - __u64 log_buf; - __u32 kern_version; - __u32 prog_flags; - char prog_name[16]; - __u32 prog_ifindex; - __u32 expected_attach_type; - __u32 prog_btf_fd; - __u32 func_info_rec_size; - __u64 func_info; - __u32 func_info_cnt; - __u32 line_info_rec_size; - __u64 line_info; - __u32 line_info_cnt; - __u32 attach_btf_id; - __u32 attach_prog_fd; - }; - struct { - __u64 pathname; - __u32 bpf_fd; - __u32 file_flags; - }; - struct { - __u32 target_fd; - __u32 attach_bpf_fd; - __u32 attach_type; - __u32 attach_flags; - }; - struct { - __u32 prog_fd; - __u32 retval; - __u32 data_size_in; - __u32 data_size_out; - __u64 data_in; - __u64 data_out; - __u32 repeat; - __u32 duration; - __u32 ctx_size_in; - __u32 ctx_size_out; - __u64 ctx_in; - __u64 ctx_out; - } test; - struct { - union { - __u32 start_id; - __u32 prog_id; - __u32 map_id; - __u32 btf_id; - }; - __u32 next_id; - __u32 open_flags; - }; - struct { - __u32 bpf_fd; - __u32 info_len; - __u64 info; - } info; - struct { - __u32 target_fd; - __u32 attach_type; - __u32 query_flags; - __u32 attach_flags; - __u64 prog_ids; - __u32 prog_cnt; - } query; - struct { - __u64 name; - __u32 prog_fd; - } raw_tracepoint; - struct { - __u64 btf; - __u64 btf_log_buf; - __u32 btf_size; - __u32 btf_log_size; - __u32 btf_log_level; - }; - struct { - __u32 pid; - __u32 fd; - __u32 flags; - __u32 buf_len; - __u64 buf; - __u32 prog_id; - __u32 fd_type; - __u64 probe_offset; - __u64 probe_addr; - } task_fd_query; +struct pid_namespace { + struct kref kref; + struct idr idr; + struct callback_head rcu; + unsigned int pid_allocated; + struct task_struct *child_reaper; + struct kmem_cache *pid_cachep; + unsigned int level; + struct pid_namespace *parent; + struct vfsmount *proc_mnt; + struct dentry *proc_self; + struct dentry *proc_thread_self; + struct fs_pin *bacct; + struct user_namespace *user_ns; + struct ucounts *ucounts; + struct work_struct proc_work; + kgid_t pid_gid; + int hide_pid; + int reboot; + struct ns_common ns; }; -struct bpf_func_info { - __u32 insn_off; - __u32 type_id; +struct rlimit { + __kernel_ulong_t rlim_cur; + __kernel_ulong_t rlim_max; }; -struct bpf_line_info { - __u32 insn_off; - __u32 file_name_off; - __u32 line_off; - __u32 line_col; +struct task_cputime { + u64 stime; + u64 utime; + long long unsigned int sum_exec_runtime; }; -struct btf; +typedef void __signalfn_t(int); -struct bpf_map; +typedef __signalfn_t *__sighandler_t; -struct btf_type; +typedef void __restorefn_t(); -struct bpf_prog_aux; +typedef __restorefn_t *__sigrestore_t; -struct bpf_map_ops { - int (*map_alloc_check)(union bpf_attr *); - struct bpf_map * (*map_alloc)(union bpf_attr *); - void (*map_release)(struct bpf_map *, struct file *); - void (*map_free)(struct bpf_map *); - int (*map_get_next_key)(struct bpf_map *, void *, void *); - void (*map_release_uref)(struct bpf_map *); - void * (*map_lookup_elem_sys_only)(struct bpf_map *, void *); - void * (*map_lookup_elem)(struct bpf_map *, void *); - int (*map_update_elem)(struct bpf_map *, void *, void *, u64); - int (*map_delete_elem)(struct bpf_map *, void *); - int (*map_push_elem)(struct bpf_map *, void *, u64); - int (*map_pop_elem)(struct bpf_map *, void *); - int (*map_peek_elem)(struct bpf_map *, void *); - void * (*map_fd_get_ptr)(struct bpf_map *, struct file *, int); - void (*map_fd_put_ptr)(void *); - u32 (*map_gen_lookup)(struct bpf_map *, struct bpf_insn *); - u32 (*map_fd_sys_lookup_elem)(void *); - void (*map_seq_show_elem)(struct bpf_map *, void *, struct seq_file *); - int (*map_check_btf)(const struct bpf_map *, const struct btf *, const struct btf_type *, const struct btf_type *); - int (*map_poke_track)(struct bpf_map *, struct bpf_prog_aux *); - void (*map_poke_untrack)(struct bpf_map *, struct bpf_prog_aux *); - void (*map_poke_run)(struct bpf_map *, u32, struct bpf_prog *, struct bpf_prog *); - int (*map_direct_value_addr)(const struct bpf_map *, u64 *, u32); - int (*map_direct_value_meta)(const struct bpf_map *, u64, u32 *); - int (*map_mmap)(struct bpf_map *, struct vm_area_struct *); +struct user_struct { + refcount_t __count; + atomic_t processes; + atomic_t sigpending; + atomic_long_t epoll_watches; + long unsigned int mq_bytes; + long unsigned int locked_shm; + long unsigned int unix_inflight; + atomic_long_t pipe_bufs; + struct hlist_node uidhash_node; + kuid_t uid; + atomic_long_t locked_vm; + struct ratelimit_state ratelimit; }; -struct bpf_map_memory { - u32 pages; - struct user_struct *user; +struct sigaction { + __sighandler_t sa_handler; + long unsigned int sa_flags; + __sigrestore_t sa_restorer; + sigset_t sa_mask; }; -struct bpf_map { - const struct bpf_map_ops *ops; - struct bpf_map *inner_map_meta; - void *security; - enum bpf_map_type map_type; - u32 key_size; - u32 value_size; - u32 max_entries; - u32 map_flags; - int spin_lock_off; - u32 id; - int numa_node; - u32 btf_key_type_id; - u32 btf_value_type_id; - struct btf *btf; - struct bpf_map_memory memory; - char name[16]; - bool unpriv_array; - bool frozen; - long: 48; - long: 64; - long: 64; - atomic64_t refcnt; - atomic64_t usercnt; - struct work_struct work; - struct mutex freeze_mutex; - u64 writecnt; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct k_sigaction { + struct sigaction sa; }; -struct btf_type { - __u32 name_off; - __u32 info; - union { - __u32 size; - __u32 type; - }; +struct cpu_itimer { + u64 expires; + u64 incr; }; -enum bpf_tramp_prog_type { - BPF_TRAMP_FENTRY = 0, - BPF_TRAMP_FEXIT = 1, - BPF_TRAMP_MAX = 2, +struct task_cputime_atomic { + atomic64_t utime; + atomic64_t stime; + atomic64_t sum_exec_runtime; }; -struct bpf_trampoline; - -struct bpf_jit_poke_descriptor; - -struct bpf_prog_ops; - -struct bpf_prog_offload; - -struct bpf_func_info_aux; - -struct bpf_prog_stats; - -struct bpf_prog_aux { - atomic64_t refcnt; - u32 used_map_cnt; - u32 max_ctx_offset; - u32 max_pkt_offset; - u32 max_tp_access; - u32 stack_depth; - u32 id; - u32 func_cnt; - u32 func_idx; - u32 attach_btf_id; - struct bpf_prog *linked_prog; - bool verifier_zext; - bool offload_requested; - bool attach_btf_trace; - bool func_proto_unreliable; - enum bpf_tramp_prog_type trampoline_prog_type; - struct bpf_trampoline *trampoline; - struct hlist_node tramp_hlist; - const struct btf_type *attach_func_proto; - const char *attach_func_name; - struct bpf_prog **func; - void *jit_data; - struct bpf_jit_poke_descriptor *poke_tab; - u32 size_poke_tab; - struct latch_tree_node ksym_tnode; - struct list_head ksym_lnode; - const struct bpf_prog_ops *ops; - struct bpf_map **used_maps; - struct bpf_prog *prog; - struct user_struct *user; - u64 load_time; - struct bpf_map *cgroup_storage[2]; - char name[16]; - void *security; - struct bpf_prog_offload *offload; - struct btf *btf; - struct bpf_func_info *func_info; - struct bpf_func_info_aux *func_info_aux; - struct bpf_line_info *linfo; - void **jited_linfo; - u32 func_info_cnt; - u32 nr_linfo; - u32 linfo_idx; - u32 num_exentries; - struct exception_table_entry *extable; - struct bpf_prog_stats *stats; - union { - struct work_struct work; - struct callback_head rcu; - }; +struct thread_group_cputimer { + struct task_cputime_atomic cputime_atomic; }; -struct sock_filter { - __u16 code; - __u8 jt; - __u8 jf; - __u32 k; +struct pacct_struct { + int ac_flag; + long int ac_exitcode; + long unsigned int ac_mem; + u64 ac_utime; + u64 ac_stime; + long unsigned int ac_minflt; + long unsigned int ac_majflt; }; -struct sock_fprog_kern; +struct tty_struct; -struct bpf_prog { - u16 pages; - u16 jited: 1; - u16 jit_requested: 1; - u16 gpl_compatible: 1; - u16 cb_access: 1; - u16 dst_needed: 1; - u16 blinded: 1; - u16 is_func: 1; - u16 kprobe_override: 1; - u16 has_callchain_buf: 1; - u16 enforce_expected_attach_type: 1; - enum bpf_prog_type type; - enum bpf_attach_type expected_attach_type; - u32 len; - u32 jited_len; - u8 tag[8]; - struct bpf_prog_aux *aux; - struct sock_fprog_kern *orig_prog; - unsigned int (*bpf_func)(const void *, const struct bpf_insn *); +struct taskstats; + +struct tty_audit_buf; + +struct signal_struct { + refcount_t sigcnt; + atomic_t live; + int nr_threads; + struct list_head thread_head; + wait_queue_head_t wait_chldexit; + struct task_struct *curr_target; + struct sigpending shared_pending; + struct hlist_head multiprocess; + int group_exit_code; + int notify_count; + struct task_struct *group_exit_task; + int group_stop_count; + unsigned int flags; + unsigned int is_child_subreaper: 1; + unsigned int has_child_subreaper: 1; + int posix_timer_id; + struct list_head posix_timers; + struct hrtimer real_timer; + ktime_t it_real_incr; + struct cpu_itimer it[2]; + struct thread_group_cputimer cputimer; + struct posix_cputimers posix_cputimers; + struct pid *pids[4]; + struct pid *tty_old_pgrp; + int leader; + struct tty_struct *tty; + seqlock_t stats_lock; + u64 utime; + u64 stime; + u64 cutime; + u64 cstime; + u64 gtime; + u64 cgtime; + struct prev_cputime prev_cputime; + long unsigned int nvcsw; + long unsigned int nivcsw; + long unsigned int cnvcsw; + long unsigned int cnivcsw; + long unsigned int min_flt; + long unsigned int maj_flt; + long unsigned int cmin_flt; + long unsigned int cmaj_flt; + long unsigned int inblock; + long unsigned int oublock; + long unsigned int cinblock; + long unsigned int coublock; + long unsigned int maxrss; + long unsigned int cmaxrss; + struct task_io_accounting ioac; + long long unsigned int sum_sched_runtime; + struct rlimit rlim[16]; + struct pacct_struct pacct; + struct taskstats *stats; + unsigned int audit_tty; + struct tty_audit_buf *tty_audit_buf; + bool oom_flag_origin; + short int oom_score_adj; + short int oom_score_adj_min; + struct mm_struct *oom_mm; + struct mutex cred_guard_mutex; +}; + +typedef int32_t key_serial_t; + +typedef uint32_t key_perm_t; + +struct key_type; + +struct key_tag; + +struct keyring_index_key { + long unsigned int hash; union { - struct sock_filter insns[0]; - struct bpf_insn insnsi[0]; + struct { + u16 desc_len; + char desc[6]; + }; + long unsigned int x; }; + struct key_type *type; + struct key_tag *domain_tag; + const char *description; }; -struct bpf_offloaded_map; +union key_payload { + void *rcu_data0; + void *data[4]; +}; -struct bpf_map_dev_ops { - int (*map_get_next_key)(struct bpf_offloaded_map *, void *, void *); - int (*map_lookup_elem)(struct bpf_offloaded_map *, void *, void *); - int (*map_update_elem)(struct bpf_offloaded_map *, void *, void *, u64); - int (*map_delete_elem)(struct bpf_offloaded_map *, void *); +struct assoc_array_ptr; + +struct assoc_array { + struct assoc_array_ptr *root; + long unsigned int nr_leaves_on_tree; }; -struct bpf_offloaded_map { - struct bpf_map map; - struct net_device *netdev; - const struct bpf_map_dev_ops *dev_ops; - void *dev_priv; - struct list_head offloads; - long: 64; - long: 64; - long: 64; +struct key_user; + +struct key_restriction; + +struct key { + refcount_t usage; + key_serial_t serial; + union { + struct list_head graveyard_link; + struct rb_node serial_node; + }; + struct rw_semaphore sem; + struct key_user *user; + void *security; + union { + time64_t expiry; + time64_t revoked_at; + }; + time64_t last_used_at; + kuid_t uid; + kgid_t gid; + key_perm_t perm; + short unsigned int quotalen; + short unsigned int datalen; + short int state; + long unsigned int flags; + union { + struct keyring_index_key index_key; + struct { + long unsigned int hash; + long unsigned int len_desc; + struct key_type *type; + struct key_tag *domain_tag; + char *description; + }; + }; + union { + union key_payload payload; + struct { + struct list_head name_link; + struct assoc_array keys; + }; + }; + struct key_restriction *restrict_link; }; -struct net_device_stats { - long unsigned int rx_packets; - long unsigned int tx_packets; - long unsigned int rx_bytes; - long unsigned int tx_bytes; - long unsigned int rx_errors; - long unsigned int tx_errors; - long unsigned int rx_dropped; - long unsigned int tx_dropped; - long unsigned int multicast; - long unsigned int collisions; - long unsigned int rx_length_errors; - long unsigned int rx_over_errors; - long unsigned int rx_crc_errors; - long unsigned int rx_frame_errors; - long unsigned int rx_fifo_errors; - long unsigned int rx_missed_errors; - long unsigned int tx_aborted_errors; - long unsigned int tx_carrier_errors; - long unsigned int tx_fifo_errors; - long unsigned int tx_heartbeat_errors; - long unsigned int tx_window_errors; - long unsigned int rx_compressed; - long unsigned int tx_compressed; +struct uts_namespace; + +struct ipc_namespace; + +struct mnt_namespace; + +struct net; + +struct cgroup_namespace; + +struct nsproxy { + atomic_t count; + struct uts_namespace *uts_ns; + struct ipc_namespace *ipc_ns; + struct mnt_namespace *mnt_ns; + struct pid_namespace *pid_ns_for_children; + struct net *net_ns; + struct cgroup_namespace *cgroup_ns; }; -struct netdev_hw_addr_list { - struct list_head list; - int count; +struct sighand_struct { + spinlock_t siglock; + refcount_t count; + wait_queue_head_t signalfd_wqh; + struct k_sigaction action[64]; }; -enum rx_handler_result { - RX_HANDLER_CONSUMED = 0, - RX_HANDLER_ANOTHER = 1, - RX_HANDLER_EXACT = 2, - RX_HANDLER_PASS = 3, +struct bio; + +struct bio_list { + struct bio *head; + struct bio *tail; }; -typedef enum rx_handler_result rx_handler_result_t; +struct blk_plug { + struct list_head mq_list; + struct list_head cb_list; + short unsigned int rq_count; + bool multiple_queues; +}; -typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **); +struct reclaim_state { + long unsigned int reclaimed_slab; +}; -struct pcpu_dstats; +typedef int congested_fn(void *, int); -struct netdev_tc_txq { - u16 count; - u16 offset; +struct fprop_local_percpu { + struct percpu_counter events; + unsigned int period; + raw_spinlock_t lock; }; -struct sfp_bus; +enum wb_reason { + WB_REASON_BACKGROUND = 0, + WB_REASON_VMSCAN = 1, + WB_REASON_SYNC = 2, + WB_REASON_PERIODIC = 3, + WB_REASON_LAPTOP_TIMER = 4, + WB_REASON_FREE_MORE_MEM = 5, + WB_REASON_FS_FREE_SPACE = 6, + WB_REASON_FORKER_THREAD = 7, + WB_REASON_FOREIGN_FLUSH = 8, + WB_REASON_MAX = 9, +}; -struct netdev_name_node; +struct bdi_writeback_congested; -struct dev_ifalias; +struct bdi_writeback { + struct backing_dev_info *bdi; + long unsigned int state; + long unsigned int last_old_flush; + struct list_head b_dirty; + struct list_head b_io; + struct list_head b_more_io; + struct list_head b_dirty_time; + spinlock_t list_lock; + struct percpu_counter stat[4]; + struct bdi_writeback_congested *congested; + long unsigned int bw_time_stamp; + long unsigned int dirtied_stamp; + long unsigned int written_stamp; + long unsigned int write_bandwidth; + long unsigned int avg_write_bandwidth; + long unsigned int dirty_ratelimit; + long unsigned int balanced_dirty_ratelimit; + struct fprop_local_percpu completions; + int dirty_exceeded; + enum wb_reason start_all_reason; + spinlock_t work_lock; + struct list_head work_list; + struct delayed_work dwork; + long unsigned int dirty_sleep; + struct list_head bdi_node; +}; -struct net_device_ops; +struct backing_dev_info { + u64 id; + struct rb_node rb_node; + struct list_head bdi_list; + long unsigned int ra_pages; + long unsigned int io_pages; + congested_fn *congested_fn; + void *congested_data; + const char *name; + struct kref refcnt; + unsigned int capabilities; + unsigned int min_ratio; + unsigned int max_ratio; + unsigned int max_prop_frac; + atomic_long_t tot_write_bandwidth; + struct bdi_writeback wb; + struct list_head wb_list; + struct bdi_writeback_congested *wb_congested; + wait_queue_head_t wb_waitq; + struct device *dev; + struct device *owner; + struct timer_list laptop_mode_wb_timer; + struct dentry *debug_dir; +}; -struct ethtool_ops; +struct cgroup_subsys_state; -struct ndisc_ops; +struct cgroup; -struct header_ops; +struct css_set { + struct cgroup_subsys_state *subsys[4]; + refcount_t refcount; + struct css_set *dom_cset; + struct cgroup *dfl_cgrp; + int nr_tasks; + struct list_head tasks; + struct list_head mg_tasks; + struct list_head dying_tasks; + struct list_head task_iters; + struct list_head e_cset_node[4]; + struct list_head threaded_csets; + struct list_head threaded_csets_node; + struct hlist_node hlist; + struct list_head cgrp_links; + struct list_head mg_preload_node; + struct list_head mg_node; + struct cgroup *mg_src_cgrp; + struct cgroup *mg_dst_cgrp; + struct css_set *mg_dst_cset; + bool dead; + struct callback_head callback_head; +}; -struct in_device; +struct perf_event_groups { + struct rb_root tree; + u64 index; +}; -struct inet6_dev; +struct perf_event_context { + struct pmu *pmu; + raw_spinlock_t lock; + struct mutex mutex; + struct list_head active_ctx_list; + struct perf_event_groups pinned_groups; + struct perf_event_groups flexible_groups; + struct list_head event_list; + struct list_head pinned_active; + struct list_head flexible_active; + int nr_events; + int nr_active; + int is_active; + int nr_stat; + int nr_freq; + int rotate_disable; + int rotate_necessary; + refcount_t refcount; + struct task_struct *task; + u64 time; + u64 timestamp; + struct perf_event_context *parent_ctx; + u64 parent_gen; + u64 generation; + int pin_count; + void *task_ctx_data; + struct callback_head callback_head; +}; -struct wireless_dev; +struct task_delay_info { + raw_spinlock_t lock; + unsigned int flags; + u64 blkio_start; + u64 blkio_delay; + u64 swapin_delay; + u32 blkio_count; + u32 swapin_count; + u64 freepages_start; + u64 freepages_delay; + u64 thrashing_start; + u64 thrashing_delay; + u32 freepages_count; + u32 thrashing_count; +}; -struct wpan_dev; +union thread_union { + struct task_struct task; + long unsigned int stack[2048]; +}; -struct netdev_rx_queue; +typedef unsigned int blk_qc_t; -struct mini_Qdisc; +typedef blk_qc_t make_request_fn(struct request_queue *, struct bio *); -struct netdev_queue; +struct request; -struct cpu_rmap; +typedef int dma_drain_needed_fn(struct request *); -struct Qdisc; +struct blk_rq_stat { + u64 mean; + u64 min; + u64 max; + u32 nr_samples; + u64 batch; +}; -struct xps_dev_maps; +enum blk_zoned_model { + BLK_ZONED_NONE = 0, + BLK_ZONED_HA = 1, + BLK_ZONED_HM = 2, +}; -struct netpoll_info; +struct queue_limits { + long unsigned int bounce_pfn; + long unsigned int seg_boundary_mask; + long unsigned int virt_boundary_mask; + unsigned int max_hw_sectors; + unsigned int max_dev_sectors; + unsigned int chunk_sectors; + unsigned int max_sectors; + unsigned int max_segment_size; + unsigned int physical_block_size; + unsigned int logical_block_size; + unsigned int alignment_offset; + unsigned int io_min; + unsigned int io_opt; + unsigned int max_discard_sectors; + unsigned int max_hw_discard_sectors; + unsigned int max_write_same_sectors; + unsigned int max_write_zeroes_sectors; + unsigned int discard_granularity; + unsigned int discard_alignment; + short unsigned int max_segments; + short unsigned int max_integrity_segments; + short unsigned int max_discard_segments; + unsigned char misaligned; + unsigned char discard_misaligned; + unsigned char raid_partial_stripes_expensive; + enum blk_zoned_model zoned; +}; -struct pcpu_lstats; +struct bsg_ops; -struct pcpu_sw_netstats; +struct bsg_class_device { + struct device *class_dev; + int minor; + struct request_queue *queue; + const struct bsg_ops *ops; +}; -struct rtnl_link_ops; +typedef void *mempool_alloc_t(gfp_t, void *); -struct phy_device; +typedef void mempool_free_t(void *, void *); -struct net_device { - char name[16]; - struct netdev_name_node *name_node; - struct dev_ifalias *ifalias; - long unsigned int mem_end; - long unsigned int mem_start; - long unsigned int base_addr; - int irq; - long unsigned int state; - struct list_head dev_list; - struct list_head napi_list; - struct list_head unreg_list; - struct list_head close_list; - struct list_head ptype_all; - struct list_head ptype_specific; - struct { - struct list_head upper; - struct list_head lower; - } adj_list; - netdev_features_t features; - netdev_features_t hw_features; - netdev_features_t wanted_features; - netdev_features_t vlan_features; - netdev_features_t hw_enc_features; - netdev_features_t mpls_features; - netdev_features_t gso_partial_features; - int ifindex; - int group; - struct net_device_stats stats; - atomic_long_t rx_dropped; - atomic_long_t tx_dropped; - atomic_long_t rx_nohandler; - atomic_t carrier_up_count; - atomic_t carrier_down_count; - const struct net_device_ops *netdev_ops; - const struct ethtool_ops *ethtool_ops; - const struct ndisc_ops *ndisc_ops; - const struct header_ops *header_ops; - unsigned int flags; - unsigned int priv_flags; - short unsigned int gflags; - short unsigned int padded; - unsigned char operstate; - unsigned char link_mode; - unsigned char if_port; - unsigned char dma; - unsigned int mtu; - unsigned int min_mtu; - unsigned int max_mtu; - short unsigned int type; - short unsigned int hard_header_len; - unsigned char min_header_len; - short unsigned int needed_headroom; - short unsigned int needed_tailroom; - unsigned char perm_addr[32]; - unsigned char addr_assign_type; - unsigned char addr_len; - unsigned char upper_level; - unsigned char lower_level; - short unsigned int neigh_priv_len; - short unsigned int dev_id; - short unsigned int dev_port; - spinlock_t addr_list_lock; - unsigned char name_assign_type; - bool uc_promisc; - struct netdev_hw_addr_list uc; - struct netdev_hw_addr_list mc; - struct netdev_hw_addr_list dev_addrs; - struct kset *queues_kset; - unsigned int promiscuity; - unsigned int allmulti; - struct in_device *ip_ptr; - struct inet6_dev *ip6_ptr; - struct wireless_dev *ieee80211_ptr; - struct wpan_dev *ieee802154_ptr; - unsigned char *dev_addr; - struct netdev_rx_queue *_rx; - unsigned int num_rx_queues; - unsigned int real_num_rx_queues; - struct bpf_prog *xdp_prog; - long unsigned int gro_flush_timeout; - rx_handler_func_t *rx_handler; - void *rx_handler_data; - struct mini_Qdisc *miniq_ingress; - struct netdev_queue *ingress_queue; - struct nf_hook_entries *nf_hooks_ingress; - unsigned char broadcast[32]; - struct cpu_rmap *rx_cpu_rmap; - struct hlist_node index_hlist; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - struct netdev_queue *_tx; - unsigned int num_tx_queues; - unsigned int real_num_tx_queues; - struct Qdisc *qdisc; - struct hlist_head qdisc_hash[16]; - unsigned int tx_queue_len; - spinlock_t tx_global_lock; - int watchdog_timeo; - struct xps_dev_maps *xps_cpus_map; - struct xps_dev_maps *xps_rxqs_map; - struct mini_Qdisc *miniq_egress; - struct timer_list watchdog_timer; - int *pcpu_refcnt; - struct list_head todo_list; - struct list_head link_watch_list; - enum { - NETREG_UNINITIALIZED = 0, - NETREG_REGISTERED = 1, - NETREG_UNREGISTERING = 2, - NETREG_UNREGISTERED = 3, - NETREG_RELEASED = 4, - NETREG_DUMMY = 5, - } reg_state: 8; - bool dismantle; - enum { - RTNL_LINK_INITIALIZED = 0, - RTNL_LINK_INITIALIZING = 1, - } rtnl_link_state: 16; - bool needs_free_netdev; - void (*priv_destructor)(struct net_device *); - struct netpoll_info *npinfo; - possible_net_t nd_net; - union { - void *ml_priv; - struct pcpu_lstats *lstats; - struct pcpu_sw_netstats *tstats; - struct pcpu_dstats *dstats; - }; - struct device dev; - const struct attribute_group *sysfs_groups[4]; - const struct attribute_group *sysfs_rx_queue_group; - const struct rtnl_link_ops *rtnl_link_ops; - unsigned int gso_max_size; - u16 gso_max_segs; - s16 num_tc; - struct netdev_tc_txq tc_to_txq[16]; - u8 prio_tc_map[16]; - struct phy_device *phydev; - struct sfp_bus *sfp_bus; - struct lock_class_key qdisc_tx_busylock_key; - struct lock_class_key qdisc_running_key; - struct lock_class_key qdisc_xmit_lock_key; - struct lock_class_key addr_list_lock_key; - bool proto_down; - unsigned int wol_enabled: 1; +struct mempool_s { + spinlock_t lock; + int min_nr; + int curr_nr; + void **elements; + void *pool_data; + mempool_alloc_t *alloc; + mempool_free_t *free; + wait_queue_head_t wait; }; -struct bpf_prog_ops { - int (*test_run)(struct bpf_prog *, const union bpf_attr *, union bpf_attr *); +typedef struct mempool_s mempool_t; + +struct bio_set { + struct kmem_cache *bio_slab; + unsigned int front_pad; + mempool_t bio_pool; + mempool_t bvec_pool; + spinlock_t rescue_lock; + struct bio_list rescue_list; + struct work_struct rescue_work; + struct workqueue_struct *rescue_workqueue; }; -struct bpf_offload_dev; +struct elevator_queue; -struct bpf_prog_offload { - struct bpf_prog *prog; - struct net_device *netdev; - struct bpf_offload_dev *offdev; - void *dev_priv; - struct list_head offloads; - bool dev_state; - bool opt_failed; - void *jited_image; - u32 jited_len; -}; +struct blk_queue_stats; -struct bpf_prog_stats { - u64 cnt; - u64 nsecs; - struct u64_stats_sync syncp; -}; +struct rq_qos; -struct btf_func_model { - u8 ret_size; - u8 nr_args; - u8 arg_size[12]; -}; +struct blk_mq_ops; -struct bpf_trampoline { - struct hlist_node hlist; - struct mutex mutex; - refcount_t refcnt; - u64 key; - struct { - struct btf_func_model model; - void *addr; - bool ftrace_managed; - } func; - struct hlist_head progs_hlist[2]; - int progs_cnt[2]; - void *image; - u64 selector; -}; +struct blk_mq_ctx; -struct bpf_func_info_aux { - bool unreliable; -}; +struct blk_mq_hw_ctx; -struct bpf_jit_poke_descriptor { - void *ip; - union { - struct { - struct bpf_map *map; - u32 key; - } tail_call; - }; - bool ip_stable; - u8 adj_off; - u16 reason; -}; +struct blk_stat_callback; -typedef unsigned int sk_buff_data_t; +struct blk_trace; -struct skb_ext; +struct blk_flush_queue; -struct sk_buff { - union { - struct { - struct sk_buff *next; - struct sk_buff *prev; - union { - struct net_device *dev; - long unsigned int dev_scratch; - }; - }; - struct rb_node rbnode; - struct list_head list; - }; - union { - struct sock *sk; - int ip_defrag_offset; - }; - union { - ktime_t tstamp; - u64 skb_mstamp_ns; - }; - char cb[48]; - union { - struct { - long unsigned int _skb_refdst; - void (*destructor)(struct sk_buff *); - }; - struct list_head tcp_tsorted_anchor; - }; - long unsigned int _nfct; - unsigned int len; - unsigned int data_len; - __u16 mac_len; - __u16 hdr_len; - __u16 queue_mapping; - __u8 __cloned_offset[0]; - __u8 cloned: 1; - __u8 nohdr: 1; - __u8 fclone: 2; - __u8 peeked: 1; - __u8 head_frag: 1; - __u8 pfmemalloc: 1; - __u8 active_extensions; - __u32 headers_start[0]; - __u8 __pkt_type_offset[0]; - __u8 pkt_type: 3; - __u8 ignore_df: 1; - __u8 nf_trace: 1; - __u8 ip_summed: 2; - __u8 ooo_okay: 1; - __u8 l4_hash: 1; - __u8 sw_hash: 1; - __u8 wifi_acked_valid: 1; - __u8 wifi_acked: 1; - __u8 no_fcs: 1; - __u8 encapsulation: 1; - __u8 encap_hdr_csum: 1; - __u8 csum_valid: 1; - __u8 __pkt_vlan_present_offset[0]; - __u8 vlan_present: 1; - __u8 csum_complete_sw: 1; - __u8 csum_level: 2; - __u8 csum_not_inet: 1; - __u8 dst_pending_confirm: 1; - __u8 ndisc_nodetype: 2; - __u8 ipvs_property: 1; - __u8 inner_protocol_type: 1; - __u8 remcsum_offload: 1; - __u8 tc_skip_classify: 1; - __u8 tc_at_ingress: 1; - __u8 tc_redirected: 1; - __u8 tc_from_ingress: 1; - __u16 tc_index; - union { - __wsum csum; - struct { - __u16 csum_start; - __u16 csum_offset; - }; - }; - __u32 priority; - int skb_iif; - __u32 hash; - __be16 vlan_proto; - __u16 vlan_tci; - union { - unsigned int napi_id; - unsigned int sender_cpu; - }; - __u32 secmark; - union { - __u32 mark; - __u32 reserved_tailroom; - }; - union { - __be16 inner_protocol; - __u8 inner_ipproto; - }; - __u16 inner_transport_header; - __u16 inner_network_header; - __u16 inner_mac_header; - __be16 protocol; - __u16 transport_header; - __u16 network_header; - __u16 mac_header; - __u32 headers_end[0]; - sk_buff_data_t tail; - sk_buff_data_t end; - unsigned char *head; - unsigned char *data; - unsigned int truesize; - refcount_t users; - struct skb_ext *extensions; -}; +struct blk_mq_tag_set; -struct sg_table { - struct scatterlist *sgl; - unsigned int nents; - unsigned int orig_nents; +struct request_queue { + struct request *last_merge; + struct elevator_queue *elevator; + struct blk_queue_stats *stats; + struct rq_qos *rq_qos; + make_request_fn *make_request_fn; + dma_drain_needed_fn *dma_drain_needed; + const struct blk_mq_ops *mq_ops; + struct blk_mq_ctx *queue_ctx; + unsigned int queue_depth; + struct blk_mq_hw_ctx **queue_hw_ctx; + unsigned int nr_hw_queues; + struct backing_dev_info *backing_dev_info; + void *queuedata; + long unsigned int queue_flags; + atomic_t pm_only; + int id; + gfp_t bounce_gfp; + spinlock_t queue_lock; + struct kobject kobj; + struct kobject *mq_kobj; + struct device *dev; + int rpm_status; + unsigned int nr_pending; + long unsigned int nr_requests; + unsigned int dma_drain_size; + void *dma_drain_buffer; + unsigned int dma_pad_mask; + unsigned int dma_alignment; + unsigned int rq_timeout; + int poll_nsec; + struct blk_stat_callback *poll_cb; + struct blk_rq_stat poll_stat[16]; + struct timer_list timeout; + struct work_struct timeout_work; + struct list_head icq_list; + struct queue_limits limits; + unsigned int required_elevator_features; + unsigned int sg_timeout; + unsigned int sg_reserved_size; + int node; + struct blk_trace *blk_trace; + struct mutex blk_trace_mutex; + struct blk_flush_queue *fq; + struct list_head requeue_list; + spinlock_t requeue_lock; + struct delayed_work requeue_work; + struct mutex sysfs_lock; + struct mutex sysfs_dir_lock; + struct list_head unused_hctx_list; + spinlock_t unused_hctx_lock; + int mq_freeze_depth; + struct bsg_class_device bsg_dev; + struct callback_head callback_head; + wait_queue_head_t mq_freeze_wq; + struct mutex mq_freeze_lock; + struct percpu_ref q_usage_counter; + struct blk_mq_tag_set *tag_set; + struct list_head tag_set_list; + struct bio_set bio_split; + struct dentry *debugfs_dir; + struct dentry *sched_debugfs_dir; + struct dentry *rqos_debugfs_dir; + bool mq_sysfs_init_done; + size_t cmd_size; + struct work_struct release_work; + u64 write_hints[5]; }; -enum suspend_stat_step { - SUSPEND_FREEZE = 1, - SUSPEND_PREPARE = 2, - SUSPEND_SUSPEND = 3, - SUSPEND_SUSPEND_LATE = 4, - SUSPEND_SUSPEND_NOIRQ = 5, - SUSPEND_RESUME_NOIRQ = 6, - SUSPEND_RESUME_EARLY = 7, - SUSPEND_RESUME = 8, +enum writeback_sync_modes { + WB_SYNC_NONE = 0, + WB_SYNC_ALL = 1, }; -struct suspend_stats { - int success; - int fail; - int failed_freeze; - int failed_prepare; - int failed_suspend; - int failed_suspend_late; - int failed_suspend_noirq; - int failed_resume; - int failed_resume_early; - int failed_resume_noirq; - int last_failed_dev; - char failed_devs[80]; - int last_failed_errno; - int errno[2]; - int last_failed_step; - enum suspend_stat_step failed_steps[2]; +struct writeback_control { + long int nr_to_write; + long int pages_skipped; + loff_t range_start; + loff_t range_end; + enum writeback_sync_modes sync_mode; + unsigned int for_kupdate: 1; + unsigned int for_background: 1; + unsigned int tagged_writepages: 1; + unsigned int for_reclaim: 1; + unsigned int range_cyclic: 1; + unsigned int for_sync: 1; + unsigned int no_cgroup_owner: 1; + unsigned int punt_to_cgroup: 1; }; -enum s2idle_states { - S2IDLE_STATE_NONE = 0, - S2IDLE_STATE_ENTER = 1, - S2IDLE_STATE_WAKE = 2, +struct swap_cluster_info { + spinlock_t lock; + unsigned int data: 24; + unsigned int flags: 8; }; -enum { - Root_NFS = 255, - Root_CIFS = 254, - Root_RAM0 = 1048576, - Root_RAM1 = 1048577, - Root_FD0 = 2097152, - Root_HDA1 = 3145729, - Root_HDA2 = 3145730, - Root_SDA1 = 8388609, - Root_SDA2 = 8388610, - Root_HDC1 = 23068673, - Root_SR0 = 11534336, +struct swap_cluster_list { + struct swap_cluster_info head; + struct swap_cluster_info tail; }; -struct ethhdr { - unsigned char h_dest[6]; - unsigned char h_source[6]; - __be16 h_proto; -}; +struct percpu_cluster; -struct flow_dissector { - unsigned int used_keys; - short unsigned int offset[27]; +struct swap_info_struct { + long unsigned int flags; + short int prio; + struct plist_node list; + signed char type; + unsigned int max; + unsigned char *swap_map; + struct swap_cluster_info *cluster_info; + struct swap_cluster_list free_clusters; + unsigned int lowest_bit; + unsigned int highest_bit; + unsigned int pages; + unsigned int inuse_pages; + unsigned int cluster_next; + unsigned int cluster_nr; + struct percpu_cluster *percpu_cluster; + struct rb_root swap_extent_root; + struct block_device *bdev; + struct file *swap_file; + unsigned int old_block_size; + spinlock_t lock; + spinlock_t cont_lock; + struct work_struct discard_work; + struct swap_cluster_list discard_clusters; + struct plist_node avail_lists[0]; }; -struct flowi_tunnel { - __be64 tun_id; -}; +struct partition_meta_info; -struct flowi_common { - int flowic_oif; - int flowic_iif; - __u32 flowic_mark; - __u8 flowic_tos; - __u8 flowic_scope; - __u8 flowic_proto; - __u8 flowic_flags; - __u32 flowic_secid; - kuid_t flowic_uid; - struct flowi_tunnel flowic_tun_key; - __u32 flowic_multipath_hash; +struct disk_stats; + +struct hd_struct { + sector_t start_sect; + sector_t nr_sects; + seqcount_t nr_sects_seq; + sector_t alignment_offset; + unsigned int discard_alignment; + struct device __dev; + struct kobject *holder_dir; + int policy; + int partno; + struct partition_meta_info *info; + long unsigned int stamp; + struct disk_stats *dkstats; + struct percpu_ref ref; + struct rcu_work rcu_work; }; -union flowi_uli { - struct { - __be16 dport; - __be16 sport; - } ports; - struct { - __u8 type; - __u8 code; - } icmpt; - struct { - __le16 dport; - __le16 sport; - } dnports; - __be32 spi; - __be32 gre_key; - struct { - __u8 type; - } mht; -}; +struct disk_part_tbl; -struct flowi4 { - struct flowi_common __fl_common; - __be32 saddr; - __be32 daddr; - union flowi_uli uli; -}; +struct block_device_operations; -struct flowi6 { - struct flowi_common __fl_common; - struct in6_addr daddr; - struct in6_addr saddr; - __be32 flowlabel; - union flowi_uli uli; - __u32 mp_hash; -}; +struct timer_rand_state; -struct flowidn { - struct flowi_common __fl_common; - __le16 daddr; - __le16 saddr; - union flowi_uli uli; -}; +struct disk_events; -struct flowi { - union { - struct flowi_common __fl_common; - struct flowi4 ip4; - struct flowi6 ip6; - struct flowidn dn; - } u; -}; +struct badblocks; -struct ipstats_mib { - u64 mibs[37]; - struct u64_stats_sync syncp; +struct gendisk { + int major; + int first_minor; + int minors; + char disk_name[32]; + char * (*devnode)(struct gendisk *, umode_t *); + short unsigned int events; + short unsigned int event_flags; + struct disk_part_tbl *part_tbl; + struct hd_struct part0; + const struct block_device_operations *fops; + struct request_queue *queue; + void *private_data; + int flags; + struct rw_semaphore lookup_sem; + struct kobject *slave_dir; + struct timer_rand_state *random; + atomic_t sync_io; + struct disk_events *ev; + int node_id; + struct badblocks *bb; + struct lockdep_map lockdep_map; }; -struct icmp_mib { - long unsigned int mibs[28]; +struct cdev { + struct kobject kobj; + struct module *owner; + const struct file_operations *ops; + struct list_head list; + dev_t dev; + unsigned int count; }; -struct icmpmsg_mib { - atomic_long_t mibs[512]; -}; +typedef u8 blk_status_t; -struct icmpv6_mib { - long unsigned int mibs[6]; +struct bvec_iter { + sector_t bi_sector; + unsigned int bi_size; + unsigned int bi_idx; + unsigned int bi_bvec_done; }; -struct icmpv6_mib_device { - atomic_long_t mibs[6]; -}; +typedef void bio_end_io_t(struct bio *); -struct icmpv6msg_mib { - atomic_long_t mibs[512]; +struct bio_vec { + struct page *bv_page; + unsigned int bv_len; + unsigned int bv_offset; }; -struct icmpv6msg_mib_device { - atomic_long_t mibs[512]; +struct bio { + struct bio *bi_next; + struct gendisk *bi_disk; + unsigned int bi_opf; + short unsigned int bi_flags; + short unsigned int bi_ioprio; + short unsigned int bi_write_hint; + blk_status_t bi_status; + u8 bi_partno; + atomic_t __bi_remaining; + struct bvec_iter bi_iter; + bio_end_io_t *bi_end_io; + void *bi_private; + union { }; + short unsigned int bi_vcnt; + short unsigned int bi_max_vecs; + atomic_t __bi_cnt; + struct bio_vec *bi_io_vec; + struct bio_set *bi_pool; + struct bio_vec bi_inline_vecs[0]; }; -struct tcp_mib { - long unsigned int mibs[16]; +struct linux_binprm { + struct vm_area_struct *vma; + long unsigned int vma_pages; + struct mm_struct *mm; + long unsigned int p; + long unsigned int argmin; + unsigned int called_set_creds: 1; + unsigned int cap_elevated: 1; + unsigned int secureexec: 1; + unsigned int recursion_depth; + struct file *file; + struct cred *cred; + int unsafe; + unsigned int per_clear; + int argc; + int envc; + const char *filename; + const char *interp; + unsigned int interp_flags; + unsigned int interp_data; + long unsigned int loader; + long unsigned int exec; + struct rlimit rlim_stack; + char buf[256]; }; -struct udp_mib { - long unsigned int mibs[9]; +struct coredump_params { + const kernel_siginfo_t *siginfo; + struct pt_regs *regs; + struct file *file; + long unsigned int limit; + long unsigned int mm_flags; + loff_t written; + loff_t pos; }; -struct linux_mib { - long unsigned int mibs[120]; +struct key_tag { + struct callback_head rcu; + refcount_t usage; + bool removed; }; -struct inet_frags; - -struct fqdir { - long int high_thresh; - long int low_thresh; - int timeout; - int max_dist; - struct inet_frags *f; - struct net *net; - bool dead; - long: 56; - long: 64; - long: 64; - struct rhashtable rhashtable; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - atomic_long_t mem; - struct work_struct destroy_work; - long: 64; - long: 64; - long: 64; -}; +typedef int (*request_key_actor_t)(struct key *, void *); -struct inet_frag_queue; +struct key_preparsed_payload; -struct inet_frags { - unsigned int qsize; - void (*constructor)(struct inet_frag_queue *, const void *); - void (*destructor)(struct inet_frag_queue *); - void (*frag_expire)(struct timer_list *); - struct kmem_cache *frags_cachep; - const char *frags_cache_name; - struct rhashtable_params rhash_params; - refcount_t refcnt; - struct completion completion; -}; +struct key_match_data; -struct frag_v4_compare_key { - __be32 saddr; - __be32 daddr; - u32 user; - u32 vif; - __be16 id; - u16 protocol; -}; +struct kernel_pkey_params; -struct frag_v6_compare_key { - struct in6_addr saddr; - struct in6_addr daddr; - u32 user; - __be32 id; - u32 iif; -}; +struct kernel_pkey_query; -struct inet_frag_queue { - struct rhash_head node; - union { - struct frag_v4_compare_key v4; - struct frag_v6_compare_key v6; - } key; - struct timer_list timer; - spinlock_t lock; - refcount_t refcnt; - struct rb_root rb_fragments; - struct sk_buff *fragments_tail; - struct sk_buff *last_run_head; - ktime_t stamp; - int len; - int meat; - __u8 flags; - u16 max_size; - struct fqdir *fqdir; - struct callback_head rcu; +struct key_type { + const char *name; + size_t def_datalen; + unsigned int flags; + int (*vet_description)(const char *); + int (*preparse)(struct key_preparsed_payload *); + void (*free_preparse)(struct key_preparsed_payload *); + int (*instantiate)(struct key *, struct key_preparsed_payload *); + int (*update)(struct key *, struct key_preparsed_payload *); + int (*match_preparse)(struct key_match_data *); + void (*match_free)(struct key_match_data *); + void (*revoke)(struct key *); + void (*destroy)(struct key *); + void (*describe)(const struct key *, struct seq_file *); + long int (*read)(const struct key *, char *, size_t); + request_key_actor_t request_key; + struct key_restriction * (*lookup_restriction)(const char *); + int (*asym_query)(const struct kernel_pkey_params *, struct kernel_pkey_query *); + int (*asym_eds_op)(struct kernel_pkey_params *, const void *, void *); + int (*asym_verify_signature)(struct kernel_pkey_params *, const void *, const void *); + struct list_head link; + struct lock_class_key lock_class; }; -struct fib_rule; - -struct fib_lookup_arg; +typedef int (*key_restrict_link_func_t)(struct key *, const struct key_type *, const union key_payload *, struct key *); -struct fib_rule_hdr; +struct key_restriction { + key_restrict_link_func_t check; + struct key *key; + struct key_type *keytype; +}; -struct nlattr; +struct group_info { + atomic_t usage; + int ngroups; + kgid_t gid[0]; +}; -struct netlink_ext_ack; +struct ring_buffer_event { + u32 type_len: 5; + u32 time_delta: 27; + u32 array[0]; +}; -struct nla_policy; +struct seq_buf { + char *buffer; + size_t size; + size_t len; + loff_t readpos; +}; -struct fib_rules_ops { - int family; - struct list_head list; - int rule_size; - int addr_size; - int unresolved_rules; - int nr_goto_rules; - unsigned int fib_rules_seq; - int (*action)(struct fib_rule *, struct flowi *, int, struct fib_lookup_arg *); - bool (*suppress)(struct fib_rule *, struct fib_lookup_arg *); - int (*match)(struct fib_rule *, struct flowi *, int); - int (*configure)(struct fib_rule *, struct sk_buff *, struct fib_rule_hdr *, struct nlattr **, struct netlink_ext_ack *); - int (*delete)(struct fib_rule *); - int (*compare)(struct fib_rule *, struct fib_rule_hdr *, struct nlattr **); - int (*fill)(struct fib_rule *, struct sk_buff *, struct fib_rule_hdr *); - size_t (*nlmsg_payload)(struct fib_rule *); - void (*flush_cache)(struct fib_rules_ops *); - int nlgroup; - const struct nla_policy *policy; - struct list_head rules_list; - struct module *owner; - struct net *fro_net; - struct callback_head rcu; +struct trace_seq { + unsigned char buffer[4096]; + struct seq_buf seq; + int full; }; -enum tcp_ca_event { - CA_EVENT_TX_START = 0, - CA_EVENT_CWND_RESTART = 1, - CA_EVENT_COMPLETE_CWR = 2, - CA_EVENT_LOSS = 3, - CA_EVENT_ECN_NO_CE = 4, - CA_EVENT_ECN_IS_CE = 5, +enum perf_sw_ids { + PERF_COUNT_SW_CPU_CLOCK = 0, + PERF_COUNT_SW_TASK_CLOCK = 1, + PERF_COUNT_SW_PAGE_FAULTS = 2, + PERF_COUNT_SW_CONTEXT_SWITCHES = 3, + PERF_COUNT_SW_CPU_MIGRATIONS = 4, + PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, + PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, + PERF_COUNT_SW_ALIGNMENT_FAULTS = 7, + PERF_COUNT_SW_EMULATION_FAULTS = 8, + PERF_COUNT_SW_DUMMY = 9, + PERF_COUNT_SW_BPF_OUTPUT = 10, + PERF_COUNT_SW_MAX = 11, }; -struct ack_sample; +union perf_mem_data_src { + __u64 val; + struct { + __u64 mem_op: 5; + __u64 mem_lvl: 14; + __u64 mem_snoop: 5; + __u64 mem_lock: 2; + __u64 mem_dtlb: 7; + __u64 mem_lvl_num: 4; + __u64 mem_remote: 1; + __u64 mem_snoopx: 2; + __u64 mem_rsvd: 24; + }; +}; -struct rate_sample; +struct perf_branch_entry { + __u64 from; + __u64 to; + __u64 mispred: 1; + __u64 predicted: 1; + __u64 in_tx: 1; + __u64 abort: 1; + __u64 cycles: 16; + __u64 type: 4; + __u64 reserved: 40; +}; -union tcp_cc_info; +struct taskstats { + __u16 version; + __u32 ac_exitcode; + __u8 ac_flag; + __u8 ac_nice; + __u64 cpu_count; + __u64 cpu_delay_total; + __u64 blkio_count; + __u64 blkio_delay_total; + __u64 swapin_count; + __u64 swapin_delay_total; + __u64 cpu_run_real_total; + __u64 cpu_run_virtual_total; + char ac_comm[32]; + __u8 ac_sched; + __u8 ac_pad[3]; + int: 32; + __u32 ac_uid; + __u32 ac_gid; + __u32 ac_pid; + __u32 ac_ppid; + __u32 ac_btime; + __u64 ac_etime; + __u64 ac_utime; + __u64 ac_stime; + __u64 ac_minflt; + __u64 ac_majflt; + __u64 coremem; + __u64 virtmem; + __u64 hiwater_rss; + __u64 hiwater_vm; + __u64 read_char; + __u64 write_char; + __u64 read_syscalls; + __u64 write_syscalls; + __u64 read_bytes; + __u64 write_bytes; + __u64 cancelled_write_bytes; + __u64 nvcsw; + __u64 nivcsw; + __u64 ac_utimescaled; + __u64 ac_stimescaled; + __u64 cpu_scaled_run_real_total; + __u64 freepages_count; + __u64 freepages_delay_total; + __u64 thrashing_count; + __u64 thrashing_delay_total; +}; -struct tcp_congestion_ops { - struct list_head list; - u32 key; - u32 flags; - void (*init)(struct sock *); - void (*release)(struct sock *); - u32 (*ssthresh)(struct sock *); - void (*cong_avoid)(struct sock *, u32, u32); - void (*set_state)(struct sock *, u8); - void (*cwnd_event)(struct sock *, enum tcp_ca_event); - void (*in_ack_event)(struct sock *, u32); - u32 (*undo_cwnd)(struct sock *); - void (*pkts_acked)(struct sock *, const struct ack_sample *); - u32 (*min_tso_segs)(struct sock *); - u32 (*sndbuf_expand)(struct sock *); - void (*cong_control)(struct sock *, const struct rate_sample *); - size_t (*get_info)(struct sock *, u32, int *, union tcp_cc_info *); - char name[16]; - struct module *owner; +struct new_utsname { + char sysname[65]; + char nodename[65]; + char release[65]; + char version[65]; + char machine[65]; + char domainname[65]; }; -struct fib_notifier_ops { - int family; - struct list_head list; - unsigned int (*fib_seq_read)(struct net *); - int (*fib_dump)(struct net *, struct notifier_block *, struct netlink_ext_ack *); - struct module *owner; - struct callback_head rcu; +struct uts_namespace { + struct kref kref; + struct new_utsname name; + struct user_namespace *user_ns; + struct ucounts *ucounts; + struct ns_common ns; }; -struct xfrm_state; +struct cgroup_namespace { + refcount_t count; + struct ns_common ns; + struct user_namespace *user_ns; + struct ucounts *ucounts; + struct css_set *root_cset; +}; -struct lwtunnel_state; +struct proc_ns_operations { + const char *name; + const char *real_ns_name; + int type; + struct ns_common * (*get)(struct task_struct *); + void (*put)(struct ns_common *); + int (*install)(struct nsproxy *, struct ns_common *); + struct user_namespace * (*owner)(struct ns_common *); + struct ns_common * (*get_parent)(struct ns_common *); +}; -struct dst_entry { - struct net_device *dev; - struct dst_ops *ops; - long unsigned int _metrics; - long unsigned int expires; - struct xfrm_state *xfrm; - int (*input)(struct sk_buff *); - int (*output)(struct net *, struct sock *, struct sk_buff *); - short unsigned int flags; - short int obsolete; - short unsigned int header_len; - short unsigned int trailer_len; - atomic_t __refcnt; - int __use; - long unsigned int lastuse; - struct lwtunnel_state *lwtstate; - struct callback_head callback_head; - short int error; - short int __pad; - __u32 tclassid; +struct ucounts { + struct hlist_node node; + struct user_namespace *ns; + kuid_t uid; + int count; + atomic_t ucount[9]; }; -struct hh_cache { - unsigned int hh_len; - seqlock_t hh_lock; - long unsigned int hh_data[12]; +struct perf_guest_info_callbacks { + int (*is_in_guest)(); + int (*is_user_mode)(); + long unsigned int (*get_guest_ip)(); + void (*handle_intel_pt_intr)(); }; -struct neigh_table; - -struct neigh_parms; - -struct neigh_ops; +struct perf_cpu_context; -struct neighbour { - struct neighbour *next; - struct neigh_table *tbl; - struct neigh_parms *parms; - long unsigned int confirmed; - long unsigned int updated; - rwlock_t lock; - refcount_t refcnt; - unsigned int arp_queue_len_bytes; - struct sk_buff_head arp_queue; - struct timer_list timer; - long unsigned int used; - atomic_t probes; - __u8 flags; - __u8 nud_state; - __u8 type; - __u8 dead; - u8 protocol; - seqlock_t ha_lock; - int: 32; - unsigned char ha[32]; - struct hh_cache hh; - int (*output)(struct neighbour *, struct sk_buff *); - const struct neigh_ops *ops; - struct list_head gc_list; - struct callback_head rcu; - struct net_device *dev; - u8 primary_key[0]; -}; +struct perf_output_handle; -struct ipv6_stable_secret { - bool initialized; - struct in6_addr secret; +struct pmu { + struct list_head entry; + struct module *module; + struct device *dev; + const struct attribute_group **attr_groups; + const struct attribute_group **attr_update; + const char *name; + int type; + int capabilities; + int *pmu_disable_count; + struct perf_cpu_context *pmu_cpu_context; + atomic_t exclusive_cnt; + int task_ctx_nr; + int hrtimer_interval_ms; + unsigned int nr_addr_filters; + void (*pmu_enable)(struct pmu *); + void (*pmu_disable)(struct pmu *); + int (*event_init)(struct perf_event *); + void (*event_mapped)(struct perf_event *, struct mm_struct *); + void (*event_unmapped)(struct perf_event *, struct mm_struct *); + int (*add)(struct perf_event *, int); + void (*del)(struct perf_event *, int); + void (*start)(struct perf_event *, int); + void (*stop)(struct perf_event *, int); + void (*read)(struct perf_event *); + void (*start_txn)(struct pmu *, unsigned int); + int (*commit_txn)(struct pmu *); + void (*cancel_txn)(struct pmu *); + int (*event_idx)(struct perf_event *); + void (*sched_task)(struct perf_event_context *, bool); + size_t task_ctx_size; + void (*swap_task_ctx)(struct perf_event_context *, struct perf_event_context *); + void * (*setup_aux)(struct perf_event *, void **, int, bool); + void (*free_aux)(void *); + long int (*snapshot_aux)(struct perf_event *, struct perf_output_handle *, long unsigned int); + int (*addr_filters_validate)(struct list_head *); + void (*addr_filters_sync)(struct perf_event *); + int (*aux_output_match)(struct perf_event *); + int (*filter_match)(struct perf_event *); + int (*check_period)(struct perf_event *, u64); }; -struct ipv6_devconf { - __s32 forwarding; - __s32 hop_limit; - __s32 mtu6; - __s32 accept_ra; - __s32 accept_redirects; - __s32 autoconf; - __s32 dad_transmits; - __s32 rtr_solicits; - __s32 rtr_solicit_interval; - __s32 rtr_solicit_max_interval; - __s32 rtr_solicit_delay; - __s32 force_mld_version; - __s32 mldv1_unsolicited_report_interval; - __s32 mldv2_unsolicited_report_interval; - __s32 use_tempaddr; - __s32 temp_valid_lft; - __s32 temp_prefered_lft; - __s32 regen_max_retry; - __s32 max_desync_factor; - __s32 max_addresses; - __s32 accept_ra_defrtr; - __s32 accept_ra_min_hop_limit; - __s32 accept_ra_pinfo; - __s32 ignore_routes_with_linkdown; - __s32 proxy_ndp; - __s32 accept_source_route; - __s32 accept_ra_from_local; - __s32 disable_ipv6; - __s32 drop_unicast_in_l2_multicast; - __s32 accept_dad; - __s32 force_tllao; - __s32 ndisc_notify; - __s32 suppress_frag_ndisc; - __s32 accept_ra_mtu; - __s32 drop_unsolicited_na; - struct ipv6_stable_secret stable_secret; - __s32 use_oif_addrs_only; - __s32 keep_addr_on_down; - __s32 seg6_enabled; - __u32 enhanced_dad; - __u32 addr_gen_mode; - __s32 disable_policy; - __s32 ndisc_tclass; - struct ctl_table_header *sysctl_header; +enum irq_domain_bus_token { + DOMAIN_BUS_ANY = 0, + DOMAIN_BUS_WIRED = 1, + DOMAIN_BUS_GENERIC_MSI = 2, + DOMAIN_BUS_PCI_MSI = 3, + DOMAIN_BUS_PLATFORM_MSI = 4, + DOMAIN_BUS_NEXUS = 5, + DOMAIN_BUS_IPI = 6, + DOMAIN_BUS_FSL_MC_MSI = 7, + DOMAIN_BUS_TI_SCI_INTA_MSI = 8, + DOMAIN_BUS_WAKEUP = 9, }; -struct nf_queue_entry; +struct irq_domain_ops; -struct nf_queue_handler { - int (*outfn)(struct nf_queue_entry *, unsigned int); - void (*nf_hook_drop)(struct net *); -}; +struct irq_domain_chip_generic; -enum nf_log_type { - NF_LOG_TYPE_LOG = 0, - NF_LOG_TYPE_ULOG = 1, - NF_LOG_TYPE_MAX = 2, +struct irq_domain { + struct list_head link; + const char *name; + const struct irq_domain_ops *ops; + void *host_data; + unsigned int flags; + unsigned int mapcount; + struct fwnode_handle *fwnode; + enum irq_domain_bus_token bus_token; + struct irq_domain_chip_generic *gc; + struct irq_domain *parent; + irq_hw_number_t hwirq_max; + unsigned int revmap_direct_max_irq; + unsigned int revmap_size; + struct xarray revmap_tree; + struct mutex revmap_tree_mutex; + unsigned int linear_revmap[0]; }; -typedef u8 u_int8_t; - -struct nf_loginfo; - -typedef void nf_logfn(struct net *, u_int8_t, unsigned int, const struct sk_buff *, const struct net_device *, const struct net_device *, const struct nf_loginfo *, const char *); - -struct nf_logger { - char *name; - enum nf_log_type type; - nf_logfn *logfn; - struct module *me; -}; +typedef u32 phandle; -struct hlist_nulls_head { - struct hlist_nulls_node *first; -}; +struct property; -struct ct_pcpu { - spinlock_t lock; - struct hlist_nulls_head unconfirmed; - struct hlist_nulls_head dying; +struct device_node { + const char *name; + phandle phandle; + const char *full_name; + struct fwnode_handle fwnode; + struct property *properties; + struct property *deadprops; + struct device_node *parent; + struct device_node *child; + struct device_node *sibling; + long unsigned int _flags; + void *data; }; -struct ip_conntrack_stat { - unsigned int found; - unsigned int invalid; - unsigned int ignore; - unsigned int insert; - unsigned int insert_failed; - unsigned int drop; - unsigned int early_drop; - unsigned int error; - unsigned int expect_new; - unsigned int expect_create; - unsigned int expect_delete; - unsigned int search_restart; +enum cpuhp_state { + CPUHP_INVALID = 4294967295, + CPUHP_OFFLINE = 0, + CPUHP_CREATE_THREADS = 1, + CPUHP_PERF_PREPARE = 2, + CPUHP_PERF_X86_PREPARE = 3, + CPUHP_PERF_X86_AMD_UNCORE_PREP = 4, + CPUHP_PERF_POWER = 5, + CPUHP_PERF_SUPERH = 6, + CPUHP_X86_HPET_DEAD = 7, + CPUHP_X86_APB_DEAD = 8, + CPUHP_X86_MCE_DEAD = 9, + CPUHP_VIRT_NET_DEAD = 10, + CPUHP_SLUB_DEAD = 11, + CPUHP_MM_WRITEBACK_DEAD = 12, + CPUHP_MM_VMSTAT_DEAD = 13, + CPUHP_SOFTIRQ_DEAD = 14, + CPUHP_NET_MVNETA_DEAD = 15, + CPUHP_CPUIDLE_DEAD = 16, + CPUHP_ARM64_FPSIMD_DEAD = 17, + CPUHP_ARM_OMAP_WAKE_DEAD = 18, + CPUHP_IRQ_POLL_DEAD = 19, + CPUHP_BLOCK_SOFTIRQ_DEAD = 20, + CPUHP_ACPI_CPUDRV_DEAD = 21, + CPUHP_S390_PFAULT_DEAD = 22, + CPUHP_BLK_MQ_DEAD = 23, + CPUHP_FS_BUFF_DEAD = 24, + CPUHP_PRINTK_DEAD = 25, + CPUHP_MM_MEMCQ_DEAD = 26, + CPUHP_PERCPU_CNT_DEAD = 27, + CPUHP_RADIX_DEAD = 28, + CPUHP_PAGE_ALLOC_DEAD = 29, + CPUHP_NET_DEV_DEAD = 30, + CPUHP_PCI_XGENE_DEAD = 31, + CPUHP_IOMMU_INTEL_DEAD = 32, + CPUHP_LUSTRE_CFS_DEAD = 33, + CPUHP_AP_ARM_CACHE_B15_RAC_DEAD = 34, + CPUHP_WORKQUEUE_PREP = 35, + CPUHP_POWER_NUMA_PREPARE = 36, + CPUHP_HRTIMERS_PREPARE = 37, + CPUHP_PROFILE_PREPARE = 38, + CPUHP_X2APIC_PREPARE = 39, + CPUHP_SMPCFD_PREPARE = 40, + CPUHP_RELAY_PREPARE = 41, + CPUHP_SLAB_PREPARE = 42, + CPUHP_MD_RAID5_PREPARE = 43, + CPUHP_RCUTREE_PREP = 44, + CPUHP_CPUIDLE_COUPLED_PREPARE = 45, + CPUHP_POWERPC_PMAC_PREPARE = 46, + CPUHP_POWERPC_MMU_CTX_PREPARE = 47, + CPUHP_XEN_PREPARE = 48, + CPUHP_XEN_EVTCHN_PREPARE = 49, + CPUHP_ARM_SHMOBILE_SCU_PREPARE = 50, + CPUHP_SH_SH3X_PREPARE = 51, + CPUHP_NET_FLOW_PREPARE = 52, + CPUHP_TOPOLOGY_PREPARE = 53, + CPUHP_NET_IUCV_PREPARE = 54, + CPUHP_ARM_BL_PREPARE = 55, + CPUHP_TRACE_RB_PREPARE = 56, + CPUHP_MM_ZS_PREPARE = 57, + CPUHP_MM_ZSWP_MEM_PREPARE = 58, + CPUHP_MM_ZSWP_POOL_PREPARE = 59, + CPUHP_KVM_PPC_BOOK3S_PREPARE = 60, + CPUHP_ZCOMP_PREPARE = 61, + CPUHP_TIMERS_PREPARE = 62, + CPUHP_MIPS_SOC_PREPARE = 63, + CPUHP_BP_PREPARE_DYN = 64, + CPUHP_BP_PREPARE_DYN_END = 84, + CPUHP_BRINGUP_CPU = 85, + CPUHP_AP_IDLE_DEAD = 86, + CPUHP_AP_OFFLINE = 87, + CPUHP_AP_SCHED_STARTING = 88, + CPUHP_AP_RCUTREE_DYING = 89, + CPUHP_AP_IRQ_GIC_STARTING = 90, + CPUHP_AP_IRQ_HIP04_STARTING = 91, + CPUHP_AP_IRQ_ARMADA_XP_STARTING = 92, + CPUHP_AP_IRQ_BCM2836_STARTING = 93, + CPUHP_AP_IRQ_MIPS_GIC_STARTING = 94, + CPUHP_AP_ARM_MVEBU_COHERENCY = 95, + CPUHP_AP_MICROCODE_LOADER = 96, + CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING = 97, + CPUHP_AP_PERF_X86_STARTING = 98, + CPUHP_AP_PERF_X86_AMD_IBS_STARTING = 99, + CPUHP_AP_PERF_X86_CQM_STARTING = 100, + CPUHP_AP_PERF_X86_CSTATE_STARTING = 101, + CPUHP_AP_PERF_XTENSA_STARTING = 102, + CPUHP_AP_MIPS_OP_LOONGSON3_STARTING = 103, + CPUHP_AP_ARM_SDEI_STARTING = 104, + CPUHP_AP_ARM_VFP_STARTING = 105, + CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING = 106, + CPUHP_AP_PERF_ARM_HW_BREAKPOINT_STARTING = 107, + CPUHP_AP_PERF_ARM_ACPI_STARTING = 108, + CPUHP_AP_PERF_ARM_STARTING = 109, + CPUHP_AP_ARM_L2X0_STARTING = 110, + CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING = 111, + CPUHP_AP_ARM_ARCH_TIMER_STARTING = 112, + CPUHP_AP_ARM_GLOBAL_TIMER_STARTING = 113, + CPUHP_AP_JCORE_TIMER_STARTING = 114, + CPUHP_AP_ARM_TWD_STARTING = 115, + CPUHP_AP_QCOM_TIMER_STARTING = 116, + CPUHP_AP_TEGRA_TIMER_STARTING = 117, + CPUHP_AP_ARMADA_TIMER_STARTING = 118, + CPUHP_AP_MARCO_TIMER_STARTING = 119, + CPUHP_AP_MIPS_GIC_TIMER_STARTING = 120, + CPUHP_AP_ARC_TIMER_STARTING = 121, + CPUHP_AP_RISCV_TIMER_STARTING = 122, + CPUHP_AP_CSKY_TIMER_STARTING = 123, + CPUHP_AP_HYPERV_TIMER_STARTING = 124, + CPUHP_AP_KVM_STARTING = 125, + CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING = 126, + CPUHP_AP_KVM_ARM_VGIC_STARTING = 127, + CPUHP_AP_KVM_ARM_TIMER_STARTING = 128, + CPUHP_AP_DUMMY_TIMER_STARTING = 129, + CPUHP_AP_ARM_XEN_STARTING = 130, + CPUHP_AP_ARM_KVMPV_STARTING = 131, + CPUHP_AP_ARM_CORESIGHT_STARTING = 132, + CPUHP_AP_ARM64_ISNDEP_STARTING = 133, + CPUHP_AP_SMPCFD_DYING = 134, + CPUHP_AP_X86_TBOOT_DYING = 135, + CPUHP_AP_ARM_CACHE_B15_RAC_DYING = 136, + CPUHP_AP_ONLINE = 137, + CPUHP_TEARDOWN_CPU = 138, + CPUHP_AP_ONLINE_IDLE = 139, + CPUHP_AP_SMPBOOT_THREADS = 140, + CPUHP_AP_X86_VDSO_VMA_ONLINE = 141, + CPUHP_AP_IRQ_AFFINITY_ONLINE = 142, + CPUHP_AP_ARM_MVEBU_SYNC_CLOCKS = 143, + CPUHP_AP_X86_INTEL_EPB_ONLINE = 144, + CPUHP_AP_PERF_ONLINE = 145, + CPUHP_AP_PERF_X86_ONLINE = 146, + CPUHP_AP_PERF_X86_UNCORE_ONLINE = 147, + CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE = 148, + CPUHP_AP_PERF_X86_AMD_POWER_ONLINE = 149, + CPUHP_AP_PERF_X86_RAPL_ONLINE = 150, + CPUHP_AP_PERF_X86_CQM_ONLINE = 151, + CPUHP_AP_PERF_X86_CSTATE_ONLINE = 152, + CPUHP_AP_PERF_S390_CF_ONLINE = 153, + CPUHP_AP_PERF_S390_SF_ONLINE = 154, + CPUHP_AP_PERF_ARM_CCI_ONLINE = 155, + CPUHP_AP_PERF_ARM_CCN_ONLINE = 156, + CPUHP_AP_PERF_ARM_HISI_DDRC_ONLINE = 157, + CPUHP_AP_PERF_ARM_HISI_HHA_ONLINE = 158, + CPUHP_AP_PERF_ARM_HISI_L3_ONLINE = 159, + CPUHP_AP_PERF_ARM_L2X0_ONLINE = 160, + CPUHP_AP_PERF_ARM_QCOM_L2_ONLINE = 161, + CPUHP_AP_PERF_ARM_QCOM_L3_ONLINE = 162, + CPUHP_AP_PERF_ARM_APM_XGENE_ONLINE = 163, + CPUHP_AP_PERF_ARM_CAVIUM_TX2_UNCORE_ONLINE = 164, + CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE = 165, + CPUHP_AP_PERF_POWERPC_CORE_IMC_ONLINE = 166, + CPUHP_AP_PERF_POWERPC_THREAD_IMC_ONLINE = 167, + CPUHP_AP_PERF_POWERPC_TRACE_IMC_ONLINE = 168, + CPUHP_AP_WATCHDOG_ONLINE = 169, + CPUHP_AP_WORKQUEUE_ONLINE = 170, + CPUHP_AP_RCUTREE_ONLINE = 171, + CPUHP_AP_BASE_CACHEINFO_ONLINE = 172, + CPUHP_AP_ONLINE_DYN = 173, + CPUHP_AP_ONLINE_DYN_END = 203, + CPUHP_AP_X86_HPET_ONLINE = 204, + CPUHP_AP_X86_KVM_CLK_ONLINE = 205, + CPUHP_AP_ACTIVE = 206, + CPUHP_ONLINE = 207, }; -typedef enum { - SS_FREE = 0, - SS_UNCONNECTED = 1, - SS_CONNECTING = 2, - SS_CONNECTED = 3, - SS_DISCONNECTING = 4, -} socket_state; - -struct socket_wq { - wait_queue_head_t wait; - struct fasync_struct *fasync_list; - long unsigned int flags; - struct callback_head rcu; - long: 64; +struct perf_regs { + __u64 abi; + struct pt_regs *regs; }; -struct proto_ops; - -struct socket { - socket_state state; - short int type; - long unsigned int flags; - struct file *file; - struct sock *sk; - const struct proto_ops *ops; - long: 64; - long: 64; - long: 64; - struct socket_wq wq; +struct kernel_cpustat { + u64 cpustat[10]; }; -typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *, unsigned int, size_t); - -struct proto_ops { - int family; - struct module *owner; - int (*release)(struct socket *); - int (*bind)(struct socket *, struct sockaddr *, int); - int (*connect)(struct socket *, struct sockaddr *, int, int); - int (*socketpair)(struct socket *, struct socket *); - int (*accept)(struct socket *, struct socket *, int, bool); - int (*getname)(struct socket *, struct sockaddr *, int); - __poll_t (*poll)(struct file *, struct socket *, struct poll_table_struct *); - int (*ioctl)(struct socket *, unsigned int, long unsigned int); - int (*compat_ioctl)(struct socket *, unsigned int, long unsigned int); - int (*gettstamp)(struct socket *, void *, bool, bool); - int (*listen)(struct socket *, int); - int (*shutdown)(struct socket *, int); - int (*setsockopt)(struct socket *, int, int, char *, unsigned int); - int (*getsockopt)(struct socket *, int, int, char *, int *); - int (*compat_setsockopt)(struct socket *, int, int, char *, unsigned int); - int (*compat_getsockopt)(struct socket *, int, int, char *, int *); - int (*sendmsg)(struct socket *, struct msghdr *, size_t); - int (*recvmsg)(struct socket *, struct msghdr *, size_t, int); - int (*mmap)(struct file *, struct socket *, struct vm_area_struct *); - ssize_t (*sendpage)(struct socket *, struct page *, int, size_t, int); - ssize_t (*splice_read)(struct socket *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); - int (*set_peek_off)(struct sock *, int); - int (*peek_len)(struct socket *); - int (*read_sock)(struct sock *, read_descriptor_t *, sk_read_actor_t); - int (*sendpage_locked)(struct sock *, struct page *, int, size_t, int); - int (*sendmsg_locked)(struct sock *, struct msghdr *, size_t); - int (*set_rcvlowat)(struct sock *, int); +struct kernel_stat { + long unsigned int irqs_sum; + unsigned int softirqs[10]; }; -struct pipe_buf_operations; +struct u64_stats_sync {}; -struct pipe_buffer { - struct page *page; - unsigned int offset; - unsigned int len; - const struct pipe_buf_operations *ops; - unsigned int flags; - long unsigned int private; +struct bpf_insn { + __u8 code; + __u8 dst_reg: 4; + __u8 src_reg: 4; + __s16 off; + __s32 imm; }; -struct pipe_buf_operations { - int (*confirm)(struct pipe_inode_info *, struct pipe_buffer *); - void (*release)(struct pipe_inode_info *, struct pipe_buffer *); - int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); - bool (*get)(struct pipe_inode_info *, struct pipe_buffer *); +struct bpf_cgroup_storage_key { + __u64 cgroup_inode_id; + __u32 attach_type; }; -struct skb_ext { - refcount_t refcnt; - u8 offset[1]; - u8 chunks; - short: 16; - char data[0]; +enum bpf_map_type { + BPF_MAP_TYPE_UNSPEC = 0, + BPF_MAP_TYPE_HASH = 1, + BPF_MAP_TYPE_ARRAY = 2, + BPF_MAP_TYPE_PROG_ARRAY = 3, + BPF_MAP_TYPE_PERF_EVENT_ARRAY = 4, + BPF_MAP_TYPE_PERCPU_HASH = 5, + BPF_MAP_TYPE_PERCPU_ARRAY = 6, + BPF_MAP_TYPE_STACK_TRACE = 7, + BPF_MAP_TYPE_CGROUP_ARRAY = 8, + BPF_MAP_TYPE_LRU_HASH = 9, + BPF_MAP_TYPE_LRU_PERCPU_HASH = 10, + BPF_MAP_TYPE_LPM_TRIE = 11, + BPF_MAP_TYPE_ARRAY_OF_MAPS = 12, + BPF_MAP_TYPE_HASH_OF_MAPS = 13, + BPF_MAP_TYPE_DEVMAP = 14, + BPF_MAP_TYPE_SOCKMAP = 15, + BPF_MAP_TYPE_CPUMAP = 16, + BPF_MAP_TYPE_XSKMAP = 17, + BPF_MAP_TYPE_SOCKHASH = 18, + BPF_MAP_TYPE_CGROUP_STORAGE = 19, + BPF_MAP_TYPE_REUSEPORT_SOCKARRAY = 20, + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = 21, + BPF_MAP_TYPE_QUEUE = 22, + BPF_MAP_TYPE_STACK = 23, + BPF_MAP_TYPE_SK_STORAGE = 24, + BPF_MAP_TYPE_DEVMAP_HASH = 25, }; -struct dql { - unsigned int num_queued; - unsigned int adj_limit; - unsigned int last_obj_cnt; - long: 32; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - unsigned int limit; - unsigned int num_completed; - unsigned int prev_ovlimit; - unsigned int prev_num_queued; - unsigned int prev_last_obj_cnt; - unsigned int lowest_slack; - long unsigned int slack_start_time; - unsigned int max_limit; - unsigned int min_limit; - unsigned int slack_hold_time; - long: 32; - long: 64; - long: 64; -}; - -struct ethtool_drvinfo { - __u32 cmd; - char driver[32]; - char version[32]; - char fw_version[32]; - char bus_info[32]; - char erom_version[32]; - char reserved2[12]; - __u32 n_priv_flags; - __u32 n_stats; - __u32 testinfo_len; - __u32 eedump_len; - __u32 regdump_len; +union bpf_attr { + struct { + __u32 map_type; + __u32 key_size; + __u32 value_size; + __u32 max_entries; + __u32 map_flags; + __u32 inner_map_fd; + __u32 numa_node; + char map_name[16]; + __u32 map_ifindex; + __u32 btf_fd; + __u32 btf_key_type_id; + __u32 btf_value_type_id; + }; + struct { + __u32 map_fd; + __u64 key; + union { + __u64 value; + __u64 next_key; + }; + __u64 flags; + }; + struct { + __u32 prog_type; + __u32 insn_cnt; + __u64 insns; + __u64 license; + __u32 log_level; + __u32 log_size; + __u64 log_buf; + __u32 kern_version; + __u32 prog_flags; + char prog_name[16]; + __u32 prog_ifindex; + __u32 expected_attach_type; + __u32 prog_btf_fd; + __u32 func_info_rec_size; + __u64 func_info; + __u32 func_info_cnt; + __u32 line_info_rec_size; + __u64 line_info; + __u32 line_info_cnt; + __u32 attach_btf_id; + __u32 attach_prog_fd; + }; + struct { + __u64 pathname; + __u32 bpf_fd; + __u32 file_flags; + }; + struct { + __u32 target_fd; + __u32 attach_bpf_fd; + __u32 attach_type; + __u32 attach_flags; + }; + struct { + __u32 prog_fd; + __u32 retval; + __u32 data_size_in; + __u32 data_size_out; + __u64 data_in; + __u64 data_out; + __u32 repeat; + __u32 duration; + __u32 ctx_size_in; + __u32 ctx_size_out; + __u64 ctx_in; + __u64 ctx_out; + } test; + struct { + union { + __u32 start_id; + __u32 prog_id; + __u32 map_id; + __u32 btf_id; + }; + __u32 next_id; + __u32 open_flags; + }; + struct { + __u32 bpf_fd; + __u32 info_len; + __u64 info; + } info; + struct { + __u32 target_fd; + __u32 attach_type; + __u32 query_flags; + __u32 attach_flags; + __u64 prog_ids; + __u32 prog_cnt; + } query; + struct { + __u64 name; + __u32 prog_fd; + } raw_tracepoint; + struct { + __u64 btf; + __u64 btf_log_buf; + __u32 btf_size; + __u32 btf_log_size; + __u32 btf_log_level; + }; + struct { + __u32 pid; + __u32 fd; + __u32 flags; + __u32 buf_len; + __u64 buf; + __u32 prog_id; + __u32 fd_type; + __u64 probe_offset; + __u64 probe_addr; + } task_fd_query; }; -struct ethtool_wolinfo { - __u32 cmd; - __u32 supported; - __u32 wolopts; - __u8 sopass[6]; +enum bpf_func_id { + BPF_FUNC_unspec = 0, + BPF_FUNC_map_lookup_elem = 1, + BPF_FUNC_map_update_elem = 2, + BPF_FUNC_map_delete_elem = 3, + BPF_FUNC_probe_read = 4, + BPF_FUNC_ktime_get_ns = 5, + BPF_FUNC_trace_printk = 6, + BPF_FUNC_get_prandom_u32 = 7, + BPF_FUNC_get_smp_processor_id = 8, + BPF_FUNC_skb_store_bytes = 9, + BPF_FUNC_l3_csum_replace = 10, + BPF_FUNC_l4_csum_replace = 11, + BPF_FUNC_tail_call = 12, + BPF_FUNC_clone_redirect = 13, + BPF_FUNC_get_current_pid_tgid = 14, + BPF_FUNC_get_current_uid_gid = 15, + BPF_FUNC_get_current_comm = 16, + BPF_FUNC_get_cgroup_classid = 17, + BPF_FUNC_skb_vlan_push = 18, + BPF_FUNC_skb_vlan_pop = 19, + BPF_FUNC_skb_get_tunnel_key = 20, + BPF_FUNC_skb_set_tunnel_key = 21, + BPF_FUNC_perf_event_read = 22, + BPF_FUNC_redirect = 23, + BPF_FUNC_get_route_realm = 24, + BPF_FUNC_perf_event_output = 25, + BPF_FUNC_skb_load_bytes = 26, + BPF_FUNC_get_stackid = 27, + BPF_FUNC_csum_diff = 28, + BPF_FUNC_skb_get_tunnel_opt = 29, + BPF_FUNC_skb_set_tunnel_opt = 30, + BPF_FUNC_skb_change_proto = 31, + BPF_FUNC_skb_change_type = 32, + BPF_FUNC_skb_under_cgroup = 33, + BPF_FUNC_get_hash_recalc = 34, + BPF_FUNC_get_current_task = 35, + BPF_FUNC_probe_write_user = 36, + BPF_FUNC_current_task_under_cgroup = 37, + BPF_FUNC_skb_change_tail = 38, + BPF_FUNC_skb_pull_data = 39, + BPF_FUNC_csum_update = 40, + BPF_FUNC_set_hash_invalid = 41, + BPF_FUNC_get_numa_node_id = 42, + BPF_FUNC_skb_change_head = 43, + BPF_FUNC_xdp_adjust_head = 44, + BPF_FUNC_probe_read_str = 45, + BPF_FUNC_get_socket_cookie = 46, + BPF_FUNC_get_socket_uid = 47, + BPF_FUNC_set_hash = 48, + BPF_FUNC_setsockopt = 49, + BPF_FUNC_skb_adjust_room = 50, + BPF_FUNC_redirect_map = 51, + BPF_FUNC_sk_redirect_map = 52, + BPF_FUNC_sock_map_update = 53, + BPF_FUNC_xdp_adjust_meta = 54, + BPF_FUNC_perf_event_read_value = 55, + BPF_FUNC_perf_prog_read_value = 56, + BPF_FUNC_getsockopt = 57, + BPF_FUNC_override_return = 58, + BPF_FUNC_sock_ops_cb_flags_set = 59, + BPF_FUNC_msg_redirect_map = 60, + BPF_FUNC_msg_apply_bytes = 61, + BPF_FUNC_msg_cork_bytes = 62, + BPF_FUNC_msg_pull_data = 63, + BPF_FUNC_bind = 64, + BPF_FUNC_xdp_adjust_tail = 65, + BPF_FUNC_skb_get_xfrm_state = 66, + BPF_FUNC_get_stack = 67, + BPF_FUNC_skb_load_bytes_relative = 68, + BPF_FUNC_fib_lookup = 69, + BPF_FUNC_sock_hash_update = 70, + BPF_FUNC_msg_redirect_hash = 71, + BPF_FUNC_sk_redirect_hash = 72, + BPF_FUNC_lwt_push_encap = 73, + BPF_FUNC_lwt_seg6_store_bytes = 74, + BPF_FUNC_lwt_seg6_adjust_srh = 75, + BPF_FUNC_lwt_seg6_action = 76, + BPF_FUNC_rc_repeat = 77, + BPF_FUNC_rc_keydown = 78, + BPF_FUNC_skb_cgroup_id = 79, + BPF_FUNC_get_current_cgroup_id = 80, + BPF_FUNC_get_local_storage = 81, + BPF_FUNC_sk_select_reuseport = 82, + BPF_FUNC_skb_ancestor_cgroup_id = 83, + BPF_FUNC_sk_lookup_tcp = 84, + BPF_FUNC_sk_lookup_udp = 85, + BPF_FUNC_sk_release = 86, + BPF_FUNC_map_push_elem = 87, + BPF_FUNC_map_pop_elem = 88, + BPF_FUNC_map_peek_elem = 89, + BPF_FUNC_msg_push_data = 90, + BPF_FUNC_msg_pop_data = 91, + BPF_FUNC_rc_pointer_rel = 92, + BPF_FUNC_spin_lock = 93, + BPF_FUNC_spin_unlock = 94, + BPF_FUNC_sk_fullsock = 95, + BPF_FUNC_tcp_sock = 96, + BPF_FUNC_skb_ecn_set_ce = 97, + BPF_FUNC_get_listener_sock = 98, + BPF_FUNC_skc_lookup_tcp = 99, + BPF_FUNC_tcp_check_syncookie = 100, + BPF_FUNC_sysctl_get_name = 101, + BPF_FUNC_sysctl_get_current_value = 102, + BPF_FUNC_sysctl_get_new_value = 103, + BPF_FUNC_sysctl_set_new_value = 104, + BPF_FUNC_strtol = 105, + BPF_FUNC_strtoul = 106, + BPF_FUNC_sk_storage_get = 107, + BPF_FUNC_sk_storage_delete = 108, + BPF_FUNC_send_signal = 109, + BPF_FUNC_tcp_gen_syncookie = 110, + BPF_FUNC_skb_output = 111, + BPF_FUNC_probe_read_user = 112, + BPF_FUNC_probe_read_kernel = 113, + BPF_FUNC_probe_read_user_str = 114, + BPF_FUNC_probe_read_kernel_str = 115, + __BPF_FUNC_MAX_ID = 116, }; -struct ethtool_tunable { - __u32 cmd; - __u32 id; +struct bpf_func_info { + __u32 insn_off; __u32 type_id; - __u32 len; - void *data[0]; }; -struct ethtool_regs { - __u32 cmd; - __u32 version; - __u32 len; - __u8 data[0]; +struct bpf_line_info { + __u32 insn_off; + __u32 file_name_off; + __u32 line_off; + __u32 line_col; }; -struct ethtool_eeprom { - __u32 cmd; - __u32 magic; - __u32 offset; - __u32 len; - __u8 data[0]; -}; +struct bpf_map; -struct ethtool_eee { - __u32 cmd; - __u32 supported; - __u32 advertised; - __u32 lp_advertised; - __u32 eee_active; - __u32 eee_enabled; - __u32 tx_lpi_enabled; - __u32 tx_lpi_timer; - __u32 reserved[2]; -}; +struct btf; -struct ethtool_modinfo { - __u32 cmd; - __u32 type; - __u32 eeprom_len; - __u32 reserved[8]; -}; +struct btf_type; -struct ethtool_coalesce { - __u32 cmd; - __u32 rx_coalesce_usecs; - __u32 rx_max_coalesced_frames; - __u32 rx_coalesce_usecs_irq; - __u32 rx_max_coalesced_frames_irq; - __u32 tx_coalesce_usecs; - __u32 tx_max_coalesced_frames; - __u32 tx_coalesce_usecs_irq; - __u32 tx_max_coalesced_frames_irq; - __u32 stats_block_coalesce_usecs; - __u32 use_adaptive_rx_coalesce; - __u32 use_adaptive_tx_coalesce; - __u32 pkt_rate_low; - __u32 rx_coalesce_usecs_low; - __u32 rx_max_coalesced_frames_low; - __u32 tx_coalesce_usecs_low; - __u32 tx_max_coalesced_frames_low; - __u32 pkt_rate_high; - __u32 rx_coalesce_usecs_high; - __u32 rx_max_coalesced_frames_high; - __u32 tx_coalesce_usecs_high; - __u32 tx_max_coalesced_frames_high; - __u32 rate_sample_interval; -}; +struct bpf_prog_aux; -struct ethtool_ringparam { - __u32 cmd; - __u32 rx_max_pending; - __u32 rx_mini_max_pending; - __u32 rx_jumbo_max_pending; - __u32 tx_max_pending; - __u32 rx_pending; - __u32 rx_mini_pending; - __u32 rx_jumbo_pending; - __u32 tx_pending; +struct bpf_map_ops { + int (*map_alloc_check)(union bpf_attr *); + struct bpf_map * (*map_alloc)(union bpf_attr *); + void (*map_release)(struct bpf_map *, struct file *); + void (*map_free)(struct bpf_map *); + int (*map_get_next_key)(struct bpf_map *, void *, void *); + void (*map_release_uref)(struct bpf_map *); + void * (*map_lookup_elem_sys_only)(struct bpf_map *, void *); + void * (*map_lookup_elem)(struct bpf_map *, void *); + int (*map_update_elem)(struct bpf_map *, void *, void *, u64); + int (*map_delete_elem)(struct bpf_map *, void *); + int (*map_push_elem)(struct bpf_map *, void *, u64); + int (*map_pop_elem)(struct bpf_map *, void *); + int (*map_peek_elem)(struct bpf_map *, void *); + void * (*map_fd_get_ptr)(struct bpf_map *, struct file *, int); + void (*map_fd_put_ptr)(void *); + u32 (*map_gen_lookup)(struct bpf_map *, struct bpf_insn *); + u32 (*map_fd_sys_lookup_elem)(void *); + void (*map_seq_show_elem)(struct bpf_map *, void *, struct seq_file *); + int (*map_check_btf)(const struct bpf_map *, const struct btf *, const struct btf_type *, const struct btf_type *); + int (*map_poke_track)(struct bpf_map *, struct bpf_prog_aux *); + void (*map_poke_untrack)(struct bpf_map *, struct bpf_prog_aux *); + void (*map_poke_run)(struct bpf_map *, u32, struct bpf_prog *, struct bpf_prog *); + int (*map_direct_value_addr)(const struct bpf_map *, u64 *, u32); + int (*map_direct_value_meta)(const struct bpf_map *, u64, u32 *); + int (*map_mmap)(struct bpf_map *, struct vm_area_struct *); }; -struct ethtool_channels { - __u32 cmd; - __u32 max_rx; - __u32 max_tx; - __u32 max_other; - __u32 max_combined; - __u32 rx_count; - __u32 tx_count; - __u32 other_count; - __u32 combined_count; +struct bpf_map_memory { + u32 pages; + struct user_struct *user; }; -struct ethtool_pauseparam { - __u32 cmd; - __u32 autoneg; - __u32 rx_pause; - __u32 tx_pause; +struct bpf_map { + const struct bpf_map_ops *ops; + struct bpf_map *inner_map_meta; + void *security; + enum bpf_map_type map_type; + u32 key_size; + u32 value_size; + u32 max_entries; + u32 map_flags; + int spin_lock_off; + u32 id; + int numa_node; + u32 btf_key_type_id; + u32 btf_value_type_id; + struct btf *btf; + struct bpf_map_memory memory; + char name[16]; + bool unpriv_array; + bool frozen; + long: 48; + long: 64; + long: 64; + atomic64_t refcnt; + atomic64_t usercnt; + struct work_struct work; + struct mutex freeze_mutex; + u64 writecnt; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct ethtool_test { - __u32 cmd; - __u32 flags; - __u32 reserved; - __u32 len; - __u64 data[0]; +struct btf_header { + __u16 magic; + __u8 version; + __u8 flags; + __u32 hdr_len; + __u32 type_off; + __u32 type_len; + __u32 str_off; + __u32 str_len; }; -struct ethtool_stats { - __u32 cmd; - __u32 n_stats; - __u64 data[0]; +struct btf { + void *data; + struct btf_type **types; + u32 *resolved_ids; + u32 *resolved_sizes; + const char *strings; + void *nohdr_data; + struct btf_header hdr; + u32 nr_types; + u32 types_size; + u32 data_size; + refcount_t refcnt; + u32 id; + struct callback_head rcu; }; -struct ethtool_tcpip4_spec { - __be32 ip4src; - __be32 ip4dst; - __be16 psrc; - __be16 pdst; - __u8 tos; +struct btf_type { + __u32 name_off; + __u32 info; + union { + __u32 size; + __u32 type; + }; }; -struct ethtool_ah_espip4_spec { - __be32 ip4src; - __be32 ip4dst; - __be32 spi; - __u8 tos; +enum bpf_tramp_prog_type { + BPF_TRAMP_FENTRY = 0, + BPF_TRAMP_FEXIT = 1, + BPF_TRAMP_MAX = 2, }; -struct ethtool_usrip4_spec { - __be32 ip4src; - __be32 ip4dst; - __be32 l4_4_bytes; - __u8 tos; - __u8 ip_ver; - __u8 proto; -}; +struct bpf_trampoline; -struct ethtool_tcpip6_spec { - __be32 ip6src[4]; - __be32 ip6dst[4]; - __be16 psrc; - __be16 pdst; - __u8 tclass; -}; +struct bpf_jit_poke_descriptor; -struct ethtool_ah_espip6_spec { - __be32 ip6src[4]; - __be32 ip6dst[4]; - __be32 spi; - __u8 tclass; -}; +struct bpf_prog_ops; -struct ethtool_usrip6_spec { - __be32 ip6src[4]; - __be32 ip6dst[4]; - __be32 l4_4_bytes; - __u8 tclass; - __u8 l4_proto; -}; +struct bpf_prog_offload; -union ethtool_flow_union { - struct ethtool_tcpip4_spec tcp_ip4_spec; - struct ethtool_tcpip4_spec udp_ip4_spec; - struct ethtool_tcpip4_spec sctp_ip4_spec; - struct ethtool_ah_espip4_spec ah_ip4_spec; - struct ethtool_ah_espip4_spec esp_ip4_spec; - struct ethtool_usrip4_spec usr_ip4_spec; - struct ethtool_tcpip6_spec tcp_ip6_spec; - struct ethtool_tcpip6_spec udp_ip6_spec; - struct ethtool_tcpip6_spec sctp_ip6_spec; - struct ethtool_ah_espip6_spec ah_ip6_spec; - struct ethtool_ah_espip6_spec esp_ip6_spec; - struct ethtool_usrip6_spec usr_ip6_spec; - struct ethhdr ether_spec; - __u8 hdata[52]; -}; +struct bpf_func_info_aux; -struct ethtool_flow_ext { - __u8 padding[2]; - unsigned char h_dest[6]; - __be16 vlan_etype; - __be16 vlan_tci; - __be32 data[2]; -}; +struct bpf_prog_stats; -struct ethtool_rx_flow_spec { - __u32 flow_type; - union ethtool_flow_union h_u; - struct ethtool_flow_ext h_ext; - union ethtool_flow_union m_u; - struct ethtool_flow_ext m_ext; - __u64 ring_cookie; - __u32 location; +struct bpf_prog_aux { + atomic64_t refcnt; + u32 used_map_cnt; + u32 max_ctx_offset; + u32 max_pkt_offset; + u32 max_tp_access; + u32 stack_depth; + u32 id; + u32 func_cnt; + u32 func_idx; + u32 attach_btf_id; + struct bpf_prog *linked_prog; + bool verifier_zext; + bool offload_requested; + bool attach_btf_trace; + bool func_proto_unreliable; + enum bpf_tramp_prog_type trampoline_prog_type; + struct bpf_trampoline *trampoline; + struct hlist_node tramp_hlist; + const struct btf_type *attach_func_proto; + const char *attach_func_name; + struct bpf_prog **func; + void *jit_data; + struct bpf_jit_poke_descriptor *poke_tab; + u32 size_poke_tab; + struct latch_tree_node ksym_tnode; + struct list_head ksym_lnode; + const struct bpf_prog_ops *ops; + struct bpf_map **used_maps; + struct bpf_prog *prog; + struct user_struct *user; + u64 load_time; + struct bpf_map *cgroup_storage[2]; + char name[16]; + void *security; + struct bpf_prog_offload *offload; + struct btf *btf; + struct bpf_func_info *func_info; + struct bpf_func_info_aux *func_info_aux; + struct bpf_line_info *linfo; + void **jited_linfo; + u32 func_info_cnt; + u32 nr_linfo; + u32 linfo_idx; + u32 num_exentries; + struct exception_table_entry *extable; + struct bpf_prog_stats *stats; + union { + struct work_struct work; + struct callback_head rcu; + }; }; -struct ethtool_rxnfc { - __u32 cmd; - __u32 flow_type; - __u64 data; - struct ethtool_rx_flow_spec fs; +enum bpf_prog_type { + BPF_PROG_TYPE_UNSPEC = 0, + BPF_PROG_TYPE_SOCKET_FILTER = 1, + BPF_PROG_TYPE_KPROBE = 2, + BPF_PROG_TYPE_SCHED_CLS = 3, + BPF_PROG_TYPE_SCHED_ACT = 4, + BPF_PROG_TYPE_TRACEPOINT = 5, + BPF_PROG_TYPE_XDP = 6, + BPF_PROG_TYPE_PERF_EVENT = 7, + BPF_PROG_TYPE_CGROUP_SKB = 8, + BPF_PROG_TYPE_CGROUP_SOCK = 9, + BPF_PROG_TYPE_LWT_IN = 10, + BPF_PROG_TYPE_LWT_OUT = 11, + BPF_PROG_TYPE_LWT_XMIT = 12, + BPF_PROG_TYPE_SOCK_OPS = 13, + BPF_PROG_TYPE_SK_SKB = 14, + BPF_PROG_TYPE_CGROUP_DEVICE = 15, + BPF_PROG_TYPE_SK_MSG = 16, + BPF_PROG_TYPE_RAW_TRACEPOINT = 17, + BPF_PROG_TYPE_CGROUP_SOCK_ADDR = 18, + BPF_PROG_TYPE_LWT_SEG6LOCAL = 19, + BPF_PROG_TYPE_LIRC_MODE2 = 20, + BPF_PROG_TYPE_SK_REUSEPORT = 21, + BPF_PROG_TYPE_FLOW_DISSECTOR = 22, + BPF_PROG_TYPE_CGROUP_SYSCTL = 23, + BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE = 24, + BPF_PROG_TYPE_CGROUP_SOCKOPT = 25, + BPF_PROG_TYPE_TRACING = 26, +}; + +enum bpf_attach_type { + BPF_CGROUP_INET_INGRESS = 0, + BPF_CGROUP_INET_EGRESS = 1, + BPF_CGROUP_INET_SOCK_CREATE = 2, + BPF_CGROUP_SOCK_OPS = 3, + BPF_SK_SKB_STREAM_PARSER = 4, + BPF_SK_SKB_STREAM_VERDICT = 5, + BPF_CGROUP_DEVICE = 6, + BPF_SK_MSG_VERDICT = 7, + BPF_CGROUP_INET4_BIND = 8, + BPF_CGROUP_INET6_BIND = 9, + BPF_CGROUP_INET4_CONNECT = 10, + BPF_CGROUP_INET6_CONNECT = 11, + BPF_CGROUP_INET4_POST_BIND = 12, + BPF_CGROUP_INET6_POST_BIND = 13, + BPF_CGROUP_UDP4_SENDMSG = 14, + BPF_CGROUP_UDP6_SENDMSG = 15, + BPF_LIRC_MODE2 = 16, + BPF_FLOW_DISSECTOR = 17, + BPF_CGROUP_SYSCTL = 18, + BPF_CGROUP_UDP4_RECVMSG = 19, + BPF_CGROUP_UDP6_RECVMSG = 20, + BPF_CGROUP_GETSOCKOPT = 21, + BPF_CGROUP_SETSOCKOPT = 22, + BPF_TRACE_RAW_TP = 23, + BPF_TRACE_FENTRY = 24, + BPF_TRACE_FEXIT = 25, + __MAX_BPF_ATTACH_TYPE = 26, +}; + +struct sock_filter { + __u16 code; + __u8 jt; + __u8 jf; + __u32 k; +}; + +struct sock_fprog_kern; + +struct bpf_prog { + u16 pages; + u16 jited: 1; + u16 jit_requested: 1; + u16 gpl_compatible: 1; + u16 cb_access: 1; + u16 dst_needed: 1; + u16 blinded: 1; + u16 is_func: 1; + u16 kprobe_override: 1; + u16 has_callchain_buf: 1; + u16 enforce_expected_attach_type: 1; + enum bpf_prog_type type; + enum bpf_attach_type expected_attach_type; + u32 len; + u32 jited_len; + u8 tag[8]; + struct bpf_prog_aux *aux; + struct sock_fprog_kern *orig_prog; + unsigned int (*bpf_func)(const void *, const struct bpf_insn *); union { - __u32 rule_cnt; - __u32 rss_context; + struct sock_filter insns[0]; + struct bpf_insn insnsi[0]; }; - __u32 rule_locs[0]; }; -struct ethtool_flash { - __u32 cmd; - __u32 region; - char data[128]; +enum bpf_arg_type { + ARG_DONTCARE = 0, + ARG_CONST_MAP_PTR = 1, + ARG_PTR_TO_MAP_KEY = 2, + ARG_PTR_TO_MAP_VALUE = 3, + ARG_PTR_TO_UNINIT_MAP_VALUE = 4, + ARG_PTR_TO_MAP_VALUE_OR_NULL = 5, + ARG_PTR_TO_MEM = 6, + ARG_PTR_TO_MEM_OR_NULL = 7, + ARG_PTR_TO_UNINIT_MEM = 8, + ARG_CONST_SIZE = 9, + ARG_CONST_SIZE_OR_ZERO = 10, + ARG_PTR_TO_CTX = 11, + ARG_ANYTHING = 12, + ARG_PTR_TO_SPIN_LOCK = 13, + ARG_PTR_TO_SOCK_COMMON = 14, + ARG_PTR_TO_INT = 15, + ARG_PTR_TO_LONG = 16, + ARG_PTR_TO_SOCKET = 17, + ARG_PTR_TO_BTF_ID = 18, }; -struct ethtool_dump { - __u32 cmd; - __u32 version; - __u32 flag; - __u32 len; - __u8 data[0]; +enum bpf_return_type { + RET_INTEGER = 0, + RET_VOID = 1, + RET_PTR_TO_MAP_VALUE = 2, + RET_PTR_TO_MAP_VALUE_OR_NULL = 3, + RET_PTR_TO_SOCKET_OR_NULL = 4, + RET_PTR_TO_TCP_SOCK_OR_NULL = 5, + RET_PTR_TO_SOCK_COMMON_OR_NULL = 6, }; -struct ethtool_ts_info { - __u32 cmd; - __u32 so_timestamping; - __s32 phc_index; - __u32 tx_types; - __u32 tx_reserved[3]; - __u32 rx_filters; - __u32 rx_reserved[3]; +struct bpf_func_proto { + u64 (*func)(u64, u64, u64, u64, u64); + bool gpl_only; + bool pkt_access; + enum bpf_return_type ret_type; + union { + struct { + enum bpf_arg_type arg1_type; + enum bpf_arg_type arg2_type; + enum bpf_arg_type arg3_type; + enum bpf_arg_type arg4_type; + enum bpf_arg_type arg5_type; + }; + enum bpf_arg_type arg_type[5]; + }; + int *btf_id; }; -struct ethtool_fecparam { - __u32 cmd; - __u32 active_fec; - __u32 fec; - __u32 reserved; +enum bpf_access_type { + BPF_READ = 1, + BPF_WRITE = 2, }; -struct ethtool_link_settings { - __u32 cmd; - __u32 speed; - __u8 duplex; - __u8 port; - __u8 phy_address; - __u8 autoneg; - __u8 mdio_support; - __u8 eth_tp_mdix; - __u8 eth_tp_mdix_ctrl; - __s8 link_mode_masks_nwords; - __u8 transceiver; - __u8 reserved1[3]; - __u32 reserved[7]; - __u32 link_mode_masks[0]; +enum bpf_reg_type { + NOT_INIT = 0, + SCALAR_VALUE = 1, + PTR_TO_CTX = 2, + CONST_PTR_TO_MAP = 3, + PTR_TO_MAP_VALUE = 4, + PTR_TO_MAP_VALUE_OR_NULL = 5, + PTR_TO_STACK = 6, + PTR_TO_PACKET_META = 7, + PTR_TO_PACKET = 8, + PTR_TO_PACKET_END = 9, + PTR_TO_FLOW_KEYS = 10, + PTR_TO_SOCKET = 11, + PTR_TO_SOCKET_OR_NULL = 12, + PTR_TO_SOCK_COMMON = 13, + PTR_TO_SOCK_COMMON_OR_NULL = 14, + PTR_TO_TCP_SOCK = 15, + PTR_TO_TCP_SOCK_OR_NULL = 16, + PTR_TO_TP_BUFFER = 17, + PTR_TO_XDP_SOCK = 18, + PTR_TO_BTF_ID = 19, }; -enum ethtool_phys_id_state { - ETHTOOL_ID_INACTIVE = 0, - ETHTOOL_ID_ACTIVE = 1, - ETHTOOL_ID_ON = 2, - ETHTOOL_ID_OFF = 3, -}; +struct bpf_verifier_log; -struct ethtool_link_ksettings { - struct ethtool_link_settings base; - struct { - long unsigned int supported[2]; - long unsigned int advertising[2]; - long unsigned int lp_advertising[2]; - } link_modes; +struct bpf_insn_access_aux { + enum bpf_reg_type reg_type; + union { + int ctx_field_size; + u32 btf_id; + }; + struct bpf_verifier_log *log; }; -struct ethtool_ops { - void (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *); - int (*get_regs_len)(struct net_device *); - void (*get_regs)(struct net_device *, struct ethtool_regs *, void *); - void (*get_wol)(struct net_device *, struct ethtool_wolinfo *); - int (*set_wol)(struct net_device *, struct ethtool_wolinfo *); - u32 (*get_msglevel)(struct net_device *); - void (*set_msglevel)(struct net_device *, u32); - int (*nway_reset)(struct net_device *); - u32 (*get_link)(struct net_device *); - int (*get_eeprom_len)(struct net_device *); - int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); - int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); - int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); - int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *); - void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *); - int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *); - void (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam *); - int (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam *); - void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); - void (*get_strings)(struct net_device *, u32, u8 *); - int (*set_phys_id)(struct net_device *, enum ethtool_phys_id_state); - void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *); - int (*begin)(struct net_device *); - void (*complete)(struct net_device *); - u32 (*get_priv_flags)(struct net_device *); - int (*set_priv_flags)(struct net_device *, u32); - int (*get_sset_count)(struct net_device *, int); - int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, u32 *); - int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); - int (*flash_device)(struct net_device *, struct ethtool_flash *); - int (*reset)(struct net_device *, u32 *); - u32 (*get_rxfh_key_size)(struct net_device *); - u32 (*get_rxfh_indir_size)(struct net_device *); - int (*get_rxfh)(struct net_device *, u32 *, u8 *, u8 *); - int (*set_rxfh)(struct net_device *, const u32 *, const u8 *, const u8); - int (*get_rxfh_context)(struct net_device *, u32 *, u8 *, u8 *, u32); - int (*set_rxfh_context)(struct net_device *, const u32 *, const u8 *, const u8, u32 *, bool); - void (*get_channels)(struct net_device *, struct ethtool_channels *); - int (*set_channels)(struct net_device *, struct ethtool_channels *); - int (*get_dump_flag)(struct net_device *, struct ethtool_dump *); - int (*get_dump_data)(struct net_device *, struct ethtool_dump *, void *); - int (*set_dump)(struct net_device *, struct ethtool_dump *); - int (*get_ts_info)(struct net_device *, struct ethtool_ts_info *); - int (*get_module_info)(struct net_device *, struct ethtool_modinfo *); - int (*get_module_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); - int (*get_eee)(struct net_device *, struct ethtool_eee *); - int (*set_eee)(struct net_device *, struct ethtool_eee *); - int (*get_tunable)(struct net_device *, const struct ethtool_tunable *, void *); - int (*set_tunable)(struct net_device *, const struct ethtool_tunable *, const void *); - int (*get_per_queue_coalesce)(struct net_device *, u32, struct ethtool_coalesce *); - int (*set_per_queue_coalesce)(struct net_device *, u32, struct ethtool_coalesce *); - int (*get_link_ksettings)(struct net_device *, struct ethtool_link_ksettings *); - int (*set_link_ksettings)(struct net_device *, const struct ethtool_link_ksettings *); - int (*get_fecparam)(struct net_device *, struct ethtool_fecparam *); - int (*set_fecparam)(struct net_device *, struct ethtool_fecparam *); - void (*get_ethtool_phy_stats)(struct net_device *, struct ethtool_stats *, u64 *); +struct bpf_prog_ops { + int (*test_run)(struct bpf_prog *, const union bpf_attr *, union bpf_attr *); }; -struct xdp_mem_info { - u32 type; - u32 id; +struct bpf_verifier_ops { + const struct bpf_func_proto * (*get_func_proto)(enum bpf_func_id, const struct bpf_prog *); + bool (*is_valid_access)(int, int, enum bpf_access_type, const struct bpf_prog *, struct bpf_insn_access_aux *); + int (*gen_prologue)(struct bpf_insn *, bool, const struct bpf_prog *); + int (*gen_ld_abs)(const struct bpf_insn *, struct bpf_insn *); + u32 (*convert_ctx_access)(enum bpf_access_type, const struct bpf_insn *, struct bpf_insn *, struct bpf_prog *, u32 *); }; -struct xdp_rxq_info { - struct net_device *dev; - u32 queue_index; - u32 reg_state; - struct xdp_mem_info mem; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct net_device; + +struct bpf_offload_dev; + +struct bpf_prog_offload { + struct bpf_prog *prog; + struct net_device *netdev; + struct bpf_offload_dev *offdev; + void *dev_priv; + struct list_head offloads; + bool dev_state; + bool opt_failed; + void *jited_image; + u32 jited_len; }; -struct xdp_frame { - void *data; - u16 len; - u16 headroom; - u16 metasize; - struct xdp_mem_info mem; - struct net_device *dev_rx; +struct bpf_prog_stats { + u64 cnt; + u64 nsecs; + struct u64_stats_sync syncp; }; -struct nlmsghdr { - __u32 nlmsg_len; - __u16 nlmsg_type; - __u16 nlmsg_flags; - __u32 nlmsg_seq; - __u32 nlmsg_pid; +struct btf_func_model { + u8 ret_size; + u8 nr_args; + u8 arg_size[12]; }; -struct nlattr { - __u16 nla_len; - __u16 nla_type; +struct bpf_trampoline { + struct hlist_node hlist; + struct mutex mutex; + refcount_t refcnt; + u64 key; + struct { + struct btf_func_model model; + void *addr; + bool ftrace_managed; + } func; + struct hlist_head progs_hlist[2]; + int progs_cnt[2]; + void *image; + u64 selector; }; -struct netlink_ext_ack { - const char *_msg; - const struct nlattr *bad_attr; - u8 cookie[20]; - u8 cookie_len; +struct bpf_func_info_aux { + bool unreliable; }; -struct netlink_callback { - struct sk_buff *skb; - const struct nlmsghdr *nlh; - int (*dump)(struct sk_buff *, struct netlink_callback *); - int (*done)(struct netlink_callback *); - void *data; - struct module *module; - struct netlink_ext_ack *extack; - u16 family; - u16 min_dump_alloc; - bool strict_check; - u16 answer_flags; - unsigned int prev_seq; - unsigned int seq; +struct bpf_jit_poke_descriptor { + void *ip; union { - u8 ctx[48]; - long int args[6]; + struct { + struct bpf_map *map; + u32 key; + } tail_call; }; + bool ip_stable; + u8 adj_off; + u16 reason; }; -struct ndmsg { - __u8 ndm_family; - __u8 ndm_pad1; - __u16 ndm_pad2; - __s32 ndm_ifindex; - __u16 ndm_state; - __u8 ndm_flags; - __u8 ndm_type; +struct bpf_cgroup_storage; + +struct bpf_prog_array_item { + struct bpf_prog *prog; + struct bpf_cgroup_storage *cgroup_storage[2]; }; -struct rtnl_link_stats64 { - __u64 rx_packets; - __u64 tx_packets; - __u64 rx_bytes; - __u64 tx_bytes; - __u64 rx_errors; - __u64 tx_errors; - __u64 rx_dropped; - __u64 tx_dropped; - __u64 multicast; - __u64 collisions; - __u64 rx_length_errors; - __u64 rx_over_errors; - __u64 rx_crc_errors; - __u64 rx_frame_errors; - __u64 rx_fifo_errors; - __u64 rx_missed_errors; - __u64 tx_aborted_errors; - __u64 tx_carrier_errors; - __u64 tx_fifo_errors; - __u64 tx_heartbeat_errors; - __u64 tx_window_errors; - __u64 rx_compressed; - __u64 tx_compressed; - __u64 rx_nohandler; +struct bpf_storage_buffer; + +struct bpf_cgroup_storage_map; + +struct bpf_cgroup_storage { + union { + struct bpf_storage_buffer *buf; + void *percpu_buf; + }; + struct bpf_cgroup_storage_map *map; + struct bpf_cgroup_storage_key key; + struct list_head list; + struct rb_node node; + struct callback_head rcu; }; -struct ifla_vf_guid { - __u32 vf; - __u64 guid; +struct bpf_prog_array { + struct callback_head rcu; + struct bpf_prog_array_item items[0]; }; -struct ifla_vf_stats { - __u64 rx_packets; - __u64 tx_packets; - __u64 rx_bytes; - __u64 tx_bytes; - __u64 broadcast; - __u64 multicast; - __u64 rx_dropped; - __u64 tx_dropped; +struct bpf_storage_buffer { + struct callback_head rcu; + char data[0]; }; -struct ifla_vf_info { - __u32 vf; - __u8 mac[32]; - __u32 vlan; - __u32 qos; - __u32 spoofchk; - __u32 linkstate; - __u32 min_tx_rate; - __u32 max_tx_rate; - __u32 rss_query_en; - __u32 trusted; - __be16 vlan_proto; -}; - -struct tc_stats { - __u64 bytes; - __u32 packets; - __u32 drops; - __u32 overlimits; - __u32 bps; - __u32 pps; - __u32 qlen; - __u32 backlog; +struct cgroup_bpf { + struct bpf_prog_array *effective[26]; + struct list_head progs[26]; + u32 flags[26]; + struct bpf_prog_array *inactive; + struct percpu_ref refcnt; + struct work_struct release_work; }; -struct tc_sizespec { - unsigned char cell_log; - unsigned char size_log; - short int cell_align; - int overhead; - unsigned int linklayer; - unsigned int mpu; - unsigned int mtu; - unsigned int tsize; -}; +struct psi_group {}; -enum netdev_tx { - __NETDEV_TX_MIN = -2147483648, - NETDEV_TX_OK = 0, - NETDEV_TX_BUSY = 16, +struct cgroup_file { + struct kernfs_node *kn; + long unsigned int notified_at; + struct timer_list notify_timer; }; -typedef enum netdev_tx netdev_tx_t; +struct cgroup_subsys; -struct header_ops { - int (*create)(struct sk_buff *, struct net_device *, short unsigned int, const void *, const void *, unsigned int); - int (*parse)(const struct sk_buff *, unsigned char *); - int (*cache)(const struct neighbour *, struct hh_cache *, __be16); - void (*cache_update)(struct hh_cache *, const struct net_device *, const unsigned char *); - bool (*validate)(const char *, unsigned int); - __be16 (*parse_protocol)(const struct sk_buff *); +struct cgroup_subsys_state { + struct cgroup *cgroup; + struct cgroup_subsys *ss; + struct percpu_ref refcnt; + struct list_head sibling; + struct list_head children; + struct list_head rstat_css_node; + int id; + unsigned int flags; + u64 serial_nr; + atomic_t online_cnt; + struct work_struct destroy_work; + struct rcu_work destroy_rwork; + struct cgroup_subsys_state *parent; }; -struct gro_list { - struct list_head list; - int count; +struct cgroup_base_stat { + struct task_cputime cputime; }; -struct napi_struct { - struct list_head poll_list; - long unsigned int state; - int weight; - long unsigned int gro_bitmask; - int (*poll)(struct napi_struct *, int); - int poll_owner; - struct net_device *dev; - struct gro_list gro_hash[8]; - struct sk_buff *skb; - struct list_head rx_list; - int rx_count; - struct hrtimer timer; - struct list_head dev_list; - struct hlist_node napi_hash_node; - unsigned int napi_id; +struct cgroup_freezer_state { + bool freeze; + int e_freeze; + int nr_frozen_descendants; + int nr_frozen_tasks; }; -struct netdev_queue { - struct net_device *dev; - struct Qdisc *qdisc; - struct Qdisc *qdisc_sleeping; - struct kobject kobj; - int numa_node; - long unsigned int tx_maxrate; - long unsigned int trans_timeout; - struct net_device *sb_dev; - long: 64; - spinlock_t _xmit_lock; - int xmit_lock_owner; - long unsigned int trans_start; - long unsigned int state; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - struct dql dql; +struct cgroup_root; + +struct cgroup_rstat_cpu; + +struct cgroup { + struct cgroup_subsys_state self; + long unsigned int flags; + int level; + int max_depth; + int nr_descendants; + int nr_dying_descendants; + int max_descendants; + int nr_populated_csets; + int nr_populated_domain_children; + int nr_populated_threaded_children; + int nr_threaded_children; + struct kernfs_node *kn; + struct cgroup_file procs_file; + struct cgroup_file events_file; + u16 subtree_control; + u16 subtree_ss_mask; + u16 old_subtree_control; + u16 old_subtree_ss_mask; + struct cgroup_subsys_state *subsys[4]; + struct cgroup_root *root; + struct list_head cset_links; + struct list_head e_csets[4]; + struct cgroup *dom_cgrp; + struct cgroup *old_dom_cgrp; + struct cgroup_rstat_cpu *rstat_cpu; + struct list_head rstat_css_list; + struct cgroup_base_stat last_bstat; + struct cgroup_base_stat bstat; + struct prev_cputime prev_cputime; + struct list_head pidlists; + struct mutex pidlist_mutex; + wait_queue_head_t offline_waitq; + struct work_struct release_agent_work; + struct psi_group psi; + struct cgroup_bpf bpf; + atomic_t congestion_count; + struct cgroup_freezer_state freezer; + u64 ancestor_ids[0]; }; -struct qdisc_skb_head { - struct sk_buff *head; - struct sk_buff *tail; - __u32 qlen; - spinlock_t lock; +struct cgroup_taskset; + +struct cftype; + +struct cgroup_subsys { + struct cgroup_subsys_state * (*css_alloc)(struct cgroup_subsys_state *); + int (*css_online)(struct cgroup_subsys_state *); + void (*css_offline)(struct cgroup_subsys_state *); + void (*css_released)(struct cgroup_subsys_state *); + void (*css_free)(struct cgroup_subsys_state *); + void (*css_reset)(struct cgroup_subsys_state *); + void (*css_rstat_flush)(struct cgroup_subsys_state *, int); + int (*css_extra_stat_show)(struct seq_file *, struct cgroup_subsys_state *); + int (*can_attach)(struct cgroup_taskset *); + void (*cancel_attach)(struct cgroup_taskset *); + void (*attach)(struct cgroup_taskset *); + void (*post_attach)(); + int (*can_fork)(struct task_struct *); + void (*cancel_fork)(struct task_struct *); + void (*fork)(struct task_struct *); + void (*exit)(struct task_struct *); + void (*release)(struct task_struct *); + void (*bind)(struct cgroup_subsys_state *); + bool early_init: 1; + bool implicit_on_dfl: 1; + bool threaded: 1; + bool broken_hierarchy: 1; + bool warned_broken_hierarchy: 1; + int id; + const char *name; + const char *legacy_name; + struct cgroup_root *root; + struct idr css_idr; + struct list_head cfts; + struct cftype *dfl_cftypes; + struct cftype *legacy_cftypes; + unsigned int depends_on; }; -struct gnet_stats_basic_packed { - __u64 bytes; - __u64 packets; +struct cgroup_rstat_cpu { + struct u64_stats_sync bsync; + struct cgroup_base_stat bstat; + struct cgroup_base_stat last_bstat; + struct cgroup *updated_children; + struct cgroup *updated_next; }; -struct gnet_stats_queue { - __u32 qlen; - __u32 backlog; - __u32 drops; - __u32 requeues; - __u32 overlimits; +struct cgroup_root { + struct kernfs_root *kf_root; + unsigned int subsys_mask; + int hierarchy_id; + struct cgroup cgrp; + u64 cgrp_ancestor_id_storage; + atomic_t nr_cgrps; + struct list_head root_list; + unsigned int flags; + char release_agent_path[4096]; + char name[64]; }; -struct Qdisc_ops; +struct cftype { + char name[64]; + long unsigned int private; + size_t max_write_len; + unsigned int flags; + unsigned int file_offset; + struct cgroup_subsys *ss; + struct list_head node; + struct kernfs_ops *kf_ops; + int (*open)(struct kernfs_open_file *); + void (*release)(struct kernfs_open_file *); + u64 (*read_u64)(struct cgroup_subsys_state *, struct cftype *); + s64 (*read_s64)(struct cgroup_subsys_state *, struct cftype *); + int (*seq_show)(struct seq_file *, void *); + void * (*seq_start)(struct seq_file *, loff_t *); + void * (*seq_next)(struct seq_file *, void *, loff_t *); + void (*seq_stop)(struct seq_file *, void *); + int (*write_u64)(struct cgroup_subsys_state *, struct cftype *, u64); + int (*write_s64)(struct cgroup_subsys_state *, struct cftype *, s64); + ssize_t (*write)(struct kernfs_open_file *, char *, size_t, loff_t); + __poll_t (*poll)(struct kernfs_open_file *, struct poll_table_struct *); +}; -struct qdisc_size_table; +struct perf_callchain_entry { + __u64 nr; + __u64 ip[0]; +}; -struct net_rate_estimator; +typedef long unsigned int (*perf_copy_f)(void *, const void *, long unsigned int, long unsigned int); -struct gnet_stats_basic_cpu; +struct perf_raw_frag { + union { + struct perf_raw_frag *next; + long unsigned int pad; + }; + perf_copy_f copy; + void *data; + u32 size; +} __attribute__((packed)); -struct Qdisc { - int (*enqueue)(struct sk_buff *, struct Qdisc *, struct sk_buff **); - struct sk_buff * (*dequeue)(struct Qdisc *); - unsigned int flags; - u32 limit; - const struct Qdisc_ops *ops; - struct qdisc_size_table *stab; - struct hlist_node hash; - u32 handle; - u32 parent; - struct netdev_queue *dev_queue; - struct net_rate_estimator *rate_est; - struct gnet_stats_basic_cpu *cpu_bstats; - struct gnet_stats_queue *cpu_qstats; - int padded; - refcount_t refcnt; - long: 64; - long: 64; - long: 64; - struct sk_buff_head gso_skb; - struct qdisc_skb_head q; - struct gnet_stats_basic_packed bstats; - seqcount_t running; - struct gnet_stats_queue qstats; - long unsigned int state; - struct Qdisc *next_sched; - struct sk_buff_head skb_bad_txq; - spinlock_t busylock; - spinlock_t seqlock; - bool empty; - struct callback_head rcu; - long: 64; - long: 64; - long: 64; - long: 64; +struct perf_raw_record { + struct perf_raw_frag frag; + u32 size; }; -struct rps_map { - unsigned int len; - struct callback_head rcu; - u16 cpus[0]; +struct perf_branch_stack { + __u64 nr; + struct perf_branch_entry entries[0]; }; -struct rps_dev_flow { - u16 cpu; - u16 filter; - unsigned int last_qtail; +struct perf_cpu_context { + struct perf_event_context ctx; + struct perf_event_context *task_ctx; + int active_oncpu; + int exclusive; + raw_spinlock_t hrtimer_lock; + struct hrtimer hrtimer; + ktime_t hrtimer_interval; + unsigned int hrtimer_active; + struct list_head sched_cb_entry; + int sched_cb_usage; + int online; }; -struct rps_dev_flow_table { - unsigned int mask; - struct callback_head rcu; - struct rps_dev_flow flows[0]; +struct perf_output_handle { + struct perf_event *event; + struct ring_buffer *rb; + long unsigned int wakeup; + long unsigned int size; + u64 aux_flags; + union { + void *addr; + long unsigned int head; + }; + int page; }; -struct rps_sock_flow_table { - u32 mask; - long: 32; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - u32 ents[0]; +struct perf_addr_filter_range { + long unsigned int start; + long unsigned int size; }; -struct netdev_rx_queue { - struct rps_map *rps_map; - struct rps_dev_flow_table *rps_flow_table; - struct kobject kobj; - struct net_device *dev; +struct perf_sample_data { + u64 addr; + struct perf_raw_record *raw; + struct perf_branch_stack *br_stack; + u64 period; + u64 weight; + u64 txn; + union perf_mem_data_src data_src; + u64 type; + u64 ip; + struct { + u32 pid; + u32 tid; + } tid_entry; + u64 time; + u64 id; + u64 stream_id; + struct { + u32 cpu; + u32 reserved; + } cpu_entry; + struct perf_callchain_entry *callchain; + u64 aux_size; + struct perf_regs regs_user; + struct pt_regs regs_user_copy; + struct perf_regs regs_intr; + u64 stack_user_size; + u64 phys_addr; long: 64; long: 64; long: 64; long: 64; long: 64; - struct xdp_rxq_info xdp_rxq; }; -struct xps_map { - unsigned int len; - unsigned int alloc_len; - struct callback_head rcu; - u16 queues[0]; +struct trace_entry { + short unsigned int type; + unsigned char flags; + unsigned char preempt_count; + int pid; }; -struct xps_dev_maps { - struct callback_head rcu; - struct xps_map *attr_map[0]; -}; +struct trace_array; -struct netdev_phys_item_id { - unsigned char id[32]; - unsigned char id_len; -}; +struct tracer; -enum tc_setup_type { - TC_SETUP_QDISC_MQPRIO = 0, - TC_SETUP_CLSU32 = 1, - TC_SETUP_CLSFLOWER = 2, - TC_SETUP_CLSMATCHALL = 3, - TC_SETUP_CLSBPF = 4, - TC_SETUP_BLOCK = 5, - TC_SETUP_QDISC_CBS = 6, - TC_SETUP_QDISC_RED = 7, - TC_SETUP_QDISC_PRIO = 8, - TC_SETUP_QDISC_MQ = 9, - TC_SETUP_QDISC_ETF = 10, - TC_SETUP_ROOT_QDISC = 11, - TC_SETUP_QDISC_GRED = 12, - TC_SETUP_QDISC_TAPRIO = 13, - TC_SETUP_FT = 14, +struct trace_buffer; + +struct ring_buffer_iter; + +struct trace_iterator { + struct trace_array *tr; + struct tracer *trace; + struct trace_buffer *trace_buffer; + void *private; + int cpu_file; + struct mutex mutex; + struct ring_buffer_iter **buffer_iter; + long unsigned int iter_flags; + struct trace_seq tmp_seq; + cpumask_var_t started; + bool snapshot; + struct trace_seq seq; + struct trace_entry *ent; + long unsigned int lost_events; + int leftover; + int ent_size; + int cpu; + u64 ts; + loff_t pos; + long int idx; }; -enum bpf_netdev_command { - XDP_SETUP_PROG = 0, - XDP_SETUP_PROG_HW = 1, - XDP_QUERY_PROG = 2, - XDP_QUERY_PROG_HW = 3, - BPF_OFFLOAD_MAP_ALLOC = 4, - BPF_OFFLOAD_MAP_FREE = 5, - XDP_SETUP_XSK_UMEM = 6, +enum print_line_t { + TRACE_TYPE_PARTIAL_LINE = 0, + TRACE_TYPE_HANDLED = 1, + TRACE_TYPE_UNHANDLED = 2, + TRACE_TYPE_NO_CONSUME = 3, }; -struct xdp_umem; +typedef enum print_line_t (*trace_print_func)(struct trace_iterator *, int, struct trace_event *); -struct netdev_bpf { - enum bpf_netdev_command command; - union { - struct { - u32 flags; - struct bpf_prog *prog; - struct netlink_ext_ack *extack; - }; - struct { - u32 prog_id; - u32 prog_flags; - }; - struct { - struct bpf_offloaded_map *offmap; - }; - struct { - struct xdp_umem *umem; - u16 queue_id; - } xsk; - }; +struct trace_event_functions { + trace_print_func trace; + trace_print_func raw; + trace_print_func hex; + trace_print_func binary; }; -struct dev_ifalias { - struct callback_head rcuhead; - char ifalias[0]; +enum trace_reg { + TRACE_REG_REGISTER = 0, + TRACE_REG_UNREGISTER = 1, + TRACE_REG_PERF_REGISTER = 2, + TRACE_REG_PERF_UNREGISTER = 3, + TRACE_REG_PERF_OPEN = 4, + TRACE_REG_PERF_CLOSE = 5, + TRACE_REG_PERF_ADD = 6, + TRACE_REG_PERF_DEL = 7, }; -struct netdev_name_node { - struct hlist_node hlist; - struct list_head list; - struct net_device *dev; - const char *name; +struct trace_event_class { + const char *system; + void *probe; + void *perf_probe; + int (*reg)(struct trace_event_call *, enum trace_reg, void *); + int (*define_fields)(struct trace_event_call *); + struct list_head * (*get_fields)(struct trace_event_call *); + struct list_head fields; + int (*raw_init)(struct trace_event_call *); }; -struct udp_tunnel_info; - -struct devlink_port; +struct trace_event_file; -struct net_device_ops { - int (*ndo_init)(struct net_device *); - void (*ndo_uninit)(struct net_device *); - int (*ndo_open)(struct net_device *); - int (*ndo_stop)(struct net_device *); - netdev_tx_t (*ndo_start_xmit)(struct sk_buff *, struct net_device *); - netdev_features_t (*ndo_features_check)(struct sk_buff *, struct net_device *, netdev_features_t); - u16 (*ndo_select_queue)(struct net_device *, struct sk_buff *, struct net_device *); - void (*ndo_change_rx_flags)(struct net_device *, int); - void (*ndo_set_rx_mode)(struct net_device *); - int (*ndo_set_mac_address)(struct net_device *, void *); - int (*ndo_validate_addr)(struct net_device *); - int (*ndo_do_ioctl)(struct net_device *, struct ifreq *, int); - int (*ndo_set_config)(struct net_device *, struct ifmap *); - int (*ndo_change_mtu)(struct net_device *, int); - int (*ndo_neigh_setup)(struct net_device *, struct neigh_parms *); - void (*ndo_tx_timeout)(struct net_device *); - void (*ndo_get_stats64)(struct net_device *, struct rtnl_link_stats64 *); - bool (*ndo_has_offload_stats)(const struct net_device *, int); - int (*ndo_get_offload_stats)(int, const struct net_device *, void *); - struct net_device_stats * (*ndo_get_stats)(struct net_device *); - int (*ndo_vlan_rx_add_vid)(struct net_device *, __be16, u16); - int (*ndo_vlan_rx_kill_vid)(struct net_device *, __be16, u16); - void (*ndo_poll_controller)(struct net_device *); - int (*ndo_netpoll_setup)(struct net_device *, struct netpoll_info *); - void (*ndo_netpoll_cleanup)(struct net_device *); - int (*ndo_set_vf_mac)(struct net_device *, int, u8 *); - int (*ndo_set_vf_vlan)(struct net_device *, int, u16, u8, __be16); - int (*ndo_set_vf_rate)(struct net_device *, int, int, int); - int (*ndo_set_vf_spoofchk)(struct net_device *, int, bool); - int (*ndo_set_vf_trust)(struct net_device *, int, bool); - int (*ndo_get_vf_config)(struct net_device *, int, struct ifla_vf_info *); - int (*ndo_set_vf_link_state)(struct net_device *, int, int); - int (*ndo_get_vf_stats)(struct net_device *, int, struct ifla_vf_stats *); - int (*ndo_set_vf_port)(struct net_device *, int, struct nlattr **); - int (*ndo_get_vf_port)(struct net_device *, int, struct sk_buff *); - int (*ndo_get_vf_guid)(struct net_device *, int, struct ifla_vf_guid *, struct ifla_vf_guid *); - int (*ndo_set_vf_guid)(struct net_device *, int, u64, int); - int (*ndo_set_vf_rss_query_en)(struct net_device *, int, bool); - int (*ndo_setup_tc)(struct net_device *, enum tc_setup_type, void *); - int (*ndo_rx_flow_steer)(struct net_device *, const struct sk_buff *, u16, u32); - int (*ndo_add_slave)(struct net_device *, struct net_device *, struct netlink_ext_ack *); - int (*ndo_del_slave)(struct net_device *, struct net_device *); - netdev_features_t (*ndo_fix_features)(struct net_device *, netdev_features_t); - int (*ndo_set_features)(struct net_device *, netdev_features_t); - int (*ndo_neigh_construct)(struct net_device *, struct neighbour *); - void (*ndo_neigh_destroy)(struct net_device *, struct neighbour *); - int (*ndo_fdb_add)(struct ndmsg *, struct nlattr **, struct net_device *, const unsigned char *, u16, u16, struct netlink_ext_ack *); - int (*ndo_fdb_del)(struct ndmsg *, struct nlattr **, struct net_device *, const unsigned char *, u16); - int (*ndo_fdb_dump)(struct sk_buff *, struct netlink_callback *, struct net_device *, struct net_device *, int *); - int (*ndo_fdb_get)(struct sk_buff *, struct nlattr **, struct net_device *, const unsigned char *, u16, u32, u32, struct netlink_ext_ack *); - int (*ndo_bridge_setlink)(struct net_device *, struct nlmsghdr *, u16, struct netlink_ext_ack *); - int (*ndo_bridge_getlink)(struct sk_buff *, u32, u32, struct net_device *, u32, int); - int (*ndo_bridge_dellink)(struct net_device *, struct nlmsghdr *, u16); - int (*ndo_change_carrier)(struct net_device *, bool); - int (*ndo_get_phys_port_id)(struct net_device *, struct netdev_phys_item_id *); - int (*ndo_get_port_parent_id)(struct net_device *, struct netdev_phys_item_id *); - int (*ndo_get_phys_port_name)(struct net_device *, char *, size_t); - void (*ndo_udp_tunnel_add)(struct net_device *, struct udp_tunnel_info *); - void (*ndo_udp_tunnel_del)(struct net_device *, struct udp_tunnel_info *); - void * (*ndo_dfwd_add_station)(struct net_device *, struct net_device *); - void (*ndo_dfwd_del_station)(struct net_device *, void *); - int (*ndo_set_tx_maxrate)(struct net_device *, int, u32); - int (*ndo_get_iflink)(const struct net_device *); - int (*ndo_change_proto_down)(struct net_device *, bool); - int (*ndo_fill_metadata_dst)(struct net_device *, struct sk_buff *); - void (*ndo_set_rx_headroom)(struct net_device *, int); - int (*ndo_bpf)(struct net_device *, struct netdev_bpf *); - int (*ndo_xdp_xmit)(struct net_device *, int, struct xdp_frame **, u32); - int (*ndo_xsk_wakeup)(struct net_device *, u32, u32); - struct devlink_port * (*ndo_get_devlink_port)(struct net_device *); +struct trace_event_buffer { + struct ring_buffer *buffer; + struct ring_buffer_event *event; + struct trace_event_file *trace_file; + void *entry; + long unsigned int flags; + int pc; }; -struct neigh_parms { - possible_net_t net; - struct net_device *dev; +struct trace_subsystem_dir; + +struct trace_event_file { struct list_head list; - int (*neigh_setup)(struct neighbour *); - struct neigh_table *tbl; - void *sysctl_table; - int dead; - refcount_t refcnt; - struct callback_head callback_head; - int reachable_time; - int data[13]; - long unsigned int data_state[1]; + struct trace_event_call *event_call; + struct event_filter *filter; + struct dentry *dir; + struct trace_array *tr; + struct trace_subsystem_dir *system; + struct list_head triggers; + long unsigned int flags; + atomic_t sm_ref; + atomic_t tm_ref; }; -struct pcpu_lstats { - u64_stats_t packets; - u64_stats_t bytes; - struct u64_stats_sync syncp; +enum { + TRACE_EVENT_FL_FILTERED_BIT = 0, + TRACE_EVENT_FL_CAP_ANY_BIT = 1, + TRACE_EVENT_FL_NO_SET_FILTER_BIT = 2, + TRACE_EVENT_FL_IGNORE_ENABLE_BIT = 3, + TRACE_EVENT_FL_TRACEPOINT_BIT = 4, + TRACE_EVENT_FL_KPROBE_BIT = 5, + TRACE_EVENT_FL_UPROBE_BIT = 6, }; -struct pcpu_sw_netstats { - u64 rx_packets; - u64 rx_bytes; - u64 tx_packets; - u64 tx_bytes; - struct u64_stats_sync syncp; +enum { + TRACE_EVENT_FL_FILTERED = 1, + TRACE_EVENT_FL_CAP_ANY = 2, + TRACE_EVENT_FL_NO_SET_FILTER = 4, + TRACE_EVENT_FL_IGNORE_ENABLE = 8, + TRACE_EVENT_FL_TRACEPOINT = 16, + TRACE_EVENT_FL_KPROBE = 32, + TRACE_EVENT_FL_UPROBE = 64, }; -struct nd_opt_hdr; +enum { + EVENT_FILE_FL_ENABLED_BIT = 0, + EVENT_FILE_FL_RECORDED_CMD_BIT = 1, + EVENT_FILE_FL_RECORDED_TGID_BIT = 2, + EVENT_FILE_FL_FILTERED_BIT = 3, + EVENT_FILE_FL_NO_SET_FILTER_BIT = 4, + EVENT_FILE_FL_SOFT_MODE_BIT = 5, + EVENT_FILE_FL_SOFT_DISABLED_BIT = 6, + EVENT_FILE_FL_TRIGGER_MODE_BIT = 7, + EVENT_FILE_FL_TRIGGER_COND_BIT = 8, + EVENT_FILE_FL_PID_FILTER_BIT = 9, + EVENT_FILE_FL_WAS_ENABLED_BIT = 10, +}; -struct ndisc_options; +enum { + EVENT_FILE_FL_ENABLED = 1, + EVENT_FILE_FL_RECORDED_CMD = 2, + EVENT_FILE_FL_RECORDED_TGID = 4, + EVENT_FILE_FL_FILTERED = 8, + EVENT_FILE_FL_NO_SET_FILTER = 16, + EVENT_FILE_FL_SOFT_MODE = 32, + EVENT_FILE_FL_SOFT_DISABLED = 64, + EVENT_FILE_FL_TRIGGER_MODE = 128, + EVENT_FILE_FL_TRIGGER_COND = 256, + EVENT_FILE_FL_PID_FILTER = 512, + EVENT_FILE_FL_WAS_ENABLED = 1024, +}; -struct prefix_info; +enum { + FILTER_OTHER = 0, + FILTER_STATIC_STRING = 1, + FILTER_DYN_STRING = 2, + FILTER_PTR_STRING = 3, + FILTER_TRACE_FN = 4, + FILTER_COMM = 5, + FILTER_CPU = 6, +}; -struct ndisc_ops { - int (*is_useropt)(u8); - int (*parse_options)(const struct net_device *, struct nd_opt_hdr *, struct ndisc_options *); - void (*update)(const struct net_device *, struct neighbour *, u32, u8, const struct ndisc_options *); - int (*opt_addr_space)(const struct net_device *, u8, struct neighbour *, u8 *, u8 **); - void (*fill_addr_option)(const struct net_device *, struct sk_buff *, u8, const u8 *); - void (*prefix_rcv_add_addr)(struct net *, struct net_device *, const struct prefix_info *, struct inet6_dev *, struct in6_addr *, int, u32, bool, bool, __u32, u32, bool); +struct property { + char *name; + int length; + void *value; + struct property *next; }; -struct ipv6_devstat { - struct proc_dir_entry *proc_dir_entry; - struct ipstats_mib *ipv6; - struct icmpv6_mib_device *icmpv6dev; - struct icmpv6msg_mib_device *icmpv6msgdev; +struct irq_fwspec { + struct fwnode_handle *fwnode; + int param_count; + u32 param[16]; }; -struct ifmcaddr6; +struct irq_data; -struct ifacaddr6; +struct irq_domain_ops { + int (*match)(struct irq_domain *, struct device_node *, enum irq_domain_bus_token); + int (*select)(struct irq_domain *, struct irq_fwspec *, enum irq_domain_bus_token); + int (*map)(struct irq_domain *, unsigned int, irq_hw_number_t); + void (*unmap)(struct irq_domain *, unsigned int); + int (*xlate)(struct irq_domain *, struct device_node *, const u32 *, unsigned int, long unsigned int *, unsigned int *); + int (*alloc)(struct irq_domain *, unsigned int, unsigned int, void *); + void (*free)(struct irq_domain *, unsigned int, unsigned int); + int (*activate)(struct irq_domain *, struct irq_data *, bool); + void (*deactivate)(struct irq_domain *, struct irq_data *); + int (*translate)(struct irq_domain *, struct irq_fwspec *, long unsigned int *, unsigned int *); +}; -struct inet6_dev { - struct net_device *dev; - struct list_head addr_list; - struct ifmcaddr6 *mc_list; - struct ifmcaddr6 *mc_tomb; - spinlock_t mc_lock; - unsigned char mc_qrv; - unsigned char mc_gq_running; - unsigned char mc_ifc_count; - unsigned char mc_dad_count; - long unsigned int mc_v1_seen; - long unsigned int mc_qi; - long unsigned int mc_qri; - long unsigned int mc_maxdelay; - struct timer_list mc_gq_timer; - struct timer_list mc_ifc_timer; - struct timer_list mc_dad_timer; - struct ifacaddr6 *ac_list; - rwlock_t lock; - refcount_t refcnt; - __u32 if_flags; - int dead; - u32 desync_factor; - u8 rndid[8]; - struct list_head tempaddr_list; - struct in6_addr token; - struct neigh_parms *nd_parms; - struct ipv6_devconf cnf; - struct ipv6_devstat stats; - struct timer_list rs_timer; - __s32 rs_interval; - __u8 rs_probes; - long unsigned int tstamp; - struct callback_head rcu; +struct acpi_table_header { + char signature[4]; + u32 length; + u8 revision; + u8 checksum; + char oem_id[6]; + char oem_table_id[8]; + u32 oem_revision; + char asl_compiler_id[4]; + u32 asl_compiler_revision; }; -struct tcf_proto; +struct acpi_generic_address { + u8 space_id; + u8 bit_width; + u8 bit_offset; + u8 access_width; + u64 address; +} __attribute__((packed)); -struct mini_Qdisc { - struct tcf_proto *filter_list; - struct gnet_stats_basic_cpu *cpu_bstats; - struct gnet_stats_queue *cpu_qstats; - struct callback_head rcu; -}; +struct acpi_table_fadt { + struct acpi_table_header header; + u32 facs; + u32 dsdt; + u8 model; + u8 preferred_profile; + u16 sci_interrupt; + u32 smi_command; + u8 acpi_enable; + u8 acpi_disable; + u8 s4_bios_request; + u8 pstate_control; + u32 pm1a_event_block; + u32 pm1b_event_block; + u32 pm1a_control_block; + u32 pm1b_control_block; + u32 pm2_control_block; + u32 pm_timer_block; + u32 gpe0_block; + u32 gpe1_block; + u8 pm1_event_length; + u8 pm1_control_length; + u8 pm2_control_length; + u8 pm_timer_length; + u8 gpe0_block_length; + u8 gpe1_block_length; + u8 gpe1_base; + u8 cst_control; + u16 c2_latency; + u16 c3_latency; + u16 flush_size; + u16 flush_stride; + u8 duty_offset; + u8 duty_width; + u8 day_alarm; + u8 month_alarm; + u8 century; + u16 boot_flags; + u8 reserved; + u32 flags; + struct acpi_generic_address reset_register; + u8 reset_value; + u16 arm_boot_flags; + u8 minor_revision; + u64 Xfacs; + u64 Xdsdt; + struct acpi_generic_address xpm1a_event_block; + struct acpi_generic_address xpm1b_event_block; + struct acpi_generic_address xpm1a_control_block; + struct acpi_generic_address xpm1b_control_block; + struct acpi_generic_address xpm2_control_block; + struct acpi_generic_address xpm_timer_block; + struct acpi_generic_address xgpe0_block; + struct acpi_generic_address xgpe1_block; + struct acpi_generic_address sleep_control; + struct acpi_generic_address sleep_status; + u64 hypervisor_id; +} __attribute__((packed)); -struct rtnl_link_ops { - struct list_head list; - const char *kind; - size_t priv_size; - void (*setup)(struct net_device *); - unsigned int maxtype; - const struct nla_policy *policy; - int (*validate)(struct nlattr **, struct nlattr **, struct netlink_ext_ack *); - int (*newlink)(struct net *, struct net_device *, struct nlattr **, struct nlattr **, struct netlink_ext_ack *); - int (*changelink)(struct net_device *, struct nlattr **, struct nlattr **, struct netlink_ext_ack *); - void (*dellink)(struct net_device *, struct list_head *); - size_t (*get_size)(const struct net_device *); - int (*fill_info)(struct sk_buff *, const struct net_device *); - size_t (*get_xstats_size)(const struct net_device *); - int (*fill_xstats)(struct sk_buff *, const struct net_device *); - unsigned int (*get_num_tx_queues)(); - unsigned int (*get_num_rx_queues)(); - unsigned int slave_maxtype; - const struct nla_policy *slave_policy; - int (*slave_changelink)(struct net_device *, struct net_device *, struct nlattr **, struct nlattr **, struct netlink_ext_ack *); - size_t (*get_slave_size)(const struct net_device *, const struct net_device *); - int (*fill_slave_info)(struct sk_buff *, const struct net_device *, const struct net_device *); - struct net * (*get_link_net)(const struct net_device *); - size_t (*get_linkxstats_size)(const struct net_device *, int); - int (*fill_linkxstats)(struct sk_buff *, const struct net_device *, int *, int); +enum acpi_irq_model_id { + ACPI_IRQ_MODEL_PIC = 0, + ACPI_IRQ_MODEL_IOAPIC = 1, + ACPI_IRQ_MODEL_IOSAPIC = 2, + ACPI_IRQ_MODEL_PLATFORM = 3, + ACPI_IRQ_MODEL_GIC = 4, + ACPI_IRQ_MODEL_COUNT = 5, }; -struct sd_flow_limit { - u64 count; - unsigned int num_buckets; - unsigned int history_head; - u16 history[128]; - u8 buckets[0]; +enum con_scroll { + SM_UP = 0, + SM_DOWN = 1, }; -struct softnet_data { - struct list_head poll_list; - struct sk_buff_head process_queue; - unsigned int processed; - unsigned int time_squeeze; - unsigned int received_rps; - struct softnet_data *rps_ipi_list; - struct sd_flow_limit *flow_limit; - struct Qdisc *output_queue; - struct Qdisc **output_queue_tailp; - struct sk_buff *completion_queue; - struct { - u16 recursion; - u8 more; - } xmit; - long: 32; - long: 64; - long: 64; - long: 64; - unsigned int input_queue_head; - long: 32; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - call_single_data_t csd; - struct softnet_data *rps_ipi_next; - unsigned int cpu; - unsigned int input_queue_tail; - unsigned int dropped; - struct sk_buff_head input_pkt_queue; - struct napi_struct backlog; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; -}; +struct vc_data; -enum { - RTAX_UNSPEC = 0, - RTAX_LOCK = 1, - RTAX_MTU = 2, - RTAX_WINDOW = 3, - RTAX_RTT = 4, - RTAX_RTTVAR = 5, - RTAX_SSTHRESH = 6, - RTAX_CWND = 7, - RTAX_ADVMSS = 8, - RTAX_REORDERING = 9, - RTAX_HOPLIMIT = 10, - RTAX_INITCWND = 11, - RTAX_FEATURES = 12, - RTAX_RTO_MIN = 13, - RTAX_INITRWND = 14, - RTAX_QUICKACK = 15, - RTAX_CC_ALGO = 16, - RTAX_FASTOPEN_NO_COOKIE = 17, - __RTAX_MAX = 18, +struct console_font; + +struct consw { + struct module *owner; + const char * (*con_startup)(); + void (*con_init)(struct vc_data *, int); + void (*con_deinit)(struct vc_data *); + void (*con_clear)(struct vc_data *, int, int, int, int); + void (*con_putc)(struct vc_data *, int, int, int); + void (*con_putcs)(struct vc_data *, const short unsigned int *, int, int, int); + void (*con_cursor)(struct vc_data *, int); + bool (*con_scroll)(struct vc_data *, unsigned int, unsigned int, enum con_scroll, unsigned int); + int (*con_switch)(struct vc_data *); + int (*con_blank)(struct vc_data *, int, int); + int (*con_font_set)(struct vc_data *, struct console_font *, unsigned int); + int (*con_font_get)(struct vc_data *, struct console_font *); + int (*con_font_default)(struct vc_data *, struct console_font *, char *); + int (*con_font_copy)(struct vc_data *, int); + int (*con_resize)(struct vc_data *, unsigned int, unsigned int, unsigned int); + void (*con_set_palette)(struct vc_data *, const unsigned char *); + void (*con_scrolldelta)(struct vc_data *, int); + int (*con_set_origin)(struct vc_data *); + void (*con_save_screen)(struct vc_data *); + u8 (*con_build_attr)(struct vc_data *, u8, u8, u8, u8, u8, u8); + void (*con_invert_region)(struct vc_data *, u16 *, int); + u16 * (*con_screen_pos)(struct vc_data *, int); + long unsigned int (*con_getxy)(struct vc_data *, long unsigned int, int *, int *); + void (*con_flush_scrollback)(struct vc_data *); + int (*con_debug_enter)(struct vc_data *); + int (*con_debug_leave)(struct vc_data *); }; -struct tcmsg { - unsigned char tcm_family; - unsigned char tcm__pad1; - short unsigned int tcm__pad2; - int tcm_ifindex; - __u32 tcm_handle; - __u32 tcm_parent; - __u32 tcm_info; +struct tty_driver; + +struct console { + char name[16]; + void (*write)(struct console *, const char *, unsigned int); + int (*read)(struct console *, char *, unsigned int); + struct tty_driver * (*device)(struct console *, int *); + void (*unblank)(); + int (*setup)(struct console *, char *); + int (*match)(struct console *, char *, int, char *); + short int flags; + short int index; + int cflag; + void *data; + struct console *next; }; -struct gnet_stats_basic_cpu { - struct gnet_stats_basic_packed bstats; - struct u64_stats_sync syncp; +struct fprop_global { + struct percpu_counter events; + unsigned int period; + seqcount_t sequence; }; -struct gnet_dump { - spinlock_t *lock; - struct sk_buff *skb; - struct nlattr *tail; - int compat_tc_stats; - int compat_xstats; - int padattr; - void *xstats; - int xstats_len; - struct tc_stats tc_stats; +enum wb_stat_item { + WB_RECLAIMABLE = 0, + WB_WRITEBACK = 1, + WB_DIRTIED = 2, + WB_WRITTEN = 3, + NR_WB_STAT_ITEMS = 4, }; -struct nla_policy { - u8 type; - u8 validation_type; - u16 len; - union { - const void *validation_data; - struct { - s16 min; - s16 max; - }; - int (*validate)(const struct nlattr *, struct netlink_ext_ack *); - u16 strict_start_type; - }; +struct bdi_writeback_congested { + long unsigned int state; + refcount_t refcnt; }; -struct nl_info { - struct nlmsghdr *nlh; - struct net *nl_net; - u32 portid; - u8 skip_notify: 1; - u8 skip_notify_kernel: 1; +enum stat_group { + STAT_READ = 0, + STAT_WRITE = 1, + STAT_DISCARD = 2, + STAT_FLUSH = 3, + NR_STAT_GROUPS = 4, }; -struct rhash_lock_head {}; - -struct flow_block { - struct list_head cb_list; +struct disk_stats { + u64 nsecs[4]; + long unsigned int sectors[4]; + long unsigned int ios[4]; + long unsigned int merges[4]; + long unsigned int io_ticks; + long unsigned int time_in_queue; + local_t in_flight[2]; }; -typedef int flow_setup_cb_t(enum tc_setup_type, void *, void *); +struct partition_meta_info { + char uuid[37]; + u8 volname[64]; +}; -struct qdisc_size_table { - struct callback_head rcu; - struct list_head list; - struct tc_sizespec szopts; - int refcnt; - u16 data[0]; +struct disk_part_tbl { + struct callback_head callback_head; + int len; + struct hd_struct *last_lookup; + struct hd_struct *part[0]; }; -struct Qdisc_class_ops; +struct blk_zone; -struct Qdisc_ops { - struct Qdisc_ops *next; - const struct Qdisc_class_ops *cl_ops; - char id[16]; - int priv_size; - unsigned int static_flags; - int (*enqueue)(struct sk_buff *, struct Qdisc *, struct sk_buff **); - struct sk_buff * (*dequeue)(struct Qdisc *); - struct sk_buff * (*peek)(struct Qdisc *); - int (*init)(struct Qdisc *, struct nlattr *, struct netlink_ext_ack *); - void (*reset)(struct Qdisc *); - void (*destroy)(struct Qdisc *); - int (*change)(struct Qdisc *, struct nlattr *, struct netlink_ext_ack *); - void (*attach)(struct Qdisc *); - int (*change_tx_queue_len)(struct Qdisc *, unsigned int); - int (*dump)(struct Qdisc *, struct sk_buff *); - int (*dump_stats)(struct Qdisc *, struct gnet_dump *); - void (*ingress_block_set)(struct Qdisc *, u32); - void (*egress_block_set)(struct Qdisc *, u32); - u32 (*ingress_block_get)(struct Qdisc *); - u32 (*egress_block_get)(struct Qdisc *); - struct module *owner; -}; +typedef int (*report_zones_cb)(struct blk_zone *, unsigned int, void *); -struct qdisc_walker; +struct hd_geometry; -struct tcf_block; +struct pr_ops; -struct Qdisc_class_ops { - unsigned int flags; - struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *); - int (*graft)(struct Qdisc *, long unsigned int, struct Qdisc *, struct Qdisc **, struct netlink_ext_ack *); - struct Qdisc * (*leaf)(struct Qdisc *, long unsigned int); - void (*qlen_notify)(struct Qdisc *, long unsigned int); - long unsigned int (*find)(struct Qdisc *, u32); - int (*change)(struct Qdisc *, u32, u32, struct nlattr **, long unsigned int *, struct netlink_ext_ack *); - int (*delete)(struct Qdisc *, long unsigned int); - void (*walk)(struct Qdisc *, struct qdisc_walker *); - struct tcf_block * (*tcf_block)(struct Qdisc *, long unsigned int, struct netlink_ext_ack *); - long unsigned int (*bind_tcf)(struct Qdisc *, long unsigned int, u32); - void (*unbind_tcf)(struct Qdisc *, long unsigned int); - int (*dump)(struct Qdisc *, long unsigned int, struct sk_buff *, struct tcmsg *); - int (*dump_stats)(struct Qdisc *, long unsigned int, struct gnet_dump *); +struct block_device_operations { + int (*open)(struct block_device *, fmode_t); + void (*release)(struct gendisk *, fmode_t); + int (*rw_page)(struct block_device *, sector_t, struct page *, unsigned int); + int (*ioctl)(struct block_device *, fmode_t, unsigned int, long unsigned int); + int (*compat_ioctl)(struct block_device *, fmode_t, unsigned int, long unsigned int); + unsigned int (*check_events)(struct gendisk *, unsigned int); + int (*media_changed)(struct gendisk *); + void (*unlock_native_capacity)(struct gendisk *); + int (*revalidate_disk)(struct gendisk *); + int (*getgeo)(struct block_device *, struct hd_geometry *); + void (*swap_slot_free_notify)(struct block_device *, long unsigned int); + int (*report_zones)(struct gendisk *, sector_t, unsigned int, report_zones_cb, void *); + struct module *owner; + const struct pr_ops *pr_ops; }; -struct tcf_chain; +struct sg_io_v4 { + __s32 guard; + __u32 protocol; + __u32 subprotocol; + __u32 request_len; + __u64 request; + __u64 request_tag; + __u32 request_attr; + __u32 request_priority; + __u32 request_extra; + __u32 max_response_len; + __u64 response; + __u32 dout_iovec_count; + __u32 dout_xfer_len; + __u32 din_iovec_count; + __u32 din_xfer_len; + __u64 dout_xferp; + __u64 din_xferp; + __u32 timeout; + __u32 flags; + __u64 usr_ptr; + __u32 spare_in; + __u32 driver_status; + __u32 transport_status; + __u32 device_status; + __u32 retry_delay; + __u32 info; + __u32 duration; + __u32 response_len; + __s32 din_resid; + __s32 dout_resid; + __u64 generated_tag; + __u32 spare_out; + __u32 padding; +}; -struct tcf_block { - struct mutex lock; - struct list_head chain_list; - u32 index; - refcount_t refcnt; - struct net *net; - struct Qdisc *q; - struct rw_semaphore cb_lock; - struct flow_block flow_block; - struct list_head owner_list; - bool keep_dst; - atomic_t offloadcnt; - unsigned int nooffloaddevcnt; - unsigned int lockeddevcnt; - struct { - struct tcf_chain *chain; - struct list_head filter_chain_list; - } chain0; - struct callback_head rcu; - struct hlist_head proto_destroy_ht[128]; - struct mutex proto_destroy_lock; +struct bsg_ops { + int (*check_proto)(struct sg_io_v4 *); + int (*fill_hdr)(struct request *, struct sg_io_v4 *, fmode_t); + int (*complete_rq)(struct request *, struct sg_io_v4 *); + void (*free_rq)(struct request *); }; -struct tcf_result; +typedef __u32 req_flags_t; -struct tcf_proto_ops; +typedef void rq_end_io_fn(struct request *, blk_status_t); -struct tcf_proto { - struct tcf_proto *next; - void *root; - int (*classify)(struct sk_buff *, const struct tcf_proto *, struct tcf_result *); - __be16 protocol; - u32 prio; - void *data; - const struct tcf_proto_ops *ops; - struct tcf_chain *chain; - spinlock_t lock; - bool deleting; - refcount_t refcnt; - struct callback_head rcu; - struct hlist_node destroy_ht_node; +enum mq_rq_state { + MQ_RQ_IDLE = 0, + MQ_RQ_IN_FLIGHT = 1, + MQ_RQ_COMPLETE = 2, }; -struct tcf_result { +struct request { + struct request_queue *q; + struct blk_mq_ctx *mq_ctx; + struct blk_mq_hw_ctx *mq_hctx; + unsigned int cmd_flags; + req_flags_t rq_flags; + int tag; + int internal_tag; + unsigned int __data_len; + sector_t __sector; + struct bio *bio; + struct bio *biotail; + struct list_head queuelist; + union { + struct hlist_node hash; + struct list_head ipi_list; + }; + union { + struct rb_node rb_node; + struct bio_vec special_vec; + void *completion_data; + int error_count; + }; union { struct { - long unsigned int class; - u32 classid; - }; - const struct tcf_proto *goto_tp; + struct io_cq *icq; + void *priv[2]; + } elv; struct { - bool ingress; - struct gnet_stats_queue *qstats; - }; + unsigned int seq; + struct list_head list; + rq_end_io_fn *saved_end_io; + } flush; + }; + struct gendisk *rq_disk; + struct hd_struct *part; + u64 start_time_ns; + u64 io_start_time_ns; + short unsigned int stats_sectors; + short unsigned int nr_phys_segments; + short unsigned int write_hint; + short unsigned int ioprio; + unsigned int extra_len; + enum mq_rq_state state; + refcount_t ref; + unsigned int timeout; + long unsigned int deadline; + union { + struct __call_single_data csd; + u64 fifo_time; }; + rq_end_io_fn *end_io; + void *end_io_data; }; -struct tcf_walker; +struct blk_zone { + __u64 start; + __u64 len; + __u64 wp; + __u8 type; + __u8 cond; + __u8 non_seq; + __u8 reset; + __u8 reserved[36]; +}; -struct tcf_proto_ops { - struct list_head head; - char kind[16]; - int (*classify)(struct sk_buff *, const struct tcf_proto *, struct tcf_result *); - int (*init)(struct tcf_proto *); - void (*destroy)(struct tcf_proto *, bool, struct netlink_ext_ack *); - void * (*get)(struct tcf_proto *, u32); - void (*put)(struct tcf_proto *, void *); - int (*change)(struct net *, struct sk_buff *, struct tcf_proto *, long unsigned int, u32, struct nlattr **, void **, bool, bool, struct netlink_ext_ack *); - int (*delete)(struct tcf_proto *, void *, bool *, bool, struct netlink_ext_ack *); - bool (*delete_empty)(struct tcf_proto *); - void (*walk)(struct tcf_proto *, struct tcf_walker *, bool); - int (*reoffload)(struct tcf_proto *, bool, flow_setup_cb_t *, void *, struct netlink_ext_ack *); - void (*hw_add)(struct tcf_proto *, void *); - void (*hw_del)(struct tcf_proto *, void *); - void (*bind_class)(void *, u32, long unsigned int); - void * (*tmplt_create)(struct net *, struct tcf_chain *, struct nlattr **, struct netlink_ext_ack *); - void (*tmplt_destroy)(void *); - int (*dump)(struct net *, struct tcf_proto *, void *, struct sk_buff *, struct tcmsg *, bool); - int (*tmplt_dump)(struct sk_buff *, struct net *, void *); - struct module *owner; - int flags; +enum elv_merge { + ELEVATOR_NO_MERGE = 0, + ELEVATOR_FRONT_MERGE = 1, + ELEVATOR_BACK_MERGE = 2, + ELEVATOR_DISCARD_MERGE = 3, }; -struct tcf_chain { - struct mutex filter_chain_lock; - struct tcf_proto *filter_chain; - struct list_head list; - struct tcf_block *block; - u32 index; - unsigned int refcnt; - unsigned int action_refcnt; - bool explicitly_created; - bool flushing; - const struct tcf_proto_ops *tmplt_ops; - void *tmplt_priv; - struct callback_head rcu; +struct elevator_type; + +struct blk_mq_alloc_data; + +struct elevator_mq_ops { + int (*init_sched)(struct request_queue *, struct elevator_type *); + void (*exit_sched)(struct elevator_queue *); + int (*init_hctx)(struct blk_mq_hw_ctx *, unsigned int); + void (*exit_hctx)(struct blk_mq_hw_ctx *, unsigned int); + void (*depth_updated)(struct blk_mq_hw_ctx *); + bool (*allow_merge)(struct request_queue *, struct request *, struct bio *); + bool (*bio_merge)(struct blk_mq_hw_ctx *, struct bio *, unsigned int); + int (*request_merge)(struct request_queue *, struct request **, struct bio *); + void (*request_merged)(struct request_queue *, struct request *, enum elv_merge); + void (*requests_merged)(struct request_queue *, struct request *, struct request *); + void (*limit_depth)(unsigned int, struct blk_mq_alloc_data *); + void (*prepare_request)(struct request *, struct bio *); + void (*finish_request)(struct request *); + void (*insert_requests)(struct blk_mq_hw_ctx *, struct list_head *, bool); + struct request * (*dispatch_request)(struct blk_mq_hw_ctx *); + bool (*has_work)(struct blk_mq_hw_ctx *); + void (*completed_request)(struct request *, u64); + void (*requeue_request)(struct request *); + struct request * (*former_request)(struct request_queue *, struct request *); + struct request * (*next_request)(struct request_queue *, struct request *); + void (*init_icq)(struct io_cq *); + void (*exit_icq)(struct io_cq *); }; -struct sock_fprog_kern { - u16 len; - struct sock_filter *filter; +struct elv_fs_entry; + +struct blk_mq_debugfs_attr; + +struct elevator_type { + struct kmem_cache *icq_cache; + struct elevator_mq_ops ops; + size_t icq_size; + size_t icq_align; + struct elv_fs_entry *elevator_attrs; + const char *elevator_name; + const char *elevator_alias; + const unsigned int elevator_features; + struct module *elevator_owner; + const struct blk_mq_debugfs_attr *queue_debugfs_attrs; + const struct blk_mq_debugfs_attr *hctx_debugfs_attrs; + char icq_cache_name[22]; + struct list_head list; }; -struct sk_filter { - refcount_t refcnt; - struct callback_head rcu; - struct bpf_prog *prog; +struct elevator_queue { + struct elevator_type *type; + void *elevator_data; + struct kobject kobj; + struct mutex sysfs_lock; + unsigned int registered: 1; + struct hlist_head hash[64]; }; -struct bpf_redirect_info { - u32 flags; - u32 tgt_index; - void *tgt_value; - struct bpf_map *map; - struct bpf_map *map_to_flush; - u32 kern_flags; +struct elv_fs_entry { + struct attribute attr; + ssize_t (*show)(struct elevator_queue *, char *); + ssize_t (*store)(struct elevator_queue *, const char *, size_t); }; -enum { - NEIGH_VAR_MCAST_PROBES = 0, - NEIGH_VAR_UCAST_PROBES = 1, - NEIGH_VAR_APP_PROBES = 2, - NEIGH_VAR_MCAST_REPROBES = 3, - NEIGH_VAR_RETRANS_TIME = 4, - NEIGH_VAR_BASE_REACHABLE_TIME = 5, - NEIGH_VAR_DELAY_PROBE_TIME = 6, - NEIGH_VAR_GC_STALETIME = 7, - NEIGH_VAR_QUEUE_LEN_BYTES = 8, - NEIGH_VAR_PROXY_QLEN = 9, - NEIGH_VAR_ANYCAST_DELAY = 10, - NEIGH_VAR_PROXY_DELAY = 11, - NEIGH_VAR_LOCKTIME = 12, - NEIGH_VAR_QUEUE_LEN = 13, - NEIGH_VAR_RETRANS_TIME_MS = 14, - NEIGH_VAR_BASE_REACHABLE_TIME_MS = 15, - NEIGH_VAR_GC_INTERVAL = 16, - NEIGH_VAR_GC_THRESH1 = 17, - NEIGH_VAR_GC_THRESH2 = 18, - NEIGH_VAR_GC_THRESH3 = 19, - NEIGH_VAR_MAX = 20, +struct blk_mq_debugfs_attr { + const char *name; + umode_t mode; + int (*show)(void *, struct seq_file *); + ssize_t (*write)(void *, const char *, size_t, loff_t *); + const struct seq_operations___2 *seq_ops; }; -struct pneigh_entry; +struct blk_mq_queue_data; -struct neigh_statistics; +typedef blk_status_t queue_rq_fn(struct blk_mq_hw_ctx *, const struct blk_mq_queue_data *); -struct neigh_hash_table; +typedef void commit_rqs_fn(struct blk_mq_hw_ctx *); -struct neigh_table { - int family; - unsigned int entry_size; - unsigned int key_len; - __be16 protocol; - __u32 (*hash)(const void *, const struct net_device *, __u32 *); - bool (*key_eq)(const struct neighbour *, const void *); - int (*constructor)(struct neighbour *); - int (*pconstructor)(struct pneigh_entry *); - void (*pdestructor)(struct pneigh_entry *); - void (*proxy_redo)(struct sk_buff *); - bool (*allow_add)(const struct net_device *, struct netlink_ext_ack *); - char *id; - struct neigh_parms parms; - struct list_head parms_list; - int gc_interval; - int gc_thresh1; - int gc_thresh2; - int gc_thresh3; - long unsigned int last_flush; - struct delayed_work gc_work; - struct timer_list proxy_timer; - struct sk_buff_head proxy_queue; - atomic_t entries; - atomic_t gc_entries; - struct list_head gc_list; - rwlock_t lock; - long unsigned int last_rand; - struct neigh_statistics *stats; - struct neigh_hash_table *nht; - struct pneigh_entry **phash_buckets; -}; +typedef bool get_budget_fn(struct blk_mq_hw_ctx *); -struct neigh_statistics { - long unsigned int allocs; - long unsigned int destroys; - long unsigned int hash_grows; - long unsigned int res_failed; - long unsigned int lookups; - long unsigned int hits; - long unsigned int rcv_probes_mcast; - long unsigned int rcv_probes_ucast; - long unsigned int periodic_gc_runs; - long unsigned int forced_gc_runs; - long unsigned int unres_discards; - long unsigned int table_fulls; -}; +typedef void put_budget_fn(struct blk_mq_hw_ctx *); -struct neigh_ops { - int family; - void (*solicit)(struct neighbour *, struct sk_buff *); - void (*error_report)(struct neighbour *, struct sk_buff *); - int (*output)(struct neighbour *, struct sk_buff *); - int (*connected_output)(struct neighbour *, struct sk_buff *); +enum blk_eh_timer_return { + BLK_EH_DONE = 0, + BLK_EH_RESET_TIMER = 1, }; -struct pneigh_entry { - struct pneigh_entry *next; - possible_net_t net; - struct net_device *dev; - u8 flags; - u8 protocol; - u8 key[0]; -}; +typedef enum blk_eh_timer_return timeout_fn(struct request *, bool); -struct neigh_hash_table { - struct neighbour **hash_buckets; - unsigned int hash_shift; - __u32 hash_rnd[4]; - struct callback_head rcu; -}; +typedef int poll_fn(struct blk_mq_hw_ctx *); -enum { - TCP_ESTABLISHED = 1, - TCP_SYN_SENT = 2, - TCP_SYN_RECV = 3, - TCP_FIN_WAIT1 = 4, - TCP_FIN_WAIT2 = 5, - TCP_TIME_WAIT = 6, - TCP_CLOSE = 7, - TCP_CLOSE_WAIT = 8, - TCP_LAST_ACK = 9, - TCP_LISTEN = 10, - TCP_CLOSING = 11, - TCP_NEW_SYN_RECV = 12, - TCP_MAX_STATES = 13, -}; +typedef void complete_fn(struct request *); -struct fib_rule_hdr { - __u8 family; - __u8 dst_len; - __u8 src_len; - __u8 tos; - __u8 table; - __u8 res1; - __u8 res2; - __u8 action; - __u32 flags; -}; +typedef int init_hctx_fn(struct blk_mq_hw_ctx *, void *, unsigned int); -struct fib_rule_port_range { - __u16 start; - __u16 end; -}; +typedef void exit_hctx_fn(struct blk_mq_hw_ctx *, unsigned int); -struct fib_kuid_range { - kuid_t start; - kuid_t end; -}; +typedef int init_request_fn(struct blk_mq_tag_set *, struct request *, unsigned int, unsigned int); -struct fib_rule { - struct list_head list; - int iifindex; - int oifindex; - u32 mark; - u32 mark_mask; - u32 flags; - u32 table; - u8 action; - u8 l3mdev; - u8 proto; - u8 ip_proto; - u32 target; - __be64 tun_id; - struct fib_rule *ctarget; - struct net *fr_net; - refcount_t refcnt; - u32 pref; - int suppress_ifgroup; - int suppress_prefixlen; - char iifname[16]; - char oifname[16]; - struct fib_kuid_range uid_range; - struct fib_rule_port_range sport_range; - struct fib_rule_port_range dport_range; - struct callback_head rcu; -}; - -struct fib_lookup_arg { - void *lookup_ptr; - const void *lookup_data; - void *result; - struct fib_rule *rule; - u32 table; - int flags; -}; - -struct smc_hashinfo; - -struct request_sock_ops; +typedef void exit_request_fn(struct blk_mq_tag_set *, struct request *, unsigned int); -struct timewait_sock_ops; +typedef void cleanup_rq_fn(struct request *); -struct udp_table; +typedef bool busy_fn(struct request_queue *); -struct raw_hashinfo; +typedef int map_queues_fn(struct blk_mq_tag_set *); -struct proto { - void (*close)(struct sock *, long int); - int (*pre_connect)(struct sock *, struct sockaddr *, int); - int (*connect)(struct sock *, struct sockaddr *, int); - int (*disconnect)(struct sock *, int); - struct sock * (*accept)(struct sock *, int, int *, bool); - int (*ioctl)(struct sock *, int, long unsigned int); - int (*init)(struct sock *); - void (*destroy)(struct sock *); - void (*shutdown)(struct sock *, int); - int (*setsockopt)(struct sock *, int, int, char *, unsigned int); - int (*getsockopt)(struct sock *, int, int, char *, int *); - void (*keepalive)(struct sock *, int); - int (*compat_setsockopt)(struct sock *, int, int, char *, unsigned int); - int (*compat_getsockopt)(struct sock *, int, int, char *, int *); - int (*compat_ioctl)(struct sock *, unsigned int, long unsigned int); - int (*sendmsg)(struct sock *, struct msghdr *, size_t); - int (*recvmsg)(struct sock *, struct msghdr *, size_t, int, int, int *); - int (*sendpage)(struct sock *, struct page *, int, size_t, int); - int (*bind)(struct sock *, struct sockaddr *, int); - int (*backlog_rcv)(struct sock *, struct sk_buff *); - void (*release_cb)(struct sock *); - int (*hash)(struct sock *); - void (*unhash)(struct sock *); - void (*rehash)(struct sock *); - int (*get_port)(struct sock *, short unsigned int); - unsigned int inuse_idx; - bool (*stream_memory_free)(const struct sock *, int); - bool (*stream_memory_read)(const struct sock *); - void (*enter_memory_pressure)(struct sock *); - void (*leave_memory_pressure)(struct sock *); - atomic_long_t *memory_allocated; - struct percpu_counter *sockets_allocated; - long unsigned int *memory_pressure; - long int *sysctl_mem; - int *sysctl_wmem; - int *sysctl_rmem; - u32 sysctl_wmem_offset; - u32 sysctl_rmem_offset; - int max_header; - bool no_autobind; - struct kmem_cache *slab; - unsigned int obj_size; - slab_flags_t slab_flags; - unsigned int useroffset; - unsigned int usersize; - struct percpu_counter *orphan_count; - struct request_sock_ops *rsk_prot; - struct timewait_sock_ops *twsk_prot; - union { - struct inet_hashinfo *hashinfo; - struct udp_table *udp_table; - struct raw_hashinfo *raw_hash; - struct smc_hashinfo *smc_hash; - } h; - struct module *owner; - char name[32]; - struct list_head node; - int (*diag_destroy)(struct sock *, int); +struct blk_mq_ops { + queue_rq_fn *queue_rq; + commit_rqs_fn *commit_rqs; + get_budget_fn *get_budget; + put_budget_fn *put_budget; + timeout_fn *timeout; + poll_fn *poll; + complete_fn *complete; + init_hctx_fn *init_hctx; + exit_hctx_fn *exit_hctx; + init_request_fn *init_request; + exit_request_fn *exit_request; + void (*initialize_rq_fn)(struct request *); + cleanup_rq_fn *cleanup_rq; + busy_fn *busy; + map_queues_fn *map_queues; + void (*show_rq)(struct seq_file *, struct request *); }; -struct request_sock; - -struct request_sock_ops { - int family; - unsigned int obj_size; - struct kmem_cache *slab; - char *slab_name; - int (*rtx_syn_ack)(const struct sock *, struct request_sock *); - void (*send_ack)(const struct sock *, struct sk_buff *, struct request_sock *); - void (*send_reset)(const struct sock *, struct sk_buff *); - void (*destructor)(struct request_sock *); - void (*syn_ack_timeout)(const struct request_sock *); +enum pr_type { + PR_WRITE_EXCLUSIVE = 1, + PR_EXCLUSIVE_ACCESS = 2, + PR_WRITE_EXCLUSIVE_REG_ONLY = 3, + PR_EXCLUSIVE_ACCESS_REG_ONLY = 4, + PR_WRITE_EXCLUSIVE_ALL_REGS = 5, + PR_EXCLUSIVE_ACCESS_ALL_REGS = 6, }; -struct timewait_sock_ops { - struct kmem_cache *twsk_slab; - char *twsk_slab_name; - unsigned int twsk_obj_size; - int (*twsk_unique)(struct sock *, struct sock *, void *); - void (*twsk_destructor)(struct sock *); +struct pr_ops { + int (*pr_register)(struct block_device *, u64, u64, u32); + int (*pr_reserve)(struct block_device *, u64, enum pr_type, u32); + int (*pr_release)(struct block_device *, u64, enum pr_type); + int (*pr_preempt)(struct block_device *, u64, u64, enum pr_type, bool); + int (*pr_clear)(struct block_device *, u64); }; -struct request_sock { - struct sock_common __req_common; - struct request_sock *dl_next; - u16 mss; - u8 num_retrans; - u8 cookie_ts: 1; - u8 num_timeout: 7; - u32 ts_recent; - struct timer_list rsk_timer; - const struct request_sock_ops *rsk_ops; - struct sock *sk; - u32 *saved_syn; - u32 secid; - u32 peer_secid; +struct wb_domain { + spinlock_t lock; + struct fprop_global completions; + struct timer_list period_timer; + long unsigned int period_time; + long unsigned int dirty_limit_tstamp; + long unsigned int dirty_limit; }; -enum tsq_enum { - TSQ_THROTTLED = 0, - TSQ_QUEUED = 1, - TCP_TSQ_DEFERRED = 2, - TCP_WRITE_TIMER_DEFERRED = 3, - TCP_DELACK_TIMER_DEFERRED = 4, - TCP_MTU_REDUCED_DEFERRED = 5, +enum cpu_idle_type { + CPU_IDLE = 0, + CPU_NOT_IDLE = 1, + CPU_NEWLY_IDLE = 2, + CPU_MAX_IDLE_TYPES = 3, }; -struct static_key_false_deferred { - struct static_key_false key; - long unsigned int timeout; - struct delayed_work work; +enum reboot_mode { + REBOOT_UNDEFINED = 4294967295, + REBOOT_COLD = 0, + REBOOT_WARM = 1, + REBOOT_HARD = 2, + REBOOT_SOFT = 3, + REBOOT_GPIO = 4, }; -struct ip6_sf_list { - struct ip6_sf_list *sf_next; - struct in6_addr sf_addr; - long unsigned int sf_count[2]; - unsigned char sf_gsresp; - unsigned char sf_oldin; - unsigned char sf_crcount; +enum reboot_type { + BOOT_TRIPLE = 116, + BOOT_KBD = 107, + BOOT_BIOS = 98, + BOOT_ACPI = 97, + BOOT_EFI = 101, + BOOT_CF9_FORCE = 112, + BOOT_CF9_SAFE = 113, }; -struct ifmcaddr6 { - struct in6_addr mca_addr; - struct inet6_dev *idev; - struct ifmcaddr6 *next; - struct ip6_sf_list *mca_sources; - struct ip6_sf_list *mca_tomb; - unsigned int mca_sfmode; - unsigned char mca_crcount; - long unsigned int mca_sfcount[2]; - struct timer_list mca_timer; - unsigned int mca_flags; - int mca_users; - refcount_t mca_refcnt; - spinlock_t mca_lock; - long unsigned int mca_cstamp; - long unsigned int mca_tstamp; -}; +typedef long unsigned int efi_status_t; -struct ifacaddr6 { - struct in6_addr aca_addr; - struct fib6_info *aca_rt; - struct ifacaddr6 *aca_next; - struct hlist_node aca_addr_lst; - int aca_users; - refcount_t aca_refcnt; - long unsigned int aca_cstamp; - long unsigned int aca_tstamp; - struct callback_head rcu; -}; +typedef u8 efi_bool_t; -struct fib6_result; +typedef u16 efi_char16_t; -struct fib6_nh; +typedef u64 efi_physical_addr_t; -struct fib6_config; +typedef void *efi_handle_t; -struct ipv6_stub { - int (*ipv6_sock_mc_join)(struct sock *, int, const struct in6_addr *); - int (*ipv6_sock_mc_drop)(struct sock *, int, const struct in6_addr *); - struct dst_entry * (*ipv6_dst_lookup_flow)(struct net *, const struct sock *, struct flowi6 *, const struct in6_addr *); - int (*ipv6_route_input)(struct sk_buff *); - struct fib6_table * (*fib6_get_table)(struct net *, u32); - int (*fib6_lookup)(struct net *, int, struct flowi6 *, struct fib6_result *, int); - int (*fib6_table_lookup)(struct net *, struct fib6_table *, int, struct flowi6 *, struct fib6_result *, int); - void (*fib6_select_path)(const struct net *, struct fib6_result *, struct flowi6 *, int, bool, const struct sk_buff *, int); - u32 (*ip6_mtu_from_fib6)(const struct fib6_result *, const struct in6_addr *, const struct in6_addr *); - int (*fib6_nh_init)(struct net *, struct fib6_nh *, struct fib6_config *, gfp_t, struct netlink_ext_ack *); - void (*fib6_nh_release)(struct fib6_nh *); - void (*fib6_update_sernum)(struct net *, struct fib6_info *); - int (*ip6_del_rt)(struct net *, struct fib6_info *); - void (*fib6_rt_update)(struct net *, struct fib6_info *, struct nl_info *); - void (*udpv6_encap_enable)(); - void (*ndisc_send_na)(struct net_device *, const struct in6_addr *, const struct in6_addr *, bool, bool, bool, bool); - struct neigh_table *nd_tbl; -}; +typedef guid_t efi_guid_t; -struct fib6_result { - struct fib6_nh *nh; - struct fib6_info *f6i; - u32 fib6_flags; - u8 fib6_type; - struct rt6_info *rt6; -}; +typedef struct { + u64 signature; + u32 revision; + u32 headersize; + u32 crc32; + u32 reserved; +} efi_table_hdr_t; -enum { - __ND_OPT_PREFIX_INFO_END = 0, - ND_OPT_SOURCE_LL_ADDR = 1, - ND_OPT_TARGET_LL_ADDR = 2, - ND_OPT_PREFIX_INFO = 3, - ND_OPT_REDIRECT_HDR = 4, - ND_OPT_MTU = 5, - ND_OPT_NONCE = 14, - __ND_OPT_ARRAY_MAX = 15, - ND_OPT_ROUTE_INFO = 24, - ND_OPT_RDNSS = 25, - ND_OPT_DNSSL = 31, - ND_OPT_6CO = 34, - ND_OPT_CAPTIVE_PORTAL = 37, - __ND_OPT_MAX = 38, -}; +typedef struct { + u32 type; + u32 pad; + u64 phys_addr; + u64 virt_addr; + u64 num_pages; + u64 attribute; +} efi_memory_desc_t; -struct nd_opt_hdr { - __u8 nd_opt_type; - __u8 nd_opt_len; -}; +typedef struct { + efi_guid_t guid; + u32 headersize; + u32 flags; + u32 imagesize; +} efi_capsule_header_t; -struct ndisc_options { - struct nd_opt_hdr *nd_opt_array[15]; - struct nd_opt_hdr *nd_useropts; - struct nd_opt_hdr *nd_useropts_end; -}; +typedef struct { + u16 year; + u8 month; + u8 day; + u8 hour; + u8 minute; + u8 second; + u8 pad1; + u32 nanosecond; + s16 timezone; + u8 daylight; + u8 pad2; +} efi_time_t; -struct prefix_info { - __u8 type; - __u8 length; - __u8 prefix_len; - __u8 reserved: 6; - __u8 autoconf: 1; - __u8 onlink: 1; - __be32 valid; - __be32 prefered; - __be32 reserved2; - struct in6_addr prefix; -}; +typedef struct { + u32 resolution; + u32 accuracy; + u8 sets_to_zero; +} efi_time_cap_t; -enum nfs_opnum4 { - OP_ACCESS = 3, - OP_CLOSE = 4, - OP_COMMIT = 5, - OP_CREATE = 6, - OP_DELEGPURGE = 7, - OP_DELEGRETURN = 8, - OP_GETATTR = 9, - OP_GETFH = 10, - OP_LINK = 11, - OP_LOCK = 12, - OP_LOCKT = 13, - OP_LOCKU = 14, - OP_LOOKUP = 15, - OP_LOOKUPP = 16, - OP_NVERIFY = 17, - OP_OPEN = 18, - OP_OPENATTR = 19, - OP_OPEN_CONFIRM = 20, - OP_OPEN_DOWNGRADE = 21, - OP_PUTFH = 22, - OP_PUTPUBFH = 23, - OP_PUTROOTFH = 24, - OP_READ = 25, - OP_READDIR = 26, - OP_READLINK = 27, - OP_REMOVE = 28, - OP_RENAME = 29, - OP_RENEW = 30, - OP_RESTOREFH = 31, - OP_SAVEFH = 32, - OP_SECINFO = 33, - OP_SETATTR = 34, - OP_SETCLIENTID = 35, - OP_SETCLIENTID_CONFIRM = 36, - OP_VERIFY = 37, - OP_WRITE = 38, - OP_RELEASE_LOCKOWNER = 39, - OP_BACKCHANNEL_CTL = 40, - OP_BIND_CONN_TO_SESSION = 41, - OP_EXCHANGE_ID = 42, - OP_CREATE_SESSION = 43, - OP_DESTROY_SESSION = 44, - OP_FREE_STATEID = 45, - OP_GET_DIR_DELEGATION = 46, - OP_GETDEVICEINFO = 47, - OP_GETDEVICELIST = 48, - OP_LAYOUTCOMMIT = 49, - OP_LAYOUTGET = 50, - OP_LAYOUTRETURN = 51, - OP_SECINFO_NO_NAME = 52, - OP_SEQUENCE = 53, - OP_SET_SSV = 54, - OP_TEST_STATEID = 55, - OP_WANT_DELEGATION = 56, - OP_DESTROY_CLIENTID = 57, - OP_RECLAIM_COMPLETE = 58, - OP_ALLOCATE = 59, - OP_COPY = 60, - OP_COPY_NOTIFY = 61, - OP_DEALLOCATE = 62, - OP_IO_ADVISE = 63, - OP_LAYOUTERROR = 64, - OP_LAYOUTSTATS = 65, - OP_OFFLOAD_CANCEL = 66, - OP_OFFLOAD_STATUS = 67, - OP_READ_PLUS = 68, - OP_SEEK = 69, - OP_WRITE_SAME = 70, - OP_CLONE = 71, - OP_ILLEGAL = 10044, -}; +typedef struct { + efi_table_hdr_t hdr; + void *raise_tpl; + void *restore_tpl; + efi_status_t (*allocate_pages)(int, int, long unsigned int, efi_physical_addr_t *); + efi_status_t (*free_pages)(efi_physical_addr_t, long unsigned int); + efi_status_t (*get_memory_map)(long unsigned int *, void *, long unsigned int *, long unsigned int *, u32 *); + efi_status_t (*allocate_pool)(int, long unsigned int, void **); + efi_status_t (*free_pool)(void *); + void *create_event; + void *set_timer; + void *wait_for_event; + void *signal_event; + void *close_event; + void *check_event; + void *install_protocol_interface; + void *reinstall_protocol_interface; + void *uninstall_protocol_interface; + efi_status_t (*handle_protocol)(efi_handle_t, efi_guid_t *, void **); + void *__reserved; + void *register_protocol_notify; + efi_status_t (*locate_handle)(int, efi_guid_t *, void *, long unsigned int *, efi_handle_t *); + void *locate_device_path; + efi_status_t (*install_configuration_table)(efi_guid_t *, void *); + void *load_image; + void *start_image; + void *exit; + void *unload_image; + efi_status_t (*exit_boot_services)(efi_handle_t, long unsigned int); + void *get_next_monotonic_count; + void *stall; + void *set_watchdog_timer; + void *connect_controller; + void *disconnect_controller; + void *open_protocol; + void *close_protocol; + void *open_protocol_information; + void *protocols_per_handle; + void *locate_handle_buffer; + efi_status_t (*locate_protocol)(efi_guid_t *, void *, void **); + void *install_multiple_protocol_interfaces; + void *uninstall_multiple_protocol_interfaces; + void *calculate_crc32; + void *copy_mem; + void *set_mem; + void *create_event_ex; +} efi_boot_services_t; -enum perf_branch_sample_type_shift { - PERF_SAMPLE_BRANCH_USER_SHIFT = 0, - PERF_SAMPLE_BRANCH_KERNEL_SHIFT = 1, - PERF_SAMPLE_BRANCH_HV_SHIFT = 2, - PERF_SAMPLE_BRANCH_ANY_SHIFT = 3, - PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT = 4, - PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT = 5, - PERF_SAMPLE_BRANCH_IND_CALL_SHIFT = 6, - PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT = 7, - PERF_SAMPLE_BRANCH_IN_TX_SHIFT = 8, - PERF_SAMPLE_BRANCH_NO_TX_SHIFT = 9, - PERF_SAMPLE_BRANCH_COND_SHIFT = 10, - PERF_SAMPLE_BRANCH_CALL_STACK_SHIFT = 11, - PERF_SAMPLE_BRANCH_IND_JUMP_SHIFT = 12, - PERF_SAMPLE_BRANCH_CALL_SHIFT = 13, - PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT = 14, - PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT = 15, - PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 16, - PERF_SAMPLE_BRANCH_MAX_SHIFT = 17, -}; +typedef efi_status_t efi_get_time_t(efi_time_t *, efi_time_cap_t *); -enum exception_stack_ordering { - ESTACK_DF = 0, - ESTACK_NMI = 1, - ESTACK_DB2 = 2, - ESTACK_DB1 = 3, - ESTACK_DB = 4, - ESTACK_MCE = 5, - N_EXCEPTION_STACKS = 6, -}; +typedef efi_status_t efi_set_time_t(efi_time_t *); -enum { - TSK_TRACE_FL_TRACE_BIT = 0, - TSK_TRACE_FL_GRAPH_BIT = 1, -}; +typedef efi_status_t efi_get_wakeup_time_t(efi_bool_t *, efi_bool_t *, efi_time_t *); -struct uuidcmp { - const char *uuid; - int len; -}; +typedef efi_status_t efi_set_wakeup_time_t(efi_bool_t, efi_time_t *); -struct mdu_array_info_s { - int major_version; - int minor_version; - int patch_version; - unsigned int ctime; - int level; - int size; - int nr_disks; - int raid_disks; - int md_minor; - int not_persistent; - unsigned int utime; - int state; - int active_disks; - int working_disks; - int failed_disks; - int spare_disks; - int layout; - int chunk_size; +typedef efi_status_t efi_get_variable_t(efi_char16_t *, efi_guid_t *, u32 *, long unsigned int *, void *); + +typedef efi_status_t efi_get_next_variable_t(long unsigned int *, efi_char16_t *, efi_guid_t *); + +typedef efi_status_t efi_set_variable_t(efi_char16_t *, efi_guid_t *, u32, long unsigned int, void *); + +typedef efi_status_t efi_get_next_high_mono_count_t(u32 *); + +typedef void efi_reset_system_t(int, efi_status_t, long unsigned int, efi_char16_t *); + +typedef efi_status_t efi_set_virtual_address_map_t(long unsigned int, long unsigned int, u32, efi_memory_desc_t *); + +typedef efi_status_t efi_query_variable_info_t(u32, u64 *, u64 *, u64 *); + +typedef efi_status_t efi_update_capsule_t(efi_capsule_header_t **, long unsigned int, long unsigned int); + +typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **, long unsigned int, u64 *, int *); + +typedef struct { + efi_table_hdr_t hdr; + efi_get_time_t *get_time; + efi_set_time_t *set_time; + efi_get_wakeup_time_t *get_wakeup_time; + efi_set_wakeup_time_t *set_wakeup_time; + efi_set_virtual_address_map_t *set_virtual_address_map; + void *convert_pointer; + efi_get_variable_t *get_variable; + efi_get_next_variable_t *get_next_variable; + efi_set_variable_t *set_variable; + efi_get_next_high_mono_count_t *get_next_high_mono_count; + efi_reset_system_t *reset_system; + efi_update_capsule_t *update_capsule; + efi_query_capsule_caps_t *query_capsule_caps; + efi_query_variable_info_t *query_variable_info; +} efi_runtime_services_t; + +typedef struct { + efi_table_hdr_t hdr; + long unsigned int fw_vendor; + u32 fw_revision; + long unsigned int con_in_handle; + long unsigned int con_in; + long unsigned int con_out_handle; + long unsigned int con_out; + long unsigned int stderr_handle; + long unsigned int stderr; + efi_runtime_services_t *runtime; + efi_boot_services_t *boottime; + long unsigned int nr_tables; + long unsigned int tables; +} efi_system_table_t; + +struct efi_memory_map { + phys_addr_t phys_map; + void *map; + void *map_end; + int nr_map; + long unsigned int desc_version; + long unsigned int desc_size; + bool late; }; -typedef struct mdu_array_info_s mdu_array_info_t; +struct efi { + efi_system_table_t *systab; + unsigned int runtime_version; + long unsigned int mps; + long unsigned int acpi; + long unsigned int acpi20; + long unsigned int smbios; + long unsigned int smbios3; + long unsigned int boot_info; + long unsigned int hcdp; + long unsigned int uga; + long unsigned int fw_vendor; + long unsigned int runtime; + long unsigned int config_table; + long unsigned int esrt; + long unsigned int properties_table; + long unsigned int mem_attr_table; + long unsigned int rng_seed; + long unsigned int tpm_log; + long unsigned int tpm_final_log; + long unsigned int mem_reserve; + efi_get_time_t *get_time; + efi_set_time_t *set_time; + efi_get_wakeup_time_t *get_wakeup_time; + efi_set_wakeup_time_t *set_wakeup_time; + efi_get_variable_t *get_variable; + efi_get_next_variable_t *get_next_variable; + efi_set_variable_t *set_variable; + efi_set_variable_t *set_variable_nonblocking; + efi_query_variable_info_t *query_variable_info; + efi_query_variable_info_t *query_variable_info_nonblocking; + efi_update_capsule_t *update_capsule; + efi_query_capsule_caps_t *query_capsule_caps; + efi_get_next_high_mono_count_t *get_next_high_mono_count; + efi_reset_system_t *reset_system; + efi_set_virtual_address_map_t *set_virtual_address_map; + struct efi_memory_map memmap; + long unsigned int flags; +}; -struct mdu_disk_info_s { - int number; - int major; - int minor; - int raid_disk; - int state; +enum efi_rts_ids { + EFI_NONE = 0, + EFI_GET_TIME = 1, + EFI_SET_TIME = 2, + EFI_GET_WAKEUP_TIME = 3, + EFI_SET_WAKEUP_TIME = 4, + EFI_GET_VARIABLE = 5, + EFI_GET_NEXT_VARIABLE = 6, + EFI_SET_VARIABLE = 7, + EFI_QUERY_VARIABLE_INFO = 8, + EFI_GET_NEXT_HIGH_MONO_COUNT = 9, + EFI_RESET_SYSTEM = 10, + EFI_UPDATE_CAPSULE = 11, + EFI_QUERY_CAPSULE_CAPS = 12, }; -typedef struct mdu_disk_info_s mdu_disk_info_t; +struct efi_runtime_work { + void *arg1; + void *arg2; + void *arg3; + void *arg4; + void *arg5; + efi_status_t status; + struct work_struct work; + enum efi_rts_ids efi_rts_id; + struct completion efi_rts_comp; +}; -enum kmalloc_cache_type { - KMALLOC_NORMAL = 0, - KMALLOC_RECLAIM = 1, - KMALLOC_DMA = 2, - NR_KMALLOC_TYPES = 3, +struct percpu_cluster { + struct swap_cluster_info index; + unsigned int next; }; -struct hash { - int ino; - int minor; - int major; - umode_t mode; - struct hash *next; - char name[4098]; +struct trace_event_raw_initcall_level { + struct trace_entry ent; + u32 __data_loc_level; + char __data[0]; }; -struct dir_entry { - struct list_head list; - char *name; - time64_t mtime; +struct trace_event_raw_initcall_start { + struct trace_entry ent; + initcall_t func; + char __data[0]; }; -enum state { - Start = 0, - Collect = 1, - GotHeader = 2, - SkipIt = 3, - GotName = 4, - CopyFile = 5, - GotSymlink = 6, - Reset = 7, +struct trace_event_raw_initcall_finish { + struct trace_entry ent; + initcall_t func; + int ret; + char __data[0]; }; -typedef int (*decompress_fn)(unsigned char *, long int, long int (*)(void *, long unsigned int), long int (*)(void *, long unsigned int), unsigned char *, long int *, void (*)(char *)); +struct trace_event_data_offsets_initcall_level { + u32 level; +}; -enum ucount_type { - UCOUNT_USER_NAMESPACES = 0, - UCOUNT_PID_NAMESPACES = 1, - UCOUNT_UTS_NAMESPACES = 2, - UCOUNT_IPC_NAMESPACES = 3, - UCOUNT_NET_NAMESPACES = 4, - UCOUNT_MNT_NAMESPACES = 5, - UCOUNT_CGROUP_NAMESPACES = 6, - UCOUNT_INOTIFY_INSTANCES = 7, - UCOUNT_INOTIFY_WATCHES = 8, - UCOUNT_COUNTS = 9, +struct trace_event_data_offsets_initcall_start {}; + +struct trace_event_data_offsets_initcall_finish {}; + +typedef void (*btf_trace_initcall_level)(void *, const char *); + +typedef void (*btf_trace_initcall_start)(void *, initcall_t); + +typedef void (*btf_trace_initcall_finish)(void *, initcall_t, int); + +struct blacklist_entry { + struct list_head next; + char *buf; }; -enum flow_dissector_key_id { - FLOW_DISSECTOR_KEY_CONTROL = 0, - FLOW_DISSECTOR_KEY_BASIC = 1, - FLOW_DISSECTOR_KEY_IPV4_ADDRS = 2, - FLOW_DISSECTOR_KEY_IPV6_ADDRS = 3, - FLOW_DISSECTOR_KEY_PORTS = 4, - FLOW_DISSECTOR_KEY_PORTS_RANGE = 5, - FLOW_DISSECTOR_KEY_ICMP = 6, - FLOW_DISSECTOR_KEY_ETH_ADDRS = 7, - FLOW_DISSECTOR_KEY_TIPC = 8, - FLOW_DISSECTOR_KEY_ARP = 9, - FLOW_DISSECTOR_KEY_VLAN = 10, - FLOW_DISSECTOR_KEY_FLOW_LABEL = 11, - FLOW_DISSECTOR_KEY_GRE_KEYID = 12, - FLOW_DISSECTOR_KEY_MPLS_ENTROPY = 13, - FLOW_DISSECTOR_KEY_ENC_KEYID = 14, - FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS = 15, - FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS = 16, - FLOW_DISSECTOR_KEY_ENC_CONTROL = 17, - FLOW_DISSECTOR_KEY_ENC_PORTS = 18, - FLOW_DISSECTOR_KEY_MPLS = 19, - FLOW_DISSECTOR_KEY_TCP = 20, - FLOW_DISSECTOR_KEY_IP = 21, - FLOW_DISSECTOR_KEY_CVLAN = 22, - FLOW_DISSECTOR_KEY_ENC_IP = 23, - FLOW_DISSECTOR_KEY_ENC_OPTS = 24, - FLOW_DISSECTOR_KEY_META = 25, - FLOW_DISSECTOR_KEY_CT = 26, - FLOW_DISSECTOR_KEY_MAX = 27, +enum page_cache_mode { + _PAGE_CACHE_MODE_WB = 0, + _PAGE_CACHE_MODE_WC = 1, + _PAGE_CACHE_MODE_UC_MINUS = 2, + _PAGE_CACHE_MODE_UC = 3, + _PAGE_CACHE_MODE_WT = 4, + _PAGE_CACHE_MODE_WP = 5, + _PAGE_CACHE_MODE_NUM = 8, }; enum { - IPSTATS_MIB_NUM = 0, - IPSTATS_MIB_INPKTS = 1, - IPSTATS_MIB_INOCTETS = 2, - IPSTATS_MIB_INDELIVERS = 3, - IPSTATS_MIB_OUTFORWDATAGRAMS = 4, - IPSTATS_MIB_OUTPKTS = 5, - IPSTATS_MIB_OUTOCTETS = 6, - IPSTATS_MIB_INHDRERRORS = 7, - IPSTATS_MIB_INTOOBIGERRORS = 8, - IPSTATS_MIB_INNOROUTES = 9, - IPSTATS_MIB_INADDRERRORS = 10, - IPSTATS_MIB_INUNKNOWNPROTOS = 11, - IPSTATS_MIB_INTRUNCATEDPKTS = 12, - IPSTATS_MIB_INDISCARDS = 13, - IPSTATS_MIB_OUTDISCARDS = 14, - IPSTATS_MIB_OUTNOROUTES = 15, - IPSTATS_MIB_REASMTIMEOUT = 16, - IPSTATS_MIB_REASMREQDS = 17, - IPSTATS_MIB_REASMOKS = 18, - IPSTATS_MIB_REASMFAILS = 19, - IPSTATS_MIB_FRAGOKS = 20, - IPSTATS_MIB_FRAGFAILS = 21, - IPSTATS_MIB_FRAGCREATES = 22, - IPSTATS_MIB_INMCASTPKTS = 23, - IPSTATS_MIB_OUTMCASTPKTS = 24, - IPSTATS_MIB_INBCASTPKTS = 25, - IPSTATS_MIB_OUTBCASTPKTS = 26, - IPSTATS_MIB_INMCASTOCTETS = 27, - IPSTATS_MIB_OUTMCASTOCTETS = 28, - IPSTATS_MIB_INBCASTOCTETS = 29, - IPSTATS_MIB_OUTBCASTOCTETS = 30, - IPSTATS_MIB_CSUMERRORS = 31, - IPSTATS_MIB_NOECTPKTS = 32, - IPSTATS_MIB_ECT1PKTS = 33, - IPSTATS_MIB_ECT0PKTS = 34, - IPSTATS_MIB_CEPKTS = 35, - IPSTATS_MIB_REASM_OVERLAPS = 36, - __IPSTATS_MIB_MAX = 37, + UNAME26 = 131072, + ADDR_NO_RANDOMIZE = 262144, + FDPIC_FUNCPTRS = 524288, + MMAP_PAGE_ZERO = 1048576, + ADDR_COMPAT_LAYOUT = 2097152, + READ_IMPLIES_EXEC = 4194304, + ADDR_LIMIT_32BIT = 8388608, + SHORT_INODE = 16777216, + WHOLE_SECONDS = 33554432, + STICKY_TIMEOUTS = 67108864, + ADDR_LIMIT_3GB = 134217728, }; -enum { - ICMP_MIB_NUM = 0, - ICMP_MIB_INMSGS = 1, - ICMP_MIB_INERRORS = 2, - ICMP_MIB_INDESTUNREACHS = 3, - ICMP_MIB_INTIMEEXCDS = 4, - ICMP_MIB_INPARMPROBS = 5, - ICMP_MIB_INSRCQUENCHS = 6, - ICMP_MIB_INREDIRECTS = 7, - ICMP_MIB_INECHOS = 8, - ICMP_MIB_INECHOREPS = 9, - ICMP_MIB_INTIMESTAMPS = 10, - ICMP_MIB_INTIMESTAMPREPS = 11, - ICMP_MIB_INADDRMASKS = 12, - ICMP_MIB_INADDRMASKREPS = 13, - ICMP_MIB_OUTMSGS = 14, - ICMP_MIB_OUTERRORS = 15, - ICMP_MIB_OUTDESTUNREACHS = 16, - ICMP_MIB_OUTTIMEEXCDS = 17, - ICMP_MIB_OUTPARMPROBS = 18, - ICMP_MIB_OUTSRCQUENCHS = 19, - ICMP_MIB_OUTREDIRECTS = 20, - ICMP_MIB_OUTECHOS = 21, - ICMP_MIB_OUTECHOREPS = 22, - ICMP_MIB_OUTTIMESTAMPS = 23, - ICMP_MIB_OUTTIMESTAMPREPS = 24, - ICMP_MIB_OUTADDRMASKS = 25, - ICMP_MIB_OUTADDRMASKREPS = 26, - ICMP_MIB_CSUMERRORS = 27, - __ICMP_MIB_MAX = 28, +enum tlb_infos { + ENTRIES = 0, + NR_INFO = 1, }; enum { - ICMP6_MIB_NUM = 0, - ICMP6_MIB_INMSGS = 1, - ICMP6_MIB_INERRORS = 2, - ICMP6_MIB_OUTMSGS = 3, - ICMP6_MIB_OUTERRORS = 4, - ICMP6_MIB_CSUMERRORS = 5, - __ICMP6_MIB_MAX = 6, + MM_FILEPAGES = 0, + MM_ANONPAGES = 1, + MM_SWAPENTS = 2, + MM_SHMEMPAGES = 3, + NR_MM_COUNTERS = 4, }; -enum { - TCP_MIB_NUM = 0, - TCP_MIB_RTOALGORITHM = 1, - TCP_MIB_RTOMIN = 2, - TCP_MIB_RTOMAX = 3, - TCP_MIB_MAXCONN = 4, - TCP_MIB_ACTIVEOPENS = 5, - TCP_MIB_PASSIVEOPENS = 6, - TCP_MIB_ATTEMPTFAILS = 7, - TCP_MIB_ESTABRESETS = 8, - TCP_MIB_CURRESTAB = 9, - TCP_MIB_INSEGS = 10, - TCP_MIB_OUTSEGS = 11, - TCP_MIB_RETRANSSEGS = 12, - TCP_MIB_INERRS = 13, - TCP_MIB_OUTRSTS = 14, - TCP_MIB_CSUMERRORS = 15, - __TCP_MIB_MAX = 16, +typedef __u32 Elf32_Word; + +struct elf32_note { + Elf32_Word n_namesz; + Elf32_Word n_descsz; + Elf32_Word n_type; }; -enum { - UDP_MIB_NUM = 0, - UDP_MIB_INDATAGRAMS = 1, - UDP_MIB_NOPORTS = 2, - UDP_MIB_INERRORS = 3, - UDP_MIB_OUTDATAGRAMS = 4, - UDP_MIB_RCVBUFERRORS = 5, - UDP_MIB_SNDBUFERRORS = 6, - UDP_MIB_CSUMERRORS = 7, - UDP_MIB_IGNOREDMULTI = 8, - __UDP_MIB_MAX = 9, +enum hrtimer_base_type { + HRTIMER_BASE_MONOTONIC = 0, + HRTIMER_BASE_REALTIME = 1, + HRTIMER_BASE_BOOTTIME = 2, + HRTIMER_BASE_TAI = 3, + HRTIMER_BASE_MONOTONIC_SOFT = 4, + HRTIMER_BASE_REALTIME_SOFT = 5, + HRTIMER_BASE_BOOTTIME_SOFT = 6, + HRTIMER_BASE_TAI_SOFT = 7, + HRTIMER_MAX_CLOCK_BASES = 8, }; -enum { - LINUX_MIB_NUM = 0, - LINUX_MIB_SYNCOOKIESSENT = 1, - LINUX_MIB_SYNCOOKIESRECV = 2, - LINUX_MIB_SYNCOOKIESFAILED = 3, - LINUX_MIB_EMBRYONICRSTS = 4, - LINUX_MIB_PRUNECALLED = 5, - LINUX_MIB_RCVPRUNED = 6, - LINUX_MIB_OFOPRUNED = 7, - LINUX_MIB_OUTOFWINDOWICMPS = 8, - LINUX_MIB_LOCKDROPPEDICMPS = 9, - LINUX_MIB_ARPFILTER = 10, - LINUX_MIB_TIMEWAITED = 11, - LINUX_MIB_TIMEWAITRECYCLED = 12, - LINUX_MIB_TIMEWAITKILLED = 13, - LINUX_MIB_PAWSACTIVEREJECTED = 14, - LINUX_MIB_PAWSESTABREJECTED = 15, - LINUX_MIB_DELAYEDACKS = 16, - LINUX_MIB_DELAYEDACKLOCKED = 17, - LINUX_MIB_DELAYEDACKLOST = 18, - LINUX_MIB_LISTENOVERFLOWS = 19, - LINUX_MIB_LISTENDROPS = 20, - LINUX_MIB_TCPHPHITS = 21, - LINUX_MIB_TCPPUREACKS = 22, - LINUX_MIB_TCPHPACKS = 23, - LINUX_MIB_TCPRENORECOVERY = 24, - LINUX_MIB_TCPSACKRECOVERY = 25, - LINUX_MIB_TCPSACKRENEGING = 26, - LINUX_MIB_TCPSACKREORDER = 27, - LINUX_MIB_TCPRENOREORDER = 28, - LINUX_MIB_TCPTSREORDER = 29, - LINUX_MIB_TCPFULLUNDO = 30, - LINUX_MIB_TCPPARTIALUNDO = 31, - LINUX_MIB_TCPDSACKUNDO = 32, - LINUX_MIB_TCPLOSSUNDO = 33, - LINUX_MIB_TCPLOSTRETRANSMIT = 34, - LINUX_MIB_TCPRENOFAILURES = 35, - LINUX_MIB_TCPSACKFAILURES = 36, - LINUX_MIB_TCPLOSSFAILURES = 37, - LINUX_MIB_TCPFASTRETRANS = 38, - LINUX_MIB_TCPSLOWSTARTRETRANS = 39, - LINUX_MIB_TCPTIMEOUTS = 40, - LINUX_MIB_TCPLOSSPROBES = 41, - LINUX_MIB_TCPLOSSPROBERECOVERY = 42, - LINUX_MIB_TCPRENORECOVERYFAIL = 43, - LINUX_MIB_TCPSACKRECOVERYFAIL = 44, - LINUX_MIB_TCPRCVCOLLAPSED = 45, - LINUX_MIB_TCPDSACKOLDSENT = 46, - LINUX_MIB_TCPDSACKOFOSENT = 47, - LINUX_MIB_TCPDSACKRECV = 48, - LINUX_MIB_TCPDSACKOFORECV = 49, - LINUX_MIB_TCPABORTONDATA = 50, - LINUX_MIB_TCPABORTONCLOSE = 51, - LINUX_MIB_TCPABORTONMEMORY = 52, - LINUX_MIB_TCPABORTONTIMEOUT = 53, - LINUX_MIB_TCPABORTONLINGER = 54, - LINUX_MIB_TCPABORTFAILED = 55, - LINUX_MIB_TCPMEMORYPRESSURES = 56, - LINUX_MIB_TCPMEMORYPRESSURESCHRONO = 57, - LINUX_MIB_TCPSACKDISCARD = 58, - LINUX_MIB_TCPDSACKIGNOREDOLD = 59, - LINUX_MIB_TCPDSACKIGNOREDNOUNDO = 60, - LINUX_MIB_TCPSPURIOUSRTOS = 61, - LINUX_MIB_TCPMD5NOTFOUND = 62, - LINUX_MIB_TCPMD5UNEXPECTED = 63, - LINUX_MIB_TCPMD5FAILURE = 64, - LINUX_MIB_SACKSHIFTED = 65, - LINUX_MIB_SACKMERGED = 66, - LINUX_MIB_SACKSHIFTFALLBACK = 67, - LINUX_MIB_TCPBACKLOGDROP = 68, - LINUX_MIB_PFMEMALLOCDROP = 69, - LINUX_MIB_TCPMINTTLDROP = 70, - LINUX_MIB_TCPDEFERACCEPTDROP = 71, - LINUX_MIB_IPRPFILTER = 72, - LINUX_MIB_TCPTIMEWAITOVERFLOW = 73, - LINUX_MIB_TCPREQQFULLDOCOOKIES = 74, - LINUX_MIB_TCPREQQFULLDROP = 75, - LINUX_MIB_TCPRETRANSFAIL = 76, - LINUX_MIB_TCPRCVCOALESCE = 77, - LINUX_MIB_TCPBACKLOGCOALESCE = 78, - LINUX_MIB_TCPOFOQUEUE = 79, - LINUX_MIB_TCPOFODROP = 80, - LINUX_MIB_TCPOFOMERGE = 81, - LINUX_MIB_TCPCHALLENGEACK = 82, - LINUX_MIB_TCPSYNCHALLENGE = 83, - LINUX_MIB_TCPFASTOPENACTIVE = 84, - LINUX_MIB_TCPFASTOPENACTIVEFAIL = 85, - LINUX_MIB_TCPFASTOPENPASSIVE = 86, - LINUX_MIB_TCPFASTOPENPASSIVEFAIL = 87, - LINUX_MIB_TCPFASTOPENLISTENOVERFLOW = 88, - LINUX_MIB_TCPFASTOPENCOOKIEREQD = 89, - LINUX_MIB_TCPFASTOPENBLACKHOLE = 90, - LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES = 91, - LINUX_MIB_BUSYPOLLRXPACKETS = 92, - LINUX_MIB_TCPAUTOCORKING = 93, - LINUX_MIB_TCPFROMZEROWINDOWADV = 94, - LINUX_MIB_TCPTOZEROWINDOWADV = 95, - LINUX_MIB_TCPWANTZEROWINDOWADV = 96, - LINUX_MIB_TCPSYNRETRANS = 97, - LINUX_MIB_TCPORIGDATASENT = 98, - LINUX_MIB_TCPHYSTARTTRAINDETECT = 99, - LINUX_MIB_TCPHYSTARTTRAINCWND = 100, - LINUX_MIB_TCPHYSTARTDELAYDETECT = 101, - LINUX_MIB_TCPHYSTARTDELAYCWND = 102, - LINUX_MIB_TCPACKSKIPPEDSYNRECV = 103, - LINUX_MIB_TCPACKSKIPPEDPAWS = 104, - LINUX_MIB_TCPACKSKIPPEDSEQ = 105, - LINUX_MIB_TCPACKSKIPPEDFINWAIT2 = 106, - LINUX_MIB_TCPACKSKIPPEDTIMEWAIT = 107, - LINUX_MIB_TCPACKSKIPPEDCHALLENGE = 108, - LINUX_MIB_TCPWINPROBE = 109, - LINUX_MIB_TCPKEEPALIVE = 110, - LINUX_MIB_TCPMTUPFAIL = 111, - LINUX_MIB_TCPMTUPSUCCESS = 112, - LINUX_MIB_TCPDELIVERED = 113, - LINUX_MIB_TCPDELIVEREDCE = 114, - LINUX_MIB_TCPACKCOMPRESSED = 115, - LINUX_MIB_TCPZEROWINDOWDROP = 116, - LINUX_MIB_TCPRCVQDROP = 117, - LINUX_MIB_TCPWQUEUETOOBIG = 118, - LINUX_MIB_TCPFASTOPENPASSIVEALTKEY = 119, - __LINUX_MIB_MAX = 120, +enum rseq_cs_flags_bit { + RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT_BIT = 0, + RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL_BIT = 1, + RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE_BIT = 2, }; -enum { - LINUX_MIB_XFRMNUM = 0, - LINUX_MIB_XFRMINERROR = 1, - LINUX_MIB_XFRMINBUFFERERROR = 2, - LINUX_MIB_XFRMINHDRERROR = 3, - LINUX_MIB_XFRMINNOSTATES = 4, - LINUX_MIB_XFRMINSTATEPROTOERROR = 5, - LINUX_MIB_XFRMINSTATEMODEERROR = 6, - LINUX_MIB_XFRMINSTATESEQERROR = 7, - LINUX_MIB_XFRMINSTATEEXPIRED = 8, - LINUX_MIB_XFRMINSTATEMISMATCH = 9, - LINUX_MIB_XFRMINSTATEINVALID = 10, - LINUX_MIB_XFRMINTMPLMISMATCH = 11, - LINUX_MIB_XFRMINNOPOLS = 12, - LINUX_MIB_XFRMINPOLBLOCK = 13, - LINUX_MIB_XFRMINPOLERROR = 14, - LINUX_MIB_XFRMOUTERROR = 15, - LINUX_MIB_XFRMOUTBUNDLEGENERROR = 16, - LINUX_MIB_XFRMOUTBUNDLECHECKERROR = 17, - LINUX_MIB_XFRMOUTNOSTATES = 18, - LINUX_MIB_XFRMOUTSTATEPROTOERROR = 19, - LINUX_MIB_XFRMOUTSTATEMODEERROR = 20, - LINUX_MIB_XFRMOUTSTATESEQERROR = 21, - LINUX_MIB_XFRMOUTSTATEEXPIRED = 22, - LINUX_MIB_XFRMOUTPOLBLOCK = 23, - LINUX_MIB_XFRMOUTPOLDEAD = 24, - LINUX_MIB_XFRMOUTPOLERROR = 25, - LINUX_MIB_XFRMFWDHDRERROR = 26, - LINUX_MIB_XFRMOUTSTATEINVALID = 27, - LINUX_MIB_XFRMACQUIREERROR = 28, - __LINUX_MIB_XFRMMAX = 29, -}; - -enum { - LINUX_MIB_TLSNUM = 0, - LINUX_MIB_TLSCURRTXSW = 1, - LINUX_MIB_TLSCURRRXSW = 2, - LINUX_MIB_TLSCURRTXDEVICE = 3, - LINUX_MIB_TLSCURRRXDEVICE = 4, - LINUX_MIB_TLSTXSW = 5, - LINUX_MIB_TLSRXSW = 6, - LINUX_MIB_TLSTXDEVICE = 7, - LINUX_MIB_TLSRXDEVICE = 8, - LINUX_MIB_TLSDECRYPTERROR = 9, - LINUX_MIB_TLSRXDEVICERESYNC = 10, - __LINUX_MIB_TLSMAX = 11, +enum perf_event_task_context { + perf_invalid_context = 4294967295, + perf_hw_context = 0, + perf_sw_context = 1, + perf_nr_task_contexts = 2, }; -enum nf_inet_hooks { - NF_INET_PRE_ROUTING = 0, - NF_INET_LOCAL_IN = 1, - NF_INET_FORWARD = 2, - NF_INET_LOCAL_OUT = 3, - NF_INET_POST_ROUTING = 4, - NF_INET_NUMHOOKS = 5, +enum rseq_event_mask_bits { + RSEQ_EVENT_PREEMPT_BIT = 0, + RSEQ_EVENT_SIGNAL_BIT = 1, + RSEQ_EVENT_MIGRATE_BIT = 2, }; enum { - NFPROTO_UNSPEC = 0, - NFPROTO_INET = 1, - NFPROTO_IPV4 = 2, - NFPROTO_ARP = 3, - NFPROTO_NETDEV = 5, - NFPROTO_BRIDGE = 7, - NFPROTO_IPV6 = 10, - NFPROTO_DECNET = 12, - NFPROTO_NUMPROTO = 13, + PROC_ROOT_INO = 1, + PROC_IPC_INIT_INO = 4026531839, + PROC_UTS_INIT_INO = 4026531838, + PROC_USER_INIT_INO = 4026531837, + PROC_PID_INIT_INO = 4026531836, + PROC_CGROUP_INIT_INO = 4026531835, }; -enum tcp_conntrack { - TCP_CONNTRACK_NONE = 0, - TCP_CONNTRACK_SYN_SENT = 1, - TCP_CONNTRACK_SYN_RECV = 2, - TCP_CONNTRACK_ESTABLISHED = 3, - TCP_CONNTRACK_FIN_WAIT = 4, - TCP_CONNTRACK_CLOSE_WAIT = 5, - TCP_CONNTRACK_LAST_ACK = 6, - TCP_CONNTRACK_TIME_WAIT = 7, - TCP_CONNTRACK_CLOSE = 8, - TCP_CONNTRACK_LISTEN = 9, - TCP_CONNTRACK_MAX = 10, - TCP_CONNTRACK_IGNORE = 11, - TCP_CONNTRACK_RETRANS = 12, - TCP_CONNTRACK_UNACK = 13, - TCP_CONNTRACK_TIMEOUT_MAX = 14, -}; +typedef __u16 __le16; -enum udp_conntrack { - UDP_CT_UNREPLIED = 0, - UDP_CT_REPLIED = 1, - UDP_CT_MAX = 2, -}; +typedef __u16 __be16; -enum { - XFRM_POLICY_IN = 0, - XFRM_POLICY_OUT = 1, - XFRM_POLICY_FWD = 2, - XFRM_POLICY_MASK = 3, - XFRM_POLICY_MAX = 3, -}; +typedef __u32 __be32; -enum skb_ext_id { - SKB_EXT_SEC_PATH = 0, - SKB_EXT_NUM = 1, -}; +typedef __u64 __be64; -enum audit_ntp_type { - AUDIT_NTP_OFFSET = 0, - AUDIT_NTP_FREQ = 1, - AUDIT_NTP_STATUS = 2, - AUDIT_NTP_TAI = 3, - AUDIT_NTP_TICK = 4, - AUDIT_NTP_ADJUST = 5, - AUDIT_NTP_NVALS = 6, -}; +typedef __u32 __wsum; -enum { - EI_ETYPE_NONE = 0, - EI_ETYPE_NULL = 1, - EI_ETYPE_ERRNO = 2, - EI_ETYPE_ERRNO_NULL = 3, - EI_ETYPE_TRUE = 4, -}; +typedef u64 uint64_t; -typedef long int (*sys_call_ptr_t)(const struct pt_regs *); +typedef unsigned int slab_flags_t; -struct io_bitmap { - u64 sequence; - refcount_t refcnt; - unsigned int max; - long unsigned int bitmap[1024]; +struct raw_notifier_head { + struct notifier_block *head; }; -struct seccomp_data { - int nr; - __u32 arch; - __u64 instruction_pointer; - __u64 args[6]; +struct llist_head { + struct llist_node *first; }; -struct ksignal { - struct k_sigaction ka; - kernel_siginfo_t info; - int sig; -}; +typedef struct __call_single_data call_single_data_t; -struct __large_struct { - long unsigned int buf[100]; +struct ida { + struct xarray xa; }; -enum { - TASKSTATS_CMD_UNSPEC = 0, - TASKSTATS_CMD_GET = 1, - TASKSTATS_CMD_NEW = 2, - __TASKSTATS_CMD_MAX = 3, -}; +typedef __u64 __addrpair; -enum ctx_state { - CONTEXT_DISABLED = -1, - CONTEXT_KERNEL = 0, - CONTEXT_USER = 1, - CONTEXT_GUEST = 2, -}; +typedef __u32 __portpair; -enum { - HI_SOFTIRQ = 0, - TIMER_SOFTIRQ = 1, - NET_TX_SOFTIRQ = 2, - NET_RX_SOFTIRQ = 3, - BLOCK_SOFTIRQ = 4, - IRQ_POLL_SOFTIRQ = 5, - TASKLET_SOFTIRQ = 6, - SCHED_SOFTIRQ = 7, - HRTIMER_SOFTIRQ = 8, - RCU_SOFTIRQ = 9, - NR_SOFTIRQS = 10, -}; +typedef struct { + struct net *net; +} possible_net_t; -enum cpu_usage_stat { - CPUTIME_USER = 0, - CPUTIME_NICE = 1, - CPUTIME_SYSTEM = 2, - CPUTIME_SOFTIRQ = 3, - CPUTIME_IRQ = 4, - CPUTIME_IDLE = 5, - CPUTIME_IOWAIT = 6, - CPUTIME_STEAL = 7, - CPUTIME_GUEST = 8, - CPUTIME_GUEST_NICE = 9, - NR_STATS = 10, +struct in6_addr { + union { + __u8 u6_addr8[16]; + __be16 u6_addr16[8]; + __be32 u6_addr32[4]; + } in6_u; }; -enum bpf_cgroup_storage_type { - BPF_CGROUP_STORAGE_SHARED = 0, - BPF_CGROUP_STORAGE_PERCPU = 1, - __BPF_CGROUP_STORAGE_MAX = 2, +struct hlist_nulls_node { + struct hlist_nulls_node *next; + struct hlist_nulls_node **pprev; }; -enum cgroup_subsys_id { - cpuset_cgrp_id = 0, - cpu_cgrp_id = 1, - cpuacct_cgrp_id = 2, - freezer_cgrp_id = 3, - CGROUP_SUBSYS_COUNT = 4, -}; +struct proto; -typedef u8 kprobe_opcode_t; +struct inet_timewait_death_row; -struct arch_specific_insn { - kprobe_opcode_t *insn; - bool boostable; - bool if_modifier; +struct sock_common { + union { + __addrpair skc_addrpair; + struct { + __be32 skc_daddr; + __be32 skc_rcv_saddr; + }; + }; + union { + unsigned int skc_hash; + __u16 skc_u16hashes[2]; + }; + union { + __portpair skc_portpair; + struct { + __be16 skc_dport; + __u16 skc_num; + }; + }; + short unsigned int skc_family; + volatile unsigned char skc_state; + unsigned char skc_reuse: 4; + unsigned char skc_reuseport: 1; + unsigned char skc_ipv6only: 1; + unsigned char skc_net_refcnt: 1; + int skc_bound_dev_if; + union { + struct hlist_node skc_bind_node; + struct hlist_node skc_portaddr_node; + }; + struct proto *skc_prot; + possible_net_t skc_net; + struct in6_addr skc_v6_daddr; + struct in6_addr skc_v6_rcv_saddr; + atomic64_t skc_cookie; + union { + long unsigned int skc_flags; + struct sock *skc_listener; + struct inet_timewait_death_row *skc_tw_dr; + }; + int skc_dontcopy_begin[0]; + union { + struct hlist_node skc_node; + struct hlist_nulls_node skc_nulls_node; + }; + short unsigned int skc_tx_queue_mapping; + short unsigned int skc_rx_queue_mapping; + union { + int skc_incoming_cpu; + u32 skc_rcv_wnd; + u32 skc_tw_rcv_nxt; + }; + refcount_t skc_refcnt; + int skc_dontcopy_end[0]; + union { + u32 skc_rxhash; + u32 skc_window_clamp; + u32 skc_tw_snd_nxt; + }; }; -struct kprobe; - -struct prev_kprobe { - struct kprobe *kp; - long unsigned int status; - long unsigned int old_flags; - long unsigned int saved_flags; -}; +typedef struct { + spinlock_t slock; + int owned; + wait_queue_head_t wq; +} socket_lock_t; -typedef int (*kprobe_pre_handler_t)(struct kprobe *, struct pt_regs *); +struct sk_buff; -typedef void (*kprobe_post_handler_t)(struct kprobe *, struct pt_regs *, long unsigned int); +struct sk_buff_head { + struct sk_buff *next; + struct sk_buff *prev; + __u32 qlen; + spinlock_t lock; +}; -typedef int (*kprobe_fault_handler_t)(struct kprobe *, struct pt_regs *, int); +typedef u64 netdev_features_t; -struct kprobe { - struct hlist_node hlist; - struct list_head list; - long unsigned int nmissed; - kprobe_opcode_t *addr; - const char *symbol_name; - unsigned int offset; - kprobe_pre_handler_t pre_handler; - kprobe_post_handler_t post_handler; - kprobe_fault_handler_t fault_handler; - kprobe_opcode_t opcode; - struct arch_specific_insn ainsn; - u32 flags; +struct sock_cgroup_data { + union { + struct { + u8 is_data; + u8 padding; + u16 prioidx; + u32 classid; + }; + u64 val; + }; }; -struct kprobe_ctlblk { - long unsigned int kprobe_status; - long unsigned int kprobe_old_flags; - long unsigned int kprobe_saved_flags; - struct prev_kprobe prev_kprobe; -}; +struct sk_filter; -struct kprobe_insn_cache { - struct mutex mutex; - void * (*alloc)(); - void (*free)(void *); - struct list_head pages; - size_t insn_size; - int nr_garbage; -}; +struct socket_wq; -struct trace_event_raw_sys_enter { - struct trace_entry ent; - long int id; - long unsigned int args[6]; - char __data[0]; -}; +struct xfrm_policy; -struct trace_event_raw_sys_exit { - struct trace_entry ent; - long int id; - long int ret; - char __data[0]; -}; +struct dst_entry; -struct trace_event_data_offsets_sys_enter {}; +struct socket; -struct trace_event_data_offsets_sys_exit {}; +struct sock_reuseport; -struct alt_instr { - s32 instr_offset; - s32 repl_offset; - u16 cpuid; - u8 instrlen; - u8 replacementlen; - u8 padlen; -} __attribute__((packed)); +struct bpf_sk_storage; -enum vm_fault_reason { - VM_FAULT_OOM = 1, - VM_FAULT_SIGBUS = 2, - VM_FAULT_MAJOR = 4, - VM_FAULT_WRITE = 8, - VM_FAULT_HWPOISON = 16, - VM_FAULT_HWPOISON_LARGE = 32, - VM_FAULT_SIGSEGV = 64, - VM_FAULT_NOPAGE = 256, - VM_FAULT_LOCKED = 512, - VM_FAULT_RETRY = 1024, - VM_FAULT_FALLBACK = 2048, - VM_FAULT_DONE_COW = 4096, - VM_FAULT_NEEDDSYNC = 8192, - VM_FAULT_HINDEX_MASK = 983040, +struct sock { + struct sock_common __sk_common; + socket_lock_t sk_lock; + atomic_t sk_drops; + int sk_rcvlowat; + struct sk_buff_head sk_error_queue; + struct sk_buff *sk_rx_skb_cache; + struct sk_buff_head sk_receive_queue; + struct { + atomic_t rmem_alloc; + int len; + struct sk_buff *head; + struct sk_buff *tail; + } sk_backlog; + int sk_forward_alloc; + unsigned int sk_ll_usec; + unsigned int sk_napi_id; + int sk_rcvbuf; + struct sk_filter *sk_filter; + union { + struct socket_wq *sk_wq; + struct socket_wq *sk_wq_raw; + }; + struct xfrm_policy *sk_policy[2]; + struct dst_entry *sk_rx_dst; + struct dst_entry *sk_dst_cache; + atomic_t sk_omem_alloc; + int sk_sndbuf; + int sk_wmem_queued; + refcount_t sk_wmem_alloc; + long unsigned int sk_tsq_flags; + union { + struct sk_buff *sk_send_head; + struct rb_root tcp_rtx_queue; + }; + struct sk_buff *sk_tx_skb_cache; + struct sk_buff_head sk_write_queue; + __s32 sk_peek_off; + int sk_write_pending; + __u32 sk_dst_pending_confirm; + u32 sk_pacing_status; + long int sk_sndtimeo; + struct timer_list sk_timer; + __u32 sk_priority; + __u32 sk_mark; + long unsigned int sk_pacing_rate; + long unsigned int sk_max_pacing_rate; + struct page_frag sk_frag; + netdev_features_t sk_route_caps; + netdev_features_t sk_route_nocaps; + netdev_features_t sk_route_forced_caps; + int sk_gso_type; + unsigned int sk_gso_max_size; + gfp_t sk_allocation; + __u32 sk_txhash; + unsigned int __sk_flags_offset[0]; + unsigned int sk_padding: 1; + unsigned int sk_kern_sock: 1; + unsigned int sk_no_check_tx: 1; + unsigned int sk_no_check_rx: 1; + unsigned int sk_userlocks: 4; + unsigned int sk_protocol: 8; + unsigned int sk_type: 16; + u16 sk_gso_max_segs; + u8 sk_pacing_shift; + long unsigned int sk_lingertime; + struct proto *sk_prot_creator; + rwlock_t sk_callback_lock; + int sk_err; + int sk_err_soft; + u32 sk_ack_backlog; + u32 sk_max_ack_backlog; + kuid_t sk_uid; + struct pid *sk_peer_pid; + const struct cred *sk_peer_cred; + long int sk_rcvtimeo; + ktime_t sk_stamp; + u16 sk_tsflags; + u8 sk_shutdown; + u32 sk_tskey; + atomic_t sk_zckey; + u8 sk_clockid; + u8 sk_txtime_deadline_mode: 1; + u8 sk_txtime_report_errors: 1; + u8 sk_txtime_unused: 6; + struct socket *sk_socket; + void *sk_user_data; + void *sk_security; + struct sock_cgroup_data sk_cgrp_data; + struct mem_cgroup *sk_memcg; + void (*sk_state_change)(struct sock *); + void (*sk_data_ready)(struct sock *); + void (*sk_write_space)(struct sock *); + void (*sk_error_report)(struct sock *); + int (*sk_backlog_rcv)(struct sock *, struct sk_buff *); + void (*sk_destruct)(struct sock *); + struct sock_reuseport *sk_reuseport_cb; + struct bpf_sk_storage *sk_bpf_storage; + struct callback_head sk_rcu; }; -struct vm_special_mapping { - const char *name; - struct page **pages; - vm_fault_t (*fault)(const struct vm_special_mapping *, struct vm_area_struct *, struct vm_fault *); - int (*mremap)(const struct vm_special_mapping *, struct vm_area_struct *); +struct rhash_head { + struct rhash_head *next; }; -struct pvclock_vcpu_time_info { - u32 version; - u32 pad0; - u64 tsc_timestamp; - u64 system_time; - u32 tsc_to_system_mul; - s8 tsc_shift; - u8 flags; - u8 pad[2]; -}; +struct rhashtable; -struct pvclock_vsyscall_time_info { - struct pvclock_vcpu_time_info pvti; - long: 64; - long: 64; - long: 64; - long: 64; +struct rhashtable_compare_arg { + struct rhashtable *ht; + const void *key; }; -struct ms_hyperv_tsc_page { - volatile u32 tsc_sequence; - u32 reserved1; - volatile u64 tsc_scale; - volatile s64 tsc_offset; - u64 reserved2[509]; -}; +typedef u32 (*rht_hashfn_t)(const void *, u32, u32); -enum { - X86_TRAP_DE = 0, - X86_TRAP_DB = 1, - X86_TRAP_NMI = 2, - X86_TRAP_BP = 3, - X86_TRAP_OF = 4, - X86_TRAP_BR = 5, - X86_TRAP_UD = 6, - X86_TRAP_NM = 7, - X86_TRAP_DF = 8, - X86_TRAP_OLD_MF = 9, - X86_TRAP_TS = 10, - X86_TRAP_NP = 11, - X86_TRAP_SS = 12, - X86_TRAP_GP = 13, - X86_TRAP_PF = 14, - X86_TRAP_SPURIOUS = 15, - X86_TRAP_MF = 16, - X86_TRAP_AC = 17, - X86_TRAP_MC = 18, - X86_TRAP_XF = 19, - X86_TRAP_IRET = 32, -}; +typedef u32 (*rht_obj_hashfn_t)(const void *, u32, u32); -enum x86_pf_error_code { - X86_PF_PROT = 1, - X86_PF_WRITE = 2, - X86_PF_USER = 4, - X86_PF_RSVD = 8, - X86_PF_INSTR = 16, - X86_PF_PK = 32, +typedef int (*rht_obj_cmpfn_t)(struct rhashtable_compare_arg *, const void *); + +struct rhashtable_params { + u16 nelem_hint; + u16 key_len; + u16 key_offset; + u16 head_offset; + unsigned int max_size; + u16 min_size; + bool automatic_shrinking; + rht_hashfn_t hashfn; + rht_obj_hashfn_t obj_hashfn; + rht_obj_cmpfn_t obj_cmpfn; }; -struct trace_event_raw_emulate_vsyscall { - struct trace_entry ent; - int nr; - char __data[0]; +struct bucket_table; + +struct rhashtable { + struct bucket_table *tbl; + unsigned int key_len; + unsigned int max_elems; + struct rhashtable_params p; + bool rhlist; + struct work_struct run_work; + struct mutex mutex; + spinlock_t lock; + atomic_t nelems; }; -struct trace_event_data_offsets_emulate_vsyscall {}; +struct rhash_lock_head; -enum { - EMULATE = 0, - XONLY = 1, - NONE = 2, +struct bucket_table { + unsigned int size; + unsigned int nest; + u32 hash_rnd; + struct list_head walkers; + struct callback_head rcu; + struct bucket_table *future_tbl; + struct lockdep_map dep_map; + long: 64; + struct rhash_lock_head *buckets[0]; }; -enum perf_type_id { - PERF_TYPE_HARDWARE = 0, - PERF_TYPE_SOFTWARE = 1, - PERF_TYPE_TRACEPOINT = 2, - PERF_TYPE_HW_CACHE = 3, - PERF_TYPE_RAW = 4, - PERF_TYPE_BREAKPOINT = 5, - PERF_TYPE_MAX = 6, +struct fs_struct { + int users; + spinlock_t lock; + seqcount_t seq; + int umask; + int in_exec; + struct path root; + struct path pwd; }; -enum perf_hw_id { - PERF_COUNT_HW_CPU_CYCLES = 0, - PERF_COUNT_HW_INSTRUCTIONS = 1, - PERF_COUNT_HW_CACHE_REFERENCES = 2, - PERF_COUNT_HW_CACHE_MISSES = 3, - PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4, - PERF_COUNT_HW_BRANCH_MISSES = 5, - PERF_COUNT_HW_BUS_CYCLES = 6, - PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 7, - PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 8, - PERF_COUNT_HW_REF_CPU_CYCLES = 9, - PERF_COUNT_HW_MAX = 10, +typedef u32 compat_uptr_t; + +struct compat_robust_list { + compat_uptr_t next; }; -enum perf_hw_cache_id { - PERF_COUNT_HW_CACHE_L1D = 0, - PERF_COUNT_HW_CACHE_L1I = 1, - PERF_COUNT_HW_CACHE_LL = 2, - PERF_COUNT_HW_CACHE_DTLB = 3, - PERF_COUNT_HW_CACHE_ITLB = 4, - PERF_COUNT_HW_CACHE_BPU = 5, - PERF_COUNT_HW_CACHE_NODE = 6, - PERF_COUNT_HW_CACHE_MAX = 7, +typedef s32 compat_long_t; + +struct compat_robust_list_head { + struct compat_robust_list list; + compat_long_t futex_offset; + compat_uptr_t list_op_pending; }; -enum perf_hw_cache_op_id { - PERF_COUNT_HW_CACHE_OP_READ = 0, - PERF_COUNT_HW_CACHE_OP_WRITE = 1, - PERF_COUNT_HW_CACHE_OP_PREFETCH = 2, - PERF_COUNT_HW_CACHE_OP_MAX = 3, +struct pipe_buffer; + +struct pipe_inode_info { + struct mutex mutex; + wait_queue_head_t wait; + unsigned int head; + unsigned int tail; + unsigned int max_usage; + unsigned int ring_size; + unsigned int readers; + unsigned int writers; + unsigned int files; + unsigned int r_counter; + unsigned int w_counter; + struct page *tmp_page; + struct fasync_struct *fasync_readers; + struct fasync_struct *fasync_writers; + struct pipe_buffer *bufs; + struct user_struct *user; }; -enum perf_hw_cache_op_result_id { - PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0, - PERF_COUNT_HW_CACHE_RESULT_MISS = 1, - PERF_COUNT_HW_CACHE_RESULT_MAX = 2, +struct scatterlist { + long unsigned int page_link; + unsigned int offset; + unsigned int length; + dma_addr_t dma_address; + unsigned int dma_length; }; -enum perf_event_sample_format { - PERF_SAMPLE_IP = 1, - PERF_SAMPLE_TID = 2, - PERF_SAMPLE_TIME = 4, - PERF_SAMPLE_ADDR = 8, - PERF_SAMPLE_READ = 16, - PERF_SAMPLE_CALLCHAIN = 32, - PERF_SAMPLE_ID = 64, - PERF_SAMPLE_CPU = 128, - PERF_SAMPLE_PERIOD = 256, - PERF_SAMPLE_STREAM_ID = 512, - PERF_SAMPLE_RAW = 1024, - PERF_SAMPLE_BRANCH_STACK = 2048, - PERF_SAMPLE_REGS_USER = 4096, - PERF_SAMPLE_STACK_USER = 8192, - PERF_SAMPLE_WEIGHT = 16384, - PERF_SAMPLE_DATA_SRC = 32768, - PERF_SAMPLE_IDENTIFIER = 65536, - PERF_SAMPLE_TRANSACTION = 131072, - PERF_SAMPLE_REGS_INTR = 262144, - PERF_SAMPLE_PHYS_ADDR = 524288, - PERF_SAMPLE_AUX = 1048576, - PERF_SAMPLE_MAX = 2097152, - __PERF_SAMPLE_CALLCHAIN_EARLY = -1, +struct iovec { + void *iov_base; + __kernel_size_t iov_len; }; -enum perf_branch_sample_type { - PERF_SAMPLE_BRANCH_USER = 1, - PERF_SAMPLE_BRANCH_KERNEL = 2, - PERF_SAMPLE_BRANCH_HV = 4, - PERF_SAMPLE_BRANCH_ANY = 8, - PERF_SAMPLE_BRANCH_ANY_CALL = 16, - PERF_SAMPLE_BRANCH_ANY_RETURN = 32, - PERF_SAMPLE_BRANCH_IND_CALL = 64, - PERF_SAMPLE_BRANCH_ABORT_TX = 128, - PERF_SAMPLE_BRANCH_IN_TX = 256, - PERF_SAMPLE_BRANCH_NO_TX = 512, - PERF_SAMPLE_BRANCH_COND = 1024, - PERF_SAMPLE_BRANCH_CALL_STACK = 2048, - PERF_SAMPLE_BRANCH_IND_JUMP = 4096, - PERF_SAMPLE_BRANCH_CALL = 8192, - PERF_SAMPLE_BRANCH_NO_FLAGS = 16384, - PERF_SAMPLE_BRANCH_NO_CYCLES = 32768, - PERF_SAMPLE_BRANCH_TYPE_SAVE = 65536, - PERF_SAMPLE_BRANCH_MAX = 131072, +struct kvec { + void *iov_base; + size_t iov_len; }; -struct perf_event_mmap_page { - __u32 version; - __u32 compat_version; - __u32 lock; - __u32 index; - __s64 offset; - __u64 time_enabled; - __u64 time_running; +struct iov_iter { + unsigned int type; + size_t iov_offset; + size_t count; union { - __u64 capabilities; + const struct iovec *iov; + const struct kvec *kvec; + const struct bio_vec *bvec; + struct pipe_inode_info *pipe; + }; + union { + long unsigned int nr_segs; struct { - __u64 cap_bit0: 1; - __u64 cap_bit0_is_deprecated: 1; - __u64 cap_user_rdpmc: 1; - __u64 cap_user_time: 1; - __u64 cap_user_time_zero: 1; - __u64 cap_____res: 59; + unsigned int head; + unsigned int start_head; }; }; - __u16 pmc_width; - __u16 time_shift; - __u32 time_mult; - __u64 time_offset; - __u64 time_zero; - __u32 size; - __u8 __reserved[948]; - __u64 data_head; - __u64 data_tail; - __u64 data_offset; - __u64 data_size; - __u64 aux_head; - __u64 aux_tail; - __u64 aux_offset; - __u64 aux_size; }; -struct ldt_struct { - struct desc_struct *entries; - unsigned int nr_entries; - int slot; +typedef short unsigned int __kernel_sa_family_t; + +struct __kernel_sockaddr_storage { + union { + struct { + __kernel_sa_family_t ss_family; + char __data[126]; + }; + void *__align; + }; +}; + +typedef __kernel_sa_family_t sa_family_t; + +struct sockaddr { + sa_family_t sa_family; + char sa_data[14]; +}; + +struct msghdr { + void *msg_name; + int msg_namelen; + struct iov_iter msg_iter; + void *msg_control; + __kernel_size_t msg_controllen; + unsigned int msg_flags; + struct kiocb *msg_iocb; }; typedef struct { - u16 __softirq_pending; - unsigned int __nmi_count; - unsigned int apic_timer_irqs; - unsigned int irq_spurious_count; - unsigned int icr_read_retry_count; - unsigned int kvm_posted_intr_ipis; - unsigned int kvm_posted_intr_wakeup_ipis; - unsigned int kvm_posted_intr_nested_ipis; - unsigned int x86_platform_ipis; - unsigned int apic_perf_irqs; - unsigned int apic_irq_work_irqs; - unsigned int irq_resched_count; - unsigned int irq_call_count; - unsigned int irq_tlb_count; - unsigned int irq_thermal_count; - unsigned int irq_threshold_count; - unsigned int irq_deferred_error_count; - long: 32; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; -} irq_cpustat_t; + unsigned int clock_rate; + unsigned int clock_type; + short unsigned int loopback; +} sync_serial_settings; -struct x86_pmu_capability { - int version; - int num_counters_gp; - int num_counters_fixed; - int bit_width_gp; - int bit_width_fixed; - unsigned int events_mask; - int events_mask_len; +typedef struct { + unsigned int clock_rate; + unsigned int clock_type; + short unsigned int loopback; + unsigned int slot_map; +} te1_settings; + +typedef struct { + short unsigned int encoding; + short unsigned int parity; +} raw_hdlc_proto; + +typedef struct { + unsigned int t391; + unsigned int t392; + unsigned int n391; + unsigned int n392; + unsigned int n393; + short unsigned int lmi; + short unsigned int dce; +} fr_proto; + +typedef struct { + unsigned int dlci; +} fr_proto_pvc; + +typedef struct { + unsigned int dlci; + char master[16]; +} fr_proto_pvc_info; + +typedef struct { + unsigned int interval; + unsigned int timeout; +} cisco_proto; + +struct ifmap { + long unsigned int mem_start; + long unsigned int mem_end; + short unsigned int base_addr; + unsigned char irq; + unsigned char dma; + unsigned char port; }; -struct debug_store { - u64 bts_buffer_base; - u64 bts_index; - u64 bts_absolute_maximum; - u64 bts_interrupt_threshold; - u64 pebs_buffer_base; - u64 pebs_index; - u64 pebs_absolute_maximum; - u64 pebs_interrupt_threshold; - u64 pebs_event_reset[12]; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct if_settings { + unsigned int type; + unsigned int size; + union { + raw_hdlc_proto *raw_hdlc; + cisco_proto *cisco; + fr_proto *fr; + fr_proto_pvc *fr_pvc; + fr_proto_pvc_info *fr_pvc_info; + sync_serial_settings *sync; + te1_settings *te1; + } ifs_ifsu; }; -enum stack_type { - STACK_TYPE_UNKNOWN = 0, - STACK_TYPE_TASK = 1, - STACK_TYPE_IRQ = 2, - STACK_TYPE_SOFTIRQ = 3, - STACK_TYPE_ENTRY = 4, - STACK_TYPE_EXCEPTION = 5, - STACK_TYPE_EXCEPTION_LAST = 10, +struct ifreq { + union { + char ifrn_name[16]; + } ifr_ifrn; + union { + struct sockaddr ifru_addr; + struct sockaddr ifru_dstaddr; + struct sockaddr ifru_broadaddr; + struct sockaddr ifru_netmask; + struct sockaddr ifru_hwaddr; + short int ifru_flags; + int ifru_ivalue; + int ifru_mtu; + struct ifmap ifru_map; + char ifru_slave[16]; + char ifru_newname[16]; + void *ifru_data; + struct if_settings ifru_settings; + } ifr_ifru; }; -struct stack_info { - enum stack_type type; - long unsigned int *begin; - long unsigned int *end; - long unsigned int *next_sp; +struct vfsmount { + struct dentry *mnt_root; + struct super_block *mnt_sb; + int mnt_flags; }; -struct stack_frame { - struct stack_frame *next_frame; - long unsigned int return_address; -}; +typedef struct { + size_t written; + size_t count; + union { + char *buf; + void *data; + } arg; + int error; +} read_descriptor_t; -struct stack_frame_ia32 { - u32 next_frame; - u32 return_address; +struct posix_acl_entry { + short int e_tag; + short unsigned int e_perm; + union { + kuid_t e_uid; + kgid_t e_gid; + }; }; -struct perf_guest_switch_msr { - unsigned int msr; - u64 host; - u64 guest; +struct posix_acl { + refcount_t a_refcount; + struct callback_head a_rcu; + unsigned int a_count; + struct posix_acl_entry a_entries[0]; }; -struct perf_guest_info_callbacks { - int (*is_in_guest)(); - int (*is_user_mode)(); - long unsigned int (*get_guest_ip)(); - void (*handle_intel_pt_intr)(); -}; +typedef unsigned char cc_t; -struct device_attribute { - struct attribute attr; - ssize_t (*show)(struct device *, struct device_attribute *, char *); - ssize_t (*store)(struct device *, struct device_attribute *, const char *, size_t); -}; +typedef unsigned int speed_t; -enum perf_event_x86_regs { - PERF_REG_X86_AX = 0, - PERF_REG_X86_BX = 1, - PERF_REG_X86_CX = 2, - PERF_REG_X86_DX = 3, - PERF_REG_X86_SI = 4, - PERF_REG_X86_DI = 5, - PERF_REG_X86_BP = 6, - PERF_REG_X86_SP = 7, - PERF_REG_X86_IP = 8, - PERF_REG_X86_FLAGS = 9, - PERF_REG_X86_CS = 10, - PERF_REG_X86_SS = 11, - PERF_REG_X86_DS = 12, - PERF_REG_X86_ES = 13, - PERF_REG_X86_FS = 14, - PERF_REG_X86_GS = 15, - PERF_REG_X86_R8 = 16, - PERF_REG_X86_R9 = 17, - PERF_REG_X86_R10 = 18, - PERF_REG_X86_R11 = 19, - PERF_REG_X86_R12 = 20, - PERF_REG_X86_R13 = 21, - PERF_REG_X86_R14 = 22, - PERF_REG_X86_R15 = 23, - PERF_REG_X86_32_MAX = 16, - PERF_REG_X86_64_MAX = 24, - PERF_REG_X86_XMM0 = 32, - PERF_REG_X86_XMM1 = 34, - PERF_REG_X86_XMM2 = 36, - PERF_REG_X86_XMM3 = 38, - PERF_REG_X86_XMM4 = 40, - PERF_REG_X86_XMM5 = 42, - PERF_REG_X86_XMM6 = 44, - PERF_REG_X86_XMM7 = 46, - PERF_REG_X86_XMM8 = 48, - PERF_REG_X86_XMM9 = 50, - PERF_REG_X86_XMM10 = 52, - PERF_REG_X86_XMM11 = 54, - PERF_REG_X86_XMM12 = 56, - PERF_REG_X86_XMM13 = 58, - PERF_REG_X86_XMM14 = 60, - PERF_REG_X86_XMM15 = 62, - PERF_REG_X86_XMM_MAX = 64, -}; +typedef unsigned int tcflag_t; -struct perf_callchain_entry_ctx { - struct perf_callchain_entry *entry; - u32 max_stack; - u32 nr; - short int contexts; - bool contexts_maxed; +struct ktermios { + tcflag_t c_iflag; + tcflag_t c_oflag; + tcflag_t c_cflag; + tcflag_t c_lflag; + cc_t c_line; + cc_t c_cc[19]; + speed_t c_ispeed; + speed_t c_ospeed; }; -struct perf_pmu_events_attr { - struct device_attribute attr; - u64 id; - const char *event_str; +struct winsize { + short unsigned int ws_row; + short unsigned int ws_col; + short unsigned int ws_xpixel; + short unsigned int ws_ypixel; }; -struct perf_pmu_events_ht_attr { - struct device_attribute attr; - u64 id; - const char *event_str_ht; - const char *event_str_noht; +struct termiox { + __u16 x_hflag; + __u16 x_cflag; + __u16 x_rflag[5]; + __u16 x_sflag; }; -enum { - NMI_LOCAL = 0, - NMI_UNKNOWN = 1, - NMI_SERR = 2, - NMI_IO_CHECK = 3, - NMI_MAX = 4, -}; +struct serial_icounter_struct; -typedef int (*nmi_handler_t)(unsigned int, struct pt_regs *); +struct serial_struct; -struct nmiaction { - struct list_head list; - nmi_handler_t handler; - u64 max_duration; - struct irq_work irq_work; - long unsigned int flags; - const char *name; +struct tty_operations { + struct tty_struct * (*lookup)(struct tty_driver *, struct file *, int); + int (*install)(struct tty_driver *, struct tty_struct *); + void (*remove)(struct tty_driver *, struct tty_struct *); + int (*open)(struct tty_struct *, struct file *); + void (*close)(struct tty_struct *, struct file *); + void (*shutdown)(struct tty_struct *); + void (*cleanup)(struct tty_struct *); + int (*write)(struct tty_struct *, const unsigned char *, int); + int (*put_char)(struct tty_struct *, unsigned char); + void (*flush_chars)(struct tty_struct *); + int (*write_room)(struct tty_struct *); + int (*chars_in_buffer)(struct tty_struct *); + int (*ioctl)(struct tty_struct *, unsigned int, long unsigned int); + long int (*compat_ioctl)(struct tty_struct *, unsigned int, long unsigned int); + void (*set_termios)(struct tty_struct *, struct ktermios *); + void (*throttle)(struct tty_struct *); + void (*unthrottle)(struct tty_struct *); + void (*stop)(struct tty_struct *); + void (*start)(struct tty_struct *); + void (*hangup)(struct tty_struct *); + int (*break_ctl)(struct tty_struct *, int); + void (*flush_buffer)(struct tty_struct *); + void (*set_ldisc)(struct tty_struct *); + void (*wait_until_sent)(struct tty_struct *, int); + void (*send_xchar)(struct tty_struct *, char); + int (*tiocmget)(struct tty_struct *); + int (*tiocmset)(struct tty_struct *, unsigned int, unsigned int); + int (*resize)(struct tty_struct *, struct winsize *); + int (*set_termiox)(struct tty_struct *, struct termiox *); + int (*get_icount)(struct tty_struct *, struct serial_icounter_struct *); + int (*get_serial)(struct tty_struct *, struct serial_struct *); + int (*set_serial)(struct tty_struct *, struct serial_struct *); + void (*show_fdinfo)(struct tty_struct *, struct seq_file *); + int (*proc_show)(struct seq_file *, void *); }; -struct cyc2ns_data { - u32 cyc2ns_mul; - u32 cyc2ns_shift; - u64 cyc2ns_offset; +struct ld_semaphore { + atomic_long_t count; + raw_spinlock_t wait_lock; + unsigned int wait_readers; + struct list_head read_wait; + struct list_head write_wait; }; -struct unwind_state { - struct stack_info stack_info; - long unsigned int stack_mask; - struct task_struct *task; - int graph_idx; - bool error; - bool signal; - bool full_regs; - long unsigned int sp; - long unsigned int bp; - long unsigned int ip; - struct pt_regs *regs; +struct tty_ldisc; + +struct tty_port; + +struct tty_struct { + int magic; + struct kref kref; + struct device *dev; + struct tty_driver *driver; + const struct tty_operations *ops; + int index; + struct ld_semaphore ldisc_sem; + struct tty_ldisc *ldisc; + struct mutex atomic_write_lock; + struct mutex legacy_mutex; + struct mutex throttle_mutex; + struct rw_semaphore termios_rwsem; + struct mutex winsize_mutex; + spinlock_t ctrl_lock; + spinlock_t flow_lock; + struct ktermios termios; + struct ktermios termios_locked; + struct termiox *termiox; + char name[64]; + struct pid *pgrp; + struct pid *session; + long unsigned int flags; + int count; + struct winsize winsize; + long unsigned int stopped: 1; + long unsigned int flow_stopped: 1; + int: 30; + long unsigned int unused: 62; + int hw_stopped; + long unsigned int ctrl_status: 8; + long unsigned int packet: 1; + int: 23; + long unsigned int unused_ctrl: 55; + unsigned int receive_room; + int flow_change; + struct tty_struct *link; + struct fasync_struct *fasync; + wait_queue_head_t write_wait; + wait_queue_head_t read_wait; + struct work_struct hangup_work; + void *disc_data; + void *driver_data; + spinlock_t files_lock; + struct list_head tty_files; + int closing; + unsigned char *write_buf; + int write_cnt; + struct work_struct SAK_work; + struct tty_port *port; }; -enum extra_reg_type { - EXTRA_REG_NONE = -1, - EXTRA_REG_RSP_0 = 0, - EXTRA_REG_RSP_1 = 1, - EXTRA_REG_LBR = 2, - EXTRA_REG_LDLAT = 3, - EXTRA_REG_FE = 4, - EXTRA_REG_MAX = 5, +struct proc_dir_entry; + +struct tty_driver { + int magic; + struct kref kref; + struct cdev **cdevs; + struct module *owner; + const char *driver_name; + const char *name; + int name_base; + int major; + int minor_start; + unsigned int num; + short int type; + short int subtype; + struct ktermios init_termios; + long unsigned int flags; + struct proc_dir_entry *proc_entry; + struct tty_driver *other; + struct tty_struct **ttys; + struct tty_port **ports; + struct ktermios **termios; + void *driver_state; + const struct tty_operations *ops; + struct list_head tty_drivers; }; -struct event_constraint { +struct tty_buffer { union { - long unsigned int idxmsk[1]; - u64 idxmsk64; + struct tty_buffer *next; + struct llist_node free; }; - u64 code; - u64 cmask; - int weight; - int overlap; + int used; + int size; + int commit; + int read; int flags; - unsigned int size; + long unsigned int data[0]; }; -struct amd_nb { - int nb_id; - int refcnt; - struct perf_event *owners[64]; - struct event_constraint event_constraints[64]; +struct tty_bufhead { + struct tty_buffer *head; + struct work_struct work; + struct mutex lock; + atomic_t priority; + struct tty_buffer sentinel; + struct llist_head free; + atomic_t mem_used; + int mem_limit; + struct tty_buffer *tail; }; -struct er_account { - raw_spinlock_t lock; - u64 config; - u64 reg; - atomic_t ref; -}; +struct tty_port_operations; -struct intel_shared_regs { - struct er_account regs[5]; - int refcnt; - unsigned int core_id; +struct tty_port_client_operations; + +struct tty_port { + struct tty_bufhead buf; + struct tty_struct *tty; + struct tty_struct *itty; + const struct tty_port_operations *ops; + const struct tty_port_client_operations *client_ops; + spinlock_t lock; + int blocked_open; + int count; + wait_queue_head_t open_wait; + wait_queue_head_t delta_msr_wait; + long unsigned int flags; + long unsigned int iflags; + unsigned char console: 1; + unsigned char low_latency: 1; + struct mutex mutex; + struct mutex buf_mutex; + unsigned char *xmit_buf; + unsigned int close_delay; + unsigned int closing_wait; + int drain_delay; + struct kref kref; + void *client_data; }; -enum intel_excl_state_type { - INTEL_EXCL_UNUSED = 0, - INTEL_EXCL_SHARED = 1, - INTEL_EXCL_EXCLUSIVE = 2, +struct tty_ldisc_ops { + int magic; + char *name; + int num; + int flags; + int (*open)(struct tty_struct *); + void (*close)(struct tty_struct *); + void (*flush_buffer)(struct tty_struct *); + ssize_t (*read)(struct tty_struct *, struct file *, unsigned char *, size_t); + ssize_t (*write)(struct tty_struct *, struct file *, const unsigned char *, size_t); + int (*ioctl)(struct tty_struct *, struct file *, unsigned int, long unsigned int); + int (*compat_ioctl)(struct tty_struct *, struct file *, unsigned int, long unsigned int); + void (*set_termios)(struct tty_struct *, struct ktermios *); + __poll_t (*poll)(struct tty_struct *, struct file *, struct poll_table_struct *); + int (*hangup)(struct tty_struct *); + void (*receive_buf)(struct tty_struct *, const unsigned char *, char *, int); + void (*write_wakeup)(struct tty_struct *); + void (*dcd_change)(struct tty_struct *, unsigned int); + int (*receive_buf2)(struct tty_struct *, const unsigned char *, char *, int); + struct module *owner; + int refcount; }; -struct intel_excl_states { - enum intel_excl_state_type state[64]; - bool sched_started; +struct tty_ldisc { + struct tty_ldisc_ops *ops; + struct tty_struct *tty; }; -struct intel_excl_cntrs { - raw_spinlock_t lock; - struct intel_excl_states states[2]; - union { - u16 has_exclusive[2]; - u32 exclusive_present; - }; - int refcnt; - unsigned int core_id; +struct tty_port_operations { + int (*carrier_raised)(struct tty_port *); + void (*dtr_rts)(struct tty_port *, int); + void (*shutdown)(struct tty_port *); + int (*activate)(struct tty_port *, struct tty_struct *); + void (*destruct)(struct tty_port *); }; -enum { - X86_PERF_KFREE_SHARED = 0, - X86_PERF_KFREE_EXCL = 1, - X86_PERF_KFREE_MAX = 2, +struct tty_port_client_operations { + int (*receive_buf)(struct tty_port *, const unsigned char *, const unsigned char *, size_t); + void (*write_wakeup)(struct tty_port *); }; -struct x86_perf_task_context; +struct prot_inuse; -struct cpu_hw_events { - struct perf_event *events[64]; - long unsigned int active_mask[1]; - long unsigned int running[1]; - int enabled; - int n_events; - int n_added; - int n_txn; - int assign[64]; - u64 tags[64]; - struct perf_event *event_list[64]; - struct event_constraint *event_constraint[64]; - int n_excl; - unsigned int txn_flags; - int is_fake; - struct debug_store *ds; - void *ds_pebs_vaddr; - void *ds_bts_vaddr; - u64 pebs_enabled; - int n_pebs; - int n_large_pebs; - int n_pebs_via_pt; - int pebs_output; - u64 pebs_data_cfg; - u64 active_pebs_data_cfg; - int pebs_record_size; - int lbr_users; - int lbr_pebs_users; - struct perf_branch_stack lbr_stack; - struct perf_branch_entry lbr_entries[32]; - struct er_account *lbr_sel; - u64 br_sel; - struct x86_perf_task_context *last_task_ctx; - int last_log_id; - u64 intel_ctrl_guest_mask; - u64 intel_ctrl_host_mask; - struct perf_guest_switch_msr guest_switch_msrs[64]; - u64 intel_cp_status; - struct intel_shared_regs *shared_regs; - struct event_constraint *constraint_list; - struct intel_excl_cntrs *excl_cntrs; - int excl_thread_id; - u64 tfa_shadow; - struct amd_nb *amd_nb; - u64 perf_ctr_virt_mask; - void *kfree_on_online[2]; +struct netns_core { + struct ctl_table_header *sysctl_hdr; + int sysctl_somaxconn; + int *sock_inuse; + struct prot_inuse *prot_inuse; }; -struct x86_perf_task_context { - u64 lbr_from[32]; - u64 lbr_to[32]; - u64 lbr_info[32]; - int tos; - int valid_lbrs; - int lbr_callstack_users; - int lbr_stack_state; - int log_id; -}; +struct tcp_mib; -struct extra_reg { - unsigned int event; - unsigned int msr; - u64 config_mask; - u64 valid_mask; - int idx; - bool extra_msr_access; +struct ipstats_mib; + +struct linux_mib; + +struct udp_mib; + +struct icmp_mib; + +struct icmpmsg_mib; + +struct icmpv6_mib; + +struct icmpv6msg_mib; + +struct netns_mib { + struct tcp_mib *tcp_statistics; + struct ipstats_mib *ip_statistics; + struct linux_mib *net_statistics; + struct udp_mib *udp_statistics; + struct udp_mib *udplite_statistics; + struct icmp_mib *icmp_statistics; + struct icmpmsg_mib *icmpmsg_statistics; + struct proc_dir_entry *proc_net_devsnmp6; + struct udp_mib *udp_stats_in6; + struct udp_mib *udplite_stats_in6; + struct ipstats_mib *ipv6_statistics; + struct icmpv6_mib *icmpv6_statistics; + struct icmpv6msg_mib *icmpv6msg_statistics; }; -union perf_capabilities { - struct { - u64 lbr_format: 6; - u64 pebs_trap: 1; - u64 pebs_arch_reg: 1; - u64 pebs_format: 4; - u64 smm_freeze: 1; - u64 full_width_write: 1; - u64 pebs_baseline: 1; - u64 pebs_metrics_available: 1; - u64 pebs_output_pt_available: 1; - }; - u64 capabilities; +struct netns_packet { + struct mutex sklist_lock; + struct hlist_head sklist; }; -struct x86_pmu_quirk { - struct x86_pmu_quirk *next; - void (*func)(); +struct netns_unix { + int sysctl_max_dgram_qlen; + struct ctl_table_header *ctl; }; -enum { - x86_lbr_exclusive_lbr = 0, - x86_lbr_exclusive_bts = 1, - x86_lbr_exclusive_pt = 2, - x86_lbr_exclusive_max = 3, +struct netns_nexthop { + struct rb_root rb_root; + struct hlist_head *devhash; + unsigned int seq; + u32 last_id_allocated; }; -struct x86_pmu { - const char *name; - int version; - int (*handle_irq)(struct pt_regs *); - void (*disable_all)(); - void (*enable_all)(int); - void (*enable)(struct perf_event *); - void (*disable)(struct perf_event *); - void (*add)(struct perf_event *); - void (*del)(struct perf_event *); - void (*read)(struct perf_event *); - int (*hw_config)(struct perf_event *); - int (*schedule_events)(struct cpu_hw_events *, int, int *); - unsigned int eventsel; - unsigned int perfctr; - int (*addr_offset)(int, bool); - int (*rdpmc_index)(int); - u64 (*event_map)(int); - int max_events; - int num_counters; - int num_counters_fixed; - int cntval_bits; - u64 cntval_mask; - union { - long unsigned int events_maskl; - long unsigned int events_mask[1]; - }; - int events_mask_len; - int apic; - u64 max_period; - struct event_constraint * (*get_event_constraints)(struct cpu_hw_events *, int, struct perf_event *); - void (*put_event_constraints)(struct cpu_hw_events *, struct perf_event *); - void (*start_scheduling)(struct cpu_hw_events *); - void (*commit_scheduling)(struct cpu_hw_events *, int, int); - void (*stop_scheduling)(struct cpu_hw_events *); - struct event_constraint *event_constraints; - struct x86_pmu_quirk *quirks; - int perfctr_second_write; - u64 (*limit_period)(struct perf_event *, u64); - unsigned int late_ack: 1; - unsigned int counter_freezing: 1; - int attr_rdpmc_broken; - int attr_rdpmc; - struct attribute **format_attrs; - ssize_t (*events_sysfs_show)(char *, u64); - const struct attribute_group **attr_update; - long unsigned int attr_freeze_on_smi; - int (*cpu_prepare)(int); - void (*cpu_starting)(int); - void (*cpu_dying)(int); - void (*cpu_dead)(int); - void (*check_microcode)(); - void (*sched_task)(struct perf_event_context *, bool); - u64 intel_ctrl; - union perf_capabilities intel_cap; - unsigned int bts: 1; - unsigned int bts_active: 1; - unsigned int pebs: 1; - unsigned int pebs_active: 1; - unsigned int pebs_broken: 1; - unsigned int pebs_prec_dist: 1; - unsigned int pebs_no_tlb: 1; - unsigned int pebs_no_isolation: 1; - int pebs_record_size; - int pebs_buffer_size; - int max_pebs_events; - void (*drain_pebs)(struct pt_regs *); - struct event_constraint *pebs_constraints; - void (*pebs_aliases)(struct perf_event *); - long unsigned int large_pebs_flags; - u64 rtm_abort_event; - long unsigned int lbr_tos; - long unsigned int lbr_from; - long unsigned int lbr_to; - int lbr_nr; - u64 lbr_sel_mask; - const int *lbr_sel_map; - bool lbr_double_abort; - bool lbr_pt_coexist; - atomic_t lbr_exclusive[3]; - void (*swap_task_ctx)(struct perf_event_context *, struct perf_event_context *); - unsigned int amd_nb_constraints: 1; - struct extra_reg *extra_regs; - unsigned int flags; - struct perf_guest_switch_msr * (*guest_get_msrs)(int *); - int (*check_period)(struct perf_event *, u64); - int (*aux_output_match)(struct perf_event *); +struct local_ports { + seqlock_t lock; + int range[2]; + bool warned; }; -struct sched_state { - int weight; - int event; - int counter; - int unassigned; - int nr_gp; - long unsigned int used[1]; +struct inet_hashinfo; + +struct inet_timewait_death_row { + atomic_t tw_count; + long: 32; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + struct inet_hashinfo *hashinfo; + int sysctl_max_tw_buckets; + long: 32; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct perf_sched { - int max_weight; - int max_events; - int max_gp; - int saved_states; - struct event_constraint **constraints; - struct sched_state state; - struct sched_state saved[2]; +struct ping_group_range { + seqlock_t lock; + kgid_t range[2]; }; -typedef int pao_T__; +typedef struct { + u64 key[2]; +} siphash_key_t; -enum migratetype { - MIGRATE_UNMOVABLE = 0, - MIGRATE_MOVABLE = 1, - MIGRATE_RECLAIMABLE = 2, - MIGRATE_PCPTYPES = 3, - MIGRATE_HIGHATOMIC = 3, - MIGRATE_TYPES = 4, -}; +struct ipv4_devconf; -enum lru_list { - LRU_INACTIVE_ANON = 0, - LRU_ACTIVE_ANON = 1, - LRU_INACTIVE_FILE = 2, - LRU_ACTIVE_FILE = 3, - LRU_UNEVICTABLE = 4, - NR_LRU_LISTS = 5, -}; +struct ip_ra_chain; -enum zone_watermarks { - WMARK_MIN = 0, - WMARK_LOW = 1, - WMARK_HIGH = 2, - NR_WMARK = 3, -}; +struct fib_rules_ops; -enum { - ZONELIST_FALLBACK = 0, - ZONELIST_NOFALLBACK = 1, - MAX_ZONELISTS = 2, +struct fib_table; + +struct inet_peer_base; + +struct fqdir; + +struct xt_table; + +struct tcp_congestion_ops; + +struct tcp_fastopen_context; + +struct mr_table; + +struct fib_notifier_ops; + +struct netns_ipv4 { + struct ctl_table_header *forw_hdr; + struct ctl_table_header *frags_hdr; + struct ctl_table_header *ipv4_hdr; + struct ctl_table_header *route_hdr; + struct ctl_table_header *xfrm4_hdr; + struct ipv4_devconf *devconf_all; + struct ipv4_devconf *devconf_dflt; + struct ip_ra_chain *ra_chain; + struct mutex ra_mutex; + struct fib_rules_ops *rules_ops; + bool fib_has_custom_rules; + unsigned int fib_rules_require_fldissect; + struct fib_table *fib_main; + struct fib_table *fib_default; + bool fib_has_custom_local_routes; + struct hlist_head *fib_table_hash; + bool fib_offload_disabled; + struct sock *fibnl; + struct sock **icmp_sk; + struct sock *mc_autojoin_sk; + struct inet_peer_base *peers; + struct sock **tcp_sk; + struct fqdir *fqdir; + struct xt_table *iptable_filter; + struct xt_table *iptable_mangle; + struct xt_table *iptable_raw; + struct xt_table *arptable_filter; + struct xt_table *iptable_security; + struct xt_table *nat_table; + int sysctl_icmp_echo_ignore_all; + int sysctl_icmp_echo_ignore_broadcasts; + int sysctl_icmp_ignore_bogus_error_responses; + int sysctl_icmp_ratelimit; + int sysctl_icmp_ratemask; + int sysctl_icmp_errors_use_inbound_ifaddr; + struct local_ports ip_local_ports; + int sysctl_tcp_ecn; + int sysctl_tcp_ecn_fallback; + int sysctl_ip_default_ttl; + int sysctl_ip_no_pmtu_disc; + int sysctl_ip_fwd_use_pmtu; + int sysctl_ip_fwd_update_priority; + int sysctl_ip_nonlocal_bind; + int sysctl_ip_dynaddr; + int sysctl_ip_early_demux; + int sysctl_tcp_early_demux; + int sysctl_udp_early_demux; + int sysctl_fwmark_reflect; + int sysctl_tcp_fwmark_accept; + int sysctl_tcp_mtu_probing; + int sysctl_tcp_mtu_probe_floor; + int sysctl_tcp_base_mss; + int sysctl_tcp_min_snd_mss; + int sysctl_tcp_probe_threshold; + u32 sysctl_tcp_probe_interval; + int sysctl_tcp_keepalive_time; + int sysctl_tcp_keepalive_probes; + int sysctl_tcp_keepalive_intvl; + int sysctl_tcp_syn_retries; + int sysctl_tcp_synack_retries; + int sysctl_tcp_syncookies; + int sysctl_tcp_reordering; + int sysctl_tcp_retries1; + int sysctl_tcp_retries2; + int sysctl_tcp_orphan_retries; + int sysctl_tcp_fin_timeout; + unsigned int sysctl_tcp_notsent_lowat; + int sysctl_tcp_tw_reuse; + int sysctl_tcp_sack; + int sysctl_tcp_window_scaling; + int sysctl_tcp_timestamps; + int sysctl_tcp_early_retrans; + int sysctl_tcp_recovery; + int sysctl_tcp_thin_linear_timeouts; + int sysctl_tcp_slow_start_after_idle; + int sysctl_tcp_retrans_collapse; + int sysctl_tcp_stdurg; + int sysctl_tcp_rfc1337; + int sysctl_tcp_abort_on_overflow; + int sysctl_tcp_fack; + int sysctl_tcp_max_reordering; + int sysctl_tcp_dsack; + int sysctl_tcp_app_win; + int sysctl_tcp_adv_win_scale; + int sysctl_tcp_frto; + int sysctl_tcp_nometrics_save; + int sysctl_tcp_moderate_rcvbuf; + int sysctl_tcp_tso_win_divisor; + int sysctl_tcp_workaround_signed_windows; + int sysctl_tcp_limit_output_bytes; + int sysctl_tcp_challenge_ack_limit; + int sysctl_tcp_min_tso_segs; + int sysctl_tcp_min_rtt_wlen; + int sysctl_tcp_autocorking; + int sysctl_tcp_invalid_ratelimit; + int sysctl_tcp_pacing_ss_ratio; + int sysctl_tcp_pacing_ca_ratio; + int sysctl_tcp_wmem[3]; + int sysctl_tcp_rmem[3]; + int sysctl_tcp_comp_sack_nr; + long unsigned int sysctl_tcp_comp_sack_delay_ns; + struct inet_timewait_death_row tcp_death_row; + int sysctl_max_syn_backlog; + int sysctl_tcp_fastopen; + const struct tcp_congestion_ops *tcp_congestion_control; + struct tcp_fastopen_context *tcp_fastopen_ctx; + spinlock_t tcp_fastopen_ctx_lock; + unsigned int sysctl_tcp_fastopen_blackhole_timeout; + atomic_t tfo_active_disable_times; + long unsigned int tfo_active_disable_stamp; + int sysctl_udp_wmem_min; + int sysctl_udp_rmem_min; + int sysctl_igmp_max_memberships; + int sysctl_igmp_max_msf; + int sysctl_igmp_llm_reports; + int sysctl_igmp_qrv; + struct ping_group_range ping_group_range; + atomic_t dev_addr_genid; + long unsigned int *sysctl_local_reserved_ports; + int sysctl_ip_prot_sock; + struct mr_table *mrt; + int sysctl_fib_multipath_use_neigh; + int sysctl_fib_multipath_hash_policy; + struct fib_notifier_ops *notifier_ops; + unsigned int fib_seq; + struct fib_notifier_ops *ipmr_notifier_ops; + unsigned int ipmr_seq; + atomic_t rt_genid; + siphash_key_t ip_id_key; + long: 64; + long: 64; }; -struct perf_msr { - u64 msr; - struct attribute_group *grp; - bool (*test)(int, void *); - bool no_check; +struct netns_sysctl_ipv6 { + struct ctl_table_header *hdr; + struct ctl_table_header *route_hdr; + struct ctl_table_header *icmp_hdr; + struct ctl_table_header *frags_hdr; + struct ctl_table_header *xfrm6_hdr; + int bindv6only; + int flush_delay; + int ip6_rt_max_size; + int ip6_rt_gc_min_interval; + int ip6_rt_gc_timeout; + int ip6_rt_gc_interval; + int ip6_rt_gc_elasticity; + int ip6_rt_mtu_expires; + int ip6_rt_min_advmss; + int multipath_hash_policy; + int flowlabel_consistency; + int auto_flowlabels; + int icmpv6_time; + int icmpv6_echo_ignore_all; + int icmpv6_echo_ignore_multicast; + int icmpv6_echo_ignore_anycast; + long unsigned int icmpv6_ratemask[4]; + long unsigned int *icmpv6_ratemask_ptr; + int anycast_src_echo_reply; + int ip_nonlocal_bind; + int fwmark_reflect; + int idgen_retries; + int idgen_delay; + int flowlabel_state_ranges; + int flowlabel_reflect; + int max_dst_opts_cnt; + int max_hbh_opts_cnt; + int max_dst_opts_len; + int max_hbh_opts_len; + int seg6_flowlabel; + bool skip_notify_on_dev_down; }; -typedef long unsigned int pto_T__; +struct neighbour; -struct amd_uncore { - int id; - int refcnt; - int cpu; - int num_counters; - int rdpmc_base; - u32 msr_base; - cpumask_t *active_mask; - struct pmu *pmu; - struct perf_event *events[6]; - struct hlist_node node; +struct dst_ops { + short unsigned int family; + unsigned int gc_thresh; + int (*gc)(struct dst_ops *); + struct dst_entry * (*check)(struct dst_entry *, __u32); + unsigned int (*default_advmss)(const struct dst_entry *); + unsigned int (*mtu)(const struct dst_entry *); + u32 * (*cow_metrics)(struct dst_entry *, long unsigned int); + void (*destroy)(struct dst_entry *); + void (*ifdown)(struct dst_entry *, struct net_device *, int); + struct dst_entry * (*negative_advice)(struct dst_entry *); + void (*link_failure)(struct sk_buff *); + void (*update_pmtu)(struct dst_entry *, struct sock *, struct sk_buff *, u32, bool); + void (*redirect)(struct dst_entry *, struct sock *, struct sk_buff *); + int (*local_out)(struct net *, struct sock *, struct sk_buff *); + struct neighbour * (*neigh_lookup)(const struct dst_entry *, struct sk_buff *, const void *); + void (*confirm_neigh)(const struct dst_entry *, const void *); + struct kmem_cache *kmem_cachep; + struct percpu_counter pcpuc_entries; + long: 64; + long: 64; + long: 64; }; -typedef int pci_power_t; +struct ipv6_devconf; -typedef unsigned int pci_channel_state_t; +struct fib6_info; -typedef short unsigned int pci_dev_flags_t; +struct rt6_info; -struct pci_bus; +struct rt6_statistics; -struct pci_slot; +struct fib6_table; -struct aer_stats; +struct seg6_pernet_data; -struct pci_driver; +struct netns_ipv6 { + struct netns_sysctl_ipv6 sysctl; + struct ipv6_devconf *devconf_all; + struct ipv6_devconf *devconf_dflt; + struct inet_peer_base *peers; + struct fqdir *fqdir; + struct xt_table *ip6table_filter; + struct xt_table *ip6table_mangle; + struct xt_table *ip6table_raw; + struct xt_table *ip6table_security; + struct xt_table *ip6table_nat; + struct fib6_info *fib6_null_entry; + struct rt6_info *ip6_null_entry; + struct rt6_statistics *rt6_stats; + struct timer_list ip6_fib_timer; + struct hlist_head *fib_table_hash; + struct fib6_table *fib6_main_tbl; + struct list_head fib6_walkers; + long: 64; + long: 64; + struct dst_ops ip6_dst_ops; + rwlock_t fib6_walker_lock; + spinlock_t fib6_gc_lock; + unsigned int ip6_rt_gc_expire; + long unsigned int ip6_rt_last_gc; + unsigned int fib6_rules_require_fldissect; + bool fib6_has_custom_rules; + struct rt6_info *ip6_prohibit_entry; + struct rt6_info *ip6_blk_hole_entry; + struct fib6_table *fib6_local_tbl; + struct fib_rules_ops *fib6_rules_ops; + struct sock **icmp_sk; + struct sock *ndisc_sk; + struct sock *tcp_sk; + struct sock *igmp_sk; + struct sock *mc_autojoin_sk; + atomic_t dev_addr_genid; + atomic_t fib6_sernum; + struct seg6_pernet_data *seg6_data; + struct fib_notifier_ops *notifier_ops; + struct fib_notifier_ops *ip6mr_notifier_ops; + unsigned int ipmr_seq; + struct { + struct hlist_head head; + spinlock_t lock; + u32 seq; + } ip6addrlbl_table; + long: 64; + long: 64; + long: 64; + long: 64; +}; -struct pcie_link_state; +struct nf_queue_handler; -struct pci_vpd; +struct nf_logger; -struct pci_sriov; +struct nf_hook_entries; -struct pci_dev { - struct list_head bus_list; - struct pci_bus *bus; - struct pci_bus *subordinate; - void *sysdata; - struct proc_dir_entry *procent; - struct pci_slot *slot; - unsigned int devfn; - short unsigned int vendor; - short unsigned int device; - short unsigned int subsystem_vendor; - short unsigned int subsystem_device; - unsigned int class; - u8 revision; - u8 hdr_type; - u16 aer_cap; - struct aer_stats *aer_stats; - u8 pcie_cap; - u8 msi_cap; - u8 msix_cap; - u8 pcie_mpss: 3; - u8 rom_base_reg; - u8 pin; - u16 pcie_flags_reg; - long unsigned int *dma_alias_mask; - struct pci_driver *driver; - u64 dma_mask; - struct device_dma_parameters dma_parms; - pci_power_t current_state; - unsigned int imm_ready: 1; - u8 pm_cap; - unsigned int pme_support: 5; - unsigned int pme_poll: 1; - unsigned int d1_support: 1; - unsigned int d2_support: 1; - unsigned int no_d1d2: 1; - unsigned int no_d3cold: 1; - unsigned int bridge_d3: 1; - unsigned int d3cold_allowed: 1; - unsigned int mmio_always_on: 1; - unsigned int wakeup_prepared: 1; - unsigned int runtime_d3cold: 1; - unsigned int skip_bus_pm: 1; - unsigned int ignore_hotplug: 1; - unsigned int hotplug_user_indicators: 1; - unsigned int clear_retrain_link: 1; - unsigned int d3_delay; - unsigned int d3cold_delay; - struct pcie_link_state *link_state; - unsigned int ltr_path: 1; - unsigned int eetlp_prefix_path: 1; - pci_channel_state_t error_state; - struct device dev; - int cfg_size; - unsigned int irq; - struct resource resource[11]; - bool match_driver; - unsigned int transparent: 1; - unsigned int io_window: 1; - unsigned int pref_window: 1; - unsigned int pref_64_window: 1; - unsigned int multifunction: 1; - unsigned int is_busmaster: 1; - unsigned int no_msi: 1; - unsigned int no_64bit_msi: 1; - unsigned int block_cfg_access: 1; - unsigned int broken_parity_status: 1; - unsigned int irq_reroute_variant: 2; - unsigned int msi_enabled: 1; - unsigned int msix_enabled: 1; - unsigned int ari_enabled: 1; - unsigned int ats_enabled: 1; - unsigned int pasid_enabled: 1; - unsigned int pri_enabled: 1; - unsigned int is_managed: 1; - unsigned int needs_freset: 1; - unsigned int state_saved: 1; - unsigned int is_physfn: 1; - unsigned int is_virtfn: 1; - unsigned int reset_fn: 1; - unsigned int is_hotplug_bridge: 1; - unsigned int shpc_managed: 1; - unsigned int is_thunderbolt: 1; - unsigned int untrusted: 1; - unsigned int __aer_firmware_first_valid: 1; - unsigned int __aer_firmware_first: 1; - unsigned int broken_intx_masking: 1; - unsigned int io_window_1k: 1; - unsigned int irq_managed: 1; - unsigned int non_compliant_bars: 1; - unsigned int is_probed: 1; - unsigned int link_active_reporting: 1; - unsigned int no_vf_scan: 1; - pci_dev_flags_t dev_flags; - atomic_t enable_cnt; - u32 saved_config_space[16]; - struct hlist_head saved_cap_space; - struct bin_attribute *rom_attr; - int rom_attr_enabled; - struct bin_attribute *res_attr[11]; - struct bin_attribute *res_attr_wc[11]; - const struct attribute_group **msi_irq_groups; - struct pci_vpd *vpd; - union { - struct pci_sriov *sriov; - struct pci_dev *physfn; - }; - u16 ats_cap; - u8 ats_stu; - u16 pri_cap; - u32 pri_reqs_alloc; - unsigned int pasid_required: 1; - u16 pasid_cap; - u16 pasid_features; - phys_addr_t rom; - size_t romlen; - char *driver_override; - long unsigned int priv_flags; +struct netns_nf { + struct proc_dir_entry *proc_netfilter; + const struct nf_queue_handler *queue_handler; + const struct nf_logger *nf_loggers[13]; + struct ctl_table_header *nf_log_dir_header; + struct nf_hook_entries *hooks_ipv4[5]; + struct nf_hook_entries *hooks_ipv6[5]; + bool defrag_ipv4; + bool defrag_ipv6; }; -struct pci_device_id { - __u32 vendor; - __u32 device; - __u32 subvendor; - __u32 subdevice; - __u32 class; - __u32 class_mask; - kernel_ulong_t driver_data; +struct netns_xt { + struct list_head tables[13]; + bool notrack_deprecated_warning; + bool clusterip_deprecated_warning; }; -struct hotplug_slot; +struct nf_ct_event_notifier; -struct pci_slot { - struct pci_bus *bus; - struct list_head list; - struct hotplug_slot *hotplug; - unsigned char number; - struct kobject kobj; -}; +struct nf_exp_event_notifier; -typedef short unsigned int pci_bus_flags_t; - -struct pci_ops; - -struct msi_controller; - -struct pci_bus { - struct list_head node; - struct pci_bus *parent; - struct list_head children; - struct list_head devices; - struct pci_dev *self; - struct list_head slots; - struct resource *resource[4]; - struct list_head resources; - struct resource busn_res; - struct pci_ops *ops; - struct msi_controller *msi; - void *sysdata; - struct proc_dir_entry *procdir; - unsigned char number; - unsigned char primary; - unsigned char max_bus_speed; - unsigned char cur_bus_speed; - char name[48]; - short unsigned int bridge_ctl; - pci_bus_flags_t bus_flags; - struct device *bridge; - struct device dev; - struct bin_attribute *legacy_io; - struct bin_attribute *legacy_mem; - unsigned int is_added: 1; +struct nf_generic_net { + unsigned int timeout; }; -enum { - PCI_STD_RESOURCES = 0, - PCI_STD_RESOURCE_END = 5, - PCI_ROM_RESOURCE = 6, - PCI_BRIDGE_RESOURCES = 7, - PCI_BRIDGE_RESOURCE_END = 10, - PCI_NUM_RESOURCES = 11, - DEVICE_COUNT_RESOURCE = 11, +struct nf_tcp_net { + unsigned int timeouts[14]; + int tcp_loose; + int tcp_be_liberal; + int tcp_max_retrans; }; -enum pci_channel_state { - pci_channel_io_normal = 1, - pci_channel_io_frozen = 2, - pci_channel_io_perm_failure = 3, +struct nf_udp_net { + unsigned int timeouts[2]; }; -typedef unsigned int pcie_reset_state_t; - -struct pci_dynids { - spinlock_t lock; - struct list_head list; +struct nf_icmp_net { + unsigned int timeout; }; -struct pci_error_handlers; +struct nf_dccp_net { + int dccp_loose; + unsigned int dccp_timeout[10]; +}; -struct pci_driver { - struct list_head node; - const char *name; - const struct pci_device_id *id_table; - int (*probe)(struct pci_dev *, const struct pci_device_id *); - void (*remove)(struct pci_dev *); - int (*suspend)(struct pci_dev *, pm_message_t); - int (*resume)(struct pci_dev *); - void (*shutdown)(struct pci_dev *); - int (*sriov_configure)(struct pci_dev *, int); - const struct pci_error_handlers *err_handler; - const struct attribute_group **groups; - struct device_driver driver; - struct pci_dynids dynids; +struct nf_sctp_net { + unsigned int timeouts[10]; }; -struct pci_ops { - int (*add_bus)(struct pci_bus *); - void (*remove_bus)(struct pci_bus *); - void * (*map_bus)(struct pci_bus *, unsigned int, int); - int (*read)(struct pci_bus *, unsigned int, int, int, u32 *); - int (*write)(struct pci_bus *, unsigned int, int, int, u32); +struct nf_ip_net { + struct nf_generic_net generic; + struct nf_tcp_net tcp; + struct nf_udp_net udp; + struct nf_icmp_net icmp; + struct nf_icmp_net icmpv6; + struct nf_dccp_net dccp; + struct nf_sctp_net sctp; }; -typedef unsigned int pci_ers_result_t; +struct ct_pcpu; -struct pci_error_handlers { - pci_ers_result_t (*error_detected)(struct pci_dev *, enum pci_channel_state); - pci_ers_result_t (*mmio_enabled)(struct pci_dev *); - pci_ers_result_t (*slot_reset)(struct pci_dev *); - void (*reset_prepare)(struct pci_dev *); - void (*reset_done)(struct pci_dev *); - void (*resume)(struct pci_dev *); -}; +struct ip_conntrack_stat; -struct syscore_ops { - struct list_head node; - int (*suspend)(); - void (*resume)(); - void (*shutdown)(); +struct netns_ct { + atomic_t count; + unsigned int expect_count; + bool auto_assign_helper_warned; + struct ctl_table_header *sysctl_header; + unsigned int sysctl_log_invalid; + int sysctl_events; + int sysctl_acct; + int sysctl_auto_assign_helper; + int sysctl_tstamp; + int sysctl_checksum; + struct ct_pcpu *pcpu_lists; + struct ip_conntrack_stat *stat; + struct nf_ct_event_notifier *nf_conntrack_event_cb; + struct nf_exp_event_notifier *nf_expect_event_cb; + struct nf_ip_net nf_ct_proto; }; -enum ibs_states { - IBS_ENABLED = 0, - IBS_STARTED = 1, - IBS_STOPPING = 2, - IBS_STOPPED = 3, - IBS_MAX_STATES = 4, +struct netns_nf_frag { + struct fqdir *fqdir; }; -struct cpu_perf_ibs { - struct perf_event *event; - long unsigned int state[1]; +struct xfrm_policy_hash { + struct hlist_head *table; + unsigned int hmask; + u8 dbits4; + u8 sbits4; + u8 dbits6; + u8 sbits6; }; -struct perf_ibs { - struct pmu pmu; - unsigned int msr; - u64 config_mask; - u64 cnt_mask; - u64 enable_mask; - u64 valid_mask; - u64 max_period; - long unsigned int offset_mask[1]; - int offset_max; - struct cpu_perf_ibs *pcpu; - struct attribute **format_attrs; - struct attribute_group format_group; - const struct attribute_group *attr_groups[2]; - u64 (*get_count)(u64); +struct xfrm_policy_hthresh { + struct work_struct work; + seqlock_t lock; + u8 lbits4; + u8 rbits4; + u8 lbits6; + u8 rbits6; }; -struct perf_ibs_data { - u32 size; - union { - u32 data[0]; - u32 caps; - }; - u64 regs[8]; +struct netns_xfrm { + struct list_head state_all; + struct hlist_head *state_bydst; + struct hlist_head *state_bysrc; + struct hlist_head *state_byspi; + unsigned int state_hmask; + unsigned int state_num; + struct work_struct state_hash_work; + struct list_head policy_all; + struct hlist_head *policy_byidx; + unsigned int policy_idx_hmask; + struct hlist_head policy_inexact[3]; + struct xfrm_policy_hash policy_bydst[3]; + unsigned int policy_count[6]; + struct work_struct policy_hash_work; + struct xfrm_policy_hthresh policy_hthresh; + struct list_head inexact_bins; + struct sock *nlsk; + struct sock *nlsk_stash; + u32 sysctl_aevent_etime; + u32 sysctl_aevent_rseqth; + int sysctl_larval_drop; + u32 sysctl_acq_expires; + struct ctl_table_header *sysctl_hdr; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + struct dst_ops xfrm4_dst_ops; + struct dst_ops xfrm6_dst_ops; + spinlock_t xfrm_state_lock; + spinlock_t xfrm_policy_lock; + struct mutex xfrm_cfg_mutex; + long: 64; + long: 64; + long: 64; }; -struct kobj_attribute { - struct attribute attr; - ssize_t (*show)(struct kobject *, struct kobj_attribute *, char *); - ssize_t (*store)(struct kobject *, struct kobj_attribute *, const char *, size_t); +struct netns_xdp { + struct mutex lock; + struct hlist_head list; }; -struct amd_iommu; +struct uevent_sock; -struct perf_amd_iommu { +struct net_generic; + +struct net { + refcount_t passive; + refcount_t count; + spinlock_t rules_mod_lock; + unsigned int dev_unreg_count; + unsigned int dev_base_seq; + int ifindex; + spinlock_t nsid_lock; + atomic_t fnhe_genid; struct list_head list; - struct pmu pmu; - struct amd_iommu *iommu; - char name[16]; - u8 max_banks; - u8 max_counters; - u64 cntr_assign_mask; - raw_spinlock_t lock; + struct list_head exit_list; + struct llist_node cleanup_list; + struct key_tag *key_domain; + struct user_namespace *user_ns; + struct ucounts *ucounts; + struct idr netns_ids; + struct ns_common ns; + struct list_head dev_base_head; + struct proc_dir_entry *proc_net; + struct proc_dir_entry *proc_net_stat; + struct ctl_table_set sysctls; + struct sock *rtnl; + struct sock *genl_sock; + struct uevent_sock *uevent_sock; + struct hlist_head *dev_name_head; + struct hlist_head *dev_index_head; + struct raw_notifier_head netdev_chain; + u32 hash_mix; + struct net_device *loopback_dev; + struct list_head rules_ops; + struct netns_core core; + struct netns_mib mib; + struct netns_packet packet; + struct netns_unix unx; + struct netns_nexthop nexthop; + long: 64; + struct netns_ipv4 ipv4; + struct netns_ipv6 ipv6; + struct netns_nf nf; + struct netns_xt xt; + struct netns_ct ct; + struct netns_nf_frag nf_frag; + struct ctl_table_header *nf_frag_frags_hdr; + struct sock *nfnl; + struct sock *nfnl_stash; + struct net_generic *gen; + struct bpf_prog *flow_dissector_prog; + long: 64; + long: 64; + long: 64; + long: 64; + struct netns_xfrm xfrm; + struct netns_xdp xdp; + struct sock *diag_nlsk; + long: 64; + long: 64; }; -struct amd_iommu_event_desc { - struct kobj_attribute attr; - const char *event; -}; +typedef struct { + local64_t v; +} u64_stats_t; -enum perf_msr_id { - PERF_MSR_TSC = 0, - PERF_MSR_APERF = 1, - PERF_MSR_MPERF = 2, - PERF_MSR_PPERF = 3, - PERF_MSR_SMI = 4, - PERF_MSR_PTSC = 5, - PERF_MSR_IRPERF = 6, - PERF_MSR_THERM = 7, - PERF_MSR_EVENT_MAX = 8, -}; +struct bpf_offloaded_map; -struct x86_cpu_desc { - u8 x86_family; - u8 x86_vendor; - u8 x86_model; - u8 x86_stepping; - u32 x86_microcode_rev; +struct bpf_map_dev_ops { + int (*map_get_next_key)(struct bpf_offloaded_map *, void *, void *); + int (*map_lookup_elem)(struct bpf_offloaded_map *, void *, void *); + int (*map_update_elem)(struct bpf_offloaded_map *, void *, void *, u64); + int (*map_delete_elem)(struct bpf_offloaded_map *, void *); }; -union cpuid10_eax { - struct { - unsigned int version_id: 8; - unsigned int num_counters: 8; - unsigned int bit_width: 8; - unsigned int mask_length: 8; - } split; - unsigned int full; +struct bpf_offloaded_map { + struct bpf_map map; + struct net_device *netdev; + const struct bpf_map_dev_ops *dev_ops; + void *dev_priv; + struct list_head offloads; + long: 64; + long: 64; + long: 64; }; -union cpuid10_ebx { - struct { - unsigned int no_unhalted_core_cycles: 1; - unsigned int no_instructions_retired: 1; - unsigned int no_unhalted_reference_cycles: 1; - unsigned int no_llc_reference: 1; - unsigned int no_llc_misses: 1; - unsigned int no_branch_instruction_retired: 1; - unsigned int no_branch_misses_retired: 1; - } split; - unsigned int full; +struct net_device_stats { + long unsigned int rx_packets; + long unsigned int tx_packets; + long unsigned int rx_bytes; + long unsigned int tx_bytes; + long unsigned int rx_errors; + long unsigned int tx_errors; + long unsigned int rx_dropped; + long unsigned int tx_dropped; + long unsigned int multicast; + long unsigned int collisions; + long unsigned int rx_length_errors; + long unsigned int rx_over_errors; + long unsigned int rx_crc_errors; + long unsigned int rx_frame_errors; + long unsigned int rx_fifo_errors; + long unsigned int rx_missed_errors; + long unsigned int tx_aborted_errors; + long unsigned int tx_carrier_errors; + long unsigned int tx_fifo_errors; + long unsigned int tx_heartbeat_errors; + long unsigned int tx_window_errors; + long unsigned int rx_compressed; + long unsigned int tx_compressed; }; -union cpuid10_edx { - struct { - unsigned int num_counters_fixed: 5; - unsigned int bit_width_fixed: 8; - unsigned int reserved: 19; - } split; - unsigned int full; +struct netdev_hw_addr_list { + struct list_head list; + int count; }; -union x86_pmu_config { - struct { - u64 event: 8; - u64 umask: 8; - u64 usr: 1; - u64 os: 1; - u64 edge: 1; - u64 pc: 1; - u64 interrupt: 1; - u64 __reserved1: 1; - u64 en: 1; - u64 inv: 1; - u64 cmask: 8; - u64 event2: 4; - u64 __reserved2: 4; - u64 go: 1; - u64 ho: 1; - } bits; - u64 value; +enum rx_handler_result { + RX_HANDLER_CONSUMED = 0, + RX_HANDLER_ANOTHER = 1, + RX_HANDLER_EXACT = 2, + RX_HANDLER_PASS = 3, }; -enum pageflags { - PG_locked = 0, - PG_referenced = 1, - PG_uptodate = 2, - PG_dirty = 3, - PG_lru = 4, - PG_active = 5, - PG_workingset = 6, - PG_waiters = 7, - PG_error = 8, - PG_slab = 9, - PG_owner_priv_1 = 10, - PG_arch_1 = 11, - PG_reserved = 12, - PG_private = 13, - PG_private_2 = 14, - PG_writeback = 15, - PG_head = 16, - PG_mappedtodisk = 17, - PG_reclaim = 18, - PG_swapbacked = 19, - PG_unevictable = 20, - PG_mlocked = 21, - PG_uncached = 22, - __NR_PAGEFLAGS = 23, - PG_checked = 10, - PG_swapcache = 10, - PG_fscache = 14, - PG_pinned = 10, - PG_savepinned = 3, - PG_foreign = 10, - PG_xen_remapped = 10, - PG_slob_free = 13, - PG_double_map = 14, - PG_isolated = 18, +typedef enum rx_handler_result rx_handler_result_t; + +typedef rx_handler_result_t rx_handler_func_t(struct sk_buff **); + +struct pcpu_dstats; + +struct netdev_tc_txq { + u16 count; + u16 offset; }; -struct bts_ctx { - struct perf_output_handle handle; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct sfp_bus; + +struct netdev_name_node; + +struct dev_ifalias; + +struct net_device_ops; + +struct ethtool_ops; + +struct ndisc_ops; + +struct header_ops; + +struct in_device; + +struct inet6_dev; + +struct wireless_dev; + +struct wpan_dev; + +struct netdev_rx_queue; + +struct mini_Qdisc; + +struct netdev_queue; + +struct cpu_rmap; + +struct Qdisc; + +struct xps_dev_maps; + +struct netpoll_info; + +struct pcpu_lstats; + +struct pcpu_sw_netstats; + +struct rtnl_link_ops; + +struct phy_device; + +struct net_device { + char name[16]; + struct netdev_name_node *name_node; + struct dev_ifalias *ifalias; + long unsigned int mem_end; + long unsigned int mem_start; + long unsigned int base_addr; + int irq; + long unsigned int state; + struct list_head dev_list; + struct list_head napi_list; + struct list_head unreg_list; + struct list_head close_list; + struct list_head ptype_all; + struct list_head ptype_specific; + struct { + struct list_head upper; + struct list_head lower; + } adj_list; + netdev_features_t features; + netdev_features_t hw_features; + netdev_features_t wanted_features; + netdev_features_t vlan_features; + netdev_features_t hw_enc_features; + netdev_features_t mpls_features; + netdev_features_t gso_partial_features; + int ifindex; + int group; + struct net_device_stats stats; + atomic_long_t rx_dropped; + atomic_long_t tx_dropped; + atomic_long_t rx_nohandler; + atomic_t carrier_up_count; + atomic_t carrier_down_count; + const struct net_device_ops *netdev_ops; + const struct ethtool_ops *ethtool_ops; + const struct ndisc_ops *ndisc_ops; + const struct header_ops *header_ops; + unsigned int flags; + unsigned int priv_flags; + short unsigned int gflags; + short unsigned int padded; + unsigned char operstate; + unsigned char link_mode; + unsigned char if_port; + unsigned char dma; + unsigned int mtu; + unsigned int min_mtu; + unsigned int max_mtu; + short unsigned int type; + short unsigned int hard_header_len; + unsigned char min_header_len; + short unsigned int needed_headroom; + short unsigned int needed_tailroom; + unsigned char perm_addr[32]; + unsigned char addr_assign_type; + unsigned char addr_len; + unsigned char upper_level; + unsigned char lower_level; + short unsigned int neigh_priv_len; + short unsigned int dev_id; + short unsigned int dev_port; + spinlock_t addr_list_lock; + unsigned char name_assign_type; + bool uc_promisc; + struct netdev_hw_addr_list uc; + struct netdev_hw_addr_list mc; + struct netdev_hw_addr_list dev_addrs; + struct kset *queues_kset; + unsigned int promiscuity; + unsigned int allmulti; + struct in_device *ip_ptr; + struct inet6_dev *ip6_ptr; + struct wireless_dev *ieee80211_ptr; + struct wpan_dev *ieee802154_ptr; + unsigned char *dev_addr; + struct netdev_rx_queue *_rx; + unsigned int num_rx_queues; + unsigned int real_num_rx_queues; + struct bpf_prog *xdp_prog; + long unsigned int gro_flush_timeout; + rx_handler_func_t *rx_handler; + void *rx_handler_data; + struct mini_Qdisc *miniq_ingress; + struct netdev_queue *ingress_queue; + struct nf_hook_entries *nf_hooks_ingress; + unsigned char broadcast[32]; + struct cpu_rmap *rx_cpu_rmap; + struct hlist_node index_hlist; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + struct netdev_queue *_tx; + unsigned int num_tx_queues; + unsigned int real_num_tx_queues; + struct Qdisc *qdisc; + struct hlist_head qdisc_hash[16]; + unsigned int tx_queue_len; + spinlock_t tx_global_lock; + int watchdog_timeo; + struct xps_dev_maps *xps_cpus_map; + struct xps_dev_maps *xps_rxqs_map; + struct mini_Qdisc *miniq_egress; + struct timer_list watchdog_timer; + int *pcpu_refcnt; + struct list_head todo_list; + struct list_head link_watch_list; + enum { + NETREG_UNINITIALIZED = 0, + NETREG_REGISTERED = 1, + NETREG_UNREGISTERING = 2, + NETREG_UNREGISTERED = 3, + NETREG_RELEASED = 4, + NETREG_DUMMY = 5, + } reg_state: 8; + bool dismantle; + enum { + RTNL_LINK_INITIALIZED = 0, + RTNL_LINK_INITIALIZING = 1, + } rtnl_link_state: 16; + bool needs_free_netdev; + void (*priv_destructor)(struct net_device *); + struct netpoll_info *npinfo; + possible_net_t nd_net; + union { + void *ml_priv; + struct pcpu_lstats *lstats; + struct pcpu_sw_netstats *tstats; + struct pcpu_dstats *dstats; + }; + struct device dev; + const struct attribute_group *sysfs_groups[4]; + const struct attribute_group *sysfs_rx_queue_group; + const struct rtnl_link_ops *rtnl_link_ops; + unsigned int gso_max_size; + u16 gso_max_segs; + s16 num_tc; + struct netdev_tc_txq tc_to_txq[16]; + u8 prio_tc_map[16]; + struct phy_device *phydev; + struct sfp_bus *sfp_bus; + struct lock_class_key qdisc_tx_busylock_key; + struct lock_class_key qdisc_running_key; + struct lock_class_key qdisc_xmit_lock_key; + struct lock_class_key addr_list_lock_key; + bool proto_down; + unsigned int wol_enabled: 1; +}; + +typedef unsigned int sk_buff_data_t; + +struct skb_ext; + +struct sk_buff { + union { + struct { + struct sk_buff *next; + struct sk_buff *prev; + union { + struct net_device *dev; + long unsigned int dev_scratch; + }; + }; + struct rb_node rbnode; + struct list_head list; + }; + union { + struct sock *sk; + int ip_defrag_offset; + }; + union { + ktime_t tstamp; + u64 skb_mstamp_ns; + }; + char cb[48]; + union { + struct { + long unsigned int _skb_refdst; + void (*destructor)(struct sk_buff *); + }; + struct list_head tcp_tsorted_anchor; + }; + long unsigned int _nfct; + unsigned int len; + unsigned int data_len; + __u16 mac_len; + __u16 hdr_len; + __u16 queue_mapping; + __u8 __cloned_offset[0]; + __u8 cloned: 1; + __u8 nohdr: 1; + __u8 fclone: 2; + __u8 peeked: 1; + __u8 head_frag: 1; + __u8 pfmemalloc: 1; + __u8 active_extensions; + __u32 headers_start[0]; + __u8 __pkt_type_offset[0]; + __u8 pkt_type: 3; + __u8 ignore_df: 1; + __u8 nf_trace: 1; + __u8 ip_summed: 2; + __u8 ooo_okay: 1; + __u8 l4_hash: 1; + __u8 sw_hash: 1; + __u8 wifi_acked_valid: 1; + __u8 wifi_acked: 1; + __u8 no_fcs: 1; + __u8 encapsulation: 1; + __u8 encap_hdr_csum: 1; + __u8 csum_valid: 1; + __u8 __pkt_vlan_present_offset[0]; + __u8 vlan_present: 1; + __u8 csum_complete_sw: 1; + __u8 csum_level: 2; + __u8 csum_not_inet: 1; + __u8 dst_pending_confirm: 1; + __u8 ndisc_nodetype: 2; + __u8 ipvs_property: 1; + __u8 inner_protocol_type: 1; + __u8 remcsum_offload: 1; + __u8 tc_skip_classify: 1; + __u8 tc_at_ingress: 1; + __u8 tc_redirected: 1; + __u8 tc_from_ingress: 1; + __u16 tc_index; + union { + __wsum csum; + struct { + __u16 csum_start; + __u16 csum_offset; + }; + }; + __u32 priority; + int skb_iif; + __u32 hash; + __be16 vlan_proto; + __u16 vlan_tci; + union { + unsigned int napi_id; + unsigned int sender_cpu; + }; + __u32 secmark; + union { + __u32 mark; + __u32 reserved_tailroom; + }; + union { + __be16 inner_protocol; + __u8 inner_ipproto; + }; + __u16 inner_transport_header; + __u16 inner_network_header; + __u16 inner_mac_header; + __be16 protocol; + __u16 transport_header; + __u16 network_header; + __u16 mac_header; + __u32 headers_end[0]; + sk_buff_data_t tail; + sk_buff_data_t end; + unsigned char *head; + unsigned char *data; + unsigned int truesize; + refcount_t users; + struct skb_ext *extensions; +}; + +struct sg_table { + struct scatterlist *sgl; + unsigned int nents; + unsigned int orig_nents; +}; + +typedef int suspend_state_t; + +enum suspend_stat_step { + SUSPEND_FREEZE = 1, + SUSPEND_PREPARE = 2, + SUSPEND_SUSPEND = 3, + SUSPEND_SUSPEND_LATE = 4, + SUSPEND_SUSPEND_NOIRQ = 5, + SUSPEND_RESUME_NOIRQ = 6, + SUSPEND_RESUME_EARLY = 7, + SUSPEND_RESUME = 8, +}; + +struct suspend_stats { + int success; + int fail; + int failed_freeze; + int failed_prepare; + int failed_suspend; + int failed_suspend_late; + int failed_suspend_noirq; + int failed_resume; + int failed_resume_early; + int failed_resume_noirq; + int last_failed_dev; + char failed_devs[80]; + int last_failed_errno; + int errno[2]; + int last_failed_step; + enum suspend_stat_step failed_steps[2]; +}; + +enum s2idle_states { + S2IDLE_STATE_NONE = 0, + S2IDLE_STATE_ENTER = 1, + S2IDLE_STATE_WAKE = 2, +}; + +struct pbe { + void *address; + void *orig_address; + struct pbe *next; +}; + +enum { + Root_NFS = 255, + Root_CIFS = 254, + Root_RAM0 = 1048576, + Root_RAM1 = 1048577, + Root_FD0 = 2097152, + Root_HDA1 = 3145729, + Root_HDA2 = 3145730, + Root_SDA1 = 8388609, + Root_SDA2 = 8388610, + Root_HDC1 = 23068673, + Root_SR0 = 11534336, +}; + +struct xdr_buf { + struct kvec head[1]; + struct kvec tail[1]; + struct bio_vec *bvec; + struct page **pages; + unsigned int page_base; + unsigned int page_len; + unsigned int flags; + unsigned int buflen; + unsigned int len; +}; + +struct rpc_rqst; + +struct xdr_stream { + __be32 *p; + struct xdr_buf *buf; + __be32 *end; + struct kvec *iov; + struct kvec scratch; + struct page **page_ptr; + unsigned int nwords; + struct rpc_rqst *rqst; +}; + +struct rpc_xprt; + +struct rpc_task; + +struct rpc_cred; + +struct rpc_rqst { + struct rpc_xprt *rq_xprt; + struct xdr_buf rq_snd_buf; + struct xdr_buf rq_rcv_buf; + struct rpc_task *rq_task; + struct rpc_cred *rq_cred; + __be32 rq_xid; + int rq_cong; + u32 rq_seqno; + int rq_enc_pages_num; + struct page **rq_enc_pages; + void (*rq_release_snd_buf)(struct rpc_rqst *); + union { + struct list_head rq_list; + struct rb_node rq_recv; + }; + struct list_head rq_xmit; + struct list_head rq_xmit2; + void *rq_buffer; + size_t rq_callsize; + void *rq_rbuffer; + size_t rq_rcvsize; + size_t rq_xmit_bytes_sent; + size_t rq_reply_bytes_recvd; + struct xdr_buf rq_private_buf; + long unsigned int rq_majortimeo; + long unsigned int rq_timeout; + ktime_t rq_rtt; + unsigned int rq_retries; + unsigned int rq_connect_cookie; + atomic_t rq_pin; + u32 rq_bytes_sent; + ktime_t rq_xtime; + int rq_ntrans; +}; + +typedef void (*kxdreproc_t)(struct rpc_rqst *, struct xdr_stream *, const void *); + +typedef int (*kxdrdproc_t)(struct rpc_rqst *, struct xdr_stream *, void *); + +struct rpc_procinfo; + +struct rpc_message { + const struct rpc_procinfo *rpc_proc; + void *rpc_argp; + void *rpc_resp; + const struct cred *rpc_cred; +}; + +struct rpc_procinfo { + u32 p_proc; + kxdreproc_t p_encode; + kxdrdproc_t p_decode; + unsigned int p_arglen; + unsigned int p_replen; + unsigned int p_timer; + u32 p_statidx; + const char *p_name; +}; + +struct rpc_wait { + struct list_head list; + struct list_head links; + struct list_head timer_list; +}; + +struct rpc_wait_queue; + +struct rpc_call_ops; + +struct rpc_clnt; + +struct rpc_task { + atomic_t tk_count; + int tk_status; + struct list_head tk_task; + void (*tk_callback)(struct rpc_task *); + void (*tk_action)(struct rpc_task *); + long unsigned int tk_timeout; + long unsigned int tk_runstate; + struct rpc_wait_queue *tk_waitqueue; + union { + struct work_struct tk_work; + struct rpc_wait tk_wait; + } u; + int tk_rpc_status; + struct rpc_message tk_msg; + void *tk_calldata; + const struct rpc_call_ops *tk_ops; + struct rpc_clnt *tk_client; + struct rpc_xprt *tk_xprt; + struct rpc_cred *tk_op_cred; + struct rpc_rqst *tk_rqstp; + struct workqueue_struct *tk_workqueue; + ktime_t tk_start; + pid_t tk_owner; + short unsigned int tk_flags; + short unsigned int tk_timeouts; + short unsigned int tk_pid; + unsigned char tk_priority: 2; + unsigned char tk_garb_retry: 2; + unsigned char tk_cred_retry: 2; + unsigned char tk_rebind_retry: 2; +}; + +struct rpc_timer { + struct list_head list; + long unsigned int expires; + struct delayed_work dwork; +}; + +struct rpc_wait_queue { + spinlock_t lock; + struct list_head tasks[4]; + unsigned char maxpriority; + unsigned char priority; + unsigned char nr; + short unsigned int qlen; + struct rpc_timer timer_list; + const char *name; +}; + +struct rpc_call_ops { + void (*rpc_call_prepare)(struct rpc_task *, void *); + void (*rpc_call_done)(struct rpc_task *, void *); + void (*rpc_count_stats)(struct rpc_task *, void *); + void (*rpc_release)(void *); +}; + +struct rpc_pipe_dir_head { + struct list_head pdh_entries; + struct dentry *pdh_dentry; +}; + +struct rpc_rtt { + long unsigned int timeo; + long unsigned int srtt[5]; + long unsigned int sdrtt[5]; + int ntimeouts[5]; +}; + +struct rpc_timeout { + long unsigned int to_initval; + long unsigned int to_maxval; + long unsigned int to_increment; + unsigned int to_retries; + unsigned char to_exponential; +}; + +struct rpc_xprt_switch; + +struct rpc_xprt_iter_ops; + +struct rpc_xprt_iter { + struct rpc_xprt_switch *xpi_xpswitch; + struct rpc_xprt *xpi_cursor; + const struct rpc_xprt_iter_ops *xpi_ops; +}; + +struct rpc_auth; + +struct rpc_stat; + +struct rpc_iostats; + +struct rpc_program; + +struct rpc_clnt { + atomic_t cl_count; + unsigned int cl_clid; + struct list_head cl_clients; + struct list_head cl_tasks; + spinlock_t cl_lock; + struct rpc_xprt *cl_xprt; + const struct rpc_procinfo *cl_procinfo; + u32 cl_prog; + u32 cl_vers; + u32 cl_maxproc; + struct rpc_auth *cl_auth; + struct rpc_stat *cl_stats; + struct rpc_iostats *cl_metrics; + unsigned int cl_softrtry: 1; + unsigned int cl_softerr: 1; + unsigned int cl_discrtry: 1; + unsigned int cl_noretranstimeo: 1; + unsigned int cl_autobind: 1; + unsigned int cl_chatty: 1; + struct rpc_rtt *cl_rtt; + const struct rpc_timeout *cl_timeout; + atomic_t cl_swapper; + int cl_nodelen; + char cl_nodename[65]; + struct rpc_pipe_dir_head cl_pipedir_objects; + struct rpc_clnt *cl_parent; + struct rpc_rtt cl_rtt_default; + struct rpc_timeout cl_timeout_default; + const struct rpc_program *cl_program; + const char *cl_principal; + struct rpc_xprt_iter cl_xpi; + const struct cred *cl_cred; +}; + +struct rpc_xprt_ops; + +struct svc_xprt; + +struct rpc_xprt { + struct kref kref; + const struct rpc_xprt_ops *ops; + const struct rpc_timeout *timeout; + struct __kernel_sockaddr_storage addr; + size_t addrlen; + int prot; + long unsigned int cong; + long unsigned int cwnd; + size_t max_payload; + struct rpc_wait_queue binding; + struct rpc_wait_queue sending; + struct rpc_wait_queue pending; + struct rpc_wait_queue backlog; + struct list_head free; + unsigned int max_reqs; + unsigned int min_reqs; + unsigned int num_reqs; + long unsigned int state; + unsigned char resvport: 1; + unsigned char reuseport: 1; + atomic_t swapper; + unsigned int bind_index; + struct list_head xprt_switch; + long unsigned int bind_timeout; + long unsigned int reestablish_timeout; + unsigned int connect_cookie; + struct work_struct task_cleanup; + struct timer_list timer; + long unsigned int last_used; + long unsigned int idle_timeout; + long unsigned int connect_timeout; + long unsigned int max_reconnect_timeout; + atomic_long_t queuelen; + spinlock_t transport_lock; + spinlock_t reserve_lock; + spinlock_t queue_lock; + u32 xid; + struct rpc_task *snd_task; + struct list_head xmit_queue; + struct svc_xprt *bc_xprt; + struct rb_root recv_queue; + struct { + long unsigned int bind_count; + long unsigned int connect_count; + long unsigned int connect_start; + long unsigned int connect_time; + long unsigned int sends; + long unsigned int recvs; + long unsigned int bad_xids; + long unsigned int max_slots; + long long unsigned int req_u; + long long unsigned int bklog_u; + long long unsigned int sending_u; + long long unsigned int pending_u; + } stat; + struct net *xprt_net; + const char *servername; + const char *address_strings[6]; + struct callback_head rcu; +}; + +struct rpc_credops; + +struct rpc_cred { + struct hlist_node cr_hash; + struct list_head cr_lru; + struct callback_head cr_rcu; + struct rpc_auth *cr_auth; + const struct rpc_credops *cr_ops; + long unsigned int cr_expire; + long unsigned int cr_flags; + refcount_t cr_count; + const struct cred *cr_cred; +}; + +typedef u32 rpc_authflavor_t; + +struct ethhdr { + unsigned char h_dest[6]; + unsigned char h_source[6]; + __be16 h_proto; +}; + +struct flow_dissector { + unsigned int used_keys; + short unsigned int offset[27]; +}; + +struct flowi_tunnel { + __be64 tun_id; +}; + +struct flowi_common { + int flowic_oif; + int flowic_iif; + __u32 flowic_mark; + __u8 flowic_tos; + __u8 flowic_scope; + __u8 flowic_proto; + __u8 flowic_flags; + __u32 flowic_secid; + kuid_t flowic_uid; + struct flowi_tunnel flowic_tun_key; + __u32 flowic_multipath_hash; +}; + +union flowi_uli { + struct { + __be16 dport; + __be16 sport; + } ports; + struct { + __u8 type; + __u8 code; + } icmpt; + struct { + __le16 dport; + __le16 sport; + } dnports; + __be32 spi; + __be32 gre_key; + struct { + __u8 type; + } mht; +}; + +struct flowi4 { + struct flowi_common __fl_common; + __be32 saddr; + __be32 daddr; + union flowi_uli uli; +}; + +struct flowi6 { + struct flowi_common __fl_common; + struct in6_addr daddr; + struct in6_addr saddr; + __be32 flowlabel; + union flowi_uli uli; + __u32 mp_hash; +}; + +struct flowidn { + struct flowi_common __fl_common; + __le16 daddr; + __le16 saddr; + union flowi_uli uli; +}; + +struct flowi { + union { + struct flowi_common __fl_common; + struct flowi4 ip4; + struct flowi6 ip6; + struct flowidn dn; + } u; +}; + +struct ipstats_mib { + u64 mibs[37]; + struct u64_stats_sync syncp; +}; + +struct icmp_mib { + long unsigned int mibs[28]; +}; + +struct icmpmsg_mib { + atomic_long_t mibs[512]; +}; + +struct icmpv6_mib { + long unsigned int mibs[6]; +}; + +struct icmpv6_mib_device { + atomic_long_t mibs[6]; +}; + +struct icmpv6msg_mib { + atomic_long_t mibs[512]; +}; + +struct icmpv6msg_mib_device { + atomic_long_t mibs[512]; +}; + +struct tcp_mib { + long unsigned int mibs[16]; +}; + +struct udp_mib { + long unsigned int mibs[9]; +}; + +struct linux_mib { + long unsigned int mibs[120]; +}; + +struct inet_frags; + +struct fqdir { + long int high_thresh; + long int low_thresh; + int timeout; + int max_dist; + struct inet_frags *f; + struct net *net; + bool dead; + long: 56; + long: 64; + long: 64; + struct rhashtable rhashtable; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + atomic_long_t mem; + struct work_struct destroy_work; + long: 64; + long: 64; + long: 64; +}; + +struct inet_frag_queue; + +struct inet_frags { + unsigned int qsize; + void (*constructor)(struct inet_frag_queue *, const void *); + void (*destructor)(struct inet_frag_queue *); + void (*frag_expire)(struct timer_list *); + struct kmem_cache *frags_cachep; + const char *frags_cache_name; + struct rhashtable_params rhash_params; + refcount_t refcnt; + struct completion completion; +}; + +struct frag_v4_compare_key { + __be32 saddr; + __be32 daddr; + u32 user; + u32 vif; + __be16 id; + u16 protocol; +}; + +struct frag_v6_compare_key { + struct in6_addr saddr; + struct in6_addr daddr; + u32 user; + __be32 id; + u32 iif; +}; + +struct inet_frag_queue { + struct rhash_head node; + union { + struct frag_v4_compare_key v4; + struct frag_v6_compare_key v6; + } key; + struct timer_list timer; + spinlock_t lock; + refcount_t refcnt; + struct rb_root rb_fragments; + struct sk_buff *fragments_tail; + struct sk_buff *last_run_head; + ktime_t stamp; + int len; + int meat; + __u8 flags; + u16 max_size; + struct fqdir *fqdir; + struct callback_head rcu; +}; + +struct fib_rule; + +struct fib_lookup_arg; + +struct fib_rule_hdr; + +struct nlattr; + +struct netlink_ext_ack; + +struct nla_policy; + +struct fib_rules_ops { + int family; + struct list_head list; + int rule_size; + int addr_size; + int unresolved_rules; + int nr_goto_rules; + unsigned int fib_rules_seq; + int (*action)(struct fib_rule *, struct flowi *, int, struct fib_lookup_arg *); + bool (*suppress)(struct fib_rule *, struct fib_lookup_arg *); + int (*match)(struct fib_rule *, struct flowi *, int); + int (*configure)(struct fib_rule *, struct sk_buff *, struct fib_rule_hdr *, struct nlattr **, struct netlink_ext_ack *); + int (*delete)(struct fib_rule *); + int (*compare)(struct fib_rule *, struct fib_rule_hdr *, struct nlattr **); + int (*fill)(struct fib_rule *, struct sk_buff *, struct fib_rule_hdr *); + size_t (*nlmsg_payload)(struct fib_rule *); + void (*flush_cache)(struct fib_rules_ops *); + int nlgroup; + const struct nla_policy *policy; + struct list_head rules_list; + struct module *owner; + struct net *fro_net; + struct callback_head rcu; +}; + +enum tcp_ca_event { + CA_EVENT_TX_START = 0, + CA_EVENT_CWND_RESTART = 1, + CA_EVENT_COMPLETE_CWR = 2, + CA_EVENT_LOSS = 3, + CA_EVENT_ECN_NO_CE = 4, + CA_EVENT_ECN_IS_CE = 5, +}; + +struct ack_sample; + +struct rate_sample; + +union tcp_cc_info; + +struct tcp_congestion_ops { + struct list_head list; + u32 key; + u32 flags; + void (*init)(struct sock *); + void (*release)(struct sock *); + u32 (*ssthresh)(struct sock *); + void (*cong_avoid)(struct sock *, u32, u32); + void (*set_state)(struct sock *, u8); + void (*cwnd_event)(struct sock *, enum tcp_ca_event); + void (*in_ack_event)(struct sock *, u32); + u32 (*undo_cwnd)(struct sock *); + void (*pkts_acked)(struct sock *, const struct ack_sample *); + u32 (*min_tso_segs)(struct sock *); + u32 (*sndbuf_expand)(struct sock *); + void (*cong_control)(struct sock *, const struct rate_sample *); + size_t (*get_info)(struct sock *, u32, int *, union tcp_cc_info *); + char name[16]; + struct module *owner; +}; + +struct fib_notifier_ops { + int family; + struct list_head list; + unsigned int (*fib_seq_read)(struct net *); + int (*fib_dump)(struct net *, struct notifier_block *, struct netlink_ext_ack *); + struct module *owner; + struct callback_head rcu; +}; + +struct xfrm_state; + +struct lwtunnel_state; + +struct dst_entry { + struct net_device *dev; + struct dst_ops *ops; + long unsigned int _metrics; + long unsigned int expires; + struct xfrm_state *xfrm; + int (*input)(struct sk_buff *); + int (*output)(struct net *, struct sock *, struct sk_buff *); + short unsigned int flags; + short int obsolete; + short unsigned int header_len; + short unsigned int trailer_len; + atomic_t __refcnt; + int __use; + long unsigned int lastuse; + struct lwtunnel_state *lwtstate; + struct callback_head callback_head; + short int error; + short int __pad; + __u32 tclassid; +}; + +struct hh_cache { + unsigned int hh_len; + seqlock_t hh_lock; + long unsigned int hh_data[12]; +}; + +struct neigh_table; + +struct neigh_parms; + +struct neigh_ops; + +struct neighbour { + struct neighbour *next; + struct neigh_table *tbl; + struct neigh_parms *parms; + long unsigned int confirmed; + long unsigned int updated; + rwlock_t lock; + refcount_t refcnt; + unsigned int arp_queue_len_bytes; + struct sk_buff_head arp_queue; + struct timer_list timer; + long unsigned int used; + atomic_t probes; + __u8 flags; + __u8 nud_state; + __u8 type; + __u8 dead; + u8 protocol; + seqlock_t ha_lock; + int: 32; + unsigned char ha[32]; + struct hh_cache hh; + int (*output)(struct neighbour *, struct sk_buff *); + const struct neigh_ops *ops; + struct list_head gc_list; + struct callback_head rcu; + struct net_device *dev; + u8 primary_key[0]; +}; + +struct ipv6_stable_secret { + bool initialized; + struct in6_addr secret; +}; + +struct ipv6_devconf { + __s32 forwarding; + __s32 hop_limit; + __s32 mtu6; + __s32 accept_ra; + __s32 accept_redirects; + __s32 autoconf; + __s32 dad_transmits; + __s32 rtr_solicits; + __s32 rtr_solicit_interval; + __s32 rtr_solicit_max_interval; + __s32 rtr_solicit_delay; + __s32 force_mld_version; + __s32 mldv1_unsolicited_report_interval; + __s32 mldv2_unsolicited_report_interval; + __s32 use_tempaddr; + __s32 temp_valid_lft; + __s32 temp_prefered_lft; + __s32 regen_max_retry; + __s32 max_desync_factor; + __s32 max_addresses; + __s32 accept_ra_defrtr; + __s32 accept_ra_min_hop_limit; + __s32 accept_ra_pinfo; + __s32 ignore_routes_with_linkdown; + __s32 proxy_ndp; + __s32 accept_source_route; + __s32 accept_ra_from_local; + __s32 disable_ipv6; + __s32 drop_unicast_in_l2_multicast; + __s32 accept_dad; + __s32 force_tllao; + __s32 ndisc_notify; + __s32 suppress_frag_ndisc; + __s32 accept_ra_mtu; + __s32 drop_unsolicited_na; + struct ipv6_stable_secret stable_secret; + __s32 use_oif_addrs_only; + __s32 keep_addr_on_down; + __s32 seg6_enabled; + __u32 enhanced_dad; + __u32 addr_gen_mode; + __s32 disable_policy; + __s32 ndisc_tclass; + struct ctl_table_header *sysctl_header; +}; + +struct nf_queue_entry; + +struct nf_queue_handler { + int (*outfn)(struct nf_queue_entry *, unsigned int); + void (*nf_hook_drop)(struct net *); +}; + +enum nf_log_type { + NF_LOG_TYPE_LOG = 0, + NF_LOG_TYPE_ULOG = 1, + NF_LOG_TYPE_MAX = 2, +}; + +typedef u8 u_int8_t; + +struct nf_loginfo; + +typedef void nf_logfn(struct net *, u_int8_t, unsigned int, const struct sk_buff *, const struct net_device *, const struct net_device *, const struct nf_loginfo *, const char *); + +struct nf_logger { + char *name; + enum nf_log_type type; + nf_logfn *logfn; + struct module *me; +}; + +struct hlist_nulls_head { + struct hlist_nulls_node *first; +}; + +struct ip_conntrack_stat { + unsigned int found; + unsigned int invalid; + unsigned int ignore; + unsigned int insert; + unsigned int insert_failed; + unsigned int drop; + unsigned int early_drop; + unsigned int error; + unsigned int expect_new; + unsigned int expect_create; + unsigned int expect_delete; + unsigned int search_restart; +}; + +struct ct_pcpu { + spinlock_t lock; + struct hlist_nulls_head unconfirmed; + struct hlist_nulls_head dying; +}; + +typedef enum { + SS_FREE = 0, + SS_UNCONNECTED = 1, + SS_CONNECTING = 2, + SS_CONNECTED = 3, + SS_DISCONNECTING = 4, +} socket_state; + +struct socket_wq { + wait_queue_head_t wait; + struct fasync_struct *fasync_list; + long unsigned int flags; + struct callback_head rcu; + long: 64; +}; + +struct proto_ops; + +struct socket { + socket_state state; + short int type; + long unsigned int flags; + struct file *file; + struct sock *sk; + const struct proto_ops *ops; + long: 64; + long: 64; + long: 64; + struct socket_wq wq; +}; + +typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *, unsigned int, size_t); + +struct proto_ops { + int family; + struct module *owner; + int (*release)(struct socket *); + int (*bind)(struct socket *, struct sockaddr *, int); + int (*connect)(struct socket *, struct sockaddr *, int, int); + int (*socketpair)(struct socket *, struct socket *); + int (*accept)(struct socket *, struct socket *, int, bool); + int (*getname)(struct socket *, struct sockaddr *, int); + __poll_t (*poll)(struct file *, struct socket *, struct poll_table_struct *); + int (*ioctl)(struct socket *, unsigned int, long unsigned int); + int (*compat_ioctl)(struct socket *, unsigned int, long unsigned int); + int (*gettstamp)(struct socket *, void *, bool, bool); + int (*listen)(struct socket *, int); + int (*shutdown)(struct socket *, int); + int (*setsockopt)(struct socket *, int, int, char *, unsigned int); + int (*getsockopt)(struct socket *, int, int, char *, int *); + int (*compat_setsockopt)(struct socket *, int, int, char *, unsigned int); + int (*compat_getsockopt)(struct socket *, int, int, char *, int *); + int (*sendmsg)(struct socket *, struct msghdr *, size_t); + int (*recvmsg)(struct socket *, struct msghdr *, size_t, int); + int (*mmap)(struct file *, struct socket *, struct vm_area_struct *); + ssize_t (*sendpage)(struct socket *, struct page *, int, size_t, int); + ssize_t (*splice_read)(struct socket *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); + int (*set_peek_off)(struct sock *, int); + int (*peek_len)(struct socket *); + int (*read_sock)(struct sock *, read_descriptor_t *, sk_read_actor_t); + int (*sendpage_locked)(struct sock *, struct page *, int, size_t, int); + int (*sendmsg_locked)(struct sock *, struct msghdr *, size_t); + int (*set_rcvlowat)(struct sock *, int); +}; + +enum swiotlb_force { + SWIOTLB_NORMAL = 0, + SWIOTLB_FORCE = 1, + SWIOTLB_NO_FORCE = 2, +}; + +struct pipe_buf_operations; + +struct pipe_buffer { + struct page *page; + unsigned int offset; + unsigned int len; + const struct pipe_buf_operations *ops; + unsigned int flags; + long unsigned int private; +}; + +struct pipe_buf_operations { + int (*confirm)(struct pipe_inode_info *, struct pipe_buffer *); + void (*release)(struct pipe_inode_info *, struct pipe_buffer *); + int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); + bool (*get)(struct pipe_inode_info *, struct pipe_buffer *); +}; + +struct skb_ext { + refcount_t refcnt; + u8 offset[1]; + u8 chunks; + short: 16; + char data[0]; +}; + +struct skb_checksum_ops { + __wsum (*update)(const void *, int, __wsum); + __wsum (*combine)(__wsum, __wsum, int, int); +}; + +struct pernet_operations { + struct list_head list; + int (*init)(struct net *); + void (*pre_exit)(struct net *); + void (*exit)(struct net *); + void (*exit_batch)(struct list_head *); + unsigned int *id; + size_t size; +}; + +struct auth_cred { + const struct cred *cred; + const char *principal; +}; + +struct rpc_authops; + +struct rpc_cred_cache; + +struct rpc_auth { + unsigned int au_cslack; + unsigned int au_rslack; + unsigned int au_verfsize; + unsigned int au_ralign; + unsigned int au_flags; + const struct rpc_authops *au_ops; + rpc_authflavor_t au_flavor; + refcount_t au_count; + struct rpc_cred_cache *au_credcache; +}; + +struct rpc_credops { + const char *cr_name; + int (*cr_init)(struct rpc_auth *, struct rpc_cred *); + void (*crdestroy)(struct rpc_cred *); + int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); + int (*crmarshal)(struct rpc_task *, struct xdr_stream *); + int (*crrefresh)(struct rpc_task *); + int (*crvalidate)(struct rpc_task *, struct xdr_stream *); + int (*crwrap_req)(struct rpc_task *, struct xdr_stream *); + int (*crunwrap_resp)(struct rpc_task *, struct xdr_stream *); + int (*crkey_timeout)(struct rpc_cred *); + char * (*crstringify_acceptor)(struct rpc_cred *); + bool (*crneed_reencode)(struct rpc_task *); +}; + +struct rpc_auth_create_args; + +struct rpcsec_gss_info; + +struct rpc_authops { + struct module *owner; + rpc_authflavor_t au_flavor; + char *au_name; + struct rpc_auth * (*create)(const struct rpc_auth_create_args *, struct rpc_clnt *); + void (*destroy)(struct rpc_auth *); + int (*hash_cred)(struct auth_cred *, unsigned int); + struct rpc_cred * (*lookup_cred)(struct rpc_auth *, struct auth_cred *, int); + struct rpc_cred * (*crcreate)(struct rpc_auth *, struct auth_cred *, int, gfp_t); + int (*list_pseudoflavors)(rpc_authflavor_t *, int); + rpc_authflavor_t (*info2flavor)(struct rpcsec_gss_info *); + int (*flavor2info)(rpc_authflavor_t, struct rpcsec_gss_info *); + int (*key_timeout)(struct rpc_auth *, struct rpc_cred *); +}; + +struct rpc_auth_create_args { + rpc_authflavor_t pseudoflavor; + const char *target_name; +}; + +struct rpcsec_gss_oid { + unsigned int len; + u8 data[32]; +}; + +struct rpcsec_gss_info { + struct rpcsec_gss_oid oid; + u32 qop; + u32 service; +}; + +struct rpc_xprt_ops { + void (*set_buffer_size)(struct rpc_xprt *, size_t, size_t); + int (*reserve_xprt)(struct rpc_xprt *, struct rpc_task *); + void (*release_xprt)(struct rpc_xprt *, struct rpc_task *); + void (*alloc_slot)(struct rpc_xprt *, struct rpc_task *); + void (*free_slot)(struct rpc_xprt *, struct rpc_rqst *); + void (*rpcbind)(struct rpc_task *); + void (*set_port)(struct rpc_xprt *, short unsigned int); + void (*connect)(struct rpc_xprt *, struct rpc_task *); + int (*buf_alloc)(struct rpc_task *); + void (*buf_free)(struct rpc_task *); + void (*prepare_request)(struct rpc_rqst *); + int (*send_request)(struct rpc_rqst *); + void (*wait_for_reply_request)(struct rpc_task *); + void (*timer)(struct rpc_xprt *, struct rpc_task *); + void (*release_request)(struct rpc_task *); + void (*close)(struct rpc_xprt *); + void (*destroy)(struct rpc_xprt *); + void (*set_connect_timeout)(struct rpc_xprt *, long unsigned int, long unsigned int); + void (*print_stats)(struct rpc_xprt *, struct seq_file *); + int (*enable_swap)(struct rpc_xprt *); + void (*disable_swap)(struct rpc_xprt *); + void (*inject_disconnect)(struct rpc_xprt *); + int (*bc_setup)(struct rpc_xprt *, unsigned int); + size_t (*bc_maxpayload)(struct rpc_xprt *); + unsigned int (*bc_num_slots)(struct rpc_xprt *); + void (*bc_free_rqst)(struct rpc_rqst *); + void (*bc_destroy)(struct rpc_xprt *, unsigned int); +}; + +struct rpc_xprt_switch { + spinlock_t xps_lock; + struct kref xps_kref; + unsigned int xps_nxprts; + unsigned int xps_nactive; + atomic_long_t xps_queuelen; + struct list_head xps_xprt_list; + struct net *xps_net; + const struct rpc_xprt_iter_ops *xps_iter_ops; + struct callback_head xps_rcu; +}; + +struct rpc_stat { + const struct rpc_program *program; + unsigned int netcnt; + unsigned int netudpcnt; + unsigned int nettcpcnt; + unsigned int nettcpconn; + unsigned int netreconn; + unsigned int rpccnt; + unsigned int rpcretrans; + unsigned int rpcauthrefresh; + unsigned int rpcgarbage; +}; + +struct rpc_version; + +struct rpc_program { + const char *name; + u32 number; + unsigned int nrvers; + const struct rpc_version **version; + struct rpc_stat *stats; + const char *pipe_dir_name; +}; + +struct ipv6_params { + __s32 disable_ipv6; + __s32 autoconf; +}; + +struct dql { + unsigned int num_queued; + unsigned int adj_limit; + unsigned int last_obj_cnt; + long: 32; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + unsigned int limit; + unsigned int num_completed; + unsigned int prev_ovlimit; + unsigned int prev_num_queued; + unsigned int prev_last_obj_cnt; + unsigned int lowest_slack; + long unsigned int slack_start_time; + unsigned int max_limit; + unsigned int min_limit; + unsigned int slack_hold_time; + long: 32; + long: 64; + long: 64; +}; + +struct ethtool_drvinfo { + __u32 cmd; + char driver[32]; + char version[32]; + char fw_version[32]; + char bus_info[32]; + char erom_version[32]; + char reserved2[12]; + __u32 n_priv_flags; + __u32 n_stats; + __u32 testinfo_len; + __u32 eedump_len; + __u32 regdump_len; +}; + +struct ethtool_wolinfo { + __u32 cmd; + __u32 supported; + __u32 wolopts; + __u8 sopass[6]; +}; + +struct ethtool_tunable { + __u32 cmd; + __u32 id; + __u32 type_id; + __u32 len; + void *data[0]; +}; + +struct ethtool_regs { + __u32 cmd; + __u32 version; + __u32 len; + __u8 data[0]; +}; + +struct ethtool_eeprom { + __u32 cmd; + __u32 magic; + __u32 offset; + __u32 len; + __u8 data[0]; +}; + +struct ethtool_eee { + __u32 cmd; + __u32 supported; + __u32 advertised; + __u32 lp_advertised; + __u32 eee_active; + __u32 eee_enabled; + __u32 tx_lpi_enabled; + __u32 tx_lpi_timer; + __u32 reserved[2]; +}; + +struct ethtool_modinfo { + __u32 cmd; + __u32 type; + __u32 eeprom_len; + __u32 reserved[8]; +}; + +struct ethtool_coalesce { + __u32 cmd; + __u32 rx_coalesce_usecs; + __u32 rx_max_coalesced_frames; + __u32 rx_coalesce_usecs_irq; + __u32 rx_max_coalesced_frames_irq; + __u32 tx_coalesce_usecs; + __u32 tx_max_coalesced_frames; + __u32 tx_coalesce_usecs_irq; + __u32 tx_max_coalesced_frames_irq; + __u32 stats_block_coalesce_usecs; + __u32 use_adaptive_rx_coalesce; + __u32 use_adaptive_tx_coalesce; + __u32 pkt_rate_low; + __u32 rx_coalesce_usecs_low; + __u32 rx_max_coalesced_frames_low; + __u32 tx_coalesce_usecs_low; + __u32 tx_max_coalesced_frames_low; + __u32 pkt_rate_high; + __u32 rx_coalesce_usecs_high; + __u32 rx_max_coalesced_frames_high; + __u32 tx_coalesce_usecs_high; + __u32 tx_max_coalesced_frames_high; + __u32 rate_sample_interval; +}; + +struct ethtool_ringparam { + __u32 cmd; + __u32 rx_max_pending; + __u32 rx_mini_max_pending; + __u32 rx_jumbo_max_pending; + __u32 tx_max_pending; + __u32 rx_pending; + __u32 rx_mini_pending; + __u32 rx_jumbo_pending; + __u32 tx_pending; +}; + +struct ethtool_channels { + __u32 cmd; + __u32 max_rx; + __u32 max_tx; + __u32 max_other; + __u32 max_combined; + __u32 rx_count; + __u32 tx_count; + __u32 other_count; + __u32 combined_count; +}; + +struct ethtool_pauseparam { + __u32 cmd; + __u32 autoneg; + __u32 rx_pause; + __u32 tx_pause; +}; + +struct ethtool_test { + __u32 cmd; + __u32 flags; + __u32 reserved; + __u32 len; + __u64 data[0]; +}; + +struct ethtool_stats { + __u32 cmd; + __u32 n_stats; + __u64 data[0]; +}; + +struct ethtool_tcpip4_spec { + __be32 ip4src; + __be32 ip4dst; + __be16 psrc; + __be16 pdst; + __u8 tos; +}; + +struct ethtool_ah_espip4_spec { + __be32 ip4src; + __be32 ip4dst; + __be32 spi; + __u8 tos; +}; + +struct ethtool_usrip4_spec { + __be32 ip4src; + __be32 ip4dst; + __be32 l4_4_bytes; + __u8 tos; + __u8 ip_ver; + __u8 proto; +}; + +struct ethtool_tcpip6_spec { + __be32 ip6src[4]; + __be32 ip6dst[4]; + __be16 psrc; + __be16 pdst; + __u8 tclass; +}; + +struct ethtool_ah_espip6_spec { + __be32 ip6src[4]; + __be32 ip6dst[4]; + __be32 spi; + __u8 tclass; +}; + +struct ethtool_usrip6_spec { + __be32 ip6src[4]; + __be32 ip6dst[4]; + __be32 l4_4_bytes; + __u8 tclass; + __u8 l4_proto; +}; + +union ethtool_flow_union { + struct ethtool_tcpip4_spec tcp_ip4_spec; + struct ethtool_tcpip4_spec udp_ip4_spec; + struct ethtool_tcpip4_spec sctp_ip4_spec; + struct ethtool_ah_espip4_spec ah_ip4_spec; + struct ethtool_ah_espip4_spec esp_ip4_spec; + struct ethtool_usrip4_spec usr_ip4_spec; + struct ethtool_tcpip6_spec tcp_ip6_spec; + struct ethtool_tcpip6_spec udp_ip6_spec; + struct ethtool_tcpip6_spec sctp_ip6_spec; + struct ethtool_ah_espip6_spec ah_ip6_spec; + struct ethtool_ah_espip6_spec esp_ip6_spec; + struct ethtool_usrip6_spec usr_ip6_spec; + struct ethhdr ether_spec; + __u8 hdata[52]; +}; + +struct ethtool_flow_ext { + __u8 padding[2]; + unsigned char h_dest[6]; + __be16 vlan_etype; + __be16 vlan_tci; + __be32 data[2]; +}; + +struct ethtool_rx_flow_spec { + __u32 flow_type; + union ethtool_flow_union h_u; + struct ethtool_flow_ext h_ext; + union ethtool_flow_union m_u; + struct ethtool_flow_ext m_ext; + __u64 ring_cookie; + __u32 location; +}; + +struct ethtool_rxnfc { + __u32 cmd; + __u32 flow_type; + __u64 data; + struct ethtool_rx_flow_spec fs; + union { + __u32 rule_cnt; + __u32 rss_context; + }; + __u32 rule_locs[0]; +}; + +struct ethtool_flash { + __u32 cmd; + __u32 region; + char data[128]; +}; + +struct ethtool_dump { + __u32 cmd; + __u32 version; + __u32 flag; + __u32 len; + __u8 data[0]; +}; + +struct ethtool_ts_info { + __u32 cmd; + __u32 so_timestamping; + __s32 phc_index; + __u32 tx_types; + __u32 tx_reserved[3]; + __u32 rx_filters; + __u32 rx_reserved[3]; +}; + +struct ethtool_fecparam { + __u32 cmd; + __u32 active_fec; + __u32 fec; + __u32 reserved; +}; + +struct ethtool_link_settings { + __u32 cmd; + __u32 speed; + __u8 duplex; + __u8 port; + __u8 phy_address; + __u8 autoneg; + __u8 mdio_support; + __u8 eth_tp_mdix; + __u8 eth_tp_mdix_ctrl; + __s8 link_mode_masks_nwords; + __u8 transceiver; + __u8 reserved1[3]; + __u32 reserved[7]; + __u32 link_mode_masks[0]; +}; + +enum ethtool_phys_id_state { + ETHTOOL_ID_INACTIVE = 0, + ETHTOOL_ID_ACTIVE = 1, + ETHTOOL_ID_ON = 2, + ETHTOOL_ID_OFF = 3, +}; + +struct ethtool_link_ksettings { + struct ethtool_link_settings base; + struct { + long unsigned int supported[2]; + long unsigned int advertising[2]; + long unsigned int lp_advertising[2]; + } link_modes; +}; + +struct ethtool_ops { + void (*get_drvinfo)(struct net_device *, struct ethtool_drvinfo *); + int (*get_regs_len)(struct net_device *); + void (*get_regs)(struct net_device *, struct ethtool_regs *, void *); + void (*get_wol)(struct net_device *, struct ethtool_wolinfo *); + int (*set_wol)(struct net_device *, struct ethtool_wolinfo *); + u32 (*get_msglevel)(struct net_device *); + void (*set_msglevel)(struct net_device *, u32); + int (*nway_reset)(struct net_device *); + u32 (*get_link)(struct net_device *); + int (*get_eeprom_len)(struct net_device *); + int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); + int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); + int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); + int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *); + void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *); + int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *); + void (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam *); + int (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam *); + void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); + void (*get_strings)(struct net_device *, u32, u8 *); + int (*set_phys_id)(struct net_device *, enum ethtool_phys_id_state); + void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *); + int (*begin)(struct net_device *); + void (*complete)(struct net_device *); + u32 (*get_priv_flags)(struct net_device *); + int (*set_priv_flags)(struct net_device *, u32); + int (*get_sset_count)(struct net_device *, int); + int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, u32 *); + int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); + int (*flash_device)(struct net_device *, struct ethtool_flash *); + int (*reset)(struct net_device *, u32 *); + u32 (*get_rxfh_key_size)(struct net_device *); + u32 (*get_rxfh_indir_size)(struct net_device *); + int (*get_rxfh)(struct net_device *, u32 *, u8 *, u8 *); + int (*set_rxfh)(struct net_device *, const u32 *, const u8 *, const u8); + int (*get_rxfh_context)(struct net_device *, u32 *, u8 *, u8 *, u32); + int (*set_rxfh_context)(struct net_device *, const u32 *, const u8 *, const u8, u32 *, bool); + void (*get_channels)(struct net_device *, struct ethtool_channels *); + int (*set_channels)(struct net_device *, struct ethtool_channels *); + int (*get_dump_flag)(struct net_device *, struct ethtool_dump *); + int (*get_dump_data)(struct net_device *, struct ethtool_dump *, void *); + int (*set_dump)(struct net_device *, struct ethtool_dump *); + int (*get_ts_info)(struct net_device *, struct ethtool_ts_info *); + int (*get_module_info)(struct net_device *, struct ethtool_modinfo *); + int (*get_module_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); + int (*get_eee)(struct net_device *, struct ethtool_eee *); + int (*set_eee)(struct net_device *, struct ethtool_eee *); + int (*get_tunable)(struct net_device *, const struct ethtool_tunable *, void *); + int (*set_tunable)(struct net_device *, const struct ethtool_tunable *, const void *); + int (*get_per_queue_coalesce)(struct net_device *, u32, struct ethtool_coalesce *); + int (*set_per_queue_coalesce)(struct net_device *, u32, struct ethtool_coalesce *); + int (*get_link_ksettings)(struct net_device *, struct ethtool_link_ksettings *); + int (*set_link_ksettings)(struct net_device *, const struct ethtool_link_ksettings *); + int (*get_fecparam)(struct net_device *, struct ethtool_fecparam *); + int (*set_fecparam)(struct net_device *, struct ethtool_fecparam *); + void (*get_ethtool_phy_stats)(struct net_device *, struct ethtool_stats *, u64 *); +}; + +struct xdp_mem_info { + u32 type; + u32 id; +}; + +struct xdp_rxq_info { + struct net_device *dev; + u32 queue_index; + u32 reg_state; + struct xdp_mem_info mem; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; +}; + +struct xdp_frame { + void *data; + u16 len; + u16 headroom; + u16 metasize; + struct xdp_mem_info mem; + struct net_device *dev_rx; +}; + +struct nlmsghdr { + __u32 nlmsg_len; + __u16 nlmsg_type; + __u16 nlmsg_flags; + __u32 nlmsg_seq; + __u32 nlmsg_pid; +}; + +struct nlattr { + __u16 nla_len; + __u16 nla_type; +}; + +struct netlink_ext_ack { + const char *_msg; + const struct nlattr *bad_attr; + u8 cookie[20]; + u8 cookie_len; +}; + +struct netlink_callback { + struct sk_buff *skb; + const struct nlmsghdr *nlh; + int (*dump)(struct sk_buff *, struct netlink_callback *); + int (*done)(struct netlink_callback *); + void *data; + struct module *module; + struct netlink_ext_ack *extack; + u16 family; + u16 min_dump_alloc; + bool strict_check; + u16 answer_flags; + unsigned int prev_seq; + unsigned int seq; + union { + u8 ctx[48]; + long int args[6]; + }; +}; + +struct ndmsg { + __u8 ndm_family; + __u8 ndm_pad1; + __u16 ndm_pad2; + __s32 ndm_ifindex; + __u16 ndm_state; + __u8 ndm_flags; + __u8 ndm_type; +}; + +struct rtnl_link_stats64 { + __u64 rx_packets; + __u64 tx_packets; + __u64 rx_bytes; + __u64 tx_bytes; + __u64 rx_errors; + __u64 tx_errors; + __u64 rx_dropped; + __u64 tx_dropped; + __u64 multicast; + __u64 collisions; + __u64 rx_length_errors; + __u64 rx_over_errors; + __u64 rx_crc_errors; + __u64 rx_frame_errors; + __u64 rx_fifo_errors; + __u64 rx_missed_errors; + __u64 tx_aborted_errors; + __u64 tx_carrier_errors; + __u64 tx_fifo_errors; + __u64 tx_heartbeat_errors; + __u64 tx_window_errors; + __u64 rx_compressed; + __u64 tx_compressed; + __u64 rx_nohandler; +}; + +struct ifla_vf_guid { + __u32 vf; + __u64 guid; +}; + +struct ifla_vf_stats { + __u64 rx_packets; + __u64 tx_packets; + __u64 rx_bytes; + __u64 tx_bytes; + __u64 broadcast; + __u64 multicast; + __u64 rx_dropped; + __u64 tx_dropped; +}; + +struct ifla_vf_info { + __u32 vf; + __u8 mac[32]; + __u32 vlan; + __u32 qos; + __u32 spoofchk; + __u32 linkstate; + __u32 min_tx_rate; + __u32 max_tx_rate; + __u32 rss_query_en; + __u32 trusted; + __be16 vlan_proto; +}; + +struct tc_stats { + __u64 bytes; + __u32 packets; + __u32 drops; + __u32 overlimits; + __u32 bps; + __u32 pps; + __u32 qlen; + __u32 backlog; +}; + +struct tc_sizespec { + unsigned char cell_log; + unsigned char size_log; + short int cell_align; + int overhead; + unsigned int linklayer; + unsigned int mpu; + unsigned int mtu; + unsigned int tsize; +}; + +enum netdev_tx { + __NETDEV_TX_MIN = 2147483648, + NETDEV_TX_OK = 0, + NETDEV_TX_BUSY = 16, +}; + +typedef enum netdev_tx netdev_tx_t; + +struct header_ops { + int (*create)(struct sk_buff *, struct net_device *, short unsigned int, const void *, const void *, unsigned int); + int (*parse)(const struct sk_buff *, unsigned char *); + int (*cache)(const struct neighbour *, struct hh_cache *, __be16); + void (*cache_update)(struct hh_cache *, const struct net_device *, const unsigned char *); + bool (*validate)(const char *, unsigned int); + __be16 (*parse_protocol)(const struct sk_buff *); +}; + +struct gro_list { + struct list_head list; + int count; +}; + +struct napi_struct { + struct list_head poll_list; + long unsigned int state; + int weight; + long unsigned int gro_bitmask; + int (*poll)(struct napi_struct *, int); + int poll_owner; + struct net_device *dev; + struct gro_list gro_hash[8]; + struct sk_buff *skb; + struct list_head rx_list; + int rx_count; + struct hrtimer timer; + struct list_head dev_list; + struct hlist_node napi_hash_node; + unsigned int napi_id; +}; + +struct xdp_umem; + +struct netdev_queue { + struct net_device *dev; + struct Qdisc *qdisc; + struct Qdisc *qdisc_sleeping; + struct kobject kobj; + int numa_node; + long unsigned int tx_maxrate; + long unsigned int trans_timeout; + struct net_device *sb_dev; + struct xdp_umem *umem; + spinlock_t _xmit_lock; + int xmit_lock_owner; + long unsigned int trans_start; + long unsigned int state; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + struct dql dql; +}; + +struct qdisc_skb_head { + struct sk_buff *head; + struct sk_buff *tail; + __u32 qlen; + spinlock_t lock; +}; + +struct gnet_stats_basic_packed { + __u64 bytes; + __u64 packets; +}; + +struct gnet_stats_queue { + __u32 qlen; + __u32 backlog; + __u32 drops; + __u32 requeues; + __u32 overlimits; +}; + +struct Qdisc_ops; + +struct qdisc_size_table; + +struct net_rate_estimator; + +struct gnet_stats_basic_cpu; + +struct Qdisc { + int (*enqueue)(struct sk_buff *, struct Qdisc *, struct sk_buff **); + struct sk_buff * (*dequeue)(struct Qdisc *); + unsigned int flags; + u32 limit; + const struct Qdisc_ops *ops; + struct qdisc_size_table *stab; + struct hlist_node hash; + u32 handle; + u32 parent; + struct netdev_queue *dev_queue; + struct net_rate_estimator *rate_est; + struct gnet_stats_basic_cpu *cpu_bstats; + struct gnet_stats_queue *cpu_qstats; + int padded; + refcount_t refcnt; + long: 64; + long: 64; + long: 64; + struct sk_buff_head gso_skb; + struct qdisc_skb_head q; + struct gnet_stats_basic_packed bstats; + seqcount_t running; + struct gnet_stats_queue qstats; + long unsigned int state; + struct Qdisc *next_sched; + struct sk_buff_head skb_bad_txq; + spinlock_t busylock; + spinlock_t seqlock; + bool empty; + struct callback_head rcu; + long: 64; + long: 64; + long: 64; + long: 64; +}; + +struct rps_map { + unsigned int len; + struct callback_head rcu; + u16 cpus[0]; +}; + +struct rps_dev_flow { + u16 cpu; + u16 filter; + unsigned int last_qtail; +}; + +struct rps_dev_flow_table { + unsigned int mask; + struct callback_head rcu; + struct rps_dev_flow flows[0]; +}; + +struct rps_sock_flow_table { + u32 mask; + long: 32; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + u32 ents[0]; +}; + +struct netdev_rx_queue { + struct rps_map *rps_map; + struct rps_dev_flow_table *rps_flow_table; + struct kobject kobj; + struct net_device *dev; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + struct xdp_rxq_info xdp_rxq; + struct xdp_umem *umem; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; +}; + +struct xps_map { + unsigned int len; + unsigned int alloc_len; + struct callback_head rcu; + u16 queues[0]; +}; + +struct xps_dev_maps { + struct callback_head rcu; + struct xps_map *attr_map[0]; +}; + +struct netdev_phys_item_id { + unsigned char id[32]; + unsigned char id_len; +}; + +enum tc_setup_type { + TC_SETUP_QDISC_MQPRIO = 0, + TC_SETUP_CLSU32 = 1, + TC_SETUP_CLSFLOWER = 2, + TC_SETUP_CLSMATCHALL = 3, + TC_SETUP_CLSBPF = 4, + TC_SETUP_BLOCK = 5, + TC_SETUP_QDISC_CBS = 6, + TC_SETUP_QDISC_RED = 7, + TC_SETUP_QDISC_PRIO = 8, + TC_SETUP_QDISC_MQ = 9, + TC_SETUP_QDISC_ETF = 10, + TC_SETUP_ROOT_QDISC = 11, + TC_SETUP_QDISC_GRED = 12, + TC_SETUP_QDISC_TAPRIO = 13, + TC_SETUP_FT = 14, +}; + +enum bpf_netdev_command { + XDP_SETUP_PROG = 0, + XDP_SETUP_PROG_HW = 1, + XDP_QUERY_PROG = 2, + XDP_QUERY_PROG_HW = 3, + BPF_OFFLOAD_MAP_ALLOC = 4, + BPF_OFFLOAD_MAP_FREE = 5, + XDP_SETUP_XSK_UMEM = 6, +}; + +struct netdev_bpf { + enum bpf_netdev_command command; + union { + struct { + u32 flags; + struct bpf_prog *prog; + struct netlink_ext_ack *extack; + }; + struct { + u32 prog_id; + u32 prog_flags; + }; + struct { + struct bpf_offloaded_map *offmap; + }; + struct { + struct xdp_umem *umem; + u16 queue_id; + } xsk; + }; +}; + +struct dev_ifalias { + struct callback_head rcuhead; + char ifalias[0]; +}; + +struct netdev_name_node { + struct hlist_node hlist; + struct list_head list; + struct net_device *dev; + const char *name; +}; + +struct udp_tunnel_info; + +struct devlink_port; + +struct net_device_ops { + int (*ndo_init)(struct net_device *); + void (*ndo_uninit)(struct net_device *); + int (*ndo_open)(struct net_device *); + int (*ndo_stop)(struct net_device *); + netdev_tx_t (*ndo_start_xmit)(struct sk_buff *, struct net_device *); + netdev_features_t (*ndo_features_check)(struct sk_buff *, struct net_device *, netdev_features_t); + u16 (*ndo_select_queue)(struct net_device *, struct sk_buff *, struct net_device *); + void (*ndo_change_rx_flags)(struct net_device *, int); + void (*ndo_set_rx_mode)(struct net_device *); + int (*ndo_set_mac_address)(struct net_device *, void *); + int (*ndo_validate_addr)(struct net_device *); + int (*ndo_do_ioctl)(struct net_device *, struct ifreq *, int); + int (*ndo_set_config)(struct net_device *, struct ifmap *); + int (*ndo_change_mtu)(struct net_device *, int); + int (*ndo_neigh_setup)(struct net_device *, struct neigh_parms *); + void (*ndo_tx_timeout)(struct net_device *); + void (*ndo_get_stats64)(struct net_device *, struct rtnl_link_stats64 *); + bool (*ndo_has_offload_stats)(const struct net_device *, int); + int (*ndo_get_offload_stats)(int, const struct net_device *, void *); + struct net_device_stats * (*ndo_get_stats)(struct net_device *); + int (*ndo_vlan_rx_add_vid)(struct net_device *, __be16, u16); + int (*ndo_vlan_rx_kill_vid)(struct net_device *, __be16, u16); + void (*ndo_poll_controller)(struct net_device *); + int (*ndo_netpoll_setup)(struct net_device *, struct netpoll_info *); + void (*ndo_netpoll_cleanup)(struct net_device *); + int (*ndo_set_vf_mac)(struct net_device *, int, u8 *); + int (*ndo_set_vf_vlan)(struct net_device *, int, u16, u8, __be16); + int (*ndo_set_vf_rate)(struct net_device *, int, int, int); + int (*ndo_set_vf_spoofchk)(struct net_device *, int, bool); + int (*ndo_set_vf_trust)(struct net_device *, int, bool); + int (*ndo_get_vf_config)(struct net_device *, int, struct ifla_vf_info *); + int (*ndo_set_vf_link_state)(struct net_device *, int, int); + int (*ndo_get_vf_stats)(struct net_device *, int, struct ifla_vf_stats *); + int (*ndo_set_vf_port)(struct net_device *, int, struct nlattr **); + int (*ndo_get_vf_port)(struct net_device *, int, struct sk_buff *); + int (*ndo_get_vf_guid)(struct net_device *, int, struct ifla_vf_guid *, struct ifla_vf_guid *); + int (*ndo_set_vf_guid)(struct net_device *, int, u64, int); + int (*ndo_set_vf_rss_query_en)(struct net_device *, int, bool); + int (*ndo_setup_tc)(struct net_device *, enum tc_setup_type, void *); + int (*ndo_rx_flow_steer)(struct net_device *, const struct sk_buff *, u16, u32); + int (*ndo_add_slave)(struct net_device *, struct net_device *, struct netlink_ext_ack *); + int (*ndo_del_slave)(struct net_device *, struct net_device *); + netdev_features_t (*ndo_fix_features)(struct net_device *, netdev_features_t); + int (*ndo_set_features)(struct net_device *, netdev_features_t); + int (*ndo_neigh_construct)(struct net_device *, struct neighbour *); + void (*ndo_neigh_destroy)(struct net_device *, struct neighbour *); + int (*ndo_fdb_add)(struct ndmsg *, struct nlattr **, struct net_device *, const unsigned char *, u16, u16, struct netlink_ext_ack *); + int (*ndo_fdb_del)(struct ndmsg *, struct nlattr **, struct net_device *, const unsigned char *, u16); + int (*ndo_fdb_dump)(struct sk_buff *, struct netlink_callback *, struct net_device *, struct net_device *, int *); + int (*ndo_fdb_get)(struct sk_buff *, struct nlattr **, struct net_device *, const unsigned char *, u16, u32, u32, struct netlink_ext_ack *); + int (*ndo_bridge_setlink)(struct net_device *, struct nlmsghdr *, u16, struct netlink_ext_ack *); + int (*ndo_bridge_getlink)(struct sk_buff *, u32, u32, struct net_device *, u32, int); + int (*ndo_bridge_dellink)(struct net_device *, struct nlmsghdr *, u16); + int (*ndo_change_carrier)(struct net_device *, bool); + int (*ndo_get_phys_port_id)(struct net_device *, struct netdev_phys_item_id *); + int (*ndo_get_port_parent_id)(struct net_device *, struct netdev_phys_item_id *); + int (*ndo_get_phys_port_name)(struct net_device *, char *, size_t); + void (*ndo_udp_tunnel_add)(struct net_device *, struct udp_tunnel_info *); + void (*ndo_udp_tunnel_del)(struct net_device *, struct udp_tunnel_info *); + void * (*ndo_dfwd_add_station)(struct net_device *, struct net_device *); + void (*ndo_dfwd_del_station)(struct net_device *, void *); + int (*ndo_set_tx_maxrate)(struct net_device *, int, u32); + int (*ndo_get_iflink)(const struct net_device *); + int (*ndo_change_proto_down)(struct net_device *, bool); + int (*ndo_fill_metadata_dst)(struct net_device *, struct sk_buff *); + void (*ndo_set_rx_headroom)(struct net_device *, int); + int (*ndo_bpf)(struct net_device *, struct netdev_bpf *); + int (*ndo_xdp_xmit)(struct net_device *, int, struct xdp_frame **, u32); + int (*ndo_xsk_wakeup)(struct net_device *, u32, u32); + struct devlink_port * (*ndo_get_devlink_port)(struct net_device *); +}; + +struct neigh_parms { + possible_net_t net; + struct net_device *dev; + struct list_head list; + int (*neigh_setup)(struct neighbour *); + struct neigh_table *tbl; + void *sysctl_table; + int dead; + refcount_t refcnt; + struct callback_head callback_head; + int reachable_time; + int data[13]; + long unsigned int data_state[1]; +}; + +struct pcpu_lstats { + u64_stats_t packets; + u64_stats_t bytes; + struct u64_stats_sync syncp; +}; + +struct pcpu_sw_netstats { + u64 rx_packets; + u64 rx_bytes; + u64 tx_packets; + u64 tx_bytes; + struct u64_stats_sync syncp; +}; + +struct nd_opt_hdr; + +struct ndisc_options; + +struct prefix_info; + +struct ndisc_ops { + int (*is_useropt)(u8); + int (*parse_options)(const struct net_device *, struct nd_opt_hdr *, struct ndisc_options *); + void (*update)(const struct net_device *, struct neighbour *, u32, u8, const struct ndisc_options *); + int (*opt_addr_space)(const struct net_device *, u8, struct neighbour *, u8 *, u8 **); + void (*fill_addr_option)(const struct net_device *, struct sk_buff *, u8, const u8 *); + void (*prefix_rcv_add_addr)(struct net *, struct net_device *, const struct prefix_info *, struct inet6_dev *, struct in6_addr *, int, u32, bool, bool, __u32, u32, bool); +}; + +struct ipv6_devstat { + struct proc_dir_entry *proc_dir_entry; + struct ipstats_mib *ipv6; + struct icmpv6_mib_device *icmpv6dev; + struct icmpv6msg_mib_device *icmpv6msgdev; +}; + +struct ifmcaddr6; + +struct ifacaddr6; + +struct inet6_dev { + struct net_device *dev; + struct list_head addr_list; + struct ifmcaddr6 *mc_list; + struct ifmcaddr6 *mc_tomb; + spinlock_t mc_lock; + unsigned char mc_qrv; + unsigned char mc_gq_running; + unsigned char mc_ifc_count; + unsigned char mc_dad_count; + long unsigned int mc_v1_seen; + long unsigned int mc_qi; + long unsigned int mc_qri; + long unsigned int mc_maxdelay; + struct timer_list mc_gq_timer; + struct timer_list mc_ifc_timer; + struct timer_list mc_dad_timer; + struct ifacaddr6 *ac_list; + rwlock_t lock; + refcount_t refcnt; + __u32 if_flags; + int dead; + u32 desync_factor; + u8 rndid[8]; + struct list_head tempaddr_list; + struct in6_addr token; + struct neigh_parms *nd_parms; + struct ipv6_devconf cnf; + struct ipv6_devstat stats; + struct timer_list rs_timer; + __s32 rs_interval; + __u8 rs_probes; + long unsigned int tstamp; + struct callback_head rcu; +}; + +struct tcf_proto; + +struct mini_Qdisc { + struct tcf_proto *filter_list; + struct gnet_stats_basic_cpu *cpu_bstats; + struct gnet_stats_queue *cpu_qstats; + struct callback_head rcu; +}; + +struct rtnl_link_ops { + struct list_head list; + const char *kind; + size_t priv_size; + void (*setup)(struct net_device *); + unsigned int maxtype; + const struct nla_policy *policy; + int (*validate)(struct nlattr **, struct nlattr **, struct netlink_ext_ack *); + int (*newlink)(struct net *, struct net_device *, struct nlattr **, struct nlattr **, struct netlink_ext_ack *); + int (*changelink)(struct net_device *, struct nlattr **, struct nlattr **, struct netlink_ext_ack *); + void (*dellink)(struct net_device *, struct list_head *); + size_t (*get_size)(const struct net_device *); + int (*fill_info)(struct sk_buff *, const struct net_device *); + size_t (*get_xstats_size)(const struct net_device *); + int (*fill_xstats)(struct sk_buff *, const struct net_device *); + unsigned int (*get_num_tx_queues)(); + unsigned int (*get_num_rx_queues)(); + unsigned int slave_maxtype; + const struct nla_policy *slave_policy; + int (*slave_changelink)(struct net_device *, struct net_device *, struct nlattr **, struct nlattr **, struct netlink_ext_ack *); + size_t (*get_slave_size)(const struct net_device *, const struct net_device *); + int (*fill_slave_info)(struct sk_buff *, const struct net_device *, const struct net_device *); + struct net * (*get_link_net)(const struct net_device *); + size_t (*get_linkxstats_size)(const struct net_device *, int); + int (*fill_linkxstats)(struct sk_buff *, const struct net_device *, int *, int); +}; + +struct sd_flow_limit { + u64 count; + unsigned int num_buckets; + unsigned int history_head; + u16 history[128]; + u8 buckets[0]; +}; + +struct softnet_data { + struct list_head poll_list; + struct sk_buff_head process_queue; + unsigned int processed; + unsigned int time_squeeze; + unsigned int received_rps; + struct softnet_data *rps_ipi_list; + struct sd_flow_limit *flow_limit; + struct Qdisc *output_queue; + struct Qdisc **output_queue_tailp; + struct sk_buff *completion_queue; + struct { + u16 recursion; + u8 more; + } xmit; + long: 32; + long: 64; + long: 64; + long: 64; + unsigned int input_queue_head; + long: 32; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + call_single_data_t csd; + struct softnet_data *rps_ipi_next; + unsigned int cpu; + unsigned int input_queue_tail; + unsigned int dropped; + struct sk_buff_head input_pkt_queue; + struct napi_struct backlog; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; +}; + +enum { + RTAX_UNSPEC = 0, + RTAX_LOCK = 1, + RTAX_MTU = 2, + RTAX_WINDOW = 3, + RTAX_RTT = 4, + RTAX_RTTVAR = 5, + RTAX_SSTHRESH = 6, + RTAX_CWND = 7, + RTAX_ADVMSS = 8, + RTAX_REORDERING = 9, + RTAX_HOPLIMIT = 10, + RTAX_INITCWND = 11, + RTAX_FEATURES = 12, + RTAX_RTO_MIN = 13, + RTAX_INITRWND = 14, + RTAX_QUICKACK = 15, + RTAX_CC_ALGO = 16, + RTAX_FASTOPEN_NO_COOKIE = 17, + __RTAX_MAX = 18, +}; + +struct tcmsg { + unsigned char tcm_family; + unsigned char tcm__pad1; + short unsigned int tcm__pad2; + int tcm_ifindex; + __u32 tcm_handle; + __u32 tcm_parent; + __u32 tcm_info; +}; + +struct gnet_stats_basic_cpu { + struct gnet_stats_basic_packed bstats; + struct u64_stats_sync syncp; +}; + +struct gnet_dump { + spinlock_t *lock; + struct sk_buff *skb; + struct nlattr *tail; + int compat_tc_stats; + int compat_xstats; + int padattr; + void *xstats; + int xstats_len; + struct tc_stats tc_stats; +}; + +struct nla_policy { + u8 type; + u8 validation_type; + u16 len; + union { + const void *validation_data; + struct { + s16 min; + s16 max; + }; + int (*validate)(const struct nlattr *, struct netlink_ext_ack *); + u16 strict_start_type; + }; +}; + +struct nl_info { + struct nlmsghdr *nlh; + struct net *nl_net; + u32 portid; + u8 skip_notify: 1; + u8 skip_notify_kernel: 1; +}; + +struct rhash_lock_head {}; + +struct flow_block { + struct list_head cb_list; +}; + +typedef int flow_setup_cb_t(enum tc_setup_type, void *, void *); + +struct qdisc_size_table { + struct callback_head rcu; + struct list_head list; + struct tc_sizespec szopts; + int refcnt; + u16 data[0]; +}; + +struct Qdisc_class_ops; + +struct Qdisc_ops { + struct Qdisc_ops *next; + const struct Qdisc_class_ops *cl_ops; + char id[16]; + int priv_size; + unsigned int static_flags; + int (*enqueue)(struct sk_buff *, struct Qdisc *, struct sk_buff **); + struct sk_buff * (*dequeue)(struct Qdisc *); + struct sk_buff * (*peek)(struct Qdisc *); + int (*init)(struct Qdisc *, struct nlattr *, struct netlink_ext_ack *); + void (*reset)(struct Qdisc *); + void (*destroy)(struct Qdisc *); + int (*change)(struct Qdisc *, struct nlattr *, struct netlink_ext_ack *); + void (*attach)(struct Qdisc *); + int (*change_tx_queue_len)(struct Qdisc *, unsigned int); + int (*dump)(struct Qdisc *, struct sk_buff *); + int (*dump_stats)(struct Qdisc *, struct gnet_dump *); + void (*ingress_block_set)(struct Qdisc *, u32); + void (*egress_block_set)(struct Qdisc *, u32); + u32 (*ingress_block_get)(struct Qdisc *); + u32 (*egress_block_get)(struct Qdisc *); + struct module *owner; +}; + +struct qdisc_walker; + +struct tcf_block; + +struct Qdisc_class_ops { + unsigned int flags; + struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *); + int (*graft)(struct Qdisc *, long unsigned int, struct Qdisc *, struct Qdisc **, struct netlink_ext_ack *); + struct Qdisc * (*leaf)(struct Qdisc *, long unsigned int); + void (*qlen_notify)(struct Qdisc *, long unsigned int); + long unsigned int (*find)(struct Qdisc *, u32); + int (*change)(struct Qdisc *, u32, u32, struct nlattr **, long unsigned int *, struct netlink_ext_ack *); + int (*delete)(struct Qdisc *, long unsigned int); + void (*walk)(struct Qdisc *, struct qdisc_walker *); + struct tcf_block * (*tcf_block)(struct Qdisc *, long unsigned int, struct netlink_ext_ack *); + long unsigned int (*bind_tcf)(struct Qdisc *, long unsigned int, u32); + void (*unbind_tcf)(struct Qdisc *, long unsigned int); + int (*dump)(struct Qdisc *, long unsigned int, struct sk_buff *, struct tcmsg *); + int (*dump_stats)(struct Qdisc *, long unsigned int, struct gnet_dump *); +}; + +struct tcf_chain; + +struct tcf_block { + struct mutex lock; + struct list_head chain_list; + u32 index; + refcount_t refcnt; + struct net *net; + struct Qdisc *q; + struct rw_semaphore cb_lock; + struct flow_block flow_block; + struct list_head owner_list; + bool keep_dst; + atomic_t offloadcnt; + unsigned int nooffloaddevcnt; + unsigned int lockeddevcnt; + struct { + struct tcf_chain *chain; + struct list_head filter_chain_list; + } chain0; + struct callback_head rcu; + struct hlist_head proto_destroy_ht[128]; + struct mutex proto_destroy_lock; +}; + +struct tcf_result; + +struct tcf_proto_ops; + +struct tcf_proto { + struct tcf_proto *next; + void *root; + int (*classify)(struct sk_buff *, const struct tcf_proto *, struct tcf_result *); + __be16 protocol; + u32 prio; + void *data; + const struct tcf_proto_ops *ops; + struct tcf_chain *chain; + spinlock_t lock; + bool deleting; + refcount_t refcnt; + struct callback_head rcu; + struct hlist_node destroy_ht_node; +}; + +struct tcf_result { + union { + struct { + long unsigned int class; + u32 classid; + }; + const struct tcf_proto *goto_tp; + struct { + bool ingress; + struct gnet_stats_queue *qstats; + }; + }; +}; + +struct tcf_walker; + +struct tcf_proto_ops { + struct list_head head; + char kind[16]; + int (*classify)(struct sk_buff *, const struct tcf_proto *, struct tcf_result *); + int (*init)(struct tcf_proto *); + void (*destroy)(struct tcf_proto *, bool, struct netlink_ext_ack *); + void * (*get)(struct tcf_proto *, u32); + void (*put)(struct tcf_proto *, void *); + int (*change)(struct net *, struct sk_buff *, struct tcf_proto *, long unsigned int, u32, struct nlattr **, void **, bool, bool, struct netlink_ext_ack *); + int (*delete)(struct tcf_proto *, void *, bool *, bool, struct netlink_ext_ack *); + bool (*delete_empty)(struct tcf_proto *); + void (*walk)(struct tcf_proto *, struct tcf_walker *, bool); + int (*reoffload)(struct tcf_proto *, bool, flow_setup_cb_t *, void *, struct netlink_ext_ack *); + void (*hw_add)(struct tcf_proto *, void *); + void (*hw_del)(struct tcf_proto *, void *); + void (*bind_class)(void *, u32, long unsigned int); + void * (*tmplt_create)(struct net *, struct tcf_chain *, struct nlattr **, struct netlink_ext_ack *); + void (*tmplt_destroy)(void *); + int (*dump)(struct net *, struct tcf_proto *, void *, struct sk_buff *, struct tcmsg *, bool); + int (*tmplt_dump)(struct sk_buff *, struct net *, void *); + struct module *owner; + int flags; +}; + +struct tcf_chain { + struct mutex filter_chain_lock; + struct tcf_proto *filter_chain; + struct list_head list; + struct tcf_block *block; + u32 index; + unsigned int refcnt; + unsigned int action_refcnt; + bool explicitly_created; + bool flushing; + const struct tcf_proto_ops *tmplt_ops; + void *tmplt_priv; + struct callback_head rcu; +}; + +struct sock_fprog_kern { + u16 len; + struct sock_filter *filter; +}; + +struct sk_filter { + refcount_t refcnt; + struct callback_head rcu; + struct bpf_prog *prog; +}; + +struct bpf_redirect_info { + u32 flags; + u32 tgt_index; + void *tgt_value; + struct bpf_map *map; + struct bpf_map *map_to_flush; + u32 kern_flags; +}; + +enum { + NEIGH_VAR_MCAST_PROBES = 0, + NEIGH_VAR_UCAST_PROBES = 1, + NEIGH_VAR_APP_PROBES = 2, + NEIGH_VAR_MCAST_REPROBES = 3, + NEIGH_VAR_RETRANS_TIME = 4, + NEIGH_VAR_BASE_REACHABLE_TIME = 5, + NEIGH_VAR_DELAY_PROBE_TIME = 6, + NEIGH_VAR_GC_STALETIME = 7, + NEIGH_VAR_QUEUE_LEN_BYTES = 8, + NEIGH_VAR_PROXY_QLEN = 9, + NEIGH_VAR_ANYCAST_DELAY = 10, + NEIGH_VAR_PROXY_DELAY = 11, + NEIGH_VAR_LOCKTIME = 12, + NEIGH_VAR_QUEUE_LEN = 13, + NEIGH_VAR_RETRANS_TIME_MS = 14, + NEIGH_VAR_BASE_REACHABLE_TIME_MS = 15, + NEIGH_VAR_GC_INTERVAL = 16, + NEIGH_VAR_GC_THRESH1 = 17, + NEIGH_VAR_GC_THRESH2 = 18, + NEIGH_VAR_GC_THRESH3 = 19, + NEIGH_VAR_MAX = 20, +}; + +struct pneigh_entry; + +struct neigh_statistics; + +struct neigh_hash_table; + +struct neigh_table { + int family; + unsigned int entry_size; + unsigned int key_len; + __be16 protocol; + __u32 (*hash)(const void *, const struct net_device *, __u32 *); + bool (*key_eq)(const struct neighbour *, const void *); + int (*constructor)(struct neighbour *); + int (*pconstructor)(struct pneigh_entry *); + void (*pdestructor)(struct pneigh_entry *); + void (*proxy_redo)(struct sk_buff *); + bool (*allow_add)(const struct net_device *, struct netlink_ext_ack *); + char *id; + struct neigh_parms parms; + struct list_head parms_list; + int gc_interval; + int gc_thresh1; + int gc_thresh2; + int gc_thresh3; + long unsigned int last_flush; + struct delayed_work gc_work; + struct timer_list proxy_timer; + struct sk_buff_head proxy_queue; + atomic_t entries; + atomic_t gc_entries; + struct list_head gc_list; + rwlock_t lock; + long unsigned int last_rand; + struct neigh_statistics *stats; + struct neigh_hash_table *nht; + struct pneigh_entry **phash_buckets; +}; + +struct neigh_statistics { + long unsigned int allocs; + long unsigned int destroys; + long unsigned int hash_grows; + long unsigned int res_failed; + long unsigned int lookups; + long unsigned int hits; + long unsigned int rcv_probes_mcast; + long unsigned int rcv_probes_ucast; + long unsigned int periodic_gc_runs; + long unsigned int forced_gc_runs; + long unsigned int unres_discards; + long unsigned int table_fulls; +}; + +struct neigh_ops { + int family; + void (*solicit)(struct neighbour *, struct sk_buff *); + void (*error_report)(struct neighbour *, struct sk_buff *); + int (*output)(struct neighbour *, struct sk_buff *); + int (*connected_output)(struct neighbour *, struct sk_buff *); +}; + +struct pneigh_entry { + struct pneigh_entry *next; + possible_net_t net; + struct net_device *dev; + u8 flags; + u8 protocol; + u8 key[0]; +}; + +struct neigh_hash_table { + struct neighbour **hash_buckets; + unsigned int hash_shift; + __u32 hash_rnd[4]; + struct callback_head rcu; +}; + +struct dst_metrics { + u32 metrics[17]; + refcount_t refcnt; +}; + +enum { + TCP_ESTABLISHED = 1, + TCP_SYN_SENT = 2, + TCP_SYN_RECV = 3, + TCP_FIN_WAIT1 = 4, + TCP_FIN_WAIT2 = 5, + TCP_TIME_WAIT = 6, + TCP_CLOSE = 7, + TCP_CLOSE_WAIT = 8, + TCP_LAST_ACK = 9, + TCP_LISTEN = 10, + TCP_CLOSING = 11, + TCP_NEW_SYN_RECV = 12, + TCP_MAX_STATES = 13, +}; + +struct fib_rule_hdr { + __u8 family; + __u8 dst_len; + __u8 src_len; + __u8 tos; + __u8 table; + __u8 res1; + __u8 res2; + __u8 action; + __u32 flags; +}; + +struct fib_rule_port_range { + __u16 start; + __u16 end; +}; + +struct fib_kuid_range { + kuid_t start; + kuid_t end; +}; + +struct fib_rule { + struct list_head list; + int iifindex; + int oifindex; + u32 mark; + u32 mark_mask; + u32 flags; + u32 table; + u8 action; + u8 l3mdev; + u8 proto; + u8 ip_proto; + u32 target; + __be64 tun_id; + struct fib_rule *ctarget; + struct net *fr_net; + refcount_t refcnt; + u32 pref; + int suppress_ifgroup; + int suppress_prefixlen; + char iifname[16]; + char oifname[16]; + struct fib_kuid_range uid_range; + struct fib_rule_port_range sport_range; + struct fib_rule_port_range dport_range; + struct callback_head rcu; +}; + +struct fib_lookup_arg { + void *lookup_ptr; + const void *lookup_data; + void *result; + struct fib_rule *rule; + u32 table; + int flags; +}; + +struct smc_hashinfo; + +struct request_sock_ops; + +struct timewait_sock_ops; + +struct udp_table; + +struct raw_hashinfo; + +struct proto { + void (*close)(struct sock *, long int); + int (*pre_connect)(struct sock *, struct sockaddr *, int); + int (*connect)(struct sock *, struct sockaddr *, int); + int (*disconnect)(struct sock *, int); + struct sock * (*accept)(struct sock *, int, int *, bool); + int (*ioctl)(struct sock *, int, long unsigned int); + int (*init)(struct sock *); + void (*destroy)(struct sock *); + void (*shutdown)(struct sock *, int); + int (*setsockopt)(struct sock *, int, int, char *, unsigned int); + int (*getsockopt)(struct sock *, int, int, char *, int *); + void (*keepalive)(struct sock *, int); + int (*compat_setsockopt)(struct sock *, int, int, char *, unsigned int); + int (*compat_getsockopt)(struct sock *, int, int, char *, int *); + int (*compat_ioctl)(struct sock *, unsigned int, long unsigned int); + int (*sendmsg)(struct sock *, struct msghdr *, size_t); + int (*recvmsg)(struct sock *, struct msghdr *, size_t, int, int, int *); + int (*sendpage)(struct sock *, struct page *, int, size_t, int); + int (*bind)(struct sock *, struct sockaddr *, int); + int (*backlog_rcv)(struct sock *, struct sk_buff *); + void (*release_cb)(struct sock *); + int (*hash)(struct sock *); + void (*unhash)(struct sock *); + void (*rehash)(struct sock *); + int (*get_port)(struct sock *, short unsigned int); + unsigned int inuse_idx; + bool (*stream_memory_free)(const struct sock *, int); + bool (*stream_memory_read)(const struct sock *); + void (*enter_memory_pressure)(struct sock *); + void (*leave_memory_pressure)(struct sock *); + atomic_long_t *memory_allocated; + struct percpu_counter *sockets_allocated; + long unsigned int *memory_pressure; + long int *sysctl_mem; + int *sysctl_wmem; + int *sysctl_rmem; + u32 sysctl_wmem_offset; + u32 sysctl_rmem_offset; + int max_header; + bool no_autobind; + struct kmem_cache *slab; + unsigned int obj_size; + slab_flags_t slab_flags; + unsigned int useroffset; + unsigned int usersize; + struct percpu_counter *orphan_count; + struct request_sock_ops *rsk_prot; + struct timewait_sock_ops *twsk_prot; + union { + struct inet_hashinfo *hashinfo; + struct udp_table *udp_table; + struct raw_hashinfo *raw_hash; + struct smc_hashinfo *smc_hash; + } h; + struct module *owner; + char name[32]; + struct list_head node; + int (*diag_destroy)(struct sock *, int); +}; + +struct request_sock; + +struct request_sock_ops { + int family; + unsigned int obj_size; + struct kmem_cache *slab; + char *slab_name; + int (*rtx_syn_ack)(const struct sock *, struct request_sock *); + void (*send_ack)(const struct sock *, struct sk_buff *, struct request_sock *); + void (*send_reset)(const struct sock *, struct sk_buff *); + void (*destructor)(struct request_sock *); + void (*syn_ack_timeout)(const struct request_sock *); +}; + +struct timewait_sock_ops { + struct kmem_cache *twsk_slab; + char *twsk_slab_name; + unsigned int twsk_obj_size; + int (*twsk_unique)(struct sock *, struct sock *, void *); + void (*twsk_destructor)(struct sock *); +}; + +struct request_sock { + struct sock_common __req_common; + struct request_sock *dl_next; + u16 mss; + u8 num_retrans; + u8 cookie_ts: 1; + u8 num_timeout: 7; + u32 ts_recent; + struct timer_list rsk_timer; + const struct request_sock_ops *rsk_ops; + struct sock *sk; + u32 *saved_syn; + u32 secid; + u32 peer_secid; +}; + +enum tsq_enum { + TSQ_THROTTLED = 0, + TSQ_QUEUED = 1, + TCP_TSQ_DEFERRED = 2, + TCP_WRITE_TIMER_DEFERRED = 3, + TCP_DELACK_TIMER_DEFERRED = 4, + TCP_MTU_REDUCED_DEFERRED = 5, +}; + +struct static_key_false_deferred { + struct static_key_false key; + long unsigned int timeout; + struct delayed_work work; +}; + +struct ip6_sf_list { + struct ip6_sf_list *sf_next; + struct in6_addr sf_addr; + long unsigned int sf_count[2]; + unsigned char sf_gsresp; + unsigned char sf_oldin; + unsigned char sf_crcount; +}; + +struct ifmcaddr6 { + struct in6_addr mca_addr; + struct inet6_dev *idev; + struct ifmcaddr6 *next; + struct ip6_sf_list *mca_sources; + struct ip6_sf_list *mca_tomb; + unsigned int mca_sfmode; + unsigned char mca_crcount; + long unsigned int mca_sfcount[2]; + struct timer_list mca_timer; + unsigned int mca_flags; + int mca_users; + refcount_t mca_refcnt; + spinlock_t mca_lock; + long unsigned int mca_cstamp; + long unsigned int mca_tstamp; +}; + +struct ifacaddr6 { + struct in6_addr aca_addr; + struct fib6_info *aca_rt; + struct ifacaddr6 *aca_next; + struct hlist_node aca_addr_lst; + int aca_users; + refcount_t aca_refcnt; + long unsigned int aca_cstamp; + long unsigned int aca_tstamp; + struct callback_head rcu; +}; + +struct fib6_result; + +struct fib6_nh; + +struct fib6_config; + +struct ipv6_stub { + int (*ipv6_sock_mc_join)(struct sock *, int, const struct in6_addr *); + int (*ipv6_sock_mc_drop)(struct sock *, int, const struct in6_addr *); + struct dst_entry * (*ipv6_dst_lookup_flow)(struct net *, const struct sock *, struct flowi6 *, const struct in6_addr *); + int (*ipv6_route_input)(struct sk_buff *); + struct fib6_table * (*fib6_get_table)(struct net *, u32); + int (*fib6_lookup)(struct net *, int, struct flowi6 *, struct fib6_result *, int); + int (*fib6_table_lookup)(struct net *, struct fib6_table *, int, struct flowi6 *, struct fib6_result *, int); + void (*fib6_select_path)(const struct net *, struct fib6_result *, struct flowi6 *, int, bool, const struct sk_buff *, int); + u32 (*ip6_mtu_from_fib6)(const struct fib6_result *, const struct in6_addr *, const struct in6_addr *); + int (*fib6_nh_init)(struct net *, struct fib6_nh *, struct fib6_config *, gfp_t, struct netlink_ext_ack *); + void (*fib6_nh_release)(struct fib6_nh *); + void (*fib6_update_sernum)(struct net *, struct fib6_info *); + int (*ip6_del_rt)(struct net *, struct fib6_info *); + void (*fib6_rt_update)(struct net *, struct fib6_info *, struct nl_info *); + void (*udpv6_encap_enable)(); + void (*ndisc_send_na)(struct net_device *, const struct in6_addr *, const struct in6_addr *, bool, bool, bool, bool); + struct neigh_table *nd_tbl; +}; + +struct fib6_result { + struct fib6_nh *nh; + struct fib6_info *f6i; + u32 fib6_flags; + u8 fib6_type; + struct rt6_info *rt6; +}; + +struct ipv6_bpf_stub { + int (*inet6_bind)(struct sock *, struct sockaddr *, int, bool, bool); + struct sock * (*udp6_lib_lookup)(struct net *, const struct in6_addr *, __be16, const struct in6_addr *, __be16, int, int, struct udp_table *, struct sk_buff *); +}; + +enum { + __ND_OPT_PREFIX_INFO_END = 0, + ND_OPT_SOURCE_LL_ADDR = 1, + ND_OPT_TARGET_LL_ADDR = 2, + ND_OPT_PREFIX_INFO = 3, + ND_OPT_REDIRECT_HDR = 4, + ND_OPT_MTU = 5, + ND_OPT_NONCE = 14, + __ND_OPT_ARRAY_MAX = 15, + ND_OPT_ROUTE_INFO = 24, + ND_OPT_RDNSS = 25, + ND_OPT_DNSSL = 31, + ND_OPT_6CO = 34, + ND_OPT_CAPTIVE_PORTAL = 37, + __ND_OPT_MAX = 38, +}; + +struct nd_opt_hdr { + __u8 nd_opt_type; + __u8 nd_opt_len; +}; + +struct ndisc_options { + struct nd_opt_hdr *nd_opt_array[15]; + struct nd_opt_hdr *nd_useropts; + struct nd_opt_hdr *nd_useropts_end; +}; + +struct prefix_info { + __u8 type; + __u8 length; + __u8 prefix_len; + __u8 reserved: 6; + __u8 autoconf: 1; + __u8 onlink: 1; + __be32 valid; + __be32 prefered; + __be32 reserved2; + struct in6_addr prefix; +}; + +struct ip6_ra_chain { + struct ip6_ra_chain *next; + struct sock *sk; + int sel; + void (*destructor)(struct sock *); +}; + +struct rpc_xprt_iter_ops { + void (*xpi_rewind)(struct rpc_xprt_iter *); + struct rpc_xprt * (*xpi_xprt)(struct rpc_xprt_iter *); + struct rpc_xprt * (*xpi_next)(struct rpc_xprt_iter *); +}; + +struct rpc_version { + u32 number; + unsigned int nrprocs; + const struct rpc_procinfo *procs; + unsigned int *counts; +}; + +struct nfs_fh { + short unsigned int size; + unsigned char data[128]; +}; + +enum nfs3_stable_how { + NFS_UNSTABLE = 0, + NFS_DATA_SYNC = 1, + NFS_FILE_SYNC = 2, + NFS_INVALID_STABLE_HOW = 4294967295, +}; + +struct nfs4_label { + uint32_t lfs; + uint32_t pi; + u32 len; + char *label; +}; + +typedef struct { + char data[8]; +} nfs4_verifier; + +struct nfs4_stateid_struct { + union { + char data[16]; + struct { + __be32 seqid; + char other[12]; + }; + }; + enum { + NFS4_INVALID_STATEID_TYPE = 0, + NFS4_SPECIAL_STATEID_TYPE = 1, + NFS4_OPEN_STATEID_TYPE = 2, + NFS4_LOCK_STATEID_TYPE = 3, + NFS4_DELEGATION_STATEID_TYPE = 4, + NFS4_LAYOUT_STATEID_TYPE = 5, + NFS4_PNFS_DS_STATEID_TYPE = 6, + NFS4_REVOKED_STATEID_TYPE = 7, + } type; +}; + +typedef struct nfs4_stateid_struct nfs4_stateid; + +enum nfs_opnum4 { + OP_ACCESS = 3, + OP_CLOSE = 4, + OP_COMMIT = 5, + OP_CREATE = 6, + OP_DELEGPURGE = 7, + OP_DELEGRETURN = 8, + OP_GETATTR = 9, + OP_GETFH = 10, + OP_LINK = 11, + OP_LOCK = 12, + OP_LOCKT = 13, + OP_LOCKU = 14, + OP_LOOKUP = 15, + OP_LOOKUPP = 16, + OP_NVERIFY = 17, + OP_OPEN = 18, + OP_OPENATTR = 19, + OP_OPEN_CONFIRM = 20, + OP_OPEN_DOWNGRADE = 21, + OP_PUTFH = 22, + OP_PUTPUBFH = 23, + OP_PUTROOTFH = 24, + OP_READ = 25, + OP_READDIR = 26, + OP_READLINK = 27, + OP_REMOVE = 28, + OP_RENAME = 29, + OP_RENEW = 30, + OP_RESTOREFH = 31, + OP_SAVEFH = 32, + OP_SECINFO = 33, + OP_SETATTR = 34, + OP_SETCLIENTID = 35, + OP_SETCLIENTID_CONFIRM = 36, + OP_VERIFY = 37, + OP_WRITE = 38, + OP_RELEASE_LOCKOWNER = 39, + OP_BACKCHANNEL_CTL = 40, + OP_BIND_CONN_TO_SESSION = 41, + OP_EXCHANGE_ID = 42, + OP_CREATE_SESSION = 43, + OP_DESTROY_SESSION = 44, + OP_FREE_STATEID = 45, + OP_GET_DIR_DELEGATION = 46, + OP_GETDEVICEINFO = 47, + OP_GETDEVICELIST = 48, + OP_LAYOUTCOMMIT = 49, + OP_LAYOUTGET = 50, + OP_LAYOUTRETURN = 51, + OP_SECINFO_NO_NAME = 52, + OP_SEQUENCE = 53, + OP_SET_SSV = 54, + OP_TEST_STATEID = 55, + OP_WANT_DELEGATION = 56, + OP_DESTROY_CLIENTID = 57, + OP_RECLAIM_COMPLETE = 58, + OP_ALLOCATE = 59, + OP_COPY = 60, + OP_COPY_NOTIFY = 61, + OP_DEALLOCATE = 62, + OP_IO_ADVISE = 63, + OP_LAYOUTERROR = 64, + OP_LAYOUTSTATS = 65, + OP_OFFLOAD_CANCEL = 66, + OP_OFFLOAD_STATUS = 67, + OP_READ_PLUS = 68, + OP_SEEK = 69, + OP_WRITE_SAME = 70, + OP_CLONE = 71, + OP_ILLEGAL = 10044, +}; + +struct nfs4_string { + unsigned int len; + char *data; +}; + +struct nfs_fsid { + uint64_t major; + uint64_t minor; +}; + +struct nfs4_threshold { + __u32 bm; + __u32 l_type; + __u64 rd_sz; + __u64 wr_sz; + __u64 rd_io_sz; + __u64 wr_io_sz; +}; + +struct nfs_fattr { + unsigned int valid; + umode_t mode; + __u32 nlink; + kuid_t uid; + kgid_t gid; + dev_t rdev; + __u64 size; + union { + struct { + __u32 blocksize; + __u32 blocks; + } nfs2; + struct { + __u64 used; + } nfs3; + } du; + struct nfs_fsid fsid; + __u64 fileid; + __u64 mounted_on_fileid; + struct timespec64 atime; + struct timespec64 mtime; + struct timespec64 ctime; + __u64 change_attr; + __u64 pre_change_attr; + __u64 pre_size; + struct timespec64 pre_mtime; + struct timespec64 pre_ctime; + long unsigned int time_start; + long unsigned int gencount; + struct nfs4_string *owner_name; + struct nfs4_string *group_name; + struct nfs4_threshold *mdsthreshold; +}; + +struct nfs_fsinfo { + struct nfs_fattr *fattr; + __u32 rtmax; + __u32 rtpref; + __u32 rtmult; + __u32 wtmax; + __u32 wtpref; + __u32 wtmult; + __u32 dtpref; + __u64 maxfilesize; + struct timespec64 time_delta; + __u32 lease_time; + __u32 nlayouttypes; + __u32 layouttype[8]; + __u32 blksize; + __u32 clone_blksize; +}; + +struct nfs_fsstat { + struct nfs_fattr *fattr; + __u64 tbytes; + __u64 fbytes; + __u64 abytes; + __u64 tfiles; + __u64 ffiles; + __u64 afiles; +}; + +struct nfs_pathconf { + struct nfs_fattr *fattr; + __u32 max_link; + __u32 max_namelen; +}; + +struct nfs4_change_info { + u32 atomic; + u64 before; + u64 after; +}; + +struct nfs4_slot; + +struct nfs4_sequence_args { + struct nfs4_slot *sa_slot; + u8 sa_cache_this: 1; + u8 sa_privileged: 1; +}; + +struct nfs4_sequence_res { + struct nfs4_slot *sr_slot; + long unsigned int sr_timestamp; + int sr_status; + u32 sr_status_flags; + u32 sr_highest_slotid; + u32 sr_target_highest_slotid; +}; + +struct nfs_open_context; + +struct nfs_lock_context { + refcount_t count; + struct list_head list; + struct nfs_open_context *open_context; + fl_owner_t lockowner; + atomic_t io_count; + struct callback_head callback_head; +}; + +struct nfs4_state; + +struct nfs_open_context { + struct nfs_lock_context lock_context; + fl_owner_t flock_owner; + struct dentry *dentry; + const struct cred *cred; + struct rpc_cred *ll_cred; + struct nfs4_state *state; + fmode_t mode; + long unsigned int flags; + int error; + struct list_head list; + struct nfs4_threshold *mdsthreshold; + struct callback_head callback_head; +}; + +struct nfs_auth_info { + unsigned int flavor_len; + rpc_authflavor_t flavors[12]; +}; + +struct pnfs_layoutdriver_type; + +struct nfs_client; + +struct nlm_host; + +struct nfs_iostats; + +struct nfs_server { + struct nfs_client *nfs_client; + struct list_head client_link; + struct list_head master_link; + struct rpc_clnt *client; + struct rpc_clnt *client_acl; + struct nlm_host *nlm_host; + struct nfs_iostats *io_stats; + atomic_long_t writeback; + int flags; + unsigned int caps; + unsigned int rsize; + unsigned int rpages; + unsigned int wsize; + unsigned int wpages; + unsigned int wtmult; + unsigned int dtsize; + short unsigned int port; + unsigned int bsize; + unsigned int acregmin; + unsigned int acregmax; + unsigned int acdirmin; + unsigned int acdirmax; + unsigned int namelen; + unsigned int options; + unsigned int clone_blksize; + struct nfs_fsid fsid; + __u64 maxfilesize; + struct timespec64 time_delta; + long unsigned int mount_time; + struct super_block *super; + dev_t s_dev; + struct nfs_auth_info auth_info; + u32 pnfs_blksize; + u32 attr_bitmask[3]; + u32 attr_bitmask_nl[3]; + u32 exclcreat_bitmask[3]; + u32 cache_consistency_bitmask[3]; + u32 acl_bitmask; + u32 fh_expire_type; + struct pnfs_layoutdriver_type *pnfs_curr_ld; + struct rpc_wait_queue roc_rpcwaitq; + void *pnfs_ld_data; + struct rb_root state_owners; + struct ida openowner_id; + struct ida lockowner_id; + struct list_head state_owners_lru; + struct list_head layouts; + struct list_head delegations; + struct list_head ss_copies; + long unsigned int mig_gen; + long unsigned int mig_status; + void (*destroy)(struct nfs_server *); + atomic_t active; + struct __kernel_sockaddr_storage mountd_address; + size_t mountd_addrlen; + u32 mountd_version; + short unsigned int mountd_port; + short unsigned int mountd_protocol; + struct rpc_wait_queue uoc_rpcwaitq; + unsigned int read_hdrsize; + const struct cred *cred; +}; + +struct nfs41_server_owner; + +struct nfs41_server_scope; + +struct nfs41_impl_id; + +struct nfs_rpc_ops; + +struct nfs_subversion; + +struct idmap; + +struct nfs4_minor_version_ops; + +struct nfs4_slot_table; + +struct nfs4_session; + +struct nfs_client { + refcount_t cl_count; + atomic_t cl_mds_count; + int cl_cons_state; + long unsigned int cl_res_state; + long unsigned int cl_flags; + struct __kernel_sockaddr_storage cl_addr; + size_t cl_addrlen; + char *cl_hostname; + char *cl_acceptor; + struct list_head cl_share_link; + struct list_head cl_superblocks; + struct rpc_clnt *cl_rpcclient; + const struct nfs_rpc_ops *rpc_ops; + int cl_proto; + struct nfs_subversion *cl_nfs_mod; + u32 cl_minorversion; + unsigned int cl_nconnect; + const char *cl_principal; + struct list_head cl_ds_clients; + u64 cl_clientid; + nfs4_verifier cl_confirm; + long unsigned int cl_state; + spinlock_t cl_lock; + long unsigned int cl_lease_time; + long unsigned int cl_last_renewal; + struct delayed_work cl_renewd; + struct rpc_wait_queue cl_rpcwaitq; + struct idmap *cl_idmap; + const char *cl_owner_id; + u32 cl_cb_ident; + const struct nfs4_minor_version_ops *cl_mvops; + long unsigned int cl_mig_gen; + struct nfs4_slot_table *cl_slot_tbl; + u32 cl_seqid; + u32 cl_exchange_flags; + struct nfs4_session *cl_session; + bool cl_preserve_clid; + struct nfs41_server_owner *cl_serverowner; + struct nfs41_server_scope *cl_serverscope; + struct nfs41_impl_id *cl_implid; + long unsigned int cl_sp4_flags; + char cl_ipaddr[48]; + struct net *cl_net; + struct list_head pending_cb_stateids; +}; + +struct nfs_write_verifier { + char data[8]; +}; + +struct nfs_writeverf { + struct nfs_write_verifier verifier; + enum nfs3_stable_how committed; +}; + +struct nfs_pgio_args { + struct nfs4_sequence_args seq_args; + struct nfs_fh *fh; + struct nfs_open_context *context; + struct nfs_lock_context *lock_context; + nfs4_stateid stateid; + __u64 offset; + __u32 count; + unsigned int pgbase; + struct page **pages; + union { + unsigned int replen; + struct { + const u32 *bitmask; + enum nfs3_stable_how stable; + }; + }; +}; + +struct nfs_pgio_res { + struct nfs4_sequence_res seq_res; + struct nfs_fattr *fattr; + __u32 count; + __u32 op_status; + union { + struct { + unsigned int replen; + int eof; + }; + struct { + struct nfs_writeverf *verf; + const struct nfs_server *server; + }; + }; +}; + +struct nfs_commitargs { + struct nfs4_sequence_args seq_args; + struct nfs_fh *fh; + __u64 offset; + __u32 count; + const u32 *bitmask; +}; + +struct nfs_commitres { + struct nfs4_sequence_res seq_res; + __u32 op_status; + struct nfs_fattr *fattr; + struct nfs_writeverf *verf; + const struct nfs_server *server; +}; + +struct nfs_removeargs { + struct nfs4_sequence_args seq_args; + const struct nfs_fh *fh; + struct qstr name; +}; + +struct nfs_removeres { + struct nfs4_sequence_res seq_res; + struct nfs_server *server; + struct nfs_fattr *dir_attr; + struct nfs4_change_info cinfo; +}; + +struct nfs_renameargs { + struct nfs4_sequence_args seq_args; + const struct nfs_fh *old_dir; + const struct nfs_fh *new_dir; + const struct qstr *old_name; + const struct qstr *new_name; +}; + +struct nfs_renameres { + struct nfs4_sequence_res seq_res; + struct nfs_server *server; + struct nfs4_change_info old_cinfo; + struct nfs_fattr *old_fattr; + struct nfs4_change_info new_cinfo; + struct nfs_fattr *new_fattr; +}; + +struct nfs_entry { + __u64 ino; + __u64 cookie; + __u64 prev_cookie; + const char *name; + unsigned int len; + int eof; + struct nfs_fh *fh; + struct nfs_fattr *fattr; + struct nfs4_label *label; + unsigned char d_type; + struct nfs_server *server; +}; + +struct pnfs_ds_commit_info {}; + +struct nfs_page_array { + struct page **pagevec; + unsigned int npages; + struct page *page_array[8]; +}; + +struct nfs_page; + +struct pnfs_layout_segment; + +struct nfs_pgio_completion_ops; + +struct nfs_rw_ops; + +struct nfs_io_completion; + +struct nfs_direct_req; + +struct nfs_pgio_header { + struct inode *inode; + const struct cred *cred; + struct list_head pages; + struct nfs_page *req; + struct nfs_writeverf verf; + fmode_t rw_mode; + struct pnfs_layout_segment *lseg; + loff_t io_start; + const struct rpc_call_ops *mds_ops; + void (*release)(struct nfs_pgio_header *); + const struct nfs_pgio_completion_ops *completion_ops; + const struct nfs_rw_ops *rw_ops; + struct nfs_io_completion *io_completion; + struct nfs_direct_req *dreq; + int pnfs_error; + int error; + unsigned int good_bytes; + long unsigned int flags; + struct rpc_task task; + struct nfs_fattr fattr; + struct nfs_pgio_args args; + struct nfs_pgio_res res; + long unsigned int timestamp; + int (*pgio_done_cb)(struct rpc_task *, struct nfs_pgio_header *); + __u64 mds_offset; + struct nfs_page_array page_array; + struct nfs_client *ds_clp; + int ds_commit_idx; + int pgio_mirror_idx; +}; + +struct nfs_pgio_completion_ops { + void (*error_cleanup)(struct list_head *, int); + void (*init_hdr)(struct nfs_pgio_header *); + void (*completion)(struct nfs_pgio_header *); + void (*reschedule_io)(struct nfs_pgio_header *); +}; + +struct rpc_task_setup; + +struct nfs_rw_ops { + struct nfs_pgio_header * (*rw_alloc_header)(); + void (*rw_free_header)(struct nfs_pgio_header *); + int (*rw_done)(struct rpc_task *, struct nfs_pgio_header *, struct inode *); + void (*rw_result)(struct rpc_task *, struct nfs_pgio_header *); + void (*rw_initiate)(struct nfs_pgio_header *, struct rpc_message *, const struct nfs_rpc_ops *, struct rpc_task_setup *, int); +}; + +struct nfs_mds_commit_info { + atomic_t rpcs_out; + atomic_long_t ncommit; + struct list_head list; +}; + +struct nfs_commit_data; + +struct nfs_commit_info; + +struct nfs_commit_completion_ops { + void (*completion)(struct nfs_commit_data *); + void (*resched_write)(struct nfs_commit_info *, struct nfs_page *); +}; + +struct nfs_commit_data { + struct rpc_task task; + struct inode *inode; + const struct cred *cred; + struct nfs_fattr fattr; + struct nfs_writeverf verf; + struct list_head pages; + struct list_head list; + struct nfs_direct_req *dreq; + struct nfs_commitargs args; + struct nfs_commitres res; + struct nfs_open_context *context; + struct pnfs_layout_segment *lseg; + struct nfs_client *ds_clp; + int ds_commit_index; + loff_t lwb; + const struct rpc_call_ops *mds_ops; + const struct nfs_commit_completion_ops *completion_ops; + int (*commit_done_cb)(struct rpc_task *, struct nfs_commit_data *); + long unsigned int flags; +}; + +struct nfs_commit_info { + struct inode *inode; + struct nfs_mds_commit_info *mds; + struct pnfs_ds_commit_info *ds; + struct nfs_direct_req *dreq; + const struct nfs_commit_completion_ops *completion_ops; +}; + +struct nfs_unlinkdata { + struct nfs_removeargs args; + struct nfs_removeres res; + struct dentry *dentry; + wait_queue_head_t wq; + const struct cred *cred; + struct nfs_fattr dir_attr; + long int timeout; +}; + +struct nfs_renamedata { + struct nfs_renameargs args; + struct nfs_renameres res; + const struct cred *cred; + struct inode *old_dir; + struct dentry *old_dentry; + struct nfs_fattr old_fattr; + struct inode *new_dir; + struct dentry *new_dentry; + struct nfs_fattr new_fattr; + void (*complete)(struct rpc_task *, struct nfs_renamedata *); + long int timeout; + bool cancelled; +}; + +struct nlmclnt_operations; + +struct nfs_mount_info; + +struct nfs_access_entry; + +struct nfs_client_initdata; + +struct nfs_rpc_ops { + u32 version; + const struct dentry_operations *dentry_ops; + const struct inode_operations *dir_inode_ops; + const struct inode_operations *file_inode_ops; + const struct file_operations *file_ops; + const struct nlmclnt_operations *nlmclnt_ops; + int (*getroot)(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); + struct vfsmount * (*submount)(struct nfs_server *, struct dentry *, struct nfs_fh *, struct nfs_fattr *); + struct dentry * (*try_mount)(int, const char *, struct nfs_mount_info *, struct nfs_subversion *); + int (*getattr)(struct nfs_server *, struct nfs_fh *, struct nfs_fattr *, struct nfs4_label *, struct inode *); + int (*setattr)(struct dentry *, struct nfs_fattr *, struct iattr *); + int (*lookup)(struct inode *, const struct qstr *, struct nfs_fh *, struct nfs_fattr *, struct nfs4_label *); + int (*lookupp)(struct inode *, struct nfs_fh *, struct nfs_fattr *, struct nfs4_label *); + int (*access)(struct inode *, struct nfs_access_entry *); + int (*readlink)(struct inode *, struct page *, unsigned int, unsigned int); + int (*create)(struct inode *, struct dentry *, struct iattr *, int); + int (*remove)(struct inode *, struct dentry *); + void (*unlink_setup)(struct rpc_message *, struct dentry *, struct inode *); + void (*unlink_rpc_prepare)(struct rpc_task *, struct nfs_unlinkdata *); + int (*unlink_done)(struct rpc_task *, struct inode *); + void (*rename_setup)(struct rpc_message *, struct dentry *, struct dentry *); + void (*rename_rpc_prepare)(struct rpc_task *, struct nfs_renamedata *); + int (*rename_done)(struct rpc_task *, struct inode *, struct inode *); + int (*link)(struct inode *, struct inode *, const struct qstr *); + int (*symlink)(struct inode *, struct dentry *, struct page *, unsigned int, struct iattr *); + int (*mkdir)(struct inode *, struct dentry *, struct iattr *); + int (*rmdir)(struct inode *, const struct qstr *); + int (*readdir)(struct dentry *, const struct cred *, u64, struct page **, unsigned int, bool); + int (*mknod)(struct inode *, struct dentry *, struct iattr *, dev_t); + int (*statfs)(struct nfs_server *, struct nfs_fh *, struct nfs_fsstat *); + int (*fsinfo)(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); + int (*pathconf)(struct nfs_server *, struct nfs_fh *, struct nfs_pathconf *); + int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); + int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, bool); + int (*pgio_rpc_prepare)(struct rpc_task *, struct nfs_pgio_header *); + void (*read_setup)(struct nfs_pgio_header *, struct rpc_message *); + int (*read_done)(struct rpc_task *, struct nfs_pgio_header *); + void (*write_setup)(struct nfs_pgio_header *, struct rpc_message *, struct rpc_clnt **); + int (*write_done)(struct rpc_task *, struct nfs_pgio_header *); + void (*commit_setup)(struct nfs_commit_data *, struct rpc_message *, struct rpc_clnt **); + void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *); + int (*commit_done)(struct rpc_task *, struct nfs_commit_data *); + int (*lock)(struct file *, int, struct file_lock *); + int (*lock_check_bounds)(const struct file_lock *); + void (*clear_acl_cache)(struct inode *); + void (*close_context)(struct nfs_open_context *, int); + struct inode * (*open_context)(struct inode *, struct nfs_open_context *, int, struct iattr *, int *); + int (*have_delegation)(struct inode *, fmode_t); + struct nfs_client * (*alloc_client)(const struct nfs_client_initdata *); + struct nfs_client * (*init_client)(struct nfs_client *, const struct nfs_client_initdata *); + void (*free_client)(struct nfs_client *); + struct nfs_server * (*create_server)(struct nfs_mount_info *, struct nfs_subversion *); + struct nfs_server * (*clone_server)(struct nfs_server *, struct nfs_fh *, struct nfs_fattr *, rpc_authflavor_t); +}; + +struct nlmclnt_operations { + void (*nlmclnt_alloc_call)(void *); + bool (*nlmclnt_unlock_prepare)(struct rpc_task *, void *); + void (*nlmclnt_release_call)(void *); +}; + +struct nfs_access_entry { + struct rb_node rb_node; + struct list_head lru; + const struct cred *cred; + __u32 mask; + struct callback_head callback_head; +}; + +struct nfs_client_initdata { + long unsigned int init_flags; + const char *hostname; + const struct sockaddr *addr; + const char *nodename; + const char *ip_addr; + size_t addrlen; + struct nfs_subversion *nfs_mod; + int proto; + u32 minorversion; + unsigned int nconnect; + struct net *net; + const struct rpc_timeout *timeparms; + const struct cred *cred; +}; + +struct nfs_seqid; + +struct nfs_seqid_counter; + +struct nfs4_state_recovery_ops; + +struct nfs4_state_maintenance_ops; + +struct nfs4_mig_recovery_ops; + +struct nfs4_minor_version_ops { + u32 minor_version; + unsigned int init_caps; + int (*init_client)(struct nfs_client *); + void (*shutdown_client)(struct nfs_client *); + bool (*match_stateid)(const nfs4_stateid *, const nfs4_stateid *); + int (*find_root_sec)(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); + void (*free_lock_state)(struct nfs_server *, struct nfs4_lock_state *); + int (*test_and_free_expired)(struct nfs_server *, nfs4_stateid *, const struct cred *); + struct nfs_seqid * (*alloc_seqid)(struct nfs_seqid_counter *, gfp_t); + void (*session_trunk)(struct rpc_clnt *, struct rpc_xprt *, void *); + const struct rpc_call_ops *call_sync_ops; + const struct nfs4_state_recovery_ops *reboot_recovery_ops; + const struct nfs4_state_recovery_ops *nograce_recovery_ops; + const struct nfs4_state_maintenance_ops *state_renewal_ops; + const struct nfs4_mig_recovery_ops *mig_recovery_ops; +}; + +enum perf_branch_sample_type_shift { + PERF_SAMPLE_BRANCH_USER_SHIFT = 0, + PERF_SAMPLE_BRANCH_KERNEL_SHIFT = 1, + PERF_SAMPLE_BRANCH_HV_SHIFT = 2, + PERF_SAMPLE_BRANCH_ANY_SHIFT = 3, + PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT = 4, + PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT = 5, + PERF_SAMPLE_BRANCH_IND_CALL_SHIFT = 6, + PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT = 7, + PERF_SAMPLE_BRANCH_IN_TX_SHIFT = 8, + PERF_SAMPLE_BRANCH_NO_TX_SHIFT = 9, + PERF_SAMPLE_BRANCH_COND_SHIFT = 10, + PERF_SAMPLE_BRANCH_CALL_STACK_SHIFT = 11, + PERF_SAMPLE_BRANCH_IND_JUMP_SHIFT = 12, + PERF_SAMPLE_BRANCH_CALL_SHIFT = 13, + PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT = 14, + PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT = 15, + PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 16, + PERF_SAMPLE_BRANCH_MAX_SHIFT = 17, +}; + +enum exception_stack_ordering { + ESTACK_DF = 0, + ESTACK_NMI = 1, + ESTACK_DB2 = 2, + ESTACK_DB1 = 3, + ESTACK_DB = 4, + ESTACK_MCE = 5, + N_EXCEPTION_STACKS = 6, +}; + +enum { + TSK_TRACE_FL_TRACE_BIT = 0, + TSK_TRACE_FL_GRAPH_BIT = 1, +}; + +struct uuidcmp { + const char *uuid; + int len; +}; + +struct subprocess_info { + struct work_struct work; + struct completion *complete; + const char *path; + char **argv; + char **envp; + struct file *file; + int wait; + int retval; + pid_t pid; + int (*init)(struct subprocess_info *, struct cred *); + void (*cleanup)(struct subprocess_info *); + void *data; +}; + +struct mdu_array_info_s { + int major_version; + int minor_version; + int patch_version; + unsigned int ctime; + int level; + int size; + int nr_disks; + int raid_disks; + int md_minor; + int not_persistent; + unsigned int utime; + int state; + int active_disks; + int working_disks; + int failed_disks; + int spare_disks; + int layout; + int chunk_size; +}; + +typedef struct mdu_array_info_s mdu_array_info_t; + +struct mdu_disk_info_s { + int number; + int major; + int minor; + int raid_disk; + int state; +}; + +typedef struct mdu_disk_info_s mdu_disk_info_t; + +enum kmalloc_cache_type { + KMALLOC_NORMAL = 0, + KMALLOC_RECLAIM = 1, + KMALLOC_DMA = 2, + NR_KMALLOC_TYPES = 3, +}; + +struct hash { + int ino; + int minor; + int major; + umode_t mode; + struct hash *next; + char name[4098]; +}; + +struct dir_entry { + struct list_head list; + char *name; + time64_t mtime; +}; + +enum state { + Start = 0, + Collect = 1, + GotHeader = 2, + SkipIt = 3, + GotName = 4, + CopyFile = 5, + GotSymlink = 6, + Reset = 7, +}; + +typedef int (*decompress_fn)(unsigned char *, long int, long int (*)(void *, long unsigned int), long int (*)(void *, long unsigned int), unsigned char *, long int *, void (*)(char *)); + +typedef u32 note_buf_t[92]; + +struct kimage_arch { + p4d_t *p4d; + pud_t *pud; + pmd_t *pmd; + pte_t *pte; + void *elf_headers; + long unsigned int elf_headers_sz; + long unsigned int elf_load_addr; +}; + +typedef void crash_vmclear_fn(); + +typedef long unsigned int kimage_entry_t; + +struct kexec_segment { + union { + void *buf; + void *kbuf; + }; + size_t bufsz; + long unsigned int mem; + size_t memsz; +}; + +struct kimage { + kimage_entry_t head; + kimage_entry_t *entry; + kimage_entry_t *last_entry; + long unsigned int start; + struct page *control_code_page; + struct page *swap_page; + void *vmcoreinfo_data_copy; + long unsigned int nr_segments; + struct kexec_segment segment[16]; + struct list_head control_pages; + struct list_head dest_pages; + struct list_head unusable_pages; + long unsigned int control_page; + unsigned int type: 1; + unsigned int preserve_context: 1; + unsigned int file_mode: 1; + struct kimage_arch arch; +}; + +enum ucount_type { + UCOUNT_USER_NAMESPACES = 0, + UCOUNT_PID_NAMESPACES = 1, + UCOUNT_UTS_NAMESPACES = 2, + UCOUNT_IPC_NAMESPACES = 3, + UCOUNT_NET_NAMESPACES = 4, + UCOUNT_MNT_NAMESPACES = 5, + UCOUNT_CGROUP_NAMESPACES = 6, + UCOUNT_INOTIFY_INSTANCES = 7, + UCOUNT_INOTIFY_WATCHES = 8, + UCOUNT_COUNTS = 9, +}; + +enum flow_dissector_key_id { + FLOW_DISSECTOR_KEY_CONTROL = 0, + FLOW_DISSECTOR_KEY_BASIC = 1, + FLOW_DISSECTOR_KEY_IPV4_ADDRS = 2, + FLOW_DISSECTOR_KEY_IPV6_ADDRS = 3, + FLOW_DISSECTOR_KEY_PORTS = 4, + FLOW_DISSECTOR_KEY_PORTS_RANGE = 5, + FLOW_DISSECTOR_KEY_ICMP = 6, + FLOW_DISSECTOR_KEY_ETH_ADDRS = 7, + FLOW_DISSECTOR_KEY_TIPC = 8, + FLOW_DISSECTOR_KEY_ARP = 9, + FLOW_DISSECTOR_KEY_VLAN = 10, + FLOW_DISSECTOR_KEY_FLOW_LABEL = 11, + FLOW_DISSECTOR_KEY_GRE_KEYID = 12, + FLOW_DISSECTOR_KEY_MPLS_ENTROPY = 13, + FLOW_DISSECTOR_KEY_ENC_KEYID = 14, + FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS = 15, + FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS = 16, + FLOW_DISSECTOR_KEY_ENC_CONTROL = 17, + FLOW_DISSECTOR_KEY_ENC_PORTS = 18, + FLOW_DISSECTOR_KEY_MPLS = 19, + FLOW_DISSECTOR_KEY_TCP = 20, + FLOW_DISSECTOR_KEY_IP = 21, + FLOW_DISSECTOR_KEY_CVLAN = 22, + FLOW_DISSECTOR_KEY_ENC_IP = 23, + FLOW_DISSECTOR_KEY_ENC_OPTS = 24, + FLOW_DISSECTOR_KEY_META = 25, + FLOW_DISSECTOR_KEY_CT = 26, + FLOW_DISSECTOR_KEY_MAX = 27, +}; + +enum { + IPSTATS_MIB_NUM = 0, + IPSTATS_MIB_INPKTS = 1, + IPSTATS_MIB_INOCTETS = 2, + IPSTATS_MIB_INDELIVERS = 3, + IPSTATS_MIB_OUTFORWDATAGRAMS = 4, + IPSTATS_MIB_OUTPKTS = 5, + IPSTATS_MIB_OUTOCTETS = 6, + IPSTATS_MIB_INHDRERRORS = 7, + IPSTATS_MIB_INTOOBIGERRORS = 8, + IPSTATS_MIB_INNOROUTES = 9, + IPSTATS_MIB_INADDRERRORS = 10, + IPSTATS_MIB_INUNKNOWNPROTOS = 11, + IPSTATS_MIB_INTRUNCATEDPKTS = 12, + IPSTATS_MIB_INDISCARDS = 13, + IPSTATS_MIB_OUTDISCARDS = 14, + IPSTATS_MIB_OUTNOROUTES = 15, + IPSTATS_MIB_REASMTIMEOUT = 16, + IPSTATS_MIB_REASMREQDS = 17, + IPSTATS_MIB_REASMOKS = 18, + IPSTATS_MIB_REASMFAILS = 19, + IPSTATS_MIB_FRAGOKS = 20, + IPSTATS_MIB_FRAGFAILS = 21, + IPSTATS_MIB_FRAGCREATES = 22, + IPSTATS_MIB_INMCASTPKTS = 23, + IPSTATS_MIB_OUTMCASTPKTS = 24, + IPSTATS_MIB_INBCASTPKTS = 25, + IPSTATS_MIB_OUTBCASTPKTS = 26, + IPSTATS_MIB_INMCASTOCTETS = 27, + IPSTATS_MIB_OUTMCASTOCTETS = 28, + IPSTATS_MIB_INBCASTOCTETS = 29, + IPSTATS_MIB_OUTBCASTOCTETS = 30, + IPSTATS_MIB_CSUMERRORS = 31, + IPSTATS_MIB_NOECTPKTS = 32, + IPSTATS_MIB_ECT1PKTS = 33, + IPSTATS_MIB_ECT0PKTS = 34, + IPSTATS_MIB_CEPKTS = 35, + IPSTATS_MIB_REASM_OVERLAPS = 36, + __IPSTATS_MIB_MAX = 37, +}; + +enum { + ICMP_MIB_NUM = 0, + ICMP_MIB_INMSGS = 1, + ICMP_MIB_INERRORS = 2, + ICMP_MIB_INDESTUNREACHS = 3, + ICMP_MIB_INTIMEEXCDS = 4, + ICMP_MIB_INPARMPROBS = 5, + ICMP_MIB_INSRCQUENCHS = 6, + ICMP_MIB_INREDIRECTS = 7, + ICMP_MIB_INECHOS = 8, + ICMP_MIB_INECHOREPS = 9, + ICMP_MIB_INTIMESTAMPS = 10, + ICMP_MIB_INTIMESTAMPREPS = 11, + ICMP_MIB_INADDRMASKS = 12, + ICMP_MIB_INADDRMASKREPS = 13, + ICMP_MIB_OUTMSGS = 14, + ICMP_MIB_OUTERRORS = 15, + ICMP_MIB_OUTDESTUNREACHS = 16, + ICMP_MIB_OUTTIMEEXCDS = 17, + ICMP_MIB_OUTPARMPROBS = 18, + ICMP_MIB_OUTSRCQUENCHS = 19, + ICMP_MIB_OUTREDIRECTS = 20, + ICMP_MIB_OUTECHOS = 21, + ICMP_MIB_OUTECHOREPS = 22, + ICMP_MIB_OUTTIMESTAMPS = 23, + ICMP_MIB_OUTTIMESTAMPREPS = 24, + ICMP_MIB_OUTADDRMASKS = 25, + ICMP_MIB_OUTADDRMASKREPS = 26, + ICMP_MIB_CSUMERRORS = 27, + __ICMP_MIB_MAX = 28, +}; + +enum { + ICMP6_MIB_NUM = 0, + ICMP6_MIB_INMSGS = 1, + ICMP6_MIB_INERRORS = 2, + ICMP6_MIB_OUTMSGS = 3, + ICMP6_MIB_OUTERRORS = 4, + ICMP6_MIB_CSUMERRORS = 5, + __ICMP6_MIB_MAX = 6, +}; + +enum { + TCP_MIB_NUM = 0, + TCP_MIB_RTOALGORITHM = 1, + TCP_MIB_RTOMIN = 2, + TCP_MIB_RTOMAX = 3, + TCP_MIB_MAXCONN = 4, + TCP_MIB_ACTIVEOPENS = 5, + TCP_MIB_PASSIVEOPENS = 6, + TCP_MIB_ATTEMPTFAILS = 7, + TCP_MIB_ESTABRESETS = 8, + TCP_MIB_CURRESTAB = 9, + TCP_MIB_INSEGS = 10, + TCP_MIB_OUTSEGS = 11, + TCP_MIB_RETRANSSEGS = 12, + TCP_MIB_INERRS = 13, + TCP_MIB_OUTRSTS = 14, + TCP_MIB_CSUMERRORS = 15, + __TCP_MIB_MAX = 16, +}; + +enum { + UDP_MIB_NUM = 0, + UDP_MIB_INDATAGRAMS = 1, + UDP_MIB_NOPORTS = 2, + UDP_MIB_INERRORS = 3, + UDP_MIB_OUTDATAGRAMS = 4, + UDP_MIB_RCVBUFERRORS = 5, + UDP_MIB_SNDBUFERRORS = 6, + UDP_MIB_CSUMERRORS = 7, + UDP_MIB_IGNOREDMULTI = 8, + __UDP_MIB_MAX = 9, +}; + +enum { + LINUX_MIB_NUM = 0, + LINUX_MIB_SYNCOOKIESSENT = 1, + LINUX_MIB_SYNCOOKIESRECV = 2, + LINUX_MIB_SYNCOOKIESFAILED = 3, + LINUX_MIB_EMBRYONICRSTS = 4, + LINUX_MIB_PRUNECALLED = 5, + LINUX_MIB_RCVPRUNED = 6, + LINUX_MIB_OFOPRUNED = 7, + LINUX_MIB_OUTOFWINDOWICMPS = 8, + LINUX_MIB_LOCKDROPPEDICMPS = 9, + LINUX_MIB_ARPFILTER = 10, + LINUX_MIB_TIMEWAITED = 11, + LINUX_MIB_TIMEWAITRECYCLED = 12, + LINUX_MIB_TIMEWAITKILLED = 13, + LINUX_MIB_PAWSACTIVEREJECTED = 14, + LINUX_MIB_PAWSESTABREJECTED = 15, + LINUX_MIB_DELAYEDACKS = 16, + LINUX_MIB_DELAYEDACKLOCKED = 17, + LINUX_MIB_DELAYEDACKLOST = 18, + LINUX_MIB_LISTENOVERFLOWS = 19, + LINUX_MIB_LISTENDROPS = 20, + LINUX_MIB_TCPHPHITS = 21, + LINUX_MIB_TCPPUREACKS = 22, + LINUX_MIB_TCPHPACKS = 23, + LINUX_MIB_TCPRENORECOVERY = 24, + LINUX_MIB_TCPSACKRECOVERY = 25, + LINUX_MIB_TCPSACKRENEGING = 26, + LINUX_MIB_TCPSACKREORDER = 27, + LINUX_MIB_TCPRENOREORDER = 28, + LINUX_MIB_TCPTSREORDER = 29, + LINUX_MIB_TCPFULLUNDO = 30, + LINUX_MIB_TCPPARTIALUNDO = 31, + LINUX_MIB_TCPDSACKUNDO = 32, + LINUX_MIB_TCPLOSSUNDO = 33, + LINUX_MIB_TCPLOSTRETRANSMIT = 34, + LINUX_MIB_TCPRENOFAILURES = 35, + LINUX_MIB_TCPSACKFAILURES = 36, + LINUX_MIB_TCPLOSSFAILURES = 37, + LINUX_MIB_TCPFASTRETRANS = 38, + LINUX_MIB_TCPSLOWSTARTRETRANS = 39, + LINUX_MIB_TCPTIMEOUTS = 40, + LINUX_MIB_TCPLOSSPROBES = 41, + LINUX_MIB_TCPLOSSPROBERECOVERY = 42, + LINUX_MIB_TCPRENORECOVERYFAIL = 43, + LINUX_MIB_TCPSACKRECOVERYFAIL = 44, + LINUX_MIB_TCPRCVCOLLAPSED = 45, + LINUX_MIB_TCPDSACKOLDSENT = 46, + LINUX_MIB_TCPDSACKOFOSENT = 47, + LINUX_MIB_TCPDSACKRECV = 48, + LINUX_MIB_TCPDSACKOFORECV = 49, + LINUX_MIB_TCPABORTONDATA = 50, + LINUX_MIB_TCPABORTONCLOSE = 51, + LINUX_MIB_TCPABORTONMEMORY = 52, + LINUX_MIB_TCPABORTONTIMEOUT = 53, + LINUX_MIB_TCPABORTONLINGER = 54, + LINUX_MIB_TCPABORTFAILED = 55, + LINUX_MIB_TCPMEMORYPRESSURES = 56, + LINUX_MIB_TCPMEMORYPRESSURESCHRONO = 57, + LINUX_MIB_TCPSACKDISCARD = 58, + LINUX_MIB_TCPDSACKIGNOREDOLD = 59, + LINUX_MIB_TCPDSACKIGNOREDNOUNDO = 60, + LINUX_MIB_TCPSPURIOUSRTOS = 61, + LINUX_MIB_TCPMD5NOTFOUND = 62, + LINUX_MIB_TCPMD5UNEXPECTED = 63, + LINUX_MIB_TCPMD5FAILURE = 64, + LINUX_MIB_SACKSHIFTED = 65, + LINUX_MIB_SACKMERGED = 66, + LINUX_MIB_SACKSHIFTFALLBACK = 67, + LINUX_MIB_TCPBACKLOGDROP = 68, + LINUX_MIB_PFMEMALLOCDROP = 69, + LINUX_MIB_TCPMINTTLDROP = 70, + LINUX_MIB_TCPDEFERACCEPTDROP = 71, + LINUX_MIB_IPRPFILTER = 72, + LINUX_MIB_TCPTIMEWAITOVERFLOW = 73, + LINUX_MIB_TCPREQQFULLDOCOOKIES = 74, + LINUX_MIB_TCPREQQFULLDROP = 75, + LINUX_MIB_TCPRETRANSFAIL = 76, + LINUX_MIB_TCPRCVCOALESCE = 77, + LINUX_MIB_TCPBACKLOGCOALESCE = 78, + LINUX_MIB_TCPOFOQUEUE = 79, + LINUX_MIB_TCPOFODROP = 80, + LINUX_MIB_TCPOFOMERGE = 81, + LINUX_MIB_TCPCHALLENGEACK = 82, + LINUX_MIB_TCPSYNCHALLENGE = 83, + LINUX_MIB_TCPFASTOPENACTIVE = 84, + LINUX_MIB_TCPFASTOPENACTIVEFAIL = 85, + LINUX_MIB_TCPFASTOPENPASSIVE = 86, + LINUX_MIB_TCPFASTOPENPASSIVEFAIL = 87, + LINUX_MIB_TCPFASTOPENLISTENOVERFLOW = 88, + LINUX_MIB_TCPFASTOPENCOOKIEREQD = 89, + LINUX_MIB_TCPFASTOPENBLACKHOLE = 90, + LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES = 91, + LINUX_MIB_BUSYPOLLRXPACKETS = 92, + LINUX_MIB_TCPAUTOCORKING = 93, + LINUX_MIB_TCPFROMZEROWINDOWADV = 94, + LINUX_MIB_TCPTOZEROWINDOWADV = 95, + LINUX_MIB_TCPWANTZEROWINDOWADV = 96, + LINUX_MIB_TCPSYNRETRANS = 97, + LINUX_MIB_TCPORIGDATASENT = 98, + LINUX_MIB_TCPHYSTARTTRAINDETECT = 99, + LINUX_MIB_TCPHYSTARTTRAINCWND = 100, + LINUX_MIB_TCPHYSTARTDELAYDETECT = 101, + LINUX_MIB_TCPHYSTARTDELAYCWND = 102, + LINUX_MIB_TCPACKSKIPPEDSYNRECV = 103, + LINUX_MIB_TCPACKSKIPPEDPAWS = 104, + LINUX_MIB_TCPACKSKIPPEDSEQ = 105, + LINUX_MIB_TCPACKSKIPPEDFINWAIT2 = 106, + LINUX_MIB_TCPACKSKIPPEDTIMEWAIT = 107, + LINUX_MIB_TCPACKSKIPPEDCHALLENGE = 108, + LINUX_MIB_TCPWINPROBE = 109, + LINUX_MIB_TCPKEEPALIVE = 110, + LINUX_MIB_TCPMTUPFAIL = 111, + LINUX_MIB_TCPMTUPSUCCESS = 112, + LINUX_MIB_TCPDELIVERED = 113, + LINUX_MIB_TCPDELIVEREDCE = 114, + LINUX_MIB_TCPACKCOMPRESSED = 115, + LINUX_MIB_TCPZEROWINDOWDROP = 116, + LINUX_MIB_TCPRCVQDROP = 117, + LINUX_MIB_TCPWQUEUETOOBIG = 118, + LINUX_MIB_TCPFASTOPENPASSIVEALTKEY = 119, + __LINUX_MIB_MAX = 120, +}; + +enum { + LINUX_MIB_XFRMNUM = 0, + LINUX_MIB_XFRMINERROR = 1, + LINUX_MIB_XFRMINBUFFERERROR = 2, + LINUX_MIB_XFRMINHDRERROR = 3, + LINUX_MIB_XFRMINNOSTATES = 4, + LINUX_MIB_XFRMINSTATEPROTOERROR = 5, + LINUX_MIB_XFRMINSTATEMODEERROR = 6, + LINUX_MIB_XFRMINSTATESEQERROR = 7, + LINUX_MIB_XFRMINSTATEEXPIRED = 8, + LINUX_MIB_XFRMINSTATEMISMATCH = 9, + LINUX_MIB_XFRMINSTATEINVALID = 10, + LINUX_MIB_XFRMINTMPLMISMATCH = 11, + LINUX_MIB_XFRMINNOPOLS = 12, + LINUX_MIB_XFRMINPOLBLOCK = 13, + LINUX_MIB_XFRMINPOLERROR = 14, + LINUX_MIB_XFRMOUTERROR = 15, + LINUX_MIB_XFRMOUTBUNDLEGENERROR = 16, + LINUX_MIB_XFRMOUTBUNDLECHECKERROR = 17, + LINUX_MIB_XFRMOUTNOSTATES = 18, + LINUX_MIB_XFRMOUTSTATEPROTOERROR = 19, + LINUX_MIB_XFRMOUTSTATEMODEERROR = 20, + LINUX_MIB_XFRMOUTSTATESEQERROR = 21, + LINUX_MIB_XFRMOUTSTATEEXPIRED = 22, + LINUX_MIB_XFRMOUTPOLBLOCK = 23, + LINUX_MIB_XFRMOUTPOLDEAD = 24, + LINUX_MIB_XFRMOUTPOLERROR = 25, + LINUX_MIB_XFRMFWDHDRERROR = 26, + LINUX_MIB_XFRMOUTSTATEINVALID = 27, + LINUX_MIB_XFRMACQUIREERROR = 28, + __LINUX_MIB_XFRMMAX = 29, +}; + +enum { + LINUX_MIB_TLSNUM = 0, + LINUX_MIB_TLSCURRTXSW = 1, + LINUX_MIB_TLSCURRRXSW = 2, + LINUX_MIB_TLSCURRTXDEVICE = 3, + LINUX_MIB_TLSCURRRXDEVICE = 4, + LINUX_MIB_TLSTXSW = 5, + LINUX_MIB_TLSRXSW = 6, + LINUX_MIB_TLSTXDEVICE = 7, + LINUX_MIB_TLSRXDEVICE = 8, + LINUX_MIB_TLSDECRYPTERROR = 9, + LINUX_MIB_TLSRXDEVICERESYNC = 10, + __LINUX_MIB_TLSMAX = 11, +}; + +enum nf_inet_hooks { + NF_INET_PRE_ROUTING = 0, + NF_INET_LOCAL_IN = 1, + NF_INET_FORWARD = 2, + NF_INET_LOCAL_OUT = 3, + NF_INET_POST_ROUTING = 4, + NF_INET_NUMHOOKS = 5, +}; + +enum { + NFPROTO_UNSPEC = 0, + NFPROTO_INET = 1, + NFPROTO_IPV4 = 2, + NFPROTO_ARP = 3, + NFPROTO_NETDEV = 5, + NFPROTO_BRIDGE = 7, + NFPROTO_IPV6 = 10, + NFPROTO_DECNET = 12, + NFPROTO_NUMPROTO = 13, +}; + +enum tcp_conntrack { + TCP_CONNTRACK_NONE = 0, + TCP_CONNTRACK_SYN_SENT = 1, + TCP_CONNTRACK_SYN_RECV = 2, + TCP_CONNTRACK_ESTABLISHED = 3, + TCP_CONNTRACK_FIN_WAIT = 4, + TCP_CONNTRACK_CLOSE_WAIT = 5, + TCP_CONNTRACK_LAST_ACK = 6, + TCP_CONNTRACK_TIME_WAIT = 7, + TCP_CONNTRACK_CLOSE = 8, + TCP_CONNTRACK_LISTEN = 9, + TCP_CONNTRACK_MAX = 10, + TCP_CONNTRACK_IGNORE = 11, + TCP_CONNTRACK_RETRANS = 12, + TCP_CONNTRACK_UNACK = 13, + TCP_CONNTRACK_TIMEOUT_MAX = 14, +}; + +enum ct_dccp_states { + CT_DCCP_NONE = 0, + CT_DCCP_REQUEST = 1, + CT_DCCP_RESPOND = 2, + CT_DCCP_PARTOPEN = 3, + CT_DCCP_OPEN = 4, + CT_DCCP_CLOSEREQ = 5, + CT_DCCP_CLOSING = 6, + CT_DCCP_TIMEWAIT = 7, + CT_DCCP_IGNORE = 8, + CT_DCCP_INVALID = 9, + __CT_DCCP_MAX = 10, +}; + +enum ip_conntrack_dir { + IP_CT_DIR_ORIGINAL = 0, + IP_CT_DIR_REPLY = 1, + IP_CT_DIR_MAX = 2, +}; + +enum sctp_conntrack { + SCTP_CONNTRACK_NONE = 0, + SCTP_CONNTRACK_CLOSED = 1, + SCTP_CONNTRACK_COOKIE_WAIT = 2, + SCTP_CONNTRACK_COOKIE_ECHOED = 3, + SCTP_CONNTRACK_ESTABLISHED = 4, + SCTP_CONNTRACK_SHUTDOWN_SENT = 5, + SCTP_CONNTRACK_SHUTDOWN_RECD = 6, + SCTP_CONNTRACK_SHUTDOWN_ACK_SENT = 7, + SCTP_CONNTRACK_HEARTBEAT_SENT = 8, + SCTP_CONNTRACK_HEARTBEAT_ACKED = 9, + SCTP_CONNTRACK_MAX = 10, +}; + +enum udp_conntrack { + UDP_CT_UNREPLIED = 0, + UDP_CT_REPLIED = 1, + UDP_CT_MAX = 2, +}; + +enum { + XFRM_POLICY_IN = 0, + XFRM_POLICY_OUT = 1, + XFRM_POLICY_FWD = 2, + XFRM_POLICY_MASK = 3, + XFRM_POLICY_MAX = 3, +}; + +enum skb_ext_id { + SKB_EXT_SEC_PATH = 0, + SKB_EXT_NUM = 1, +}; + +enum sched_tunable_scaling { + SCHED_TUNABLESCALING_NONE = 0, + SCHED_TUNABLESCALING_LOG = 1, + SCHED_TUNABLESCALING_LINEAR = 2, + SCHED_TUNABLESCALING_END = 3, +}; + +enum audit_ntp_type { + AUDIT_NTP_OFFSET = 0, + AUDIT_NTP_FREQ = 1, + AUDIT_NTP_STATUS = 2, + AUDIT_NTP_TAI = 3, + AUDIT_NTP_TICK = 4, + AUDIT_NTP_ADJUST = 5, + AUDIT_NTP_NVALS = 6, +}; + +typedef long int (*sys_call_ptr_t)(const struct pt_regs *); + +enum { + EI_ETYPE_NONE = 0, + EI_ETYPE_NULL = 1, + EI_ETYPE_ERRNO = 2, + EI_ETYPE_ERRNO_NULL = 3, + EI_ETYPE_TRUE = 4, +}; + +struct io_bitmap { + u64 sequence; + refcount_t refcnt; + unsigned int max; + long unsigned int bitmap[1024]; +}; + +struct seccomp_data { + int nr; + __u32 arch; + __u64 instruction_pointer; + __u64 args[6]; +}; + +struct ksignal { + struct k_sigaction ka; + kernel_siginfo_t info; + int sig; +}; + +struct __large_struct { + long unsigned int buf[100]; +}; + +enum { + TASKSTATS_CMD_UNSPEC = 0, + TASKSTATS_CMD_GET = 1, + TASKSTATS_CMD_NEW = 2, + __TASKSTATS_CMD_MAX = 3, +}; + +enum ctx_state { + CONTEXT_DISABLED = 4294967295, + CONTEXT_KERNEL = 0, + CONTEXT_USER = 1, + CONTEXT_GUEST = 2, +}; + +enum { + HI_SOFTIRQ = 0, + TIMER_SOFTIRQ = 1, + NET_TX_SOFTIRQ = 2, + NET_RX_SOFTIRQ = 3, + BLOCK_SOFTIRQ = 4, + IRQ_POLL_SOFTIRQ = 5, + TASKLET_SOFTIRQ = 6, + SCHED_SOFTIRQ = 7, + HRTIMER_SOFTIRQ = 8, + RCU_SOFTIRQ = 9, + NR_SOFTIRQS = 10, +}; + +enum cpu_usage_stat { + CPUTIME_USER = 0, + CPUTIME_NICE = 1, + CPUTIME_SYSTEM = 2, + CPUTIME_SOFTIRQ = 3, + CPUTIME_IRQ = 4, + CPUTIME_IDLE = 5, + CPUTIME_IOWAIT = 6, + CPUTIME_STEAL = 7, + CPUTIME_GUEST = 8, + CPUTIME_GUEST_NICE = 9, + NR_STATS = 10, +}; + +enum bpf_cgroup_storage_type { + BPF_CGROUP_STORAGE_SHARED = 0, + BPF_CGROUP_STORAGE_PERCPU = 1, + __BPF_CGROUP_STORAGE_MAX = 2, +}; + +enum cgroup_subsys_id { + cpuset_cgrp_id = 0, + cpu_cgrp_id = 1, + cpuacct_cgrp_id = 2, + freezer_cgrp_id = 3, + CGROUP_SUBSYS_COUNT = 4, +}; + +typedef u8 kprobe_opcode_t; + +struct arch_specific_insn { + kprobe_opcode_t *insn; + bool boostable; + bool if_modifier; +}; + +struct kprobe; + +struct prev_kprobe { + struct kprobe *kp; + long unsigned int status; + long unsigned int old_flags; + long unsigned int saved_flags; +}; + +typedef int (*kprobe_pre_handler_t)(struct kprobe *, struct pt_regs *); + +typedef void (*kprobe_post_handler_t)(struct kprobe *, struct pt_regs *, long unsigned int); + +typedef int (*kprobe_fault_handler_t)(struct kprobe *, struct pt_regs *, int); + +struct kprobe { + struct hlist_node hlist; + struct list_head list; + long unsigned int nmissed; + kprobe_opcode_t *addr; + const char *symbol_name; + unsigned int offset; + kprobe_pre_handler_t pre_handler; + kprobe_post_handler_t post_handler; + kprobe_fault_handler_t fault_handler; + kprobe_opcode_t opcode; + struct arch_specific_insn ainsn; + u32 flags; +}; + +struct kprobe_ctlblk { + long unsigned int kprobe_status; + long unsigned int kprobe_old_flags; + long unsigned int kprobe_saved_flags; + struct prev_kprobe prev_kprobe; +}; + +struct kretprobe_blackpoint { + const char *name; + void *addr; +}; + +struct kprobe_insn_cache { + struct mutex mutex; + void * (*alloc)(); + void (*free)(void *); + struct list_head pages; + size_t insn_size; + int nr_garbage; +}; + +struct trace_event_raw_sys_enter { + struct trace_entry ent; + long int id; + long unsigned int args[6]; + char __data[0]; +}; + +struct trace_event_raw_sys_exit { + struct trace_entry ent; + long int id; + long int ret; + char __data[0]; +}; + +struct trace_event_data_offsets_sys_enter {}; + +struct trace_event_data_offsets_sys_exit {}; + +typedef void (*btf_trace_sys_enter)(void *, struct pt_regs *, long int); + +typedef void (*btf_trace_sys_exit)(void *, struct pt_regs *, long int); + +struct alt_instr { + s32 instr_offset; + s32 repl_offset; + u16 cpuid; + u8 instrlen; + u8 replacementlen; + u8 padlen; +} __attribute__((packed)); + +enum vm_fault_reason { + VM_FAULT_OOM = 1, + VM_FAULT_SIGBUS = 2, + VM_FAULT_MAJOR = 4, + VM_FAULT_WRITE = 8, + VM_FAULT_HWPOISON = 16, + VM_FAULT_HWPOISON_LARGE = 32, + VM_FAULT_SIGSEGV = 64, + VM_FAULT_NOPAGE = 256, + VM_FAULT_LOCKED = 512, + VM_FAULT_RETRY = 1024, + VM_FAULT_FALLBACK = 2048, + VM_FAULT_DONE_COW = 4096, + VM_FAULT_NEEDDSYNC = 8192, + VM_FAULT_HINDEX_MASK = 983040, +}; + +struct vm_special_mapping { + const char *name; + struct page **pages; + vm_fault_t (*fault)(const struct vm_special_mapping *, struct vm_area_struct *, struct vm_fault *); + int (*mremap)(const struct vm_special_mapping *, struct vm_area_struct *); +}; + +struct pvclock_vcpu_time_info { + u32 version; + u32 pad0; + u64 tsc_timestamp; + u64 system_time; + u32 tsc_to_system_mul; + s8 tsc_shift; + u8 flags; + u8 pad[2]; +}; + +struct pvclock_vsyscall_time_info { + struct pvclock_vcpu_time_info pvti; + long: 64; + long: 64; + long: 64; + long: 64; +}; + +struct vdso_timestamp { + u64 sec; + u64 nsec; +}; + +struct vdso_data { + u32 seq; + s32 clock_mode; + u64 cycle_last; + u64 mask; + u32 mult; + u32 shift; + struct vdso_timestamp basetime[12]; + s32 tz_minuteswest; + s32 tz_dsttime; + u32 hrtimer_res; + u32 __unused; +}; + +struct ms_hyperv_tsc_page { + volatile u32 tsc_sequence; + u32 reserved1; + volatile u64 tsc_scale; + volatile s64 tsc_offset; + u64 reserved2[509]; +}; + +struct ms_hyperv_info { + u32 features; + u32 misc_features; + u32 hints; + u32 nested_features; + u32 max_vp_index; + u32 max_lp_index; +}; + +enum { + X86_TRAP_DE = 0, + X86_TRAP_DB = 1, + X86_TRAP_NMI = 2, + X86_TRAP_BP = 3, + X86_TRAP_OF = 4, + X86_TRAP_BR = 5, + X86_TRAP_UD = 6, + X86_TRAP_NM = 7, + X86_TRAP_DF = 8, + X86_TRAP_OLD_MF = 9, + X86_TRAP_TS = 10, + X86_TRAP_NP = 11, + X86_TRAP_SS = 12, + X86_TRAP_GP = 13, + X86_TRAP_PF = 14, + X86_TRAP_SPURIOUS = 15, + X86_TRAP_MF = 16, + X86_TRAP_AC = 17, + X86_TRAP_MC = 18, + X86_TRAP_XF = 19, + X86_TRAP_IRET = 32, +}; + +enum x86_pf_error_code { + X86_PF_PROT = 1, + X86_PF_WRITE = 2, + X86_PF_USER = 4, + X86_PF_RSVD = 8, + X86_PF_INSTR = 16, + X86_PF_PK = 32, +}; + +struct trace_event_raw_emulate_vsyscall { + struct trace_entry ent; + int nr; + char __data[0]; +}; + +struct trace_event_data_offsets_emulate_vsyscall {}; + +typedef void (*btf_trace_emulate_vsyscall)(void *, int); + +enum { + EMULATE = 0, + XONLY = 1, + NONE = 2, +}; + +enum perf_type_id { + PERF_TYPE_HARDWARE = 0, + PERF_TYPE_SOFTWARE = 1, + PERF_TYPE_TRACEPOINT = 2, + PERF_TYPE_HW_CACHE = 3, + PERF_TYPE_RAW = 4, + PERF_TYPE_BREAKPOINT = 5, + PERF_TYPE_MAX = 6, +}; + +enum perf_hw_id { + PERF_COUNT_HW_CPU_CYCLES = 0, + PERF_COUNT_HW_INSTRUCTIONS = 1, + PERF_COUNT_HW_CACHE_REFERENCES = 2, + PERF_COUNT_HW_CACHE_MISSES = 3, + PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4, + PERF_COUNT_HW_BRANCH_MISSES = 5, + PERF_COUNT_HW_BUS_CYCLES = 6, + PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 7, + PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 8, + PERF_COUNT_HW_REF_CPU_CYCLES = 9, + PERF_COUNT_HW_MAX = 10, +}; + +enum perf_hw_cache_id { + PERF_COUNT_HW_CACHE_L1D = 0, + PERF_COUNT_HW_CACHE_L1I = 1, + PERF_COUNT_HW_CACHE_LL = 2, + PERF_COUNT_HW_CACHE_DTLB = 3, + PERF_COUNT_HW_CACHE_ITLB = 4, + PERF_COUNT_HW_CACHE_BPU = 5, + PERF_COUNT_HW_CACHE_NODE = 6, + PERF_COUNT_HW_CACHE_MAX = 7, +}; + +enum perf_hw_cache_op_id { + PERF_COUNT_HW_CACHE_OP_READ = 0, + PERF_COUNT_HW_CACHE_OP_WRITE = 1, + PERF_COUNT_HW_CACHE_OP_PREFETCH = 2, + PERF_COUNT_HW_CACHE_OP_MAX = 3, +}; + +enum perf_hw_cache_op_result_id { + PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0, + PERF_COUNT_HW_CACHE_RESULT_MISS = 1, + PERF_COUNT_HW_CACHE_RESULT_MAX = 2, +}; + +enum perf_event_sample_format { + PERF_SAMPLE_IP = 1, + PERF_SAMPLE_TID = 2, + PERF_SAMPLE_TIME = 4, + PERF_SAMPLE_ADDR = 8, + PERF_SAMPLE_READ = 16, + PERF_SAMPLE_CALLCHAIN = 32, + PERF_SAMPLE_ID = 64, + PERF_SAMPLE_CPU = 128, + PERF_SAMPLE_PERIOD = 256, + PERF_SAMPLE_STREAM_ID = 512, + PERF_SAMPLE_RAW = 1024, + PERF_SAMPLE_BRANCH_STACK = 2048, + PERF_SAMPLE_REGS_USER = 4096, + PERF_SAMPLE_STACK_USER = 8192, + PERF_SAMPLE_WEIGHT = 16384, + PERF_SAMPLE_DATA_SRC = 32768, + PERF_SAMPLE_IDENTIFIER = 65536, + PERF_SAMPLE_TRANSACTION = 131072, + PERF_SAMPLE_REGS_INTR = 262144, + PERF_SAMPLE_PHYS_ADDR = 524288, + PERF_SAMPLE_AUX = 1048576, + PERF_SAMPLE_MAX = 2097152, + __PERF_SAMPLE_CALLCHAIN_EARLY = 0, +}; + +enum perf_branch_sample_type { + PERF_SAMPLE_BRANCH_USER = 1, + PERF_SAMPLE_BRANCH_KERNEL = 2, + PERF_SAMPLE_BRANCH_HV = 4, + PERF_SAMPLE_BRANCH_ANY = 8, + PERF_SAMPLE_BRANCH_ANY_CALL = 16, + PERF_SAMPLE_BRANCH_ANY_RETURN = 32, + PERF_SAMPLE_BRANCH_IND_CALL = 64, + PERF_SAMPLE_BRANCH_ABORT_TX = 128, + PERF_SAMPLE_BRANCH_IN_TX = 256, + PERF_SAMPLE_BRANCH_NO_TX = 512, + PERF_SAMPLE_BRANCH_COND = 1024, + PERF_SAMPLE_BRANCH_CALL_STACK = 2048, + PERF_SAMPLE_BRANCH_IND_JUMP = 4096, + PERF_SAMPLE_BRANCH_CALL = 8192, + PERF_SAMPLE_BRANCH_NO_FLAGS = 16384, + PERF_SAMPLE_BRANCH_NO_CYCLES = 32768, + PERF_SAMPLE_BRANCH_TYPE_SAVE = 65536, + PERF_SAMPLE_BRANCH_MAX = 131072, +}; + +struct perf_event_mmap_page { + __u32 version; + __u32 compat_version; + __u32 lock; + __u32 index; + __s64 offset; + __u64 time_enabled; + __u64 time_running; + union { + __u64 capabilities; + struct { + __u64 cap_bit0: 1; + __u64 cap_bit0_is_deprecated: 1; + __u64 cap_user_rdpmc: 1; + __u64 cap_user_time: 1; + __u64 cap_user_time_zero: 1; + __u64 cap_____res: 59; + }; + }; + __u16 pmc_width; + __u16 time_shift; + __u32 time_mult; + __u64 time_offset; + __u64 time_zero; + __u32 size; + __u8 __reserved[948]; + __u64 data_head; + __u64 data_tail; + __u64 data_offset; + __u64 data_size; + __u64 aux_head; + __u64 aux_tail; + __u64 aux_offset; + __u64 aux_size; +}; + +struct ldt_struct { + struct desc_struct *entries; + unsigned int nr_entries; + int slot; +}; + +struct x86_pmu_capability { + int version; + int num_counters_gp; + int num_counters_fixed; + int bit_width_gp; + int bit_width_fixed; + unsigned int events_mask; + int events_mask_len; +}; + +enum stack_type { + STACK_TYPE_UNKNOWN = 0, + STACK_TYPE_TASK = 1, + STACK_TYPE_IRQ = 2, + STACK_TYPE_SOFTIRQ = 3, + STACK_TYPE_ENTRY = 4, + STACK_TYPE_EXCEPTION = 5, + STACK_TYPE_EXCEPTION_LAST = 10, +}; + +struct stack_info { + enum stack_type type; + long unsigned int *begin; + long unsigned int *end; + long unsigned int *next_sp; +}; + +struct stack_frame { + struct stack_frame *next_frame; + long unsigned int return_address; +}; + +struct stack_frame_ia32 { + u32 next_frame; + u32 return_address; +}; + +struct perf_guest_switch_msr { + unsigned int msr; + u64 host; + u64 guest; +}; + +struct device_attribute { + struct attribute attr; + ssize_t (*show)(struct device *, struct device_attribute *, char *); + ssize_t (*store)(struct device *, struct device_attribute *, const char *, size_t); +}; + +enum perf_event_x86_regs { + PERF_REG_X86_AX = 0, + PERF_REG_X86_BX = 1, + PERF_REG_X86_CX = 2, + PERF_REG_X86_DX = 3, + PERF_REG_X86_SI = 4, + PERF_REG_X86_DI = 5, + PERF_REG_X86_BP = 6, + PERF_REG_X86_SP = 7, + PERF_REG_X86_IP = 8, + PERF_REG_X86_FLAGS = 9, + PERF_REG_X86_CS = 10, + PERF_REG_X86_SS = 11, + PERF_REG_X86_DS = 12, + PERF_REG_X86_ES = 13, + PERF_REG_X86_FS = 14, + PERF_REG_X86_GS = 15, + PERF_REG_X86_R8 = 16, + PERF_REG_X86_R9 = 17, + PERF_REG_X86_R10 = 18, + PERF_REG_X86_R11 = 19, + PERF_REG_X86_R12 = 20, + PERF_REG_X86_R13 = 21, + PERF_REG_X86_R14 = 22, + PERF_REG_X86_R15 = 23, + PERF_REG_X86_32_MAX = 16, + PERF_REG_X86_64_MAX = 24, + PERF_REG_X86_XMM0 = 32, + PERF_REG_X86_XMM1 = 34, + PERF_REG_X86_XMM2 = 36, + PERF_REG_X86_XMM3 = 38, + PERF_REG_X86_XMM4 = 40, + PERF_REG_X86_XMM5 = 42, + PERF_REG_X86_XMM6 = 44, + PERF_REG_X86_XMM7 = 46, + PERF_REG_X86_XMM8 = 48, + PERF_REG_X86_XMM9 = 50, + PERF_REG_X86_XMM10 = 52, + PERF_REG_X86_XMM11 = 54, + PERF_REG_X86_XMM12 = 56, + PERF_REG_X86_XMM13 = 58, + PERF_REG_X86_XMM14 = 60, + PERF_REG_X86_XMM15 = 62, + PERF_REG_X86_XMM_MAX = 64, +}; + +struct perf_callchain_entry_ctx { + struct perf_callchain_entry *entry; + u32 max_stack; + u32 nr; + short int contexts; + bool contexts_maxed; +}; + +struct perf_pmu_events_attr { + struct device_attribute attr; + u64 id; + const char *event_str; +}; + +struct perf_pmu_events_ht_attr { + struct device_attribute attr; + u64 id; + const char *event_str_ht; + const char *event_str_noht; +}; + +enum { + NMI_LOCAL = 0, + NMI_UNKNOWN = 1, + NMI_SERR = 2, + NMI_IO_CHECK = 3, + NMI_MAX = 4, +}; + +typedef int (*nmi_handler_t)(unsigned int, struct pt_regs *); + +struct nmiaction { + struct list_head list; + nmi_handler_t handler; + u64 max_duration; + struct irq_work irq_work; + long unsigned int flags; + const char *name; +}; + +struct cyc2ns_data { + u32 cyc2ns_mul; + u32 cyc2ns_shift; + u64 cyc2ns_offset; +}; + +struct unwind_state { + struct stack_info stack_info; + long unsigned int stack_mask; + struct task_struct *task; + int graph_idx; + bool error; + bool signal; + bool full_regs; + long unsigned int sp; + long unsigned int bp; + long unsigned int ip; + struct pt_regs *regs; +}; + +enum extra_reg_type { + EXTRA_REG_NONE = 4294967295, + EXTRA_REG_RSP_0 = 0, + EXTRA_REG_RSP_1 = 1, + EXTRA_REG_LBR = 2, + EXTRA_REG_LDLAT = 3, + EXTRA_REG_FE = 4, + EXTRA_REG_MAX = 5, +}; + +struct event_constraint { + union { + long unsigned int idxmsk[1]; + u64 idxmsk64; + }; + u64 code; + u64 cmask; + int weight; + int overlap; + int flags; + unsigned int size; +}; + +struct amd_nb { + int nb_id; + int refcnt; + struct perf_event *owners[64]; + struct event_constraint event_constraints[64]; +}; + +struct er_account { + raw_spinlock_t lock; + u64 config; + u64 reg; + atomic_t ref; +}; + +struct intel_shared_regs { + struct er_account regs[5]; + int refcnt; + unsigned int core_id; +}; + +enum intel_excl_state_type { + INTEL_EXCL_UNUSED = 0, + INTEL_EXCL_SHARED = 1, + INTEL_EXCL_EXCLUSIVE = 2, +}; + +struct intel_excl_states { + enum intel_excl_state_type state[64]; + bool sched_started; +}; + +struct intel_excl_cntrs { + raw_spinlock_t lock; + struct intel_excl_states states[2]; + union { + u16 has_exclusive[2]; + u32 exclusive_present; + }; + int refcnt; + unsigned int core_id; +}; + +enum { + X86_PERF_KFREE_SHARED = 0, + X86_PERF_KFREE_EXCL = 1, + X86_PERF_KFREE_MAX = 2, +}; + +struct x86_perf_task_context; + +struct cpu_hw_events { + struct perf_event *events[64]; + long unsigned int active_mask[1]; + long unsigned int running[1]; + int enabled; + int n_events; + int n_added; + int n_txn; + int assign[64]; + u64 tags[64]; + struct perf_event *event_list[64]; + struct event_constraint *event_constraint[64]; + int n_excl; + unsigned int txn_flags; + int is_fake; + struct debug_store *ds; + void *ds_pebs_vaddr; + void *ds_bts_vaddr; + u64 pebs_enabled; + int n_pebs; + int n_large_pebs; + int n_pebs_via_pt; + int pebs_output; + u64 pebs_data_cfg; + u64 active_pebs_data_cfg; + int pebs_record_size; + int lbr_users; + int lbr_pebs_users; + struct perf_branch_stack lbr_stack; + struct perf_branch_entry lbr_entries[32]; + struct er_account *lbr_sel; + u64 br_sel; + struct x86_perf_task_context *last_task_ctx; + int last_log_id; + u64 intel_ctrl_guest_mask; + u64 intel_ctrl_host_mask; + struct perf_guest_switch_msr guest_switch_msrs[64]; + u64 intel_cp_status; + struct intel_shared_regs *shared_regs; + struct event_constraint *constraint_list; + struct intel_excl_cntrs *excl_cntrs; + int excl_thread_id; + u64 tfa_shadow; + struct amd_nb *amd_nb; + u64 perf_ctr_virt_mask; + void *kfree_on_online[2]; +}; + +struct x86_perf_task_context { + u64 lbr_from[32]; + u64 lbr_to[32]; + u64 lbr_info[32]; + int tos; + int valid_lbrs; + int lbr_callstack_users; + int lbr_stack_state; + int log_id; +}; + +struct extra_reg { + unsigned int event; + unsigned int msr; + u64 config_mask; + u64 valid_mask; + int idx; + bool extra_msr_access; +}; + +union perf_capabilities { + struct { + u64 lbr_format: 6; + u64 pebs_trap: 1; + u64 pebs_arch_reg: 1; + u64 pebs_format: 4; + u64 smm_freeze: 1; + u64 full_width_write: 1; + u64 pebs_baseline: 1; + u64 pebs_metrics_available: 1; + u64 pebs_output_pt_available: 1; + }; + u64 capabilities; +}; + +struct x86_pmu_quirk { + struct x86_pmu_quirk *next; + void (*func)(); +}; + +enum { + x86_lbr_exclusive_lbr = 0, + x86_lbr_exclusive_bts = 1, + x86_lbr_exclusive_pt = 2, + x86_lbr_exclusive_max = 3, +}; + +struct x86_pmu { + const char *name; + int version; + int (*handle_irq)(struct pt_regs *); + void (*disable_all)(); + void (*enable_all)(int); + void (*enable)(struct perf_event *); + void (*disable)(struct perf_event *); + void (*add)(struct perf_event *); + void (*del)(struct perf_event *); + void (*read)(struct perf_event *); + int (*hw_config)(struct perf_event *); + int (*schedule_events)(struct cpu_hw_events *, int, int *); + unsigned int eventsel; + unsigned int perfctr; + int (*addr_offset)(int, bool); + int (*rdpmc_index)(int); + u64 (*event_map)(int); + int max_events; + int num_counters; + int num_counters_fixed; + int cntval_bits; + u64 cntval_mask; + union { + long unsigned int events_maskl; + long unsigned int events_mask[1]; + }; + int events_mask_len; + int apic; + u64 max_period; + struct event_constraint * (*get_event_constraints)(struct cpu_hw_events *, int, struct perf_event *); + void (*put_event_constraints)(struct cpu_hw_events *, struct perf_event *); + void (*start_scheduling)(struct cpu_hw_events *); + void (*commit_scheduling)(struct cpu_hw_events *, int, int); + void (*stop_scheduling)(struct cpu_hw_events *); + struct event_constraint *event_constraints; + struct x86_pmu_quirk *quirks; + int perfctr_second_write; + u64 (*limit_period)(struct perf_event *, u64); + unsigned int late_ack: 1; + unsigned int counter_freezing: 1; + int attr_rdpmc_broken; + int attr_rdpmc; + struct attribute **format_attrs; + ssize_t (*events_sysfs_show)(char *, u64); + const struct attribute_group **attr_update; + long unsigned int attr_freeze_on_smi; + int (*cpu_prepare)(int); + void (*cpu_starting)(int); + void (*cpu_dying)(int); + void (*cpu_dead)(int); + void (*check_microcode)(); + void (*sched_task)(struct perf_event_context *, bool); + u64 intel_ctrl; + union perf_capabilities intel_cap; + unsigned int bts: 1; + unsigned int bts_active: 1; + unsigned int pebs: 1; + unsigned int pebs_active: 1; + unsigned int pebs_broken: 1; + unsigned int pebs_prec_dist: 1; + unsigned int pebs_no_tlb: 1; + unsigned int pebs_no_isolation: 1; + int pebs_record_size; + int pebs_buffer_size; + int max_pebs_events; + void (*drain_pebs)(struct pt_regs *); + struct event_constraint *pebs_constraints; + void (*pebs_aliases)(struct perf_event *); + long unsigned int large_pebs_flags; + u64 rtm_abort_event; + long unsigned int lbr_tos; + long unsigned int lbr_from; + long unsigned int lbr_to; + int lbr_nr; + u64 lbr_sel_mask; + const int *lbr_sel_map; + bool lbr_double_abort; + bool lbr_pt_coexist; + atomic_t lbr_exclusive[3]; + void (*swap_task_ctx)(struct perf_event_context *, struct perf_event_context *); + unsigned int amd_nb_constraints: 1; + struct extra_reg *extra_regs; + unsigned int flags; + struct perf_guest_switch_msr * (*guest_get_msrs)(int *); + int (*check_period)(struct perf_event *, u64); + int (*aux_output_match)(struct perf_event *); +}; + +struct sched_state { + int weight; + int event; + int counter; + int unassigned; + int nr_gp; + long unsigned int used[1]; +}; + +struct perf_sched { + int max_weight; + int max_events; + int max_gp; + int saved_states; + struct event_constraint **constraints; + struct sched_state state; + struct sched_state saved[2]; +}; + +typedef int pao_T__; + +typedef int pto_T_____2; + +typedef unsigned int pao_T_____2; + +enum migratetype { + MIGRATE_UNMOVABLE = 0, + MIGRATE_MOVABLE = 1, + MIGRATE_RECLAIMABLE = 2, + MIGRATE_PCPTYPES = 3, + MIGRATE_HIGHATOMIC = 3, + MIGRATE_TYPES = 4, +}; + +enum lru_list { + LRU_INACTIVE_ANON = 0, + LRU_ACTIVE_ANON = 1, + LRU_INACTIVE_FILE = 2, + LRU_ACTIVE_FILE = 3, + LRU_UNEVICTABLE = 4, + NR_LRU_LISTS = 5, +}; + +enum zone_watermarks { + WMARK_MIN = 0, + WMARK_LOW = 1, + WMARK_HIGH = 2, + NR_WMARK = 3, +}; + +enum { + ZONELIST_FALLBACK = 0, + ZONELIST_NOFALLBACK = 1, + MAX_ZONELISTS = 2, +}; + +struct perf_msr { + u64 msr; + struct attribute_group *grp; + bool (*test)(int, void *); + bool no_check; +}; + +struct amd_uncore { + int id; + int refcnt; + int cpu; + int num_counters; + int rdpmc_base; + u32 msr_base; + cpumask_t *active_mask; + struct pmu *pmu; + struct perf_event *events[6]; + struct hlist_node node; +}; + +typedef int pci_power_t; + +typedef unsigned int pci_channel_state_t; + +typedef short unsigned int pci_dev_flags_t; + +struct pci_bus; + +struct pci_slot; + +struct aer_stats; + +struct pci_driver; + +struct pcie_link_state; + +struct pci_vpd; + +struct pci_sriov; + +struct pci_dev { + struct list_head bus_list; + struct pci_bus *bus; + struct pci_bus *subordinate; + void *sysdata; + struct proc_dir_entry *procent; + struct pci_slot *slot; + unsigned int devfn; + short unsigned int vendor; + short unsigned int device; + short unsigned int subsystem_vendor; + short unsigned int subsystem_device; + unsigned int class; + u8 revision; + u8 hdr_type; + u16 aer_cap; + struct aer_stats *aer_stats; + u8 pcie_cap; + u8 msi_cap; + u8 msix_cap; + u8 pcie_mpss: 3; + u8 rom_base_reg; + u8 pin; + u16 pcie_flags_reg; + long unsigned int *dma_alias_mask; + struct pci_driver *driver; + u64 dma_mask; + struct device_dma_parameters dma_parms; + pci_power_t current_state; + unsigned int imm_ready: 1; + u8 pm_cap; + unsigned int pme_support: 5; + unsigned int pme_poll: 1; + unsigned int d1_support: 1; + unsigned int d2_support: 1; + unsigned int no_d1d2: 1; + unsigned int no_d3cold: 1; + unsigned int bridge_d3: 1; + unsigned int d3cold_allowed: 1; + unsigned int mmio_always_on: 1; + unsigned int wakeup_prepared: 1; + unsigned int runtime_d3cold: 1; + unsigned int skip_bus_pm: 1; + unsigned int ignore_hotplug: 1; + unsigned int hotplug_user_indicators: 1; + unsigned int clear_retrain_link: 1; + unsigned int d3_delay; + unsigned int d3cold_delay; + struct pcie_link_state *link_state; + unsigned int ltr_path: 1; + unsigned int eetlp_prefix_path: 1; + pci_channel_state_t error_state; + struct device dev; + int cfg_size; + unsigned int irq; + struct resource resource[11]; + bool match_driver; + unsigned int transparent: 1; + unsigned int io_window: 1; + unsigned int pref_window: 1; + unsigned int pref_64_window: 1; + unsigned int multifunction: 1; + unsigned int is_busmaster: 1; + unsigned int no_msi: 1; + unsigned int no_64bit_msi: 1; + unsigned int block_cfg_access: 1; + unsigned int broken_parity_status: 1; + unsigned int irq_reroute_variant: 2; + unsigned int msi_enabled: 1; + unsigned int msix_enabled: 1; + unsigned int ari_enabled: 1; + unsigned int ats_enabled: 1; + unsigned int pasid_enabled: 1; + unsigned int pri_enabled: 1; + unsigned int is_managed: 1; + unsigned int needs_freset: 1; + unsigned int state_saved: 1; + unsigned int is_physfn: 1; + unsigned int is_virtfn: 1; + unsigned int reset_fn: 1; + unsigned int is_hotplug_bridge: 1; + unsigned int shpc_managed: 1; + unsigned int is_thunderbolt: 1; + unsigned int untrusted: 1; + unsigned int __aer_firmware_first_valid: 1; + unsigned int __aer_firmware_first: 1; + unsigned int broken_intx_masking: 1; + unsigned int io_window_1k: 1; + unsigned int irq_managed: 1; + unsigned int non_compliant_bars: 1; + unsigned int is_probed: 1; + unsigned int link_active_reporting: 1; + unsigned int no_vf_scan: 1; + pci_dev_flags_t dev_flags; + atomic_t enable_cnt; + u32 saved_config_space[16]; + struct hlist_head saved_cap_space; + struct bin_attribute *rom_attr; + int rom_attr_enabled; + struct bin_attribute *res_attr[11]; + struct bin_attribute *res_attr_wc[11]; + const struct attribute_group **msi_irq_groups; + struct pci_vpd *vpd; + union { + struct pci_sriov *sriov; + struct pci_dev *physfn; + }; + u16 ats_cap; + u8 ats_stu; + u16 pri_cap; + u32 pri_reqs_alloc; + unsigned int pasid_required: 1; + u16 pasid_cap; + u16 pasid_features; + phys_addr_t rom; + size_t romlen; + char *driver_override; + long unsigned int priv_flags; +}; + +struct pci_device_id { + __u32 vendor; + __u32 device; + __u32 subvendor; + __u32 subdevice; + __u32 class; + __u32 class_mask; + kernel_ulong_t driver_data; +}; + +struct hotplug_slot; + +struct pci_slot { + struct pci_bus *bus; + struct list_head list; + struct hotplug_slot *hotplug; + unsigned char number; + struct kobject kobj; +}; + +typedef short unsigned int pci_bus_flags_t; + +struct pci_ops; + +struct msi_controller; + +struct pci_bus { + struct list_head node; + struct pci_bus *parent; + struct list_head children; + struct list_head devices; + struct pci_dev *self; + struct list_head slots; + struct resource *resource[4]; + struct list_head resources; + struct resource busn_res; + struct pci_ops *ops; + struct msi_controller *msi; + void *sysdata; + struct proc_dir_entry *procdir; + unsigned char number; + unsigned char primary; + unsigned char max_bus_speed; + unsigned char cur_bus_speed; + char name[48]; + short unsigned int bridge_ctl; + pci_bus_flags_t bus_flags; + struct device *bridge; + struct device dev; + struct bin_attribute *legacy_io; + struct bin_attribute *legacy_mem; + unsigned int is_added: 1; +}; + +enum { + PCI_STD_RESOURCES = 0, + PCI_STD_RESOURCE_END = 5, + PCI_ROM_RESOURCE = 6, + PCI_BRIDGE_RESOURCES = 7, + PCI_BRIDGE_RESOURCE_END = 10, + PCI_NUM_RESOURCES = 11, + DEVICE_COUNT_RESOURCE = 11, +}; + +enum pci_channel_state { + pci_channel_io_normal = 1, + pci_channel_io_frozen = 2, + pci_channel_io_perm_failure = 3, +}; + +typedef unsigned int pcie_reset_state_t; + +struct pci_dynids { + spinlock_t lock; + struct list_head list; +}; + +struct pci_error_handlers; + +struct pci_driver { + struct list_head node; + const char *name; + const struct pci_device_id *id_table; + int (*probe)(struct pci_dev *, const struct pci_device_id *); + void (*remove)(struct pci_dev *); + int (*suspend)(struct pci_dev *, pm_message_t); + int (*resume)(struct pci_dev *); + void (*shutdown)(struct pci_dev *); + int (*sriov_configure)(struct pci_dev *, int); + const struct pci_error_handlers *err_handler; + const struct attribute_group **groups; + struct device_driver driver; + struct pci_dynids dynids; +}; + +struct pci_ops { + int (*add_bus)(struct pci_bus *); + void (*remove_bus)(struct pci_bus *); + void * (*map_bus)(struct pci_bus *, unsigned int, int); + int (*read)(struct pci_bus *, unsigned int, int, int, u32 *); + int (*write)(struct pci_bus *, unsigned int, int, int, u32); +}; + +typedef unsigned int pci_ers_result_t; + +struct pci_error_handlers { + pci_ers_result_t (*error_detected)(struct pci_dev *, enum pci_channel_state); + pci_ers_result_t (*mmio_enabled)(struct pci_dev *); + pci_ers_result_t (*slot_reset)(struct pci_dev *); + void (*reset_prepare)(struct pci_dev *); + void (*reset_done)(struct pci_dev *); + void (*resume)(struct pci_dev *); +}; + +enum pcie_bus_config_types { + PCIE_BUS_TUNE_OFF = 0, + PCIE_BUS_DEFAULT = 1, + PCIE_BUS_SAFE = 2, + PCIE_BUS_PERFORMANCE = 3, + PCIE_BUS_PEER2PEER = 4, +}; + +struct syscore_ops { + struct list_head node; + int (*suspend)(); + void (*resume)(); + void (*shutdown)(); +}; + +enum ibs_states { + IBS_ENABLED = 0, + IBS_STARTED = 1, + IBS_STOPPING = 2, + IBS_STOPPED = 3, + IBS_MAX_STATES = 4, +}; + +struct cpu_perf_ibs { + struct perf_event *event; + long unsigned int state[1]; +}; + +struct perf_ibs { + struct pmu pmu; + unsigned int msr; + u64 config_mask; + u64 cnt_mask; + u64 enable_mask; + u64 valid_mask; + u64 max_period; + long unsigned int offset_mask[1]; + int offset_max; + struct cpu_perf_ibs *pcpu; + struct attribute **format_attrs; + struct attribute_group format_group; + const struct attribute_group *attr_groups[2]; + u64 (*get_count)(u64); +}; + +struct perf_ibs_data { + u32 size; + union { + u32 data[0]; + u32 caps; + }; + u64 regs[8]; +}; + +struct amd_iommu; + +struct perf_amd_iommu { + struct list_head list; + struct pmu pmu; + struct amd_iommu *iommu; + char name[16]; + u8 max_banks; + u8 max_counters; + u64 cntr_assign_mask; + raw_spinlock_t lock; +}; + +struct amd_iommu_event_desc { + struct kobj_attribute attr; + const char *event; +}; + +enum perf_msr_id { + PERF_MSR_TSC = 0, + PERF_MSR_APERF = 1, + PERF_MSR_MPERF = 2, + PERF_MSR_PPERF = 3, + PERF_MSR_SMI = 4, + PERF_MSR_PTSC = 5, + PERF_MSR_IRPERF = 6, + PERF_MSR_THERM = 7, + PERF_MSR_EVENT_MAX = 8, +}; + +struct x86_cpu_desc { + u8 x86_family; + u8 x86_vendor; + u8 x86_model; + u8 x86_stepping; + u32 x86_microcode_rev; +}; + +union cpuid10_eax { + struct { + unsigned int version_id: 8; + unsigned int num_counters: 8; + unsigned int bit_width: 8; + unsigned int mask_length: 8; + } split; + unsigned int full; +}; + +union cpuid10_ebx { + struct { + unsigned int no_unhalted_core_cycles: 1; + unsigned int no_instructions_retired: 1; + unsigned int no_unhalted_reference_cycles: 1; + unsigned int no_llc_reference: 1; + unsigned int no_llc_misses: 1; + unsigned int no_branch_instruction_retired: 1; + unsigned int no_branch_misses_retired: 1; + } split; + unsigned int full; +}; + +union cpuid10_edx { + struct { + unsigned int num_counters_fixed: 5; + unsigned int bit_width_fixed: 8; + unsigned int reserved: 19; + } split; + unsigned int full; +}; + +union x86_pmu_config { + struct { + u64 event: 8; + u64 umask: 8; + u64 usr: 1; + u64 os: 1; + u64 edge: 1; + u64 pc: 1; + u64 interrupt: 1; + u64 __reserved1: 1; + u64 en: 1; + u64 inv: 1; + u64 cmask: 8; + u64 event2: 4; + u64 __reserved2: 4; + u64 go: 1; + u64 ho: 1; + } bits; + u64 value; +}; + +enum pageflags { + PG_locked = 0, + PG_referenced = 1, + PG_uptodate = 2, + PG_dirty = 3, + PG_lru = 4, + PG_active = 5, + PG_workingset = 6, + PG_waiters = 7, + PG_error = 8, + PG_slab = 9, + PG_owner_priv_1 = 10, + PG_arch_1 = 11, + PG_reserved = 12, + PG_private = 13, + PG_private_2 = 14, + PG_writeback = 15, + PG_head = 16, + PG_mappedtodisk = 17, + PG_reclaim = 18, + PG_swapbacked = 19, + PG_unevictable = 20, + PG_mlocked = 21, + PG_uncached = 22, + __NR_PAGEFLAGS = 23, + PG_checked = 10, + PG_swapcache = 10, + PG_fscache = 14, + PG_pinned = 10, + PG_savepinned = 3, + PG_foreign = 10, + PG_xen_remapped = 10, + PG_slob_free = 13, + PG_double_map = 14, + PG_isolated = 18, +}; + +struct bts_ctx { + struct perf_output_handle handle; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; long: 64; long: 64; long: 64; @@ -16796,481 +19337,1465 @@ struct bts_ctx { long: 64; }; -enum { - BTS_STATE_STOPPED = 0, - BTS_STATE_INACTIVE = 1, - BTS_STATE_ACTIVE = 2, -}; +enum { + BTS_STATE_STOPPED = 0, + BTS_STATE_INACTIVE = 1, + BTS_STATE_ACTIVE = 2, +}; + +struct bts_phys { + struct page *page; + long unsigned int size; + long unsigned int offset; + long unsigned int displacement; +}; + +struct bts_buffer { + size_t real_size; + unsigned int nr_pages; + unsigned int nr_bufs; + unsigned int cur_buf; + bool snapshot; + local_t data_size; + local_t head; + long unsigned int end; + void **data_pages; + struct bts_phys buf[0]; +}; + +struct pebs_basic { + u64 format_size; + u64 ip; + u64 applicable_counters; + u64 tsc; +}; + +struct pebs_meminfo { + u64 address; + u64 aux; + u64 latency; + u64 tsx_tuning; +}; + +struct pebs_gprs { + u64 flags; + u64 ip; + u64 ax; + u64 cx; + u64 dx; + u64 bx; + u64 sp; + u64 bp; + u64 si; + u64 di; + u64 r8; + u64 r9; + u64 r10; + u64 r11; + u64 r12; + u64 r13; + u64 r14; + u64 r15; +}; + +struct pebs_xmm { + u64 xmm[32]; +}; + +struct pebs_lbr_entry { + u64 from; + u64 to; + u64 info; +}; + +struct pebs_lbr { + struct pebs_lbr_entry lbr[0]; +}; + +struct x86_perf_regs { + struct pt_regs regs; + u64 *xmm_regs; +}; + +typedef unsigned int insn_attr_t; + +typedef unsigned char insn_byte_t; + +typedef int insn_value_t; + +struct insn_field { + union { + insn_value_t value; + insn_byte_t bytes[4]; + }; + unsigned char got; + unsigned char nbytes; +}; + +struct insn { + struct insn_field prefixes; + struct insn_field rex_prefix; + struct insn_field vex_prefix; + struct insn_field opcode; + struct insn_field modrm; + struct insn_field sib; + struct insn_field displacement; + union { + struct insn_field immediate; + struct insn_field moffset1; + struct insn_field immediate1; + }; + union { + struct insn_field moffset2; + struct insn_field immediate2; + }; + int emulate_prefix_size; + insn_attr_t attr; + unsigned char opnd_bytes; + unsigned char addr_bytes; + unsigned char length; + unsigned char x86_64; + const insn_byte_t *kaddr; + const insn_byte_t *end_kaddr; + const insn_byte_t *next_byte; +}; + +enum { + PERF_TXN_ELISION = 1, + PERF_TXN_TRANSACTION = 2, + PERF_TXN_SYNC = 4, + PERF_TXN_ASYNC = 8, + PERF_TXN_RETRY = 16, + PERF_TXN_CONFLICT = 32, + PERF_TXN_CAPACITY_WRITE = 64, + PERF_TXN_CAPACITY_READ = 128, + PERF_TXN_MAX = 256, + PERF_TXN_ABORT_MASK = 0, + PERF_TXN_ABORT_SHIFT = 32, +}; + +struct perf_event_header { + __u32 type; + __u16 misc; + __u16 size; +}; + +union intel_x86_pebs_dse { + u64 val; + struct { + unsigned int ld_dse: 4; + unsigned int ld_stlb_miss: 1; + unsigned int ld_locked: 1; + unsigned int ld_reserved: 26; + }; + struct { + unsigned int st_l1d_hit: 1; + unsigned int st_reserved1: 3; + unsigned int st_stlb_miss: 1; + unsigned int st_locked: 1; + unsigned int st_reserved2: 26; + }; +}; + +struct pebs_record_core { + u64 flags; + u64 ip; + u64 ax; + u64 bx; + u64 cx; + u64 dx; + u64 si; + u64 di; + u64 bp; + u64 sp; + u64 r8; + u64 r9; + u64 r10; + u64 r11; + u64 r12; + u64 r13; + u64 r14; + u64 r15; +}; + +struct pebs_record_nhm { + u64 flags; + u64 ip; + u64 ax; + u64 bx; + u64 cx; + u64 dx; + u64 si; + u64 di; + u64 bp; + u64 sp; + u64 r8; + u64 r9; + u64 r10; + u64 r11; + u64 r12; + u64 r13; + u64 r14; + u64 r15; + u64 status; + u64 dla; + u64 dse; + u64 lat; +}; + +union hsw_tsx_tuning { + struct { + u32 cycles_last_block: 32; + u32 hle_abort: 1; + u32 rtm_abort: 1; + u32 instruction_abort: 1; + u32 non_instruction_abort: 1; + u32 retry: 1; + u32 data_conflict: 1; + u32 capacity_writes: 1; + u32 capacity_reads: 1; + }; + u64 value; +}; + +struct pebs_record_skl { + u64 flags; + u64 ip; + u64 ax; + u64 bx; + u64 cx; + u64 dx; + u64 si; + u64 di; + u64 bp; + u64 sp; + u64 r8; + u64 r9; + u64 r10; + u64 r11; + u64 r12; + u64 r13; + u64 r14; + u64 r15; + u64 status; + u64 dla; + u64 dse; + u64 lat; + u64 real_ip; + u64 tsx_tuning; + u64 tsc; +}; + +struct bts_record { + u64 from; + u64 to; + u64 flags; +}; + +enum { + PERF_BR_UNKNOWN = 0, + PERF_BR_COND = 1, + PERF_BR_UNCOND = 2, + PERF_BR_IND = 3, + PERF_BR_CALL = 4, + PERF_BR_IND_CALL = 5, + PERF_BR_RET = 6, + PERF_BR_SYSCALL = 7, + PERF_BR_SYSRET = 8, + PERF_BR_COND_CALL = 9, + PERF_BR_COND_RET = 10, + PERF_BR_MAX = 11, +}; + +enum { + LBR_FORMAT_32 = 0, + LBR_FORMAT_LIP = 1, + LBR_FORMAT_EIP = 2, + LBR_FORMAT_EIP_FLAGS = 3, + LBR_FORMAT_EIP_FLAGS2 = 4, + LBR_FORMAT_INFO = 5, + LBR_FORMAT_TIME = 6, + LBR_FORMAT_MAX_KNOWN = 6, +}; + +enum { + X86_BR_NONE = 0, + X86_BR_USER = 1, + X86_BR_KERNEL = 2, + X86_BR_CALL = 4, + X86_BR_RET = 8, + X86_BR_SYSCALL = 16, + X86_BR_SYSRET = 32, + X86_BR_INT = 64, + X86_BR_IRET = 128, + X86_BR_JCC = 256, + X86_BR_JMP = 512, + X86_BR_IRQ = 1024, + X86_BR_IND_CALL = 2048, + X86_BR_ABORT = 4096, + X86_BR_IN_TX = 8192, + X86_BR_NO_TX = 16384, + X86_BR_ZERO_CALL = 32768, + X86_BR_CALL_STACK = 65536, + X86_BR_IND_JMP = 131072, + X86_BR_TYPE_SAVE = 262144, +}; + +enum { + LBR_NONE = 0, + LBR_VALID = 1, +}; + +enum P4_EVENTS { + P4_EVENT_TC_DELIVER_MODE = 0, + P4_EVENT_BPU_FETCH_REQUEST = 1, + P4_EVENT_ITLB_REFERENCE = 2, + P4_EVENT_MEMORY_CANCEL = 3, + P4_EVENT_MEMORY_COMPLETE = 4, + P4_EVENT_LOAD_PORT_REPLAY = 5, + P4_EVENT_STORE_PORT_REPLAY = 6, + P4_EVENT_MOB_LOAD_REPLAY = 7, + P4_EVENT_PAGE_WALK_TYPE = 8, + P4_EVENT_BSQ_CACHE_REFERENCE = 9, + P4_EVENT_IOQ_ALLOCATION = 10, + P4_EVENT_IOQ_ACTIVE_ENTRIES = 11, + P4_EVENT_FSB_DATA_ACTIVITY = 12, + P4_EVENT_BSQ_ALLOCATION = 13, + P4_EVENT_BSQ_ACTIVE_ENTRIES = 14, + P4_EVENT_SSE_INPUT_ASSIST = 15, + P4_EVENT_PACKED_SP_UOP = 16, + P4_EVENT_PACKED_DP_UOP = 17, + P4_EVENT_SCALAR_SP_UOP = 18, + P4_EVENT_SCALAR_DP_UOP = 19, + P4_EVENT_64BIT_MMX_UOP = 20, + P4_EVENT_128BIT_MMX_UOP = 21, + P4_EVENT_X87_FP_UOP = 22, + P4_EVENT_TC_MISC = 23, + P4_EVENT_GLOBAL_POWER_EVENTS = 24, + P4_EVENT_TC_MS_XFER = 25, + P4_EVENT_UOP_QUEUE_WRITES = 26, + P4_EVENT_RETIRED_MISPRED_BRANCH_TYPE = 27, + P4_EVENT_RETIRED_BRANCH_TYPE = 28, + P4_EVENT_RESOURCE_STALL = 29, + P4_EVENT_WC_BUFFER = 30, + P4_EVENT_B2B_CYCLES = 31, + P4_EVENT_BNR = 32, + P4_EVENT_SNOOP = 33, + P4_EVENT_RESPONSE = 34, + P4_EVENT_FRONT_END_EVENT = 35, + P4_EVENT_EXECUTION_EVENT = 36, + P4_EVENT_REPLAY_EVENT = 37, + P4_EVENT_INSTR_RETIRED = 38, + P4_EVENT_UOPS_RETIRED = 39, + P4_EVENT_UOP_TYPE = 40, + P4_EVENT_BRANCH_RETIRED = 41, + P4_EVENT_MISPRED_BRANCH_RETIRED = 42, + P4_EVENT_X87_ASSIST = 43, + P4_EVENT_MACHINE_CLEAR = 44, + P4_EVENT_INSTR_COMPLETED = 45, +}; + +enum P4_EVENT_OPCODES { + P4_EVENT_TC_DELIVER_MODE_OPCODE = 257, + P4_EVENT_BPU_FETCH_REQUEST_OPCODE = 768, + P4_EVENT_ITLB_REFERENCE_OPCODE = 6147, + P4_EVENT_MEMORY_CANCEL_OPCODE = 517, + P4_EVENT_MEMORY_COMPLETE_OPCODE = 2050, + P4_EVENT_LOAD_PORT_REPLAY_OPCODE = 1026, + P4_EVENT_STORE_PORT_REPLAY_OPCODE = 1282, + P4_EVENT_MOB_LOAD_REPLAY_OPCODE = 770, + P4_EVENT_PAGE_WALK_TYPE_OPCODE = 260, + P4_EVENT_BSQ_CACHE_REFERENCE_OPCODE = 3079, + P4_EVENT_IOQ_ALLOCATION_OPCODE = 774, + P4_EVENT_IOQ_ACTIVE_ENTRIES_OPCODE = 6662, + P4_EVENT_FSB_DATA_ACTIVITY_OPCODE = 5894, + P4_EVENT_BSQ_ALLOCATION_OPCODE = 1287, + P4_EVENT_BSQ_ACTIVE_ENTRIES_OPCODE = 1543, + P4_EVENT_SSE_INPUT_ASSIST_OPCODE = 13313, + P4_EVENT_PACKED_SP_UOP_OPCODE = 2049, + P4_EVENT_PACKED_DP_UOP_OPCODE = 3073, + P4_EVENT_SCALAR_SP_UOP_OPCODE = 2561, + P4_EVENT_SCALAR_DP_UOP_OPCODE = 3585, + P4_EVENT_64BIT_MMX_UOP_OPCODE = 513, + P4_EVENT_128BIT_MMX_UOP_OPCODE = 6657, + P4_EVENT_X87_FP_UOP_OPCODE = 1025, + P4_EVENT_TC_MISC_OPCODE = 1537, + P4_EVENT_GLOBAL_POWER_EVENTS_OPCODE = 4870, + P4_EVENT_TC_MS_XFER_OPCODE = 1280, + P4_EVENT_UOP_QUEUE_WRITES_OPCODE = 2304, + P4_EVENT_RETIRED_MISPRED_BRANCH_TYPE_OPCODE = 1282, + P4_EVENT_RETIRED_BRANCH_TYPE_OPCODE = 1026, + P4_EVENT_RESOURCE_STALL_OPCODE = 257, + P4_EVENT_WC_BUFFER_OPCODE = 1285, + P4_EVENT_B2B_CYCLES_OPCODE = 5635, + P4_EVENT_BNR_OPCODE = 2051, + P4_EVENT_SNOOP_OPCODE = 1539, + P4_EVENT_RESPONSE_OPCODE = 1027, + P4_EVENT_FRONT_END_EVENT_OPCODE = 2053, + P4_EVENT_EXECUTION_EVENT_OPCODE = 3077, + P4_EVENT_REPLAY_EVENT_OPCODE = 2309, + P4_EVENT_INSTR_RETIRED_OPCODE = 516, + P4_EVENT_UOPS_RETIRED_OPCODE = 260, + P4_EVENT_UOP_TYPE_OPCODE = 514, + P4_EVENT_BRANCH_RETIRED_OPCODE = 1541, + P4_EVENT_MISPRED_BRANCH_RETIRED_OPCODE = 772, + P4_EVENT_X87_ASSIST_OPCODE = 773, + P4_EVENT_MACHINE_CLEAR_OPCODE = 517, + P4_EVENT_INSTR_COMPLETED_OPCODE = 1796, +}; + +enum P4_ESCR_EMASKS { + P4_EVENT_TC_DELIVER_MODE__DD = 512, + P4_EVENT_TC_DELIVER_MODE__DB = 1024, + P4_EVENT_TC_DELIVER_MODE__DI = 2048, + P4_EVENT_TC_DELIVER_MODE__BD = 4096, + P4_EVENT_TC_DELIVER_MODE__BB = 8192, + P4_EVENT_TC_DELIVER_MODE__BI = 16384, + P4_EVENT_TC_DELIVER_MODE__ID = 32768, + P4_EVENT_BPU_FETCH_REQUEST__TCMISS = 512, + P4_EVENT_ITLB_REFERENCE__HIT = 512, + P4_EVENT_ITLB_REFERENCE__MISS = 1024, + P4_EVENT_ITLB_REFERENCE__HIT_UK = 2048, + P4_EVENT_MEMORY_CANCEL__ST_RB_FULL = 2048, + P4_EVENT_MEMORY_CANCEL__64K_CONF = 4096, + P4_EVENT_MEMORY_COMPLETE__LSC = 512, + P4_EVENT_MEMORY_COMPLETE__SSC = 1024, + P4_EVENT_LOAD_PORT_REPLAY__SPLIT_LD = 1024, + P4_EVENT_STORE_PORT_REPLAY__SPLIT_ST = 1024, + P4_EVENT_MOB_LOAD_REPLAY__NO_STA = 1024, + P4_EVENT_MOB_LOAD_REPLAY__NO_STD = 4096, + P4_EVENT_MOB_LOAD_REPLAY__PARTIAL_DATA = 8192, + P4_EVENT_MOB_LOAD_REPLAY__UNALGN_ADDR = 16384, + P4_EVENT_PAGE_WALK_TYPE__DTMISS = 512, + P4_EVENT_PAGE_WALK_TYPE__ITMISS = 1024, + P4_EVENT_BSQ_CACHE_REFERENCE__RD_2ndL_HITS = 512, + P4_EVENT_BSQ_CACHE_REFERENCE__RD_2ndL_HITE = 1024, + P4_EVENT_BSQ_CACHE_REFERENCE__RD_2ndL_HITM = 2048, + P4_EVENT_BSQ_CACHE_REFERENCE__RD_3rdL_HITS = 4096, + P4_EVENT_BSQ_CACHE_REFERENCE__RD_3rdL_HITE = 8192, + P4_EVENT_BSQ_CACHE_REFERENCE__RD_3rdL_HITM = 16384, + P4_EVENT_BSQ_CACHE_REFERENCE__RD_2ndL_MISS = 131072, + P4_EVENT_BSQ_CACHE_REFERENCE__RD_3rdL_MISS = 262144, + P4_EVENT_BSQ_CACHE_REFERENCE__WR_2ndL_MISS = 524288, + P4_EVENT_IOQ_ALLOCATION__DEFAULT = 512, + P4_EVENT_IOQ_ALLOCATION__ALL_READ = 16384, + P4_EVENT_IOQ_ALLOCATION__ALL_WRITE = 32768, + P4_EVENT_IOQ_ALLOCATION__MEM_UC = 65536, + P4_EVENT_IOQ_ALLOCATION__MEM_WC = 131072, + P4_EVENT_IOQ_ALLOCATION__MEM_WT = 262144, + P4_EVENT_IOQ_ALLOCATION__MEM_WP = 524288, + P4_EVENT_IOQ_ALLOCATION__MEM_WB = 1048576, + P4_EVENT_IOQ_ALLOCATION__OWN = 4194304, + P4_EVENT_IOQ_ALLOCATION__OTHER = 8388608, + P4_EVENT_IOQ_ALLOCATION__PREFETCH = 16777216, + P4_EVENT_IOQ_ACTIVE_ENTRIES__DEFAULT = 512, + P4_EVENT_IOQ_ACTIVE_ENTRIES__ALL_READ = 16384, + P4_EVENT_IOQ_ACTIVE_ENTRIES__ALL_WRITE = 32768, + P4_EVENT_IOQ_ACTIVE_ENTRIES__MEM_UC = 65536, + P4_EVENT_IOQ_ACTIVE_ENTRIES__MEM_WC = 131072, + P4_EVENT_IOQ_ACTIVE_ENTRIES__MEM_WT = 262144, + P4_EVENT_IOQ_ACTIVE_ENTRIES__MEM_WP = 524288, + P4_EVENT_IOQ_ACTIVE_ENTRIES__MEM_WB = 1048576, + P4_EVENT_IOQ_ACTIVE_ENTRIES__OWN = 4194304, + P4_EVENT_IOQ_ACTIVE_ENTRIES__OTHER = 8388608, + P4_EVENT_IOQ_ACTIVE_ENTRIES__PREFETCH = 16777216, + P4_EVENT_FSB_DATA_ACTIVITY__DRDY_DRV = 512, + P4_EVENT_FSB_DATA_ACTIVITY__DRDY_OWN = 1024, + P4_EVENT_FSB_DATA_ACTIVITY__DRDY_OTHER = 2048, + P4_EVENT_FSB_DATA_ACTIVITY__DBSY_DRV = 4096, + P4_EVENT_FSB_DATA_ACTIVITY__DBSY_OWN = 8192, + P4_EVENT_FSB_DATA_ACTIVITY__DBSY_OTHER = 16384, + P4_EVENT_BSQ_ALLOCATION__REQ_TYPE0 = 512, + P4_EVENT_BSQ_ALLOCATION__REQ_TYPE1 = 1024, + P4_EVENT_BSQ_ALLOCATION__REQ_LEN0 = 2048, + P4_EVENT_BSQ_ALLOCATION__REQ_LEN1 = 4096, + P4_EVENT_BSQ_ALLOCATION__REQ_IO_TYPE = 16384, + P4_EVENT_BSQ_ALLOCATION__REQ_LOCK_TYPE = 32768, + P4_EVENT_BSQ_ALLOCATION__REQ_CACHE_TYPE = 65536, + P4_EVENT_BSQ_ALLOCATION__REQ_SPLIT_TYPE = 131072, + P4_EVENT_BSQ_ALLOCATION__REQ_DEM_TYPE = 262144, + P4_EVENT_BSQ_ALLOCATION__REQ_ORD_TYPE = 524288, + P4_EVENT_BSQ_ALLOCATION__MEM_TYPE0 = 1048576, + P4_EVENT_BSQ_ALLOCATION__MEM_TYPE1 = 2097152, + P4_EVENT_BSQ_ALLOCATION__MEM_TYPE2 = 4194304, + P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_TYPE0 = 512, + P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_TYPE1 = 1024, + P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_LEN0 = 2048, + P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_LEN1 = 4096, + P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_IO_TYPE = 16384, + P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_LOCK_TYPE = 32768, + P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_CACHE_TYPE = 65536, + P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_SPLIT_TYPE = 131072, + P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_DEM_TYPE = 262144, + P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_ORD_TYPE = 524288, + P4_EVENT_BSQ_ACTIVE_ENTRIES__MEM_TYPE0 = 1048576, + P4_EVENT_BSQ_ACTIVE_ENTRIES__MEM_TYPE1 = 2097152, + P4_EVENT_BSQ_ACTIVE_ENTRIES__MEM_TYPE2 = 4194304, + P4_EVENT_SSE_INPUT_ASSIST__ALL = 16777216, + P4_EVENT_PACKED_SP_UOP__ALL = 16777216, + P4_EVENT_PACKED_DP_UOP__ALL = 16777216, + P4_EVENT_SCALAR_SP_UOP__ALL = 16777216, + P4_EVENT_SCALAR_DP_UOP__ALL = 16777216, + P4_EVENT_64BIT_MMX_UOP__ALL = 16777216, + P4_EVENT_128BIT_MMX_UOP__ALL = 16777216, + P4_EVENT_X87_FP_UOP__ALL = 16777216, + P4_EVENT_TC_MISC__FLUSH = 8192, + P4_EVENT_GLOBAL_POWER_EVENTS__RUNNING = 512, + P4_EVENT_TC_MS_XFER__CISC = 512, + P4_EVENT_UOP_QUEUE_WRITES__FROM_TC_BUILD = 512, + P4_EVENT_UOP_QUEUE_WRITES__FROM_TC_DELIVER = 1024, + P4_EVENT_UOP_QUEUE_WRITES__FROM_ROM = 2048, + P4_EVENT_RETIRED_MISPRED_BRANCH_TYPE__CONDITIONAL = 1024, + P4_EVENT_RETIRED_MISPRED_BRANCH_TYPE__CALL = 2048, + P4_EVENT_RETIRED_MISPRED_BRANCH_TYPE__RETURN = 4096, + P4_EVENT_RETIRED_MISPRED_BRANCH_TYPE__INDIRECT = 8192, + P4_EVENT_RETIRED_BRANCH_TYPE__CONDITIONAL = 1024, + P4_EVENT_RETIRED_BRANCH_TYPE__CALL = 2048, + P4_EVENT_RETIRED_BRANCH_TYPE__RETURN = 4096, + P4_EVENT_RETIRED_BRANCH_TYPE__INDIRECT = 8192, + P4_EVENT_RESOURCE_STALL__SBFULL = 16384, + P4_EVENT_WC_BUFFER__WCB_EVICTS = 512, + P4_EVENT_WC_BUFFER__WCB_FULL_EVICTS = 1024, + P4_EVENT_FRONT_END_EVENT__NBOGUS = 512, + P4_EVENT_FRONT_END_EVENT__BOGUS = 1024, + P4_EVENT_EXECUTION_EVENT__NBOGUS0 = 512, + P4_EVENT_EXECUTION_EVENT__NBOGUS1 = 1024, + P4_EVENT_EXECUTION_EVENT__NBOGUS2 = 2048, + P4_EVENT_EXECUTION_EVENT__NBOGUS3 = 4096, + P4_EVENT_EXECUTION_EVENT__BOGUS0 = 8192, + P4_EVENT_EXECUTION_EVENT__BOGUS1 = 16384, + P4_EVENT_EXECUTION_EVENT__BOGUS2 = 32768, + P4_EVENT_EXECUTION_EVENT__BOGUS3 = 65536, + P4_EVENT_REPLAY_EVENT__NBOGUS = 512, + P4_EVENT_REPLAY_EVENT__BOGUS = 1024, + P4_EVENT_INSTR_RETIRED__NBOGUSNTAG = 512, + P4_EVENT_INSTR_RETIRED__NBOGUSTAG = 1024, + P4_EVENT_INSTR_RETIRED__BOGUSNTAG = 2048, + P4_EVENT_INSTR_RETIRED__BOGUSTAG = 4096, + P4_EVENT_UOPS_RETIRED__NBOGUS = 512, + P4_EVENT_UOPS_RETIRED__BOGUS = 1024, + P4_EVENT_UOP_TYPE__TAGLOADS = 1024, + P4_EVENT_UOP_TYPE__TAGSTORES = 2048, + P4_EVENT_BRANCH_RETIRED__MMNP = 512, + P4_EVENT_BRANCH_RETIRED__MMNM = 1024, + P4_EVENT_BRANCH_RETIRED__MMTP = 2048, + P4_EVENT_BRANCH_RETIRED__MMTM = 4096, + P4_EVENT_MISPRED_BRANCH_RETIRED__NBOGUS = 512, + P4_EVENT_X87_ASSIST__FPSU = 512, + P4_EVENT_X87_ASSIST__FPSO = 1024, + P4_EVENT_X87_ASSIST__POAO = 2048, + P4_EVENT_X87_ASSIST__POAU = 4096, + P4_EVENT_X87_ASSIST__PREA = 8192, + P4_EVENT_MACHINE_CLEAR__CLEAR = 512, + P4_EVENT_MACHINE_CLEAR__MOCLEAR = 1024, + P4_EVENT_MACHINE_CLEAR__SMCLEAR = 2048, + P4_EVENT_INSTR_COMPLETED__NBOGUS = 512, + P4_EVENT_INSTR_COMPLETED__BOGUS = 1024, +}; + +enum P4_PEBS_METRIC { + P4_PEBS_METRIC__none = 0, + P4_PEBS_METRIC__1stl_cache_load_miss_retired = 1, + P4_PEBS_METRIC__2ndl_cache_load_miss_retired = 2, + P4_PEBS_METRIC__dtlb_load_miss_retired = 3, + P4_PEBS_METRIC__dtlb_store_miss_retired = 4, + P4_PEBS_METRIC__dtlb_all_miss_retired = 5, + P4_PEBS_METRIC__tagged_mispred_branch = 6, + P4_PEBS_METRIC__mob_load_replay_retired = 7, + P4_PEBS_METRIC__split_load_retired = 8, + P4_PEBS_METRIC__split_store_retired = 9, + P4_PEBS_METRIC__max = 10, +}; + +struct p4_event_bind { + unsigned int opcode; + unsigned int escr_msr[2]; + unsigned int escr_emask; + unsigned int shared; + char cntr[6]; +}; + +struct p4_pebs_bind { + unsigned int metric_pebs; + unsigned int metric_vert; +}; + +struct p4_event_alias { + u64 original; + u64 alternative; +}; + +enum cpuid_regs_idx { + CPUID_EAX = 0, + CPUID_EBX = 1, + CPUID_ECX = 2, + CPUID_EDX = 3, +}; + +struct dev_ext_attribute { + struct device_attribute attr; + void *var; +}; + +enum pt_capabilities { + PT_CAP_max_subleaf = 0, + PT_CAP_cr3_filtering = 1, + PT_CAP_psb_cyc = 2, + PT_CAP_ip_filtering = 3, + PT_CAP_mtc = 4, + PT_CAP_ptwrite = 5, + PT_CAP_power_event_trace = 6, + PT_CAP_topa_output = 7, + PT_CAP_topa_multiple_entries = 8, + PT_CAP_single_range_output = 9, + PT_CAP_output_subsys = 10, + PT_CAP_payloads_lip = 11, + PT_CAP_num_address_ranges = 12, + PT_CAP_mtc_periods = 13, + PT_CAP_cycle_thresholds = 14, + PT_CAP_psb_periods = 15, +}; + +enum perf_addr_filter_action_t { + PERF_ADDR_FILTER_ACTION_STOP = 0, + PERF_ADDR_FILTER_ACTION_START = 1, + PERF_ADDR_FILTER_ACTION_FILTER = 2, +}; + +struct perf_addr_filter { + struct list_head entry; + struct path path; + long unsigned int offset; + long unsigned int size; + enum perf_addr_filter_action_t action; +}; + +struct topa_entry { + u64 end: 1; + u64 rsvd0: 1; + u64 intr: 1; + u64 rsvd1: 1; + u64 stop: 1; + u64 rsvd2: 1; + u64 size: 4; + u64 rsvd3: 2; + u64 base: 36; + u64 rsvd4: 16; +}; + +struct pt_pmu { + struct pmu pmu; + u32 caps[8]; + bool vmx; + bool branch_en_always_on; + long unsigned int max_nonturbo_ratio; + unsigned int tsc_art_num; + unsigned int tsc_art_den; +}; + +struct topa; + +struct pt_buffer { + struct list_head tables; + struct topa *first; + struct topa *last; + struct topa *cur; + unsigned int cur_idx; + size_t output_off; + long unsigned int nr_pages; + local_t data_size; + local64_t head; + bool snapshot; + bool single; + long int stop_pos; + long int intr_pos; + struct topa_entry *stop_te; + struct topa_entry *intr_te; + void **data_pages; +}; + +struct topa { + struct list_head list; + u64 offset; + size_t size; + int last; + unsigned int z_count; +}; + +struct pt_filter { + long unsigned int msr_a; + long unsigned int msr_b; + long unsigned int config; +}; + +struct pt_filters { + struct pt_filter filter[4]; + unsigned int nr_filters; +}; + +struct pt { + struct perf_output_handle handle; + struct pt_filters filters; + int handle_nmi; + int vmx_on; + u64 output_base; + u64 output_mask; +}; + +struct pt_cap_desc { + const char *name; + u32 leaf; + u8 reg; + u32 mask; +}; + +struct pt_address_range { + long unsigned int msr_a; + long unsigned int msr_b; + unsigned int reg_off; +}; + +struct topa_page { + struct topa_entry table[507]; + struct topa topa; +}; + +typedef void (*exitcall_t)(); + +enum hrtimer_mode { + HRTIMER_MODE_ABS = 0, + HRTIMER_MODE_REL = 1, + HRTIMER_MODE_PINNED = 2, + HRTIMER_MODE_SOFT = 4, + HRTIMER_MODE_HARD = 8, + HRTIMER_MODE_ABS_PINNED = 2, + HRTIMER_MODE_REL_PINNED = 3, + HRTIMER_MODE_ABS_SOFT = 4, + HRTIMER_MODE_REL_SOFT = 5, + HRTIMER_MODE_ABS_PINNED_SOFT = 6, + HRTIMER_MODE_REL_PINNED_SOFT = 7, + HRTIMER_MODE_ABS_HARD = 8, + HRTIMER_MODE_REL_HARD = 9, + HRTIMER_MODE_ABS_PINNED_HARD = 10, + HRTIMER_MODE_REL_PINNED_HARD = 11, +}; + +struct x86_cpu_id { + __u16 vendor; + __u16 family; + __u16 model; + __u16 feature; + kernel_ulong_t driver_data; +}; + +enum perf_rapl_events { + PERF_RAPL_PP0 = 0, + PERF_RAPL_PKG = 1, + PERF_RAPL_RAM = 2, + PERF_RAPL_PP1 = 3, + PERF_RAPL_PSYS = 4, + PERF_RAPL_MAX = 5, + NR_RAPL_DOMAINS = 5, +}; + +struct rapl_pmu { + raw_spinlock_t lock; + int n_active; + int cpu; + struct list_head active_list; + struct pmu *pmu; + ktime_t timer_interval; + struct hrtimer hrtimer; +}; + +struct rapl_pmus { + struct pmu pmu; + unsigned int maxdie; + struct rapl_pmu *pmus[0]; +}; + +struct rapl_model { + long unsigned int events; + bool apply_quirk; +}; + +struct acpi_device; + +struct pci_sysdata { + int domain; + int node; + struct acpi_device *companion; + void *iommu; + void *fwnode; +}; + +struct pci_extra_dev { + struct pci_dev *dev[4]; +}; + +struct intel_uncore_pmu; + +struct intel_uncore_ops; + +struct uncore_event_desc; + +struct freerunning_counters; + +struct intel_uncore_type { + const char *name; + int num_counters; + int num_boxes; + int perf_ctr_bits; + int fixed_ctr_bits; + int num_freerunning_types; + unsigned int perf_ctr; + unsigned int event_ctl; + unsigned int event_mask; + unsigned int event_mask_ext; + unsigned int fixed_ctr; + unsigned int fixed_ctl; + unsigned int box_ctl; + union { + unsigned int msr_offset; + unsigned int mmio_offset; + }; + unsigned int num_shared_regs: 8; + unsigned int single_fixed: 1; + unsigned int pair_ctr_ctl: 1; + unsigned int *msr_offsets; + struct event_constraint unconstrainted; + struct event_constraint *constraints; + struct intel_uncore_pmu *pmus; + struct intel_uncore_ops *ops; + struct uncore_event_desc *event_descs; + struct freerunning_counters *freerunning; + const struct attribute_group *attr_groups[4]; + struct pmu *pmu; +}; + +struct intel_uncore_box; + +struct intel_uncore_pmu { + struct pmu pmu; + char name[32]; + int pmu_idx; + int func_id; + bool registered; + atomic_t activeboxes; + struct intel_uncore_type *type; + struct intel_uncore_box **boxes; +}; + +struct intel_uncore_ops { + void (*init_box)(struct intel_uncore_box *); + void (*exit_box)(struct intel_uncore_box *); + void (*disable_box)(struct intel_uncore_box *); + void (*enable_box)(struct intel_uncore_box *); + void (*disable_event)(struct intel_uncore_box *, struct perf_event *); + void (*enable_event)(struct intel_uncore_box *, struct perf_event *); + u64 (*read_counter)(struct intel_uncore_box *, struct perf_event *); + int (*hw_config)(struct intel_uncore_box *, struct perf_event *); + struct event_constraint * (*get_constraint)(struct intel_uncore_box *, struct perf_event *); + void (*put_constraint)(struct intel_uncore_box *, struct perf_event *); +}; + +struct uncore_event_desc { + struct kobj_attribute attr; + const char *config; +}; + +struct freerunning_counters { + unsigned int counter_base; + unsigned int counter_offset; + unsigned int box_offset; + unsigned int num_counters; + unsigned int bits; +}; + +struct intel_uncore_extra_reg { + raw_spinlock_t lock; + u64 config; + u64 config1; + u64 config2; + atomic_t ref; +}; + +struct intel_uncore_box { + int pci_phys_id; + int dieid; + int n_active; + int n_events; + int cpu; + long unsigned int flags; + atomic_t refcnt; + struct perf_event *events[10]; + struct perf_event *event_list[10]; + struct event_constraint *event_constraint[10]; + long unsigned int active_mask[1]; + u64 tags[10]; + struct pci_dev *pci_dev; + struct intel_uncore_pmu *pmu; + u64 hrtimer_duration; + struct hrtimer hrtimer; + struct list_head list; + struct list_head active_list; + void *io_addr; + struct intel_uncore_extra_reg shared_regs[0]; +}; + +struct pci2phy_map { + struct list_head list; + int segment; + int pbus_to_physid[256]; +}; + +struct intel_uncore_init_fun { + void (*cpu_init)(); + int (*pci_init)(); + void (*mmio_init)(); +}; + +enum { + EXTRA_REG_NHMEX_M_FILTER = 0, + EXTRA_REG_NHMEX_M_DSP = 1, + EXTRA_REG_NHMEX_M_ISS = 2, + EXTRA_REG_NHMEX_M_MAP = 3, + EXTRA_REG_NHMEX_M_MSC_THR = 4, + EXTRA_REG_NHMEX_M_PGT = 5, + EXTRA_REG_NHMEX_M_PLD = 6, + EXTRA_REG_NHMEX_M_ZDP_CTL_FVC = 7, +}; + +enum { + SNB_PCI_UNCORE_IMC = 0, +}; + +enum perf_snb_uncore_imc_freerunning_types { + SNB_PCI_UNCORE_IMC_DATA = 0, + SNB_PCI_UNCORE_IMC_FREERUNNING_TYPE_MAX = 1, +}; + +struct imc_uncore_pci_dev { + __u32 pci_id; + struct pci_driver *driver; +}; + +enum { + SNBEP_PCI_QPI_PORT0_FILTER = 0, + SNBEP_PCI_QPI_PORT1_FILTER = 1, + BDX_PCI_QPI_PORT2_FILTER = 2, + HSWEP_PCI_PCU_3 = 3, +}; + +enum { + SNBEP_PCI_UNCORE_HA = 0, + SNBEP_PCI_UNCORE_IMC = 1, + SNBEP_PCI_UNCORE_QPI = 2, + SNBEP_PCI_UNCORE_R2PCIE = 3, + SNBEP_PCI_UNCORE_R3QPI = 4, +}; + +enum { + IVBEP_PCI_UNCORE_HA = 0, + IVBEP_PCI_UNCORE_IMC = 1, + IVBEP_PCI_UNCORE_IRP = 2, + IVBEP_PCI_UNCORE_QPI = 3, + IVBEP_PCI_UNCORE_R2PCIE = 4, + IVBEP_PCI_UNCORE_R3QPI = 5, +}; + +enum { + KNL_PCI_UNCORE_MC_UCLK = 0, + KNL_PCI_UNCORE_MC_DCLK = 1, + KNL_PCI_UNCORE_EDC_UCLK = 2, + KNL_PCI_UNCORE_EDC_ECLK = 3, + KNL_PCI_UNCORE_M2PCIE = 4, + KNL_PCI_UNCORE_IRP = 5, +}; + +enum { + HSWEP_PCI_UNCORE_HA = 0, + HSWEP_PCI_UNCORE_IMC = 1, + HSWEP_PCI_UNCORE_IRP = 2, + HSWEP_PCI_UNCORE_QPI = 3, + HSWEP_PCI_UNCORE_R2PCIE = 4, + HSWEP_PCI_UNCORE_R3QPI = 5, +}; + +enum { + BDX_PCI_UNCORE_HA = 0, + BDX_PCI_UNCORE_IMC = 1, + BDX_PCI_UNCORE_IRP = 2, + BDX_PCI_UNCORE_QPI = 3, + BDX_PCI_UNCORE_R2PCIE = 4, + BDX_PCI_UNCORE_R3QPI = 5, +}; + +enum perf_uncore_iio_freerunning_type_id { + SKX_IIO_MSR_IOCLK = 0, + SKX_IIO_MSR_BW = 1, + SKX_IIO_MSR_UTIL = 2, + SKX_IIO_FREERUNNING_TYPE_MAX = 3, +}; + +enum { + SKX_PCI_UNCORE_IMC = 0, + SKX_PCI_UNCORE_M2M = 1, + SKX_PCI_UNCORE_UPI = 2, + SKX_PCI_UNCORE_M2PCIE = 3, + SKX_PCI_UNCORE_M3UPI = 4, +}; + +enum perf_uncore_snr_iio_freerunning_type_id { + SNR_IIO_MSR_IOCLK = 0, + SNR_IIO_MSR_BW_IN = 1, + SNR_IIO_FREERUNNING_TYPE_MAX = 2, +}; + +enum { + SNR_PCI_UNCORE_M2M = 0, +}; + +enum perf_uncore_snr_imc_freerunning_type_id { + SNR_IMC_DCLK = 0, + SNR_IMC_DDR = 1, + SNR_IMC_FREERUNNING_TYPE_MAX = 2, +}; + +struct cstate_model { + long unsigned int core_events; + long unsigned int pkg_events; + long unsigned int quirks; +}; + +enum perf_cstate_core_events { + PERF_CSTATE_CORE_C1_RES = 0, + PERF_CSTATE_CORE_C3_RES = 1, + PERF_CSTATE_CORE_C6_RES = 2, + PERF_CSTATE_CORE_C7_RES = 3, + PERF_CSTATE_CORE_EVENT_MAX = 4, +}; + +enum perf_cstate_pkg_events { + PERF_CSTATE_PKG_C2_RES = 0, + PERF_CSTATE_PKG_C3_RES = 1, + PERF_CSTATE_PKG_C6_RES = 2, + PERF_CSTATE_PKG_C7_RES = 3, + PERF_CSTATE_PKG_C8_RES = 4, + PERF_CSTATE_PKG_C9_RES = 5, + PERF_CSTATE_PKG_C10_RES = 6, + PERF_CSTATE_PKG_EVENT_MAX = 7, +}; + +struct trampoline_header { + u64 start; + u64 efer; + u32 cr4; + u32 flags; +}; + +enum xfeature { + XFEATURE_FP = 0, + XFEATURE_SSE = 1, + XFEATURE_YMM = 2, + XFEATURE_BNDREGS = 3, + XFEATURE_BNDCSR = 4, + XFEATURE_OPMASK = 5, + XFEATURE_ZMM_Hi256 = 6, + XFEATURE_Hi16_ZMM = 7, + XFEATURE_PT_UNIMPLEMENTED_SO_FAR = 8, + XFEATURE_PKRU = 9, + XFEATURE_MAX = 10, +}; + +struct pkru_state { + u32 pkru; + u32 pad; +}; + +enum show_regs_mode { + SHOW_REGS_SHORT = 0, + SHOW_REGS_USER = 1, + SHOW_REGS_ALL = 2, +}; + +struct shared_info; + +struct start_info; + +enum which_selector { + FS = 0, + GS = 1, +}; + +typedef struct task_struct *pto_T_____3; + +typedef u64 pto_T_____4; + +struct sigcontext_64 { + __u64 r8; + __u64 r9; + __u64 r10; + __u64 r11; + __u64 r12; + __u64 r13; + __u64 r14; + __u64 r15; + __u64 di; + __u64 si; + __u64 bp; + __u64 bx; + __u64 dx; + __u64 ax; + __u64 cx; + __u64 sp; + __u64 ip; + __u64 flags; + __u16 cs; + __u16 gs; + __u16 fs; + __u16 ss; + __u64 err; + __u64 trapno; + __u64 oldmask; + __u64 cr2; + __u64 fpstate; + __u64 reserved1[8]; +}; + +struct sigaltstack { + void *ss_sp; + int ss_flags; + size_t ss_size; +}; + +typedef struct sigaltstack stack_t; + +struct siginfo { + union { + struct { + int si_signo; + int si_errno; + int si_code; + union __sifields _sifields; + }; + int _si_pad[32]; + }; +}; + +struct ucontext { + long unsigned int uc_flags; + struct ucontext *uc_link; + stack_t uc_stack; + struct sigcontext_64 uc_mcontext; + sigset_t uc_sigmask; +}; + +typedef u32 compat_sigset_word; + +typedef struct { + compat_sigset_word sig[2]; +} compat_sigset_t; + +struct mce { + __u64 status; + __u64 misc; + __u64 addr; + __u64 mcgstatus; + __u64 ip; + __u64 tsc; + __u64 time; + __u8 cpuvendor; + __u8 inject_flags; + __u8 severity; + __u8 pad; + __u32 cpuid; + __u8 cs; + __u8 bank; + __u8 cpu; + __u8 finished; + __u32 extcpu; + __u32 socketid; + __u32 apicid; + __u64 mcgcap; + __u64 synd; + __u64 ipid; + __u64 ppin; + __u32 microcode; +}; + +typedef long unsigned int mce_banks_t[1]; -struct bts_phys { - struct page *page; - long unsigned int size; - long unsigned int offset; - long unsigned int displacement; +struct smca_hwid { + unsigned int bank_type; + u32 hwid_mcatype; + u32 xec_bitmap; + u8 count; }; -struct bts_buffer { - size_t real_size; - unsigned int nr_pages; - unsigned int nr_bufs; - unsigned int cur_buf; - bool snapshot; - local_t data_size; - local_t head; - long unsigned int end; - void **data_pages; - struct bts_phys buf[0]; +struct smca_bank { + struct smca_hwid *hwid; + u32 id; + u8 sysfs_id; }; -struct entry_stack { - long unsigned int words[64]; +struct kernel_vm86_regs { + struct pt_regs pt; + short unsigned int es; + short unsigned int __esh; + short unsigned int ds; + short unsigned int __dsh; + short unsigned int fs; + short unsigned int __fsh; + short unsigned int gs; + short unsigned int __gsh; }; -struct entry_stack_page { - struct entry_stack stack; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct rt_sigframe { + char *pretcode; + struct ucontext uc; + struct siginfo info; +}; + +typedef struct siginfo siginfo_t; + +typedef s32 compat_clock_t; + +typedef s32 compat_pid_t; + +typedef s32 compat_timer_t; + +typedef s32 compat_int_t; + +typedef u32 __compat_uid32_t; + +union compat_sigval { + compat_int_t sival_int; + compat_uptr_t sival_ptr; +}; + +typedef union compat_sigval compat_sigval_t; + +struct compat_siginfo { + int si_signo; + int si_errno; + int si_code; + union { + int _pad[29]; + struct { + compat_pid_t _pid; + __compat_uid32_t _uid; + } _kill; + struct { + compat_timer_t _tid; + int _overrun; + compat_sigval_t _sigval; + } _timer; + struct { + compat_pid_t _pid; + __compat_uid32_t _uid; + compat_sigval_t _sigval; + } _rt; + struct { + compat_pid_t _pid; + __compat_uid32_t _uid; + int _status; + compat_clock_t _utime; + compat_clock_t _stime; + } _sigchld; + struct { + compat_uptr_t _addr; + union { + short int _addr_lsb; + struct { + char _dummy_bnd[4]; + compat_uptr_t _lower; + compat_uptr_t _upper; + } _addr_bnd; + struct { + char _dummy_pkey[4]; + u32 _pkey; + } _addr_pkey; + }; + } _sigfault; + struct { + compat_long_t _band; + int _fd; + } _sigpoll; + struct { + compat_uptr_t _call_addr; + int _syscall; + unsigned int _arch; + } _sigsys; + } _sifields; +}; + +typedef struct compat_siginfo compat_siginfo_t; + +enum bug_trap_type { + BUG_TRAP_TYPE_NONE = 0, + BUG_TRAP_TYPE_WARN = 1, + BUG_TRAP_TYPE_BUG = 2, +}; + +struct mpx_bndcsr { + u64 bndcfgu; + u64 bndstatus; +}; + +enum die_val { + DIE_OOPS = 1, + DIE_INT3 = 2, + DIE_DEBUG = 3, + DIE_PANIC = 4, + DIE_NMI = 5, + DIE_DIE = 6, + DIE_KERNELDEBUG = 7, + DIE_TRAP = 8, + DIE_GPF = 9, + DIE_CALL = 10, + DIE_PAGE_FAULT = 11, + DIE_NMIUNKNOWN = 12, +}; + +struct mpx_fault_info { + void *addr; + void *lower; + void *upper; +}; + +struct bad_iret_stack { + void *error_entry_ret; + struct pt_regs regs; +}; + +enum { + GATE_INTERRUPT = 14, + GATE_TRAP = 15, + GATE_CALL = 12, + GATE_TASK = 5, +}; + +struct irq_desc; + +typedef struct irq_desc *vector_irq_t[256]; + +struct idt_data { + unsigned int vector; + unsigned int segment; + struct idt_bits bits; + const void *addr; +}; + +enum irqreturn { + IRQ_NONE = 0, + IRQ_HANDLED = 1, + IRQ_WAKE_THREAD = 2, +}; + +typedef enum irqreturn irqreturn_t; + +typedef irqreturn_t (*irq_handler_t)(int, void *); + +struct irqaction { + irq_handler_t handler; + void *dev_id; + void *percpu_dev_id; + struct irqaction *next; + irq_handler_t thread_fn; + struct task_struct *thread; + struct irqaction *secondary; + unsigned int irq; + unsigned int flags; + long unsigned int thread_flags; + long unsigned int thread_mask; + const char *name; + struct proc_dir_entry *dir; long: 64; long: 64; long: 64; long: 64; +}; + +struct irq_affinity_notify { + unsigned int irq; + struct kref kref; + struct work_struct work; + void (*notify)(struct irq_affinity_notify *, const cpumask_t *); + void (*release)(struct kref *); +}; + +enum irqchip_irq_state { + IRQCHIP_STATE_PENDING = 0, + IRQCHIP_STATE_ACTIVE = 1, + IRQCHIP_STATE_MASKED = 2, + IRQCHIP_STATE_LINE_LEVEL = 3, +}; + +struct irq_desc___2; + +typedef void (*irq_flow_handler_t)(struct irq_desc___2 *); + +struct msi_desc; + +struct irq_common_data { + unsigned int state_use_accessors; + unsigned int node; + void *handler_data; + struct msi_desc *msi_desc; + cpumask_var_t affinity; + cpumask_var_t effective_affinity; +}; + +struct irq_chip; + +struct irq_data { + u32 mask; + unsigned int irq; + long unsigned int hwirq; + struct irq_common_data *common; + struct irq_chip *chip; + struct irq_domain *domain; + struct irq_data *parent_data; + void *chip_data; +}; + +struct irq_desc___2 { + struct irq_common_data irq_common_data; + struct irq_data irq_data; + unsigned int *kstat_irqs; + irq_flow_handler_t handle_irq; + struct irqaction *action; + unsigned int status_use_accessors; + unsigned int core_internal_state__do_not_mess_with_it; + unsigned int depth; + unsigned int wake_depth; + unsigned int tot_count; + unsigned int irq_count; + long unsigned int last_unhandled; + unsigned int irqs_unhandled; + atomic_t threads_handled; + int threads_handled_last; + raw_spinlock_t lock; + struct cpumask *percpu_enabled; + const struct cpumask *percpu_affinity; + const struct cpumask *affinity_hint; + struct irq_affinity_notify *affinity_notify; + cpumask_var_t pending_mask; + long unsigned int threads_oneshot; + atomic_t threads_active; + wait_queue_head_t wait_for_threads; + unsigned int nr_actions; + unsigned int no_suspend_depth; + unsigned int cond_suspend_depth; + unsigned int force_resume_depth; + struct proc_dir_entry *dir; + struct callback_head rcu; + struct kobject kobj; + struct mutex request_mutex; + int parent_irq; + struct module *owner; + const char *name; long: 64; long: 64; long: 64; @@ -17278,8461 +20803,9052 @@ struct entry_stack_page { long: 64; }; -struct debug_store_buffers { - char bts_buffer[65536]; - char pebs_buffer[65536]; +struct msi_msg; + +struct irq_chip { + struct device *parent_device; + const char *name; + unsigned int (*irq_startup)(struct irq_data *); + void (*irq_shutdown)(struct irq_data *); + void (*irq_enable)(struct irq_data *); + void (*irq_disable)(struct irq_data *); + void (*irq_ack)(struct irq_data *); + void (*irq_mask)(struct irq_data *); + void (*irq_mask_ack)(struct irq_data *); + void (*irq_unmask)(struct irq_data *); + void (*irq_eoi)(struct irq_data *); + int (*irq_set_affinity)(struct irq_data *, const struct cpumask *, bool); + int (*irq_retrigger)(struct irq_data *); + int (*irq_set_type)(struct irq_data *, unsigned int); + int (*irq_set_wake)(struct irq_data *, unsigned int); + void (*irq_bus_lock)(struct irq_data *); + void (*irq_bus_sync_unlock)(struct irq_data *); + void (*irq_cpu_online)(struct irq_data *); + void (*irq_cpu_offline)(struct irq_data *); + void (*irq_suspend)(struct irq_data *); + void (*irq_resume)(struct irq_data *); + void (*irq_pm_shutdown)(struct irq_data *); + void (*irq_calc_mask)(struct irq_data *); + void (*irq_print_chip)(struct irq_data *, struct seq_file *); + int (*irq_request_resources)(struct irq_data *); + void (*irq_release_resources)(struct irq_data *); + void (*irq_compose_msi_msg)(struct irq_data *, struct msi_msg *); + void (*irq_write_msi_msg)(struct irq_data *, struct msi_msg *); + int (*irq_get_irqchip_state)(struct irq_data *, enum irqchip_irq_state, bool *); + int (*irq_set_irqchip_state)(struct irq_data *, enum irqchip_irq_state, bool); + int (*irq_set_vcpu_affinity)(struct irq_data *, void *); + void (*ipi_send_single)(struct irq_data *, unsigned int); + void (*ipi_send_mask)(struct irq_data *, const struct cpumask *); + int (*irq_nmi_setup)(struct irq_data *); + void (*irq_nmi_teardown)(struct irq_data *); + long unsigned int flags; }; -struct cea_exception_stacks { - char DF_stack_guard[4096]; - char DF_stack[4096]; - char NMI_stack_guard[4096]; - char NMI_stack[4096]; - char DB2_stack_guard[4096]; - char DB2_stack[4096]; - char DB1_stack_guard[4096]; - char DB1_stack[4096]; - char DB_stack_guard[4096]; - char DB_stack[4096]; - char MCE_stack_guard[4096]; - char MCE_stack[4096]; - char IST_top_guard[4096]; +typedef struct irq_desc___2 *vector_irq_t___2[256]; + +struct trace_event_raw_x86_irq_vector { + struct trace_entry ent; + int vector; + char __data[0]; }; -struct cpu_entry_area { - char gdt[4096]; - struct entry_stack_page entry_stack_page; - struct tss_struct tss; - struct cea_exception_stacks estacks; - struct debug_store cpu_debug_store; - struct debug_store_buffers cpu_debug_buffers; +struct trace_event_raw_vector_config { + struct trace_entry ent; + unsigned int irq; + unsigned int vector; + unsigned int cpu; + unsigned int apicdest; + char __data[0]; }; -struct pebs_basic { - u64 format_size; - u64 ip; - u64 applicable_counters; - u64 tsc; +struct trace_event_raw_vector_mod { + struct trace_entry ent; + unsigned int irq; + unsigned int vector; + unsigned int cpu; + unsigned int prev_vector; + unsigned int prev_cpu; + char __data[0]; }; -struct pebs_meminfo { - u64 address; - u64 aux; - u64 latency; - u64 tsx_tuning; +struct trace_event_raw_vector_reserve { + struct trace_entry ent; + unsigned int irq; + int ret; + char __data[0]; }; -struct pebs_gprs { - u64 flags; - u64 ip; - u64 ax; - u64 cx; - u64 dx; - u64 bx; - u64 sp; - u64 bp; - u64 si; - u64 di; - u64 r8; - u64 r9; - u64 r10; - u64 r11; - u64 r12; - u64 r13; - u64 r14; - u64 r15; +struct trace_event_raw_vector_alloc { + struct trace_entry ent; + unsigned int irq; + unsigned int vector; + bool reserved; + int ret; + char __data[0]; }; -struct pebs_xmm { - u64 xmm[32]; +struct trace_event_raw_vector_alloc_managed { + struct trace_entry ent; + unsigned int irq; + unsigned int vector; + int ret; + char __data[0]; }; -struct pebs_lbr_entry { - u64 from; - u64 to; - u64 info; +struct trace_event_raw_vector_activate { + struct trace_entry ent; + unsigned int irq; + bool is_managed; + bool can_reserve; + bool reserve; + char __data[0]; }; -struct pebs_lbr { - struct pebs_lbr_entry lbr[0]; +struct trace_event_raw_vector_teardown { + struct trace_entry ent; + unsigned int irq; + bool is_managed; + bool has_reserved; + char __data[0]; }; -struct x86_perf_regs { - struct pt_regs regs; - u64 *xmm_regs; +struct trace_event_raw_vector_setup { + struct trace_entry ent; + unsigned int irq; + bool is_legacy; + int ret; + char __data[0]; }; -typedef unsigned int insn_attr_t; +struct trace_event_raw_vector_free_moved { + struct trace_entry ent; + unsigned int irq; + unsigned int cpu; + unsigned int vector; + bool is_managed; + char __data[0]; +}; -typedef unsigned char insn_byte_t; +struct trace_event_data_offsets_x86_irq_vector {}; -typedef int insn_value_t; +struct trace_event_data_offsets_vector_config {}; -struct insn_field { - union { - insn_value_t value; - insn_byte_t bytes[4]; - }; - unsigned char got; - unsigned char nbytes; -}; +struct trace_event_data_offsets_vector_mod {}; -struct insn { - struct insn_field prefixes; - struct insn_field rex_prefix; - struct insn_field vex_prefix; - struct insn_field opcode; - struct insn_field modrm; - struct insn_field sib; - struct insn_field displacement; - union { - struct insn_field immediate; - struct insn_field moffset1; - struct insn_field immediate1; - }; - union { - struct insn_field moffset2; - struct insn_field immediate2; - }; - int emulate_prefix_size; - insn_attr_t attr; - unsigned char opnd_bytes; - unsigned char addr_bytes; - unsigned char length; - unsigned char x86_64; - const insn_byte_t *kaddr; - const insn_byte_t *end_kaddr; - const insn_byte_t *next_byte; -}; +struct trace_event_data_offsets_vector_reserve {}; -enum { - PERF_TXN_ELISION = 1, - PERF_TXN_TRANSACTION = 2, - PERF_TXN_SYNC = 4, - PERF_TXN_ASYNC = 8, - PERF_TXN_RETRY = 16, - PERF_TXN_CONFLICT = 32, - PERF_TXN_CAPACITY_WRITE = 64, - PERF_TXN_CAPACITY_READ = 128, - PERF_TXN_MAX = 256, - PERF_TXN_ABORT_MASK = 0, - PERF_TXN_ABORT_SHIFT = 32, -}; +struct trace_event_data_offsets_vector_alloc {}; -struct perf_event_header { - __u32 type; - __u16 misc; - __u16 size; -}; +struct trace_event_data_offsets_vector_alloc_managed {}; -union intel_x86_pebs_dse { - u64 val; - struct { - unsigned int ld_dse: 4; - unsigned int ld_stlb_miss: 1; - unsigned int ld_locked: 1; - unsigned int ld_reserved: 26; - }; - struct { - unsigned int st_l1d_hit: 1; - unsigned int st_reserved1: 3; - unsigned int st_stlb_miss: 1; - unsigned int st_locked: 1; - unsigned int st_reserved2: 26; - }; +struct trace_event_data_offsets_vector_activate {}; + +struct trace_event_data_offsets_vector_teardown {}; + +struct trace_event_data_offsets_vector_setup {}; + +struct trace_event_data_offsets_vector_free_moved {}; + +typedef void (*btf_trace_local_timer_entry)(void *, int); + +typedef void (*btf_trace_local_timer_exit)(void *, int); + +typedef void (*btf_trace_spurious_apic_entry)(void *, int); + +typedef void (*btf_trace_spurious_apic_exit)(void *, int); + +typedef void (*btf_trace_error_apic_entry)(void *, int); + +typedef void (*btf_trace_error_apic_exit)(void *, int); + +typedef void (*btf_trace_x86_platform_ipi_entry)(void *, int); + +typedef void (*btf_trace_x86_platform_ipi_exit)(void *, int); + +typedef void (*btf_trace_irq_work_entry)(void *, int); + +typedef void (*btf_trace_irq_work_exit)(void *, int); + +typedef void (*btf_trace_reschedule_entry)(void *, int); + +typedef void (*btf_trace_reschedule_exit)(void *, int); + +typedef void (*btf_trace_call_function_entry)(void *, int); + +typedef void (*btf_trace_call_function_exit)(void *, int); + +typedef void (*btf_trace_call_function_single_entry)(void *, int); + +typedef void (*btf_trace_call_function_single_exit)(void *, int); + +typedef void (*btf_trace_threshold_apic_entry)(void *, int); + +typedef void (*btf_trace_threshold_apic_exit)(void *, int); + +typedef void (*btf_trace_deferred_error_apic_entry)(void *, int); + +typedef void (*btf_trace_deferred_error_apic_exit)(void *, int); + +typedef void (*btf_trace_thermal_apic_entry)(void *, int); + +typedef void (*btf_trace_thermal_apic_exit)(void *, int); + +typedef void (*btf_trace_vector_config)(void *, unsigned int, unsigned int, unsigned int, unsigned int); + +typedef void (*btf_trace_vector_update)(void *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); + +typedef void (*btf_trace_vector_clear)(void *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); + +typedef void (*btf_trace_vector_reserve_managed)(void *, unsigned int, int); + +typedef void (*btf_trace_vector_reserve)(void *, unsigned int, int); + +typedef void (*btf_trace_vector_alloc)(void *, unsigned int, unsigned int, bool, int); + +typedef void (*btf_trace_vector_alloc_managed)(void *, unsigned int, unsigned int, int); + +typedef void (*btf_trace_vector_activate)(void *, unsigned int, bool, bool, bool); + +typedef void (*btf_trace_vector_deactivate)(void *, unsigned int, bool, bool, bool); + +typedef void (*btf_trace_vector_teardown)(void *, unsigned int, bool, bool); + +typedef void (*btf_trace_vector_setup)(void *, unsigned int, bool, int); + +typedef void (*btf_trace_vector_free_moved)(void *, unsigned int, unsigned int, unsigned int, bool); + +typedef struct irq_desc___2 *pto_T_____5; + +typedef struct pt_regs *pto_T_____6; + +struct estack_pages { + u32 offs; + u16 size; + u16 type; }; -struct pebs_record_core { - u64 flags; - u64 ip; - u64 ax; - u64 bx; - u64 cx; - u64 dx; - u64 si; - u64 di; - u64 bp; - u64 sp; - u64 r8; - u64 r9; - u64 r10; - u64 r11; - u64 r12; - u64 r13; - u64 r14; - u64 r15; +struct arch_clocksource_data { + int vclock_mode; }; -struct pebs_record_nhm { - u64 flags; - u64 ip; - u64 ax; - u64 bx; - u64 cx; - u64 dx; - u64 si; - u64 di; - u64 bp; - u64 sp; - u64 r8; - u64 r9; - u64 r10; - u64 r11; - u64 r12; - u64 r13; - u64 r14; - u64 r15; - u64 status; - u64 dla; - u64 dse; - u64 lat; +struct clocksource { + u64 (*read)(struct clocksource *); + u64 mask; + u32 mult; + u32 shift; + u64 max_idle_ns; + u32 maxadj; + struct arch_clocksource_data archdata; + u64 max_cycles; + const char *name; + struct list_head list; + int rating; + int (*enable)(struct clocksource *); + void (*disable)(struct clocksource *); + long unsigned int flags; + void (*suspend)(struct clocksource *); + void (*resume)(struct clocksource *); + void (*mark_unstable)(struct clocksource *); + void (*tick_stable)(struct clocksource *); + struct list_head wd_list; + u64 cs_last; + u64 wd_last; + struct module *owner; }; -union hsw_tsx_tuning { - struct { - u32 cycles_last_block: 32; - u32 hle_abort: 1; - u32 rtm_abort: 1; - u32 instruction_abort: 1; - u32 non_instruction_abort: 1; - u32 retry: 1; - u32 data_conflict: 1; - u32 capacity_writes: 1; - u32 capacity_reads: 1; - }; - u64 value; +enum clock_event_state { + CLOCK_EVT_STATE_DETACHED = 0, + CLOCK_EVT_STATE_SHUTDOWN = 1, + CLOCK_EVT_STATE_PERIODIC = 2, + CLOCK_EVT_STATE_ONESHOT = 3, + CLOCK_EVT_STATE_ONESHOT_STOPPED = 4, }; -struct pebs_record_skl { - u64 flags; - u64 ip; - u64 ax; - u64 bx; - u64 cx; - u64 dx; - u64 si; - u64 di; - u64 bp; - u64 sp; - u64 r8; - u64 r9; - u64 r10; - u64 r11; - u64 r12; - u64 r13; - u64 r14; - u64 r15; - u64 status; - u64 dla; - u64 dse; - u64 lat; - u64 real_ip; - u64 tsx_tuning; - u64 tsc; +struct clock_event_device { + void (*event_handler)(struct clock_event_device *); + int (*set_next_event)(long unsigned int, struct clock_event_device *); + int (*set_next_ktime)(ktime_t, struct clock_event_device *); + ktime_t next_event; + u64 max_delta_ns; + u64 min_delta_ns; + u32 mult; + u32 shift; + enum clock_event_state state_use_accessors; + unsigned int features; + long unsigned int retries; + int (*set_state_periodic)(struct clock_event_device *); + int (*set_state_oneshot)(struct clock_event_device *); + int (*set_state_oneshot_stopped)(struct clock_event_device *); + int (*set_state_shutdown)(struct clock_event_device *); + int (*tick_resume)(struct clock_event_device *); + void (*broadcast)(const struct cpumask *); + void (*suspend)(struct clock_event_device *); + void (*resume)(struct clock_event_device *); + long unsigned int min_delta_ticks; + long unsigned int max_delta_ticks; + const char *name; + int rating; + int irq; + int bound_on; + const struct cpumask *cpumask; + struct list_head list; + struct module *owner; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct bts_record { - u64 from; - u64 to; - u64 flags; +struct irq_affinity_desc { + struct cpumask mask; + unsigned int is_managed: 1; }; -enum { - PERF_BR_UNKNOWN = 0, - PERF_BR_COND = 1, - PERF_BR_UNCOND = 2, - PERF_BR_IND = 3, - PERF_BR_CALL = 4, - PERF_BR_IND_CALL = 5, - PERF_BR_RET = 6, - PERF_BR_SYSCALL = 7, - PERF_BR_SYSRET = 8, - PERF_BR_COND_CALL = 9, - PERF_BR_COND_RET = 10, - PERF_BR_MAX = 11, +struct msi_msg { + u32 address_lo; + u32 address_hi; + u32 data; }; -enum { - LBR_FORMAT_32 = 0, - LBR_FORMAT_LIP = 1, - LBR_FORMAT_EIP = 2, - LBR_FORMAT_EIP_FLAGS = 3, - LBR_FORMAT_EIP_FLAGS2 = 4, - LBR_FORMAT_INFO = 5, - LBR_FORMAT_TIME = 6, - LBR_FORMAT_MAX_KNOWN = 6, +struct platform_msi_priv_data; + +struct platform_msi_desc { + struct platform_msi_priv_data *msi_priv_data; + u16 msi_index; }; -enum { - X86_BR_NONE = 0, - X86_BR_USER = 1, - X86_BR_KERNEL = 2, - X86_BR_CALL = 4, - X86_BR_RET = 8, - X86_BR_SYSCALL = 16, - X86_BR_SYSRET = 32, - X86_BR_INT = 64, - X86_BR_IRET = 128, - X86_BR_JCC = 256, - X86_BR_JMP = 512, - X86_BR_IRQ = 1024, - X86_BR_IND_CALL = 2048, - X86_BR_ABORT = 4096, - X86_BR_IN_TX = 8192, - X86_BR_NO_TX = 16384, - X86_BR_ZERO_CALL = 32768, - X86_BR_CALL_STACK = 65536, - X86_BR_IND_JMP = 131072, - X86_BR_TYPE_SAVE = 262144, +struct fsl_mc_msi_desc { + u16 msi_index; }; -enum { - LBR_NONE = 0, - LBR_VALID = 1, +struct ti_sci_inta_msi_desc { + u16 dev_index; }; -enum P4_EVENTS { - P4_EVENT_TC_DELIVER_MODE = 0, - P4_EVENT_BPU_FETCH_REQUEST = 1, - P4_EVENT_ITLB_REFERENCE = 2, - P4_EVENT_MEMORY_CANCEL = 3, - P4_EVENT_MEMORY_COMPLETE = 4, - P4_EVENT_LOAD_PORT_REPLAY = 5, - P4_EVENT_STORE_PORT_REPLAY = 6, - P4_EVENT_MOB_LOAD_REPLAY = 7, - P4_EVENT_PAGE_WALK_TYPE = 8, - P4_EVENT_BSQ_CACHE_REFERENCE = 9, - P4_EVENT_IOQ_ALLOCATION = 10, - P4_EVENT_IOQ_ACTIVE_ENTRIES = 11, - P4_EVENT_FSB_DATA_ACTIVITY = 12, - P4_EVENT_BSQ_ALLOCATION = 13, - P4_EVENT_BSQ_ACTIVE_ENTRIES = 14, - P4_EVENT_SSE_INPUT_ASSIST = 15, - P4_EVENT_PACKED_SP_UOP = 16, - P4_EVENT_PACKED_DP_UOP = 17, - P4_EVENT_SCALAR_SP_UOP = 18, - P4_EVENT_SCALAR_DP_UOP = 19, - P4_EVENT_64BIT_MMX_UOP = 20, - P4_EVENT_128BIT_MMX_UOP = 21, - P4_EVENT_X87_FP_UOP = 22, - P4_EVENT_TC_MISC = 23, - P4_EVENT_GLOBAL_POWER_EVENTS = 24, - P4_EVENT_TC_MS_XFER = 25, - P4_EVENT_UOP_QUEUE_WRITES = 26, - P4_EVENT_RETIRED_MISPRED_BRANCH_TYPE = 27, - P4_EVENT_RETIRED_BRANCH_TYPE = 28, - P4_EVENT_RESOURCE_STALL = 29, - P4_EVENT_WC_BUFFER = 30, - P4_EVENT_B2B_CYCLES = 31, - P4_EVENT_BNR = 32, - P4_EVENT_SNOOP = 33, - P4_EVENT_RESPONSE = 34, - P4_EVENT_FRONT_END_EVENT = 35, - P4_EVENT_EXECUTION_EVENT = 36, - P4_EVENT_REPLAY_EVENT = 37, - P4_EVENT_INSTR_RETIRED = 38, - P4_EVENT_UOPS_RETIRED = 39, - P4_EVENT_UOP_TYPE = 40, - P4_EVENT_BRANCH_RETIRED = 41, - P4_EVENT_MISPRED_BRANCH_RETIRED = 42, - P4_EVENT_X87_ASSIST = 43, - P4_EVENT_MACHINE_CLEAR = 44, - P4_EVENT_INSTR_COMPLETED = 45, +struct msi_desc { + struct list_head list; + unsigned int irq; + unsigned int nvec_used; + struct device *dev; + struct msi_msg msg; + struct irq_affinity_desc *affinity; + const void *iommu_cookie; + void (*write_msi_msg)(struct msi_desc *, void *); + void *write_msi_msg_data; + union { + struct { + u32 masked; + struct { + u8 is_msix: 1; + u8 multiple: 3; + u8 multi_cap: 3; + u8 maskbit: 1; + u8 is_64: 1; + u8 is_virtual: 1; + u16 entry_nr; + unsigned int default_irq; + } msi_attrib; + union { + u8 mask_pos; + void *mask_base; + }; + }; + struct platform_msi_desc platform; + struct fsl_mc_msi_desc fsl_mc; + struct ti_sci_inta_msi_desc inta; + }; }; -enum P4_EVENT_OPCODES { - P4_EVENT_TC_DELIVER_MODE_OPCODE = 257, - P4_EVENT_BPU_FETCH_REQUEST_OPCODE = 768, - P4_EVENT_ITLB_REFERENCE_OPCODE = 6147, - P4_EVENT_MEMORY_CANCEL_OPCODE = 517, - P4_EVENT_MEMORY_COMPLETE_OPCODE = 2050, - P4_EVENT_LOAD_PORT_REPLAY_OPCODE = 1026, - P4_EVENT_STORE_PORT_REPLAY_OPCODE = 1282, - P4_EVENT_MOB_LOAD_REPLAY_OPCODE = 770, - P4_EVENT_PAGE_WALK_TYPE_OPCODE = 260, - P4_EVENT_BSQ_CACHE_REFERENCE_OPCODE = 3079, - P4_EVENT_IOQ_ALLOCATION_OPCODE = 774, - P4_EVENT_IOQ_ACTIVE_ENTRIES_OPCODE = 6662, - P4_EVENT_FSB_DATA_ACTIVITY_OPCODE = 5894, - P4_EVENT_BSQ_ALLOCATION_OPCODE = 1287, - P4_EVENT_BSQ_ACTIVE_ENTRIES_OPCODE = 1543, - P4_EVENT_SSE_INPUT_ASSIST_OPCODE = 13313, - P4_EVENT_PACKED_SP_UOP_OPCODE = 2049, - P4_EVENT_PACKED_DP_UOP_OPCODE = 3073, - P4_EVENT_SCALAR_SP_UOP_OPCODE = 2561, - P4_EVENT_SCALAR_DP_UOP_OPCODE = 3585, - P4_EVENT_64BIT_MMX_UOP_OPCODE = 513, - P4_EVENT_128BIT_MMX_UOP_OPCODE = 6657, - P4_EVENT_X87_FP_UOP_OPCODE = 1025, - P4_EVENT_TC_MISC_OPCODE = 1537, - P4_EVENT_GLOBAL_POWER_EVENTS_OPCODE = 4870, - P4_EVENT_TC_MS_XFER_OPCODE = 1280, - P4_EVENT_UOP_QUEUE_WRITES_OPCODE = 2304, - P4_EVENT_RETIRED_MISPRED_BRANCH_TYPE_OPCODE = 1282, - P4_EVENT_RETIRED_BRANCH_TYPE_OPCODE = 1026, - P4_EVENT_RESOURCE_STALL_OPCODE = 257, - P4_EVENT_WC_BUFFER_OPCODE = 1285, - P4_EVENT_B2B_CYCLES_OPCODE = 5635, - P4_EVENT_BNR_OPCODE = 2051, - P4_EVENT_SNOOP_OPCODE = 1539, - P4_EVENT_RESPONSE_OPCODE = 1027, - P4_EVENT_FRONT_END_EVENT_OPCODE = 2053, - P4_EVENT_EXECUTION_EVENT_OPCODE = 3077, - P4_EVENT_REPLAY_EVENT_OPCODE = 2309, - P4_EVENT_INSTR_RETIRED_OPCODE = 516, - P4_EVENT_UOPS_RETIRED_OPCODE = 260, - P4_EVENT_UOP_TYPE_OPCODE = 514, - P4_EVENT_BRANCH_RETIRED_OPCODE = 1541, - P4_EVENT_MISPRED_BRANCH_RETIRED_OPCODE = 772, - P4_EVENT_X87_ASSIST_OPCODE = 773, - P4_EVENT_MACHINE_CLEAR_OPCODE = 517, - P4_EVENT_INSTR_COMPLETED_OPCODE = 1796, +struct irq_chip_regs { + long unsigned int enable; + long unsigned int disable; + long unsigned int mask; + long unsigned int ack; + long unsigned int eoi; + long unsigned int type; + long unsigned int polarity; }; -enum P4_ESCR_EMASKS { - P4_EVENT_TC_DELIVER_MODE__DD = 512, - P4_EVENT_TC_DELIVER_MODE__DB = 1024, - P4_EVENT_TC_DELIVER_MODE__DI = 2048, - P4_EVENT_TC_DELIVER_MODE__BD = 4096, - P4_EVENT_TC_DELIVER_MODE__BB = 8192, - P4_EVENT_TC_DELIVER_MODE__BI = 16384, - P4_EVENT_TC_DELIVER_MODE__ID = 32768, - P4_EVENT_BPU_FETCH_REQUEST__TCMISS = 512, - P4_EVENT_ITLB_REFERENCE__HIT = 512, - P4_EVENT_ITLB_REFERENCE__MISS = 1024, - P4_EVENT_ITLB_REFERENCE__HIT_UK = 2048, - P4_EVENT_MEMORY_CANCEL__ST_RB_FULL = 2048, - P4_EVENT_MEMORY_CANCEL__64K_CONF = 4096, - P4_EVENT_MEMORY_COMPLETE__LSC = 512, - P4_EVENT_MEMORY_COMPLETE__SSC = 1024, - P4_EVENT_LOAD_PORT_REPLAY__SPLIT_LD = 1024, - P4_EVENT_STORE_PORT_REPLAY__SPLIT_ST = 1024, - P4_EVENT_MOB_LOAD_REPLAY__NO_STA = 1024, - P4_EVENT_MOB_LOAD_REPLAY__NO_STD = 4096, - P4_EVENT_MOB_LOAD_REPLAY__PARTIAL_DATA = 8192, - P4_EVENT_MOB_LOAD_REPLAY__UNALGN_ADDR = 16384, - P4_EVENT_PAGE_WALK_TYPE__DTMISS = 512, - P4_EVENT_PAGE_WALK_TYPE__ITMISS = 1024, - P4_EVENT_BSQ_CACHE_REFERENCE__RD_2ndL_HITS = 512, - P4_EVENT_BSQ_CACHE_REFERENCE__RD_2ndL_HITE = 1024, - P4_EVENT_BSQ_CACHE_REFERENCE__RD_2ndL_HITM = 2048, - P4_EVENT_BSQ_CACHE_REFERENCE__RD_3rdL_HITS = 4096, - P4_EVENT_BSQ_CACHE_REFERENCE__RD_3rdL_HITE = 8192, - P4_EVENT_BSQ_CACHE_REFERENCE__RD_3rdL_HITM = 16384, - P4_EVENT_BSQ_CACHE_REFERENCE__RD_2ndL_MISS = 131072, - P4_EVENT_BSQ_CACHE_REFERENCE__RD_3rdL_MISS = 262144, - P4_EVENT_BSQ_CACHE_REFERENCE__WR_2ndL_MISS = 524288, - P4_EVENT_IOQ_ALLOCATION__DEFAULT = 512, - P4_EVENT_IOQ_ALLOCATION__ALL_READ = 16384, - P4_EVENT_IOQ_ALLOCATION__ALL_WRITE = 32768, - P4_EVENT_IOQ_ALLOCATION__MEM_UC = 65536, - P4_EVENT_IOQ_ALLOCATION__MEM_WC = 131072, - P4_EVENT_IOQ_ALLOCATION__MEM_WT = 262144, - P4_EVENT_IOQ_ALLOCATION__MEM_WP = 524288, - P4_EVENT_IOQ_ALLOCATION__MEM_WB = 1048576, - P4_EVENT_IOQ_ALLOCATION__OWN = 4194304, - P4_EVENT_IOQ_ALLOCATION__OTHER = 8388608, - P4_EVENT_IOQ_ALLOCATION__PREFETCH = 16777216, - P4_EVENT_IOQ_ACTIVE_ENTRIES__DEFAULT = 512, - P4_EVENT_IOQ_ACTIVE_ENTRIES__ALL_READ = 16384, - P4_EVENT_IOQ_ACTIVE_ENTRIES__ALL_WRITE = 32768, - P4_EVENT_IOQ_ACTIVE_ENTRIES__MEM_UC = 65536, - P4_EVENT_IOQ_ACTIVE_ENTRIES__MEM_WC = 131072, - P4_EVENT_IOQ_ACTIVE_ENTRIES__MEM_WT = 262144, - P4_EVENT_IOQ_ACTIVE_ENTRIES__MEM_WP = 524288, - P4_EVENT_IOQ_ACTIVE_ENTRIES__MEM_WB = 1048576, - P4_EVENT_IOQ_ACTIVE_ENTRIES__OWN = 4194304, - P4_EVENT_IOQ_ACTIVE_ENTRIES__OTHER = 8388608, - P4_EVENT_IOQ_ACTIVE_ENTRIES__PREFETCH = 16777216, - P4_EVENT_FSB_DATA_ACTIVITY__DRDY_DRV = 512, - P4_EVENT_FSB_DATA_ACTIVITY__DRDY_OWN = 1024, - P4_EVENT_FSB_DATA_ACTIVITY__DRDY_OTHER = 2048, - P4_EVENT_FSB_DATA_ACTIVITY__DBSY_DRV = 4096, - P4_EVENT_FSB_DATA_ACTIVITY__DBSY_OWN = 8192, - P4_EVENT_FSB_DATA_ACTIVITY__DBSY_OTHER = 16384, - P4_EVENT_BSQ_ALLOCATION__REQ_TYPE0 = 512, - P4_EVENT_BSQ_ALLOCATION__REQ_TYPE1 = 1024, - P4_EVENT_BSQ_ALLOCATION__REQ_LEN0 = 2048, - P4_EVENT_BSQ_ALLOCATION__REQ_LEN1 = 4096, - P4_EVENT_BSQ_ALLOCATION__REQ_IO_TYPE = 16384, - P4_EVENT_BSQ_ALLOCATION__REQ_LOCK_TYPE = 32768, - P4_EVENT_BSQ_ALLOCATION__REQ_CACHE_TYPE = 65536, - P4_EVENT_BSQ_ALLOCATION__REQ_SPLIT_TYPE = 131072, - P4_EVENT_BSQ_ALLOCATION__REQ_DEM_TYPE = 262144, - P4_EVENT_BSQ_ALLOCATION__REQ_ORD_TYPE = 524288, - P4_EVENT_BSQ_ALLOCATION__MEM_TYPE0 = 1048576, - P4_EVENT_BSQ_ALLOCATION__MEM_TYPE1 = 2097152, - P4_EVENT_BSQ_ALLOCATION__MEM_TYPE2 = 4194304, - P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_TYPE0 = 512, - P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_TYPE1 = 1024, - P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_LEN0 = 2048, - P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_LEN1 = 4096, - P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_IO_TYPE = 16384, - P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_LOCK_TYPE = 32768, - P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_CACHE_TYPE = 65536, - P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_SPLIT_TYPE = 131072, - P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_DEM_TYPE = 262144, - P4_EVENT_BSQ_ACTIVE_ENTRIES__REQ_ORD_TYPE = 524288, - P4_EVENT_BSQ_ACTIVE_ENTRIES__MEM_TYPE0 = 1048576, - P4_EVENT_BSQ_ACTIVE_ENTRIES__MEM_TYPE1 = 2097152, - P4_EVENT_BSQ_ACTIVE_ENTRIES__MEM_TYPE2 = 4194304, - P4_EVENT_SSE_INPUT_ASSIST__ALL = 16777216, - P4_EVENT_PACKED_SP_UOP__ALL = 16777216, - P4_EVENT_PACKED_DP_UOP__ALL = 16777216, - P4_EVENT_SCALAR_SP_UOP__ALL = 16777216, - P4_EVENT_SCALAR_DP_UOP__ALL = 16777216, - P4_EVENT_64BIT_MMX_UOP__ALL = 16777216, - P4_EVENT_128BIT_MMX_UOP__ALL = 16777216, - P4_EVENT_X87_FP_UOP__ALL = 16777216, - P4_EVENT_TC_MISC__FLUSH = 8192, - P4_EVENT_GLOBAL_POWER_EVENTS__RUNNING = 512, - P4_EVENT_TC_MS_XFER__CISC = 512, - P4_EVENT_UOP_QUEUE_WRITES__FROM_TC_BUILD = 512, - P4_EVENT_UOP_QUEUE_WRITES__FROM_TC_DELIVER = 1024, - P4_EVENT_UOP_QUEUE_WRITES__FROM_ROM = 2048, - P4_EVENT_RETIRED_MISPRED_BRANCH_TYPE__CONDITIONAL = 1024, - P4_EVENT_RETIRED_MISPRED_BRANCH_TYPE__CALL = 2048, - P4_EVENT_RETIRED_MISPRED_BRANCH_TYPE__RETURN = 4096, - P4_EVENT_RETIRED_MISPRED_BRANCH_TYPE__INDIRECT = 8192, - P4_EVENT_RETIRED_BRANCH_TYPE__CONDITIONAL = 1024, - P4_EVENT_RETIRED_BRANCH_TYPE__CALL = 2048, - P4_EVENT_RETIRED_BRANCH_TYPE__RETURN = 4096, - P4_EVENT_RETIRED_BRANCH_TYPE__INDIRECT = 8192, - P4_EVENT_RESOURCE_STALL__SBFULL = 16384, - P4_EVENT_WC_BUFFER__WCB_EVICTS = 512, - P4_EVENT_WC_BUFFER__WCB_FULL_EVICTS = 1024, - P4_EVENT_FRONT_END_EVENT__NBOGUS = 512, - P4_EVENT_FRONT_END_EVENT__BOGUS = 1024, - P4_EVENT_EXECUTION_EVENT__NBOGUS0 = 512, - P4_EVENT_EXECUTION_EVENT__NBOGUS1 = 1024, - P4_EVENT_EXECUTION_EVENT__NBOGUS2 = 2048, - P4_EVENT_EXECUTION_EVENT__NBOGUS3 = 4096, - P4_EVENT_EXECUTION_EVENT__BOGUS0 = 8192, - P4_EVENT_EXECUTION_EVENT__BOGUS1 = 16384, - P4_EVENT_EXECUTION_EVENT__BOGUS2 = 32768, - P4_EVENT_EXECUTION_EVENT__BOGUS3 = 65536, - P4_EVENT_REPLAY_EVENT__NBOGUS = 512, - P4_EVENT_REPLAY_EVENT__BOGUS = 1024, - P4_EVENT_INSTR_RETIRED__NBOGUSNTAG = 512, - P4_EVENT_INSTR_RETIRED__NBOGUSTAG = 1024, - P4_EVENT_INSTR_RETIRED__BOGUSNTAG = 2048, - P4_EVENT_INSTR_RETIRED__BOGUSTAG = 4096, - P4_EVENT_UOPS_RETIRED__NBOGUS = 512, - P4_EVENT_UOPS_RETIRED__BOGUS = 1024, - P4_EVENT_UOP_TYPE__TAGLOADS = 1024, - P4_EVENT_UOP_TYPE__TAGSTORES = 2048, - P4_EVENT_BRANCH_RETIRED__MMNP = 512, - P4_EVENT_BRANCH_RETIRED__MMNM = 1024, - P4_EVENT_BRANCH_RETIRED__MMTP = 2048, - P4_EVENT_BRANCH_RETIRED__MMTM = 4096, - P4_EVENT_MISPRED_BRANCH_RETIRED__NBOGUS = 512, - P4_EVENT_X87_ASSIST__FPSU = 512, - P4_EVENT_X87_ASSIST__FPSO = 1024, - P4_EVENT_X87_ASSIST__POAO = 2048, - P4_EVENT_X87_ASSIST__POAU = 4096, - P4_EVENT_X87_ASSIST__PREA = 8192, - P4_EVENT_MACHINE_CLEAR__CLEAR = 512, - P4_EVENT_MACHINE_CLEAR__MOCLEAR = 1024, - P4_EVENT_MACHINE_CLEAR__SMCLEAR = 2048, - P4_EVENT_INSTR_COMPLETED__NBOGUS = 512, - P4_EVENT_INSTR_COMPLETED__BOGUS = 1024, +struct irq_chip_type { + struct irq_chip chip; + struct irq_chip_regs regs; + irq_flow_handler_t handler; + u32 type; + u32 mask_cache_priv; + u32 *mask_cache; }; -enum P4_PEBS_METRIC { - P4_PEBS_METRIC__none = 0, - P4_PEBS_METRIC__1stl_cache_load_miss_retired = 1, - P4_PEBS_METRIC__2ndl_cache_load_miss_retired = 2, - P4_PEBS_METRIC__dtlb_load_miss_retired = 3, - P4_PEBS_METRIC__dtlb_store_miss_retired = 4, - P4_PEBS_METRIC__dtlb_all_miss_retired = 5, - P4_PEBS_METRIC__tagged_mispred_branch = 6, - P4_PEBS_METRIC__mob_load_replay_retired = 7, - P4_PEBS_METRIC__split_load_retired = 8, - P4_PEBS_METRIC__split_store_retired = 9, - P4_PEBS_METRIC__max = 10, +struct irq_chip_generic { + raw_spinlock_t lock; + void *reg_base; + u32 (*reg_readl)(void *); + void (*reg_writel)(u32, void *); + void (*suspend)(struct irq_chip_generic *); + void (*resume)(struct irq_chip_generic *); + unsigned int irq_base; + unsigned int irq_cnt; + u32 mask_cache; + u32 type_cache; + u32 polarity_cache; + u32 wake_enabled; + u32 wake_active; + unsigned int num_ct; + void *private; + long unsigned int installed; + long unsigned int unused; + struct irq_domain *domain; + struct list_head list; + struct irq_chip_type chip_types[0]; }; -struct p4_event_bind { - unsigned int opcode; - unsigned int escr_msr[2]; - unsigned int escr_emask; - unsigned int shared; - char cntr[6]; +enum irq_gc_flags { + IRQ_GC_INIT_MASK_CACHE = 1, + IRQ_GC_INIT_NESTED_LOCK = 2, + IRQ_GC_MASK_CACHE_PER_TYPE = 4, + IRQ_GC_NO_MASK = 8, + IRQ_GC_BE_IO = 16, }; -struct p4_pebs_bind { - unsigned int metric_pebs; - unsigned int metric_vert; +struct irq_domain_chip_generic { + unsigned int irqs_per_chip; + unsigned int num_chips; + unsigned int irq_flags_to_clear; + unsigned int irq_flags_to_set; + enum irq_gc_flags gc_flags; + struct irq_chip_generic *gc[0]; }; -struct p4_event_alias { - u64 original; - u64 alternative; +struct legacy_pic { + int nr_legacy_irqs; + struct irq_chip *chip; + void (*mask)(unsigned int); + void (*unmask)(unsigned int); + void (*mask_all)(); + void (*restore_mask)(); + void (*init)(int); + int (*probe)(); + int (*irq_pending)(unsigned int); + void (*make_irq)(unsigned int); }; -enum cpuid_regs_idx { - CPUID_EAX = 0, - CPUID_EBX = 1, - CPUID_ECX = 2, - CPUID_EDX = 3, +enum refcount_saturation_type { + REFCOUNT_ADD_NOT_ZERO_OVF = 0, + REFCOUNT_ADD_OVF = 1, + REFCOUNT_ADD_UAF = 2, + REFCOUNT_SUB_UAF = 3, + REFCOUNT_DEC_LEAK = 4, }; -struct dev_ext_attribute { - struct device_attribute attr; - void *var; +enum lockdown_reason { + LOCKDOWN_NONE = 0, + LOCKDOWN_MODULE_SIGNATURE = 1, + LOCKDOWN_DEV_MEM = 2, + LOCKDOWN_EFI_TEST = 3, + LOCKDOWN_KEXEC = 4, + LOCKDOWN_HIBERNATION = 5, + LOCKDOWN_PCI_ACCESS = 6, + LOCKDOWN_IOPORT = 7, + LOCKDOWN_MSR = 8, + LOCKDOWN_ACPI_TABLES = 9, + LOCKDOWN_PCMCIA_CIS = 10, + LOCKDOWN_TIOCSSERIAL = 11, + LOCKDOWN_MODULE_PARAMETERS = 12, + LOCKDOWN_MMIOTRACE = 13, + LOCKDOWN_DEBUGFS = 14, + LOCKDOWN_XMON_WR = 15, + LOCKDOWN_INTEGRITY_MAX = 16, + LOCKDOWN_KCORE = 17, + LOCKDOWN_KPROBES = 18, + LOCKDOWN_BPF_READ = 19, + LOCKDOWN_PERF = 20, + LOCKDOWN_TRACEFS = 21, + LOCKDOWN_XMON_RW = 22, + LOCKDOWN_CONFIDENTIALITY_MAX = 23, }; -enum pt_capabilities { - PT_CAP_max_subleaf = 0, - PT_CAP_cr3_filtering = 1, - PT_CAP_psb_cyc = 2, - PT_CAP_ip_filtering = 3, - PT_CAP_mtc = 4, - PT_CAP_ptwrite = 5, - PT_CAP_power_event_trace = 6, - PT_CAP_topa_output = 7, - PT_CAP_topa_multiple_entries = 8, - PT_CAP_single_range_output = 9, - PT_CAP_output_subsys = 10, - PT_CAP_payloads_lip = 11, - PT_CAP_num_address_ranges = 12, - PT_CAP_mtc_periods = 13, - PT_CAP_cycle_thresholds = 14, - PT_CAP_psb_periods = 15, +enum lockdep_ok { + LOCKDEP_STILL_OK = 0, + LOCKDEP_NOW_UNRELIABLE = 1, }; -enum perf_addr_filter_action_t { - PERF_ADDR_FILTER_ACTION_STOP = 0, - PERF_ADDR_FILTER_ACTION_START = 1, - PERF_ADDR_FILTER_ACTION_FILTER = 2, -}; +typedef long unsigned int uintptr_t; -struct perf_addr_filter { - struct list_head entry; - struct path path; - long unsigned int offset; - long unsigned int size; - enum perf_addr_filter_action_t action; +struct machine_ops { + void (*restart)(char *); + void (*halt)(); + void (*power_off)(); + void (*shutdown)(); + void (*crash_shutdown)(struct pt_regs *); + void (*emergency_restart)(); }; -struct topa_entry { - u64 end: 1; - u64 rsvd0: 1; - u64 intr: 1; - u64 rsvd1: 1; - u64 stop: 1; - u64 rsvd2: 1; - u64 size: 4; - u64 rsvd3: 2; - u64 base: 36; - u64 rsvd4: 16; +struct trace_event_raw_nmi_handler { + struct trace_entry ent; + void *handler; + s64 delta_ns; + int handled; + char __data[0]; }; -struct pt_pmu { - struct pmu pmu; - u32 caps[8]; - bool vmx; - bool branch_en_always_on; - long unsigned int max_nonturbo_ratio; - unsigned int tsc_art_num; - unsigned int tsc_art_den; +struct trace_event_data_offsets_nmi_handler {}; + +typedef void (*btf_trace_nmi_handler)(void *, void *, s64, int); + +struct nmi_desc { + raw_spinlock_t lock; + struct list_head head; }; -struct topa; +struct nmi_stats { + unsigned int normal; + unsigned int unknown; + unsigned int external; + unsigned int swallow; +}; -struct pt_buffer { - struct list_head tables; - struct topa *first; - struct topa *last; - struct topa *cur; - unsigned int cur_idx; - size_t output_off; - long unsigned int nr_pages; - local_t data_size; - local64_t head; - bool snapshot; - bool single; - long int stop_pos; - long int intr_pos; - struct topa_entry *stop_te; - struct topa_entry *intr_te; - void **data_pages; +enum nmi_states { + NMI_NOT_RUNNING = 0, + NMI_EXECUTING = 1, + NMI_LATCHED = 2, }; -struct topa { - struct list_head list; - u64 offset; - size_t size; - int last; - unsigned int z_count; +typedef enum nmi_states pto_T_____7; + +typedef bool pto_T_____8; + +enum { + DESC_TSS = 9, + DESC_LDT = 2, + DESCTYPE_S = 16, }; -struct pt_filter { - long unsigned int msr_a; - long unsigned int msr_b; - long unsigned int config; +struct ldttss_desc { + u16 limit0; + u16 base0; + u16 base1: 8; + u16 type: 5; + u16 dpl: 2; + u16 p: 1; + u16 limit1: 4; + u16 zero0: 3; + u16 g: 1; + u16 base2: 8; + u32 base3; + u32 zero1; }; -struct pt_filters { - struct pt_filter filter[4]; - unsigned int nr_filters; +typedef struct ldttss_desc ldt_desc; + +struct user_desc { + unsigned int entry_number; + unsigned int base_addr; + unsigned int limit; + unsigned int seg_32bit: 1; + unsigned int contents: 2; + unsigned int read_exec_only: 1; + unsigned int limit_in_pages: 1; + unsigned int seg_not_present: 1; + unsigned int useable: 1; + unsigned int lm: 1; }; -struct pt { - struct perf_output_handle handle; - struct pt_filters filters; - int handle_nmi; - int vmx_on; - u64 output_base; - u64 output_mask; +struct mmu_gather_batch { + struct mmu_gather_batch *next; + unsigned int nr; + unsigned int max; + struct page *pages[0]; }; -struct pt_cap_desc { - const char *name; - u32 leaf; - u8 reg; - u32 mask; +struct mmu_gather { + struct mm_struct *mm; + long unsigned int start; + long unsigned int end; + unsigned int fullmm: 1; + unsigned int need_flush_all: 1; + unsigned int freed_tables: 1; + unsigned int cleared_ptes: 1; + unsigned int cleared_pmds: 1; + unsigned int cleared_puds: 1; + unsigned int cleared_p4ds: 1; + unsigned int vma_exec: 1; + unsigned int vma_huge: 1; + unsigned int batch_count; + struct mmu_gather_batch *active; + struct mmu_gather_batch local; + struct page *__pages[8]; }; -struct pt_address_range { - long unsigned int msr_a; - long unsigned int msr_b; - unsigned int reg_off; +struct setup_data { + __u64 next; + __u32 type; + __u32 len; + __u8 data[0]; }; -struct topa_page { - struct topa_entry table[507]; - struct topa topa; +struct setup_indirect { + __u32 type; + __u32 reserved; + __u64 len; + __u64 addr; }; -typedef void (*exitcall_t)(); +struct plist_head { + struct list_head node_list; +}; -enum hrtimer_mode { - HRTIMER_MODE_ABS = 0, - HRTIMER_MODE_REL = 1, - HRTIMER_MODE_PINNED = 2, - HRTIMER_MODE_SOFT = 4, - HRTIMER_MODE_HARD = 8, - HRTIMER_MODE_ABS_PINNED = 2, - HRTIMER_MODE_REL_PINNED = 3, - HRTIMER_MODE_ABS_SOFT = 4, - HRTIMER_MODE_REL_SOFT = 5, - HRTIMER_MODE_ABS_PINNED_SOFT = 6, - HRTIMER_MODE_REL_PINNED_SOFT = 7, - HRTIMER_MODE_ABS_HARD = 8, - HRTIMER_MODE_REL_HARD = 9, - HRTIMER_MODE_ABS_PINNED_HARD = 10, - HRTIMER_MODE_REL_PINNED_HARD = 11, +enum pm_qos_type { + PM_QOS_UNITIALIZED = 0, + PM_QOS_MAX = 1, + PM_QOS_MIN = 2, + PM_QOS_SUM = 3, }; -struct x86_cpu_id { - __u16 vendor; - __u16 family; - __u16 model; - __u16 feature; - kernel_ulong_t driver_data; +struct pm_qos_constraints { + struct plist_head list; + s32 target_value; + s32 default_value; + s32 no_constraint_value; + enum pm_qos_type type; + struct blocking_notifier_head *notifiers; }; -enum perf_rapl_events { - PERF_RAPL_PP0 = 0, - PERF_RAPL_PKG = 1, - PERF_RAPL_RAM = 2, - PERF_RAPL_PP1 = 3, - PERF_RAPL_PSYS = 4, - PERF_RAPL_MAX = 5, - NR_RAPL_DOMAINS = 5, +struct freq_constraints { + struct pm_qos_constraints min_freq; + struct blocking_notifier_head min_freq_notifiers; + struct pm_qos_constraints max_freq; + struct blocking_notifier_head max_freq_notifiers; }; -struct rapl_pmu { - raw_spinlock_t lock; - int n_active; - int cpu; - struct list_head active_list; - struct pmu *pmu; - ktime_t timer_interval; - struct hrtimer hrtimer; +struct pm_qos_flags { + struct list_head list; + s32 effective_flags; }; -struct rapl_pmus { - struct pmu pmu; - unsigned int maxdie; - struct rapl_pmu *pmus[0]; +struct dev_pm_qos_request; + +struct dev_pm_qos { + struct pm_qos_constraints resume_latency; + struct pm_qos_constraints latency_tolerance; + struct freq_constraints freq; + struct pm_qos_flags flags; + struct dev_pm_qos_request *resume_latency_req; + struct dev_pm_qos_request *latency_tolerance_req; + struct dev_pm_qos_request *flags_req; }; -struct rapl_model { - long unsigned int events; - bool apply_quirk; +struct acpi_table_ibft { + struct acpi_table_header header; + u8 reserved[12]; }; -struct acpi_device; +enum efi_secureboot_mode { + efi_secureboot_mode_unset = 0, + efi_secureboot_mode_unknown = 1, + efi_secureboot_mode_disabled = 2, + efi_secureboot_mode_enabled = 3, +}; -struct pci_sysdata { - int domain; - int node; - struct acpi_device *companion; - void *iommu; - void *fwnode; +enum xen_domain_type { + XEN_NATIVE = 0, + XEN_PV_DOMAIN = 1, + XEN_HVM_DOMAIN = 2, }; -struct pci_extra_dev { - struct pci_dev *dev[4]; +struct hvm_start_info { + uint32_t magic; + uint32_t version; + uint32_t flags; + uint32_t nr_modules; + uint64_t modlist_paddr; + uint64_t cmdline_paddr; + uint64_t rsdp_paddr; + uint64_t memmap_paddr; + uint32_t memmap_entries; + uint32_t reserved; }; -struct intel_uncore_pmu; +struct pm_qos_flags_request { + struct list_head node; + s32 flags; +}; -struct intel_uncore_ops; +enum freq_qos_req_type { + FREQ_QOS_MIN = 1, + FREQ_QOS_MAX = 2, +}; -struct uncore_event_desc; +struct freq_qos_request { + enum freq_qos_req_type type; + struct plist_node pnode; + struct freq_constraints *qos; +}; -struct freerunning_counters; +enum dev_pm_qos_req_type { + DEV_PM_QOS_RESUME_LATENCY = 1, + DEV_PM_QOS_LATENCY_TOLERANCE = 2, + DEV_PM_QOS_MIN_FREQUENCY = 3, + DEV_PM_QOS_MAX_FREQUENCY = 4, + DEV_PM_QOS_FLAGS = 5, +}; -struct intel_uncore_type { - const char *name; - int num_counters; - int num_boxes; - int perf_ctr_bits; - int fixed_ctr_bits; - int num_freerunning_types; - unsigned int perf_ctr; - unsigned int event_ctl; - unsigned int event_mask; - unsigned int event_mask_ext; - unsigned int fixed_ctr; - unsigned int fixed_ctl; - unsigned int box_ctl; +struct dev_pm_qos_request { + enum dev_pm_qos_req_type type; union { - unsigned int msr_offset; - unsigned int mmio_offset; - }; - unsigned int num_shared_regs: 8; - unsigned int single_fixed: 1; - unsigned int pair_ctr_ctl: 1; - unsigned int *msr_offsets; - struct event_constraint unconstrainted; - struct event_constraint *constraints; - struct intel_uncore_pmu *pmus; - struct intel_uncore_ops *ops; - struct uncore_event_desc *event_descs; - struct freerunning_counters *freerunning; - const struct attribute_group *attr_groups[4]; - struct pmu *pmu; + struct plist_node pnode; + struct pm_qos_flags_request flr; + struct freq_qos_request freq; + } data; + struct device *dev; +}; + +enum cpufreq_table_sorting { + CPUFREQ_TABLE_UNSORTED = 0, + CPUFREQ_TABLE_SORTED_ASCENDING = 1, + CPUFREQ_TABLE_SORTED_DESCENDING = 2, +}; + +struct cpufreq_cpuinfo { + unsigned int max_freq; + unsigned int min_freq; + unsigned int transition_latency; +}; + +struct cpufreq_stats; + +struct clk; + +struct cpufreq_governor; + +struct cpufreq_frequency_table; + +struct thermal_cooling_device; + +struct cpufreq_policy { + cpumask_var_t cpus; + cpumask_var_t related_cpus; + cpumask_var_t real_cpus; + unsigned int shared_type; + unsigned int cpu; + struct clk *clk; + struct cpufreq_cpuinfo cpuinfo; + unsigned int min; + unsigned int max; + unsigned int cur; + unsigned int restore_freq; + unsigned int suspend_freq; + unsigned int policy; + unsigned int last_policy; + struct cpufreq_governor *governor; + void *governor_data; + char last_governor[16]; + struct work_struct update; + struct freq_constraints constraints; + struct freq_qos_request *min_freq_req; + struct freq_qos_request *max_freq_req; + struct cpufreq_frequency_table *freq_table; + enum cpufreq_table_sorting freq_table_sorted; + struct list_head policy_list; + struct kobject kobj; + struct completion kobj_unregister; + struct rw_semaphore rwsem; + bool fast_switch_possible; + bool fast_switch_enabled; + unsigned int transition_delay_us; + bool dvfs_possible_from_any_cpu; + unsigned int cached_target_freq; + int cached_resolved_idx; + bool transition_ongoing; + spinlock_t transition_lock; + wait_queue_head_t transition_wait; + struct task_struct *transition_task; + struct cpufreq_stats *stats; + void *driver_data; + struct thermal_cooling_device *cdev; + struct notifier_block nb_min; + struct notifier_block nb_max; }; -struct intel_uncore_box; - -struct intel_uncore_pmu { - struct pmu pmu; - char name[32]; - int pmu_idx; - int func_id; - bool registered; - atomic_t activeboxes; - struct intel_uncore_type *type; - struct intel_uncore_box **boxes; +struct cpufreq_governor { + char name[16]; + int (*init)(struct cpufreq_policy *); + void (*exit)(struct cpufreq_policy *); + int (*start)(struct cpufreq_policy *); + void (*stop)(struct cpufreq_policy *); + void (*limits)(struct cpufreq_policy *); + ssize_t (*show_setspeed)(struct cpufreq_policy *, char *); + int (*store_setspeed)(struct cpufreq_policy *, unsigned int); + bool dynamic_switching; + struct list_head governor_list; + struct module *owner; }; -struct intel_uncore_ops { - void (*init_box)(struct intel_uncore_box *); - void (*exit_box)(struct intel_uncore_box *); - void (*disable_box)(struct intel_uncore_box *); - void (*enable_box)(struct intel_uncore_box *); - void (*disable_event)(struct intel_uncore_box *, struct perf_event *); - void (*enable_event)(struct intel_uncore_box *, struct perf_event *); - u64 (*read_counter)(struct intel_uncore_box *, struct perf_event *); - int (*hw_config)(struct intel_uncore_box *, struct perf_event *); - struct event_constraint * (*get_constraint)(struct intel_uncore_box *, struct perf_event *); - void (*put_constraint)(struct intel_uncore_box *, struct perf_event *); +struct cpufreq_frequency_table { + unsigned int flags; + unsigned int driver_data; + unsigned int frequency; }; -struct uncore_event_desc { - struct kobj_attribute attr; - const char *config; +struct freq_attr { + struct attribute attr; + ssize_t (*show)(struct cpufreq_policy *, char *); + ssize_t (*store)(struct cpufreq_policy *, const char *, size_t); }; -struct freerunning_counters { - unsigned int counter_base; - unsigned int counter_offset; - unsigned int box_offset; - unsigned int num_counters; - unsigned int bits; +struct efi_scratch { + u64 phys_stack; + struct mm_struct *prev_mm; }; -struct intel_uncore_extra_reg { - raw_spinlock_t lock; - u64 config; - u64 config1; - u64 config2; - atomic_t ref; +struct amd_nb_bus_dev_range { + u8 bus; + u8 dev_base; + u8 dev_limit; }; -struct intel_uncore_box { - int pci_phys_id; - int dieid; - int n_active; - int n_events; - int cpu; - long unsigned int flags; - atomic_t refcnt; - struct perf_event *events[10]; - struct perf_event *event_list[10]; - struct event_constraint *event_constraint[10]; - long unsigned int active_mask[1]; - u64 tags[10]; - struct pci_dev *pci_dev; - struct intel_uncore_pmu *pmu; - u64 hrtimer_duration; - struct hrtimer hrtimer; +struct msi_controller { + struct module *owner; + struct device *dev; + struct device_node *of_node; struct list_head list; - struct list_head active_list; - void *io_addr; - struct intel_uncore_extra_reg shared_regs[0]; + int (*setup_irq)(struct msi_controller *, struct pci_dev *, struct msi_desc *); + int (*setup_irqs)(struct msi_controller *, struct pci_dev *, int, int); + void (*teardown_irq)(struct msi_controller *, unsigned int); }; -struct pci2phy_map { - struct list_head list; - int segment; - int pbus_to_physid[256]; +struct pci_raw_ops { + int (*read)(unsigned int, unsigned int, unsigned int, int, int, u32 *); + int (*write)(unsigned int, unsigned int, unsigned int, int, int, u32); }; -struct intel_uncore_init_fun { - void (*cpu_init)(); - int (*pci_init)(); - void (*mmio_init)(); +struct clock_event_device___2; + +enum jump_label_type { + JUMP_LABEL_NOP = 0, + JUMP_LABEL_JMP = 1, }; -enum { - EXTRA_REG_NHMEX_M_FILTER = 0, - EXTRA_REG_NHMEX_M_DSP = 1, - EXTRA_REG_NHMEX_M_ISS = 2, - EXTRA_REG_NHMEX_M_MAP = 3, - EXTRA_REG_NHMEX_M_MSC_THR = 4, - EXTRA_REG_NHMEX_M_PGT = 5, - EXTRA_REG_NHMEX_M_PLD = 6, - EXTRA_REG_NHMEX_M_ZDP_CTL_FVC = 7, +struct text_poke_loc { + void *addr; + int len; + s32 rel32; + u8 opcode; + const u8 text[5]; +}; + +union jump_code_union { + char code[5]; + struct { + char jump; + int offset; + } __attribute__((packed)); }; enum { - SNB_PCI_UNCORE_IMC = 0, + JL_STATE_START = 0, + JL_STATE_NO_UPDATE = 1, + JL_STATE_UPDATE = 2, }; -enum perf_snb_uncore_imc_freerunning_types { - SNB_PCI_UNCORE_IMC_DATA = 0, - SNB_PCI_UNCORE_IMC_FREERUNNING_TYPE_MAX = 1, +struct vm_unmapped_area_info { + long unsigned int flags; + long unsigned int length; + long unsigned int low_limit; + long unsigned int high_limit; + long unsigned int align_mask; + long unsigned int align_offset; }; -struct imc_uncore_pci_dev { - __u32 pci_id; - struct pci_driver *driver; +enum align_flags { + ALIGN_VA_32 = 1, + ALIGN_VA_64 = 2, }; enum { - SNBEP_PCI_QPI_PORT0_FILTER = 0, - SNBEP_PCI_QPI_PORT1_FILTER = 1, - BDX_PCI_QPI_PORT2_FILTER = 2, - HSWEP_PCI_PCU_3 = 3, + MEMREMAP_WB = 1, + MEMREMAP_WT = 2, + MEMREMAP_WC = 4, + MEMREMAP_ENC = 8, + MEMREMAP_DEC = 16, }; enum { - SNBEP_PCI_UNCORE_HA = 0, - SNBEP_PCI_UNCORE_IMC = 1, - SNBEP_PCI_UNCORE_QPI = 2, - SNBEP_PCI_UNCORE_R2PCIE = 3, - SNBEP_PCI_UNCORE_R3QPI = 4, + IORES_DESC_NONE = 0, + IORES_DESC_CRASH_KERNEL = 1, + IORES_DESC_ACPI_TABLES = 2, + IORES_DESC_ACPI_NV_STORAGE = 3, + IORES_DESC_PERSISTENT_MEMORY = 4, + IORES_DESC_PERSISTENT_MEMORY_LEGACY = 5, + IORES_DESC_DEVICE_PRIVATE_MEMORY = 6, + IORES_DESC_RESERVED = 7, + IORES_DESC_SOFT_RESERVED = 8, }; -enum { - IVBEP_PCI_UNCORE_HA = 0, - IVBEP_PCI_UNCORE_IMC = 1, - IVBEP_PCI_UNCORE_IRP = 2, - IVBEP_PCI_UNCORE_QPI = 3, - IVBEP_PCI_UNCORE_R2PCIE = 4, - IVBEP_PCI_UNCORE_R3QPI = 5, +struct change_member { + struct e820_entry *entry; + long long unsigned int addr; }; -enum { - KNL_PCI_UNCORE_MC_UCLK = 0, - KNL_PCI_UNCORE_MC_DCLK = 1, - KNL_PCI_UNCORE_EDC_UCLK = 2, - KNL_PCI_UNCORE_EDC_ECLK = 3, - KNL_PCI_UNCORE_M2PCIE = 4, - KNL_PCI_UNCORE_IRP = 5, +struct iommu_fwspec { + const struct iommu_ops *ops; + struct fwnode_handle *iommu_fwnode; + void *iommu_priv; + u32 flags; + unsigned int num_ids; + u32 ids[1]; }; -enum { - HSWEP_PCI_UNCORE_HA = 0, - HSWEP_PCI_UNCORE_IMC = 1, - HSWEP_PCI_UNCORE_IRP = 2, - HSWEP_PCI_UNCORE_QPI = 3, - HSWEP_PCI_UNCORE_R2PCIE = 4, - HSWEP_PCI_UNCORE_R3QPI = 5, +struct iommu_fault_param; + +struct iommu_param { + struct mutex lock; + struct iommu_fault_param *fault_param; }; -enum { - BDX_PCI_UNCORE_HA = 0, - BDX_PCI_UNCORE_IMC = 1, - BDX_PCI_UNCORE_IRP = 2, - BDX_PCI_UNCORE_QPI = 3, - BDX_PCI_UNCORE_R2PCIE = 4, - BDX_PCI_UNCORE_R3QPI = 5, +struct of_phandle_args { + struct device_node *np; + int args_count; + uint32_t args[16]; }; -enum perf_uncore_iio_freerunning_type_id { - SKX_IIO_MSR_IOCLK = 0, - SKX_IIO_MSR_BW = 1, - SKX_IIO_MSR_UTIL = 2, - SKX_IIO_FREERUNNING_TYPE_MAX = 3, +struct iommu_fault_unrecoverable { + __u32 reason; + __u32 flags; + __u32 pasid; + __u32 perm; + __u64 addr; + __u64 fetch_addr; }; -enum { - SKX_PCI_UNCORE_IMC = 0, - SKX_PCI_UNCORE_M2M = 1, - SKX_PCI_UNCORE_UPI = 2, - SKX_PCI_UNCORE_M2PCIE = 3, - SKX_PCI_UNCORE_M3UPI = 4, +struct iommu_fault_page_request { + __u32 flags; + __u32 pasid; + __u32 grpid; + __u32 perm; + __u64 addr; + __u64 private_data[2]; }; -enum perf_uncore_snr_iio_freerunning_type_id { - SNR_IIO_MSR_IOCLK = 0, - SNR_IIO_MSR_BW_IN = 1, - SNR_IIO_FREERUNNING_TYPE_MAX = 2, +struct iommu_fault { + __u32 type; + __u32 padding; + union { + struct iommu_fault_unrecoverable event; + struct iommu_fault_page_request prm; + __u8 padding2[56]; + }; }; -enum { - SNR_PCI_UNCORE_M2M = 0, +struct iommu_page_response { + __u32 version; + __u32 flags; + __u32 pasid; + __u32 grpid; + __u32 code; }; -enum perf_uncore_snr_imc_freerunning_type_id { - SNR_IMC_DCLK = 0, - SNR_IMC_DDR = 1, - SNR_IMC_FREERUNNING_TYPE_MAX = 2, +struct iommu_inv_addr_info { + __u32 flags; + __u32 archid; + __u64 pasid; + __u64 addr; + __u64 granule_size; + __u64 nb_granules; }; -struct cstate_model { - long unsigned int core_events; - long unsigned int pkg_events; - long unsigned int quirks; +struct iommu_inv_pasid_info { + __u32 flags; + __u32 archid; + __u64 pasid; }; -enum perf_cstate_core_events { - PERF_CSTATE_CORE_C1_RES = 0, - PERF_CSTATE_CORE_C3_RES = 1, - PERF_CSTATE_CORE_C6_RES = 2, - PERF_CSTATE_CORE_C7_RES = 3, - PERF_CSTATE_CORE_EVENT_MAX = 4, +struct iommu_cache_invalidate_info { + __u32 version; + __u8 cache; + __u8 granularity; + __u8 padding[2]; + union { + struct iommu_inv_pasid_info pasid_info; + struct iommu_inv_addr_info addr_info; + }; }; -enum perf_cstate_pkg_events { - PERF_CSTATE_PKG_C2_RES = 0, - PERF_CSTATE_PKG_C3_RES = 1, - PERF_CSTATE_PKG_C6_RES = 2, - PERF_CSTATE_PKG_C7_RES = 3, - PERF_CSTATE_PKG_C8_RES = 4, - PERF_CSTATE_PKG_C9_RES = 5, - PERF_CSTATE_PKG_C10_RES = 6, - PERF_CSTATE_PKG_EVENT_MAX = 7, +struct iommu_gpasid_bind_data_vtd { + __u64 flags; + __u32 pat; + __u32 emt; }; -struct trampoline_header { - u64 start; - u64 efer; - u32 cr4; - u32 flags; +struct iommu_gpasid_bind_data { + __u32 version; + __u32 format; + __u64 flags; + __u64 gpgd; + __u64 hpasid; + __u64 gpasid; + __u32 addr_width; + __u8 padding[12]; + union { + struct iommu_gpasid_bind_data_vtd vtd; + }; }; -enum xfeature { - XFEATURE_FP = 0, - XFEATURE_SSE = 1, - XFEATURE_YMM = 2, - XFEATURE_BNDREGS = 3, - XFEATURE_BNDCSR = 4, - XFEATURE_OPMASK = 5, - XFEATURE_ZMM_Hi256 = 6, - XFEATURE_Hi16_ZMM = 7, - XFEATURE_PT_UNIMPLEMENTED_SO_FAR = 8, - XFEATURE_PKRU = 9, - XFEATURE_MAX = 10, +typedef int (*iommu_fault_handler_t)(struct iommu_domain *, struct device *, long unsigned int, int, void *); + +struct iommu_domain_geometry { + dma_addr_t aperture_start; + dma_addr_t aperture_end; + bool force_aperture; }; -struct pkru_state { - u32 pkru; - u32 pad; +struct iommu_domain { + unsigned int type; + const struct iommu_ops *ops; + long unsigned int pgsize_bitmap; + iommu_fault_handler_t handler; + void *handler_token; + struct iommu_domain_geometry geometry; + void *iova_cookie; }; -enum show_regs_mode { - SHOW_REGS_SHORT = 0, - SHOW_REGS_USER = 1, - SHOW_REGS_ALL = 2, +typedef int (*iommu_mm_exit_handler_t)(struct device *, struct iommu_sva *, void *); + +struct iommu_sva_ops; + +struct iommu_sva { + struct device *dev; + const struct iommu_sva_ops *ops; }; -enum which_selector { - FS = 0, - GS = 1, +typedef int (*iommu_dev_fault_handler_t)(struct iommu_fault *, void *); + +enum iommu_resv_type { + IOMMU_RESV_DIRECT = 0, + IOMMU_RESV_DIRECT_RELAXABLE = 1, + IOMMU_RESV_RESERVED = 2, + IOMMU_RESV_MSI = 3, + IOMMU_RESV_SW_MSI = 4, }; -struct sigcontext_64 { - __u64 r8; - __u64 r9; - __u64 r10; - __u64 r11; - __u64 r12; - __u64 r13; - __u64 r14; - __u64 r15; - __u64 di; - __u64 si; - __u64 bp; - __u64 bx; - __u64 dx; - __u64 ax; - __u64 cx; - __u64 sp; - __u64 ip; - __u64 flags; - __u16 cs; - __u16 gs; - __u16 fs; - __u16 ss; - __u64 err; - __u64 trapno; - __u64 oldmask; - __u64 cr2; - __u64 fpstate; - __u64 reserved1[8]; +struct iommu_resv_region { + struct list_head list; + phys_addr_t start; + size_t length; + int prot; + enum iommu_resv_type type; }; -struct sigaltstack { - void *ss_sp; - int ss_flags; - size_t ss_size; +struct iommu_sva_ops { + iommu_mm_exit_handler_t mm_exit; }; -typedef struct sigaltstack stack_t; +struct iommu_iotlb_gather { + long unsigned int start; + long unsigned int end; + size_t pgsize; +}; -struct siginfo { - union { - struct { - int si_signo; - int si_errno; - int si_code; - union __sifields _sifields; - }; - int _si_pad[32]; - }; +struct iommu_fault_event { + struct iommu_fault fault; + struct list_head list; }; -typedef struct siginfo siginfo_t; +struct iommu_fault_param { + iommu_dev_fault_handler_t handler; + void *data; + struct list_head faults; + struct mutex lock; +}; -struct ucontext { - long unsigned int uc_flags; - struct ucontext *uc_link; - stack_t uc_stack; - struct sigcontext_64 uc_mcontext; - sigset_t uc_sigmask; +struct iommu_table_entry { + initcall_t detect; + initcall_t depend; + void (*early_init)(); + void (*late_init)(); + int flags; +}; + +enum dmi_field { + DMI_NONE = 0, + DMI_BIOS_VENDOR = 1, + DMI_BIOS_VERSION = 2, + DMI_BIOS_DATE = 3, + DMI_SYS_VENDOR = 4, + DMI_PRODUCT_NAME = 5, + DMI_PRODUCT_VERSION = 6, + DMI_PRODUCT_SERIAL = 7, + DMI_PRODUCT_UUID = 8, + DMI_PRODUCT_SKU = 9, + DMI_PRODUCT_FAMILY = 10, + DMI_BOARD_VENDOR = 11, + DMI_BOARD_NAME = 12, + DMI_BOARD_VERSION = 13, + DMI_BOARD_SERIAL = 14, + DMI_BOARD_ASSET_TAG = 15, + DMI_CHASSIS_VENDOR = 16, + DMI_CHASSIS_TYPE = 17, + DMI_CHASSIS_VERSION = 18, + DMI_CHASSIS_SERIAL = 19, + DMI_CHASSIS_ASSET_TAG = 20, + DMI_STRING_MAX = 21, + DMI_OEM_STRING = 22, +}; + +enum { + NONE_FORCE_HPET_RESUME = 0, + OLD_ICH_FORCE_HPET_RESUME = 1, + ICH_FORCE_HPET_RESUME = 2, + VT8237_FORCE_HPET_RESUME = 3, + NVIDIA_FORCE_HPET_RESUME = 4, + ATI_FORCE_HPET_RESUME = 5, }; -typedef u32 compat_sigset_word; - -typedef struct { - compat_sigset_word sig[2]; -} compat_sigset_t; - -struct kernel_vm86_regs { - struct pt_regs pt; - short unsigned int es; - short unsigned int __esh; - short unsigned int ds; - short unsigned int __dsh; - short unsigned int fs; - short unsigned int __fsh; - short unsigned int gs; - short unsigned int __gsh; +struct cpu { + int node_id; + int hotpluggable; + struct device dev; }; -struct rt_sigframe { - char *pretcode; - struct ucontext uc; - struct siginfo info; +struct x86_cpu { + struct cpu cpu; }; -typedef s32 compat_clock_t; - -typedef s32 compat_pid_t; +struct debugfs_blob_wrapper { + void *data; + long unsigned int size; +}; -typedef s32 compat_timer_t; +struct setup_data_node { + u64 paddr; + u32 type; + u32 len; +}; -typedef s32 compat_int_t; +struct die_args { + struct pt_regs *regs; + const char *str; + long int err; + int trapnr; + int signr; +}; -typedef u32 __compat_uid32_t; +typedef struct { + struct mm_struct *mm; +} temp_mm_state_t; -union compat_sigval { - compat_int_t sival_int; - compat_uptr_t sival_ptr; +struct smp_alt_module { + struct module *mod; + char *name; + const s32 *locks; + const s32 *locks_end; + u8 *text; + u8 *text_end; + struct list_head next; }; -typedef union compat_sigval compat_sigval_t; - -struct compat_siginfo { - int si_signo; - int si_errno; - int si_code; - union { - int _pad[29]; - struct { - compat_pid_t _pid; - __compat_uid32_t _uid; - } _kill; - struct { - compat_timer_t _tid; - int _overrun; - compat_sigval_t _sigval; - } _timer; - struct { - compat_pid_t _pid; - __compat_uid32_t _uid; - compat_sigval_t _sigval; - } _rt; - struct { - compat_pid_t _pid; - __compat_uid32_t _uid; - int _status; - compat_clock_t _utime; - compat_clock_t _stime; - } _sigchld; - struct { - compat_uptr_t _addr; - union { - short int _addr_lsb; - struct { - char _dummy_bnd[4]; - compat_uptr_t _lower; - compat_uptr_t _upper; - } _addr_bnd; - struct { - char _dummy_pkey[4]; - u32 _pkey; - } _addr_pkey; - }; - } _sigfault; - struct { - compat_long_t _band; - int _fd; - } _sigpoll; - struct { - compat_uptr_t _call_addr; - int _syscall; - unsigned int _arch; - } _sigsys; - } _sifields; +struct bp_patching_desc { + struct text_poke_loc *vec; + int nr_entries; }; -typedef struct compat_siginfo compat_siginfo_t; +struct paravirt_patch_site; -enum bug_trap_type { - BUG_TRAP_TYPE_NONE = 0, - BUG_TRAP_TYPE_WARN = 1, - BUG_TRAP_TYPE_BUG = 2, +struct user_i387_struct { + short unsigned int cwd; + short unsigned int swd; + short unsigned int twd; + short unsigned int fop; + __u64 rip; + __u64 rdp; + __u32 mxcsr; + __u32 mxcsr_mask; + __u32 st_space[32]; + __u32 xmm_space[64]; + __u32 padding[24]; }; -struct idt_bits { - u16 ist: 3; - u16 zero: 5; - u16 type: 5; - u16 dpl: 2; - u16 p: 1; +struct user_regs_struct { + long unsigned int r15; + long unsigned int r14; + long unsigned int r13; + long unsigned int r12; + long unsigned int bp; + long unsigned int bx; + long unsigned int r11; + long unsigned int r10; + long unsigned int r9; + long unsigned int r8; + long unsigned int ax; + long unsigned int cx; + long unsigned int dx; + long unsigned int si; + long unsigned int di; + long unsigned int orig_ax; + long unsigned int ip; + long unsigned int cs; + long unsigned int flags; + long unsigned int sp; + long unsigned int ss; + long unsigned int fs_base; + long unsigned int gs_base; + long unsigned int ds; + long unsigned int es; + long unsigned int fs; + long unsigned int gs; }; -struct gate_struct { - u16 offset_low; - u16 segment; - struct idt_bits bits; - u16 offset_middle; - u32 offset_high; - u32 reserved; +struct user { + struct user_regs_struct regs; + int u_fpvalid; + int pad0; + struct user_i387_struct i387; + long unsigned int u_tsize; + long unsigned int u_dsize; + long unsigned int u_ssize; + long unsigned int start_code; + long unsigned int start_stack; + long int signal; + int reserved; + int pad1; + long unsigned int u_ar0; + struct user_i387_struct *u_fpstate; + long unsigned int magic; + char u_comm[32]; + long unsigned int u_debugreg[8]; + long unsigned int error_code; + long unsigned int fault_address; }; -typedef struct gate_struct gate_desc; - -struct mpx_bndcsr { - u64 bndcfgu; - u64 bndstatus; +enum { + HW_BREAKPOINT_LEN_1 = 1, + HW_BREAKPOINT_LEN_2 = 2, + HW_BREAKPOINT_LEN_3 = 3, + HW_BREAKPOINT_LEN_4 = 4, + HW_BREAKPOINT_LEN_5 = 5, + HW_BREAKPOINT_LEN_6 = 6, + HW_BREAKPOINT_LEN_7 = 7, + HW_BREAKPOINT_LEN_8 = 8, }; -enum die_val { - DIE_OOPS = 1, - DIE_INT3 = 2, - DIE_DEBUG = 3, - DIE_PANIC = 4, - DIE_NMI = 5, - DIE_DIE = 6, - DIE_KERNELDEBUG = 7, - DIE_TRAP = 8, - DIE_GPF = 9, - DIE_CALL = 10, - DIE_PAGE_FAULT = 11, - DIE_NMIUNKNOWN = 12, +enum { + HW_BREAKPOINT_EMPTY = 0, + HW_BREAKPOINT_R = 1, + HW_BREAKPOINT_W = 2, + HW_BREAKPOINT_RW = 3, + HW_BREAKPOINT_X = 4, + HW_BREAKPOINT_INVALID = 7, }; -struct bad_iret_stack { - void *error_entry_ret; - struct pt_regs regs; +typedef unsigned int u_int; + +typedef long long unsigned int cycles_t; + +struct system_counterval_t { + u64 cycles; + struct clocksource *cs; }; enum { - GATE_INTERRUPT = 14, - GATE_TRAP = 15, - GATE_CALL = 12, - GATE_TASK = 5, + WORK_STRUCT_PENDING_BIT = 0, + WORK_STRUCT_DELAYED_BIT = 1, + WORK_STRUCT_PWQ_BIT = 2, + WORK_STRUCT_LINKED_BIT = 3, + WORK_STRUCT_COLOR_SHIFT = 4, + WORK_STRUCT_COLOR_BITS = 4, + WORK_STRUCT_PENDING = 1, + WORK_STRUCT_DELAYED = 2, + WORK_STRUCT_PWQ = 4, + WORK_STRUCT_LINKED = 8, + WORK_STRUCT_STATIC = 0, + WORK_NR_COLORS = 15, + WORK_NO_COLOR = 15, + WORK_CPU_UNBOUND = 64, + WORK_STRUCT_FLAG_BITS = 8, + WORK_OFFQ_FLAG_BASE = 4, + __WORK_OFFQ_CANCELING = 4, + WORK_OFFQ_CANCELING = 16, + WORK_OFFQ_FLAG_BITS = 1, + WORK_OFFQ_POOL_SHIFT = 5, + WORK_OFFQ_LEFT = 59, + WORK_OFFQ_POOL_BITS = 31, + WORK_OFFQ_POOL_NONE = 2147483647, + WORK_STRUCT_FLAG_MASK = 255, + WORK_STRUCT_WQ_DATA_MASK = 4294967040, + WORK_STRUCT_NO_POOL = 4294967264, + WORK_BUSY_PENDING = 1, + WORK_BUSY_RUNNING = 2, + WORKER_DESC_LEN = 24, }; -struct idt_data { - unsigned int vector; - unsigned int segment; - struct idt_bits bits; - const void *addr; +struct cpufreq_freqs { + struct cpufreq_policy *policy; + unsigned int old; + unsigned int new; + u8 flags; }; -enum irqreturn { - IRQ_NONE = 0, - IRQ_HANDLED = 1, - IRQ_WAKE_THREAD = 2, +struct cyc2ns { + struct cyc2ns_data data[2]; + seqcount_t seq; }; -typedef enum irqreturn irqreturn_t; - -typedef irqreturn_t (*irq_handler_t)(int, void *); - -struct irqaction { - irq_handler_t handler; - void *dev_id; - void *percpu_dev_id; - struct irqaction *next; - irq_handler_t thread_fn; - struct task_struct *thread; - struct irqaction *secondary; - unsigned int irq; - unsigned int flags; - long unsigned int thread_flags; - long unsigned int thread_mask; - const char *name; - struct proc_dir_entry *dir; - long: 64; - long: 64; - long: 64; - long: 64; +struct freq_desc { + u8 msr_plat; + u32 freqs[9]; }; -struct irq_affinity_notify { - unsigned int irq; - struct kref kref; - struct work_struct work; - void (*notify)(struct irq_affinity_notify *, const cpumask_t *); - void (*release)(struct kref *); +struct dmi_strmatch { + unsigned char slot: 7; + unsigned char exact_match: 1; + char substr[79]; }; -enum irqchip_irq_state { - IRQCHIP_STATE_PENDING = 0, - IRQCHIP_STATE_ACTIVE = 1, - IRQCHIP_STATE_MASKED = 2, - IRQCHIP_STATE_LINE_LEVEL = 3, +struct dmi_system_id { + int (*callback)(const struct dmi_system_id *); + const char *ident; + struct dmi_strmatch matches[4]; + void *driver_data; }; -struct irq_desc; +struct pdev_archdata {}; -typedef void (*irq_flow_handler_t)(struct irq_desc *); +struct mfd_cell; -struct msi_desc; +struct platform_device_id; -struct irq_common_data { - unsigned int state_use_accessors; - unsigned int node; - void *handler_data; - struct msi_desc *msi_desc; - cpumask_var_t affinity; - cpumask_var_t effective_affinity; +struct platform_device { + const char *name; + int id; + bool id_auto; + struct device dev; + u64 dma_mask; + u32 num_resources; + struct resource *resource; + const struct platform_device_id *id_entry; + char *driver_override; + struct mfd_cell *mfd_cell; + struct pdev_archdata archdata; }; -struct irq_chip; - -struct irq_data { - u32 mask; - unsigned int irq; - long unsigned int hwirq; - struct irq_common_data *common; - struct irq_chip *chip; - struct irq_domain *domain; - struct irq_data *parent_data; - void *chip_data; +struct platform_device_id { + char name[20]; + kernel_ulong_t driver_data; }; -struct irq_desc { - struct irq_common_data irq_common_data; - struct irq_data irq_data; - unsigned int *kstat_irqs; - irq_flow_handler_t handle_irq; - struct irqaction *action; - unsigned int status_use_accessors; - unsigned int core_internal_state__do_not_mess_with_it; - unsigned int depth; - unsigned int wake_depth; - unsigned int tot_count; - unsigned int irq_count; - long unsigned int last_unhandled; - unsigned int irqs_unhandled; - atomic_t threads_handled; - int threads_handled_last; - raw_spinlock_t lock; - struct cpumask *percpu_enabled; - const struct cpumask *percpu_affinity; - const struct cpumask *affinity_hint; - struct irq_affinity_notify *affinity_notify; - cpumask_var_t pending_mask; - long unsigned int threads_oneshot; - atomic_t threads_active; - wait_queue_head_t wait_for_threads; - unsigned int nr_actions; - unsigned int no_suspend_depth; - unsigned int cond_suspend_depth; - unsigned int force_resume_depth; - struct proc_dir_entry *dir; - struct callback_head rcu; - struct kobject kobj; - struct mutex request_mutex; - int parent_irq; - struct module *owner; - const char *name; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct rtc_time { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; }; -struct msi_msg; +struct pnp_device_id { + __u8 id[8]; + kernel_ulong_t driver_data; +}; -struct irq_chip { - struct device *parent_device; - const char *name; - unsigned int (*irq_startup)(struct irq_data *); - void (*irq_shutdown)(struct irq_data *); - void (*irq_enable)(struct irq_data *); - void (*irq_disable)(struct irq_data *); - void (*irq_ack)(struct irq_data *); - void (*irq_mask)(struct irq_data *); - void (*irq_mask_ack)(struct irq_data *); - void (*irq_unmask)(struct irq_data *); - void (*irq_eoi)(struct irq_data *); - int (*irq_set_affinity)(struct irq_data *, const struct cpumask *, bool); - int (*irq_retrigger)(struct irq_data *); - int (*irq_set_type)(struct irq_data *, unsigned int); - int (*irq_set_wake)(struct irq_data *, unsigned int); - void (*irq_bus_lock)(struct irq_data *); - void (*irq_bus_sync_unlock)(struct irq_data *); - void (*irq_cpu_online)(struct irq_data *); - void (*irq_cpu_offline)(struct irq_data *); - void (*irq_suspend)(struct irq_data *); - void (*irq_resume)(struct irq_data *); - void (*irq_pm_shutdown)(struct irq_data *); - void (*irq_calc_mask)(struct irq_data *); - void (*irq_print_chip)(struct irq_data *, struct seq_file *); - int (*irq_request_resources)(struct irq_data *); - void (*irq_release_resources)(struct irq_data *); - void (*irq_compose_msi_msg)(struct irq_data *, struct msi_msg *); - void (*irq_write_msi_msg)(struct irq_data *, struct msi_msg *); - int (*irq_get_irqchip_state)(struct irq_data *, enum irqchip_irq_state, bool *); - int (*irq_set_irqchip_state)(struct irq_data *, enum irqchip_irq_state, bool); - int (*irq_set_vcpu_affinity)(struct irq_data *, void *); - void (*ipi_send_single)(struct irq_data *, unsigned int); - void (*ipi_send_mask)(struct irq_data *, const struct cpumask *); - int (*irq_nmi_setup)(struct irq_data *); - void (*irq_nmi_teardown)(struct irq_data *); - long unsigned int flags; +struct pnp_card_device_id { + __u8 id[8]; + kernel_ulong_t driver_data; + struct { + __u8 id[8]; + } devs[8]; }; -typedef struct irq_desc *vector_irq_t[256]; +struct pnp_protocol; -struct trace_event_raw_x86_irq_vector { - struct trace_entry ent; - int vector; - char __data[0]; +struct pnp_id; + +struct pnp_card { + struct device dev; + unsigned char number; + struct list_head global_list; + struct list_head protocol_list; + struct list_head devices; + struct pnp_protocol *protocol; + struct pnp_id *id; + char name[50]; + unsigned char pnpver; + unsigned char productver; + unsigned int serial; + unsigned char checksum; + struct proc_dir_entry *procdir; }; -struct trace_event_raw_vector_config { - struct trace_entry ent; - unsigned int irq; - unsigned int vector; - unsigned int cpu; - unsigned int apicdest; - char __data[0]; +struct pnp_dev; + +struct pnp_protocol { + struct list_head protocol_list; + char *name; + int (*get)(struct pnp_dev *); + int (*set)(struct pnp_dev *); + int (*disable)(struct pnp_dev *); + bool (*can_wakeup)(struct pnp_dev *); + int (*suspend)(struct pnp_dev *, pm_message_t); + int (*resume)(struct pnp_dev *); + unsigned char number; + struct device dev; + struct list_head cards; + struct list_head devices; }; -struct trace_event_raw_vector_mod { - struct trace_entry ent; - unsigned int irq; - unsigned int vector; - unsigned int cpu; - unsigned int prev_vector; - unsigned int prev_cpu; - char __data[0]; +struct pnp_id { + char id[8]; + struct pnp_id *next; }; -struct trace_event_raw_vector_reserve { - struct trace_entry ent; - unsigned int irq; - int ret; - char __data[0]; -}; +struct pnp_card_driver; -struct trace_event_raw_vector_alloc { - struct trace_entry ent; - unsigned int irq; - unsigned int vector; - bool reserved; - int ret; - char __data[0]; +struct pnp_card_link { + struct pnp_card *card; + struct pnp_card_driver *driver; + void *driver_data; + pm_message_t pm_state; }; -struct trace_event_raw_vector_alloc_managed { - struct trace_entry ent; - unsigned int irq; - unsigned int vector; - int ret; - char __data[0]; +struct pnp_driver { + char *name; + const struct pnp_device_id *id_table; + unsigned int flags; + int (*probe)(struct pnp_dev *, const struct pnp_device_id *); + void (*remove)(struct pnp_dev *); + void (*shutdown)(struct pnp_dev *); + int (*suspend)(struct pnp_dev *, pm_message_t); + int (*resume)(struct pnp_dev *); + struct device_driver driver; }; -struct trace_event_raw_vector_activate { - struct trace_entry ent; - unsigned int irq; - bool is_managed; - bool can_reserve; - bool reserve; - char __data[0]; +struct pnp_card_driver { + struct list_head global_list; + char *name; + const struct pnp_card_device_id *id_table; + unsigned int flags; + int (*probe)(struct pnp_card_link *, const struct pnp_card_device_id *); + void (*remove)(struct pnp_card_link *); + int (*suspend)(struct pnp_card_link *, pm_message_t); + int (*resume)(struct pnp_card_link *); + struct pnp_driver link; }; -struct trace_event_raw_vector_teardown { - struct trace_entry ent; - unsigned int irq; - bool is_managed; - bool has_reserved; - char __data[0]; +struct pnp_dev { + struct device dev; + u64 dma_mask; + unsigned int number; + int status; + struct list_head global_list; + struct list_head protocol_list; + struct list_head card_list; + struct list_head rdev_list; + struct pnp_protocol *protocol; + struct pnp_card *card; + struct pnp_driver *driver; + struct pnp_card_link *card_link; + struct pnp_id *id; + int active; + int capabilities; + unsigned int num_dependent_sets; + struct list_head resources; + struct list_head options; + char name[50]; + int flags; + struct proc_dir_entry *procent; + void *data; }; -struct trace_event_raw_vector_setup { - struct trace_entry ent; - unsigned int irq; - bool is_legacy; - int ret; - char __data[0]; -}; +struct sfi_rtc_table_entry { + u64 phys_addr; + u32 irq; +} __attribute__((packed)); -struct trace_event_raw_vector_free_moved { - struct trace_entry ent; - unsigned int irq; - unsigned int cpu; - unsigned int vector; - bool is_managed; - char __data[0]; +enum intel_mid_cpu_type { + INTEL_MID_CPU_CHIP_PENWELL = 2, + INTEL_MID_CPU_CHIP_CLOVERVIEW = 3, + INTEL_MID_CPU_CHIP_TANGIER = 4, }; -struct trace_event_data_offsets_x86_irq_vector {}; - -struct trace_event_data_offsets_vector_config {}; +enum intel_mid_timer_options { + INTEL_MID_TIMER_DEFAULT = 0, + INTEL_MID_TIMER_APBT_ONLY = 1, + INTEL_MID_TIMER_LAPIC_APBT = 2, +}; -struct trace_event_data_offsets_vector_mod {}; +typedef struct ldttss_desc tss_desc; -struct trace_event_data_offsets_vector_reserve {}; +enum idle_boot_override { + IDLE_NO_OVERRIDE = 0, + IDLE_HALT = 1, + IDLE_NOMWAIT = 2, + IDLE_POLL = 3, +}; -struct trace_event_data_offsets_vector_alloc {}; +enum tick_broadcast_mode { + TICK_BROADCAST_OFF = 0, + TICK_BROADCAST_ON = 1, + TICK_BROADCAST_FORCE = 2, +}; -struct trace_event_data_offsets_vector_alloc_managed {}; +enum tick_broadcast_state { + TICK_BROADCAST_EXIT = 0, + TICK_BROADCAST_ENTER = 1, +}; -struct trace_event_data_offsets_vector_activate {}; +struct cpuidle_state_usage { + long long unsigned int disable; + long long unsigned int usage; + u64 time_ns; + long long unsigned int above; + long long unsigned int below; + long long unsigned int s2idle_usage; + long long unsigned int s2idle_time; +}; -struct trace_event_data_offsets_vector_teardown {}; +struct cpuidle_driver_kobj; -struct trace_event_data_offsets_vector_setup {}; +struct cpuidle_state_kobj; -struct trace_event_data_offsets_vector_free_moved {}; +struct cpuidle_device_kobj; -struct irq_stack { - char stack[16384]; +struct cpuidle_device { + unsigned int registered: 1; + unsigned int enabled: 1; + unsigned int poll_time_limit: 1; + unsigned int cpu; + ktime_t next_hrtimer; + int last_state_idx; + u64 last_residency_ns; + u64 poll_limit_ns; + u64 forced_idle_latency_limit_ns; + struct cpuidle_state_usage states_usage[10]; + struct cpuidle_state_kobj *kobjs[10]; + struct cpuidle_driver_kobj *kobj_driver; + struct cpuidle_device_kobj *kobj_dev; + struct list_head device_list; }; -struct estack_pages { - u32 offs; - u16 size; - u16 type; +struct inactive_task_frame { + long unsigned int r15; + long unsigned int r14; + long unsigned int r13; + long unsigned int r12; + long unsigned int bx; + long unsigned int bp; + long unsigned int ret_addr; }; -struct arch_clocksource_data { - int vclock_mode; +struct fork_frame { + struct inactive_task_frame frame; + struct pt_regs regs; }; -struct clocksource { - u64 (*read)(struct clocksource *); - u64 mask; - u32 mult; - u32 shift; - u64 max_idle_ns; - u32 maxadj; - struct arch_clocksource_data archdata; - u64 max_cycles; - const char *name; - struct list_head list; - int rating; - int (*enable)(struct clocksource *); - void (*disable)(struct clocksource *); - long unsigned int flags; - void (*suspend)(struct clocksource *); - void (*resume)(struct clocksource *); - void (*mark_unstable)(struct clocksource *); - void (*tick_stable)(struct clocksource *); - struct list_head wd_list; - u64 cs_last; - u64 wd_last; - struct module *owner; +struct ssb_state { + struct ssb_state *shared_state; + raw_spinlock_t lock; + unsigned int disable_state; + long unsigned int local_state; }; -enum clock_event_state { - CLOCK_EVT_STATE_DETACHED = 0, - CLOCK_EVT_STATE_SHUTDOWN = 1, - CLOCK_EVT_STATE_PERIODIC = 2, - CLOCK_EVT_STATE_ONESHOT = 3, - CLOCK_EVT_STATE_ONESHOT_STOPPED = 4, +struct trace_event_raw_x86_fpu { + struct trace_entry ent; + struct fpu *fpu; + bool load_fpu; + u64 xfeatures; + u64 xcomp_bv; + char __data[0]; }; -struct clock_event_device { - void (*event_handler)(struct clock_event_device *); - int (*set_next_event)(long unsigned int, struct clock_event_device *); - int (*set_next_ktime)(ktime_t, struct clock_event_device *); - ktime_t next_event; - u64 max_delta_ns; - u64 min_delta_ns; - u32 mult; - u32 shift; - enum clock_event_state state_use_accessors; - unsigned int features; - long unsigned int retries; - int (*set_state_periodic)(struct clock_event_device *); - int (*set_state_oneshot)(struct clock_event_device *); - int (*set_state_oneshot_stopped)(struct clock_event_device *); - int (*set_state_shutdown)(struct clock_event_device *); - int (*tick_resume)(struct clock_event_device *); - void (*broadcast)(const struct cpumask *); - void (*suspend)(struct clock_event_device *); - void (*resume)(struct clock_event_device *); - long unsigned int min_delta_ticks; - long unsigned int max_delta_ticks; - const char *name; - int rating; - int irq; - int bound_on; - const struct cpumask *cpumask; - struct list_head list; - struct module *owner; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; -}; +struct trace_event_data_offsets_x86_fpu {}; -struct irq_affinity_desc { - struct cpumask mask; - unsigned int is_managed: 1; -}; +typedef void (*btf_trace_x86_fpu_before_save)(void *, struct fpu *); -struct msi_msg { - u32 address_lo; - u32 address_hi; - u32 data; -}; +typedef void (*btf_trace_x86_fpu_after_save)(void *, struct fpu *); -struct platform_msi_priv_data; +typedef void (*btf_trace_x86_fpu_before_restore)(void *, struct fpu *); -struct platform_msi_desc { - struct platform_msi_priv_data *msi_priv_data; - u16 msi_index; -}; +typedef void (*btf_trace_x86_fpu_after_restore)(void *, struct fpu *); -struct fsl_mc_msi_desc { - u16 msi_index; -}; +typedef void (*btf_trace_x86_fpu_regs_activated)(void *, struct fpu *); -struct ti_sci_inta_msi_desc { - u16 dev_index; -}; +typedef void (*btf_trace_x86_fpu_regs_deactivated)(void *, struct fpu *); -struct msi_desc { - struct list_head list; - unsigned int irq; - unsigned int nvec_used; - struct device *dev; - struct msi_msg msg; - struct irq_affinity_desc *affinity; - const void *iommu_cookie; - void (*write_msi_msg)(struct msi_desc *, void *); - void *write_msi_msg_data; - union { - struct { - u32 masked; - struct { - u8 is_msix: 1; - u8 multiple: 3; - u8 multi_cap: 3; - u8 maskbit: 1; - u8 is_64: 1; - u8 is_virtual: 1; - u16 entry_nr; - unsigned int default_irq; - } msi_attrib; - union { - u8 mask_pos; - void *mask_base; - }; - }; - struct platform_msi_desc platform; - struct fsl_mc_msi_desc fsl_mc; - struct ti_sci_inta_msi_desc inta; - }; -}; +typedef void (*btf_trace_x86_fpu_init_state)(void *, struct fpu *); -struct irq_chip_regs { - long unsigned int enable; - long unsigned int disable; - long unsigned int mask; - long unsigned int ack; - long unsigned int eoi; - long unsigned int type; - long unsigned int polarity; -}; +typedef void (*btf_trace_x86_fpu_dropped)(void *, struct fpu *); -struct irq_chip_type { - struct irq_chip chip; - struct irq_chip_regs regs; - irq_flow_handler_t handler; - u32 type; - u32 mask_cache_priv; - u32 *mask_cache; -}; +typedef void (*btf_trace_x86_fpu_copy_src)(void *, struct fpu *); -struct irq_chip_generic { - raw_spinlock_t lock; - void *reg_base; - u32 (*reg_readl)(void *); - void (*reg_writel)(u32, void *); - void (*suspend)(struct irq_chip_generic *); - void (*resume)(struct irq_chip_generic *); - unsigned int irq_base; - unsigned int irq_cnt; - u32 mask_cache; - u32 type_cache; - u32 polarity_cache; - u32 wake_enabled; - u32 wake_active; - unsigned int num_ct; - void *private; - long unsigned int installed; - long unsigned int unused; - struct irq_domain *domain; - struct list_head list; - struct irq_chip_type chip_types[0]; -}; +typedef void (*btf_trace_x86_fpu_copy_dst)(void *, struct fpu *); -enum irq_gc_flags { - IRQ_GC_INIT_MASK_CACHE = 1, - IRQ_GC_INIT_NESTED_LOCK = 2, - IRQ_GC_MASK_CACHE_PER_TYPE = 4, - IRQ_GC_NO_MASK = 8, - IRQ_GC_BE_IO = 16, -}; +typedef void (*btf_trace_x86_fpu_xstate_check_failed)(void *, struct fpu *); -struct irq_domain_chip_generic { - unsigned int irqs_per_chip; - unsigned int num_chips; - unsigned int irq_flags_to_clear; - unsigned int irq_flags_to_set; - enum irq_gc_flags gc_flags; - struct irq_chip_generic *gc[0]; -}; +typedef struct fpu *pto_T_____9; -struct legacy_pic { - int nr_legacy_irqs; - struct irq_chip *chip; - void (*mask)(unsigned int); - void (*unmask)(unsigned int); - void (*mask_all)(); - void (*restore_mask)(); - void (*init)(int); - int (*probe)(); - int (*irq_pending)(unsigned int); - void (*make_irq)(unsigned int); +struct _fpreg { + __u16 significand[4]; + __u16 exponent; }; -enum refcount_saturation_type { - REFCOUNT_ADD_NOT_ZERO_OVF = 0, - REFCOUNT_ADD_OVF = 1, - REFCOUNT_ADD_UAF = 2, - REFCOUNT_SUB_UAF = 3, - REFCOUNT_DEC_LEAK = 4, +struct _fpxreg { + __u16 significand[4]; + __u16 exponent; + __u16 padding[3]; }; -enum lockdown_reason { - LOCKDOWN_NONE = 0, - LOCKDOWN_MODULE_SIGNATURE = 1, - LOCKDOWN_DEV_MEM = 2, - LOCKDOWN_EFI_TEST = 3, - LOCKDOWN_KEXEC = 4, - LOCKDOWN_HIBERNATION = 5, - LOCKDOWN_PCI_ACCESS = 6, - LOCKDOWN_IOPORT = 7, - LOCKDOWN_MSR = 8, - LOCKDOWN_ACPI_TABLES = 9, - LOCKDOWN_PCMCIA_CIS = 10, - LOCKDOWN_TIOCSSERIAL = 11, - LOCKDOWN_MODULE_PARAMETERS = 12, - LOCKDOWN_MMIOTRACE = 13, - LOCKDOWN_DEBUGFS = 14, - LOCKDOWN_XMON_WR = 15, - LOCKDOWN_INTEGRITY_MAX = 16, - LOCKDOWN_KCORE = 17, - LOCKDOWN_KPROBES = 18, - LOCKDOWN_BPF_READ = 19, - LOCKDOWN_PERF = 20, - LOCKDOWN_TRACEFS = 21, - LOCKDOWN_XMON_RW = 22, - LOCKDOWN_CONFIDENTIALITY_MAX = 23, +struct user_i387_ia32_struct { + u32 cwd; + u32 swd; + u32 twd; + u32 fip; + u32 fcs; + u32 foo; + u32 fos; + u32 st_space[20]; }; -enum lockdep_ok { - LOCKDEP_STILL_OK = 0, - LOCKDEP_NOW_UNRELIABLE = 1, -}; +struct user_regset; -typedef long unsigned int uintptr_t; +typedef int user_regset_active_fn(struct task_struct *, const struct user_regset *); -typedef u64 uint64_t; +typedef int user_regset_get_fn(struct task_struct *, const struct user_regset *, unsigned int, unsigned int, void *, void *); -struct trace_event_raw_nmi_handler { - struct trace_entry ent; - void *handler; - s64 delta_ns; - int handled; - char __data[0]; -}; +typedef int user_regset_set_fn(struct task_struct *, const struct user_regset *, unsigned int, unsigned int, const void *, const void *); -struct trace_event_data_offsets_nmi_handler {}; +typedef int user_regset_writeback_fn(struct task_struct *, const struct user_regset *, int); -struct nmi_desc { - raw_spinlock_t lock; - struct list_head head; -}; +typedef unsigned int user_regset_get_size_fn(struct task_struct *, const struct user_regset *); -struct nmi_stats { - unsigned int normal; - unsigned int unknown; - unsigned int external; - unsigned int swallow; +struct user_regset { + user_regset_get_fn *get; + user_regset_set_fn *set; + user_regset_active_fn *active; + user_regset_writeback_fn *writeback; + user_regset_get_size_fn *get_size; + unsigned int n; + unsigned int size; + unsigned int align; + unsigned int bias; + unsigned int core_note_type; }; -enum nmi_states { - NMI_NOT_RUNNING = 0, - NMI_EXECUTING = 1, - NMI_LATCHED = 2, +struct _fpx_sw_bytes { + __u32 magic1; + __u32 extended_size; + __u64 xfeatures; + __u32 xstate_size; + __u32 padding[7]; }; -typedef unsigned int pao_T_____2; - -typedef enum nmi_states pto_T_____2; - -typedef int pto_T_____3; - -enum { - DESC_TSS = 9, - DESC_LDT = 2, - DESCTYPE_S = 16, +struct _xmmreg { + __u32 element[4]; }; -struct ldttss_desc { - u16 limit0; - u16 base0; - u16 base1: 8; - u16 type: 5; - u16 dpl: 2; - u16 p: 1; - u16 limit1: 4; - u16 zero0: 3; - u16 g: 1; - u16 base2: 8; - u32 base3; - u32 zero1; +struct _fpstate_32 { + __u32 cw; + __u32 sw; + __u32 tag; + __u32 ipoff; + __u32 cssel; + __u32 dataoff; + __u32 datasel; + struct _fpreg _st[8]; + __u16 status; + __u16 magic; + __u32 _fxsr_env[6]; + __u32 mxcsr; + __u32 reserved; + struct _fpxreg _fxsr_st[8]; + struct _xmmreg _xmm[8]; + union { + __u32 padding1[44]; + __u32 padding[44]; + }; + union { + __u32 padding2[12]; + struct _fpx_sw_bytes sw_reserved; + }; }; -typedef struct ldttss_desc ldt_desc; +typedef u32 compat_ulong_t; -struct user_desc { - unsigned int entry_number; - unsigned int base_addr; - unsigned int limit; - unsigned int seg_32bit: 1; - unsigned int contents: 2; - unsigned int read_exec_only: 1; - unsigned int limit_in_pages: 1; - unsigned int seg_not_present: 1; - unsigned int useable: 1; - unsigned int lm: 1; +struct user_regset_view { + const char *name; + const struct user_regset *regsets; + unsigned int n; + u32 e_flags; + u16 e_machine; + u8 ei_osabi; }; -struct mmu_gather_batch { - struct mmu_gather_batch *next; - unsigned int nr; - unsigned int max; - struct page *pages[0]; +enum x86_regset { + REGSET_GENERAL = 0, + REGSET_FP = 1, + REGSET_XFP = 2, + REGSET_IOPERM64 = 2, + REGSET_XSTATE = 3, + REGSET_TLS = 4, + REGSET_IOPERM32 = 5, }; -struct mmu_gather { - struct mm_struct *mm; - long unsigned int start; - long unsigned int end; - unsigned int fullmm: 1; - unsigned int need_flush_all: 1; - unsigned int freed_tables: 1; - unsigned int cleared_ptes: 1; - unsigned int cleared_pmds: 1; - unsigned int cleared_puds: 1; - unsigned int cleared_p4ds: 1; - unsigned int vma_exec: 1; - unsigned int vma_huge: 1; - unsigned int batch_count; - struct mmu_gather_batch *active; - struct mmu_gather_batch local; - struct page *__pages[8]; +struct pt_regs_offset { + const char *name; + int offset; }; -struct setup_data { - __u64 next; - __u32 type; - __u32 len; - __u8 data[0]; -}; +typedef bool (*stack_trace_consume_fn)(void *, long unsigned int, bool); -struct setup_indirect { - __u32 type; - __u32 reserved; - __u64 len; - __u64 addr; +struct stack_frame_user { + const void *next_fp; + long unsigned int ret_addr; }; -struct plist_head { - struct list_head node_list; +enum cache_type { + CACHE_TYPE_NOCACHE = 0, + CACHE_TYPE_INST = 1, + CACHE_TYPE_DATA = 2, + CACHE_TYPE_SEPARATE = 3, + CACHE_TYPE_UNIFIED = 4, }; -struct atomic_notifier_head { - spinlock_t lock; - struct notifier_block *head; +struct cacheinfo { + unsigned int id; + enum cache_type type; + unsigned int level; + unsigned int coherency_line_size; + unsigned int number_of_sets; + unsigned int ways_of_associativity; + unsigned int physical_line_partition; + unsigned int size; + cpumask_t shared_cpu_map; + unsigned int attributes; + void *fw_token; + bool disable_sysfs; + void *priv; }; -struct blocking_notifier_head { - struct rw_semaphore rwsem; - struct notifier_block *head; +struct cpu_cacheinfo { + struct cacheinfo *info_list; + unsigned int num_levels; + unsigned int num_leaves; + bool cpu_map_populated; }; -enum pm_qos_type { - PM_QOS_UNITIALIZED = 0, - PM_QOS_MAX = 1, - PM_QOS_MIN = 2, - PM_QOS_SUM = 3, +struct amd_l3_cache { + unsigned int indices; + u8 subcaches[4]; }; -struct pm_qos_constraints { - struct plist_head list; - s32 target_value; - s32 default_value; - s32 no_constraint_value; - enum pm_qos_type type; - struct blocking_notifier_head *notifiers; +struct threshold_block { + unsigned int block; + unsigned int bank; + unsigned int cpu; + u32 address; + u16 interrupt_enable; + bool interrupt_capable; + u16 threshold_limit; + struct kobject kobj; + struct list_head miscj; }; -struct freq_constraints { - struct pm_qos_constraints min_freq; - struct blocking_notifier_head min_freq_notifiers; - struct pm_qos_constraints max_freq; - struct blocking_notifier_head max_freq_notifiers; +struct threshold_bank { + struct kobject *kobj; + struct threshold_block *blocks; + refcount_t cpus; }; -struct pm_qos_flags { - struct list_head list; - s32 effective_flags; +struct amd_northbridge { + struct pci_dev *root; + struct pci_dev *misc; + struct pci_dev *link; + struct amd_l3_cache l3_cache; + struct threshold_bank *bank4; }; -struct dev_pm_qos_request; - -struct dev_pm_qos { - struct pm_qos_constraints resume_latency; - struct pm_qos_constraints latency_tolerance; - struct freq_constraints freq; - struct pm_qos_flags flags; - struct dev_pm_qos_request *resume_latency_req; - struct dev_pm_qos_request *latency_tolerance_req; - struct dev_pm_qos_request *flags_req; +struct cpu_dev { + const char *c_vendor; + const char *c_ident[2]; + void (*c_early_init)(struct cpuinfo_x86 *); + void (*c_bsp_init)(struct cpuinfo_x86 *); + void (*c_init)(struct cpuinfo_x86 *); + void (*c_identify)(struct cpuinfo_x86 *); + void (*c_detect_tlb)(struct cpuinfo_x86 *); + int c_x86_vendor; }; -enum con_scroll { - SM_UP = 0, - SM_DOWN = 1, +enum tsx_ctrl_states { + TSX_CTRL_ENABLE = 0, + TSX_CTRL_DISABLE = 1, + TSX_CTRL_NOT_SUPPORTED = 2, }; -struct vc_data; +struct _cache_table { + unsigned char descriptor; + char cache_type; + short int size; +}; -struct console_font; +enum _cache_type { + CTYPE_NULL = 0, + CTYPE_DATA = 1, + CTYPE_INST = 2, + CTYPE_UNIFIED = 3, +}; -struct consw { - struct module *owner; - const char * (*con_startup)(); - void (*con_init)(struct vc_data *, int); - void (*con_deinit)(struct vc_data *); - void (*con_clear)(struct vc_data *, int, int, int, int); - void (*con_putc)(struct vc_data *, int, int, int); - void (*con_putcs)(struct vc_data *, const short unsigned int *, int, int, int); - void (*con_cursor)(struct vc_data *, int); - bool (*con_scroll)(struct vc_data *, unsigned int, unsigned int, enum con_scroll, unsigned int); - int (*con_switch)(struct vc_data *); - int (*con_blank)(struct vc_data *, int, int); - int (*con_font_set)(struct vc_data *, struct console_font *, unsigned int); - int (*con_font_get)(struct vc_data *, struct console_font *); - int (*con_font_default)(struct vc_data *, struct console_font *, char *); - int (*con_font_copy)(struct vc_data *, int); - int (*con_resize)(struct vc_data *, unsigned int, unsigned int, unsigned int); - void (*con_set_palette)(struct vc_data *, const unsigned char *); - void (*con_scrolldelta)(struct vc_data *, int); - int (*con_set_origin)(struct vc_data *); - void (*con_save_screen)(struct vc_data *); - u8 (*con_build_attr)(struct vc_data *, u8, u8, u8, u8, u8, u8); - void (*con_invert_region)(struct vc_data *, u16 *, int); - u16 * (*con_screen_pos)(struct vc_data *, int); - long unsigned int (*con_getxy)(struct vc_data *, long unsigned int, int *, int *); - void (*con_flush_scrollback)(struct vc_data *); - int (*con_debug_enter)(struct vc_data *); - int (*con_debug_leave)(struct vc_data *); +union _cpuid4_leaf_eax { + struct { + enum _cache_type type: 5; + unsigned int level: 3; + unsigned int is_self_initializing: 1; + unsigned int is_fully_associative: 1; + unsigned int reserved: 4; + unsigned int num_threads_sharing: 12; + unsigned int num_cores_on_die: 6; + } split; + u32 full; }; -enum efi_secureboot_mode { - efi_secureboot_mode_unset = 0, - efi_secureboot_mode_unknown = 1, - efi_secureboot_mode_disabled = 2, - efi_secureboot_mode_enabled = 3, +union _cpuid4_leaf_ebx { + struct { + unsigned int coherency_line_size: 12; + unsigned int physical_line_partition: 10; + unsigned int ways_of_associativity: 10; + } split; + u32 full; }; -enum xen_domain_type { - XEN_NATIVE = 0, - XEN_PV_DOMAIN = 1, - XEN_HVM_DOMAIN = 2, +union _cpuid4_leaf_ecx { + struct { + unsigned int number_of_sets: 32; + } split; + u32 full; }; -struct pm_qos_flags_request { - struct list_head node; - s32 flags; +struct _cpuid4_info_regs { + union _cpuid4_leaf_eax eax; + union _cpuid4_leaf_ebx ebx; + union _cpuid4_leaf_ecx ecx; + unsigned int id; + long unsigned int size; + struct amd_northbridge *nb; }; -enum freq_qos_req_type { - FREQ_QOS_MIN = 1, - FREQ_QOS_MAX = 2, +union l1_cache { + struct { + unsigned int line_size: 8; + unsigned int lines_per_tag: 8; + unsigned int assoc: 8; + unsigned int size_in_kb: 8; + }; + unsigned int val; }; -struct freq_qos_request { - enum freq_qos_req_type type; - struct plist_node pnode; - struct freq_constraints *qos; +union l2_cache { + struct { + unsigned int line_size: 8; + unsigned int lines_per_tag: 4; + unsigned int assoc: 4; + unsigned int size_in_kb: 16; + }; + unsigned int val; }; -enum dev_pm_qos_req_type { - DEV_PM_QOS_RESUME_LATENCY = 1, - DEV_PM_QOS_LATENCY_TOLERANCE = 2, - DEV_PM_QOS_MIN_FREQUENCY = 3, - DEV_PM_QOS_MAX_FREQUENCY = 4, - DEV_PM_QOS_FLAGS = 5, +union l3_cache { + struct { + unsigned int line_size: 8; + unsigned int lines_per_tag: 4; + unsigned int assoc: 4; + unsigned int res: 2; + unsigned int size_encoded: 14; + }; + unsigned int val; }; -struct dev_pm_qos_request { - enum dev_pm_qos_req_type type; - union { - struct plist_node pnode; - struct pm_qos_flags_request flr; - struct freq_qos_request freq; - } data; - struct device *dev; +struct cpuid_bit { + u16 feature; + u8 reg; + u8 bit; + u32 level; + u32 sub_leaf; }; -enum e820_type { - E820_TYPE_RAM = 1, - E820_TYPE_RESERVED = 2, - E820_TYPE_ACPI = 3, - E820_TYPE_NVS = 4, - E820_TYPE_UNUSABLE = 5, - E820_TYPE_PMEM = 7, - E820_TYPE_PRAM = 12, - E820_TYPE_SOFT_RESERVED = -268435457, - E820_TYPE_RESERVED_KERN = 128, +enum cpuid_leafs { + CPUID_1_EDX = 0, + CPUID_8000_0001_EDX = 1, + CPUID_8086_0001_EDX = 2, + CPUID_LNX_1 = 3, + CPUID_1_ECX = 4, + CPUID_C000_0001_EDX = 5, + CPUID_8000_0001_ECX = 6, + CPUID_LNX_2 = 7, + CPUID_LNX_3 = 8, + CPUID_7_0_EBX = 9, + CPUID_D_1_EAX = 10, + CPUID_LNX_4 = 11, + CPUID_7_1_EAX = 12, + CPUID_8000_0008_EBX = 13, + CPUID_6_EAX = 14, + CPUID_8000_000A_EDX = 15, + CPUID_7_ECX = 16, + CPUID_8000_0007_EBX = 17, + CPUID_7_EDX = 18, }; -struct e820_entry { - u64 addr; - u64 size; - enum e820_type type; -} __attribute__((packed)); +struct cpuid_dependent_feature { + u32 feature; + u32 level; +}; -struct e820_table { - __u32 nr_entries; - struct e820_entry entries[320]; -} __attribute__((packed)); +typedef u32 pao_T_____3; -struct x86_cpuinit_ops { - void (*setup_percpu_clockev)(); - void (*early_percpu_clock_init)(); - void (*fixup_cpu_id)(struct cpuinfo_x86 *, int); +enum spectre_v2_mitigation { + SPECTRE_V2_NONE = 0, + SPECTRE_V2_RETPOLINE_GENERIC = 1, + SPECTRE_V2_RETPOLINE_AMD = 2, + SPECTRE_V2_IBRS_ENHANCED = 3, }; -struct x86_msi_ops { - int (*setup_msi_irqs)(struct pci_dev *, int, int); - void (*teardown_msi_irq)(unsigned int); - void (*teardown_msi_irqs)(struct pci_dev *); - void (*restore_msi_irqs)(struct pci_dev *); +enum spectre_v2_user_mitigation { + SPECTRE_V2_USER_NONE = 0, + SPECTRE_V2_USER_STRICT = 1, + SPECTRE_V2_USER_STRICT_PREFERRED = 2, + SPECTRE_V2_USER_PRCTL = 3, + SPECTRE_V2_USER_SECCOMP = 4, }; -struct msi_controller { - struct module *owner; - struct device *dev; - struct device_node *of_node; - struct list_head list; - int (*setup_irq)(struct msi_controller *, struct pci_dev *, struct msi_desc *); - int (*setup_irqs)(struct msi_controller *, struct pci_dev *, int, int); - void (*teardown_irq)(struct msi_controller *, unsigned int); +enum ssb_mitigation { + SPEC_STORE_BYPASS_NONE = 0, + SPEC_STORE_BYPASS_DISABLE = 1, + SPEC_STORE_BYPASS_PRCTL = 2, + SPEC_STORE_BYPASS_SECCOMP = 3, }; -enum jump_label_type { - JUMP_LABEL_NOP = 0, - JUMP_LABEL_JMP = 1, +enum mds_mitigations { + MDS_MITIGATION_OFF = 0, + MDS_MITIGATION_FULL = 1, + MDS_MITIGATION_VMWERV = 2, }; -struct text_poke_loc { - void *addr; - int len; - s32 rel32; - u8 opcode; - u8 text[5]; +enum taa_mitigations { + TAA_MITIGATION_OFF = 0, + TAA_MITIGATION_UCODE_NEEDED = 1, + TAA_MITIGATION_VERW = 2, + TAA_MITIGATION_TSX_DISABLED = 3, }; -union jump_code_union { - char code[5]; - struct { - char jump; - int offset; - } __attribute__((packed)); +enum vmx_l1d_flush_state { + VMENTER_L1D_FLUSH_AUTO = 0, + VMENTER_L1D_FLUSH_NEVER = 1, + VMENTER_L1D_FLUSH_COND = 2, + VMENTER_L1D_FLUSH_ALWAYS = 3, + VMENTER_L1D_FLUSH_EPT_DISABLED = 4, + VMENTER_L1D_FLUSH_NOT_REQUIRED = 5, }; -enum { - JL_STATE_START = 0, - JL_STATE_NO_UPDATE = 1, - JL_STATE_UPDATE = 2, +enum x86_hypervisor_type { + X86_HYPER_NATIVE = 0, + X86_HYPER_VMWARE = 1, + X86_HYPER_MS_HYPERV = 2, + X86_HYPER_XEN_PV = 3, + X86_HYPER_XEN_HVM = 4, + X86_HYPER_KVM = 5, + X86_HYPER_JAILHOUSE = 6, + X86_HYPER_ACRN = 7, }; -struct vm_unmapped_area_info { - long unsigned int flags; - long unsigned int length; - long unsigned int low_limit; - long unsigned int high_limit; - long unsigned int align_mask; - long unsigned int align_offset; +enum spectre_v1_mitigation { + SPECTRE_V1_MITIGATION_NONE = 0, + SPECTRE_V1_MITIGATION_AUTO = 1, }; -enum align_flags { - ALIGN_VA_32 = 1, - ALIGN_VA_64 = 2, +enum spectre_v2_mitigation_cmd { + SPECTRE_V2_CMD_NONE = 0, + SPECTRE_V2_CMD_AUTO = 1, + SPECTRE_V2_CMD_FORCE = 2, + SPECTRE_V2_CMD_RETPOLINE = 3, + SPECTRE_V2_CMD_RETPOLINE_GENERIC = 4, + SPECTRE_V2_CMD_RETPOLINE_AMD = 5, }; -struct va_alignment { - int flags; - long unsigned int mask; - long unsigned int bits; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +enum spectre_v2_user_cmd { + SPECTRE_V2_USER_CMD_NONE = 0, + SPECTRE_V2_USER_CMD_AUTO = 1, + SPECTRE_V2_USER_CMD_FORCE = 2, + SPECTRE_V2_USER_CMD_PRCTL = 3, + SPECTRE_V2_USER_CMD_PRCTL_IBPB = 4, + SPECTRE_V2_USER_CMD_SECCOMP = 5, + SPECTRE_V2_USER_CMD_SECCOMP_IBPB = 6, }; -enum { - MEMREMAP_WB = 1, - MEMREMAP_WT = 2, - MEMREMAP_WC = 4, - MEMREMAP_ENC = 8, - MEMREMAP_DEC = 16, +enum ssb_mitigation_cmd { + SPEC_STORE_BYPASS_CMD_NONE = 0, + SPEC_STORE_BYPASS_CMD_AUTO = 1, + SPEC_STORE_BYPASS_CMD_ON = 2, + SPEC_STORE_BYPASS_CMD_PRCTL = 3, + SPEC_STORE_BYPASS_CMD_SECCOMP = 4, }; -typedef void (*swap_func_t)(void *, void *, int); - -typedef int (*cmp_func_t)(const void *, const void *); +enum hk_flags { + HK_FLAG_TIMER = 1, + HK_FLAG_RCU = 2, + HK_FLAG_MISC = 4, + HK_FLAG_SCHED = 8, + HK_FLAG_TICK = 16, + HK_FLAG_DOMAIN = 32, + HK_FLAG_WQ = 64, +}; -enum { - IORES_DESC_NONE = 0, - IORES_DESC_CRASH_KERNEL = 1, - IORES_DESC_ACPI_TABLES = 2, - IORES_DESC_ACPI_NV_STORAGE = 3, - IORES_DESC_PERSISTENT_MEMORY = 4, - IORES_DESC_PERSISTENT_MEMORY_LEGACY = 5, - IORES_DESC_DEVICE_PRIVATE_MEMORY = 6, - IORES_DESC_RESERVED = 7, - IORES_DESC_SOFT_RESERVED = 8, +struct aperfmperf_sample { + unsigned int khz; + ktime_t time; + u64 aperf; + u64 mperf; }; -struct change_member { - struct e820_entry *entry; - long long unsigned int addr; +struct cpuid_dep { + unsigned int feature; + unsigned int depends; }; -struct iommu_fwspec { - const struct iommu_ops *ops; - struct fwnode_handle *iommu_fwnode; - void *iommu_priv; - u32 flags; - unsigned int num_ids; - u32 ids[1]; +struct _tlb_table { + unsigned char descriptor; + char tlb_type; + unsigned int entries; + char info[128]; }; -struct iommu_fault_param; - -struct iommu_param { - struct mutex lock; - struct iommu_fault_param *fault_param; +struct sku_microcode { + u8 model; + u8 stepping; + u32 microcode; }; -struct of_phandle_args { - struct device_node *np; - int args_count; - uint32_t args[16]; +struct cpuid_regs { + u32 eax; + u32 ebx; + u32 ecx; + u32 edx; }; -struct iommu_fault_unrecoverable { - __u32 reason; - __u32 flags; - __u32 pasid; - __u32 perm; - __u64 addr; - __u64 fetch_addr; +enum pconfig_target { + INVALID_TARGET = 0, + MKTME_TARGET = 1, + PCONFIG_TARGET_NR = 2, }; -struct iommu_fault_page_request { - __u32 flags; - __u32 pasid; - __u32 grpid; - __u32 perm; - __u64 addr; - __u64 private_data[2]; +enum { + PCONFIG_CPUID_SUBLEAF_INVALID = 0, + PCONFIG_CPUID_SUBLEAF_TARGETID = 1, }; -struct iommu_fault { - __u32 type; - __u32 padding; - union { - struct iommu_fault_unrecoverable event; - struct iommu_fault_page_request prm; - __u8 padding2[56]; - }; -}; +typedef u8 pto_T_____10; -struct iommu_page_response { - __u32 version; - __u32 flags; - __u32 pasid; - __u32 grpid; - __u32 code; +enum mf_flags { + MF_COUNT_INCREASED = 1, + MF_ACTION_REQUIRED = 2, + MF_MUST_KILL = 4, + MF_SOFT_OFFLINE = 8, }; -struct iommu_inv_addr_info { - __u32 flags; - __u32 archid; - __u64 pasid; - __u64 addr; - __u64 granule_size; - __u64 nb_granules; +enum mce_notifier_prios { + MCE_PRIO_FIRST = 2147483647, + MCE_PRIO_SRAO = 2147483646, + MCE_PRIO_EXTLOG = 2147483645, + MCE_PRIO_NFIT = 2147483644, + MCE_PRIO_EDAC = 2147483643, + MCE_PRIO_MCELOG = 1, + MCE_PRIO_LOWEST = 0, }; -struct iommu_inv_pasid_info { - __u32 flags; - __u32 archid; - __u64 pasid; +enum mcp_flags { + MCP_TIMESTAMP = 1, + MCP_UC = 2, + MCP_DONTLOG = 4, }; -struct iommu_cache_invalidate_info { - __u32 version; - __u8 cache; - __u8 granularity; - __u8 padding[2]; - union { - struct iommu_inv_pasid_info pasid_info; - struct iommu_inv_addr_info addr_info; - }; +enum severity_level { + MCE_NO_SEVERITY = 0, + MCE_DEFERRED_SEVERITY = 1, + MCE_UCNA_SEVERITY = 1, + MCE_KEEP_SEVERITY = 2, + MCE_SOME_SEVERITY = 3, + MCE_AO_SEVERITY = 4, + MCE_UC_SEVERITY = 5, + MCE_AR_SEVERITY = 6, + MCE_PANIC_SEVERITY = 7, }; -struct iommu_gpasid_bind_data_vtd { - __u64 flags; - __u32 pat; - __u32 emt; +struct mce_evt_llist { + struct llist_node llnode; + struct mce mce; }; -struct iommu_gpasid_bind_data { - __u32 version; - __u32 format; - __u64 flags; - __u64 gpgd; - __u64 hpasid; - __u64 gpasid; - __u32 addr_width; - __u8 padding[12]; - union { - struct iommu_gpasid_bind_data_vtd vtd; - }; +struct mca_config { + bool dont_log_ce; + bool cmci_disabled; + bool ignore_ce; + __u64 lmce_disabled: 1; + __u64 disabled: 1; + __u64 ser: 1; + __u64 recovery: 1; + __u64 bios_cmci_threshold: 1; + long: 35; + __u64 __reserved: 59; + s8 bootlog; + int tolerant; + int monarch_timeout; + int panic_timeout; + u32 rip_msr; }; -typedef int (*iommu_fault_handler_t)(struct iommu_domain *, struct device *, long unsigned int, int, void *); +struct mce_vendor_flags { + __u64 overflow_recov: 1; + __u64 succor: 1; + __u64 smca: 1; + __u64 __reserved_0: 61; +}; -struct iommu_domain_geometry { - dma_addr_t aperture_start; - dma_addr_t aperture_end; - bool force_aperture; +struct mca_msr_regs { + u32 (*ctl)(int); + u32 (*status)(int); + u32 (*addr)(int); + u32 (*misc)(int); }; -struct iommu_domain { - unsigned int type; - const struct iommu_ops *ops; - long unsigned int pgsize_bitmap; - iommu_fault_handler_t handler; - void *handler_token; - struct iommu_domain_geometry geometry; - void *iova_cookie; +struct trace_event_raw_mce_record { + struct trace_entry ent; + u64 mcgcap; + u64 mcgstatus; + u64 status; + u64 addr; + u64 misc; + u64 synd; + u64 ipid; + u64 ip; + u64 tsc; + u64 walltime; + u32 cpu; + u32 cpuid; + u32 apicid; + u32 socketid; + u8 cs; + u8 bank; + u8 cpuvendor; + char __data[0]; }; -typedef int (*iommu_mm_exit_handler_t)(struct device *, struct iommu_sva *, void *); +struct trace_event_data_offsets_mce_record {}; -struct iommu_sva_ops; +typedef void (*btf_trace_mce_record)(void *, struct mce *); -struct iommu_sva { - struct device *dev; - const struct iommu_sva_ops *ops; +struct mce_bank { + u64 ctl; + bool init; }; -typedef int (*iommu_dev_fault_handler_t)(struct iommu_fault *, void *); - -enum iommu_resv_type { - IOMMU_RESV_DIRECT = 0, - IOMMU_RESV_DIRECT_RELAXABLE = 1, - IOMMU_RESV_RESERVED = 2, - IOMMU_RESV_MSI = 3, - IOMMU_RESV_SW_MSI = 4, +struct mce_bank_dev { + struct device_attribute attr; + char attrname[16]; + u8 bank; }; -struct iommu_resv_region { - struct list_head list; - phys_addr_t start; - size_t length; - int prot; - enum iommu_resv_type type; -}; +typedef unsigned int pto_T_____11; -struct iommu_sva_ops { - iommu_mm_exit_handler_t mm_exit; +enum context { + IN_KERNEL = 1, + IN_USER = 2, + IN_KERNEL_RECOV = 3, }; -struct iommu_iotlb_gather { - long unsigned int start; - long unsigned int end; - size_t pgsize; +enum ser { + SER_REQUIRED = 1, + NO_SER = 2, }; -struct iommu_fault_event { - struct iommu_fault fault; - struct list_head list; +enum exception { + EXCP_CONTEXT = 1, + NO_EXCP = 2, }; -struct iommu_fault_param { - iommu_dev_fault_handler_t handler; - void *data; - struct list_head faults; - struct mutex lock; +struct severity { + u64 mask; + u64 result; + unsigned char sev; + unsigned char mcgmask; + unsigned char mcgres; + unsigned char ser; + unsigned char context; + unsigned char excp; + unsigned char covered; + char *msg; }; -struct iommu_table_entry { - initcall_t detect; - initcall_t depend; - void (*early_init)(); - void (*late_init)(); - int flags; -}; +struct gen_pool; -enum dmi_field { - DMI_NONE = 0, - DMI_BIOS_VENDOR = 1, - DMI_BIOS_VERSION = 2, - DMI_BIOS_DATE = 3, - DMI_SYS_VENDOR = 4, - DMI_PRODUCT_NAME = 5, - DMI_PRODUCT_VERSION = 6, - DMI_PRODUCT_SERIAL = 7, - DMI_PRODUCT_UUID = 8, - DMI_PRODUCT_SKU = 9, - DMI_PRODUCT_FAMILY = 10, - DMI_BOARD_VENDOR = 11, - DMI_BOARD_NAME = 12, - DMI_BOARD_VERSION = 13, - DMI_BOARD_SERIAL = 14, - DMI_BOARD_ASSET_TAG = 15, - DMI_CHASSIS_VENDOR = 16, - DMI_CHASSIS_TYPE = 17, - DMI_CHASSIS_VERSION = 18, - DMI_CHASSIS_SERIAL = 19, - DMI_CHASSIS_ASSET_TAG = 20, - DMI_STRING_MAX = 21, - DMI_OEM_STRING = 22, +typedef long unsigned int (*genpool_algo_t)(long unsigned int *, long unsigned int, long unsigned int, unsigned int, void *, struct gen_pool *, long unsigned int); + +struct gen_pool { + spinlock_t lock; + struct list_head chunks; + int min_alloc_order; + genpool_algo_t algo; + void *data; + const char *name; }; enum { - NONE_FORCE_HPET_RESUME = 0, - OLD_ICH_FORCE_HPET_RESUME = 1, - ICH_FORCE_HPET_RESUME = 2, - VT8237_FORCE_HPET_RESUME = 3, - NVIDIA_FORCE_HPET_RESUME = 4, - ATI_FORCE_HPET_RESUME = 5, + CMCI_STORM_NONE = 0, + CMCI_STORM_ACTIVE = 1, + CMCI_STORM_SUBSIDED = 2, }; -struct cpu { - int node_id; - int hotpluggable; - struct device dev; +enum kobject_action { + KOBJ_ADD = 0, + KOBJ_REMOVE = 1, + KOBJ_CHANGE = 2, + KOBJ_MOVE = 3, + KOBJ_ONLINE = 4, + KOBJ_OFFLINE = 5, + KOBJ_BIND = 6, + KOBJ_UNBIND = 7, + KOBJ_MAX = 8, }; -struct x86_cpu { - struct cpu cpu; +enum smca_bank_types { + SMCA_LS = 0, + SMCA_IF = 1, + SMCA_L2_CACHE = 2, + SMCA_DE = 3, + SMCA_RESERVED = 4, + SMCA_EX = 5, + SMCA_FP = 6, + SMCA_L3_CACHE = 7, + SMCA_CS = 8, + SMCA_CS_V2 = 9, + SMCA_PIE = 10, + SMCA_UMC = 11, + SMCA_PB = 12, + SMCA_PSP = 13, + SMCA_PSP_V2 = 14, + SMCA_SMU = 15, + SMCA_SMU_V2 = 16, + SMCA_MP5 = 17, + SMCA_NBIO = 18, + SMCA_PCIE = 19, + N_SMCA_BANK_TYPES = 20, }; -struct debugfs_blob_wrapper { - void *data; - long unsigned int size; +struct smca_bank_name { + const char *name; + const char *long_name; }; -struct setup_data_node { - u64 paddr; - u32 type; - u32 len; +struct thresh_restart { + struct threshold_block *b; + int reset; + int set_lvt_off; + int lvt_off; + u16 old_limit; }; -struct die_args { - struct pt_regs *regs; - const char *str; - long int err; - int trapnr; - int signr; +struct threshold_attr { + struct attribute attr; + ssize_t (*show)(struct threshold_block *, char *); + ssize_t (*store)(struct threshold_block *, const char *, size_t); }; -typedef struct { - struct mm_struct *mm; -} temp_mm_state_t; +struct _thermal_state { + u64 next_check; + u64 last_interrupt_time; + struct delayed_work therm_work; + long unsigned int count; + long unsigned int last_count; + long unsigned int max_time_ms; + long unsigned int total_time_ms; + bool rate_control_active; + bool new_event; + u8 level; + u8 sample_index; + u8 sample_count; + u8 average; + u8 baseline_temp; + u8 temp_samples[3]; +}; -struct smp_alt_module { - struct module *mod; - char *name; - const s32 *locks; - const s32 *locks_end; - u8 *text; - u8 *text_end; - struct list_head next; +struct thermal_state { + struct _thermal_state core_throttle; + struct _thermal_state core_power_limit; + struct _thermal_state package_throttle; + struct _thermal_state package_power_limit; + struct _thermal_state core_thresh0; + struct _thermal_state core_thresh1; + struct _thermal_state pkg_thresh0; + struct _thermal_state pkg_thresh1; }; -struct bp_patching_desc { - struct text_poke_loc *vec; - int nr_entries; +struct mtrr_var_range { + __u32 base_lo; + __u32 base_hi; + __u32 mask_lo; + __u32 mask_hi; }; -struct paravirt_patch_site; +typedef __u8 mtrr_type; -struct user_i387_struct { - short unsigned int cwd; - short unsigned int swd; - short unsigned int twd; - short unsigned int fop; - __u64 rip; - __u64 rdp; - __u32 mxcsr; - __u32 mxcsr_mask; - __u32 st_space[32]; - __u32 xmm_space[64]; - __u32 padding[24]; +struct mtrr_state_type { + struct mtrr_var_range var_ranges[256]; + mtrr_type fixed_ranges[88]; + unsigned char enabled; + unsigned char have_fixed; + mtrr_type def_type; }; -struct user_regs_struct { - long unsigned int r15; - long unsigned int r14; - long unsigned int r13; - long unsigned int r12; - long unsigned int bp; - long unsigned int bx; - long unsigned int r11; - long unsigned int r10; - long unsigned int r9; - long unsigned int r8; - long unsigned int ax; - long unsigned int cx; - long unsigned int dx; - long unsigned int si; - long unsigned int di; - long unsigned int orig_ax; - long unsigned int ip; - long unsigned int cs; - long unsigned int flags; - long unsigned int sp; - long unsigned int ss; - long unsigned int fs_base; - long unsigned int gs_base; - long unsigned int ds; - long unsigned int es; - long unsigned int fs; - long unsigned int gs; +struct mtrr_ops { + u32 vendor; + u32 use_intel_if; + void (*set)(unsigned int, long unsigned int, long unsigned int, mtrr_type); + void (*set_all)(); + void (*get)(unsigned int, long unsigned int *, long unsigned int *, mtrr_type *); + int (*get_free_region)(long unsigned int, long unsigned int, int); + int (*validate_add_page)(long unsigned int, long unsigned int, unsigned int); + int (*have_wrcomb)(); }; -struct user { - struct user_regs_struct regs; - int u_fpvalid; - int pad0; - struct user_i387_struct i387; - long unsigned int u_tsize; - long unsigned int u_dsize; - long unsigned int u_ssize; - long unsigned int start_code; - long unsigned int start_stack; - long int signal; - int reserved; - int pad1; - long unsigned int u_ar0; - struct user_i387_struct *u_fpstate; - long unsigned int magic; - char u_comm[32]; - long unsigned int u_debugreg[8]; - long unsigned int error_code; - long unsigned int fault_address; +struct set_mtrr_data { + long unsigned int smp_base; + long unsigned int smp_size; + unsigned int smp_reg; + mtrr_type smp_type; }; -enum { - HW_BREAKPOINT_LEN_1 = 1, - HW_BREAKPOINT_LEN_2 = 2, - HW_BREAKPOINT_LEN_3 = 3, - HW_BREAKPOINT_LEN_4 = 4, - HW_BREAKPOINT_LEN_5 = 5, - HW_BREAKPOINT_LEN_6 = 6, - HW_BREAKPOINT_LEN_7 = 7, - HW_BREAKPOINT_LEN_8 = 8, +struct mtrr_value { + mtrr_type ltype; + long unsigned int lbase; + long unsigned int lsize; }; -enum { - HW_BREAKPOINT_EMPTY = 0, - HW_BREAKPOINT_R = 1, - HW_BREAKPOINT_W = 2, - HW_BREAKPOINT_RW = 3, - HW_BREAKPOINT_X = 4, - HW_BREAKPOINT_INVALID = 7, +struct mtrr_sentry { + __u64 base; + __u32 size; + __u32 type; }; -typedef unsigned int u_int; +struct mtrr_gentry { + __u64 base; + __u32 size; + __u32 regnum; + __u32 type; + __u32 _pad; +}; -typedef long long unsigned int cycles_t; +typedef u32 compat_uint_t; -struct system_counterval_t { - u64 cycles; - struct clocksource *cs; +struct mtrr_sentry32 { + compat_ulong_t base; + compat_uint_t size; + compat_uint_t type; }; -enum { - WORK_STRUCT_PENDING_BIT = 0, - WORK_STRUCT_DELAYED_BIT = 1, - WORK_STRUCT_PWQ_BIT = 2, - WORK_STRUCT_LINKED_BIT = 3, - WORK_STRUCT_COLOR_SHIFT = 4, - WORK_STRUCT_COLOR_BITS = 4, - WORK_STRUCT_PENDING = 1, - WORK_STRUCT_DELAYED = 2, - WORK_STRUCT_PWQ = 4, - WORK_STRUCT_LINKED = 8, - WORK_STRUCT_STATIC = 0, - WORK_NR_COLORS = 15, - WORK_NO_COLOR = 15, - WORK_CPU_UNBOUND = 64, - WORK_STRUCT_FLAG_BITS = 8, - WORK_OFFQ_FLAG_BASE = 4, - __WORK_OFFQ_CANCELING = 4, - WORK_OFFQ_CANCELING = 16, - WORK_OFFQ_FLAG_BITS = 1, - WORK_OFFQ_POOL_SHIFT = 5, - WORK_OFFQ_LEFT = 59, - WORK_OFFQ_POOL_BITS = 31, - WORK_OFFQ_POOL_NONE = 2147483647, - WORK_STRUCT_FLAG_MASK = 255, - WORK_STRUCT_WQ_DATA_MASK = -256, - WORK_STRUCT_NO_POOL = -32, - WORK_BUSY_PENDING = 1, - WORK_BUSY_RUNNING = 2, - WORKER_DESC_LEN = 24, +struct mtrr_gentry32 { + compat_ulong_t regnum; + compat_uint_t base; + compat_uint_t size; + compat_uint_t type; }; -enum cpufreq_table_sorting { - CPUFREQ_TABLE_UNSORTED = 0, - CPUFREQ_TABLE_SORTED_ASCENDING = 1, - CPUFREQ_TABLE_SORTED_DESCENDING = 2, +struct fixed_range_block { + int base_msr; + int ranges; }; -struct cpufreq_cpuinfo { - unsigned int max_freq; - unsigned int min_freq; - unsigned int transition_latency; +struct var_mtrr_range_state { + long unsigned int base_pfn; + long unsigned int size_pfn; + mtrr_type type; }; -struct cpufreq_stats; +struct subsys_interface { + const char *name; + struct bus_type *subsys; + struct list_head node; + int (*add_dev)(struct device *, struct subsys_interface *); + void (*remove_dev)(struct device *, struct subsys_interface *); +}; -struct clk; +struct property_entry; -struct cpufreq_governor; +struct platform_device_info { + struct device *parent; + struct fwnode_handle *fwnode; + bool of_node_reused; + const char *name; + int id; + const struct resource *res; + unsigned int num_res; + const void *data; + size_t size_data; + u64 dma_mask; + struct property_entry *properties; +}; -struct cpufreq_frequency_table; +struct builtin_fw { + char *name; + void *data; + long unsigned int size; +}; -struct thermal_cooling_device; +struct cpio_data { + void *data; + size_t size; + char name[18]; +}; -struct cpufreq_policy { - cpumask_var_t cpus; - cpumask_var_t related_cpus; - cpumask_var_t real_cpus; - unsigned int shared_type; - unsigned int cpu; - struct clk *clk; - struct cpufreq_cpuinfo cpuinfo; - unsigned int min; - unsigned int max; - unsigned int cur; - unsigned int restore_freq; - unsigned int suspend_freq; - unsigned int policy; - unsigned int last_policy; - struct cpufreq_governor *governor; - void *governor_data; - char last_governor[16]; - struct work_struct update; - struct freq_constraints constraints; - struct freq_qos_request *min_freq_req; - struct freq_qos_request *max_freq_req; - struct cpufreq_frequency_table *freq_table; - enum cpufreq_table_sorting freq_table_sorted; - struct list_head policy_list; - struct kobject kobj; - struct completion kobj_unregister; - struct rw_semaphore rwsem; - bool fast_switch_possible; - bool fast_switch_enabled; - unsigned int transition_delay_us; - bool dvfs_possible_from_any_cpu; - unsigned int cached_target_freq; - int cached_resolved_idx; - bool transition_ongoing; - spinlock_t transition_lock; - wait_queue_head_t transition_wait; - struct task_struct *transition_task; - struct cpufreq_stats *stats; - void *driver_data; - struct thermal_cooling_device *cdev; - struct notifier_block nb_min; - struct notifier_block nb_max; +enum ucode_state { + UCODE_OK = 0, + UCODE_NEW = 1, + UCODE_UPDATED = 2, + UCODE_NFOUND = 3, + UCODE_ERROR = 4, }; -struct cpufreq_governor { - char name[16]; - int (*init)(struct cpufreq_policy *); - void (*exit)(struct cpufreq_policy *); - int (*start)(struct cpufreq_policy *); - void (*stop)(struct cpufreq_policy *); - void (*limits)(struct cpufreq_policy *); - ssize_t (*show_setspeed)(struct cpufreq_policy *, char *); - int (*store_setspeed)(struct cpufreq_policy *, unsigned int); - bool dynamic_switching; - struct list_head governor_list; - struct module *owner; +struct microcode_ops { + enum ucode_state (*request_microcode_user)(int, const void *, size_t); + enum ucode_state (*request_microcode_fw)(int, struct device *, bool); + void (*microcode_fini_cpu)(int); + enum ucode_state (*apply_microcode)(int); + int (*collect_cpu_info)(int, struct cpu_signature *); }; -struct cpufreq_frequency_table { - unsigned int flags; - unsigned int driver_data; - unsigned int frequency; +struct cpu_info_ctx { + struct cpu_signature *cpu_sig; + int err; }; -struct cpufreq_freqs { - struct cpufreq_policy *policy; - unsigned int old; - unsigned int new; - u8 flags; +struct firmware { + size_t size; + const u8 *data; + struct page **pages; + void *priv; }; -struct cyc2ns { - struct cyc2ns_data data[2]; - seqcount_t seq; +struct ucode_patch { + struct list_head plist; + void *data; + u32 patch_id; + u16 equiv_cpu; }; -struct freq_desc { - u8 msr_plat; - u32 freqs[9]; +struct microcode_header_intel { + unsigned int hdrver; + unsigned int rev; + unsigned int date; + unsigned int sig; + unsigned int cksum; + unsigned int ldrver; + unsigned int pf; + unsigned int datasize; + unsigned int totalsize; + unsigned int reserved[3]; }; -struct dmi_strmatch { - unsigned char slot: 7; - unsigned char exact_match: 1; - char substr[79]; +struct microcode_intel { + struct microcode_header_intel hdr; + unsigned int bits[0]; }; -struct dmi_system_id { - int (*callback)(const struct dmi_system_id *); - const char *ident; - struct dmi_strmatch matches[4]; - void *driver_data; +struct extended_signature { + unsigned int sig; + unsigned int pf; + unsigned int cksum; }; -struct pdev_archdata {}; +struct extended_sigtable { + unsigned int count; + unsigned int cksum; + unsigned int reserved[3]; + struct extended_signature sigs[0]; +}; -struct mfd_cell; +struct equiv_cpu_entry { + u32 installed_cpu; + u32 fixed_errata_mask; + u32 fixed_errata_compare; + u16 equiv_cpu; + u16 res; +}; -struct platform_device_id; +struct microcode_header_amd { + u32 data_code; + u32 patch_id; + u16 mc_patch_data_id; + u8 mc_patch_data_len; + u8 init_flag; + u32 mc_patch_data_checksum; + u32 nb_dev_id; + u32 sb_dev_id; + u16 processor_rev_id; + u8 nb_rev_id; + u8 sb_rev_id; + u8 bios_api_rev; + u8 reserved1[3]; + u32 match_reg[8]; +}; -struct platform_device { - const char *name; - int id; - bool id_auto; - struct device dev; - u64 dma_mask; - u32 num_resources; - struct resource *resource; - const struct platform_device_id *id_entry; - char *driver_override; - struct mfd_cell *mfd_cell; - struct pdev_archdata archdata; +struct microcode_amd { + struct microcode_header_amd hdr; + unsigned int mpb[0]; }; -struct platform_device_id { - char name[20]; - kernel_ulong_t driver_data; +struct equiv_cpu_table { + unsigned int num_entries; + struct equiv_cpu_entry *entry; }; -struct rtc_time { - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; +struct cont_desc { + struct microcode_amd *mc; + u32 cpuid_1_eax; + u32 psize; + u8 *data; + size_t size; }; -struct pnp_device_id { - __u8 id[8]; - kernel_ulong_t driver_data; +enum mp_irq_source_types { + mp_INT = 0, + mp_NMI = 1, + mp_SMI = 2, + mp_ExtINT = 3, }; -struct pnp_card_device_id { - __u8 id[8]; - kernel_ulong_t driver_data; - struct { - __u8 id[8]; - } devs[8]; +struct IO_APIC_route_entry { + __u32 vector: 8; + __u32 delivery_mode: 3; + __u32 dest_mode: 1; + __u32 delivery_status: 1; + __u32 polarity: 1; + __u32 irr: 1; + __u32 trigger: 1; + __u32 mask: 1; + __u32 __reserved_2: 15; + __u32 __reserved_3: 24; + __u32 dest: 8; }; -struct pnp_protocol; +typedef u64 acpi_physical_address; -struct pnp_id; +typedef u32 acpi_status; -struct pnp_card { - struct device dev; - unsigned char number; - struct list_head global_list; - struct list_head protocol_list; - struct list_head devices; - struct pnp_protocol *protocol; - struct pnp_id *id; - char name[50]; - unsigned char pnpver; - unsigned char productver; - unsigned int serial; - unsigned char checksum; - struct proc_dir_entry *procdir; +typedef void *acpi_handle; + +typedef u8 acpi_adr_space_type; + +struct acpi_subtable_header { + u8 type; + u8 length; }; -struct pnp_dev; +struct acpi_table_bgrt { + struct acpi_table_header header; + u16 version; + u8 status; + u8 image_type; + u64 image_address; + u32 image_offset_x; + u32 image_offset_y; +}; -struct pnp_protocol { - struct list_head protocol_list; - char *name; - int (*get)(struct pnp_dev *); - int (*set)(struct pnp_dev *); - int (*disable)(struct pnp_dev *); - bool (*can_wakeup)(struct pnp_dev *); - int (*suspend)(struct pnp_dev *, pm_message_t); - int (*resume)(struct pnp_dev *); - unsigned char number; - struct device dev; - struct list_head cards; - struct list_head devices; +struct acpi_table_boot { + struct acpi_table_header header; + u8 cmos_index; + u8 reserved[3]; }; -struct pnp_id { - char id[8]; - struct pnp_id *next; +struct acpi_hmat_structure { + u16 type; + u16 reserved; + u32 length; }; -struct pnp_card_driver; +struct acpi_table_hpet { + struct acpi_table_header header; + u32 id; + struct acpi_generic_address address; + u8 sequence; + u16 minimum_tick; + u8 flags; +} __attribute__((packed)); -struct pnp_card_link { - struct pnp_card *card; - struct pnp_card_driver *driver; - void *driver_data; - pm_message_t pm_state; +struct acpi_table_madt { + struct acpi_table_header header; + u32 address; + u32 flags; }; -struct pnp_driver { - char *name; - const struct pnp_device_id *id_table; - unsigned int flags; - int (*probe)(struct pnp_dev *, const struct pnp_device_id *); - void (*remove)(struct pnp_dev *); - void (*shutdown)(struct pnp_dev *); - int (*suspend)(struct pnp_dev *, pm_message_t); - int (*resume)(struct pnp_dev *); - struct device_driver driver; +enum acpi_madt_type { + ACPI_MADT_TYPE_LOCAL_APIC = 0, + ACPI_MADT_TYPE_IO_APIC = 1, + ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2, + ACPI_MADT_TYPE_NMI_SOURCE = 3, + ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4, + ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5, + ACPI_MADT_TYPE_IO_SAPIC = 6, + ACPI_MADT_TYPE_LOCAL_SAPIC = 7, + ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, + ACPI_MADT_TYPE_LOCAL_X2APIC = 9, + ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, + ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, + ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, + ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13, + ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14, + ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15, + ACPI_MADT_TYPE_RESERVED = 16, }; -struct pnp_card_driver { - struct list_head global_list; - char *name; - const struct pnp_card_device_id *id_table; - unsigned int flags; - int (*probe)(struct pnp_card_link *, const struct pnp_card_device_id *); - void (*remove)(struct pnp_card_link *); - int (*suspend)(struct pnp_card_link *, pm_message_t); - int (*resume)(struct pnp_card_link *); - struct pnp_driver link; +struct acpi_madt_local_apic { + struct acpi_subtable_header header; + u8 processor_id; + u8 id; + u32 lapic_flags; }; -struct pnp_dev { - struct device dev; - u64 dma_mask; - unsigned int number; - int status; - struct list_head global_list; - struct list_head protocol_list; - struct list_head card_list; - struct list_head rdev_list; - struct pnp_protocol *protocol; - struct pnp_card *card; - struct pnp_driver *driver; - struct pnp_card_link *card_link; - struct pnp_id *id; - int active; - int capabilities; - unsigned int num_dependent_sets; - struct list_head resources; - struct list_head options; - char name[50]; - int flags; - struct proc_dir_entry *procent; - void *data; +struct acpi_madt_io_apic { + struct acpi_subtable_header header; + u8 id; + u8 reserved; + u32 address; + u32 global_irq_base; }; -typedef struct ldttss_desc tss_desc; +struct acpi_madt_interrupt_override { + struct acpi_subtable_header header; + u8 bus; + u8 source_irq; + u32 global_irq; + u16 inti_flags; +} __attribute__((packed)); -enum idle_boot_override { - IDLE_NO_OVERRIDE = 0, - IDLE_HALT = 1, - IDLE_NOMWAIT = 2, - IDLE_POLL = 3, +struct acpi_madt_nmi_source { + struct acpi_subtable_header header; + u16 inti_flags; + u32 global_irq; }; -enum tick_broadcast_mode { - TICK_BROADCAST_OFF = 0, - TICK_BROADCAST_ON = 1, - TICK_BROADCAST_FORCE = 2, +struct acpi_madt_local_apic_nmi { + struct acpi_subtable_header header; + u8 processor_id; + u16 inti_flags; + u8 lint; +} __attribute__((packed)); + +struct acpi_madt_local_apic_override { + struct acpi_subtable_header header; + u16 reserved; + u64 address; +} __attribute__((packed)); + +struct acpi_madt_local_sapic { + struct acpi_subtable_header header; + u8 processor_id; + u8 id; + u8 eid; + u8 reserved[3]; + u32 lapic_flags; + u32 uid; + char uid_string[1]; +} __attribute__((packed)); + +struct acpi_madt_local_x2apic { + struct acpi_subtable_header header; + u16 reserved; + u32 local_apic_id; + u32 lapic_flags; + u32 uid; }; -enum tick_broadcast_state { - TICK_BROADCAST_EXIT = 0, - TICK_BROADCAST_ENTER = 1, +struct acpi_madt_local_x2apic_nmi { + struct acpi_subtable_header header; + u16 inti_flags; + u32 uid; + u8 lint; + u8 reserved[3]; }; -struct cpuidle_state_usage { - long long unsigned int disable; - long long unsigned int usage; - u64 time_ns; - long long unsigned int above; - long long unsigned int below; - long long unsigned int s2idle_usage; - long long unsigned int s2idle_time; +union acpi_subtable_headers { + struct acpi_subtable_header common; + struct acpi_hmat_structure hmat; }; -struct cpuidle_driver_kobj; +typedef int (*acpi_tbl_entry_handler)(union acpi_subtable_headers *, const long unsigned int); -struct cpuidle_state_kobj; +struct acpi_subtable_proc { + int id; + acpi_tbl_entry_handler handler; + int count; +}; -struct cpuidle_device_kobj; +typedef u32 phys_cpuid_t; -struct cpuidle_device { - unsigned int registered: 1; - unsigned int enabled: 1; - unsigned int poll_time_limit: 1; - unsigned int cpu; - ktime_t next_hrtimer; - int last_state_idx; - u64 last_residency_ns; - u64 poll_limit_ns; - u64 forced_idle_latency_limit_ns; - struct cpuidle_state_usage states_usage[10]; - struct cpuidle_state_kobj *kobjs[10]; - struct cpuidle_driver_kobj *kobj_driver; - struct cpuidle_device_kobj *kobj_dev; - struct list_head device_list; +enum irq_alloc_type { + X86_IRQ_ALLOC_TYPE_IOAPIC = 1, + X86_IRQ_ALLOC_TYPE_HPET = 2, + X86_IRQ_ALLOC_TYPE_MSI = 3, + X86_IRQ_ALLOC_TYPE_MSIX = 4, + X86_IRQ_ALLOC_TYPE_DMAR = 5, + X86_IRQ_ALLOC_TYPE_UV = 6, }; -struct inactive_task_frame { - long unsigned int r15; - long unsigned int r14; - long unsigned int r13; - long unsigned int r12; - long unsigned int bx; - long unsigned int bp; - long unsigned int ret_addr; +struct irq_alloc_info { + enum irq_alloc_type type; + u32 flags; + const struct cpumask *mask; + union { + int unused; + struct { + int hpet_id; + int hpet_index; + void *hpet_data; + }; + struct { + struct pci_dev *msi_dev; + irq_hw_number_t msi_hwirq; + }; + struct { + int ioapic_id; + int ioapic_pin; + int ioapic_node; + u32 ioapic_trigger: 1; + u32 ioapic_polarity: 1; + u32 ioapic_valid: 1; + struct IO_APIC_route_entry *ioapic_entry; + }; + struct { + int dmar_id; + void *dmar_data; + }; + }; }; -struct fork_frame { - struct inactive_task_frame frame; - struct pt_regs regs; +struct circ_buf { + char *buf; + int head; + int tail; }; -struct ssb_state { - struct ssb_state *shared_state; - raw_spinlock_t lock; - unsigned int disable_state; - long unsigned int local_state; +struct serial_icounter_struct { + int cts; + int dsr; + int rng; + int dcd; + int rx; + int tx; + int frame; + int overrun; + int parity; + int brk; + int buf_overrun; + int reserved[9]; }; -struct trace_event_raw_x86_fpu { - struct trace_entry ent; - struct fpu *fpu; - bool load_fpu; - u64 xfeatures; - u64 xcomp_bv; - char __data[0]; +struct serial_struct { + int type; + int line; + unsigned int port; + int irq; + int flags; + int xmit_fifo_size; + int custom_divisor; + int baud_base; + short unsigned int close_delay; + char io_type; + char reserved_char[1]; + int hub6; + short unsigned int closing_wait; + short unsigned int closing_wait2; + unsigned char *iomem_base; + short unsigned int iomem_reg_shift; + unsigned int port_high; + long unsigned int iomap_base; }; -struct trace_event_data_offsets_x86_fpu {}; +struct serial_rs485 { + __u32 flags; + __u32 delay_rts_before_send; + __u32 delay_rts_after_send; + __u32 padding[5]; +}; -struct _fpreg { - __u16 significand[4]; - __u16 exponent; +struct serial_iso7816 { + __u32 flags; + __u32 tg; + __u32 sc_fi; + __u32 sc_di; + __u32 clk; + __u32 reserved[5]; }; -struct _fpxreg { - __u16 significand[4]; - __u16 exponent; - __u16 padding[3]; +struct uart_port; + +struct uart_ops { + unsigned int (*tx_empty)(struct uart_port *); + void (*set_mctrl)(struct uart_port *, unsigned int); + unsigned int (*get_mctrl)(struct uart_port *); + void (*stop_tx)(struct uart_port *); + void (*start_tx)(struct uart_port *); + void (*throttle)(struct uart_port *); + void (*unthrottle)(struct uart_port *); + void (*send_xchar)(struct uart_port *, char); + void (*stop_rx)(struct uart_port *); + void (*enable_ms)(struct uart_port *); + void (*break_ctl)(struct uart_port *, int); + int (*startup)(struct uart_port *); + void (*shutdown)(struct uart_port *); + void (*flush_buffer)(struct uart_port *); + void (*set_termios)(struct uart_port *, struct ktermios *, struct ktermios *); + void (*set_ldisc)(struct uart_port *, struct ktermios *); + void (*pm)(struct uart_port *, unsigned int, unsigned int); + const char * (*type)(struct uart_port *); + void (*release_port)(struct uart_port *); + int (*request_port)(struct uart_port *); + void (*config_port)(struct uart_port *, int); + int (*verify_port)(struct uart_port *, struct serial_struct *); + int (*ioctl)(struct uart_port *, unsigned int, long unsigned int); }; -struct user_i387_ia32_struct { - u32 cwd; - u32 swd; - u32 twd; - u32 fip; - u32 fcs; - u32 foo; - u32 fos; - u32 st_space[20]; +struct uart_icount { + __u32 cts; + __u32 dsr; + __u32 rng; + __u32 dcd; + __u32 rx; + __u32 tx; + __u32 frame; + __u32 overrun; + __u32 parity; + __u32 brk; + __u32 buf_overrun; }; -struct user_regset; +typedef unsigned int upf_t; -typedef int user_regset_active_fn(struct task_struct *, const struct user_regset *); +typedef unsigned int upstat_t; -typedef int user_regset_get_fn(struct task_struct *, const struct user_regset *, unsigned int, unsigned int, void *, void *); +struct uart_state; -typedef int user_regset_set_fn(struct task_struct *, const struct user_regset *, unsigned int, unsigned int, const void *, const void *); +struct uart_port { + spinlock_t lock; + long unsigned int iobase; + unsigned char *membase; + unsigned int (*serial_in)(struct uart_port *, int); + void (*serial_out)(struct uart_port *, int, int); + void (*set_termios)(struct uart_port *, struct ktermios *, struct ktermios *); + void (*set_ldisc)(struct uart_port *, struct ktermios *); + unsigned int (*get_mctrl)(struct uart_port *); + void (*set_mctrl)(struct uart_port *, unsigned int); + unsigned int (*get_divisor)(struct uart_port *, unsigned int, unsigned int *); + void (*set_divisor)(struct uart_port *, unsigned int, unsigned int, unsigned int); + int (*startup)(struct uart_port *); + void (*shutdown)(struct uart_port *); + void (*throttle)(struct uart_port *); + void (*unthrottle)(struct uart_port *); + int (*handle_irq)(struct uart_port *); + void (*pm)(struct uart_port *, unsigned int, unsigned int); + void (*handle_break)(struct uart_port *); + int (*rs485_config)(struct uart_port *, struct serial_rs485 *); + int (*iso7816_config)(struct uart_port *, struct serial_iso7816 *); + unsigned int irq; + long unsigned int irqflags; + unsigned int uartclk; + unsigned int fifosize; + unsigned char x_char; + unsigned char regshift; + unsigned char iotype; + unsigned char quirks; + unsigned int read_status_mask; + unsigned int ignore_status_mask; + struct uart_state *state; + struct uart_icount icount; + struct console *cons; + long unsigned int sysrq; + unsigned int sysrq_ch; + upf_t flags; + upstat_t status; + int hw_stopped; + unsigned int mctrl; + unsigned int timeout; + unsigned int type; + const struct uart_ops *ops; + unsigned int custom_divisor; + unsigned int line; + unsigned int minor; + resource_size_t mapbase; + resource_size_t mapsize; + struct device *dev; + unsigned char hub6; + unsigned char suspended; + unsigned char unused[2]; + const char *name; + struct attribute_group *attr_group; + const struct attribute_group **tty_groups; + struct serial_rs485 rs485; + struct serial_iso7816 iso7816; + void *private_data; +}; -typedef int user_regset_writeback_fn(struct task_struct *, const struct user_regset *, int); +enum uart_pm_state { + UART_PM_STATE_ON = 0, + UART_PM_STATE_OFF = 3, + UART_PM_STATE_UNDEFINED = 4, +}; -typedef unsigned int user_regset_get_size_fn(struct task_struct *, const struct user_regset *); +struct uart_state { + struct tty_port port; + enum uart_pm_state pm_state; + struct circ_buf xmit; + atomic_t refcount; + wait_queue_head_t remove_wait; + struct uart_port *uart_port; +}; -struct user_regset { - user_regset_get_fn *get; - user_regset_set_fn *set; - user_regset_active_fn *active; - user_regset_writeback_fn *writeback; - user_regset_get_size_fn *get_size; - unsigned int n; - unsigned int size; - unsigned int align; - unsigned int bias; - unsigned int core_note_type; +struct earlycon_device { + struct console *con; + struct uart_port port; + char options[16]; + unsigned int baud; }; -struct _fpx_sw_bytes { - __u32 magic1; - __u32 extended_size; - __u64 xfeatures; - __u32 xstate_size; - __u32 padding[7]; +struct earlycon_id { + char name[15]; + char name_term; + char compatible[128]; + int (*setup)(struct earlycon_device *, const char *); }; -struct _xmmreg { - __u32 element[4]; +enum ioapic_domain_type { + IOAPIC_DOMAIN_INVALID = 0, + IOAPIC_DOMAIN_LEGACY = 1, + IOAPIC_DOMAIN_STRICT = 2, + IOAPIC_DOMAIN_DYNAMIC = 3, }; -struct _fpstate_32 { - __u32 cw; - __u32 sw; - __u32 tag; - __u32 ipoff; - __u32 cssel; - __u32 dataoff; - __u32 datasel; - struct _fpreg _st[8]; - __u16 status; - __u16 magic; - __u32 _fxsr_env[6]; - __u32 mxcsr; - __u32 reserved; - struct _fpxreg _fxsr_st[8]; - struct _xmmreg _xmm[8]; - union { - __u32 padding1[44]; - __u32 padding[44]; - }; - union { - __u32 padding2[12]; - struct _fpx_sw_bytes sw_reserved; - }; +struct ioapic_domain_cfg { + enum ioapic_domain_type type; + const struct irq_domain_ops *ops; + struct device_node *dev; }; -typedef u32 compat_ulong_t; +struct thermal_cooling_device_ops; -struct user_regset_view { - const char *name; - const struct user_regset *regsets; - unsigned int n; - u32 e_flags; - u16 e_machine; - u8 ei_osabi; +struct thermal_cooling_device { + int id; + char type[20]; + struct device device; + struct device_node *np; + void *devdata; + void *stats; + const struct thermal_cooling_device_ops *ops; + bool updated; + struct mutex lock; + struct list_head thermal_instances; + struct list_head node; }; -enum x86_regset { - REGSET_GENERAL = 0, - REGSET_FP = 1, - REGSET_XFP = 2, - REGSET_IOPERM64 = 2, - REGSET_XSTATE = 3, - REGSET_TLS = 4, - REGSET_IOPERM32 = 5, +enum thermal_device_mode { + THERMAL_DEVICE_DISABLED = 0, + THERMAL_DEVICE_ENABLED = 1, }; -struct pt_regs_offset { - const char *name; - int offset; +enum thermal_trip_type { + THERMAL_TRIP_ACTIVE = 0, + THERMAL_TRIP_PASSIVE = 1, + THERMAL_TRIP_HOT = 2, + THERMAL_TRIP_CRITICAL = 3, }; -typedef bool (*stack_trace_consume_fn)(void *, long unsigned int, bool); - -struct stack_frame_user { - const void *next_fp; - long unsigned int ret_addr; +enum thermal_trend { + THERMAL_TREND_STABLE = 0, + THERMAL_TREND_RAISING = 1, + THERMAL_TREND_DROPPING = 2, + THERMAL_TREND_RAISE_FULL = 3, + THERMAL_TREND_DROP_FULL = 4, }; -enum cache_type { - CACHE_TYPE_NOCACHE = 0, - CACHE_TYPE_INST = 1, - CACHE_TYPE_DATA = 2, - CACHE_TYPE_SEPARATE = 3, - CACHE_TYPE_UNIFIED = 4, +enum thermal_notify_event { + THERMAL_EVENT_UNSPECIFIED = 0, + THERMAL_EVENT_TEMP_SAMPLE = 1, + THERMAL_TRIP_VIOLATED = 2, + THERMAL_TRIP_CHANGED = 3, + THERMAL_DEVICE_DOWN = 4, + THERMAL_DEVICE_UP = 5, + THERMAL_DEVICE_POWER_CAPABILITY_CHANGED = 6, + THERMAL_TABLE_CHANGED = 7, }; -struct cacheinfo { - unsigned int id; - enum cache_type type; - unsigned int level; - unsigned int coherency_line_size; - unsigned int number_of_sets; - unsigned int ways_of_associativity; - unsigned int physical_line_partition; - unsigned int size; - cpumask_t shared_cpu_map; - unsigned int attributes; - void *fw_token; - bool disable_sysfs; - void *priv; -}; +struct thermal_zone_device; -struct cpu_cacheinfo { - struct cacheinfo *info_list; - unsigned int num_levels; - unsigned int num_leaves; - bool cpu_map_populated; +struct thermal_zone_device_ops { + int (*bind)(struct thermal_zone_device *, struct thermal_cooling_device *); + int (*unbind)(struct thermal_zone_device *, struct thermal_cooling_device *); + int (*get_temp)(struct thermal_zone_device *, int *); + int (*set_trips)(struct thermal_zone_device *, int, int); + int (*get_mode)(struct thermal_zone_device *, enum thermal_device_mode *); + int (*set_mode)(struct thermal_zone_device *, enum thermal_device_mode); + int (*get_trip_type)(struct thermal_zone_device *, int, enum thermal_trip_type *); + int (*get_trip_temp)(struct thermal_zone_device *, int, int *); + int (*set_trip_temp)(struct thermal_zone_device *, int, int); + int (*get_trip_hyst)(struct thermal_zone_device *, int, int *); + int (*set_trip_hyst)(struct thermal_zone_device *, int, int); + int (*get_crit_temp)(struct thermal_zone_device *, int *); + int (*set_emul_temp)(struct thermal_zone_device *, int); + int (*get_trend)(struct thermal_zone_device *, int, enum thermal_trend *); + int (*notify)(struct thermal_zone_device *, int, enum thermal_trip_type); }; -struct amd_l3_cache { - unsigned int indices; - u8 subcaches[4]; -}; +struct thermal_attr; -struct threshold_block { - unsigned int block; - unsigned int bank; - unsigned int cpu; - u32 address; - u16 interrupt_enable; - bool interrupt_capable; - u16 threshold_limit; - struct kobject kobj; - struct list_head miscj; +struct thermal_zone_params; + +struct thermal_governor; + +struct thermal_zone_device { + int id; + char type[20]; + struct device device; + struct attribute_group trips_attribute_group; + struct thermal_attr *trip_temp_attrs; + struct thermal_attr *trip_type_attrs; + struct thermal_attr *trip_hyst_attrs; + void *devdata; + int trips; + long unsigned int trips_disabled; + int passive_delay; + int polling_delay; + int temperature; + int last_temperature; + int emul_temperature; + int passive; + int prev_low_trip; + int prev_high_trip; + unsigned int forced_passive; + atomic_t need_update; + struct thermal_zone_device_ops *ops; + struct thermal_zone_params *tzp; + struct thermal_governor *governor; + void *governor_data; + struct list_head thermal_instances; + struct ida ida; + struct mutex lock; + struct list_head node; + struct delayed_work poll_queue; + enum thermal_notify_event notify_event; }; -struct threshold_bank { - struct kobject *kobj; - struct threshold_block *blocks; - refcount_t cpus; +struct thermal_cooling_device_ops { + int (*get_max_state)(struct thermal_cooling_device *, long unsigned int *); + int (*get_cur_state)(struct thermal_cooling_device *, long unsigned int *); + int (*set_cur_state)(struct thermal_cooling_device *, long unsigned int); + int (*get_requested_power)(struct thermal_cooling_device *, struct thermal_zone_device *, u32 *); + int (*state2power)(struct thermal_cooling_device *, struct thermal_zone_device *, long unsigned int, u32 *); + int (*power2state)(struct thermal_cooling_device *, struct thermal_zone_device *, u32, long unsigned int *); }; -struct amd_northbridge { - struct pci_dev *root; - struct pci_dev *misc; - struct pci_dev *link; - struct amd_l3_cache l3_cache; - struct threshold_bank *bank4; +struct thermal_attr { + struct device_attribute attr; + char name[20]; }; -struct _cache_table { - unsigned char descriptor; - char cache_type; - short int size; -}; +struct thermal_bind_params; -enum _cache_type { - CTYPE_NULL = 0, - CTYPE_DATA = 1, - CTYPE_INST = 2, - CTYPE_UNIFIED = 3, +struct thermal_zone_params { + char governor_name[20]; + bool no_hwmon; + int num_tbps; + struct thermal_bind_params *tbp; + u32 sustainable_power; + s32 k_po; + s32 k_pu; + s32 k_i; + s32 k_d; + s32 integral_cutoff; + int slope; + int offset; }; -union _cpuid4_leaf_eax { - struct { - enum _cache_type type: 5; - unsigned int level: 3; - unsigned int is_self_initializing: 1; - unsigned int is_fully_associative: 1; - unsigned int reserved: 4; - unsigned int num_threads_sharing: 12; - unsigned int num_cores_on_die: 6; - } split; - u32 full; +struct thermal_governor { + char name[20]; + int (*bind_to_tz)(struct thermal_zone_device *); + void (*unbind_from_tz)(struct thermal_zone_device *); + int (*throttle)(struct thermal_zone_device *, int); + struct list_head governor_list; }; -union _cpuid4_leaf_ebx { - struct { - unsigned int coherency_line_size: 12; - unsigned int physical_line_partition: 10; - unsigned int ways_of_associativity: 10; - } split; - u32 full; +struct thermal_bind_params { + struct thermal_cooling_device *cdev; + int weight; + int trip_mask; + long unsigned int *binding_limits; + int (*match)(struct thermal_zone_device *, struct thermal_cooling_device *); }; -union _cpuid4_leaf_ecx { - struct { - unsigned int number_of_sets: 32; - } split; - u32 full; +struct acpi_processor_cx { + u8 valid; + u8 type; + u32 address; + u8 entry_method; + u8 index; + u32 latency; + u8 bm_sts_skip; + char desc[32]; }; -struct _cpuid4_info_regs { - union _cpuid4_leaf_eax eax; - union _cpuid4_leaf_ebx ebx; - union _cpuid4_leaf_ecx ecx; - unsigned int id; - long unsigned int size; - struct amd_northbridge *nb; +struct acpi_lpi_state { + u32 min_residency; + u32 wake_latency; + u32 flags; + u32 arch_flags; + u32 res_cnt_freq; + u32 enable_parent_state; + u64 address; + u8 index; + u8 entry_method; + char desc[32]; }; -union l1_cache { - struct { - unsigned int line_size: 8; - unsigned int lines_per_tag: 8; - unsigned int assoc: 8; - unsigned int size_in_kb: 8; +struct acpi_processor_power { + int count; + union { + struct acpi_processor_cx states[8]; + struct acpi_lpi_state lpi_states[8]; }; - unsigned int val; + int timer_broadcast_on_state; }; -union l2_cache { - struct { - unsigned int line_size: 8; - unsigned int lines_per_tag: 4; - unsigned int assoc: 4; - unsigned int size_in_kb: 16; - }; - unsigned int val; +struct acpi_psd_package { + u64 num_entries; + u64 revision; + u64 domain; + u64 coord_type; + u64 num_processors; }; -union l3_cache { - struct { - unsigned int line_size: 8; - unsigned int lines_per_tag: 4; - unsigned int assoc: 4; - unsigned int res: 2; - unsigned int size_encoded: 14; - }; - unsigned int val; -}; +struct acpi_pct_register { + u8 descriptor; + u16 length; + u8 space_id; + u8 bit_width; + u8 bit_offset; + u8 reserved; + u64 address; +} __attribute__((packed)); -struct cpuid_bit { - u16 feature; - u8 reg; - u8 bit; - u32 level; - u32 sub_leaf; +struct acpi_processor_px { + u64 core_frequency; + u64 power; + u64 transition_latency; + u64 bus_master_latency; + u64 control; + u64 status; }; -enum cpuid_leafs { - CPUID_1_EDX = 0, - CPUID_8000_0001_EDX = 1, - CPUID_8086_0001_EDX = 2, - CPUID_LNX_1 = 3, - CPUID_1_ECX = 4, - CPUID_C000_0001_EDX = 5, - CPUID_8000_0001_ECX = 6, - CPUID_LNX_2 = 7, - CPUID_LNX_3 = 8, - CPUID_7_0_EBX = 9, - CPUID_D_1_EAX = 10, - CPUID_LNX_4 = 11, - CPUID_7_1_EAX = 12, - CPUID_8000_0008_EBX = 13, - CPUID_6_EAX = 14, - CPUID_8000_000A_EDX = 15, - CPUID_7_ECX = 16, - CPUID_8000_0007_EBX = 17, - CPUID_7_EDX = 18, -}; +struct acpi_processor_performance { + unsigned int state; + unsigned int platform_limit; + struct acpi_pct_register control_register; + struct acpi_pct_register status_register; + short: 16; + unsigned int state_count; + int: 32; + struct acpi_processor_px *states; + struct acpi_psd_package domain_info; + cpumask_var_t shared_cpu_map; + unsigned int shared_type; + int: 32; +} __attribute__((packed)); -struct cpu_dev { - const char *c_vendor; - const char *c_ident[2]; - void (*c_early_init)(struct cpuinfo_x86 *); - void (*c_bsp_init)(struct cpuinfo_x86 *); - void (*c_init)(struct cpuinfo_x86 *); - void (*c_identify)(struct cpuinfo_x86 *); - void (*c_detect_tlb)(struct cpuinfo_x86 *); - int c_x86_vendor; +struct acpi_tsd_package { + u64 num_entries; + u64 revision; + u64 domain; + u64 coord_type; + u64 num_processors; }; -struct cpuid_dependent_feature { - u32 feature; - u32 level; +struct acpi_processor_tx_tss { + u64 freqpercentage; + u64 power; + u64 transition_latency; + u64 control; + u64 status; }; -enum spectre_v2_mitigation { - SPECTRE_V2_NONE = 0, - SPECTRE_V2_RETPOLINE_GENERIC = 1, - SPECTRE_V2_RETPOLINE_AMD = 2, - SPECTRE_V2_IBRS_ENHANCED = 3, +struct acpi_processor_tx { + u16 power; + u16 performance; }; -enum spectre_v2_user_mitigation { - SPECTRE_V2_USER_NONE = 0, - SPECTRE_V2_USER_STRICT = 1, - SPECTRE_V2_USER_STRICT_PREFERRED = 2, - SPECTRE_V2_USER_PRCTL = 3, - SPECTRE_V2_USER_SECCOMP = 4, -}; +struct acpi_processor; -enum ssb_mitigation { - SPEC_STORE_BYPASS_NONE = 0, - SPEC_STORE_BYPASS_DISABLE = 1, - SPEC_STORE_BYPASS_PRCTL = 2, - SPEC_STORE_BYPASS_SECCOMP = 3, -}; +struct acpi_processor_throttling { + unsigned int state; + unsigned int platform_limit; + struct acpi_pct_register control_register; + struct acpi_pct_register status_register; + short: 16; + unsigned int state_count; + int: 32; + struct acpi_processor_tx_tss *states_tss; + struct acpi_tsd_package domain_info; + cpumask_var_t shared_cpu_map; + int (*acpi_processor_get_throttling)(struct acpi_processor *); + int (*acpi_processor_set_throttling)(struct acpi_processor *, int, bool); + u32 address; + u8 duty_offset; + u8 duty_width; + u8 tsd_valid_flag; + char: 8; + unsigned int shared_type; + struct acpi_processor_tx states[16]; + int: 32; +} __attribute__((packed)); -enum l1tf_mitigations { - L1TF_MITIGATION_OFF = 0, - L1TF_MITIGATION_FLUSH_NOWARN = 1, - L1TF_MITIGATION_FLUSH = 2, - L1TF_MITIGATION_FLUSH_NOSMT = 3, - L1TF_MITIGATION_FULL = 4, - L1TF_MITIGATION_FULL_FORCE = 5, +struct acpi_processor_flags { + u8 power: 1; + u8 performance: 1; + u8 throttling: 1; + u8 limit: 1; + u8 bm_control: 1; + u8 bm_check: 1; + u8 has_cst: 1; + u8 has_lpi: 1; + u8 power_setup_done: 1; + u8 bm_rld_set: 1; + u8 need_hotplug_init: 1; }; -enum mds_mitigations { - MDS_MITIGATION_OFF = 0, - MDS_MITIGATION_FULL = 1, - MDS_MITIGATION_VMWERV = 2, +struct acpi_processor_lx { + int px; + int tx; }; -enum taa_mitigations { - TAA_MITIGATION_OFF = 0, - TAA_MITIGATION_UCODE_NEEDED = 1, - TAA_MITIGATION_VERW = 2, - TAA_MITIGATION_TSX_DISABLED = 3, +struct acpi_processor_limit { + struct acpi_processor_lx state; + struct acpi_processor_lx thermal; + struct acpi_processor_lx user; }; -enum cpuhp_smt_control { - CPU_SMT_ENABLED = 0, - CPU_SMT_DISABLED = 1, - CPU_SMT_FORCE_DISABLED = 2, - CPU_SMT_NOT_SUPPORTED = 3, - CPU_SMT_NOT_IMPLEMENTED = 4, +struct acpi_processor { + acpi_handle handle; + u32 acpi_id; + phys_cpuid_t phys_id; + u32 id; + u32 pblk; + int performance_platform_limit; + int throttling_platform_limit; + struct acpi_processor_flags flags; + struct acpi_processor_power power; + struct acpi_processor_performance *performance; + struct acpi_processor_throttling throttling; + struct acpi_processor_limit limit; + struct thermal_cooling_device *cdev; + struct device *dev; + struct freq_qos_request perflib_req; + struct freq_qos_request thermal_req; }; -enum vmx_l1d_flush_state { - VMENTER_L1D_FLUSH_AUTO = 0, - VMENTER_L1D_FLUSH_NEVER = 1, - VMENTER_L1D_FLUSH_COND = 2, - VMENTER_L1D_FLUSH_ALWAYS = 3, - VMENTER_L1D_FLUSH_EPT_DISABLED = 4, - VMENTER_L1D_FLUSH_NOT_REQUIRED = 5, +struct acpi_processor_errata { + u8 smp; + struct { + u8 throttle: 1; + u8 fdma: 1; + u8 reserved: 6; + u32 bmisx; + } piix4; }; -enum x86_hypervisor_type { - X86_HYPER_NATIVE = 0, - X86_HYPER_VMWARE = 1, - X86_HYPER_MS_HYPERV = 2, - X86_HYPER_XEN_PV = 3, - X86_HYPER_XEN_HVM = 4, - X86_HYPER_KVM = 5, - X86_HYPER_JAILHOUSE = 6, - X86_HYPER_ACRN = 7, -}; +struct cpuidle_driver; -enum spectre_v1_mitigation { - SPECTRE_V1_MITIGATION_NONE = 0, - SPECTRE_V1_MITIGATION_AUTO = 1, -}; +struct wakeup_header { + u16 video_mode; + u32 pmode_entry; + u16 pmode_cs; + u32 pmode_cr0; + u32 pmode_cr3; + u32 pmode_cr4; + u32 pmode_efer_low; + u32 pmode_efer_high; + u64 pmode_gdt; + u32 pmode_misc_en_low; + u32 pmode_misc_en_high; + u32 pmode_behavior; + u32 realmode_flags; + u32 real_magic; + u32 signature; +} __attribute__((packed)); -enum spectre_v2_mitigation_cmd { - SPECTRE_V2_CMD_NONE = 0, - SPECTRE_V2_CMD_AUTO = 1, - SPECTRE_V2_CMD_FORCE = 2, - SPECTRE_V2_CMD_RETPOLINE = 3, - SPECTRE_V2_CMD_RETPOLINE_GENERIC = 4, - SPECTRE_V2_CMD_RETPOLINE_AMD = 5, +struct cpc_reg { + u8 descriptor; + u16 length; + u8 space_id; + u8 bit_width; + u8 bit_offset; + u8 access_width; + u64 address; +} __attribute__((packed)); + +struct acpi_power_register { + u8 descriptor; + u16 length; + u8 space_id; + u8 bit_width; + u8 bit_offset; + u8 access_size; + u64 address; +} __attribute__((packed)); + +struct cstate_entry { + struct { + unsigned int eax; + unsigned int ecx; + } states[8]; }; -enum spectre_v2_user_cmd { - SPECTRE_V2_USER_CMD_NONE = 0, - SPECTRE_V2_USER_CMD_AUTO = 1, - SPECTRE_V2_USER_CMD_FORCE = 2, - SPECTRE_V2_USER_CMD_PRCTL = 3, - SPECTRE_V2_USER_CMD_PRCTL_IBPB = 4, - SPECTRE_V2_USER_CMD_SECCOMP = 5, - SPECTRE_V2_USER_CMD_SECCOMP_IBPB = 6, +typedef void (*nmi_shootdown_cb)(int, struct pt_regs *); + +struct pci_ops___2; + +struct cpuid_regs_done { + struct cpuid_regs regs; + struct completion done; }; -enum ssb_mitigation_cmd { - SPEC_STORE_BYPASS_CMD_NONE = 0, - SPEC_STORE_BYPASS_CMD_AUTO = 1, - SPEC_STORE_BYPASS_CMD_ON = 2, - SPEC_STORE_BYPASS_CMD_PRCTL = 3, - SPEC_STORE_BYPASS_CMD_SECCOMP = 4, +struct intel_early_ops { + resource_size_t (*stolen_size)(int, int, int); + resource_size_t (*stolen_base)(int, int, int, resource_size_t); }; -enum hk_flags { - HK_FLAG_TIMER = 1, - HK_FLAG_RCU = 2, - HK_FLAG_MISC = 4, - HK_FLAG_SCHED = 8, - HK_FLAG_TICK = 16, - HK_FLAG_DOMAIN = 32, - HK_FLAG_WQ = 64, +struct chipset { + u32 vendor; + u32 device; + u32 class; + u32 class_mask; + u32 flags; + void (*f)(int, int, int); }; -struct aperfmperf_sample { - unsigned int khz; - ktime_t time; - u64 aperf; - u64 mperf; +struct sched_domain_shared { + atomic_t ref; + atomic_t nr_busy_cpus; + int has_idle_cores; }; -struct cpuid_dep { - unsigned int feature; - unsigned int depends; +struct sched_group; + +struct sched_domain { + struct sched_domain *parent; + struct sched_domain *child; + struct sched_group *groups; + long unsigned int min_interval; + long unsigned int max_interval; + unsigned int busy_factor; + unsigned int imbalance_pct; + unsigned int cache_nice_tries; + int nohz_idle; + int flags; + int level; + long unsigned int last_balance; + unsigned int balance_interval; + unsigned int nr_balance_failed; + u64 max_newidle_lb_cost; + long unsigned int next_decay_max_lb_cost; + u64 avg_scan_cost; + unsigned int lb_count[3]; + unsigned int lb_failed[3]; + unsigned int lb_balanced[3]; + unsigned int lb_imbalance[3]; + unsigned int lb_gained[3]; + unsigned int lb_hot_gained[3]; + unsigned int lb_nobusyg[3]; + unsigned int lb_nobusyq[3]; + unsigned int alb_count; + unsigned int alb_failed; + unsigned int alb_pushed; + unsigned int sbe_count; + unsigned int sbe_balanced; + unsigned int sbe_pushed; + unsigned int sbf_count; + unsigned int sbf_balanced; + unsigned int sbf_pushed; + unsigned int ttwu_wake_remote; + unsigned int ttwu_move_affine; + unsigned int ttwu_move_balance; + union { + void *private; + struct callback_head rcu; + }; + struct sched_domain_shared *shared; + unsigned int span_weight; + long unsigned int span[0]; }; -struct _tlb_table { - unsigned char descriptor; - char tlb_type; - unsigned int entries; - char info[128]; -}; +typedef const struct cpumask * (*sched_domain_mask_f)(int); -enum tsx_ctrl_states { - TSX_CTRL_ENABLE = 0, - TSX_CTRL_DISABLE = 1, - TSX_CTRL_NOT_SUPPORTED = 2, -}; +typedef int (*sched_domain_flags_f)(); -struct sku_microcode { - u8 model; - u8 stepping; - u32 microcode; +struct sched_group_capacity; + +struct sd_data { + struct sched_domain **sd; + struct sched_domain_shared **sds; + struct sched_group **sg; + struct sched_group_capacity **sgc; }; -struct cpuid_regs { - u32 eax; - u32 ebx; - u32 ecx; - u32 edx; +struct sched_domain_topology_level { + sched_domain_mask_f mask; + sched_domain_flags_f sd_flags; + int flags; + int numa_level; + struct sd_data data; }; -enum pconfig_target { - INVALID_TARGET = 0, - MKTME_TARGET = 1, - PCONFIG_TARGET_NR = 2, +struct tsc_adjust { + s64 bootval; + s64 adjusted; + long unsigned int nextcheck; + bool warned; }; enum { - PCONFIG_CPUID_SUBLEAF_INVALID = 0, - PCONFIG_CPUID_SUBLEAF_TARGETID = 1, + DUMP_PREFIX_NONE = 0, + DUMP_PREFIX_ADDRESS = 1, + DUMP_PREFIX_OFFSET = 2, }; -typedef u8 pto_T_____4; - -enum mf_flags { - MF_COUNT_INCREASED = 1, - MF_ACTION_REQUIRED = 2, - MF_MUST_KILL = 4, - MF_SOFT_OFFLINE = 8, +struct mpf_intel { + char signature[4]; + unsigned int physptr; + unsigned char length; + unsigned char specification; + unsigned char checksum; + unsigned char feature1; + unsigned char feature2; + unsigned char feature3; + unsigned char feature4; + unsigned char feature5; }; -struct mce { - __u64 status; - __u64 misc; - __u64 addr; - __u64 mcgstatus; - __u64 ip; - __u64 tsc; - __u64 time; - __u8 cpuvendor; - __u8 inject_flags; - __u8 severity; - __u8 pad; - __u32 cpuid; - __u8 cs; - __u8 bank; - __u8 cpu; - __u8 finished; - __u32 extcpu; - __u32 socketid; - __u32 apicid; - __u64 mcgcap; - __u64 synd; - __u64 ipid; - __u64 ppin; - __u32 microcode; +struct mpc_ioapic { + unsigned char type; + unsigned char apicid; + unsigned char apicver; + unsigned char flags; + unsigned int apicaddr; }; -enum mce_notifier_prios { - MCE_PRIO_FIRST = 2147483647, - MCE_PRIO_SRAO = 2147483646, - MCE_PRIO_EXTLOG = 2147483645, - MCE_PRIO_NFIT = 2147483644, - MCE_PRIO_EDAC = 2147483643, - MCE_PRIO_MCELOG = 1, - MCE_PRIO_LOWEST = 0, +struct mpc_lintsrc { + unsigned char type; + unsigned char irqtype; + short unsigned int irqflag; + unsigned char srcbusid; + unsigned char srcbusirq; + unsigned char destapic; + unsigned char destapiclint; }; -typedef long unsigned int mce_banks_t[1]; +union apic_ir { + long unsigned int map[4]; + u32 regs[8]; +}; -enum mcp_flags { - MCP_TIMESTAMP = 1, - MCP_UC = 2, - MCP_DONTLOG = 4, +enum ioapic_irq_destination_types { + dest_Fixed = 0, + dest_LowestPrio = 1, + dest_SMI = 2, + dest__reserved_1 = 3, + dest_NMI = 4, + dest_INIT = 5, + dest__reserved_2 = 6, + dest_ExtINT = 7, }; -enum severity_level { - MCE_NO_SEVERITY = 0, - MCE_DEFERRED_SEVERITY = 1, - MCE_UCNA_SEVERITY = 1, - MCE_KEEP_SEVERITY = 2, - MCE_SOME_SEVERITY = 3, - MCE_AO_SEVERITY = 4, - MCE_UC_SEVERITY = 5, - MCE_AR_SEVERITY = 6, - MCE_PANIC_SEVERITY = 7, +enum { + IRQ_SET_MASK_OK = 0, + IRQ_SET_MASK_OK_NOCOPY = 1, + IRQ_SET_MASK_OK_DONE = 2, }; -struct mce_evt_llist { - struct llist_node llnode; - struct mce mce; +enum { + IRQD_TRIGGER_MASK = 15, + IRQD_SETAFFINITY_PENDING = 256, + IRQD_ACTIVATED = 512, + IRQD_NO_BALANCING = 1024, + IRQD_PER_CPU = 2048, + IRQD_AFFINITY_SET = 4096, + IRQD_LEVEL = 8192, + IRQD_WAKEUP_STATE = 16384, + IRQD_MOVE_PCNTXT = 32768, + IRQD_IRQ_DISABLED = 65536, + IRQD_IRQ_MASKED = 131072, + IRQD_IRQ_INPROGRESS = 262144, + IRQD_WAKEUP_ARMED = 524288, + IRQD_FORWARDED_TO_VCPU = 1048576, + IRQD_AFFINITY_MANAGED = 2097152, + IRQD_IRQ_STARTED = 4194304, + IRQD_MANAGED_SHUTDOWN = 8388608, + IRQD_SINGLE_TARGET = 16777216, + IRQD_DEFAULT_TRIGGER_SET = 33554432, + IRQD_CAN_RESERVE = 67108864, }; -struct mca_config { - bool dont_log_ce; - bool cmci_disabled; - bool ignore_ce; - __u64 lmce_disabled: 1; - __u64 disabled: 1; - __u64 ser: 1; - __u64 recovery: 1; - __u64 bios_cmci_threshold: 1; - long: 35; - __u64 __reserved: 59; - s8 bootlog; - int tolerant; - int monarch_timeout; - int panic_timeout; - u32 rip_msr; +struct irq_cfg { + unsigned int dest_apicid; + unsigned int vector; }; -struct mce_vendor_flags { - __u64 overflow_recov: 1; - __u64 succor: 1; - __u64 smca: 1; - __u64 __reserved_0: 61; +enum { + IRQCHIP_FWNODE_REAL = 0, + IRQCHIP_FWNODE_NAMED = 1, + IRQCHIP_FWNODE_NAMED_ID = 2, }; -struct mca_msr_regs { - u32 (*ctl)(int); - u32 (*status)(int); - u32 (*addr)(int); - u32 (*misc)(int); +enum { + X86_IRQ_ALLOC_CONTIGUOUS_VECTORS = 1, + X86_IRQ_ALLOC_LEGACY = 2, }; -struct trace_event_raw_mce_record { - struct trace_entry ent; - u64 mcgcap; - u64 mcgstatus; - u64 status; - u64 addr; - u64 misc; - u64 synd; - u64 ipid; - u64 ip; - u64 tsc; - u64 walltime; - u32 cpu; - u32 cpuid; - u32 apicid; - u32 socketid; - u8 cs; - u8 bank; - u8 cpuvendor; - char __data[0]; +struct apic_chip_data { + struct irq_cfg hw_irq_cfg; + unsigned int vector; + unsigned int prev_vector; + unsigned int cpu; + unsigned int prev_cpu; + unsigned int irq; + struct hlist_node clist; + unsigned int move_in_progress: 1; + unsigned int is_managed: 1; + unsigned int can_reserve: 1; + unsigned int has_reserved: 1; }; -struct trace_event_data_offsets_mce_record {}; +struct irq_matrix; -struct mce_bank { - u64 ctl; - bool init; +union IO_APIC_reg_00 { + u32 raw; + struct { + u32 __reserved_2: 14; + u32 LTS: 1; + u32 delivery_type: 1; + u32 __reserved_1: 8; + u32 ID: 8; + } bits; }; -struct mce_bank_dev { - struct device_attribute attr; - char attrname[16]; - u8 bank; +union IO_APIC_reg_01 { + u32 raw; + struct { + u32 version: 8; + u32 __reserved_2: 7; + u32 PRQ: 1; + u32 entries: 8; + u32 __reserved_1: 8; + } bits; }; -enum context { - IN_KERNEL = 1, - IN_USER = 2, - IN_KERNEL_RECOV = 3, +union IO_APIC_reg_02 { + u32 raw; + struct { + u32 __reserved_2: 24; + u32 arbitration: 4; + u32 __reserved_1: 4; + } bits; }; -enum ser { - SER_REQUIRED = 1, - NO_SER = 2, +union IO_APIC_reg_03 { + u32 raw; + struct { + u32 boot_DT: 1; + u32 __reserved_1: 31; + } bits; }; -enum exception { - EXCP_CONTEXT = 1, - NO_EXCP = 2, +struct IR_IO_APIC_route_entry { + __u64 vector: 8; + __u64 zero: 3; + __u64 index2: 1; + __u64 delivery_status: 1; + __u64 polarity: 1; + __u64 irr: 1; + __u64 trigger: 1; + __u64 mask: 1; + __u64 reserved: 31; + __u64 format: 1; + __u64 index: 15; }; -struct severity { - u64 mask; - u64 result; - unsigned char sev; - unsigned char mcgmask; - unsigned char mcgres; - unsigned char ser; - unsigned char context; - unsigned char excp; - unsigned char covered; - char *msg; +enum { + IRQ_TYPE_NONE = 0, + IRQ_TYPE_EDGE_RISING = 1, + IRQ_TYPE_EDGE_FALLING = 2, + IRQ_TYPE_EDGE_BOTH = 3, + IRQ_TYPE_LEVEL_HIGH = 4, + IRQ_TYPE_LEVEL_LOW = 8, + IRQ_TYPE_LEVEL_MASK = 12, + IRQ_TYPE_SENSE_MASK = 15, + IRQ_TYPE_DEFAULT = 15, + IRQ_TYPE_PROBE = 16, + IRQ_LEVEL = 256, + IRQ_PER_CPU = 512, + IRQ_NOPROBE = 1024, + IRQ_NOREQUEST = 2048, + IRQ_NOAUTOEN = 4096, + IRQ_NO_BALANCING = 8192, + IRQ_MOVE_PCNTXT = 16384, + IRQ_NESTED_THREAD = 32768, + IRQ_NOTHREAD = 65536, + IRQ_PER_CPU_DEVID = 131072, + IRQ_IS_POLLED = 262144, + IRQ_DISABLE_UNLAZY = 524288, }; -struct gen_pool; - -typedef long unsigned int (*genpool_algo_t)(long unsigned int *, long unsigned int, long unsigned int, unsigned int, void *, struct gen_pool *, long unsigned int); +enum { + IRQCHIP_SET_TYPE_MASKED = 1, + IRQCHIP_EOI_IF_HANDLED = 2, + IRQCHIP_MASK_ON_SUSPEND = 4, + IRQCHIP_ONOFFLINE_ENABLED = 8, + IRQCHIP_SKIP_SET_WAKE = 16, + IRQCHIP_ONESHOT_SAFE = 32, + IRQCHIP_EOI_THREADED = 64, + IRQCHIP_SUPPORTS_LEVEL_MSI = 128, + IRQCHIP_SUPPORTS_NMI = 256, +}; -struct gen_pool { - spinlock_t lock; - struct list_head chunks; - int min_alloc_order; - genpool_algo_t algo; - void *data; - const char *name; +struct irq_pin_list { + struct list_head list; + int apic; + int pin; }; -enum { - CMCI_STORM_NONE = 0, - CMCI_STORM_ACTIVE = 1, - CMCI_STORM_SUBSIDED = 2, +struct mp_chip_data { + struct list_head irq_2_pin; + struct IO_APIC_route_entry entry; + int trigger; + int polarity; + u32 count; + bool isa_irq; }; -enum kobject_action { - KOBJ_ADD = 0, - KOBJ_REMOVE = 1, - KOBJ_CHANGE = 2, - KOBJ_MOVE = 3, - KOBJ_ONLINE = 4, - KOBJ_OFFLINE = 5, - KOBJ_BIND = 6, - KOBJ_UNBIND = 7, - KOBJ_MAX = 8, +struct mp_ioapic_gsi { + u32 gsi_base; + u32 gsi_end; }; -enum smca_bank_types { - SMCA_LS = 0, - SMCA_IF = 1, - SMCA_L2_CACHE = 2, - SMCA_DE = 3, - SMCA_RESERVED = 4, - SMCA_EX = 5, - SMCA_FP = 6, - SMCA_L3_CACHE = 7, - SMCA_CS = 8, - SMCA_CS_V2 = 9, - SMCA_PIE = 10, - SMCA_UMC = 11, - SMCA_PB = 12, - SMCA_PSP = 13, - SMCA_PSP_V2 = 14, - SMCA_SMU = 15, - SMCA_SMU_V2 = 16, - SMCA_MP5 = 17, - SMCA_NBIO = 18, - SMCA_PCIE = 19, - N_SMCA_BANK_TYPES = 20, +struct ioapic { + int nr_registers; + struct IO_APIC_route_entry *saved_registers; + struct mpc_ioapic mp_config; + struct mp_ioapic_gsi gsi_config; + struct ioapic_domain_cfg irqdomain_cfg; + struct irq_domain *irqdomain; + struct resource *iomem_res; }; -struct smca_hwid { - unsigned int bank_type; - u32 hwid_mcatype; - u32 xec_bitmap; - u8 count; +struct io_apic { + unsigned int index; + unsigned int unused[3]; + unsigned int data; + unsigned int unused2[11]; + unsigned int eoi; }; -struct smca_bank { - struct smca_hwid *hwid; - u32 id; - u8 sysfs_id; +union entry_union { + struct { + u32 w1; + u32 w2; + }; + struct IO_APIC_route_entry entry; }; -struct smca_bank_name { - const char *name; - const char *long_name; +typedef struct irq_alloc_info msi_alloc_info_t; + +struct msi_domain_info; + +struct msi_domain_ops { + irq_hw_number_t (*get_hwirq)(struct msi_domain_info *, msi_alloc_info_t *); + int (*msi_init)(struct irq_domain *, struct msi_domain_info *, unsigned int, irq_hw_number_t, msi_alloc_info_t *); + void (*msi_free)(struct irq_domain *, struct msi_domain_info *, unsigned int); + int (*msi_check)(struct irq_domain *, struct msi_domain_info *, struct device *); + int (*msi_prepare)(struct irq_domain *, struct device *, int, msi_alloc_info_t *); + void (*msi_finish)(msi_alloc_info_t *, int); + void (*set_desc)(msi_alloc_info_t *, struct msi_desc *); + int (*handle_error)(struct irq_domain *, struct msi_desc *, int); }; -struct thresh_restart { - struct threshold_block *b; - int reset; - int set_lvt_off; - int lvt_off; - u16 old_limit; +struct msi_domain_info { + u32 flags; + struct msi_domain_ops *ops; + struct irq_chip *chip; + void *chip_data; + irq_flow_handler_t handler; + void *handler_data; + const char *handler_name; + void *data; }; -struct threshold_attr { - struct attribute attr; - ssize_t (*show)(struct threshold_block *, char *); - ssize_t (*store)(struct threshold_block *, const char *, size_t); +enum { + MSI_FLAG_USE_DEF_DOM_OPS = 1, + MSI_FLAG_USE_DEF_CHIP_OPS = 2, + MSI_FLAG_MULTI_PCI_MSI = 4, + MSI_FLAG_PCI_MSIX = 8, + MSI_FLAG_ACTIVATE_EARLY = 16, + MSI_FLAG_MUST_REACTIVATE = 32, + MSI_FLAG_LEVEL_CAPABLE = 64, }; -struct _thermal_state { - u64 next_check; - u64 last_interrupt_time; - struct delayed_work therm_work; - long unsigned int count; - long unsigned int last_count; - long unsigned int max_time_ms; - long unsigned int total_time_ms; - bool rate_control_active; - bool new_event; - u8 level; - u8 sample_index; - u8 sample_count; - u8 average; - u8 baseline_temp; - u8 temp_samples[3]; +struct hpet_channel; + +struct x86_mapping_info { + void * (*alloc_pgt_page)(void *); + void *context; + long unsigned int page_flag; + long unsigned int offset; + bool direct_gbpages; + long unsigned int kernpg_flag; }; -struct thermal_state { - struct _thermal_state core_throttle; - struct _thermal_state core_power_limit; - struct _thermal_state package_throttle; - struct _thermal_state package_power_limit; - struct _thermal_state core_thresh0; - struct _thermal_state core_thresh1; - struct _thermal_state pkg_thresh0; - struct _thermal_state pkg_thresh1; +struct kexec_file_ops; + +struct init_pgtable_data { + struct x86_mapping_info *info; + pgd_t *level4p; }; -typedef int (*cpu_stop_fn_t)(void *); +struct kretprobe_instance; -typedef __u8 mtrr_type; +typedef int (*kretprobe_handler_t)(struct kretprobe_instance *, struct pt_regs *); -struct mtrr_ops { - u32 vendor; - u32 use_intel_if; - void (*set)(unsigned int, long unsigned int, long unsigned int, mtrr_type); - void (*set_all)(); - void (*get)(unsigned int, long unsigned int *, long unsigned int *, mtrr_type *); - int (*get_free_region)(long unsigned int, long unsigned int, int); - int (*validate_add_page)(long unsigned int, long unsigned int, unsigned int); - int (*have_wrcomb)(); -}; +struct kretprobe; -struct set_mtrr_data { - long unsigned int smp_base; - long unsigned int smp_size; - unsigned int smp_reg; - mtrr_type smp_type; +struct kretprobe_instance { + struct hlist_node hlist; + struct kretprobe *rp; + kprobe_opcode_t *ret_addr; + struct task_struct *task; + void *fp; + char data[0]; }; -struct mtrr_value { - mtrr_type ltype; - long unsigned int lbase; - long unsigned int lsize; +struct kretprobe { + struct kprobe kp; + kretprobe_handler_t handler; + kretprobe_handler_t entry_handler; + int maxactive; + int nmissed; + size_t data_size; + struct hlist_head free_instances; + raw_spinlock_t lock; }; -struct mtrr_sentry { - __u64 base; - __u32 size; - __u32 type; +typedef struct kprobe *pto_T_____12; + +struct __arch_relative_insn { + u8 op; + s32 raddr; +} __attribute__((packed)); + +struct arch_optimized_insn { + kprobe_opcode_t copied_insn[4]; + kprobe_opcode_t *insn; + size_t size; }; -struct mtrr_gentry { - __u64 base; - __u32 size; - __u32 regnum; - __u32 type; - __u32 _pad; +struct optimized_kprobe { + struct kprobe kp; + struct list_head list; + struct arch_optimized_insn optinsn; }; -typedef u32 compat_uint_t; +typedef __u64 Elf64_Off; -struct mtrr_sentry32 { - compat_ulong_t base; - compat_uint_t size; - compat_uint_t type; +struct elf64_rela { + Elf64_Addr r_offset; + Elf64_Xword r_info; + Elf64_Sxword r_addend; }; -struct mtrr_gentry32 { - compat_ulong_t regnum; - compat_uint_t base; - compat_uint_t size; - compat_uint_t type; -}; +typedef struct elf64_rela Elf64_Rela; -struct mtrr_var_range { - __u32 base_lo; - __u32 base_hi; - __u32 mask_lo; - __u32 mask_hi; +struct elf64_hdr { + unsigned char e_ident[16]; + Elf64_Half e_type; + Elf64_Half e_machine; + Elf64_Word e_version; + Elf64_Addr e_entry; + Elf64_Off e_phoff; + Elf64_Off e_shoff; + Elf64_Word e_flags; + Elf64_Half e_ehsize; + Elf64_Half e_phentsize; + Elf64_Half e_phnum; + Elf64_Half e_shentsize; + Elf64_Half e_shnum; + Elf64_Half e_shstrndx; }; -struct mtrr_state_type { - struct mtrr_var_range var_ranges[256]; - mtrr_type fixed_ranges[88]; - unsigned char enabled; - unsigned char have_fixed; - mtrr_type def_type; -}; +typedef struct elf64_hdr Elf64_Ehdr; -struct fixed_range_block { - int base_msr; - int ranges; +struct elf64_shdr { + Elf64_Word sh_name; + Elf64_Word sh_type; + Elf64_Xword sh_flags; + Elf64_Addr sh_addr; + Elf64_Off sh_offset; + Elf64_Xword sh_size; + Elf64_Word sh_link; + Elf64_Word sh_info; + Elf64_Xword sh_addralign; + Elf64_Xword sh_entsize; }; -struct range { - u64 start; - u64 end; -}; +typedef struct elf64_shdr Elf64_Shdr; -struct var_mtrr_range_state { - long unsigned int base_pfn; - long unsigned int size_pfn; - mtrr_type type; +struct hpet_data { + long unsigned int hd_phys_address; + void *hd_address; + short unsigned int hd_nirqs; + unsigned int hd_state; + unsigned int hd_irq[32]; }; -struct subsys_interface { - const char *name; - struct bus_type *subsys; - struct list_head node; - int (*add_dev)(struct device *, struct subsys_interface *); - void (*remove_dev)(struct device *, struct subsys_interface *); -}; +typedef irqreturn_t (*rtc_irq_handler)(int, void *); -struct property_entry; +enum hpet_mode { + HPET_MODE_UNUSED = 0, + HPET_MODE_LEGACY = 1, + HPET_MODE_CLOCKEVT = 2, + HPET_MODE_DEVICE = 3, +}; -struct platform_device_info { - struct device *parent; - struct fwnode_handle *fwnode; - bool of_node_reused; - const char *name; - int id; - const struct resource *res; - unsigned int num_res; - const void *data; - size_t size_data; - u64 dma_mask; - struct property_entry *properties; +struct hpet_channel___2 { + struct clock_event_device evt; + unsigned int num; + unsigned int cpu; + unsigned int irq; + unsigned int in_use; + enum hpet_mode mode; + unsigned int boot_cfg; + char name[10]; + long: 48; + long: 64; + long: 64; + long: 64; }; -struct builtin_fw { - char *name; - void *data; - long unsigned int size; +struct hpet_base { + unsigned int nr_channels; + unsigned int nr_clockevents; + unsigned int boot_cfg; + struct hpet_channel___2 *channels; }; -struct cpio_data { - void *data; - size_t size; - char name[18]; +union hpet_lock { + struct { + arch_spinlock_t lock; + u32 value; + }; + u64 lockval; }; -struct cpu_signature { - unsigned int sig; - unsigned int pf; - unsigned int rev; +struct amd_northbridge_info { + u16 num; + u64 flags; + struct amd_northbridge *nb; }; -enum ucode_state { - UCODE_OK = 0, - UCODE_NEW = 1, - UCODE_UPDATED = 2, - UCODE_NFOUND = 3, - UCODE_ERROR = 4, +struct scan_area { + u64 addr; + u64 size; }; -struct microcode_ops { - enum ucode_state (*request_microcode_user)(int, const void *, size_t); - enum ucode_state (*request_microcode_fw)(int, struct device *, bool); - void (*microcode_fini_cpu)(int); - enum ucode_state (*apply_microcode)(int); - int (*collect_cpu_info)(int, struct cpu_signature *); +struct uprobe_xol_ops; + +struct arch_uprobe { + union { + u8 insn[16]; + u8 ixol[16]; + }; + const struct uprobe_xol_ops *ops; + union { + struct { + s32 offs; + u8 ilen; + u8 opc1; + } branch; + struct { + u8 fixups; + u8 ilen; + } defparam; + struct { + u8 reg_offset; + u8 ilen; + } push; + }; }; -struct ucode_cpu_info { - struct cpu_signature cpu_sig; - int valid; - void *mc; +struct uprobe_xol_ops { + bool (*emulate)(struct arch_uprobe *, struct pt_regs *); + int (*pre_xol)(struct arch_uprobe *, struct pt_regs *); + int (*post_xol)(struct arch_uprobe *, struct pt_regs *); + void (*abort)(struct arch_uprobe *, struct pt_regs *); }; -struct cpu_info_ctx { - struct cpu_signature *cpu_sig; - int err; +enum rp_check { + RP_CHECK_CALL = 0, + RP_CHECK_CHAIN_CALL = 1, + RP_CHECK_RET = 2, }; -struct firmware { - size_t size; - const u8 *data; - struct page **pages; - void *priv; +enum dev_prop_type { + DEV_PROP_U8 = 0, + DEV_PROP_U16 = 1, + DEV_PROP_U32 = 2, + DEV_PROP_U64 = 3, + DEV_PROP_STRING = 4, }; -struct ucode_patch { - struct list_head plist; - void *data; - u32 patch_id; - u16 equiv_cpu; +struct property_entry { + const char *name; + size_t length; + bool is_array; + enum dev_prop_type type; + union { + const void *pointer; + union { + u8 u8_data; + u16 u16_data; + u32 u32_data; + u64 u64_data; + const char *str; + } value; + }; }; -struct microcode_header_intel { - unsigned int hdrver; - unsigned int rev; - unsigned int date; - unsigned int sig; - unsigned int cksum; - unsigned int ldrver; - unsigned int pf; - unsigned int datasize; - unsigned int totalsize; - unsigned int reserved[3]; +struct fb_fix_screeninfo { + char id[16]; + long unsigned int smem_start; + __u32 smem_len; + __u32 type; + __u32 type_aux; + __u32 visual; + __u16 xpanstep; + __u16 ypanstep; + __u16 ywrapstep; + __u32 line_length; + long unsigned int mmio_start; + __u32 mmio_len; + __u32 accel; + __u16 capabilities; + __u16 reserved[2]; }; -struct microcode_intel { - struct microcode_header_intel hdr; - unsigned int bits[0]; +struct fb_bitfield { + __u32 offset; + __u32 length; + __u32 msb_right; }; -struct extended_signature { - unsigned int sig; - unsigned int pf; - unsigned int cksum; +struct fb_var_screeninfo { + __u32 xres; + __u32 yres; + __u32 xres_virtual; + __u32 yres_virtual; + __u32 xoffset; + __u32 yoffset; + __u32 bits_per_pixel; + __u32 grayscale; + struct fb_bitfield red; + struct fb_bitfield green; + struct fb_bitfield blue; + struct fb_bitfield transp; + __u32 nonstd; + __u32 activate; + __u32 height; + __u32 width; + __u32 accel_flags; + __u32 pixclock; + __u32 left_margin; + __u32 right_margin; + __u32 upper_margin; + __u32 lower_margin; + __u32 hsync_len; + __u32 vsync_len; + __u32 sync; + __u32 vmode; + __u32 rotate; + __u32 colorspace; + __u32 reserved[4]; }; -struct extended_sigtable { - unsigned int count; - unsigned int cksum; - unsigned int reserved[3]; - struct extended_signature sigs[0]; +struct fb_cmap { + __u32 start; + __u32 len; + __u16 *red; + __u16 *green; + __u16 *blue; + __u16 *transp; }; -struct equiv_cpu_entry { - u32 installed_cpu; - u32 fixed_errata_mask; - u32 fixed_errata_compare; - u16 equiv_cpu; - u16 res; +struct fb_copyarea { + __u32 dx; + __u32 dy; + __u32 width; + __u32 height; + __u32 sx; + __u32 sy; }; -struct microcode_header_amd { - u32 data_code; - u32 patch_id; - u16 mc_patch_data_id; - u8 mc_patch_data_len; - u8 init_flag; - u32 mc_patch_data_checksum; - u32 nb_dev_id; - u32 sb_dev_id; - u16 processor_rev_id; - u8 nb_rev_id; - u8 sb_rev_id; - u8 bios_api_rev; - u8 reserved1[3]; - u32 match_reg[8]; +struct fb_fillrect { + __u32 dx; + __u32 dy; + __u32 width; + __u32 height; + __u32 color; + __u32 rop; }; -struct microcode_amd { - struct microcode_header_amd hdr; - unsigned int mpb[0]; +struct fb_image { + __u32 dx; + __u32 dy; + __u32 width; + __u32 height; + __u32 fg_color; + __u32 bg_color; + __u8 depth; + const char *data; + struct fb_cmap cmap; }; -struct equiv_cpu_table { - unsigned int num_entries; - struct equiv_cpu_entry *entry; +struct fbcurpos { + __u16 x; + __u16 y; }; -struct cont_desc { - struct microcode_amd *mc; - u32 cpuid_1_eax; - u32 psize; - u8 *data; - size_t size; +struct fb_cursor { + __u16 set; + __u16 enable; + __u16 rop; + const char *mask; + struct fbcurpos hot; + struct fb_image image; }; -struct mpc_intsrc { - unsigned char type; - unsigned char irqtype; - short unsigned int irqflag; - unsigned char srcbus; - unsigned char srcbusirq; - unsigned char dstapic; - unsigned char dstirq; +struct fb_chroma { + __u32 redx; + __u32 greenx; + __u32 bluex; + __u32 whitex; + __u32 redy; + __u32 greeny; + __u32 bluey; + __u32 whitey; }; -enum mp_irq_source_types { - mp_INT = 0, - mp_NMI = 1, - mp_SMI = 2, - mp_ExtINT = 3, +struct fb_videomode; + +struct fb_monspecs { + struct fb_chroma chroma; + struct fb_videomode *modedb; + __u8 manufacturer[4]; + __u8 monitor[14]; + __u8 serial_no[14]; + __u8 ascii[14]; + __u32 modedb_len; + __u32 model; + __u32 serial; + __u32 year; + __u32 week; + __u32 hfmin; + __u32 hfmax; + __u32 dclkmin; + __u32 dclkmax; + __u16 input; + __u16 dpms; + __u16 signal; + __u16 vfmin; + __u16 vfmax; + __u16 gamma; + __u16 gtf: 1; + __u16 misc; + __u8 version; + __u8 revision; + __u8 max_x; + __u8 max_y; }; -struct IO_APIC_route_entry { - __u32 vector: 8; - __u32 delivery_mode: 3; - __u32 dest_mode: 1; - __u32 delivery_status: 1; - __u32 polarity: 1; - __u32 irr: 1; - __u32 trigger: 1; - __u32 mask: 1; - __u32 __reserved_2: 15; - __u32 __reserved_3: 24; - __u32 dest: 8; +struct fb_info; + +struct fb_pixmap { + u8 *addr; + u32 size; + u32 offset; + u32 buf_align; + u32 scan_align; + u32 access_align; + u32 flags; + u32 blit_x; + u32 blit_y; + void (*writeio)(struct fb_info *, void *, void *, unsigned int); + void (*readio)(struct fb_info *, void *, void *, unsigned int); }; -typedef u64 acpi_io_address; - -typedef u64 acpi_physical_address; - -typedef u32 acpi_status; - -typedef char *acpi_string; +struct fb_deferred_io; -typedef void *acpi_handle; +struct fb_ops; -typedef u32 acpi_object_type; +struct fb_tile_ops; -typedef u8 acpi_adr_space_type; +struct apertures_struct; -union acpi_object { - acpi_object_type type; - struct { - acpi_object_type type; - u64 value; - } integer; - struct { - acpi_object_type type; - u32 length; - char *pointer; - } string; - struct { - acpi_object_type type; - u32 length; - u8 *pointer; - } buffer; - struct { - acpi_object_type type; - u32 count; - union acpi_object *elements; - } package; - struct { - acpi_object_type type; - acpi_object_type actual_type; - acpi_handle handle; - } reference; - struct { - acpi_object_type type; - u32 proc_id; - acpi_io_address pblk_address; - u32 pblk_length; - } processor; - struct { - acpi_object_type type; - u32 system_level; - u32 resource_order; - } power_resource; +struct fb_info { + atomic_t count; + int node; + int flags; + int fbcon_rotate_hint; + struct mutex lock; + struct mutex mm_lock; + struct fb_var_screeninfo var; + struct fb_fix_screeninfo fix; + struct fb_monspecs monspecs; + struct work_struct queue; + struct fb_pixmap pixmap; + struct fb_pixmap sprite; + struct fb_cmap cmap; + struct list_head modelist; + struct fb_videomode *mode; + struct delayed_work deferred_work; + struct fb_deferred_io *fbdefio; + struct fb_ops *fbops; + struct device *device; + struct device *dev; + int class_flag; + struct fb_tile_ops *tileops; + union { + char *screen_base; + char *screen_buffer; + }; + long unsigned int screen_size; + void *pseudo_palette; + u32 state; + void *fbcon_par; + void *par; + struct apertures_struct *apertures; + bool skip_vt_switch; }; -struct acpi_object_list { - u32 count; - union acpi_object *pointer; +struct fb_videomode { + const char *name; + u32 refresh; + u32 xres; + u32 yres; + u32 pixclock; + u32 left_margin; + u32 right_margin; + u32 upper_margin; + u32 lower_margin; + u32 hsync_len; + u32 vsync_len; + u32 sync; + u32 vmode; + u32 flag; }; -struct acpi_subtable_header { - u8 type; - u8 length; +struct fb_blit_caps { + u32 x; + u32 y; + u32 len; + u32 flags; }; -struct acpi_table_boot { - struct acpi_table_header header; - u8 cmos_index; - u8 reserved[3]; +struct fb_deferred_io { + long unsigned int delay; + struct mutex lock; + struct list_head pagelist; + void (*first_io)(struct fb_info *); + void (*deferred_io)(struct fb_info *, struct list_head *); }; -struct acpi_hmat_structure { - u16 type; - u16 reserved; - u32 length; +struct fb_ops { + struct module *owner; + int (*fb_open)(struct fb_info *, int); + int (*fb_release)(struct fb_info *, int); + ssize_t (*fb_read)(struct fb_info *, char *, size_t, loff_t *); + ssize_t (*fb_write)(struct fb_info *, const char *, size_t, loff_t *); + int (*fb_check_var)(struct fb_var_screeninfo *, struct fb_info *); + int (*fb_set_par)(struct fb_info *); + int (*fb_setcolreg)(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, struct fb_info *); + int (*fb_setcmap)(struct fb_cmap *, struct fb_info *); + int (*fb_blank)(int, struct fb_info *); + int (*fb_pan_display)(struct fb_var_screeninfo *, struct fb_info *); + void (*fb_fillrect)(struct fb_info *, const struct fb_fillrect *); + void (*fb_copyarea)(struct fb_info *, const struct fb_copyarea *); + void (*fb_imageblit)(struct fb_info *, const struct fb_image *); + int (*fb_cursor)(struct fb_info *, struct fb_cursor *); + int (*fb_sync)(struct fb_info *); + int (*fb_ioctl)(struct fb_info *, unsigned int, long unsigned int); + int (*fb_compat_ioctl)(struct fb_info *, unsigned int, long unsigned int); + int (*fb_mmap)(struct fb_info *, struct vm_area_struct *); + void (*fb_get_caps)(struct fb_info *, struct fb_blit_caps *, struct fb_var_screeninfo *); + void (*fb_destroy)(struct fb_info *); + int (*fb_debug_enter)(struct fb_info *); + int (*fb_debug_leave)(struct fb_info *); }; -struct acpi_table_hpet { - struct acpi_table_header header; - u32 id; - struct acpi_generic_address address; - u8 sequence; - u16 minimum_tick; - u8 flags; -} __attribute__((packed)); - -struct acpi_table_madt { - struct acpi_table_header header; - u32 address; - u32 flags; +struct fb_tilemap { + __u32 width; + __u32 height; + __u32 depth; + __u32 length; + const __u8 *data; }; -enum acpi_madt_type { - ACPI_MADT_TYPE_LOCAL_APIC = 0, - ACPI_MADT_TYPE_IO_APIC = 1, - ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2, - ACPI_MADT_TYPE_NMI_SOURCE = 3, - ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4, - ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5, - ACPI_MADT_TYPE_IO_SAPIC = 6, - ACPI_MADT_TYPE_LOCAL_SAPIC = 7, - ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, - ACPI_MADT_TYPE_LOCAL_X2APIC = 9, - ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, - ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, - ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, - ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13, - ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14, - ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15, - ACPI_MADT_TYPE_RESERVED = 16, +struct fb_tilerect { + __u32 sx; + __u32 sy; + __u32 width; + __u32 height; + __u32 index; + __u32 fg; + __u32 bg; + __u32 rop; }; -struct acpi_madt_local_apic { - struct acpi_subtable_header header; - u8 processor_id; - u8 id; - u32 lapic_flags; +struct fb_tilearea { + __u32 sx; + __u32 sy; + __u32 dx; + __u32 dy; + __u32 width; + __u32 height; }; -struct acpi_madt_io_apic { - struct acpi_subtable_header header; - u8 id; - u8 reserved; - u32 address; - u32 global_irq_base; +struct fb_tileblit { + __u32 sx; + __u32 sy; + __u32 width; + __u32 height; + __u32 fg; + __u32 bg; + __u32 length; + __u32 *indices; }; -struct acpi_madt_interrupt_override { - struct acpi_subtable_header header; - u8 bus; - u8 source_irq; - u32 global_irq; - u16 inti_flags; -} __attribute__((packed)); - -struct acpi_madt_nmi_source { - struct acpi_subtable_header header; - u16 inti_flags; - u32 global_irq; +struct fb_tilecursor { + __u32 sx; + __u32 sy; + __u32 mode; + __u32 shape; + __u32 fg; + __u32 bg; }; -struct acpi_madt_local_apic_nmi { - struct acpi_subtable_header header; - u8 processor_id; - u16 inti_flags; - u8 lint; -} __attribute__((packed)); +struct fb_tile_ops { + void (*fb_settile)(struct fb_info *, struct fb_tilemap *); + void (*fb_tilecopy)(struct fb_info *, struct fb_tilearea *); + void (*fb_tilefill)(struct fb_info *, struct fb_tilerect *); + void (*fb_tileblit)(struct fb_info *, struct fb_tileblit *); + void (*fb_tilecursor)(struct fb_info *, struct fb_tilecursor *); + int (*fb_get_tilemax)(struct fb_info *); +}; -struct acpi_madt_local_apic_override { - struct acpi_subtable_header header; - u16 reserved; - u64 address; -} __attribute__((packed)); +struct aperture { + resource_size_t base; + resource_size_t size; +}; -struct acpi_madt_local_sapic { - struct acpi_subtable_header header; - u8 processor_id; - u8 id; - u8 eid; - u8 reserved[3]; - u32 lapic_flags; - u32 uid; - char uid_string[1]; -} __attribute__((packed)); +struct apertures_struct { + unsigned int count; + struct aperture ranges[0]; +}; -struct acpi_madt_local_x2apic { - struct acpi_subtable_header header; - u16 reserved; - u32 local_apic_id; - u32 lapic_flags; - u32 uid; +struct dmt_videomode { + u32 dmt_id; + u32 std_2byte_code; + u32 cvt_3byte_code; + const struct fb_videomode *mode; }; -struct acpi_madt_local_x2apic_nmi { - struct acpi_subtable_header header; - u16 inti_flags; - u32 uid; - u8 lint; - u8 reserved[3]; +struct simplefb_platform_data { + u32 width; + u32 height; + u32 stride; + const char *format; }; -enum acpi_irq_model_id { - ACPI_IRQ_MODEL_PIC = 0, - ACPI_IRQ_MODEL_IOAPIC = 1, - ACPI_IRQ_MODEL_IOSAPIC = 2, - ACPI_IRQ_MODEL_PLATFORM = 3, - ACPI_IRQ_MODEL_GIC = 4, - ACPI_IRQ_MODEL_COUNT = 5, +struct efifb_dmi_info { + char *optname; + long unsigned int base; + int stride; + int width; + int height; + int flags; }; -union acpi_subtable_headers { - struct acpi_subtable_header common; - struct acpi_hmat_structure hmat; +enum { + M_I17 = 0, + M_I20 = 1, + M_I20_SR = 2, + M_I24 = 3, + M_I24_8_1 = 4, + M_I24_10_1 = 5, + M_I27_11_1 = 6, + M_MINI = 7, + M_MINI_3_1 = 8, + M_MINI_4_1 = 9, + M_MB = 10, + M_MB_2 = 11, + M_MB_3 = 12, + M_MB_5_1 = 13, + M_MB_6_1 = 14, + M_MB_7_1 = 15, + M_MB_SR = 16, + M_MBA = 17, + M_MBA_3 = 18, + M_MBP = 19, + M_MBP_2 = 20, + M_MBP_2_2 = 21, + M_MBP_SR = 22, + M_MBP_4 = 23, + M_MBP_5_1 = 24, + M_MBP_5_2 = 25, + M_MBP_5_3 = 26, + M_MBP_6_1 = 27, + M_MBP_6_2 = 28, + M_MBP_7_1 = 29, + M_MBP_8_2 = 30, + M_UNKNOWN = 31, }; -typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *); +enum { + OVERRIDE_NONE = 0, + OVERRIDE_BASE = 1, + OVERRIDE_STRIDE = 2, + OVERRIDE_HEIGHT = 4, + OVERRIDE_WIDTH = 8, +}; -typedef int (*acpi_tbl_entry_handler)(union acpi_subtable_headers *, const long unsigned int); +enum perf_sample_regs_abi { + PERF_SAMPLE_REGS_ABI_NONE = 0, + PERF_SAMPLE_REGS_ABI_32 = 1, + PERF_SAMPLE_REGS_ABI_64 = 2, +}; -struct acpi_subtable_proc { - int id; - acpi_tbl_entry_handler handler; - int count; +struct __va_list_tag { + unsigned int gp_offset; + unsigned int fp_offset; + void *overflow_arg_area; + void *reg_save_area; }; -typedef u32 phys_cpuid_t; +typedef __builtin_va_list __gnuc_va_list; -enum irq_alloc_type { - X86_IRQ_ALLOC_TYPE_IOAPIC = 1, - X86_IRQ_ALLOC_TYPE_HPET = 2, - X86_IRQ_ALLOC_TYPE_MSI = 3, - X86_IRQ_ALLOC_TYPE_MSIX = 4, - X86_IRQ_ALLOC_TYPE_DMAR = 5, - X86_IRQ_ALLOC_TYPE_UV = 6, -}; +typedef __gnuc_va_list va_list; -struct irq_alloc_info { - enum irq_alloc_type type; - u32 flags; - const struct cpumask *mask; - union { - int unused; - struct { - int hpet_id; - int hpet_index; - void *hpet_data; - }; - struct { - struct pci_dev *msi_dev; - irq_hw_number_t msi_hwirq; - }; - struct { - int ioapic_id; - int ioapic_pin; - int ioapic_node; - u32 ioapic_trigger: 1; - u32 ioapic_polarity: 1; - u32 ioapic_valid: 1; - struct IO_APIC_route_entry *ioapic_entry; - }; - struct { - int dmar_id; - void *dmar_data; - }; - }; +struct va_format { + const char *fmt; + va_list *va; }; -enum ioapic_domain_type { - IOAPIC_DOMAIN_INVALID = 0, - IOAPIC_DOMAIN_LEGACY = 1, - IOAPIC_DOMAIN_STRICT = 2, - IOAPIC_DOMAIN_DYNAMIC = 3, +struct pci_hostbridge_probe { + u32 bus; + u32 slot; + u32 vendor; + u32 device; }; -struct ioapic_domain_cfg { - enum ioapic_domain_type type; - const struct irq_domain_ops *ops; - struct device_node *dev; +enum pg_level { + PG_LEVEL_NONE = 0, + PG_LEVEL_4K = 1, + PG_LEVEL_2M = 2, + PG_LEVEL_1G = 3, + PG_LEVEL_512G = 4, + PG_LEVEL_NUM = 5, }; -struct wakeup_header { - u16 video_mode; - u32 pmode_entry; - u16 pmode_cs; - u32 pmode_cr0; - u32 pmode_cr3; - u32 pmode_cr4; - u32 pmode_efer_low; - u32 pmode_efer_high; - u64 pmode_gdt; - u32 pmode_misc_en_low; - u32 pmode_misc_en_high; - u32 pmode_behavior; - u32 realmode_flags; - u32 real_magic; - u32 signature; -} __attribute__((packed)); - -struct cpc_reg { - u8 descriptor; - u16 length; - u8 space_id; - u8 bit_width; - u8 bit_offset; - u8 access_width; - u64 address; -} __attribute__((packed)); - -struct acpi_power_register { - u8 descriptor; - u16 length; - u8 space_id; - u8 bit_width; - u8 bit_offset; - u8 access_size; - u64 address; -} __attribute__((packed)); - -struct acpi_processor_cx { - u8 valid; - u8 type; - u32 address; - u8 entry_method; - u8 index; - u32 latency; - u8 bm_sts_skip; - char desc[32]; +struct trace_print_flags { + long unsigned int mask; + const char *name; }; -struct acpi_processor_flags { - u8 power: 1; - u8 performance: 1; - u8 throttling: 1; - u8 limit: 1; - u8 bm_control: 1; - u8 bm_check: 1; - u8 has_cst: 1; - u8 has_lpi: 1; - u8 power_setup_done: 1; - u8 bm_rld_set: 1; - u8 need_hotplug_init: 1; +enum tlb_flush_reason { + TLB_FLUSH_ON_TASK_SWITCH = 0, + TLB_REMOTE_SHOOTDOWN = 1, + TLB_LOCAL_SHOOTDOWN = 2, + TLB_LOCAL_MM_SHOOTDOWN = 3, + TLB_REMOTE_SEND_IPI = 4, + NR_TLB_FLUSH_REASONS = 5, }; -struct cstate_entry { - struct { - unsigned int eax; - unsigned int ecx; - } states[8]; +enum { + REGION_INTERSECTS = 0, + REGION_DISJOINT = 1, + REGION_MIXED = 2, }; -enum reboot_mode { - REBOOT_UNDEFINED = -1, - REBOOT_COLD = 0, - REBOOT_WARM = 1, - REBOOT_HARD = 2, - REBOOT_SOFT = 3, - REBOOT_GPIO = 4, +struct trace_event_raw_tlb_flush { + struct trace_entry ent; + int reason; + long unsigned int pages; + char __data[0]; }; -enum reboot_type { - BOOT_TRIPLE = 116, - BOOT_KBD = 107, - BOOT_BIOS = 98, - BOOT_ACPI = 97, - BOOT_EFI = 101, - BOOT_CF9_FORCE = 112, - BOOT_CF9_SAFE = 113, -}; +struct trace_event_data_offsets_tlb_flush {}; -struct machine_ops { - void (*restart)(char *); - void (*halt)(); - void (*power_off)(); - void (*shutdown)(); - void (*crash_shutdown)(struct pt_regs *); - void (*emergency_restart)(); +typedef void (*btf_trace_tlb_flush)(void *, int, long unsigned int); + +struct map_range { + long unsigned int start; + long unsigned int end; + unsigned int page_size_mask; }; -typedef void (*nmi_shootdown_cb)(int, struct pt_regs *); +enum kcore_type { + KCORE_TEXT = 0, + KCORE_VMALLOC = 1, + KCORE_RAM = 2, + KCORE_VMEMMAP = 3, + KCORE_USER = 4, + KCORE_OTHER = 5, + KCORE_REMAP = 6, +}; -struct cpuid_regs_done { - struct cpuid_regs regs; - struct completion done; +struct kcore_list { + struct list_head list; + long unsigned int addr; + long unsigned int vaddr; + size_t size; + int type; }; -struct intel_early_ops { - resource_size_t (*stolen_size)(int, int, int); - resource_size_t (*stolen_base)(int, int, int, resource_size_t); +struct hstate { + int next_nid_to_alloc; + int next_nid_to_free; + unsigned int order; + long unsigned int mask; + long unsigned int max_huge_pages; + long unsigned int nr_huge_pages; + long unsigned int free_huge_pages; + long unsigned int resv_huge_pages; + long unsigned int surplus_huge_pages; + long unsigned int nr_overcommit_huge_pages; + struct list_head hugepage_activelist; + struct list_head hugepage_freelists[64]; + unsigned int nr_huge_pages_node[64]; + unsigned int free_huge_pages_node[64]; + unsigned int surplus_huge_pages_node[64]; + char name[32]; }; -struct chipset { - u32 vendor; - u32 device; - u32 class; - u32 class_mask; - u32 flags; - void (*f)(int, int, int); +struct trace_event_raw_x86_exceptions { + struct trace_entry ent; + long unsigned int address; + long unsigned int ip; + long unsigned int error_code; + char __data[0]; }; -enum apic_intr_mode_id { - APIC_PIC = 0, - APIC_VIRTUAL_WIRE = 1, - APIC_VIRTUAL_WIRE_NO_CONFIG = 2, - APIC_SYMMETRIC_IO = 3, - APIC_SYMMETRIC_IO_NO_ROUTING = 4, +struct trace_event_data_offsets_x86_exceptions {}; + +typedef void (*btf_trace_page_fault_user)(void *, long unsigned int, struct pt_regs *, long unsigned int); + +typedef void (*btf_trace_page_fault_kernel)(void *, long unsigned int, struct pt_regs *, long unsigned int); + +enum { + IORES_MAP_SYSTEM_RAM = 1, + IORES_MAP_ENCRYPTED = 2, }; -struct sched_domain_shared { - atomic_t ref; - atomic_t nr_busy_cpus; - int has_idle_cores; +struct ioremap_desc { + unsigned int flags; }; -struct sched_group; +typedef bool (*ex_handler_t)(const struct exception_table_entry *, struct pt_regs *, int, long unsigned int, long unsigned int); -struct sched_domain { - struct sched_domain *parent; - struct sched_domain *child; - struct sched_group *groups; - long unsigned int min_interval; - long unsigned int max_interval; - unsigned int busy_factor; - unsigned int imbalance_pct; - unsigned int cache_nice_tries; - int nohz_idle; - int flags; - int level; - long unsigned int last_balance; - unsigned int balance_interval; - unsigned int nr_balance_failed; - u64 max_newidle_lb_cost; - long unsigned int next_decay_max_lb_cost; - u64 avg_scan_cost; - unsigned int lb_count[3]; - unsigned int lb_failed[3]; - unsigned int lb_balanced[3]; - unsigned int lb_imbalance[3]; - unsigned int lb_gained[3]; - unsigned int lb_hot_gained[3]; - unsigned int lb_nobusyg[3]; - unsigned int lb_nobusyq[3]; - unsigned int alb_count; - unsigned int alb_failed; - unsigned int alb_pushed; - unsigned int sbe_count; - unsigned int sbe_balanced; - unsigned int sbe_pushed; - unsigned int sbf_count; - unsigned int sbf_balanced; - unsigned int sbf_pushed; - unsigned int ttwu_wake_remote; - unsigned int ttwu_move_affine; - unsigned int ttwu_move_balance; - union { - void *private; - struct callback_head rcu; - }; - struct sched_domain_shared *shared; - unsigned int span_weight; - long unsigned int span[0]; +struct cpa_data { + long unsigned int *vaddr; + pgd_t *pgd; + pgprot_t mask_set; + pgprot_t mask_clr; + long unsigned int numpages; + long unsigned int curpage; + long unsigned int pfn; + unsigned int flags; + unsigned int force_split: 1; + unsigned int force_static_prot: 1; + struct page **pages; }; -typedef const struct cpumask * (*sched_domain_mask_f)(int); +enum cpa_warn { + CPA_CONFLICT = 0, + CPA_PROTECT = 1, + CPA_DETECT = 2, +}; -typedef int (*sched_domain_flags_f)(); +typedef struct { + u64 val; +} pfn_t; -struct sched_group_capacity; +struct memtype { + u64 start; + u64 end; + u64 subtree_max_end; + enum page_cache_mode type; + struct rb_node rb; +}; -struct sd_data { - struct sched_domain **sd; - struct sched_domain_shared **sds; - struct sched_group **sg; - struct sched_group_capacity **sgc; +enum { + PAT_UC = 0, + PAT_WC = 1, + PAT_WT = 4, + PAT_WP = 5, + PAT_WB = 6, + PAT_UC_MINUS = 7, }; -struct sched_domain_topology_level { - sched_domain_mask_f mask; - sched_domain_flags_f sd_flags; - int flags; - int numa_level; - struct sd_data data; +struct pagerange_state { + long unsigned int cur_pfn; + int ram; + int not_ram; }; -struct tsc_adjust { - s64 bootval; - s64 adjusted; - long unsigned int nextcheck; - bool warned; +struct flush_tlb_info { + struct mm_struct *mm; + long unsigned int start; + long unsigned int end; + u64 new_tlb_gen; + unsigned int stride_shift; + bool freed_tables; }; -typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int, size_t, size_t); +typedef u16 pto_T_____13; -typedef void (*pcpu_fc_free_fn_t)(void *, size_t); +typedef struct mm_struct *pto_T_____14; -typedef void (*pcpu_fc_populate_pte_fn_t)(long unsigned int); +struct exception_stacks { + char DF_stack_guard[0]; + char DF_stack[4096]; + char NMI_stack_guard[0]; + char NMI_stack[4096]; + char DB2_stack_guard[0]; + char DB2_stack[0]; + char DB1_stack_guard[0]; + char DB1_stack[4096]; + char DB_stack_guard[0]; + char DB_stack[4096]; + char MCE_stack_guard[0]; + char MCE_stack[4096]; + char IST_top_guard[0]; +}; -typedef int pcpu_fc_cpu_distance_fn_t(unsigned int, unsigned int); +struct rb_augment_callbacks { + void (*propagate)(struct rb_node *, struct rb_node *); + void (*copy)(struct rb_node *, struct rb_node *); + void (*rotate)(struct rb_node *, struct rb_node *); +}; enum { - DUMP_PREFIX_NONE = 0, - DUMP_PREFIX_ADDRESS = 1, - DUMP_PREFIX_OFFSET = 2, + MEMTYPE_EXACT_MATCH = 0, + MEMTYPE_END_MATCH = 1, }; -struct mpf_intel { - char signature[4]; - unsigned int physptr; - unsigned char length; - unsigned char specification; - unsigned char checksum; - unsigned char feature1; - unsigned char feature2; - unsigned char feature3; - unsigned char feature4; - unsigned char feature5; +struct hugepage_subpool { + spinlock_t lock; + long int count; + long int max_hpages; + long int used_hpages; + struct hstate *hstate; + long int min_hpages; + long int rsv_hpages; }; -struct mpc_ioapic { - unsigned char type; - unsigned char apicid; - unsigned char apicver; - unsigned char flags; - unsigned int apicaddr; +struct hugetlbfs_sb_info { + long int max_inodes; + long int free_inodes; + spinlock_t stat_lock; + struct hstate *hstate; + struct hugepage_subpool *spool; + kuid_t uid; + kgid_t gid; + umode_t mode; }; -struct mpc_lintsrc { - unsigned char type; - unsigned char irqtype; - short unsigned int irqflag; - unsigned char srcbusid; - unsigned char srcbusirq; - unsigned char destapic; - unsigned char destapiclint; +struct numa_memblk { + u64 start; + u64 end; + int nid; }; -union apic_ir { - long unsigned int map[4]; - u32 regs[8]; +struct numa_meminfo { + int nr_blks; + struct numa_memblk blk[128]; }; -enum ioapic_irq_destination_types { - dest_Fixed = 0, - dest_LowestPrio = 1, - dest_SMI = 2, - dest__reserved_1 = 3, - dest_NMI = 4, - dest_INIT = 5, - dest__reserved_2 = 6, - dest_ExtINT = 7, +struct acpi_srat_cpu_affinity { + struct acpi_subtable_header header; + u8 proximity_domain_lo; + u8 apic_id; + u32 flags; + u8 local_sapic_eid; + u8 proximity_domain_hi[3]; + u32 clock_domain; }; -enum { - IRQ_SET_MASK_OK = 0, - IRQ_SET_MASK_OK_NOCOPY = 1, - IRQ_SET_MASK_OK_DONE = 2, +struct acpi_srat_x2apic_cpu_affinity { + struct acpi_subtable_header header; + u16 reserved; + u32 proximity_domain; + u32 apic_id; + u32 flags; + u32 clock_domain; + u32 reserved2; }; -enum { - IRQD_TRIGGER_MASK = 15, - IRQD_SETAFFINITY_PENDING = 256, - IRQD_ACTIVATED = 512, - IRQD_NO_BALANCING = 1024, - IRQD_PER_CPU = 2048, - IRQD_AFFINITY_SET = 4096, - IRQD_LEVEL = 8192, - IRQD_WAKEUP_STATE = 16384, - IRQD_MOVE_PCNTXT = 32768, - IRQD_IRQ_DISABLED = 65536, - IRQD_IRQ_MASKED = 131072, - IRQD_IRQ_INPROGRESS = 262144, - IRQD_WAKEUP_ARMED = 524288, - IRQD_FORWARDED_TO_VCPU = 1048576, - IRQD_AFFINITY_MANAGED = 2097152, - IRQD_IRQ_STARTED = 4194304, - IRQD_MANAGED_SHUTDOWN = 8388608, - IRQD_SINGLE_TARGET = 16777216, - IRQD_DEFAULT_TRIGGER_SET = 33554432, - IRQD_CAN_RESERVE = 67108864, +enum uv_system_type { + UV_NONE = 0, + UV_LEGACY_APIC = 1, + UV_X2APIC = 2, + UV_NON_UNIQUE_APIC = 3, }; -struct irq_cfg { - unsigned int dest_apicid; - unsigned int vector; +struct rnd_state { + __u32 s1; + __u32 s2; + __u32 s3; + __u32 s4; }; -enum { - IRQCHIP_FWNODE_REAL = 0, - IRQCHIP_FWNODE_NAMED = 1, - IRQCHIP_FWNODE_NAMED_ID = 2, +struct kaslr_memory_region { + long unsigned int *base; + long unsigned int size_tb; }; -enum { - X86_IRQ_ALLOC_CONTIGUOUS_VECTORS = 1, - X86_IRQ_ALLOC_LEGACY = 2, +enum pti_mode { + PTI_AUTO = 0, + PTI_FORCE_OFF = 1, + PTI_FORCE_ON = 2, }; -struct apic_chip_data { - struct irq_cfg hw_irq_cfg; - unsigned int vector; - unsigned int prev_vector; - unsigned int cpu; - unsigned int prev_cpu; - unsigned int irq; - struct hlist_node clist; - unsigned int move_in_progress: 1; - unsigned int is_managed: 1; - unsigned int can_reserve: 1; - unsigned int has_reserved: 1; +enum pti_clone_level { + PTI_CLONE_PMD = 0, + PTI_CLONE_PTE = 1, }; -struct irq_matrix; +typedef short unsigned int __kernel_old_uid_t; -union IO_APIC_reg_00 { - u32 raw; - struct { - u32 __reserved_2: 14; - u32 LTS: 1; - u32 delivery_type: 1; - u32 __reserved_1: 8; - u32 ID: 8; - } bits; +typedef short unsigned int __kernel_old_gid_t; + +typedef struct { + int val[2]; +} __kernel_fsid_t; + +typedef __kernel_old_uid_t old_uid_t; + +typedef __kernel_old_gid_t old_gid_t; + +struct kstatfs { + long int f_type; + long int f_bsize; + u64 f_blocks; + u64 f_bfree; + u64 f_bavail; + u64 f_files; + u64 f_ffree; + __kernel_fsid_t f_fsid; + long int f_namelen; + long int f_frsize; + long int f_flags; + long int f_spare[4]; }; -union IO_APIC_reg_01 { - u32 raw; - struct { - u32 version: 8; - u32 __reserved_2: 7; - u32 PRQ: 1; - u32 entries: 8; - u32 __reserved_1: 8; - } bits; +struct kernel_clone_args { + u64 flags; + int *pidfd; + int *child_tid; + int *parent_tid; + int exit_signal; + long unsigned int stack; + long unsigned int stack_size; + long unsigned int tls; + pid_t *set_tid; + size_t set_tid_size; }; -union IO_APIC_reg_02 { - u32 raw; - struct { - u32 __reserved_2: 24; - u32 arbitration: 4; - u32 __reserved_1: 4; - } bits; +struct stat64 { + long long unsigned int st_dev; + unsigned char __pad0[4]; + unsigned int __st_ino; + unsigned int st_mode; + unsigned int st_nlink; + unsigned int st_uid; + unsigned int st_gid; + long long unsigned int st_rdev; + unsigned char __pad3[4]; + long long int st_size; + unsigned int st_blksize; + long long int st_blocks; + unsigned int st_atime; + unsigned int st_atime_nsec; + unsigned int st_mtime; + unsigned int st_mtime_nsec; + unsigned int st_ctime; + unsigned int st_ctime_nsec; + long long unsigned int st_ino; +} __attribute__((packed)); + +struct mmap_arg_struct32 { + unsigned int addr; + unsigned int len; + unsigned int prot; + unsigned int flags; + unsigned int fd; + unsigned int offset; +}; + +struct sigcontext_32 { + __u16 gs; + __u16 __gsh; + __u16 fs; + __u16 __fsh; + __u16 es; + __u16 __esh; + __u16 ds; + __u16 __dsh; + __u32 di; + __u32 si; + __u32 bp; + __u32 sp; + __u32 bx; + __u32 dx; + __u32 cx; + __u32 ax; + __u32 trapno; + __u32 err; + __u32 ip; + __u16 cs; + __u16 __csh; + __u32 flags; + __u32 sp_at_signal; + __u16 ss; + __u16 __ssh; + __u32 fpstate; + __u32 oldmask; + __u32 cr2; }; -union IO_APIC_reg_03 { - u32 raw; - struct { - u32 boot_DT: 1; - u32 __reserved_1: 31; - } bits; -}; +typedef u32 compat_size_t; -struct IR_IO_APIC_route_entry { - __u64 vector: 8; - __u64 zero: 3; - __u64 index2: 1; - __u64 delivery_status: 1; - __u64 polarity: 1; - __u64 irr: 1; - __u64 trigger: 1; - __u64 mask: 1; - __u64 reserved: 31; - __u64 format: 1; - __u64 index: 15; +struct compat_sigaltstack { + compat_uptr_t ss_sp; + int ss_flags; + compat_size_t ss_size; }; -enum { - IRQ_TYPE_NONE = 0, - IRQ_TYPE_EDGE_RISING = 1, - IRQ_TYPE_EDGE_FALLING = 2, - IRQ_TYPE_EDGE_BOTH = 3, - IRQ_TYPE_LEVEL_HIGH = 4, - IRQ_TYPE_LEVEL_LOW = 8, - IRQ_TYPE_LEVEL_MASK = 12, - IRQ_TYPE_SENSE_MASK = 15, - IRQ_TYPE_DEFAULT = 15, - IRQ_TYPE_PROBE = 16, - IRQ_LEVEL = 256, - IRQ_PER_CPU = 512, - IRQ_NOPROBE = 1024, - IRQ_NOREQUEST = 2048, - IRQ_NOAUTOEN = 4096, - IRQ_NO_BALANCING = 8192, - IRQ_MOVE_PCNTXT = 16384, - IRQ_NESTED_THREAD = 32768, - IRQ_NOTHREAD = 65536, - IRQ_PER_CPU_DEVID = 131072, - IRQ_IS_POLLED = 262144, - IRQ_DISABLE_UNLAZY = 524288, -}; +typedef struct compat_sigaltstack compat_stack_t; -enum { - IRQCHIP_SET_TYPE_MASKED = 1, - IRQCHIP_EOI_IF_HANDLED = 2, - IRQCHIP_MASK_ON_SUSPEND = 4, - IRQCHIP_ONOFFLINE_ENABLED = 8, - IRQCHIP_SKIP_SET_WAKE = 16, - IRQCHIP_ONESHOT_SAFE = 32, - IRQCHIP_EOI_THREADED = 64, - IRQCHIP_SUPPORTS_LEVEL_MSI = 128, - IRQCHIP_SUPPORTS_NMI = 256, +struct ucontext_ia32 { + unsigned int uc_flags; + unsigned int uc_link; + compat_stack_t uc_stack; + struct sigcontext_32 uc_mcontext; + compat_sigset_t uc_sigmask; }; -struct irq_pin_list { - struct list_head list; - int apic; - int pin; +struct sigframe_ia32 { + u32 pretcode; + int sig; + struct sigcontext_32 sc; + struct _fpstate_32 fpstate_unused; + unsigned int extramask[1]; + char retcode[8]; }; -struct mp_chip_data { - struct list_head irq_2_pin; - struct IO_APIC_route_entry entry; - int trigger; - int polarity; - u32 count; - bool isa_irq; +struct rt_sigframe_ia32 { + u32 pretcode; + int sig; + u32 pinfo; + u32 puc; + compat_siginfo_t info; + struct ucontext_ia32 uc; + char retcode[8]; }; -struct mp_ioapic_gsi { - u32 gsi_base; - u32 gsi_end; -}; +typedef struct { + efi_guid_t guid; + u64 table; +} efi_config_table_64_t; -struct ioapic { - int nr_registers; - struct IO_APIC_route_entry *saved_registers; - struct mpc_ioapic mp_config; - struct mp_ioapic_gsi gsi_config; - struct ioapic_domain_cfg irqdomain_cfg; - struct irq_domain *irqdomain; - struct resource *iomem_res; +struct efi_mem_range { + struct range range; + u64 attribute; }; -struct io_apic { - unsigned int index; - unsigned int unused[3]; - unsigned int data; - unsigned int unused2[11]; - unsigned int eoi; +struct efi_setup_data { + u64 fw_vendor; + u64 runtime; + u64 tables; + u64 smbios; + u64 reserved[8]; }; -union entry_union { - struct { - u32 w1; - u32 w2; - }; - struct IO_APIC_route_entry entry; -}; +typedef struct { + efi_table_hdr_t hdr; + u32 get_time; + u32 set_time; + u32 get_wakeup_time; + u32 set_wakeup_time; + u32 set_virtual_address_map; + u32 convert_pointer; + u32 get_variable; + u32 get_next_variable; + u32 set_variable; + u32 get_next_high_mono_count; + u32 reset_system; + u32 update_capsule; + u32 query_capsule_caps; + u32 query_variable_info; +} efi_runtime_services_32_t; -struct clock_event_device___2; +typedef struct { + efi_table_hdr_t hdr; + u64 get_time; + u64 set_time; + u64 get_wakeup_time; + u64 set_wakeup_time; + u64 set_virtual_address_map; + u64 convert_pointer; + u64 get_variable; + u64 get_next_variable; + u64 set_variable; + u64 get_next_high_mono_count; + u64 reset_system; + u64 update_capsule; + u64 query_capsule_caps; + u64 query_variable_info; +} efi_runtime_services_64_t; -typedef struct irq_alloc_info msi_alloc_info_t; +typedef struct { + efi_guid_t guid; + const char *name; + long unsigned int *ptr; +} efi_config_table_type_t; -struct msi_domain_info; +typedef struct { + efi_table_hdr_t hdr; + u64 fw_vendor; + u32 fw_revision; + u32 __pad1; + u64 con_in_handle; + u64 con_in; + u64 con_out_handle; + u64 con_out; + u64 stderr_handle; + u64 stderr; + u64 runtime; + u64 boottime; + u32 nr_tables; + u32 __pad2; + u64 tables; +} efi_system_table_64_t; -struct msi_domain_ops { - irq_hw_number_t (*get_hwirq)(struct msi_domain_info *, msi_alloc_info_t *); - int (*msi_init)(struct irq_domain *, struct msi_domain_info *, unsigned int, irq_hw_number_t, msi_alloc_info_t *); - void (*msi_free)(struct irq_domain *, struct msi_domain_info *, unsigned int); - int (*msi_check)(struct irq_domain *, struct msi_domain_info *, struct device *); - int (*msi_prepare)(struct irq_domain *, struct device *, int, msi_alloc_info_t *); - void (*msi_finish)(msi_alloc_info_t *, int); - void (*set_desc)(msi_alloc_info_t *, struct msi_desc *); - int (*handle_error)(struct irq_domain *, struct msi_desc *, int); +typedef struct { + efi_table_hdr_t hdr; + u32 fw_vendor; + u32 fw_revision; + u32 con_in_handle; + u32 con_in; + u32 con_out_handle; + u32 con_out; + u32 stderr_handle; + u32 stderr; + u32 runtime; + u32 boottime; + u32 nr_tables; + u32 tables; +} efi_system_table_32_t; + +struct efi_memory_map_data { + phys_addr_t phys_map; + long unsigned int size; + long unsigned int desc_version; + long unsigned int desc_size; }; -struct msi_domain_info { - u32 flags; - struct msi_domain_ops *ops; - struct irq_chip *chip; - void *chip_data; - irq_flow_handler_t handler; - void *handler_data; - const char *handler_name; - void *data; +struct wait_queue_entry; + +typedef int (*wait_queue_func_t)(struct wait_queue_entry *, unsigned int, int, void *); + +struct wait_queue_entry { + unsigned int flags; + void *private; + wait_queue_func_t func; + struct list_head entry; }; enum { - MSI_FLAG_USE_DEF_DOM_OPS = 1, - MSI_FLAG_USE_DEF_CHIP_OPS = 2, - MSI_FLAG_MULTI_PCI_MSI = 4, - MSI_FLAG_PCI_MSIX = 8, - MSI_FLAG_ACTIVATE_EARLY = 16, - MSI_FLAG_MUST_REACTIVATE = 32, - MSI_FLAG_LEVEL_CAPABLE = 64, + PM_QOS_RESERVED = 0, + PM_QOS_CPU_DMA_LATENCY = 1, + PM_QOS_NUM_CLASSES = 2, }; -struct hpet_channel; +struct pm_qos_request { + struct plist_node node; + int pm_qos_class; + struct delayed_work work; +}; -struct kimage_arch { - p4d_t *p4d; - pud_t *pud; - pmd_t *pmd; - pte_t *pte; - void *elf_headers; - long unsigned int elf_headers_sz; - long unsigned int elf_load_addr; +enum { + BPF_REG_0 = 0, + BPF_REG_1 = 1, + BPF_REG_2 = 2, + BPF_REG_3 = 3, + BPF_REG_4 = 4, + BPF_REG_5 = 5, + BPF_REG_6 = 6, + BPF_REG_7 = 7, + BPF_REG_8 = 8, + BPF_REG_9 = 9, + BPF_REG_10 = 10, + __MAX_BPF_REG = 11, }; -typedef long unsigned int kimage_entry_t; +enum bpf_jit_poke_reason { + BPF_POKE_REASON_TAIL_CALL = 0, +}; -struct kexec_segment { +struct bpf_array_aux { + enum bpf_prog_type type; + bool jited; + struct list_head poke_progs; + struct bpf_map *map; + struct mutex poke_mutex; + struct work_struct work; +}; + +struct bpf_array { + struct bpf_map map; + u32 elem_size; + u32 index_mask; + struct bpf_array_aux *aux; union { - void *buf; - void *kbuf; + char value[0]; + void *ptrs[0]; + void *pptrs[0]; }; - size_t bufsz; - long unsigned int mem; - size_t memsz; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct kimage { - kimage_entry_t head; - kimage_entry_t *entry; - kimage_entry_t *last_entry; - long unsigned int start; - struct page *control_code_page; - struct page *swap_page; - void *vmcoreinfo_data_copy; - long unsigned int nr_segments; - struct kexec_segment segment[16]; - struct list_head control_pages; - struct list_head dest_pages; - struct list_head unusable_pages; - long unsigned int control_page; - unsigned int type: 1; - unsigned int preserve_context: 1; - unsigned int file_mode: 1; - struct kimage_arch arch; +enum bpf_text_poke_type { + BPF_MOD_CALL = 0, + BPF_MOD_JUMP = 1, }; -struct x86_mapping_info { - void * (*alloc_pgt_page)(void *); - void *context; - long unsigned int page_flag; - long unsigned int offset; - bool direct_gbpages; - long unsigned int kernpg_flag; +struct bpf_binary_header { + u32 pages; + int: 32; + u8 image[0]; }; -struct init_pgtable_data { - struct x86_mapping_info *info; - pgd_t *level4p; +struct jit_context { + int cleanup_addr; }; -typedef void crash_vmclear_fn(); - -struct kretprobe_instance; - -typedef int (*kretprobe_handler_t)(struct kretprobe_instance *, struct pt_regs *); - -struct kretprobe; - -struct kretprobe_instance { - struct hlist_node hlist; - struct kretprobe *rp; - kprobe_opcode_t *ret_addr; - struct task_struct *task; - void *fp; - char data[0]; +struct x64_jit_data { + struct bpf_binary_header *header; + int *addrs; + u8 *image; + int proglen; + struct jit_context ctx; }; -struct kretprobe { - struct kprobe kp; - kretprobe_handler_t handler; - kretprobe_handler_t entry_handler; - int maxactive; - int nmissed; - size_t data_size; - struct hlist_head free_instances; - raw_spinlock_t lock; +enum tk_offsets { + TK_OFFS_REAL = 0, + TK_OFFS_BOOT = 1, + TK_OFFS_TAI = 2, + TK_OFFS_MAX = 3, }; -struct kretprobe_blackpoint { - const char *name; - void *addr; +struct clone_args { + __u64 flags; + __u64 pidfd; + __u64 child_tid; + __u64 parent_tid; + __u64 exit_signal; + __u64 stack; + __u64 stack_size; + __u64 tls; + __u64 set_tid; + __u64 set_tid_size; }; -struct __arch_relative_insn { - u8 op; - s32 raddr; -} __attribute__((packed)); +struct fdtable { + unsigned int max_fds; + struct file **fd; + long unsigned int *close_on_exec; + long unsigned int *open_fds; + long unsigned int *full_fds_bits; + struct callback_head rcu; +}; -struct arch_optimized_insn { - kprobe_opcode_t copied_insn[4]; - kprobe_opcode_t *insn; - size_t size; +struct files_struct { + atomic_t count; + bool resize_in_progress; + wait_queue_head_t resize_wait; + struct fdtable *fdt; + struct fdtable fdtab; + long: 64; + long: 64; + long: 64; + long: 64; + spinlock_t file_lock; + unsigned int next_fd; + long unsigned int close_on_exec_init[1]; + long unsigned int open_fds_init[1]; + long unsigned int full_fds_bits_init[1]; + struct file *fd_array[64]; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct optimized_kprobe { - struct kprobe kp; - struct list_head list; - struct arch_optimized_insn optinsn; +struct robust_list { + struct robust_list *next; }; -typedef struct kprobe *pto_T_____5; +struct robust_list_head { + struct robust_list list; + long int futex_offset; + struct robust_list *list_op_pending; +}; -typedef __u64 Elf64_Off; +struct multiprocess_signals { + sigset_t signal; + struct hlist_node node; +}; -typedef __s64 Elf64_Sxword; +typedef int (*proc_visitor)(struct task_struct *, void *); -struct elf64_rela { - Elf64_Addr r_offset; - Elf64_Xword r_info; - Elf64_Sxword r_addend; +enum { + IOPRIO_CLASS_NONE = 0, + IOPRIO_CLASS_RT = 1, + IOPRIO_CLASS_BE = 2, + IOPRIO_CLASS_IDLE = 3, }; -typedef struct elf64_rela Elf64_Rela; - -struct elf64_hdr { - unsigned char e_ident[16]; - Elf64_Half e_type; - Elf64_Half e_machine; - Elf64_Word e_version; - Elf64_Addr e_entry; - Elf64_Off e_phoff; - Elf64_Off e_shoff; - Elf64_Word e_flags; - Elf64_Half e_ehsize; - Elf64_Half e_phentsize; - Elf64_Half e_phnum; - Elf64_Half e_shentsize; - Elf64_Half e_shnum; - Elf64_Half e_shstrndx; +enum memcg_stat_item { + MEMCG_CACHE = 32, + MEMCG_RSS = 33, + MEMCG_RSS_HUGE = 34, + MEMCG_SWAP = 35, + MEMCG_SOCK = 36, + MEMCG_KERNEL_STACK_KB = 37, + MEMCG_NR_STAT = 38, }; -typedef struct elf64_hdr Elf64_Ehdr; +typedef struct poll_table_struct poll_table; -struct elf64_shdr { - Elf64_Word sh_name; - Elf64_Word sh_type; - Elf64_Xword sh_flags; - Elf64_Addr sh_addr; - Elf64_Off sh_offset; - Elf64_Xword sh_size; - Elf64_Word sh_link; - Elf64_Word sh_info; - Elf64_Xword sh_addralign; - Elf64_Xword sh_entsize; +enum { + FUTEX_STATE_OK = 0, + FUTEX_STATE_EXITING = 1, + FUTEX_STATE_DEAD = 2, }; -typedef struct elf64_shdr Elf64_Shdr; - -struct console { - char name[16]; - void (*write)(struct console *, const char *, unsigned int); - int (*read)(struct console *, char *, unsigned int); - struct tty_driver * (*device)(struct console *, int *); - void (*unblank)(); - int (*setup)(struct console *, char *); - int (*match)(struct console *, char *, int, char *); - short int flags; - short int index; - int cflag; - void *data; - struct console *next; +struct trace_event_raw_task_newtask { + struct trace_entry ent; + pid_t pid; + char comm[16]; + long unsigned int clone_flags; + short int oom_score_adj; + char __data[0]; }; -struct hpet_data { - long unsigned int hd_phys_address; - void *hd_address; - short unsigned int hd_nirqs; - unsigned int hd_state; - unsigned int hd_irq[32]; +struct trace_event_raw_task_rename { + struct trace_entry ent; + pid_t pid; + char oldcomm[16]; + char newcomm[16]; + short int oom_score_adj; + char __data[0]; }; -typedef irqreturn_t (*rtc_irq_handler)(int, void *); +struct trace_event_data_offsets_task_newtask {}; -enum hpet_mode { - HPET_MODE_UNUSED = 0, - HPET_MODE_LEGACY = 1, - HPET_MODE_CLOCKEVT = 2, - HPET_MODE_DEVICE = 3, -}; +struct trace_event_data_offsets_task_rename {}; -struct hpet_channel___2 { - struct clock_event_device evt; - unsigned int num; - unsigned int cpu; - unsigned int irq; - unsigned int in_use; - enum hpet_mode mode; - unsigned int boot_cfg; - char name[10]; - long: 48; - long: 64; - long: 64; - long: 64; -}; +typedef void (*btf_trace_task_newtask)(void *, struct task_struct *, long unsigned int); -struct hpet_base { - unsigned int nr_channels; - unsigned int nr_clockevents; - unsigned int boot_cfg; - struct hpet_channel___2 *channels; -}; +typedef void (*btf_trace_task_rename)(void *, struct task_struct *, const char *); -union hpet_lock { - struct { - arch_spinlock_t lock; - u32 value; - }; - u64 lockval; -}; +typedef long unsigned int pao_T_____4; -struct amd_nb_bus_dev_range { - u8 bus; - u8 dev_base; - u8 dev_limit; +enum kmsg_dump_reason { + KMSG_DUMP_UNDEF = 0, + KMSG_DUMP_PANIC = 1, + KMSG_DUMP_OOPS = 2, + KMSG_DUMP_EMERG = 3, + KMSG_DUMP_RESTART = 4, + KMSG_DUMP_HALT = 5, + KMSG_DUMP_POWEROFF = 6, }; -struct amd_northbridge_info { - u16 num; - u64 flags; - struct amd_northbridge *nb; +struct vt_mode { + char mode; + char waitv; + short int relsig; + short int acqsig; + short int frsig; }; -struct scan_area { - u64 addr; - u64 size; +struct console_font { + unsigned int width; + unsigned int height; + unsigned int charcount; + unsigned char *data; }; -enum swiotlb_force { - SWIOTLB_NORMAL = 0, - SWIOTLB_FORCE = 1, - SWIOTLB_NO_FORCE = 2, -}; +struct uni_pagedir; -struct uprobe_xol_ops; +struct uni_screen; -struct arch_uprobe { - union { - u8 insn[16]; - u8 ixol[16]; - }; - const struct uprobe_xol_ops *ops; - union { - struct { - s32 offs; - u8 ilen; - u8 opc1; - } branch; - struct { - u8 fixups; - u8 ilen; - } defparam; - struct { - u8 reg_offset; - u8 ilen; - } push; - }; +struct vc_data { + struct tty_port port; + short unsigned int vc_num; + unsigned int vc_cols; + unsigned int vc_rows; + unsigned int vc_size_row; + unsigned int vc_scan_lines; + long unsigned int vc_origin; + long unsigned int vc_scr_end; + long unsigned int vc_visible_origin; + unsigned int vc_top; + unsigned int vc_bottom; + const struct consw *vc_sw; + short unsigned int *vc_screenbuf; + unsigned int vc_screenbuf_size; + unsigned char vc_mode; + unsigned char vc_attr; + unsigned char vc_def_color; + unsigned char vc_color; + unsigned char vc_s_color; + unsigned char vc_ulcolor; + unsigned char vc_itcolor; + unsigned char vc_halfcolor; + unsigned int vc_cursor_type; + short unsigned int vc_complement_mask; + short unsigned int vc_s_complement_mask; + unsigned int vc_x; + unsigned int vc_y; + unsigned int vc_saved_x; + unsigned int vc_saved_y; + long unsigned int vc_pos; + short unsigned int vc_hi_font_mask; + struct console_font vc_font; + short unsigned int vc_video_erase_char; + unsigned int vc_state; + unsigned int vc_npar; + unsigned int vc_par[16]; + struct vt_mode vt_mode; + struct pid *vt_pid; + int vt_newvt; + wait_queue_head_t paste_wait; + unsigned int vc_charset: 1; + unsigned int vc_s_charset: 1; + unsigned int vc_disp_ctrl: 1; + unsigned int vc_toggle_meta: 1; + unsigned int vc_decscnm: 1; + unsigned int vc_decom: 1; + unsigned int vc_decawm: 1; + unsigned int vc_deccm: 1; + unsigned int vc_decim: 1; + unsigned int vc_intensity: 2; + unsigned int vc_italic: 1; + unsigned int vc_underline: 1; + unsigned int vc_blink: 1; + unsigned int vc_reverse: 1; + unsigned int vc_s_intensity: 2; + unsigned int vc_s_italic: 1; + unsigned int vc_s_underline: 1; + unsigned int vc_s_blink: 1; + unsigned int vc_s_reverse: 1; + unsigned int vc_priv: 3; + unsigned int vc_need_wrap: 1; + unsigned int vc_can_do_color: 1; + unsigned int vc_report_mouse: 2; + unsigned char vc_utf: 1; + unsigned char vc_utf_count; + int vc_utf_char; + unsigned int vc_tab_stop[8]; + unsigned char vc_palette[48]; + short unsigned int *vc_translate; + unsigned char vc_G0_charset; + unsigned char vc_G1_charset; + unsigned char vc_saved_G0; + unsigned char vc_saved_G1; + unsigned int vc_resize_user; + unsigned int vc_bell_pitch; + unsigned int vc_bell_duration; + short unsigned int vc_cur_blink_ms; + struct vc_data **vc_display_fg; + struct uni_pagedir *vc_uni_pagedir; + struct uni_pagedir **vc_uni_pagedir_loc; + struct uni_screen *vc_uni_screen; }; -struct uprobe_xol_ops { - bool (*emulate)(struct arch_uprobe *, struct pt_regs *); - int (*pre_xol)(struct arch_uprobe *, struct pt_regs *); - int (*post_xol)(struct arch_uprobe *, struct pt_regs *); - void (*abort)(struct arch_uprobe *, struct pt_regs *); +struct vc { + struct vc_data *d; + struct work_struct SAK_work; }; -enum rp_check { - RP_CHECK_CALL = 0, - RP_CHECK_CHAIN_CALL = 1, - RP_CHECK_RET = 2, +struct vt_spawn_console { + spinlock_t lock; + struct pid *pid; + int sig; }; -enum dev_prop_type { - DEV_PROP_U8 = 0, - DEV_PROP_U16 = 1, - DEV_PROP_U32 = 2, - DEV_PROP_U64 = 3, - DEV_PROP_STRING = 4, +enum con_flush_mode { + CONSOLE_FLUSH_PENDING = 0, + CONSOLE_REPLAY_ALL = 1, }; -struct property_entry { - const char *name; - size_t length; - bool is_array; - enum dev_prop_type type; - union { - const void *pointer; - union { - u8 u8_data; - u16 u16_data; - u32 u32_data; - u64 u64_data; - const char *str; - } value; - }; +struct warn_args { + const char *fmt; + va_list args; }; -struct simplefb_platform_data { - u32 width; - u32 height; - u32 stride; - const char *format; +struct smp_hotplug_thread { + struct task_struct **store; + struct list_head list; + int (*thread_should_run)(unsigned int); + void (*thread_fn)(unsigned int); + void (*create)(unsigned int); + void (*setup)(unsigned int); + void (*cleanup)(unsigned int, bool); + void (*park)(unsigned int); + void (*unpark)(unsigned int); + bool selfparking; + const char *thread_comm; }; -enum { - M_I17 = 0, - M_I20 = 1, - M_I20_SR = 2, - M_I24 = 3, - M_I24_8_1 = 4, - M_I24_10_1 = 5, - M_I27_11_1 = 6, - M_MINI = 7, - M_MINI_3_1 = 8, - M_MINI_4_1 = 9, - M_MB = 10, - M_MB_2 = 11, - M_MB_3 = 12, - M_MB_5_1 = 13, - M_MB_6_1 = 14, - M_MB_7_1 = 15, - M_MB_SR = 16, - M_MBA = 17, - M_MBA_3 = 18, - M_MBP = 19, - M_MBP_2 = 20, - M_MBP_2_2 = 21, - M_MBP_SR = 22, - M_MBP_4 = 23, - M_MBP_5_1 = 24, - M_MBP_5_2 = 25, - M_MBP_5_3 = 26, - M_MBP_6_1 = 27, - M_MBP_6_2 = 28, - M_MBP_7_1 = 29, - M_MBP_8_2 = 30, - M_UNKNOWN = 31, +struct trace_event_raw_cpuhp_enter { + struct trace_entry ent; + unsigned int cpu; + int target; + int idx; + void *fun; + char __data[0]; }; -struct efifb_dmi_info { - char *optname; - long unsigned int base; - int stride; - int width; - int height; - int flags; +struct trace_event_raw_cpuhp_multi_enter { + struct trace_entry ent; + unsigned int cpu; + int target; + int idx; + void *fun; + char __data[0]; }; -enum { - OVERRIDE_NONE = 0, - OVERRIDE_BASE = 1, - OVERRIDE_STRIDE = 2, - OVERRIDE_HEIGHT = 4, - OVERRIDE_WIDTH = 8, +struct trace_event_raw_cpuhp_exit { + struct trace_entry ent; + unsigned int cpu; + int state; + int idx; + int ret; + char __data[0]; }; -enum perf_sample_regs_abi { - PERF_SAMPLE_REGS_ABI_NONE = 0, - PERF_SAMPLE_REGS_ABI_32 = 1, - PERF_SAMPLE_REGS_ABI_64 = 2, +struct trace_event_data_offsets_cpuhp_enter {}; + +struct trace_event_data_offsets_cpuhp_multi_enter {}; + +struct trace_event_data_offsets_cpuhp_exit {}; + +typedef void (*btf_trace_cpuhp_enter)(void *, unsigned int, int, int, int (*)(unsigned int)); + +typedef void (*btf_trace_cpuhp_multi_enter)(void *, unsigned int, int, int, int (*)(unsigned int, struct hlist_node *), struct hlist_node *); + +typedef void (*btf_trace_cpuhp_exit)(void *, unsigned int, int, int, int); + +struct cpuhp_cpu_state { + enum cpuhp_state state; + enum cpuhp_state target; + enum cpuhp_state fail; + struct task_struct *thread; + bool should_run; + bool rollback; + bool single; + bool bringup; + struct hlist_node *node; + struct hlist_node *last; + enum cpuhp_state cb_state; + int result; + struct completion done_up; + struct completion done_down; }; -struct __va_list_tag { - unsigned int gp_offset; - unsigned int fp_offset; - void *overflow_arg_area; - void *reg_save_area; +struct cpuhp_step { + const char *name; + union { + int (*single)(unsigned int); + int (*multi)(unsigned int, struct hlist_node *); + } startup; + union { + int (*single)(unsigned int); + int (*multi)(unsigned int, struct hlist_node *); + } teardown; + struct hlist_head list; + bool cant_stop; + bool multi_instance; }; -typedef struct __va_list_tag __gnuc_va_list[1]; +enum cpu_mitigations { + CPU_MITIGATIONS_OFF = 0, + CPU_MITIGATIONS_AUTO = 1, + CPU_MITIGATIONS_AUTO_NOSMT = 2, +}; -typedef __gnuc_va_list va_list; +typedef enum cpuhp_state pto_T_____15; -struct va_format { - const char *fmt; - va_list *va; +struct __kernel_old_timeval { + __kernel_long_t tv_sec; + __kernel_long_t tv_usec; }; -struct pci_hostbridge_probe { - u32 bus; - u32 slot; - u32 vendor; - u32 device; -}; +typedef struct wait_queue_entry wait_queue_entry_t; -enum pg_level { - PG_LEVEL_NONE = 0, - PG_LEVEL_4K = 1, - PG_LEVEL_2M = 2, - PG_LEVEL_1G = 3, - PG_LEVEL_512G = 4, - PG_LEVEL_NUM = 5, +struct old_timeval32 { + old_time32_t tv_sec; + s32 tv_usec; }; -struct trace_print_flags { - long unsigned int mask; - const char *name; +struct rusage { + struct __kernel_old_timeval ru_utime; + struct __kernel_old_timeval ru_stime; + __kernel_long_t ru_maxrss; + __kernel_long_t ru_ixrss; + __kernel_long_t ru_idrss; + __kernel_long_t ru_isrss; + __kernel_long_t ru_minflt; + __kernel_long_t ru_majflt; + __kernel_long_t ru_nswap; + __kernel_long_t ru_inblock; + __kernel_long_t ru_oublock; + __kernel_long_t ru_msgsnd; + __kernel_long_t ru_msgrcv; + __kernel_long_t ru_nsignals; + __kernel_long_t ru_nvcsw; + __kernel_long_t ru_nivcsw; }; -enum tlb_flush_reason { - TLB_FLUSH_ON_TASK_SWITCH = 0, - TLB_REMOTE_SHOOTDOWN = 1, - TLB_LOCAL_SHOOTDOWN = 2, - TLB_LOCAL_MM_SHOOTDOWN = 3, - TLB_REMOTE_SEND_IPI = 4, - NR_TLB_FLUSH_REASONS = 5, +struct fd { + struct file *file; + unsigned int flags; }; -enum { - REGION_INTERSECTS = 0, - REGION_DISJOINT = 1, - REGION_MIXED = 2, +struct compat_rusage { + struct old_timeval32 ru_utime; + struct old_timeval32 ru_stime; + compat_long_t ru_maxrss; + compat_long_t ru_ixrss; + compat_long_t ru_idrss; + compat_long_t ru_isrss; + compat_long_t ru_minflt; + compat_long_t ru_majflt; + compat_long_t ru_nswap; + compat_long_t ru_inblock; + compat_long_t ru_oublock; + compat_long_t ru_msgsnd; + compat_long_t ru_msgrcv; + compat_long_t ru_nsignals; + compat_long_t ru_nvcsw; + compat_long_t ru_nivcsw; }; -struct trace_event_raw_tlb_flush { - struct trace_entry ent; - int reason; - long unsigned int pages; - char __data[0]; +struct waitid_info { + pid_t pid; + uid_t uid; + int status; + int cause; }; -struct trace_event_data_offsets_tlb_flush {}; +struct wait_opts { + enum pid_type wo_type; + int wo_flags; + struct pid *wo_pid; + struct waitid_info *wo_info; + int wo_stat; + struct rusage *wo_rusage; + wait_queue_entry_t child_wait; + int notask_error; +}; -struct map_range { - long unsigned int start; - long unsigned int end; - unsigned int page_size_mask; +struct softirq_action { + void (*action)(struct softirq_action *); }; -enum kcore_type { - KCORE_TEXT = 0, - KCORE_VMALLOC = 1, - KCORE_RAM = 2, - KCORE_VMEMMAP = 3, - KCORE_USER = 4, - KCORE_OTHER = 5, - KCORE_REMAP = 6, +struct tasklet_struct { + struct tasklet_struct *next; + long unsigned int state; + atomic_t count; + void (*func)(long unsigned int); + long unsigned int data; }; -struct kcore_list { - struct list_head list; - long unsigned int addr; - long unsigned int vaddr; - size_t size; - int type; +enum { + TASKLET_STATE_SCHED = 0, + TASKLET_STATE_RUN = 1, }; -struct hstate { - int next_nid_to_alloc; - int next_nid_to_free; - unsigned int order; - long unsigned int mask; - long unsigned int max_huge_pages; - long unsigned int nr_huge_pages; - long unsigned int free_huge_pages; - long unsigned int resv_huge_pages; - long unsigned int surplus_huge_pages; - long unsigned int nr_overcommit_huge_pages; - struct list_head hugepage_activelist; - struct list_head hugepage_freelists[64]; - unsigned int nr_huge_pages_node[64]; - unsigned int free_huge_pages_node[64]; - unsigned int surplus_huge_pages_node[64]; - char name[32]; +struct trace_event_raw_irq_handler_entry { + struct trace_entry ent; + int irq; + u32 __data_loc_name; + char __data[0]; }; -struct trace_event_raw_x86_exceptions { +struct trace_event_raw_irq_handler_exit { struct trace_entry ent; - long unsigned int address; - long unsigned int ip; - long unsigned int error_code; + int irq; + int ret; char __data[0]; }; -struct trace_event_data_offsets_x86_exceptions {}; - -enum { - IORES_MAP_SYSTEM_RAM = 1, - IORES_MAP_ENCRYPTED = 2, +struct trace_event_raw_softirq { + struct trace_entry ent; + unsigned int vec; + char __data[0]; }; -struct ioremap_desc { - unsigned int flags; +struct trace_event_data_offsets_irq_handler_entry { + u32 name; }; -typedef bool (*ex_handler_t)(const struct exception_table_entry *, struct pt_regs *, int, long unsigned int, long unsigned int); +struct trace_event_data_offsets_irq_handler_exit {}; -struct cpa_data { - long unsigned int *vaddr; - pgd_t *pgd; - pgprot_t mask_set; - pgprot_t mask_clr; - long unsigned int numpages; - long unsigned int curpage; - long unsigned int pfn; - unsigned int flags; - unsigned int force_split: 1; - unsigned int force_static_prot: 1; - struct page **pages; -}; +struct trace_event_data_offsets_softirq {}; -enum cpa_warn { - CPA_CONFLICT = 0, - CPA_PROTECT = 1, - CPA_DETECT = 2, -}; +typedef void (*btf_trace_irq_handler_entry)(void *, int, struct irqaction *); -typedef struct { - u64 val; -} pfn_t; +typedef void (*btf_trace_irq_handler_exit)(void *, int, struct irqaction *, int); -struct memtype { - u64 start; - u64 end; - u64 subtree_max_end; - enum page_cache_mode type; - struct rb_node rb; -}; +typedef void (*btf_trace_softirq_entry)(void *, unsigned int); -enum { - PAT_UC = 0, - PAT_WC = 1, - PAT_WT = 4, - PAT_WP = 5, - PAT_WB = 6, - PAT_UC_MINUS = 7, -}; +typedef void (*btf_trace_softirq_exit)(void *, unsigned int); -struct pagerange_state { - long unsigned int cur_pfn; - int ram; - int not_ram; -}; +typedef void (*btf_trace_softirq_raise)(void *, unsigned int); -struct flush_tlb_info { - struct mm_struct *mm; - long unsigned int start; - long unsigned int end; - u64 new_tlb_gen; - unsigned int stride_shift; - bool freed_tables; +struct tasklet_head { + struct tasklet_struct *head; + struct tasklet_struct **tail; }; -struct exception_stacks { - char DF_stack_guard[0]; - char DF_stack[4096]; - char NMI_stack_guard[0]; - char NMI_stack[4096]; - char DB2_stack_guard[0]; - char DB2_stack[0]; - char DB1_stack_guard[0]; - char DB1_stack[4096]; - char DB_stack_guard[0]; - char DB_stack[4096]; - char MCE_stack_guard[0]; - char MCE_stack[4096]; - char IST_top_guard[0]; +typedef struct tasklet_struct **pto_T_____16; + +struct resource_entry { + struct list_head node; + struct resource *res; + resource_size_t offset; + struct resource __res; }; -struct rb_augment_callbacks { - void (*propagate)(struct rb_node *, struct rb_node *); - void (*copy)(struct rb_node *, struct rb_node *); - void (*rotate)(struct rb_node *, struct rb_node *); +struct resource_constraint { + resource_size_t min; + resource_size_t max; + resource_size_t align; + resource_size_t (*alignf)(void *, const struct resource *, resource_size_t, resource_size_t); + void *alignf_data; }; enum { - MEMTYPE_EXACT_MATCH = 0, - MEMTYPE_END_MATCH = 1, + MAX_IORES_LEVEL = 5, }; -struct hugepage_subpool { - spinlock_t lock; - long int count; - long int max_hpages; - long int used_hpages; - struct hstate *hstate; - long int min_hpages; - long int rsv_hpages; +struct region_devres { + struct resource *parent; + resource_size_t start; + resource_size_t n; }; -struct hugetlbfs_sb_info { - long int max_inodes; - long int free_inodes; - spinlock_t stat_lock; - struct hstate *hstate; - struct hugepage_subpool *spool; - kuid_t uid; - kgid_t gid; - umode_t mode; +enum sysctl_writes_mode { + SYSCTL_WRITES_LEGACY = 4294967295, + SYSCTL_WRITES_WARN = 0, + SYSCTL_WRITES_STRICT = 1, }; -struct numa_memblk { - u64 start; - u64 end; - int nid; +struct do_proc_dointvec_minmax_conv_param { + int *min; + int *max; }; -struct numa_meminfo { - int nr_blks; - struct numa_memblk blk[128]; +struct do_proc_douintvec_minmax_conv_param { + unsigned int *min; + unsigned int *max; }; -struct acpi_srat_cpu_affinity { - struct acpi_subtable_header header; - u8 proximity_domain_lo; - u8 apic_id; - u32 flags; - u8 local_sapic_eid; - u8 proximity_domain_hi[3]; - u32 clock_domain; +struct __sysctl_args { + int *name; + int nlen; + void *oldval; + size_t *oldlenp; + void *newval; + size_t newlen; + long unsigned int __unused[4]; }; -struct acpi_srat_x2apic_cpu_affinity { - struct acpi_subtable_header header; - u16 reserved; - u32 proximity_domain; - u32 apic_id; - u32 flags; - u32 clock_domain; - u32 reserved2; +enum { + CTL_KERN = 1, + CTL_VM = 2, + CTL_NET = 3, + CTL_PROC = 4, + CTL_FS = 5, + CTL_DEBUG = 6, + CTL_DEV = 7, + CTL_BUS = 8, + CTL_ABI = 9, + CTL_CPU = 10, + CTL_ARLAN = 254, + CTL_S390DBF = 5677, + CTL_SUNRPC = 7249, + CTL_PM = 9899, + CTL_FRV = 9898, }; -enum uv_system_type { - UV_NONE = 0, - UV_LEGACY_APIC = 1, - UV_X2APIC = 2, - UV_NON_UNIQUE_APIC = 3, +enum { + KERN_OSTYPE = 1, + KERN_OSRELEASE = 2, + KERN_OSREV = 3, + KERN_VERSION = 4, + KERN_SECUREMASK = 5, + KERN_PROF = 6, + KERN_NODENAME = 7, + KERN_DOMAINNAME = 8, + KERN_PANIC = 15, + KERN_REALROOTDEV = 16, + KERN_SPARC_REBOOT = 21, + KERN_CTLALTDEL = 22, + KERN_PRINTK = 23, + KERN_NAMETRANS = 24, + KERN_PPC_HTABRECLAIM = 25, + KERN_PPC_ZEROPAGED = 26, + KERN_PPC_POWERSAVE_NAP = 27, + KERN_MODPROBE = 28, + KERN_SG_BIG_BUFF = 29, + KERN_ACCT = 30, + KERN_PPC_L2CR = 31, + KERN_RTSIGNR = 32, + KERN_RTSIGMAX = 33, + KERN_SHMMAX = 34, + KERN_MSGMAX = 35, + KERN_MSGMNB = 36, + KERN_MSGPOOL = 37, + KERN_SYSRQ = 38, + KERN_MAX_THREADS = 39, + KERN_RANDOM = 40, + KERN_SHMALL = 41, + KERN_MSGMNI = 42, + KERN_SEM = 43, + KERN_SPARC_STOP_A = 44, + KERN_SHMMNI = 45, + KERN_OVERFLOWUID = 46, + KERN_OVERFLOWGID = 47, + KERN_SHMPATH = 48, + KERN_HOTPLUG = 49, + KERN_IEEE_EMULATION_WARNINGS = 50, + KERN_S390_USER_DEBUG_LOGGING = 51, + KERN_CORE_USES_PID = 52, + KERN_TAINTED = 53, + KERN_CADPID = 54, + KERN_PIDMAX = 55, + KERN_CORE_PATTERN = 56, + KERN_PANIC_ON_OOPS = 57, + KERN_HPPA_PWRSW = 58, + KERN_HPPA_UNALIGNED = 59, + KERN_PRINTK_RATELIMIT = 60, + KERN_PRINTK_RATELIMIT_BURST = 61, + KERN_PTY = 62, + KERN_NGROUPS_MAX = 63, + KERN_SPARC_SCONS_PWROFF = 64, + KERN_HZ_TIMER = 65, + KERN_UNKNOWN_NMI_PANIC = 66, + KERN_BOOTLOADER_TYPE = 67, + KERN_RANDOMIZE = 68, + KERN_SETUID_DUMPABLE = 69, + KERN_SPIN_RETRY = 70, + KERN_ACPI_VIDEO_FLAGS = 71, + KERN_IA64_UNALIGNED = 72, + KERN_COMPAT_LOG = 73, + KERN_MAX_LOCK_DEPTH = 74, + KERN_NMI_WATCHDOG = 75, + KERN_PANIC_ON_NMI = 76, + KERN_PANIC_ON_WARN = 77, + KERN_PANIC_PRINT = 78, }; -struct rnd_state { - __u32 s1; - __u32 s2; - __u32 s3; - __u32 s4; +struct xfs_sysctl_val { + int min; + int val; + int max; }; -struct kaslr_memory_region { - long unsigned int *base; - long unsigned int size_tb; +typedef struct xfs_sysctl_val xfs_sysctl_val_t; + +struct xfs_param { + xfs_sysctl_val_t sgid_inherit; + xfs_sysctl_val_t symlink_mode; + xfs_sysctl_val_t panic_mask; + xfs_sysctl_val_t error_level; + xfs_sysctl_val_t syncd_timer; + xfs_sysctl_val_t stats_clear; + xfs_sysctl_val_t inherit_sync; + xfs_sysctl_val_t inherit_nodump; + xfs_sysctl_val_t inherit_noatim; + xfs_sysctl_val_t xfs_buf_timer; + xfs_sysctl_val_t xfs_buf_age; + xfs_sysctl_val_t inherit_nosym; + xfs_sysctl_val_t rotorstep; + xfs_sysctl_val_t inherit_nodfrg; + xfs_sysctl_val_t fstrm_timer; + xfs_sysctl_val_t eofb_timer; + xfs_sysctl_val_t cowb_timer; }; -enum pti_mode { - PTI_AUTO = 0, - PTI_FORCE_OFF = 1, - PTI_FORCE_ON = 2, +typedef struct xfs_param xfs_param_t; + +struct xfs_globals { + int log_recovery_delay; + int mount_delay; + bool bug_on_assert; + bool always_cow; }; -enum pti_clone_level { - PTI_CLONE_PMD = 0, - PTI_CLONE_PTE = 1, +enum ethtool_link_mode_bit_indices { + ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0, + ETHTOOL_LINK_MODE_10baseT_Full_BIT = 1, + ETHTOOL_LINK_MODE_100baseT_Half_BIT = 2, + ETHTOOL_LINK_MODE_100baseT_Full_BIT = 3, + ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 4, + ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 5, + ETHTOOL_LINK_MODE_Autoneg_BIT = 6, + ETHTOOL_LINK_MODE_TP_BIT = 7, + ETHTOOL_LINK_MODE_AUI_BIT = 8, + ETHTOOL_LINK_MODE_MII_BIT = 9, + ETHTOOL_LINK_MODE_FIBRE_BIT = 10, + ETHTOOL_LINK_MODE_BNC_BIT = 11, + ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 12, + ETHTOOL_LINK_MODE_Pause_BIT = 13, + ETHTOOL_LINK_MODE_Asym_Pause_BIT = 14, + ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 15, + ETHTOOL_LINK_MODE_Backplane_BIT = 16, + ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 17, + ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 18, + ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 19, + ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 20, + ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 21, + ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 22, + ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 23, + ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 24, + ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 25, + ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 26, + ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 27, + ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 28, + ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29, + ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30, + ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31, + ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32, + ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33, + ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34, + ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT = 35, + ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 36, + ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT = 37, + ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 38, + ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT = 39, + ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT = 40, + ETHTOOL_LINK_MODE_1000baseX_Full_BIT = 41, + ETHTOOL_LINK_MODE_10000baseCR_Full_BIT = 42, + ETHTOOL_LINK_MODE_10000baseSR_Full_BIT = 43, + ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 44, + ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 45, + ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 46, + ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 47, + ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 48, + ETHTOOL_LINK_MODE_FEC_NONE_BIT = 49, + ETHTOOL_LINK_MODE_FEC_RS_BIT = 50, + ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51, + ETHTOOL_LINK_MODE_50000baseKR_Full_BIT = 52, + ETHTOOL_LINK_MODE_50000baseSR_Full_BIT = 53, + ETHTOOL_LINK_MODE_50000baseCR_Full_BIT = 54, + ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT = 55, + ETHTOOL_LINK_MODE_50000baseDR_Full_BIT = 56, + ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT = 57, + ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT = 58, + ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT = 59, + ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT = 60, + ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT = 61, + ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT = 62, + ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT = 63, + ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 64, + ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 65, + ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 66, + ETHTOOL_LINK_MODE_100baseT1_Full_BIT = 67, + ETHTOOL_LINK_MODE_1000baseT1_Full_BIT = 68, + ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT = 69, + ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT = 70, + ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 71, + ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT = 72, + ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT = 73, + __ETHTOOL_LINK_MODE_MASK_NBITS = 74, }; -typedef short unsigned int __kernel_old_uid_t; +enum { + NAPI_STATE_SCHED = 0, + NAPI_STATE_MISSED = 1, + NAPI_STATE_DISABLE = 2, + NAPI_STATE_NPSVC = 3, + NAPI_STATE_HASHED = 4, + NAPI_STATE_NO_BUSY_POLL = 5, + NAPI_STATE_IN_BUSY_POLL = 6, +}; -typedef short unsigned int __kernel_old_gid_t; +struct compat_sysctl_args { + compat_uptr_t name; + int nlen; + compat_uptr_t oldval; + compat_uptr_t oldlenp; + compat_uptr_t newval; + compat_size_t newlen; + compat_ulong_t __unused[4]; +}; -typedef struct { - int val[2]; -} __kernel_fsid_t; +struct __user_cap_header_struct { + __u32 version; + int pid; +}; -typedef __kernel_old_uid_t old_uid_t; +typedef struct __user_cap_header_struct *cap_user_header_t; -typedef __kernel_old_gid_t old_gid_t; +struct __user_cap_data_struct { + __u32 effective; + __u32 permitted; + __u32 inheritable; +}; -struct kstatfs { - long int f_type; - long int f_bsize; - u64 f_blocks; - u64 f_bfree; - u64 f_bavail; - u64 f_files; - u64 f_ffree; - __kernel_fsid_t f_fsid; - long int f_namelen; - long int f_frsize; - long int f_flags; - long int f_spare[4]; +typedef struct __user_cap_data_struct *cap_user_data_t; + +struct sigqueue { + struct list_head list; + int flags; + kernel_siginfo_t info; + struct user_struct *user; }; -struct kernel_clone_args { - u64 flags; - int *pidfd; - int *child_tid; - int *parent_tid; - int exit_signal; - long unsigned int stack; - long unsigned int stack_size; - long unsigned int tls; - pid_t *set_tid; - size_t set_tid_size; +struct ptrace_peeksiginfo_args { + __u64 off; + __u32 flags; + __s32 nr; }; -struct stat64 { - long long unsigned int st_dev; - unsigned char __pad0[4]; - unsigned int __st_ino; - unsigned int st_mode; - unsigned int st_nlink; - unsigned int st_uid; - unsigned int st_gid; - long long unsigned int st_rdev; - unsigned char __pad3[4]; - long long int st_size; - unsigned int st_blksize; - long long int st_blocks; - unsigned int st_atime; - unsigned int st_atime_nsec; - unsigned int st_mtime; - unsigned int st_mtime_nsec; - unsigned int st_ctime; - unsigned int st_ctime_nsec; - long long unsigned int st_ino; -} __attribute__((packed)); +struct ptrace_syscall_info { + __u8 op; + __u32 arch; + __u64 instruction_pointer; + __u64 stack_pointer; + union { + struct { + __u64 nr; + __u64 args[6]; + } entry; + struct { + __s64 rval; + __u8 is_error; + } exit; + struct { + __u64 nr; + __u64 args[6]; + __u32 ret_data; + } seccomp; + }; +}; -struct mmap_arg_struct32 { - unsigned int addr; - unsigned int len; - unsigned int prot; - unsigned int flags; - unsigned int fd; - unsigned int offset; +struct compat_iovec { + compat_uptr_t iov_base; + compat_size_t iov_len; }; -struct sigcontext_32 { - __u16 gs; - __u16 __gsh; - __u16 fs; - __u16 __fsh; - __u16 es; - __u16 __esh; - __u16 ds; - __u16 __dsh; - __u32 di; - __u32 si; - __u32 bp; - __u32 sp; - __u32 bx; - __u32 dx; - __u32 cx; - __u32 ax; - __u32 trapno; - __u32 err; - __u32 ip; - __u16 cs; - __u16 __csh; - __u32 flags; - __u32 sp_at_signal; - __u16 ss; - __u16 __ssh; - __u32 fpstate; - __u32 oldmask; - __u32 cr2; +typedef long unsigned int old_sigset_t; + +enum siginfo_layout { + SIL_KILL = 0, + SIL_TIMER = 1, + SIL_POLL = 2, + SIL_FAULT = 3, + SIL_FAULT_MCEERR = 4, + SIL_FAULT_BNDERR = 5, + SIL_FAULT_PKUERR = 6, + SIL_CHLD = 7, + SIL_RT = 8, + SIL_SYS = 9, }; -typedef u32 compat_size_t; +typedef u32 compat_old_sigset_t; -struct compat_sigaltstack { - compat_uptr_t ss_sp; - int ss_flags; - compat_size_t ss_size; +struct compat_sigaction { + compat_uptr_t sa_handler; + compat_ulong_t sa_flags; + compat_uptr_t sa_restorer; + compat_sigset_t sa_mask; }; -typedef struct compat_sigaltstack compat_stack_t; +struct compat_old_sigaction { + compat_uptr_t sa_handler; + compat_old_sigset_t sa_mask; + compat_ulong_t sa_flags; + compat_uptr_t sa_restorer; +}; -struct ucontext_ia32 { - unsigned int uc_flags; - unsigned int uc_link; - compat_stack_t uc_stack; - struct sigcontext_32 uc_mcontext; - compat_sigset_t uc_sigmask; +enum { + TRACE_SIGNAL_DELIVERED = 0, + TRACE_SIGNAL_IGNORED = 1, + TRACE_SIGNAL_ALREADY_PENDING = 2, + TRACE_SIGNAL_OVERFLOW_FAIL = 3, + TRACE_SIGNAL_LOSE_INFO = 4, }; -struct sigframe_ia32 { - u32 pretcode; +struct trace_event_raw_signal_generate { + struct trace_entry ent; int sig; - struct sigcontext_32 sc; - struct _fpstate_32 fpstate_unused; - unsigned int extramask[1]; - char retcode[8]; + int errno; + int code; + char comm[16]; + pid_t pid; + int group; + int result; + char __data[0]; }; -struct rt_sigframe_ia32 { - u32 pretcode; +struct trace_event_raw_signal_deliver { + struct trace_entry ent; int sig; - u32 pinfo; - u32 puc; - compat_siginfo_t info; - struct ucontext_ia32 uc; - char retcode[8]; + int errno; + int code; + long unsigned int sa_handler; + long unsigned int sa_flags; + char __data[0]; }; -typedef struct { - efi_guid_t guid; - u64 table; -} efi_config_table_64_t; +struct trace_event_data_offsets_signal_generate {}; -struct efi_mem_range { - struct range range; - u64 attribute; +struct trace_event_data_offsets_signal_deliver {}; + +typedef void (*btf_trace_signal_generate)(void *, int, struct kernel_siginfo *, struct task_struct *, int, int); + +typedef void (*btf_trace_signal_deliver)(void *, int, struct kernel_siginfo *, struct k_sigaction *); + +typedef __kernel_clock_t clock_t; + +struct sysinfo { + __kernel_long_t uptime; + __kernel_ulong_t loads[3]; + __kernel_ulong_t totalram; + __kernel_ulong_t freeram; + __kernel_ulong_t sharedram; + __kernel_ulong_t bufferram; + __kernel_ulong_t totalswap; + __kernel_ulong_t freeswap; + __u16 procs; + __u16 pad; + __kernel_ulong_t totalhigh; + __kernel_ulong_t freehigh; + __u32 mem_unit; + char _f[0]; }; -enum efi_rts_ids { - EFI_NONE = 0, - EFI_GET_TIME = 1, - EFI_SET_TIME = 2, - EFI_GET_WAKEUP_TIME = 3, - EFI_SET_WAKEUP_TIME = 4, - EFI_GET_VARIABLE = 5, - EFI_GET_NEXT_VARIABLE = 6, - EFI_SET_VARIABLE = 7, - EFI_QUERY_VARIABLE_INFO = 8, - EFI_GET_NEXT_HIGH_MONO_COUNT = 9, - EFI_RESET_SYSTEM = 10, - EFI_UPDATE_CAPSULE = 11, - EFI_QUERY_CAPSULE_CAPS = 12, +enum { + PER_LINUX = 0, + PER_LINUX_32BIT = 8388608, + PER_LINUX_FDPIC = 524288, + PER_SVR4 = 68157441, + PER_SVR3 = 83886082, + PER_SCOSVR3 = 117440515, + PER_OSR5 = 100663299, + PER_WYSEV386 = 83886084, + PER_ISCR4 = 67108869, + PER_BSD = 6, + PER_SUNOS = 67108870, + PER_XENIX = 83886087, + PER_LINUX32 = 8, + PER_LINUX32_3GB = 134217736, + PER_IRIX32 = 67108873, + PER_IRIXN32 = 67108874, + PER_IRIX64 = 67108875, + PER_RISCOS = 12, + PER_SOLARIS = 67108877, + PER_UW7 = 68157454, + PER_OSF4 = 15, + PER_HPUX = 16, + PER_MASK = 255, }; -struct efi_runtime_work { - void *arg1; - void *arg2; - void *arg3; - void *arg4; - void *arg5; - efi_status_t status; - struct work_struct work; - enum efi_rts_ids efi_rts_id; - struct completion efi_rts_comp; +struct rlimit64 { + __u64 rlim_cur; + __u64 rlim_max; }; -struct efi_scratch { - u64 phys_stack; - struct mm_struct *prev_mm; +struct oldold_utsname { + char sysname[9]; + char nodename[9]; + char release[9]; + char version[9]; + char machine[9]; }; -struct efi_setup_data { - u64 fw_vendor; - u64 runtime; - u64 tables; - u64 smbios; - u64 reserved[8]; +struct old_utsname { + char sysname[65]; + char nodename[65]; + char release[65]; + char version[65]; + char machine[65]; }; -typedef struct { - efi_table_hdr_t hdr; - u32 get_time; - u32 set_time; - u32 get_wakeup_time; - u32 set_wakeup_time; - u32 set_virtual_address_map; - u32 convert_pointer; - u32 get_variable; - u32 get_next_variable; - u32 set_variable; - u32 get_next_high_mono_count; - u32 reset_system; - u32 update_capsule; - u32 query_capsule_caps; - u32 query_variable_info; -} efi_runtime_services_32_t; +enum uts_proc { + UTS_PROC_OSTYPE = 0, + UTS_PROC_OSRELEASE = 1, + UTS_PROC_VERSION = 2, + UTS_PROC_HOSTNAME = 3, + UTS_PROC_DOMAINNAME = 4, +}; -typedef struct { - efi_table_hdr_t hdr; - u64 get_time; - u64 set_time; - u64 get_wakeup_time; - u64 set_wakeup_time; - u64 set_virtual_address_map; - u64 convert_pointer; - u64 get_variable; - u64 get_next_variable; - u64 set_variable; - u64 get_next_high_mono_count; - u64 reset_system; - u64 update_capsule; - u64 query_capsule_caps; - u64 query_variable_info; -} efi_runtime_services_64_t; +struct prctl_mm_map { + __u64 start_code; + __u64 end_code; + __u64 start_data; + __u64 end_data; + __u64 start_brk; + __u64 brk; + __u64 start_stack; + __u64 arg_start; + __u64 arg_end; + __u64 env_start; + __u64 env_end; + __u64 *auxv; + __u32 auxv_size; + __u32 exe_fd; +}; -typedef struct { - efi_guid_t guid; - const char *name; - long unsigned int *ptr; -} efi_config_table_type_t; +struct tms { + __kernel_clock_t tms_utime; + __kernel_clock_t tms_stime; + __kernel_clock_t tms_cutime; + __kernel_clock_t tms_cstime; +}; -typedef struct { - efi_table_hdr_t hdr; - u64 fw_vendor; - u32 fw_revision; - u32 __pad1; - u64 con_in_handle; - u64 con_in; - u64 con_out_handle; - u64 con_out; - u64 stderr_handle; - u64 stderr; - u64 runtime; - u64 boottime; - u32 nr_tables; - u32 __pad2; - u64 tables; -} efi_system_table_64_t; +struct getcpu_cache { + long unsigned int blob[16]; +}; -typedef struct { - efi_table_hdr_t hdr; - u32 fw_vendor; - u32 fw_revision; - u32 con_in_handle; - u32 con_in; - u32 con_out_handle; - u32 con_out; - u32 stderr_handle; - u32 stderr; - u32 runtime; - u32 boottime; - u32 nr_tables; - u32 tables; -} efi_system_table_32_t; +struct compat_tms { + compat_clock_t tms_utime; + compat_clock_t tms_stime; + compat_clock_t tms_cutime; + compat_clock_t tms_cstime; +}; -struct efi_memory_map_data { - phys_addr_t phys_map; - long unsigned int size; - long unsigned int desc_version; - long unsigned int desc_size; +struct compat_rlimit { + compat_ulong_t rlim_cur; + compat_ulong_t rlim_max; }; -typedef int (*efi_memattr_perm_setter)(struct mm_struct *, efi_memory_desc_t *); +struct compat_sysinfo { + s32 uptime; + u32 loads[3]; + u32 totalram; + u32 freeram; + u32 sharedram; + u32 bufferram; + u32 totalswap; + u32 freeswap; + u16 procs; + u16 pad; + u32 totalhigh; + u32 freehigh; + u32 mem_unit; + char _f[8]; +}; -typedef u16 ucs2_char_t; +struct umh_info { + const char *cmdline; + struct file *pipe_to_umh; + struct file *pipe_from_umh; + struct list_head list; + void (*cleanup)(struct umh_info *); + pid_t pid; +}; -struct wait_queue_entry; +struct wq_flusher; -typedef int (*wait_queue_func_t)(struct wait_queue_entry *, unsigned int, int, void *); +struct worker; -struct wait_queue_entry { +struct workqueue_attrs; + +struct pool_workqueue; + +struct wq_device; + +struct workqueue_struct { + struct list_head pwqs; + struct list_head list; + struct mutex mutex; + int work_color; + int flush_color; + atomic_t nr_pwqs_to_flush; + struct wq_flusher *first_flusher; + struct list_head flusher_queue; + struct list_head flusher_overflow; + struct list_head maydays; + struct worker *rescuer; + int nr_drainers; + int saved_max_active; + struct workqueue_attrs *unbound_attrs; + struct pool_workqueue *dfl_pwq; + struct wq_device *wq_dev; + char name[24]; + struct callback_head rcu; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; unsigned int flags; - void *private; - wait_queue_func_t func; - struct list_head entry; + struct pool_workqueue *cpu_pwqs; + struct pool_workqueue *numa_pwq_tbl[0]; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -enum { - PM_QOS_RESERVED = 0, - PM_QOS_CPU_DMA_LATENCY = 1, - PM_QOS_NUM_CLASSES = 2, +struct workqueue_attrs { + int nice; + cpumask_var_t cpumask; + bool no_numa; }; -struct pm_qos_request { - struct plist_node node; - int pm_qos_class; - struct delayed_work work; +struct execute_work { + struct work_struct work; }; -enum tk_offsets { - TK_OFFS_REAL = 0, - TK_OFFS_BOOT = 1, - TK_OFFS_TAI = 2, - TK_OFFS_MAX = 3, +enum { + WQ_UNBOUND = 2, + WQ_FREEZABLE = 4, + WQ_MEM_RECLAIM = 8, + WQ_HIGHPRI = 16, + WQ_CPU_INTENSIVE = 32, + WQ_SYSFS = 64, + WQ_POWER_EFFICIENT = 128, + __WQ_DRAINING = 65536, + __WQ_ORDERED = 131072, + __WQ_LEGACY = 262144, + __WQ_ORDERED_EXPLICIT = 524288, + WQ_MAX_ACTIVE = 512, + WQ_MAX_UNBOUND_PER_CPU = 4, + WQ_DFL_ACTIVE = 256, }; -typedef long unsigned int vm_flags_t; +typedef unsigned int xa_mark_t; -struct clone_args { - __u64 flags; - __u64 pidfd; - __u64 child_tid; - __u64 parent_tid; - __u64 exit_signal; - __u64 stack; - __u64 stack_size; - __u64 tls; - __u64 set_tid; - __u64 set_tid_size; +enum xa_lock_type { + XA_LOCK_IRQ = 1, + XA_LOCK_BH = 2, }; -struct fdtable { - unsigned int max_fds; - struct file **fd; - long unsigned int *close_on_exec; - long unsigned int *open_fds; - long unsigned int *full_fds_bits; - struct callback_head rcu; +struct __una_u32 { + u32 x; }; -struct files_struct { - atomic_t count; - bool resize_in_progress; - wait_queue_head_t resize_wait; - struct fdtable *fdt; - struct fdtable fdtab; +struct worker_pool; + +struct worker { + union { + struct list_head entry; + struct hlist_node hentry; + }; + struct work_struct *current_work; + work_func_t current_func; + struct pool_workqueue *current_pwq; + struct list_head scheduled; + struct task_struct *task; + struct worker_pool *pool; + struct list_head node; + long unsigned int last_active; + unsigned int flags; + int id; + int sleeping; + char desc[24]; + struct workqueue_struct *rescue_wq; + work_func_t last_func; +}; + +struct pool_workqueue { + struct worker_pool *pool; + struct workqueue_struct *wq; + int work_color; + int flush_color; + int refcnt; + int nr_in_flight[15]; + int nr_active; + int max_active; + struct list_head delayed_works; + struct list_head pwqs_node; + struct list_head mayday_node; + struct work_struct unbound_release_work; + struct callback_head rcu; long: 64; long: 64; long: 64; long: 64; - spinlock_t file_lock; - unsigned int next_fd; - long unsigned int close_on_exec_init[1]; - long unsigned int open_fds_init[1]; - long unsigned int full_fds_bits_init[1]; - struct file *fd_array[64]; long: 64; long: 64; long: 64; long: 64; }; -struct robust_list { - struct robust_list *next; -}; - -struct robust_list_head { - struct robust_list list; - long int futex_offset; - struct robust_list *list_op_pending; -}; - -struct multiprocess_signals { - sigset_t signal; - struct hlist_node node; +struct worker_pool { + spinlock_t lock; + int cpu; + int node; + int id; + unsigned int flags; + long unsigned int watchdog_ts; + struct list_head worklist; + int nr_workers; + int nr_idle; + struct list_head idle_list; + struct timer_list idle_timer; + struct timer_list mayday_timer; + struct hlist_head busy_hash[64]; + struct worker *manager; + struct list_head workers; + struct completion *detach_completion; + struct ida worker_ida; + struct workqueue_attrs *attrs; + struct hlist_node hash_node; + int refcnt; + long: 32; + long: 64; + long: 64; + long: 64; + atomic_t nr_running; + struct callback_head rcu; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -typedef int (*proc_visitor)(struct task_struct *, void *); - enum { - IOPRIO_CLASS_NONE = 0, - IOPRIO_CLASS_RT = 1, - IOPRIO_CLASS_BE = 2, - IOPRIO_CLASS_IDLE = 3, + POOL_MANAGER_ACTIVE = 1, + POOL_DISASSOCIATED = 4, + WORKER_DIE = 2, + WORKER_IDLE = 4, + WORKER_PREP = 8, + WORKER_CPU_INTENSIVE = 64, + WORKER_UNBOUND = 128, + WORKER_REBOUND = 256, + WORKER_NOT_RUNNING = 456, + NR_STD_WORKER_POOLS = 2, + UNBOUND_POOL_HASH_ORDER = 6, + BUSY_WORKER_HASH_ORDER = 6, + MAX_IDLE_WORKERS_RATIO = 4, + IDLE_WORKER_TIMEOUT = 300000, + MAYDAY_INITIAL_TIMEOUT = 10, + MAYDAY_INTERVAL = 100, + CREATE_COOLDOWN = 1000, + RESCUER_NICE_LEVEL = 4294967276, + HIGHPRI_NICE_LEVEL = 4294967276, + WQ_NAME_LEN = 24, }; -enum memcg_stat_item { - MEMCG_CACHE = 32, - MEMCG_RSS = 33, - MEMCG_RSS_HUGE = 34, - MEMCG_SWAP = 35, - MEMCG_SOCK = 36, - MEMCG_KERNEL_STACK_KB = 37, - MEMCG_NR_STAT = 38, +struct wq_flusher { + struct list_head list; + int flush_color; + struct completion done; }; -typedef struct poll_table_struct poll_table; +struct wq_device { + struct workqueue_struct *wq; + struct device dev; +}; -enum { - FUTEX_STATE_OK = 0, - FUTEX_STATE_EXITING = 1, - FUTEX_STATE_DEAD = 2, +struct trace_event_raw_workqueue_work { + struct trace_entry ent; + void *work; + char __data[0]; }; -struct trace_event_raw_task_newtask { +struct trace_event_raw_workqueue_queue_work { struct trace_entry ent; - pid_t pid; - char comm[16]; - long unsigned int clone_flags; - short int oom_score_adj; + void *work; + void *function; + void *workqueue; + unsigned int req_cpu; + unsigned int cpu; char __data[0]; }; -struct trace_event_raw_task_rename { +struct trace_event_raw_workqueue_execute_start { struct trace_entry ent; - pid_t pid; - char oldcomm[16]; - char newcomm[16]; - short int oom_score_adj; + void *work; + void *function; char __data[0]; }; -struct trace_event_data_offsets_task_newtask {}; +struct trace_event_data_offsets_workqueue_work {}; -struct trace_event_data_offsets_task_rename {}; +struct trace_event_data_offsets_workqueue_queue_work {}; -struct taint_flag { - char c_true; - char c_false; - bool module; +struct trace_event_data_offsets_workqueue_execute_start {}; + +typedef void (*btf_trace_workqueue_queue_work)(void *, unsigned int, struct pool_workqueue *, struct work_struct *); + +typedef void (*btf_trace_workqueue_activate_work)(void *, struct work_struct *); + +typedef void (*btf_trace_workqueue_execute_start)(void *, struct work_struct *); + +typedef void (*btf_trace_workqueue_execute_end)(void *, struct work_struct *); + +struct wq_barrier { + struct work_struct work; + struct completion done; + struct task_struct *task; }; -enum ftrace_dump_mode { - DUMP_NONE = 0, - DUMP_ALL = 1, - DUMP_ORIG = 2, +struct cwt_wait { + wait_queue_entry_t wait; + struct work_struct *work; }; -enum kmsg_dump_reason { - KMSG_DUMP_UNDEF = 0, - KMSG_DUMP_PANIC = 1, - KMSG_DUMP_OOPS = 2, - KMSG_DUMP_EMERG = 3, - KMSG_DUMP_RESTART = 4, - KMSG_DUMP_HALT = 5, - KMSG_DUMP_POWEROFF = 6, +struct apply_wqattrs_ctx { + struct workqueue_struct *wq; + struct workqueue_attrs *attrs; + struct list_head list; + struct pool_workqueue *dfl_pwq; + struct pool_workqueue *pwq_tbl[0]; }; -enum con_flush_mode { - CONSOLE_FLUSH_PENDING = 0, - CONSOLE_REPLAY_ALL = 1, +struct work_for_cpu { + struct work_struct work; + long int (*fn)(void *); + void *arg; + long int ret; }; -struct warn_args { - const char *fmt; - va_list args; +typedef void (*task_work_func_t)(struct callback_head *); + +enum { + KERNEL_PARAM_OPS_FL_NOARG = 1, }; -struct smp_hotplug_thread { - struct task_struct **store; - struct list_head list; - int (*thread_should_run)(unsigned int); - void (*thread_fn)(unsigned int); - void (*create)(unsigned int); - void (*setup)(unsigned int); - void (*cleanup)(unsigned int, bool); - void (*park)(unsigned int); - void (*unpark)(unsigned int); - bool selfparking; - const char *thread_comm; +enum { + KERNEL_PARAM_FL_UNSAFE = 1, + KERNEL_PARAM_FL_HWPARAM = 2, }; -struct trace_event_raw_cpuhp_enter { - struct trace_entry ent; - unsigned int cpu; - int target; - int idx; - void *fun; - char __data[0]; +struct param_attribute { + struct module_attribute mattr; + const struct kernel_param *param; }; -struct trace_event_raw_cpuhp_multi_enter { - struct trace_entry ent; - unsigned int cpu; - int target; - int idx; - void *fun; - char __data[0]; +struct module_param_attrs { + unsigned int num; + struct attribute_group grp; + struct param_attribute attrs[0]; }; -struct trace_event_raw_cpuhp_exit { - struct trace_entry ent; - unsigned int cpu; - int state; - int idx; - int ret; - char __data[0]; +struct module_version_attribute { + struct module_attribute mattr; + const char *module_name; + const char *version; }; -struct trace_event_data_offsets_cpuhp_enter {}; +struct kmalloced_param { + struct list_head list; + char val[0]; +}; -struct trace_event_data_offsets_cpuhp_multi_enter {}; +struct sched_param { + int sched_priority; +}; -struct trace_event_data_offsets_cpuhp_exit {}; +struct kthread_work; -struct cpuhp_cpu_state { - enum cpuhp_state state; - enum cpuhp_state target; - enum cpuhp_state fail; - struct task_struct *thread; - bool should_run; - bool rollback; - bool single; - bool bringup; - struct hlist_node *node; - struct hlist_node *last; - enum cpuhp_state cb_state; - int result; - struct completion done_up; - struct completion done_down; +typedef void (*kthread_work_func_t)(struct kthread_work *); + +struct kthread_worker; + +struct kthread_work { + struct list_head node; + kthread_work_func_t func; + struct kthread_worker *worker; + int canceling; }; -struct cpuhp_step { - const char *name; - union { - int (*single)(unsigned int); - int (*multi)(unsigned int, struct hlist_node *); - } startup; - union { - int (*single)(unsigned int); - int (*multi)(unsigned int, struct hlist_node *); - } teardown; - struct hlist_head list; - bool cant_stop; - bool multi_instance; +enum { + KTW_FREEZABLE = 1, }; -enum cpu_mitigations { - CPU_MITIGATIONS_OFF = 0, - CPU_MITIGATIONS_AUTO = 1, - CPU_MITIGATIONS_AUTO_NOSMT = 2, +struct kthread_worker { + unsigned int flags; + raw_spinlock_t lock; + struct list_head work_list; + struct list_head delayed_work_list; + struct task_struct *task; + struct kthread_work *current_work; }; -typedef void (*rcu_callback_t)(struct callback_head *); +struct kthread_delayed_work { + struct kthread_work work; + struct timer_list timer; +}; -struct __kernel_old_timeval { - __kernel_long_t tv_sec; - __kernel_long_t tv_usec; +struct kthread_create_info { + int (*threadfn)(void *); + void *data; + int node; + struct task_struct *result; + struct completion *done; + struct list_head list; }; -typedef struct wait_queue_entry wait_queue_entry_t; +struct kthread { + long unsigned int flags; + unsigned int cpu; + void *data; + struct completion parked; + struct completion exited; +}; -struct old_timeval32 { - old_time32_t tv_sec; - s32 tv_usec; +enum KTHREAD_BITS { + KTHREAD_IS_PER_CPU = 0, + KTHREAD_SHOULD_STOP = 1, + KTHREAD_SHOULD_PARK = 2, }; -struct rusage { - struct __kernel_old_timeval ru_utime; - struct __kernel_old_timeval ru_stime; - __kernel_long_t ru_maxrss; - __kernel_long_t ru_ixrss; - __kernel_long_t ru_idrss; - __kernel_long_t ru_isrss; - __kernel_long_t ru_minflt; - __kernel_long_t ru_majflt; - __kernel_long_t ru_nswap; - __kernel_long_t ru_inblock; - __kernel_long_t ru_oublock; - __kernel_long_t ru_msgsnd; - __kernel_long_t ru_msgrcv; - __kernel_long_t ru_nsignals; - __kernel_long_t ru_nvcsw; - __kernel_long_t ru_nivcsw; +struct kthread_flush_work { + struct kthread_work work; + struct completion done; }; -struct fd { - struct file *file; - unsigned int flags; +struct pt_regs___2; + +struct ipc_ids { + int in_use; + short unsigned int seq; + struct rw_semaphore rwsem; + struct idr ipcs_idr; + int max_idx; + int last_idx; + struct rhashtable key_ht; }; -struct compat_rusage { - struct old_timeval32 ru_utime; - struct old_timeval32 ru_stime; - compat_long_t ru_maxrss; - compat_long_t ru_ixrss; - compat_long_t ru_idrss; - compat_long_t ru_isrss; - compat_long_t ru_minflt; - compat_long_t ru_majflt; - compat_long_t ru_nswap; - compat_long_t ru_inblock; - compat_long_t ru_oublock; - compat_long_t ru_msgsnd; - compat_long_t ru_msgrcv; - compat_long_t ru_nsignals; - compat_long_t ru_nvcsw; - compat_long_t ru_nivcsw; +struct ipc_namespace { + refcount_t count; + struct ipc_ids ids[3]; + int sem_ctls[4]; + int used_sems; + unsigned int msg_ctlmax; + unsigned int msg_ctlmnb; + unsigned int msg_ctlmni; + atomic_t msg_bytes; + atomic_t msg_hdrs; + size_t shm_ctlmax; + size_t shm_ctlall; + long unsigned int shm_tot; + int shm_ctlmni; + int shm_rmid_forced; + struct notifier_block ipcns_nb; + struct vfsmount *mq_mnt; + unsigned int mq_queues_count; + unsigned int mq_queues_max; + unsigned int mq_msg_max; + unsigned int mq_msgsize_max; + unsigned int mq_msg_default; + unsigned int mq_msgsize_default; + struct user_namespace *user_ns; + struct ucounts *ucounts; + struct ns_common ns; }; -struct waitid_info { - pid_t pid; - uid_t uid; - int status; - int cause; +struct srcu_notifier_head { + struct mutex mutex; + struct srcu_struct srcu; + struct notifier_block *head; }; -struct wait_opts { - enum pid_type wo_type; - int wo_flags; - struct pid *wo_pid; - struct waitid_info *wo_info; - int wo_stat; - struct rusage *wo_rusage; - wait_queue_entry_t child_wait; - int notask_error; +enum what { + PROC_EVENT_NONE = 0, + PROC_EVENT_FORK = 1, + PROC_EVENT_EXEC = 2, + PROC_EVENT_UID = 4, + PROC_EVENT_GID = 64, + PROC_EVENT_SID = 128, + PROC_EVENT_PTRACE = 256, + PROC_EVENT_COMM = 512, + PROC_EVENT_COREDUMP = 1073741824, + PROC_EVENT_EXIT = 2147483648, }; -struct softirq_action { - void (*action)(struct softirq_action *); +typedef u64 async_cookie_t; + +typedef void (*async_func_t)(void *, async_cookie_t); + +struct async_domain { + struct list_head pending; + unsigned int registered: 1; }; -struct tasklet_struct { - struct tasklet_struct *next; - long unsigned int state; - atomic_t count; - void (*func)(long unsigned int); - long unsigned int data; +struct async_entry { + struct list_head domain_list; + struct list_head global_list; + struct work_struct work; + async_cookie_t cookie; + async_func_t func; + void *data; + struct async_domain *domain; }; -enum { - TASKLET_STATE_SCHED = 0, - TASKLET_STATE_RUN = 1, +struct smpboot_thread_data { + unsigned int cpu; + unsigned int status; + struct smp_hotplug_thread *ht; }; -struct trace_event_raw_irq_handler_entry { - struct trace_entry ent; - int irq; - u32 __data_loc_name; - char __data[0]; +enum { + HP_THREAD_NONE = 0, + HP_THREAD_ACTIVE = 1, + HP_THREAD_PARKED = 2, }; -struct trace_event_raw_irq_handler_exit { - struct trace_entry ent; - int irq; - int ret; - char __data[0]; +struct pin_cookie {}; + +struct dl_bw { + raw_spinlock_t lock; + u64 bw; + u64 total_bw; }; -struct trace_event_raw_softirq { - struct trace_entry ent; - unsigned int vec; - char __data[0]; +struct cpudl_item; + +struct cpudl { + raw_spinlock_t lock; + int size; + cpumask_var_t free_cpus; + struct cpudl_item *elements; }; -struct trace_event_data_offsets_irq_handler_entry { - u32 name; +struct cpupri_vec { + atomic_t count; + cpumask_var_t mask; }; -struct trace_event_data_offsets_irq_handler_exit {}; +struct cpupri { + struct cpupri_vec pri_to_cpu[102]; + int *cpu_to_pri; +}; -struct trace_event_data_offsets_softirq {}; +struct perf_domain; -struct tasklet_head { - struct tasklet_struct *head; - struct tasklet_struct **tail; +struct root_domain___2 { + atomic_t refcount; + atomic_t rto_count; + struct callback_head rcu; + cpumask_var_t span; + cpumask_var_t online; + int overload; + int overutilized; + cpumask_var_t dlo_mask; + atomic_t dlo_count; + struct dl_bw dl_bw; + struct cpudl cpudl; + struct irq_work rto_push_work; + raw_spinlock_t rto_lock; + int rto_loop; + int rto_cpu; + atomic_t rto_loop_next; + atomic_t rto_loop_start; + cpumask_var_t rto_mask; + struct cpupri cpupri; + long unsigned int max_cpu_capacity; + struct perf_domain *pd; }; -typedef u16 pto_T_____6; - -typedef void (*dr_release_t)(struct device *, void *); +struct cfs_rq { + struct load_weight load; + long unsigned int runnable_weight; + unsigned int nr_running; + unsigned int h_nr_running; + unsigned int idle_h_nr_running; + u64 exec_clock; + u64 min_vruntime; + struct rb_root_cached tasks_timeline; + struct sched_entity *curr; + struct sched_entity *next; + struct sched_entity *last; + struct sched_entity *skip; + long: 64; + long: 64; + long: 64; + struct sched_avg avg; + struct { + raw_spinlock_t lock; + int nr; + long unsigned int load_avg; + long unsigned int util_avg; + long unsigned int runnable_sum; + long: 64; + long: 64; + long: 64; + long: 64; + } removed; + long unsigned int tg_load_avg_contrib; + long int propagate; + long int prop_runnable_sum; + long unsigned int h_load; + u64 last_h_load_update; + struct sched_entity *h_load_next; + struct rq *rq; + int on_list; + struct list_head leaf_cfs_rq_list; + struct task_group *tg; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; +}; -typedef int (*dr_match_t)(struct device *, void *, void *); +struct cfs_bandwidth {}; -struct resource_entry { - struct list_head node; - struct resource *res; - resource_size_t offset; - struct resource __res; +struct task_group { + struct cgroup_subsys_state css; + struct sched_entity **se; + struct cfs_rq **cfs_rq; + long unsigned int shares; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + atomic_long_t load_avg; + struct callback_head rcu; + struct list_head list; + struct task_group *parent; + struct list_head siblings; + struct list_head children; + struct cfs_bandwidth cfs_bandwidth; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct resource_constraint { - resource_size_t min; - resource_size_t max; - resource_size_t align; - resource_size_t (*alignf)(void *, const struct resource *, resource_size_t, resource_size_t); - void *alignf_data; +struct update_util_data { + void (*func)(struct update_util_data *, u64, unsigned int); }; enum { - MAX_IORES_LEVEL = 5, + MEMBARRIER_STATE_PRIVATE_EXPEDITED_READY = 1, + MEMBARRIER_STATE_PRIVATE_EXPEDITED = 2, + MEMBARRIER_STATE_GLOBAL_EXPEDITED_READY = 4, + MEMBARRIER_STATE_GLOBAL_EXPEDITED = 8, + MEMBARRIER_STATE_PRIVATE_EXPEDITED_SYNC_CORE_READY = 16, + MEMBARRIER_STATE_PRIVATE_EXPEDITED_SYNC_CORE = 32, }; -struct region_devres { - struct resource *parent; - resource_size_t start; - resource_size_t n; +struct sched_group { + struct sched_group *next; + atomic_t ref; + unsigned int group_weight; + struct sched_group_capacity *sgc; + int asym_prefer_cpu; + long unsigned int cpumask[0]; }; -typedef __kernel_clock_t clock_t; - -struct dentry_stat_t { - long int nr_dentry; - long int nr_unused; - long int age_limit; - long int want_pages; - long int nr_negative; - long int dummy; +struct sched_group_capacity { + atomic_t ref; + long unsigned int capacity; + long unsigned int min_capacity; + long unsigned int max_capacity; + long unsigned int next_update; + int imbalance; + long unsigned int cpumask[0]; }; -struct files_stat_struct { - long unsigned int nr_files; - long unsigned int nr_free_files; - long unsigned int max_files; +struct wake_q_head { + struct wake_q_node *first; + struct wake_q_node **lastp; }; -struct inodes_stat_t { - long int nr_inodes; - long int nr_unused; - long int dummy[5]; +struct sched_attr { + __u32 size; + __u32 sched_policy; + __u64 sched_flags; + __s32 sched_nice; + __u32 sched_priority; + __u64 sched_runtime; + __u64 sched_deadline; + __u64 sched_period; + __u32 sched_util_min; + __u32 sched_util_max; }; -enum sysctl_writes_mode { - SYSCTL_WRITES_LEGACY = -1, - SYSCTL_WRITES_WARN = 0, - SYSCTL_WRITES_STRICT = 1, -}; +struct cpuidle_driver___2; -struct do_proc_dointvec_minmax_conv_param { - int *min; - int *max; +struct cpuidle_state { + char name[16]; + char desc[32]; + u64 exit_latency_ns; + u64 target_residency_ns; + unsigned int flags; + unsigned int exit_latency; + int power_usage; + unsigned int target_residency; + int (*enter)(struct cpuidle_device *, struct cpuidle_driver___2 *, int); + int (*enter_dead)(struct cpuidle_device *, int); + void (*enter_s2idle)(struct cpuidle_device *, struct cpuidle_driver___2 *, int); }; -struct do_proc_douintvec_minmax_conv_param { - unsigned int *min; - unsigned int *max; +struct cpuidle_driver___2 { + const char *name; + struct module *owner; + int refcnt; + unsigned int bctimer: 1; + struct cpuidle_state states[10]; + int state_count; + int safe_state_index; + struct cpumask *cpumask; + const char *governor; }; -struct __sysctl_args { - int *name; - int nlen; - void *oldval; - size_t *oldlenp; - void *newval; - size_t newlen; - long unsigned int __unused[4]; +struct em_cap_state { + long unsigned int frequency; + long unsigned int power; + long unsigned int cost; }; -enum { - CTL_KERN = 1, - CTL_VM = 2, - CTL_NET = 3, - CTL_PROC = 4, - CTL_FS = 5, - CTL_DEBUG = 6, - CTL_DEV = 7, - CTL_BUS = 8, - CTL_ABI = 9, - CTL_CPU = 10, - CTL_ARLAN = 254, - CTL_S390DBF = 5677, - CTL_SUNRPC = 7249, - CTL_PM = 9899, - CTL_FRV = 9898, +struct em_perf_domain { + struct em_cap_state *table; + int nr_cap_states; + long unsigned int cpus[0]; }; enum { - KERN_OSTYPE = 1, - KERN_OSRELEASE = 2, - KERN_OSREV = 3, - KERN_VERSION = 4, - KERN_SECUREMASK = 5, - KERN_PROF = 6, - KERN_NODENAME = 7, - KERN_DOMAINNAME = 8, - KERN_PANIC = 15, - KERN_REALROOTDEV = 16, - KERN_SPARC_REBOOT = 21, - KERN_CTLALTDEL = 22, - KERN_PRINTK = 23, - KERN_NAMETRANS = 24, - KERN_PPC_HTABRECLAIM = 25, - KERN_PPC_ZEROPAGED = 26, - KERN_PPC_POWERSAVE_NAP = 27, - KERN_MODPROBE = 28, - KERN_SG_BIG_BUFF = 29, - KERN_ACCT = 30, - KERN_PPC_L2CR = 31, - KERN_RTSIGNR = 32, - KERN_RTSIGMAX = 33, - KERN_SHMMAX = 34, - KERN_MSGMAX = 35, - KERN_MSGMNB = 36, - KERN_MSGPOOL = 37, - KERN_SYSRQ = 38, - KERN_MAX_THREADS = 39, - KERN_RANDOM = 40, - KERN_SHMALL = 41, - KERN_MSGMNI = 42, - KERN_SEM = 43, - KERN_SPARC_STOP_A = 44, - KERN_SHMMNI = 45, - KERN_OVERFLOWUID = 46, - KERN_OVERFLOWGID = 47, - KERN_SHMPATH = 48, - KERN_HOTPLUG = 49, - KERN_IEEE_EMULATION_WARNINGS = 50, - KERN_S390_USER_DEBUG_LOGGING = 51, - KERN_CORE_USES_PID = 52, - KERN_TAINTED = 53, - KERN_CADPID = 54, - KERN_PIDMAX = 55, - KERN_CORE_PATTERN = 56, - KERN_PANIC_ON_OOPS = 57, - KERN_HPPA_PWRSW = 58, - KERN_HPPA_UNALIGNED = 59, - KERN_PRINTK_RATELIMIT = 60, - KERN_PRINTK_RATELIMIT_BURST = 61, - KERN_PTY = 62, - KERN_NGROUPS_MAX = 63, - KERN_SPARC_SCONS_PWROFF = 64, - KERN_HZ_TIMER = 65, - KERN_UNKNOWN_NMI_PANIC = 66, - KERN_BOOTLOADER_TYPE = 67, - KERN_RANDOMIZE = 68, - KERN_SETUID_DUMPABLE = 69, - KERN_SPIN_RETRY = 70, - KERN_ACPI_VIDEO_FLAGS = 71, - KERN_IA64_UNALIGNED = 72, - KERN_COMPAT_LOG = 73, - KERN_MAX_LOCK_DEPTH = 74, - KERN_NMI_WATCHDOG = 75, - KERN_PANIC_ON_NMI = 76, - KERN_PANIC_ON_WARN = 77, - KERN_PANIC_PRINT = 78, + CFTYPE_ONLY_ON_ROOT = 1, + CFTYPE_NOT_ON_ROOT = 2, + CFTYPE_NS_DELEGATABLE = 4, + CFTYPE_NO_PREFIX = 8, + CFTYPE_WORLD_WRITABLE = 16, + CFTYPE_DEBUG = 32, + __CFTYPE_ONLY_ON_DFL = 65536, + __CFTYPE_NOT_ON_DFL = 131072, }; -enum ethtool_link_mode_bit_indices { - ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0, - ETHTOOL_LINK_MODE_10baseT_Full_BIT = 1, - ETHTOOL_LINK_MODE_100baseT_Half_BIT = 2, - ETHTOOL_LINK_MODE_100baseT_Full_BIT = 3, - ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 4, - ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 5, - ETHTOOL_LINK_MODE_Autoneg_BIT = 6, - ETHTOOL_LINK_MODE_TP_BIT = 7, - ETHTOOL_LINK_MODE_AUI_BIT = 8, - ETHTOOL_LINK_MODE_MII_BIT = 9, - ETHTOOL_LINK_MODE_FIBRE_BIT = 10, - ETHTOOL_LINK_MODE_BNC_BIT = 11, - ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 12, - ETHTOOL_LINK_MODE_Pause_BIT = 13, - ETHTOOL_LINK_MODE_Asym_Pause_BIT = 14, - ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 15, - ETHTOOL_LINK_MODE_Backplane_BIT = 16, - ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 17, - ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 18, - ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 19, - ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 20, - ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 21, - ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 22, - ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 23, - ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 24, - ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 25, - ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 26, - ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 27, - ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 28, - ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29, - ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30, - ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31, - ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32, - ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33, - ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34, - ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT = 35, - ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 36, - ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT = 37, - ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 38, - ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT = 39, - ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT = 40, - ETHTOOL_LINK_MODE_1000baseX_Full_BIT = 41, - ETHTOOL_LINK_MODE_10000baseCR_Full_BIT = 42, - ETHTOOL_LINK_MODE_10000baseSR_Full_BIT = 43, - ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 44, - ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 45, - ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 46, - ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 47, - ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 48, - ETHTOOL_LINK_MODE_FEC_NONE_BIT = 49, - ETHTOOL_LINK_MODE_FEC_RS_BIT = 50, - ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51, - ETHTOOL_LINK_MODE_50000baseKR_Full_BIT = 52, - ETHTOOL_LINK_MODE_50000baseSR_Full_BIT = 53, - ETHTOOL_LINK_MODE_50000baseCR_Full_BIT = 54, - ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT = 55, - ETHTOOL_LINK_MODE_50000baseDR_Full_BIT = 56, - ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT = 57, - ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT = 58, - ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT = 59, - ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT = 60, - ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT = 61, - ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT = 62, - ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT = 63, - ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 64, - ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT = 65, - ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT = 66, - ETHTOOL_LINK_MODE_100baseT1_Full_BIT = 67, - ETHTOOL_LINK_MODE_1000baseT1_Full_BIT = 68, - ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT = 69, - ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT = 70, - ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT = 71, - ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT = 72, - ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT = 73, - __ETHTOOL_LINK_MODE_MASK_NBITS = 74, -}; +typedef int (*cpu_stop_fn_t)(void *); -enum { - NAPI_STATE_SCHED = 0, - NAPI_STATE_MISSED = 1, - NAPI_STATE_DISABLE = 2, - NAPI_STATE_NPSVC = 3, - NAPI_STATE_HASHED = 4, - NAPI_STATE_NO_BUSY_POLL = 5, - NAPI_STATE_IN_BUSY_POLL = 6, -}; +struct cpu_stop_done; -struct compat_sysctl_args { - compat_uptr_t name; - int nlen; - compat_uptr_t oldval; - compat_uptr_t oldlenp; - compat_uptr_t newval; - compat_size_t newlen; - compat_ulong_t __unused[4]; +struct cpu_stop_work { + struct list_head list; + cpu_stop_fn_t fn; + void *arg; + struct cpu_stop_done *done; }; -struct __user_cap_header_struct { - __u32 version; - int pid; +struct cpudl_item { + u64 dl; + int cpu; + int idx; }; -typedef struct __user_cap_header_struct *cap_user_header_t; - -struct __user_cap_data_struct { - __u32 effective; - __u32 permitted; - __u32 inheritable; +struct rt_prio_array { + long unsigned int bitmap[2]; + struct list_head queue[100]; }; -typedef struct __user_cap_data_struct *cap_user_data_t; - -struct sigqueue { - struct list_head list; - int flags; - kernel_siginfo_t info; - struct user_struct *user; +struct rt_bandwidth { + raw_spinlock_t rt_runtime_lock; + ktime_t rt_period; + u64 rt_runtime; + struct hrtimer rt_period_timer; + unsigned int rt_period_active; }; -struct wait_bit_key { - void *flags; - int bit_nr; - long unsigned int timeout; +struct dl_bandwidth { + raw_spinlock_t dl_runtime_lock; + u64 dl_runtime; + u64 dl_period; }; -typedef int wait_bit_action_f(struct wait_bit_key *, int); - -struct ptrace_peeksiginfo_args { - __u64 off; - __u32 flags; - __s32 nr; -}; +typedef int (*tg_visitor)(struct task_group *, void *); -struct ptrace_syscall_info { - __u8 op; - __u32 arch; - __u64 instruction_pointer; - __u64 stack_pointer; - union { - struct { - __u64 nr; - __u64 args[6]; - } entry; - struct { - __s64 rval; - __u8 is_error; - } exit; - struct { - __u64 nr; - __u64 args[6]; - __u32 ret_data; - } seccomp; - }; +struct rt_rq { + struct rt_prio_array active; + unsigned int rt_nr_running; + unsigned int rr_nr_running; + struct { + int curr; + int next; + } highest_prio; + long unsigned int rt_nr_migratory; + long unsigned int rt_nr_total; + int overloaded; + struct plist_head pushable_tasks; + int rt_queued; + int rt_throttled; + u64 rt_time; + u64 rt_runtime; + raw_spinlock_t rt_runtime_lock; }; -struct compat_iovec { - compat_uptr_t iov_base; - compat_size_t iov_len; +struct dl_rq { + struct rb_root_cached root; + long unsigned int dl_nr_running; + struct { + u64 curr; + u64 next; + } earliest_dl; + long unsigned int dl_nr_migratory; + int overloaded; + struct rb_root_cached pushable_dl_tasks_root; + u64 running_bw; + u64 this_bw; + u64 extra_bw; + u64 bw_ratio; }; -typedef long unsigned int old_sigset_t; - -enum siginfo_layout { - SIL_KILL = 0, - SIL_TIMER = 1, - SIL_POLL = 2, - SIL_FAULT = 3, - SIL_FAULT_MCEERR = 4, - SIL_FAULT_BNDERR = 5, - SIL_FAULT_PKUERR = 6, - SIL_CHLD = 7, - SIL_RT = 8, - SIL_SYS = 9, +struct rq { + raw_spinlock_t lock; + unsigned int nr_running; + long unsigned int last_load_update_tick; + long unsigned int last_blocked_load_update_tick; + unsigned int has_blocked_load; + unsigned int nohz_tick_stopped; + atomic_t nohz_flags; + long unsigned int nr_load_updates; + u64 nr_switches; + long: 64; + struct cfs_rq cfs; + struct rt_rq rt; + struct dl_rq dl; + struct list_head leaf_cfs_rq_list; + struct list_head *tmp_alone_branch; + long unsigned int nr_uninterruptible; + struct task_struct *curr; + struct task_struct *idle; + struct task_struct *stop; + long unsigned int next_balance; + struct mm_struct *prev_mm; + unsigned int clock_update_flags; + u64 clock; + long: 64; + long: 64; + long: 64; + u64 clock_task; + u64 clock_pelt; + long unsigned int lost_idle_time; + atomic_t nr_iowait; + int membarrier_state; + struct root_domain___2 *rd; + struct sched_domain *sd; + long unsigned int cpu_capacity; + long unsigned int cpu_capacity_orig; + struct callback_head *balance_callback; + unsigned char idle_balance; + long unsigned int misfit_task_load; + int active_balance; + int push_cpu; + struct cpu_stop_work active_balance_work; + int cpu; + int online; + struct list_head cfs_tasks; + long: 64; + long: 64; + long: 64; + long: 64; + struct sched_avg avg_rt; + struct sched_avg avg_dl; + u64 idle_stamp; + u64 avg_idle; + u64 max_idle_balance_cost; + long unsigned int calc_load_update; + long int calc_load_active; + int hrtick_csd_pending; + long: 32; + long: 64; + long: 64; + call_single_data_t hrtick_csd; + struct hrtimer hrtick_timer; + struct sched_info rq_sched_info; + long long unsigned int rq_cpu_time; + unsigned int yld_count; + unsigned int sched_count; + unsigned int sched_goidle; + unsigned int ttwu_count; + unsigned int ttwu_local; + struct llist_head wake_list; + struct cpuidle_state *idle_state; + long: 64; + long: 64; }; -typedef u32 compat_old_sigset_t; +struct perf_domain { + struct em_perf_domain *em_pd; + struct perf_domain *next; + struct callback_head rcu; +}; -struct compat_sigaction { - compat_uptr_t sa_handler; - compat_ulong_t sa_flags; - compat_uptr_t sa_restorer; - compat_sigset_t sa_mask; +struct rq_flags { + long unsigned int flags; + struct pin_cookie cookie; }; -struct compat_old_sigaction { - compat_uptr_t sa_handler; - compat_old_sigset_t sa_mask; - compat_ulong_t sa_flags; - compat_uptr_t sa_restorer; +enum numa_topology_type { + NUMA_DIRECT = 0, + NUMA_GLUELESS_MESH = 1, + NUMA_BACKPLANE = 2, }; enum { - TRACE_SIGNAL_DELIVERED = 0, - TRACE_SIGNAL_IGNORED = 1, - TRACE_SIGNAL_ALREADY_PENDING = 2, - TRACE_SIGNAL_OVERFLOW_FAIL = 3, - TRACE_SIGNAL_LOSE_INFO = 4, + __SCHED_FEAT_GENTLE_FAIR_SLEEPERS = 0, + __SCHED_FEAT_START_DEBIT = 1, + __SCHED_FEAT_NEXT_BUDDY = 2, + __SCHED_FEAT_LAST_BUDDY = 3, + __SCHED_FEAT_CACHE_HOT_BUDDY = 4, + __SCHED_FEAT_WAKEUP_PREEMPTION = 5, + __SCHED_FEAT_HRTICK = 6, + __SCHED_FEAT_DOUBLE_TICK = 7, + __SCHED_FEAT_NONTASK_CAPACITY = 8, + __SCHED_FEAT_TTWU_QUEUE = 9, + __SCHED_FEAT_SIS_AVG_CPU = 10, + __SCHED_FEAT_SIS_PROP = 11, + __SCHED_FEAT_WARN_DOUBLE_CLOCK = 12, + __SCHED_FEAT_RT_PUSH_IPI = 13, + __SCHED_FEAT_RT_RUNTIME_SHARE = 14, + __SCHED_FEAT_LB_MIN = 15, + __SCHED_FEAT_ATTACH_AGE_LOAD = 16, + __SCHED_FEAT_WA_IDLE = 17, + __SCHED_FEAT_WA_WEIGHT = 18, + __SCHED_FEAT_WA_BIAS = 19, + __SCHED_FEAT_UTIL_EST = 20, + __SCHED_FEAT_UTIL_EST_FASTUP = 21, + __SCHED_FEAT_NR = 22, }; -struct trace_event_raw_signal_generate { +struct trace_event_raw_sched_kthread_stop { struct trace_entry ent; - int sig; - int errno; - int code; char comm[16]; pid_t pid; - int group; - int result; char __data[0]; }; -struct trace_event_raw_signal_deliver { +struct trace_event_raw_sched_kthread_stop_ret { struct trace_entry ent; - int sig; - int errno; - int code; - long unsigned int sa_handler; - long unsigned int sa_flags; + int ret; char __data[0]; }; -struct trace_event_data_offsets_signal_generate {}; - -struct trace_event_data_offsets_signal_deliver {}; - -struct sysinfo { - __kernel_long_t uptime; - __kernel_ulong_t loads[3]; - __kernel_ulong_t totalram; - __kernel_ulong_t freeram; - __kernel_ulong_t sharedram; - __kernel_ulong_t bufferram; - __kernel_ulong_t totalswap; - __kernel_ulong_t freeswap; - __u16 procs; - __u16 pad; - __kernel_ulong_t totalhigh; - __kernel_ulong_t freehigh; - __u32 mem_unit; - char _f[0]; +struct trace_event_raw_sched_wakeup_template { + struct trace_entry ent; + char comm[16]; + pid_t pid; + int prio; + int success; + int target_cpu; + char __data[0]; }; -enum { - PER_LINUX = 0, - PER_LINUX_32BIT = 8388608, - PER_LINUX_FDPIC = 524288, - PER_SVR4 = 68157441, - PER_SVR3 = 83886082, - PER_SCOSVR3 = 117440515, - PER_OSR5 = 100663299, - PER_WYSEV386 = 83886084, - PER_ISCR4 = 67108869, - PER_BSD = 6, - PER_SUNOS = 67108870, - PER_XENIX = 83886087, - PER_LINUX32 = 8, - PER_LINUX32_3GB = 134217736, - PER_IRIX32 = 67108873, - PER_IRIXN32 = 67108874, - PER_IRIX64 = 67108875, - PER_RISCOS = 12, - PER_SOLARIS = 67108877, - PER_UW7 = 68157454, - PER_OSF4 = 15, - PER_HPUX = 16, - PER_MASK = 255, +struct trace_event_raw_sched_switch { + struct trace_entry ent; + char prev_comm[16]; + pid_t prev_pid; + int prev_prio; + long int prev_state; + char next_comm[16]; + pid_t next_pid; + int next_prio; + char __data[0]; }; -struct rlimit64 { - __u64 rlim_cur; - __u64 rlim_max; +struct trace_event_raw_sched_migrate_task { + struct trace_entry ent; + char comm[16]; + pid_t pid; + int prio; + int orig_cpu; + int dest_cpu; + char __data[0]; }; -struct oldold_utsname { - char sysname[9]; - char nodename[9]; - char release[9]; - char version[9]; - char machine[9]; +struct trace_event_raw_sched_process_template { + struct trace_entry ent; + char comm[16]; + pid_t pid; + int prio; + char __data[0]; }; -struct old_utsname { - char sysname[65]; - char nodename[65]; - char release[65]; - char version[65]; - char machine[65]; +struct trace_event_raw_sched_process_wait { + struct trace_entry ent; + char comm[16]; + pid_t pid; + int prio; + char __data[0]; }; -enum uts_proc { - UTS_PROC_OSTYPE = 0, - UTS_PROC_OSRELEASE = 1, - UTS_PROC_VERSION = 2, - UTS_PROC_HOSTNAME = 3, - UTS_PROC_DOMAINNAME = 4, +struct trace_event_raw_sched_process_fork { + struct trace_entry ent; + char parent_comm[16]; + pid_t parent_pid; + char child_comm[16]; + pid_t child_pid; + char __data[0]; }; -struct prctl_mm_map { - __u64 start_code; - __u64 end_code; - __u64 start_data; - __u64 end_data; - __u64 start_brk; - __u64 brk; - __u64 start_stack; - __u64 arg_start; - __u64 arg_end; - __u64 env_start; - __u64 env_end; - __u64 *auxv; - __u32 auxv_size; - __u32 exe_fd; +struct trace_event_raw_sched_process_exec { + struct trace_entry ent; + u32 __data_loc_filename; + pid_t pid; + pid_t old_pid; + char __data[0]; }; -struct tms { - __kernel_clock_t tms_utime; - __kernel_clock_t tms_stime; - __kernel_clock_t tms_cutime; - __kernel_clock_t tms_cstime; +struct trace_event_raw_sched_stat_template { + struct trace_entry ent; + char comm[16]; + pid_t pid; + u64 delay; + char __data[0]; }; -struct getcpu_cache { - long unsigned int blob[16]; +struct trace_event_raw_sched_stat_runtime { + struct trace_entry ent; + char comm[16]; + pid_t pid; + u64 runtime; + u64 vruntime; + char __data[0]; }; -struct compat_tms { - compat_clock_t tms_utime; - compat_clock_t tms_stime; - compat_clock_t tms_cutime; - compat_clock_t tms_cstime; +struct trace_event_raw_sched_pi_setprio { + struct trace_entry ent; + char comm[16]; + pid_t pid; + int oldprio; + int newprio; + char __data[0]; }; -struct compat_rlimit { - compat_ulong_t rlim_cur; - compat_ulong_t rlim_max; +struct trace_event_raw_sched_move_task_template { + struct trace_entry ent; + pid_t pid; + pid_t tgid; + pid_t ngid; + int src_cpu; + int src_nid; + int dst_cpu; + int dst_nid; + char __data[0]; }; -struct compat_sysinfo { - s32 uptime; - u32 loads[3]; - u32 totalram; - u32 freeram; - u32 sharedram; - u32 bufferram; - u32 totalswap; - u32 freeswap; - u16 procs; - u16 pad; - u32 totalhigh; - u32 freehigh; - u32 mem_unit; - char _f[8]; +struct trace_event_raw_sched_swap_numa { + struct trace_entry ent; + pid_t src_pid; + pid_t src_tgid; + pid_t src_ngid; + int src_cpu; + int src_nid; + pid_t dst_pid; + pid_t dst_tgid; + pid_t dst_ngid; + int dst_cpu; + int dst_nid; + char __data[0]; }; -struct subprocess_info { - struct work_struct work; - struct completion *complete; - const char *path; - char **argv; - char **envp; - struct file *file; - int wait; - int retval; - pid_t pid; - int (*init)(struct subprocess_info *, struct cred *); - void (*cleanup)(struct subprocess_info *); - void *data; +struct trace_event_raw_sched_wake_idle_without_ipi { + struct trace_entry ent; + int cpu; + char __data[0]; }; -struct umh_info { - const char *cmdline; - struct file *pipe_to_umh; - struct file *pipe_from_umh; - struct list_head list; - void (*cleanup)(struct umh_info *); - pid_t pid; -}; +struct trace_event_data_offsets_sched_kthread_stop {}; -struct wq_flusher; +struct trace_event_data_offsets_sched_kthread_stop_ret {}; -struct worker; +struct trace_event_data_offsets_sched_wakeup_template {}; -struct workqueue_attrs; +struct trace_event_data_offsets_sched_switch {}; -struct pool_workqueue; +struct trace_event_data_offsets_sched_migrate_task {}; -struct wq_device; +struct trace_event_data_offsets_sched_process_template {}; -struct workqueue_struct { - struct list_head pwqs; - struct list_head list; - struct mutex mutex; - int work_color; - int flush_color; - atomic_t nr_pwqs_to_flush; - struct wq_flusher *first_flusher; - struct list_head flusher_queue; - struct list_head flusher_overflow; - struct list_head maydays; - struct worker *rescuer; - int nr_drainers; - int saved_max_active; - struct workqueue_attrs *unbound_attrs; - struct pool_workqueue *dfl_pwq; - struct wq_device *wq_dev; - char name[24]; - struct callback_head rcu; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - unsigned int flags; - struct pool_workqueue *cpu_pwqs; - struct pool_workqueue *numa_pwq_tbl[0]; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; -}; +struct trace_event_data_offsets_sched_process_wait {}; -struct workqueue_attrs { - int nice; - cpumask_var_t cpumask; - bool no_numa; -}; +struct trace_event_data_offsets_sched_process_fork {}; -struct execute_work { - struct work_struct work; +struct trace_event_data_offsets_sched_process_exec { + u32 filename; }; -enum { - WQ_UNBOUND = 2, - WQ_FREEZABLE = 4, - WQ_MEM_RECLAIM = 8, - WQ_HIGHPRI = 16, - WQ_CPU_INTENSIVE = 32, - WQ_SYSFS = 64, - WQ_POWER_EFFICIENT = 128, - __WQ_DRAINING = 65536, - __WQ_ORDERED = 131072, - __WQ_LEGACY = 262144, - __WQ_ORDERED_EXPLICIT = 524288, - WQ_MAX_ACTIVE = 512, - WQ_MAX_UNBOUND_PER_CPU = 4, - WQ_DFL_ACTIVE = 256, -}; +struct trace_event_data_offsets_sched_stat_template {}; -typedef unsigned int xa_mark_t; +struct trace_event_data_offsets_sched_stat_runtime {}; -enum xa_lock_type { - XA_LOCK_IRQ = 1, - XA_LOCK_BH = 2, -}; +struct trace_event_data_offsets_sched_pi_setprio {}; -struct ida { - struct xarray xa; -}; +struct trace_event_data_offsets_sched_move_task_template {}; -struct __una_u32 { - u32 x; -}; +struct trace_event_data_offsets_sched_swap_numa {}; -struct worker_pool; +struct trace_event_data_offsets_sched_wake_idle_without_ipi {}; -struct worker { - union { - struct list_head entry; - struct hlist_node hentry; - }; - struct work_struct *current_work; - work_func_t current_func; - struct pool_workqueue *current_pwq; - struct list_head scheduled; - struct task_struct *task; - struct worker_pool *pool; - struct list_head node; - long unsigned int last_active; - unsigned int flags; - int id; - int sleeping; - char desc[24]; - struct workqueue_struct *rescue_wq; - work_func_t last_func; -}; +typedef void (*btf_trace_sched_kthread_stop)(void *, struct task_struct *); -struct pool_workqueue { - struct worker_pool *pool; - struct workqueue_struct *wq; - int work_color; - int flush_color; - int refcnt; - int nr_in_flight[15]; - int nr_active; - int max_active; - struct list_head delayed_works; - struct list_head pwqs_node; - struct list_head mayday_node; - struct work_struct unbound_release_work; - struct callback_head rcu; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; -}; +typedef void (*btf_trace_sched_kthread_stop_ret)(void *, int); -struct worker_pool { - spinlock_t lock; - int cpu; - int node; - int id; - unsigned int flags; - long unsigned int watchdog_ts; - struct list_head worklist; - int nr_workers; - int nr_idle; - struct list_head idle_list; - struct timer_list idle_timer; - struct timer_list mayday_timer; - struct hlist_head busy_hash[64]; - struct worker *manager; - struct list_head workers; - struct completion *detach_completion; - struct ida worker_ida; - struct workqueue_attrs *attrs; - struct hlist_node hash_node; - int refcnt; - long: 32; - long: 64; - long: 64; - long: 64; - atomic_t nr_running; - struct callback_head rcu; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; -}; +typedef void (*btf_trace_sched_waking)(void *, struct task_struct *); -enum { - POOL_MANAGER_ACTIVE = 1, - POOL_DISASSOCIATED = 4, - WORKER_DIE = 2, - WORKER_IDLE = 4, - WORKER_PREP = 8, - WORKER_CPU_INTENSIVE = 64, - WORKER_UNBOUND = 128, - WORKER_REBOUND = 256, - WORKER_NOT_RUNNING = 456, - NR_STD_WORKER_POOLS = 2, - UNBOUND_POOL_HASH_ORDER = 6, - BUSY_WORKER_HASH_ORDER = 6, - MAX_IDLE_WORKERS_RATIO = 4, - IDLE_WORKER_TIMEOUT = 300000, - MAYDAY_INITIAL_TIMEOUT = 10, - MAYDAY_INTERVAL = 100, - CREATE_COOLDOWN = 1000, - RESCUER_NICE_LEVEL = -20, - HIGHPRI_NICE_LEVEL = -20, - WQ_NAME_LEN = 24, -}; +typedef void (*btf_trace_sched_wakeup)(void *, struct task_struct *); -struct wq_flusher { - struct list_head list; - int flush_color; - struct completion done; -}; +typedef void (*btf_trace_sched_wakeup_new)(void *, struct task_struct *); -struct wq_device { - struct workqueue_struct *wq; - struct device dev; -}; +typedef void (*btf_trace_sched_switch)(void *, bool, struct task_struct *, struct task_struct *); -struct trace_event_raw_workqueue_work { - struct trace_entry ent; - void *work; - char __data[0]; -}; +typedef void (*btf_trace_sched_migrate_task)(void *, struct task_struct *, int); -struct trace_event_raw_workqueue_queue_work { - struct trace_entry ent; - void *work; - void *function; - void *workqueue; - unsigned int req_cpu; - unsigned int cpu; - char __data[0]; -}; +typedef void (*btf_trace_sched_process_free)(void *, struct task_struct *); -struct trace_event_raw_workqueue_execute_start { - struct trace_entry ent; - void *work; - void *function; - char __data[0]; -}; +typedef void (*btf_trace_sched_process_exit)(void *, struct task_struct *); + +typedef void (*btf_trace_sched_wait_task)(void *, struct task_struct *); + +typedef void (*btf_trace_sched_process_wait)(void *, struct pid *); + +typedef void (*btf_trace_sched_process_fork)(void *, struct task_struct *, struct task_struct *); -struct trace_event_data_offsets_workqueue_work {}; +typedef void (*btf_trace_sched_process_exec)(void *, struct task_struct *, pid_t, struct linux_binprm *); -struct trace_event_data_offsets_workqueue_queue_work {}; +typedef void (*btf_trace_sched_stat_wait)(void *, struct task_struct *, u64); -struct trace_event_data_offsets_workqueue_execute_start {}; +typedef void (*btf_trace_sched_stat_sleep)(void *, struct task_struct *, u64); -struct wq_barrier { - struct work_struct work; - struct completion done; - struct task_struct *task; -}; +typedef void (*btf_trace_sched_stat_iowait)(void *, struct task_struct *, u64); -struct cwt_wait { - wait_queue_entry_t wait; - struct work_struct *work; -}; +typedef void (*btf_trace_sched_stat_blocked)(void *, struct task_struct *, u64); -struct apply_wqattrs_ctx { - struct workqueue_struct *wq; - struct workqueue_attrs *attrs; - struct list_head list; - struct pool_workqueue *dfl_pwq; - struct pool_workqueue *pwq_tbl[0]; -}; +typedef void (*btf_trace_sched_stat_runtime)(void *, struct task_struct *, u64, u64); -struct work_for_cpu { - struct work_struct work; - long int (*fn)(void *); - void *arg; - long int ret; -}; +typedef void (*btf_trace_sched_pi_setprio)(void *, struct task_struct *, struct task_struct *); -typedef void (*task_work_func_t)(struct callback_head *); +typedef void (*btf_trace_sched_move_numa)(void *, struct task_struct *, int, int); -enum { - KERNEL_PARAM_OPS_FL_NOARG = 1, +typedef void (*btf_trace_sched_stick_numa)(void *, struct task_struct *, int, int); + +typedef void (*btf_trace_sched_swap_numa)(void *, struct task_struct *, int, struct task_struct *, int); + +typedef void (*btf_trace_sched_wake_idle_without_ipi)(void *, int); + +struct migration_arg { + struct task_struct *task; + int dest_cpu; }; enum { - KERNEL_PARAM_FL_UNSAFE = 1, - KERNEL_PARAM_FL_HWPARAM = 2, + cpuset = 0, + possible = 1, + fail = 2, }; -struct param_attribute { - struct module_attribute mattr; - const struct kernel_param *param; +enum tick_dep_bits { + TICK_DEP_BIT_POSIX_TIMER = 0, + TICK_DEP_BIT_PERF_EVENTS = 1, + TICK_DEP_BIT_SCHED = 2, + TICK_DEP_BIT_CLOCK_UNSTABLE = 3, + TICK_DEP_BIT_RCU = 4, }; -struct module_param_attrs { - unsigned int num; - struct attribute_group grp; - struct param_attribute attrs[0]; +struct sched_clock_data { + u64 tick_raw; + u64 tick_gtod; + u64 clock; }; -struct module_version_attribute { - struct module_attribute mattr; - const char *module_name; - const char *version; -}; +typedef u64 pao_T_____5; -struct kmalloced_param { - struct list_head list; - char val[0]; +struct idle_timer { + struct hrtimer timer; + int done; }; -struct sched_param { - int sched_priority; +enum schedutil_type { + FREQUENCY_UTIL = 0, + ENERGY_UTIL = 1, }; -struct kthread_work; - -typedef void (*kthread_work_func_t)(struct kthread_work *); - -struct kthread_worker; +enum fbq_type { + regular = 0, + remote = 1, + all = 2, +}; -struct kthread_work { - struct list_head node; - kthread_work_func_t func; - struct kthread_worker *worker; - int canceling; +enum group_type { + group_has_spare = 0, + group_fully_busy = 1, + group_misfit_task = 2, + group_asym_packing = 3, + group_imbalanced = 4, + group_overloaded = 5, }; -enum { - KTW_FREEZABLE = 1, +enum migration_type { + migrate_load = 0, + migrate_util = 1, + migrate_task = 2, + migrate_misfit = 3, }; -struct kthread_worker { +struct lb_env { + struct sched_domain *sd; + struct rq *src_rq; + int src_cpu; + int dst_cpu; + struct rq *dst_rq; + struct cpumask *dst_grpmask; + int new_dst_cpu; + enum cpu_idle_type idle; + long int imbalance; + struct cpumask *cpus; unsigned int flags; - raw_spinlock_t lock; - struct list_head work_list; - struct list_head delayed_work_list; - struct task_struct *task; - struct kthread_work *current_work; + unsigned int loop; + unsigned int loop_break; + unsigned int loop_max; + enum fbq_type fbq_type; + enum migration_type migration_type; + struct list_head tasks; }; -struct kthread_delayed_work { - struct kthread_work work; - struct timer_list timer; +struct sg_lb_stats { + long unsigned int avg_load; + long unsigned int group_load; + long unsigned int group_capacity; + long unsigned int group_util; + unsigned int sum_nr_running; + unsigned int sum_h_nr_running; + unsigned int idle_cpus; + unsigned int group_weight; + enum group_type group_type; + unsigned int group_asym_packing; + long unsigned int group_misfit_task_load; }; -struct kthread_create_info { - int (*threadfn)(void *); - void *data; - int node; - struct task_struct *result; - struct completion *done; - struct list_head list; +struct sd_lb_stats { + struct sched_group *busiest; + struct sched_group *local; + long unsigned int total_load; + long unsigned int total_capacity; + long unsigned int avg_load; + unsigned int prefer_sibling; + struct sg_lb_stats busiest_stat; + struct sg_lb_stats local_stat; }; -struct kthread { - long unsigned int flags; - unsigned int cpu; - void *data; - struct completion parked; - struct completion exited; -}; +typedef struct rt_rq *rt_rq_iter_t; -enum KTHREAD_BITS { - KTHREAD_IS_PER_CPU = 0, - KTHREAD_SHOULD_STOP = 1, - KTHREAD_SHOULD_PARK = 2, +struct wait_bit_key { + void *flags; + int bit_nr; + long unsigned int timeout; }; -struct kthread_flush_work { - struct kthread_work work; - struct completion done; +struct wait_bit_queue_entry { + struct wait_bit_key key; + struct wait_queue_entry wq_entry; }; -struct pt_regs___2; +typedef int wait_bit_action_f(struct wait_bit_key *, int); -struct ipc_ids { - int in_use; - short unsigned int seq; - struct rw_semaphore rwsem; - struct idr ipcs_idr; - int max_idx; - int last_idx; - struct rhashtable key_ht; +struct swait_queue_head { + raw_spinlock_t lock; + struct list_head task_list; }; -struct ipc_namespace { - refcount_t count; - struct ipc_ids ids[3]; - int sem_ctls[4]; - int used_sems; - unsigned int msg_ctlmax; - unsigned int msg_ctlmnb; - unsigned int msg_ctlmni; - atomic_t msg_bytes; - atomic_t msg_hdrs; - size_t shm_ctlmax; - size_t shm_ctlall; - long unsigned int shm_tot; - int shm_ctlmni; - int shm_rmid_forced; - struct notifier_block ipcns_nb; - struct vfsmount *mq_mnt; - unsigned int mq_queues_count; - unsigned int mq_queues_max; - unsigned int mq_msg_max; - unsigned int mq_msgsize_max; - unsigned int mq_msg_default; - unsigned int mq_msgsize_default; - struct user_namespace *user_ns; - struct ucounts *ucounts; - struct ns_common ns; +struct swait_queue { + struct task_struct *task; + struct list_head task_list; }; -struct srcu_notifier_head { - struct mutex mutex; - struct srcu_struct srcu; - struct notifier_block *head; +struct sched_domain_attr { + int relax_domain_level; }; -enum what { - PROC_EVENT_NONE = 0, - PROC_EVENT_FORK = 1, - PROC_EVENT_EXEC = 2, - PROC_EVENT_UID = 4, - PROC_EVENT_GID = 64, - PROC_EVENT_SID = 128, - PROC_EVENT_PTRACE = 256, - PROC_EVENT_COMM = 512, - PROC_EVENT_COREDUMP = 1073741824, - PROC_EVENT_EXIT = -2147483648, +struct s_data { + struct sched_domain **sd; + struct root_domain___2 *rd; }; -typedef u64 async_cookie_t; - -typedef void (*async_func_t)(void *, async_cookie_t); +enum s_alloc { + sa_rootdomain = 0, + sa_sd = 1, + sa_sd_storage = 2, + sa_none = 3, +}; -struct async_domain { - struct list_head pending; - unsigned int registered: 1; +enum cpuacct_stat_index { + CPUACCT_STAT_USER = 0, + CPUACCT_STAT_SYSTEM = 1, + CPUACCT_STAT_NSTATS = 2, }; -struct async_entry { - struct list_head domain_list; - struct list_head global_list; - struct work_struct work; - async_cookie_t cookie; - async_func_t func; - void *data; - struct async_domain *domain; +struct cpuacct_usage { + u64 usages[2]; }; -struct smpboot_thread_data { - unsigned int cpu; - unsigned int status; - struct smp_hotplug_thread *ht; +struct cpuacct { + struct cgroup_subsys_state css; + struct cpuacct_usage *cpuusage; + struct kernel_cpustat *cpustat; }; enum { - HP_THREAD_NONE = 0, - HP_THREAD_ACTIVE = 1, - HP_THREAD_PARKED = 2, + MEMBARRIER_FLAG_SYNC_CORE = 1, }; -struct pin_cookie {}; - -struct cfs_rq { - struct load_weight load; - long unsigned int runnable_weight; - unsigned int nr_running; - unsigned int h_nr_running; - unsigned int idle_h_nr_running; - u64 exec_clock; - u64 min_vruntime; - struct rb_root_cached tasks_timeline; - struct sched_entity *curr; - struct sched_entity *next; - struct sched_entity *last; - struct sched_entity *skip; - long: 64; - long: 64; - long: 64; - struct sched_avg avg; - struct { - raw_spinlock_t lock; - int nr; - long unsigned int load_avg; - long unsigned int util_avg; - long unsigned int runnable_sum; - long: 64; - long: 64; - long: 64; - long: 64; - } removed; - long unsigned int tg_load_avg_contrib; - long int propagate; - long int prop_runnable_sum; - long unsigned int h_load; - u64 last_h_load_update; - struct sched_entity *h_load_next; - struct rq *rq; - int on_list; - struct list_head leaf_cfs_rq_list; - struct task_group *tg; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +enum membarrier_cmd { + MEMBARRIER_CMD_QUERY = 0, + MEMBARRIER_CMD_GLOBAL = 1, + MEMBARRIER_CMD_GLOBAL_EXPEDITED = 2, + MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED = 4, + MEMBARRIER_CMD_PRIVATE_EXPEDITED = 8, + MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED = 16, + MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE = 32, + MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE = 64, + MEMBARRIER_CMD_SHARED = 1, }; -struct cfs_bandwidth {}; +struct ww_acquire_ctx; -struct task_group { - struct cgroup_subsys_state css; - struct sched_entity **se; - struct cfs_rq **cfs_rq; - long unsigned int shares; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - atomic_long_t load_avg; - struct callback_head rcu; +struct mutex_waiter { struct list_head list; - struct task_group *parent; - struct list_head siblings; - struct list_head children; - struct cfs_bandwidth cfs_bandwidth; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; + struct task_struct *task; + struct ww_acquire_ctx *ww_ctx; }; -struct update_util_data { - void (*func)(struct update_util_data *, u64, unsigned int); +struct ww_acquire_ctx { + struct task_struct *task; + long unsigned int stamp; + unsigned int acquired; + short unsigned int wounded; + short unsigned int is_wait_die; }; -enum { - MEMBARRIER_STATE_PRIVATE_EXPEDITED_READY = 1, - MEMBARRIER_STATE_PRIVATE_EXPEDITED = 2, - MEMBARRIER_STATE_GLOBAL_EXPEDITED_READY = 4, - MEMBARRIER_STATE_GLOBAL_EXPEDITED = 8, - MEMBARRIER_STATE_PRIVATE_EXPEDITED_SYNC_CORE_READY = 16, - MEMBARRIER_STATE_PRIVATE_EXPEDITED_SYNC_CORE = 32, +enum mutex_trylock_recursive_enum { + MUTEX_TRYLOCK_FAILED = 0, + MUTEX_TRYLOCK_SUCCESS = 1, + MUTEX_TRYLOCK_RECURSIVE = 2, }; -struct sched_domain_attr { - int relax_domain_level; +struct ww_mutex { + struct mutex base; + struct ww_acquire_ctx *ctx; }; -struct sched_group { - struct sched_group *next; - atomic_t ref; - unsigned int group_weight; - struct sched_group_capacity *sgc; - int asym_prefer_cpu; - long unsigned int cpumask[0]; +struct semaphore { + raw_spinlock_t lock; + unsigned int count; + struct list_head wait_list; }; -struct sched_group_capacity { - atomic_t ref; - long unsigned int capacity; - long unsigned int min_capacity; - long unsigned int max_capacity; - long unsigned int next_update; - int imbalance; - long unsigned int cpumask[0]; +struct semaphore_waiter { + struct list_head list; + struct task_struct *task; + bool up; }; -struct wake_q_head { - struct wake_q_node *first; - struct wake_q_node **lastp; +enum rwsem_waiter_type { + RWSEM_WAITING_FOR_WRITE = 0, + RWSEM_WAITING_FOR_READ = 1, }; -struct sched_attr { - __u32 size; - __u32 sched_policy; - __u64 sched_flags; - __s32 sched_nice; - __u32 sched_priority; - __u64 sched_runtime; - __u64 sched_deadline; - __u64 sched_period; - __u32 sched_util_min; - __u32 sched_util_max; +struct rwsem_waiter { + struct list_head list; + struct task_struct *task; + enum rwsem_waiter_type type; + long unsigned int timeout; + long unsigned int last_rowner; }; -struct cpuidle_driver; - -struct cpuidle_state { - char name[16]; - char desc[32]; - u64 exit_latency_ns; - u64 target_residency_ns; - unsigned int flags; - unsigned int exit_latency; - int power_usage; - unsigned int target_residency; - int (*enter)(struct cpuidle_device *, struct cpuidle_driver *, int); - int (*enter_dead)(struct cpuidle_device *, int); - void (*enter_s2idle)(struct cpuidle_device *, struct cpuidle_driver *, int); +enum rwsem_wake_type { + RWSEM_WAKE_ANY = 0, + RWSEM_WAKE_READERS = 1, + RWSEM_WAKE_READ_OWNED = 2, }; -struct cpuidle_driver { - const char *name; - struct module *owner; - int refcnt; - unsigned int bctimer: 1; - struct cpuidle_state states[10]; - int state_count; - int safe_state_index; - struct cpumask *cpumask; - const char *governor; +enum writer_wait_state { + WRITER_NOT_FIRST = 0, + WRITER_FIRST = 1, + WRITER_HANDOFF = 2, }; -struct em_cap_state { - long unsigned int frequency; - long unsigned int power; - long unsigned int cost; +enum owner_state { + OWNER_NULL = 1, + OWNER_WRITER = 2, + OWNER_READER = 4, + OWNER_NONSPINNABLE = 8, }; -struct em_perf_domain { - struct em_cap_state *table; - int nr_cap_states; - long unsigned int cpus[0]; +struct optimistic_spin_node { + struct optimistic_spin_node *next; + struct optimistic_spin_node *prev; + int locked; + int cpu; }; -enum { - CFTYPE_ONLY_ON_ROOT = 1, - CFTYPE_NOT_ON_ROOT = 2, - CFTYPE_NS_DELEGATABLE = 4, - CFTYPE_NO_PREFIX = 8, - CFTYPE_WORLD_WRITABLE = 16, - CFTYPE_DEBUG = 32, - __CFTYPE_ONLY_ON_DFL = 65536, - __CFTYPE_NOT_ON_DFL = 131072, +struct mcs_spinlock { + struct mcs_spinlock *next; + int locked; + int count; }; -struct cpu_stop_done; +struct qnode { + struct mcs_spinlock mcs; +}; -struct cpu_stop_work { - struct list_head list; - cpu_stop_fn_t fn; - void *arg; - struct cpu_stop_done *done; +struct hrtimer_sleeper { + struct hrtimer timer; + struct task_struct *task; }; -struct cpupri_vec { - atomic_t count; - cpumask_var_t mask; +struct rt_mutex; + +struct rt_mutex_waiter { + struct rb_node tree_entry; + struct rb_node pi_tree_entry; + struct task_struct *task; + struct rt_mutex *lock; + int prio; + u64 deadline; }; -struct cpupri { - struct cpupri_vec pri_to_cpu[102]; - int *cpu_to_pri; +struct rt_mutex { + raw_spinlock_t wait_lock; + struct rb_root_cached waiters; + struct task_struct *owner; }; -struct cpudl_item { - u64 dl; - int cpu; - int idx; +enum rtmutex_chainwalk { + RT_MUTEX_MIN_CHAINWALK = 0, + RT_MUTEX_FULL_CHAINWALK = 1, }; -struct cpudl { - raw_spinlock_t lock; - int size; - cpumask_var_t free_cpus; - struct cpudl_item *elements; +enum pm_qos_req_action { + PM_QOS_ADD_REQ = 0, + PM_QOS_UPDATE_REQ = 1, + PM_QOS_REMOVE_REQ = 2, }; -struct rt_prio_array { - long unsigned int bitmap[2]; - struct list_head queue[100]; +struct miscdevice { + int minor; + const char *name; + const struct file_operations *fops; + struct list_head list; + struct device *parent; + struct device *this_device; + const struct attribute_group **groups; + const char *nodename; + umode_t mode; }; -struct rt_bandwidth { - raw_spinlock_t rt_runtime_lock; - ktime_t rt_period; - u64 rt_runtime; - struct hrtimer rt_period_timer; - unsigned int rt_period_active; +struct pm_qos_object { + struct pm_qos_constraints *constraints; + struct miscdevice pm_qos_power_miscdev; + char *name; }; -struct dl_bandwidth { - raw_spinlock_t dl_runtime_lock; - u64 dl_runtime; - u64 dl_period; +enum { + TEST_NONE = 0, + TEST_CORE = 1, + TEST_CPUS = 2, + TEST_PLATFORM = 3, + TEST_DEVICES = 4, + TEST_FREEZER = 5, + __TEST_AFTER_LAST = 6, }; -struct dl_bw { - raw_spinlock_t lock; - u64 bw; - u64 total_bw; +struct pm_vt_switch { + struct list_head head; + struct device *dev; + bool required; }; -typedef int (*tg_visitor)(struct task_group *, void *); +struct platform_suspend_ops { + int (*valid)(suspend_state_t); + int (*begin)(suspend_state_t); + int (*prepare)(); + int (*prepare_late)(); + int (*enter)(suspend_state_t); + void (*wake)(); + void (*finish)(); + bool (*suspend_again)(); + void (*end)(); + void (*recover)(); +}; -struct rt_rq { - struct rt_prio_array active; - unsigned int rt_nr_running; - unsigned int rr_nr_running; - struct { - int curr; - int next; - } highest_prio; - long unsigned int rt_nr_migratory; - long unsigned int rt_nr_total; - int overloaded; - struct plist_head pushable_tasks; - int rt_queued; - int rt_throttled; - u64 rt_time; - u64 rt_runtime; - raw_spinlock_t rt_runtime_lock; +struct platform_s2idle_ops { + int (*begin)(); + int (*prepare)(); + int (*prepare_late)(); + void (*wake)(); + void (*restore_early)(); + void (*restore)(); + void (*end)(); }; -struct dl_rq { - struct rb_root_cached root; - long unsigned int dl_nr_running; - struct { - u64 curr; - u64 next; - } earliest_dl; - long unsigned int dl_nr_migratory; - int overloaded; - struct rb_root_cached pushable_dl_tasks_root; - u64 running_bw; - u64 this_bw; - u64 extra_bw; - u64 bw_ratio; +struct platform_hibernation_ops { + int (*begin)(pm_message_t); + void (*end)(); + int (*pre_snapshot)(); + void (*finish)(); + int (*prepare)(); + int (*enter)(); + void (*leave)(); + int (*pre_restore)(); + void (*restore_cleanup)(); + void (*recover)(); }; -struct root_domain; +enum { + HIBERNATION_INVALID = 0, + HIBERNATION_PLATFORM = 1, + HIBERNATION_SHUTDOWN = 2, + HIBERNATION_REBOOT = 3, + HIBERNATION_SUSPEND = 4, + HIBERNATION_TEST_RESUME = 5, + __HIBERNATION_AFTER_LAST = 6, +}; -struct rq { - raw_spinlock_t lock; - unsigned int nr_running; - long unsigned int last_load_update_tick; - long unsigned int last_blocked_load_update_tick; - unsigned int has_blocked_load; - unsigned int nohz_tick_stopped; - atomic_t nohz_flags; - long unsigned int nr_load_updates; - u64 nr_switches; +struct swsusp_info { + struct new_utsname uts; + u32 version_code; + long unsigned int num_physpages; + int cpus; + long unsigned int image_pages; + long unsigned int pages; + long unsigned int size; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; long: 64; - struct cfs_rq cfs; - struct rt_rq rt; - struct dl_rq dl; - struct list_head leaf_cfs_rq_list; - struct list_head *tmp_alone_branch; - long unsigned int nr_uninterruptible; - struct task_struct *curr; - struct task_struct *idle; - struct task_struct *stop; - long unsigned int next_balance; - struct mm_struct *prev_mm; - unsigned int clock_update_flags; - u64 clock; long: 64; long: 64; long: 64; - u64 clock_task; - u64 clock_pelt; - long unsigned int lost_idle_time; - atomic_t nr_iowait; - int membarrier_state; - struct root_domain *rd; - struct sched_domain *sd; - long unsigned int cpu_capacity; - long unsigned int cpu_capacity_orig; - struct callback_head *balance_callback; - unsigned char idle_balance; - long unsigned int misfit_task_load; - int active_balance; - int push_cpu; - struct cpu_stop_work active_balance_work; - int cpu; - int online; - struct list_head cfs_tasks; long: 64; long: 64; long: 64; long: 64; - struct sched_avg avg_rt; - struct sched_avg avg_dl; - u64 idle_stamp; - u64 avg_idle; - u64 max_idle_balance_cost; - long unsigned int calc_load_update; - long int calc_load_active; - int hrtick_csd_pending; - long: 32; long: 64; long: 64; - call_single_data_t hrtick_csd; - struct hrtimer hrtick_timer; - struct sched_info rq_sched_info; - long long unsigned int rq_cpu_time; - unsigned int yld_count; - unsigned int sched_count; - unsigned int sched_goidle; - unsigned int ttwu_count; - unsigned int ttwu_local; - struct llist_head wake_list; - struct cpuidle_state *idle_state; long: 64; long: 64; }; -struct perf_domain { - struct em_perf_domain *em_pd; - struct perf_domain *next; - struct callback_head rcu; +struct snapshot_handle { + unsigned int cur; + void *buffer; + int sync_read; }; -struct root_domain { - atomic_t refcount; - atomic_t rto_count; - struct callback_head rcu; - cpumask_var_t span; - cpumask_var_t online; - int overload; - int overutilized; - cpumask_var_t dlo_mask; - atomic_t dlo_count; - struct dl_bw dl_bw; - struct cpudl cpudl; - struct irq_work rto_push_work; - raw_spinlock_t rto_lock; - int rto_loop; - int rto_cpu; - atomic_t rto_loop_next; - atomic_t rto_loop_start; - cpumask_var_t rto_mask; - struct cpupri cpupri; - long unsigned int max_cpu_capacity; - struct perf_domain *pd; +struct linked_page { + struct linked_page *next; + char data[4088]; }; -struct rq_flags { - long unsigned int flags; - struct pin_cookie cookie; +struct chain_allocator { + struct linked_page *chain; + unsigned int used_space; + gfp_t gfp_mask; + int safe_needed; }; -enum { - __SCHED_FEAT_GENTLE_FAIR_SLEEPERS = 0, - __SCHED_FEAT_START_DEBIT = 1, - __SCHED_FEAT_NEXT_BUDDY = 2, - __SCHED_FEAT_LAST_BUDDY = 3, - __SCHED_FEAT_CACHE_HOT_BUDDY = 4, - __SCHED_FEAT_WAKEUP_PREEMPTION = 5, - __SCHED_FEAT_HRTICK = 6, - __SCHED_FEAT_DOUBLE_TICK = 7, - __SCHED_FEAT_NONTASK_CAPACITY = 8, - __SCHED_FEAT_TTWU_QUEUE = 9, - __SCHED_FEAT_SIS_AVG_CPU = 10, - __SCHED_FEAT_SIS_PROP = 11, - __SCHED_FEAT_WARN_DOUBLE_CLOCK = 12, - __SCHED_FEAT_RT_PUSH_IPI = 13, - __SCHED_FEAT_RT_RUNTIME_SHARE = 14, - __SCHED_FEAT_LB_MIN = 15, - __SCHED_FEAT_ATTACH_AGE_LOAD = 16, - __SCHED_FEAT_WA_IDLE = 17, - __SCHED_FEAT_WA_WEIGHT = 18, - __SCHED_FEAT_WA_BIAS = 19, - __SCHED_FEAT_UTIL_EST = 20, - __SCHED_FEAT_UTIL_EST_FASTUP = 21, - __SCHED_FEAT_NR = 22, +struct rtree_node { + struct list_head list; + long unsigned int *data; }; -struct trace_event_raw_sched_kthread_stop { - struct trace_entry ent; - char comm[16]; - pid_t pid; - char __data[0]; +struct mem_zone_bm_rtree { + struct list_head list; + struct list_head nodes; + struct list_head leaves; + long unsigned int start_pfn; + long unsigned int end_pfn; + struct rtree_node *rtree; + int levels; + unsigned int blocks; }; -struct trace_event_raw_sched_kthread_stop_ret { - struct trace_entry ent; - int ret; - char __data[0]; +struct bm_position { + struct mem_zone_bm_rtree *zone; + struct rtree_node *node; + long unsigned int node_pfn; + int node_bit; }; -struct trace_event_raw_sched_wakeup_template { - struct trace_entry ent; - char comm[16]; - pid_t pid; - int prio; - int success; - int target_cpu; - char __data[0]; +struct memory_bitmap { + struct list_head zones; + struct linked_page *p_list; + struct bm_position cur; }; -struct trace_event_raw_sched_switch { - struct trace_entry ent; - char prev_comm[16]; - pid_t prev_pid; - int prev_prio; - long int prev_state; - char next_comm[16]; - pid_t next_pid; - int next_prio; - char __data[0]; +struct mem_extent { + struct list_head hook; + long unsigned int start; + long unsigned int end; }; -struct trace_event_raw_sched_migrate_task { - struct trace_entry ent; - char comm[16]; - pid_t pid; - int prio; - int orig_cpu; - int dest_cpu; - char __data[0]; +struct nosave_region { + struct list_head list; + long unsigned int start_pfn; + long unsigned int end_pfn; }; -struct trace_event_raw_sched_process_template { - struct trace_entry ent; - char comm[16]; - pid_t pid; - int prio; - char __data[0]; -}; +typedef struct { + long unsigned int val; +} swp_entry_t; -struct trace_event_raw_sched_process_wait { - struct trace_entry ent; - char comm[16]; - pid_t pid; - int prio; - char __data[0]; +enum { + BIO_NO_PAGE_REF = 0, + BIO_CLONED = 1, + BIO_BOUNCED = 2, + BIO_USER_MAPPED = 3, + BIO_NULL_MAPPED = 4, + BIO_WORKINGSET = 5, + BIO_QUIET = 6, + BIO_CHAIN = 7, + BIO_REFFED = 8, + BIO_THROTTLED = 9, + BIO_TRACE_COMPLETION = 10, + BIO_QUEUE_ENTERED = 11, + BIO_TRACKED = 12, + BIO_FLAG_LAST = 13, }; -struct trace_event_raw_sched_process_fork { - struct trace_entry ent; - char parent_comm[16]; - pid_t parent_pid; - char child_comm[16]; - pid_t child_pid; - char __data[0]; +enum req_opf { + REQ_OP_READ = 0, + REQ_OP_WRITE = 1, + REQ_OP_FLUSH = 2, + REQ_OP_DISCARD = 3, + REQ_OP_SECURE_ERASE = 5, + REQ_OP_ZONE_RESET = 6, + REQ_OP_WRITE_SAME = 7, + REQ_OP_ZONE_RESET_ALL = 8, + REQ_OP_WRITE_ZEROES = 9, + REQ_OP_ZONE_OPEN = 10, + REQ_OP_ZONE_CLOSE = 11, + REQ_OP_ZONE_FINISH = 12, + REQ_OP_SCSI_IN = 32, + REQ_OP_SCSI_OUT = 33, + REQ_OP_DRV_IN = 34, + REQ_OP_DRV_OUT = 35, + REQ_OP_LAST = 36, }; -struct trace_event_raw_sched_process_exec { - struct trace_entry ent; - u32 __data_loc_filename; - pid_t pid; - pid_t old_pid; - char __data[0]; +enum req_flag_bits { + __REQ_FAILFAST_DEV = 8, + __REQ_FAILFAST_TRANSPORT = 9, + __REQ_FAILFAST_DRIVER = 10, + __REQ_SYNC = 11, + __REQ_META = 12, + __REQ_PRIO = 13, + __REQ_NOMERGE = 14, + __REQ_IDLE = 15, + __REQ_INTEGRITY = 16, + __REQ_FUA = 17, + __REQ_PREFLUSH = 18, + __REQ_RAHEAD = 19, + __REQ_BACKGROUND = 20, + __REQ_NOWAIT = 21, + __REQ_NOWAIT_INLINE = 22, + __REQ_CGROUP_PUNT = 23, + __REQ_NOUNMAP = 24, + __REQ_HIPRI = 25, + __REQ_DRV = 26, + __REQ_SWAP = 27, + __REQ_NR_BITS = 28, }; -struct trace_event_raw_sched_stat_template { - struct trace_entry ent; - char comm[16]; - pid_t pid; - u64 delay; - char __data[0]; +struct swap_map_page { + sector_t entries[511]; + sector_t next_swap; }; -struct trace_event_raw_sched_stat_runtime { - struct trace_entry ent; - char comm[16]; - pid_t pid; - u64 runtime; - u64 vruntime; - char __data[0]; +struct swap_map_page_list { + struct swap_map_page *map; + struct swap_map_page_list *next; }; -struct trace_event_raw_sched_pi_setprio { - struct trace_entry ent; - char comm[16]; - pid_t pid; - int oldprio; - int newprio; - char __data[0]; +struct swap_map_handle { + struct swap_map_page *cur; + struct swap_map_page_list *maps; + sector_t cur_swap; + sector_t first_sector; + unsigned int k; + long unsigned int reqd_free_pages; + u32 crc32; }; -struct trace_event_raw_sched_move_task_template { - struct trace_entry ent; - pid_t pid; - pid_t tgid; - pid_t ngid; - int src_cpu; - int src_nid; - int dst_cpu; - int dst_nid; - char __data[0]; +struct swsusp_header { + char reserved[4060]; + u32 crc32; + sector_t image; + unsigned int flags; + char orig_sig[10]; + char sig[10]; }; -struct trace_event_raw_sched_swap_numa { - struct trace_entry ent; - pid_t src_pid; - pid_t src_tgid; - pid_t src_ngid; - int src_cpu; - int src_nid; - pid_t dst_pid; - pid_t dst_tgid; - pid_t dst_ngid; - int dst_cpu; - int dst_nid; - char __data[0]; +struct swsusp_extent { + struct rb_node node; + long unsigned int start; + long unsigned int end; }; -struct trace_event_raw_sched_wake_idle_without_ipi { - struct trace_entry ent; - int cpu; - char __data[0]; +struct hib_bio_batch { + atomic_t count; + wait_queue_head_t wait; + blk_status_t error; }; -struct trace_event_data_offsets_sched_kthread_stop {}; - -struct trace_event_data_offsets_sched_kthread_stop_ret {}; - -struct trace_event_data_offsets_sched_wakeup_template {}; - -struct trace_event_data_offsets_sched_switch {}; - -struct trace_event_data_offsets_sched_migrate_task {}; - -struct trace_event_data_offsets_sched_process_template {}; - -struct trace_event_data_offsets_sched_process_wait {}; - -struct trace_event_data_offsets_sched_process_fork {}; - -struct trace_event_data_offsets_sched_process_exec { - u32 filename; +struct crc_data { + struct task_struct *thr; + atomic_t ready; + atomic_t stop; + unsigned int run_threads; + wait_queue_head_t go; + wait_queue_head_t done; + u32 *crc32; + size_t *unc_len[3]; + unsigned char *unc[3]; }; -struct trace_event_data_offsets_sched_stat_template {}; - -struct trace_event_data_offsets_sched_stat_runtime {}; - -struct trace_event_data_offsets_sched_pi_setprio {}; +struct cmp_data { + struct task_struct *thr; + atomic_t ready; + atomic_t stop; + int ret; + wait_queue_head_t go; + wait_queue_head_t done; + size_t unc_len; + size_t cmp_len; + unsigned char unc[131072]; + unsigned char cmp[143360]; + unsigned char wrk[16384]; +}; -struct trace_event_data_offsets_sched_move_task_template {}; +struct dec_data { + struct task_struct *thr; + atomic_t ready; + atomic_t stop; + int ret; + wait_queue_head_t go; + wait_queue_head_t done; + size_t unc_len; + size_t cmp_len; + unsigned char unc[131072]; + unsigned char cmp[143360]; +}; -struct trace_event_data_offsets_sched_swap_numa {}; +typedef s64 compat_loff_t; -struct trace_event_data_offsets_sched_wake_idle_without_ipi {}; +struct resume_swap_area { + __kernel_loff_t offset; + __u32 dev; +} __attribute__((packed)); -struct migration_arg { - struct task_struct *task; - int dest_cpu; +struct snapshot_data { + struct snapshot_handle handle; + int swap; + int mode; + bool frozen; + bool ready; + bool platform_support; + bool free_bitmaps; }; -enum { - cpuset = 0, - possible = 1, - fail = 2, +struct compat_resume_swap_area { + compat_loff_t offset; + u32 dev; +} __attribute__((packed)); + +struct sysrq_key_op { + void (*handler)(int); + char *help_msg; + char *action_msg; + int enable_mask; }; -enum tick_dep_bits { - TICK_DEP_BIT_POSIX_TIMER = 0, - TICK_DEP_BIT_PERF_EVENTS = 1, - TICK_DEP_BIT_SCHED = 2, - TICK_DEP_BIT_CLOCK_UNSTABLE = 3, - TICK_DEP_BIT_RCU = 4, +struct kmsg_dumper { + struct list_head list; + void (*dump)(struct kmsg_dumper *, enum kmsg_dump_reason); + enum kmsg_dump_reason max_reason; + bool active; + bool registered; + u32 cur_idx; + u32 next_idx; + u64 cur_seq; + u64 next_seq; }; -struct sched_clock_data { - u64 tick_raw; - u64 tick_gtod; - u64 clock; +struct trace_event_raw_console { + struct trace_entry ent; + u32 __data_loc_msg; + char __data[0]; }; -struct idle_timer { - struct hrtimer timer; - int done; +struct trace_event_data_offsets_console { + u32 msg; }; -enum sched_tunable_scaling { - SCHED_TUNABLESCALING_NONE = 0, - SCHED_TUNABLESCALING_LOG = 1, - SCHED_TUNABLESCALING_LINEAR = 2, - SCHED_TUNABLESCALING_END = 3, -}; +typedef void (*btf_trace_console)(void *, const char *, size_t); -enum schedutil_type { - FREQUENCY_UTIL = 0, - ENERGY_UTIL = 1, +struct console_cmdline { + char name[16]; + int index; + char *options; }; -enum fbq_type { - regular = 0, - remote = 1, - all = 2, +enum devkmsg_log_bits { + __DEVKMSG_LOG_BIT_ON = 0, + __DEVKMSG_LOG_BIT_OFF = 1, + __DEVKMSG_LOG_BIT_LOCK = 2, }; -enum group_type { - group_has_spare = 0, - group_fully_busy = 1, - group_misfit_task = 2, - group_asym_packing = 3, - group_imbalanced = 4, - group_overloaded = 5, +enum devkmsg_log_masks { + DEVKMSG_LOG_MASK_ON = 1, + DEVKMSG_LOG_MASK_OFF = 2, + DEVKMSG_LOG_MASK_LOCK = 4, }; -enum migration_type { - migrate_load = 0, - migrate_util = 1, - migrate_task = 2, - migrate_misfit = 3, +enum con_msg_format_flags { + MSG_FORMAT_DEFAULT = 0, + MSG_FORMAT_SYSLOG = 1, }; -struct lb_env { - struct sched_domain *sd; - struct rq *src_rq; - int src_cpu; - int dst_cpu; - struct rq *dst_rq; - struct cpumask *dst_grpmask; - int new_dst_cpu; - enum cpu_idle_type idle; - long int imbalance; - struct cpumask *cpus; - unsigned int flags; - unsigned int loop; - unsigned int loop_break; - unsigned int loop_max; - enum fbq_type fbq_type; - enum migration_type migration_type; - struct list_head tasks; +enum log_flags { + LOG_NEWLINE = 2, + LOG_CONT = 8, }; -struct sg_lb_stats { - long unsigned int avg_load; - long unsigned int group_load; - long unsigned int group_capacity; - long unsigned int group_util; - unsigned int sum_nr_running; - unsigned int sum_h_nr_running; - unsigned int idle_cpus; - unsigned int group_weight; - enum group_type group_type; - unsigned int group_asym_packing; - long unsigned int group_misfit_task_load; +struct printk_log { + u64 ts_nsec; + u16 len; + u16 text_len; + u16 dict_len; + u8 facility; + u8 flags: 5; + u8 level: 3; }; -struct sd_lb_stats { - struct sched_group *busiest; - struct sched_group *local; - long unsigned int total_load; - long unsigned int total_capacity; - long unsigned int avg_load; - unsigned int prefer_sibling; - struct sg_lb_stats busiest_stat; - struct sg_lb_stats local_stat; +struct devkmsg_user { + u64 seq; + u32 idx; + struct ratelimit_state rs; + struct mutex lock; + char buf[8192]; }; -typedef struct rt_rq *rt_rq_iter_t; - -struct wait_bit_queue_entry { - struct wait_bit_key key; - struct wait_queue_entry wq_entry; +struct cont { + char buf[992]; + size_t len; + u32 caller_id; + u64 ts_nsec; + u8 level; + u8 facility; + enum log_flags flags; }; -struct swait_queue_head { - raw_spinlock_t lock; - struct list_head task_list; +struct printk_safe_seq_buf { + atomic_t len; + atomic_t message_lost; + struct irq_work work; + unsigned char buffer[8160]; }; -struct swait_queue { - struct task_struct *task; - struct list_head task_list; +enum { + IRQS_AUTODETECT = 1, + IRQS_SPURIOUS_DISABLED = 2, + IRQS_POLL_INPROGRESS = 8, + IRQS_ONESHOT = 32, + IRQS_REPLAY = 64, + IRQS_WAITING = 128, + IRQS_PENDING = 512, + IRQS_SUSPENDED = 2048, + IRQS_TIMINGS = 4096, + IRQS_NMI = 8192, }; -enum numa_topology_type { - NUMA_DIRECT = 0, - NUMA_GLUELESS_MESH = 1, - NUMA_BACKPLANE = 2, +enum { + _IRQ_DEFAULT_INIT_FLAGS = 0, + _IRQ_PER_CPU = 512, + _IRQ_LEVEL = 256, + _IRQ_NOPROBE = 1024, + _IRQ_NOREQUEST = 2048, + _IRQ_NOTHREAD = 65536, + _IRQ_NOAUTOEN = 4096, + _IRQ_MOVE_PCNTXT = 16384, + _IRQ_NO_BALANCING = 8192, + _IRQ_NESTED_THREAD = 32768, + _IRQ_PER_CPU_DEVID = 131072, + _IRQ_IS_POLLED = 262144, + _IRQ_DISABLE_UNLAZY = 524288, + _IRQF_MODIFY_MASK = 1048335, }; -struct s_data { - struct sched_domain **sd; - struct root_domain *rd; +enum { + IRQTF_RUNTHREAD = 0, + IRQTF_WARNED = 1, + IRQTF_AFFINITY = 2, + IRQTF_FORCED_THREAD = 3, }; -enum s_alloc { - sa_rootdomain = 0, - sa_sd = 1, - sa_sd_storage = 2, - sa_none = 3, +enum { + IRQC_IS_HARDIRQ = 0, + IRQC_IS_NESTED = 1, }; -enum cpuacct_stat_index { - CPUACCT_STAT_USER = 0, - CPUACCT_STAT_SYSTEM = 1, - CPUACCT_STAT_NSTATS = 2, +enum { + IRQ_STARTUP_NORMAL = 0, + IRQ_STARTUP_MANAGED = 1, + IRQ_STARTUP_ABORT = 2, }; -struct cpuacct_usage { - u64 usages[2]; +struct irq_devres { + unsigned int irq; + void *dev_id; }; -struct cpuacct { - struct cgroup_subsys_state css; - struct cpuacct_usage *cpuusage; - struct kernel_cpustat *cpustat; +struct irq_desc_devres { + unsigned int from; + unsigned int cnt; }; enum { - MEMBARRIER_FLAG_SYNC_CORE = 1, + IRQ_DOMAIN_FLAG_HIERARCHY = 1, + IRQ_DOMAIN_NAME_ALLOCATED = 64, + IRQ_DOMAIN_FLAG_IPI_PER_CPU = 4, + IRQ_DOMAIN_FLAG_IPI_SINGLE = 8, + IRQ_DOMAIN_FLAG_MSI = 16, + IRQ_DOMAIN_FLAG_MSI_REMAP = 32, + IRQ_DOMAIN_FLAG_NONCORE = 65536, }; -enum membarrier_cmd { - MEMBARRIER_CMD_QUERY = 0, - MEMBARRIER_CMD_GLOBAL = 1, - MEMBARRIER_CMD_GLOBAL_EXPEDITED = 2, - MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED = 4, - MEMBARRIER_CMD_PRIVATE_EXPEDITED = 8, - MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED = 16, - MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE = 32, - MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE = 64, - MEMBARRIER_CMD_SHARED = 1, -}; +typedef u64 acpi_size; -struct ww_acquire_ctx; +typedef u64 acpi_io_address; -struct mutex_waiter { - struct list_head list; - struct task_struct *task; - struct ww_acquire_ctx *ww_ctx; -}; +typedef u32 acpi_object_type; -struct ww_acquire_ctx { - struct task_struct *task; - long unsigned int stamp; - unsigned int acquired; - short unsigned int wounded; - short unsigned int is_wait_die; +union acpi_object { + acpi_object_type type; + struct { + acpi_object_type type; + u64 value; + } integer; + struct { + acpi_object_type type; + u32 length; + char *pointer; + } string; + struct { + acpi_object_type type; + u32 length; + u8 *pointer; + } buffer; + struct { + acpi_object_type type; + u32 count; + union acpi_object *elements; + } package; + struct { + acpi_object_type type; + acpi_object_type actual_type; + acpi_handle handle; + } reference; + struct { + acpi_object_type type; + u32 proc_id; + acpi_io_address pblk_address; + u32 pblk_length; + } processor; + struct { + acpi_object_type type; + u32 system_level; + u32 resource_order; + } power_resource; }; -enum mutex_trylock_recursive_enum { - MUTEX_TRYLOCK_FAILED = 0, - MUTEX_TRYLOCK_SUCCESS = 1, - MUTEX_TRYLOCK_RECURSIVE = 2, +struct acpi_buffer { + acpi_size length; + void *pointer; }; -struct ww_mutex { - struct mutex base; - struct ww_acquire_ctx *ctx; +struct acpi_hotplug_profile { + struct kobject kobj; + int (*scan_dependent)(struct acpi_device *); + void (*notify_online)(struct acpi_device *); + bool enabled: 1; + bool demand_offline: 1; }; -struct semaphore { - raw_spinlock_t lock; - unsigned int count; - struct list_head wait_list; +struct acpi_device_status { + u32 present: 1; + u32 enabled: 1; + u32 show_in_ui: 1; + u32 functional: 1; + u32 battery_present: 1; + u32 reserved: 27; }; -struct semaphore_waiter { - struct list_head list; - struct task_struct *task; - bool up; +struct acpi_device_flags { + u32 dynamic_status: 1; + u32 removable: 1; + u32 ejectable: 1; + u32 power_manageable: 1; + u32 match_driver: 1; + u32 initialized: 1; + u32 visited: 1; + u32 hotplug_notify: 1; + u32 is_dock_station: 1; + u32 of_compatible_ok: 1; + u32 coherent_dma: 1; + u32 cca_seen: 1; + u32 enumeration_by_parent: 1; + u32 reserved: 19; }; -enum rwsem_waiter_type { - RWSEM_WAITING_FOR_WRITE = 0, - RWSEM_WAITING_FOR_READ = 1, +typedef char acpi_bus_id[8]; + +struct acpi_pnp_type { + u32 hardware_id: 1; + u32 bus_address: 1; + u32 platform_id: 1; + u32 reserved: 29; }; -struct rwsem_waiter { - struct list_head list; - struct task_struct *task; - enum rwsem_waiter_type type; - long unsigned int timeout; - long unsigned int last_rowner; +typedef u64 acpi_bus_address; + +typedef char acpi_device_name[40]; + +typedef char acpi_device_class[20]; + +struct acpi_device_pnp { + acpi_bus_id bus_id; + struct acpi_pnp_type type; + acpi_bus_address bus_address; + char *unique_id; + struct list_head ids; + acpi_device_name device_name; + acpi_device_class device_class; + union acpi_object *str_obj; }; -enum rwsem_wake_type { - RWSEM_WAKE_ANY = 0, - RWSEM_WAKE_READERS = 1, - RWSEM_WAKE_READ_OWNED = 2, +struct acpi_device_power_flags { + u32 explicit_get: 1; + u32 power_resources: 1; + u32 inrush_current: 1; + u32 power_removed: 1; + u32 ignore_parent: 1; + u32 dsw_present: 1; + u32 reserved: 26; }; -enum writer_wait_state { - WRITER_NOT_FIRST = 0, - WRITER_FIRST = 1, - WRITER_HANDOFF = 2, +struct acpi_device_power_state { + struct { + u8 valid: 1; + u8 explicit_set: 1; + u8 reserved: 6; + } flags; + int power; + int latency; + struct list_head resources; }; -enum owner_state { - OWNER_NULL = 1, - OWNER_WRITER = 2, - OWNER_READER = 4, - OWNER_NONSPINNABLE = 8, +struct acpi_device_power { + int state; + struct acpi_device_power_flags flags; + struct acpi_device_power_state states[5]; }; -struct optimistic_spin_node { - struct optimistic_spin_node *next; - struct optimistic_spin_node *prev; - int locked; - int cpu; +struct acpi_device_wakeup_flags { + u8 valid: 1; + u8 notifier_present: 1; }; -struct mcs_spinlock { - struct mcs_spinlock *next; - int locked; - int count; +struct acpi_device_wakeup_context { + void (*func)(struct acpi_device_wakeup_context *); + struct device *dev; }; -struct qnode { - struct mcs_spinlock mcs; +struct acpi_device_wakeup { + acpi_handle gpe_device; + u64 gpe_number; + u64 sleep_state; + struct list_head resources; + struct acpi_device_wakeup_flags flags; + struct acpi_device_wakeup_context context; + struct wakeup_source *ws; + int prepare_count; + int enable_count; }; -struct hrtimer_sleeper { - struct hrtimer timer; - struct task_struct *task; +struct acpi_device_perf_flags { + u8 reserved: 8; }; -struct rt_mutex; +struct acpi_device_perf_state; -struct rt_mutex_waiter { - struct rb_node tree_entry; - struct rb_node pi_tree_entry; - struct task_struct *task; - struct rt_mutex *lock; - int prio; - u64 deadline; +struct acpi_device_perf { + int state; + struct acpi_device_perf_flags flags; + int state_count; + struct acpi_device_perf_state *states; }; -struct rt_mutex { - raw_spinlock_t wait_lock; - struct rb_root_cached waiters; - struct task_struct *owner; +struct acpi_device_dir { + struct proc_dir_entry *entry; }; -enum rtmutex_chainwalk { - RT_MUTEX_MIN_CHAINWALK = 0, - RT_MUTEX_FULL_CHAINWALK = 1, +struct acpi_device_data { + const union acpi_object *pointer; + struct list_head properties; + const union acpi_object *of_compatible; + struct list_head subnodes; }; -enum pm_qos_req_action { - PM_QOS_ADD_REQ = 0, - PM_QOS_UPDATE_REQ = 1, - PM_QOS_REMOVE_REQ = 2, -}; +struct acpi_scan_handler; -struct miscdevice { - int minor; - const char *name; - const struct file_operations *fops; - struct list_head list; - struct device *parent; - struct device *this_device; - const struct attribute_group **groups; - const char *nodename; - umode_t mode; -}; +struct acpi_hotplug_context; -struct pm_qos_object { - struct pm_qos_constraints *constraints; - struct miscdevice pm_qos_power_miscdev; - char *name; -}; +struct acpi_driver; -typedef int suspend_state_t; +struct acpi_gpio_mapping; -enum { - TEST_NONE = 0, - TEST_CORE = 1, - TEST_CPUS = 2, - TEST_PLATFORM = 3, - TEST_DEVICES = 4, - TEST_FREEZER = 5, - __TEST_AFTER_LAST = 6, +struct acpi_device { + int device_type; + acpi_handle handle; + struct fwnode_handle fwnode; + struct acpi_device *parent; + struct list_head children; + struct list_head node; + struct list_head wakeup_list; + struct list_head del_list; + struct acpi_device_status status; + struct acpi_device_flags flags; + struct acpi_device_pnp pnp; + struct acpi_device_power power; + struct acpi_device_wakeup wakeup; + struct acpi_device_perf performance; + struct acpi_device_dir dir; + struct acpi_device_data data; + struct acpi_scan_handler *handler; + struct acpi_hotplug_context *hp; + struct acpi_driver *driver; + const struct acpi_gpio_mapping *driver_gpios; + void *driver_data; + struct device dev; + unsigned int physical_node_count; + unsigned int dep_unmet; + struct list_head physical_node_list; + struct mutex physical_node_lock; + void (*remove)(struct acpi_device *); }; -struct pm_vt_switch { - struct list_head head; - struct device *dev; - bool required; +struct acpi_scan_handler { + const struct acpi_device_id *ids; + struct list_head list_node; + bool (*match)(const char *, const struct acpi_device_id **); + int (*attach)(struct acpi_device *, const struct acpi_device_id *); + void (*detach)(struct acpi_device *); + void (*bind)(struct device *); + void (*unbind)(struct device *); + struct acpi_hotplug_profile hotplug; }; -struct platform_suspend_ops { - int (*valid)(suspend_state_t); - int (*begin)(suspend_state_t); - int (*prepare)(); - int (*prepare_late)(); - int (*enter)(suspend_state_t); - void (*wake)(); - void (*finish)(); - bool (*suspend_again)(); - void (*end)(); - void (*recover)(); +struct acpi_hotplug_context { + struct acpi_device *self; + int (*notify)(struct acpi_device *, u32); + void (*uevent)(struct acpi_device *, u32); + void (*fixup)(struct acpi_device *); }; -struct platform_s2idle_ops { - int (*begin)(); - int (*prepare)(); - int (*prepare_late)(); - void (*wake)(); - void (*restore_early)(); - void (*restore)(); - void (*end)(); -}; +typedef int (*acpi_op_add)(struct acpi_device *); -struct platform_hibernation_ops { - int (*begin)(pm_message_t); - void (*end)(); - int (*pre_snapshot)(); - void (*finish)(); - int (*prepare)(); - int (*enter)(); - void (*leave)(); - int (*pre_restore)(); - void (*restore_cleanup)(); - void (*recover)(); -}; +typedef int (*acpi_op_remove)(struct acpi_device *); -enum { - HIBERNATION_INVALID = 0, - HIBERNATION_PLATFORM = 1, - HIBERNATION_SHUTDOWN = 2, - HIBERNATION_REBOOT = 3, - HIBERNATION_SUSPEND = 4, - HIBERNATION_TEST_RESUME = 5, - __HIBERNATION_AFTER_LAST = 6, -}; +typedef void (*acpi_op_notify)(struct acpi_device *, u32); -struct pbe { - void *address; - void *orig_address; - struct pbe *next; +struct acpi_device_ops { + acpi_op_add add; + acpi_op_remove remove; + acpi_op_notify notify; }; -struct swsusp_info { - struct new_utsname uts; - u32 version_code; - long unsigned int num_physpages; - int cpus; - long unsigned int image_pages; - long unsigned int pages; - long unsigned int size; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct acpi_driver { + char name[80]; + char class[80]; + const struct acpi_device_id *ids; + unsigned int flags; + struct acpi_device_ops ops; + struct device_driver drv; + struct module *owner; +}; + +struct acpi_device_perf_state { + struct { + u8 valid: 1; + u8 reserved: 7; + } flags; + u8 power; + u8 performance; + int latency; +}; + +struct acpi_gpio_params; + +struct acpi_gpio_mapping { + const char *name; + const struct acpi_gpio_params *data; + unsigned int size; + unsigned int quirks; +}; + +struct irqchip_fwid { + struct fwnode_handle fwnode; + unsigned int type; + char *name; + phys_addr_t *pa; +}; + +enum { + AFFINITY = 0, + AFFINITY_LIST = 1, + EFFECTIVE = 2, + EFFECTIVE_LIST = 3, +}; + +struct irq_affinity { + unsigned int pre_vectors; + unsigned int post_vectors; + unsigned int nr_sets; + unsigned int set_size[4]; + void (*calc_sets)(struct irq_affinity *, unsigned int); + void *priv; +}; + +struct node_vectors { + unsigned int id; + union { + unsigned int nvectors; + unsigned int ncpus; + }; +}; + +struct cpumap { + unsigned int available; + unsigned int allocated; + unsigned int managed; + unsigned int managed_allocated; + bool initialized; + bool online; + long unsigned int alloc_map[4]; + long unsigned int managed_map[4]; +}; + +struct irq_matrix___2 { + unsigned int matrix_bits; + unsigned int alloc_start; + unsigned int alloc_end; + unsigned int alloc_size; + unsigned int global_available; + unsigned int global_reserved; + unsigned int systembits_inalloc; + unsigned int total_allocated; + unsigned int online_maps; + struct cpumap *maps; + long unsigned int scratch_map[4]; + long unsigned int system_map[4]; +}; + +struct trace_event_raw_irq_matrix_global { + struct trace_entry ent; + unsigned int online_maps; + unsigned int global_available; + unsigned int global_reserved; + unsigned int total_allocated; + char __data[0]; +}; + +struct trace_event_raw_irq_matrix_global_update { + struct trace_entry ent; + int bit; + unsigned int online_maps; + unsigned int global_available; + unsigned int global_reserved; + unsigned int total_allocated; + char __data[0]; +}; + +struct trace_event_raw_irq_matrix_cpu { + struct trace_entry ent; + int bit; + unsigned int cpu; + bool online; + unsigned int available; + unsigned int allocated; + unsigned int managed; + unsigned int online_maps; + unsigned int global_available; + unsigned int global_reserved; + unsigned int total_allocated; + char __data[0]; +}; + +struct trace_event_data_offsets_irq_matrix_global {}; + +struct trace_event_data_offsets_irq_matrix_global_update {}; + +struct trace_event_data_offsets_irq_matrix_cpu {}; + +typedef void (*btf_trace_irq_matrix_online)(void *, struct irq_matrix___2 *); + +typedef void (*btf_trace_irq_matrix_offline)(void *, struct irq_matrix___2 *); + +typedef void (*btf_trace_irq_matrix_reserve)(void *, struct irq_matrix___2 *); + +typedef void (*btf_trace_irq_matrix_remove_reserved)(void *, struct irq_matrix___2 *); + +typedef void (*btf_trace_irq_matrix_assign_system)(void *, int, struct irq_matrix___2 *); + +typedef void (*btf_trace_irq_matrix_alloc_reserved)(void *, int, unsigned int, struct irq_matrix___2 *, struct cpumap *); + +typedef void (*btf_trace_irq_matrix_reserve_managed)(void *, int, unsigned int, struct irq_matrix___2 *, struct cpumap *); + +typedef void (*btf_trace_irq_matrix_remove_managed)(void *, int, unsigned int, struct irq_matrix___2 *, struct cpumap *); + +typedef void (*btf_trace_irq_matrix_alloc_managed)(void *, int, unsigned int, struct irq_matrix___2 *, struct cpumap *); + +typedef void (*btf_trace_irq_matrix_assign)(void *, int, unsigned int, struct irq_matrix___2 *, struct cpumap *); + +typedef void (*btf_trace_irq_matrix_alloc)(void *, int, unsigned int, struct irq_matrix___2 *, struct cpumap *); + +typedef void (*btf_trace_irq_matrix_free)(void *, int, unsigned int, struct irq_matrix___2 *, struct cpumap *); + +typedef void (*rcu_callback_t)(struct callback_head *); + +typedef void (*call_rcu_func_t)(struct callback_head *, rcu_callback_t); + +struct rcu_synchronize { + struct callback_head head; + struct completion completion; +}; + +struct trace_event_raw_rcu_utilization { + struct trace_entry ent; + const char *s; + char __data[0]; +}; + +struct trace_event_raw_rcu_grace_period { + struct trace_entry ent; + const char *rcuname; + long unsigned int gp_seq; + const char *gpevent; + char __data[0]; +}; + +struct trace_event_raw_rcu_future_grace_period { + struct trace_entry ent; + const char *rcuname; + long unsigned int gp_seq; + long unsigned int gp_seq_req; + u8 level; + int grplo; + int grphi; + const char *gpevent; + char __data[0]; +}; + +struct trace_event_raw_rcu_grace_period_init { + struct trace_entry ent; + const char *rcuname; + long unsigned int gp_seq; + u8 level; + int grplo; + int grphi; + long unsigned int qsmask; + char __data[0]; +}; + +struct trace_event_raw_rcu_exp_grace_period { + struct trace_entry ent; + const char *rcuname; + long unsigned int gpseq; + const char *gpevent; + char __data[0]; +}; + +struct trace_event_raw_rcu_exp_funnel_lock { + struct trace_entry ent; + const char *rcuname; + u8 level; + int grplo; + int grphi; + const char *gpevent; + char __data[0]; +}; + +struct trace_event_raw_rcu_preempt_task { + struct trace_entry ent; + const char *rcuname; + long unsigned int gp_seq; + int pid; + char __data[0]; +}; + +struct trace_event_raw_rcu_unlock_preempted_task { + struct trace_entry ent; + const char *rcuname; + long unsigned int gp_seq; + int pid; + char __data[0]; +}; + +struct trace_event_raw_rcu_quiescent_state_report { + struct trace_entry ent; + const char *rcuname; + long unsigned int gp_seq; + long unsigned int mask; + long unsigned int qsmask; + u8 level; + int grplo; + int grphi; + u8 gp_tasks; + char __data[0]; +}; + +struct trace_event_raw_rcu_fqs { + struct trace_entry ent; + const char *rcuname; + long unsigned int gp_seq; + int cpu; + const char *qsevent; + char __data[0]; +}; + +struct trace_event_raw_rcu_dyntick { + struct trace_entry ent; + const char *polarity; + long int oldnesting; + long int newnesting; + int dynticks; + char __data[0]; +}; + +struct trace_event_raw_rcu_callback { + struct trace_entry ent; + const char *rcuname; + void *rhp; + void *func; + long int qlen_lazy; + long int qlen; + char __data[0]; +}; + +struct trace_event_raw_rcu_kfree_callback { + struct trace_entry ent; + const char *rcuname; + void *rhp; + long unsigned int offset; + long int qlen_lazy; + long int qlen; + char __data[0]; +}; + +struct trace_event_raw_rcu_batch_start { + struct trace_entry ent; + const char *rcuname; + long int qlen_lazy; + long int qlen; + long int blimit; + char __data[0]; +}; + +struct trace_event_raw_rcu_invoke_callback { + struct trace_entry ent; + const char *rcuname; + void *rhp; + void *func; + char __data[0]; +}; + +struct trace_event_raw_rcu_invoke_kfree_callback { + struct trace_entry ent; + const char *rcuname; + void *rhp; + long unsigned int offset; + char __data[0]; +}; + +struct trace_event_raw_rcu_batch_end { + struct trace_entry ent; + const char *rcuname; + int callbacks_invoked; + char cb; + char nr; + char iit; + char risk; + char __data[0]; +}; + +struct trace_event_raw_rcu_torture_read { + struct trace_entry ent; + char rcutorturename[8]; + struct callback_head *rhp; + long unsigned int secs; + long unsigned int c_old; + long unsigned int c; + char __data[0]; +}; + +struct trace_event_raw_rcu_barrier { + struct trace_entry ent; + const char *rcuname; + const char *s; + int cpu; + int cnt; + long unsigned int done; + char __data[0]; +}; + +struct trace_event_data_offsets_rcu_utilization {}; + +struct trace_event_data_offsets_rcu_grace_period {}; + +struct trace_event_data_offsets_rcu_future_grace_period {}; + +struct trace_event_data_offsets_rcu_grace_period_init {}; + +struct trace_event_data_offsets_rcu_exp_grace_period {}; + +struct trace_event_data_offsets_rcu_exp_funnel_lock {}; + +struct trace_event_data_offsets_rcu_preempt_task {}; + +struct trace_event_data_offsets_rcu_unlock_preempted_task {}; + +struct trace_event_data_offsets_rcu_quiescent_state_report {}; + +struct trace_event_data_offsets_rcu_fqs {}; + +struct trace_event_data_offsets_rcu_dyntick {}; + +struct trace_event_data_offsets_rcu_callback {}; + +struct trace_event_data_offsets_rcu_kfree_callback {}; + +struct trace_event_data_offsets_rcu_batch_start {}; + +struct trace_event_data_offsets_rcu_invoke_callback {}; + +struct trace_event_data_offsets_rcu_invoke_kfree_callback {}; + +struct trace_event_data_offsets_rcu_batch_end {}; + +struct trace_event_data_offsets_rcu_torture_read {}; + +struct trace_event_data_offsets_rcu_barrier {}; + +typedef void (*btf_trace_rcu_utilization)(void *, const char *); + +typedef void (*btf_trace_rcu_grace_period)(void *, const char *, long unsigned int, const char *); + +typedef void (*btf_trace_rcu_future_grace_period)(void *, const char *, long unsigned int, long unsigned int, u8, int, int, const char *); + +typedef void (*btf_trace_rcu_grace_period_init)(void *, const char *, long unsigned int, u8, int, int, long unsigned int); + +typedef void (*btf_trace_rcu_exp_grace_period)(void *, const char *, long unsigned int, const char *); + +typedef void (*btf_trace_rcu_exp_funnel_lock)(void *, const char *, u8, int, int, const char *); + +typedef void (*btf_trace_rcu_preempt_task)(void *, const char *, int, long unsigned int); + +typedef void (*btf_trace_rcu_unlock_preempted_task)(void *, const char *, long unsigned int, int); + +typedef void (*btf_trace_rcu_quiescent_state_report)(void *, const char *, long unsigned int, long unsigned int, long unsigned int, u8, int, int, int); + +typedef void (*btf_trace_rcu_fqs)(void *, const char *, long unsigned int, int, const char *); + +typedef void (*btf_trace_rcu_dyntick)(void *, const char *, long int, long int, atomic_t); + +typedef void (*btf_trace_rcu_callback)(void *, const char *, struct callback_head *, long int, long int); + +typedef void (*btf_trace_rcu_kfree_callback)(void *, const char *, struct callback_head *, long unsigned int, long int, long int); + +typedef void (*btf_trace_rcu_batch_start)(void *, const char *, long int, long int, long int); + +typedef void (*btf_trace_rcu_invoke_callback)(void *, const char *, struct callback_head *); + +typedef void (*btf_trace_rcu_invoke_kfree_callback)(void *, const char *, struct callback_head *, long unsigned int); + +typedef void (*btf_trace_rcu_batch_end)(void *, const char *, int, char, char, char, char); + +typedef void (*btf_trace_rcu_torture_read)(void *, const char *, struct callback_head *, long unsigned int, long unsigned int, long unsigned int); + +typedef void (*btf_trace_rcu_barrier)(void *, const char *, const char *, int, int, long unsigned int); + +enum { + GP_IDLE = 0, + GP_ENTER = 1, + GP_PASSED = 2, + GP_EXIT = 3, + GP_REPLAY = 4, +}; + +typedef long unsigned int ulong; + +struct rcu_cblist { + struct callback_head *head; + struct callback_head **tail; + long int len; + long int len_lazy; +}; + +enum rcutorture_type { + RCU_FLAVOR = 0, + RCU_TASKS_FLAVOR = 1, + RCU_TRIVIAL_FLAVOR = 2, + SRCU_FLAVOR = 3, + INVALID_RCU_FLAVOR = 4, +}; + +enum tick_device_mode { + TICKDEV_MODE_PERIODIC = 0, + TICKDEV_MODE_ONESHOT = 1, +}; + +struct tick_device___2 { + struct clock_event_device *evtdev; + enum tick_device_mode mode; +}; + +struct rcu_exp_work { + long unsigned int rew_s; + struct work_struct rew_work; +}; + +struct rcu_node { + raw_spinlock_t lock; + long unsigned int gp_seq; + long unsigned int gp_seq_needed; + long unsigned int completedqs; + long unsigned int qsmask; + long unsigned int rcu_gp_init_mask; + long unsigned int qsmaskinit; + long unsigned int qsmaskinitnext; + long unsigned int expmask; + long unsigned int expmaskinit; + long unsigned int expmaskinitnext; + long unsigned int ffmask; + long unsigned int grpmask; + int grplo; + int grphi; + u8 grpnum; + u8 level; + bool wait_blkd_tasks; + struct rcu_node *parent; + struct list_head blkd_tasks; + struct list_head *gp_tasks; + struct list_head *exp_tasks; + struct list_head *boost_tasks; + struct rt_mutex boost_mtx; + long unsigned int boost_time; + struct task_struct *boost_kthread_task; + unsigned int boost_kthread_status; + long: 32; long: 64; long: 64; long: 64; long: 64; + raw_spinlock_t fqslock; + long: 32; long: 64; long: 64; long: 64; @@ -25740,16 +29856,112 @@ struct swsusp_info { long: 64; long: 64; long: 64; + spinlock_t exp_lock; + long unsigned int exp_seq_rq; + wait_queue_head_t exp_wq[4]; + struct rcu_exp_work rew; + bool exp_need_flush; + long: 56; long: 64; long: 64; long: 64; long: 64; +}; + +union rcu_noqs { + struct { + u8 norm; + u8 exp; + } b; + u16 s; +}; + +struct rcu_data { + long unsigned int gp_seq; + long unsigned int gp_seq_needed; + union rcu_noqs cpu_no_qs; + bool core_needs_qs; + bool beenonline; + bool gpwrap; + bool exp_deferred_qs; + struct rcu_node *mynode; + long unsigned int grpmask; + long unsigned int ticks_this_gp; + struct irq_work defer_qs_iw; + bool defer_qs_iw_pending; + struct rcu_segcblist cblist; + long int qlen_last_fqs_check; + long unsigned int n_force_qs_snap; + long int blimit; + int dynticks_snap; + long int dynticks_nesting; + long int dynticks_nmi_nesting; + atomic_t dynticks; + bool rcu_need_heavy_qs; + bool rcu_urgent_qs; + bool rcu_forced_tick; + struct callback_head barrier_head; + int exp_dynticks_snap; + struct task_struct *rcu_cpu_kthread_task; + unsigned int rcu_cpu_kthread_status; + char rcu_cpu_has_work; + unsigned int softirq_snap; + struct irq_work rcu_iw; + bool rcu_iw_pending; + long unsigned int rcu_iw_gp_seq; + long unsigned int rcu_ofl_gp_seq; + short int rcu_ofl_gp_flags; + long unsigned int rcu_onl_gp_seq; + short int rcu_onl_gp_flags; + long unsigned int last_fqs_resched; + int cpu; +}; + +struct rcu_state { + struct rcu_node node[5]; + struct rcu_node *level[3]; + int ncpus; + long: 32; long: 64; long: 64; long: 64; long: 64; + u8 boost; + long unsigned int gp_seq; + struct task_struct *gp_kthread; + struct swait_queue_head gp_wq; + short int gp_flags; + short int gp_state; + long unsigned int gp_wake_time; + long unsigned int gp_wake_seq; + struct mutex barrier_mutex; + atomic_t barrier_cpu_count; + struct completion barrier_completion; + long unsigned int barrier_sequence; + struct mutex exp_mutex; + struct mutex exp_wake_mutex; + long unsigned int expedited_sequence; + atomic_t expedited_need_qs; + struct swait_queue_head expedited_wq; + int ncpus_snap; + long unsigned int jiffies_force_qs; + long unsigned int jiffies_kick_kthreads; + long unsigned int n_force_qs; + long unsigned int gp_start; + long unsigned int gp_end; + long unsigned int gp_activity; + long unsigned int gp_req_activity; + long unsigned int jiffies_stall; + long unsigned int jiffies_resched; + long unsigned int n_force_qs_gpstart; + long unsigned int gp_max; + const char *name; + char abbr; + long: 56; long: 64; long: 64; + raw_spinlock_t ofl_lock; + long: 32; long: 64; long: 64; long: 64; @@ -25757,1256 +29969,1954 @@ struct swsusp_info { long: 64; long: 64; long: 64; +}; + +typedef char pto_T_____17; + +struct dma_devres { + size_t size; + void *vaddr; + dma_addr_t dma_handle; + long unsigned int attrs; +}; + +enum dma_sync_target { + SYNC_FOR_CPU = 0, + SYNC_FOR_DEVICE = 1, +}; + +struct trace_event_raw_swiotlb_bounced { + struct trace_entry ent; + u32 __data_loc_dev_name; + u64 dma_mask; + dma_addr_t dev_addr; + size_t size; + enum swiotlb_force swiotlb_force; + char __data[0]; +}; + +struct trace_event_data_offsets_swiotlb_bounced { + u32 dev_name; +}; + +typedef void (*btf_trace_swiotlb_bounced)(void *, struct device *, dma_addr_t, size_t, enum swiotlb_force); + +enum profile_type { + PROFILE_TASK_EXIT = 0, + PROFILE_MUNMAP = 1, +}; + +struct profile_hit { + u32 pc; + u32 hits; +}; + +struct stacktrace_cookie { + long unsigned int *store; + unsigned int size; + unsigned int skip; + unsigned int len; +}; + +typedef __kernel_long_t __kernel_suseconds_t; + +typedef __kernel_long_t __kernel_old_time_t; + +typedef __kernel_suseconds_t suseconds_t; + +typedef __u64 timeu64_t; + +struct __kernel_itimerspec { + struct __kernel_timespec it_interval; + struct __kernel_timespec it_value; +}; + +struct timespec { + __kernel_old_time_t tv_sec; + long int tv_nsec; +}; + +struct timeval { + __kernel_old_time_t tv_sec; + __kernel_suseconds_t tv_usec; +}; + +struct itimerspec64 { + struct timespec64 it_interval; + struct timespec64 it_value; +}; + +struct old_itimerspec32 { + struct old_timespec32 it_interval; + struct old_timespec32 it_value; +}; + +struct old_timex32 { + u32 modes; + s32 offset; + s32 freq; + s32 maxerror; + s32 esterror; + s32 status; + s32 constant; + s32 precision; + s32 tolerance; + struct old_timeval32 time; + s32 tick; + s32 ppsfreq; + s32 jitter; + s32 shift; + s32 stabil; + s32 jitcnt; + s32 calcnt; + s32 errcnt; + s32 stbcnt; + s32 tai; + long: 32; long: 64; long: 64; long: 64; long: 64; long: 64; +}; + +struct __kernel_timex_timeval { + __kernel_time64_t tv_sec; + long long int tv_usec; +}; + +struct __kernel_timex { + unsigned int modes; + long long int offset; + long long int freq; + long long int maxerror; + long long int esterror; + int status; + long long int constant; + long long int precision; + long long int tolerance; + struct __kernel_timex_timeval time; + long long int tick; + long long int ppsfreq; + long long int jitter; + int shift; + long long int stabil; + long long int jitcnt; + long long int calcnt; + long long int errcnt; + long long int stbcnt; + int tai; + long: 32; long: 64; long: 64; long: 64; long: 64; long: 64; +}; + +struct trace_event_raw_timer_class { + struct trace_entry ent; + void *timer; + char __data[0]; +}; + +struct trace_event_raw_timer_start { + struct trace_entry ent; + void *timer; + void *function; + long unsigned int expires; + long unsigned int now; + unsigned int flags; + char __data[0]; +}; + +struct trace_event_raw_timer_expire_entry { + struct trace_entry ent; + void *timer; + long unsigned int now; + void *function; + long unsigned int baseclk; + char __data[0]; +}; + +struct trace_event_raw_hrtimer_init { + struct trace_entry ent; + void *hrtimer; + clockid_t clockid; + enum hrtimer_mode mode; + char __data[0]; +}; + +struct trace_event_raw_hrtimer_start { + struct trace_entry ent; + void *hrtimer; + void *function; + s64 expires; + s64 softexpires; + enum hrtimer_mode mode; + char __data[0]; +}; + +struct trace_event_raw_hrtimer_expire_entry { + struct trace_entry ent; + void *hrtimer; + s64 now; + void *function; + char __data[0]; +}; + +struct trace_event_raw_hrtimer_class { + struct trace_entry ent; + void *hrtimer; + char __data[0]; +}; + +struct trace_event_raw_itimer_state { + struct trace_entry ent; + int which; + long long unsigned int expires; + long int value_sec; + long int value_nsec; + long int interval_sec; + long int interval_nsec; + char __data[0]; +}; + +struct trace_event_raw_itimer_expire { + struct trace_entry ent; + int which; + pid_t pid; + long long unsigned int now; + char __data[0]; +}; + +struct trace_event_raw_tick_stop { + struct trace_entry ent; + int success; + int dependency; + char __data[0]; +}; + +struct trace_event_data_offsets_timer_class {}; + +struct trace_event_data_offsets_timer_start {}; + +struct trace_event_data_offsets_timer_expire_entry {}; + +struct trace_event_data_offsets_hrtimer_init {}; + +struct trace_event_data_offsets_hrtimer_start {}; + +struct trace_event_data_offsets_hrtimer_expire_entry {}; + +struct trace_event_data_offsets_hrtimer_class {}; + +struct trace_event_data_offsets_itimer_state {}; + +struct trace_event_data_offsets_itimer_expire {}; + +struct trace_event_data_offsets_tick_stop {}; + +typedef void (*btf_trace_timer_init)(void *, struct timer_list *); + +typedef void (*btf_trace_timer_start)(void *, struct timer_list *, long unsigned int, unsigned int); + +typedef void (*btf_trace_timer_expire_entry)(void *, struct timer_list *, long unsigned int); + +typedef void (*btf_trace_timer_expire_exit)(void *, struct timer_list *); + +typedef void (*btf_trace_timer_cancel)(void *, struct timer_list *); + +typedef void (*btf_trace_hrtimer_init)(void *, struct hrtimer *, clockid_t, enum hrtimer_mode); + +typedef void (*btf_trace_hrtimer_start)(void *, struct hrtimer *, enum hrtimer_mode); + +typedef void (*btf_trace_hrtimer_expire_entry)(void *, struct hrtimer *, ktime_t *); + +typedef void (*btf_trace_hrtimer_expire_exit)(void *, struct hrtimer *); + +typedef void (*btf_trace_hrtimer_cancel)(void *, struct hrtimer *); + +typedef void (*btf_trace_itimer_state)(void *, int, const struct itimerspec64 * const, long long unsigned int); + +typedef void (*btf_trace_itimer_expire)(void *, int, struct pid *, long long unsigned int); + +typedef void (*btf_trace_tick_stop)(void *, int, int); + +struct timer_base { + raw_spinlock_t lock; + struct timer_list *running_timer; + long unsigned int clk; + long unsigned int next_expiry; + unsigned int cpu; + bool is_idle; + bool must_forward_clk; + long unsigned int pending_map[9]; + struct hlist_head vectors[576]; long: 64; long: 64; }; -struct snapshot_handle { - unsigned int cur; - void *buffer; - int sync_read; +struct process_timer { + struct timer_list timer; + struct task_struct *task; +}; + +struct system_time_snapshot { + u64 cycles; + ktime_t real; + ktime_t raw; + unsigned int clock_was_set_seq; + u8 cs_was_changed_seq; +}; + +struct system_device_crosststamp { + ktime_t device; + ktime_t sys_realtime; + ktime_t sys_monoraw; +}; + +struct tk_read_base { + struct clocksource *clock; + u64 mask; + u64 cycle_last; + u32 mult; + u32 shift; + u64 xtime_nsec; + ktime_t base; + u64 base_real; +}; + +struct timekeeper { + struct tk_read_base tkr_mono; + struct tk_read_base tkr_raw; + u64 xtime_sec; + long unsigned int ktime_sec; + struct timespec64 wall_to_monotonic; + ktime_t offs_real; + ktime_t offs_boot; + ktime_t offs_tai; + s32 tai_offset; + unsigned int clock_was_set_seq; + u8 cs_was_changed_seq; + ktime_t next_leap_ktime; + u64 raw_sec; + struct timespec64 monotonic_to_boot; + u64 cycle_interval; + u64 xtime_interval; + s64 xtime_remainder; + u64 raw_interval; + u64 ntp_tick; + s64 ntp_error; + u32 ntp_error_shift; + u32 ntp_err_mult; + u32 skip_second_overflow; +}; + +struct audit_ntp_val { + long long int oldval; + long long int newval; +}; + +struct audit_ntp_data { + struct audit_ntp_val vals[6]; +}; + +enum timekeeping_adv_mode { + TK_ADV_TICK = 0, + TK_ADV_FREQ = 1, +}; + +struct tk_fast { + seqcount_t seq; + struct tk_read_base base[2]; +}; + +typedef s64 int64_t; + +enum tick_nohz_mode { + NOHZ_MODE_INACTIVE = 0, + NOHZ_MODE_LOWRES = 1, + NOHZ_MODE_HIGHRES = 2, +}; + +struct tick_sched { + struct hrtimer sched_timer; + long unsigned int check_clocks; + enum tick_nohz_mode nohz_mode; + unsigned int inidle: 1; + unsigned int tick_stopped: 1; + unsigned int idle_active: 1; + unsigned int do_timer_last: 1; + unsigned int got_idle_tick: 1; + ktime_t last_tick; + ktime_t next_tick; + long unsigned int idle_jiffies; + long unsigned int idle_calls; + long unsigned int idle_sleeps; + ktime_t idle_entrytime; + ktime_t idle_waketime; + ktime_t idle_exittime; + ktime_t idle_sleeptime; + ktime_t iowait_sleeptime; + long unsigned int last_jiffies; + u64 timer_expires; + u64 timer_expires_base; + u64 next_timer; + ktime_t idle_expires; + atomic_t tick_dep_mask; +}; + +struct timer_list_iter { + int cpu; + bool second_pass; + u64 now; +}; + +struct tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + long int tm_year; + int tm_wday; + int tm_yday; +}; + +struct cyclecounter { + u64 (*read)(const struct cyclecounter *); + u64 mask; + u32 mult; + u32 shift; +}; + +struct timecounter { + const struct cyclecounter *cc; + u64 cycle_last; + u64 nsec; + u64 mask; + u64 frac; +}; + +typedef __kernel_timer_t timer_t; + +struct rtc_wkalrm { + unsigned char enabled; + unsigned char pending; + struct rtc_time time; +}; + +enum alarmtimer_type { + ALARM_REALTIME = 0, + ALARM_BOOTTIME = 1, + ALARM_NUMTYPE = 2, + ALARM_REALTIME_FREEZER = 3, + ALARM_BOOTTIME_FREEZER = 4, +}; + +enum alarmtimer_restart { + ALARMTIMER_NORESTART = 0, + ALARMTIMER_RESTART = 1, +}; + +struct alarm { + struct timerqueue_node node; + struct hrtimer timer; + enum alarmtimer_restart (*function)(struct alarm *, ktime_t); + enum alarmtimer_type type; + int state; + void *data; +}; + +struct cpu_timer { + struct timerqueue_node node; + struct timerqueue_head *head; + struct task_struct *task; + struct list_head elist; + int firing; +}; + +struct k_clock; + +struct k_itimer { + struct list_head list; + struct hlist_node t_hash; + spinlock_t it_lock; + const struct k_clock *kclock; + clockid_t it_clock; + timer_t it_id; + int it_active; + s64 it_overrun; + s64 it_overrun_last; + int it_requeue_pending; + int it_sigev_notify; + ktime_t it_interval; + struct signal_struct *it_signal; + union { + struct pid *it_pid; + struct task_struct *it_process; + }; + struct sigqueue *sigq; + union { + struct { + struct hrtimer timer; + } real; + struct cpu_timer cpu; + struct { + struct alarm alarmtimer; + } alarm; + } it; + struct callback_head rcu; +}; + +struct k_clock { + int (*clock_getres)(const clockid_t, struct timespec64 *); + int (*clock_set)(const clockid_t, const struct timespec64 *); + int (*clock_get)(const clockid_t, struct timespec64 *); + int (*clock_adj)(const clockid_t, struct __kernel_timex *); + int (*timer_create)(struct k_itimer *); + int (*nsleep)(const clockid_t, int, const struct timespec64 *); + int (*timer_set)(struct k_itimer *, int, struct itimerspec64 *, struct itimerspec64 *); + int (*timer_del)(struct k_itimer *); + void (*timer_get)(struct k_itimer *, struct itimerspec64 *); + void (*timer_rearm)(struct k_itimer *); + s64 (*timer_forward)(struct k_itimer *, ktime_t); + ktime_t (*timer_remaining)(struct k_itimer *, ktime_t); + int (*timer_try_to_cancel)(struct k_itimer *); + void (*timer_arm)(struct k_itimer *, ktime_t, bool, bool); + void (*timer_wait_running)(struct k_itimer *); +}; + +struct class_interface { + struct list_head node; + struct class *class; + int (*add_dev)(struct device *, struct class_interface *); + void (*remove_dev)(struct device *, struct class_interface *); }; -struct linked_page { - struct linked_page *next; - char data[4088]; +struct rtc_class_ops { + int (*ioctl)(struct device *, unsigned int, long unsigned int); + int (*read_time)(struct device *, struct rtc_time *); + int (*set_time)(struct device *, struct rtc_time *); + int (*read_alarm)(struct device *, struct rtc_wkalrm *); + int (*set_alarm)(struct device *, struct rtc_wkalrm *); + int (*proc)(struct device *, struct seq_file *); + int (*alarm_irq_enable)(struct device *, unsigned int); + int (*read_offset)(struct device *, long int *); + int (*set_offset)(struct device *, long int); }; -struct chain_allocator { - struct linked_page *chain; - unsigned int used_space; - gfp_t gfp_mask; - int safe_needed; +struct rtc_device; + +struct rtc_timer { + struct timerqueue_node node; + ktime_t period; + void (*func)(struct rtc_device *); + struct rtc_device *rtc; + int enabled; }; -struct rtree_node { - struct list_head list; - long unsigned int *data; +struct rtc_device { + struct device dev; + struct module *owner; + int id; + const struct rtc_class_ops *ops; + struct mutex ops_lock; + struct cdev char_dev; + long unsigned int flags; + long unsigned int irq_data; + spinlock_t irq_lock; + wait_queue_head_t irq_queue; + struct fasync_struct *async_queue; + int irq_freq; + int max_user_freq; + struct timerqueue_head timerqueue; + struct rtc_timer aie_timer; + struct rtc_timer uie_rtctimer; + struct hrtimer pie_timer; + int pie_enabled; + struct work_struct irqwork; + int uie_unsupported; + long int set_offset_nsec; + bool registered; + bool nvram_old_abi; + struct bin_attribute *nvram; + time64_t range_min; + timeu64_t range_max; + time64_t start_secs; + time64_t offset_secs; + bool set_start_time; }; -struct mem_zone_bm_rtree { - struct list_head list; - struct list_head nodes; - struct list_head leaves; - long unsigned int start_pfn; - long unsigned int end_pfn; - struct rtree_node *rtree; - int levels; - unsigned int blocks; +struct platform_driver { + int (*probe)(struct platform_device *); + int (*remove)(struct platform_device *); + void (*shutdown)(struct platform_device *); + int (*suspend)(struct platform_device *, pm_message_t); + int (*resume)(struct platform_device *); + struct device_driver driver; + const struct platform_device_id *id_table; + bool prevent_deferred_probe; }; -struct bm_position { - struct mem_zone_bm_rtree *zone; - struct rtree_node *node; - long unsigned int node_pfn; - int node_bit; +struct trace_event_raw_alarmtimer_suspend { + struct trace_entry ent; + s64 expires; + unsigned char alarm_type; + char __data[0]; }; -struct memory_bitmap { - struct list_head zones; - struct linked_page *p_list; - struct bm_position cur; +struct trace_event_raw_alarm_class { + struct trace_entry ent; + void *alarm; + unsigned char alarm_type; + s64 expires; + s64 now; + char __data[0]; }; -struct mem_extent { - struct list_head hook; - long unsigned int start; - long unsigned int end; +struct trace_event_data_offsets_alarmtimer_suspend {}; + +struct trace_event_data_offsets_alarm_class {}; + +typedef void (*btf_trace_alarmtimer_suspend)(void *, ktime_t, int); + +typedef void (*btf_trace_alarmtimer_fired)(void *, struct alarm *, ktime_t); + +typedef void (*btf_trace_alarmtimer_start)(void *, struct alarm *, ktime_t); + +typedef void (*btf_trace_alarmtimer_cancel)(void *, struct alarm *, ktime_t); + +struct alarm_base { + spinlock_t lock; + struct timerqueue_head timerqueue; + ktime_t (*gettime)(); + clockid_t base_clockid; }; -struct nosave_region { - struct list_head list; - long unsigned int start_pfn; - long unsigned int end_pfn; +struct sigevent { + sigval_t sigev_value; + int sigev_signo; + int sigev_notify; + union { + int _pad[12]; + int _tid; + struct { + void (*_function)(sigval_t); + void *_attribute; + } _sigev_thread; + } _sigev_un; }; -typedef struct { - long unsigned int val; -} swp_entry_t; +typedef struct sigevent sigevent_t; -enum { - BIO_NO_PAGE_REF = 0, - BIO_CLONED = 1, - BIO_BOUNCED = 2, - BIO_USER_MAPPED = 3, - BIO_NULL_MAPPED = 4, - BIO_WORKINGSET = 5, - BIO_QUIET = 6, - BIO_CHAIN = 7, - BIO_REFFED = 8, - BIO_THROTTLED = 9, - BIO_TRACE_COMPLETION = 10, - BIO_QUEUE_ENTERED = 11, - BIO_TRACKED = 12, - BIO_FLAG_LAST = 13, +struct compat_sigevent { + compat_sigval_t sigev_value; + compat_int_t sigev_signo; + compat_int_t sigev_notify; + union { + compat_int_t _pad[13]; + compat_int_t _tid; + struct { + compat_uptr_t _function; + compat_uptr_t _attribute; + } _sigev_thread; + } _sigev_un; }; -enum req_opf { - REQ_OP_READ = 0, - REQ_OP_WRITE = 1, - REQ_OP_FLUSH = 2, - REQ_OP_DISCARD = 3, - REQ_OP_SECURE_ERASE = 5, - REQ_OP_ZONE_RESET = 6, - REQ_OP_WRITE_SAME = 7, - REQ_OP_ZONE_RESET_ALL = 8, - REQ_OP_WRITE_ZEROES = 9, - REQ_OP_ZONE_OPEN = 10, - REQ_OP_ZONE_CLOSE = 11, - REQ_OP_ZONE_FINISH = 12, - REQ_OP_SCSI_IN = 32, - REQ_OP_SCSI_OUT = 33, - REQ_OP_DRV_IN = 34, - REQ_OP_DRV_OUT = 35, - REQ_OP_LAST = 36, +typedef unsigned int uint; + +struct posix_clock; + +struct posix_clock_operations { + struct module *owner; + int (*clock_adjtime)(struct posix_clock *, struct __kernel_timex *); + int (*clock_gettime)(struct posix_clock *, struct timespec64 *); + int (*clock_getres)(struct posix_clock *, struct timespec64 *); + int (*clock_settime)(struct posix_clock *, const struct timespec64 *); + long int (*ioctl)(struct posix_clock *, unsigned int, long unsigned int); + int (*open)(struct posix_clock *, fmode_t); + __poll_t (*poll)(struct posix_clock *, struct file *, poll_table *); + int (*release)(struct posix_clock *); + ssize_t (*read)(struct posix_clock *, uint, char *, size_t); }; -enum req_flag_bits { - __REQ_FAILFAST_DEV = 8, - __REQ_FAILFAST_TRANSPORT = 9, - __REQ_FAILFAST_DRIVER = 10, - __REQ_SYNC = 11, - __REQ_META = 12, - __REQ_PRIO = 13, - __REQ_NOMERGE = 14, - __REQ_IDLE = 15, - __REQ_INTEGRITY = 16, - __REQ_FUA = 17, - __REQ_PREFLUSH = 18, - __REQ_RAHEAD = 19, - __REQ_BACKGROUND = 20, - __REQ_NOWAIT = 21, - __REQ_NOWAIT_INLINE = 22, - __REQ_CGROUP_PUNT = 23, - __REQ_NOUNMAP = 24, - __REQ_HIPRI = 25, - __REQ_DRV = 26, - __REQ_SWAP = 27, - __REQ_NR_BITS = 28, +struct posix_clock { + struct posix_clock_operations ops; + struct cdev cdev; + struct device *dev; + struct rw_semaphore rwsem; + bool zombie; }; -struct swap_map_page { - sector_t entries[511]; - sector_t next_swap; +struct posix_clock_desc { + struct file *fp; + struct posix_clock *clk; }; -struct swap_map_page_list { - struct swap_map_page *map; - struct swap_map_page_list *next; +struct itimerval { + struct timeval it_interval; + struct timeval it_value; }; -struct swap_map_handle { - struct swap_map_page *cur; - struct swap_map_page_list *maps; - sector_t cur_swap; - sector_t first_sector; - unsigned int k; - long unsigned int reqd_free_pages; - u32 crc32; +struct old_itimerval32 { + struct old_timeval32 it_interval; + struct old_timeval32 it_value; }; -struct swsusp_header { - char reserved[4060]; - u32 crc32; - sector_t image; - unsigned int flags; - char orig_sig[10]; - char sig[10]; +struct ce_unbind { + struct clock_event_device *ce; + int res; }; -struct swsusp_extent { - struct rb_node node; - long unsigned int start; - long unsigned int end; +typedef ktime_t pto_T_____18; + +union futex_key { + struct { + long unsigned int pgoff; + struct inode *inode; + int offset; + } shared; + struct { + long unsigned int address; + struct mm_struct *mm; + int offset; + } private; + struct { + long unsigned int word; + void *ptr; + int offset; + } both; }; -struct hib_bio_batch { - atomic_t count; - wait_queue_head_t wait; - blk_status_t error; +struct futex_pi_state { + struct list_head list; + struct rt_mutex pi_mutex; + struct task_struct *owner; + refcount_t refcount; + union futex_key key; }; -struct crc_data { - struct task_struct *thr; - atomic_t ready; - atomic_t stop; - unsigned int run_threads; - wait_queue_head_t go; - wait_queue_head_t done; - u32 *crc32; - size_t *unc_len[3]; - unsigned char *unc[3]; +struct futex_q { + struct plist_node list; + struct task_struct *task; + spinlock_t *lock_ptr; + union futex_key key; + struct futex_pi_state *pi_state; + struct rt_mutex_waiter *rt_waiter; + union futex_key *requeue_pi_key; + u32 bitset; }; -struct cmp_data { - struct task_struct *thr; - atomic_t ready; - atomic_t stop; - int ret; - wait_queue_head_t go; - wait_queue_head_t done; - size_t unc_len; - size_t cmp_len; - unsigned char unc[131072]; - unsigned char cmp[143360]; - unsigned char wrk[16384]; +struct futex_hash_bucket { + atomic_t waiters; + spinlock_t lock; + struct plist_head chain; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct dec_data { - struct task_struct *thr; - atomic_t ready; - atomic_t stop; +enum futex_access { + FUTEX_READ = 0, + FUTEX_WRITE = 1, +}; + +struct dma_chan { + int lock; + const char *device_id; +}; + +enum { + CSD_FLAG_LOCK = 1, + CSD_FLAG_SYNCHRONOUS = 2, +}; + +struct call_function_data { + call_single_data_t *csd; + cpumask_var_t cpumask; + cpumask_var_t cpumask_ipi; +}; + +struct smp_call_on_cpu_struct { + struct work_struct work; + struct completion done; + int (*func)(void *); + void *data; int ret; - wait_queue_head_t go; - wait_queue_head_t done; - size_t unc_len; - size_t cmp_len; - unsigned char unc[131072]; - unsigned char cmp[143360]; + int cpu; }; -typedef s64 compat_loff_t; +struct latch_tree_root { + seqcount_t seq; + struct rb_root tree[2]; +}; -struct resume_swap_area { - __kernel_loff_t offset; - __u32 dev; -} __attribute__((packed)); +struct latch_tree_ops { + bool (*less)(struct latch_tree_node *, struct latch_tree_node *); + int (*comp)(void *, struct latch_tree_node *); +}; -struct snapshot_data { - struct snapshot_handle handle; - int swap; - int mode; - bool frozen; - bool ready; - bool platform_support; - bool free_bitmaps; +struct module_use { + struct list_head source_list; + struct list_head target_list; + struct module *source; + struct module *target; }; -struct compat_resume_swap_area { - compat_loff_t offset; - u32 dev; -} __attribute__((packed)); +struct module_sect_attr { + struct module_attribute mattr; + char *name; + long unsigned int address; +}; -struct sysrq_key_op { - void (*handler)(int); - char *help_msg; - char *action_msg; - int enable_mask; +struct module_sect_attrs { + struct attribute_group grp; + unsigned int nsections; + struct module_sect_attr attrs[0]; }; -struct kmsg_dumper { - struct list_head list; - void (*dump)(struct kmsg_dumper *, enum kmsg_dump_reason); - enum kmsg_dump_reason max_reason; - bool active; - bool registered; - u32 cur_idx; - u32 next_idx; - u64 cur_seq; - u64 next_seq; +struct module_notes_attrs { + struct kobject *dir; + unsigned int notes; + struct bin_attribute attrs[0]; +}; + +struct symsearch { + const struct kernel_symbol *start; + const struct kernel_symbol *stop; + const s32 *crcs; + enum { + NOT_GPL_ONLY = 0, + GPL_ONLY = 1, + WILL_BE_GPL_ONLY = 2, + } licence; + bool unused; +}; + +enum kernel_read_file_id { + READING_UNKNOWN = 0, + READING_FIRMWARE = 1, + READING_FIRMWARE_PREALLOC_BUFFER = 2, + READING_MODULE = 3, + READING_KEXEC_IMAGE = 4, + READING_KEXEC_INITRAMFS = 5, + READING_POLICY = 6, + READING_X509_CERTIFICATE = 7, + READING_MAX_ID = 8, +}; + +enum kernel_load_data_id { + LOADING_UNKNOWN = 0, + LOADING_FIRMWARE = 1, + LOADING_FIRMWARE_PREALLOC_BUFFER = 2, + LOADING_MODULE = 3, + LOADING_KEXEC_IMAGE = 4, + LOADING_KEXEC_INITRAMFS = 5, + LOADING_POLICY = 6, + LOADING_X509_CERTIFICATE = 7, + LOADING_MAX_ID = 8, +}; + +struct _ddebug { + const char *modname; + const char *function; + const char *filename; + const char *format; + unsigned int lineno: 18; + unsigned int flags: 8; + union { + struct static_key_true dd_key_true; + struct static_key_false dd_key_false; + } key; +}; + +struct load_info { + const char *name; + struct module *mod; + Elf64_Ehdr *hdr; + long unsigned int len; + Elf64_Shdr *sechdrs; + char *secstrings; + char *strtab; + long unsigned int symoffs; + long unsigned int stroffs; + long unsigned int init_typeoffs; + long unsigned int core_typeoffs; + struct _ddebug *debug; + unsigned int num_debug; + bool sig_ok; + long unsigned int mod_kallsyms_init_off; + struct { + unsigned int sym; + unsigned int str; + unsigned int mod; + unsigned int vers; + unsigned int info; + unsigned int pcpu; + } index; }; -struct trace_event_raw_console { +struct trace_event_raw_module_load { struct trace_entry ent; - u32 __data_loc_msg; + unsigned int taints; + u32 __data_loc_name; char __data[0]; }; -struct trace_event_data_offsets_console { - u32 msg; -}; - -struct console_cmdline { - char name[16]; - int index; - char *options; +struct trace_event_raw_module_free { + struct trace_entry ent; + u32 __data_loc_name; + char __data[0]; }; -enum devkmsg_log_bits { - __DEVKMSG_LOG_BIT_ON = 0, - __DEVKMSG_LOG_BIT_OFF = 1, - __DEVKMSG_LOG_BIT_LOCK = 2, +struct trace_event_raw_module_refcnt { + struct trace_entry ent; + long unsigned int ip; + int refcnt; + u32 __data_loc_name; + char __data[0]; }; -enum devkmsg_log_masks { - DEVKMSG_LOG_MASK_ON = 1, - DEVKMSG_LOG_MASK_OFF = 2, - DEVKMSG_LOG_MASK_LOCK = 4, +struct trace_event_raw_module_request { + struct trace_entry ent; + long unsigned int ip; + bool wait; + u32 __data_loc_name; + char __data[0]; }; -enum con_msg_format_flags { - MSG_FORMAT_DEFAULT = 0, - MSG_FORMAT_SYSLOG = 1, +struct trace_event_data_offsets_module_load { + u32 name; }; -enum log_flags { - LOG_NEWLINE = 2, - LOG_CONT = 8, +struct trace_event_data_offsets_module_free { + u32 name; }; -struct printk_log { - u64 ts_nsec; - u16 len; - u16 text_len; - u16 dict_len; - u8 facility; - u8 flags: 5; - u8 level: 3; +struct trace_event_data_offsets_module_refcnt { + u32 name; }; -struct devkmsg_user { - u64 seq; - u32 idx; - struct ratelimit_state rs; - struct mutex lock; - char buf[8192]; +struct trace_event_data_offsets_module_request { + u32 name; }; -struct cont { - char buf[992]; - size_t len; - u32 caller_id; - u64 ts_nsec; - u8 level; - u8 facility; - enum log_flags flags; -}; +typedef void (*btf_trace_module_load)(void *, struct module *); -struct printk_safe_seq_buf { - atomic_t len; - atomic_t message_lost; - struct irq_work work; - unsigned char buffer[8160]; -}; +typedef void (*btf_trace_module_free)(void *, struct module *); -enum { - IRQS_AUTODETECT = 1, - IRQS_SPURIOUS_DISABLED = 2, - IRQS_POLL_INPROGRESS = 8, - IRQS_ONESHOT = 32, - IRQS_REPLAY = 64, - IRQS_WAITING = 128, - IRQS_PENDING = 512, - IRQS_SUSPENDED = 2048, - IRQS_TIMINGS = 4096, - IRQS_NMI = 8192, -}; +typedef void (*btf_trace_module_get)(void *, struct module *, long unsigned int); -enum { - _IRQ_DEFAULT_INIT_FLAGS = 0, - _IRQ_PER_CPU = 512, - _IRQ_LEVEL = 256, - _IRQ_NOPROBE = 1024, - _IRQ_NOREQUEST = 2048, - _IRQ_NOTHREAD = 65536, - _IRQ_NOAUTOEN = 4096, - _IRQ_MOVE_PCNTXT = 16384, - _IRQ_NO_BALANCING = 8192, - _IRQ_NESTED_THREAD = 32768, - _IRQ_PER_CPU_DEVID = 131072, - _IRQ_IS_POLLED = 262144, - _IRQ_DISABLE_UNLAZY = 524288, - _IRQF_MODIFY_MASK = 1048335, -}; +typedef void (*btf_trace_module_put)(void *, struct module *, long unsigned int); -enum { - IRQTF_RUNTHREAD = 0, - IRQTF_WARNED = 1, - IRQTF_AFFINITY = 2, - IRQTF_FORCED_THREAD = 3, -}; +typedef void (*btf_trace_module_request)(void *, char *, bool, long unsigned int); -enum { - IRQC_IS_HARDIRQ = 0, - IRQC_IS_NESTED = 1, +struct mod_tree_root { + struct latch_tree_root root; + long unsigned int addr_min; + long unsigned int addr_max; }; -enum { - IRQ_STARTUP_NORMAL = 0, - IRQ_STARTUP_MANAGED = 1, - IRQ_STARTUP_ABORT = 2, +struct find_symbol_arg { + const char *name; + bool gplok; + bool warn; + struct module *owner; + const s32 *crc; + const struct kernel_symbol *sym; }; -struct irq_devres { - unsigned int irq; - void *dev_id; +struct mod_initfree { + struct llist_node node; + void *module_init; }; -struct irq_desc_devres { - unsigned int from; - unsigned int cnt; +struct kallsym_iter { + loff_t pos; + loff_t pos_arch_end; + loff_t pos_mod_end; + loff_t pos_ftrace_mod_end; + long unsigned int value; + unsigned int nameoff; + char type; + char name[128]; + char module_name[56]; + int exported; + int show_value; }; enum { - IRQ_DOMAIN_FLAG_HIERARCHY = 1, - IRQ_DOMAIN_NAME_ALLOCATED = 64, - IRQ_DOMAIN_FLAG_IPI_PER_CPU = 4, - IRQ_DOMAIN_FLAG_IPI_SINGLE = 8, - IRQ_DOMAIN_FLAG_MSI = 16, - IRQ_DOMAIN_FLAG_MSI_REMAP = 32, - IRQ_DOMAIN_FLAG_NONCORE = 65536, + SB_UNFROZEN = 0, + SB_FREEZE_WRITE = 1, + SB_FREEZE_PAGEFAULT = 2, + SB_FREEZE_FS = 3, + SB_FREEZE_COMPLETE = 4, }; -typedef u64 acpi_size; +struct audit_names; -struct acpi_buffer { - acpi_size length; - void *pointer; +struct filename { + const char *name; + const char *uptr; + int refcnt; + struct audit_names *aname; + const char iname[0]; }; -struct acpi_hotplug_profile { - struct kobject kobj; - int (*scan_dependent)(struct acpi_device *); - void (*notify_online)(struct acpi_device *); - bool enabled: 1; - bool demand_offline: 1; -}; +typedef __u16 comp_t; -struct acpi_device_status { - u32 present: 1; - u32 enabled: 1; - u32 show_in_ui: 1; - u32 functional: 1; - u32 battery_present: 1; - u32 reserved: 27; -}; +typedef __u32 comp2_t; -struct acpi_device_flags { - u32 dynamic_status: 1; - u32 removable: 1; - u32 ejectable: 1; - u32 power_manageable: 1; - u32 match_driver: 1; - u32 initialized: 1; - u32 visited: 1; - u32 hotplug_notify: 1; - u32 is_dock_station: 1; - u32 of_compatible_ok: 1; - u32 coherent_dma: 1; - u32 cca_seen: 1; - u32 enumeration_by_parent: 1; - u32 reserved: 19; +struct acct { + char ac_flag; + char ac_version; + __u16 ac_uid16; + __u16 ac_gid16; + __u16 ac_tty; + __u32 ac_btime; + comp_t ac_utime; + comp_t ac_stime; + comp_t ac_etime; + comp_t ac_mem; + comp_t ac_io; + comp_t ac_rw; + comp_t ac_minflt; + comp_t ac_majflt; + comp_t ac_swaps; + __u16 ac_ahz; + __u32 ac_exitcode; + char ac_comm[17]; + __u8 ac_etime_hi; + __u16 ac_etime_lo; + __u32 ac_uid; + __u32 ac_gid; }; -typedef char acpi_bus_id[8]; +typedef struct acct acct_t; -struct acpi_pnp_type { - u32 hardware_id: 1; - u32 bus_address: 1; - u32 platform_id: 1; - u32 reserved: 29; +struct fs_pin { + wait_queue_head_t wait; + int done; + struct hlist_node s_list; + struct hlist_node m_list; + void (*kill)(struct fs_pin *); }; -typedef u64 acpi_bus_address; - -typedef char acpi_device_name[40]; - -typedef char acpi_device_class[20]; - -struct acpi_device_pnp { - acpi_bus_id bus_id; - struct acpi_pnp_type type; - acpi_bus_address bus_address; - char *unique_id; - struct list_head ids; - acpi_device_name device_name; - acpi_device_class device_class; - union acpi_object *str_obj; +struct bsd_acct_struct { + struct fs_pin pin; + atomic_long_t count; + struct callback_head rcu; + struct mutex lock; + int active; + long unsigned int needcheck; + struct file *file; + struct pid_namespace *ns; + struct work_struct work; + struct completion done; }; -struct acpi_device_power_flags { - u32 explicit_get: 1; - u32 power_resources: 1; - u32 inrush_current: 1; - u32 power_removed: 1; - u32 ignore_parent: 1; - u32 dsw_present: 1; - u32 reserved: 26; +enum compound_dtor_id { + NULL_COMPOUND_DTOR = 0, + COMPOUND_PAGE_DTOR = 1, + HUGETLB_PAGE_DTOR = 2, + NR_COMPOUND_DTORS = 3, }; -struct acpi_device_power_state { - struct { - u8 valid: 1; - u8 explicit_set: 1; - u8 reserved: 6; - } flags; - int power; - int latency; - struct list_head resources; +struct elf64_note { + Elf64_Word n_namesz; + Elf64_Word n_descsz; + Elf64_Word n_type; }; -struct acpi_device_power { - int state; - struct acpi_device_power_flags flags; - struct acpi_device_power_state states[5]; -}; +typedef long unsigned int elf_greg_t; -struct acpi_device_wakeup_flags { - u8 valid: 1; - u8 notifier_present: 1; +typedef elf_greg_t elf_gregset_t[27]; + +struct elf_siginfo { + int si_signo; + int si_code; + int si_errno; }; -struct acpi_device_wakeup_context { - void (*func)(struct acpi_device_wakeup_context *); - struct device *dev; +struct elf_prstatus { + struct elf_siginfo pr_info; + short int pr_cursig; + long unsigned int pr_sigpend; + long unsigned int pr_sighold; + pid_t pr_pid; + pid_t pr_ppid; + pid_t pr_pgrp; + pid_t pr_sid; + struct __kernel_old_timeval pr_utime; + struct __kernel_old_timeval pr_stime; + struct __kernel_old_timeval pr_cutime; + struct __kernel_old_timeval pr_cstime; + elf_gregset_t pr_reg; + int pr_fpvalid; }; -struct acpi_device_wakeup { - acpi_handle gpe_device; - u64 gpe_number; - u64 sleep_state; - struct list_head resources; - struct acpi_device_wakeup_flags flags; - struct acpi_device_wakeup_context context; - struct wakeup_source *ws; - int prepare_count; - int enable_count; +struct compat_kexec_segment { + compat_uptr_t buf; + compat_size_t bufsz; + compat_ulong_t mem; + compat_size_t memsz; }; -struct acpi_device_perf_flags { - u8 reserved: 8; +enum migrate_reason { + MR_COMPACTION = 0, + MR_MEMORY_FAILURE = 1, + MR_MEMORY_HOTPLUG = 2, + MR_SYSCALL = 3, + MR_MEMPOLICY_MBIND = 4, + MR_NUMA_MISPLACED = 5, + MR_CONTIG_RANGE = 6, + MR_TYPES = 7, }; -struct acpi_device_perf_state; +typedef __kernel_ulong_t __kernel_ino_t; -struct acpi_device_perf { - int state; - struct acpi_device_perf_flags flags; - int state_count; - struct acpi_device_perf_state *states; -}; +typedef __kernel_ino_t ino_t; -struct acpi_device_dir { - struct proc_dir_entry *entry; +enum fs_context_purpose { + FS_CONTEXT_FOR_MOUNT = 0, + FS_CONTEXT_FOR_SUBMOUNT = 1, + FS_CONTEXT_FOR_RECONFIGURE = 2, }; -struct acpi_device_data { - const union acpi_object *pointer; - struct list_head properties; - const union acpi_object *of_compatible; - struct list_head subnodes; +enum fs_context_phase { + FS_CONTEXT_CREATE_PARAMS = 0, + FS_CONTEXT_CREATING = 1, + FS_CONTEXT_AWAITING_MOUNT = 2, + FS_CONTEXT_AWAITING_RECONF = 3, + FS_CONTEXT_RECONF_PARAMS = 4, + FS_CONTEXT_RECONFIGURING = 5, + FS_CONTEXT_FAILED = 6, }; -struct acpi_scan_handler; - -struct acpi_hotplug_context; - -struct acpi_driver; +struct fs_context_operations; -struct acpi_gpio_mapping; +struct fc_log; -struct acpi_device { - int device_type; - acpi_handle handle; - struct fwnode_handle fwnode; - struct acpi_device *parent; - struct list_head children; - struct list_head node; - struct list_head wakeup_list; - struct list_head del_list; - struct acpi_device_status status; - struct acpi_device_flags flags; - struct acpi_device_pnp pnp; - struct acpi_device_power power; - struct acpi_device_wakeup wakeup; - struct acpi_device_perf performance; - struct acpi_device_dir dir; - struct acpi_device_data data; - struct acpi_scan_handler *handler; - struct acpi_hotplug_context *hp; - struct acpi_driver *driver; - const struct acpi_gpio_mapping *driver_gpios; - void *driver_data; - struct device dev; - unsigned int physical_node_count; - unsigned int dep_unmet; - struct list_head physical_node_list; - struct mutex physical_node_lock; - void (*remove)(struct acpi_device *); +struct fs_context { + const struct fs_context_operations *ops; + struct mutex uapi_mutex; + struct file_system_type *fs_type; + void *fs_private; + void *sget_key; + struct dentry *root; + struct user_namespace *user_ns; + struct net *net_ns; + const struct cred *cred; + struct fc_log *log; + const char *source; + void *security; + void *s_fs_info; + unsigned int sb_flags; + unsigned int sb_flags_mask; + unsigned int s_iflags; + unsigned int lsm_flags; + enum fs_context_purpose purpose: 8; + enum fs_context_phase phase: 8; + bool need_free: 1; + bool global: 1; }; -struct acpi_scan_handler { - const struct acpi_device_id *ids; - struct list_head list_node; - bool (*match)(const char *, const struct acpi_device_id **); - int (*attach)(struct acpi_device *, const struct acpi_device_id *); - void (*detach)(struct acpi_device *); - void (*bind)(struct device *); - void (*unbind)(struct device *); - struct acpi_hotplug_profile hotplug; +enum kernfs_node_type { + KERNFS_DIR = 1, + KERNFS_FILE = 2, + KERNFS_LINK = 4, }; -struct acpi_hotplug_context { - struct acpi_device *self; - int (*notify)(struct acpi_device *, u32); - void (*uevent)(struct acpi_device *, u32); - void (*fixup)(struct acpi_device *); +enum kernfs_root_flag { + KERNFS_ROOT_CREATE_DEACTIVATED = 1, + KERNFS_ROOT_EXTRA_OPEN_PERM_CHECK = 2, + KERNFS_ROOT_SUPPORT_EXPORTOP = 4, }; -typedef int (*acpi_op_add)(struct acpi_device *); - -typedef int (*acpi_op_remove)(struct acpi_device *); - -typedef void (*acpi_op_notify)(struct acpi_device *, u32); +struct kernfs_fs_context { + struct kernfs_root *root; + void *ns_tag; + long unsigned int magic; + bool new_sb_created; +}; -struct acpi_device_ops { - acpi_op_add add; - acpi_op_remove remove; - acpi_op_notify notify; +enum { + __PERCPU_REF_ATOMIC = 1, + __PERCPU_REF_DEAD = 2, + __PERCPU_REF_ATOMIC_DEAD = 3, + __PERCPU_REF_FLAG_BITS = 2, }; -struct acpi_driver { - char name[80]; - char class[80]; - const struct acpi_device_id *ids; - unsigned int flags; - struct acpi_device_ops ops; - struct device_driver drv; - struct module *owner; +enum { + CSS_NO_REF = 1, + CSS_ONLINE = 2, + CSS_RELEASED = 4, + CSS_VISIBLE = 8, + CSS_DYING = 16, }; -struct acpi_device_perf_state { - struct { - u8 valid: 1; - u8 reserved: 7; - } flags; - u8 power; - u8 performance; - int latency; +enum { + CGRP_NOTIFY_ON_RELEASE = 0, + CGRP_CPUSET_CLONE_CHILDREN = 1, + CGRP_FREEZE = 2, + CGRP_FROZEN = 3, }; -struct acpi_gpio_params; - -struct acpi_gpio_mapping { - const char *name; - const struct acpi_gpio_params *data; - unsigned int size; - unsigned int quirks; +enum { + CGRP_ROOT_NOPREFIX = 2, + CGRP_ROOT_XATTR = 4, + CGRP_ROOT_NS_DELEGATE = 8, + CGRP_ROOT_CPUSET_V2_MODE = 16, + CGRP_ROOT_MEMORY_LOCAL_EVENTS = 32, }; -struct irqchip_fwid { - struct fwnode_handle fwnode; - unsigned int type; - char *name; - phys_addr_t *pa; +struct cgroup_taskset { + struct list_head src_csets; + struct list_head dst_csets; + int nr_tasks; + int ssid; + struct list_head *csets; + struct css_set *cur_cset; + struct task_struct *cur_task; }; -enum { - AFFINITY = 0, - AFFINITY_LIST = 1, - EFFECTIVE = 2, - EFFECTIVE_LIST = 3, +struct css_task_iter { + struct cgroup_subsys *ss; + unsigned int flags; + struct list_head *cset_pos; + struct list_head *cset_head; + struct list_head *tcset_pos; + struct list_head *tcset_head; + struct list_head *task_pos; + struct list_head *tasks_head; + struct list_head *mg_tasks_head; + struct list_head *dying_tasks_head; + struct css_set *cur_cset; + struct css_set *cur_dcset; + struct task_struct *cur_task; + struct list_head iters_node; }; -struct irq_affinity { - unsigned int pre_vectors; - unsigned int post_vectors; - unsigned int nr_sets; - unsigned int set_size[4]; - void (*calc_sets)(struct irq_affinity *, unsigned int); - void *priv; +enum fs_value_type { + fs_value_is_undefined = 0, + fs_value_is_flag = 1, + fs_value_is_string = 2, + fs_value_is_blob = 3, + fs_value_is_filename = 4, + fs_value_is_filename_empty = 5, + fs_value_is_file = 6, }; -struct node_vectors { - unsigned int id; +struct fs_parameter { + const char *key; + enum fs_value_type type: 8; union { - unsigned int nvectors; - unsigned int ncpus; + char *string; + void *blob; + struct filename *name; + struct file *file; }; + size_t size; + int dirfd; }; -struct cpumap { - unsigned int available; - unsigned int allocated; - unsigned int managed; - unsigned int managed_allocated; - bool initialized; - bool online; - long unsigned int alloc_map[4]; - long unsigned int managed_map[4]; +struct fs_context_operations { + void (*free)(struct fs_context *); + int (*dup)(struct fs_context *, struct fs_context *); + int (*parse_param)(struct fs_context *, struct fs_parameter *); + int (*parse_monolithic)(struct fs_context *, void *); + int (*get_tree)(struct fs_context *); + int (*reconfigure)(struct fs_context *); }; -struct irq_matrix___2 { - unsigned int matrix_bits; - unsigned int alloc_start; - unsigned int alloc_end; - unsigned int alloc_size; - unsigned int global_available; - unsigned int global_reserved; - unsigned int systembits_inalloc; - unsigned int total_allocated; - unsigned int online_maps; - struct cpumap *maps; - long unsigned int scratch_map[4]; - long unsigned int system_map[4]; +struct fc_log { + refcount_t usage; + u8 head; + u8 tail; + u8 need_free; + struct module *owner; + char *buffer[8]; }; -struct trace_event_raw_irq_matrix_global { - struct trace_entry ent; - unsigned int online_maps; - unsigned int global_available; - unsigned int global_reserved; - unsigned int total_allocated; - char __data[0]; +struct cgroup_fs_context { + struct kernfs_fs_context kfc; + struct cgroup_root *root; + struct cgroup_namespace *ns; + unsigned int flags; + bool cpuset_clone_children; + bool none; + bool all_ss; + u16 subsys_mask; + char *name; + char *release_agent; }; -struct trace_event_raw_irq_matrix_global_update { - struct trace_entry ent; - int bit; - unsigned int online_maps; - unsigned int global_available; - unsigned int global_reserved; - unsigned int total_allocated; - char __data[0]; +struct cgrp_cset_link { + struct cgroup *cgrp; + struct css_set *cset; + struct list_head cset_link; + struct list_head cgrp_link; }; -struct trace_event_raw_irq_matrix_cpu { - struct trace_entry ent; - int bit; - unsigned int cpu; - bool online; - unsigned int available; - unsigned int allocated; - unsigned int managed; - unsigned int online_maps; - unsigned int global_available; - unsigned int global_reserved; - unsigned int total_allocated; - char __data[0]; +struct cgroup_mgctx { + struct list_head preloaded_src_csets; + struct list_head preloaded_dst_csets; + struct cgroup_taskset tset; + u16 ss_mask; }; -struct trace_event_data_offsets_irq_matrix_global {}; - -struct trace_event_data_offsets_irq_matrix_global_update {}; - -struct trace_event_data_offsets_irq_matrix_cpu {}; - -typedef void (*call_rcu_func_t)(struct callback_head *, rcu_callback_t); - -struct rcu_synchronize { - struct callback_head head; - struct completion completion; +enum fs_parameter_type { + __fs_param_wasnt_defined = 0, + fs_param_is_flag = 1, + fs_param_is_bool = 2, + fs_param_is_u32 = 3, + fs_param_is_u32_octal = 4, + fs_param_is_u32_hex = 5, + fs_param_is_s32 = 6, + fs_param_is_u64 = 7, + fs_param_is_enum = 8, + fs_param_is_string = 9, + fs_param_is_blob = 10, + fs_param_is_blockdev = 11, + fs_param_is_path = 12, + fs_param_is_fd = 13, + nr__fs_parameter_type = 14, }; -struct trace_event_raw_rcu_utilization { - struct trace_entry ent; - const char *s; - char __data[0]; +struct fs_parameter_spec { + const char *name; + u8 opt; + enum fs_parameter_type type: 8; + short unsigned int flags; }; -struct trace_event_raw_rcu_grace_period { - struct trace_entry ent; - const char *rcuname; - long unsigned int gp_seq; - const char *gpevent; - char __data[0]; +struct fs_parameter_enum { + u8 opt; + char name[14]; + u8 value; }; -struct trace_event_raw_rcu_future_grace_period { - struct trace_entry ent; - const char *rcuname; - long unsigned int gp_seq; - long unsigned int gp_seq_req; - u8 level; - int grplo; - int grphi; - const char *gpevent; - char __data[0]; +struct fs_parse_result { + bool negated; + bool has_value; + union { + bool boolean; + int int_32; + unsigned int uint_32; + u64 uint_64; + }; }; -struct trace_event_raw_rcu_grace_period_init { +struct trace_event_raw_cgroup_root { struct trace_entry ent; - const char *rcuname; - long unsigned int gp_seq; - u8 level; - int grplo; - int grphi; - long unsigned int qsmask; + int root; + u16 ss_mask; + u32 __data_loc_name; char __data[0]; }; -struct trace_event_raw_rcu_exp_grace_period { +struct trace_event_raw_cgroup { struct trace_entry ent; - const char *rcuname; - long unsigned int gpseq; - const char *gpevent; + int root; + int id; + int level; + u32 __data_loc_path; char __data[0]; }; -struct trace_event_raw_rcu_exp_funnel_lock { +struct trace_event_raw_cgroup_migrate { struct trace_entry ent; - const char *rcuname; - u8 level; - int grplo; - int grphi; - const char *gpevent; + int dst_root; + int dst_id; + int dst_level; + int pid; + u32 __data_loc_dst_path; + u32 __data_loc_comm; char __data[0]; }; -struct trace_event_raw_rcu_preempt_task { +struct trace_event_raw_cgroup_event { struct trace_entry ent; - const char *rcuname; - long unsigned int gp_seq; - int pid; + int root; + int id; + int level; + u32 __data_loc_path; + int val; char __data[0]; }; -struct trace_event_raw_rcu_unlock_preempted_task { - struct trace_entry ent; - const char *rcuname; - long unsigned int gp_seq; - int pid; - char __data[0]; +struct trace_event_data_offsets_cgroup_root { + u32 name; }; -struct trace_event_raw_rcu_quiescent_state_report { - struct trace_entry ent; - const char *rcuname; - long unsigned int gp_seq; - long unsigned int mask; - long unsigned int qsmask; - u8 level; - int grplo; - int grphi; - u8 gp_tasks; - char __data[0]; +struct trace_event_data_offsets_cgroup { + u32 path; }; -struct trace_event_raw_rcu_fqs { - struct trace_entry ent; - const char *rcuname; - long unsigned int gp_seq; - int cpu; - const char *qsevent; - char __data[0]; +struct trace_event_data_offsets_cgroup_migrate { + u32 dst_path; + u32 comm; }; -struct trace_event_raw_rcu_dyntick { - struct trace_entry ent; - const char *polarity; - long int oldnesting; - long int newnesting; - int dynticks; - char __data[0]; +struct trace_event_data_offsets_cgroup_event { + u32 path; }; -struct trace_event_raw_rcu_callback { - struct trace_entry ent; - const char *rcuname; - void *rhp; - void *func; - long int qlen_lazy; - long int qlen; - char __data[0]; +typedef void (*btf_trace_cgroup_setup_root)(void *, struct cgroup_root *); + +typedef void (*btf_trace_cgroup_destroy_root)(void *, struct cgroup_root *); + +typedef void (*btf_trace_cgroup_remount)(void *, struct cgroup_root *); + +typedef void (*btf_trace_cgroup_mkdir)(void *, struct cgroup *, const char *); + +typedef void (*btf_trace_cgroup_rmdir)(void *, struct cgroup *, const char *); + +typedef void (*btf_trace_cgroup_release)(void *, struct cgroup *, const char *); + +typedef void (*btf_trace_cgroup_rename)(void *, struct cgroup *, const char *); + +typedef void (*btf_trace_cgroup_freeze)(void *, struct cgroup *, const char *); + +typedef void (*btf_trace_cgroup_unfreeze)(void *, struct cgroup *, const char *); + +typedef void (*btf_trace_cgroup_attach_task)(void *, struct cgroup *, const char *, struct task_struct *, bool); + +typedef void (*btf_trace_cgroup_transfer_tasks)(void *, struct cgroup *, const char *, struct task_struct *, bool); + +typedef void (*btf_trace_cgroup_notify_populated)(void *, struct cgroup *, const char *, int); + +typedef void (*btf_trace_cgroup_notify_frozen)(void *, struct cgroup *, const char *, int); + +enum cgroup2_param { + Opt_nsdelegate = 0, + Opt_memory_localevents = 1, + nr__cgroup2_params = 2, }; -struct trace_event_raw_rcu_kfree_callback { - struct trace_entry ent; - const char *rcuname; - void *rhp; - long unsigned int offset; - long int qlen_lazy; - long int qlen; - char __data[0]; +struct cgroupstats { + __u64 nr_sleeping; + __u64 nr_running; + __u64 nr_stopped; + __u64 nr_uninterruptible; + __u64 nr_io_wait; }; -struct trace_event_raw_rcu_batch_start { - struct trace_entry ent; - const char *rcuname; - long int qlen_lazy; - long int qlen; - long int blimit; - char __data[0]; +enum cgroup_filetype { + CGROUP_FILE_PROCS = 0, + CGROUP_FILE_TASKS = 1, }; -struct trace_event_raw_rcu_invoke_callback { - struct trace_entry ent; - const char *rcuname; - void *rhp; - void *func; - char __data[0]; +struct cgroup_pidlist { + struct { + enum cgroup_filetype type; + struct pid_namespace *ns; + } key; + pid_t *list; + int length; + struct list_head links; + struct cgroup *owner; + struct delayed_work destroy_dwork; }; -struct trace_event_raw_rcu_invoke_kfree_callback { - struct trace_entry ent; - const char *rcuname; - void *rhp; - long unsigned int offset; - char __data[0]; +enum cgroup1_param { + Opt_all = 0, + Opt_clone_children = 1, + Opt_cpuset_v2_mode = 2, + Opt_name = 3, + Opt_none = 4, + Opt_noprefix = 5, + Opt_release_agent = 6, + Opt_xattr = 7, }; -struct trace_event_raw_rcu_batch_end { - struct trace_entry ent; - const char *rcuname; - int callbacks_invoked; - char cb; - char nr; - char iit; - char risk; - char __data[0]; +enum freezer_state_flags { + CGROUP_FREEZER_ONLINE = 1, + CGROUP_FREEZING_SELF = 2, + CGROUP_FREEZING_PARENT = 4, + CGROUP_FROZEN = 8, + CGROUP_FREEZING = 6, }; -struct trace_event_raw_rcu_torture_read { - struct trace_entry ent; - char rcutorturename[8]; - struct callback_head *rhp; - long unsigned int secs; - long unsigned int c_old; - long unsigned int c; - char __data[0]; +struct freezer { + struct cgroup_subsys_state css; + unsigned int state; }; -struct trace_event_raw_rcu_barrier { - struct trace_entry ent; - const char *rcuname; - const char *s; - int cpu; +struct fmeter { int cnt; - long unsigned int done; - char __data[0]; + int val; + time64_t time; + spinlock_t lock; }; -struct trace_event_data_offsets_rcu_utilization {}; +struct cpuset { + struct cgroup_subsys_state css; + long unsigned int flags; + cpumask_var_t cpus_allowed; + nodemask_t mems_allowed; + cpumask_var_t effective_cpus; + nodemask_t effective_mems; + cpumask_var_t subparts_cpus; + nodemask_t old_mems_allowed; + struct fmeter fmeter; + int attach_in_progress; + int pn; + int relax_domain_level; + int nr_subparts_cpus; + int partition_root_state; + int use_parent_ecpus; + int child_ecpus_count; +}; -struct trace_event_data_offsets_rcu_grace_period {}; +struct tmpmasks { + cpumask_var_t addmask; + cpumask_var_t delmask; + cpumask_var_t new_cpus; +}; -struct trace_event_data_offsets_rcu_future_grace_period {}; +typedef enum { + CS_ONLINE = 0, + CS_CPU_EXCLUSIVE = 1, + CS_MEM_EXCLUSIVE = 2, + CS_MEM_HARDWALL = 3, + CS_MEMORY_MIGRATE = 4, + CS_SCHED_LOAD_BALANCE = 5, + CS_SPREAD_PAGE = 6, + CS_SPREAD_SLAB = 7, +} cpuset_flagbits_t; -struct trace_event_data_offsets_rcu_grace_period_init {}; +enum subparts_cmd { + partcmd_enable = 0, + partcmd_disable = 1, + partcmd_update = 2, +}; -struct trace_event_data_offsets_rcu_exp_grace_period {}; +struct cpuset_migrate_mm_work { + struct work_struct work; + struct mm_struct *mm; + nodemask_t from; + nodemask_t to; +}; -struct trace_event_data_offsets_rcu_exp_funnel_lock {}; +typedef enum { + FILE_MEMORY_MIGRATE = 0, + FILE_CPULIST = 1, + FILE_MEMLIST = 2, + FILE_EFFECTIVE_CPULIST = 3, + FILE_EFFECTIVE_MEMLIST = 4, + FILE_SUBPARTS_CPULIST = 5, + FILE_CPU_EXCLUSIVE = 6, + FILE_MEM_EXCLUSIVE = 7, + FILE_MEM_HARDWALL = 8, + FILE_SCHED_LOAD_BALANCE = 9, + FILE_PARTITION_ROOT = 10, + FILE_SCHED_RELAX_DOMAIN_LEVEL = 11, + FILE_MEMORY_PRESSURE_ENABLED = 12, + FILE_MEMORY_PRESSURE = 13, + FILE_SPREAD_PAGE = 14, + FILE_SPREAD_SLAB = 15, +} cpuset_filetype_t; -struct trace_event_data_offsets_rcu_preempt_task {}; +struct cpu_stop_done { + atomic_t nr_todo; + int ret; + struct completion completion; +}; -struct trace_event_data_offsets_rcu_unlock_preempted_task {}; +struct cpu_stopper { + struct task_struct *thread; + raw_spinlock_t lock; + bool enabled; + struct list_head works; + struct cpu_stop_work stop_work; +}; -struct trace_event_data_offsets_rcu_quiescent_state_report {}; +enum multi_stop_state { + MULTI_STOP_NONE = 0, + MULTI_STOP_PREPARE = 1, + MULTI_STOP_DISABLE_IRQ = 2, + MULTI_STOP_RUN = 3, + MULTI_STOP_EXIT = 4, +}; -struct trace_event_data_offsets_rcu_fqs {}; +struct multi_stop_data { + cpu_stop_fn_t fn; + void *data; + unsigned int num_threads; + const struct cpumask *active_cpus; + enum multi_stop_state state; + atomic_t thread_ack; +}; -struct trace_event_data_offsets_rcu_dyntick {}; +typedef int __kernel_mqd_t; -struct trace_event_data_offsets_rcu_callback {}; +typedef __kernel_mqd_t mqd_t; -struct trace_event_data_offsets_rcu_kfree_callback {}; +enum audit_state { + AUDIT_DISABLED = 0, + AUDIT_BUILD_CONTEXT = 1, + AUDIT_RECORD_CONTEXT = 2, +}; -struct trace_event_data_offsets_rcu_batch_start {}; +struct audit_cap_data { + kernel_cap_t permitted; + kernel_cap_t inheritable; + union { + unsigned int fE; + kernel_cap_t effective; + }; + kernel_cap_t ambient; + kuid_t rootid; +}; -struct trace_event_data_offsets_rcu_invoke_callback {}; +struct audit_names { + struct list_head list; + struct filename *name; + int name_len; + bool hidden; + long unsigned int ino; + dev_t dev; + umode_t mode; + kuid_t uid; + kgid_t gid; + dev_t rdev; + u32 osid; + struct audit_cap_data fcap; + unsigned int fcap_ver; + unsigned char type; + bool should_free; +}; -struct trace_event_data_offsets_rcu_invoke_kfree_callback {}; +struct mq_attr { + __kernel_long_t mq_flags; + __kernel_long_t mq_maxmsg; + __kernel_long_t mq_msgsize; + __kernel_long_t mq_curmsgs; + __kernel_long_t __reserved[4]; +}; -struct trace_event_data_offsets_rcu_batch_end {}; +struct audit_proctitle { + int len; + char *value; +}; -struct trace_event_data_offsets_rcu_torture_read {}; +struct audit_aux_data; -struct trace_event_data_offsets_rcu_barrier {}; +struct audit_tree_refs; -enum { - GP_IDLE = 0, - GP_ENTER = 1, - GP_PASSED = 2, - GP_EXIT = 3, - GP_REPLAY = 4, +struct audit_context { + int dummy; + int in_syscall; + enum audit_state state; + enum audit_state current_state; + unsigned int serial; + int major; + struct timespec64 ctime; + long unsigned int argv[4]; + long int return_code; + u64 prio; + int return_valid; + struct audit_names preallocated_names[5]; + int name_count; + struct list_head names_list; + char *filterkey; + struct path pwd; + struct audit_aux_data *aux; + struct audit_aux_data *aux_pids; + struct __kernel_sockaddr_storage *sockaddr; + size_t sockaddr_len; + pid_t pid; + pid_t ppid; + kuid_t uid; + kuid_t euid; + kuid_t suid; + kuid_t fsuid; + kgid_t gid; + kgid_t egid; + kgid_t sgid; + kgid_t fsgid; + long unsigned int personality; + int arch; + pid_t target_pid; + kuid_t target_auid; + kuid_t target_uid; + unsigned int target_sessionid; + u32 target_sid; + char target_comm[16]; + struct audit_tree_refs *trees; + struct audit_tree_refs *first_trees; + struct list_head killed_trees; + int tree_count; + int type; + union { + struct { + int nargs; + long int args[6]; + } socketcall; + struct { + kuid_t uid; + kgid_t gid; + umode_t mode; + u32 osid; + int has_perm; + uid_t perm_uid; + gid_t perm_gid; + umode_t perm_mode; + long unsigned int qbytes; + } ipc; + struct { + mqd_t mqdes; + struct mq_attr mqstat; + } mq_getsetattr; + struct { + mqd_t mqdes; + int sigev_signo; + } mq_notify; + struct { + mqd_t mqdes; + size_t msg_len; + unsigned int msg_prio; + struct timespec64 abs_timeout; + } mq_sendrecv; + struct { + int oflag; + umode_t mode; + struct mq_attr attr; + } mq_open; + struct { + pid_t pid; + struct audit_cap_data cap; + } capset; + struct { + int fd; + int flags; + } mmap; + struct { + int argc; + } execve; + struct { + char *name; + } module; + }; + int fds[2]; + struct audit_proctitle proctitle; }; -typedef long unsigned int ulong; +enum audit_nlgrps { + AUDIT_NLGRP_NONE = 0, + AUDIT_NLGRP_READLOG = 1, + __AUDIT_NLGRP_MAX = 2, +}; -struct rcu_cblist { - struct callback_head *head; - struct callback_head **tail; - long int len; - long int len_lazy; +struct audit_status { + __u32 mask; + __u32 enabled; + __u32 failure; + __u32 pid; + __u32 rate_limit; + __u32 backlog_limit; + __u32 lost; + __u32 backlog; + union { + __u32 version; + __u32 feature_bitmap; + }; + __u32 backlog_wait_time; }; -enum rcutorture_type { - RCU_FLAVOR = 0, - RCU_TASKS_FLAVOR = 1, - RCU_TRIVIAL_FLAVOR = 2, - SRCU_FLAVOR = 3, - INVALID_RCU_FLAVOR = 4, +struct audit_features { + __u32 vers; + __u32 mask; + __u32 features; + __u32 lock; }; -typedef long unsigned int pao_T_____3; +struct audit_tty_status { + __u32 enabled; + __u32 log_passwd; +}; -struct rcu_exp_work { - long unsigned int rew_s; - struct work_struct rew_work; +struct audit_sig_info { + uid_t uid; + pid_t pid; + char ctx[0]; }; -struct rcu_node { - raw_spinlock_t lock; - long unsigned int gp_seq; - long unsigned int gp_seq_needed; - long unsigned int completedqs; - long unsigned int qsmask; - long unsigned int rcu_gp_init_mask; - long unsigned int qsmaskinit; - long unsigned int qsmaskinitnext; - long unsigned int expmask; - long unsigned int expmaskinit; - long unsigned int expmaskinitnext; - long unsigned int ffmask; - long unsigned int grpmask; - int grplo; - int grphi; - u8 grpnum; - u8 level; - bool wait_blkd_tasks; - struct rcu_node *parent; - struct list_head blkd_tasks; - struct list_head *gp_tasks; - struct list_head *exp_tasks; - struct list_head *boost_tasks; - struct rt_mutex boost_mtx; - long unsigned int boost_time; - struct task_struct *boost_kthread_task; - unsigned int boost_kthread_status; - long: 32; - long: 64; - long: 64; - long: 64; - long: 64; - raw_spinlock_t fqslock; - long: 32; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - spinlock_t exp_lock; - long unsigned int exp_seq_rq; - wait_queue_head_t exp_wq[4]; - struct rcu_exp_work rew; - bool exp_need_flush; - long: 56; - long: 64; - long: 64; - long: 64; - long: 64; +struct net_generic { + union { + struct { + unsigned int len; + struct callback_head rcu; + } s; + void *ptr[0]; + }; }; -union rcu_noqs { - struct { - u8 norm; - u8 exp; - } b; - u16 s; +struct scm_creds { + u32 pid; + kuid_t uid; + kgid_t gid; }; -struct rcu_data { - long unsigned int gp_seq; - long unsigned int gp_seq_needed; - union rcu_noqs cpu_no_qs; - bool core_needs_qs; - bool beenonline; - bool gpwrap; - bool exp_deferred_qs; - struct rcu_node *mynode; - long unsigned int grpmask; - long unsigned int ticks_this_gp; - struct irq_work defer_qs_iw; - bool defer_qs_iw_pending; - struct rcu_segcblist cblist; - long int qlen_last_fqs_check; - long unsigned int n_force_qs_snap; - long int blimit; - int dynticks_snap; - long int dynticks_nesting; - long int dynticks_nmi_nesting; - atomic_t dynticks; - bool rcu_need_heavy_qs; - bool rcu_urgent_qs; - bool rcu_forced_tick; - struct callback_head barrier_head; - int exp_dynticks_snap; - struct task_struct *rcu_cpu_kthread_task; - unsigned int rcu_cpu_kthread_status; - char rcu_cpu_has_work; - unsigned int softirq_snap; - struct irq_work rcu_iw; - bool rcu_iw_pending; - long unsigned int rcu_iw_gp_seq; - long unsigned int rcu_ofl_gp_seq; - short int rcu_ofl_gp_flags; - long unsigned int rcu_onl_gp_seq; - short int rcu_onl_gp_flags; - long unsigned int last_fqs_resched; - int cpu; +struct netlink_skb_parms { + struct scm_creds creds; + __u32 portid; + __u32 dst_group; + __u32 flags; + struct sock *sk; + bool nsid_is_set; + int nsid; }; -struct rcu_state { - struct rcu_node node[5]; - struct rcu_node *level[3]; - int ncpus; - long: 32; - long: 64; - long: 64; - long: 64; - long: 64; - u8 boost; - long unsigned int gp_seq; - struct task_struct *gp_kthread; - struct swait_queue_head gp_wq; - short int gp_flags; - short int gp_state; - long unsigned int gp_wake_time; - long unsigned int gp_wake_seq; - struct mutex barrier_mutex; - atomic_t barrier_cpu_count; - struct completion barrier_completion; - long unsigned int barrier_sequence; - struct mutex exp_mutex; - struct mutex exp_wake_mutex; - long unsigned int expedited_sequence; - atomic_t expedited_need_qs; - struct swait_queue_head expedited_wq; - int ncpus_snap; - long unsigned int jiffies_force_qs; - long unsigned int jiffies_kick_kthreads; - long unsigned int n_force_qs; - long unsigned int gp_start; - long unsigned int gp_end; - long unsigned int gp_activity; - long unsigned int gp_req_activity; - long unsigned int jiffies_stall; - long unsigned int jiffies_resched; - long unsigned int n_force_qs_gpstart; - long unsigned int gp_max; - const char *name; - char abbr; - long: 56; - long: 64; - long: 64; - raw_spinlock_t ofl_lock; - long: 32; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct netlink_kernel_cfg { + unsigned int groups; + unsigned int flags; + void (*input)(struct sk_buff *); + struct mutex *cb_mutex; + int (*bind)(struct net *, int); + void (*unbind)(struct net *, int); + bool (*compare)(struct net *, struct sock *); }; -typedef bool pto_T_____7; +struct audit_netlink_list { + __u32 portid; + struct net *net; + struct sk_buff_head q; +}; -struct dma_devres { - size_t size; - void *vaddr; - dma_addr_t dma_handle; - long unsigned int attrs; +struct audit_net { + struct sock *sk; }; -enum dma_sync_target { - SYNC_FOR_CPU = 0, - SYNC_FOR_DEVICE = 1, +struct auditd_connection { + struct pid *pid; + u32 portid; + struct net *net; + struct callback_head rcu; }; -struct trace_event_raw_swiotlb_bounced { - struct trace_entry ent; - u32 __data_loc_dev_name; - u64 dma_mask; - dma_addr_t dev_addr; - size_t size; - enum swiotlb_force swiotlb_force; - char __data[0]; +struct audit_ctl_mutex { + struct mutex lock; + void *owner; }; -struct trace_event_data_offsets_swiotlb_bounced { - u32 dev_name; +struct audit_buffer { + struct sk_buff *skb; + struct audit_context *ctx; + gfp_t gfp_mask; }; -enum profile_type { - PROFILE_TASK_EXIT = 0, - PROFILE_MUNMAP = 1, +struct audit_reply { + __u32 portid; + struct net *net; + struct sk_buff *skb; }; -struct profile_hit { - u32 pc; - u32 hits; +enum { + Audit_equal = 0, + Audit_not_equal = 1, + Audit_bitmask = 2, + Audit_bittest = 3, + Audit_lt = 4, + Audit_gt = 5, + Audit_le = 6, + Audit_ge = 7, + Audit_bad = 8, }; -struct stacktrace_cookie { - long unsigned int *store; - unsigned int size; - unsigned int skip; - unsigned int len; +struct audit_rule_data { + __u32 flags; + __u32 action; + __u32 field_count; + __u32 mask[64]; + __u32 fields[64]; + __u32 values[64]; + __u32 fieldflags[64]; + __u32 buflen; + char buf[0]; }; -typedef __kernel_long_t __kernel_suseconds_t; +struct audit_field; -typedef __kernel_long_t __kernel_old_time_t; +struct audit_watch; -typedef __kernel_suseconds_t suseconds_t; +struct audit_tree; -typedef __u64 timeu64_t; +struct audit_fsnotify_mark; -struct __kernel_itimerspec { - struct __kernel_timespec it_interval; - struct __kernel_timespec it_value; +struct audit_krule { + u32 pflags; + u32 flags; + u32 listnr; + u32 action; + u32 mask[64]; + u32 buflen; + u32 field_count; + char *filterkey; + struct audit_field *fields; + struct audit_field *arch_f; + struct audit_field *inode_f; + struct audit_watch *watch; + struct audit_tree *tree; + struct audit_fsnotify_mark *exe; + struct list_head rlist; + struct list_head list; + u64 prio; }; -struct timespec { - __kernel_old_time_t tv_sec; - long int tv_nsec; +struct audit_field { + u32 type; + union { + u32 val; + kuid_t uid; + kgid_t gid; + struct { + char *lsm_str; + void *lsm_rule; + }; + }; + u32 op; }; -struct timeval { - __kernel_old_time_t tv_sec; - __kernel_suseconds_t tv_usec; +struct audit_entry { + struct list_head list; + struct callback_head rcu; + struct audit_krule rule; }; -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; +struct audit_buffer___2; -struct itimerspec64 { - struct timespec64 it_interval; - struct timespec64 it_value; -}; +typedef int __kernel_key_t; -struct old_itimerspec32 { - struct old_timespec32 it_interval; - struct old_timespec32 it_value; +typedef __kernel_key_t key_t; + +struct cpu_vfs_cap_data { + __u32 magic_etc; + kernel_cap_t permitted; + kernel_cap_t inheritable; + kuid_t rootid; }; -struct old_timex32 { - u32 modes; - s32 offset; - s32 freq; - s32 maxerror; - s32 esterror; - s32 status; - s32 constant; - s32 precision; - s32 tolerance; - struct old_timeval32 time; - s32 tick; - s32 ppsfreq; - s32 jitter; - s32 shift; - s32 stabil; - s32 jitcnt; - s32 calcnt; - s32 errcnt; - s32 stbcnt; - s32 tai; +struct kern_ipc_perm { + spinlock_t lock; + bool deleted; + int id; + key_t key; + kuid_t uid; + kgid_t gid; + kuid_t cuid; + kgid_t cgid; + umode_t mode; + long unsigned int seq; + void *security; + struct rhash_head khtnode; + struct callback_head rcu; + refcount_t refcount; long: 32; long: 64; long: 64; @@ -27015,3168 +31925,2867 @@ struct old_timex32 { long: 64; }; -struct __kernel_timex_timeval { - __kernel_time64_t tv_sec; - long long int tv_usec; -}; +typedef struct fsnotify_mark_connector *fsnotify_connp_t; -struct __kernel_timex { - unsigned int modes; - long long int offset; - long long int freq; - long long int maxerror; - long long int esterror; - int status; - long long int constant; - long long int precision; - long long int tolerance; - struct __kernel_timex_timeval time; - long long int tick; - long long int ppsfreq; - long long int jitter; - int shift; - long long int stabil; - long long int jitcnt; - long long int calcnt; - long long int errcnt; - long long int stbcnt; - int tai; - long: 32; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct fsnotify_mark_connector { + spinlock_t lock; + short unsigned int type; + short unsigned int flags; + __kernel_fsid_t fsid; + union { + fsnotify_connp_t *obj; + struct fsnotify_mark_connector *destroy_next; + }; + struct hlist_head list; }; -struct trace_event_raw_timer_class { - struct trace_entry ent; - void *timer; - char __data[0]; +enum fsnotify_obj_type { + FSNOTIFY_OBJ_TYPE_INODE = 0, + FSNOTIFY_OBJ_TYPE_VFSMOUNT = 1, + FSNOTIFY_OBJ_TYPE_SB = 2, + FSNOTIFY_OBJ_TYPE_COUNT = 3, + FSNOTIFY_OBJ_TYPE_DETACHED = 3, }; -struct trace_event_raw_timer_start { - struct trace_entry ent; - void *timer; - void *function; - long unsigned int expires; - long unsigned int now; - unsigned int flags; - char __data[0]; +struct audit_aux_data { + struct audit_aux_data *next; + int type; }; -struct trace_event_raw_timer_expire_entry { - struct trace_entry ent; - void *timer; - long unsigned int now; - void *function; - long unsigned int baseclk; - char __data[0]; -}; +struct audit_chunk; -struct trace_event_raw_hrtimer_init { - struct trace_entry ent; - void *hrtimer; - clockid_t clockid; - enum hrtimer_mode mode; - char __data[0]; +struct audit_tree_refs { + struct audit_tree_refs *next; + struct audit_chunk *c[31]; }; -struct trace_event_raw_hrtimer_start { - struct trace_entry ent; - void *hrtimer; - void *function; - s64 expires; - s64 softexpires; - enum hrtimer_mode mode; - char __data[0]; +struct audit_aux_data_pids { + struct audit_aux_data d; + pid_t target_pid[16]; + kuid_t target_auid[16]; + kuid_t target_uid[16]; + unsigned int target_sessionid[16]; + u32 target_sid[16]; + char target_comm[256]; + int pid_count; }; -struct trace_event_raw_hrtimer_expire_entry { - struct trace_entry ent; - void *hrtimer; - s64 now; - void *function; - char __data[0]; +struct audit_aux_data_bprm_fcaps { + struct audit_aux_data d; + struct audit_cap_data fcap; + unsigned int fcap_ver; + struct audit_cap_data old_pcap; + struct audit_cap_data new_pcap; }; -struct trace_event_raw_hrtimer_class { - struct trace_entry ent; - void *hrtimer; - char __data[0]; -}; +struct audit_parent; -struct trace_event_raw_itimer_state { - struct trace_entry ent; - int which; - long long unsigned int expires; - long int value_sec; - long int value_nsec; - long int interval_sec; - long int interval_nsec; - char __data[0]; +struct audit_watch { + refcount_t count; + dev_t dev; + char *path; + long unsigned int ino; + struct audit_parent *parent; + struct list_head wlist; + struct list_head rules; }; -struct trace_event_raw_itimer_expire { - struct trace_entry ent; - int which; - pid_t pid; - long long unsigned int now; - char __data[0]; -}; +struct fsnotify_group; -struct trace_event_raw_tick_stop { - struct trace_entry ent; - int success; - int dependency; - char __data[0]; -}; +struct fsnotify_iter_info; -struct trace_event_data_offsets_timer_class {}; +struct fsnotify_mark; -struct trace_event_data_offsets_timer_start {}; +struct fsnotify_event; -struct trace_event_data_offsets_timer_expire_entry {}; +struct fsnotify_ops { + int (*handle_event)(struct fsnotify_group *, struct inode *, u32, const void *, int, const struct qstr *, u32, struct fsnotify_iter_info *); + void (*free_group_priv)(struct fsnotify_group *); + void (*freeing_mark)(struct fsnotify_mark *, struct fsnotify_group *); + void (*free_event)(struct fsnotify_event *); + void (*free_mark)(struct fsnotify_mark *); +}; -struct trace_event_data_offsets_hrtimer_init {}; +struct inotify_group_private_data { + spinlock_t idr_lock; + struct idr idr; + struct ucounts *ucounts; +}; -struct trace_event_data_offsets_hrtimer_start {}; +struct fsnotify_group { + const struct fsnotify_ops *ops; + refcount_t refcnt; + spinlock_t notification_lock; + struct list_head notification_list; + wait_queue_head_t notification_waitq; + unsigned int q_len; + unsigned int max_events; + unsigned int priority; + bool shutdown; + struct mutex mark_mutex; + atomic_t num_marks; + atomic_t user_waits; + struct list_head marks_list; + struct fasync_struct *fsn_fa; + struct fsnotify_event *overflow_event; + struct mem_cgroup *memcg; + union { + void *private; + struct inotify_group_private_data inotify_data; + }; +}; -struct trace_event_data_offsets_hrtimer_expire_entry {}; +struct fsnotify_iter_info { + struct fsnotify_mark *marks[3]; + unsigned int report_mask; + int srcu_idx; +}; -struct trace_event_data_offsets_hrtimer_class {}; +struct fsnotify_mark { + __u32 mask; + refcount_t refcnt; + struct fsnotify_group *group; + struct list_head g_list; + spinlock_t lock; + struct hlist_node obj_list; + struct fsnotify_mark_connector *connector; + __u32 ignored_mask; + unsigned int flags; +}; -struct trace_event_data_offsets_itimer_state {}; +struct fsnotify_event { + struct list_head list; + struct inode *inode; +}; -struct trace_event_data_offsets_itimer_expire {}; +struct audit_parent { + struct list_head watches; + struct fsnotify_mark mark; +}; -struct trace_event_data_offsets_tick_stop {}; +struct audit_fsnotify_mark { + dev_t dev; + long unsigned int ino; + char *path; + struct fsnotify_mark mark; + struct audit_krule *rule; +}; -struct timer_base { - raw_spinlock_t lock; - struct timer_list *running_timer; - long unsigned int clk; - long unsigned int next_expiry; - unsigned int cpu; - bool is_idle; - bool must_forward_clk; - long unsigned int pending_map[9]; - struct hlist_head vectors[576]; - long: 64; - long: 64; +struct audit_chunk___2; + +struct audit_tree { + refcount_t count; + int goner; + struct audit_chunk___2 *root; + struct list_head chunks; + struct list_head rules; + struct list_head list; + struct list_head same_root; + struct callback_head head; + char pathname[0]; }; -struct process_timer { - struct timer_list timer; - struct task_struct *task; +struct node___2 { + struct list_head list; + struct audit_tree *owner; + unsigned int index; }; -enum tick_device_mode { - TICKDEV_MODE_PERIODIC = 0, - TICKDEV_MODE_ONESHOT = 1, +struct audit_chunk___2 { + struct list_head hash; + long unsigned int key; + struct fsnotify_mark *mark; + struct list_head trees; + int count; + atomic_long_t refs; + struct callback_head head; + struct node___2 owners[0]; }; -struct tick_device { - struct clock_event_device *evtdev; - enum tick_device_mode mode; +struct audit_tree_mark { + struct fsnotify_mark mark; + struct audit_chunk___2 *chunk; }; -struct system_time_snapshot { - u64 cycles; - ktime_t real; - ktime_t raw; - unsigned int clock_was_set_seq; - u8 cs_was_changed_seq; +enum { + HASH_SIZE = 128, }; -struct system_device_crosststamp { - ktime_t device; - ktime_t sys_realtime; - ktime_t sys_monoraw; +struct kprobe_blacklist_entry { + struct list_head list; + long unsigned int start_addr; + long unsigned int end_addr; }; -struct tk_read_base { - struct clocksource *clock; - u64 mask; - u64 cycle_last; - u32 mult; - u32 shift; - u64 xtime_nsec; - ktime_t base; - u64 base_real; +struct kprobe_insn_page { + struct list_head list; + kprobe_opcode_t *insns; + struct kprobe_insn_cache *cache; + int nused; + int ngarbage; + char slot_used[0]; }; -struct timekeeper { - struct tk_read_base tkr_mono; - struct tk_read_base tkr_raw; - u64 xtime_sec; - long unsigned int ktime_sec; - struct timespec64 wall_to_monotonic; - ktime_t offs_real; - ktime_t offs_boot; - ktime_t offs_tai; - s32 tai_offset; - unsigned int clock_was_set_seq; - u8 cs_was_changed_seq; - ktime_t next_leap_ktime; - u64 raw_sec; - struct timespec64 monotonic_to_boot; - u64 cycle_interval; - u64 xtime_interval; - s64 xtime_remainder; - u64 raw_interval; - u64 ntp_tick; - s64 ntp_error; - u32 ntp_error_shift; - u32 ntp_err_mult; - u32 skip_second_overflow; +enum kprobe_slot_state { + SLOT_CLEAN = 0, + SLOT_DIRTY = 1, + SLOT_USED = 2, }; -struct audit_ntp_val { - long long int oldval; - long long int newval; +struct seccomp_notif_sizes { + __u16 seccomp_notif; + __u16 seccomp_notif_resp; + __u16 seccomp_data; }; -struct audit_ntp_data { - struct audit_ntp_val vals[6]; +struct seccomp_notif { + __u64 id; + __u32 pid; + __u32 flags; + struct seccomp_data data; }; -enum timekeeping_adv_mode { - TK_ADV_TICK = 0, - TK_ADV_FREQ = 1, +struct seccomp_notif_resp { + __u64 id; + __s64 val; + __s32 error; + __u32 flags; }; -struct tk_fast { - seqcount_t seq; - struct tk_read_base base[2]; +struct notification; + +struct seccomp_filter { + refcount_t usage; + bool log; + struct seccomp_filter *prev; + struct bpf_prog *prog; + struct notification *notif; + struct mutex notify_lock; }; -typedef s64 int64_t; +struct ctl_path { + const char *procname; +}; -enum tick_nohz_mode { - NOHZ_MODE_INACTIVE = 0, - NOHZ_MODE_LOWRES = 1, - NOHZ_MODE_HIGHRES = 2, +struct sock_fprog { + short unsigned int len; + struct sock_filter *filter; }; -struct tick_sched { - struct hrtimer sched_timer; - long unsigned int check_clocks; - enum tick_nohz_mode nohz_mode; - unsigned int inidle: 1; - unsigned int tick_stopped: 1; - unsigned int idle_active: 1; - unsigned int do_timer_last: 1; - unsigned int got_idle_tick: 1; - ktime_t last_tick; - ktime_t next_tick; - long unsigned int idle_jiffies; - long unsigned int idle_calls; - long unsigned int idle_sleeps; - ktime_t idle_entrytime; - ktime_t idle_waketime; - ktime_t idle_exittime; - ktime_t idle_sleeptime; - ktime_t iowait_sleeptime; - long unsigned int last_jiffies; - u64 timer_expires; - u64 timer_expires_base; - u64 next_timer; - ktime_t idle_expires; - atomic_t tick_dep_mask; +struct compat_sock_fprog { + u16 len; + compat_uptr_t filter; }; -struct timer_list_iter { - int cpu; - bool second_pass; - u64 now; +enum notify_state { + SECCOMP_NOTIFY_INIT = 0, + SECCOMP_NOTIFY_SENT = 1, + SECCOMP_NOTIFY_REPLIED = 2, }; -struct tm { - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - long int tm_year; - int tm_wday; - int tm_yday; +struct seccomp_knotif { + struct task_struct *task; + u64 id; + const struct seccomp_data *data; + enum notify_state state; + int error; + long int val; + u32 flags; + struct completion ready; + struct list_head list; }; -struct cyclecounter { - u64 (*read)(const struct cyclecounter *); - u64 mask; - u32 mult; - u32 shift; +struct notification { + struct semaphore request; + u64 next_id; + struct list_head notifications; + wait_queue_head_t wqh; }; -struct timecounter { - const struct cyclecounter *cc; - u64 cycle_last; - u64 nsec; - u64 mask; - u64 frac; +struct seccomp_log_name { + u32 log; + const char *name; }; -typedef __kernel_timer_t timer_t; +struct rchan; -struct rtc_wkalrm { - unsigned char enabled; - unsigned char pending; - struct rtc_time time; +struct rchan_buf { + void *start; + void *data; + size_t offset; + size_t subbufs_produced; + size_t subbufs_consumed; + struct rchan *chan; + wait_queue_head_t read_wait; + struct irq_work wakeup_work; + struct dentry *dentry; + struct kref kref; + struct page **page_array; + unsigned int page_count; + unsigned int finalized; + size_t *padding; + size_t prev_padding; + size_t bytes_consumed; + size_t early_bytes; + unsigned int cpu; + long: 32; + long: 64; + long: 64; + long: 64; }; -enum alarmtimer_type { - ALARM_REALTIME = 0, - ALARM_BOOTTIME = 1, - ALARM_NUMTYPE = 2, - ALARM_REALTIME_FREEZER = 3, - ALARM_BOOTTIME_FREEZER = 4, -}; +struct rchan_callbacks; -enum alarmtimer_restart { - ALARMTIMER_NORESTART = 0, - ALARMTIMER_RESTART = 1, +struct rchan { + u32 version; + size_t subbuf_size; + size_t n_subbufs; + size_t alloc_size; + struct rchan_callbacks *cb; + struct kref kref; + void *private_data; + size_t last_toobig; + struct rchan_buf **buf; + int is_global; + struct list_head list; + struct dentry *parent; + int has_base_filename; + char base_filename[255]; }; -struct alarm { - struct timerqueue_node node; - struct hrtimer timer; - enum alarmtimer_restart (*function)(struct alarm *, ktime_t); - enum alarmtimer_type type; - int state; - void *data; +struct rchan_callbacks { + int (*subbuf_start)(struct rchan_buf *, void *, void *, size_t); + void (*buf_mapped)(struct rchan_buf *, struct file *); + void (*buf_unmapped)(struct rchan_buf *, struct file *); + struct dentry * (*create_buf_file)(const char *, struct dentry *, umode_t, struct rchan_buf *, int *); + int (*remove_buf_file)(struct dentry *); }; -struct cpu_timer { - struct timerqueue_node node; - struct timerqueue_head *head; - struct task_struct *task; - struct list_head elist; - int firing; +struct partial_page { + unsigned int offset; + unsigned int len; + long unsigned int private; }; -struct k_clock; +struct splice_pipe_desc { + struct page **pages; + struct partial_page *partial; + int nr_pages; + unsigned int nr_pages_max; + const struct pipe_buf_operations *ops; + void (*spd_release)(struct splice_pipe_desc *, unsigned int); +}; -struct k_itimer { - struct list_head list; - struct hlist_node t_hash; - spinlock_t it_lock; - const struct k_clock *kclock; - clockid_t it_clock; - timer_t it_id; - int it_active; - s64 it_overrun; - s64 it_overrun_last; - int it_requeue_pending; - int it_sigev_notify; - ktime_t it_interval; - struct signal_struct *it_signal; - union { - struct pid *it_pid; - struct task_struct *it_process; - }; - struct sigqueue *sigq; - union { - struct { - struct hrtimer timer; - } real; - struct cpu_timer cpu; - struct { - struct alarm alarmtimer; - } alarm; - } it; - struct callback_head rcu; +struct rchan_percpu_buf_dispatcher { + struct rchan_buf *buf; + struct dentry *dentry; }; -struct k_clock { - int (*clock_getres)(const clockid_t, struct timespec64 *); - int (*clock_set)(const clockid_t, const struct timespec64 *); - int (*clock_get)(const clockid_t, struct timespec64 *); - int (*clock_adj)(const clockid_t, struct __kernel_timex *); - int (*timer_create)(struct k_itimer *); - int (*nsleep)(const clockid_t, int, const struct timespec64 *); - int (*timer_set)(struct k_itimer *, int, struct itimerspec64 *, struct itimerspec64 *); - int (*timer_del)(struct k_itimer *); - void (*timer_get)(struct k_itimer *, struct itimerspec64 *); - void (*timer_rearm)(struct k_itimer *); - s64 (*timer_forward)(struct k_itimer *, ktime_t); - ktime_t (*timer_remaining)(struct k_itimer *, ktime_t); - int (*timer_try_to_cancel)(struct k_itimer *); - void (*timer_arm)(struct k_itimer *, ktime_t, bool, bool); - void (*timer_wait_running)(struct k_itimer *); +enum { + TASKSTATS_TYPE_UNSPEC = 0, + TASKSTATS_TYPE_PID = 1, + TASKSTATS_TYPE_TGID = 2, + TASKSTATS_TYPE_STATS = 3, + TASKSTATS_TYPE_AGGR_PID = 4, + TASKSTATS_TYPE_AGGR_TGID = 5, + TASKSTATS_TYPE_NULL = 6, + __TASKSTATS_TYPE_MAX = 7, }; -struct class_interface { - struct list_head node; - struct class *class; - int (*add_dev)(struct device *, struct class_interface *); - void (*remove_dev)(struct device *, struct class_interface *); +enum { + TASKSTATS_CMD_ATTR_UNSPEC = 0, + TASKSTATS_CMD_ATTR_PID = 1, + TASKSTATS_CMD_ATTR_TGID = 2, + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 3, + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 4, + __TASKSTATS_CMD_ATTR_MAX = 5, }; -struct rtc_class_ops { - int (*ioctl)(struct device *, unsigned int, long unsigned int); - int (*read_time)(struct device *, struct rtc_time *); - int (*set_time)(struct device *, struct rtc_time *); - int (*read_alarm)(struct device *, struct rtc_wkalrm *); - int (*set_alarm)(struct device *, struct rtc_wkalrm *); - int (*proc)(struct device *, struct seq_file *); - int (*alarm_irq_enable)(struct device *, unsigned int); - int (*read_offset)(struct device *, long int *); - int (*set_offset)(struct device *, long int); +enum { + CGROUPSTATS_CMD_UNSPEC = 3, + CGROUPSTATS_CMD_GET = 4, + CGROUPSTATS_CMD_NEW = 5, + __CGROUPSTATS_CMD_MAX = 6, }; -struct rtc_device; +enum { + CGROUPSTATS_TYPE_UNSPEC = 0, + CGROUPSTATS_TYPE_CGROUP_STATS = 1, + __CGROUPSTATS_TYPE_MAX = 2, +}; -struct rtc_timer { - struct timerqueue_node node; - ktime_t period; - void (*func)(struct rtc_device *); - struct rtc_device *rtc; - int enabled; +enum { + CGROUPSTATS_CMD_ATTR_UNSPEC = 0, + CGROUPSTATS_CMD_ATTR_FD = 1, + __CGROUPSTATS_CMD_ATTR_MAX = 2, }; -struct rtc_device { - struct device dev; - struct module *owner; - int id; - const struct rtc_class_ops *ops; - struct mutex ops_lock; - struct cdev char_dev; - long unsigned int flags; - long unsigned int irq_data; - spinlock_t irq_lock; - wait_queue_head_t irq_queue; - struct fasync_struct *async_queue; - int irq_freq; - int max_user_freq; - struct timerqueue_head timerqueue; - struct rtc_timer aie_timer; - struct rtc_timer uie_rtctimer; - struct hrtimer pie_timer; - int pie_enabled; - struct work_struct irqwork; - int uie_unsupported; - long int set_offset_nsec; - bool registered; - bool nvram_old_abi; - struct bin_attribute *nvram; - time64_t range_min; - timeu64_t range_max; - time64_t start_secs; - time64_t offset_secs; - bool set_start_time; +struct genlmsghdr { + __u8 cmd; + __u8 version; + __u16 reserved; }; -struct platform_driver { - int (*probe)(struct platform_device *); - int (*remove)(struct platform_device *); - void (*shutdown)(struct platform_device *); - int (*suspend)(struct platform_device *, pm_message_t); - int (*resume)(struct platform_device *); - struct device_driver driver; - const struct platform_device_id *id_table; - bool prevent_deferred_probe; +enum { + NLA_UNSPEC = 0, + NLA_U8 = 1, + NLA_U16 = 2, + NLA_U32 = 3, + NLA_U64 = 4, + NLA_STRING = 5, + NLA_FLAG = 6, + NLA_MSECS = 7, + NLA_NESTED = 8, + NLA_NESTED_ARRAY = 9, + NLA_NUL_STRING = 10, + NLA_BINARY = 11, + NLA_S8 = 12, + NLA_S16 = 13, + NLA_S32 = 14, + NLA_S64 = 15, + NLA_BITFIELD32 = 16, + NLA_REJECT = 17, + NLA_EXACT_LEN = 18, + NLA_EXACT_LEN_WARN = 19, + NLA_MIN_LEN = 20, + __NLA_TYPE_MAX = 21, }; -struct trace_event_raw_alarmtimer_suspend { - struct trace_entry ent; - s64 expires; - unsigned char alarm_type; - char __data[0]; +enum netlink_validation { + NL_VALIDATE_LIBERAL = 0, + NL_VALIDATE_TRAILING = 1, + NL_VALIDATE_MAXTYPE = 2, + NL_VALIDATE_UNSPEC = 4, + NL_VALIDATE_STRICT_ATTRS = 8, + NL_VALIDATE_NESTED = 16, }; -struct trace_event_raw_alarm_class { - struct trace_entry ent; - void *alarm; - unsigned char alarm_type; - s64 expires; - s64 now; - char __data[0]; +struct genl_multicast_group { + char name[16]; }; -struct trace_event_data_offsets_alarmtimer_suspend {}; +struct genl_ops; -struct trace_event_data_offsets_alarm_class {}; +struct genl_info; -struct alarm_base { - spinlock_t lock; - struct timerqueue_head timerqueue; - ktime_t (*gettime)(); - clockid_t base_clockid; +struct genl_family { + int id; + unsigned int hdrsize; + char name[16]; + unsigned int version; + unsigned int maxattr; + bool netnsok; + bool parallel_ops; + const struct nla_policy *policy; + int (*pre_doit)(const struct genl_ops *, struct sk_buff *, struct genl_info *); + void (*post_doit)(const struct genl_ops *, struct sk_buff *, struct genl_info *); + int (*mcast_bind)(struct net *, int); + void (*mcast_unbind)(struct net *, int); + struct nlattr **attrbuf; + const struct genl_ops *ops; + const struct genl_multicast_group *mcgrps; + unsigned int n_ops; + unsigned int n_mcgrps; + unsigned int mcgrp_offset; + struct module *module; }; -struct sigevent { - sigval_t sigev_value; - int sigev_signo; - int sigev_notify; - union { - int _pad[12]; - int _tid; - struct { - void (*_function)(sigval_t); - void *_attribute; - } _sigev_thread; - } _sigev_un; +struct genl_ops { + int (*doit)(struct sk_buff *, struct genl_info *); + int (*start)(struct netlink_callback *); + int (*dumpit)(struct sk_buff *, struct netlink_callback *); + int (*done)(struct netlink_callback *); + u8 cmd; + u8 internal_flags; + u8 flags; + u8 validate; }; -typedef struct sigevent sigevent_t; - -struct compat_sigevent { - compat_sigval_t sigev_value; - compat_int_t sigev_signo; - compat_int_t sigev_notify; - union { - compat_int_t _pad[13]; - compat_int_t _tid; - struct { - compat_uptr_t _function; - compat_uptr_t _attribute; - } _sigev_thread; - } _sigev_un; +struct genl_info { + u32 snd_seq; + u32 snd_portid; + struct nlmsghdr *nlhdr; + struct genlmsghdr *genlhdr; + void *userhdr; + struct nlattr **attrs; + possible_net_t _net; + void *user_ptr[2]; + struct netlink_ext_ack *extack; }; -typedef unsigned int uint; - -struct posix_clock; +enum genl_validate_flags { + GENL_DONT_VALIDATE_STRICT = 1, + GENL_DONT_VALIDATE_DUMP = 2, + GENL_DONT_VALIDATE_DUMP_STRICT = 4, +}; -struct posix_clock_operations { - struct module *owner; - int (*clock_adjtime)(struct posix_clock *, struct __kernel_timex *); - int (*clock_gettime)(struct posix_clock *, struct timespec64 *); - int (*clock_getres)(struct posix_clock *, struct timespec64 *); - int (*clock_settime)(struct posix_clock *, const struct timespec64 *); - long int (*ioctl)(struct posix_clock *, unsigned int, long unsigned int); - int (*open)(struct posix_clock *, fmode_t); - __poll_t (*poll)(struct posix_clock *, struct file *, poll_table *); - int (*release)(struct posix_clock *); - ssize_t (*read)(struct posix_clock *, uint, char *, size_t); +struct listener { + struct list_head list; + pid_t pid; + char valid; }; -struct posix_clock { - struct posix_clock_operations ops; - struct cdev cdev; - struct device *dev; - struct rw_semaphore rwsem; - bool zombie; +struct listener_list { + struct rw_semaphore sem; + struct list_head list; }; -struct posix_clock_desc { - struct file *fp; - struct posix_clock *clk; +enum actions { + REGISTER = 0, + DEREGISTER = 1, + CPU_DONT_CARE = 2, }; -struct itimerval { - struct timeval it_interval; - struct timeval it_value; +struct tp_module { + struct list_head list; + struct module *mod; }; -struct old_itimerval32 { - struct old_timeval32 it_interval; - struct old_timeval32 it_value; +struct tp_probes { + struct callback_head rcu; + struct tracepoint_func probes[0]; }; -struct ce_unbind { - struct clock_event_device *ce; - int res; +enum ring_buffer_type { + RINGBUF_TYPE_DATA_TYPE_LEN_MAX = 28, + RINGBUF_TYPE_PADDING = 29, + RINGBUF_TYPE_TIME_EXTEND = 30, + RINGBUF_TYPE_TIME_STAMP = 31, }; -struct vdso_timestamp { - u64 sec; - u64 nsec; +enum ring_buffer_flags { + RB_FL_OVERWRITE = 1, }; -struct vdso_data { - u32 seq; - s32 clock_mode; - u64 cycle_last; - u64 mask; - u32 mult; - u32 shift; - struct vdso_timestamp basetime[12]; - s32 tz_minuteswest; - s32 tz_dsttime; - u32 hrtimer_res; - u32 __unused; +struct rb_irq_work { + struct irq_work work; + wait_queue_head_t waiters; + wait_queue_head_t full_waiters; + bool waiters_pending; + bool full_waiters_pending; + bool wakeup_full; }; -union futex_key { - struct { - long unsigned int pgoff; - struct inode *inode; - int offset; - } shared; - struct { - long unsigned int address; - struct mm_struct *mm; - int offset; - } private; - struct { - long unsigned int word; - void *ptr; - int offset; - } both; +struct ring_buffer_per_cpu; + +struct ring_buffer { + unsigned int flags; + int cpus; + atomic_t record_disabled; + atomic_t resize_disabled; + cpumask_var_t cpumask; + struct lock_class_key *reader_lock_key; + struct mutex mutex; + struct ring_buffer_per_cpu **buffers; + struct hlist_node node; + u64 (*clock)(); + struct rb_irq_work irq_work; + bool time_stamp_abs; }; -struct futex_pi_state { - struct list_head list; - struct rt_mutex pi_mutex; - struct task_struct *owner; - refcount_t refcount; - union futex_key key; +struct buffer_page; + +struct ring_buffer_iter { + struct ring_buffer_per_cpu *cpu_buffer; + long unsigned int head; + struct buffer_page *head_page; + struct buffer_page *cache_reader_page; + long unsigned int cache_read; + u64 read_stamp; }; -struct futex_q { - struct plist_node list; - struct task_struct *task; - spinlock_t *lock_ptr; - union futex_key key; - struct futex_pi_state *pi_state; - struct rt_mutex_waiter *rt_waiter; - union futex_key *requeue_pi_key; - u32 bitset; +enum { + RB_LEN_TIME_EXTEND = 8, + RB_LEN_TIME_STAMP = 8, }; -struct futex_hash_bucket { - atomic_t waiters; - spinlock_t lock; - struct plist_head chain; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct buffer_data_page { + u64 time_stamp; + local_t commit; + unsigned char data[0]; }; -enum futex_access { - FUTEX_READ = 0, - FUTEX_WRITE = 1, +struct buffer_page { + struct list_head list; + local_t write; + unsigned int read; + local_t entries; + long unsigned int real_end; + struct buffer_data_page *page; }; -struct dma_chan { - int lock; - const char *device_id; +struct rb_event_info { + u64 ts; + u64 delta; + long unsigned int length; + struct buffer_page *tail_page; + int add_timestamp; }; enum { - CSD_FLAG_LOCK = 1, - CSD_FLAG_SYNCHRONOUS = 2, -}; - -struct call_function_data { - call_single_data_t *csd; - cpumask_var_t cpumask; - cpumask_var_t cpumask_ipi; + RB_CTX_NMI = 0, + RB_CTX_IRQ = 1, + RB_CTX_SOFTIRQ = 2, + RB_CTX_NORMAL = 3, + RB_CTX_MAX = 4, }; -struct smp_call_on_cpu_struct { - struct work_struct work; - struct completion done; - int (*func)(void *); - void *data; - int ret; +struct ring_buffer_per_cpu { int cpu; + atomic_t record_disabled; + struct ring_buffer *buffer; + raw_spinlock_t reader_lock; + arch_spinlock_t lock; + struct lock_class_key lock_key; + struct buffer_data_page *free_page; + long unsigned int nr_pages; + unsigned int current_context; + struct list_head *pages; + struct buffer_page *head_page; + struct buffer_page *tail_page; + struct buffer_page *commit_page; + struct buffer_page *reader_page; + long unsigned int lost_events; + long unsigned int last_overrun; + long unsigned int nest; + local_t entries_bytes; + local_t entries; + local_t overrun; + local_t commit_overrun; + local_t dropped_events; + local_t committing; + local_t commits; + local_t pages_touched; + local_t pages_read; + long int last_pages_touch; + size_t shortest_full; + long unsigned int read; + long unsigned int read_bytes; + u64 write_stamp; + u64 read_stamp; + long int nr_pages_to_update; + struct list_head new_pages; + struct work_struct update_pages_work; + struct completion update_done; + struct rb_irq_work irq_work; }; -struct static_key_true { - struct static_key key; +struct trace_export { + struct trace_export *next; + void (*write)(struct trace_export *, const void *, unsigned int); }; -struct latch_tree_root { - seqcount_t seq; - struct rb_root tree[2]; -}; +struct prog_entry; -struct latch_tree_ops { - bool (*less)(struct latch_tree_node *, struct latch_tree_node *); - int (*comp)(void *, struct latch_tree_node *); +struct event_filter { + struct prog_entry *prog; + char *filter_string; }; -struct module_use { - struct list_head source_list; - struct list_head target_list; - struct module *source; - struct module *target; +struct trace_array_cpu; + +struct trace_buffer { + struct trace_array *tr; + struct ring_buffer *buffer; + struct trace_array_cpu *data; + u64 time_start; + int cpu; }; -struct module_sect_attr { - struct module_attribute mattr; +struct trace_pid_list; + +struct trace_options; + +struct trace_array { + struct list_head list; char *name; - long unsigned int address; + struct trace_buffer trace_buffer; + struct trace_pid_list *filtered_pids; + arch_spinlock_t max_lock; + int buffer_disabled; + int stop_count; + int clock_id; + int nr_topts; + bool clear_trace; + int buffer_percent; + unsigned int n_err_log_entries; + struct tracer *current_trace; + unsigned int trace_flags; + unsigned char trace_flags_index[32]; + unsigned int flags; + raw_spinlock_t start_lock; + struct list_head err_log; + struct dentry *dir; + struct dentry *options; + struct dentry *percpu_dir; + struct dentry *event_dir; + struct trace_options *topts; + struct list_head systems; + struct list_head events; + struct trace_event_file *trace_marker_file; + cpumask_var_t tracing_cpumask; + int ref; + int time_stamp_abs_ref; + struct list_head hist_vars; }; -struct module_sect_attrs { - struct attribute_group grp; - unsigned int nsections; - struct module_sect_attr attrs[0]; -}; +struct tracer_flags; -struct module_notes_attrs { - struct kobject *dir; - unsigned int notes; - struct bin_attribute attrs[0]; +struct tracer { + const char *name; + int (*init)(struct trace_array *); + void (*reset)(struct trace_array *); + void (*start)(struct trace_array *); + void (*stop)(struct trace_array *); + int (*update_thresh)(struct trace_array *); + void (*open)(struct trace_iterator *); + void (*pipe_open)(struct trace_iterator *); + void (*close)(struct trace_iterator *); + void (*pipe_close)(struct trace_iterator *); + ssize_t (*read)(struct trace_iterator *, struct file *, char *, size_t, loff_t *); + ssize_t (*splice_read)(struct trace_iterator *, struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); + void (*print_header)(struct seq_file *); + enum print_line_t (*print_line)(struct trace_iterator *); + int (*set_flag)(struct trace_array *, u32, u32, int); + int (*flag_changed)(struct trace_array *, u32, int); + struct tracer *next; + struct tracer_flags *flags; + int enabled; + int ref; + bool print_max; + bool allow_instances; + bool noboot; }; -struct symsearch { - const struct kernel_symbol *start; - const struct kernel_symbol *stop; - const s32 *crcs; - enum { - NOT_GPL_ONLY = 0, - GPL_ONLY = 1, - WILL_BE_GPL_ONLY = 2, - } licence; - bool unused; +enum trace_iter_flags { + TRACE_FILE_LAT_FMT = 1, + TRACE_FILE_ANNOTATE = 2, + TRACE_FILE_TIME_IN_NS = 4, }; -enum kernel_read_file_id { - READING_UNKNOWN = 0, - READING_FIRMWARE = 1, - READING_FIRMWARE_PREALLOC_BUFFER = 2, - READING_MODULE = 3, - READING_KEXEC_IMAGE = 4, - READING_KEXEC_INITRAMFS = 5, - READING_POLICY = 6, - READING_X509_CERTIFICATE = 7, - READING_MAX_ID = 8, +struct event_subsystem; + +struct trace_subsystem_dir { + struct list_head list; + struct event_subsystem *subsystem; + struct trace_array *tr; + struct dentry *entry; + int ref_count; + int nr_events; }; -enum kernel_load_data_id { - LOADING_UNKNOWN = 0, - LOADING_FIRMWARE = 1, - LOADING_FIRMWARE_PREALLOC_BUFFER = 2, - LOADING_MODULE = 3, - LOADING_KEXEC_IMAGE = 4, - LOADING_KEXEC_INITRAMFS = 5, - LOADING_POLICY = 6, - LOADING_X509_CERTIFICATE = 7, - LOADING_MAX_ID = 8, +enum event_trigger_type { + ETT_NONE = 0, + ETT_TRACE_ONOFF = 1, + ETT_SNAPSHOT = 2, + ETT_STACKTRACE = 4, + ETT_EVENT_ENABLE = 8, + ETT_EVENT_HIST = 16, + ETT_HIST_ENABLE = 32, }; -struct _ddebug { - const char *modname; - const char *function; - const char *filename; - const char *format; - unsigned int lineno: 18; - unsigned int flags: 8; - union { - struct static_key_true dd_key_true; - struct static_key_false dd_key_false; - } key; +enum trace_type { + __TRACE_FIRST_TYPE = 0, + TRACE_FN = 1, + TRACE_CTX = 2, + TRACE_WAKE = 3, + TRACE_STACK = 4, + TRACE_PRINT = 5, + TRACE_BPRINT = 6, + TRACE_MMIO_RW = 7, + TRACE_MMIO_MAP = 8, + TRACE_BRANCH = 9, + TRACE_GRAPH_RET = 10, + TRACE_GRAPH_ENT = 11, + TRACE_USER_STACK = 12, + TRACE_BLK = 13, + TRACE_BPUTS = 14, + TRACE_HWLAT = 15, + TRACE_RAW_DATA = 16, + __TRACE_LAST_TYPE = 17, }; -struct load_info { - const char *name; - struct module *mod; - Elf64_Ehdr *hdr; - long unsigned int len; - Elf64_Shdr *sechdrs; - char *secstrings; - char *strtab; - long unsigned int symoffs; - long unsigned int stroffs; - long unsigned int init_typeoffs; - long unsigned int core_typeoffs; - struct _ddebug *debug; - unsigned int num_debug; - bool sig_ok; - long unsigned int mod_kallsyms_init_off; - struct { - unsigned int sym; - unsigned int str; - unsigned int mod; - unsigned int vers; - unsigned int info; - unsigned int pcpu; - } index; +struct ftrace_entry { + struct trace_entry ent; + long unsigned int ip; + long unsigned int parent_ip; }; -struct trace_event_raw_module_load { +struct stack_entry { struct trace_entry ent; - unsigned int taints; - u32 __data_loc_name; - char __data[0]; + int size; + long unsigned int caller[0]; }; -struct trace_event_raw_module_free { +struct userstack_entry { struct trace_entry ent; - u32 __data_loc_name; - char __data[0]; + unsigned int tgid; + long unsigned int caller[8]; }; -struct trace_event_raw_module_refcnt { +struct bprint_entry { struct trace_entry ent; long unsigned int ip; - int refcnt; - u32 __data_loc_name; - char __data[0]; + const char *fmt; + u32 buf[0]; }; -struct trace_event_raw_module_request { +struct print_entry { struct trace_entry ent; long unsigned int ip; - bool wait; - u32 __data_loc_name; - char __data[0]; + char buf[0]; }; -struct trace_event_data_offsets_module_load { - u32 name; +struct raw_data_entry { + struct trace_entry ent; + unsigned int id; + char buf[0]; }; -struct trace_event_data_offsets_module_free { - u32 name; +struct bputs_entry { + struct trace_entry ent; + long unsigned int ip; + const char *str; }; -struct trace_event_data_offsets_module_refcnt { - u32 name; +enum trace_flag_type { + TRACE_FLAG_IRQS_OFF = 1, + TRACE_FLAG_IRQS_NOSUPPORT = 2, + TRACE_FLAG_NEED_RESCHED = 4, + TRACE_FLAG_HARDIRQ = 8, + TRACE_FLAG_SOFTIRQ = 16, + TRACE_FLAG_PREEMPT_RESCHED = 32, + TRACE_FLAG_NMI = 64, }; -struct trace_event_data_offsets_module_request { - u32 name; +struct trace_array_cpu { + atomic_t disabled; + void *buffer_page; + long unsigned int entries; + long unsigned int saved_latency; + long unsigned int critical_start; + long unsigned int critical_end; + long unsigned int critical_sequence; + long unsigned int nice; + long unsigned int policy; + long unsigned int rt_priority; + long unsigned int skipped_entries; + u64 preempt_timestamp; + pid_t pid; + kuid_t uid; + char comm[16]; + bool ignore_pid; }; -struct mod_tree_root { - struct latch_tree_root root; - long unsigned int addr_min; - long unsigned int addr_max; -}; +struct trace_option_dentry; -struct find_symbol_arg { - const char *name; - bool gplok; - bool warn; - struct module *owner; - const s32 *crc; - const struct kernel_symbol *sym; +struct trace_options { + struct tracer *tracer; + struct trace_option_dentry *topts; }; -struct mod_initfree { - struct llist_node node; - void *module_init; +struct tracer_opt; + +struct trace_option_dentry { + struct tracer_opt *opt; + struct tracer_flags *flags; + struct trace_array *tr; + struct dentry *entry; }; -struct kallsym_iter { - loff_t pos; - loff_t pos_arch_end; - loff_t pos_mod_end; - loff_t pos_ftrace_mod_end; - long unsigned int value; - unsigned int nameoff; - char type; - char name[128]; - char module_name[56]; - int exported; - int show_value; +struct trace_pid_list { + int pid_max; + long unsigned int *pids; }; +typedef bool (*cond_update_fn_t)(struct trace_array *, void *); + enum { - SB_UNFROZEN = 0, - SB_FREEZE_WRITE = 1, - SB_FREEZE_PAGEFAULT = 2, - SB_FREEZE_FS = 3, - SB_FREEZE_COMPLETE = 4, + TRACE_ARRAY_FL_GLOBAL = 1, }; -typedef __u16 comp_t; +struct tracer_opt { + const char *name; + u32 bit; +}; -typedef __u32 comp2_t; +struct tracer_flags { + u32 val; + struct tracer_opt *opts; + struct tracer *trace; +}; -struct acct { - char ac_flag; - char ac_version; - __u16 ac_uid16; - __u16 ac_gid16; - __u16 ac_tty; - __u32 ac_btime; - comp_t ac_utime; - comp_t ac_stime; - comp_t ac_etime; - comp_t ac_mem; - comp_t ac_io; - comp_t ac_rw; - comp_t ac_minflt; - comp_t ac_majflt; - comp_t ac_swaps; - __u16 ac_ahz; - __u32 ac_exitcode; - char ac_comm[17]; - __u8 ac_etime_hi; - __u16 ac_etime_lo; - __u32 ac_uid; - __u32 ac_gid; +struct trace_parser { + bool cont; + char *buffer; + unsigned int idx; + unsigned int size; }; -typedef struct acct acct_t; +enum trace_iterator_bits { + TRACE_ITER_PRINT_PARENT_BIT = 0, + TRACE_ITER_SYM_OFFSET_BIT = 1, + TRACE_ITER_SYM_ADDR_BIT = 2, + TRACE_ITER_VERBOSE_BIT = 3, + TRACE_ITER_RAW_BIT = 4, + TRACE_ITER_HEX_BIT = 5, + TRACE_ITER_BIN_BIT = 6, + TRACE_ITER_BLOCK_BIT = 7, + TRACE_ITER_PRINTK_BIT = 8, + TRACE_ITER_ANNOTATE_BIT = 9, + TRACE_ITER_USERSTACKTRACE_BIT = 10, + TRACE_ITER_SYM_USEROBJ_BIT = 11, + TRACE_ITER_PRINTK_MSGONLY_BIT = 12, + TRACE_ITER_CONTEXT_INFO_BIT = 13, + TRACE_ITER_LATENCY_FMT_BIT = 14, + TRACE_ITER_RECORD_CMD_BIT = 15, + TRACE_ITER_RECORD_TGID_BIT = 16, + TRACE_ITER_OVERWRITE_BIT = 17, + TRACE_ITER_STOP_ON_FREE_BIT = 18, + TRACE_ITER_IRQ_INFO_BIT = 19, + TRACE_ITER_MARKERS_BIT = 20, + TRACE_ITER_EVENT_FORK_BIT = 21, + TRACE_ITER_STACKTRACE_BIT = 22, + TRACE_ITER_LAST_BIT = 23, +}; -struct fs_pin { - wait_queue_head_t wait; - int done; - struct hlist_node s_list; - struct hlist_node m_list; - void (*kill)(struct fs_pin *); +enum trace_iterator_flags { + TRACE_ITER_PRINT_PARENT = 1, + TRACE_ITER_SYM_OFFSET = 2, + TRACE_ITER_SYM_ADDR = 4, + TRACE_ITER_VERBOSE = 8, + TRACE_ITER_RAW = 16, + TRACE_ITER_HEX = 32, + TRACE_ITER_BIN = 64, + TRACE_ITER_BLOCK = 128, + TRACE_ITER_PRINTK = 256, + TRACE_ITER_ANNOTATE = 512, + TRACE_ITER_USERSTACKTRACE = 1024, + TRACE_ITER_SYM_USEROBJ = 2048, + TRACE_ITER_PRINTK_MSGONLY = 4096, + TRACE_ITER_CONTEXT_INFO = 8192, + TRACE_ITER_LATENCY_FMT = 16384, + TRACE_ITER_RECORD_CMD = 32768, + TRACE_ITER_RECORD_TGID = 65536, + TRACE_ITER_OVERWRITE = 131072, + TRACE_ITER_STOP_ON_FREE = 262144, + TRACE_ITER_IRQ_INFO = 524288, + TRACE_ITER_MARKERS = 1048576, + TRACE_ITER_EVENT_FORK = 2097152, + TRACE_ITER_STACKTRACE = 4194304, }; -struct bsd_acct_struct { - struct fs_pin pin; - atomic_long_t count; - struct callback_head rcu; - struct mutex lock; - int active; - long unsigned int needcheck; - struct file *file; - struct pid_namespace *ns; - struct work_struct work; - struct completion done; +struct event_subsystem { + struct list_head list; + const char *name; + struct event_filter *filter; + int ref_count; +}; + +struct saved_cmdlines_buffer { + unsigned int map_pid_to_cmdline[32769]; + unsigned int *map_cmdline_to_pid; + unsigned int cmdline_num; + int cmdline_idx; + char *saved_cmdlines; }; -enum compound_dtor_id { - NULL_COMPOUND_DTOR = 0, - COMPOUND_PAGE_DTOR = 1, - HUGETLB_PAGE_DTOR = 2, - NR_COMPOUND_DTORS = 3, +struct ftrace_stack { + long unsigned int calls[1024]; }; -struct elf64_note { - Elf64_Word n_namesz; - Elf64_Word n_descsz; - Elf64_Word n_type; +struct ftrace_stacks { + struct ftrace_stack stacks[4]; }; -typedef long unsigned int elf_greg_t; - -typedef elf_greg_t elf_gregset_t[27]; - -struct elf_siginfo { - int si_signo; - int si_code; - int si_errno; +struct trace_buffer_struct { + int nesting; + char buffer[4096]; }; -struct elf_prstatus { - struct elf_siginfo pr_info; - short int pr_cursig; - long unsigned int pr_sigpend; - long unsigned int pr_sighold; - pid_t pr_pid; - pid_t pr_ppid; - pid_t pr_pgrp; - pid_t pr_sid; - struct __kernel_old_timeval pr_utime; - struct __kernel_old_timeval pr_stime; - struct __kernel_old_timeval pr_cutime; - struct __kernel_old_timeval pr_cstime; - elf_gregset_t pr_reg; - int pr_fpvalid; +struct ftrace_buffer_info { + struct trace_iterator iter; + void *spare; + unsigned int spare_cpu; + unsigned int read; }; -typedef u32 note_buf_t[92]; - -struct compat_kexec_segment { - compat_uptr_t buf; - compat_size_t bufsz; - compat_ulong_t mem; - compat_size_t memsz; +struct err_info { + const char **errs; + u8 type; + u8 pos; + u64 ts; }; -enum migrate_reason { - MR_COMPACTION = 0, - MR_MEMORY_FAILURE = 1, - MR_MEMORY_HOTPLUG = 2, - MR_SYSCALL = 3, - MR_MEMPOLICY_MBIND = 4, - MR_NUMA_MISPLACED = 5, - MR_CONTIG_RANGE = 6, - MR_TYPES = 7, +struct tracing_log_err { + struct list_head list; + struct err_info info; + char loc[128]; + char cmd[256]; }; -typedef __kernel_ulong_t __kernel_ino_t; - -typedef __kernel_ino_t ino_t; - -enum fs_context_purpose { - FS_CONTEXT_FOR_MOUNT = 0, - FS_CONTEXT_FOR_SUBMOUNT = 1, - FS_CONTEXT_FOR_RECONFIGURE = 2, +struct buffer_ref { + struct ring_buffer *buffer; + void *page; + int cpu; + refcount_t refcount; }; -enum fs_context_phase { - FS_CONTEXT_CREATE_PARAMS = 0, - FS_CONTEXT_CREATING = 1, - FS_CONTEXT_AWAITING_MOUNT = 2, - FS_CONTEXT_AWAITING_RECONF = 3, - FS_CONTEXT_RECONF_PARAMS = 4, - FS_CONTEXT_RECONFIGURING = 5, - FS_CONTEXT_FAILED = 6, +struct ctx_switch_entry { + struct trace_entry ent; + unsigned int prev_pid; + unsigned int next_pid; + unsigned int next_cpu; + unsigned char prev_prio; + unsigned char prev_state; + unsigned char next_prio; + unsigned char next_state; }; -struct fs_context_operations; - -struct fc_log; - -struct fs_context { - const struct fs_context_operations *ops; - struct mutex uapi_mutex; - struct file_system_type *fs_type; - void *fs_private; - void *sget_key; - struct dentry *root; - struct user_namespace *user_ns; - struct net *net_ns; - const struct cred *cred; - struct fc_log *log; - const char *source; - void *security; - void *s_fs_info; - unsigned int sb_flags; - unsigned int sb_flags_mask; - unsigned int s_iflags; - unsigned int lsm_flags; - enum fs_context_purpose purpose: 8; - enum fs_context_phase phase: 8; - bool need_free: 1; - bool global: 1; +struct hwlat_entry { + struct trace_entry ent; + u64 duration; + u64 outer_duration; + u64 nmi_total_ts; + struct timespec64 timestamp; + unsigned int nmi_count; + unsigned int seqnum; }; -enum kernfs_node_type { - KERNFS_DIR = 1, - KERNFS_FILE = 2, - KERNFS_LINK = 4, +struct trace_mark { + long long unsigned int val; + char sym; }; -enum kernfs_root_flag { - KERNFS_ROOT_CREATE_DEACTIVATED = 1, - KERNFS_ROOT_EXTRA_OPEN_PERM_CHECK = 2, - KERNFS_ROOT_SUPPORT_EXPORTOP = 4, -}; +typedef int (*cmp_func_t)(const void *, const void *); -struct kernfs_fs_context { - struct kernfs_root *root; - void *ns_tag; - long unsigned int magic; - bool new_sb_created; +struct tracer_stat { + const char *name; + void * (*stat_start)(struct tracer_stat *); + void * (*stat_next)(void *, int); + cmp_func_t stat_cmp; + int (*stat_show)(struct seq_file *, void *); + void (*stat_release)(void *); + int (*stat_headers)(struct seq_file *); }; -enum { - __PERCPU_REF_ATOMIC = 1, - __PERCPU_REF_DEAD = 2, - __PERCPU_REF_ATOMIC_DEAD = 3, - __PERCPU_REF_FLAG_BITS = 2, +struct stat_node { + struct rb_node node; + void *stat; }; -enum { - CSS_NO_REF = 1, - CSS_ONLINE = 2, - CSS_RELEASED = 4, - CSS_VISIBLE = 8, - CSS_DYING = 16, +struct stat_session { + struct list_head session_list; + struct tracer_stat *ts; + struct rb_root stat_root; + struct mutex stat_mutex; + struct dentry *file; }; -enum { - CGRP_NOTIFY_ON_RELEASE = 0, - CGRP_CPUSET_CLONE_CHILDREN = 1, - CGRP_FREEZE = 2, - CGRP_FROZEN = 3, +struct trace_bprintk_fmt { + struct list_head list; + const char *fmt; }; enum { - CGRP_ROOT_NOPREFIX = 2, - CGRP_ROOT_XATTR = 4, - CGRP_ROOT_NS_DELEGATE = 8, - CGRP_ROOT_CPUSET_V2_MODE = 16, - CGRP_ROOT_MEMORY_LOCAL_EVENTS = 32, -}; - -struct cgroup_taskset { - struct list_head src_csets; - struct list_head dst_csets; - int nr_tasks; - int ssid; - struct list_head *csets; - struct css_set *cur_cset; - struct task_struct *cur_task; + TRACE_NOP_OPT_ACCEPT = 1, + TRACE_NOP_OPT_REFUSE = 2, }; -struct css_task_iter { - struct cgroup_subsys *ss; - unsigned int flags; - struct list_head *cset_pos; - struct list_head *cset_head; - struct list_head *tcset_pos; - struct list_head *tcset_head; - struct list_head *task_pos; - struct list_head *tasks_head; - struct list_head *mg_tasks_head; - struct list_head *dying_tasks_head; - struct css_set *cur_cset; - struct css_set *cur_dcset; - struct task_struct *cur_task; - struct list_head iters_node; -}; +typedef __u32 blk_mq_req_flags_t; -enum fs_value_type { - fs_value_is_undefined = 0, - fs_value_is_flag = 1, - fs_value_is_string = 2, - fs_value_is_blob = 3, - fs_value_is_filename = 4, - fs_value_is_filename_empty = 5, - fs_value_is_file = 6, -}; +struct blk_mq_ctxs; -struct fs_parameter { - const char *key; - enum fs_value_type type: 8; - union { - char *string; - void *blob; - struct filename *name; - struct file *file; +struct blk_mq_ctx { + struct { + spinlock_t lock; + struct list_head rq_lists[3]; + long: 64; }; - size_t size; - int dirfd; + unsigned int cpu; + short unsigned int index_hw[3]; + struct blk_mq_hw_ctx *hctxs[3]; + long unsigned int rq_dispatched[2]; + long unsigned int rq_merged; + long unsigned int rq_completed[2]; + struct request_queue *queue; + struct blk_mq_ctxs *ctxs; + struct kobject kobj; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct fs_context_operations { - void (*free)(struct fs_context *); - int (*dup)(struct fs_context *, struct fs_context *); - int (*parse_param)(struct fs_context *, struct fs_parameter *); - int (*parse_monolithic)(struct fs_context *, void *); - int (*get_tree)(struct fs_context *); - int (*reconfigure)(struct fs_context *); -}; +struct sbitmap_word; -struct fc_log { - refcount_t usage; - u8 head; - u8 tail; - u8 need_free; - struct module *owner; - char *buffer[8]; +struct sbitmap { + unsigned int depth; + unsigned int shift; + unsigned int map_nr; + struct sbitmap_word *map; }; -struct cgroup_fs_context { - struct kernfs_fs_context kfc; - struct cgroup_root *root; - struct cgroup_namespace *ns; - unsigned int flags; - bool cpuset_clone_children; - bool none; - bool all_ss; - u16 subsys_mask; - char *name; - char *release_agent; -}; +struct blk_mq_tags; -struct cgrp_cset_link { - struct cgroup *cgrp; - struct css_set *cset; - struct list_head cset_link; - struct list_head cgrp_link; +struct blk_mq_hw_ctx { + struct { + spinlock_t lock; + struct list_head dispatch; + long unsigned int state; + long: 64; + long: 64; + long: 64; + long: 64; + }; + struct delayed_work run_work; + cpumask_var_t cpumask; + int next_cpu; + int next_cpu_batch; + long unsigned int flags; + void *sched_data; + struct request_queue *queue; + struct blk_flush_queue *fq; + void *driver_data; + struct sbitmap ctx_map; + struct blk_mq_ctx *dispatch_from; + unsigned int dispatch_busy; + short unsigned int type; + short unsigned int nr_ctx; + struct blk_mq_ctx **ctxs; + spinlock_t dispatch_wait_lock; + wait_queue_entry_t dispatch_wait; + atomic_t wait_index; + struct blk_mq_tags *tags; + struct blk_mq_tags *sched_tags; + long unsigned int queued; + long unsigned int run; + long unsigned int dispatched[7]; + unsigned int numa_node; + unsigned int queue_num; + atomic_t nr_active; + struct hlist_node cpuhp_dead; + struct kobject kobj; + long unsigned int poll_considered; + long unsigned int poll_invoked; + long unsigned int poll_success; + struct dentry *debugfs_dir; + struct dentry *sched_debugfs_dir; + struct list_head hctx_list; + struct srcu_struct srcu[0]; + long: 64; + long: 64; + long: 64; }; -struct cgroup_mgctx { - struct list_head preloaded_src_csets; - struct list_head preloaded_dst_csets; - struct cgroup_taskset tset; - u16 ss_mask; +struct blk_mq_alloc_data { + struct request_queue *q; + blk_mq_req_flags_t flags; + unsigned int shallow_depth; + unsigned int cmd_flags; + struct blk_mq_ctx *ctx; + struct blk_mq_hw_ctx *hctx; }; -enum fs_parameter_type { - __fs_param_wasnt_defined = 0, - fs_param_is_flag = 1, - fs_param_is_bool = 2, - fs_param_is_u32 = 3, - fs_param_is_u32_octal = 4, - fs_param_is_u32_hex = 5, - fs_param_is_s32 = 6, - fs_param_is_u64 = 7, - fs_param_is_enum = 8, - fs_param_is_string = 9, - fs_param_is_blob = 10, - fs_param_is_blockdev = 11, - fs_param_is_path = 12, - fs_param_is_fd = 13, - nr__fs_parameter_type = 14, +struct blk_stat_callback { + struct list_head list; + struct timer_list timer; + struct blk_rq_stat *cpu_stat; + int (*bucket_fn)(const struct request *); + unsigned int buckets; + struct blk_rq_stat *stat; + void (*timer_fn)(struct blk_stat_callback *); + void *data; + struct callback_head rcu; }; -struct fs_parameter_spec { - const char *name; - u8 opt; - enum fs_parameter_type type: 8; - short unsigned int flags; +struct blk_trace { + int trace_state; + struct rchan *rchan; + long unsigned int *sequence; + unsigned char *msg_data; + u16 act_mask; + u64 start_lba; + u64 end_lba; + u32 pid; + u32 dev; + struct dentry *dir; + struct dentry *dropped_file; + struct dentry *msg_file; + struct list_head running_list; + atomic_t dropped; }; -struct fs_parameter_enum { - u8 opt; - char name[14]; - u8 value; +struct blk_flush_queue { + unsigned int flush_queue_delayed: 1; + unsigned int flush_pending_idx: 1; + unsigned int flush_running_idx: 1; + blk_status_t rq_status; + long unsigned int flush_pending_since; + struct list_head flush_queue[2]; + struct list_head flush_data_in_flight; + struct request *flush_rq; + struct request *orig_rq; + struct lock_class_key key; + spinlock_t mq_flush_lock; }; -struct fs_parse_result { - bool negated; - bool has_value; - union { - bool boolean; - int int_32; - unsigned int uint_32; - u64 uint_64; - }; +struct blk_mq_queue_map { + unsigned int *mq_map; + unsigned int nr_queues; + unsigned int queue_offset; }; -struct trace_event_raw_cgroup_root { - struct trace_entry ent; - int root; - u16 ss_mask; - u32 __data_loc_name; - char __data[0]; +struct blk_mq_tag_set { + struct blk_mq_queue_map map[3]; + unsigned int nr_maps; + const struct blk_mq_ops *ops; + unsigned int nr_hw_queues; + unsigned int queue_depth; + unsigned int reserved_tags; + unsigned int cmd_size; + int numa_node; + unsigned int timeout; + unsigned int flags; + void *driver_data; + struct blk_mq_tags **tags; + struct mutex tag_list_lock; + struct list_head tag_list; }; -struct trace_event_raw_cgroup { - struct trace_entry ent; - int root; - int id; - int level; - u32 __data_loc_path; - char __data[0]; -}; +typedef u64 compat_u64; -struct trace_event_raw_cgroup_migrate { - struct trace_entry ent; - int dst_root; - int dst_id; - int dst_level; - int pid; - u32 __data_loc_dst_path; - u32 __data_loc_comm; - char __data[0]; +enum blktrace_cat { + BLK_TC_READ = 1, + BLK_TC_WRITE = 2, + BLK_TC_FLUSH = 4, + BLK_TC_SYNC = 8, + BLK_TC_SYNCIO = 8, + BLK_TC_QUEUE = 16, + BLK_TC_REQUEUE = 32, + BLK_TC_ISSUE = 64, + BLK_TC_COMPLETE = 128, + BLK_TC_FS = 256, + BLK_TC_PC = 512, + BLK_TC_NOTIFY = 1024, + BLK_TC_AHEAD = 2048, + BLK_TC_META = 4096, + BLK_TC_DISCARD = 8192, + BLK_TC_DRV_DATA = 16384, + BLK_TC_FUA = 32768, + BLK_TC_END = 32768, }; -struct trace_event_raw_cgroup_event { - struct trace_entry ent; - int root; - int id; - int level; - u32 __data_loc_path; - int val; - char __data[0]; +enum blktrace_act { + __BLK_TA_QUEUE = 1, + __BLK_TA_BACKMERGE = 2, + __BLK_TA_FRONTMERGE = 3, + __BLK_TA_GETRQ = 4, + __BLK_TA_SLEEPRQ = 5, + __BLK_TA_REQUEUE = 6, + __BLK_TA_ISSUE = 7, + __BLK_TA_COMPLETE = 8, + __BLK_TA_PLUG = 9, + __BLK_TA_UNPLUG_IO = 10, + __BLK_TA_UNPLUG_TIMER = 11, + __BLK_TA_INSERT = 12, + __BLK_TA_SPLIT = 13, + __BLK_TA_BOUNCE = 14, + __BLK_TA_REMAP = 15, + __BLK_TA_ABORT = 16, + __BLK_TA_DRV_DATA = 17, + __BLK_TA_CGROUP = 256, }; -struct trace_event_data_offsets_cgroup_root { - u32 name; +enum blktrace_notify { + __BLK_TN_PROCESS = 0, + __BLK_TN_TIMESTAMP = 1, + __BLK_TN_MESSAGE = 2, + __BLK_TN_CGROUP = 256, }; -struct trace_event_data_offsets_cgroup { - u32 path; +struct blk_io_trace { + __u32 magic; + __u32 sequence; + __u64 time; + __u64 sector; + __u32 bytes; + __u32 action; + __u32 pid; + __u32 device; + __u32 cpu; + __u16 error; + __u16 pdu_len; }; -struct trace_event_data_offsets_cgroup_migrate { - u32 dst_path; - u32 comm; +struct blk_io_trace_remap { + __be32 device_from; + __be32 device_to; + __be64 sector_from; }; -struct trace_event_data_offsets_cgroup_event { - u32 path; +enum { + Blktrace_setup = 1, + Blktrace_running = 2, + Blktrace_stopped = 3, }; -enum cgroup2_param { - Opt_nsdelegate = 0, - Opt_memory_localevents = 1, - nr__cgroup2_params = 2, +struct blk_user_trace_setup { + char name[32]; + __u16 act_mask; + __u32 buf_size; + __u32 buf_nr; + __u64 start_lba; + __u64 end_lba; + __u32 pid; }; -struct cgroupstats { - __u64 nr_sleeping; - __u64 nr_running; - __u64 nr_stopped; - __u64 nr_uninterruptible; - __u64 nr_io_wait; -}; +struct compat_blk_user_trace_setup { + char name[32]; + u16 act_mask; + short: 16; + u32 buf_size; + u32 buf_nr; + compat_u64 start_lba; + compat_u64 end_lba; + u32 pid; +} __attribute__((packed)); -enum cgroup_filetype { - CGROUP_FILE_PROCS = 0, - CGROUP_FILE_TASKS = 1, +struct blkcg {}; + +struct sbitmap_word { + long unsigned int depth; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long unsigned int word; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long unsigned int cleared; + spinlock_t swap_lock; + long: 32; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct cgroup_pidlist { - struct { - enum cgroup_filetype type; - struct pid_namespace *ns; - } key; - pid_t *list; - int length; - struct list_head links; - struct cgroup *owner; - struct delayed_work destroy_dwork; +struct sbq_wait_state { + atomic_t wait_cnt; + wait_queue_head_t wait; + long: 64; + long: 64; + long: 64; + long: 64; }; -enum cgroup1_param { - Opt_all = 0, - Opt_clone_children = 1, - Opt_cpuset_v2_mode = 2, - Opt_name = 3, - Opt_none = 4, - Opt_noprefix = 5, - Opt_release_agent = 6, - Opt_xattr = 7, +struct sbitmap_queue { + struct sbitmap sb; + unsigned int *alloc_hint; + unsigned int wake_batch; + atomic_t wake_index; + struct sbq_wait_state *ws; + atomic_t ws_active; + bool round_robin; + unsigned int min_shallow_depth; }; -enum freezer_state_flags { - CGROUP_FREEZER_ONLINE = 1, - CGROUP_FREEZING_SELF = 2, - CGROUP_FREEZING_PARENT = 4, - CGROUP_FROZEN = 8, - CGROUP_FREEZING = 6, +struct blk_mq_tags { + unsigned int nr_tags; + unsigned int nr_reserved_tags; + atomic_t active_queues; + struct sbitmap_queue bitmap_tags; + struct sbitmap_queue breserved_tags; + struct request **rqs; + struct request **static_rqs; + struct list_head page_list; }; -struct freezer { - struct cgroup_subsys_state css; - unsigned int state; +struct blk_mq_queue_data { + struct request *rq; + bool last; }; -struct fmeter { - int cnt; - int val; - time64_t time; - spinlock_t lock; +struct blk_mq_ctxs { + struct kobject kobj; + struct blk_mq_ctx *queue_ctx; }; -struct cpuset { - struct cgroup_subsys_state css; - long unsigned int flags; - cpumask_var_t cpus_allowed; - nodemask_t mems_allowed; - cpumask_var_t effective_cpus; - nodemask_t effective_mems; - cpumask_var_t subparts_cpus; - nodemask_t old_mems_allowed; - struct fmeter fmeter; - int attach_in_progress; - int pn; - int relax_domain_level; - int nr_subparts_cpus; - int partition_root_state; - int use_parent_ecpus; - int child_ecpus_count; +typedef void blk_log_action_t(struct trace_iterator *, const char *, bool); + +struct ftrace_event_field { + struct list_head link; + const char *name; + const char *type; + int filter_type; + int offset; + int size; + int is_signed; }; -struct tmpmasks { - cpumask_var_t addmask; - cpumask_var_t delmask; - cpumask_var_t new_cpus; +enum { + FORMAT_HEADER = 1, + FORMAT_FIELD_SEPERATOR = 2, + FORMAT_PRINTFMT = 3, }; -typedef enum { - CS_ONLINE = 0, - CS_CPU_EXCLUSIVE = 1, - CS_MEM_EXCLUSIVE = 2, - CS_MEM_HARDWALL = 3, - CS_MEMORY_MIGRATE = 4, - CS_SCHED_LOAD_BALANCE = 5, - CS_SPREAD_PAGE = 6, - CS_SPREAD_SLAB = 7, -} cpuset_flagbits_t; +struct ftrace_graph_ent { + long unsigned int func; + int depth; +} __attribute__((packed)); -enum subparts_cmd { - partcmd_enable = 0, - partcmd_disable = 1, - partcmd_update = 2, -}; +struct ftrace_graph_ret { + long unsigned int func; + long unsigned int overrun; + long long unsigned int calltime; + long long unsigned int rettime; + int depth; +} __attribute__((packed)); -struct cpuset_migrate_mm_work { - struct work_struct work; - struct mm_struct *mm; - nodemask_t from; - nodemask_t to; +struct mmiotrace_rw { + resource_size_t phys; + long unsigned int value; + long unsigned int pc; + int map_id; + unsigned char opcode; + unsigned char width; }; -typedef enum { - FILE_MEMORY_MIGRATE = 0, - FILE_CPULIST = 1, - FILE_MEMLIST = 2, - FILE_EFFECTIVE_CPULIST = 3, - FILE_EFFECTIVE_MEMLIST = 4, - FILE_SUBPARTS_CPULIST = 5, - FILE_CPU_EXCLUSIVE = 6, - FILE_MEM_EXCLUSIVE = 7, - FILE_MEM_HARDWALL = 8, - FILE_SCHED_LOAD_BALANCE = 9, - FILE_PARTITION_ROOT = 10, - FILE_SCHED_RELAX_DOMAIN_LEVEL = 11, - FILE_MEMORY_PRESSURE_ENABLED = 12, - FILE_MEMORY_PRESSURE = 13, - FILE_SPREAD_PAGE = 14, - FILE_SPREAD_SLAB = 15, -} cpuset_filetype_t; +struct mmiotrace_map { + resource_size_t phys; + long unsigned int virt; + long unsigned int len; + int map_id; + unsigned char opcode; +}; -struct root_domain___2; +struct ftrace_graph_ent_entry { + struct trace_entry ent; + struct ftrace_graph_ent graph_ent; +} __attribute__((packed)); -struct cpu_stop_done { - atomic_t nr_todo; - int ret; - struct completion completion; -}; +struct ftrace_graph_ret_entry { + struct trace_entry ent; + struct ftrace_graph_ret ret; +} __attribute__((packed)); -struct cpu_stopper { - struct task_struct *thread; - raw_spinlock_t lock; - bool enabled; - struct list_head works; - struct cpu_stop_work stop_work; +struct trace_mmiotrace_rw { + struct trace_entry ent; + struct mmiotrace_rw rw; }; -enum multi_stop_state { - MULTI_STOP_NONE = 0, - MULTI_STOP_PREPARE = 1, - MULTI_STOP_DISABLE_IRQ = 2, - MULTI_STOP_RUN = 3, - MULTI_STOP_EXIT = 4, +struct trace_mmiotrace_map { + struct trace_entry ent; + struct mmiotrace_map map; }; -struct multi_stop_data { - cpu_stop_fn_t fn; - void *data; - unsigned int num_threads; - const struct cpumask *active_cpus; - enum multi_stop_state state; - atomic_t thread_ack; +struct trace_branch { + struct trace_entry ent; + unsigned int line; + char func[31]; + char file[21]; + char correct; + char constant; }; -typedef int __kernel_mqd_t; +typedef long unsigned int perf_trace_t[256]; -typedef __kernel_mqd_t mqd_t; +struct filter_pred; -enum audit_state { - AUDIT_DISABLED = 0, - AUDIT_BUILD_CONTEXT = 1, - AUDIT_RECORD_CONTEXT = 2, +struct prog_entry { + int target; + int when_to_branch; + struct filter_pred *pred; }; -struct audit_cap_data { - kernel_cap_t permitted; - kernel_cap_t inheritable; - union { - unsigned int fE; - kernel_cap_t effective; - }; - kernel_cap_t ambient; - kuid_t rootid; -}; +typedef int (*filter_pred_fn_t)(struct filter_pred *, void *); -struct audit_names { - struct list_head list; - struct filename *name; - int name_len; - bool hidden; - long unsigned int ino; - dev_t dev; - umode_t mode; - kuid_t uid; - kgid_t gid; - dev_t rdev; - u32 osid; - struct audit_cap_data fcap; - unsigned int fcap_ver; - unsigned char type; - bool should_free; -}; +struct regex; -struct mq_attr { - __kernel_long_t mq_flags; - __kernel_long_t mq_maxmsg; - __kernel_long_t mq_msgsize; - __kernel_long_t mq_curmsgs; - __kernel_long_t __reserved[4]; -}; +typedef int (*regex_match_func)(char *, struct regex *, int); -struct audit_proctitle { +struct regex { + char pattern[256]; int len; - char *value; + int field_len; + regex_match_func match; }; -struct audit_aux_data; - -struct __kernel_sockaddr_storage; +struct filter_pred { + filter_pred_fn_t fn; + u64 val; + struct regex regex; + short unsigned int *ops; + struct ftrace_event_field *field; + int offset; + int not; + int op; +}; -struct audit_tree_refs; +enum regex_type { + MATCH_FULL = 0, + MATCH_FRONT_ONLY = 1, + MATCH_MIDDLE_ONLY = 2, + MATCH_END_ONLY = 3, + MATCH_GLOB = 4, + MATCH_INDEX = 5, +}; -struct audit_context { - int dummy; - int in_syscall; - enum audit_state state; - enum audit_state current_state; - unsigned int serial; - int major; - struct timespec64 ctime; - long unsigned int argv[4]; - long int return_code; - u64 prio; - int return_valid; - struct audit_names preallocated_names[5]; - int name_count; - struct list_head names_list; - char *filterkey; - struct path pwd; - struct audit_aux_data *aux; - struct audit_aux_data *aux_pids; - struct __kernel_sockaddr_storage *sockaddr; - size_t sockaddr_len; - pid_t pid; - pid_t ppid; - kuid_t uid; - kuid_t euid; - kuid_t suid; - kuid_t fsuid; - kgid_t gid; - kgid_t egid; - kgid_t sgid; - kgid_t fsgid; - long unsigned int personality; - int arch; - pid_t target_pid; - kuid_t target_auid; - kuid_t target_uid; - unsigned int target_sessionid; - u32 target_sid; - char target_comm[16]; - struct audit_tree_refs *trees; - struct audit_tree_refs *first_trees; - struct list_head killed_trees; - int tree_count; - int type; - union { - struct { - int nargs; - long int args[6]; - } socketcall; - struct { - kuid_t uid; - kgid_t gid; - umode_t mode; - u32 osid; - int has_perm; - uid_t perm_uid; - gid_t perm_gid; - umode_t perm_mode; - long unsigned int qbytes; - } ipc; - struct { - mqd_t mqdes; - struct mq_attr mqstat; - } mq_getsetattr; - struct { - mqd_t mqdes; - int sigev_signo; - } mq_notify; - struct { - mqd_t mqdes; - size_t msg_len; - unsigned int msg_prio; - struct timespec64 abs_timeout; - } mq_sendrecv; - struct { - int oflag; - umode_t mode; - struct mq_attr attr; - } mq_open; - struct { - pid_t pid; - struct audit_cap_data cap; - } capset; - struct { - int fd; - int flags; - } mmap; - struct { - int argc; - } execve; - struct { - char *name; - } module; - }; - int fds[2]; - struct audit_proctitle proctitle; +enum filter_op_ids { + OP_GLOB = 0, + OP_NE = 1, + OP_EQ = 2, + OP_LE = 3, + OP_LT = 4, + OP_GE = 5, + OP_GT = 6, + OP_BAND = 7, + OP_MAX = 8, }; -enum audit_nlgrps { - AUDIT_NLGRP_NONE = 0, - AUDIT_NLGRP_READLOG = 1, - __AUDIT_NLGRP_MAX = 2, +enum { + FILT_ERR_NONE = 0, + FILT_ERR_INVALID_OP = 1, + FILT_ERR_TOO_MANY_OPEN = 2, + FILT_ERR_TOO_MANY_CLOSE = 3, + FILT_ERR_MISSING_QUOTE = 4, + FILT_ERR_OPERAND_TOO_LONG = 5, + FILT_ERR_EXPECT_STRING = 6, + FILT_ERR_EXPECT_DIGIT = 7, + FILT_ERR_ILLEGAL_FIELD_OP = 8, + FILT_ERR_FIELD_NOT_FOUND = 9, + FILT_ERR_ILLEGAL_INTVAL = 10, + FILT_ERR_BAD_SUBSYS_FILTER = 11, + FILT_ERR_TOO_MANY_PREDS = 12, + FILT_ERR_INVALID_FILTER = 13, + FILT_ERR_IP_FIELD_ONLY = 14, + FILT_ERR_INVALID_VALUE = 15, + FILT_ERR_ERRNO = 16, + FILT_ERR_NO_FILTER = 17, }; -struct audit_status { - __u32 mask; - __u32 enabled; - __u32 failure; - __u32 pid; - __u32 rate_limit; - __u32 backlog_limit; - __u32 lost; - __u32 backlog; - union { - __u32 version; - __u32 feature_bitmap; - }; - __u32 backlog_wait_time; +struct filter_parse_error { + int lasterr; + int lasterr_pos; }; -struct audit_features { - __u32 vers; - __u32 mask; - __u32 features; - __u32 lock; +typedef int (*parse_pred_fn)(const char *, void *, int, struct filter_parse_error *, struct filter_pred **); + +enum { + INVERT = 1, + PROCESS_AND = 2, + PROCESS_OR = 4, }; -struct audit_tty_status { - __u32 enabled; - __u32 log_passwd; +enum { + TOO_MANY_CLOSE = 4294967295, + TOO_MANY_OPEN = 4294967294, + MISSING_QUOTE = 4294967293, }; -struct audit_sig_info { - uid_t uid; - pid_t pid; - char ctx[0]; +struct filter_list { + struct list_head list; + struct event_filter *filter; }; -struct __kernel_sockaddr_storage { - union { - struct { - __kernel_sa_family_t ss_family; - char __data[126]; - }; - void *__align; - }; +struct event_trigger_ops; + +struct event_command; + +struct event_trigger_data { + long unsigned int count; + int ref; + struct event_trigger_ops *ops; + struct event_command *cmd_ops; + struct event_filter *filter; + char *filter_str; + void *private_data; + bool paused; + bool paused_tmp; + struct list_head list; + char *name; + struct list_head named_list; + struct event_trigger_data *named_data; }; -struct net_generic { - union { - struct { - unsigned int len; - struct callback_head rcu; - } s; - void *ptr[0]; - }; +struct event_trigger_ops { + void (*func)(struct event_trigger_data *, void *, struct ring_buffer_event *); + int (*init)(struct event_trigger_ops *, struct event_trigger_data *); + void (*free)(struct event_trigger_ops *, struct event_trigger_data *); + int (*print)(struct seq_file *, struct event_trigger_ops *, struct event_trigger_data *); }; -struct pernet_operations { +struct event_command { struct list_head list; - int (*init)(struct net *); - void (*pre_exit)(struct net *); - void (*exit)(struct net *); - void (*exit_batch)(struct list_head *); - unsigned int *id; - size_t size; + char *name; + enum event_trigger_type trigger_type; + int flags; + int (*func)(struct event_command *, struct trace_event_file *, char *, char *, char *); + int (*reg)(char *, struct event_trigger_ops *, struct event_trigger_data *, struct trace_event_file *); + void (*unreg)(char *, struct event_trigger_ops *, struct event_trigger_data *, struct trace_event_file *); + void (*unreg_all)(struct trace_event_file *); + int (*set_filter)(char *, struct event_trigger_data *, struct trace_event_file *); + struct event_trigger_ops * (*get_trigger_ops)(char *, char *); }; -struct scm_creds { - u32 pid; - kuid_t uid; - kgid_t gid; +struct enable_trigger_data { + struct trace_event_file *file; + bool enable; + bool hist; }; -struct netlink_skb_parms { - struct scm_creds creds; - __u32 portid; - __u32 dst_group; - __u32 flags; - struct sock *sk; - bool nsid_is_set; - int nsid; +enum event_command_flags { + EVENT_CMD_FL_POST_TRIGGER = 1, + EVENT_CMD_FL_NEEDS_REC = 2, }; -struct netlink_kernel_cfg { - unsigned int groups; - unsigned int flags; - void (*input)(struct sk_buff *); - struct mutex *cb_mutex; - int (*bind)(struct net *, int); - void (*unbind)(struct net *, int); - bool (*compare)(struct net *, struct sock *); +enum { + BPF_F_INDEX_MASK = 4294967295, + BPF_F_CURRENT_CPU = 4294967295, + BPF_F_CTXLEN_MASK = 0, }; -struct audit_netlink_list { - __u32 portid; - struct net *net; - struct sk_buff_head q; +struct bpf_perf_event_value { + __u64 counter; + __u64 enabled; + __u64 running; }; -struct audit_net { - struct sock *sk; +struct bpf_raw_tracepoint_args { + __u64 args[0]; }; -struct auditd_connection { - struct pid *pid; - u32 portid; - struct net *net; - struct callback_head rcu; +enum bpf_task_fd_type { + BPF_FD_TYPE_RAW_TRACEPOINT = 0, + BPF_FD_TYPE_TRACEPOINT = 1, + BPF_FD_TYPE_KPROBE = 2, + BPF_FD_TYPE_KRETPROBE = 3, + BPF_FD_TYPE_UPROBE = 4, + BPF_FD_TYPE_URETPROBE = 5, }; -struct audit_ctl_mutex { - struct mutex lock; - void *owner; +struct bpf_event_entry { + struct perf_event *event; + struct file *perf_file; + struct file *map_file; + struct callback_head rcu; }; -struct audit_buffer { - struct sk_buff *skb; - struct audit_context *ctx; - gfp_t gfp_mask; +typedef long unsigned int (*bpf_ctx_copy_t)(void *, const void *, long unsigned int, long unsigned int); + +typedef struct pt_regs bpf_user_pt_regs_t; + +struct bpf_perf_event_data { + bpf_user_pt_regs_t regs; + __u64 sample_period; + __u64 addr; }; -struct audit_reply { - __u32 portid; - struct net *net; - struct sk_buff *skb; +struct perf_event_query_bpf { + __u32 ids_len; + __u32 prog_cnt; + __u32 ids[0]; }; -enum { - Audit_equal = 0, - Audit_not_equal = 1, - Audit_bitmask = 2, - Audit_bittest = 3, - Audit_lt = 4, - Audit_gt = 5, - Audit_le = 6, - Audit_ge = 7, - Audit_bad = 8, +struct bpf_perf_event_data_kern { + bpf_user_pt_regs_t *regs; + struct perf_sample_data *data; + struct perf_event *event; }; -struct audit_rule_data { - __u32 flags; - __u32 action; - __u32 field_count; - __u32 mask[64]; - __u32 fields[64]; - __u32 values[64]; - __u32 fieldflags[64]; - __u32 buflen; - char buf[0]; +struct bpf_trace_module { + struct module *module; + struct list_head list; }; -struct audit_field; +typedef u64 (*btf_bpf_override_return)(struct pt_regs *, long unsigned int); -struct audit_watch; +typedef u64 (*btf_bpf_probe_read_user)(void *, u32, const void *); -struct audit_tree; +typedef u64 (*btf_bpf_probe_read_user_str)(void *, u32, const void *); -struct audit_fsnotify_mark; +typedef u64 (*btf_bpf_probe_read_kernel)(void *, u32, const void *); -struct audit_krule { - u32 pflags; - u32 flags; - u32 listnr; - u32 action; - u32 mask[64]; - u32 buflen; - u32 field_count; - char *filterkey; - struct audit_field *fields; - struct audit_field *arch_f; - struct audit_field *inode_f; - struct audit_watch *watch; - struct audit_tree *tree; - struct audit_fsnotify_mark *exe; - struct list_head rlist; - struct list_head list; - u64 prio; -}; +typedef u64 (*btf_bpf_probe_read_compat)(void *, u32, const void *); -struct audit_field { - u32 type; - union { - u32 val; - kuid_t uid; - kgid_t gid; - struct { - char *lsm_str; - void *lsm_rule; - }; - }; - u32 op; -}; +typedef u64 (*btf_bpf_probe_read_kernel_str)(void *, u32, const void *); -struct audit_entry { - struct list_head list; - struct callback_head rcu; - struct audit_krule rule; -}; +typedef u64 (*btf_bpf_probe_read_compat_str)(void *, u32, const void *); -struct audit_buffer___2; +typedef u64 (*btf_bpf_probe_write_user)(void *, const void *, u32); -typedef int __kernel_key_t; +typedef u64 (*btf_bpf_trace_printk)(char *, u32, u64, u64, u64); -typedef __kernel_key_t key_t; +typedef u64 (*btf_bpf_perf_event_read)(struct bpf_map *, u64); -struct cpu_vfs_cap_data { - __u32 magic_etc; - kernel_cap_t permitted; - kernel_cap_t inheritable; - kuid_t rootid; -}; +typedef u64 (*btf_bpf_perf_event_read_value)(struct bpf_map *, u64, struct bpf_perf_event_value *, u32); -struct kern_ipc_perm { - spinlock_t lock; - bool deleted; - int id; - key_t key; - kuid_t uid; - kgid_t gid; - kuid_t cuid; - kgid_t cgid; - umode_t mode; - long unsigned int seq; - void *security; - struct rhash_head khtnode; - struct callback_head rcu; - refcount_t refcount; - long: 32; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct bpf_trace_sample_data { + struct perf_sample_data sds[3]; }; -typedef struct fsnotify_mark_connector *fsnotify_connp_t; +typedef u64 (*btf_bpf_perf_event_output)(struct pt_regs *, struct bpf_map *, u64, void *, u64); -struct fsnotify_mark_connector { - spinlock_t lock; - short unsigned int type; - short unsigned int flags; - __kernel_fsid_t fsid; - union { - fsnotify_connp_t *obj; - struct fsnotify_mark_connector *destroy_next; - }; - struct hlist_head list; +struct bpf_nested_pt_regs { + struct pt_regs regs[3]; }; -enum fsnotify_obj_type { - FSNOTIFY_OBJ_TYPE_INODE = 0, - FSNOTIFY_OBJ_TYPE_VFSMOUNT = 1, - FSNOTIFY_OBJ_TYPE_SB = 2, - FSNOTIFY_OBJ_TYPE_COUNT = 3, - FSNOTIFY_OBJ_TYPE_DETACHED = 3, -}; +typedef u64 (*btf_bpf_get_current_task)(); -struct audit_aux_data { - struct audit_aux_data *next; - int type; +typedef u64 (*btf_bpf_current_task_under_cgroup)(struct bpf_map *, u32); + +struct send_signal_irq_work { + struct irq_work irq_work; + struct task_struct *task; + u32 sig; }; -struct audit_chunk; +typedef u64 (*btf_bpf_send_signal)(u32); -struct audit_tree_refs { - struct audit_tree_refs *next; - struct audit_chunk *c[31]; -}; +typedef u64 (*btf_bpf_perf_event_output_tp)(void *, struct bpf_map *, u64, void *, u64); -struct audit_aux_data_pids { - struct audit_aux_data d; - pid_t target_pid[16]; - kuid_t target_auid[16]; - kuid_t target_uid[16]; - unsigned int target_sessionid[16]; - u32 target_sid[16]; - char target_comm[256]; - int pid_count; -}; +typedef u64 (*btf_bpf_get_stackid_tp)(void *, struct bpf_map *, u64); -struct audit_aux_data_bprm_fcaps { - struct audit_aux_data d; - struct audit_cap_data fcap; - unsigned int fcap_ver; - struct audit_cap_data old_pcap; - struct audit_cap_data new_pcap; -}; +typedef u64 (*btf_bpf_get_stack_tp)(void *, void *, u32, u64); -struct audit_parent; +typedef u64 (*btf_bpf_perf_prog_read_value)(struct bpf_perf_event_data_kern *, struct bpf_perf_event_value *, u32); -struct audit_watch { - refcount_t count; - dev_t dev; - char *path; - long unsigned int ino; - struct audit_parent *parent; - struct list_head wlist; - struct list_head rules; +struct bpf_raw_tp_regs { + struct pt_regs regs[3]; }; -struct fsnotify_group; +typedef u64 (*btf_bpf_perf_event_output_raw_tp)(struct bpf_raw_tracepoint_args *, struct bpf_map *, u64, void *, u64); -struct fsnotify_iter_info; +typedef u64 (*btf_bpf_get_stackid_raw_tp)(struct bpf_raw_tracepoint_args *, struct bpf_map *, u64); -struct fsnotify_mark; +typedef u64 (*btf_bpf_get_stack_raw_tp)(struct bpf_raw_tracepoint_args *, void *, u32, u64); -struct fsnotify_event; +typedef struct bpf_cgroup_storage *pto_T_____19; -struct fsnotify_ops { - int (*handle_event)(struct fsnotify_group *, struct inode *, u32, const void *, int, const struct qstr *, u32, struct fsnotify_iter_info *); - void (*free_group_priv)(struct fsnotify_group *); - void (*freeing_mark)(struct fsnotify_mark *, struct fsnotify_group *); - void (*free_event)(struct fsnotify_event *); - void (*free_mark)(struct fsnotify_mark *); +struct kprobe_trace_entry_head { + struct trace_entry ent; + long unsigned int ip; }; -struct inotify_group_private_data { - spinlock_t idr_lock; - struct idr idr; - struct ucounts *ucounts; +struct kretprobe_trace_entry_head { + struct trace_entry ent; + long unsigned int func; + long unsigned int ret_ip; }; -struct fsnotify_group { - const struct fsnotify_ops *ops; - refcount_t refcnt; - spinlock_t notification_lock; - struct list_head notification_list; - wait_queue_head_t notification_waitq; - unsigned int q_len; - unsigned int max_events; - unsigned int priority; - bool shutdown; - struct mutex mark_mutex; - atomic_t num_marks; - atomic_t user_waits; - struct list_head marks_list; - struct fasync_struct *fsn_fa; - struct fsnotify_event *overflow_event; - struct mem_cgroup *memcg; +struct dyn_event; + +struct dyn_event_operations { + struct list_head list; + int (*create)(int, const char **); + int (*show)(struct seq_file *, struct dyn_event *); + bool (*is_busy)(struct dyn_event *); + int (*free)(struct dyn_event *); + bool (*match)(const char *, const char *, int, const char **, struct dyn_event *); +}; + +struct dyn_event { + struct list_head list; + struct dyn_event_operations *ops; +}; + +typedef int (*print_type_func_t)(struct trace_seq *, void *, void *); + +enum fetch_op { + FETCH_OP_NOP = 0, + FETCH_OP_REG = 1, + FETCH_OP_STACK = 2, + FETCH_OP_STACKP = 3, + FETCH_OP_RETVAL = 4, + FETCH_OP_IMM = 5, + FETCH_OP_COMM = 6, + FETCH_OP_ARG = 7, + FETCH_OP_FOFFS = 8, + FETCH_OP_DATA = 9, + FETCH_OP_DEREF = 10, + FETCH_OP_UDEREF = 11, + FETCH_OP_ST_RAW = 12, + FETCH_OP_ST_MEM = 13, + FETCH_OP_ST_UMEM = 14, + FETCH_OP_ST_STRING = 15, + FETCH_OP_ST_USTRING = 16, + FETCH_OP_MOD_BF = 17, + FETCH_OP_LP_ARRAY = 18, + FETCH_OP_END = 19, + FETCH_NOP_SYMBOL = 20, +}; + +struct fetch_insn { + enum fetch_op op; union { - void *private; - struct inotify_group_private_data inotify_data; + unsigned int param; + struct { + unsigned int size; + int offset; + }; + struct { + unsigned char basesize; + unsigned char lshift; + unsigned char rshift; + }; + long unsigned int immediate; + void *data; }; }; -struct fsnotify_iter_info { - struct fsnotify_mark *marks[3]; - unsigned int report_mask; - int srcu_idx; +struct fetch_type { + const char *name; + size_t size; + int is_signed; + print_type_func_t print; + const char *fmt; + const char *fmttype; }; -struct fsnotify_mark { - __u32 mask; - refcount_t refcnt; - struct fsnotify_group *group; - struct list_head g_list; - spinlock_t lock; - struct hlist_node obj_list; - struct fsnotify_mark_connector *connector; - __u32 ignored_mask; +struct probe_arg { + struct fetch_insn *code; + bool dynamic; + unsigned int offset; + unsigned int count; + const char *name; + const char *comm; + char *fmt; + const struct fetch_type *type; +}; + +struct trace_uprobe_filter { + rwlock_t rwlock; + int nr_systemwide; + struct list_head perf_events; +}; + +struct trace_probe_event { unsigned int flags; + struct trace_event_class class; + struct trace_event_call call; + struct list_head files; + struct list_head probes; + struct trace_uprobe_filter filter[0]; +}; + +struct trace_probe { + struct list_head list; + struct trace_probe_event *event; + ssize_t size; + unsigned int nr_args; + struct probe_arg args[0]; +}; + +struct event_file_link { + struct trace_event_file *file; + struct list_head list; +}; + +enum { + TP_ERR_FILE_NOT_FOUND = 0, + TP_ERR_NO_REGULAR_FILE = 1, + TP_ERR_BAD_REFCNT = 2, + TP_ERR_REFCNT_OPEN_BRACE = 3, + TP_ERR_BAD_REFCNT_SUFFIX = 4, + TP_ERR_BAD_UPROBE_OFFS = 5, + TP_ERR_MAXACT_NO_KPROBE = 6, + TP_ERR_BAD_MAXACT = 7, + TP_ERR_MAXACT_TOO_BIG = 8, + TP_ERR_BAD_PROBE_ADDR = 9, + TP_ERR_BAD_RETPROBE = 10, + TP_ERR_NO_GROUP_NAME = 11, + TP_ERR_GROUP_TOO_LONG = 12, + TP_ERR_BAD_GROUP_NAME = 13, + TP_ERR_NO_EVENT_NAME = 14, + TP_ERR_EVENT_TOO_LONG = 15, + TP_ERR_BAD_EVENT_NAME = 16, + TP_ERR_RETVAL_ON_PROBE = 17, + TP_ERR_BAD_STACK_NUM = 18, + TP_ERR_BAD_ARG_NUM = 19, + TP_ERR_BAD_VAR = 20, + TP_ERR_BAD_REG_NAME = 21, + TP_ERR_BAD_MEM_ADDR = 22, + TP_ERR_BAD_IMM = 23, + TP_ERR_IMMSTR_NO_CLOSE = 24, + TP_ERR_FILE_ON_KPROBE = 25, + TP_ERR_BAD_FILE_OFFS = 26, + TP_ERR_SYM_ON_UPROBE = 27, + TP_ERR_TOO_MANY_OPS = 28, + TP_ERR_DEREF_NEED_BRACE = 29, + TP_ERR_BAD_DEREF_OFFS = 30, + TP_ERR_DEREF_OPEN_BRACE = 31, + TP_ERR_COMM_CANT_DEREF = 32, + TP_ERR_BAD_FETCH_ARG = 33, + TP_ERR_ARRAY_NO_CLOSE = 34, + TP_ERR_BAD_ARRAY_SUFFIX = 35, + TP_ERR_BAD_ARRAY_NUM = 36, + TP_ERR_ARRAY_TOO_BIG = 37, + TP_ERR_BAD_TYPE = 38, + TP_ERR_BAD_STRING = 39, + TP_ERR_BAD_BITFIELD = 40, + TP_ERR_ARG_NAME_TOO_LONG = 41, + TP_ERR_NO_ARG_NAME = 42, + TP_ERR_BAD_ARG_NAME = 43, + TP_ERR_USED_ARG_NAME = 44, + TP_ERR_ARG_TOO_LONG = 45, + TP_ERR_NO_ARG_BODY = 46, + TP_ERR_BAD_INSN_BNDRY = 47, + TP_ERR_FAIL_REG_PROBE = 48, + TP_ERR_DIFF_PROBE_TYPE = 49, + TP_ERR_DIFF_ARG_TYPE = 50, + TP_ERR_SAME_PROBE = 51, }; -struct fsnotify_event { - struct list_head list; - struct inode *inode; +struct trace_kprobe { + struct dyn_event devent; + struct kretprobe rp; + long unsigned int *nhit; + const char *symbol; + struct trace_probe tp; }; -struct audit_parent { - struct list_head watches; - struct fsnotify_mark mark; +struct trace_event_raw_cpu { + struct trace_entry ent; + u32 state; + u32 cpu_id; + char __data[0]; }; -struct audit_fsnotify_mark { - dev_t dev; - long unsigned int ino; - char *path; - struct fsnotify_mark mark; - struct audit_krule *rule; +struct trace_event_raw_powernv_throttle { + struct trace_entry ent; + int chip_id; + u32 __data_loc_reason; + int pmax; + char __data[0]; }; -struct audit_chunk___2; +struct trace_event_raw_pstate_sample { + struct trace_entry ent; + u32 core_busy; + u32 scaled_busy; + u32 from; + u32 to; + u64 mperf; + u64 aperf; + u64 tsc; + u32 freq; + u32 io_boost; + char __data[0]; +}; -struct audit_tree { - refcount_t count; - int goner; - struct audit_chunk___2 *root; - struct list_head chunks; - struct list_head rules; - struct list_head list; - struct list_head same_root; - struct callback_head head; - char pathname[0]; +struct trace_event_raw_cpu_frequency_limits { + struct trace_entry ent; + u32 min_freq; + u32 max_freq; + u32 cpu_id; + char __data[0]; }; -struct node { - struct list_head list; - struct audit_tree *owner; - unsigned int index; +struct trace_event_raw_device_pm_callback_start { + struct trace_entry ent; + u32 __data_loc_device; + u32 __data_loc_driver; + u32 __data_loc_parent; + u32 __data_loc_pm_ops; + int event; + char __data[0]; }; -struct audit_chunk___2 { - struct list_head hash; - long unsigned int key; - struct fsnotify_mark *mark; - struct list_head trees; - int count; - atomic_long_t refs; - struct callback_head head; - struct node owners[0]; +struct trace_event_raw_device_pm_callback_end { + struct trace_entry ent; + u32 __data_loc_device; + u32 __data_loc_driver; + int error; + char __data[0]; }; -struct audit_tree_mark { - struct fsnotify_mark mark; - struct audit_chunk___2 *chunk; +struct trace_event_raw_suspend_resume { + struct trace_entry ent; + const char *action; + int val; + bool start; + char __data[0]; }; -enum { - HASH_SIZE = 128, +struct trace_event_raw_wakeup_source { + struct trace_entry ent; + u32 __data_loc_name; + u64 state; + char __data[0]; }; -struct kprobe_blacklist_entry { - struct list_head list; - long unsigned int start_addr; - long unsigned int end_addr; +struct trace_event_raw_clock { + struct trace_entry ent; + u32 __data_loc_name; + u64 state; + u64 cpu_id; + char __data[0]; }; -struct kprobe_insn_page { - struct list_head list; - kprobe_opcode_t *insns; - struct kprobe_insn_cache *cache; - int nused; - int ngarbage; - char slot_used[0]; +struct trace_event_raw_power_domain { + struct trace_entry ent; + u32 __data_loc_name; + u64 state; + u64 cpu_id; + char __data[0]; }; -enum kprobe_slot_state { - SLOT_CLEAN = 0, - SLOT_DIRTY = 1, - SLOT_USED = 2, +struct trace_event_raw_pm_qos_request { + struct trace_entry ent; + int pm_qos_class; + s32 value; + char __data[0]; }; -struct seccomp_notif_sizes { - __u16 seccomp_notif; - __u16 seccomp_notif_resp; - __u16 seccomp_data; +struct trace_event_raw_pm_qos_update_request_timeout { + struct trace_entry ent; + int pm_qos_class; + s32 value; + long unsigned int timeout_us; + char __data[0]; }; -struct seccomp_notif { - __u64 id; - __u32 pid; - __u32 flags; - struct seccomp_data data; +struct trace_event_raw_pm_qos_update { + struct trace_entry ent; + enum pm_qos_req_action action; + int prev_value; + int curr_value; + char __data[0]; }; -struct seccomp_notif_resp { - __u64 id; - __s64 val; - __s32 error; - __u32 flags; +struct trace_event_raw_dev_pm_qos_request { + struct trace_entry ent; + u32 __data_loc_name; + enum dev_pm_qos_req_type type; + s32 new_value; + char __data[0]; }; -struct notification; +struct trace_event_data_offsets_cpu {}; -struct seccomp_filter { - refcount_t usage; - bool log; - struct seccomp_filter *prev; - struct bpf_prog *prog; - struct notification *notif; - struct mutex notify_lock; +struct trace_event_data_offsets_powernv_throttle { + u32 reason; }; -struct ctl_path { - const char *procname; -}; +struct trace_event_data_offsets_pstate_sample {}; -struct sock_fprog { - short unsigned int len; - struct sock_filter *filter; -}; +struct trace_event_data_offsets_cpu_frequency_limits {}; -struct compat_sock_fprog { - u16 len; - compat_uptr_t filter; +struct trace_event_data_offsets_device_pm_callback_start { + u32 device; + u32 driver; + u32 parent; + u32 pm_ops; }; -typedef int (*bpf_aux_classic_check_t)(struct sock_filter *, unsigned int); - -enum notify_state { - SECCOMP_NOTIFY_INIT = 0, - SECCOMP_NOTIFY_SENT = 1, - SECCOMP_NOTIFY_REPLIED = 2, +struct trace_event_data_offsets_device_pm_callback_end { + u32 device; + u32 driver; }; -struct seccomp_knotif { - struct task_struct *task; - u64 id; - const struct seccomp_data *data; - enum notify_state state; - int error; - long int val; - u32 flags; - struct completion ready; - struct list_head list; +struct trace_event_data_offsets_suspend_resume {}; + +struct trace_event_data_offsets_wakeup_source { + u32 name; }; -struct notification { - struct semaphore request; - u64 next_id; - struct list_head notifications; - wait_queue_head_t wqh; +struct trace_event_data_offsets_clock { + u32 name; }; -struct seccomp_log_name { - u32 log; - const char *name; +struct trace_event_data_offsets_power_domain { + u32 name; }; -struct rchan; +struct trace_event_data_offsets_pm_qos_request {}; -struct rchan_buf { - void *start; - void *data; - size_t offset; - size_t subbufs_produced; - size_t subbufs_consumed; - struct rchan *chan; - wait_queue_head_t read_wait; - struct irq_work wakeup_work; - struct dentry *dentry; - struct kref kref; - struct page **page_array; - unsigned int page_count; - unsigned int finalized; - size_t *padding; - size_t prev_padding; - size_t bytes_consumed; - size_t early_bytes; - unsigned int cpu; - long: 32; - long: 64; - long: 64; - long: 64; -}; +struct trace_event_data_offsets_pm_qos_update_request_timeout {}; -struct rchan_callbacks; +struct trace_event_data_offsets_pm_qos_update {}; -struct rchan { - u32 version; - size_t subbuf_size; - size_t n_subbufs; - size_t alloc_size; - struct rchan_callbacks *cb; - struct kref kref; - void *private_data; - size_t last_toobig; - struct rchan_buf **buf; - int is_global; - struct list_head list; - struct dentry *parent; - int has_base_filename; - char base_filename[255]; +struct trace_event_data_offsets_dev_pm_qos_request { + u32 name; }; -struct rchan_callbacks { - int (*subbuf_start)(struct rchan_buf *, void *, void *, size_t); - void (*buf_mapped)(struct rchan_buf *, struct file *); - void (*buf_unmapped)(struct rchan_buf *, struct file *); - struct dentry * (*create_buf_file)(const char *, struct dentry *, umode_t, struct rchan_buf *, int *); - int (*remove_buf_file)(struct dentry *); -}; +typedef void (*btf_trace_cpu_idle)(void *, unsigned int, unsigned int); -struct partial_page { - unsigned int offset; - unsigned int len; - long unsigned int private; -}; +typedef void (*btf_trace_powernv_throttle)(void *, int, const char *, int); -struct splice_pipe_desc { - struct page **pages; - struct partial_page *partial; - int nr_pages; - unsigned int nr_pages_max; - const struct pipe_buf_operations *ops; - void (*spd_release)(struct splice_pipe_desc *, unsigned int); -}; +typedef void (*btf_trace_pstate_sample)(void *, u32, u32, u32, u32, u64, u64, u64, u32, u32); -struct rchan_percpu_buf_dispatcher { - struct rchan_buf *buf; - struct dentry *dentry; -}; +typedef void (*btf_trace_cpu_frequency)(void *, unsigned int, unsigned int); -enum { - TASKSTATS_TYPE_UNSPEC = 0, - TASKSTATS_TYPE_PID = 1, - TASKSTATS_TYPE_TGID = 2, - TASKSTATS_TYPE_STATS = 3, - TASKSTATS_TYPE_AGGR_PID = 4, - TASKSTATS_TYPE_AGGR_TGID = 5, - TASKSTATS_TYPE_NULL = 6, - __TASKSTATS_TYPE_MAX = 7, -}; +typedef void (*btf_trace_cpu_frequency_limits)(void *, struct cpufreq_policy *); -enum { - TASKSTATS_CMD_ATTR_UNSPEC = 0, - TASKSTATS_CMD_ATTR_PID = 1, - TASKSTATS_CMD_ATTR_TGID = 2, - TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 3, - TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 4, - __TASKSTATS_CMD_ATTR_MAX = 5, -}; +typedef void (*btf_trace_device_pm_callback_start)(void *, struct device *, const char *, int); -enum { - CGROUPSTATS_CMD_UNSPEC = 3, - CGROUPSTATS_CMD_GET = 4, - CGROUPSTATS_CMD_NEW = 5, - __CGROUPSTATS_CMD_MAX = 6, -}; +typedef void (*btf_trace_device_pm_callback_end)(void *, struct device *, int); -enum { - CGROUPSTATS_TYPE_UNSPEC = 0, - CGROUPSTATS_TYPE_CGROUP_STATS = 1, - __CGROUPSTATS_TYPE_MAX = 2, -}; +typedef void (*btf_trace_suspend_resume)(void *, const char *, int, bool); -enum { - CGROUPSTATS_CMD_ATTR_UNSPEC = 0, - CGROUPSTATS_CMD_ATTR_FD = 1, - __CGROUPSTATS_CMD_ATTR_MAX = 2, -}; +typedef void (*btf_trace_wakeup_source_activate)(void *, const char *, unsigned int); -struct genlmsghdr { - __u8 cmd; - __u8 version; - __u16 reserved; -}; +typedef void (*btf_trace_wakeup_source_deactivate)(void *, const char *, unsigned int); -enum { - NLA_UNSPEC = 0, - NLA_U8 = 1, - NLA_U16 = 2, - NLA_U32 = 3, - NLA_U64 = 4, - NLA_STRING = 5, - NLA_FLAG = 6, - NLA_MSECS = 7, - NLA_NESTED = 8, - NLA_NESTED_ARRAY = 9, - NLA_NUL_STRING = 10, - NLA_BINARY = 11, - NLA_S8 = 12, - NLA_S16 = 13, - NLA_S32 = 14, - NLA_S64 = 15, - NLA_BITFIELD32 = 16, - NLA_REJECT = 17, - NLA_EXACT_LEN = 18, - NLA_EXACT_LEN_WARN = 19, - NLA_MIN_LEN = 20, - __NLA_TYPE_MAX = 21, -}; +typedef void (*btf_trace_clock_enable)(void *, const char *, unsigned int, unsigned int); -enum netlink_validation { - NL_VALIDATE_LIBERAL = 0, - NL_VALIDATE_TRAILING = 1, - NL_VALIDATE_MAXTYPE = 2, - NL_VALIDATE_UNSPEC = 4, - NL_VALIDATE_STRICT_ATTRS = 8, - NL_VALIDATE_NESTED = 16, -}; +typedef void (*btf_trace_clock_disable)(void *, const char *, unsigned int, unsigned int); -struct genl_multicast_group { - char name[16]; -}; +typedef void (*btf_trace_clock_set_rate)(void *, const char *, unsigned int, unsigned int); -struct genl_ops; +typedef void (*btf_trace_power_domain_target)(void *, const char *, unsigned int, unsigned int); -struct genl_info; +typedef void (*btf_trace_pm_qos_add_request)(void *, int, s32); -struct genl_family { - int id; - unsigned int hdrsize; - char name[16]; - unsigned int version; - unsigned int maxattr; - bool netnsok; - bool parallel_ops; - const struct nla_policy *policy; - int (*pre_doit)(const struct genl_ops *, struct sk_buff *, struct genl_info *); - void (*post_doit)(const struct genl_ops *, struct sk_buff *, struct genl_info *); - int (*mcast_bind)(struct net *, int); - void (*mcast_unbind)(struct net *, int); - struct nlattr **attrbuf; - const struct genl_ops *ops; - const struct genl_multicast_group *mcgrps; - unsigned int n_ops; - unsigned int n_mcgrps; - unsigned int mcgrp_offset; - struct module *module; -}; +typedef void (*btf_trace_pm_qos_update_request)(void *, int, s32); -struct genl_ops { - int (*doit)(struct sk_buff *, struct genl_info *); - int (*start)(struct netlink_callback *); - int (*dumpit)(struct sk_buff *, struct netlink_callback *); - int (*done)(struct netlink_callback *); - u8 cmd; - u8 internal_flags; - u8 flags; - u8 validate; -}; +typedef void (*btf_trace_pm_qos_remove_request)(void *, int, s32); -struct genl_info { - u32 snd_seq; - u32 snd_portid; - struct nlmsghdr *nlhdr; - struct genlmsghdr *genlhdr; - void *userhdr; - struct nlattr **attrs; - possible_net_t _net; - void *user_ptr[2]; - struct netlink_ext_ack *extack; -}; +typedef void (*btf_trace_pm_qos_update_request_timeout)(void *, int, s32, long unsigned int); -enum genl_validate_flags { - GENL_DONT_VALIDATE_STRICT = 1, - GENL_DONT_VALIDATE_DUMP = 2, - GENL_DONT_VALIDATE_DUMP_STRICT = 4, -}; +typedef void (*btf_trace_pm_qos_update_target)(void *, enum pm_qos_req_action, int, int); -struct listener { - struct list_head list; - pid_t pid; - char valid; -}; +typedef void (*btf_trace_pm_qos_update_flags)(void *, enum pm_qos_req_action, int, int); -struct listener_list { - struct rw_semaphore sem; - struct list_head list; -}; +typedef void (*btf_trace_dev_pm_qos_add_request)(void *, const char *, enum dev_pm_qos_req_type, s32); -enum actions { - REGISTER = 0, - DEREGISTER = 1, - CPU_DONT_CARE = 2, -}; +typedef void (*btf_trace_dev_pm_qos_update_request)(void *, const char *, enum dev_pm_qos_req_type, s32); -struct tp_module { - struct list_head list; - struct module *mod; -}; +typedef void (*btf_trace_dev_pm_qos_remove_request)(void *, const char *, enum dev_pm_qos_req_type, s32); -struct tp_probes { - struct callback_head rcu; - struct tracepoint_func probes[0]; +struct trace_event_raw_rpm_internal { + struct trace_entry ent; + u32 __data_loc_name; + int flags; + int usage_count; + int disable_depth; + int runtime_auto; + int request_pending; + int irq_safe; + int child_count; + char __data[0]; }; -enum ring_buffer_type { - RINGBUF_TYPE_DATA_TYPE_LEN_MAX = 28, - RINGBUF_TYPE_PADDING = 29, - RINGBUF_TYPE_TIME_EXTEND = 30, - RINGBUF_TYPE_TIME_STAMP = 31, +struct trace_event_raw_rpm_return_int { + struct trace_entry ent; + u32 __data_loc_name; + long unsigned int ip; + int ret; + char __data[0]; }; -enum ring_buffer_flags { - RB_FL_OVERWRITE = 1, +struct trace_event_data_offsets_rpm_internal { + u32 name; }; -struct rb_irq_work { - struct irq_work work; - wait_queue_head_t waiters; - wait_queue_head_t full_waiters; - bool waiters_pending; - bool full_waiters_pending; - bool wakeup_full; +struct trace_event_data_offsets_rpm_return_int { + u32 name; }; -struct ring_buffer_per_cpu; +typedef void (*btf_trace_rpm_suspend)(void *, struct device *, int); -struct ring_buffer { - unsigned int flags; - int cpus; - atomic_t record_disabled; - atomic_t resize_disabled; - cpumask_var_t cpumask; - struct lock_class_key *reader_lock_key; - struct mutex mutex; - struct ring_buffer_per_cpu **buffers; - struct hlist_node node; - u64 (*clock)(); - struct rb_irq_work irq_work; - bool time_stamp_abs; -}; +typedef void (*btf_trace_rpm_resume)(void *, struct device *, int); -struct buffer_page; +typedef void (*btf_trace_rpm_idle)(void *, struct device *, int); -struct ring_buffer_iter { - struct ring_buffer_per_cpu *cpu_buffer; - long unsigned int head; - struct buffer_page *head_page; - struct buffer_page *cache_reader_page; - long unsigned int cache_read; - u64 read_stamp; -}; +typedef void (*btf_trace_rpm_return_int)(void *, struct device *, long unsigned int, int); -enum { - RB_LEN_TIME_EXTEND = 8, - RB_LEN_TIME_STAMP = 8, +struct trace_probe_log { + const char *subsystem; + const char **argv; + int argc; + int index; }; -struct buffer_data_page { - u64 time_stamp; - local_t commit; - unsigned char data[0]; +enum uprobe_filter_ctx { + UPROBE_FILTER_REGISTER = 0, + UPROBE_FILTER_UNREGISTER = 1, + UPROBE_FILTER_MMAP = 2, }; -struct buffer_page { - struct list_head list; - local_t write; - unsigned int read; - local_t entries; - long unsigned int real_end; - struct buffer_data_page *page; +struct uprobe_consumer { + int (*handler)(struct uprobe_consumer *, struct pt_regs *); + int (*ret_handler)(struct uprobe_consumer *, long unsigned int, struct pt_regs *); + bool (*filter)(struct uprobe_consumer *, enum uprobe_filter_ctx, struct mm_struct *); + struct uprobe_consumer *next; }; -struct rb_event_info { - u64 ts; - u64 delta; - long unsigned int length; - struct buffer_page *tail_page; - int add_timestamp; +struct uprobe_trace_entry_head { + struct trace_entry ent; + long unsigned int vaddr[0]; }; -enum { - RB_CTX_NMI = 0, - RB_CTX_IRQ = 1, - RB_CTX_SOFTIRQ = 2, - RB_CTX_NORMAL = 3, - RB_CTX_MAX = 4, +struct trace_uprobe { + struct dyn_event devent; + struct uprobe_consumer consumer; + struct path path; + struct inode *inode; + char *filename; + long unsigned int offset; + long unsigned int ref_ctr_offset; + long unsigned int nhit; + struct trace_probe tp; }; -struct ring_buffer_per_cpu { - int cpu; - atomic_t record_disabled; - struct ring_buffer *buffer; - raw_spinlock_t reader_lock; - arch_spinlock_t lock; - struct lock_class_key lock_key; - struct buffer_data_page *free_page; - long unsigned int nr_pages; - unsigned int current_context; - struct list_head *pages; - struct buffer_page *head_page; - struct buffer_page *tail_page; - struct buffer_page *commit_page; - struct buffer_page *reader_page; - long unsigned int lost_events; - long unsigned int last_overrun; - long unsigned int nest; - local_t entries_bytes; - local_t entries; - local_t overrun; - local_t commit_overrun; - local_t dropped_events; - local_t committing; - local_t commits; - local_t pages_touched; - local_t pages_read; - long int last_pages_touch; - size_t shortest_full; - long unsigned int read; - long unsigned int read_bytes; - u64 write_stamp; - u64 read_stamp; - long int nr_pages_to_update; - struct list_head new_pages; - struct work_struct update_pages_work; - struct completion update_done; - struct rb_irq_work irq_work; +struct uprobe_dispatch_data { + struct trace_uprobe *tu; + long unsigned int bp_addr; }; -typedef struct vfsmount * (*debugfs_automount_t)(struct dentry *, void *); - -struct trace_export { - struct trace_export *next; - void (*write)(struct trace_export *, const void *, unsigned int); +struct uprobe_cpu_buffer { + struct mutex mutex; + void *buf; }; -struct prog_entry; +typedef bool (*filter_func_t)(struct uprobe_consumer *, enum uprobe_filter_ctx, struct mm_struct *); -struct event_filter { - struct prog_entry *prog; - char *filter_string; -}; +typedef __u32 __le32; -struct trace_array_cpu; +typedef __u64 __le64; -struct trace_buffer { - struct trace_array *tr; - struct ring_buffer *buffer; - struct trace_array_cpu *data; - u64 time_start; - int cpu; +enum xdp_action { + XDP_ABORTED = 0, + XDP_DROP = 1, + XDP_PASS = 2, + XDP_TX = 3, + XDP_REDIRECT = 4, }; -struct trace_pid_list; - -struct trace_options; +enum xdp_mem_type { + MEM_TYPE_PAGE_SHARED = 0, + MEM_TYPE_PAGE_ORDER0 = 1, + MEM_TYPE_PAGE_POOL = 2, + MEM_TYPE_ZERO_COPY = 3, + MEM_TYPE_MAX = 4, +}; -struct trace_array { - struct list_head list; - char *name; - struct trace_buffer trace_buffer; - struct trace_pid_list *filtered_pids; - arch_spinlock_t max_lock; - int buffer_disabled; - int stop_count; - int clock_id; - int nr_topts; - bool clear_trace; - int buffer_percent; - unsigned int n_err_log_entries; - struct tracer *current_trace; - unsigned int trace_flags; - unsigned char trace_flags_index[32]; - unsigned int flags; - raw_spinlock_t start_lock; - struct list_head err_log; - struct dentry *dir; - struct dentry *options; - struct dentry *percpu_dir; - struct dentry *event_dir; - struct trace_options *topts; - struct list_head systems; - struct list_head events; - struct trace_event_file *trace_marker_file; - cpumask_var_t tracing_cpumask; - int ref; - int time_stamp_abs_ref; - struct list_head hist_vars; +struct zero_copy_allocator { + void (*free)(struct zero_copy_allocator *, long unsigned int); }; -struct tracer_flags; +typedef void (*bpf_jit_fill_hole_t)(void *, unsigned int); -struct tracer { - const char *name; - int (*init)(struct trace_array *); - void (*reset)(struct trace_array *); - void (*start)(struct trace_array *); - void (*stop)(struct trace_array *); - int (*update_thresh)(struct trace_array *); - void (*open)(struct trace_iterator *); - void (*pipe_open)(struct trace_iterator *); - void (*close)(struct trace_iterator *); - void (*pipe_close)(struct trace_iterator *); - ssize_t (*read)(struct trace_iterator *, struct file *, char *, size_t, loff_t *); - ssize_t (*splice_read)(struct trace_iterator *, struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); - void (*print_header)(struct seq_file *); - enum print_line_t (*print_line)(struct trace_iterator *); - int (*set_flag)(struct trace_array *, u32, u32, int); - int (*flag_changed)(struct trace_array *, u32, int); - struct tracer *next; - struct tracer_flags *flags; - int enabled; - int ref; - bool print_max; - bool allow_instances; - bool noboot; +struct bpf_prog_dummy { + struct bpf_prog prog; }; -enum trace_iter_flags { - TRACE_FILE_LAT_FMT = 1, - TRACE_FILE_ANNOTATE = 2, - TRACE_FILE_TIME_IN_NS = 4, -}; +typedef u64 (*btf_bpf_user_rnd_u32)(); -struct event_subsystem; +struct page_pool; -struct trace_subsystem_dir { - struct list_head list; - struct event_subsystem *subsystem; - struct trace_array *tr; - struct dentry *entry; - int ref_count; - int nr_events; +struct xdp_mem_allocator { + struct xdp_mem_info mem; + union { + void *allocator; + struct page_pool *page_pool; + struct zero_copy_allocator *zc_alloc; + }; + struct rhash_head node; + struct callback_head rcu; }; -enum trace_type { - __TRACE_FIRST_TYPE = 0, - TRACE_FN = 1, - TRACE_CTX = 2, - TRACE_WAKE = 3, - TRACE_STACK = 4, - TRACE_PRINT = 5, - TRACE_BPRINT = 6, - TRACE_MMIO_RW = 7, - TRACE_MMIO_MAP = 8, - TRACE_BRANCH = 9, - TRACE_GRAPH_RET = 10, - TRACE_GRAPH_ENT = 11, - TRACE_USER_STACK = 12, - TRACE_BLK = 13, - TRACE_BPUTS = 14, - TRACE_HWLAT = 15, - TRACE_RAW_DATA = 16, - __TRACE_LAST_TYPE = 17, +struct trace_event_raw_xdp_exception { + struct trace_entry ent; + int prog_id; + u32 act; + int ifindex; + char __data[0]; }; -struct ftrace_entry { +struct trace_event_raw_xdp_bulk_tx { struct trace_entry ent; - long unsigned int ip; - long unsigned int parent_ip; + int ifindex; + u32 act; + int drops; + int sent; + int err; + char __data[0]; }; -struct stack_entry { +struct trace_event_raw_xdp_redirect_template { struct trace_entry ent; - int size; - long unsigned int caller[0]; + int prog_id; + u32 act; + int ifindex; + int err; + int to_ifindex; + u32 map_id; + int map_index; + char __data[0]; }; -struct userstack_entry { +struct trace_event_raw_xdp_cpumap_kthread { struct trace_entry ent; - unsigned int tgid; - long unsigned int caller[8]; + int map_id; + u32 act; + int cpu; + unsigned int drops; + unsigned int processed; + int sched; + char __data[0]; }; -struct bprint_entry { +struct trace_event_raw_xdp_cpumap_enqueue { struct trace_entry ent; - long unsigned int ip; - const char *fmt; - u32 buf[0]; + int map_id; + u32 act; + int cpu; + unsigned int drops; + unsigned int processed; + int to_cpu; + char __data[0]; }; -struct print_entry { +struct trace_event_raw_xdp_devmap_xmit { struct trace_entry ent; - long unsigned int ip; - char buf[0]; + int map_id; + u32 act; + u32 map_index; + int drops; + int sent; + int from_ifindex; + int to_ifindex; + int err; + char __data[0]; }; -struct raw_data_entry { +struct trace_event_raw_mem_disconnect { struct trace_entry ent; - unsigned int id; - char buf[0]; + const struct xdp_mem_allocator *xa; + u32 mem_id; + u32 mem_type; + const void *allocator; + char __data[0]; }; -struct bputs_entry { +struct trace_event_raw_mem_connect { struct trace_entry ent; - long unsigned int ip; - const char *str; + const struct xdp_mem_allocator *xa; + u32 mem_id; + u32 mem_type; + const void *allocator; + const struct xdp_rxq_info *rxq; + int ifindex; + char __data[0]; }; -enum trace_flag_type { - TRACE_FLAG_IRQS_OFF = 1, - TRACE_FLAG_IRQS_NOSUPPORT = 2, - TRACE_FLAG_NEED_RESCHED = 4, - TRACE_FLAG_HARDIRQ = 8, - TRACE_FLAG_SOFTIRQ = 16, - TRACE_FLAG_PREEMPT_RESCHED = 32, - TRACE_FLAG_NMI = 64, +struct trace_event_raw_mem_return_failed { + struct trace_entry ent; + const struct page *page; + u32 mem_id; + u32 mem_type; + char __data[0]; }; -struct trace_array_cpu { - atomic_t disabled; - void *buffer_page; - long unsigned int entries; - long unsigned int saved_latency; - long unsigned int critical_start; - long unsigned int critical_end; - long unsigned int critical_sequence; - long unsigned int nice; - long unsigned int policy; - long unsigned int rt_priority; - long unsigned int skipped_entries; - u64 preempt_timestamp; - pid_t pid; - kuid_t uid; - char comm[16]; - bool ignore_pid; -}; +struct trace_event_data_offsets_xdp_exception {}; -struct trace_option_dentry; +struct trace_event_data_offsets_xdp_bulk_tx {}; -struct trace_options { - struct tracer *tracer; - struct trace_option_dentry *topts; -}; +struct trace_event_data_offsets_xdp_redirect_template {}; -struct tracer_opt; +struct trace_event_data_offsets_xdp_cpumap_kthread {}; -struct trace_option_dentry { - struct tracer_opt *opt; - struct tracer_flags *flags; - struct trace_array *tr; - struct dentry *entry; -}; +struct trace_event_data_offsets_xdp_cpumap_enqueue {}; -struct trace_pid_list { - int pid_max; - long unsigned int *pids; -}; +struct trace_event_data_offsets_xdp_devmap_xmit {}; -typedef bool (*cond_update_fn_t)(struct trace_array *, void *); +struct trace_event_data_offsets_mem_disconnect {}; -enum { - TRACE_ARRAY_FL_GLOBAL = 1, -}; +struct trace_event_data_offsets_mem_connect {}; -struct tracer_opt { - const char *name; - u32 bit; -}; +struct trace_event_data_offsets_mem_return_failed {}; -struct tracer_flags { - u32 val; - struct tracer_opt *opts; - struct tracer *trace; -}; +typedef void (*btf_trace_xdp_exception)(void *, const struct net_device *, const struct bpf_prog *, u32); -struct trace_parser { - bool cont; - char *buffer; - unsigned int idx; - unsigned int size; -}; +typedef void (*btf_trace_xdp_bulk_tx)(void *, const struct net_device *, int, int, int); -enum trace_iterator_bits { - TRACE_ITER_PRINT_PARENT_BIT = 0, - TRACE_ITER_SYM_OFFSET_BIT = 1, - TRACE_ITER_SYM_ADDR_BIT = 2, - TRACE_ITER_VERBOSE_BIT = 3, - TRACE_ITER_RAW_BIT = 4, - TRACE_ITER_HEX_BIT = 5, - TRACE_ITER_BIN_BIT = 6, - TRACE_ITER_BLOCK_BIT = 7, - TRACE_ITER_PRINTK_BIT = 8, - TRACE_ITER_ANNOTATE_BIT = 9, - TRACE_ITER_USERSTACKTRACE_BIT = 10, - TRACE_ITER_SYM_USEROBJ_BIT = 11, - TRACE_ITER_PRINTK_MSGONLY_BIT = 12, - TRACE_ITER_CONTEXT_INFO_BIT = 13, - TRACE_ITER_LATENCY_FMT_BIT = 14, - TRACE_ITER_RECORD_CMD_BIT = 15, - TRACE_ITER_RECORD_TGID_BIT = 16, - TRACE_ITER_OVERWRITE_BIT = 17, - TRACE_ITER_STOP_ON_FREE_BIT = 18, - TRACE_ITER_IRQ_INFO_BIT = 19, - TRACE_ITER_MARKERS_BIT = 20, - TRACE_ITER_EVENT_FORK_BIT = 21, - TRACE_ITER_STACKTRACE_BIT = 22, - TRACE_ITER_LAST_BIT = 23, -}; +typedef void (*btf_trace_xdp_redirect)(void *, const struct net_device *, const struct bpf_prog *, int, int, const struct bpf_map *, u32); -enum trace_iterator_flags { - TRACE_ITER_PRINT_PARENT = 1, - TRACE_ITER_SYM_OFFSET = 2, - TRACE_ITER_SYM_ADDR = 4, - TRACE_ITER_VERBOSE = 8, - TRACE_ITER_RAW = 16, - TRACE_ITER_HEX = 32, - TRACE_ITER_BIN = 64, - TRACE_ITER_BLOCK = 128, - TRACE_ITER_PRINTK = 256, - TRACE_ITER_ANNOTATE = 512, - TRACE_ITER_USERSTACKTRACE = 1024, - TRACE_ITER_SYM_USEROBJ = 2048, - TRACE_ITER_PRINTK_MSGONLY = 4096, - TRACE_ITER_CONTEXT_INFO = 8192, - TRACE_ITER_LATENCY_FMT = 16384, - TRACE_ITER_RECORD_CMD = 32768, - TRACE_ITER_RECORD_TGID = 65536, - TRACE_ITER_OVERWRITE = 131072, - TRACE_ITER_STOP_ON_FREE = 262144, - TRACE_ITER_IRQ_INFO = 524288, - TRACE_ITER_MARKERS = 1048576, - TRACE_ITER_EVENT_FORK = 2097152, - TRACE_ITER_STACKTRACE = 4194304, -}; +typedef void (*btf_trace_xdp_redirect_err)(void *, const struct net_device *, const struct bpf_prog *, int, int, const struct bpf_map *, u32); -struct event_subsystem { - struct list_head list; - const char *name; - struct event_filter *filter; - int ref_count; -}; +typedef void (*btf_trace_xdp_redirect_map)(void *, const struct net_device *, const struct bpf_prog *, int, int, const struct bpf_map *, u32); -struct saved_cmdlines_buffer { - unsigned int map_pid_to_cmdline[32769]; - unsigned int *map_cmdline_to_pid; - unsigned int cmdline_num; - int cmdline_idx; - char *saved_cmdlines; -}; +typedef void (*btf_trace_xdp_redirect_map_err)(void *, const struct net_device *, const struct bpf_prog *, int, int, const struct bpf_map *, u32); -struct ftrace_stack { - long unsigned int calls[1024]; -}; +typedef void (*btf_trace_xdp_cpumap_kthread)(void *, int, unsigned int, unsigned int, int); -struct ftrace_stacks { - struct ftrace_stack stacks[4]; -}; +typedef void (*btf_trace_xdp_cpumap_enqueue)(void *, int, unsigned int, unsigned int, int); -struct trace_buffer_struct { - int nesting; - char buffer[4096]; -}; +typedef void (*btf_trace_xdp_devmap_xmit)(void *, const struct bpf_map *, u32, int, int, const struct net_device *, const struct net_device *, int); -struct ftrace_buffer_info { - struct trace_iterator iter; - void *spare; - unsigned int spare_cpu; - unsigned int read; -}; +typedef void (*btf_trace_mem_disconnect)(void *, const struct xdp_mem_allocator *); -struct err_info { - const char **errs; - u8 type; - u8 pos; - u64 ts; -}; +typedef void (*btf_trace_mem_connect)(void *, const struct xdp_mem_allocator *, const struct xdp_rxq_info *); -struct tracing_log_err { - struct list_head list; - struct err_info info; - char loc[128]; - char cmd[256]; +typedef void (*btf_trace_mem_return_failed)(void *, const struct xdp_mem_info *, const struct page *); + +enum bpf_cmd { + BPF_MAP_CREATE = 0, + BPF_MAP_LOOKUP_ELEM = 1, + BPF_MAP_UPDATE_ELEM = 2, + BPF_MAP_DELETE_ELEM = 3, + BPF_MAP_GET_NEXT_KEY = 4, + BPF_PROG_LOAD = 5, + BPF_OBJ_PIN = 6, + BPF_OBJ_GET = 7, + BPF_PROG_ATTACH = 8, + BPF_PROG_DETACH = 9, + BPF_PROG_TEST_RUN = 10, + BPF_PROG_GET_NEXT_ID = 11, + BPF_MAP_GET_NEXT_ID = 12, + BPF_PROG_GET_FD_BY_ID = 13, + BPF_MAP_GET_FD_BY_ID = 14, + BPF_OBJ_GET_INFO_BY_FD = 15, + BPF_PROG_QUERY = 16, + BPF_RAW_TRACEPOINT_OPEN = 17, + BPF_BTF_LOAD = 18, + BPF_BTF_GET_FD_BY_ID = 19, + BPF_TASK_FD_QUERY = 20, + BPF_MAP_LOOKUP_AND_DELETE_ELEM = 21, + BPF_MAP_FREEZE = 22, + BPF_BTF_GET_NEXT_ID = 23, }; -struct buffer_ref { - struct ring_buffer *buffer; - void *page; - int cpu; - refcount_t refcount; +enum { + BPF_ANY = 0, + BPF_NOEXIST = 1, + BPF_EXIST = 2, + BPF_F_LOCK = 4, }; -struct ctx_switch_entry { - struct trace_entry ent; - unsigned int prev_pid; - unsigned int next_pid; - unsigned int next_cpu; - unsigned char prev_prio; - unsigned char prev_state; - unsigned char next_prio; - unsigned char next_state; +enum { + BPF_F_NO_PREALLOC = 1, + BPF_F_NO_COMMON_LRU = 2, + BPF_F_NUMA_NODE = 4, + BPF_F_RDONLY = 8, + BPF_F_WRONLY = 16, + BPF_F_STACK_BUILD_ID = 32, + BPF_F_ZERO_SEED = 64, + BPF_F_RDONLY_PROG = 128, + BPF_F_WRONLY_PROG = 256, + BPF_F_CLONE = 512, + BPF_F_MMAPABLE = 1024, }; -struct hwlat_entry { - struct trace_entry ent; - u64 duration; - u64 outer_duration; - u64 nmi_total_ts; - struct timespec64 timestamp; - unsigned int nmi_count; - unsigned int seqnum; +struct bpf_prog_info { + __u32 type; + __u32 id; + __u8 tag[8]; + __u32 jited_prog_len; + __u32 xlated_prog_len; + __u64 jited_prog_insns; + __u64 xlated_prog_insns; + __u64 load_time; + __u32 created_by_uid; + __u32 nr_map_ids; + __u64 map_ids; + char name[16]; + __u32 ifindex; + __u32 gpl_compatible: 1; + __u64 netns_dev; + __u64 netns_ino; + __u32 nr_jited_ksyms; + __u32 nr_jited_func_lens; + __u64 jited_ksyms; + __u64 jited_func_lens; + __u32 btf_id; + __u32 func_info_rec_size; + __u64 func_info; + __u32 nr_func_info; + __u32 nr_line_info; + __u64 line_info; + __u64 jited_line_info; + __u32 nr_jited_line_info; + __u32 line_info_rec_size; + __u32 jited_line_info_rec_size; + __u32 nr_prog_tags; + __u64 prog_tags; + __u64 run_time_ns; + __u64 run_cnt; +}; + +struct bpf_map_info { + __u32 type; + __u32 id; + __u32 key_size; + __u32 value_size; + __u32 max_entries; + __u32 map_flags; + char name[16]; + __u32 ifindex; + __u64 netns_dev; + __u64 netns_ino; + __u32 btf_id; + __u32 btf_key_type_id; + __u32 btf_value_type_id; }; -struct trace_mark { - long long unsigned int val; - char sym; +struct bpf_btf_info { + __u64 btf; + __u32 btf_size; + __u32 id; }; -struct tracer_stat { - const char *name; - void * (*stat_start)(struct tracer_stat *); - void * (*stat_next)(void *, int); - cmp_func_t stat_cmp; - int (*stat_show)(struct seq_file *, void *); - void (*stat_release)(void *); - int (*stat_headers)(struct seq_file *); +struct bpf_spin_lock { + __u32 val; }; -struct stat_node { - struct rb_node node; - void *stat; +enum perf_bpf_event_type { + PERF_BPF_EVENT_UNKNOWN = 0, + PERF_BPF_EVENT_PROG_LOAD = 1, + PERF_BPF_EVENT_PROG_UNLOAD = 2, + PERF_BPF_EVENT_MAX = 3, }; -struct stat_session { - struct list_head session_list; - struct tracer_stat *ts; - struct rb_root stat_root; - struct mutex stat_mutex; - struct dentry *file; +struct bpf_raw_tracepoint { + struct bpf_raw_event_map *btp; + struct bpf_prog *prog; }; -struct trace_bprintk_fmt { - struct list_head list; - const char *fmt; +struct bpf_verifier_log { + u32 level; + char kbuf[1024]; + char *ubuf; + u32 len_used; + u32 len_total; }; -enum { - TRACE_NOP_OPT_ACCEPT = 1, - TRACE_NOP_OPT_REFUSE = 2, +struct bpf_subprog_info { + u32 start; + u32 linfo_idx; + u16 stack_depth; }; -typedef __u32 blk_mq_req_flags_t; +struct bpf_verifier_stack_elem; -struct blk_mq_ctxs; +struct bpf_verifier_state; -struct blk_mq_ctx { +struct bpf_verifier_state_list; + +struct bpf_insn_aux_data; + +struct bpf_verifier_env { + u32 insn_idx; + u32 prev_insn_idx; + struct bpf_prog *prog; + const struct bpf_verifier_ops *ops; + struct bpf_verifier_stack_elem *head; + int stack_size; + bool strict_alignment; + bool test_state_freq; + struct bpf_verifier_state *cur_state; + struct bpf_verifier_state_list **explored_states; + struct bpf_verifier_state_list *free_list; + struct bpf_map *used_maps[64]; + u32 used_map_cnt; + u32 id_gen; + bool allow_ptr_leaks; + bool seen_direct_write; + struct bpf_insn_aux_data *insn_aux_data; + const struct bpf_line_info *prev_linfo; + struct bpf_verifier_log log; + struct bpf_subprog_info subprog_info[257]; struct { - spinlock_t lock; - struct list_head rq_lists[3]; - long: 64; + int *insn_state; + int *insn_stack; + int cur_stack; + } cfg; + u32 subprog_cnt; + u32 prev_insn_processed; + u32 insn_processed; + u32 prev_jmps_processed; + u32 jmps_processed; + u64 verification_time; + u32 max_states_per_insn; + u32 total_states; + u32 peak_states; + u32 longest_mark_read_walk; +}; + +typedef u32 (*bpf_convert_ctx_access_t)(enum bpf_access_type, const struct bpf_insn *, struct bpf_insn *, struct bpf_prog *, u32 *); + +struct tnum { + u64 value; + u64 mask; +}; + +enum bpf_reg_liveness { + REG_LIVE_NONE = 0, + REG_LIVE_READ32 = 1, + REG_LIVE_READ64 = 2, + REG_LIVE_READ = 3, + REG_LIVE_WRITTEN = 4, + REG_LIVE_DONE = 8, +}; + +struct bpf_reg_state { + enum bpf_reg_type type; + union { + u16 range; + struct bpf_map *map_ptr; + u32 btf_id; + long unsigned int raw; }; - unsigned int cpu; - short unsigned int index_hw[3]; - struct blk_mq_hw_ctx *hctxs[3]; - long unsigned int rq_dispatched[2]; - long unsigned int rq_merged; - long unsigned int rq_completed[2]; - struct request_queue *queue; - struct blk_mq_ctxs *ctxs; - struct kobject kobj; - long: 64; - long: 64; - long: 64; - long: 64; + s32 off; + u32 id; + u32 ref_obj_id; + struct tnum var_off; + s64 smin_value; + s64 smax_value; + u64 umin_value; + u64 umax_value; + struct bpf_reg_state *parent; + u32 frameno; + s32 subreg_def; + enum bpf_reg_liveness live; + bool precise; }; -struct sbitmap_word; +enum bpf_stack_slot_type { + STACK_INVALID = 0, + STACK_SPILL = 1, + STACK_MISC = 2, + STACK_ZERO = 3, +}; -struct sbitmap { - unsigned int depth; - unsigned int shift; - unsigned int map_nr; - struct sbitmap_word *map; +struct bpf_stack_state { + struct bpf_reg_state spilled_ptr; + u8 slot_type[8]; }; -struct blk_mq_tags; +struct bpf_reference_state { + int id; + int insn_idx; +}; -struct blk_mq_hw_ctx { - struct { - spinlock_t lock; - struct list_head dispatch; - long unsigned int state; - long: 64; - long: 64; - long: 64; - long: 64; - }; - struct delayed_work run_work; - cpumask_var_t cpumask; - int next_cpu; - int next_cpu_batch; - long unsigned int flags; - void *sched_data; - struct request_queue *queue; - struct blk_flush_queue *fq; - void *driver_data; - struct sbitmap ctx_map; - struct blk_mq_ctx *dispatch_from; - unsigned int dispatch_busy; - short unsigned int type; - short unsigned int nr_ctx; - struct blk_mq_ctx **ctxs; - spinlock_t dispatch_wait_lock; - wait_queue_entry_t dispatch_wait; - atomic_t wait_index; - struct blk_mq_tags *tags; - struct blk_mq_tags *sched_tags; - long unsigned int queued; - long unsigned int run; - long unsigned int dispatched[7]; - unsigned int numa_node; - unsigned int queue_num; - atomic_t nr_active; - struct hlist_node cpuhp_dead; - struct kobject kobj; - long unsigned int poll_considered; - long unsigned int poll_invoked; - long unsigned int poll_success; - struct dentry *debugfs_dir; - struct dentry *sched_debugfs_dir; - struct list_head hctx_list; - struct srcu_struct srcu[0]; - long: 64; - long: 64; - long: 64; +struct bpf_func_state { + struct bpf_reg_state regs[11]; + int callsite; + u32 frameno; + u32 subprogno; + int acquired_refs; + struct bpf_reference_state *refs; + int allocated_stack; + struct bpf_stack_state *stack; }; -struct blk_mq_alloc_data { - struct request_queue *q; - blk_mq_req_flags_t flags; - unsigned int shallow_depth; - unsigned int cmd_flags; - struct blk_mq_ctx *ctx; - struct blk_mq_hw_ctx *hctx; +struct bpf_idx_pair { + u32 prev_idx; + u32 idx; }; -struct blk_stat_callback { - struct list_head list; - struct timer_list timer; - struct blk_rq_stat *cpu_stat; - int (*bucket_fn)(const struct request *); - unsigned int buckets; - struct blk_rq_stat *stat; - void (*timer_fn)(struct blk_stat_callback *); - void *data; - struct callback_head rcu; +struct bpf_verifier_state { + struct bpf_func_state *frame[8]; + struct bpf_verifier_state *parent; + u32 branches; + u32 insn_idx; + u32 curframe; + u32 active_spin_lock; + bool speculative; + u32 first_insn_idx; + u32 last_insn_idx; + struct bpf_idx_pair *jmp_history; + u32 jmp_history_cnt; }; -struct blk_trace { - int trace_state; - struct rchan *rchan; - long unsigned int *sequence; - unsigned char *msg_data; - u16 act_mask; - u64 start_lba; - u64 end_lba; - u32 pid; - u32 dev; - struct dentry *dir; - struct dentry *dropped_file; - struct dentry *msg_file; - struct list_head running_list; - atomic_t dropped; +struct bpf_verifier_state_list { + struct bpf_verifier_state state; + struct bpf_verifier_state_list *next; + int miss_cnt; + int hit_cnt; }; -struct blk_flush_queue { - unsigned int flush_queue_delayed: 1; - unsigned int flush_pending_idx: 1; - unsigned int flush_running_idx: 1; - blk_status_t rq_status; - long unsigned int flush_pending_since; - struct list_head flush_queue[2]; - struct list_head flush_data_in_flight; - struct request *flush_rq; - struct request *orig_rq; - struct lock_class_key key; - spinlock_t mq_flush_lock; +struct bpf_insn_aux_data { + union { + enum bpf_reg_type ptr_type; + long unsigned int map_ptr_state; + s32 call_imm; + u32 alu_limit; + struct { + u32 map_index; + u32 map_off; + }; + }; + u64 map_key_state; + int ctx_field_size; + int sanitize_stack_off; + bool seen; + bool zext_dst; + u8 alu_state; + bool prune_point; + unsigned int orig_idx; }; -struct blk_mq_queue_map { - unsigned int *mq_map; - unsigned int nr_queues; - unsigned int queue_offset; +struct bpf_verifier_stack_elem { + struct bpf_verifier_state st; + int insn_idx; + int prev_insn_idx; + struct bpf_verifier_stack_elem *next; }; -struct blk_mq_tag_set { - struct blk_mq_queue_map map[3]; - unsigned int nr_maps; - const struct blk_mq_ops *ops; - unsigned int nr_hw_queues; - unsigned int queue_depth; - unsigned int reserved_tags; - unsigned int cmd_size; - int numa_node; - unsigned int timeout; - unsigned int flags; - void *driver_data; - struct blk_mq_tags **tags; - struct mutex tag_list_lock; - struct list_head tag_list; +typedef void (*bpf_insn_print_t)(void *, const char *, ...); + +typedef const char * (*bpf_insn_revmap_call_t)(void *, const struct bpf_insn *); + +typedef const char * (*bpf_insn_print_imm_t)(void *, const struct bpf_insn *, __u64); + +struct bpf_insn_cbs { + bpf_insn_print_t cb_print; + bpf_insn_revmap_call_t cb_call; + bpf_insn_print_imm_t cb_imm; + void *private_data; }; -typedef u64 compat_u64; +struct bpf_call_arg_meta { + struct bpf_map *map_ptr; + bool raw_mode; + bool pkt_access; + int regno; + int access_size; + s64 msize_smax_value; + u64 msize_umax_value; + int ref_obj_id; + int func_id; + u32 btf_id; +}; -enum blktrace_cat { - BLK_TC_READ = 1, - BLK_TC_WRITE = 2, - BLK_TC_FLUSH = 4, - BLK_TC_SYNC = 8, - BLK_TC_SYNCIO = 8, - BLK_TC_QUEUE = 16, - BLK_TC_REQUEUE = 32, - BLK_TC_ISSUE = 64, - BLK_TC_COMPLETE = 128, - BLK_TC_FS = 256, - BLK_TC_PC = 512, - BLK_TC_NOTIFY = 1024, - BLK_TC_AHEAD = 2048, - BLK_TC_META = 4096, - BLK_TC_DISCARD = 8192, - BLK_TC_DRV_DATA = 16384, - BLK_TC_FUA = 32768, - BLK_TC_END = 32768, +enum reg_arg_type { + SRC_OP = 0, + DST_OP = 1, + DST_OP_NO_MARK = 2, }; -enum blktrace_act { - __BLK_TA_QUEUE = 1, - __BLK_TA_BACKMERGE = 2, - __BLK_TA_FRONTMERGE = 3, - __BLK_TA_GETRQ = 4, - __BLK_TA_SLEEPRQ = 5, - __BLK_TA_REQUEUE = 6, - __BLK_TA_ISSUE = 7, - __BLK_TA_COMPLETE = 8, - __BLK_TA_PLUG = 9, - __BLK_TA_UNPLUG_IO = 10, - __BLK_TA_UNPLUG_TIMER = 11, - __BLK_TA_INSERT = 12, - __BLK_TA_SPLIT = 13, - __BLK_TA_BOUNCE = 14, - __BLK_TA_REMAP = 15, - __BLK_TA_ABORT = 16, - __BLK_TA_DRV_DATA = 17, - __BLK_TA_CGROUP = 256, +enum { + DISCOVERED = 16, + EXPLORED = 32, + FALLTHROUGH = 1, + BRANCH = 2, }; -enum blktrace_notify { - __BLK_TN_PROCESS = 0, - __BLK_TN_TIMESTAMP = 1, - __BLK_TN_MESSAGE = 2, - __BLK_TN_CGROUP = 256, +struct idpair { + u32 old; + u32 cur; }; -struct blk_io_trace { - __u32 magic; - __u32 sequence; - __u64 time; - __u64 sector; - __u32 bytes; - __u32 action; - __u32 pid; - __u32 device; - __u32 cpu; - __u16 error; - __u16 pdu_len; +struct tree_descr { + const char *name; + const struct file_operations *ops; + int mode; }; -struct blk_io_trace_remap { - __be32 device_from; - __be32 device_to; - __be64 sector_from; +enum bpf_type { + BPF_TYPE_UNSPEC = 0, + BPF_TYPE_PROG = 1, + BPF_TYPE_MAP = 2, +}; + +struct map_iter { + void *key; + bool done; }; enum { - Blktrace_setup = 1, - Blktrace_running = 2, - Blktrace_stopped = 3, + OPT_MODE = 0, }; -struct blk_user_trace_setup { - char name[32]; - __u16 act_mask; - __u32 buf_size; - __u32 buf_nr; - __u64 start_lba; - __u64 end_lba; - __u32 pid; +struct bpf_mount_opts { + umode_t mode; }; -struct compat_blk_user_trace_setup { - char name[32]; - u16 act_mask; - short: 16; - u32 buf_size; - u32 buf_nr; - compat_u64 start_lba; - compat_u64 end_lba; - u32 pid; -} __attribute__((packed)); +typedef u64 (*btf_bpf_map_lookup_elem)(struct bpf_map *, void *); -struct blkcg {}; +typedef u64 (*btf_bpf_map_update_elem)(struct bpf_map *, void *, void *, u64); -struct sbitmap_word { - long unsigned int depth; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +typedef u64 (*btf_bpf_map_delete_elem)(struct bpf_map *, void *); + +typedef u64 (*btf_bpf_map_push_elem)(struct bpf_map *, void *, u64); + +typedef u64 (*btf_bpf_map_pop_elem)(struct bpf_map *, void *); + +typedef u64 (*btf_bpf_map_peek_elem)(struct bpf_map *, void *); + +typedef u64 (*btf_bpf_get_smp_processor_id)(); + +typedef u64 (*btf_bpf_get_numa_node_id)(); + +typedef u64 (*btf_bpf_ktime_get_ns)(); + +typedef u64 (*btf_bpf_get_current_pid_tgid)(); + +typedef u64 (*btf_bpf_get_current_uid_gid)(); + +typedef u64 (*btf_bpf_get_current_comm)(char *, u32); + +typedef u64 (*btf_bpf_spin_lock)(struct bpf_spin_lock *); + +typedef u64 (*btf_bpf_spin_unlock)(struct bpf_spin_lock *); + +typedef u64 (*btf_bpf_get_current_cgroup_id)(); + +typedef u64 (*btf_bpf_get_local_storage)(struct bpf_map *, u64); + +typedef u64 (*btf_bpf_strtol)(const char *, size_t, u64, long int *); + +typedef u64 (*btf_bpf_strtoul)(const char *, size_t, u64, long unsigned int *); + +struct pcpu_freelist_node; + +struct pcpu_freelist_head { + struct pcpu_freelist_node *first; + raw_spinlock_t lock; +}; + +struct pcpu_freelist_node { + struct pcpu_freelist_node *next; +}; + +struct pcpu_freelist { + struct pcpu_freelist_head *freelist; +}; + +struct bpf_lru_node { + struct list_head list; + u16 cpu; + u8 type; + u8 ref; +}; + +struct bpf_lru_list { + struct list_head lists[3]; + unsigned int counts[2]; + struct list_head *next_inactive_rotation; + raw_spinlock_t lock; + long: 32; long: 64; - long unsigned int word; long: 64; long: 64; long: 64; long: 64; long: 64; long: 64; +}; + +struct bpf_lru_locallist { + struct list_head lists[2]; + u16 next_steal; + raw_spinlock_t lock; +}; + +struct bpf_common_lru { + struct bpf_lru_list lru_list; + struct bpf_lru_locallist *local_list; long: 64; - long unsigned int cleared; - spinlock_t swap_lock; - long: 32; long: 64; long: 64; long: 64; @@ -30185,804 +34794,1118 @@ struct sbitmap_word { long: 64; }; -struct sbq_wait_state { - atomic_t wait_cnt; - wait_queue_head_t wait; +typedef bool (*del_from_htab_func)(void *, struct bpf_lru_node *); + +struct bpf_lru { + union { + struct bpf_common_lru common_lru; + struct bpf_lru_list *percpu_lru; + }; + del_from_htab_func del_from_htab; + void *del_arg; + unsigned int hash_offset; + unsigned int nr_scans; + bool percpu; + long: 56; long: 64; long: 64; long: 64; long: 64; }; -struct sbitmap_queue { - struct sbitmap sb; - unsigned int *alloc_hint; - unsigned int wake_batch; - atomic_t wake_index; - struct sbq_wait_state *ws; - atomic_t ws_active; - bool round_robin; - unsigned int min_shallow_depth; -}; - -struct blk_mq_tags { - unsigned int nr_tags; - unsigned int nr_reserved_tags; - atomic_t active_queues; - struct sbitmap_queue bitmap_tags; - struct sbitmap_queue breserved_tags; - struct request **rqs; - struct request **static_rqs; - struct list_head page_list; -}; - -struct blk_mq_queue_data { - struct request *rq; - bool last; -}; - -struct blk_mq_ctxs { - struct kobject kobj; - struct blk_mq_ctx *queue_ctx; -}; - -typedef void blk_log_action_t(struct trace_iterator *, const char *, bool); - -struct ftrace_event_field { - struct list_head link; - const char *name; - const char *type; - int filter_type; - int offset; - int size; - int is_signed; -}; - -enum { - FORMAT_HEADER = 1, - FORMAT_FIELD_SEPERATOR = 2, - FORMAT_PRINTFMT = 3, +struct bucket { + struct hlist_nulls_head head; + raw_spinlock_t lock; }; -struct ftrace_graph_ent { - long unsigned int func; - int depth; -} __attribute__((packed)); - -struct ftrace_graph_ret { - long unsigned int func; - long unsigned int overrun; - long long unsigned int calltime; - long long unsigned int rettime; - int depth; -} __attribute__((packed)); - -struct mmiotrace_rw { - resource_size_t phys; - long unsigned int value; - long unsigned int pc; - int map_id; - unsigned char opcode; - unsigned char width; -}; +struct htab_elem; -struct mmiotrace_map { - resource_size_t phys; - long unsigned int virt; - long unsigned int len; - int map_id; - unsigned char opcode; +struct bpf_htab { + struct bpf_map map; + struct bucket *buckets; + void *elems; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + union { + struct pcpu_freelist freelist; + struct bpf_lru lru; + }; + struct htab_elem **extra_elems; + atomic_t count; + u32 n_buckets; + u32 elem_size; + u32 hashrnd; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct ftrace_graph_ent_entry { - struct trace_entry ent; - struct ftrace_graph_ent graph_ent; -} __attribute__((packed)); - -struct ftrace_graph_ret_entry { - struct trace_entry ent; - struct ftrace_graph_ret ret; -} __attribute__((packed)); - -struct trace_mmiotrace_rw { - struct trace_entry ent; - struct mmiotrace_rw rw; +struct htab_elem { + union { + struct hlist_nulls_node hash_node; + struct { + void *padding; + union { + struct bpf_htab *htab; + struct pcpu_freelist_node fnode; + }; + }; + }; + union { + struct callback_head rcu; + struct bpf_lru_node lru_node; + }; + u32 hash; + int: 32; + char key[0]; }; -struct trace_mmiotrace_map { - struct trace_entry ent; - struct mmiotrace_map map; +struct prog_poke_elem { + struct list_head list; + struct bpf_prog_aux *aux; }; -struct trace_branch { - struct trace_entry ent; - unsigned int line; - char func[31]; - char file[21]; - char correct; - char constant; +enum bpf_lru_list_type { + BPF_LRU_LIST_T_ACTIVE = 0, + BPF_LRU_LIST_T_INACTIVE = 1, + BPF_LRU_LIST_T_FREE = 2, + BPF_LRU_LOCAL_LIST_T_FREE = 3, + BPF_LRU_LOCAL_LIST_T_PENDING = 4, }; -typedef long unsigned int perf_trace_t[256]; - -struct filter_pred; - -struct prog_entry { - int target; - int when_to_branch; - struct filter_pred *pred; +struct bpf_lpm_trie_key { + __u32 prefixlen; + __u8 data[0]; }; -typedef int (*filter_pred_fn_t)(struct filter_pred *, void *); - -struct regex; - -typedef int (*regex_match_func)(char *, struct regex *, int); - -struct regex { - char pattern[256]; - int len; - int field_len; - regex_match_func match; +struct lpm_trie_node { + struct callback_head rcu; + struct lpm_trie_node *child[2]; + u32 prefixlen; + u32 flags; + u8 data[0]; }; -struct filter_pred { - filter_pred_fn_t fn; - u64 val; - struct regex regex; - short unsigned int *ops; - struct ftrace_event_field *field; - int offset; - int not; - int op; +struct lpm_trie { + struct bpf_map map; + struct lpm_trie_node *root; + size_t n_entries; + size_t max_prefixlen; + size_t data_size; + raw_spinlock_t lock; + long: 32; + long: 64; + long: 64; + long: 64; }; -enum regex_type { - MATCH_FULL = 0, - MATCH_FRONT_ONLY = 1, - MATCH_MIDDLE_ONLY = 2, - MATCH_END_ONLY = 3, - MATCH_GLOB = 4, - MATCH_INDEX = 5, +struct idr___2; + +struct bpf_cgroup_storage_map { + struct bpf_map map; + spinlock_t lock; + struct bpf_prog_aux *aux; + struct rb_root root; + struct list_head list; + long: 64; + long: 64; + long: 64; }; -enum filter_op_ids { - OP_GLOB = 0, - OP_NE = 1, - OP_EQ = 2, - OP_LE = 3, - OP_LT = 4, - OP_GE = 5, - OP_GT = 6, - OP_BAND = 7, - OP_MAX = 8, +struct btf_member { + __u32 name_off; + __u32 type; + __u32 offset; }; -enum { - FILT_ERR_NONE = 0, - FILT_ERR_INVALID_OP = 1, - FILT_ERR_TOO_MANY_OPEN = 2, - FILT_ERR_TOO_MANY_CLOSE = 3, - FILT_ERR_MISSING_QUOTE = 4, - FILT_ERR_OPERAND_TOO_LONG = 5, - FILT_ERR_EXPECT_STRING = 6, - FILT_ERR_EXPECT_DIGIT = 7, - FILT_ERR_ILLEGAL_FIELD_OP = 8, - FILT_ERR_FIELD_NOT_FOUND = 9, - FILT_ERR_ILLEGAL_INTVAL = 10, - FILT_ERR_BAD_SUBSYS_FILTER = 11, - FILT_ERR_TOO_MANY_PREDS = 12, - FILT_ERR_INVALID_FILTER = 13, - FILT_ERR_IP_FIELD_ONLY = 14, - FILT_ERR_INVALID_VALUE = 15, - FILT_ERR_ERRNO = 16, - FILT_ERR_NO_FILTER = 17, +struct bpf_queue_stack { + struct bpf_map map; + raw_spinlock_t lock; + u32 head; + u32 tail; + u32 size; + char elements[0]; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct filter_parse_error { - int lasterr; - int lasterr_pos; +struct btf_enum { + __u32 name_off; + __s32 val; }; -typedef int (*parse_pred_fn)(const char *, void *, int, struct filter_parse_error *, struct filter_pred **); +struct btf_array { + __u32 type; + __u32 index_type; + __u32 nelems; +}; -enum { - INVERT = 1, - PROCESS_AND = 2, - PROCESS_OR = 4, +struct btf_param { + __u32 name_off; + __u32 type; }; enum { - TOO_MANY_CLOSE = -1, - TOO_MANY_OPEN = -2, - MISSING_QUOTE = -3, + BTF_VAR_STATIC = 0, + BTF_VAR_GLOBAL_ALLOCATED = 1, }; -struct filter_list { - struct list_head list; - struct event_filter *filter; +struct btf_var { + __u32 linkage; }; -struct event_trigger_ops; - -struct event_command; +struct btf_var_secinfo { + __u32 type; + __u32 offset; + __u32 size; +}; -struct event_trigger_data { - long unsigned int count; - int ref; - struct event_trigger_ops *ops; - struct event_command *cmd_ops; - struct event_filter *filter; - char *filter_str; - void *private_data; - bool paused; - bool paused_tmp; - struct list_head list; - char *name; - struct list_head named_list; - struct event_trigger_data *named_data; +struct bpf_flow_keys { + __u16 nhoff; + __u16 thoff; + __u16 addr_proto; + __u8 is_frag; + __u8 is_first_frag; + __u8 is_encap; + __u8 ip_proto; + __be16 n_proto; + __be16 sport; + __be16 dport; + union { + struct { + __be32 ipv4_src; + __be32 ipv4_dst; + }; + struct { + __u32 ipv6_src[4]; + __u32 ipv6_dst[4]; + }; + }; + __u32 flags; + __be32 flow_label; }; -struct event_trigger_ops { - void (*func)(struct event_trigger_data *, void *, struct ring_buffer_event *); - int (*init)(struct event_trigger_ops *, struct event_trigger_data *); - void (*free)(struct event_trigger_ops *, struct event_trigger_data *); - int (*print)(struct seq_file *, struct event_trigger_ops *, struct event_trigger_data *); +struct bpf_sock { + __u32 bound_dev_if; + __u32 family; + __u32 type; + __u32 protocol; + __u32 mark; + __u32 priority; + __u32 src_ip4; + __u32 src_ip6[4]; + __u32 src_port; + __u32 dst_port; + __u32 dst_ip4; + __u32 dst_ip6[4]; + __u32 state; }; -struct event_command { - struct list_head list; - char *name; - enum event_trigger_type trigger_type; - int flags; - int (*func)(struct event_command *, struct trace_event_file *, char *, char *, char *); - int (*reg)(char *, struct event_trigger_ops *, struct event_trigger_data *, struct trace_event_file *); - void (*unreg)(char *, struct event_trigger_ops *, struct event_trigger_data *, struct trace_event_file *); - void (*unreg_all)(struct trace_event_file *); - int (*set_filter)(char *, struct event_trigger_data *, struct trace_event_file *); - struct event_trigger_ops * (*get_trigger_ops)(char *, char *); +struct __sk_buff { + __u32 len; + __u32 pkt_type; + __u32 mark; + __u32 queue_mapping; + __u32 protocol; + __u32 vlan_present; + __u32 vlan_tci; + __u32 vlan_proto; + __u32 priority; + __u32 ingress_ifindex; + __u32 ifindex; + __u32 tc_index; + __u32 cb[5]; + __u32 hash; + __u32 tc_classid; + __u32 data; + __u32 data_end; + __u32 napi_id; + __u32 family; + __u32 remote_ip4; + __u32 local_ip4; + __u32 remote_ip6[4]; + __u32 local_ip6[4]; + __u32 remote_port; + __u32 local_port; + __u32 data_meta; + union { + struct bpf_flow_keys *flow_keys; + }; + __u64 tstamp; + __u32 wire_len; + __u32 gso_segs; + union { + struct bpf_sock *sk; + }; }; -struct enable_trigger_data { - struct trace_event_file *file; - bool enable; - bool hist; +struct xdp_md { + __u32 data; + __u32 data_end; + __u32 data_meta; + __u32 ingress_ifindex; + __u32 rx_queue_index; }; -enum event_command_flags { - EVENT_CMD_FL_POST_TRIGGER = 1, - EVENT_CMD_FL_NEEDS_REC = 2, +struct sk_msg_md { + union { + void *data; + }; + union { + void *data_end; + }; + __u32 family; + __u32 remote_ip4; + __u32 local_ip4; + __u32 remote_ip6[4]; + __u32 local_ip6[4]; + __u32 remote_port; + __u32 local_port; + __u32 size; }; -enum bpf_task_fd_type { - BPF_FD_TYPE_RAW_TRACEPOINT = 0, - BPF_FD_TYPE_TRACEPOINT = 1, - BPF_FD_TYPE_KPROBE = 2, - BPF_FD_TYPE_KRETPROBE = 3, - BPF_FD_TYPE_UPROBE = 4, - BPF_FD_TYPE_URETPROBE = 5, +struct sk_reuseport_md { + union { + void *data; + }; + union { + void *data_end; + }; + __u32 len; + __u32 eth_protocol; + __u32 ip_protocol; + __u32 bind_inany; + __u32 hash; }; -struct kprobe_trace_entry_head { - struct trace_entry ent; - long unsigned int ip; +struct bpf_sock_addr { + __u32 user_family; + __u32 user_ip4; + __u32 user_ip6[4]; + __u32 user_port; + __u32 family; + __u32 type; + __u32 protocol; + __u32 msg_src_ip4; + __u32 msg_src_ip6[4]; + union { + struct bpf_sock *sk; + }; }; -struct kretprobe_trace_entry_head { - struct trace_entry ent; - long unsigned int func; - long unsigned int ret_ip; +struct bpf_sock_ops { + __u32 op; + union { + __u32 args[4]; + __u32 reply; + __u32 replylong[4]; + }; + __u32 family; + __u32 remote_ip4; + __u32 local_ip4; + __u32 remote_ip6[4]; + __u32 local_ip6[4]; + __u32 remote_port; + __u32 local_port; + __u32 is_fullsock; + __u32 snd_cwnd; + __u32 srtt_us; + __u32 bpf_sock_ops_cb_flags; + __u32 state; + __u32 rtt_min; + __u32 snd_ssthresh; + __u32 rcv_nxt; + __u32 snd_nxt; + __u32 snd_una; + __u32 mss_cache; + __u32 ecn_flags; + __u32 rate_delivered; + __u32 rate_interval_us; + __u32 packets_out; + __u32 retrans_out; + __u32 total_retrans; + __u32 segs_in; + __u32 data_segs_in; + __u32 segs_out; + __u32 data_segs_out; + __u32 lost_out; + __u32 sacked_out; + __u32 sk_txhash; + __u64 bytes_received; + __u64 bytes_acked; + union { + struct bpf_sock *sk; + }; }; -struct dyn_event; +struct bpf_cgroup_dev_ctx { + __u32 access_type; + __u32 major; + __u32 minor; +}; -struct dyn_event_operations { - struct list_head list; - int (*create)(int, const char **); - int (*show)(struct seq_file *, struct dyn_event *); - bool (*is_busy)(struct dyn_event *); - int (*free)(struct dyn_event *); - bool (*match)(const char *, const char *, int, const char **, struct dyn_event *); +struct bpf_sysctl { + __u32 write; + __u32 file_pos; }; -struct dyn_event { - struct list_head list; - struct dyn_event_operations *ops; +struct bpf_sockopt { + union { + struct bpf_sock *sk; + }; + union { + void *optval; + }; + union { + void *optval_end; + }; + __s32 level; + __s32 optname; + __s32 optlen; + __s32 retval; }; -typedef int (*print_type_func_t)(struct trace_seq *, void *, void *); +struct sk_reuseport_kern { + struct sk_buff *skb; + struct sock *sk; + struct sock *selected_sk; + void *data_end; + u32 hash; + u32 reuseport_id; + bool bind_inany; +}; -enum fetch_op { - FETCH_OP_NOP = 0, - FETCH_OP_REG = 1, - FETCH_OP_STACK = 2, - FETCH_OP_STACKP = 3, - FETCH_OP_RETVAL = 4, - FETCH_OP_IMM = 5, - FETCH_OP_COMM = 6, - FETCH_OP_ARG = 7, - FETCH_OP_FOFFS = 8, - FETCH_OP_DATA = 9, - FETCH_OP_DEREF = 10, - FETCH_OP_UDEREF = 11, - FETCH_OP_ST_RAW = 12, - FETCH_OP_ST_MEM = 13, - FETCH_OP_ST_UMEM = 14, - FETCH_OP_ST_STRING = 15, - FETCH_OP_ST_USTRING = 16, - FETCH_OP_MOD_BF = 17, - FETCH_OP_LP_ARRAY = 18, - FETCH_OP_END = 19, - FETCH_NOP_SYMBOL = 20, +struct bpf_flow_dissector { + struct bpf_flow_keys *flow_keys; + const struct sk_buff *skb; + void *data; + void *data_end; }; -struct fetch_insn { - enum fetch_op op; +struct inet_listen_hashbucket { + spinlock_t lock; + unsigned int count; union { - unsigned int param; - struct { - unsigned int size; - int offset; - }; - struct { - unsigned char basesize; - unsigned char lshift; - unsigned char rshift; - }; - long unsigned int immediate; - void *data; + struct hlist_head head; + struct hlist_nulls_head nulls_head; }; }; -struct fetch_type { - const char *name; - size_t size; - int is_signed; - print_type_func_t print; - const char *fmt; - const char *fmttype; -}; +struct inet_ehash_bucket; -struct probe_arg { - struct fetch_insn *code; - bool dynamic; - unsigned int offset; - unsigned int count; - const char *name; - const char *comm; - char *fmt; - const struct fetch_type *type; +struct inet_bind_hashbucket; + +struct inet_hashinfo { + struct inet_ehash_bucket *ehash; + spinlock_t *ehash_locks; + unsigned int ehash_mask; + unsigned int ehash_locks_mask; + struct kmem_cache *bind_bucket_cachep; + struct inet_bind_hashbucket *bhash; + unsigned int bhash_size; + unsigned int lhash2_mask; + struct inet_listen_hashbucket *lhash2; + long: 64; + struct inet_listen_hashbucket listening_hash[32]; }; -struct trace_uprobe_filter { - rwlock_t rwlock; - int nr_systemwide; - struct list_head perf_events; +struct ip_ra_chain { + struct ip_ra_chain *next; + struct sock *sk; + union { + void (*destructor)(struct sock *); + struct sock *saved_sk; + }; + struct callback_head rcu; }; -struct trace_probe_event { - unsigned int flags; - struct trace_event_class class; - struct trace_event_call call; - struct list_head files; - struct list_head probes; - struct trace_uprobe_filter filter[0]; +struct fib_table { + struct hlist_node tb_hlist; + u32 tb_id; + int tb_num_default; + struct callback_head rcu; + long unsigned int *tb_data; + long unsigned int __data[0]; }; -struct trace_probe { - struct list_head list; - struct trace_probe_event *event; - ssize_t size; - unsigned int nr_args; - struct probe_arg args[0]; +struct inet_peer_base { + struct rb_root rb_root; + seqlock_t lock; + int total; }; -struct event_file_link { - struct trace_event_file *file; - struct list_head list; +struct tcp_fastopen_context { + siphash_key_t key[2]; + int num; + struct callback_head rcu; }; -enum { - TP_ERR_FILE_NOT_FOUND = 0, - TP_ERR_NO_REGULAR_FILE = 1, - TP_ERR_BAD_REFCNT = 2, - TP_ERR_REFCNT_OPEN_BRACE = 3, - TP_ERR_BAD_REFCNT_SUFFIX = 4, - TP_ERR_BAD_UPROBE_OFFS = 5, - TP_ERR_MAXACT_NO_KPROBE = 6, - TP_ERR_BAD_MAXACT = 7, - TP_ERR_MAXACT_TOO_BIG = 8, - TP_ERR_BAD_PROBE_ADDR = 9, - TP_ERR_BAD_RETPROBE = 10, - TP_ERR_NO_GROUP_NAME = 11, - TP_ERR_GROUP_TOO_LONG = 12, - TP_ERR_BAD_GROUP_NAME = 13, - TP_ERR_NO_EVENT_NAME = 14, - TP_ERR_EVENT_TOO_LONG = 15, - TP_ERR_BAD_EVENT_NAME = 16, - TP_ERR_RETVAL_ON_PROBE = 17, - TP_ERR_BAD_STACK_NUM = 18, - TP_ERR_BAD_ARG_NUM = 19, - TP_ERR_BAD_VAR = 20, - TP_ERR_BAD_REG_NAME = 21, - TP_ERR_BAD_MEM_ADDR = 22, - TP_ERR_BAD_IMM = 23, - TP_ERR_IMMSTR_NO_CLOSE = 24, - TP_ERR_FILE_ON_KPROBE = 25, - TP_ERR_BAD_FILE_OFFS = 26, - TP_ERR_SYM_ON_UPROBE = 27, - TP_ERR_TOO_MANY_OPS = 28, - TP_ERR_DEREF_NEED_BRACE = 29, - TP_ERR_BAD_DEREF_OFFS = 30, - TP_ERR_DEREF_OPEN_BRACE = 31, - TP_ERR_COMM_CANT_DEREF = 32, - TP_ERR_BAD_FETCH_ARG = 33, - TP_ERR_ARRAY_NO_CLOSE = 34, - TP_ERR_BAD_ARRAY_SUFFIX = 35, - TP_ERR_BAD_ARRAY_NUM = 36, - TP_ERR_ARRAY_TOO_BIG = 37, - TP_ERR_BAD_TYPE = 38, - TP_ERR_BAD_STRING = 39, - TP_ERR_BAD_BITFIELD = 40, - TP_ERR_ARG_NAME_TOO_LONG = 41, - TP_ERR_NO_ARG_NAME = 42, - TP_ERR_BAD_ARG_NAME = 43, - TP_ERR_USED_ARG_NAME = 44, - TP_ERR_ARG_TOO_LONG = 45, - TP_ERR_NO_ARG_BODY = 46, - TP_ERR_BAD_INSN_BNDRY = 47, - TP_ERR_FAIL_REG_PROBE = 48, - TP_ERR_DIFF_PROBE_TYPE = 49, - TP_ERR_DIFF_ARG_TYPE = 50, - TP_ERR_SAME_PROBE = 51, +struct xdp_buff { + void *data; + void *data_end; + void *data_meta; + void *data_hard_start; + long unsigned int handle; + struct xdp_rxq_info *rxq; }; -struct trace_kprobe { - struct dyn_event devent; - struct kretprobe rp; - long unsigned int *nhit; - const char *symbol; - struct trace_probe tp; +struct bpf_sock_addr_kern { + struct sock *sk; + struct sockaddr *uaddr; + u64 tmp_reg; + void *t_ctx; }; -struct trace_event_raw_cpu { - struct trace_entry ent; - u32 state; - u32 cpu_id; - char __data[0]; +struct bpf_sock_ops_kern { + struct sock *sk; + u32 op; + union { + u32 args[4]; + u32 reply; + u32 replylong[4]; + }; + u32 is_fullsock; + u64 temp; }; -struct trace_event_raw_powernv_throttle { - struct trace_entry ent; - int chip_id; - u32 __data_loc_reason; - int pmax; - char __data[0]; +struct bpf_sysctl_kern { + struct ctl_table_header *head; + struct ctl_table *table; + void *cur_val; + size_t cur_len; + void *new_val; + size_t new_len; + int new_updated; + int write; + loff_t *ppos; + u64 tmp_reg; }; -struct trace_event_raw_pstate_sample { - struct trace_entry ent; - u32 core_busy; - u32 scaled_busy; - u32 from; - u32 to; - u64 mperf; - u64 aperf; - u64 tsc; - u32 freq; - u32 io_boost; - char __data[0]; +struct bpf_sockopt_kern { + struct sock *sk; + u8 *optval; + u8 *optval_end; + s32 level; + s32 optname; + s32 optlen; + s32 retval; }; -struct trace_event_raw_cpu_frequency_limits { - struct trace_entry ent; - u32 min_freq; - u32 max_freq; - u32 cpu_id; - char __data[0]; +struct sock_reuseport { + struct callback_head rcu; + u16 max_socks; + u16 num_socks; + unsigned int synq_overflow_ts; + unsigned int reuseport_id; + unsigned int bind_inany: 1; + unsigned int has_conns: 1; + struct bpf_prog *prog; + struct sock *socks[0]; }; -struct trace_event_raw_device_pm_callback_start { - struct trace_entry ent; - u32 __data_loc_device; - u32 __data_loc_driver; - u32 __data_loc_parent; - u32 __data_loc_pm_ops; - int event; - char __data[0]; +struct ip_rt_acct { + __u32 o_bytes; + __u32 o_packets; + __u32 i_bytes; + __u32 i_packets; }; -struct trace_event_raw_device_pm_callback_end { - struct trace_entry ent; - u32 __data_loc_device; - u32 __data_loc_driver; - int error; - char __data[0]; +struct inet_ehash_bucket { + struct hlist_nulls_head chain; }; -struct trace_event_raw_suspend_resume { - struct trace_entry ent; - const char *action; - int val; - bool start; - char __data[0]; +struct inet_bind_hashbucket { + spinlock_t lock; + struct hlist_head chain; }; -struct trace_event_raw_wakeup_source { - struct trace_entry ent; - u32 __data_loc_name; - u64 state; - char __data[0]; +struct ack_sample { + u32 pkts_acked; + s32 rtt_us; + u32 in_flight; }; -struct trace_event_raw_clock { - struct trace_entry ent; - u32 __data_loc_name; - u64 state; - u64 cpu_id; - char __data[0]; +struct rate_sample { + u64 prior_mstamp; + u32 prior_delivered; + s32 delivered; + long int interval_us; + u32 snd_interval_us; + u32 rcv_interval_us; + long int rtt_us; + int losses; + u32 acked_sacked; + u32 prior_in_flight; + bool is_app_limited; + bool is_retrans; + bool is_ack_delayed; }; -struct trace_event_raw_power_domain { - struct trace_entry ent; - u32 __data_loc_name; - u64 state; - u64 cpu_id; - char __data[0]; +struct sk_msg_sg { + u32 start; + u32 curr; + u32 end; + u32 size; + u32 copybreak; + long unsigned int copy; + struct scatterlist data[19]; }; -struct trace_event_raw_pm_qos_request { - struct trace_entry ent; - int pm_qos_class; - s32 value; - char __data[0]; +struct sk_msg { + struct sk_msg_sg sg; + void *data; + void *data_end; + u32 apply_bytes; + u32 cork_bytes; + u32 flags; + struct sk_buff *skb; + struct sock *sk_redir; + struct sock *sk; + struct list_head list; }; -struct trace_event_raw_pm_qos_update_request_timeout { - struct trace_entry ent; - int pm_qos_class; - s32 value; - long unsigned int timeout_us; - char __data[0]; +enum verifier_phase { + CHECK_META = 0, + CHECK_TYPE = 1, }; -struct trace_event_raw_pm_qos_update { - struct trace_entry ent; - enum pm_qos_req_action action; - int prev_value; - int curr_value; - char __data[0]; +struct resolve_vertex { + const struct btf_type *t; + u32 type_id; + u16 next_member; }; -struct trace_event_raw_dev_pm_qos_request { - struct trace_entry ent; - u32 __data_loc_name; - enum dev_pm_qos_req_type type; - s32 new_value; - char __data[0]; +enum visit_state { + NOT_VISITED = 0, + VISITED = 1, + RESOLVED = 2, }; -struct trace_event_data_offsets_cpu {}; +enum resolve_mode { + RESOLVE_TBD = 0, + RESOLVE_PTR = 1, + RESOLVE_STRUCT_OR_ARRAY = 2, +}; -struct trace_event_data_offsets_powernv_throttle { - u32 reason; +struct btf_sec_info { + u32 off; + u32 len; }; -struct trace_event_data_offsets_pstate_sample {}; +struct btf_verifier_env { + struct btf *btf; + u8 *visit_states; + struct resolve_vertex stack[32]; + struct bpf_verifier_log log; + u32 log_type_id; + u32 top_stack; + enum verifier_phase phase; + enum resolve_mode resolve_mode; +}; + +struct btf_kind_operations { + s32 (*check_meta)(struct btf_verifier_env *, const struct btf_type *, u32); + int (*resolve)(struct btf_verifier_env *, const struct resolve_vertex *); + int (*check_member)(struct btf_verifier_env *, const struct btf_type *, const struct btf_member *, const struct btf_type *); + int (*check_kflag_member)(struct btf_verifier_env *, const struct btf_type *, const struct btf_member *, const struct btf_type *); + void (*log_details)(struct btf_verifier_env *, const struct btf_type *); + void (*seq_show)(const struct btf *, const struct btf_type *, u32, void *, u8, struct seq_file *); +}; + +struct bpf_ctx_convert { + struct __sk_buff BPF_PROG_TYPE_SOCKET_FILTER_prog; + struct sk_buff BPF_PROG_TYPE_SOCKET_FILTER_kern; + struct __sk_buff BPF_PROG_TYPE_SCHED_CLS_prog; + struct sk_buff BPF_PROG_TYPE_SCHED_CLS_kern; + struct __sk_buff BPF_PROG_TYPE_SCHED_ACT_prog; + struct sk_buff BPF_PROG_TYPE_SCHED_ACT_kern; + struct xdp_md BPF_PROG_TYPE_XDP_prog; + struct xdp_buff BPF_PROG_TYPE_XDP_kern; + struct __sk_buff BPF_PROG_TYPE_CGROUP_SKB_prog; + struct sk_buff BPF_PROG_TYPE_CGROUP_SKB_kern; + struct bpf_sock BPF_PROG_TYPE_CGROUP_SOCK_prog; + struct sock BPF_PROG_TYPE_CGROUP_SOCK_kern; + struct bpf_sock_addr BPF_PROG_TYPE_CGROUP_SOCK_ADDR_prog; + struct bpf_sock_addr_kern BPF_PROG_TYPE_CGROUP_SOCK_ADDR_kern; + struct __sk_buff BPF_PROG_TYPE_LWT_IN_prog; + struct sk_buff BPF_PROG_TYPE_LWT_IN_kern; + struct __sk_buff BPF_PROG_TYPE_LWT_OUT_prog; + struct sk_buff BPF_PROG_TYPE_LWT_OUT_kern; + struct __sk_buff BPF_PROG_TYPE_LWT_XMIT_prog; + struct sk_buff BPF_PROG_TYPE_LWT_XMIT_kern; + struct __sk_buff BPF_PROG_TYPE_LWT_SEG6LOCAL_prog; + struct sk_buff BPF_PROG_TYPE_LWT_SEG6LOCAL_kern; + struct bpf_sock_ops BPF_PROG_TYPE_SOCK_OPS_prog; + struct bpf_sock_ops_kern BPF_PROG_TYPE_SOCK_OPS_kern; + struct __sk_buff BPF_PROG_TYPE_SK_SKB_prog; + struct sk_buff BPF_PROG_TYPE_SK_SKB_kern; + struct sk_msg_md BPF_PROG_TYPE_SK_MSG_prog; + struct sk_msg BPF_PROG_TYPE_SK_MSG_kern; + struct __sk_buff BPF_PROG_TYPE_FLOW_DISSECTOR_prog; + struct bpf_flow_dissector BPF_PROG_TYPE_FLOW_DISSECTOR_kern; + bpf_user_pt_regs_t BPF_PROG_TYPE_KPROBE_prog; + struct pt_regs BPF_PROG_TYPE_KPROBE_kern; + __u64 BPF_PROG_TYPE_TRACEPOINT_prog; + u64 BPF_PROG_TYPE_TRACEPOINT_kern; + struct bpf_perf_event_data BPF_PROG_TYPE_PERF_EVENT_prog; + struct bpf_perf_event_data_kern BPF_PROG_TYPE_PERF_EVENT_kern; + struct bpf_raw_tracepoint_args BPF_PROG_TYPE_RAW_TRACEPOINT_prog; + u64 BPF_PROG_TYPE_RAW_TRACEPOINT_kern; + struct bpf_raw_tracepoint_args BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE_prog; + u64 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE_kern; + void *BPF_PROG_TYPE_TRACING_prog; + void *BPF_PROG_TYPE_TRACING_kern; + struct bpf_cgroup_dev_ctx BPF_PROG_TYPE_CGROUP_DEVICE_prog; + struct bpf_cgroup_dev_ctx BPF_PROG_TYPE_CGROUP_DEVICE_kern; + struct bpf_sysctl BPF_PROG_TYPE_CGROUP_SYSCTL_prog; + struct bpf_sysctl_kern BPF_PROG_TYPE_CGROUP_SYSCTL_kern; + struct bpf_sockopt BPF_PROG_TYPE_CGROUP_SOCKOPT_prog; + struct bpf_sockopt_kern BPF_PROG_TYPE_CGROUP_SOCKOPT_kern; + struct sk_reuseport_md BPF_PROG_TYPE_SK_REUSEPORT_prog; + struct sk_reuseport_kern BPF_PROG_TYPE_SK_REUSEPORT_kern; +}; + +enum { + __ctx_convertBPF_PROG_TYPE_SOCKET_FILTER = 0, + __ctx_convertBPF_PROG_TYPE_SCHED_CLS = 1, + __ctx_convertBPF_PROG_TYPE_SCHED_ACT = 2, + __ctx_convertBPF_PROG_TYPE_XDP = 3, + __ctx_convertBPF_PROG_TYPE_CGROUP_SKB = 4, + __ctx_convertBPF_PROG_TYPE_CGROUP_SOCK = 5, + __ctx_convertBPF_PROG_TYPE_CGROUP_SOCK_ADDR = 6, + __ctx_convertBPF_PROG_TYPE_LWT_IN = 7, + __ctx_convertBPF_PROG_TYPE_LWT_OUT = 8, + __ctx_convertBPF_PROG_TYPE_LWT_XMIT = 9, + __ctx_convertBPF_PROG_TYPE_LWT_SEG6LOCAL = 10, + __ctx_convertBPF_PROG_TYPE_SOCK_OPS = 11, + __ctx_convertBPF_PROG_TYPE_SK_SKB = 12, + __ctx_convertBPF_PROG_TYPE_SK_MSG = 13, + __ctx_convertBPF_PROG_TYPE_FLOW_DISSECTOR = 14, + __ctx_convertBPF_PROG_TYPE_KPROBE = 15, + __ctx_convertBPF_PROG_TYPE_TRACEPOINT = 16, + __ctx_convertBPF_PROG_TYPE_PERF_EVENT = 17, + __ctx_convertBPF_PROG_TYPE_RAW_TRACEPOINT = 18, + __ctx_convertBPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE = 19, + __ctx_convertBPF_PROG_TYPE_TRACING = 20, + __ctx_convertBPF_PROG_TYPE_CGROUP_DEVICE = 21, + __ctx_convertBPF_PROG_TYPE_CGROUP_SYSCTL = 22, + __ctx_convertBPF_PROG_TYPE_CGROUP_SOCKOPT = 23, + __ctx_convertBPF_PROG_TYPE_SK_REUSEPORT = 24, + __ctx_convert_unused = 25, +}; -struct trace_event_data_offsets_cpu_frequency_limits {}; +enum net_device_flags { + IFF_UP = 1, + IFF_BROADCAST = 2, + IFF_DEBUG = 4, + IFF_LOOPBACK = 8, + IFF_POINTOPOINT = 16, + IFF_NOTRAILERS = 32, + IFF_RUNNING = 64, + IFF_NOARP = 128, + IFF_PROMISC = 256, + IFF_ALLMULTI = 512, + IFF_MASTER = 1024, + IFF_SLAVE = 2048, + IFF_MULTICAST = 4096, + IFF_PORTSEL = 8192, + IFF_AUTOMEDIA = 16384, + IFF_DYNAMIC = 32768, + IFF_LOWER_UP = 65536, + IFF_DORMANT = 131072, + IFF_ECHO = 262144, +}; -struct trace_event_data_offsets_device_pm_callback_start { - u32 device; - u32 driver; - u32 parent; - u32 pm_ops; +enum netdev_cmd { + NETDEV_UP = 1, + NETDEV_DOWN = 2, + NETDEV_REBOOT = 3, + NETDEV_CHANGE = 4, + NETDEV_REGISTER = 5, + NETDEV_UNREGISTER = 6, + NETDEV_CHANGEMTU = 7, + NETDEV_CHANGEADDR = 8, + NETDEV_PRE_CHANGEADDR = 9, + NETDEV_GOING_DOWN = 10, + NETDEV_CHANGENAME = 11, + NETDEV_FEAT_CHANGE = 12, + NETDEV_BONDING_FAILOVER = 13, + NETDEV_PRE_UP = 14, + NETDEV_PRE_TYPE_CHANGE = 15, + NETDEV_POST_TYPE_CHANGE = 16, + NETDEV_POST_INIT = 17, + NETDEV_RELEASE = 18, + NETDEV_NOTIFY_PEERS = 19, + NETDEV_JOIN = 20, + NETDEV_CHANGEUPPER = 21, + NETDEV_RESEND_IGMP = 22, + NETDEV_PRECHANGEMTU = 23, + NETDEV_CHANGEINFODATA = 24, + NETDEV_BONDING_INFO = 25, + NETDEV_PRECHANGEUPPER = 26, + NETDEV_CHANGELOWERSTATE = 27, + NETDEV_UDP_TUNNEL_PUSH_INFO = 28, + NETDEV_UDP_TUNNEL_DROP_INFO = 29, + NETDEV_CHANGE_TX_QUEUE_LEN = 30, + NETDEV_CVLAN_FILTER_PUSH_INFO = 31, + NETDEV_CVLAN_FILTER_DROP_INFO = 32, + NETDEV_SVLAN_FILTER_PUSH_INFO = 33, + NETDEV_SVLAN_FILTER_DROP_INFO = 34, }; -struct trace_event_data_offsets_device_pm_callback_end { - u32 device; - u32 driver; +struct netdev_notifier_info { + struct net_device *dev; + struct netlink_ext_ack *extack; }; -struct trace_event_data_offsets_suspend_resume {}; +struct bpf_dtab_netdev; -struct trace_event_data_offsets_wakeup_source { - u32 name; +struct xdp_bulk_queue { + struct xdp_frame *q[16]; + struct list_head flush_node; + struct net_device *dev_rx; + struct bpf_dtab_netdev *obj; + unsigned int count; }; -struct trace_event_data_offsets_clock { - u32 name; +struct bpf_dtab; + +struct bpf_dtab_netdev { + struct net_device *dev; + struct hlist_node index_hlist; + struct bpf_dtab *dtab; + struct xdp_bulk_queue *bulkq; + struct callback_head rcu; + unsigned int idx; }; -struct trace_event_data_offsets_power_domain { - u32 name; +struct bpf_dtab { + struct bpf_map map; + struct bpf_dtab_netdev **netdev_map; + struct list_head *flush_list; + struct list_head list; + struct hlist_head *dev_index_head; + spinlock_t index_lock; + unsigned int items; + u32 n_buckets; + long: 32; + long: 64; }; -struct trace_event_data_offsets_pm_qos_request {}; +typedef struct bio_vec skb_frag_t; -struct trace_event_data_offsets_pm_qos_update_request_timeout {}; +struct skb_shared_hwtstamps { + ktime_t hwtstamp; +}; -struct trace_event_data_offsets_pm_qos_update {}; +struct skb_shared_info { + __u8 __unused; + __u8 meta_len; + __u8 nr_frags; + __u8 tx_flags; + short unsigned int gso_size; + short unsigned int gso_segs; + struct sk_buff *frag_list; + struct skb_shared_hwtstamps hwtstamps; + unsigned int gso_type; + u32 tskey; + atomic_t dataref; + void *destructor_arg; + skb_frag_t frags[17]; +}; -struct trace_event_data_offsets_dev_pm_qos_request { - u32 name; +struct ptr_ring { + int producer; + spinlock_t producer_lock; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + int consumer_head; + int consumer_tail; + spinlock_t consumer_lock; + long: 32; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + int size; + int batch; + void **queue; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct trace_event_raw_rpm_internal { - struct trace_entry ent; - u32 __data_loc_name; - int flags; - int usage_count; - int disable_depth; - int runtime_auto; - int request_pending; - int irq_safe; - int child_count; - char __data[0]; +struct bpf_cpu_map_entry; + +struct xdp_bulk_queue___2 { + void *q[8]; + struct list_head flush_node; + struct bpf_cpu_map_entry *obj; + unsigned int count; }; -struct trace_event_raw_rpm_return_int { - struct trace_entry ent; - u32 __data_loc_name; - long unsigned int ip; - int ret; - char __data[0]; +struct bpf_cpu_map; + +struct bpf_cpu_map_entry { + u32 cpu; + int map_id; + u32 qsize; + struct xdp_bulk_queue___2 *bulkq; + struct bpf_cpu_map *cmap; + struct ptr_ring *queue; + struct task_struct *kthread; + struct work_struct kthread_stop_wq; + atomic_t refcnt; + struct callback_head rcu; }; -struct trace_event_data_offsets_rpm_internal { - u32 name; +struct bpf_cpu_map { + struct bpf_map map; + struct bpf_cpu_map_entry **cpu_map; + struct list_head *flush_list; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct trace_event_data_offsets_rpm_return_int { - u32 name; +struct xsk_queue; + +struct xdp_umem_page; + +struct xdp_umem_fq_reuse; + +struct xdp_umem { + struct xsk_queue *fq; + struct xsk_queue *cq; + struct xdp_umem_page *pages; + u64 chunk_mask; + u64 size; + u32 headroom; + u32 chunk_size_nohr; + struct user_struct *user; + long unsigned int address; + refcount_t users; + struct work_struct work; + struct page **pgs; + u32 npgs; + u16 queue_id; + u8 need_wakeup; + u8 flags; + int id; + struct net_device *dev; + struct xdp_umem_fq_reuse *fq_reuse; + bool zc; + spinlock_t xsk_list_lock; + struct list_head xsk_list; }; -struct trace_probe_log { - const char *subsystem; - const char **argv; - int argc; - int index; +struct xdp_umem_page { + void *addr; + dma_addr_t dma; }; -enum uprobe_filter_ctx { - UPROBE_FILTER_REGISTER = 0, - UPROBE_FILTER_UNREGISTER = 1, - UPROBE_FILTER_MMAP = 2, +struct xdp_umem_fq_reuse { + u32 nentries; + u32 length; + u64 handles[0]; }; -struct uprobe_consumer { - int (*handler)(struct uprobe_consumer *, struct pt_regs *); - int (*ret_handler)(struct uprobe_consumer *, long unsigned int, struct pt_regs *); - bool (*filter)(struct uprobe_consumer *, enum uprobe_filter_ctx, struct mm_struct *); - struct uprobe_consumer *next; +struct xdp_sock; + +struct xsk_map { + struct bpf_map map; + struct list_head *flush_list; + spinlock_t lock; + struct xdp_sock *xsk_map[0]; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct uprobe_trace_entry_head { - struct trace_entry ent; - long unsigned int vaddr[0]; +struct xdp_sock { + struct sock sk; + struct xsk_queue *rx; + struct net_device *dev; + struct xdp_umem *umem; + struct list_head flush_node; + u16 queue_id; + bool zc; + enum { + XSK_READY = 0, + XSK_BOUND = 1, + XSK_UNBOUND = 2, + } state; + struct mutex mutex; + struct xsk_queue *tx; + struct list_head list; + spinlock_t tx_completion_lock; + spinlock_t rx_lock; + u64 rx_dropped; + struct list_head map_list; + spinlock_t map_list_lock; }; -struct trace_uprobe { - struct dyn_event devent; - struct uprobe_consumer consumer; - struct path path; - struct inode *inode; - char *filename; - long unsigned int offset; - long unsigned int ref_ctr_offset; - long unsigned int nhit; - struct trace_probe tp; +struct xsk_map_node { + struct list_head node; + struct xsk_map *map; + struct xdp_sock **map_entry; }; -struct uprobe_dispatch_data { - struct trace_uprobe *tu; - long unsigned int bp_addr; +struct bpf_prog_offload_ops { + int (*insn_hook)(struct bpf_verifier_env *, int, int); + int (*finalize)(struct bpf_verifier_env *); + int (*replace_insn)(struct bpf_verifier_env *, u32, struct bpf_insn *); + int (*remove_insns)(struct bpf_verifier_env *, u32, u32); + int (*prepare)(struct bpf_prog *); + int (*translate)(struct bpf_prog *); + void (*destroy)(struct bpf_prog *); }; -struct uprobe_cpu_buffer { - struct mutex mutex; - void *buf; +struct bpf_offload_dev { + const struct bpf_prog_offload_ops *ops; + struct list_head netdevs; + void *priv; }; -typedef bool (*filter_func_t)(struct uprobe_consumer *, enum uprobe_filter_ctx, struct mm_struct *); +struct rhlist_head { + struct rhash_head rhead; + struct rhlist_head *next; +}; -typedef __u32 __le32; +struct bpf_offload_netdev { + struct rhash_head l; + struct net_device *netdev; + struct bpf_offload_dev *offdev; + struct list_head progs; + struct list_head maps; + struct list_head offdev_netdevs; +}; -typedef __u64 __le64; +struct ns_get_path_bpf_prog_args { + struct bpf_prog *prog; + struct bpf_prog_info *info; +}; + +struct ns_get_path_bpf_map_args { + struct bpf_offloaded_map *offmap; + struct bpf_map_info *info; +}; + +enum bpf_stack_build_id_status { + BPF_STACK_BUILD_ID_EMPTY = 0, + BPF_STACK_BUILD_ID_VALID = 1, + BPF_STACK_BUILD_ID_IP = 2, +}; + +struct bpf_stack_build_id { + __s32 status; + unsigned char build_id[20]; + union { + __u64 offset; + __u64 ip; + }; +}; enum { - BPF_REG_0 = 0, - BPF_REG_1 = 1, - BPF_REG_2 = 2, - BPF_REG_3 = 3, - BPF_REG_4 = 4, - BPF_REG_5 = 5, - BPF_REG_6 = 6, - BPF_REG_7 = 7, - BPF_REG_8 = 8, - BPF_REG_9 = 9, - BPF_REG_10 = 10, - __MAX_BPF_REG = 11, + BPF_F_SKIP_FIELD_MASK = 255, + BPF_F_USER_STACK = 256, + BPF_F_FAST_STACK_CMP = 512, + BPF_F_REUSE_STACKID = 1024, + BPF_F_USER_BUILD_ID = 2048, }; -enum xdp_action { - XDP_ABORTED = 0, - XDP_DROP = 1, - XDP_PASS = 2, - XDP_TX = 3, - XDP_REDIRECT = 4, +typedef __u32 Elf32_Addr; + +typedef __u16 Elf32_Half; + +typedef __u32 Elf32_Off; + +struct elf32_hdr { + unsigned char e_ident[16]; + Elf32_Half e_type; + Elf32_Half e_machine; + Elf32_Word e_version; + Elf32_Addr e_entry; + Elf32_Off e_phoff; + Elf32_Off e_shoff; + Elf32_Word e_flags; + Elf32_Half e_ehsize; + Elf32_Half e_phentsize; + Elf32_Half e_phnum; + Elf32_Half e_shentsize; + Elf32_Half e_shnum; + Elf32_Half e_shstrndx; }; -enum bpf_arg_type { - ARG_DONTCARE = 0, - ARG_CONST_MAP_PTR = 1, - ARG_PTR_TO_MAP_KEY = 2, - ARG_PTR_TO_MAP_VALUE = 3, - ARG_PTR_TO_UNINIT_MAP_VALUE = 4, - ARG_PTR_TO_MAP_VALUE_OR_NULL = 5, - ARG_PTR_TO_MEM = 6, - ARG_PTR_TO_MEM_OR_NULL = 7, - ARG_PTR_TO_UNINIT_MEM = 8, - ARG_CONST_SIZE = 9, - ARG_CONST_SIZE_OR_ZERO = 10, - ARG_PTR_TO_CTX = 11, - ARG_ANYTHING = 12, - ARG_PTR_TO_SPIN_LOCK = 13, - ARG_PTR_TO_SOCK_COMMON = 14, - ARG_PTR_TO_INT = 15, - ARG_PTR_TO_LONG = 16, - ARG_PTR_TO_SOCKET = 17, - ARG_PTR_TO_BTF_ID = 18, -}; +typedef struct elf32_hdr Elf32_Ehdr; -enum bpf_return_type { - RET_INTEGER = 0, - RET_VOID = 1, - RET_PTR_TO_MAP_VALUE = 2, - RET_PTR_TO_MAP_VALUE_OR_NULL = 3, - RET_PTR_TO_SOCKET_OR_NULL = 4, - RET_PTR_TO_TCP_SOCK_OR_NULL = 5, - RET_PTR_TO_SOCK_COMMON_OR_NULL = 6, +struct elf32_phdr { + Elf32_Word p_type; + Elf32_Off p_offset; + Elf32_Addr p_vaddr; + Elf32_Addr p_paddr; + Elf32_Word p_filesz; + Elf32_Word p_memsz; + Elf32_Word p_flags; + Elf32_Word p_align; }; -struct bpf_func_proto { - u64 (*func)(u64, u64, u64, u64, u64); - bool gpl_only; - bool pkt_access; - enum bpf_return_type ret_type; - union { - struct { - enum bpf_arg_type arg1_type; - enum bpf_arg_type arg2_type; - enum bpf_arg_type arg3_type; - enum bpf_arg_type arg4_type; - enum bpf_arg_type arg5_type; - }; - enum bpf_arg_type arg_type[5]; - }; - int *btf_id; +typedef struct elf32_phdr Elf32_Phdr; + +struct elf64_phdr { + Elf64_Word p_type; + Elf64_Word p_flags; + Elf64_Off p_offset; + Elf64_Addr p_vaddr; + Elf64_Addr p_paddr; + Elf64_Xword p_filesz; + Elf64_Xword p_memsz; + Elf64_Xword p_align; }; -struct bpf_array_aux { - enum bpf_prog_type type; - bool jited; - struct list_head poke_progs; - struct bpf_map *map; - struct mutex poke_mutex; - struct work_struct work; +typedef struct elf64_phdr Elf64_Phdr; + +typedef struct elf32_note Elf32_Nhdr; + +struct stack_map_bucket { + struct pcpu_freelist_node fnode; + u32 hash; + u32 nr; + u64 data[0]; }; -struct bpf_array { +struct bpf_stack_map { struct bpf_map map; - u32 elem_size; - u32 index_mask; - struct bpf_array_aux *aux; - union { - char value[0]; - void *ptrs[0]; - void *pptrs[0]; - }; - long: 64; + void *elems; + struct pcpu_freelist freelist; + u32 n_buckets; + struct stack_map_bucket *buckets[0]; long: 64; long: 64; long: 64; @@ -30990,163 +35913,451 @@ struct bpf_array { long: 64; }; -typedef long unsigned int (*bpf_ctx_copy_t)(void *, const void *, long unsigned int, long unsigned int); +struct stack_map_irq_work { + struct irq_work irq_work; + struct rw_semaphore *sem; +}; -enum bpf_text_poke_type { - BPF_MOD_CALL = 0, - BPF_MOD_JUMP = 1, +typedef u64 (*btf_bpf_get_stackid)(struct pt_regs *, struct bpf_map *, u64); + +typedef u64 (*btf_bpf_get_stack)(struct pt_regs *, void *, u32, u64); + +enum { + BPF_F_SYSCTL_BASE_NAME = 1, }; -enum xdp_mem_type { - MEM_TYPE_PAGE_SHARED = 0, - MEM_TYPE_PAGE_ORDER0 = 1, - MEM_TYPE_PAGE_POOL = 2, - MEM_TYPE_ZERO_COPY = 3, - MEM_TYPE_MAX = 4, +struct bpf_prog_list { + struct list_head node; + struct bpf_prog *prog; + struct bpf_cgroup_storage *storage[2]; }; -struct zero_copy_allocator { - void (*free)(struct zero_copy_allocator *, long unsigned int); +struct qdisc_skb_cb { + struct { + unsigned int pkt_len; + u16 slave_dev_queue_mapping; + u16 tc_classid; + }; + unsigned char data[20]; }; -struct bpf_prog_dummy { - struct bpf_prog prog; +struct bpf_skb_data_end { + struct qdisc_skb_cb qdisc_cb; + void *data_meta; + void *data_end; }; -typedef u64 (*btf_bpf_user_rnd_u32)(); +enum { + TCPF_ESTABLISHED = 2, + TCPF_SYN_SENT = 4, + TCPF_SYN_RECV = 8, + TCPF_FIN_WAIT1 = 16, + TCPF_FIN_WAIT2 = 32, + TCPF_TIME_WAIT = 64, + TCPF_CLOSE = 128, + TCPF_CLOSE_WAIT = 256, + TCPF_LAST_ACK = 512, + TCPF_LISTEN = 1024, + TCPF_CLOSING = 2048, + TCPF_NEW_SYN_RECV = 4096, +}; -struct page_pool; +typedef u64 (*btf_bpf_sysctl_get_name)(struct bpf_sysctl_kern *, char *, size_t, u64); -struct xdp_mem_allocator { - struct xdp_mem_info mem; - union { - void *allocator; - struct page_pool *page_pool; - struct zero_copy_allocator *zc_alloc; - }; - struct rhash_head node; - struct callback_head rcu; +typedef u64 (*btf_bpf_sysctl_get_current_value)(struct bpf_sysctl_kern *, char *, size_t); + +typedef u64 (*btf_bpf_sysctl_get_new_value)(struct bpf_sysctl_kern *, char *, size_t); + +typedef u64 (*btf_bpf_sysctl_set_new_value)(struct bpf_sysctl_kern *, const char *, size_t); + +enum sock_type { + SOCK_STREAM = 1, + SOCK_DGRAM = 2, + SOCK_RAW = 3, + SOCK_RDM = 4, + SOCK_SEQPACKET = 5, + SOCK_DCCP = 6, + SOCK_PACKET = 10, }; -struct trace_event_raw_xdp_exception { - struct trace_entry ent; - int prog_id; - u32 act; - int ifindex; - char __data[0]; +enum { + IPPROTO_IP = 0, + IPPROTO_ICMP = 1, + IPPROTO_IGMP = 2, + IPPROTO_IPIP = 4, + IPPROTO_TCP = 6, + IPPROTO_EGP = 8, + IPPROTO_PUP = 12, + IPPROTO_UDP = 17, + IPPROTO_IDP = 22, + IPPROTO_TP = 29, + IPPROTO_DCCP = 33, + IPPROTO_IPV6 = 41, + IPPROTO_RSVP = 46, + IPPROTO_GRE = 47, + IPPROTO_ESP = 50, + IPPROTO_AH = 51, + IPPROTO_MTP = 92, + IPPROTO_BEETPH = 94, + IPPROTO_ENCAP = 98, + IPPROTO_PIM = 103, + IPPROTO_COMP = 108, + IPPROTO_SCTP = 132, + IPPROTO_UDPLITE = 136, + IPPROTO_MPLS = 137, + IPPROTO_RAW = 255, + IPPROTO_MAX = 256, }; -struct trace_event_raw_xdp_bulk_tx { - struct trace_entry ent; - int ifindex; - u32 act; - int drops; - int sent; - int err; - char __data[0]; +enum sock_flags { + SOCK_DEAD = 0, + SOCK_DONE = 1, + SOCK_URGINLINE = 2, + SOCK_KEEPOPEN = 3, + SOCK_LINGER = 4, + SOCK_DESTROY = 5, + SOCK_BROADCAST = 6, + SOCK_TIMESTAMP = 7, + SOCK_ZAPPED = 8, + SOCK_USE_WRITE_QUEUE = 9, + SOCK_DBG = 10, + SOCK_RCVTSTAMP = 11, + SOCK_RCVTSTAMPNS = 12, + SOCK_LOCALROUTE = 13, + SOCK_QUEUE_SHRUNK = 14, + SOCK_MEMALLOC = 15, + SOCK_TIMESTAMPING_RX_SOFTWARE = 16, + SOCK_FASYNC = 17, + SOCK_RXQ_OVFL = 18, + SOCK_ZEROCOPY = 19, + SOCK_WIFI_STATUS = 20, + SOCK_NOFCS = 21, + SOCK_FILTER_LOCKED = 22, + SOCK_SELECT_ERR_QUEUE = 23, + SOCK_RCU_FREE = 24, + SOCK_TXTIME = 25, + SOCK_XDP = 26, + SOCK_TSTAMP_NEW = 27, }; -struct trace_event_raw_xdp_redirect_template { - struct trace_entry ent; - int prog_id; - u32 act; - int ifindex; - int err; - int to_ifindex; - u32 map_id; - int map_index; - char __data[0]; +struct reuseport_array { + struct bpf_map map; + struct sock *ptrs[0]; }; -struct trace_event_raw_xdp_cpumap_kthread { - struct trace_entry ent; - int map_id; - u32 act; - int cpu; - unsigned int drops; - unsigned int processed; - int sched; - char __data[0]; +struct super_block___2; + +struct module___2; + +struct file_system_type___3 { + const char *name; + int fs_flags; + int (*init_fs_context)(struct fs_context *); + const struct fs_parameter_description *parameters; + struct dentry___2 * (*mount)(struct file_system_type___3 *, int, const char *, void *); + void (*kill_sb)(struct super_block___2 *); + struct module___2 *owner; + struct file_system_type___3 *next; + struct hlist_head fs_supers; + struct lock_class_key s_lock_key; + struct lock_class_key s_umount_key; + struct lock_class_key s_vfs_rename_key; + struct lock_class_key s_writers_key[3]; + struct lock_class_key i_lock_key; + struct lock_class_key i_mutex_key; + struct lock_class_key i_mutex_dir_key; }; -struct trace_event_raw_xdp_cpumap_enqueue { - struct trace_entry ent; - int map_id; - u32 act; - int cpu; - unsigned int drops; - unsigned int processed; - int to_cpu; - char __data[0]; +struct file___2; + +struct kiocb___2; + +struct iov_iter___2; + +struct poll_table_struct___2; + +struct vm_area_struct___2; + +struct file_lock___2; + +struct page___2; + +struct pipe_inode_info___2; + +struct file_operations___2 { + struct module___2 *owner; + loff_t (*llseek)(struct file___2 *, loff_t, int); + ssize_t (*read)(struct file___2 *, char *, size_t, loff_t *); + ssize_t (*write)(struct file___2 *, const char *, size_t, loff_t *); + ssize_t (*read_iter)(struct kiocb___2 *, struct iov_iter___2 *); + ssize_t (*write_iter)(struct kiocb___2 *, struct iov_iter___2 *); + int (*iopoll)(struct kiocb___2 *, bool); + int (*iterate)(struct file___2 *, struct dir_context *); + int (*iterate_shared)(struct file___2 *, struct dir_context *); + __poll_t (*poll)(struct file___2 *, struct poll_table_struct___2 *); + long int (*unlocked_ioctl)(struct file___2 *, unsigned int, long unsigned int); + long int (*compat_ioctl)(struct file___2 *, unsigned int, long unsigned int); + int (*mmap)(struct file___2 *, struct vm_area_struct___2 *); + long unsigned int mmap_supported_flags; + int (*open)(struct inode___2 *, struct file___2 *); + int (*flush)(struct file___2 *, fl_owner_t); + int (*release)(struct inode___2 *, struct file___2 *); + int (*fsync)(struct file___2 *, loff_t, loff_t, int); + int (*fasync)(int, struct file___2 *, int); + int (*lock)(struct file___2 *, int, struct file_lock___2 *); + ssize_t (*sendpage)(struct file___2 *, struct page___2 *, int, size_t, loff_t *, int); + long unsigned int (*get_unmapped_area)(struct file___2 *, long unsigned int, long unsigned int, long unsigned int, long unsigned int); + int (*check_flags)(int); + int (*flock)(struct file___2 *, int, struct file_lock___2 *); + ssize_t (*splice_write)(struct pipe_inode_info___2 *, struct file___2 *, loff_t *, size_t, unsigned int); + ssize_t (*splice_read)(struct file___2 *, loff_t *, struct pipe_inode_info___2 *, size_t, unsigned int); + int (*setlease)(struct file___2 *, long int, struct file_lock___2 **, void **); + long int (*fallocate)(struct file___2 *, int, loff_t, loff_t); + void (*show_fdinfo)(struct seq_file___2 *, struct file___2 *); + ssize_t (*copy_file_range)(struct file___2 *, loff_t, struct file___2 *, loff_t, size_t, unsigned int); + loff_t (*remap_file_range)(struct file___2 *, loff_t, struct file___2 *, loff_t, loff_t, unsigned int); + int (*fadvise)(struct file___2 *, loff_t, loff_t, int); }; -struct trace_event_raw_xdp_devmap_xmit { - struct trace_entry ent; - int map_id; - u32 act; - u32 map_index; - int drops; - int sent; - int from_ifindex; - int to_ifindex; - int err; - char __data[0]; +struct vmacache___2 { + u64 seqnum; + struct vm_area_struct___2 *vmas[4]; }; -struct trace_event_raw_mem_disconnect { - struct trace_entry ent; - const struct xdp_mem_allocator *xa; - u32 mem_id; - u32 mem_type; - const void *allocator; - char __data[0]; +struct page_frag___2 { + struct page___2 *page; + __u32 offset; + __u32 size; }; -struct trace_event_raw_mem_connect { - struct trace_entry ent; - const struct xdp_mem_allocator *xa; - u32 mem_id; - u32 mem_type; - const void *allocator; - const struct xdp_rxq_info *rxq; - int ifindex; - char __data[0]; +struct perf_event___2; + +struct thread_struct___2 { + struct desc_struct tls_array[3]; + long unsigned int sp; + short unsigned int es; + short unsigned int ds; + short unsigned int fsindex; + short unsigned int gsindex; + long unsigned int fsbase; + long unsigned int gsbase; + struct perf_event___2 *ptrace_bps[4]; + long unsigned int debugreg6; + long unsigned int ptrace_dr7; + long unsigned int cr2; + long unsigned int trap_nr; + long unsigned int error_code; + struct io_bitmap *io_bitmap; + long unsigned int iopl_emul; + mm_segment_t addr_limit; + unsigned int sig_on_uaccess_err: 1; + unsigned int uaccess_err: 1; + long: 62; + long: 64; + long: 64; + long: 64; + long: 64; + struct fpu fpu; }; -struct trace_event_raw_mem_return_failed { - struct trace_entry ent; - const struct page *page; - u32 mem_id; - u32 mem_type; - char __data[0]; +struct mm_struct___2; + +struct pid___2; + +struct cred___2; + +struct nsproxy___2; + +struct signal_struct___2; + +struct css_set___2; + +struct perf_event_context___2; + +struct vm_struct___2; + +struct task_struct___2 { + struct thread_info thread_info; + volatile long int state; + void *stack; + refcount_t usage; + unsigned int flags; + unsigned int ptrace; + struct llist_node wake_entry; + int on_cpu; + unsigned int cpu; + unsigned int wakee_flips; + long unsigned int wakee_flip_decay_ts; + struct task_struct___2 *last_wakee; + int recent_used_cpu; + int wake_cpu; + int on_rq; + int prio; + int static_prio; + int normal_prio; + unsigned int rt_priority; + const struct sched_class *sched_class; + struct sched_entity se; + struct sched_rt_entity rt; + struct task_group *sched_task_group; + struct sched_dl_entity dl; + unsigned int btrace_seq; + unsigned int policy; + int nr_cpus_allowed; + const cpumask_t *cpus_ptr; + cpumask_t cpus_mask; + struct sched_info sched_info; + struct list_head tasks; + struct plist_node pushable_tasks; + struct rb_node pushable_dl_tasks; + struct mm_struct___2 *mm; + struct mm_struct___2 *active_mm; + struct vmacache___2 vmacache; + struct task_rss_stat rss_stat; + int exit_state; + int exit_code; + int exit_signal; + int pdeath_signal; + long unsigned int jobctl; + unsigned int personality; + unsigned int sched_reset_on_fork: 1; + unsigned int sched_contributes_to_load: 1; + unsigned int sched_migrated: 1; + unsigned int sched_remote_wakeup: 1; + int: 28; + unsigned int in_execve: 1; + unsigned int in_iowait: 1; + unsigned int restore_sigmask: 1; + unsigned int no_cgroup_migration: 1; + unsigned int frozen: 1; + long unsigned int atomic_flags; + struct restart_block restart_block; + pid_t pid; + pid_t tgid; + long unsigned int stack_canary; + struct task_struct___2 *real_parent; + struct task_struct___2 *parent; + struct list_head children; + struct list_head sibling; + struct task_struct___2 *group_leader; + struct list_head ptraced; + struct list_head ptrace_entry; + struct pid___2 *thread_pid; + struct hlist_node pid_links[4]; + struct list_head thread_group; + struct list_head thread_node; + struct completion *vfork_done; + int *set_child_tid; + int *clear_child_tid; + u64 utime; + u64 stime; + u64 gtime; + struct prev_cputime prev_cputime; + long unsigned int nvcsw; + long unsigned int nivcsw; + u64 start_time; + u64 start_boottime; + long unsigned int min_flt; + long unsigned int maj_flt; + struct posix_cputimers posix_cputimers; + const struct cred___2 *ptracer_cred; + const struct cred___2 *real_cred; + const struct cred___2 *cred; + struct key *cached_requested_key; + char comm[16]; + struct nameidata *nameidata; + struct sysv_sem sysvsem; + struct sysv_shm sysvshm; + struct fs_struct *fs; + struct files_struct *files; + struct nsproxy___2 *nsproxy; + struct signal_struct___2 *signal; + struct sighand_struct *sighand; + sigset_t blocked; + sigset_t real_blocked; + sigset_t saved_sigmask; + struct sigpending pending; + long unsigned int sas_ss_sp; + size_t sas_ss_size; + unsigned int sas_ss_flags; + struct callback_head *task_works; + struct audit_context *audit_context; + kuid_t loginuid; + unsigned int sessionid; + struct seccomp seccomp; + u32 parent_exec_id; + u32 self_exec_id; + spinlock_t alloc_lock; + raw_spinlock_t pi_lock; + struct wake_q_node wake_q; + struct rb_root_cached pi_waiters; + struct task_struct___2 *pi_top_task; + struct rt_mutex_waiter *pi_blocked_on; + void *journal_info; + struct bio_list *bio_list; + struct blk_plug *plug; + struct reclaim_state *reclaim_state; + struct backing_dev_info *backing_dev_info; + struct io_context *io_context; + struct capture_control *capture_control; + long unsigned int ptrace_message; + kernel_siginfo_t *last_siginfo; + struct task_io_accounting ioac; + u64 acct_rss_mem1; + u64 acct_vm_mem1; + u64 acct_timexpd; + nodemask_t mems_allowed; + seqcount_t mems_allowed_seq; + int cpuset_mem_spread_rotor; + int cpuset_slab_spread_rotor; + struct css_set___2 *cgroups; + struct list_head cg_list; + struct robust_list_head *robust_list; + struct compat_robust_list_head *compat_robust_list; + struct list_head pi_state_list; + struct futex_pi_state *pi_state_cache; + struct mutex futex_exit_mutex; + unsigned int futex_state; + struct perf_event_context___2 *perf_event_ctxp[2]; + struct mutex perf_event_mutex; + struct list_head perf_event_list; + struct mempolicy *mempolicy; + short int il_prev; + short int pref_node_fork; + struct rseq *rseq; + u32 rseq_sig; + long unsigned int rseq_event_mask; + struct tlbflush_unmap_batch tlb_ubc; + union { + refcount_t rcu_users; + struct callback_head rcu; + }; + struct pipe_inode_info___2 *splice_pipe; + struct page_frag___2 task_frag; + struct task_delay_info *delays; + int nr_dirtied; + int nr_dirtied_pause; + long unsigned int dirty_paused_when; + u64 timer_slack_ns; + u64 default_timer_slack_ns; + long unsigned int trace; + long unsigned int trace_recursion; + struct uprobe_task *utask; + int pagefault_disabled; + struct task_struct___2 *oom_reaper_list; + struct vm_struct___2 *stack_vm_area; + refcount_t stack_refcount; + void *security; + long: 64; + long: 64; + long: 64; + struct thread_struct___2 thread; }; -struct trace_event_data_offsets_xdp_exception {}; - -struct trace_event_data_offsets_xdp_bulk_tx {}; - -struct trace_event_data_offsets_xdp_redirect_template {}; - -struct trace_event_data_offsets_xdp_cpumap_kthread {}; - -struct trace_event_data_offsets_xdp_cpumap_enqueue {}; - -struct trace_event_data_offsets_xdp_devmap_xmit {}; - -struct trace_event_data_offsets_mem_disconnect {}; - -struct trace_event_data_offsets_mem_connect {}; - -struct trace_event_data_offsets_mem_return_failed {}; - -struct page___2; - typedef struct page___2 *pgtable_t___2; struct address_space___2; -struct mm_struct___2; - struct dev_pagemap___2; struct page___2 { @@ -31219,38 +36430,6 @@ struct page___2 { long: 64; }; -struct perf_event___2; - -struct thread_struct___2 { - struct desc_struct tls_array[3]; - long unsigned int sp; - short unsigned int es; - short unsigned int ds; - short unsigned int fsindex; - short unsigned int gsindex; - long unsigned int fsbase; - long unsigned int gsbase; - struct perf_event___2 *ptrace_bps[4]; - long unsigned int debugreg6; - long unsigned int ptrace_dr7; - long unsigned int cr2; - long unsigned int trap_nr; - long unsigned int error_code; - struct io_bitmap *io_bitmap; - long unsigned int iopl_emul; - mm_segment_t addr_limit; - unsigned int sig_on_uaccess_err: 1; - unsigned int uaccess_err: 1; - long: 62; - long: 64; - long: 64; - long: 64; - long: 64; - struct fpu fpu; -}; - -struct task_struct___2; - struct hw_perf_event___2 { union { struct { @@ -31305,14 +36484,14 @@ typedef void (*perf_overflow_handler_t___2)(struct perf_event___2 *, struct perf struct pmu___2; -struct perf_event_context___2; - struct ring_buffer___2; struct fasync_struct___2; struct pid_namespace___2; +struct bpf_prog___2; + struct trace_event_call___2; struct perf_event___2 { @@ -31378,6 +36557,8 @@ struct perf_event___2 { u64 (*clock)(); perf_overflow_handler_t___2 overflow_handler; void *overflow_handler_context; + perf_overflow_handler_t___2 orig_overflow_handler; + struct bpf_prog___2 *prog; struct trace_event_call___2 *tp_event; struct event_filter *filter; void *security; @@ -31434,10 +36615,6 @@ struct address_space___2 { struct inode_operations___2; -struct file_operations___2; - -struct pipe_inode_info___2; - struct block_device___2; struct inode___2 { @@ -31570,8 +36747,6 @@ struct sb_writers___2 { struct percpu_rw_semaphore___2 rw_sem[3]; }; -struct file_system_type___2; - struct super_operations___2; struct dquot_operations___2; @@ -31586,7 +36761,7 @@ struct super_block___2 { unsigned char s_blocksize_bits; long unsigned int s_blocksize; loff_t s_maxbytes; - struct file_system_type___2 *s_type; + struct file_system_type___3 *s_type; const struct super_operations___2 *s_op; const struct dquot_operations___2 *dq_op; const struct quotactl_ops___2 *s_qcop; @@ -31662,382 +36837,6 @@ struct path___2 { struct dentry___2 *dentry; }; -struct vm_area_struct___2; - -struct vmacache___2 { - u64 seqnum; - struct vm_area_struct___2 *vmas[4]; -}; - -struct vm_operations_struct___2; - -struct file___2; - -struct vm_area_struct___2 { - long unsigned int vm_start; - long unsigned int vm_end; - struct vm_area_struct___2 *vm_next; - struct vm_area_struct___2 *vm_prev; - struct rb_node vm_rb; - long unsigned int rb_subtree_gap; - struct mm_struct___2 *vm_mm; - pgprot_t vm_page_prot; - long unsigned int vm_flags; - struct { - struct rb_node rb; - long unsigned int rb_subtree_last; - } shared; - struct list_head anon_vma_chain; - struct anon_vma *anon_vma; - const struct vm_operations_struct___2 *vm_ops; - long unsigned int vm_pgoff; - struct file___2 *vm_file; - void *vm_private_data; - atomic_long_t swap_readahead_info; - struct mempolicy *vm_policy; - struct vm_userfaultfd_ctx vm_userfaultfd_ctx; -}; - -struct page_frag___2 { - struct page___2 *page; - __u32 offset; - __u32 size; -}; - -struct core_state___2; - -struct mm_struct___2 { - struct { - struct vm_area_struct___2 *mmap; - struct rb_root mm_rb; - u64 vmacache_seqnum; - long unsigned int (*get_unmapped_area)(struct file___2 *, long unsigned int, long unsigned int, long unsigned int, long unsigned int); - long unsigned int mmap_base; - long unsigned int mmap_legacy_base; - long unsigned int mmap_compat_base; - long unsigned int mmap_compat_legacy_base; - long unsigned int task_size; - long unsigned int highest_vm_end; - pgd_t *pgd; - atomic_t membarrier_state; - atomic_t mm_users; - atomic_t mm_count; - atomic_long_t pgtables_bytes; - int map_count; - spinlock_t page_table_lock; - struct rw_semaphore mmap_sem; - struct list_head mmlist; - long unsigned int hiwater_rss; - long unsigned int hiwater_vm; - long unsigned int total_vm; - long unsigned int locked_vm; - atomic64_t pinned_vm; - long unsigned int data_vm; - long unsigned int exec_vm; - long unsigned int stack_vm; - long unsigned int def_flags; - spinlock_t arg_lock; - long unsigned int start_code; - long unsigned int end_code; - long unsigned int start_data; - long unsigned int end_data; - long unsigned int start_brk; - long unsigned int brk; - long unsigned int start_stack; - long unsigned int arg_start; - long unsigned int arg_end; - long unsigned int env_start; - long unsigned int env_end; - long unsigned int saved_auxv[46]; - struct mm_rss_stat rss_stat; - struct linux_binfmt *binfmt; - mm_context_t context; - long unsigned int flags; - struct core_state___2 *core_state; - spinlock_t ioctx_lock; - struct kioctx_table *ioctx_table; - struct user_namespace___2 *user_ns; - struct file___2 *exe_file; - struct mmu_notifier_mm *mmu_notifier_mm; - atomic_t tlb_flush_pending; - bool tlb_flush_batched; - struct uprobes_state uprobes_state; - atomic_long_t hugetlb_usage; - struct work_struct async_put_work; - }; - long unsigned int cpu_bitmap[0]; -}; - -struct pid___2; - -struct cred___2; - -struct nsproxy___2; - -struct signal_struct___2; - -struct css_set___2; - -struct vm_struct___2; - -struct task_struct___2 { - struct thread_info thread_info; - volatile long int state; - void *stack; - refcount_t usage; - unsigned int flags; - unsigned int ptrace; - struct llist_node wake_entry; - int on_cpu; - unsigned int cpu; - unsigned int wakee_flips; - long unsigned int wakee_flip_decay_ts; - struct task_struct___2 *last_wakee; - int recent_used_cpu; - int wake_cpu; - int on_rq; - int prio; - int static_prio; - int normal_prio; - unsigned int rt_priority; - const struct sched_class *sched_class; - struct sched_entity se; - struct sched_rt_entity rt; - struct task_group *sched_task_group; - struct sched_dl_entity dl; - unsigned int btrace_seq; - unsigned int policy; - int nr_cpus_allowed; - const cpumask_t *cpus_ptr; - cpumask_t cpus_mask; - struct sched_info sched_info; - struct list_head tasks; - struct plist_node pushable_tasks; - struct rb_node pushable_dl_tasks; - struct mm_struct___2 *mm; - struct mm_struct___2 *active_mm; - struct vmacache___2 vmacache; - struct task_rss_stat rss_stat; - int exit_state; - int exit_code; - int exit_signal; - int pdeath_signal; - long unsigned int jobctl; - unsigned int personality; - unsigned int sched_reset_on_fork: 1; - unsigned int sched_contributes_to_load: 1; - unsigned int sched_migrated: 1; - unsigned int sched_remote_wakeup: 1; - int: 28; - unsigned int in_execve: 1; - unsigned int in_iowait: 1; - unsigned int restore_sigmask: 1; - unsigned int no_cgroup_migration: 1; - unsigned int frozen: 1; - long unsigned int atomic_flags; - struct restart_block restart_block; - pid_t pid; - pid_t tgid; - long unsigned int stack_canary; - struct task_struct___2 *real_parent; - struct task_struct___2 *parent; - struct list_head children; - struct list_head sibling; - struct task_struct___2 *group_leader; - struct list_head ptraced; - struct list_head ptrace_entry; - struct pid___2 *thread_pid; - struct hlist_node pid_links[4]; - struct list_head thread_group; - struct list_head thread_node; - struct completion *vfork_done; - int *set_child_tid; - int *clear_child_tid; - u64 utime; - u64 stime; - u64 gtime; - struct prev_cputime prev_cputime; - long unsigned int nvcsw; - long unsigned int nivcsw; - u64 start_time; - u64 start_boottime; - long unsigned int min_flt; - long unsigned int maj_flt; - struct posix_cputimers posix_cputimers; - const struct cred___2 *ptracer_cred; - const struct cred___2 *real_cred; - const struct cred___2 *cred; - struct key *cached_requested_key; - char comm[16]; - struct nameidata *nameidata; - struct sysv_sem sysvsem; - struct sysv_shm sysvshm; - struct fs_struct *fs; - struct files_struct *files; - struct nsproxy___2 *nsproxy; - struct signal_struct___2 *signal; - struct sighand_struct *sighand; - sigset_t blocked; - sigset_t real_blocked; - sigset_t saved_sigmask; - struct sigpending pending; - long unsigned int sas_ss_sp; - size_t sas_ss_size; - unsigned int sas_ss_flags; - struct callback_head *task_works; - struct audit_context *audit_context; - kuid_t loginuid; - unsigned int sessionid; - struct seccomp seccomp; - u32 parent_exec_id; - u32 self_exec_id; - spinlock_t alloc_lock; - raw_spinlock_t pi_lock; - struct wake_q_node wake_q; - struct rb_root_cached pi_waiters; - struct task_struct___2 *pi_top_task; - struct rt_mutex_waiter *pi_blocked_on; - void *journal_info; - struct bio_list *bio_list; - struct blk_plug *plug; - struct reclaim_state *reclaim_state; - struct backing_dev_info *backing_dev_info; - struct io_context *io_context; - struct capture_control *capture_control; - long unsigned int ptrace_message; - kernel_siginfo_t *last_siginfo; - struct task_io_accounting ioac; - u64 acct_rss_mem1; - u64 acct_vm_mem1; - u64 acct_timexpd; - nodemask_t mems_allowed; - seqcount_t mems_allowed_seq; - int cpuset_mem_spread_rotor; - int cpuset_slab_spread_rotor; - struct css_set___2 *cgroups; - struct list_head cg_list; - struct robust_list_head *robust_list; - struct compat_robust_list_head *compat_robust_list; - struct list_head pi_state_list; - struct futex_pi_state *pi_state_cache; - struct mutex futex_exit_mutex; - unsigned int futex_state; - struct perf_event_context___2 *perf_event_ctxp[2]; - struct mutex perf_event_mutex; - struct list_head perf_event_list; - struct mempolicy *mempolicy; - short int il_prev; - short int pref_node_fork; - struct rseq *rseq; - u32 rseq_sig; - long unsigned int rseq_event_mask; - struct tlbflush_unmap_batch tlb_ubc; - union { - refcount_t rcu_users; - struct callback_head rcu; - }; - struct pipe_inode_info___2 *splice_pipe; - struct page_frag___2 task_frag; - struct task_delay_info *delays; - int nr_dirtied; - int nr_dirtied_pause; - long unsigned int dirty_paused_when; - u64 timer_slack_ns; - u64 default_timer_slack_ns; - long unsigned int trace; - long unsigned int trace_recursion; - struct uprobe_task *utask; - int pagefault_disabled; - struct task_struct___2 *oom_reaper_list; - struct vm_struct___2 *stack_vm_area; - refcount_t stack_refcount; - void *security; - long: 64; - long: 64; - long: 64; - struct thread_struct___2 thread; -}; - -struct dev_pagemap_ops___2; - -struct dev_pagemap___2 { - struct vmem_altmap altmap; - struct resource res; - struct percpu_ref *ref; - struct percpu_ref internal_ref; - struct completion done; - enum memory_type type; - unsigned int flags; - const struct dev_pagemap_ops___2 *ops; -}; - -struct fown_struct___2 { - rwlock_t lock; - struct pid___2 *pid; - enum pid_type pid_type; - kuid_t uid; - kuid_t euid; - int signum; -}; - -struct file___2 { - union { - struct llist_node fu_llist; - struct callback_head fu_rcuhead; - } f_u; - struct path___2 f_path; - struct inode___2 *f_inode; - const struct file_operations___2 *f_op; - spinlock_t f_lock; - enum rw_hint f_write_hint; - atomic_long_t f_count; - unsigned int f_flags; - fmode_t f_mode; - struct mutex f_pos_lock; - loff_t f_pos; - struct fown_struct___2 f_owner; - const struct cred___2 *f_cred; - struct file_ra_state f_ra; - u64 f_version; - void *f_security; - void *private_data; - struct list_head f_ep_links; - struct list_head f_tfile_llink; - struct address_space___2 *f_mapping; - errseq_t f_wb_err; -}; - -struct vm_fault___2; - -struct vm_operations_struct___2 { - void (*open)(struct vm_area_struct___2 *); - void (*close)(struct vm_area_struct___2 *); - int (*split)(struct vm_area_struct___2 *, long unsigned int); - int (*mremap)(struct vm_area_struct___2 *); - vm_fault_t (*fault)(struct vm_fault___2 *); - vm_fault_t (*huge_fault)(struct vm_fault___2 *, enum page_entry_size); - void (*map_pages)(struct vm_fault___2 *, long unsigned int, long unsigned int); - long unsigned int (*pagesize)(struct vm_area_struct___2 *); - vm_fault_t (*page_mkwrite)(struct vm_fault___2 *); - vm_fault_t (*pfn_mkwrite)(struct vm_fault___2 *); - int (*access)(struct vm_area_struct___2 *, long unsigned int, void *, int, int); - const char * (*name)(struct vm_area_struct___2 *); - int (*set_policy)(struct vm_area_struct___2 *, struct mempolicy *); - struct mempolicy * (*get_policy)(struct vm_area_struct___2 *, long unsigned int); - struct page___2 * (*find_special_page)(struct vm_area_struct___2 *, long unsigned int); -}; - -struct core_thread___2 { - struct task_struct___2 *task; - struct core_thread___2 *next; -}; - -struct core_state___2 { - atomic_t nr_threads; - struct core_thread___2 dumper; - struct completion startup; -}; - struct proc_ns_operations___2; struct ns_common___2 { @@ -32069,6 +36868,177 @@ struct user_namespace___2 { int ucount_max[9]; }; +struct vm_operations_struct___2; + +struct vm_area_struct___2 { + long unsigned int vm_start; + long unsigned int vm_end; + struct vm_area_struct___2 *vm_next; + struct vm_area_struct___2 *vm_prev; + struct rb_node vm_rb; + long unsigned int rb_subtree_gap; + struct mm_struct___2 *vm_mm; + pgprot_t vm_page_prot; + long unsigned int vm_flags; + struct { + struct rb_node rb; + long unsigned int rb_subtree_last; + } shared; + struct list_head anon_vma_chain; + struct anon_vma *anon_vma; + const struct vm_operations_struct___2 *vm_ops; + long unsigned int vm_pgoff; + struct file___2 *vm_file; + void *vm_private_data; + atomic_long_t swap_readahead_info; + struct mempolicy *vm_policy; + struct vm_userfaultfd_ctx vm_userfaultfd_ctx; +}; + +struct core_state___2; + +struct mm_struct___2 { + struct { + struct vm_area_struct___2 *mmap; + struct rb_root mm_rb; + u64 vmacache_seqnum; + long unsigned int (*get_unmapped_area)(struct file___2 *, long unsigned int, long unsigned int, long unsigned int, long unsigned int); + long unsigned int mmap_base; + long unsigned int mmap_legacy_base; + long unsigned int mmap_compat_base; + long unsigned int mmap_compat_legacy_base; + long unsigned int task_size; + long unsigned int highest_vm_end; + pgd_t *pgd; + atomic_t membarrier_state; + atomic_t mm_users; + atomic_t mm_count; + atomic_long_t pgtables_bytes; + int map_count; + spinlock_t page_table_lock; + struct rw_semaphore mmap_sem; + struct list_head mmlist; + long unsigned int hiwater_rss; + long unsigned int hiwater_vm; + long unsigned int total_vm; + long unsigned int locked_vm; + atomic64_t pinned_vm; + long unsigned int data_vm; + long unsigned int exec_vm; + long unsigned int stack_vm; + long unsigned int def_flags; + spinlock_t arg_lock; + long unsigned int start_code; + long unsigned int end_code; + long unsigned int start_data; + long unsigned int end_data; + long unsigned int start_brk; + long unsigned int brk; + long unsigned int start_stack; + long unsigned int arg_start; + long unsigned int arg_end; + long unsigned int env_start; + long unsigned int env_end; + long unsigned int saved_auxv[46]; + struct mm_rss_stat rss_stat; + struct linux_binfmt *binfmt; + mm_context_t context; + long unsigned int flags; + struct core_state___2 *core_state; + spinlock_t ioctx_lock; + struct kioctx_table *ioctx_table; + struct user_namespace___2 *user_ns; + struct file___2 *exe_file; + struct mmu_notifier_mm *mmu_notifier_mm; + atomic_t tlb_flush_pending; + bool tlb_flush_batched; + struct uprobes_state uprobes_state; + atomic_long_t hugetlb_usage; + struct work_struct async_put_work; + }; + long unsigned int cpu_bitmap[0]; +}; + +struct dev_pagemap_ops___2; + +struct dev_pagemap___2 { + struct vmem_altmap altmap; + struct resource res; + struct percpu_ref *ref; + struct percpu_ref internal_ref; + struct completion done; + enum memory_type type; + unsigned int flags; + const struct dev_pagemap_ops___2 *ops; +}; + +struct fown_struct___2 { + rwlock_t lock; + struct pid___2 *pid; + enum pid_type pid_type; + kuid_t uid; + kuid_t euid; + int signum; +}; + +struct file___2 { + union { + struct llist_node fu_llist; + struct callback_head fu_rcuhead; + } f_u; + struct path___2 f_path; + struct inode___2 *f_inode; + const struct file_operations___2 *f_op; + spinlock_t f_lock; + enum rw_hint f_write_hint; + atomic_long_t f_count; + unsigned int f_flags; + fmode_t f_mode; + struct mutex f_pos_lock; + loff_t f_pos; + struct fown_struct___2 f_owner; + const struct cred___2 *f_cred; + struct file_ra_state f_ra; + u64 f_version; + void *f_security; + void *private_data; + struct list_head f_ep_links; + struct list_head f_tfile_llink; + struct address_space___2 *f_mapping; + errseq_t f_wb_err; +}; + +struct vm_fault___2; + +struct vm_operations_struct___2 { + void (*open)(struct vm_area_struct___2 *); + void (*close)(struct vm_area_struct___2 *); + int (*split)(struct vm_area_struct___2 *, long unsigned int); + int (*mremap)(struct vm_area_struct___2 *); + vm_fault_t (*fault)(struct vm_fault___2 *); + vm_fault_t (*huge_fault)(struct vm_fault___2 *, enum page_entry_size); + void (*map_pages)(struct vm_fault___2 *, long unsigned int, long unsigned int); + long unsigned int (*pagesize)(struct vm_area_struct___2 *); + vm_fault_t (*page_mkwrite)(struct vm_fault___2 *); + vm_fault_t (*pfn_mkwrite)(struct vm_fault___2 *); + int (*access)(struct vm_area_struct___2 *, long unsigned int, void *, int, int); + const char * (*name)(struct vm_area_struct___2 *); + int (*set_policy)(struct vm_area_struct___2 *, struct mempolicy *); + struct mempolicy * (*get_policy)(struct vm_area_struct___2 *, long unsigned int); + struct page___2 * (*find_special_page)(struct vm_area_struct___2 *, long unsigned int); +}; + +struct core_thread___2 { + struct task_struct___2 *task; + struct core_thread___2 *next; +}; + +struct core_state___2 { + atomic_t nr_threads; + struct core_thread___2 dumper; + struct completion startup; +}; + struct vm_fault___2 { struct vm_area_struct___2 *vma; unsigned int flags; @@ -32628,6 +37598,11 @@ struct pipe_inode_info___2 { struct user_struct *user; }; +union thread_union___2 { + struct task_struct___2 task; + long unsigned int stack[2048]; +}; + struct kiocb___2 { struct file___2 *ki_filp; loff_t ki_pos; @@ -32666,8 +37641,6 @@ struct dquot___2 { struct mem_dqblk dq_dqb; }; -struct module___2; - struct quota_format_type___2 { int qf_fmt_id; const struct quota_format_ops___2 *qf_ops; @@ -32788,6 +37761,8 @@ struct module___2 { tracepoint_ptr_t *tracepoints_ptrs; unsigned int num_srcu_structs; struct srcu_struct **srcu_struct_ptrs; + unsigned int num_bpf_raw_events; + struct bpf_raw_event_map *bpf_raw_events; struct jump_entry *jump_entries; unsigned int num_jump_entries; unsigned int num_trace_bprintk_fmt; @@ -32802,10 +37777,15 @@ struct module___2 { atomic_t refcnt; struct error_injection_entry *ei_funcs; unsigned int num_ei_funcs; + long: 32; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct iov_iter___2; - struct address_space_operations___2 { int (*writepage)(struct page___2 *, struct writeback_control *); int (*readpage)(struct file___2 *, struct page___2 *); @@ -32877,47 +37857,6 @@ struct block_device___2 { struct mutex bd_fsfreeze_mutex; }; -struct poll_table_struct___2; - -struct file_lock___2; - -struct seq_file___2; - -struct file_operations___2 { - struct module___2 *owner; - loff_t (*llseek)(struct file___2 *, loff_t, int); - ssize_t (*read)(struct file___2 *, char *, size_t, loff_t *); - ssize_t (*write)(struct file___2 *, const char *, size_t, loff_t *); - ssize_t (*read_iter)(struct kiocb___2 *, struct iov_iter___2 *); - ssize_t (*write_iter)(struct kiocb___2 *, struct iov_iter___2 *); - int (*iopoll)(struct kiocb___2 *, bool); - int (*iterate)(struct file___2 *, struct dir_context *); - int (*iterate_shared)(struct file___2 *, struct dir_context *); - __poll_t (*poll)(struct file___2 *, struct poll_table_struct___2 *); - long int (*unlocked_ioctl)(struct file___2 *, unsigned int, long unsigned int); - long int (*compat_ioctl)(struct file___2 *, unsigned int, long unsigned int); - int (*mmap)(struct file___2 *, struct vm_area_struct___2 *); - long unsigned int mmap_supported_flags; - int (*open)(struct inode___2 *, struct file___2 *); - int (*flush)(struct file___2 *, fl_owner_t); - int (*release)(struct inode___2 *, struct file___2 *); - int (*fsync)(struct file___2 *, loff_t, loff_t, int); - int (*fasync)(int, struct file___2 *, int); - int (*lock)(struct file___2 *, int, struct file_lock___2 *); - ssize_t (*sendpage)(struct file___2 *, struct page___2 *, int, size_t, loff_t *, int); - long unsigned int (*get_unmapped_area)(struct file___2 *, long unsigned int, long unsigned int, long unsigned int, long unsigned int); - int (*check_flags)(int); - int (*flock)(struct file___2 *, int, struct file_lock___2 *); - ssize_t (*splice_write)(struct pipe_inode_info___2 *, struct file___2 *, loff_t *, size_t, unsigned int); - ssize_t (*splice_read)(struct file___2 *, loff_t *, struct pipe_inode_info___2 *, size_t, unsigned int); - int (*setlease)(struct file___2 *, long int, struct file_lock___2 **, void **); - long int (*fallocate)(struct file___2 *, int, loff_t, loff_t); - void (*show_fdinfo)(struct seq_file___2 *, struct file___2 *); - ssize_t (*copy_file_range)(struct file___2 *, loff_t, struct file___2 *, loff_t, size_t, unsigned int); - loff_t (*remap_file_range)(struct file___2 *, loff_t, struct file___2 *, loff_t, loff_t, unsigned int); - int (*fadvise)(struct file___2 *, loff_t, loff_t, int); -}; - struct inode_operations___2 { struct dentry___2 * (*lookup)(struct inode___2 *, struct dentry___2 *, unsigned int); const char * (*get_link)(struct dentry___2 *, struct inode___2 *, struct delayed_call *); @@ -33002,25 +37941,6 @@ struct fasync_struct___2 { struct callback_head fa_rcu; }; -struct file_system_type___2 { - const char *name; - int fs_flags; - int (*init_fs_context)(struct fs_context *); - const struct fs_parameter_description *parameters; - struct dentry___2 * (*mount)(struct file_system_type___2 *, int, const char *, void *); - void (*kill_sb)(struct super_block___2 *); - struct module___2 *owner; - struct file_system_type___2 *next; - struct hlist_head fs_supers; - struct lock_class_key s_lock_key; - struct lock_class_key s_umount_key; - struct lock_class_key s_vfs_rename_key; - struct lock_class_key s_writers_key[3]; - struct lock_class_key i_lock_key; - struct lock_class_key i_mutex_key; - struct lock_class_key i_mutex_dir_key; -}; - struct super_operations___2 { struct inode___2 * (*alloc_inode)(struct super_block___2 *); void (*destroy_inode)(struct inode___2 *); @@ -33057,8 +37977,6 @@ struct poll_table_struct___2 { __poll_t _key; }; -struct seq_operations___2; - struct seq_file___2 { char *buf; size_t size; @@ -33069,7 +37987,7 @@ struct seq_file___2 { loff_t read_pos; u64 version; struct mutex lock; - const struct seq_operations___2 *op; + const struct seq_operations *op; int poll_event; const struct file___2 *file; void *private; @@ -33082,6 +38000,12 @@ struct dev_pagemap_ops___2 { vm_fault_t (*migrate_to_ram)(struct vm_fault___2 *); }; +struct kobj_attribute___3 { + struct attribute attr; + ssize_t (*show)(struct kobject___2 *, struct kobj_attribute___3 *, char *); + ssize_t (*store)(struct kobject___2 *, struct kobj_attribute___3 *, const char *, size_t); +}; + typedef void compound_page_dtor___2(struct page___2 *); struct kernfs_root___2; @@ -33403,6 +38327,11 @@ struct device_node___2 { void *data; }; +struct node___3 { + struct device___2 dev; + struct list_head access_list; +}; + struct fd___2 { struct file___2 *file; unsigned int flags; @@ -33599,6 +38528,12 @@ struct netns_ipv6___2 { spinlock_t fib6_gc_lock; unsigned int ip6_rt_gc_expire; long unsigned int ip6_rt_last_gc; + unsigned int fib6_rules_require_fldissect; + bool fib6_has_custom_rules; + struct rt6_info *ip6_prohibit_entry; + struct rt6_info *ip6_blk_hole_entry; + struct fib6_table *fib6_local_tbl; + struct fib_rules_ops *fib6_rules_ops; struct sock **icmp_sk; struct sock *ndisc_sk; struct sock *tcp_sk; @@ -33616,6 +38551,9 @@ struct netns_ipv6___2 { u32 seq; } ip6addrlbl_table; long: 64; + long: 64; + long: 64; + long: 64; }; struct netns_nf_frag___2 { @@ -33661,8 +38599,6 @@ struct netns_xfrm___2 { long: 64; }; -struct bpf_prog___2; - struct net___2 { refcount_t passive; refcount_t count; @@ -33714,18 +38650,11 @@ struct net___2 { long: 64; long: 64; long: 64; - long: 64; - long: 64; - long: 64; struct netns_xfrm___2 xfrm; + struct netns_xdp xdp; struct sock *diag_nlsk; long: 64; long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; }; struct cgroup_namespace___2 { @@ -33755,13 +38684,6 @@ struct ucounts___2 { atomic_t ucount[9]; }; -struct seq_operations___2 { - void * (*start)(struct seq_file___2 *, loff_t *); - void (*stop)(struct seq_file___2 *, void *); - void * (*next)(struct seq_file___2 *, void *, loff_t *); - int (*show)(struct seq_file___2 *, void *); -}; - enum perf_event_read_format { PERF_FORMAT_TOTAL_TIME_ENABLED = 1, PERF_FORMAT_TOTAL_TIME_RUNNING = 2, @@ -33818,11 +38740,50 @@ enum perf_record_ksymbol_type { PERF_RECORD_KSYMBOL_TYPE_MAX = 2, }; -enum perf_bpf_event_type { - PERF_BPF_EVENT_UNKNOWN = 0, - PERF_BPF_EVENT_PROG_LOAD = 1, - PERF_BPF_EVENT_PROG_UNLOAD = 2, - PERF_BPF_EVENT_MAX = 3, +struct perf_cpu_context___2; + +struct perf_output_handle___2; + +struct pmu___2 { + struct list_head entry; + struct module___2 *module; + struct device___2 *dev; + const struct attribute_group___2 **attr_groups; + const struct attribute_group___2 **attr_update; + const char *name; + int type; + int capabilities; + int *pmu_disable_count; + struct perf_cpu_context___2 *pmu_cpu_context; + atomic_t exclusive_cnt; + int task_ctx_nr; + int hrtimer_interval_ms; + unsigned int nr_addr_filters; + void (*pmu_enable)(struct pmu___2 *); + void (*pmu_disable)(struct pmu___2 *); + int (*event_init)(struct perf_event___2 *); + void (*event_mapped)(struct perf_event___2 *, struct mm_struct___2 *); + void (*event_unmapped)(struct perf_event___2 *, struct mm_struct___2 *); + int (*add)(struct perf_event___2 *, int); + void (*del)(struct perf_event___2 *, int); + void (*start)(struct perf_event___2 *, int); + void (*stop)(struct perf_event___2 *, int); + void (*read)(struct perf_event___2 *); + void (*start_txn)(struct pmu___2 *, unsigned int); + int (*commit_txn)(struct pmu___2 *); + void (*cancel_txn)(struct pmu___2 *); + int (*event_idx)(struct perf_event___2 *); + void (*sched_task)(struct perf_event_context___2 *, bool); + size_t task_ctx_size; + void (*swap_task_ctx)(struct perf_event_context___2 *, struct perf_event_context___2 *); + void * (*setup_aux)(struct perf_event___2 *, void **, int, bool); + void (*free_aux)(void *); + long int (*snapshot_aux)(struct perf_event___2 *, struct perf_output_handle___2 *, long unsigned int); + int (*addr_filters_validate)(struct list_head *); + void (*addr_filters_sync)(struct perf_event___2 *); + int (*aux_output_match)(struct perf_event___2 *); + int (*filter_match)(struct perf_event___2 *); + int (*check_period)(struct perf_event___2 *, u64); }; struct kernel_param_ops___2 { @@ -34238,6 +39199,14 @@ struct bpf_prog_ops___2 { int (*test_run)(struct bpf_prog___2 *, const union bpf_attr *, union bpf_attr *); }; +struct bpf_verifier_ops___2 { + const struct bpf_func_proto * (*get_func_proto)(enum bpf_func_id, const struct bpf_prog___2 *); + bool (*is_valid_access)(int, int, enum bpf_access_type, const struct bpf_prog___2 *, struct bpf_insn_access_aux *); + int (*gen_prologue)(struct bpf_insn *, bool, const struct bpf_prog___2 *); + int (*gen_ld_abs)(const struct bpf_insn *, struct bpf_insn *); + u32 (*convert_ctx_access)(enum bpf_access_type, const struct bpf_insn *, struct bpf_insn *, struct bpf_prog___2 *, u32 *); +}; + struct bpf_prog_offload___2 { struct bpf_prog___2 *prog; struct net_device___2 *netdev; @@ -34388,6 +39357,15 @@ struct sk_buff___2 { struct skb_ext *extensions; }; +struct cgroup_bpf___2 { + struct bpf_prog_array___2 *effective[26]; + struct list_head progs[26]; + u32 flags[26]; + struct bpf_prog_array___2 *inactive; + struct percpu_ref refcnt; + struct work_struct release_work; +}; + struct cgroup_file___2 { struct kernfs_node___2 *kn; long unsigned int notified_at; @@ -34451,7 +39429,7 @@ struct cgroup___2 { wait_queue_head_t offline_waitq; struct work_struct release_agent_work; struct psi_group psi; - struct cgroup_bpf bpf; + struct cgroup_bpf___2 bpf; atomic_t congestion_count; struct cgroup_freezer_state freezer; u64 ancestor_ids[0]; @@ -34538,52 +39516,6 @@ struct cftype___2 { __poll_t (*poll)(struct kernfs_open_file___2 *, struct poll_table_struct___2 *); }; -struct perf_cpu_context___2; - -struct perf_output_handle___2; - -struct pmu___2 { - struct list_head entry; - struct module___2 *module; - struct device___2 *dev; - const struct attribute_group___2 **attr_groups; - const struct attribute_group___2 **attr_update; - const char *name; - int type; - int capabilities; - int *pmu_disable_count; - struct perf_cpu_context___2 *pmu_cpu_context; - atomic_t exclusive_cnt; - int task_ctx_nr; - int hrtimer_interval_ms; - unsigned int nr_addr_filters; - void (*pmu_enable)(struct pmu___2 *); - void (*pmu_disable)(struct pmu___2 *); - int (*event_init)(struct perf_event___2 *); - void (*event_mapped)(struct perf_event___2 *, struct mm_struct___2 *); - void (*event_unmapped)(struct perf_event___2 *, struct mm_struct___2 *); - int (*add)(struct perf_event___2 *, int); - void (*del)(struct perf_event___2 *, int); - void (*start)(struct perf_event___2 *, int); - void (*stop)(struct perf_event___2 *, int); - void (*read)(struct perf_event___2 *); - void (*start_txn)(struct pmu___2 *, unsigned int); - int (*commit_txn)(struct pmu___2 *); - void (*cancel_txn)(struct pmu___2 *); - int (*event_idx)(struct perf_event___2 *); - void (*sched_task)(struct perf_event_context___2 *, bool); - size_t task_ctx_size; - void (*swap_task_ctx)(struct perf_event_context___2 *, struct perf_event_context___2 *); - void * (*setup_aux)(struct perf_event___2 *, void **, int, bool); - void (*free_aux)(void *); - long int (*snapshot_aux)(struct perf_event___2 *, struct perf_output_handle___2 *, long unsigned int); - int (*addr_filters_validate)(struct list_head *); - void (*addr_filters_sync)(struct perf_event___2 *); - int (*aux_output_match)(struct perf_event___2 *); - int (*filter_match)(struct perf_event___2 *); - int (*check_period)(struct perf_event___2 *, u64); -}; - struct perf_cpu_context___2 { struct perf_event_context___2 ctx; struct perf_event_context___2 *task_ctx; @@ -34665,6 +39597,12 @@ struct ring_buffer___2 { void *data_pages[0]; }; +struct bpf_perf_event_data_kern___2 { + bpf_user_pt_regs_t *regs; + struct perf_sample_data *data; + struct perf_event___2 *event; +}; + struct perf_pmu_events_attr___2 { struct device_attribute___2 attr; u64 id; @@ -34835,6 +39773,16 @@ struct inet_frag_queue___2 { struct callback_head rcu; }; +struct pernet_operations___2 { + struct list_head list; + int (*init)(struct net___2 *); + void (*pre_exit)(struct net___2 *); + void (*exit)(struct net___2 *); + void (*exit_batch)(struct list_head *); + unsigned int *id; + size_t size; +}; + struct xdp_rxq_info___2 { struct net_device___2 *dev; u32 queue_index; @@ -34912,7 +39860,7 @@ struct netdev_queue___2 { long unsigned int tx_maxrate; long unsigned int trans_timeout; struct net_device___2 *sb_dev; - long: 64; + struct xdp_umem *umem; spinlock_t _xmit_lock; int xmit_lock_owner; long unsigned int trans_start; @@ -34982,6 +39930,14 @@ struct netdev_rx_queue___2 { long: 64; long: 64; struct xdp_rxq_info___2 xdp_rxq; + struct xdp_umem *umem; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; struct netdev_bpf___2 { @@ -35499,7 +40455,7 @@ enum perf_probe_config { }; enum { - IF_ACT_NONE = -1, + IF_ACT_NONE = 4294967295, IF_ACT_FILTER = 0, IF_ACT_START = 1, IF_ACT_STOP = 2, @@ -35529,13 +40485,13 @@ struct perf_aux_event___2 { }; enum perf_callchain_context { - PERF_CONTEXT_HV = -32, - PERF_CONTEXT_KERNEL = -128, - PERF_CONTEXT_USER = -512, - PERF_CONTEXT_GUEST = -2048, - PERF_CONTEXT_GUEST_KERNEL = -2176, - PERF_CONTEXT_GUEST_USER = -2560, - PERF_CONTEXT_MAX = -4095, + PERF_CONTEXT_HV = 4294967264, + PERF_CONTEXT_KERNEL = 4294967168, + PERF_CONTEXT_USER = 4294966784, + PERF_CONTEXT_GUEST = 4294965248, + PERF_CONTEXT_GUEST_KERNEL = 4294965120, + PERF_CONTEXT_GUEST_USER = 4294964736, + PERF_CONTEXT_MAX = 4294963201, }; struct callchain_cpus_entries { @@ -35585,6 +40541,8 @@ struct xol_area { long unsigned int vaddr; }; +typedef long unsigned int vm_flags_t; + struct compact_control; struct capture_control { @@ -35592,8 +40550,6 @@ struct capture_control { struct page___2 *page; }; -typedef int filler_t(void *, struct page___2 *); - struct page_vma_mapped_walk { struct page___2 *page; struct vm_area_struct___2 *vma; @@ -35674,13 +40630,9 @@ struct static_key_deferred { struct delayed_work work; }; -typedef void (*dr_release_t___2)(struct device___2 *, void *); - -typedef int (*dr_match_t___2)(struct device___2 *, void *, void *); - enum rseq_cpu_id_state { - RSEQ_CPU_ID_UNINITIALIZED = -1, - RSEQ_CPU_ID_REGISTRATION_FAILED = -2, + RSEQ_CPU_ID_UNINITIALIZED = 4294967295, + RSEQ_CPU_ID_REGISTRATION_FAILED = 4294967294, }; enum rseq_flags { @@ -35720,6 +40672,10 @@ struct trace_event_data_offsets_rseq_update {}; struct trace_event_data_offsets_rseq_ip_fixup {}; +typedef void (*btf_trace_rseq_update)(void *, struct task_struct___2 *); + +typedef void (*btf_trace_rseq_ip_fixup)(void *, long unsigned int, long unsigned int, long unsigned int, long unsigned int); + struct __key_reference_with_attributes; typedef struct __key_reference_with_attributes *key_ref_t; @@ -35779,9 +40735,11 @@ struct kernel_pkey_query { __u16 max_dec_size; }; +struct asymmetric_key_subtype; + struct pkcs7_message; -typedef struct pglist_data___2 pg_data_t___2; +typedef struct pglist_data___2 pg_data_t; struct xa_node { unsigned char shift; @@ -35863,6 +40821,8 @@ struct fid { }; }; +typedef void (*poll_queue_proc___3)(struct file___2 *, wait_queue_head_t *, struct poll_table_struct *); + struct trace_event_raw_mm_filemap_op_page_cache { struct trace_entry ent; long unsigned int pfn; @@ -35896,6 +40856,14 @@ struct trace_event_data_offsets_filemap_set_wb_err {}; struct trace_event_data_offsets_file_check_and_advance_wb_err {}; +typedef void (*btf_trace_mm_filemap_delete_from_page_cache)(void *, struct page___2 *); + +typedef void (*btf_trace_mm_filemap_add_to_page_cache)(void *, struct page___2 *); + +typedef void (*btf_trace_filemap_set_wb_err)(void *, struct address_space___2 *, errseq_t); + +typedef void (*btf_trace_file_check_and_advance_wb_err)(void *, struct file___2 *, errseq_t); + struct wait_page_key { struct page___2 *page; int bit_nr; @@ -35965,10 +40933,17 @@ struct kmem_cache_node { struct list_head full; }; -struct zap_details { - struct address_space___2 *check_mapping; - long unsigned int first_index; - long unsigned int last_index; +enum slab_state { + DOWN = 0, + PARTIAL = 1, + PARTIAL_NODE = 2, + UP = 3, + FULL = 4, +}; + +struct kmalloc_info_struct { + const char *name[3]; + unsigned int size; }; enum oom_constraint { @@ -36102,23 +41077,31 @@ struct trace_event_data_offsets_skip_task_reaping {}; struct trace_event_data_offsets_compact_retry {}; +typedef void (*btf_trace_oom_score_adj_update)(void *, struct task_struct___2 *); + +typedef void (*btf_trace_reclaim_retry_zone)(void *, struct zoneref___2 *, int, long unsigned int, long unsigned int, long unsigned int, int, bool); + +typedef void (*btf_trace_mark_victim)(void *, int); + +typedef void (*btf_trace_wake_reaper)(void *, int); + +typedef void (*btf_trace_start_task_reaping)(void *, int); + +typedef void (*btf_trace_finish_task_reaping)(void *, int); + +typedef void (*btf_trace_skip_task_reaping)(void *, int); + +typedef void (*btf_trace_compact_retry)(void *, int, enum compact_priority, enum compact_result, int, int, bool); + enum wb_congested_state { WB_async_congested = 0, WB_sync_congested = 1, }; -typedef void (*poll_queue_proc___3)(struct file___2 *, wait_queue_head_t *, struct poll_table_struct *); - enum { XA_CHECK_SCHED = 4096, }; -struct fprop_global { - struct percpu_counter events; - unsigned int period; - seqcount_t sequence; -}; - enum wb_state { WB_registered = 0, WB_writeback_running = 1, @@ -36136,15 +41119,6 @@ struct wb_lock_cookie { long unsigned int flags; }; -struct wb_domain { - spinlock_t lock; - struct fprop_global completions; - struct timer_list period_timer; - long unsigned int period_time; - long unsigned int dirty_limit_tstamp; - long unsigned int dirty_limit; -}; - typedef int (*writepage_t)(struct page___2 *, struct writeback_control *, void *); struct dirty_throttle_control { @@ -36180,6 +41154,10 @@ struct trace_event_data_offsets_mm_lru_insertion {}; struct trace_event_data_offsets_mm_lru_activate {}; +typedef void (*btf_trace_mm_lru_insertion)(void *, struct page___2 *, int); + +typedef void (*btf_trace_mm_lru_activate)(void *, struct page___2 *); + enum lruvec_flags { LRUVEC_CONGESTED = 0, }; @@ -36208,7 +41186,7 @@ enum mem_cgroup_protection { }; struct mem_cgroup_reclaim_cookie { - pg_data_t___2 *pgdat; + pg_data_t *pgdat; unsigned int generation; }; @@ -36383,6 +41361,34 @@ struct trace_event_data_offsets_mm_vmscan_inactive_list_is_low {}; struct trace_event_data_offsets_mm_vmscan_node_reclaim_begin {}; +typedef void (*btf_trace_mm_vmscan_kswapd_sleep)(void *, int); + +typedef void (*btf_trace_mm_vmscan_kswapd_wake)(void *, int, int, int); + +typedef void (*btf_trace_mm_vmscan_wakeup_kswapd)(void *, int, int, int, gfp_t); + +typedef void (*btf_trace_mm_vmscan_direct_reclaim_begin)(void *, int, gfp_t); + +typedef void (*btf_trace_mm_vmscan_direct_reclaim_end)(void *, long unsigned int); + +typedef void (*btf_trace_mm_shrink_slab_start)(void *, struct shrinker *, struct shrink_control *, long int, long unsigned int, long long unsigned int, long unsigned int, int); + +typedef void (*btf_trace_mm_shrink_slab_end)(void *, struct shrinker *, int, int, long int, long int, long int); + +typedef void (*btf_trace_mm_vmscan_lru_isolate)(void *, int, int, long unsigned int, long unsigned int, long unsigned int, long unsigned int, isolate_mode_t, int); + +typedef void (*btf_trace_mm_vmscan_writepage)(void *, struct page___2 *); + +typedef void (*btf_trace_mm_vmscan_lru_shrink_inactive)(void *, int, long unsigned int, long unsigned int, struct reclaim_stat *, int, int); + +typedef void (*btf_trace_mm_vmscan_lru_shrink_active)(void *, int, long unsigned int, long unsigned int, long unsigned int, long unsigned int, int, int); + +typedef void (*btf_trace_mm_vmscan_inactive_list_is_low)(void *, int, int, long unsigned int, long unsigned int, long unsigned int, long unsigned int, long unsigned int, int); + +typedef void (*btf_trace_mm_vmscan_node_reclaim_begin)(void *, int, int, gfp_t); + +typedef void (*btf_trace_mm_vmscan_node_reclaim_end)(void *, long unsigned int); + struct scan_control { long unsigned int nr_to_reclaim; nodemask_t *nodemask; @@ -36452,10 +41458,6 @@ struct shared_policy { rwlock_t lock; }; -struct xattr; - -typedef int (*initxattrs)(struct inode___2 *, const struct xattr *, void *); - struct xattr { const char *name; void *value; @@ -36503,7 +41505,7 @@ struct shmem_inode_info { struct shared_policy policy; struct simple_xattrs xattrs; atomic_t stop_eviction; - struct inode___2 vfs_inode; + struct inode vfs_inode; }; struct shmem_sb_info { @@ -36531,8 +41533,6 @@ enum sgp_type { SGP_FALLOC = 5, }; -typedef void (*poll_queue_proc___4)(struct file *, wait_queue_head_t *, struct poll_table_struct___2 *); - struct shmem_falloc { wait_queue_head_t *waitq; long unsigned int start; @@ -36582,6 +41582,8 @@ struct contig_page_info { long unsigned int free_blocks_suitable; }; +typedef s8 pto_T_____20; + enum mminit_level { MMINIT_WARNING = 0, MMINIT_VERIFY = 1, @@ -36606,6 +41608,14 @@ struct pcpu_alloc_info { struct pcpu_group_info groups[0]; }; +typedef void * (*pcpu_fc_alloc_fn_t)(unsigned int, size_t, size_t); + +typedef void (*pcpu_fc_free_fn_t)(void *, size_t); + +typedef void (*pcpu_fc_populate_pte_fn_t)(long unsigned int); + +typedef int pcpu_fc_cpu_distance_fn_t(unsigned int, unsigned int); + struct trace_event_raw_percpu_alloc_percpu { struct trace_entry ent; bool reserved; @@ -36657,6 +41667,16 @@ struct trace_event_data_offsets_percpu_create_chunk {}; struct trace_event_data_offsets_percpu_destroy_chunk {}; +typedef void (*btf_trace_percpu_alloc_percpu)(void *, bool, bool, size_t, size_t, void *, int, void *); + +typedef void (*btf_trace_percpu_free_percpu)(void *, void *, int, void *); + +typedef void (*btf_trace_percpu_alloc_percpu_fail)(void *, bool, bool, size_t, size_t); + +typedef void (*btf_trace_percpu_create_chunk)(void *, void *); + +typedef void (*btf_trace_percpu_destroy_chunk)(void *, void *); + struct pcpu_block_md { int scan_hint; int scan_hint_start; @@ -36792,18 +41812,31 @@ struct trace_event_data_offsets_mm_page_alloc_extfrag {}; struct trace_event_data_offsets_rss_stat {}; -enum slab_state { - DOWN = 0, - PARTIAL = 1, - PARTIAL_NODE = 2, - UP = 3, - FULL = 4, -}; +typedef void (*btf_trace_kmalloc)(void *, long unsigned int, const void *, size_t, size_t, gfp_t); -struct kmalloc_info_struct { - const char *name[3]; - unsigned int size; -}; +typedef void (*btf_trace_kmem_cache_alloc)(void *, long unsigned int, const void *, size_t, size_t, gfp_t); + +typedef void (*btf_trace_kmalloc_node)(void *, long unsigned int, const void *, size_t, size_t, gfp_t, int); + +typedef void (*btf_trace_kmem_cache_alloc_node)(void *, long unsigned int, const void *, size_t, size_t, gfp_t, int); + +typedef void (*btf_trace_kfree)(void *, long unsigned int, const void *); + +typedef void (*btf_trace_kmem_cache_free)(void *, long unsigned int, const void *); + +typedef void (*btf_trace_mm_page_free)(void *, struct page___2 *, unsigned int); + +typedef void (*btf_trace_mm_page_free_batched)(void *, struct page___2 *); + +typedef void (*btf_trace_mm_page_alloc)(void *, struct page___2 *, unsigned int, gfp_t, int); + +typedef void (*btf_trace_mm_page_alloc_zone_locked)(void *, struct page___2 *, unsigned int, int); + +typedef void (*btf_trace_mm_page_pcpu_drain)(void *, struct page___2 *, unsigned int, int); + +typedef void (*btf_trace_mm_page_alloc_extfrag)(void *, struct page___2 *, int, int, int, int); + +typedef void (*btf_trace_rss_stat)(void *, struct mm_struct___2 *, int, long int); struct slabinfo { long unsigned int active_objs; @@ -36818,15 +41851,6 @@ struct slabinfo { unsigned int cache_order; }; -struct node___2 { - struct device dev; - struct list_head access_list; -}; - -typedef struct page___2 *new_page_t(struct page___2 *, long unsigned int); - -typedef void free_page_t(struct page___2 *, long unsigned int); - struct alloc_context { struct zonelist___2 *zonelist; nodemask_t *nodemask; @@ -36933,6 +41957,34 @@ struct trace_event_data_offsets_mm_compaction_kcompactd_sleep {}; struct trace_event_data_offsets_kcompactd_wake_template {}; +typedef void (*btf_trace_mm_compaction_isolate_migratepages)(void *, long unsigned int, long unsigned int, long unsigned int, long unsigned int); + +typedef void (*btf_trace_mm_compaction_isolate_freepages)(void *, long unsigned int, long unsigned int, long unsigned int, long unsigned int); + +typedef void (*btf_trace_mm_compaction_migratepages)(void *, long unsigned int, int, struct list_head *); + +typedef void (*btf_trace_mm_compaction_begin)(void *, long unsigned int, long unsigned int, long unsigned int, long unsigned int, bool); + +typedef void (*btf_trace_mm_compaction_end)(void *, long unsigned int, long unsigned int, long unsigned int, long unsigned int, bool, int); + +typedef void (*btf_trace_mm_compaction_try_to_compact_pages)(void *, int, gfp_t, int); + +typedef void (*btf_trace_mm_compaction_finished)(void *, struct zone___2 *, int, int); + +typedef void (*btf_trace_mm_compaction_suitable)(void *, struct zone___2 *, int, int); + +typedef void (*btf_trace_mm_compaction_deferred)(void *, struct zone___2 *, int); + +typedef void (*btf_trace_mm_compaction_defer_compaction)(void *, struct zone___2 *, int); + +typedef void (*btf_trace_mm_compaction_defer_reset)(void *, struct zone___2 *, int); + +typedef void (*btf_trace_mm_compaction_kcompactd_sleep)(void *, int); + +typedef void (*btf_trace_mm_compaction_wakeup_kcompactd)(void *, int, int, enum zone_type); + +typedef void (*btf_trace_mm_compaction_kcompactd_wake)(void *, int, int, enum zone_type); + typedef enum { ISOLATE_ABORT = 0, ISOLATE_NONE = 1, @@ -36966,6 +42018,12 @@ struct follow_page_context { unsigned int page_mask; }; +struct zap_details { + struct address_space___2 *check_mapping; + long unsigned int first_index; + long unsigned int last_index; +}; + typedef int (*pte_fn_t)(pte_t *, long unsigned int, void *); enum { @@ -37017,6 +42075,8 @@ enum { HUGETLB_ANONHUGE_INODE = 2, }; +struct attribute_group___3; + struct rmap_walk_control { void *arg; bool (*rmap_one)(struct page___2 *, struct vm_area_struct___2 *, long unsigned int, void *); @@ -37074,6 +42134,8 @@ struct vmap_block { struct list_head purge; }; +typedef struct vmap_area *pto_T_____21; + struct page_frag_cache { void *va; __u16 offset; @@ -37173,8 +42235,6 @@ enum string_size_units { STRING_UNITS_2 = 1, }; -typedef void (*node_registration_func_t)(struct node___2 *); - struct resv_map { struct kref refs; spinlock_t lock; @@ -37405,6 +42465,10 @@ struct buffer_head { atomic_t b_count; }; +typedef struct page___2 *new_page_t(struct page___2 *, long unsigned int); + +typedef void free_page_t(struct page___2 *, long unsigned int); + enum bh_state_bits { BH_Uptodate = 0, BH_Dirty = 1, @@ -37437,6 +42501,8 @@ struct trace_event_raw_mm_migrate_pages { struct trace_event_data_offsets_mm_migrate_pages {}; +typedef void (*btf_trace_mm_migrate_pages)(void *, long unsigned int, long unsigned int, enum migrate_mode, int); + struct hugetlbfs_inode_info { struct shared_policy policy; struct inode___2 vfs_inode; @@ -37445,6 +42511,8 @@ struct hugetlbfs_inode_info { typedef s32 compat_off_t; +struct fs_context_operations___2; + struct open_flags { int open_flag; umode_t mode; @@ -37487,7 +42555,7 @@ enum vfs_get_super_keying { vfs_get_independent_super = 3, }; -typedef struct kobject___2 *kobj_probe_t(dev_t, int *, void *); +struct kobj_map; struct char_device_struct { struct char_device_struct *next; @@ -37498,8 +42566,6 @@ struct char_device_struct { struct cdev *cdev; }; -struct kobj_map; - struct stat { __kernel_ulong_t st_dev; __kernel_ulong_t st_ino; @@ -37622,7 +42688,7 @@ enum inode_i_mutex_lock_class { struct pseudo_fs_context { const struct super_operations *ops; const struct xattr_handler **xattr; - const struct dentry_operations___2 *dops; + const struct dentry_operations *dops; long unsigned int magic; }; @@ -37900,7 +42966,7 @@ struct poll_table_entry { struct poll_table_page; struct poll_wqueues { - poll_table___2 pt; + poll_table pt; struct poll_table_page *table; struct task_struct___2 *polling_task; int triggered; @@ -37915,36 +42981,6 @@ struct poll_table_page { struct poll_table_entry entries[0]; }; -struct ip_ra_chain { - struct ip_ra_chain *next; - struct sock *sk; - union { - void (*destructor)(struct sock *); - struct sock *saved_sk; - }; - struct callback_head rcu; -}; - -struct fib_table { - struct hlist_node tb_hlist; - u32 tb_id; - int tb_num_default; - struct callback_head rcu; - long unsigned int *tb_data; - long unsigned int __data[0]; -}; - -struct inet_peer_base { - struct rb_root rb_root; - seqlock_t lock; - int total; -}; - -struct dst_metrics { - u32 metrics[17]; - refcount_t refcnt; -}; - enum poll_time_type { PT_TIMEVAL = 0, PT_OLD_TIMEVAL = 1, @@ -38009,7 +43045,7 @@ struct select_data { struct list_head dispose; }; -typedef long int pao_T_____4; +typedef long int pao_T_____6; struct fsxattr { __u32 fsx_xflags; @@ -38030,7 +43066,7 @@ enum file_time_flags { struct proc_mounts { struct mnt_namespace *ns; struct path root; - int (*show)(struct seq_file *, struct vfsmount___2 *); + int (*show)(struct seq_file *, struct vfsmount *); void *cached_mount; u64 cached_event; loff_t cached_index; @@ -38042,12 +43078,6 @@ enum umount_tree_flags { UMOUNT_CONNECTED = 4, }; -struct tree_descr { - const char *name; - const struct file_operations *ops; - int mode; -}; - struct simple_transaction_argresp { ssize_t size; char data[0]; @@ -38070,7 +43100,7 @@ struct wb_completion { struct wb_writeback_work { long int nr_pages; - struct super_block___2 *sb; + struct super_block *sb; long unsigned int *older_than_this; enum writeback_sync_modes sync_mode; unsigned int tagged_writepages: 1; @@ -38288,6 +43318,66 @@ struct trace_event_data_offsets_writeback_single_inode_template {}; struct trace_event_data_offsets_writeback_inode_template {}; +typedef void (*btf_trace_writeback_dirty_page)(void *, struct page___2 *, struct address_space___2 *); + +typedef void (*btf_trace_wait_on_page_writeback)(void *, struct page___2 *, struct address_space___2 *); + +typedef void (*btf_trace_writeback_mark_inode_dirty)(void *, struct inode___2 *, int); + +typedef void (*btf_trace_writeback_dirty_inode_start)(void *, struct inode___2 *, int); + +typedef void (*btf_trace_writeback_dirty_inode)(void *, struct inode___2 *, int); + +typedef void (*btf_trace_writeback_write_inode_start)(void *, struct inode___2 *, struct writeback_control *); + +typedef void (*btf_trace_writeback_write_inode)(void *, struct inode___2 *, struct writeback_control *); + +typedef void (*btf_trace_writeback_queue)(void *, struct bdi_writeback *, struct wb_writeback_work *); + +typedef void (*btf_trace_writeback_exec)(void *, struct bdi_writeback *, struct wb_writeback_work *); + +typedef void (*btf_trace_writeback_start)(void *, struct bdi_writeback *, struct wb_writeback_work *); + +typedef void (*btf_trace_writeback_written)(void *, struct bdi_writeback *, struct wb_writeback_work *); + +typedef void (*btf_trace_writeback_wait)(void *, struct bdi_writeback *, struct wb_writeback_work *); + +typedef void (*btf_trace_writeback_pages_written)(void *, long int); + +typedef void (*btf_trace_writeback_wake_background)(void *, struct bdi_writeback *); + +typedef void (*btf_trace_writeback_bdi_register)(void *, struct backing_dev_info *); + +typedef void (*btf_trace_wbc_writepage)(void *, struct writeback_control *, struct backing_dev_info *); + +typedef void (*btf_trace_writeback_queue_io)(void *, struct bdi_writeback *, struct wb_writeback_work *, int); + +typedef void (*btf_trace_global_dirty_state)(void *, long unsigned int, long unsigned int); + +typedef void (*btf_trace_bdi_dirty_ratelimit)(void *, struct bdi_writeback *, long unsigned int, long unsigned int); + +typedef void (*btf_trace_balance_dirty_pages)(void *, struct bdi_writeback *, long unsigned int, long unsigned int, long unsigned int, long unsigned int, long unsigned int, long unsigned int, long unsigned int, long unsigned int, long unsigned int, long int, long unsigned int); + +typedef void (*btf_trace_writeback_sb_inodes_requeue)(void *, struct inode___2 *); + +typedef void (*btf_trace_writeback_congestion_wait)(void *, unsigned int, unsigned int); + +typedef void (*btf_trace_writeback_wait_iff_congested)(void *, unsigned int, unsigned int); + +typedef void (*btf_trace_writeback_single_inode_start)(void *, struct inode___2 *, struct writeback_control *, long unsigned int); + +typedef void (*btf_trace_writeback_single_inode)(void *, struct inode___2 *, struct writeback_control *, long unsigned int); + +typedef void (*btf_trace_writeback_lazytime)(void *, struct inode___2 *); + +typedef void (*btf_trace_writeback_lazytime_iput)(void *, struct inode___2 *); + +typedef void (*btf_trace_writeback_dirty_inode_enqueue)(void *, struct inode___2 *); + +typedef void (*btf_trace_sb_mark_inode_writeback)(void *, struct inode___2 *); + +typedef void (*btf_trace_sb_clear_inode_writeback)(void *, struct inode___2 *); + struct splice_desc { size_t total_len; unsigned int len; @@ -38454,6 +43544,11 @@ struct iomap_page_ops { void (*page_done)(struct inode___2 *, loff_t, unsigned int, struct page___2 *, struct iomap___2 *); }; +struct decrypt_bh_ctx { + struct work_struct work; + struct buffer_head *bh; +}; + struct bh_lru { struct buffer_head *bhs[16]; }; @@ -38463,6 +43558,8 @@ struct bh_accounting { int ratelimit; }; +typedef struct buffer_head *pto_T_____22; + enum { DISK_EVENT_MEDIA_CHANGE = 1, DISK_EVENT_EJECT_REQUEST = 2, @@ -38475,7 +43572,7 @@ enum { struct bdev_inode { struct block_device bdev; - struct inode___2 vfs_inode; + struct inode vfs_inode; }; struct blkdev_dio { @@ -38499,7 +43596,7 @@ struct bd_holder_disk { struct blk_integrity; -typedef int dio_iodone_t(struct kiocb___2 *, loff_t, ssize_t, void *); +typedef int dio_iodone_t(struct kiocb *, loff_t, ssize_t, void *); typedef void dio_submit_t(struct bio *, struct inode___2 *, loff_t); @@ -38524,12 +43621,12 @@ struct dio_submit { loff_t logical_offset_in_bio; sector_t final_block_in_bio; sector_t next_block_for_io; - struct page___2 *cur_page; + struct page *cur_page; unsigned int cur_page_offset; unsigned int cur_page_len; sector_t cur_page_block; loff_t cur_page_fs_offset; - struct iov_iter___2 *iter; + struct iov_iter *iter; unsigned int head; unsigned int tail; size_t from; @@ -38555,10 +43652,10 @@ struct dio { long unsigned int refcount; struct bio *bio_list; struct task_struct___2 *waiter; - struct kiocb___2 *iocb; + struct kiocb *iocb; ssize_t result; union { - struct page___2 *pages[64]; + struct page *pages[64]; struct work_struct complete_work; }; long: 64; @@ -38600,9 +43697,9 @@ struct proc_dir_entry { struct completion *pde_unload_completion; const struct inode_operations___2 *proc_iops; const struct file_operations___2 *proc_fops; - const struct dentry_operations___2 *proc_dops; + const struct dentry_operations *proc_dops; union { - const struct seq_operations___2 *seq_ops; + const struct seq_operations *seq_ops; int (*single_show)(struct seq_file___2 *, void *); }; proc_write_t write; @@ -38749,7 +43846,7 @@ struct eppoll_entry { }; struct ep_pqueue { - poll_table___2 pt; + poll_table pt; struct epitem *epi; }; @@ -38888,7 +43985,7 @@ struct kioctx { unsigned int nr_events; long unsigned int mmap_base; long unsigned int mmap_size; - struct page___2 **ring_pages; + struct page **ring_pages; long int nr_pages; struct rcu_work free_rwork; struct ctx_rq_wait *rq_wait; @@ -38930,7 +44027,7 @@ struct kioctx { long: 64; long: 64; }; - struct page___2 *internal_pages[8]; + struct page *internal_pages[8]; struct file *aio_ring_file; unsigned int id; long: 32; @@ -39016,45 +44113,6 @@ struct user_msghdr { unsigned int msg_flags; }; -enum sock_type { - SOCK_STREAM = 1, - SOCK_DGRAM = 2, - SOCK_RAW = 3, - SOCK_RDM = 4, - SOCK_SEQPACKET = 5, - SOCK_DCCP = 6, - SOCK_PACKET = 10, -}; - -enum { - IPPROTO_IP = 0, - IPPROTO_ICMP = 1, - IPPROTO_IGMP = 2, - IPPROTO_IPIP = 4, - IPPROTO_TCP = 6, - IPPROTO_EGP = 8, - IPPROTO_PUP = 12, - IPPROTO_UDP = 17, - IPPROTO_IDP = 22, - IPPROTO_TP = 29, - IPPROTO_DCCP = 33, - IPPROTO_IPV6 = 41, - IPPROTO_RSVP = 46, - IPPROTO_GRE = 47, - IPPROTO_ESP = 50, - IPPROTO_AH = 51, - IPPROTO_MTP = 92, - IPPROTO_BEETPH = 94, - IPPROTO_ENCAP = 98, - IPPROTO_PIM = 103, - IPPROTO_COMP = 108, - IPPROTO_SCTP = 132, - IPPROTO_UDPLITE = 136, - IPPROTO_MPLS = 137, - IPPROTO_RAW = 255, - IPPROTO_MAX = 256, -}; - struct scm_fp_list { short int count; short int max; @@ -39192,6 +44250,26 @@ struct trace_event_data_offsets_io_uring_complete {}; struct trace_event_data_offsets_io_uring_submit_sqe {}; +typedef void (*btf_trace_io_uring_create)(void *, int, void *, u32, u32, u32); + +typedef void (*btf_trace_io_uring_register)(void *, void *, unsigned int, unsigned int, unsigned int, bool, long int); + +typedef void (*btf_trace_io_uring_file_get)(void *, void *, int); + +typedef void (*btf_trace_io_uring_queue_async_work)(void *, void *, int, void *, struct io_wq_work *, unsigned int); + +typedef void (*btf_trace_io_uring_defer)(void *, void *, void *, long long unsigned int); + +typedef void (*btf_trace_io_uring_link)(void *, void *, void *, void *); + +typedef void (*btf_trace_io_uring_cqring_wait)(void *, void *, int); + +typedef void (*btf_trace_io_uring_fail_link)(void *, void *, void *); + +typedef void (*btf_trace_io_uring_complete)(void *, void *, u64, long int); + +typedef void (*btf_trace_io_uring_submit_sqe)(void *, void *, u64, bool, bool); + struct io_uring_sqe { __u8 opcode; __u8 flags; @@ -39317,8 +44395,6 @@ struct io_wq_data { put_work_fn *put_work; }; -typedef bool work_cancel_fn(struct io_wq_work *, void *); - struct io_uring { u32 head; long: 32; @@ -39361,7 +44437,7 @@ struct io_rings { struct io_mapped_ubuf { u64 ubuf; size_t len; - struct bio_vec___2 *bvec; + struct bio_vec *bvec; unsigned int nr_bvecs; }; @@ -39419,7 +44495,7 @@ struct io_ring_ctx { unsigned int cq_mask; atomic_t cq_timeouts; struct wait_queue_head cq_wait; - struct fasync_struct___2 *cq_fasync; + struct fasync_struct *cq_fasync; struct eventfd_ctx___2 *cq_ev_fd; long: 64; }; @@ -39441,7 +44517,7 @@ struct io_ring_ctx { }; struct io_rw { - struct kiocb___2 kiocb; + struct kiocb kiocb; u64 addr; u64 len; }; @@ -39580,7 +44656,7 @@ struct io_submit_state { }; struct io_poll_table { - struct poll_table_struct___2 pt; + struct poll_table_struct pt; struct io_kiocb *req; int error; }; @@ -39597,6 +44673,8 @@ struct io_wq_work_list { struct io_wq_work_node *last; }; +typedef bool work_cancel_fn(struct io_wq_work *, void *); + enum { IO_WORKER_F_UP = 1, IO_WORKER_F_RUNNING = 2, @@ -39770,6 +44848,30 @@ struct trace_event_data_offsets_generic_add_lease {}; struct trace_event_data_offsets_leases_conflict {}; +typedef void (*btf_trace_locks_get_lock_context)(void *, struct inode___2 *, int, struct file_lock_context *); + +typedef void (*btf_trace_posix_lock_inode)(void *, struct inode___2 *, struct file_lock *, int); + +typedef void (*btf_trace_fcntl_setlk)(void *, struct inode___2 *, struct file_lock *, int); + +typedef void (*btf_trace_locks_remove_posix)(void *, struct inode___2 *, struct file_lock *, int); + +typedef void (*btf_trace_flock_lock_inode)(void *, struct inode___2 *, struct file_lock *, int); + +typedef void (*btf_trace_break_lease_noblock)(void *, struct inode___2 *, struct file_lock *); + +typedef void (*btf_trace_break_lease_block)(void *, struct inode___2 *, struct file_lock *); + +typedef void (*btf_trace_break_lease_unblock)(void *, struct inode___2 *, struct file_lock *); + +typedef void (*btf_trace_generic_delete_lease)(void *, struct inode___2 *, struct file_lock *); + +typedef void (*btf_trace_time_out_leases)(void *, struct inode___2 *, struct file_lock *); + +typedef void (*btf_trace_generic_add_lease)(void *, struct inode___2 *, struct file_lock *); + +typedef void (*btf_trace_leases_conflict)(void *, bool, struct file_lock *, struct file_lock *); + struct file_lock_list_struct { spinlock_t lock; struct hlist_head hlist; @@ -39832,42 +44934,6 @@ struct compat_nfs4_mount_data_v1 { compat_uptr_t auth_flavours; }; -struct serial_icounter_struct { - int cts; - int dsr; - int rng; - int dcd; - int rx; - int tx; - int frame; - int overrun; - int parity; - int brk; - int buf_overrun; - int reserved[9]; -}; - -struct serial_struct { - int type; - int line; - unsigned int port; - int irq; - int flags; - int xmit_fifo_size; - int custom_divisor; - int baud_base; - short unsigned int close_delay; - char io_type; - char reserved_char[1]; - int hub6; - short unsigned int closing_wait; - short unsigned int closing_wait2; - unsigned char *iomem_base; - short unsigned int iomem_reg_shift; - unsigned int port_high; - long unsigned int iomap_base; -}; - enum { VERBOSE_STATUS = 1, }; @@ -39886,7 +44952,7 @@ typedef struct { char *mask; const char *interpreter; char *name; - struct dentry___2 *dentry; + struct dentry *dentry; struct file *interp_file; } Node; @@ -39894,17 +44960,6 @@ typedef unsigned int __kernel_uid_t; typedef unsigned int __kernel_gid_t; -struct elf64_phdr { - Elf64_Word p_type; - Elf64_Word p_flags; - Elf64_Off p_offset; - Elf64_Addr p_vaddr; - Elf64_Addr p_paddr; - Elf64_Xword p_filesz; - Elf64_Xword p_memsz; - Elf64_Xword p_align; -}; - struct elf_prpsinfo { char pr_state; char pr_sname; @@ -39948,40 +45003,6 @@ struct elf_note_info { int thread_notes; }; -typedef __u32 Elf32_Addr; - -typedef __u16 Elf32_Half; - -typedef __u32 Elf32_Off; - -struct elf32_hdr { - unsigned char e_ident[16]; - Elf32_Half e_type; - Elf32_Half e_machine; - Elf32_Word e_version; - Elf32_Addr e_entry; - Elf32_Off e_phoff; - Elf32_Off e_shoff; - Elf32_Word e_flags; - Elf32_Half e_ehsize; - Elf32_Half e_phentsize; - Elf32_Half e_phnum; - Elf32_Half e_shentsize; - Elf32_Half e_shnum; - Elf32_Half e_shstrndx; -}; - -struct elf32_phdr { - Elf32_Word p_type; - Elf32_Off p_offset; - Elf32_Addr p_vaddr; - Elf32_Addr p_paddr; - Elf32_Word p_filesz; - Elf32_Word p_memsz; - Elf32_Word p_flags; - Elf32_Word p_align; -}; - struct elf32_shdr { Elf32_Word sh_name; Elf32_Word sh_type; @@ -40085,18 +45106,6 @@ struct posix_acl_xattr_header { __le32 a_version; }; -struct xdr_buf { - struct kvec head[1]; - struct kvec tail[1]; - struct bio_vec *bvec; - struct page___2 **pages; - unsigned int page_base; - unsigned int page_len; - unsigned int flags; - unsigned int buflen; - unsigned int len; -}; - struct xdr_array2_desc; typedef int (*xdr_xcode_elem_t)(struct xdr_array2_desc *, void *); @@ -40192,6 +45201,22 @@ struct trace_event_data_offsets_iomap_class {}; struct trace_event_data_offsets_iomap_apply {}; +typedef void (*btf_trace_iomap_readpage)(void *, struct inode___2 *, int); + +typedef void (*btf_trace_iomap_readpages)(void *, struct inode___2 *, int); + +typedef void (*btf_trace_iomap_writepage)(void *, struct inode___2 *, struct page___2 *, long unsigned int, unsigned int); + +typedef void (*btf_trace_iomap_releasepage)(void *, struct inode___2 *, struct page___2 *, long unsigned int, unsigned int); + +typedef void (*btf_trace_iomap_invalidatepage)(void *, struct inode___2 *, struct page___2 *, long unsigned int, unsigned int); + +typedef void (*btf_trace_iomap_apply_dstmap)(void *, struct inode___2 *, struct iomap___2 *); + +typedef void (*btf_trace_iomap_apply_srcmap)(void *, struct inode___2 *, struct iomap___2 *); + +typedef void (*btf_trace_iomap_apply)(void *, struct inode___2 *, loff_t, loff_t, unsigned int, const void *, void *, long unsigned int); + struct iomap_ops { int (*iomap_begin)(struct inode___2 *, loff_t, loff_t, unsigned int, struct iomap___2 *, struct iomap___2 *); int (*iomap_end)(struct inode___2 *, loff_t, loff_t, ssize_t, unsigned int, struct iomap___2 *); @@ -40558,8 +45583,8 @@ enum { struct proc_maps_private { struct inode___2 *inode; struct task_struct *task; - struct mm_struct___2 *mm; - struct vm_area_struct___2 *tail_vma; + struct mm_struct *mm; + struct vm_area_struct *tail_vma; struct mempolicy *task_mempolicy; }; @@ -40641,7 +45666,7 @@ struct pde_opener { }; enum { - BIAS = -2147483648, + BIAS = 2147483648, }; typedef int (*proc_write_t___2)(struct file *, char *, size_t); @@ -40676,7 +45701,7 @@ struct pid_entry { unsigned int len; umode_t mode; const struct inode_operations___2 *iop; - const struct file_operations___2 *fop; + const struct file_operations *fop; union proc_op op; }; @@ -40712,14 +45737,6 @@ struct vmcore { loff_t offset; }; -typedef struct elf32_hdr Elf32_Ehdr; - -typedef struct elf32_phdr Elf32_Phdr; - -typedef struct elf64_phdr Elf64_Phdr; - -typedef struct elf32_note Elf32_Nhdr; - typedef struct elf64_note Elf64_Nhdr; struct kernfs_iattrs { @@ -40732,7 +45749,7 @@ struct kernfs_iattrs { }; struct kernfs_super_info { - struct super_block___2 *sb; + struct super_block *sb; struct kernfs_root___2 *root; const void *ns; struct list_head node; @@ -41146,6 +46163,14 @@ struct blockgroup_lock { struct bgl_lock locks[128]; }; +struct fsverity_operations { + int (*begin_enable_verity)(struct file___2 *); + int (*end_enable_verity)(struct file___2 *, const void *, size_t, u64); + int (*get_verity_descriptor)(struct inode___2 *, void *, size_t); + struct page___2 * (*read_merkle_tree_page)(struct inode___2 *, long unsigned int); + int (*write_merkle_tree_block)(struct inode___2 *, const void *, u64, int); +}; + typedef int ext4_grpblk_t; typedef long long unsigned int ext4_fsblk_t; @@ -41431,7 +46456,7 @@ struct ext4_sb_info { struct proc_dir_entry *s_proc; struct kobject___2 s_kobj; struct completion s_kobj_unregister; - struct super_block___2 *s_sb; + struct super_block *s_sb; struct journal_s *s_journal; struct list_head s_orphan; struct mutex s_orphan_lock; @@ -41531,7 +46556,7 @@ struct ext4_locality_group { }; struct ext4_li_request { - struct super_block___2 *lr_super; + struct super_block *lr_super; struct ext4_sb_info *lr_sbi; ext4_group_t lr_next_group; struct list_head lr_request; @@ -41539,6 +46564,8 @@ struct ext4_li_request { long unsigned int lr_timeout; }; +struct iomap_ops___2; + struct shash_desc { struct crypto_shash *tfm; void *__ctx[0]; @@ -41551,12 +46578,6 @@ struct ext4_map_blocks { unsigned int m_flags; }; -typedef enum { - EXT4_IGET_NORMAL = 0, - EXT4_IGET_SPECIAL = 1, - EXT4_IGET_HANDLE = 2, -} ext4_iget_flags; - struct ext4_system_zone { struct rb_node node; ext4_fsblk_t start_blk; @@ -41642,7 +46663,7 @@ struct ext4_io_end_vec { struct ext4_io_end { struct list_head list; handle_t *handle; - struct inode___2 *inode; + struct inode *inode; struct bio *bio; unsigned int flag; atomic_t count; @@ -41772,8 +46793,6 @@ struct ext4_fsmap_head { typedef int (*ext4_fsmap_format_t)(struct ext4_fsmap *, void *); -typedef int (*ext4_mballoc_query_range_fn)(struct super_block___2 *, ext4_group_t, ext4_grpblk_t, ext4_grpblk_t, void *); - struct ext4_getfsmap_info { struct ext4_fsmap_head *gfi_head; ext4_fsmap_format_t gfi_formatter; @@ -41789,7 +46808,7 @@ struct ext4_getfsmap_info { }; struct ext4_getfsmap_dev { - int (*gfd_fn)(struct super_block___2 *, struct ext4_fsmap *, struct ext4_getfsmap_info *); + int (*gfd_fn)(struct super_block *, struct ext4_fsmap *, struct ext4_getfsmap_info *); u32 gfd_dev; }; @@ -41922,6 +46941,8 @@ typedef __kernel_uid16_t uid16_t; typedef __kernel_gid16_t gid16_t; +typedef int get_block_t___2(struct inode *, sector_t, struct buffer_head *, int); + struct ext4_io_submit { struct writeback_control *io_wbc; struct bio *io_bio; @@ -41929,13 +46950,19 @@ struct ext4_io_submit { sector_t io_next_block; }; +typedef enum { + EXT4_IGET_NORMAL = 0, + EXT4_IGET_SPECIAL = 1, + EXT4_IGET_HANDLE = 2, +} ext4_iget_flags; + struct ext4_xattr_inode_array { unsigned int count; - struct inode___2 *inodes[0]; + struct inode *inodes[0]; }; struct mpage_da_data { - struct inode___2 *inode; + struct inode *inode; struct writeback_control *wbc; long unsigned int first_page; long unsigned int next_page; @@ -42007,7 +47034,7 @@ struct fsmap_head { }; struct getfsmap_info { - struct super_block___2 *gi_sb; + struct super_block *gi_sb; struct fsmap_head *gi_data; unsigned int gi_idx; __u32 gi_last_flags; @@ -42038,7 +47065,7 @@ struct ext4_prealloc_space { ext4_grpblk_t pa_free; short unsigned int pa_type; spinlock_t *pa_obj_lock; - struct inode___2 *pa_inode; + struct inode *pa_inode; }; enum { @@ -42054,8 +47081,8 @@ struct ext4_free_extent { }; struct ext4_allocation_context { - struct inode___2 *ac_inode; - struct super_block___2 *ac_sb; + struct inode *ac_inode; + struct super_block *ac_sb; struct ext4_free_extent ac_o_ex; struct ext4_free_extent ac_g_ex; struct ext4_free_extent ac_b_ex; @@ -42069,23 +47096,25 @@ struct ext4_allocation_context { __u8 ac_criteria; __u8 ac_2order; __u8 ac_op; - struct page___2 *ac_bitmap_page; - struct page___2 *ac_buddy_page; + struct page *ac_bitmap_page; + struct page *ac_buddy_page; struct ext4_prealloc_space *ac_pa; struct ext4_locality_group *ac_lg; }; struct ext4_buddy { - struct page___2 *bd_buddy_page; + struct page *bd_buddy_page; void *bd_buddy; - struct page___2 *bd_bitmap_page; + struct page *bd_bitmap_page; void *bd_bitmap; struct ext4_group_info *bd_info; - struct super_block___2 *bd_sb; + struct super_block *bd_sb; __u16 bd_blkbits; ext4_group_t bd_group; }; +typedef int (*ext4_mballoc_query_range_fn)(struct super_block *, ext4_group_t, ext4_grpblk_t, ext4_grpblk_t, void *); + struct sg { struct ext4_group_info info; ext4_grpblk_t counters[18]; @@ -42113,7 +47142,7 @@ struct mmp_struct { struct mmpd_data { struct buffer_head *bh; - struct super_block___2 *sb; + struct super_block *sb; }; struct fscrypt_name { @@ -42204,9 +47233,9 @@ struct dx_tail { }; struct ext4_renament { - struct inode___2 *dir; - struct dentry___2 *dentry; - struct inode___2 *inode; + struct inode *dir; + struct dentry *dentry; + struct inode *inode; bool is_dir; int dir_nlink_delta; struct buffer_head *bh; @@ -42257,7 +47286,7 @@ struct ext4_lazy_init { struct ext4_journal_cb_entry { struct list_head jce_list; - void (*jce_func)(struct super_block___2 *, struct ext4_journal_cb_entry *, int); + void (*jce_func)(struct super_block *, struct ext4_journal_cb_entry *, int); }; struct trace_event_raw_ext4_other_inode_update_time { @@ -43257,2330 +48286,1690 @@ struct trace_event_data_offsets_ext4_shutdown {}; struct trace_event_data_offsets_ext4_error {}; -enum { - Opt_bsd_df = 0, - Opt_minix_df = 1, - Opt_grpid = 2, - Opt_nogrpid = 3, - Opt_resgid = 4, - Opt_resuid = 5, - Opt_sb = 6, - Opt_err_cont = 7, - Opt_err_panic = 8, - Opt_err_ro = 9, - Opt_nouid32 = 10, - Opt_debug = 11, - Opt_removed = 12, - Opt_user_xattr = 13, - Opt_nouser_xattr = 14, - Opt_acl = 15, - Opt_noacl = 16, - Opt_auto_da_alloc = 17, - Opt_noauto_da_alloc = 18, - Opt_noload = 19, - Opt_commit = 20, - Opt_min_batch_time = 21, - Opt_max_batch_time = 22, - Opt_journal_dev = 23, - Opt_journal_path = 24, - Opt_journal_checksum = 25, - Opt_journal_async_commit = 26, - Opt_abort = 27, - Opt_data_journal = 28, - Opt_data_ordered = 29, - Opt_data_writeback = 30, - Opt_data_err_abort = 31, - Opt_data_err_ignore = 32, - Opt_test_dummy_encryption = 33, - Opt_usrjquota = 34, - Opt_grpjquota = 35, - Opt_offusrjquota = 36, - Opt_offgrpjquota = 37, - Opt_jqfmt_vfsold = 38, - Opt_jqfmt_vfsv0 = 39, - Opt_jqfmt_vfsv1 = 40, - Opt_quota = 41, - Opt_noquota = 42, - Opt_barrier = 43, - Opt_nobarrier = 44, - Opt_err___2 = 45, - Opt_usrquota = 46, - Opt_grpquota = 47, - Opt_prjquota = 48, - Opt_i_version = 49, - Opt_dax = 50, - Opt_stripe = 51, - Opt_delalloc = 52, - Opt_nodelalloc = 53, - Opt_warn_on_error = 54, - Opt_nowarn_on_error = 55, - Opt_mblk_io_submit = 56, - Opt_lazytime = 57, - Opt_nolazytime = 58, - Opt_debug_want_extra_isize = 59, - Opt_nomblk_io_submit = 60, - Opt_block_validity = 61, - Opt_noblock_validity = 62, - Opt_inode_readahead_blks = 63, - Opt_journal_ioprio = 64, - Opt_dioread_nolock = 65, - Opt_dioread_lock = 66, - Opt_discard = 67, - Opt_nodiscard = 68, - Opt_init_itable = 69, - Opt_noinit_itable = 70, - Opt_max_dir_size_kb = 71, - Opt_nojournal_checksum = 72, - Opt_nombcache = 73, -}; +typedef void (*btf_trace_ext4_other_inode_update_time)(void *, struct inode *, ino_t); -struct mount_opts { - int token; - int mount_opt; - int flags; -}; +typedef void (*btf_trace_ext4_free_inode)(void *, struct inode *); -struct ext4_mount_options { - long unsigned int s_mount_opt; - long unsigned int s_mount_opt2; - kuid_t s_resuid; - kgid_t s_resgid; - long unsigned int s_commit_interval; - u32 s_min_batch_time; - u32 s_max_batch_time; - int s_jquota_fmt; - char *s_qf_names[3]; -}; +typedef void (*btf_trace_ext4_request_inode)(void *, struct inode *, int); -enum { - attr_noop = 0, - attr_delayed_allocation_blocks = 1, - attr_session_write_kbytes = 2, - attr_lifetime_write_kbytes = 3, - attr_reserved_clusters = 4, - attr_inode_readahead = 5, - attr_trigger_test_error = 6, - attr_first_error_time = 7, - attr_last_error_time = 8, - attr_feature = 9, - attr_pointer_ui = 10, - attr_pointer_atomic = 11, - attr_journal_task = 12, -}; +typedef void (*btf_trace_ext4_allocate_inode)(void *, struct inode *, struct inode *, int); -enum { - ptr_explicit = 0, - ptr_ext4_sb_info_offset = 1, - ptr_ext4_super_block_offset = 2, -}; +typedef void (*btf_trace_ext4_evict_inode)(void *, struct inode *); -struct ext4_attr { - struct attribute attr; - short int attr_id; - short int attr_ptr; - union { - int offset; - void *explicit_ptr; - } u; -}; +typedef void (*btf_trace_ext4_drop_inode)(void *, struct inode *, int); -struct ext4_xattr_header { - __le32 h_magic; - __le32 h_refcount; - __le32 h_blocks; - __le32 h_hash; - __le32 h_checksum; - __u32 h_reserved[3]; -}; +typedef void (*btf_trace_ext4_nfs_commit_metadata)(void *, struct inode *); -struct ext4_xattr_block_find { - struct ext4_xattr_search s; - struct buffer_head *bh; -}; +typedef void (*btf_trace_ext4_mark_inode_dirty)(void *, struct inode *, long unsigned int); -typedef struct { - __le16 e_tag; - __le16 e_perm; - __le32 e_id; -} ext4_acl_entry; +typedef void (*btf_trace_ext4_begin_ordered_truncate)(void *, struct inode *, loff_t); -typedef struct { - __le32 a_version; -} ext4_acl_header; +typedef void (*btf_trace_ext4_write_begin)(void *, struct inode *, loff_t, unsigned int, unsigned int); -struct commit_header { - __be32 h_magic; - __be32 h_blocktype; - __be32 h_sequence; - unsigned char h_chksum_type; - unsigned char h_chksum_size; - unsigned char h_padding[2]; - __be32 h_chksum[8]; - __be64 h_commit_sec; - __be32 h_commit_nsec; -}; +typedef void (*btf_trace_ext4_da_write_begin)(void *, struct inode *, loff_t, unsigned int, unsigned int); -struct journal_block_tag3_s { - __be32 t_blocknr; - __be32 t_flags; - __be32 t_blocknr_high; - __be32 t_checksum; -}; +typedef void (*btf_trace_ext4_write_end)(void *, struct inode *, loff_t, unsigned int, unsigned int); -typedef struct journal_block_tag3_s journal_block_tag3_t; +typedef void (*btf_trace_ext4_journalled_write_end)(void *, struct inode *, loff_t, unsigned int, unsigned int); -struct journal_block_tag_s { - __be32 t_blocknr; - __be16 t_checksum; - __be16 t_flags; - __be32 t_blocknr_high; -}; +typedef void (*btf_trace_ext4_da_write_end)(void *, struct inode *, loff_t, unsigned int, unsigned int); -typedef struct journal_block_tag_s journal_block_tag_t; +typedef void (*btf_trace_ext4_writepages)(void *, struct inode *, struct writeback_control *); -struct jbd2_journal_block_tail { - __be32 t_checksum; -}; +typedef void (*btf_trace_ext4_da_write_pages)(void *, struct inode *, long unsigned int, struct writeback_control *); -struct jbd2_journal_revoke_header_s { - journal_header_t r_header; - __be32 r_count; -}; +typedef void (*btf_trace_ext4_da_write_pages_extent)(void *, struct inode *, struct ext4_map_blocks *); -typedef struct jbd2_journal_revoke_header_s jbd2_journal_revoke_header_t; +typedef void (*btf_trace_ext4_writepages_result)(void *, struct inode *, struct writeback_control *, int, int); -struct recovery_info { - tid_t start_transaction; - tid_t end_transaction; - int nr_replays; - int nr_revokes; - int nr_revoke_hits; -}; +typedef void (*btf_trace_ext4_writepage)(void *, struct page *); -enum passtype { - PASS_SCAN = 0, - PASS_REVOKE = 1, - PASS_REPLAY = 2, -}; +typedef void (*btf_trace_ext4_readpage)(void *, struct page *); -struct jbd2_revoke_table_s { - int hash_size; - int hash_shift; - struct list_head *hash_table; -}; +typedef void (*btf_trace_ext4_releasepage)(void *, struct page *); -struct jbd2_revoke_record_s { - struct list_head hash; - tid_t sequence; - long long unsigned int blocknr; -}; +typedef void (*btf_trace_ext4_invalidatepage)(void *, struct page *, unsigned int, unsigned int); -struct trace_event_raw_jbd2_checkpoint { - struct trace_entry ent; - dev_t dev; - int result; - char __data[0]; -}; +typedef void (*btf_trace_ext4_journalled_invalidatepage)(void *, struct page *, unsigned int, unsigned int); -struct trace_event_raw_jbd2_commit { - struct trace_entry ent; - dev_t dev; - char sync_commit; - int transaction; - char __data[0]; -}; +typedef void (*btf_trace_ext4_discard_blocks)(void *, struct super_block *, long long unsigned int, long long unsigned int); -struct trace_event_raw_jbd2_end_commit { - struct trace_entry ent; - dev_t dev; - char sync_commit; - int transaction; - int head; - char __data[0]; -}; +typedef void (*btf_trace_ext4_mb_new_inode_pa)(void *, struct ext4_allocation_context *, struct ext4_prealloc_space *); -struct trace_event_raw_jbd2_submit_inode_data { - struct trace_entry ent; - dev_t dev; - ino_t ino; - char __data[0]; -}; +typedef void (*btf_trace_ext4_mb_new_group_pa)(void *, struct ext4_allocation_context *, struct ext4_prealloc_space *); -struct trace_event_raw_jbd2_handle_start_class { - struct trace_entry ent; - dev_t dev; - long unsigned int tid; - unsigned int type; - unsigned int line_no; - int requested_blocks; - char __data[0]; -}; +typedef void (*btf_trace_ext4_mb_release_inode_pa)(void *, struct ext4_prealloc_space *, long long unsigned int, unsigned int); -struct trace_event_raw_jbd2_handle_extend { - struct trace_entry ent; - dev_t dev; - long unsigned int tid; - unsigned int type; - unsigned int line_no; - int buffer_credits; - int requested_blocks; - char __data[0]; -}; +typedef void (*btf_trace_ext4_mb_release_group_pa)(void *, struct super_block *, struct ext4_prealloc_space *); -struct trace_event_raw_jbd2_handle_stats { - struct trace_entry ent; - dev_t dev; - long unsigned int tid; - unsigned int type; - unsigned int line_no; - int interval; - int sync; - int requested_blocks; - int dirtied_blocks; - char __data[0]; -}; +typedef void (*btf_trace_ext4_discard_preallocations)(void *, struct inode *); -struct trace_event_raw_jbd2_run_stats { - struct trace_entry ent; - dev_t dev; - long unsigned int tid; - long unsigned int wait; - long unsigned int request_delay; - long unsigned int running; - long unsigned int locked; - long unsigned int flushing; - long unsigned int logging; - __u32 handle_count; - __u32 blocks; - __u32 blocks_logged; - char __data[0]; -}; +typedef void (*btf_trace_ext4_mb_discard_preallocations)(void *, struct super_block *, int); -struct trace_event_raw_jbd2_checkpoint_stats { - struct trace_entry ent; - dev_t dev; - long unsigned int tid; - long unsigned int chp_time; - __u32 forced_to_close; - __u32 written; - __u32 dropped; - char __data[0]; -}; +typedef void (*btf_trace_ext4_request_blocks)(void *, struct ext4_allocation_request *); -struct trace_event_raw_jbd2_update_log_tail { - struct trace_entry ent; - dev_t dev; - tid_t tail_sequence; - tid_t first_tid; - long unsigned int block_nr; - long unsigned int freed; - char __data[0]; -}; +typedef void (*btf_trace_ext4_allocate_blocks)(void *, struct ext4_allocation_request *, long long unsigned int); -struct trace_event_raw_jbd2_write_superblock { - struct trace_entry ent; - dev_t dev; - int write_op; - char __data[0]; -}; +typedef void (*btf_trace_ext4_free_blocks)(void *, struct inode *, __u64, long unsigned int, int); -struct trace_event_raw_jbd2_lock_buffer_stall { - struct trace_entry ent; - dev_t dev; - long unsigned int stall_ms; - char __data[0]; -}; +typedef void (*btf_trace_ext4_sync_file_enter)(void *, struct file *, int); -struct trace_event_data_offsets_jbd2_checkpoint {}; +typedef void (*btf_trace_ext4_sync_file_exit)(void *, struct inode *, int); -struct trace_event_data_offsets_jbd2_commit {}; +typedef void (*btf_trace_ext4_sync_fs)(void *, struct super_block *, int); -struct trace_event_data_offsets_jbd2_end_commit {}; +typedef void (*btf_trace_ext4_alloc_da_blocks)(void *, struct inode *); -struct trace_event_data_offsets_jbd2_submit_inode_data {}; +typedef void (*btf_trace_ext4_mballoc_alloc)(void *, struct ext4_allocation_context *); -struct trace_event_data_offsets_jbd2_handle_start_class {}; +typedef void (*btf_trace_ext4_mballoc_prealloc)(void *, struct ext4_allocation_context *); -struct trace_event_data_offsets_jbd2_handle_extend {}; +typedef void (*btf_trace_ext4_mballoc_discard)(void *, struct super_block *, struct inode *, ext4_group_t, ext4_grpblk_t, ext4_grpblk_t); -struct trace_event_data_offsets_jbd2_handle_stats {}; +typedef void (*btf_trace_ext4_mballoc_free)(void *, struct super_block *, struct inode *, ext4_group_t, ext4_grpblk_t, ext4_grpblk_t); -struct trace_event_data_offsets_jbd2_run_stats {}; +typedef void (*btf_trace_ext4_forget)(void *, struct inode *, int, __u64); -struct trace_event_data_offsets_jbd2_checkpoint_stats {}; +typedef void (*btf_trace_ext4_da_update_reserve_space)(void *, struct inode *, int, int); + +typedef void (*btf_trace_ext4_da_reserve_space)(void *, struct inode *); + +typedef void (*btf_trace_ext4_da_release_space)(void *, struct inode *, int); + +typedef void (*btf_trace_ext4_mb_bitmap_load)(void *, struct super_block *, long unsigned int); + +typedef void (*btf_trace_ext4_mb_buddy_bitmap_load)(void *, struct super_block *, long unsigned int); + +typedef void (*btf_trace_ext4_read_block_bitmap_load)(void *, struct super_block *, long unsigned int); + +typedef void (*btf_trace_ext4_load_inode_bitmap)(void *, struct super_block *, long unsigned int); + +typedef void (*btf_trace_ext4_direct_IO_enter)(void *, struct inode *, loff_t, long unsigned int, int); + +typedef void (*btf_trace_ext4_direct_IO_exit)(void *, struct inode *, loff_t, long unsigned int, int, int); + +typedef void (*btf_trace_ext4_fallocate_enter)(void *, struct inode *, loff_t, loff_t, int); + +typedef void (*btf_trace_ext4_punch_hole)(void *, struct inode *, loff_t, loff_t, int); + +typedef void (*btf_trace_ext4_zero_range)(void *, struct inode *, loff_t, loff_t, int); + +typedef void (*btf_trace_ext4_fallocate_exit)(void *, struct inode *, loff_t, unsigned int, int); + +typedef void (*btf_trace_ext4_unlink_enter)(void *, struct inode *, struct dentry *); + +typedef void (*btf_trace_ext4_unlink_exit)(void *, struct dentry *, int); + +typedef void (*btf_trace_ext4_truncate_enter)(void *, struct inode *); + +typedef void (*btf_trace_ext4_truncate_exit)(void *, struct inode *); + +typedef void (*btf_trace_ext4_ext_convert_to_initialized_enter)(void *, struct inode *, struct ext4_map_blocks *, struct ext4_extent *); + +typedef void (*btf_trace_ext4_ext_convert_to_initialized_fastpath)(void *, struct inode *, struct ext4_map_blocks *, struct ext4_extent *, struct ext4_extent *); + +typedef void (*btf_trace_ext4_ext_map_blocks_enter)(void *, struct inode *, ext4_lblk_t, unsigned int, unsigned int); + +typedef void (*btf_trace_ext4_ind_map_blocks_enter)(void *, struct inode *, ext4_lblk_t, unsigned int, unsigned int); + +typedef void (*btf_trace_ext4_ext_map_blocks_exit)(void *, struct inode *, unsigned int, struct ext4_map_blocks *, int); + +typedef void (*btf_trace_ext4_ind_map_blocks_exit)(void *, struct inode *, unsigned int, struct ext4_map_blocks *, int); -struct trace_event_data_offsets_jbd2_update_log_tail {}; +typedef void (*btf_trace_ext4_ext_load_extent)(void *, struct inode *, ext4_lblk_t, ext4_fsblk_t); -struct trace_event_data_offsets_jbd2_write_superblock {}; +typedef void (*btf_trace_ext4_load_inode)(void *, struct inode *); -struct trace_event_data_offsets_jbd2_lock_buffer_stall {}; +typedef void (*btf_trace_ext4_journal_start)(void *, struct super_block *, int, int, int, long unsigned int); -struct jbd2_stats_proc_session { - journal_t *journal; - struct transaction_stats_s *stats; - int start; - int max; -}; +typedef void (*btf_trace_ext4_journal_start_reserved)(void *, struct super_block *, int, long unsigned int); -struct ramfs_mount_opts { - umode_t mode; -}; +typedef void (*btf_trace_ext4_trim_extent)(void *, struct super_block *, ext4_group_t, ext4_grpblk_t, ext4_grpblk_t); -struct ramfs_fs_info { - struct ramfs_mount_opts mount_opts; -}; +typedef void (*btf_trace_ext4_trim_all_free)(void *, struct super_block *, ext4_group_t, ext4_grpblk_t, ext4_grpblk_t); -enum ramfs_param { - Opt_mode___3 = 0, -}; +typedef void (*btf_trace_ext4_ext_handle_unwritten_extents)(void *, struct inode *, struct ext4_map_blocks *, int, unsigned int, ext4_fsblk_t); -enum hugetlbfs_size_type { - NO_SIZE = 0, - SIZE_STD = 1, - SIZE_PERCENT = 2, -}; +typedef void (*btf_trace_ext4_get_implied_cluster_alloc_exit)(void *, struct super_block *, struct ext4_map_blocks *, int); -struct hugetlbfs_fs_context { - struct hstate *hstate; - long long unsigned int max_size_opt; - long long unsigned int min_size_opt; - long int max_hpages; - long int nr_inodes; - long int min_hpages; - enum hugetlbfs_size_type max_val_type; - enum hugetlbfs_size_type min_val_type; - kuid_t uid; - kgid_t gid; - umode_t mode; -}; +typedef void (*btf_trace_ext4_ext_put_in_cache)(void *, struct inode *, ext4_lblk_t, unsigned int, ext4_fsblk_t); -enum hugetlb_param { - Opt_gid___4 = 0, - Opt_min_size = 1, - Opt_mode___4 = 2, - Opt_nr_inodes___2 = 3, - Opt_pagesize = 4, - Opt_size___2 = 5, - Opt_uid___3 = 6, -}; +typedef void (*btf_trace_ext4_ext_in_cache)(void *, struct inode *, ext4_lblk_t, int); -typedef u16 wchar_t; +typedef void (*btf_trace_ext4_find_delalloc_range)(void *, struct inode *, ext4_lblk_t, ext4_lblk_t, int, int, ext4_lblk_t); -struct nls_table { - const char *charset; - const char *alias; - int (*uni2char)(wchar_t, unsigned char *, int); - int (*char2uni)(const unsigned char *, int, wchar_t *); - const unsigned char *charset2lower; - const unsigned char *charset2upper; - struct module *owner; - struct nls_table *next; -}; +typedef void (*btf_trace_ext4_get_reserved_cluster_alloc)(void *, struct inode *, ext4_lblk_t, unsigned int); -struct fat_mount_options { - kuid_t fs_uid; - kgid_t fs_gid; - short unsigned int fs_fmask; - short unsigned int fs_dmask; - short unsigned int codepage; - int time_offset; - char *iocharset; - short unsigned int shortname; - unsigned char name_check; - unsigned char errors; - unsigned char nfs; - short unsigned int allow_utime; - unsigned int quiet: 1; - unsigned int showexec: 1; - unsigned int sys_immutable: 1; - unsigned int dotsOK: 1; - unsigned int isvfat: 1; - unsigned int utf8: 1; - unsigned int unicode_xlate: 1; - unsigned int numtail: 1; - unsigned int flush: 1; - unsigned int nocase: 1; - unsigned int usefree: 1; - unsigned int tz_set: 1; - unsigned int rodir: 1; - unsigned int discard: 1; - unsigned int dos1xfloppy: 1; -}; +typedef void (*btf_trace_ext4_ext_show_extent)(void *, struct inode *, ext4_lblk_t, ext4_fsblk_t, short unsigned int); -struct fatent_operations; +typedef void (*btf_trace_ext4_remove_blocks)(void *, struct inode *, struct ext4_extent *, ext4_lblk_t, ext4_fsblk_t, struct partial_cluster *); -struct msdos_sb_info { - short unsigned int sec_per_clus; - short unsigned int cluster_bits; - unsigned int cluster_size; - unsigned char fats; - unsigned char fat_bits; - short unsigned int fat_start; - long unsigned int fat_length; - long unsigned int dir_start; - short unsigned int dir_entries; - long unsigned int data_start; - long unsigned int max_cluster; - long unsigned int root_cluster; - long unsigned int fsinfo_sector; - struct mutex fat_lock; - struct mutex nfs_build_inode_lock; - struct mutex s_lock; - unsigned int prev_free; - unsigned int free_clusters; - unsigned int free_clus_valid; - struct fat_mount_options options; - struct nls_table *nls_disk; - struct nls_table *nls_io; - const void *dir_ops; - int dir_per_block; - int dir_per_block_bits; - unsigned int vol_id; - int fatent_shift; - const struct fatent_operations *fatent_ops; - struct inode___2 *fat_inode; - struct inode___2 *fsinfo_inode; - struct ratelimit_state ratelimit; - spinlock_t inode_hash_lock; - struct hlist_head inode_hashtable[256]; - spinlock_t dir_hash_lock; - struct hlist_head dir_hashtable[256]; - unsigned int dirty; - struct callback_head rcu; -}; +typedef void (*btf_trace_ext4_ext_rm_leaf)(void *, struct inode *, ext4_lblk_t, struct ext4_extent *, struct partial_cluster *); -struct fat_entry; +typedef void (*btf_trace_ext4_ext_rm_idx)(void *, struct inode *, ext4_fsblk_t); -struct fatent_operations { - void (*ent_blocknr)(struct super_block___2 *, int, int *, sector_t *); - void (*ent_set_ptr)(struct fat_entry *, int); - int (*ent_bread)(struct super_block___2 *, struct fat_entry *, int, sector_t); - int (*ent_get)(struct fat_entry *); - void (*ent_put)(struct fat_entry *, int); - int (*ent_next)(struct fat_entry *); -}; +typedef void (*btf_trace_ext4_ext_remove_space)(void *, struct inode *, ext4_lblk_t, ext4_lblk_t, int); -struct msdos_inode_info { - spinlock_t cache_lru_lock; - struct list_head cache_lru; - int nr_caches; - unsigned int cache_valid_id; - loff_t mmu_private; - int i_start; - int i_logstart; - int i_attrs; - loff_t i_pos; - struct hlist_node i_fat_hash; - struct hlist_node i_dir_hash; - struct rw_semaphore truncate_lock; - struct inode___2 vfs_inode; -}; +typedef void (*btf_trace_ext4_ext_remove_space_done)(void *, struct inode *, ext4_lblk_t, ext4_lblk_t, int, struct partial_cluster *, __le16); -struct fat_entry { - int entry; - union { - u8 *ent12_p[2]; - __le16 *ent16_p; - __le32 *ent32_p; - } u; - int nr_bhs; - struct buffer_head *bhs[2]; - struct inode___2 *fat_inode; -}; +typedef void (*btf_trace_ext4_es_insert_extent)(void *, struct inode *, struct extent_status *); -struct fat_cache { - struct list_head cache_list; - int nr_contig; - int fcluster; - int dcluster; -}; +typedef void (*btf_trace_ext4_es_cache_extent)(void *, struct inode *, struct extent_status *); -struct fat_cache_id { - unsigned int id; - int nr_contig; - int fcluster; - int dcluster; -}; +typedef void (*btf_trace_ext4_es_remove_extent)(void *, struct inode *, ext4_lblk_t, ext4_lblk_t); -struct compat_dirent { - u32 d_ino; - compat_off_t d_off; - u16 d_reclen; - char d_name[256]; -}; +typedef void (*btf_trace_ext4_es_find_extent_range_enter)(void *, struct inode *, ext4_lblk_t); -enum utf16_endian { - UTF16_HOST_ENDIAN = 0, - UTF16_LITTLE_ENDIAN = 1, - UTF16_BIG_ENDIAN = 2, -}; +typedef void (*btf_trace_ext4_es_find_extent_range_exit)(void *, struct inode *, struct extent_status *); -struct __fat_dirent { - long int d_ino; - __kernel_off_t d_off; - short unsigned int d_reclen; - char d_name[256]; -}; +typedef void (*btf_trace_ext4_es_lookup_extent_enter)(void *, struct inode *, ext4_lblk_t); -struct msdos_dir_entry { - __u8 name[11]; - __u8 attr; - __u8 lcase; - __u8 ctime_cs; - __le16 ctime; - __le16 cdate; - __le16 adate; - __le16 starthi; - __le16 time; - __le16 date; - __le16 start; - __le32 size; -}; +typedef void (*btf_trace_ext4_es_lookup_extent_exit)(void *, struct inode *, struct extent_status *, int); -struct msdos_dir_slot { - __u8 id; - __u8 name0_4[10]; - __u8 attr; - __u8 reserved; - __u8 alias_checksum; - __u8 name5_10[12]; - __le16 start; - __u8 name11_12[4]; -}; +typedef void (*btf_trace_ext4_es_shrink_count)(void *, struct super_block *, int, int); -struct fat_slot_info { - loff_t i_pos; - loff_t slot_off; - int nr_slots; - struct msdos_dir_entry *de; - struct buffer_head *bh; -}; +typedef void (*btf_trace_ext4_es_shrink_scan_enter)(void *, struct super_block *, int, int); -typedef long long unsigned int llu; +typedef void (*btf_trace_ext4_es_shrink_scan_exit)(void *, struct super_block *, int, int); -enum { - PARSE_INVALID = 1, - PARSE_NOT_LONGNAME = 2, - PARSE_EOF = 3, -}; +typedef void (*btf_trace_ext4_collapse_range)(void *, struct inode *, loff_t, loff_t); -struct fat_ioctl_filldir_callback { - struct dir_context ctx; - void *dirent; - int result; - const char *longname; - int long_len; - const char *shortname; - int short_len; -}; +typedef void (*btf_trace_ext4_insert_range)(void *, struct inode *, loff_t, loff_t); -struct fat_boot_sector { - __u8 ignored[3]; - __u8 system_id[8]; - __u8 sector_size[2]; - __u8 sec_per_clus; - __le16 reserved; - __u8 fats; - __u8 dir_entries[2]; - __u8 sectors[2]; - __u8 media; - __le16 fat_length; - __le16 secs_track; - __le16 heads; - __le32 hidden; - __le32 total_sect; - union { - struct { - __u8 drive_number; - __u8 state; - __u8 signature; - __u8 vol_id[4]; - __u8 vol_label[11]; - __u8 fs_type[8]; - } fat16; - struct { - __le32 length; - __le16 flags; - __u8 version[2]; - __le32 root_cluster; - __le16 info_sector; - __le16 backup_boot; - __le16 reserved2[6]; - __u8 drive_number; - __u8 state; - __u8 signature; - __u8 vol_id[4]; - __u8 vol_label[11]; - __u8 fs_type[8]; - } fat32; - }; -}; +typedef void (*btf_trace_ext4_es_shrink)(void *, struct super_block *, int, u64, int, int); -struct fat_boot_fsinfo { - __le32 signature1; - __le32 reserved1[120]; - __le32 signature2; - __le32 free_clusters; - __le32 next_cluster; - __le32 reserved2[4]; -}; +typedef void (*btf_trace_ext4_es_insert_delayed_block)(void *, struct inode *, struct extent_status *, bool); -struct fat_bios_param_block { - u16 fat_sector_size; - u8 fat_sec_per_clus; - u16 fat_reserved; - u8 fat_fats; - u16 fat_dir_entries; - u16 fat_sectors; - u16 fat_fat_length; - u32 fat_total_sect; - u8 fat16_state; - u32 fat16_vol_id; - u32 fat32_length; - u32 fat32_root_cluster; - u16 fat32_info_sector; - u8 fat32_state; - u32 fat32_vol_id; -}; +typedef void (*btf_trace_ext4_fsmap_low_key)(void *, struct super_block *, u32, u32, u64, u64, u64); -struct fat_floppy_defaults { - unsigned int nr_sectors; - unsigned int sec_per_clus; - unsigned int dir_entries; - unsigned int media; - unsigned int fat_length; -}; +typedef void (*btf_trace_ext4_fsmap_high_key)(void *, struct super_block *, u32, u32, u64, u64, u64); -enum { - Opt_check_n = 0, - Opt_check_r = 1, - Opt_check_s = 2, - Opt_uid___4 = 3, - Opt_gid___5 = 4, - Opt_umask = 5, - Opt_dmask = 6, - Opt_fmask = 7, - Opt_allow_utime = 8, - Opt_codepage = 9, - Opt_usefree = 10, - Opt_nocase = 11, - Opt_quiet = 12, - Opt_showexec = 13, - Opt_debug___2 = 14, - Opt_immutable = 15, - Opt_dots = 16, - Opt_nodots = 17, - Opt_charset = 18, - Opt_shortname_lower = 19, - Opt_shortname_win95 = 20, - Opt_shortname_winnt = 21, - Opt_shortname_mixed = 22, - Opt_utf8_no = 23, - Opt_utf8_yes = 24, - Opt_uni_xl_no = 25, - Opt_uni_xl_yes = 26, - Opt_nonumtail_no = 27, - Opt_nonumtail_yes = 28, - Opt_obsolete = 29, - Opt_flush = 30, - Opt_tz_utc = 31, - Opt_rodir = 32, - Opt_err_cont___2 = 33, - Opt_err_panic___2 = 34, - Opt_err_ro___2 = 35, - Opt_discard___2 = 36, - Opt_nfs = 37, - Opt_time_offset = 38, - Opt_nfs_stale_rw = 39, - Opt_nfs_nostale_ro = 40, - Opt_err___3 = 41, - Opt_dos1xfloppy = 42, -}; +typedef void (*btf_trace_ext4_fsmap_mapping)(void *, struct super_block *, u32, u32, u64, u64, u64); -struct fat_fid { - u32 i_gen; - u32 i_pos_low; - u16 i_pos_hi; - u16 parent_i_pos_hi; - u32 parent_i_pos_low; - u32 parent_i_gen; -}; +typedef void (*btf_trace_ext4_getfsmap_low_key)(void *, struct super_block *, struct ext4_fsmap *); -struct shortname_info { - unsigned char lower: 1; - unsigned char upper: 1; - unsigned char valid: 1; -}; +typedef void (*btf_trace_ext4_getfsmap_high_key)(void *, struct super_block *, struct ext4_fsmap *); -struct iso_directory_record { - __u8 length[1]; - __u8 ext_attr_length[1]; - __u8 extent[8]; - __u8 size[8]; - __u8 date[7]; - __u8 flags[1]; - __u8 file_unit_size[1]; - __u8 interleave[1]; - __u8 volume_sequence_number[4]; - __u8 name_len[1]; - char name[0]; -}; +typedef void (*btf_trace_ext4_getfsmap_mapping)(void *, struct super_block *, struct ext4_fsmap *); -struct iso_inode_info { - long unsigned int i_iget5_block; - long unsigned int i_iget5_offset; - unsigned int i_first_extent; - unsigned char i_file_format; - unsigned char i_format_parm[3]; - long unsigned int i_next_section_block; - long unsigned int i_next_section_offset; - off_t i_section_size; - struct inode___2 vfs_inode; -}; +typedef void (*btf_trace_ext4_shutdown)(void *, struct super_block *, long unsigned int); -struct isofs_sb_info { - long unsigned int s_ninodes; - long unsigned int s_nzones; - long unsigned int s_firstdatazone; - long unsigned int s_log_zone_size; - long unsigned int s_max_size; - int s_rock_offset; - s32 s_sbsector; - unsigned char s_joliet_level; - unsigned char s_mapping; - unsigned char s_check; - unsigned char s_session; - unsigned int s_high_sierra: 1; - unsigned int s_rock: 2; - unsigned int s_utf8: 1; - unsigned int s_cruft: 1; - unsigned int s_nocompress: 1; - unsigned int s_hide: 1; - unsigned int s_showassoc: 1; - unsigned int s_overriderockperm: 1; - unsigned int s_uid_set: 1; - unsigned int s_gid_set: 1; - umode_t s_fmode; - umode_t s_dmode; - kgid_t s_gid; - kuid_t s_uid; - struct nls_table *s_nls_iocharset; -}; +typedef void (*btf_trace_ext4_error)(void *, struct super_block *, const char *, unsigned int); -struct cdrom_msf0 { - __u8 minute; - __u8 second; - __u8 frame; +enum { + Opt_bsd_df = 0, + Opt_minix_df = 1, + Opt_grpid = 2, + Opt_nogrpid = 3, + Opt_resgid = 4, + Opt_resuid = 5, + Opt_sb = 6, + Opt_err_cont = 7, + Opt_err_panic = 8, + Opt_err_ro = 9, + Opt_nouid32 = 10, + Opt_debug = 11, + Opt_removed = 12, + Opt_user_xattr = 13, + Opt_nouser_xattr = 14, + Opt_acl = 15, + Opt_noacl = 16, + Opt_auto_da_alloc = 17, + Opt_noauto_da_alloc = 18, + Opt_noload = 19, + Opt_commit = 20, + Opt_min_batch_time = 21, + Opt_max_batch_time = 22, + Opt_journal_dev = 23, + Opt_journal_path = 24, + Opt_journal_checksum = 25, + Opt_journal_async_commit = 26, + Opt_abort = 27, + Opt_data_journal = 28, + Opt_data_ordered = 29, + Opt_data_writeback = 30, + Opt_data_err_abort = 31, + Opt_data_err_ignore = 32, + Opt_test_dummy_encryption = 33, + Opt_usrjquota = 34, + Opt_grpjquota = 35, + Opt_offusrjquota = 36, + Opt_offgrpjquota = 37, + Opt_jqfmt_vfsold = 38, + Opt_jqfmt_vfsv0 = 39, + Opt_jqfmt_vfsv1 = 40, + Opt_quota = 41, + Opt_noquota = 42, + Opt_barrier = 43, + Opt_nobarrier = 44, + Opt_err___2 = 45, + Opt_usrquota = 46, + Opt_grpquota = 47, + Opt_prjquota = 48, + Opt_i_version = 49, + Opt_dax = 50, + Opt_stripe = 51, + Opt_delalloc = 52, + Opt_nodelalloc = 53, + Opt_warn_on_error = 54, + Opt_nowarn_on_error = 55, + Opt_mblk_io_submit = 56, + Opt_lazytime = 57, + Opt_nolazytime = 58, + Opt_debug_want_extra_isize = 59, + Opt_nomblk_io_submit = 60, + Opt_block_validity = 61, + Opt_noblock_validity = 62, + Opt_inode_readahead_blks = 63, + Opt_journal_ioprio = 64, + Opt_dioread_nolock = 65, + Opt_dioread_lock = 66, + Opt_discard = 67, + Opt_nodiscard = 68, + Opt_init_itable = 69, + Opt_noinit_itable = 70, + Opt_max_dir_size_kb = 71, + Opt_nojournal_checksum = 72, + Opt_nombcache = 73, }; -union cdrom_addr { - struct cdrom_msf0 msf; - int lba; +struct mount_opts { + int token; + int mount_opt; + int flags; }; -struct cdrom_tocentry { - __u8 cdte_track; - __u8 cdte_adr: 4; - __u8 cdte_ctrl: 4; - __u8 cdte_format; - union cdrom_addr cdte_addr; - __u8 cdte_datamode; +struct ext4_mount_options { + long unsigned int s_mount_opt; + long unsigned int s_mount_opt2; + kuid_t s_resuid; + kgid_t s_resgid; + long unsigned int s_commit_interval; + u32 s_min_batch_time; + u32 s_max_batch_time; + int s_jquota_fmt; + char *s_qf_names[3]; }; -struct cdrom_multisession { - union cdrom_addr addr; - __u8 xa_flag; - __u8 addr_format; +enum { + attr_noop = 0, + attr_delayed_allocation_blocks = 1, + attr_session_write_kbytes = 2, + attr_lifetime_write_kbytes = 3, + attr_reserved_clusters = 4, + attr_inode_readahead = 5, + attr_trigger_test_error = 6, + attr_first_error_time = 7, + attr_last_error_time = 8, + attr_feature = 9, + attr_pointer_ui = 10, + attr_pointer_atomic = 11, + attr_journal_task = 12, }; -struct iso_volume_descriptor { - __u8 type[1]; - char id[5]; - __u8 version[1]; - __u8 data[2041]; +enum { + ptr_explicit = 0, + ptr_ext4_sb_info_offset = 1, + ptr_ext4_super_block_offset = 2, }; -struct iso_primary_descriptor { - __u8 type[1]; - char id[5]; - __u8 version[1]; - __u8 unused1[1]; - char system_id[32]; - char volume_id[32]; - __u8 unused2[8]; - __u8 volume_space_size[8]; - __u8 unused3[32]; - __u8 volume_set_size[4]; - __u8 volume_sequence_number[4]; - __u8 logical_block_size[4]; - __u8 path_table_size[8]; - __u8 type_l_path_table[4]; - __u8 opt_type_l_path_table[4]; - __u8 type_m_path_table[4]; - __u8 opt_type_m_path_table[4]; - __u8 root_directory_record[34]; - char volume_set_id[128]; - char publisher_id[128]; - char preparer_id[128]; - char application_id[128]; - char copyright_file_id[37]; - char abstract_file_id[37]; - char bibliographic_file_id[37]; - __u8 creation_date[17]; - __u8 modification_date[17]; - __u8 expiration_date[17]; - __u8 effective_date[17]; - __u8 file_structure_version[1]; - __u8 unused4[1]; - __u8 application_data[512]; - __u8 unused5[653]; +struct ext4_attr { + struct attribute attr; + short int attr_id; + short int attr_ptr; + union { + int offset; + void *explicit_ptr; + } u; }; -struct iso_supplementary_descriptor { - __u8 type[1]; - char id[5]; - __u8 version[1]; - __u8 flags[1]; - char system_id[32]; - char volume_id[32]; - __u8 unused2[8]; - __u8 volume_space_size[8]; - __u8 escape[32]; - __u8 volume_set_size[4]; - __u8 volume_sequence_number[4]; - __u8 logical_block_size[4]; - __u8 path_table_size[8]; - __u8 type_l_path_table[4]; - __u8 opt_type_l_path_table[4]; - __u8 type_m_path_table[4]; - __u8 opt_type_m_path_table[4]; - __u8 root_directory_record[34]; - char volume_set_id[128]; - char publisher_id[128]; - char preparer_id[128]; - char application_id[128]; - char copyright_file_id[37]; - char abstract_file_id[37]; - char bibliographic_file_id[37]; - __u8 creation_date[17]; - __u8 modification_date[17]; - __u8 expiration_date[17]; - __u8 effective_date[17]; - __u8 file_structure_version[1]; - __u8 unused4[1]; - __u8 application_data[512]; - __u8 unused5[653]; +struct ext4_xattr_header { + __le32 h_magic; + __le32 h_refcount; + __le32 h_blocks; + __le32 h_hash; + __le32 h_checksum; + __u32 h_reserved[3]; }; -struct hs_volume_descriptor { - __u8 foo[8]; - __u8 type[1]; - char id[5]; - __u8 version[1]; - __u8 data[2033]; +struct ext4_xattr_block_find { + struct ext4_xattr_search s; + struct buffer_head *bh; }; -struct hs_primary_descriptor { - __u8 foo[8]; - __u8 type[1]; - __u8 id[5]; - __u8 version[1]; - __u8 unused1[1]; - char system_id[32]; - char volume_id[32]; - __u8 unused2[8]; - __u8 volume_space_size[8]; - __u8 unused3[32]; - __u8 volume_set_size[4]; - __u8 volume_sequence_number[4]; - __u8 logical_block_size[4]; - __u8 path_table_size[8]; - __u8 type_l_path_table[4]; - __u8 unused4[28]; - __u8 root_directory_record[34]; -}; +typedef struct { + __le16 e_tag; + __le16 e_perm; + __le32 e_id; +} ext4_acl_entry; -enum isofs_file_format { - isofs_file_normal = 0, - isofs_file_sparse = 1, - isofs_file_compressed = 2, -}; +typedef struct { + __le32 a_version; +} ext4_acl_header; -struct iso9660_options { - unsigned int rock: 1; - unsigned int joliet: 1; - unsigned int cruft: 1; - unsigned int hide: 1; - unsigned int showassoc: 1; - unsigned int nocompress: 1; - unsigned int overriderockperm: 1; - unsigned int uid_set: 1; - unsigned int gid_set: 1; - unsigned int utf8: 1; - unsigned char map; - unsigned char check; - unsigned int blocksize; - umode_t fmode; - umode_t dmode; - kgid_t gid; - kuid_t uid; - char *iocharset; - s32 session; - s32 sbsector; +struct commit_header { + __be32 h_magic; + __be32 h_blocktype; + __be32 h_sequence; + unsigned char h_chksum_type; + unsigned char h_chksum_size; + unsigned char h_padding[2]; + __be32 h_chksum[8]; + __be64 h_commit_sec; + __be32 h_commit_nsec; }; -enum { - Opt_block = 0, - Opt_check_r___2 = 1, - Opt_check_s___2 = 2, - Opt_cruft = 3, - Opt_gid___6 = 4, - Opt_ignore = 5, - Opt_iocharset = 6, - Opt_map_a = 7, - Opt_map_n = 8, - Opt_map_o = 9, - Opt_mode___5 = 10, - Opt_nojoliet = 11, - Opt_norock = 12, - Opt_sb___2 = 13, - Opt_session = 14, - Opt_uid___5 = 15, - Opt_unhide = 16, - Opt_utf8 = 17, - Opt_err___4 = 18, - Opt_nocompress = 19, - Opt_hide = 20, - Opt_showassoc = 21, - Opt_dmode = 22, - Opt_overriderockperm = 23, +struct journal_block_tag3_s { + __be32 t_blocknr; + __be32 t_flags; + __be32 t_blocknr_high; + __be32 t_checksum; }; -struct isofs_iget5_callback_data { - long unsigned int block; - long unsigned int offset; -}; +typedef struct journal_block_tag3_s journal_block_tag3_t; -struct SU_SP_s { - __u8 magic[2]; - __u8 skip; +struct journal_block_tag_s { + __be32 t_blocknr; + __be16 t_checksum; + __be16 t_flags; + __be32 t_blocknr_high; }; -struct SU_CE_s { - __u8 extent[8]; - __u8 offset[8]; - __u8 size[8]; -}; +typedef struct journal_block_tag_s journal_block_tag_t; -struct SU_ER_s { - __u8 len_id; - __u8 len_des; - __u8 len_src; - __u8 ext_ver; - __u8 data[0]; +struct jbd2_journal_block_tail { + __be32 t_checksum; }; -struct RR_RR_s { - __u8 flags[1]; +struct jbd2_journal_revoke_header_s { + journal_header_t r_header; + __be32 r_count; }; -struct RR_PX_s { - __u8 mode[8]; - __u8 n_links[8]; - __u8 uid[8]; - __u8 gid[8]; -}; +typedef struct jbd2_journal_revoke_header_s jbd2_journal_revoke_header_t; -struct RR_PN_s { - __u8 dev_high[8]; - __u8 dev_low[8]; +struct recovery_info { + tid_t start_transaction; + tid_t end_transaction; + int nr_replays; + int nr_revokes; + int nr_revoke_hits; }; -struct SL_component { - __u8 flags; - __u8 len; - __u8 text[0]; +enum passtype { + PASS_SCAN = 0, + PASS_REVOKE = 1, + PASS_REPLAY = 2, }; -struct RR_SL_s { - __u8 flags; - struct SL_component link; +struct jbd2_revoke_table_s { + int hash_size; + int hash_shift; + struct list_head *hash_table; }; -struct RR_NM_s { - __u8 flags; - char name[0]; +struct jbd2_revoke_record_s { + struct list_head hash; + tid_t sequence; + long long unsigned int blocknr; }; -struct RR_CL_s { - __u8 location[8]; +struct trace_event_raw_jbd2_checkpoint { + struct trace_entry ent; + dev_t dev; + int result; + char __data[0]; }; -struct RR_PL_s { - __u8 location[8]; +struct trace_event_raw_jbd2_commit { + struct trace_entry ent; + dev_t dev; + char sync_commit; + int transaction; + char __data[0]; }; -struct stamp { - __u8 time[7]; +struct trace_event_raw_jbd2_end_commit { + struct trace_entry ent; + dev_t dev; + char sync_commit; + int transaction; + int head; + char __data[0]; }; -struct RR_TF_s { - __u8 flags; - struct stamp times[0]; +struct trace_event_raw_jbd2_submit_inode_data { + struct trace_entry ent; + dev_t dev; + ino_t ino; + char __data[0]; }; -struct RR_ZF_s { - __u8 algorithm[2]; - __u8 parms[2]; - __u8 real_size[8]; +struct trace_event_raw_jbd2_handle_start_class { + struct trace_entry ent; + dev_t dev; + long unsigned int tid; + unsigned int type; + unsigned int line_no; + int requested_blocks; + char __data[0]; }; -struct rock_ridge { - __u8 signature[2]; - __u8 len; - __u8 version; - union { - struct SU_SP_s SP; - struct SU_CE_s CE; - struct SU_ER_s ER; - struct RR_RR_s RR; - struct RR_PX_s PX; - struct RR_PN_s PN; - struct RR_SL_s SL; - struct RR_NM_s NM; - struct RR_CL_s CL; - struct RR_PL_s PL; - struct RR_TF_s TF; - struct RR_ZF_s ZF; - } u; +struct trace_event_raw_jbd2_handle_extend { + struct trace_entry ent; + dev_t dev; + long unsigned int tid; + unsigned int type; + unsigned int line_no; + int buffer_credits; + int requested_blocks; + char __data[0]; }; -struct rock_state { - void *buffer; - unsigned char *chr; - int len; - int cont_size; - int cont_extent; - int cont_offset; - int cont_loops; - struct inode___2 *inode; +struct trace_event_raw_jbd2_handle_stats { + struct trace_entry ent; + dev_t dev; + long unsigned int tid; + unsigned int type; + unsigned int line_no; + int interval; + int sync; + int requested_blocks; + int dirtied_blocks; + char __data[0]; }; -struct isofs_fid { - u32 block; - u16 offset; - u16 parent_offset; - u32 generation; - u32 parent_block; - u32 parent_generation; +struct trace_event_raw_jbd2_run_stats { + struct trace_entry ent; + dev_t dev; + long unsigned int tid; + long unsigned int wait; + long unsigned int request_delay; + long unsigned int running; + long unsigned int locked; + long unsigned int flushing; + long unsigned int logging; + __u32 handle_count; + __u32 blocks; + __u32 blocks_logged; + char __data[0]; }; -typedef unsigned char Byte; - -typedef long unsigned int uLong; - -struct internal_state; - -struct z_stream_s { - const Byte *next_in; - uLong avail_in; - uLong total_in; - Byte *next_out; - uLong avail_out; - uLong total_out; - char *msg; - struct internal_state *state; - void *workspace; - int data_type; - uLong adler; - uLong reserved; +struct trace_event_raw_jbd2_checkpoint_stats { + struct trace_entry ent; + dev_t dev; + long unsigned int tid; + long unsigned int chp_time; + __u32 forced_to_close; + __u32 written; + __u32 dropped; + char __data[0]; }; -struct internal_state { - int dummy; +struct trace_event_raw_jbd2_update_log_tail { + struct trace_entry ent; + dev_t dev; + tid_t tail_sequence; + tid_t first_tid; + long unsigned int block_nr; + long unsigned int freed; + char __data[0]; }; -typedef struct z_stream_s z_stream; - -typedef z_stream *z_streamp; - -typedef __kernel_old_time_t time_t; - -struct rpc_timer { - struct list_head list; - long unsigned int expires; - struct delayed_work dwork; +struct trace_event_raw_jbd2_write_superblock { + struct trace_entry ent; + dev_t dev; + int write_op; + char __data[0]; }; -struct rpc_wait_queue { - spinlock_t lock; - struct list_head tasks[4]; - unsigned char maxpriority; - unsigned char priority; - unsigned char nr; - short unsigned int qlen; - struct rpc_timer timer_list; - const char *name; +struct trace_event_raw_jbd2_lock_buffer_stall { + struct trace_entry ent; + dev_t dev; + long unsigned int stall_ms; + char __data[0]; }; -struct nfs_seqid_counter { - ktime_t create_time; - int owner_id; - int flags; - u32 counter; - spinlock_t lock; - struct list_head list; - struct rpc_wait_queue wait; -}; +struct trace_event_data_offsets_jbd2_checkpoint {}; -struct nfs4_stateid_struct { - union { - char data[16]; - struct { - __be32 seqid; - char other[12]; - }; - }; - enum { - NFS4_INVALID_STATEID_TYPE = 0, - NFS4_SPECIAL_STATEID_TYPE = 1, - NFS4_OPEN_STATEID_TYPE = 2, - NFS4_LOCK_STATEID_TYPE = 3, - NFS4_DELEGATION_STATEID_TYPE = 4, - NFS4_LAYOUT_STATEID_TYPE = 5, - NFS4_PNFS_DS_STATEID_TYPE = 6, - NFS4_REVOKED_STATEID_TYPE = 7, - } type; -}; +struct trace_event_data_offsets_jbd2_commit {}; -typedef struct nfs4_stateid_struct nfs4_stateid; +struct trace_event_data_offsets_jbd2_end_commit {}; -struct nfs4_state; +struct trace_event_data_offsets_jbd2_submit_inode_data {}; -struct nfs4_lock_state { - struct list_head ls_locks; - struct nfs4_state *ls_state; - long unsigned int ls_flags; - struct nfs_seqid_counter ls_seqid; - nfs4_stateid ls_stateid; - refcount_t ls_count; - fl_owner_t ls_owner; -}; +struct trace_event_data_offsets_jbd2_handle_start_class {}; + +struct trace_event_data_offsets_jbd2_handle_extend {}; + +struct trace_event_data_offsets_jbd2_handle_stats {}; -struct in_addr { - __be32 s_addr; -}; +struct trace_event_data_offsets_jbd2_run_stats {}; -struct sockaddr_in { - __kernel_sa_family_t sin_family; - __be16 sin_port; - struct in_addr sin_addr; - unsigned char __pad[8]; -}; +struct trace_event_data_offsets_jbd2_checkpoint_stats {}; -struct sockaddr_in6 { - short unsigned int sin6_family; - __be16 sin6_port; - __be32 sin6_flowinfo; - struct in6_addr sin6_addr; - __u32 sin6_scope_id; -}; +struct trace_event_data_offsets_jbd2_update_log_tail {}; -typedef u32 rpc_authflavor_t; +struct trace_event_data_offsets_jbd2_write_superblock {}; -enum rpc_auth_flavors { - RPC_AUTH_NULL = 0, - RPC_AUTH_UNIX = 1, - RPC_AUTH_SHORT = 2, - RPC_AUTH_DES = 3, - RPC_AUTH_KRB = 4, - RPC_AUTH_GSS = 6, - RPC_AUTH_MAXFLAVOR = 8, - RPC_AUTH_GSS_KRB5 = 390003, - RPC_AUTH_GSS_KRB5I = 390004, - RPC_AUTH_GSS_KRB5P = 390005, - RPC_AUTH_GSS_LKEY = 390006, - RPC_AUTH_GSS_LKEYI = 390007, - RPC_AUTH_GSS_LKEYP = 390008, - RPC_AUTH_GSS_SPKM = 390009, - RPC_AUTH_GSS_SPKMI = 390010, - RPC_AUTH_GSS_SPKMP = 390011, -}; +struct trace_event_data_offsets_jbd2_lock_buffer_stall {}; -struct xdr_netobj { - unsigned int len; - u8 *data; -}; +typedef void (*btf_trace_jbd2_checkpoint)(void *, journal_t *, int); -struct rpc_rqst; +typedef void (*btf_trace_jbd2_start_commit)(void *, journal_t *, transaction_t *); -struct xdr_stream { - __be32 *p; - struct xdr_buf *buf; - __be32 *end; - struct kvec *iov; - struct kvec scratch; - struct page___2 **page_ptr; - unsigned int nwords; - struct rpc_rqst *rqst; -}; +typedef void (*btf_trace_jbd2_commit_locking)(void *, journal_t *, transaction_t *); -struct rpc_xprt; +typedef void (*btf_trace_jbd2_commit_flushing)(void *, journal_t *, transaction_t *); -struct rpc_task; +typedef void (*btf_trace_jbd2_commit_logging)(void *, journal_t *, transaction_t *); -struct rpc_cred; +typedef void (*btf_trace_jbd2_drop_transaction)(void *, journal_t *, transaction_t *); -struct rpc_rqst { - struct rpc_xprt *rq_xprt; - struct xdr_buf rq_snd_buf; - struct xdr_buf rq_rcv_buf; - struct rpc_task *rq_task; - struct rpc_cred *rq_cred; - __be32 rq_xid; - int rq_cong; - u32 rq_seqno; - int rq_enc_pages_num; - struct page___2 **rq_enc_pages; - void (*rq_release_snd_buf)(struct rpc_rqst *); - union { - struct list_head rq_list; - struct rb_node rq_recv; - }; - struct list_head rq_xmit; - struct list_head rq_xmit2; - void *rq_buffer; - size_t rq_callsize; - void *rq_rbuffer; - size_t rq_rcvsize; - size_t rq_xmit_bytes_sent; - size_t rq_reply_bytes_recvd; - struct xdr_buf rq_private_buf; - long unsigned int rq_majortimeo; - long unsigned int rq_timeout; - ktime_t rq_rtt; - unsigned int rq_retries; - unsigned int rq_connect_cookie; - atomic_t rq_pin; - u32 rq_bytes_sent; - ktime_t rq_xtime; - int rq_ntrans; -}; +typedef void (*btf_trace_jbd2_end_commit)(void *, journal_t *, transaction_t *); -typedef void (*kxdreproc_t)(struct rpc_rqst *, struct xdr_stream *, const void *); +typedef void (*btf_trace_jbd2_submit_inode_data)(void *, struct inode *); -typedef int (*kxdrdproc_t)(struct rpc_rqst *, struct xdr_stream *, void *); +typedef void (*btf_trace_jbd2_handle_start)(void *, dev_t, long unsigned int, unsigned int, unsigned int, int); -struct rpc_procinfo; +typedef void (*btf_trace_jbd2_handle_restart)(void *, dev_t, long unsigned int, unsigned int, unsigned int, int); -struct rpc_message { - const struct rpc_procinfo *rpc_proc; - void *rpc_argp; - void *rpc_resp; - const struct cred___2 *rpc_cred; -}; +typedef void (*btf_trace_jbd2_handle_extend)(void *, dev_t, long unsigned int, unsigned int, unsigned int, int, int); -struct rpc_procinfo { - u32 p_proc; - kxdreproc_t p_encode; - kxdrdproc_t p_decode; - unsigned int p_arglen; - unsigned int p_replen; - unsigned int p_timer; - u32 p_statidx; - const char *p_name; -}; +typedef void (*btf_trace_jbd2_handle_stats)(void *, dev_t, long unsigned int, unsigned int, unsigned int, int, int, int, int); -struct rpc_wait { - struct list_head list; - struct list_head links; - struct list_head timer_list; -}; +typedef void (*btf_trace_jbd2_run_stats)(void *, dev_t, long unsigned int, struct transaction_run_stats_s *); -struct rpc_call_ops; +typedef void (*btf_trace_jbd2_checkpoint_stats)(void *, dev_t, long unsigned int, struct transaction_chp_stats_s *); -struct rpc_clnt; +typedef void (*btf_trace_jbd2_update_log_tail)(void *, journal_t *, tid_t, long unsigned int, long unsigned int); -struct rpc_task { - atomic_t tk_count; - int tk_status; - struct list_head tk_task; - void (*tk_callback)(struct rpc_task *); - void (*tk_action)(struct rpc_task *); - long unsigned int tk_timeout; - long unsigned int tk_runstate; - struct rpc_wait_queue *tk_waitqueue; - union { - struct work_struct tk_work; - struct rpc_wait tk_wait; - } u; - int tk_rpc_status; - struct rpc_message tk_msg; - void *tk_calldata; - const struct rpc_call_ops *tk_ops; - struct rpc_clnt *tk_client; - struct rpc_xprt *tk_xprt; - struct rpc_cred *tk_op_cred; - struct rpc_rqst *tk_rqstp; - struct workqueue_struct *tk_workqueue; - ktime_t tk_start; - pid_t tk_owner; - short unsigned int tk_flags; - short unsigned int tk_timeouts; - short unsigned int tk_pid; - unsigned char tk_priority: 2; - unsigned char tk_garb_retry: 2; - unsigned char tk_cred_retry: 2; - unsigned char tk_rebind_retry: 2; +typedef void (*btf_trace_jbd2_write_superblock)(void *, journal_t *, int); + +typedef void (*btf_trace_jbd2_lock_buffer_stall)(void *, dev_t, long unsigned int); + +struct jbd2_stats_proc_session { + journal_t *journal; + struct transaction_stats_s *stats; + int start; + int max; }; -struct rpc_call_ops { - void (*rpc_call_prepare)(struct rpc_task *, void *); - void (*rpc_call_done)(struct rpc_task *, void *); - void (*rpc_count_stats)(struct rpc_task *, void *); - void (*rpc_release)(void *); +struct ramfs_mount_opts { + umode_t mode; }; -struct rpc_pipe_dir_head { - struct list_head pdh_entries; - struct dentry___2 *pdh_dentry; +struct ramfs_fs_info { + struct ramfs_mount_opts mount_opts; }; -struct rpc_rtt { - long unsigned int timeo; - long unsigned int srtt[5]; - long unsigned int sdrtt[5]; - int ntimeouts[5]; +enum ramfs_param { + Opt_mode___3 = 0, }; -struct rpc_timeout { - long unsigned int to_initval; - long unsigned int to_maxval; - long unsigned int to_increment; - unsigned int to_retries; - unsigned char to_exponential; +enum hugetlbfs_size_type { + NO_SIZE = 0, + SIZE_STD = 1, + SIZE_PERCENT = 2, }; -struct rpc_xprt_switch; +struct hugetlbfs_fs_context { + struct hstate *hstate; + long long unsigned int max_size_opt; + long long unsigned int min_size_opt; + long int max_hpages; + long int nr_inodes; + long int min_hpages; + enum hugetlbfs_size_type max_val_type; + enum hugetlbfs_size_type min_val_type; + kuid_t uid; + kgid_t gid; + umode_t mode; +}; -struct rpc_xprt_iter_ops; +enum hugetlb_param { + Opt_gid___4 = 0, + Opt_min_size = 1, + Opt_mode___4 = 2, + Opt_nr_inodes___2 = 3, + Opt_pagesize = 4, + Opt_size___2 = 5, + Opt_uid___3 = 6, +}; -struct rpc_xprt_iter { - struct rpc_xprt_switch *xpi_xpswitch; - struct rpc_xprt *xpi_cursor; - const struct rpc_xprt_iter_ops *xpi_ops; +typedef u16 wchar_t; + +struct nls_table { + const char *charset; + const char *alias; + int (*uni2char)(wchar_t, unsigned char *, int); + int (*char2uni)(const unsigned char *, int, wchar_t *); + const unsigned char *charset2lower; + const unsigned char *charset2upper; + struct module *owner; + struct nls_table *next; }; -struct rpc_auth; +struct fat_mount_options { + kuid_t fs_uid; + kgid_t fs_gid; + short unsigned int fs_fmask; + short unsigned int fs_dmask; + short unsigned int codepage; + int time_offset; + char *iocharset; + short unsigned int shortname; + unsigned char name_check; + unsigned char errors; + unsigned char nfs; + short unsigned int allow_utime; + unsigned int quiet: 1; + unsigned int showexec: 1; + unsigned int sys_immutable: 1; + unsigned int dotsOK: 1; + unsigned int isvfat: 1; + unsigned int utf8: 1; + unsigned int unicode_xlate: 1; + unsigned int numtail: 1; + unsigned int flush: 1; + unsigned int nocase: 1; + unsigned int usefree: 1; + unsigned int tz_set: 1; + unsigned int rodir: 1; + unsigned int discard: 1; + unsigned int dos1xfloppy: 1; +}; -struct rpc_stat; +struct fatent_operations; -struct rpc_iostats; +struct msdos_sb_info { + short unsigned int sec_per_clus; + short unsigned int cluster_bits; + unsigned int cluster_size; + unsigned char fats; + unsigned char fat_bits; + short unsigned int fat_start; + long unsigned int fat_length; + long unsigned int dir_start; + short unsigned int dir_entries; + long unsigned int data_start; + long unsigned int max_cluster; + long unsigned int root_cluster; + long unsigned int fsinfo_sector; + struct mutex fat_lock; + struct mutex nfs_build_inode_lock; + struct mutex s_lock; + unsigned int prev_free; + unsigned int free_clusters; + unsigned int free_clus_valid; + struct fat_mount_options options; + struct nls_table *nls_disk; + struct nls_table *nls_io; + const void *dir_ops; + int dir_per_block; + int dir_per_block_bits; + unsigned int vol_id; + int fatent_shift; + const struct fatent_operations *fatent_ops; + struct inode *fat_inode; + struct inode *fsinfo_inode; + struct ratelimit_state ratelimit; + spinlock_t inode_hash_lock; + struct hlist_head inode_hashtable[256]; + spinlock_t dir_hash_lock; + struct hlist_head dir_hashtable[256]; + unsigned int dirty; + struct callback_head rcu; +}; -struct rpc_program; +struct fat_entry; -struct rpc_clnt { - atomic_t cl_count; - unsigned int cl_clid; - struct list_head cl_clients; - struct list_head cl_tasks; - spinlock_t cl_lock; - struct rpc_xprt *cl_xprt; - const struct rpc_procinfo *cl_procinfo; - u32 cl_prog; - u32 cl_vers; - u32 cl_maxproc; - struct rpc_auth *cl_auth; - struct rpc_stat *cl_stats; - struct rpc_iostats *cl_metrics; - unsigned int cl_softrtry: 1; - unsigned int cl_softerr: 1; - unsigned int cl_discrtry: 1; - unsigned int cl_noretranstimeo: 1; - unsigned int cl_autobind: 1; - unsigned int cl_chatty: 1; - struct rpc_rtt *cl_rtt; - const struct rpc_timeout *cl_timeout; - atomic_t cl_swapper; - int cl_nodelen; - char cl_nodename[65]; - struct rpc_pipe_dir_head cl_pipedir_objects; - struct rpc_clnt *cl_parent; - struct rpc_rtt cl_rtt_default; - struct rpc_timeout cl_timeout_default; - const struct rpc_program *cl_program; - const char *cl_principal; - struct rpc_xprt_iter cl_xpi; - const struct cred___2 *cl_cred; +struct fatent_operations { + void (*ent_blocknr)(struct super_block *, int, int *, sector_t *); + void (*ent_set_ptr)(struct fat_entry *, int); + int (*ent_bread)(struct super_block *, struct fat_entry *, int, sector_t); + int (*ent_get)(struct fat_entry *); + void (*ent_put)(struct fat_entry *, int); + int (*ent_next)(struct fat_entry *); }; -struct rpc_xprt_ops; +struct msdos_inode_info { + spinlock_t cache_lru_lock; + struct list_head cache_lru; + int nr_caches; + unsigned int cache_valid_id; + loff_t mmu_private; + int i_start; + int i_logstart; + int i_attrs; + loff_t i_pos; + struct hlist_node i_fat_hash; + struct hlist_node i_dir_hash; + struct rw_semaphore truncate_lock; + struct inode vfs_inode; +}; -struct svc_xprt; +struct fat_entry { + int entry; + union { + u8 *ent12_p[2]; + __le16 *ent16_p; + __le32 *ent32_p; + } u; + int nr_bhs; + struct buffer_head *bhs[2]; + struct inode *fat_inode; +}; -struct rpc_xprt { - struct kref kref; - const struct rpc_xprt_ops *ops; - const struct rpc_timeout *timeout; - struct __kernel_sockaddr_storage addr; - size_t addrlen; - int prot; - long unsigned int cong; - long unsigned int cwnd; - size_t max_payload; - struct rpc_wait_queue binding; - struct rpc_wait_queue sending; - struct rpc_wait_queue pending; - struct rpc_wait_queue backlog; - struct list_head free; - unsigned int max_reqs; - unsigned int min_reqs; - unsigned int num_reqs; - long unsigned int state; - unsigned char resvport: 1; - unsigned char reuseport: 1; - atomic_t swapper; - unsigned int bind_index; - struct list_head xprt_switch; - long unsigned int bind_timeout; - long unsigned int reestablish_timeout; - unsigned int connect_cookie; - struct work_struct task_cleanup; - struct timer_list timer; - long unsigned int last_used; - long unsigned int idle_timeout; - long unsigned int connect_timeout; - long unsigned int max_reconnect_timeout; - atomic_long_t queuelen; - spinlock_t transport_lock; - spinlock_t reserve_lock; - spinlock_t queue_lock; - u32 xid; - struct rpc_task *snd_task; - struct list_head xmit_queue; - struct svc_xprt *bc_xprt; - struct rb_root recv_queue; - struct { - long unsigned int bind_count; - long unsigned int connect_count; - long unsigned int connect_start; - long unsigned int connect_time; - long unsigned int sends; - long unsigned int recvs; - long unsigned int bad_xids; - long unsigned int max_slots; - long long unsigned int req_u; - long long unsigned int bklog_u; - long long unsigned int sending_u; - long long unsigned int pending_u; - } stat; - struct net___2 *xprt_net; - const char *servername; - const char *address_strings[6]; - struct callback_head rcu; +struct fat_cache { + struct list_head cache_list; + int nr_contig; + int fcluster; + int dcluster; }; -struct rpc_credops; +struct fat_cache_id { + unsigned int id; + int nr_contig; + int fcluster; + int dcluster; +}; -struct rpc_cred { - struct hlist_node cr_hash; - struct list_head cr_lru; - struct callback_head cr_rcu; - struct rpc_auth *cr_auth; - const struct rpc_credops *cr_ops; - long unsigned int cr_expire; - long unsigned int cr_flags; - refcount_t cr_count; - const struct cred___2 *cr_cred; +struct compat_dirent { + u32 d_ino; + compat_off_t d_off; + u16 d_reclen; + char d_name[256]; }; -struct rpc_task_setup { - struct rpc_task *task; - struct rpc_clnt *rpc_client; - struct rpc_xprt *rpc_xprt; - struct rpc_cred *rpc_op_cred; - const struct rpc_message *rpc_message; - const struct rpc_call_ops *callback_ops; - void *callback_data; - struct workqueue_struct *workqueue; - short unsigned int flags; - signed char priority; +enum utf16_endian { + UTF16_HOST_ENDIAN = 0, + UTF16_LITTLE_ENDIAN = 1, + UTF16_BIG_ENDIAN = 2, }; -enum rpc_display_format_t { - RPC_DISPLAY_ADDR = 0, - RPC_DISPLAY_PORT = 1, - RPC_DISPLAY_PROTO = 2, - RPC_DISPLAY_HEX_ADDR = 3, - RPC_DISPLAY_HEX_PORT = 4, - RPC_DISPLAY_NETID = 5, - RPC_DISPLAY_MAX = 6, +struct __fat_dirent { + long int d_ino; + __kernel_off_t d_off; + short unsigned int d_reclen; + char d_name[256]; }; -struct rpc_xprt_ops { - void (*set_buffer_size)(struct rpc_xprt *, size_t, size_t); - int (*reserve_xprt)(struct rpc_xprt *, struct rpc_task *); - void (*release_xprt)(struct rpc_xprt *, struct rpc_task *); - void (*alloc_slot)(struct rpc_xprt *, struct rpc_task *); - void (*free_slot)(struct rpc_xprt *, struct rpc_rqst *); - void (*rpcbind)(struct rpc_task *); - void (*set_port)(struct rpc_xprt *, short unsigned int); - void (*connect)(struct rpc_xprt *, struct rpc_task *); - int (*buf_alloc)(struct rpc_task *); - void (*buf_free)(struct rpc_task *); - void (*prepare_request)(struct rpc_rqst *); - int (*send_request)(struct rpc_rqst *); - void (*wait_for_reply_request)(struct rpc_task *); - void (*timer)(struct rpc_xprt *, struct rpc_task *); - void (*release_request)(struct rpc_task *); - void (*close)(struct rpc_xprt *); - void (*destroy)(struct rpc_xprt *); - void (*set_connect_timeout)(struct rpc_xprt *, long unsigned int, long unsigned int); - void (*print_stats)(struct rpc_xprt *, struct seq_file *); - int (*enable_swap)(struct rpc_xprt *); - void (*disable_swap)(struct rpc_xprt *); - void (*inject_disconnect)(struct rpc_xprt *); - int (*bc_setup)(struct rpc_xprt *, unsigned int); - size_t (*bc_maxpayload)(struct rpc_xprt *); - unsigned int (*bc_num_slots)(struct rpc_xprt *); - void (*bc_free_rqst)(struct rpc_rqst *); - void (*bc_destroy)(struct rpc_xprt *, unsigned int); +struct msdos_dir_entry { + __u8 name[11]; + __u8 attr; + __u8 lcase; + __u8 ctime_cs; + __le16 ctime; + __le16 cdate; + __le16 adate; + __le16 starthi; + __le16 time; + __le16 date; + __le16 start; + __le32 size; }; -enum xprt_transports { - XPRT_TRANSPORT_UDP = 17, - XPRT_TRANSPORT_TCP = 6, - XPRT_TRANSPORT_BC_TCP = -2147483642, - XPRT_TRANSPORT_RDMA = 256, - XPRT_TRANSPORT_BC_RDMA = -2147483392, - XPRT_TRANSPORT_LOCAL = 257, +struct msdos_dir_slot { + __u8 id; + __u8 name0_4[10]; + __u8 attr; + __u8 reserved; + __u8 alias_checksum; + __u8 name5_10[12]; + __le16 start; + __u8 name11_12[4]; }; -struct svc_xprt_class; - -struct svc_xprt_ops; +struct fat_slot_info { + loff_t i_pos; + loff_t slot_off; + int nr_slots; + struct msdos_dir_entry *de; + struct buffer_head *bh; +}; -struct svc_serv; +typedef long long unsigned int llu; -struct svc_xprt { - struct svc_xprt_class *xpt_class; - const struct svc_xprt_ops *xpt_ops; - struct kref xpt_ref; - struct list_head xpt_list; - struct list_head xpt_ready; - long unsigned int xpt_flags; - struct svc_serv *xpt_server; - atomic_t xpt_reserved; - atomic_t xpt_nr_rqsts; - struct mutex xpt_mutex; - spinlock_t xpt_lock; - void *xpt_auth_cache; - struct list_head xpt_deferred; - struct __kernel_sockaddr_storage xpt_local; - size_t xpt_locallen; - struct __kernel_sockaddr_storage xpt_remote; - size_t xpt_remotelen; - char xpt_remotebuf[58]; - struct list_head xpt_users; - struct net___2 *xpt_net; - const struct cred___2 *xpt_cred; - struct rpc_xprt *xpt_bc_xprt; - struct rpc_xprt_switch *xpt_bc_xps; +enum { + PARSE_INVALID = 1, + PARSE_NOT_LONGNAME = 2, + PARSE_EOF = 3, }; -struct rpc_xprt_switch { - spinlock_t xps_lock; - struct kref xps_kref; - unsigned int xps_nxprts; - unsigned int xps_nactive; - atomic_long_t xps_queuelen; - struct list_head xps_xprt_list; - struct net___2 *xps_net; - const struct rpc_xprt_iter_ops *xps_iter_ops; - struct callback_head xps_rcu; +struct fat_ioctl_filldir_callback { + struct dir_context ctx; + void *dirent; + int result; + const char *longname; + int long_len; + const char *shortname; + int short_len; }; -struct auth_cred { - const struct cred___2 *cred; - const char *principal; +struct fat_boot_sector { + __u8 ignored[3]; + __u8 system_id[8]; + __u8 sector_size[2]; + __u8 sec_per_clus; + __le16 reserved; + __u8 fats; + __u8 dir_entries[2]; + __u8 sectors[2]; + __u8 media; + __le16 fat_length; + __le16 secs_track; + __le16 heads; + __le32 hidden; + __le32 total_sect; + union { + struct { + __u8 drive_number; + __u8 state; + __u8 signature; + __u8 vol_id[4]; + __u8 vol_label[11]; + __u8 fs_type[8]; + } fat16; + struct { + __le32 length; + __le16 flags; + __u8 version[2]; + __le32 root_cluster; + __le16 info_sector; + __le16 backup_boot; + __le16 reserved2[6]; + __u8 drive_number; + __u8 state; + __u8 signature; + __u8 vol_id[4]; + __u8 vol_label[11]; + __u8 fs_type[8]; + } fat32; + }; }; -struct rpc_authops; +struct fat_boot_fsinfo { + __le32 signature1; + __le32 reserved1[120]; + __le32 signature2; + __le32 free_clusters; + __le32 next_cluster; + __le32 reserved2[4]; +}; -struct rpc_cred_cache; +struct fat_bios_param_block { + u16 fat_sector_size; + u8 fat_sec_per_clus; + u16 fat_reserved; + u8 fat_fats; + u16 fat_dir_entries; + u16 fat_sectors; + u16 fat_fat_length; + u32 fat_total_sect; + u8 fat16_state; + u32 fat16_vol_id; + u32 fat32_length; + u32 fat32_root_cluster; + u16 fat32_info_sector; + u8 fat32_state; + u32 fat32_vol_id; +}; -struct rpc_auth { - unsigned int au_cslack; - unsigned int au_rslack; - unsigned int au_verfsize; - unsigned int au_ralign; - unsigned int au_flags; - const struct rpc_authops *au_ops; - rpc_authflavor_t au_flavor; - refcount_t au_count; - struct rpc_cred_cache *au_credcache; +struct fat_floppy_defaults { + unsigned int nr_sectors; + unsigned int sec_per_clus; + unsigned int dir_entries; + unsigned int media; + unsigned int fat_length; }; -struct rpc_credops { - const char *cr_name; - int (*cr_init)(struct rpc_auth *, struct rpc_cred *); - void (*crdestroy)(struct rpc_cred *); - int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); - int (*crmarshal)(struct rpc_task *, struct xdr_stream *); - int (*crrefresh)(struct rpc_task *); - int (*crvalidate)(struct rpc_task *, struct xdr_stream *); - int (*crwrap_req)(struct rpc_task *, struct xdr_stream *); - int (*crunwrap_resp)(struct rpc_task *, struct xdr_stream *); - int (*crkey_timeout)(struct rpc_cred *); - char * (*crstringify_acceptor)(struct rpc_cred *); - bool (*crneed_reencode)(struct rpc_task *); +enum { + Opt_check_n = 0, + Opt_check_r = 1, + Opt_check_s = 2, + Opt_uid___4 = 3, + Opt_gid___5 = 4, + Opt_umask = 5, + Opt_dmask = 6, + Opt_fmask = 7, + Opt_allow_utime = 8, + Opt_codepage = 9, + Opt_usefree = 10, + Opt_nocase = 11, + Opt_quiet = 12, + Opt_showexec = 13, + Opt_debug___2 = 14, + Opt_immutable = 15, + Opt_dots = 16, + Opt_nodots = 17, + Opt_charset = 18, + Opt_shortname_lower = 19, + Opt_shortname_win95 = 20, + Opt_shortname_winnt = 21, + Opt_shortname_mixed = 22, + Opt_utf8_no = 23, + Opt_utf8_yes = 24, + Opt_uni_xl_no = 25, + Opt_uni_xl_yes = 26, + Opt_nonumtail_no = 27, + Opt_nonumtail_yes = 28, + Opt_obsolete = 29, + Opt_flush = 30, + Opt_tz_utc = 31, + Opt_rodir = 32, + Opt_err_cont___2 = 33, + Opt_err_panic___2 = 34, + Opt_err_ro___2 = 35, + Opt_discard___2 = 36, + Opt_nfs = 37, + Opt_time_offset = 38, + Opt_nfs_stale_rw = 39, + Opt_nfs_nostale_ro = 40, + Opt_err___3 = 41, + Opt_dos1xfloppy = 42, }; -struct rpc_auth_create_args; +struct fat_fid { + u32 i_gen; + u32 i_pos_low; + u16 i_pos_hi; + u16 parent_i_pos_hi; + u32 parent_i_pos_low; + u32 parent_i_gen; +}; -struct rpcsec_gss_info; +struct shortname_info { + unsigned char lower: 1; + unsigned char upper: 1; + unsigned char valid: 1; +}; -struct rpc_authops { - struct module___2 *owner; - rpc_authflavor_t au_flavor; - char *au_name; - struct rpc_auth * (*create)(const struct rpc_auth_create_args *, struct rpc_clnt *); - void (*destroy)(struct rpc_auth *); - int (*hash_cred)(struct auth_cred *, unsigned int); - struct rpc_cred * (*lookup_cred)(struct rpc_auth *, struct auth_cred *, int); - struct rpc_cred * (*crcreate)(struct rpc_auth *, struct auth_cred *, int, gfp_t); - int (*list_pseudoflavors)(rpc_authflavor_t *, int); - rpc_authflavor_t (*info2flavor)(struct rpcsec_gss_info *); - int (*flavor2info)(rpc_authflavor_t, struct rpcsec_gss_info *); - int (*key_timeout)(struct rpc_auth *, struct rpc_cred *); +struct iso_directory_record { + __u8 length[1]; + __u8 ext_attr_length[1]; + __u8 extent[8]; + __u8 size[8]; + __u8 date[7]; + __u8 flags[1]; + __u8 file_unit_size[1]; + __u8 interleave[1]; + __u8 volume_sequence_number[4]; + __u8 name_len[1]; + char name[0]; }; -struct rpc_auth_create_args { - rpc_authflavor_t pseudoflavor; - const char *target_name; +struct iso_inode_info { + long unsigned int i_iget5_block; + long unsigned int i_iget5_offset; + unsigned int i_first_extent; + unsigned char i_file_format; + unsigned char i_format_parm[3]; + long unsigned int i_next_section_block; + long unsigned int i_next_section_offset; + off_t i_section_size; + struct inode vfs_inode; }; -struct rpcsec_gss_oid { - unsigned int len; - u8 data[32]; +struct isofs_sb_info { + long unsigned int s_ninodes; + long unsigned int s_nzones; + long unsigned int s_firstdatazone; + long unsigned int s_log_zone_size; + long unsigned int s_max_size; + int s_rock_offset; + s32 s_sbsector; + unsigned char s_joliet_level; + unsigned char s_mapping; + unsigned char s_check; + unsigned char s_session; + unsigned int s_high_sierra: 1; + unsigned int s_rock: 2; + unsigned int s_utf8: 1; + unsigned int s_cruft: 1; + unsigned int s_nocompress: 1; + unsigned int s_hide: 1; + unsigned int s_showassoc: 1; + unsigned int s_overriderockperm: 1; + unsigned int s_uid_set: 1; + unsigned int s_gid_set: 1; + umode_t s_fmode; + umode_t s_dmode; + kgid_t s_gid; + kuid_t s_uid; + struct nls_table *s_nls_iocharset; }; -struct rpcsec_gss_info { - struct rpcsec_gss_oid oid; - u32 qop; - u32 service; +struct cdrom_msf0 { + __u8 minute; + __u8 second; + __u8 frame; }; -struct rpc_stat { - const struct rpc_program *program; - unsigned int netcnt; - unsigned int netudpcnt; - unsigned int nettcpcnt; - unsigned int nettcpconn; - unsigned int netreconn; - unsigned int rpccnt; - unsigned int rpcretrans; - unsigned int rpcauthrefresh; - unsigned int rpcgarbage; +union cdrom_addr { + struct cdrom_msf0 msf; + int lba; }; -struct rpc_version; +struct cdrom_tocentry { + __u8 cdte_track; + __u8 cdte_adr: 4; + __u8 cdte_ctrl: 4; + __u8 cdte_format; + union cdrom_addr cdte_addr; + __u8 cdte_datamode; +}; -struct rpc_program { - const char *name; - u32 number; - unsigned int nrvers; - const struct rpc_version **version; - struct rpc_stat *stats; - const char *pipe_dir_name; +struct cdrom_multisession { + union cdrom_addr addr; + __u8 xa_flag; + __u8 addr_format; }; -struct svc_program; +struct iso_volume_descriptor { + __u8 type[1]; + char id[5]; + __u8 version[1]; + __u8 data[2041]; +}; -struct svc_stat { - struct svc_program *program; - unsigned int netcnt; - unsigned int netudpcnt; - unsigned int nettcpcnt; - unsigned int nettcpconn; - unsigned int rpccnt; - unsigned int rpcbadfmt; - unsigned int rpcbadauth; - unsigned int rpcbadclnt; +struct iso_primary_descriptor { + __u8 type[1]; + char id[5]; + __u8 version[1]; + __u8 unused1[1]; + char system_id[32]; + char volume_id[32]; + __u8 unused2[8]; + __u8 volume_space_size[8]; + __u8 unused3[32]; + __u8 volume_set_size[4]; + __u8 volume_sequence_number[4]; + __u8 logical_block_size[4]; + __u8 path_table_size[8]; + __u8 type_l_path_table[4]; + __u8 opt_type_l_path_table[4]; + __u8 type_m_path_table[4]; + __u8 opt_type_m_path_table[4]; + __u8 root_directory_record[34]; + char volume_set_id[128]; + char publisher_id[128]; + char preparer_id[128]; + char application_id[128]; + char copyright_file_id[37]; + char abstract_file_id[37]; + char bibliographic_file_id[37]; + __u8 creation_date[17]; + __u8 modification_date[17]; + __u8 expiration_date[17]; + __u8 effective_date[17]; + __u8 file_structure_version[1]; + __u8 unused4[1]; + __u8 application_data[512]; + __u8 unused5[653]; }; -struct svc_version; +struct iso_supplementary_descriptor { + __u8 type[1]; + char id[5]; + __u8 version[1]; + __u8 flags[1]; + char system_id[32]; + char volume_id[32]; + __u8 unused2[8]; + __u8 volume_space_size[8]; + __u8 escape[32]; + __u8 volume_set_size[4]; + __u8 volume_sequence_number[4]; + __u8 logical_block_size[4]; + __u8 path_table_size[8]; + __u8 type_l_path_table[4]; + __u8 opt_type_l_path_table[4]; + __u8 type_m_path_table[4]; + __u8 opt_type_m_path_table[4]; + __u8 root_directory_record[34]; + char volume_set_id[128]; + char publisher_id[128]; + char preparer_id[128]; + char application_id[128]; + char copyright_file_id[37]; + char abstract_file_id[37]; + char bibliographic_file_id[37]; + __u8 creation_date[17]; + __u8 modification_date[17]; + __u8 expiration_date[17]; + __u8 effective_date[17]; + __u8 file_structure_version[1]; + __u8 unused4[1]; + __u8 application_data[512]; + __u8 unused5[653]; +}; -struct svc_rqst; +struct hs_volume_descriptor { + __u8 foo[8]; + __u8 type[1]; + char id[5]; + __u8 version[1]; + __u8 data[2033]; +}; -struct svc_process_info; +struct hs_primary_descriptor { + __u8 foo[8]; + __u8 type[1]; + __u8 id[5]; + __u8 version[1]; + __u8 unused1[1]; + char system_id[32]; + char volume_id[32]; + __u8 unused2[8]; + __u8 volume_space_size[8]; + __u8 unused3[32]; + __u8 volume_set_size[4]; + __u8 volume_sequence_number[4]; + __u8 logical_block_size[4]; + __u8 path_table_size[8]; + __u8 type_l_path_table[4]; + __u8 unused4[28]; + __u8 root_directory_record[34]; +}; -struct svc_program { - struct svc_program *pg_next; - u32 pg_prog; - unsigned int pg_lovers; - unsigned int pg_hivers; - unsigned int pg_nvers; - const struct svc_version **pg_vers; - char *pg_name; - char *pg_class; - struct svc_stat *pg_stats; - int (*pg_authenticate)(struct svc_rqst *); - __be32 (*pg_init_request)(struct svc_rqst *, const struct svc_program *, struct svc_process_info *); - int (*pg_rpcbind_set)(struct net___2 *, const struct svc_program *, u32, int, short unsigned int, short unsigned int); +enum isofs_file_format { + isofs_file_normal = 0, + isofs_file_sparse = 1, + isofs_file_compressed = 2, }; -struct rpc_pipe_msg { - struct list_head list; - void *data; - size_t len; - size_t copied; - int errno; +struct iso9660_options { + unsigned int rock: 1; + unsigned int joliet: 1; + unsigned int cruft: 1; + unsigned int hide: 1; + unsigned int showassoc: 1; + unsigned int nocompress: 1; + unsigned int overriderockperm: 1; + unsigned int uid_set: 1; + unsigned int gid_set: 1; + unsigned int utf8: 1; + unsigned char map; + unsigned char check; + unsigned int blocksize; + umode_t fmode; + umode_t dmode; + kgid_t gid; + kuid_t uid; + char *iocharset; + s32 session; + s32 sbsector; }; -struct rpc_pipe_ops { - ssize_t (*upcall)(struct file___2 *, struct rpc_pipe_msg *, char *, size_t); - ssize_t (*downcall)(struct file___2 *, const char *, size_t); - void (*release_pipe)(struct inode___2 *); - int (*open_pipe)(struct inode___2 *); - void (*destroy_msg)(struct rpc_pipe_msg *); +enum { + Opt_block = 0, + Opt_check_r___2 = 1, + Opt_check_s___2 = 2, + Opt_cruft = 3, + Opt_gid___6 = 4, + Opt_ignore = 5, + Opt_iocharset = 6, + Opt_map_a = 7, + Opt_map_n = 8, + Opt_map_o = 9, + Opt_mode___5 = 10, + Opt_nojoliet = 11, + Opt_norock = 12, + Opt_sb___2 = 13, + Opt_session = 14, + Opt_uid___5 = 15, + Opt_unhide = 16, + Opt_utf8 = 17, + Opt_err___4 = 18, + Opt_nocompress = 19, + Opt_hide = 20, + Opt_showassoc = 21, + Opt_dmode = 22, + Opt_overriderockperm = 23, }; -struct rpc_pipe { - struct list_head pipe; - struct list_head in_upcall; - struct list_head in_downcall; - int pipelen; - int nreaders; - int nwriters; - int flags; - struct delayed_work queue_timeout; - const struct rpc_pipe_ops *ops; - spinlock_t lock; - struct dentry___2 *dentry; +struct isofs_iget5_callback_data { + long unsigned int block; + long unsigned int offset; }; -struct rpc_xprt_iter_ops { - void (*xpi_rewind)(struct rpc_xprt_iter *); - struct rpc_xprt * (*xpi_xprt)(struct rpc_xprt_iter *); - struct rpc_xprt * (*xpi_next)(struct rpc_xprt_iter *); +struct SU_SP_s { + __u8 magic[2]; + __u8 skip; }; -struct rpc_iostats { - spinlock_t om_lock; - long unsigned int om_ops; - long unsigned int om_ntrans; - long unsigned int om_timeouts; - long long unsigned int om_bytes_sent; - long long unsigned int om_bytes_recv; - ktime_t om_queue; - ktime_t om_rtt; - ktime_t om_execute; - long unsigned int om_error_status; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; +struct SU_CE_s { + __u8 extent[8]; + __u8 offset[8]; + __u8 size[8]; }; -struct rpc_version { - u32 number; - unsigned int nrprocs; - const struct rpc_procinfo *procs; - unsigned int *counts; +struct SU_ER_s { + __u8 len_id; + __u8 len_des; + __u8 len_src; + __u8 ext_ver; + __u8 data[0]; }; -struct rpc_create_args { - struct net___2 *net; - int protocol; - struct sockaddr *address; - size_t addrsize; - struct sockaddr *saddress; - const struct rpc_timeout *timeout; - const char *servername; - const char *nodename; - const struct rpc_program *program; - u32 prognumber; - u32 version; - rpc_authflavor_t authflavor; - u32 nconnect; - long unsigned int flags; - char *client_name; - struct svc_xprt *bc_xprt; - const struct cred___2 *cred; +struct RR_RR_s { + __u8 flags[1]; }; -struct nfs_fh { - short unsigned int size; - unsigned char data[128]; +struct RR_PX_s { + __u8 mode[8]; + __u8 n_links[8]; + __u8 uid[8]; + __u8 gid[8]; }; -enum nfs3_stable_how { - NFS_UNSTABLE = 0, - NFS_DATA_SYNC = 1, - NFS_FILE_SYNC = 2, - NFS_INVALID_STABLE_HOW = -1, +struct RR_PN_s { + __u8 dev_high[8]; + __u8 dev_low[8]; }; -struct nfs4_label { - uint32_t lfs; - uint32_t pi; - u32 len; - char *label; +struct SL_component { + __u8 flags; + __u8 len; + __u8 text[0]; }; -typedef struct { - char data[8]; -} nfs4_verifier; - -struct gss_api_mech; - -struct gss_ctx { - struct gss_api_mech *mech_type; - void *internal_ctx_id; +struct RR_SL_s { + __u8 flags; + struct SL_component link; }; -struct gss_api_ops; - -struct pf_desc; - -struct gss_api_mech { - struct list_head gm_list; - struct module___2 *gm_owner; - struct rpcsec_gss_oid gm_oid; - char *gm_name; - const struct gss_api_ops *gm_ops; - int gm_pf_num; - struct pf_desc *gm_pfs; - const char *gm_upcall_enctypes; +struct RR_NM_s { + __u8 flags; + char name[0]; }; -struct pf_desc { - u32 pseudoflavor; - u32 qop; - u32 service; - char *name; - char *auth_domain_name; - bool datatouch; +struct RR_CL_s { + __u8 location[8]; }; -struct gss_api_ops { - int (*gss_import_sec_context)(const void *, size_t, struct gss_ctx *, time_t *, gfp_t); - u32 (*gss_get_mic)(struct gss_ctx *, struct xdr_buf *, struct xdr_netobj *); - u32 (*gss_verify_mic)(struct gss_ctx *, struct xdr_buf *, struct xdr_netobj *); - u32 (*gss_wrap)(struct gss_ctx *, int, struct xdr_buf *, struct page___2 **); - u32 (*gss_unwrap)(struct gss_ctx *, int, struct xdr_buf *); - void (*gss_delete_sec_context)(void *); +struct RR_PL_s { + __u8 location[8]; }; -struct nfs4_string { - unsigned int len; - char *data; +struct stamp { + __u8 time[7]; }; -struct nfs_fsid { - uint64_t major; - uint64_t minor; +struct RR_TF_s { + __u8 flags; + struct stamp times[0]; }; -struct nfs4_threshold { - __u32 bm; - __u32 l_type; - __u64 rd_sz; - __u64 wr_sz; - __u64 rd_io_sz; - __u64 wr_io_sz; +struct RR_ZF_s { + __u8 algorithm[2]; + __u8 parms[2]; + __u8 real_size[8]; }; -struct nfs_fattr { - unsigned int valid; - umode_t mode; - __u32 nlink; - kuid_t uid; - kgid_t gid; - dev_t rdev; - __u64 size; +struct rock_ridge { + __u8 signature[2]; + __u8 len; + __u8 version; union { - struct { - __u32 blocksize; - __u32 blocks; - } nfs2; - struct { - __u64 used; - } nfs3; - } du; - struct nfs_fsid fsid; - __u64 fileid; - __u64 mounted_on_fileid; - struct timespec64 atime; - struct timespec64 mtime; - struct timespec64 ctime; - __u64 change_attr; - __u64 pre_change_attr; - __u64 pre_size; - struct timespec64 pre_mtime; - struct timespec64 pre_ctime; - long unsigned int time_start; - long unsigned int gencount; - struct nfs4_string *owner_name; - struct nfs4_string *group_name; - struct nfs4_threshold *mdsthreshold; + struct SU_SP_s SP; + struct SU_CE_s CE; + struct SU_ER_s ER; + struct RR_RR_s RR; + struct RR_PX_s PX; + struct RR_PN_s PN; + struct RR_SL_s SL; + struct RR_NM_s NM; + struct RR_CL_s CL; + struct RR_PL_s PL; + struct RR_TF_s TF; + struct RR_ZF_s ZF; + } u; }; -struct nfs_fsinfo { - struct nfs_fattr *fattr; - __u32 rtmax; - __u32 rtpref; - __u32 rtmult; - __u32 wtmax; - __u32 wtpref; - __u32 wtmult; - __u32 dtpref; - __u64 maxfilesize; - struct timespec64 time_delta; - __u32 lease_time; - __u32 nlayouttypes; - __u32 layouttype[8]; - __u32 blksize; - __u32 clone_blksize; +struct rock_state { + void *buffer; + unsigned char *chr; + int len; + int cont_size; + int cont_extent; + int cont_offset; + int cont_loops; + struct inode *inode; }; -struct nfs_fsstat { - struct nfs_fattr *fattr; - __u64 tbytes; - __u64 fbytes; - __u64 abytes; - __u64 tfiles; - __u64 ffiles; - __u64 afiles; +struct isofs_fid { + u32 block; + u16 offset; + u16 parent_offset; + u32 generation; + u32 parent_block; + u32 parent_generation; }; -struct nfs_pathconf { - struct nfs_fattr *fattr; - __u32 max_link; - __u32 max_namelen; -}; +typedef unsigned char Byte; -struct nfs4_change_info { - u32 atomic; - u64 before; - u64 after; -}; +typedef long unsigned int uLong; -struct nfs4_slot; +struct internal_state; -struct nfs4_sequence_args { - struct nfs4_slot *sa_slot; - u8 sa_cache_this: 1; - u8 sa_privileged: 1; +struct z_stream_s { + const Byte *next_in; + uLong avail_in; + uLong total_in; + Byte *next_out; + uLong avail_out; + uLong total_out; + char *msg; + struct internal_state *state; + void *workspace; + int data_type; + uLong adler; + uLong reserved; }; -struct nfs4_sequence_res { - struct nfs4_slot *sr_slot; - long unsigned int sr_timestamp; - int sr_status; - u32 sr_status_flags; - u32 sr_highest_slotid; - u32 sr_target_highest_slotid; +struct internal_state { + int dummy; }; -struct pnfs_layout_range { - u32 iomode; - u64 offset; - u64 length; -}; +typedef struct z_stream_s z_stream; -struct nfs_open_context; +typedef __kernel_old_time_t time_t; -struct nfs_lock_context { - refcount_t count; +struct nfs_seqid_counter { + ktime_t create_time; + int owner_id; + int flags; + u32 counter; + spinlock_t lock; struct list_head list; - struct nfs_open_context *open_context; - fl_owner_t lockowner; - atomic_t io_count; - struct callback_head callback_head; + struct rpc_wait_queue wait; }; -struct nfs_open_context { - struct nfs_lock_context lock_context; - fl_owner_t flock_owner; - struct dentry___2 *dentry; - const struct cred___2 *cred; - struct rpc_cred *ll_cred; - struct nfs4_state *state; - fmode_t mode; - long unsigned int flags; - int error; - struct list_head list; - struct nfs4_threshold *mdsthreshold; - struct callback_head callback_head; +struct nfs4_lock_state { + struct list_head ls_locks; + struct nfs4_state *ls_state; + long unsigned int ls_flags; + struct nfs_seqid_counter ls_seqid; + nfs4_stateid ls_stateid; + refcount_t ls_count; + fl_owner_t ls_owner; }; -struct nlm_host; +struct in_addr { + __be32 s_addr; +}; -struct nfs_auth_info { - unsigned int flavor_len; - rpc_authflavor_t flavors[12]; +struct sockaddr_in { + __kernel_sa_family_t sin_family; + __be16 sin_port; + struct in_addr sin_addr; + unsigned char __pad[8]; }; -struct pnfs_layoutdriver_type; +struct sockaddr_in6 { + short unsigned int sin6_family; + __be16 sin6_port; + __be32 sin6_flowinfo; + struct in6_addr sin6_addr; + __u32 sin6_scope_id; +}; -struct nfs_client; +enum rpc_auth_flavors { + RPC_AUTH_NULL = 0, + RPC_AUTH_UNIX = 1, + RPC_AUTH_SHORT = 2, + RPC_AUTH_DES = 3, + RPC_AUTH_KRB = 4, + RPC_AUTH_GSS = 6, + RPC_AUTH_MAXFLAVOR = 8, + RPC_AUTH_GSS_KRB5 = 390003, + RPC_AUTH_GSS_KRB5I = 390004, + RPC_AUTH_GSS_KRB5P = 390005, + RPC_AUTH_GSS_LKEY = 390006, + RPC_AUTH_GSS_LKEYI = 390007, + RPC_AUTH_GSS_LKEYP = 390008, + RPC_AUTH_GSS_SPKM = 390009, + RPC_AUTH_GSS_SPKMI = 390010, + RPC_AUTH_GSS_SPKMP = 390011, +}; -struct nfs_iostats; +struct xdr_netobj { + unsigned int len; + u8 *data; +}; -struct nfs_server { - struct nfs_client *nfs_client; - struct list_head client_link; - struct list_head master_link; - struct rpc_clnt *client; - struct rpc_clnt *client_acl; - struct nlm_host *nlm_host; - struct nfs_iostats *io_stats; - atomic_long_t writeback; - int flags; - unsigned int caps; - unsigned int rsize; - unsigned int rpages; - unsigned int wsize; - unsigned int wpages; - unsigned int wtmult; - unsigned int dtsize; - short unsigned int port; - unsigned int bsize; - unsigned int acregmin; - unsigned int acregmax; - unsigned int acdirmin; - unsigned int acdirmax; - unsigned int namelen; - unsigned int options; - unsigned int clone_blksize; - struct nfs_fsid fsid; - __u64 maxfilesize; - struct timespec64 time_delta; - long unsigned int mount_time; - struct super_block___2 *super; - dev_t s_dev; - struct nfs_auth_info auth_info; - u32 pnfs_blksize; - u32 attr_bitmask[3]; - u32 attr_bitmask_nl[3]; - u32 exclcreat_bitmask[3]; - u32 cache_consistency_bitmask[3]; - u32 acl_bitmask; - u32 fh_expire_type; - struct pnfs_layoutdriver_type *pnfs_curr_ld; - struct rpc_wait_queue roc_rpcwaitq; - void *pnfs_ld_data; - struct rb_root state_owners; - struct ida openowner_id; - struct ida lockowner_id; - struct list_head state_owners_lru; - struct list_head layouts; - struct list_head delegations; - struct list_head ss_copies; - long unsigned int mig_gen; - long unsigned int mig_status; - void (*destroy)(struct nfs_server *); - atomic_t active; - struct __kernel_sockaddr_storage mountd_address; - size_t mountd_addrlen; - u32 mountd_version; - short unsigned int mountd_port; - short unsigned int mountd_protocol; - struct rpc_wait_queue uoc_rpcwaitq; - unsigned int read_hdrsize; - const struct cred___2 *cred; +struct rpc_task_setup { + struct rpc_task *task; + struct rpc_clnt *rpc_client; + struct rpc_xprt *rpc_xprt; + struct rpc_cred *rpc_op_cred; + const struct rpc_message *rpc_message; + const struct rpc_call_ops *callback_ops; + void *callback_data; + struct workqueue_struct *workqueue; + short unsigned int flags; + signed char priority; }; -struct pnfs_layout_hdr; +enum rpc_display_format_t { + RPC_DISPLAY_ADDR = 0, + RPC_DISPLAY_PORT = 1, + RPC_DISPLAY_PROTO = 2, + RPC_DISPLAY_HEX_ADDR = 3, + RPC_DISPLAY_HEX_PORT = 4, + RPC_DISPLAY_NETID = 5, + RPC_DISPLAY_MAX = 6, +}; -struct nfs41_server_owner; +enum xprt_transports { + XPRT_TRANSPORT_UDP = 17, + XPRT_TRANSPORT_TCP = 6, + XPRT_TRANSPORT_BC_TCP = 2147483654, + XPRT_TRANSPORT_RDMA = 256, + XPRT_TRANSPORT_BC_RDMA = 2147483904, + XPRT_TRANSPORT_LOCAL = 257, +}; -struct nfs41_server_scope; +struct svc_xprt_class; -struct nfs41_impl_id; +struct svc_xprt_ops; -struct nfs_rpc_ops; +struct svc_serv; -struct nfs_subversion; +struct svc_xprt { + struct svc_xprt_class *xpt_class; + const struct svc_xprt_ops *xpt_ops; + struct kref xpt_ref; + struct list_head xpt_list; + struct list_head xpt_ready; + long unsigned int xpt_flags; + struct svc_serv *xpt_server; + atomic_t xpt_reserved; + atomic_t xpt_nr_rqsts; + struct mutex xpt_mutex; + spinlock_t xpt_lock; + void *xpt_auth_cache; + struct list_head xpt_deferred; + struct __kernel_sockaddr_storage xpt_local; + size_t xpt_locallen; + struct __kernel_sockaddr_storage xpt_remote; + size_t xpt_remotelen; + char xpt_remotebuf[58]; + struct list_head xpt_users; + struct net *xpt_net; + const struct cred *xpt_cred; + struct rpc_xprt *xpt_bc_xprt; + struct rpc_xprt_switch *xpt_bc_xps; +}; -struct idmap; +struct svc_program; -struct nfs4_minor_version_ops; +struct svc_stat { + struct svc_program *program; + unsigned int netcnt; + unsigned int netudpcnt; + unsigned int nettcpcnt; + unsigned int nettcpconn; + unsigned int rpccnt; + unsigned int rpcbadfmt; + unsigned int rpcbadauth; + unsigned int rpcbadclnt; +}; -struct nfs4_slot_table; +struct svc_version; -struct nfs4_session; +struct svc_rqst; -struct nfs_client { - refcount_t cl_count; - atomic_t cl_mds_count; - int cl_cons_state; - long unsigned int cl_res_state; - long unsigned int cl_flags; - struct __kernel_sockaddr_storage cl_addr; - size_t cl_addrlen; - char *cl_hostname; - char *cl_acceptor; - struct list_head cl_share_link; - struct list_head cl_superblocks; - struct rpc_clnt *cl_rpcclient; - const struct nfs_rpc_ops *rpc_ops; - int cl_proto; - struct nfs_subversion *cl_nfs_mod; - u32 cl_minorversion; - unsigned int cl_nconnect; - const char *cl_principal; - struct list_head cl_ds_clients; - u64 cl_clientid; - nfs4_verifier cl_confirm; - long unsigned int cl_state; - spinlock_t cl_lock; - long unsigned int cl_lease_time; - long unsigned int cl_last_renewal; - struct delayed_work cl_renewd; - struct rpc_wait_queue cl_rpcwaitq; - struct idmap *cl_idmap; - const char *cl_owner_id; - u32 cl_cb_ident; - const struct nfs4_minor_version_ops *cl_mvops; - long unsigned int cl_mig_gen; - struct nfs4_slot_table *cl_slot_tbl; - u32 cl_seqid; - u32 cl_exchange_flags; - struct nfs4_session *cl_session; - bool cl_preserve_clid; - struct nfs41_server_owner *cl_serverowner; - struct nfs41_server_scope *cl_serverscope; - struct nfs41_impl_id *cl_implid; - long unsigned int cl_sp4_flags; - char cl_ipaddr[48]; - struct net___2 *cl_net; - struct list_head pending_cb_stateids; -}; +struct svc_process_info; -struct pnfs_layout_segment { - struct list_head pls_list; - struct list_head pls_lc_list; - struct pnfs_layout_range pls_range; - refcount_t pls_refcount; - u32 pls_seq; - long unsigned int pls_flags; - struct pnfs_layout_hdr *pls_layout; +struct svc_program { + struct svc_program *pg_next; + u32 pg_prog; + unsigned int pg_lovers; + unsigned int pg_hivers; + unsigned int pg_nvers; + const struct svc_version **pg_vers; + char *pg_name; + char *pg_class; + struct svc_stat *pg_stats; + int (*pg_authenticate)(struct svc_rqst *); + __be32 (*pg_init_request)(struct svc_rqst *, const struct svc_program *, struct svc_process_info *); + int (*pg_rpcbind_set)(struct net *, const struct svc_program *, u32, int, short unsigned int, short unsigned int); }; -struct nfs_seqid { - struct nfs_seqid_counter *sequence; +struct rpc_pipe_msg { struct list_head list; - struct rpc_task *task; + void *data; + size_t len; + size_t copied; + int errno; }; -struct nfs_write_verifier { - char data[8]; +struct rpc_pipe_ops { + ssize_t (*upcall)(struct file *, struct rpc_pipe_msg *, char *, size_t); + ssize_t (*downcall)(struct file *, const char *, size_t); + void (*release_pipe)(struct inode *); + int (*open_pipe)(struct inode *); + void (*destroy_msg)(struct rpc_pipe_msg *); }; -struct nfs_writeverf { - struct nfs_write_verifier verifier; - enum nfs3_stable_how committed; +struct rpc_pipe { + struct list_head pipe; + struct list_head in_upcall; + struct list_head in_downcall; + int pipelen; + int nreaders; + int nwriters; + int flags; + struct delayed_work queue_timeout; + const struct rpc_pipe_ops *ops; + spinlock_t lock; + struct dentry *dentry; }; -struct nfs_pgio_args { - struct nfs4_sequence_args seq_args; - struct nfs_fh *fh; - struct nfs_open_context *context; - struct nfs_lock_context *lock_context; - nfs4_stateid stateid; - __u64 offset; - __u32 count; - unsigned int pgbase; - struct page___2 **pages; - union { - unsigned int replen; - struct { - const u32 *bitmask; - enum nfs3_stable_how stable; - }; - }; +struct rpc_iostats { + spinlock_t om_lock; + long unsigned int om_ops; + long unsigned int om_ntrans; + long unsigned int om_timeouts; + long long unsigned int om_bytes_sent; + long long unsigned int om_bytes_recv; + ktime_t om_queue; + ktime_t om_rtt; + ktime_t om_execute; + long unsigned int om_error_status; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; }; -struct nfs_pgio_res { - struct nfs4_sequence_res seq_res; - struct nfs_fattr *fattr; - __u32 count; - __u32 op_status; - union { - struct { - unsigned int replen; - int eof; - }; - struct { - struct nfs_writeverf *verf; - const struct nfs_server *server; - }; - }; +struct rpc_create_args { + struct net *net; + int protocol; + struct sockaddr *address; + size_t addrsize; + struct sockaddr *saddress; + const struct rpc_timeout *timeout; + const char *servername; + const char *nodename; + const struct rpc_program *program; + u32 prognumber; + u32 version; + rpc_authflavor_t authflavor; + u32 nconnect; + long unsigned int flags; + char *client_name; + struct svc_xprt *bc_xprt; + const struct cred *cred; }; -struct nfs_commitargs { - struct nfs4_sequence_args seq_args; - struct nfs_fh *fh; - __u64 offset; - __u32 count; - const u32 *bitmask; +struct gss_api_mech; + +struct gss_ctx { + struct gss_api_mech *mech_type; + void *internal_ctx_id; }; -struct nfs_commitres { - struct nfs4_sequence_res seq_res; - __u32 op_status; - struct nfs_fattr *fattr; - struct nfs_writeverf *verf; - const struct nfs_server *server; +struct gss_api_ops; + +struct pf_desc; + +struct gss_api_mech { + struct list_head gm_list; + struct module *gm_owner; + struct rpcsec_gss_oid gm_oid; + char *gm_name; + const struct gss_api_ops *gm_ops; + int gm_pf_num; + struct pf_desc *gm_pfs; + const char *gm_upcall_enctypes; }; -struct nfs_removeargs { - struct nfs4_sequence_args seq_args; - const struct nfs_fh *fh; - struct qstr name; +struct pf_desc { + u32 pseudoflavor; + u32 qop; + u32 service; + char *name; + char *auth_domain_name; + bool datatouch; }; -struct nfs_removeres { - struct nfs4_sequence_res seq_res; - struct nfs_server *server; - struct nfs_fattr *dir_attr; - struct nfs4_change_info cinfo; +struct gss_api_ops { + int (*gss_import_sec_context)(const void *, size_t, struct gss_ctx *, time_t *, gfp_t); + u32 (*gss_get_mic)(struct gss_ctx *, struct xdr_buf *, struct xdr_netobj *); + u32 (*gss_verify_mic)(struct gss_ctx *, struct xdr_buf *, struct xdr_netobj *); + u32 (*gss_wrap)(struct gss_ctx *, int, struct xdr_buf *, struct page **); + u32 (*gss_unwrap)(struct gss_ctx *, int, struct xdr_buf *); + void (*gss_delete_sec_context)(void *); }; -struct nfs_renameargs { - struct nfs4_sequence_args seq_args; - const struct nfs_fh *old_dir; - const struct nfs_fh *new_dir; - const struct qstr *old_name; - const struct qstr *new_name; +struct pnfs_layout_range { + u32 iomode; + u64 offset; + u64 length; }; -struct nfs_renameres { - struct nfs4_sequence_res seq_res; - struct nfs_server *server; - struct nfs4_change_info old_cinfo; - struct nfs_fattr *old_fattr; - struct nfs4_change_info new_cinfo; - struct nfs_fattr *new_fattr; +struct pnfs_layout_hdr; + +struct pnfs_layout_segment { + struct list_head pls_list; + struct list_head pls_lc_list; + struct pnfs_layout_range pls_range; + refcount_t pls_refcount; + u32 pls_seq; + long unsigned int pls_flags; + struct pnfs_layout_hdr *pls_layout; }; -struct nfs_entry { - __u64 ino; - __u64 cookie; - __u64 prev_cookie; - const char *name; - unsigned int len; - int eof; - struct nfs_fh *fh; - struct nfs_fattr *fattr; - struct nfs4_label *label; - unsigned char d_type; - struct nfs_server *server; +struct nfs_seqid { + struct nfs_seqid_counter *sequence; + struct list_head list; + struct rpc_task *task; }; struct nfs4_pathname { @@ -45602,59 +49991,9 @@ struct nfs4_fs_locations { struct nfs4_fs_location locations[10]; }; -struct pnfs_ds_commit_info {}; - -struct nfs_page_array { - struct page___2 **pagevec; - unsigned int npages; - struct page___2 *page_array[8]; -}; - -struct nfs_page; - -struct nfs_pgio_completion_ops; - -struct nfs_rw_ops; - -struct nfs_io_completion; - -struct nfs_direct_req; - -struct nfs_pgio_header { - struct inode___2 *inode; - const struct cred___2 *cred; - struct list_head pages; - struct nfs_page *req; - struct nfs_writeverf verf; - fmode_t rw_mode; - struct pnfs_layout_segment *lseg; - loff_t io_start; - const struct rpc_call_ops *mds_ops; - void (*release)(struct nfs_pgio_header *); - const struct nfs_pgio_completion_ops *completion_ops; - const struct nfs_rw_ops *rw_ops; - struct nfs_io_completion *io_completion; - struct nfs_direct_req *dreq; - int pnfs_error; - int error; - unsigned int good_bytes; - long unsigned int flags; - struct rpc_task task; - struct nfs_fattr fattr; - struct nfs_pgio_args args; - struct nfs_pgio_res res; - long unsigned int timestamp; - int (*pgio_done_cb)(struct rpc_task *, struct nfs_pgio_header *); - __u64 mds_offset; - struct nfs_page_array page_array; - struct nfs_client *ds_clp; - int ds_commit_idx; - int pgio_mirror_idx; -}; - struct nfs_page { struct list_head wb_list; - struct page___2 *wb_page; + struct page *wb_page; struct nfs_lock_context *wb_lock_context; long unsigned int wb_index; unsigned int wb_offset; @@ -45668,176 +50007,21 @@ struct nfs_page { short unsigned int wb_nio; }; -struct nfs_pgio_completion_ops { - void (*error_cleanup)(struct list_head *, int); - void (*init_hdr)(struct nfs_pgio_header *); - void (*completion)(struct nfs_pgio_header *); - void (*reschedule_io)(struct nfs_pgio_header *); -}; - -struct nfs_rw_ops { - struct nfs_pgio_header * (*rw_alloc_header)(); - void (*rw_free_header)(struct nfs_pgio_header *); - int (*rw_done)(struct rpc_task *, struct nfs_pgio_header *, struct inode___2 *); - void (*rw_result)(struct rpc_task *, struct nfs_pgio_header *); - void (*rw_initiate)(struct nfs_pgio_header *, struct rpc_message *, const struct nfs_rpc_ops *, struct rpc_task_setup *, int); -}; - -struct nfs_mds_commit_info { - atomic_t rpcs_out; - atomic_long_t ncommit; - struct list_head list; -}; - -struct nfs_commit_data; - -struct nfs_commit_info; - -struct nfs_commit_completion_ops { - void (*completion)(struct nfs_commit_data *); - void (*resched_write)(struct nfs_commit_info *, struct nfs_page *); -}; - -struct nfs_commit_data { - struct rpc_task task; - struct inode___2 *inode; - const struct cred___2 *cred; - struct nfs_fattr fattr; - struct nfs_writeverf verf; - struct list_head pages; - struct list_head list; - struct nfs_direct_req *dreq; - struct nfs_commitargs args; - struct nfs_commitres res; - struct nfs_open_context *context; - struct pnfs_layout_segment *lseg; - struct nfs_client *ds_clp; - int ds_commit_index; - loff_t lwb; - const struct rpc_call_ops *mds_ops; - const struct nfs_commit_completion_ops *completion_ops; - int (*commit_done_cb)(struct rpc_task *, struct nfs_commit_data *); - long unsigned int flags; -}; - -struct nfs_commit_info { - struct inode___2 *inode; - struct nfs_mds_commit_info *mds; - struct pnfs_ds_commit_info *ds; - struct nfs_direct_req *dreq; - const struct nfs_commit_completion_ops *completion_ops; -}; - -struct nfs_unlinkdata { - struct nfs_removeargs args; - struct nfs_removeres res; - struct dentry___2 *dentry; - wait_queue_head_t wq; - const struct cred___2 *cred; - struct nfs_fattr dir_attr; - long int timeout; -}; - -struct nfs_renamedata { - struct nfs_renameargs args; - struct nfs_renameres res; - const struct cred___2 *cred; - struct inode___2 *old_dir; - struct dentry___2 *old_dentry; - struct nfs_fattr old_fattr; - struct inode___2 *new_dir; - struct dentry___2 *new_dentry; - struct nfs_fattr new_fattr; - void (*complete)(struct rpc_task *, struct nfs_renamedata *); - long int timeout; - bool cancelled; -}; - -struct nlmclnt_operations; - -struct nfs_mount_info; - -struct nfs_access_entry; - -struct nfs_client_initdata; - -struct nfs_rpc_ops { - u32 version; - const struct dentry_operations___2 *dentry_ops; - const struct inode_operations___2 *dir_inode_ops; - const struct inode_operations___2 *file_inode_ops; - const struct file_operations___2 *file_ops; - const struct nlmclnt_operations *nlmclnt_ops; - int (*getroot)(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); - struct vfsmount___2 * (*submount)(struct nfs_server *, struct dentry___2 *, struct nfs_fh *, struct nfs_fattr *); - struct dentry___2 * (*try_mount)(int, const char *, struct nfs_mount_info *, struct nfs_subversion *); - int (*getattr)(struct nfs_server *, struct nfs_fh *, struct nfs_fattr *, struct nfs4_label *, struct inode___2 *); - int (*setattr)(struct dentry___2 *, struct nfs_fattr *, struct iattr *); - int (*lookup)(struct inode___2 *, const struct qstr *, struct nfs_fh *, struct nfs_fattr *, struct nfs4_label *); - int (*lookupp)(struct inode___2 *, struct nfs_fh *, struct nfs_fattr *, struct nfs4_label *); - int (*access)(struct inode___2 *, struct nfs_access_entry *); - int (*readlink)(struct inode___2 *, struct page___2 *, unsigned int, unsigned int); - int (*create)(struct inode___2 *, struct dentry___2 *, struct iattr *, int); - int (*remove)(struct inode___2 *, struct dentry___2 *); - void (*unlink_setup)(struct rpc_message *, struct dentry___2 *, struct inode___2 *); - void (*unlink_rpc_prepare)(struct rpc_task *, struct nfs_unlinkdata *); - int (*unlink_done)(struct rpc_task *, struct inode___2 *); - void (*rename_setup)(struct rpc_message *, struct dentry___2 *, struct dentry___2 *); - void (*rename_rpc_prepare)(struct rpc_task *, struct nfs_renamedata *); - int (*rename_done)(struct rpc_task *, struct inode___2 *, struct inode___2 *); - int (*link)(struct inode___2 *, struct inode___2 *, const struct qstr *); - int (*symlink)(struct inode___2 *, struct dentry___2 *, struct page___2 *, unsigned int, struct iattr *); - int (*mkdir)(struct inode___2 *, struct dentry___2 *, struct iattr *); - int (*rmdir)(struct inode___2 *, const struct qstr *); - int (*readdir)(struct dentry___2 *, const struct cred___2 *, u64, struct page___2 **, unsigned int, bool); - int (*mknod)(struct inode___2 *, struct dentry___2 *, struct iattr *, dev_t); - int (*statfs)(struct nfs_server *, struct nfs_fh *, struct nfs_fsstat *); - int (*fsinfo)(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); - int (*pathconf)(struct nfs_server *, struct nfs_fh *, struct nfs_pathconf *); - int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); - int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, bool); - int (*pgio_rpc_prepare)(struct rpc_task *, struct nfs_pgio_header *); - void (*read_setup)(struct nfs_pgio_header *, struct rpc_message *); - int (*read_done)(struct rpc_task *, struct nfs_pgio_header *); - void (*write_setup)(struct nfs_pgio_header *, struct rpc_message *, struct rpc_clnt **); - int (*write_done)(struct rpc_task *, struct nfs_pgio_header *); - void (*commit_setup)(struct nfs_commit_data *, struct rpc_message *, struct rpc_clnt **); - void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *); - int (*commit_done)(struct rpc_task *, struct nfs_commit_data *); - int (*lock)(struct file___2 *, int, struct file_lock *); - int (*lock_check_bounds)(const struct file_lock *); - void (*clear_acl_cache)(struct inode___2 *); - void (*close_context)(struct nfs_open_context *, int); - struct inode___2 * (*open_context)(struct inode___2 *, struct nfs_open_context *, int, struct iattr *, int *); - int (*have_delegation)(struct inode___2 *, fmode_t); - struct nfs_client * (*alloc_client)(const struct nfs_client_initdata *); - struct nfs_client * (*init_client)(struct nfs_client *, const struct nfs_client_initdata *); - void (*free_client)(struct nfs_client *); - struct nfs_server * (*create_server)(struct nfs_mount_info *, struct nfs_subversion *); - struct nfs_server * (*clone_server)(struct nfs_server *, struct nfs_fh *, struct nfs_fattr *, rpc_authflavor_t); -}; - -struct nlmclnt_operations { - void (*nlmclnt_alloc_call)(void *); - bool (*nlmclnt_unlock_prepare)(struct rpc_task *, void *); - void (*nlmclnt_release_call)(void *); -}; - struct nfs_parsed_mount_data; struct nfs_clone_mount; struct nfs_mount_info { - void (*fill_super)(struct super_block___2 *, struct nfs_mount_info *); - int (*set_security)(struct super_block___2 *, struct dentry___2 *, struct nfs_mount_info *); + void (*fill_super)(struct super_block *, struct nfs_mount_info *); + int (*set_security)(struct super_block *, struct dentry *, struct nfs_mount_info *); struct nfs_parsed_mount_data *parsed; struct nfs_clone_mount *cloned; struct nfs_fh *mntfh; }; struct nfs_subversion { - struct module___2 *owner; - struct file_system_type___2 *nfs_fs; + struct module *owner; + struct file_system_type *nfs_fs; const struct rpc_version *rpc_vers; const struct nfs_rpc_ops *rpc_ops; const struct super_operations *sops; @@ -45845,54 +50029,6 @@ struct nfs_subversion { struct list_head list; }; -struct nfs_access_entry { - struct rb_node rb_node; - struct list_head lru; - const struct cred___2 *cred; - __u32 mask; - struct callback_head callback_head; -}; - -struct nfs_client_initdata { - long unsigned int init_flags; - const char *hostname; - const struct sockaddr *addr; - const char *nodename; - const char *ip_addr; - size_t addrlen; - struct nfs_subversion *nfs_mod; - int proto; - u32 minorversion; - unsigned int nconnect; - struct net___2 *net; - const struct rpc_timeout *timeparms; - const struct cred___2 *cred; -}; - -struct nfs4_state_recovery_ops; - -struct nfs4_state_maintenance_ops; - -struct nfs4_mig_recovery_ops; - -struct nfs4_minor_version_ops { - u32 minor_version; - unsigned int init_caps; - int (*init_client)(struct nfs_client *); - void (*shutdown_client)(struct nfs_client *); - bool (*match_stateid)(const nfs4_stateid *, const nfs4_stateid *); - int (*find_root_sec)(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); - void (*free_lock_state)(struct nfs_server *, struct nfs4_lock_state *); - int (*test_and_free_expired)(struct nfs_server *, nfs4_stateid *, const struct cred___2 *); - struct nfs_seqid * (*alloc_seqid)(struct nfs_seqid_counter *, gfp_t); - void (*session_trunk)(struct rpc_clnt *, struct rpc_xprt *, void *); - const struct rpc_call_ops *call_sync_ops; - const struct nfs4_state_recovery_ops *reboot_recovery_ops; - const struct nfs4_state_recovery_ops *nograce_recovery_ops; - const struct nfs4_state_maintenance_ops *state_renewal_ops; - const struct nfs4_mig_recovery_ops *mig_recovery_ops; -}; - struct nfs_iostats { long long unsigned int bytes[8]; long unsigned int events[27]; @@ -45910,7 +50046,7 @@ struct nfs4_state { struct list_head inode_states; struct list_head lock_states; struct nfs4_state_owner *owner; - struct inode___2 *inode; + struct inode *inode; long unsigned int flags; spinlock_t state_lock; seqlock_t seqlock; @@ -45925,6 +50061,11 @@ struct nfs4_state { struct callback_head callback_head; }; +struct nlmsvc_binding { + __be32 (*fopen)(struct svc_rqst *, struct nfs_fh *, struct file **); + void (*fclose)(struct file *); +}; + struct svc_cred { kuid_t cr_uid; kgid_t cr_gid; @@ -45973,10 +50114,10 @@ struct svc_rqst { size_t rq_xprt_hlen; struct xdr_buf rq_arg; struct xdr_buf rq_res; - struct page___2 *rq_pages[260]; - struct page___2 **rq_respages; - struct page___2 **rq_next_page; - struct page___2 **rq_page_end; + struct page *rq_pages[260]; + struct page **rq_respages; + struct page **rq_next_page; + struct page **rq_page_end; struct kvec rq_vec[259]; __be32 rq_xid; u32 rq_prog; @@ -45996,9 +50137,9 @@ struct svc_rqst { struct auth_domain *rq_client; struct auth_domain *rq_gssclient; struct svc_cacherep *rq_cacherep; - struct task_struct___2 *rq_task; + struct task_struct *rq_task; spinlock_t rq_lock; - struct net___2 *rq_bc_net; + struct net *rq_bc_net; }; struct nlmclnt_initdata { @@ -46008,9 +50149,9 @@ struct nlmclnt_initdata { short unsigned int protocol; u32 nfs_version; int noresvport; - struct net___2 *net; + struct net *net; const struct nlmclnt_operations *nlmclnt_ops; - const struct cred___2 *cred; + const struct cred *cred; }; struct cache_head { @@ -46022,7 +50163,7 @@ struct cache_head { }; struct cache_detail { - struct module___2 *owner; + struct module *owner; int hash_size; struct hlist_head *hash_table; spinlock_t hash_lock; @@ -46048,9 +50189,9 @@ struct cache_detail { time_t last_warn; union { struct proc_dir_entry *procfs; - struct dentry___2 *pipefs; + struct dentry *pipefs; }; - struct net___2 *net; + struct net *net; }; struct cache_deferred_req { @@ -46071,7 +50212,7 @@ struct auth_domain { struct auth_ops { char *name; - struct module___2 *owner; + struct module *owner; int flavour; int (*accept)(struct svc_rqst *, __be32 *); int (*release)(struct svc_rqst *); @@ -46102,11 +50243,11 @@ struct svc_pool { }; struct svc_serv_ops { - void (*svo_shutdown)(struct svc_serv *, struct net___2 *); + void (*svo_shutdown)(struct svc_serv *, struct net *); int (*svo_function)(void *); void (*svo_enqueue_xprt)(struct svc_xprt *); int (*svo_setup)(struct svc_serv *, struct svc_pool *, int); - struct module___2 *svo_module; + struct module *svo_module; }; struct svc_serv { @@ -46174,8 +50315,16 @@ struct svc_version { int (*vs_dispatch)(struct svc_rqst *, __be32 *); }; +struct svc_pool_map { + int count; + int mode; + unsigned int npools; + unsigned int *pool_to; + unsigned int *to_pool; +}; + struct svc_xprt_ops { - struct svc_xprt * (*xpo_create)(struct svc_serv *, struct net___2 *, struct sockaddr *, int, int); + struct svc_xprt * (*xpo_create)(struct svc_serv *, struct net *, struct sockaddr *, int, int); struct svc_xprt * (*xpo_accept)(struct svc_xprt *); int (*xpo_has_wspace)(struct svc_xprt *); int (*xpo_recvfrom)(struct svc_rqst *); @@ -46189,7 +50338,7 @@ struct svc_xprt_ops { struct svc_xprt_class { const char *xcl_name; - struct module___2 *xcl_owner; + struct module *xcl_owner; const struct svc_xprt_ops *xcl_ops; struct list_head xcl_list; u32 xcl_max_payload; @@ -46201,20 +50350,20 @@ struct nfs4_state_recovery_ops { int state_flag_bit; int (*recover_open)(struct nfs4_state_owner *, struct nfs4_state *); int (*recover_lock)(struct nfs4_state *, struct file_lock *); - int (*establish_clid)(struct nfs_client *, const struct cred___2 *); - int (*reclaim_complete)(struct nfs_client *, const struct cred___2 *); - int (*detect_trunking)(struct nfs_client *, struct nfs_client **, const struct cred___2 *); + int (*establish_clid)(struct nfs_client *, const struct cred *); + int (*reclaim_complete)(struct nfs_client *, const struct cred *); + int (*detect_trunking)(struct nfs_client *, struct nfs_client **, const struct cred *); }; struct nfs4_state_maintenance_ops { - int (*sched_state_renewal)(struct nfs_client *, const struct cred___2 *, unsigned int); - const struct cred___2 * (*get_state_renewal_cred)(struct nfs_client *); - int (*renew_lease)(struct nfs_client *, const struct cred___2 *); + int (*sched_state_renewal)(struct nfs_client *, const struct cred *, unsigned int); + const struct cred * (*get_state_renewal_cred)(struct nfs_client *); + int (*renew_lease)(struct nfs_client *, const struct cred *); }; struct nfs4_mig_recovery_ops { - int (*get_locations)(struct inode___2 *, struct nfs4_fs_locations *, struct page___2 *, const struct cred___2 *); - int (*fsid_present)(struct inode___2 *, const struct cred___2 *); + int (*get_locations)(struct inode *, struct nfs4_fs_locations *, struct page *, const struct cred *); + int (*fsid_present)(struct inode *, const struct cred *); }; struct nfs4_state_owner { @@ -46222,7 +50371,7 @@ struct nfs4_state_owner { struct list_head so_lru; long unsigned int so_expires; struct rb_node so_server_node; - const struct cred___2 *so_cred; + const struct cred *so_cred; spinlock_t so_lock; atomic_t so_count; long unsigned int so_flags; @@ -46275,9 +50424,49 @@ enum nfs_stat_eventcounters { __NFSIOS_COUNTSMAX = 27, }; +struct nfs_pageio_descriptor; + +struct nfs_pageio_ops { + void (*pg_init)(struct nfs_pageio_descriptor *, struct nfs_page *); + size_t (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *); + int (*pg_doio)(struct nfs_pageio_descriptor *); + unsigned int (*pg_get_mirror_count)(struct nfs_pageio_descriptor *, struct nfs_page *); + void (*pg_cleanup)(struct nfs_pageio_descriptor *); +}; + +struct nfs_pgio_mirror { + struct list_head pg_list; + long unsigned int pg_bytes_written; + size_t pg_count; + size_t pg_bsize; + unsigned int pg_base; + unsigned char pg_recoalesce: 1; +}; + +struct nfs_pageio_descriptor { + struct inode *pg_inode; + const struct nfs_pageio_ops *pg_ops; + const struct nfs_rw_ops *pg_rw_ops; + int pg_ioflags; + int pg_error; + const struct rpc_call_ops *pg_rpc_callops; + const struct nfs_pgio_completion_ops *pg_completion_ops; + struct pnfs_layout_segment *pg_lseg; + struct nfs_io_completion *pg_io_completion; + struct nfs_direct_req *pg_dreq; + unsigned int pg_bsize; + u32 pg_mirror_count; + struct nfs_pgio_mirror *pg_mirrors; + struct nfs_pgio_mirror pg_mirrors_static[1]; + struct nfs_pgio_mirror *pg_mirrors_dynamic; + u32 pg_mirror_idx; + short unsigned int pg_maxretrans; + unsigned char pg_moreio: 1; +}; + struct nfs_clone_mount { - const struct super_block___2 *sb; - const struct dentry___2 *dentry; + const struct super_block *sb; + const struct dentry *dentry; struct nfs_fh *fh; struct nfs_fattr *fattr; char *hostname; @@ -46325,7 +50514,7 @@ struct nfs_parsed_mount_data { short unsigned int nconnect; } nfs_server; void *lsm_opts; - struct net___2 *net; + struct net *net; }; struct bl_dev_msg { @@ -46355,13 +50544,11 @@ struct nfs_net { }; struct nfs_netns_client { - struct kobject___2 kobject; - struct net___2 *net; + struct kobject kobject; + struct net *net; const char *identifier; }; -typedef int filler_t___2(void *, struct page *); - struct nfs_open_dir_context { struct list_head list; const struct cred *cred; @@ -46417,6 +50604,8 @@ struct nfs_delegation { struct callback_head rcu; }; +struct svc_version___2; + struct nfs_cache_array_entry { u64 cookie; u64 ino; @@ -46449,6 +50638,8 @@ typedef struct { bool eof; } nfs_readdir_descriptor_t; +typedef long long unsigned int pao_T_____7; + struct nfs_find_desc { struct nfs_fh *fh; struct nfs_fattr *fattr; @@ -46722,55 +50913,11 @@ enum { PG_CONTENDED2 = 12, }; -struct nfs_pageio_descriptor; - -struct nfs_pageio_ops { - void (*pg_init)(struct nfs_pageio_descriptor *, struct nfs_page *); - size_t (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *); - int (*pg_doio)(struct nfs_pageio_descriptor *); - unsigned int (*pg_get_mirror_count)(struct nfs_pageio_descriptor *, struct nfs_page *); - void (*pg_cleanup)(struct nfs_pageio_descriptor *); -}; - -struct nfs_pgio_mirror { - struct list_head pg_list; - long unsigned int pg_bytes_written; - size_t pg_count; - size_t pg_bsize; - unsigned int pg_base; - unsigned char pg_recoalesce: 1; -}; - -struct nfs_pageio_descriptor { - struct inode *pg_inode; - const struct nfs_pageio_ops *pg_ops; - const struct nfs_rw_ops *pg_rw_ops; - int pg_ioflags; - int pg_error; - const struct rpc_call_ops *pg_rpc_callops; - const struct nfs_pgio_completion_ops *pg_completion_ops; - struct pnfs_layout_segment *pg_lseg; - struct nfs_io_completion *pg_io_completion; - struct nfs_direct_req *pg_dreq; - unsigned int pg_bsize; - u32 pg_mirror_count; - struct nfs_pgio_mirror *pg_mirrors; - struct nfs_pgio_mirror pg_mirrors_static[1]; - struct nfs_pgio_mirror *pg_mirrors_dynamic; - u32 pg_mirror_idx; - short unsigned int pg_maxretrans; - unsigned char pg_moreio: 1; -}; - -typedef void (*rpc_action)(struct rpc_task *); - struct nfs_readdesc { struct nfs_pageio_descriptor *pgio; struct nfs_open_context *ctx; }; -typedef int (*writepage_t___2)(struct page *, struct writeback_control *, void *); - struct nfs_io_completion { void (*complete)(void *); void *data; @@ -47209,6 +51356,110 @@ struct trace_event_data_offsets_nfs_fh_to_dentry {}; struct trace_event_data_offsets_nfs_xdr_status {}; +typedef void (*btf_trace_nfs_refresh_inode_enter)(void *, const struct inode *); + +typedef void (*btf_trace_nfs_refresh_inode_exit)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs_revalidate_inode_enter)(void *, const struct inode *); + +typedef void (*btf_trace_nfs_revalidate_inode_exit)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs_invalidate_mapping_enter)(void *, const struct inode *); + +typedef void (*btf_trace_nfs_invalidate_mapping_exit)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs_getattr_enter)(void *, const struct inode *); + +typedef void (*btf_trace_nfs_getattr_exit)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs_setattr_enter)(void *, const struct inode *); + +typedef void (*btf_trace_nfs_setattr_exit)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs_writeback_page_enter)(void *, const struct inode *); + +typedef void (*btf_trace_nfs_writeback_page_exit)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs_writeback_inode_enter)(void *, const struct inode *); + +typedef void (*btf_trace_nfs_writeback_inode_exit)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs_fsync_enter)(void *, const struct inode *); + +typedef void (*btf_trace_nfs_fsync_exit)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs_access_enter)(void *, const struct inode *); + +typedef void (*btf_trace_nfs_access_exit)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs_lookup_enter)(void *, const struct inode *, const struct dentry *, unsigned int); + +typedef void (*btf_trace_nfs_lookup_exit)(void *, const struct inode *, const struct dentry *, unsigned int, int); + +typedef void (*btf_trace_nfs_lookup_revalidate_enter)(void *, const struct inode *, const struct dentry *, unsigned int); + +typedef void (*btf_trace_nfs_lookup_revalidate_exit)(void *, const struct inode *, const struct dentry *, unsigned int, int); + +typedef void (*btf_trace_nfs_atomic_open_enter)(void *, const struct inode *, const struct nfs_open_context *, unsigned int); + +typedef void (*btf_trace_nfs_atomic_open_exit)(void *, const struct inode *, const struct nfs_open_context *, unsigned int, int); + +typedef void (*btf_trace_nfs_create_enter)(void *, const struct inode *, const struct dentry *, unsigned int); + +typedef void (*btf_trace_nfs_create_exit)(void *, const struct inode *, const struct dentry *, unsigned int, int); + +typedef void (*btf_trace_nfs_mknod_enter)(void *, const struct inode *, const struct dentry *); + +typedef void (*btf_trace_nfs_mknod_exit)(void *, const struct inode *, const struct dentry *, int); + +typedef void (*btf_trace_nfs_mkdir_enter)(void *, const struct inode *, const struct dentry *); + +typedef void (*btf_trace_nfs_mkdir_exit)(void *, const struct inode *, const struct dentry *, int); + +typedef void (*btf_trace_nfs_rmdir_enter)(void *, const struct inode *, const struct dentry *); + +typedef void (*btf_trace_nfs_rmdir_exit)(void *, const struct inode *, const struct dentry *, int); + +typedef void (*btf_trace_nfs_remove_enter)(void *, const struct inode *, const struct dentry *); + +typedef void (*btf_trace_nfs_remove_exit)(void *, const struct inode *, const struct dentry *, int); + +typedef void (*btf_trace_nfs_unlink_enter)(void *, const struct inode *, const struct dentry *); + +typedef void (*btf_trace_nfs_unlink_exit)(void *, const struct inode *, const struct dentry *, int); + +typedef void (*btf_trace_nfs_symlink_enter)(void *, const struct inode *, const struct dentry *); + +typedef void (*btf_trace_nfs_symlink_exit)(void *, const struct inode *, const struct dentry *, int); + +typedef void (*btf_trace_nfs_link_enter)(void *, const struct inode *, const struct inode *, const struct dentry *); + +typedef void (*btf_trace_nfs_link_exit)(void *, const struct inode *, const struct inode *, const struct dentry *, int); + +typedef void (*btf_trace_nfs_rename_enter)(void *, const struct inode *, const struct dentry *, const struct inode *, const struct dentry *); + +typedef void (*btf_trace_nfs_rename_exit)(void *, const struct inode *, const struct dentry *, const struct inode *, const struct dentry *, int); + +typedef void (*btf_trace_nfs_sillyrename_rename)(void *, const struct inode *, const struct dentry *, const struct inode *, const struct dentry *, int); + +typedef void (*btf_trace_nfs_sillyrename_unlink)(void *, const struct nfs_unlinkdata *, int); + +typedef void (*btf_trace_nfs_initiate_read)(void *, const struct inode *, loff_t, long unsigned int); + +typedef void (*btf_trace_nfs_readpage_done)(void *, const struct inode *, int, loff_t, bool); + +typedef void (*btf_trace_nfs_initiate_write)(void *, const struct inode *, loff_t, long unsigned int, enum nfs3_stable_how); + +typedef void (*btf_trace_nfs_writeback_done)(void *, const struct inode *, int, loff_t, struct nfs_writeverf *); + +typedef void (*btf_trace_nfs_initiate_commit)(void *, const struct nfs_commit_data *); + +typedef void (*btf_trace_nfs_commit_done)(void *, const struct nfs_commit_data *); + +typedef void (*btf_trace_nfs_fh_to_dentry)(void *, const struct super_block *, const struct nfs_fh *, u64, int); + +typedef void (*btf_trace_nfs_xdr_status)(void *, const struct xdr_stream *, int); + enum { FILEID_HIGH_OFF = 0, FILEID_LOW_OFF = 1, @@ -48326,7 +52577,7 @@ struct nfs4_call_sync_data { struct nfs4_open_createattrs { struct nfs4_label *label; struct iattr *sattr; - __u32 verf[2]; + const __u32 verf[2]; }; struct nfs4_closedata { @@ -48988,6 +53239,108 @@ struct trace_event_data_offsets_nfs4_write_event {}; struct trace_event_data_offsets_nfs4_commit_event {}; +typedef void (*btf_trace_nfs4_setclientid)(void *, const struct nfs_client *, int); + +typedef void (*btf_trace_nfs4_setclientid_confirm)(void *, const struct nfs_client *, int); + +typedef void (*btf_trace_nfs4_renew)(void *, const struct nfs_client *, int); + +typedef void (*btf_trace_nfs4_renew_async)(void *, const struct nfs_client *, int); + +typedef void (*btf_trace_nfs4_setup_sequence)(void *, const struct nfs4_session *, const struct nfs4_sequence_args *); + +typedef void (*btf_trace_nfs4_state_mgr)(void *, const struct nfs_client *); + +typedef void (*btf_trace_nfs4_state_mgr_failed)(void *, const struct nfs_client *, const char *, int); + +typedef void (*btf_trace_nfs4_xdr_status)(void *, const struct xdr_stream *, u32, int); + +typedef void (*btf_trace_nfs4_open_reclaim)(void *, const struct nfs_open_context *, int, int); + +typedef void (*btf_trace_nfs4_open_expired)(void *, const struct nfs_open_context *, int, int); + +typedef void (*btf_trace_nfs4_open_file)(void *, const struct nfs_open_context *, int, int); + +typedef void (*btf_trace_nfs4_cached_open)(void *, const struct nfs4_state *); + +typedef void (*btf_trace_nfs4_close)(void *, const struct nfs4_state *, const struct nfs_closeargs *, const struct nfs_closeres *, int); + +typedef void (*btf_trace_nfs4_get_lock)(void *, const struct file_lock *, const struct nfs4_state *, int, int); + +typedef void (*btf_trace_nfs4_unlock)(void *, const struct file_lock *, const struct nfs4_state *, int, int); + +typedef void (*btf_trace_nfs4_set_lock)(void *, const struct file_lock *, const struct nfs4_state *, const nfs4_stateid *, int, int); + +typedef void (*btf_trace_nfs4_state_lock_reclaim)(void *, const struct nfs4_state *, const struct nfs4_lock_state *); + +typedef void (*btf_trace_nfs4_set_delegation)(void *, const struct inode *, fmode_t); + +typedef void (*btf_trace_nfs4_reclaim_delegation)(void *, const struct inode *, fmode_t); + +typedef void (*btf_trace_nfs4_delegreturn_exit)(void *, const struct nfs4_delegreturnargs *, const struct nfs4_delegreturnres *, int); + +typedef void (*btf_trace_nfs4_lookup)(void *, const struct inode *, const struct qstr *, int); + +typedef void (*btf_trace_nfs4_symlink)(void *, const struct inode *, const struct qstr *, int); + +typedef void (*btf_trace_nfs4_mkdir)(void *, const struct inode *, const struct qstr *, int); + +typedef void (*btf_trace_nfs4_mknod)(void *, const struct inode *, const struct qstr *, int); + +typedef void (*btf_trace_nfs4_remove)(void *, const struct inode *, const struct qstr *, int); + +typedef void (*btf_trace_nfs4_get_fs_locations)(void *, const struct inode *, const struct qstr *, int); + +typedef void (*btf_trace_nfs4_secinfo)(void *, const struct inode *, const struct qstr *, int); + +typedef void (*btf_trace_nfs4_lookupp)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs4_rename)(void *, const struct inode *, const struct qstr *, const struct inode *, const struct qstr *, int); + +typedef void (*btf_trace_nfs4_access)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs4_readlink)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs4_readdir)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs4_get_acl)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs4_set_acl)(void *, const struct inode *, int); + +typedef void (*btf_trace_nfs4_setattr)(void *, const struct inode *, const nfs4_stateid *, int); + +typedef void (*btf_trace_nfs4_delegreturn)(void *, const struct inode *, const nfs4_stateid *, int); + +typedef void (*btf_trace_nfs4_open_stateid_update)(void *, const struct inode *, const nfs4_stateid *, int); + +typedef void (*btf_trace_nfs4_open_stateid_update_wait)(void *, const struct inode *, const nfs4_stateid *, int); + +typedef void (*btf_trace_nfs4_getattr)(void *, const struct nfs_server *, const struct nfs_fh *, const struct nfs_fattr *, int); + +typedef void (*btf_trace_nfs4_lookup_root)(void *, const struct nfs_server *, const struct nfs_fh *, const struct nfs_fattr *, int); + +typedef void (*btf_trace_nfs4_fsinfo)(void *, const struct nfs_server *, const struct nfs_fh *, const struct nfs_fattr *, int); + +typedef void (*btf_trace_nfs4_cb_getattr)(void *, const struct nfs_client *, const struct nfs_fh *, const struct inode *, int); + +typedef void (*btf_trace_nfs4_cb_recall)(void *, const struct nfs_client *, const struct nfs_fh *, const struct inode *, const nfs4_stateid *, int); + +typedef void (*btf_trace_nfs4_cb_layoutrecall_file)(void *, const struct nfs_client *, const struct nfs_fh *, const struct inode *, const nfs4_stateid *, int); + +typedef void (*btf_trace_nfs4_map_name_to_uid)(void *, const char *, int, u32, int); + +typedef void (*btf_trace_nfs4_map_group_to_gid)(void *, const char *, int, u32, int); + +typedef void (*btf_trace_nfs4_map_uid_to_name)(void *, const char *, int, u32, int); + +typedef void (*btf_trace_nfs4_map_gid_to_group)(void *, const char *, int, u32, int); + +typedef void (*btf_trace_nfs4_read)(void *, const struct nfs_pgio_header *, int); + +typedef void (*btf_trace_nfs4_write)(void *, const struct nfs_pgio_header *, int); + +typedef void (*btf_trace_nfs4_commit)(void *, const struct nfs_commit_data *, int); + struct getdents_callback___2 { struct dir_context ctx; char *name; @@ -48996,19 +53349,17 @@ struct getdents_callback___2 { int sequence; }; -struct nlm_host___2; - struct nlm_lockowner { struct list_head list; refcount_t count; - struct nlm_host___2 *host; + struct nlm_host *host; fl_owner_t owner; uint32_t pid; }; struct nsm_handle; -struct nlm_host___2 { +struct nlm_host { struct hlist_node h_hash; struct __kernel_sockaddr_storage h_addr; size_t h_addrlen; @@ -49109,7 +53460,7 @@ struct nlm_block; struct nlm_rqst { refcount_t a_count; unsigned int a_flags; - struct nlm_host___2 *a_host; + struct nlm_host *a_host; struct nlm_args a_args; struct nlm_res a_res; struct nlm_block *a_block; @@ -49126,7 +53477,7 @@ struct nlm_block { struct list_head b_flist; struct nlm_rqst *b_call; struct svc_serv *b_daemon; - struct nlm_host___2 *b_host; + struct nlm_host *b_host; long unsigned int b_when; unsigned int b_id; unsigned char b_granted; @@ -49152,7 +53503,7 @@ struct nlm_file { struct nlm_wait { struct list_head b_list; wait_queue_head_t b_wait; - struct nlm_host___2 *b_host; + struct nlm_host *b_host; struct file_lock *b_lock; short unsigned int b_reclaim; __be32 b_status; @@ -49224,43 +53575,6 @@ struct in_device { struct callback_head callback_head; }; -enum netdev_cmd { - NETDEV_UP = 1, - NETDEV_DOWN = 2, - NETDEV_REBOOT = 3, - NETDEV_CHANGE = 4, - NETDEV_REGISTER = 5, - NETDEV_UNREGISTER = 6, - NETDEV_CHANGEMTU = 7, - NETDEV_CHANGEADDR = 8, - NETDEV_PRE_CHANGEADDR = 9, - NETDEV_GOING_DOWN = 10, - NETDEV_CHANGENAME = 11, - NETDEV_FEAT_CHANGE = 12, - NETDEV_BONDING_FAILOVER = 13, - NETDEV_PRE_UP = 14, - NETDEV_PRE_TYPE_CHANGE = 15, - NETDEV_POST_TYPE_CHANGE = 16, - NETDEV_POST_INIT = 17, - NETDEV_RELEASE = 18, - NETDEV_NOTIFY_PEERS = 19, - NETDEV_JOIN = 20, - NETDEV_CHANGEUPPER = 21, - NETDEV_RESEND_IGMP = 22, - NETDEV_PRECHANGEMTU = 23, - NETDEV_CHANGEINFODATA = 24, - NETDEV_BONDING_INFO = 25, - NETDEV_PRECHANGEUPPER = 26, - NETDEV_CHANGELOWERSTATE = 27, - NETDEV_UDP_TUNNEL_PUSH_INFO = 28, - NETDEV_UDP_TUNNEL_DROP_INFO = 29, - NETDEV_CHANGE_TX_QUEUE_LEN = 30, - NETDEV_CVLAN_FILTER_PUSH_INFO = 31, - NETDEV_CVLAN_FILTER_DROP_INFO = 32, - NETDEV_SVLAN_FILTER_PUSH_INFO = 33, - NETDEV_SVLAN_FILTER_DROP_INFO = 34, -}; - struct in_ifaddr { struct hlist_node hash; struct in_ifaddr *ifa_next; @@ -49310,22 +53624,21 @@ struct inet6_ifaddr { struct in6_addr peer_addr; }; -struct nlmsvc_binding { - __be32 (*fopen)(struct svc_rqst *, struct nfs_fh *, struct file **); - void (*fclose)(struct file *); -}; - -typedef int (*nlm_host_match_fn_t)(void *, struct nlm_host___2 *); +typedef int (*nlm_host_match_fn_t)(void *, struct nlm_host *); struct nlm_share { struct nlm_share *s_next; - struct nlm_host___2 *s_host; + struct nlm_host *s_host; struct nlm_file *s_file; struct xdr_netobj s_owner; u32 s_access; u32 s_mode; }; +struct rpc_version___2; + +struct rpc_program___2; + enum { NSMPROC_NULL = 0, NSMPROC_STAT = 1, @@ -49434,17 +53747,6 @@ enum { Opt_ignore___2 = 11, }; -struct autofs_packet_hdr { - int proto_version; - int type; -}; - -struct autofs_packet_expire { - struct autofs_packet_hdr hdr; - int len; - char name[256]; -}; - enum { AUTOFS_IOC_READY_CMD = 96, AUTOFS_IOC_FAIL_CMD = 97, @@ -49466,6 +53768,11 @@ enum { AUTOFS_IOC_ASKUMOUNT_CMD = 112, }; +struct autofs_packet_hdr { + int proto_version; + int type; +}; + struct autofs_packet_missing { struct autofs_packet_hdr hdr; autofs_wqt_t wait_queue_token; @@ -49473,6 +53780,12 @@ struct autofs_packet_missing { char name[256]; }; +struct autofs_packet_expire { + struct autofs_packet_hdr hdr; + int len; + char name[256]; +}; + struct autofs_packet_expire_multi { struct autofs_packet_hdr hdr; autofs_wqt_t wait_queue_token; @@ -49615,6 +53928,8 @@ enum { typedef int (*ioctl_fn)(struct file *, struct autofs_sb_info *, struct autofs_dev_ioctl *); +typedef struct vfsmount * (*debugfs_automount_t)(struct dentry *, void *); + struct debugfs_fsdata { const struct file_operations *real_fops; refcount_t active_users; @@ -49718,11 +54033,6 @@ struct compat_ipc_perm { short unsigned int seq; }; -struct rhlist_head { - struct rhash_head rhead; - struct rhlist_head *next; -}; - struct ipc_perm { __kernel_key_t key; __kernel_uid_t uid; @@ -50544,6 +54854,13 @@ union security_list_options { int (*audit_rule_known)(struct audit_krule *); int (*audit_rule_match)(u32, u32, u32, void *); void (*audit_rule_free)(void *); + int (*bpf)(int, union bpf_attr *, unsigned int); + int (*bpf_map)(struct bpf_map *, fmode_t); + int (*bpf_prog)(struct bpf_prog *); + int (*bpf_map_alloc_security)(struct bpf_map *); + void (*bpf_map_free_security)(struct bpf_map *); + int (*bpf_prog_alloc_security)(struct bpf_prog_aux *); + void (*bpf_prog_free_security)(struct bpf_prog_aux *); int (*locked_down)(enum lockdown_reason); int (*perf_event_open)(struct perf_event_attr *, int); int (*perf_event_alloc)(struct perf_event *); @@ -50743,6 +55060,13 @@ struct security_hook_heads { struct hlist_head audit_rule_known; struct hlist_head audit_rule_match; struct hlist_head audit_rule_free; + struct hlist_head bpf; + struct hlist_head bpf_map; + struct hlist_head bpf_prog; + struct hlist_head bpf_map_alloc_security; + struct hlist_head bpf_map_free_security; + struct hlist_head bpf_prog_alloc_security; + struct hlist_head bpf_prog_free_security; struct hlist_head locked_down; struct hlist_head perf_event_open; struct hlist_head perf_event_alloc; @@ -50768,7 +55092,7 @@ struct lsm_blob_sizes { }; enum lsm_order { - LSM_ORDER_FIRST = -1, + LSM_ORDER_FIRST = 4294967295, LSM_ORDER_MUTABLE = 0, }; @@ -50785,7 +55109,7 @@ enum lsm_event { LSM_POLICY_CHANGE = 0, }; -typedef int (*initxattrs___2)(struct inode *, const struct xattr *, void *); +typedef int (*initxattrs)(struct inode *, const struct xattr *, void *); enum ib_uverbs_write_cmds { IB_USER_VERBS_CMD_GET_CONTEXT = 0, @@ -50863,6 +55187,14 @@ enum ib_uverbs_access_flags { IB_UVERBS_ACCESS_HUGETLB = 128, }; +union ib_gid { + u8 raw[16]; + struct { + __be64 subnet_prefix; + __be64 interface_id; + } global; +}; + struct lsm_network_audit { int netif; struct sock *sk; @@ -51043,6 +55375,12 @@ struct avc_callback_node { typedef __u16 __sum16; +typedef u16 u_int16_t; + +struct rhltable { + struct rhashtable ht; +}; + enum sctp_endpoint_type { SCTP_EP_TYPE_SOCKET = 0, SCTP_EP_TYPE_ASSOCIATION = 1, @@ -51100,37 +55438,19 @@ struct sctp_endpoint { u32 peer_secid; }; -struct inet_listen_hashbucket { - spinlock_t lock; - unsigned int count; - union { - struct hlist_head head; - struct hlist_nulls_head nulls_head; - }; -}; - -struct inet_ehash_bucket; - -struct inet_bind_hashbucket; - -struct inet_hashinfo { - struct inet_ehash_bucket *ehash; - spinlock_t *ehash_locks; - unsigned int ehash_mask; - unsigned int ehash_locks_mask; - struct kmem_cache *bind_bucket_cachep; - struct inet_bind_hashbucket *bhash; - unsigned int bhash_size; - unsigned int lhash2_mask; - struct inet_listen_hashbucket *lhash2; - long: 64; - struct inet_listen_hashbucket listening_hash[32]; +enum ip_conntrack_info { + IP_CT_ESTABLISHED = 0, + IP_CT_RELATED = 1, + IP_CT_NEW = 2, + IP_CT_IS_REPLY = 3, + IP_CT_ESTABLISHED_REPLY = 3, + IP_CT_RELATED_REPLY = 4, + IP_CT_NUMBER = 5, + IP_CT_UNTRACKED = 7, }; -struct tcp_fastopen_context { - siphash_key_t key[2]; - int num; - struct callback_head rcu; +struct nf_conntrack { + atomic_t use; }; struct nf_hook_state; @@ -51171,12 +55491,6 @@ enum nf_nat_manip_type { NF_NAT_MANIP_DST = 1, }; -enum ip_conntrack_dir { - IP_CT_DIR_ORIGINAL = 0, - IP_CT_DIR_REPLY = 1, - IP_CT_DIR_MAX = 2, -}; - struct nf_conn; struct nf_nat_hook { @@ -51185,15 +55499,184 @@ struct nf_nat_hook { unsigned int (*manip_pkt)(struct sk_buff *, struct nf_conn *, enum nf_nat_manip_type, enum ip_conntrack_dir); }; +union nf_inet_addr { + __u32 all[4]; + __be32 ip; + __be32 ip6[4]; + struct in_addr in; + struct in6_addr in6; +}; + +union nf_conntrack_man_proto { + __be16 all; + struct { + __be16 port; + } tcp; + struct { + __be16 port; + } udp; + struct { + __be16 id; + } icmp; + struct { + __be16 port; + } dccp; + struct { + __be16 port; + } sctp; + struct { + __be16 key; + } gre; +}; + +struct nf_conntrack_man { + union nf_inet_addr u3; + union nf_conntrack_man_proto u; + u_int16_t l3num; +}; + +struct nf_conntrack_tuple { + struct nf_conntrack_man src; + struct { + union nf_inet_addr u3; + union { + __be16 all; + struct { + __be16 port; + } tcp; + struct { + __be16 port; + } udp; + struct { + u_int8_t type; + u_int8_t code; + } icmp; + struct { + __be16 port; + } dccp; + struct { + __be16 port; + } sctp; + struct { + __be16 key; + } gre; + } u; + u_int8_t protonum; + u_int8_t dir; + } dst; +}; + +struct nf_conntrack_tuple_hash { + struct hlist_nulls_node hnnode; + struct nf_conntrack_tuple tuple; +}; + +typedef u32 u_int32_t; + +typedef u64 u_int64_t; + +struct nf_ct_dccp { + u_int8_t role[2]; + u_int8_t state; + u_int8_t last_pkt; + u_int8_t last_dir; + u_int64_t handshake_seq; +}; + +struct ip_ct_sctp { + enum sctp_conntrack state; + __be32 vtag[2]; +}; + +struct ip_ct_tcp_state { + u_int32_t td_end; + u_int32_t td_maxend; + u_int32_t td_maxwin; + u_int32_t td_maxack; + u_int8_t td_scale; + u_int8_t flags; +}; + +struct ip_ct_tcp { + struct ip_ct_tcp_state seen[2]; + u_int8_t state; + u_int8_t last_dir; + u_int8_t retrans; + u_int8_t last_index; + u_int32_t last_seq; + u_int32_t last_ack; + u_int32_t last_end; + u_int16_t last_win; + u_int8_t last_wscale; + u_int8_t last_flags; +}; + +struct nf_ct_udp { + long unsigned int stream_ts; +}; + +struct nf_ct_gre { + unsigned int stream_timeout; + unsigned int timeout; +}; + +union nf_conntrack_proto { + struct nf_ct_dccp dccp; + struct ip_ct_sctp sctp; + struct ip_ct_tcp tcp; + struct nf_ct_udp udp; + struct nf_ct_gre gre; + unsigned int tmpl_padto; +}; + +struct nf_ct_ext; + +struct nf_conn { + struct nf_conntrack ct_general; + spinlock_t lock; + u32 timeout; + struct nf_conntrack_tuple_hash tuplehash[2]; + long unsigned int status; + u16 cpu; + possible_net_t ct_net; + struct hlist_node nat_bysource; + u8 __nfct_init_offset[0]; + struct nf_conn *master; + u_int32_t secmark; + struct nf_ct_ext *ext; + union nf_conntrack_proto proto; +}; + +struct nf_conntrack_zone { + u16 id; + u8 flags; + u8 dir; +}; + +struct nf_ct_hook { + int (*update)(struct net *, struct sk_buff *); + void (*destroy)(struct nf_conntrack *); + bool (*get_tuple_skb)(struct nf_conntrack_tuple *, const struct sk_buff *); +}; + +struct nfnl_ct_hook { + struct nf_conn * (*get_ct)(const struct sk_buff *, enum ip_conntrack_info *); + size_t (*build_size)(const struct nf_conn *); + int (*build)(struct sk_buff *, struct nf_conn *, enum ip_conntrack_info, u_int16_t, u_int16_t); + int (*parse)(const struct nlattr *, struct nf_conn *); + int (*attach_expect)(const struct nlattr *, struct nf_conn *, u32, u32); + void (*seq_adjust)(struct sk_buff *, struct nf_conn *, enum ip_conntrack_info, s32); +}; + enum nf_ip_hook_priorities { - NF_IP_PRI_FIRST = -2147483648, - NF_IP_PRI_RAW_BEFORE_DEFRAG = -450, - NF_IP_PRI_CONNTRACK_DEFRAG = -400, - NF_IP_PRI_RAW = -300, - NF_IP_PRI_SELINUX_FIRST = -225, - NF_IP_PRI_CONNTRACK = -200, - NF_IP_PRI_MANGLE = -150, - NF_IP_PRI_NAT_DST = -100, + NF_IP_PRI_FIRST = 2147483648, + NF_IP_PRI_RAW_BEFORE_DEFRAG = 4294966846, + NF_IP_PRI_CONNTRACK_DEFRAG = 4294966896, + NF_IP_PRI_RAW = 4294966996, + NF_IP_PRI_SELINUX_FIRST = 4294967071, + NF_IP_PRI_CONNTRACK = 4294967096, + NF_IP_PRI_MANGLE = 4294967146, + NF_IP_PRI_NAT_DST = 4294967196, NF_IP_PRI_FILTER = 0, NF_IP_PRI_SECURITY = 50, NF_IP_PRI_NAT_SRC = 100, @@ -51204,14 +55687,14 @@ enum nf_ip_hook_priorities { }; enum nf_ip6_hook_priorities { - NF_IP6_PRI_FIRST = -2147483648, - NF_IP6_PRI_RAW_BEFORE_DEFRAG = -450, - NF_IP6_PRI_CONNTRACK_DEFRAG = -400, - NF_IP6_PRI_RAW = -300, - NF_IP6_PRI_SELINUX_FIRST = -225, - NF_IP6_PRI_CONNTRACK = -200, - NF_IP6_PRI_MANGLE = -150, - NF_IP6_PRI_NAT_DST = -100, + NF_IP6_PRI_FIRST = 2147483648, + NF_IP6_PRI_RAW_BEFORE_DEFRAG = 4294966846, + NF_IP6_PRI_CONNTRACK_DEFRAG = 4294966896, + NF_IP6_PRI_RAW = 4294966996, + NF_IP6_PRI_SELINUX_FIRST = 4294967071, + NF_IP6_PRI_CONNTRACK = 4294967096, + NF_IP6_PRI_MANGLE = 4294967146, + NF_IP6_PRI_NAT_DST = 4294967196, NF_IP6_PRI_FILTER = 0, NF_IP6_PRI_SECURITY = 50, NF_IP6_PRI_NAT_SRC = 100, @@ -51220,33 +55703,6 @@ enum nf_ip6_hook_priorities { NF_IP6_PRI_LAST = 2147483647, }; -enum { - TCPF_ESTABLISHED = 2, - TCPF_SYN_SENT = 4, - TCPF_SYN_RECV = 8, - TCPF_FIN_WAIT1 = 16, - TCPF_FIN_WAIT2 = 32, - TCPF_TIME_WAIT = 64, - TCPF_CLOSE = 128, - TCPF_CLOSE_WAIT = 256, - TCPF_LAST_ACK = 512, - TCPF_LISTEN = 1024, - TCPF_CLOSING = 2048, - TCPF_NEW_SYN_RECV = 4096, -}; - -struct sock_reuseport { - struct callback_head rcu; - u16 max_socks; - u16 num_socks; - unsigned int synq_overflow_ts; - unsigned int reuseport_id; - unsigned int bind_inany: 1; - unsigned int has_conns: 1; - struct bpf_prog *prog; - struct sock *socks[0]; -}; - struct socket_alloc { struct socket socket; struct inode vfs_inode; @@ -51553,15 +56009,6 @@ struct ip6_flowlabel { struct net *fl_net; }; -struct inet_ehash_bucket { - struct hlist_nulls_head chain; -}; - -struct inet_bind_hashbucket { - spinlock_t lock; - struct hlist_head chain; -}; - struct inet_skb_parm { int iif; struct ip_options opt; @@ -51569,28 +56016,6 @@ struct inet_skb_parm { u16 frag_max_size; }; -struct ack_sample { - u32 pkts_acked; - s32 rtt_us; - u32 in_flight; -}; - -struct rate_sample { - u64 prior_mstamp; - u32 prior_delivered; - s32 delivered; - long int interval_us; - u32 snd_interval_us; - u32 rcv_interval_us; - long int rtt_us; - int losses; - u32 acked_sacked; - u32 prior_in_flight; - bool is_app_limited; - bool is_retrans; - bool is_ack_delayed; -}; - struct nf_ipv6_ops { void (*route_input)(struct sk_buff *); int (*fragment)(struct net *, struct sock *, struct sk_buff *, int (*)(struct net *, struct sock *, struct sk_buff *)); @@ -51612,6 +56037,11 @@ struct tty_file_private { struct list_head list; }; +struct icmp_err { + int errno; + unsigned int fatal: 1; +}; + struct netlbl_lsm_cache { refcount_t refcount; void (*free)(const void *); @@ -52433,6 +56863,28 @@ struct sctp_bind_bucket { struct net *net; }; +struct sctp_bind_hashbucket { + spinlock_t lock; + struct hlist_head chain; +}; + +struct sctp_hashbucket { + rwlock_t lock; + struct hlist_head chain; +}; + +struct sctp_globals { + struct list_head address_families; + struct sctp_hashbucket *ep_hashtable; + struct sctp_bind_hashbucket *port_hashtable; + struct rhltable transport_hashtable; + int ep_hashsize; + int port_hashsize; + __u16 max_instreams; + __u16 max_outstreams; + bool checksum_disable; +}; + enum sctp_socket_type { SCTP_SOCKET_UDP = 0, SCTP_SOCKET_UDP_HIGH_BANDWIDTH = 1, @@ -52755,6 +57207,10 @@ struct key_security_struct { u32 sid; }; +struct bpf_security_struct { + u32 sid; +}; + struct perf_event_security_struct { u32 sid; }; @@ -52767,7 +57223,7 @@ struct selinux_mnt_opts { }; enum { - Opt_error = -1, + Opt_error = 4294967295, Opt_context = 0, Opt_defcontext = 1, Opt_fscontext = 2, @@ -52938,11 +57394,6 @@ struct nlmsg_perm { u32 perm; }; -struct netdev_notifier_info { - struct net_device *dev; - struct netlink_ext_ack *extack; -}; - struct netif_security_struct { struct net *ns; int ifindex; @@ -53436,8 +57887,6 @@ struct unix_sock { spinlock_t lock; long unsigned int gc_flags; long: 64; - long: 64; - long: 64; struct socket_wq peer_wq; wait_queue_entry_t peer_wake; long: 64; @@ -54126,6 +58575,8 @@ struct rsa_mpi_key { MPI d; }; +struct crypto_template___2; + struct asn1_decoder___2; struct rsa_asn1_template { @@ -54599,7 +59050,7 @@ struct asymmetric_key_ids { struct public_key_signature; -struct asymmetric_key_subtype { +struct asymmetric_key_subtype___2 { struct module *owner; const char *name; short unsigned int name_len; @@ -54993,6 +59444,8 @@ enum { BLK_MQ_REQ_PREEMPT = 8, }; +struct blk_integrity_profile; + struct trace_event_raw_block_buffer { struct trace_entry ent; dev_t dev; @@ -55164,6 +59617,42 @@ struct trace_event_data_offsets_block_bio_remap {}; struct trace_event_data_offsets_block_rq_remap {}; +typedef void (*btf_trace_block_touch_buffer)(void *, struct buffer_head *); + +typedef void (*btf_trace_block_dirty_buffer)(void *, struct buffer_head *); + +typedef void (*btf_trace_block_rq_requeue)(void *, struct request_queue *, struct request *); + +typedef void (*btf_trace_block_rq_complete)(void *, struct request *, int, unsigned int); + +typedef void (*btf_trace_block_rq_insert)(void *, struct request_queue *, struct request *); + +typedef void (*btf_trace_block_rq_issue)(void *, struct request_queue *, struct request *); + +typedef void (*btf_trace_block_bio_bounce)(void *, struct request_queue *, struct bio *); + +typedef void (*btf_trace_block_bio_complete)(void *, struct request_queue *, struct bio *, int); + +typedef void (*btf_trace_block_bio_backmerge)(void *, struct request_queue *, struct request *, struct bio *); + +typedef void (*btf_trace_block_bio_frontmerge)(void *, struct request_queue *, struct request *, struct bio *); + +typedef void (*btf_trace_block_bio_queue)(void *, struct request_queue *, struct bio *); + +typedef void (*btf_trace_block_getrq)(void *, struct request_queue *, struct bio *, int); + +typedef void (*btf_trace_block_sleeprq)(void *, struct request_queue *, struct bio *, int); + +typedef void (*btf_trace_block_plug)(void *, struct request_queue *); + +typedef void (*btf_trace_block_unplug)(void *, struct request_queue *, unsigned int, bool); + +typedef void (*btf_trace_block_split)(void *, struct request_queue *, struct bio *, unsigned int); + +typedef void (*btf_trace_block_bio_remap)(void *, struct request_queue *, struct bio *, dev_t, sector_t); + +typedef void (*btf_trace_block_rq_remap)(void *, struct request_queue *, struct request *, dev_t, sector_t); + struct queue_sysfs_entry { struct attribute attr; ssize_t (*show)(struct request_queue *, char *); @@ -55184,7 +59673,7 @@ enum blk_default_limits { BLK_SAFE_MAX_SECTORS = 255, BLK_DEF_MAX_SECTORS = 2560, BLK_MAX_SEGMENT_SIZE = 65536, - BLK_SEG_BOUNDARY_MASK = -1, + BLK_SEG_BOUNDARY_MASK = 4294967295, }; enum { @@ -55202,17 +59691,15 @@ struct req_iterator { typedef bool (*sb_for_each_fn)(struct sbitmap *, unsigned int, void *); -typedef bool busy_iter_fn(struct blk_mq_hw_ctx *, struct request *, void *, bool); - enum { BLK_MQ_UNIQUE_TAG_BITS = 16, BLK_MQ_UNIQUE_TAG_MASK = 65535, }; enum { - BLK_MQ_TAG_FAIL = -1, + BLK_MQ_TAG_FAIL = 4294967295, BLK_MQ_TAG_MIN = 1, - BLK_MQ_TAG_MAX = -2, + BLK_MQ_TAG_MAX = 4294967294, }; struct mq_inflight { @@ -55241,6 +59728,8 @@ struct sbq_wait { struct wait_queue_entry wait; }; +typedef bool busy_iter_fn(struct blk_mq_hw_ctx *, struct request *, void *, bool); + typedef bool busy_tag_iter_fn(struct request *, void *, bool); struct bt_iter_data { @@ -55384,8 +59873,6 @@ struct badblocks { sector_t size; }; -typedef struct kobject *kobj_probe_t___2(dev_t, int *, void *); - struct blk_major_name { struct blk_major_name *next; int major; @@ -55661,6 +60148,10 @@ struct compat_sg_io_hdr { compat_uint_t info; }; +enum { + OMAX_SB_LEN = 16, +}; + struct bsg_device { struct request_queue *queue; spinlock_t lock; @@ -55718,6 +60209,12 @@ struct trace_event_data_offsets_kyber_adjust {}; struct trace_event_data_offsets_kyber_throttled {}; +typedef void (*btf_trace_kyber_latency)(void *, struct request_queue *, const char *, const char *, unsigned int, unsigned int, unsigned int, unsigned int); + +typedef void (*btf_trace_kyber_adjust)(void *, struct request_queue *, const char *, unsigned int); + +typedef void (*btf_trace_kyber_throttled)(void *, struct request_queue *, const char *); + enum { KYBER_READ = 0, KYBER_WRITE = 1, @@ -55834,6 +60331,8 @@ struct show_busy_params { struct blk_mq_hw_ctx *hctx; }; +typedef void (*swap_func_t)(void *, void *, int); + typedef int (*cmp_r_func_t)(const void *, const void *, const void *); typedef __kernel_long_t __kernel_ptrdiff_t; @@ -55889,10 +60388,6 @@ struct __kfifo { void *data; }; -struct rhltable { - struct rhashtable ht; -}; - struct rhashtable_walker { struct list_head list; struct bucket_table *tbl; @@ -56005,6 +60500,8 @@ struct genpool_data_fixed { long unsigned int offset; }; +typedef z_stream *z_streamp; + typedef struct { unsigned char op; unsigned char bits; @@ -56084,17 +60581,17 @@ union uu { typedef unsigned int uInt; +struct inflate_workspace { + struct inflate_state inflate_state; + unsigned char working_window[32768]; +}; + typedef enum { CODES = 0, LENS = 1, DISTS = 2, } codetype; -struct inflate_workspace { - struct inflate_state inflate_state; - unsigned char working_window[32768]; -}; - typedef unsigned char uch; typedef short unsigned int ush; @@ -56488,6 +60985,8 @@ struct xz_dec_bcj___2 { } temp; }; +typedef s32 pao_T_____8; + struct ei_entry { struct list_head list; long unsigned int start_addr; @@ -56560,6 +61059,8 @@ struct font_desc { int pref; }; +typedef u16 ucs2_char_t; + struct msr { union { struct { @@ -56597,6 +61098,12 @@ struct trace_event_raw_msr_trace_class { struct trace_event_data_offsets_msr_trace_class {}; +typedef void (*btf_trace_read_msr)(void *, unsigned int, u64, int); + +typedef void (*btf_trace_write_msr)(void *, unsigned int, u64, int); + +typedef void (*btf_trace_rdpmc)(void *, unsigned int, u64, int); + struct pci_sriov { int pos; int nres; @@ -56744,14 +61251,6 @@ enum { PCI_SCAN_ALL_PCIE_DEVS = 64, }; -enum pcie_bus_config_types { - PCIE_BUS_TUNE_OFF = 0, - PCIE_BUS_DEFAULT = 1, - PCIE_BUS_SAFE = 2, - PCIE_BUS_PERFORMANCE = 3, - PCIE_BUS_PEER2PEER = 4, -}; - struct hotplug_slot_ops { int (*enable_slot)(struct hotplug_slot *); int (*disable_slot)(struct hotplug_slot *); @@ -56860,12 +61359,6 @@ enum pci_ers_result { PCI_ERS_RESULT_NO_AER_DRIVER = 6, }; -enum dev_dma_attr { - DEV_DMA_NOT_SUPPORTED = 0, - DEV_DMA_NON_COHERENT = 1, - DEV_DMA_COHERENT = 2, -}; - struct pcie_device { int irq; struct pci_dev *port; @@ -56954,7 +61447,7 @@ enum release_type { }; enum enable_type { - undefined = -1, + undefined = 4294967295, user_disabled = 0, auto_disabled = 1, user_enabled = 2, @@ -57104,7 +61597,7 @@ struct acpi_pci_root { }; enum pm_qos_flags_status { - PM_QOS_FLAGS_UNDEFINED = -1, + PM_QOS_FLAGS_UNDEFINED = 4294967295, PM_QOS_FLAGS_NONE = 0, PM_QOS_FLAGS_SOME = 1, PM_QOS_FLAGS_ALL = 2, @@ -57189,28 +61682,6 @@ enum hpx_type3_cfg_loc { HPX_CFG_MAX = 5, }; -enum device_link_state { - DL_STATE_NONE = -1, - DL_STATE_DORMANT = 0, - DL_STATE_AVAILABLE = 1, - DL_STATE_CONSUMER_PROBE = 2, - DL_STATE_ACTIVE = 3, - DL_STATE_SUPPLIER_UNBIND = 4, -}; - -struct device_link { - struct device *supplier; - struct list_head s_node; - struct device *consumer; - struct list_head c_node; - enum device_link_state status; - u32 flags; - refcount_t rpm_active; - struct kref kref; - struct callback_head callback_head; - bool supplier_preactivated; -}; - enum pci_irq_reroute_variant { INTEL_IRQ_REROUTE_VARIANT = 1, MAX_IRQ_REROUTE_VARIANTS = 3, @@ -57366,8 +61837,6 @@ struct pci_dev_acs_ops { int (*disable_acs_redir)(struct pci_dev *); }; -typedef acpi_status (*acpi_walk_callback)(acpi_handle, u32, void *, void **); - struct msix_entry { u32 vector; u16 entry; @@ -57385,10 +61854,10 @@ enum dmi_device_type { DMI_DEV_TYPE_PATA = 8, DMI_DEV_TYPE_SATA = 9, DMI_DEV_TYPE_SAS = 10, - DMI_DEV_TYPE_IPMI = -1, - DMI_DEV_TYPE_OEM_STRING = -2, - DMI_DEV_TYPE_DEV_ONBOARD = -3, - DMI_DEV_TYPE_DEV_SLOT = -4, + DMI_DEV_TYPE_IPMI = 4294967295, + DMI_DEV_TYPE_OEM_STRING = 4294967294, + DMI_DEV_TYPE_DEV_ONBOARD = 4294967293, + DMI_DEV_TYPE_DEV_SLOT = 4294967292, }; struct dmi_device { @@ -57660,7 +62129,7 @@ struct hdmi_audio_infoframe { }; enum hdmi_3d_structure { - HDMI_3D_STRUCTURE_INVALID = -1, + HDMI_3D_STRUCTURE_INVALID = 4294967295, HDMI_3D_STRUCTURE_FRAME_PACKING = 0, HDMI_3D_STRUCTURE_FIELD_ALTERNATIVE = 1, HDMI_3D_STRUCTURE_LINE_ALTERNATIVE = 2, @@ -57700,114 +62169,6 @@ union hdmi_infoframe { struct hdmi_drm_infoframe drm; }; -struct console_font { - unsigned int width; - unsigned int height; - unsigned int charcount; - unsigned char *data; -}; - -struct vt_mode { - char mode; - char waitv; - short int relsig; - short int acqsig; - short int frsig; -}; - -struct uni_pagedir; - -struct uni_screen; - -struct vc_data { - struct tty_port port; - short unsigned int vc_num; - unsigned int vc_cols; - unsigned int vc_rows; - unsigned int vc_size_row; - unsigned int vc_scan_lines; - long unsigned int vc_origin; - long unsigned int vc_scr_end; - long unsigned int vc_visible_origin; - unsigned int vc_top; - unsigned int vc_bottom; - const struct consw *vc_sw; - short unsigned int *vc_screenbuf; - unsigned int vc_screenbuf_size; - unsigned char vc_mode; - unsigned char vc_attr; - unsigned char vc_def_color; - unsigned char vc_color; - unsigned char vc_s_color; - unsigned char vc_ulcolor; - unsigned char vc_itcolor; - unsigned char vc_halfcolor; - unsigned int vc_cursor_type; - short unsigned int vc_complement_mask; - short unsigned int vc_s_complement_mask; - unsigned int vc_x; - unsigned int vc_y; - unsigned int vc_saved_x; - unsigned int vc_saved_y; - long unsigned int vc_pos; - short unsigned int vc_hi_font_mask; - struct console_font vc_font; - short unsigned int vc_video_erase_char; - unsigned int vc_state; - unsigned int vc_npar; - unsigned int vc_par[16]; - struct vt_mode vt_mode; - struct pid *vt_pid; - int vt_newvt; - wait_queue_head_t paste_wait; - unsigned int vc_charset: 1; - unsigned int vc_s_charset: 1; - unsigned int vc_disp_ctrl: 1; - unsigned int vc_toggle_meta: 1; - unsigned int vc_decscnm: 1; - unsigned int vc_decom: 1; - unsigned int vc_decawm: 1; - unsigned int vc_deccm: 1; - unsigned int vc_decim: 1; - unsigned int vc_intensity: 2; - unsigned int vc_italic: 1; - unsigned int vc_underline: 1; - unsigned int vc_blink: 1; - unsigned int vc_reverse: 1; - unsigned int vc_s_intensity: 2; - unsigned int vc_s_italic: 1; - unsigned int vc_s_underline: 1; - unsigned int vc_s_blink: 1; - unsigned int vc_s_reverse: 1; - unsigned int vc_priv: 3; - unsigned int vc_need_wrap: 1; - unsigned int vc_can_do_color: 1; - unsigned int vc_report_mouse: 2; - unsigned char vc_utf: 1; - unsigned char vc_utf_count; - int vc_utf_char; - unsigned int vc_tab_stop[8]; - unsigned char vc_palette[48]; - short unsigned int *vc_translate; - unsigned char vc_G0_charset; - unsigned char vc_G1_charset; - unsigned char vc_saved_G0; - unsigned char vc_saved_G1; - unsigned int vc_resize_user; - unsigned int vc_bell_pitch; - unsigned int vc_bell_duration; - short unsigned int vc_cur_blink_ms; - struct vc_data **vc_display_fg; - struct uni_pagedir *vc_uni_pagedir; - struct uni_pagedir **vc_uni_pagedir_loc; - struct uni_screen *vc_uni_screen; -}; - -struct vc { - struct vc_data *d; - struct work_struct SAK_work; -}; - struct vgastate { void *vgabase; long unsigned int membase; @@ -57841,71 +62202,6 @@ struct linux_logo { const unsigned char *data; }; -struct fb_fix_screeninfo { - char id[16]; - long unsigned int smem_start; - __u32 smem_len; - __u32 type; - __u32 type_aux; - __u32 visual; - __u16 xpanstep; - __u16 ypanstep; - __u16 ywrapstep; - __u32 line_length; - long unsigned int mmio_start; - __u32 mmio_len; - __u32 accel; - __u16 capabilities; - __u16 reserved[2]; -}; - -struct fb_bitfield { - __u32 offset; - __u32 length; - __u32 msb_right; -}; - -struct fb_var_screeninfo { - __u32 xres; - __u32 yres; - __u32 xres_virtual; - __u32 yres_virtual; - __u32 xoffset; - __u32 yoffset; - __u32 bits_per_pixel; - __u32 grayscale; - struct fb_bitfield red; - struct fb_bitfield green; - struct fb_bitfield blue; - struct fb_bitfield transp; - __u32 nonstd; - __u32 activate; - __u32 height; - __u32 width; - __u32 accel_flags; - __u32 pixclock; - __u32 left_margin; - __u32 right_margin; - __u32 upper_margin; - __u32 lower_margin; - __u32 hsync_len; - __u32 vsync_len; - __u32 sync; - __u32 vmode; - __u32 rotate; - __u32 colorspace; - __u32 reserved[4]; -}; - -struct fb_cmap { - __u32 start; - __u32 len; - __u16 *red; - __u16 *green; - __u16 *blue; - __u16 *transp; -}; - enum { FB_BLANK_UNBLANK = 0, FB_BLANK_NORMAL = 1, @@ -57914,283 +62210,11 @@ enum { FB_BLANK_POWERDOWN = 4, }; -struct fb_copyarea { - __u32 dx; - __u32 dy; - __u32 width; - __u32 height; - __u32 sx; - __u32 sy; -}; - -struct fb_fillrect { - __u32 dx; - __u32 dy; - __u32 width; - __u32 height; - __u32 color; - __u32 rop; -}; - -struct fb_image { - __u32 dx; - __u32 dy; - __u32 width; - __u32 height; - __u32 fg_color; - __u32 bg_color; - __u8 depth; - const char *data; - struct fb_cmap cmap; -}; - -struct fbcurpos { - __u16 x; - __u16 y; -}; - -struct fb_cursor { - __u16 set; - __u16 enable; - __u16 rop; - const char *mask; - struct fbcurpos hot; - struct fb_image image; -}; - -struct fb_chroma { - __u32 redx; - __u32 greenx; - __u32 bluex; - __u32 whitex; - __u32 redy; - __u32 greeny; - __u32 bluey; - __u32 whitey; -}; - -struct fb_videomode; - -struct fb_monspecs { - struct fb_chroma chroma; - struct fb_videomode *modedb; - __u8 manufacturer[4]; - __u8 monitor[14]; - __u8 serial_no[14]; - __u8 ascii[14]; - __u32 modedb_len; - __u32 model; - __u32 serial; - __u32 year; - __u32 week; - __u32 hfmin; - __u32 hfmax; - __u32 dclkmin; - __u32 dclkmax; - __u16 input; - __u16 dpms; - __u16 signal; - __u16 vfmin; - __u16 vfmax; - __u16 gamma; - __u16 gtf: 1; - __u16 misc; - __u8 version; - __u8 revision; - __u8 max_x; - __u8 max_y; -}; - -struct fb_videomode { - const char *name; - u32 refresh; - u32 xres; - u32 yres; - u32 pixclock; - u32 left_margin; - u32 right_margin; - u32 upper_margin; - u32 lower_margin; - u32 hsync_len; - u32 vsync_len; - u32 sync; - u32 vmode; - u32 flag; -}; - -struct fb_info; - struct fb_event { struct fb_info *info; void *data; }; -struct fb_pixmap { - u8 *addr; - u32 size; - u32 offset; - u32 buf_align; - u32 scan_align; - u32 access_align; - u32 flags; - u32 blit_x; - u32 blit_y; - void (*writeio)(struct fb_info *, void *, void *, unsigned int); - void (*readio)(struct fb_info *, void *, void *, unsigned int); -}; - -struct fb_deferred_io; - -struct fb_ops; - -struct fb_tile_ops; - -struct apertures_struct; - -struct fb_info { - atomic_t count; - int node; - int flags; - int fbcon_rotate_hint; - struct mutex lock; - struct mutex mm_lock; - struct fb_var_screeninfo var; - struct fb_fix_screeninfo fix; - struct fb_monspecs monspecs; - struct work_struct queue; - struct fb_pixmap pixmap; - struct fb_pixmap sprite; - struct fb_cmap cmap; - struct list_head modelist; - struct fb_videomode *mode; - struct delayed_work deferred_work; - struct fb_deferred_io *fbdefio; - struct fb_ops *fbops; - struct device *device; - struct device *dev; - int class_flag; - struct fb_tile_ops *tileops; - union { - char *screen_base; - char *screen_buffer; - }; - long unsigned int screen_size; - void *pseudo_palette; - u32 state; - void *fbcon_par; - void *par; - struct apertures_struct *apertures; - bool skip_vt_switch; -}; - -struct fb_blit_caps { - u32 x; - u32 y; - u32 len; - u32 flags; -}; - -struct fb_deferred_io { - long unsigned int delay; - struct mutex lock; - struct list_head pagelist; - void (*first_io)(struct fb_info *); - void (*deferred_io)(struct fb_info *, struct list_head *); -}; - -struct fb_ops { - struct module *owner; - int (*fb_open)(struct fb_info *, int); - int (*fb_release)(struct fb_info *, int); - ssize_t (*fb_read)(struct fb_info *, char *, size_t, loff_t *); - ssize_t (*fb_write)(struct fb_info *, const char *, size_t, loff_t *); - int (*fb_check_var)(struct fb_var_screeninfo *, struct fb_info *); - int (*fb_set_par)(struct fb_info *); - int (*fb_setcolreg)(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, struct fb_info *); - int (*fb_setcmap)(struct fb_cmap *, struct fb_info *); - int (*fb_blank)(int, struct fb_info *); - int (*fb_pan_display)(struct fb_var_screeninfo *, struct fb_info *); - void (*fb_fillrect)(struct fb_info *, const struct fb_fillrect *); - void (*fb_copyarea)(struct fb_info *, const struct fb_copyarea *); - void (*fb_imageblit)(struct fb_info *, const struct fb_image *); - int (*fb_cursor)(struct fb_info *, struct fb_cursor *); - int (*fb_sync)(struct fb_info *); - int (*fb_ioctl)(struct fb_info *, unsigned int, long unsigned int); - int (*fb_compat_ioctl)(struct fb_info *, unsigned int, long unsigned int); - int (*fb_mmap)(struct fb_info *, struct vm_area_struct *); - void (*fb_get_caps)(struct fb_info *, struct fb_blit_caps *, struct fb_var_screeninfo *); - void (*fb_destroy)(struct fb_info *); - int (*fb_debug_enter)(struct fb_info *); - int (*fb_debug_leave)(struct fb_info *); -}; - -struct fb_tilemap { - __u32 width; - __u32 height; - __u32 depth; - __u32 length; - const __u8 *data; -}; - -struct fb_tilerect { - __u32 sx; - __u32 sy; - __u32 width; - __u32 height; - __u32 index; - __u32 fg; - __u32 bg; - __u32 rop; -}; - -struct fb_tilearea { - __u32 sx; - __u32 sy; - __u32 dx; - __u32 dy; - __u32 width; - __u32 height; -}; - -struct fb_tileblit { - __u32 sx; - __u32 sy; - __u32 width; - __u32 height; - __u32 fg; - __u32 bg; - __u32 length; - __u32 *indices; -}; - -struct fb_tilecursor { - __u32 sx; - __u32 sy; - __u32 mode; - __u32 shape; - __u32 fg; - __u32 bg; -}; - -struct fb_tile_ops { - void (*fb_settile)(struct fb_info *, struct fb_tilemap *); - void (*fb_tilecopy)(struct fb_info *, struct fb_tilearea *); - void (*fb_tilefill)(struct fb_info *, struct fb_tilerect *); - void (*fb_tileblit)(struct fb_info *, struct fb_tileblit *); - void (*fb_tilecursor)(struct fb_info *, struct fb_tilecursor *); - int (*fb_get_tilemax)(struct fb_info *); -}; - -struct aperture { - resource_size_t base; - resource_size_t size; -}; - -struct apertures_struct { - unsigned int count; - struct aperture ranges[0]; -}; - enum backlight_update_reason { BACKLIGHT_UPDATE_HOTKEY = 0, BACKLIGHT_UPDATE_SYSFS = 1, @@ -58302,13 +62326,6 @@ struct fb_cmap32 { compat_caddr_t transp; }; -struct dmt_videomode { - u32 dmt_id; - u32 std_2byte_code; - u32 cvt_3byte_code; - const struct fb_videomode *mode; -}; - struct broken_edid { u8 manufacturer[4]; u32 model; @@ -58419,13 +62436,13 @@ struct fbcon_ops { }; enum { - FBCON_LOGO_CANSHOW = -1, - FBCON_LOGO_DRAW = -2, - FBCON_LOGO_DONTSHOW = -3, + FBCON_LOGO_CANSHOW = 4294967295, + FBCON_LOGO_DRAW = 4294967294, + FBCON_LOGO_DONTSHOW = 4294967293, }; enum drm_panel_orientation { - DRM_MODE_PANEL_ORIENTATION_UNKNOWN = -1, + DRM_MODE_PANEL_ORIENTATION_UNKNOWN = 4294967295, DRM_MODE_PANEL_ORIENTATION_NORMAL = 0, DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP = 1, DRM_MODE_PANEL_ORIENTATION_LEFT_UP = 2, @@ -58498,6 +62515,31 @@ struct acpi_madt_generic_distributor { u8 reserved2[3]; }; +typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *); + +struct transaction; + +struct acpi_ec { + acpi_handle handle; + int gpe; + int irq; + long unsigned int command_addr; + long unsigned int data_addr; + bool global_lock; + long unsigned int flags; + long unsigned int reference_count; + struct mutex mutex; + wait_queue_head_t wait; + struct list_head list; + struct transaction *curr; + spinlock_t lock; + struct work_struct work; + long unsigned int timestamp; + long unsigned int nr_pending_queries; + bool busy_polling; + unsigned int polling_guard; +}; + enum acpi_subtable_type { ACPI_SUBTABLE_COMMON = 0, ACPI_SUBTABLE_HMAT = 1, @@ -58525,7 +62567,7 @@ struct acpi_platform_list { u32 data; }; -typedef u32 (*acpi_interface_handler)(acpi_string, u32); +typedef char *acpi_string; struct acpi_osi_entry { char string[64]; @@ -58542,6 +62584,8 @@ struct acpi_osi_config { unsigned int darwin_cmdline: 1; }; +typedef u32 acpi_name; + struct acpi_predefined_names { const char *name; u8 type; @@ -58552,16 +62596,30 @@ typedef u32 (*acpi_osd_handler)(void *); typedef void (*acpi_osd_exec_callback)(void *); +typedef u32 (*acpi_sci_handler)(void *); + +typedef void (*acpi_gbl_event_handler)(u32, acpi_handle, u32, void *); + +typedef u32 (*acpi_event_handler)(void *); + typedef u32 (*acpi_gpe_handler)(acpi_handle, u32, void *); typedef void (*acpi_notify_handler)(acpi_handle, u32, void *); typedef void (*acpi_object_handler)(acpi_handle, void *); +typedef acpi_status (*acpi_init_handler)(acpi_handle, u32); + +typedef acpi_status (*acpi_exception_handler)(acpi_status, acpi_name, u16, u32, void *); + +typedef acpi_status (*acpi_table_handler)(u32, void *, void *); + typedef acpi_status (*acpi_adr_space_handler)(u32, acpi_physical_address, u32, u64 *, void *, void *); typedef acpi_status (*acpi_adr_space_setup)(acpi_handle, u32, void *, void **); +typedef u32 (*acpi_interface_handler)(acpi_string, u32); + struct acpi_pci_id { u16 segment; u16 bus; @@ -58577,6 +62635,20 @@ struct acpi_mem_space_context { acpi_size mapped_length; }; +struct acpi_table_facs { + char signature[4]; + u32 length; + u32 hardware_signature; + u32 firmware_waking_vector; + u32 global_lock; + u32 flags; + u64 xfirmware_waking_vector; + u8 version; + u8 reserved[3]; + u32 ospm_flags; + u8 reserved1[24]; +}; + typedef enum { OSL_GLOBAL_LOCK_HANDLER = 0, OSL_NOTIFY_HANDLER = 1, @@ -58587,6 +62659,18 @@ typedef enum { OSL_EC_BURST_HANDLER = 6, } acpi_execute_type; +struct acpi_rw_lock { + void *writer_mutex; + void *reader_mutex; + u32 num_readers; +}; + +struct acpi_mutex_info { + void *mutex; + u32 use_count; + u64 thread_id; +}; + union acpi_operand_object; struct acpi_namespace_node { @@ -58983,6 +63067,13 @@ union acpi_operand_object { struct acpi_namespace_node node; }; +struct acpi_table_list { + struct acpi_table_desc *tables; + u32 current_table_count; + u32 max_table_count; + u8 flags; +}; + union acpi_parse_object; union acpi_generic_state; @@ -59061,6 +63152,12 @@ struct acpi_walk_state { acpi_parse_upwards ascending_callback; }; +struct acpi_sci_handler_info { + struct acpi_sci_handler_info *next; + acpi_sci_handler address; + void *context; +}; + struct acpi_gpe_handler_info { acpi_gpe_handler address; void *context; @@ -59125,6 +63222,18 @@ struct acpi_gpe_xrupt_info { u32 interrupt_number; }; +struct acpi_fixed_event_handler { + acpi_event_handler handler; + void *context; +}; + +struct acpi_fixed_event_info { + u8 status_register_id; + u8 enable_register_id; + u16 status_bit_mask; + u16 enable_bit_mask; +}; + struct acpi_common_state { void *next; u8 descriptor_type; @@ -59322,6 +63431,13 @@ union acpi_generic_state { struct acpi_notify_info notify; }; +struct acpi_address_range { + struct acpi_address_range *next; + struct acpi_namespace_node *region_node; + acpi_physical_address start_address; + acpi_physical_address end_address; +}; + struct acpi_opcode_info { u32 parse_args; u32 runtime_args; @@ -59331,6 +63447,24 @@ struct acpi_opcode_info { u8 type; }; +struct acpi_comment_node { + char *comment; + struct acpi_comment_node *next; +}; + +struct acpi_bit_register_info { + u8 parent_register; + u8 bit_position; + u16 access_bit_mask; +}; + +struct acpi_interface_info { + char *name; + struct acpi_interface_info *next; + u8 flags; + u8 value; +}; + struct acpi_os_dpc { acpi_osd_exec_callback function; void *context; @@ -59351,6 +63485,11 @@ struct acpi_hp_work { u32 src; }; +struct acpi_object_list { + u32 count; + union acpi_object *pointer; +}; + struct acpi_pld_info { u8 revision; u8 ignore_color; @@ -59416,20 +63555,6 @@ struct nvs_page { typedef u32 acpi_event_status; -struct acpi_table_facs { - char signature[4]; - u32 length; - u32 hardware_signature; - u32 firmware_waking_vector; - u32 global_lock; - u32 flags; - u64 xfirmware_waking_vector; - u8 version; - u8 reserved[3]; - u32 ospm_flags; - u8 reserved1[24]; -}; - struct lpi_device_info { char *name; int enabled; @@ -59476,10 +63601,6 @@ struct acpi_device_physical_node { bool put_online: 1; }; -typedef u32 (*acpi_event_handler)(void *); - -typedef acpi_status (*acpi_table_handler)(u32, void *, void *); - enum acpi_bus_device_type { ACPI_BUS_TYPE_DEVICE = 0, ACPI_BUS_TYPE_POWER = 1, @@ -59498,6 +63619,12 @@ struct acpi_osc_context { struct acpi_buffer ret; }; +enum dev_dma_attr { + DEV_DMA_NOT_SUPPORTED = 0, + DEV_DMA_NON_COHERENT = 1, + DEV_DMA_COHERENT = 2, +}; + struct acpi_pnp_device_id { u32 length; char *string; @@ -59949,8 +64076,6 @@ struct acpi_resource { union acpi_resource_data data; } __attribute__((packed)); -typedef acpi_status (*acpi_walk_resource_callback)(struct acpi_resource *, void *); - enum acpi_reconfig_event { ACPI_RECONFIG_DEVICE_ADD = 0, ACPI_RECONFIG_DEVICE_REMOVE = 1, @@ -59996,309 +64121,6 @@ struct res_proc_context { int error; }; -struct thermal_cooling_device_ops; - -struct thermal_cooling_device { - int id; - char type[20]; - struct device device; - struct device_node *np; - void *devdata; - void *stats; - const struct thermal_cooling_device_ops *ops; - bool updated; - struct mutex lock; - struct list_head thermal_instances; - struct list_head node; -}; - -enum thermal_device_mode { - THERMAL_DEVICE_DISABLED = 0, - THERMAL_DEVICE_ENABLED = 1, -}; - -enum thermal_trip_type { - THERMAL_TRIP_ACTIVE = 0, - THERMAL_TRIP_PASSIVE = 1, - THERMAL_TRIP_HOT = 2, - THERMAL_TRIP_CRITICAL = 3, -}; - -enum thermal_trend { - THERMAL_TREND_STABLE = 0, - THERMAL_TREND_RAISING = 1, - THERMAL_TREND_DROPPING = 2, - THERMAL_TREND_RAISE_FULL = 3, - THERMAL_TREND_DROP_FULL = 4, -}; - -enum thermal_notify_event { - THERMAL_EVENT_UNSPECIFIED = 0, - THERMAL_EVENT_TEMP_SAMPLE = 1, - THERMAL_TRIP_VIOLATED = 2, - THERMAL_TRIP_CHANGED = 3, - THERMAL_DEVICE_DOWN = 4, - THERMAL_DEVICE_UP = 5, - THERMAL_DEVICE_POWER_CAPABILITY_CHANGED = 6, - THERMAL_TABLE_CHANGED = 7, -}; - -struct thermal_zone_device; - -struct thermal_zone_device_ops { - int (*bind)(struct thermal_zone_device *, struct thermal_cooling_device *); - int (*unbind)(struct thermal_zone_device *, struct thermal_cooling_device *); - int (*get_temp)(struct thermal_zone_device *, int *); - int (*set_trips)(struct thermal_zone_device *, int, int); - int (*get_mode)(struct thermal_zone_device *, enum thermal_device_mode *); - int (*set_mode)(struct thermal_zone_device *, enum thermal_device_mode); - int (*get_trip_type)(struct thermal_zone_device *, int, enum thermal_trip_type *); - int (*get_trip_temp)(struct thermal_zone_device *, int, int *); - int (*set_trip_temp)(struct thermal_zone_device *, int, int); - int (*get_trip_hyst)(struct thermal_zone_device *, int, int *); - int (*set_trip_hyst)(struct thermal_zone_device *, int, int); - int (*get_crit_temp)(struct thermal_zone_device *, int *); - int (*set_emul_temp)(struct thermal_zone_device *, int); - int (*get_trend)(struct thermal_zone_device *, int, enum thermal_trend *); - int (*notify)(struct thermal_zone_device *, int, enum thermal_trip_type); -}; - -struct thermal_attr; - -struct thermal_zone_params; - -struct thermal_governor; - -struct thermal_zone_device { - int id; - char type[20]; - struct device device; - struct attribute_group trips_attribute_group; - struct thermal_attr *trip_temp_attrs; - struct thermal_attr *trip_type_attrs; - struct thermal_attr *trip_hyst_attrs; - void *devdata; - int trips; - long unsigned int trips_disabled; - int passive_delay; - int polling_delay; - int temperature; - int last_temperature; - int emul_temperature; - int passive; - int prev_low_trip; - int prev_high_trip; - unsigned int forced_passive; - atomic_t need_update; - struct thermal_zone_device_ops *ops; - struct thermal_zone_params *tzp; - struct thermal_governor *governor; - void *governor_data; - struct list_head thermal_instances; - struct ida ida; - struct mutex lock; - struct list_head node; - struct delayed_work poll_queue; - enum thermal_notify_event notify_event; -}; - -struct thermal_cooling_device_ops { - int (*get_max_state)(struct thermal_cooling_device *, long unsigned int *); - int (*get_cur_state)(struct thermal_cooling_device *, long unsigned int *); - int (*set_cur_state)(struct thermal_cooling_device *, long unsigned int); - int (*get_requested_power)(struct thermal_cooling_device *, struct thermal_zone_device *, u32 *); - int (*state2power)(struct thermal_cooling_device *, struct thermal_zone_device *, long unsigned int, u32 *); - int (*power2state)(struct thermal_cooling_device *, struct thermal_zone_device *, u32, long unsigned int *); -}; - -struct thermal_attr { - struct device_attribute attr; - char name[20]; -}; - -struct thermal_bind_params; - -struct thermal_zone_params { - char governor_name[20]; - bool no_hwmon; - int num_tbps; - struct thermal_bind_params *tbp; - u32 sustainable_power; - s32 k_po; - s32 k_pu; - s32 k_i; - s32 k_d; - s32 integral_cutoff; - int slope; - int offset; -}; - -struct thermal_governor { - char name[20]; - int (*bind_to_tz)(struct thermal_zone_device *); - void (*unbind_from_tz)(struct thermal_zone_device *); - int (*throttle)(struct thermal_zone_device *, int); - struct list_head governor_list; -}; - -struct thermal_bind_params { - struct thermal_cooling_device *cdev; - int weight; - int trip_mask; - long unsigned int *binding_limits; - int (*match)(struct thermal_zone_device *, struct thermal_cooling_device *); -}; - -struct acpi_lpi_state { - u32 min_residency; - u32 wake_latency; - u32 flags; - u32 arch_flags; - u32 res_cnt_freq; - u32 enable_parent_state; - u64 address; - u8 index; - u8 entry_method; - char desc[32]; -}; - -struct acpi_processor_power { - int count; - union { - struct acpi_processor_cx states[8]; - struct acpi_lpi_state lpi_states[8]; - }; - int timer_broadcast_on_state; -}; - -struct acpi_psd_package { - u64 num_entries; - u64 revision; - u64 domain; - u64 coord_type; - u64 num_processors; -}; - -struct acpi_pct_register { - u8 descriptor; - u16 length; - u8 space_id; - u8 bit_width; - u8 bit_offset; - u8 reserved; - u64 address; -} __attribute__((packed)); - -struct acpi_processor_px { - u64 core_frequency; - u64 power; - u64 transition_latency; - u64 bus_master_latency; - u64 control; - u64 status; -}; - -struct acpi_processor_performance { - unsigned int state; - unsigned int platform_limit; - struct acpi_pct_register control_register; - struct acpi_pct_register status_register; - short: 16; - unsigned int state_count; - int: 32; - struct acpi_processor_px *states; - struct acpi_psd_package domain_info; - cpumask_var_t shared_cpu_map; - unsigned int shared_type; - int: 32; -} __attribute__((packed)); - -struct acpi_tsd_package { - u64 num_entries; - u64 revision; - u64 domain; - u64 coord_type; - u64 num_processors; -}; - -struct acpi_processor_tx_tss { - u64 freqpercentage; - u64 power; - u64 transition_latency; - u64 control; - u64 status; -}; - -struct acpi_processor_tx { - u16 power; - u16 performance; -}; - -struct acpi_processor; - -struct acpi_processor_throttling { - unsigned int state; - unsigned int platform_limit; - struct acpi_pct_register control_register; - struct acpi_pct_register status_register; - short: 16; - unsigned int state_count; - int: 32; - struct acpi_processor_tx_tss *states_tss; - struct acpi_tsd_package domain_info; - cpumask_var_t shared_cpu_map; - int (*acpi_processor_get_throttling)(struct acpi_processor *); - int (*acpi_processor_set_throttling)(struct acpi_processor *, int, bool); - u32 address; - u8 duty_offset; - u8 duty_width; - u8 tsd_valid_flag; - char: 8; - unsigned int shared_type; - struct acpi_processor_tx states[16]; - int: 32; -} __attribute__((packed)); - -struct acpi_processor_lx { - int px; - int tx; -}; - -struct acpi_processor_limit { - struct acpi_processor_lx state; - struct acpi_processor_lx thermal; - struct acpi_processor_lx user; -}; - -struct acpi_processor { - acpi_handle handle; - u32 acpi_id; - phys_cpuid_t phys_id; - u32 id; - u32 pblk; - int performance_platform_limit; - int throttling_platform_limit; - struct acpi_processor_flags flags; - struct acpi_processor_power power; - struct acpi_processor_performance *performance; - struct acpi_processor_throttling throttling; - struct acpi_processor_limit limit; - struct thermal_cooling_device *cdev; - struct device *dev; - struct freq_qos_request perflib_req; - struct freq_qos_request thermal_req; -}; - -struct acpi_processor_errata { - u8 smp; - struct { - u8 throttle: 1; - u8 fdma: 1; - u8 reserved: 6; - u32 bmisx; - } piix4; -}; - struct acpi_table_ecdt { struct acpi_table_header header; struct acpi_generic_address control; @@ -60308,29 +64130,6 @@ struct acpi_table_ecdt { u8 id[1]; } __attribute__((packed)); -struct transaction; - -struct acpi_ec { - acpi_handle handle; - int gpe; - int irq; - long unsigned int command_addr; - long unsigned int data_addr; - bool global_lock; - long unsigned int flags; - long unsigned int reference_count; - struct mutex mutex; - wait_queue_head_t wait; - struct list_head list; - struct transaction *curr; - spinlock_t lock; - struct work_struct work; - long unsigned int timestamp; - long unsigned int nr_pending_queries; - bool busy_polling; - unsigned int polling_guard; -}; - struct transaction { const u8 *wdata; u8 *rdata; @@ -60470,6 +64269,73 @@ struct prt_quirk { const char *actual_source; }; +struct clk_core; + +struct clk_init_data; + +struct clk_hw { + struct clk_core *core; + struct clk *clk; + const struct clk_init_data *init; +}; + +struct clk_rate_request { + long unsigned int rate; + long unsigned int min_rate; + long unsigned int max_rate; + long unsigned int best_parent_rate; + struct clk_hw *best_parent_hw; +}; + +struct clk_duty { + unsigned int num; + unsigned int den; +}; + +struct clk_ops { + int (*prepare)(struct clk_hw *); + void (*unprepare)(struct clk_hw *); + int (*is_prepared)(struct clk_hw *); + void (*unprepare_unused)(struct clk_hw *); + int (*enable)(struct clk_hw *); + void (*disable)(struct clk_hw *); + int (*is_enabled)(struct clk_hw *); + void (*disable_unused)(struct clk_hw *); + int (*save_context)(struct clk_hw *); + void (*restore_context)(struct clk_hw *); + long unsigned int (*recalc_rate)(struct clk_hw *, long unsigned int); + long int (*round_rate)(struct clk_hw *, long unsigned int, long unsigned int *); + int (*determine_rate)(struct clk_hw *, struct clk_rate_request *); + int (*set_parent)(struct clk_hw *, u8); + u8 (*get_parent)(struct clk_hw *); + int (*set_rate)(struct clk_hw *, long unsigned int, long unsigned int); + int (*set_rate_and_parent)(struct clk_hw *, long unsigned int, long unsigned int, u8); + long unsigned int (*recalc_accuracy)(struct clk_hw *, long unsigned int); + int (*get_phase)(struct clk_hw *); + int (*set_phase)(struct clk_hw *, int); + int (*get_duty_cycle)(struct clk_hw *, struct clk_duty *); + int (*set_duty_cycle)(struct clk_hw *, struct clk_duty *); + void (*init)(struct clk_hw *); + void (*debug_init)(struct clk_hw *, struct dentry *); +}; + +struct clk_parent_data { + const struct clk_hw *hw; + const char *fw_name; + const char *name; + int index; +}; + +struct clk_init_data { + const char *name; + const struct clk_ops *ops; + const char * const *parent_names; + const struct clk_parent_data *parent_data; + const struct clk_hw **parent_hws; + u8 num_parents; + long unsigned int flags; +}; + struct apd_private_data; struct apd_device_desc { @@ -60547,8 +64413,6 @@ struct acpi_ged_event { acpi_handle handle; }; -typedef void (*acpi_gbl_event_handler)(u32, acpi_handle, u32, void *); - struct acpi_table_bert { struct acpi_table_header header; u32 region_length; @@ -60628,6 +64492,66 @@ struct lpit_residency_info { void *iomem_addr; }; +enum { + ACPI_REFCLASS_LOCAL = 0, + ACPI_REFCLASS_ARG = 1, + ACPI_REFCLASS_REFOF = 2, + ACPI_REFCLASS_INDEX = 3, + ACPI_REFCLASS_TABLE = 4, + ACPI_REFCLASS_NAME = 5, + ACPI_REFCLASS_DEBUG = 6, + ACPI_REFCLASS_MAX = 6, +}; + +struct acpi_common_descriptor { + void *common_pointer; + u8 descriptor_type; +}; + +union acpi_descriptor { + struct acpi_common_descriptor common; + union acpi_operand_object object; + struct acpi_namespace_node node; + union acpi_parse_object op; +}; + +struct acpi_create_field_info { + struct acpi_namespace_node *region_node; + struct acpi_namespace_node *field_node; + struct acpi_namespace_node *register_node; + struct acpi_namespace_node *data_register_node; + struct acpi_namespace_node *connection_node; + u8 *resource_buffer; + u32 bank_value; + u32 field_bit_position; + u32 field_bit_length; + u16 resource_length; + u16 pin_number_index; + u8 field_flags; + u8 attribute; + u8 field_type; + u8 access_length; +}; + +struct acpi_init_walk_info { + u32 table_index; + u32 object_count; + u32 method_count; + u32 serial_method_count; + u32 non_serial_method_count; + u32 serialized_method_count; + u32 device_count; + u32 op_region_count; + u32 field_count; + u32 buffer_count; + u32 package_count; + u32 op_region_init; + u32 field_init; + u32 buffer_init; + u32 package_init; + acpi_owner_id owner_id; +}; + struct acpi_name_info { char name[4]; u16 argument_list; @@ -60694,76 +64618,6 @@ struct acpi_evaluate_info { u8 flags; }; -enum { - ACPI_REFCLASS_LOCAL = 0, - ACPI_REFCLASS_ARG = 1, - ACPI_REFCLASS_REFOF = 2, - ACPI_REFCLASS_INDEX = 3, - ACPI_REFCLASS_TABLE = 4, - ACPI_REFCLASS_NAME = 5, - ACPI_REFCLASS_DEBUG = 6, - ACPI_REFCLASS_MAX = 6, -}; - -struct acpi_common_descriptor { - void *common_pointer; - u8 descriptor_type; -}; - -union acpi_descriptor { - struct acpi_common_descriptor common; - union acpi_operand_object object; - struct acpi_namespace_node node; - union acpi_parse_object op; -}; - -typedef enum { - ACPI_IMODE_LOAD_PASS1 = 1, - ACPI_IMODE_LOAD_PASS2 = 2, - ACPI_IMODE_EXECUTE = 3, -} acpi_interpreter_mode; - -struct acpi_create_field_info { - struct acpi_namespace_node *region_node; - struct acpi_namespace_node *field_node; - struct acpi_namespace_node *register_node; - struct acpi_namespace_node *data_register_node; - struct acpi_namespace_node *connection_node; - u8 *resource_buffer; - u32 bank_value; - u32 field_bit_position; - u32 field_bit_length; - u16 resource_length; - u16 pin_number_index; - u8 field_flags; - u8 attribute; - u8 field_type; - u8 access_length; -}; - -struct acpi_init_walk_info { - u32 table_index; - u32 object_count; - u32 method_count; - u32 serial_method_count; - u32 non_serial_method_count; - u32 serialized_method_count; - u32 device_count; - u32 op_region_count; - u32 field_count; - u32 buffer_count; - u32 package_count; - u32 op_region_init; - u32 field_init; - u32 buffer_init; - u32 package_init; - acpi_owner_id owner_id; -}; - -typedef u32 acpi_name; - -typedef acpi_status (*acpi_exception_handler)(acpi_status, acpi_name, u16, u32, void *); - enum { AML_FIELD_ACCESS_ANY = 0, AML_FIELD_ACCESS_BYTE = 1, @@ -60773,21 +64627,13 @@ enum { AML_FIELD_ACCESS_BUFFER = 5, }; -typedef acpi_status (*acpi_execute_op)(struct acpi_walk_state *); - -struct acpi_fixed_event_handler { - acpi_event_handler handler; - void *context; -}; - -struct acpi_fixed_event_info { - u8 status_register_id; - u8 enable_register_id; - u16 status_bit_mask; - u16 enable_bit_mask; -}; +typedef enum { + ACPI_IMODE_LOAD_PASS1 = 1, + ACPI_IMODE_LOAD_PASS2 = 2, + ACPI_IMODE_EXECUTE = 3, +} acpi_interpreter_mode; -typedef u32 acpi_mutex_handle; +typedef acpi_status (*acpi_execute_op)(struct acpi_walk_state *); struct acpi_gpe_walk_info { struct acpi_namespace_node *gpe_device; @@ -60818,14 +64664,6 @@ struct acpi_reg_walk_info { acpi_adr_space_type space_id; }; -typedef u32 (*acpi_sci_handler)(void *); - -struct acpi_sci_handler_info { - struct acpi_sci_handler_info *next; - acpi_sci_handler address; - void *context; -}; - enum { AML_FIELD_UPDATE_PRESERVE = 0, AML_FIELD_UPDATE_WRITE_AS_ONES = 32, @@ -60866,12 +64704,6 @@ typedef enum { ACPI_TRACE_AML_REGION = 2, } acpi_trace_event_type; -struct acpi_bit_register_info { - u8 parent_register; - u8 bit_position; - u16 access_bit_mask; -}; - struct acpi_port_info { char *name; u16 start; @@ -60884,8 +64716,6 @@ struct acpi_pci_device { struct acpi_pci_device *next; }; -typedef acpi_status (*acpi_init_handler)(acpi_handle, u32); - struct acpi_device_walk_info { struct acpi_table_desc *table_desc; struct acpi_evaluate_info *evaluate_info; @@ -60894,15 +64724,6 @@ struct acpi_device_walk_info { u32 num_INI; }; -typedef acpi_status (*acpi_pkg_callback)(u8, union acpi_operand_object *, union acpi_generic_state *, void *); - -struct acpi_table_list { - struct acpi_table_desc *tables; - u32 current_table_count; - u32 max_table_count; - u8 flags; -}; - enum acpi_return_package_types { ACPI_PTYPE1_FIXED = 1, ACPI_PTYPE1_VAR = 2, @@ -60945,11 +64766,7 @@ struct acpi_namestring_info { u8 fully_qualified; }; -struct acpi_rw_lock { - void *writer_mutex; - void *reader_mutex; - u32 num_readers; -}; +typedef acpi_status (*acpi_walk_callback)(acpi_handle, u32, void *, void **); struct acpi_get_devices_info { acpi_walk_callback user_function; @@ -61358,8 +65175,6 @@ enum { typedef u16 acpi_rs_length; -typedef acpi_status (*acpi_walk_aml_callback)(u8 *, u32, u32, u8, void **); - typedef u32 acpi_rsdesc_size; struct acpi_vendor_uuid { @@ -61367,6 +65182,8 @@ struct acpi_vendor_uuid { u8 data[16]; }; +typedef acpi_status (*acpi_walk_resource_callback)(struct acpi_resource *, void *); + struct acpi_vendor_walk_info { struct acpi_vendor_uuid *uuid; struct acpi_buffer *buffer; @@ -61400,13 +65217,6 @@ struct acpi_table_rsdp { u8 reserved[3]; } __attribute__((packed)); -struct acpi_address_range { - struct acpi_address_range *next; - struct acpi_namespace_node *region_node; - acpi_physical_address start_address; - acpi_physical_address end_address; -}; - struct acpi_pkg_info { u8 *free_space; acpi_size length; @@ -61418,23 +65228,11 @@ struct acpi_exception_info { char *name; }; -struct acpi_mutex_info { - void *mutex; - u32 use_count; - u64 thread_id; -}; +typedef acpi_status (*acpi_pkg_callback)(u8, union acpi_operand_object *, union acpi_generic_state *, void *); -struct acpi_comment_node { - char *comment; - struct acpi_comment_node *next; -}; +typedef u32 acpi_mutex_handle; -struct acpi_interface_info { - char *name; - struct acpi_interface_info *next; - u8 flags; - u8 value; -}; +typedef acpi_status (*acpi_walk_aml_callback)(u8 *, u32, u32, u8, void **); enum led_brightness { LED_OFF = 0, @@ -61952,7 +65750,7 @@ struct acpi_video_device_brightness { }; enum acpi_backlight_type { - acpi_backlight_undef = -1, + acpi_backlight_undef = 4294967295, acpi_backlight_none = 0, acpi_backlight_video = 1, acpi_backlight_vendor = 2, @@ -62337,16 +66135,6 @@ struct acpi_offsets { u8 mode; }; -struct acpi_table_bgrt { - struct acpi_table_header header; - u16 version; - u8 status; - u8 image_type; - u64 image_address; - u32 image_offset_x; - u32 image_offset_y; -}; - struct acpi_pcct_hw_reduced { struct acpi_subtable_header header; u32 platform_interrupt; @@ -62599,8 +66387,6 @@ struct clk_bulk_devres { int num_clks; }; -struct clk_hw; - struct clk_lookup { struct list_head node; const char *dev_id; @@ -62609,73 +66395,6 @@ struct clk_lookup { struct clk_hw *clk_hw; }; -struct clk_core; - -struct clk_init_data; - -struct clk_hw { - struct clk_core *core; - struct clk *clk; - const struct clk_init_data *init; -}; - -struct clk_rate_request { - long unsigned int rate; - long unsigned int min_rate; - long unsigned int max_rate; - long unsigned int best_parent_rate; - struct clk_hw *best_parent_hw; -}; - -struct clk_duty { - unsigned int num; - unsigned int den; -}; - -struct clk_ops { - int (*prepare)(struct clk_hw *); - void (*unprepare)(struct clk_hw *); - int (*is_prepared)(struct clk_hw *); - void (*unprepare_unused)(struct clk_hw *); - int (*enable)(struct clk_hw *); - void (*disable)(struct clk_hw *); - int (*is_enabled)(struct clk_hw *); - void (*disable_unused)(struct clk_hw *); - int (*save_context)(struct clk_hw *); - void (*restore_context)(struct clk_hw *); - long unsigned int (*recalc_rate)(struct clk_hw *, long unsigned int); - long int (*round_rate)(struct clk_hw *, long unsigned int, long unsigned int *); - int (*determine_rate)(struct clk_hw *, struct clk_rate_request *); - int (*set_parent)(struct clk_hw *, u8); - u8 (*get_parent)(struct clk_hw *); - int (*set_rate)(struct clk_hw *, long unsigned int, long unsigned int); - int (*set_rate_and_parent)(struct clk_hw *, long unsigned int, long unsigned int, u8); - long unsigned int (*recalc_accuracy)(struct clk_hw *, long unsigned int); - int (*get_phase)(struct clk_hw *); - int (*set_phase)(struct clk_hw *, int); - int (*get_duty_cycle)(struct clk_hw *, struct clk_duty *); - int (*set_duty_cycle)(struct clk_hw *, struct clk_duty *); - void (*init)(struct clk_hw *); - void (*debug_init)(struct clk_hw *, struct dentry *); -}; - -struct clk_parent_data { - const struct clk_hw *hw; - const char *fw_name; - const char *name; - int index; -}; - -struct clk_init_data { - const char *name; - const struct clk_ops *ops; - const char * const *parent_names; - const struct clk_parent_data *parent_data; - const struct clk_hw **parent_hws; - u8 num_parents; - long unsigned int flags; -}; - struct clk_lookup_alloc { struct clk_lookup cl; char dev_id[20]; @@ -62807,6 +66526,38 @@ struct trace_event_data_offsets_clk_duty_cycle { u32 name; }; +typedef void (*btf_trace_clk_enable)(void *, struct clk_core *); + +typedef void (*btf_trace_clk_enable_complete)(void *, struct clk_core *); + +typedef void (*btf_trace_clk_disable)(void *, struct clk_core *); + +typedef void (*btf_trace_clk_disable_complete)(void *, struct clk_core *); + +typedef void (*btf_trace_clk_prepare)(void *, struct clk_core *); + +typedef void (*btf_trace_clk_prepare_complete)(void *, struct clk_core *); + +typedef void (*btf_trace_clk_unprepare)(void *, struct clk_core *); + +typedef void (*btf_trace_clk_unprepare_complete)(void *, struct clk_core *); + +typedef void (*btf_trace_clk_set_rate)(void *, struct clk_core *, long unsigned int); + +typedef void (*btf_trace_clk_set_rate_complete)(void *, struct clk_core *, long unsigned int); + +typedef void (*btf_trace_clk_set_parent)(void *, struct clk_core *, struct clk_core *); + +typedef void (*btf_trace_clk_set_parent_complete)(void *, struct clk_core *, struct clk_core *); + +typedef void (*btf_trace_clk_set_phase)(void *, struct clk_core *, int); + +typedef void (*btf_trace_clk_set_phase_complete)(void *, struct clk_core *, int); + +typedef void (*btf_trace_clk_set_duty_cycle)(void *, struct clk_core *, struct clk_duty *); + +typedef void (*btf_trace_clk_set_duty_cycle_complete)(void *, struct clk_core *, struct clk_duty *); + struct clk_div_table { unsigned int val; unsigned int div; @@ -63711,20 +67462,10 @@ struct unimapdesc { struct unipair *entries; }; -struct kbentry { - unsigned char kb_table; - unsigned char kb_index; - short unsigned int kb_value; -}; - -struct kbsentry { - unsigned char kb_func; - unsigned char kb_string[512]; -}; - -struct kbkeycode { - unsigned int scancode; - unsigned int keycode; +struct kbdiacruc { + unsigned int diacr; + unsigned int base; + unsigned int result; }; struct kbd_repeat { @@ -63774,12 +67515,6 @@ struct vt_setactivate { struct vt_mode mode; }; -struct vt_spawn_console { - spinlock_t lock; - struct pid *pid; - int sig; -}; - struct vt_event_wait { struct list_head list; struct vt_event event; @@ -63847,6 +67582,17 @@ struct kbd_struct { unsigned char modeflags: 5; }; +struct kbentry { + unsigned char kb_table; + unsigned char kb_index; + short unsigned int kb_value; +}; + +struct kbsentry { + unsigned char kb_func; + unsigned char kb_string[512]; +}; + struct kbdiacr { unsigned char diacr; unsigned char base; @@ -63858,17 +67604,16 @@ struct kbdiacrs { struct kbdiacr kbdiacr[256]; }; -struct kbdiacruc { - unsigned int diacr; - unsigned int base; - unsigned int result; -}; - struct kbdiacrsuc { unsigned int kb_cnt; struct kbdiacruc kbdiacruc[256]; }; +struct kbkeycode { + unsigned int scancode; + unsigned int keycode; +}; + typedef void k_handler_fn(struct vc_data *, unsigned char, char); typedef void fn_handler_fn(struct vc_data *); @@ -63948,151 +67693,6 @@ struct interval { uint32_t last; }; -struct serial_rs485 { - __u32 flags; - __u32 delay_rts_before_send; - __u32 delay_rts_after_send; - __u32 padding[5]; -}; - -struct serial_iso7816 { - __u32 flags; - __u32 tg; - __u32 sc_fi; - __u32 sc_di; - __u32 clk; - __u32 reserved[5]; -}; - -struct circ_buf { - char *buf; - int head; - int tail; -}; - -struct uart_port; - -struct uart_ops { - unsigned int (*tx_empty)(struct uart_port *); - void (*set_mctrl)(struct uart_port *, unsigned int); - unsigned int (*get_mctrl)(struct uart_port *); - void (*stop_tx)(struct uart_port *); - void (*start_tx)(struct uart_port *); - void (*throttle)(struct uart_port *); - void (*unthrottle)(struct uart_port *); - void (*send_xchar)(struct uart_port *, char); - void (*stop_rx)(struct uart_port *); - void (*enable_ms)(struct uart_port *); - void (*break_ctl)(struct uart_port *, int); - int (*startup)(struct uart_port *); - void (*shutdown)(struct uart_port *); - void (*flush_buffer)(struct uart_port *); - void (*set_termios)(struct uart_port *, struct ktermios *, struct ktermios *); - void (*set_ldisc)(struct uart_port *, struct ktermios *); - void (*pm)(struct uart_port *, unsigned int, unsigned int); - const char * (*type)(struct uart_port *); - void (*release_port)(struct uart_port *); - int (*request_port)(struct uart_port *); - void (*config_port)(struct uart_port *, int); - int (*verify_port)(struct uart_port *, struct serial_struct *); - int (*ioctl)(struct uart_port *, unsigned int, long unsigned int); -}; - -struct uart_icount { - __u32 cts; - __u32 dsr; - __u32 rng; - __u32 dcd; - __u32 rx; - __u32 tx; - __u32 frame; - __u32 overrun; - __u32 parity; - __u32 brk; - __u32 buf_overrun; -}; - -typedef unsigned int upf_t; - -typedef unsigned int upstat_t; - -struct uart_state; - -struct uart_port { - spinlock_t lock; - long unsigned int iobase; - unsigned char *membase; - unsigned int (*serial_in)(struct uart_port *, int); - void (*serial_out)(struct uart_port *, int, int); - void (*set_termios)(struct uart_port *, struct ktermios *, struct ktermios *); - void (*set_ldisc)(struct uart_port *, struct ktermios *); - unsigned int (*get_mctrl)(struct uart_port *); - void (*set_mctrl)(struct uart_port *, unsigned int); - unsigned int (*get_divisor)(struct uart_port *, unsigned int, unsigned int *); - void (*set_divisor)(struct uart_port *, unsigned int, unsigned int, unsigned int); - int (*startup)(struct uart_port *); - void (*shutdown)(struct uart_port *); - void (*throttle)(struct uart_port *); - void (*unthrottle)(struct uart_port *); - int (*handle_irq)(struct uart_port *); - void (*pm)(struct uart_port *, unsigned int, unsigned int); - void (*handle_break)(struct uart_port *); - int (*rs485_config)(struct uart_port *, struct serial_rs485 *); - int (*iso7816_config)(struct uart_port *, struct serial_iso7816 *); - unsigned int irq; - long unsigned int irqflags; - unsigned int uartclk; - unsigned int fifosize; - unsigned char x_char; - unsigned char regshift; - unsigned char iotype; - unsigned char quirks; - unsigned int read_status_mask; - unsigned int ignore_status_mask; - struct uart_state *state; - struct uart_icount icount; - struct console *cons; - long unsigned int sysrq; - unsigned int sysrq_ch; - upf_t flags; - upstat_t status; - int hw_stopped; - unsigned int mctrl; - unsigned int timeout; - unsigned int type; - const struct uart_ops *ops; - unsigned int custom_divisor; - unsigned int line; - unsigned int minor; - resource_size_t mapbase; - resource_size_t mapsize; - struct device *dev; - unsigned char hub6; - unsigned char suspended; - unsigned char unused[2]; - const char *name; - struct attribute_group *attr_group; - const struct attribute_group **tty_groups; - struct serial_rs485 rs485; - struct serial_iso7816 iso7816; - void *private_data; -}; - -enum uart_pm_state { - UART_PM_STATE_ON = 0, - UART_PM_STATE_OFF = 3, - UART_PM_STATE_UNDEFINED = 4, -}; - -struct uart_state { - struct tty_port port; - enum uart_pm_state pm_state; - struct circ_buf xmit; - atomic_t refcount; - wait_queue_head_t remove_wait; - struct uart_port *uart_port; -}; - struct uart_driver { struct module *owner; const char *driver_name; @@ -64110,20 +67710,6 @@ struct uart_match { struct uart_driver *driver; }; -struct earlycon_device { - struct console *con; - struct uart_port port; - char options[16]; - unsigned int baud; -}; - -struct earlycon_id { - char name[15]; - char name_term; - char compatible[128]; - int (*setup)(struct earlycon_device *, const char *); -}; - enum hwparam_type { hwparam_ioport = 0, hwparam_iomem = 1, @@ -64158,7 +67744,7 @@ struct plat_serial8250_port { }; enum { - PLAT8250_DEV_LEGACY = -1, + PLAT8250_DEV_LEGACY = 4294967295, PLAT8250_DEV_PLATFORM = 0, PLAT8250_DEV_PLATFORM1 = 1, PLAT8250_DEV_PLATFORM2 = 2, @@ -64511,8 +68097,6 @@ struct mid8250 { struct hsu_dma_chip dma_chip; }; -typedef int splice_actor___2(struct pipe_inode_info *, struct pipe_buffer *, struct splice_desc *); - struct memdev { const char *name; umode_t mode; @@ -64645,6 +68229,36 @@ struct trace_event_data_offsets_random_read {}; struct trace_event_data_offsets_urandom_read {}; +typedef void (*btf_trace_add_device_randomness)(void *, int, long unsigned int); + +typedef void (*btf_trace_mix_pool_bytes)(void *, const char *, int, long unsigned int); + +typedef void (*btf_trace_mix_pool_bytes_nolock)(void *, const char *, int, long unsigned int); + +typedef void (*btf_trace_credit_entropy_bits)(void *, const char *, int, int, long unsigned int); + +typedef void (*btf_trace_push_to_pool)(void *, const char *, int, int); + +typedef void (*btf_trace_debit_entropy)(void *, const char *, int); + +typedef void (*btf_trace_add_input_randomness)(void *, int); + +typedef void (*btf_trace_add_disk_randomness)(void *, dev_t, int); + +typedef void (*btf_trace_xfer_secondary_pool)(void *, const char *, int, int, int, int); + +typedef void (*btf_trace_get_random_bytes)(void *, int, long unsigned int); + +typedef void (*btf_trace_get_random_bytes_arch)(void *, int, long unsigned int); + +typedef void (*btf_trace_extract_entropy)(void *, const char *, int, int, long unsigned int); + +typedef void (*btf_trace_extract_entropy_user)(void *, const char *, int, int, long unsigned int); + +typedef void (*btf_trace_random_read)(void *, int, int, int, int); + +typedef void (*btf_trace_urandom_read)(void *, int, int, int); + struct poolinfo { int poolbitshift; int poolwords; @@ -64798,7 +68412,7 @@ enum { VIA_XSTORE_CNT_MASK = 15, VIA_RNG_CHUNK_8 = 0, VIA_RNG_CHUNK_4 = 1, - VIA_RNG_CHUNK_4_MASK = -1, + VIA_RNG_CHUNK_4_MASK = 4294967295, VIA_RNG_CHUNK_2 = 2, VIA_RNG_CHUNK_2_MASK = 65535, VIA_RNG_CHUNK_1 = 3, @@ -64882,6 +68496,13 @@ struct gatt_mask { u32 type; }; +struct aper_size_info_16 { + int size; + int num_entries; + int page_order; + u16 size_value; +}; + struct agp_bridge_driver { struct module *owner; const void *aperture_sizes; @@ -65014,13 +68635,6 @@ struct aper_size_info_8 { u8 size_value; }; -struct aper_size_info_16 { - int size; - int num_entries; - int page_order; - u16 size_value; -}; - struct aper_size_info_32 { int size; int num_entries; @@ -65146,6 +68760,28 @@ struct intel_gtt_driver_description { const struct intel_gtt_driver *gtt_driver; }; +enum device_link_state { + DL_STATE_NONE = 4294967295, + DL_STATE_DORMANT = 0, + DL_STATE_AVAILABLE = 1, + DL_STATE_CONSUMER_PROBE = 2, + DL_STATE_ACTIVE = 3, + DL_STATE_SUPPLIER_UNBIND = 4, +}; + +struct device_link { + struct device *supplier; + struct list_head s_node; + struct device *consumer; + struct list_head c_node; + enum device_link_state status; + u32 flags; + refcount_t rpm_active; + struct kref kref; + struct callback_head callback_head; + bool supplier_preactivated; +}; + struct iommu_group { struct kobject kobj; struct kobject *devices_kobj; @@ -65317,6 +68953,20 @@ struct trace_event_data_offsets_iommu_error { u32 driver; }; +typedef void (*btf_trace_add_device_to_group)(void *, int, struct device *); + +typedef void (*btf_trace_remove_device_from_group)(void *, int, struct device *); + +typedef void (*btf_trace_attach_device_to_domain)(void *, struct device *); + +typedef void (*btf_trace_detach_device_from_domain)(void *, struct device *); + +typedef void (*btf_trace_map)(void *, long unsigned int, phys_addr_t, size_t); + +typedef void (*btf_trace_unmap)(void *, long unsigned int, size_t, size_t); + +typedef void (*btf_trace_io_page_fault)(void *, struct device *, long unsigned int, int); + struct iova { struct rb_node node; long unsigned int pfn_hi; @@ -65413,6 +69063,12 @@ struct amd_iommu_device_info { u32 flags; }; +struct irq_remap_table { + raw_spinlock_t lock; + unsigned int min_index; + u32 *table; +}; + struct amd_iommu_fault { u64 address; u32 pasid; @@ -65527,12 +69183,6 @@ enum { IRQ_REMAP_X2APIC_MODE = 1, }; -struct irq_remap_table { - raw_spinlock_t lock; - unsigned int min_index; - u32 *table; -}; - struct devid_map { struct list_head list; u8 id; @@ -65948,6 +69598,18 @@ struct trace_event_data_offsets_dma_unmap { u32 dev_name; }; +typedef void (*btf_trace_map_single)(void *, struct device *, dma_addr_t, phys_addr_t, size_t); + +typedef void (*btf_trace_map_sg)(void *, struct device *, dma_addr_t, phys_addr_t, size_t); + +typedef void (*btf_trace_bounce_map_single)(void *, struct device *, dma_addr_t, phys_addr_t, size_t); + +typedef void (*btf_trace_unmap_single)(void *, struct device *, dma_addr_t, size_t); + +typedef void (*btf_trace_unmap_sg)(void *, struct device *, dma_addr_t, size_t); + +typedef void (*btf_trace_bounce_unmap_single)(void *, struct device *, dma_addr_t, size_t); + struct i2c_msg { __u16 addr; __u16 flags; @@ -66422,6 +70084,62 @@ struct drm_format_info { bool is_yuv; }; +struct drm_mm; + +struct drm_mm_node { + long unsigned int color; + u64 start; + u64 size; + struct drm_mm *mm; + struct list_head node_list; + struct list_head hole_stack; + struct rb_node rb; + struct rb_node rb_hole_size; + struct rb_node rb_hole_addr; + u64 __subtree_last; + u64 hole_size; + long unsigned int flags; +}; + +struct drm_vma_offset_node { + rwlock_t vm_lock; + struct drm_mm_node vm_node; + struct rb_root vm_files; + bool readonly: 1; +}; + +struct dma_fence; + +struct dma_resv_list; + +struct dma_resv { + struct ww_mutex lock; + seqcount_t seq; + struct dma_fence *fence_excl; + struct dma_resv_list *fence; +}; + +struct dma_buf; + +struct dma_buf_attachment; + +struct drm_gem_object_funcs; + +struct drm_gem_object { + struct kref refcount; + unsigned int handle_count; + struct drm_device *dev; + struct file *filp; + struct drm_vma_offset_node vma_node; + size_t size; + int name; + struct dma_buf *dma_buf; + struct dma_buf_attachment *import_attach; + struct dma_resv *resv; + struct dma_resv _resv; + const struct drm_gem_object_funcs *funcs; +}; + enum drm_connector_force { DRM_FORCE_UNSPECIFIED = 0, DRM_FORCE_OFF = 1, @@ -66668,9 +70386,9 @@ enum drm_mode_status { MODE_NO_REDUCED = 34, MODE_NO_STEREO = 35, MODE_NO_420 = 36, - MODE_STALE = -3, - MODE_BAD = -2, - MODE_ERROR = -1, + MODE_STALE = 4294967293, + MODE_BAD = 4294967294, + MODE_ERROR = 4294967295, }; struct drm_display_mode { @@ -66909,10 +70627,6 @@ struct drm_mode_config_helper_funcs { void (*atomic_commit_tail)(struct drm_atomic_state *); }; -struct dma_buf; - -struct dma_buf_attachment; - struct drm_ioctl_desc; struct drm_driver { @@ -67054,8 +70768,6 @@ enum drm_color_range { DRM_COLOR_RANGE_MAX = 2, }; -struct dma_fence; - struct drm_plane_state { struct drm_plane *plane; struct drm_crtc *crtc; @@ -67390,57 +71102,7 @@ enum drm_driver_feature { DRIVER_SG = 268435456, DRIVER_HAVE_DMA = 536870912, DRIVER_HAVE_IRQ = 1073741824, - DRIVER_KMS_LEGACY_CONTEXT = -2147483648, -}; - -struct drm_mm; - -struct drm_mm_node { - long unsigned int color; - u64 start; - u64 size; - struct drm_mm *mm; - struct list_head node_list; - struct list_head hole_stack; - struct rb_node rb; - struct rb_node rb_hole_size; - struct rb_node rb_hole_addr; - u64 __subtree_last; - u64 hole_size; - long unsigned int flags; -}; - -struct drm_vma_offset_node { - rwlock_t vm_lock; - struct drm_mm_node vm_node; - struct rb_root vm_files; - bool readonly: 1; -}; - -struct dma_resv_list; - -struct dma_resv { - struct ww_mutex lock; - seqcount_t seq; - struct dma_fence *fence_excl; - struct dma_resv_list *fence; -}; - -struct drm_gem_object_funcs; - -struct drm_gem_object { - struct kref refcount; - unsigned int handle_count; - struct drm_device *dev; - struct file *filp; - struct drm_vma_offset_node vma_node; - size_t size; - int name; - struct dma_buf *dma_buf; - struct dma_buf_attachment *import_attach; - struct dma_resv *resv; - struct dma_resv _resv; - const struct drm_gem_object_funcs *funcs; + DRIVER_KMS_LEGACY_CONTEXT = 2147483648, }; enum drm_ioctl_flags { @@ -68286,6 +71948,15 @@ struct dma_buf_attachment { void *priv; }; +struct ww_class { + atomic_long_t stamp; + struct lock_class_key acquire_key; + struct lock_class_key mutex_key; + const char *acquire_name; + const char *mutex_name; + unsigned int is_wait_die; +}; + struct dma_resv_list { struct callback_head rcu; u32 shared_count; @@ -68425,15 +72096,6 @@ struct drm_gem_open { __u64 size; }; -struct ww_class { - atomic_long_t stamp; - struct lock_class_key acquire_key; - struct lock_class_key mutex_key; - const char *acquire_name; - const char *mutex_name; - unsigned int is_wait_die; -}; - struct drm_version { int version_major; int version_minor; @@ -68594,9 +72256,9 @@ enum drm_mm_insert_mode { DRM_MM_INSERT_LOW = 1, DRM_MM_INSERT_HIGH = 2, DRM_MM_INSERT_EVICT = 3, - DRM_MM_INSERT_ONCE = -2147483648, - DRM_MM_INSERT_HIGHEST = -2147483646, - DRM_MM_INSERT_LOWEST = -2147483647, + DRM_MM_INSERT_ONCE = 2147483648, + DRM_MM_INSERT_HIGHEST = 2147483650, + DRM_MM_INSERT_LOWEST = 2147483649, }; struct drm_mm_scan { @@ -68858,6 +72520,12 @@ struct trace_event_data_offsets_drm_vblank_event_queued {}; struct trace_event_data_offsets_drm_vblank_event_delivered {}; +typedef void (*btf_trace_drm_vblank_event)(void *, int, unsigned int, ktime_t, bool); + +typedef void (*btf_trace_drm_vblank_event_queued)(void *, struct drm_file *, int, unsigned int); + +typedef void (*btf_trace_drm_vblank_event_delivered)(void *, struct drm_file *, int, unsigned int); + struct dma_buf_export_info { const char *exp_name; struct module *owner; @@ -69703,7 +73371,7 @@ struct drm_i915_gem_pwrite { }; enum pipe { - INVALID_PIPE = -1, + INVALID_PIPE = 4294967295, PIPE_A = 0, PIPE_B = 1, PIPE_C = 2, @@ -69713,7 +73381,7 @@ enum pipe { }; enum transcoder { - INVALID_TRANSCODER = -1, + INVALID_TRANSCODER = 4294967295, TRANSCODER_A = 0, TRANSCODER_B = 1, TRANSCODER_C = 2, @@ -69745,7 +73413,7 @@ enum plane_id { }; enum port { - PORT_NONE = -1, + PORT_NONE = 4294967295, PORT_A = 0, PORT_B = 1, PORT_C = 2, @@ -71072,7 +74740,7 @@ struct drm_i915_display_funcs { }; enum intel_pch { - PCH_NOP = -1, + PCH_NOP = 4294967295, PCH_NONE = 0, PCH_IBX = 1, PCH_CPT = 2, @@ -71513,7 +75181,7 @@ enum intel_uc_fw_type { }; enum intel_uc_fw_status { - INTEL_UC_FIRMWARE_NOT_SUPPORTED = -1, + INTEL_UC_FIRMWARE_NOT_SUPPORTED = 4294967295, INTEL_UC_FIRMWARE_UNINITIALIZED = 0, INTEL_UC_FIRMWARE_DISABLED = 1, INTEL_UC_FIRMWARE_SELECTED = 2, @@ -71995,7 +75663,7 @@ struct i915_power_well_desc { }; enum intel_dpll_id { - DPLL_ID_PRIVATE = -1, + DPLL_ID_PRIVATE = 4294967295, DPLL_ID_PCH_PLL_A = 0, DPLL_ID_PCH_PLL_B = 1, DPLL_ID_WRPLL1 = 0, @@ -72041,7 +75709,7 @@ struct dpll_info { }; enum dsb_id { - INVALID_DSB = -1, + INVALID_DSB = 4294967295, DSB1 = 0, DSB2 = 1, DSB3 = 2, @@ -73780,7 +77448,7 @@ struct intel_dp_mst_encoder { }; enum tc_port { - PORT_TC_NONE = -1, + PORT_TC_NONE = 4294967295, PORT_TC1 = 0, PORT_TC2 = 1, PORT_TC3 = 2, @@ -73797,7 +77465,7 @@ enum drm_i915_gem_engine_class { I915_ENGINE_CLASS_COPY = 1, I915_ENGINE_CLASS_VIDEO = 2, I915_ENGINE_CLASS_VIDEO_ENHANCE = 3, - I915_ENGINE_CLASS_INVALID = -1, + I915_ENGINE_CLASS_INVALID = 4294967295, }; struct drm_i915_getparam { @@ -74036,6 +77704,8 @@ struct reg_whitelist { u8 size; }; +struct resource___2; + struct remap_pfn { struct mm_struct *mm; long unsigned int pfn; @@ -74147,8 +77817,8 @@ struct guc_stage_desc { enum i915_map_type { I915_MAP_WB = 0, I915_MAP_WC = 1, - I915_MAP_FORCE_WB = -2147483648, - I915_MAP_FORCE_WC = -2147483647, + I915_MAP_FORCE_WB = 2147483648, + I915_MAP_FORCE_WC = 2147483649, }; struct intel_guc_client { @@ -74233,7 +77903,7 @@ struct measure_breadcrumb { }; enum { - I915_PRIORITY_MIN = -1024, + I915_PRIORITY_MIN = 4294966272, I915_PRIORITY_NORMAL = 0, I915_PRIORITY_MAX = 1024, I915_PRIORITY_HEARTBEAT = 1025, @@ -74545,8 +78215,6 @@ struct drm_i915_gem_caching { __u32 caching; }; -struct i915_vma_work; - struct drm_i915_gem_relocation_entry { __u32 target_handle; __u32 delta; @@ -75358,12 +79026,86 @@ struct trace_event_data_offsets_i915_ppgtt {}; struct trace_event_data_offsets_i915_context {}; +typedef void (*btf_trace_intel_pipe_enable)(void *, struct intel_crtc *); + +typedef void (*btf_trace_intel_pipe_disable)(void *, struct intel_crtc *); + +typedef void (*btf_trace_intel_pipe_crc)(void *, struct intel_crtc *, const u32 *); + +typedef void (*btf_trace_intel_cpu_fifo_underrun)(void *, struct drm_i915_private *, enum pipe); + +typedef void (*btf_trace_intel_pch_fifo_underrun)(void *, struct drm_i915_private *, enum pipe); + +typedef void (*btf_trace_intel_memory_cxsr)(void *, struct drm_i915_private *, bool, bool); + +typedef void (*btf_trace_g4x_wm)(void *, struct intel_crtc *, const struct g4x_wm_values *); + +typedef void (*btf_trace_vlv_wm)(void *, struct intel_crtc *, const struct vlv_wm_values *); + +typedef void (*btf_trace_vlv_fifo_size)(void *, struct intel_crtc *, u32, u32, u32); + +typedef void (*btf_trace_intel_update_plane)(void *, struct drm_plane *, struct intel_crtc *); + +typedef void (*btf_trace_intel_disable_plane)(void *, struct drm_plane *, struct intel_crtc *); + +typedef void (*btf_trace_i915_pipe_update_start)(void *, struct intel_crtc *); + +typedef void (*btf_trace_i915_pipe_update_vblank_evaded)(void *, struct intel_crtc *); + +typedef void (*btf_trace_i915_pipe_update_end)(void *, struct intel_crtc *, u32, int); + +typedef void (*btf_trace_i915_gem_object_create)(void *, struct drm_i915_gem_object *); + +typedef void (*btf_trace_i915_gem_shrink)(void *, struct drm_i915_private *, long unsigned int, unsigned int); + +typedef void (*btf_trace_i915_vma_bind)(void *, struct i915_vma *, unsigned int); + +typedef void (*btf_trace_i915_vma_unbind)(void *, struct i915_vma *); + +typedef void (*btf_trace_i915_gem_object_pwrite)(void *, struct drm_i915_gem_object *, u64, u64); + +typedef void (*btf_trace_i915_gem_object_pread)(void *, struct drm_i915_gem_object *, u64, u64); + +typedef void (*btf_trace_i915_gem_object_fault)(void *, struct drm_i915_gem_object *, u64, bool, bool); + +typedef void (*btf_trace_i915_gem_object_clflush)(void *, struct drm_i915_gem_object *); + +typedef void (*btf_trace_i915_gem_object_destroy)(void *, struct drm_i915_gem_object *); + +typedef void (*btf_trace_i915_gem_evict)(void *, struct i915_address_space *, u64, u64, unsigned int); + +typedef void (*btf_trace_i915_gem_evict_node)(void *, struct i915_address_space *, struct drm_mm_node *, unsigned int); + +typedef void (*btf_trace_i915_gem_evict_vm)(void *, struct i915_address_space *); + +typedef void (*btf_trace_i915_request_queue)(void *, struct i915_request *, u32); + +typedef void (*btf_trace_i915_request_add)(void *, struct i915_request *); + +typedef void (*btf_trace_i915_request_retire)(void *, struct i915_request *); + +typedef void (*btf_trace_i915_request_wait_begin)(void *, struct i915_request *, unsigned int); + +typedef void (*btf_trace_i915_request_wait_end)(void *, struct i915_request *); + +typedef void (*btf_trace_i915_reg_rw)(void *, bool, i915_reg_t, u64, int, bool); + +typedef void (*btf_trace_intel_gpu_freq_change)(void *, u32); + +typedef void (*btf_trace_i915_ppgtt_create)(void *, struct i915_address_space *); + +typedef void (*btf_trace_i915_ppgtt_release)(void *, struct i915_address_space *); + +typedef void (*btf_trace_i915_context_create)(void *, struct i915_gem_context *); + +typedef void (*btf_trace_i915_context_free)(void *, struct i915_gem_context *); + struct i915_global_vma { struct i915_global base; struct kmem_cache *slab_vmas; }; -struct i915_vma_work___2 { +struct i915_vma_work { struct dma_fence_work base; struct i915_vma *vma; enum i915_cache_level cache_level; @@ -75398,7 +79140,7 @@ struct uc_fw_blob { struct uc_fw_platform_requirement { enum intel_platform p; u8 rev; - struct uc_fw_blob blobs[2]; + const struct uc_fw_blob blobs[2]; } __attribute__((packed)); enum intel_guc_msg_type { @@ -75588,8 +79330,8 @@ struct guc_doorbell_info { }; enum hdmi_force_audio { - HDMI_AUDIO_OFF_DVI = -2, - HDMI_AUDIO_OFF = -1, + HDMI_AUDIO_OFF_DVI = 4294967294, + HDMI_AUDIO_OFF = 4294967295, HDMI_AUDIO_AUTO = 0, HDMI_AUDIO_ON = 1, }; @@ -75656,7 +79398,7 @@ struct hdmi_aud_ncts { }; enum phy { - PHY_NONE = -1, + PHY_NONE = 4294967295, PHY_A = 0, PHY_B = 1, PHY_C = 2, @@ -76471,7 +80213,7 @@ struct intel_quirk { struct intel_dmi_quirk { void (*hook)(struct drm_i915_private *); - struct dmi_system_id (*dmi_id_list)[0]; + const struct dmi_system_id (*dmi_id_list)[0]; }; struct opregion_header { @@ -77329,6 +81071,15 @@ struct flex { u32 value; }; +enum { + START_TS = 0, + NOW_TS = 1, + DELTA_TS = 2, + JUMP_PREDICATE = 3, + DELTA_TARGET = 4, + N_CS_GPR = 5, +}; + struct compress { struct pagevec pool; struct z_stream_s zstream; @@ -77634,12 +81385,14 @@ struct cpu_attr { const struct cpumask * const map; }; +typedef struct kobject *kobj_probe_t(dev_t, int *, void *); + struct probe { struct probe *next; dev_t dev; long unsigned int range; struct module *owner; - kobj_probe_t___2 *get; + kobj_probe_t *get; int (*lock)(dev_t, void *); void *data; }; @@ -77649,6 +81402,10 @@ struct kobj_map___2 { struct mutex *lock; }; +typedef void (*dr_release_t)(struct device *, void *); + +typedef int (*dr_match_t)(struct device *, void *, void *); + struct devres_node { struct list_head entry; dr_release_t release; @@ -78035,6 +81792,8 @@ struct firmware_work { enum fw_opt opt_flags; }; +typedef void (*node_registration_func_t)(struct node *); + struct node_access_nodes { struct device dev; struct list_head list_node; @@ -78402,6 +82161,36 @@ struct trace_event_data_offsets_regcache_drop_region { u32 name; }; +typedef void (*btf_trace_regmap_reg_write)(void *, struct regmap *, unsigned int, unsigned int); + +typedef void (*btf_trace_regmap_reg_read)(void *, struct regmap *, unsigned int, unsigned int); + +typedef void (*btf_trace_regmap_reg_read_cache)(void *, struct regmap *, unsigned int, unsigned int); + +typedef void (*btf_trace_regmap_hw_read_start)(void *, struct regmap *, unsigned int, int); + +typedef void (*btf_trace_regmap_hw_read_done)(void *, struct regmap *, unsigned int, int); + +typedef void (*btf_trace_regmap_hw_write_start)(void *, struct regmap *, unsigned int, int); + +typedef void (*btf_trace_regmap_hw_write_done)(void *, struct regmap *, unsigned int, int); + +typedef void (*btf_trace_regcache_sync)(void *, struct regmap *, const char *, const char *); + +typedef void (*btf_trace_regmap_cache_only)(void *, struct regmap *, bool); + +typedef void (*btf_trace_regmap_cache_bypass)(void *, struct regmap *, bool); + +typedef void (*btf_trace_regmap_async_write_start)(void *, struct regmap *, unsigned int, int); + +typedef void (*btf_trace_regmap_async_io_complete)(void *, struct regmap *); + +typedef void (*btf_trace_regmap_async_complete_start)(void *, struct regmap *); + +typedef void (*btf_trace_regmap_async_complete_done)(void *, struct regmap *); + +typedef void (*btf_trace_regcache_drop_region)(void *, struct regmap *, unsigned int, unsigned int); + struct regcache_rbtree_node { void *block; long int *cache_present; @@ -78574,6 +82363,20 @@ struct trace_event_data_offsets_dma_fence { u32 timeline; }; +typedef void (*btf_trace_dma_fence_emit)(void *, struct dma_fence *); + +typedef void (*btf_trace_dma_fence_init)(void *, struct dma_fence *); + +typedef void (*btf_trace_dma_fence_destroy)(void *, struct dma_fence *); + +typedef void (*btf_trace_dma_fence_enable_signal)(void *, struct dma_fence *); + +typedef void (*btf_trace_dma_fence_signaled)(void *, struct dma_fence *); + +typedef void (*btf_trace_dma_fence_wait_start)(void *, struct dma_fence *); + +typedef void (*btf_trace_dma_fence_wait_end)(void *, struct dma_fence *); + struct default_wait_cb { struct dma_fence_cb base; struct task_struct *task; @@ -79074,6 +82877,16 @@ struct trace_event_data_offsets_scsi_cmd_done_timeout_template { struct trace_event_data_offsets_scsi_eh_wakeup {}; +typedef void (*btf_trace_scsi_dispatch_cmd_start)(void *, struct scsi_cmnd *); + +typedef void (*btf_trace_scsi_dispatch_cmd_error)(void *, struct scsi_cmnd *, int); + +typedef void (*btf_trace_scsi_dispatch_cmd_done)(void *, struct scsi_cmnd *); + +typedef void (*btf_trace_scsi_dispatch_cmd_timeout)(void *, struct scsi_cmnd *); + +typedef void (*btf_trace_scsi_eh_wakeup)(void *, struct Scsi_Host *); + struct scsi_transport_template { struct transport_container host_attrs; struct transport_container target_attrs; @@ -79362,7 +83175,7 @@ enum { enum { SD_DEF_XFER_BLOCKS = 65535, - SD_MAX_XFER_BLOCKS = -1, + SD_MAX_XFER_BLOCKS = 4294967295, SD_MAX_WS10_BLOCKS = 65535, SD_MAX_WS16_BLOCKS = 8388607, }; @@ -79538,8 +83351,6 @@ struct scsi_cd { struct gendisk *disk; }; -typedef struct scsi_cd Scsi_CD; - struct cdrom_ti { __u8 cdti_trk0; __u8 cdti_ind0; @@ -79552,6 +83363,8 @@ struct cdrom_tochdr { __u8 cdth_trk1; }; +typedef struct scsi_cd Scsi_CD; + struct ccs_modesel_head { __u8 _r1; __u8 medium; @@ -79805,7 +83618,7 @@ enum { ATA_UDMA_MASK_40C = 7, ATA_PRD_SZ = 8, ATA_PRD_TBL_SZ = 2048, - ATA_PRD_EOT = -2147483648, + ATA_PRD_EOT = 2147483648, ATA_DMA_TABLE_OFS = 4, ATA_DMA_STATUS = 2, ATA_DMA_CMD = 0, @@ -80154,7 +83967,7 @@ enum { ATAPI_MAX_DRAIN = 16384, ATA_ALL_DEVICES = 3, ATA_SHT_EMULATED = 1, - ATA_SHT_THIS_ID = -1, + ATA_SHT_THIS_ID = 4294967295, ATA_TFLAG_LBA48 = 1, ATA_TFLAG_ISADDR = 2, ATA_TFLAG_DEVICE = 4, @@ -80875,6 +84688,18 @@ struct trace_event_data_offsets_ata_eh_link_autopsy {}; struct trace_event_data_offsets_ata_eh_link_autopsy_qc {}; +typedef void (*btf_trace_ata_qc_issue)(void *, struct ata_queued_cmd *); + +typedef void (*btf_trace_ata_qc_complete_internal)(void *, struct ata_queued_cmd *); + +typedef void (*btf_trace_ata_qc_complete_failed)(void *, struct ata_queued_cmd *); + +typedef void (*btf_trace_ata_qc_complete_done)(void *, struct ata_queued_cmd *); + +typedef void (*btf_trace_ata_eh_link_autopsy)(void *, struct ata_device *, unsigned int, unsigned int); + +typedef void (*btf_trace_ata_eh_link_autopsy_qc)(void *, struct ata_queued_cmd *); + enum { ATA_READID_POSTRESET = 1, ATA_DNXFER_PIO = 0, @@ -80882,7 +84707,7 @@ enum { ATA_DNXFER_40C = 2, ATA_DNXFER_FORCE_PIO = 3, ATA_DNXFER_FORCE_PIO0 = 4, - ATA_DNXFER_QUIET = -2147483648, + ATA_DNXFER_QUIET = 2147483648, }; struct ata_force_param { @@ -80934,7 +84759,7 @@ enum { ATA_EH_SPDN_KEEP_ERRORS = 8, ATA_EFLAG_IS_IO = 1, ATA_EFLAG_DUBIOUS_XFER = 2, - ATA_EFLAG_OLD_ER = -2147483648, + ATA_EFLAG_OLD_ER = 2147483648, ATA_ECAT_NONE = 0, ATA_ECAT_ATA_BUS = 1, ATA_ECAT_TOUT_HSM = 2, @@ -81093,7 +84918,7 @@ enum { AHCI_MAX_PORTS = 32, AHCI_MAX_CLKS = 5, AHCI_MAX_SG = 168, - AHCI_DMA_BOUNDARY = -1, + AHCI_DMA_BOUNDARY = 4294967295, AHCI_MAX_CMDS = 32, AHCI_CMD_SZ = 32, AHCI_CMD_SLOT_SZ = 1024, @@ -81104,7 +84929,7 @@ enum { AHCI_CMD_TBL_AR_SZ = 90112, AHCI_PORT_PRIV_DMA_SZ = 91392, AHCI_PORT_PRIV_FBS_DMA_SZ = 95232, - AHCI_IRQ_ON_SG = -2147483648, + AHCI_IRQ_ON_SG = 2147483648, AHCI_CMD_ATAPI = 32, AHCI_CMD_WRITE = 64, AHCI_CMD_PREFETCH = 128, @@ -81125,7 +84950,7 @@ enum { HOST_RESET = 1, HOST_IRQ_EN = 2, HOST_MRSM = 4, - HOST_AHCI_EN = -2147483648, + HOST_AHCI_EN = 2147483648, HOST_CAP_SXS = 32, HOST_CAP_EMS = 64, HOST_CAP_CCC = 128, @@ -81142,7 +84967,7 @@ enum { HOST_CAP_MPS = 268435456, HOST_CAP_SNTF = 536870912, HOST_CAP_NCQ = 1073741824, - HOST_CAP_64 = -2147483648, + HOST_CAP_64 = 2147483648, HOST_CAP2_BOH = 1, HOST_CAP2_NVMHCI = 2, HOST_CAP2_APST = 4, @@ -81166,7 +84991,7 @@ enum { PORT_SCR_NTF = 60, PORT_FBS = 64, PORT_DEVSLP = 68, - PORT_IRQ_COLD_PRES = -2147483648, + PORT_IRQ_COLD_PRES = 2147483648, PORT_IRQ_TF_ERR = 1073741824, PORT_IRQ_HBUS_ERR = 536870912, PORT_IRQ_HBUS_DATA_ERR = 268435456, @@ -81200,7 +85025,7 @@ enum { PORT_CMD_POWER_ON = 4, PORT_CMD_SPIN_UP = 2, PORT_CMD_START = 1, - PORT_CMD_ICC_MASK = -268435456, + PORT_CMD_ICC_MASK = 4026531840, PORT_CMD_ICC_ACTIVE = 268435456, PORT_CMD_ICC_PARTIAL = 536870912, PORT_CMD_ICC_SLUMBER = 1610612736, @@ -81389,9 +85214,9 @@ enum { P1 = 1, P2 = 2, P3 = 3, - IDE = -1, - NA = -2, - RV = -3, + IDE = 4294967295, + NA = 4294967294, + RV = 4294967293, PIIX_AHCI_DEVICE = 6, PIIX_HOST_BROKEN_SUSPEND = 16777216, }; @@ -81419,7 +85244,7 @@ enum piix_controller_ids { struct piix_map_db { const u32 mask; const u16 port_enable; - int map[0]; + const int map[0]; }; struct piix_host_priv { @@ -81441,7 +85266,7 @@ enum { MDM = 768, UDM = 458752, PPE = 1073741824, - USD = -2147483648, + USD = 2147483648, }; struct ethtool_cmd { @@ -81559,12 +85384,6 @@ enum { NETDEV_FEATURE_COUNT = 56, }; -typedef struct bio_vec skb_frag_t; - -struct skb_shared_hwtstamps { - ktime_t hwtstamp; -}; - enum { SKBTX_HW_TSTAMP = 1, SKBTX_SW_TSTAMP = 2, @@ -81575,44 +85394,6 @@ enum { SKBTX_SCHED_TSTAMP = 64, }; -struct skb_shared_info { - __u8 __unused; - __u8 meta_len; - __u8 nr_frags; - __u8 tx_flags; - short unsigned int gso_size; - short unsigned int gso_segs; - struct sk_buff *frag_list; - struct skb_shared_hwtstamps hwtstamps; - unsigned int gso_type; - u32 tskey; - atomic_t dataref; - void *destructor_arg; - skb_frag_t frags[17]; -}; - -enum net_device_flags { - IFF_UP = 1, - IFF_BROADCAST = 2, - IFF_DEBUG = 4, - IFF_LOOPBACK = 8, - IFF_POINTOPOINT = 16, - IFF_NOTRAILERS = 32, - IFF_RUNNING = 64, - IFF_NOARP = 128, - IFF_PROMISC = 256, - IFF_ALLMULTI = 512, - IFF_MASTER = 1024, - IFF_SLAVE = 2048, - IFF_MULTICAST = 4096, - IFF_PORTSEL = 8192, - IFF_AUTOMEDIA = 16384, - IFF_DYNAMIC = 32768, - IFF_LOWER_UP = 65536, - IFF_DORMANT = 131072, - IFF_ECHO = 262144, -}; - enum netdev_priv_flags { IFF_802_1Q_VLAN = 1, IFF_EBRIDGE = 2, @@ -81850,6 +85631,8 @@ struct trace_event_raw_mdio_access { struct trace_event_data_offsets_mdio_access {}; +typedef void (*btf_trace_mdio_access)(void *, struct mii_bus *, char, u8, unsigned int, u16, int); + struct mdio_driver { struct mdio_driver_common mdiodrv; int (*probe)(struct mdio_device *); @@ -81919,17 +85702,6 @@ struct netdev_hw_addr { struct callback_head callback_head; }; -enum gro_result { - GRO_MERGED = 0, - GRO_MERGED_FREE = 1, - GRO_HELD = 2, - GRO_NORMAL = 3, - GRO_DROP = 4, - GRO_CONSUMED = 5, -}; - -typedef enum gro_result gro_result_t; - enum netdev_queue_state_t { __QUEUE_STATE_DRV_XOFF = 0, __QUEUE_STATE_STACK_XOFF = 1, @@ -82664,12 +86436,12 @@ struct subsys_tbl_ent { struct tg3_dev_id { u32 vendor; u32 device; + u32 rev; }; struct tg3_dev_id___2 { u32 vendor; u32 device; - u32 rev; }; struct mem_entry { @@ -82702,8 +86474,8 @@ enum phy___3 { phy_82562_em = 52429480, phy_82562_ek = 51380904, phy_82562_eh = 24117928, - phy_82552_v = -798949299, - phy_unknown = -1, + phy_82552_v = 3496017997, + phy_unknown = 4294967295, }; struct csr { @@ -82731,7 +86503,7 @@ enum scb_status { enum ru_state { RU_SUSPENDED = 0, RU_RUNNING = 1, - RU_UNINITIALIZED = -1, + RU_UNINITIALIZED = 4294967295, }; enum scb_stat_ack { @@ -83116,6 +86888,13 @@ struct nic { long: 64; }; +enum led_state { + led_on = 1, + led_off = 4, + led_on_559 = 5, + led_on_557 = 7, +}; + struct vlan_hdr { __be16 h_vlan_TCI; __be16 h_vlan_encapsulated_proto; @@ -84502,7 +88281,7 @@ enum { }; enum pci_dev_reg_1 { - PCI_Y2_PIG_ENA = -2147483648, + PCI_Y2_PIG_ENA = 2147483648, PCI_Y2_DLL_DIS = 1073741824, PCI_SW_PWR_ON_RST = 1073741824, PCI_Y2_PHY2_COMA = 536870912, @@ -84517,7 +88296,7 @@ enum pci_dev_reg_1 { }; enum pci_dev_reg_2 { - PCI_VPD_WR_THR = -16777216, + PCI_VPD_WR_THR = 4278190080, PCI_DEV_SEL = 16646144, PCI_VPD_ROM_SZ = 114688, PCI_PATCH_DIR = 3840, @@ -84552,7 +88331,7 @@ enum pci_dev_reg_3 { }; enum pci_dev_reg_4 { - P_PEX_LTSSM_STAT_MSK = -33554432, + P_PEX_LTSSM_STAT_MSK = 4261412864, P_PEX_LTSSM_L1_STAT = 52, P_PEX_LTSSM_DET_STAT = 1, P_TIMER_VALUE_MSK = 16711680, @@ -84569,7 +88348,7 @@ enum pci_dev_reg_4 { }; enum pci_dev_reg_5 { - P_CTL_DIV_CORE_CLK_ENA = -2147483648, + P_CTL_DIV_CORE_CLK_ENA = 2147483648, P_CTL_SRESET_VMAIN_AV = 1073741824, P_CTL_BYPASS_VMAIN_AV = 536870912, P_CTL_TIM_VMAIN_AV_MSK = 402653184, @@ -84728,7 +88507,7 @@ enum { }; enum { - Y2_IS_HW_ERR = -2147483648, + Y2_IS_HW_ERR = 2147483648, Y2_IS_STAT_BMU = 1073741824, Y2_IS_ASF = 536870912, Y2_IS_CPU_TO = 268435456, @@ -84749,10 +88528,10 @@ enum { Y2_IS_CHK_RX1 = 4, Y2_IS_CHK_TXS1 = 2, Y2_IS_CHK_TXA1 = 1, - Y2_IS_BASE = -1073741824, + Y2_IS_BASE = 3221225472, Y2_IS_PORT_1 = 29, Y2_IS_PORT_2 = 7424, - Y2_IS_ERROR = -2147480307, + Y2_IS_ERROR = 2147486989, }; enum { @@ -84796,7 +88575,7 @@ enum { }; enum { - GLB_GPIO_CLK_DEB_ENA = -2147483648, + GLB_GPIO_CLK_DEB_ENA = 2147483648, GLB_GPIO_CLK_DBG_MSK = 1006632960, GLB_GPIO_INT_RST_D3_DIS = 32768, GLB_GPIO_LED_PAD_SPEED_UP = 16384, @@ -84899,7 +88678,7 @@ enum { }; enum { - PEX_RD_ACCESS = -2147483648, + PEX_RD_ACCESS = 2147483648, PEX_DB_ACCESS = 1073741824, }; @@ -84978,7 +88757,7 @@ enum { }; enum { - F_TX_CHK_AUTO_OFF = -2147483648, + F_TX_CHK_AUTO_OFF = 2147483648, F_TX_CHK_AUTO_ON = 1073741824, F_M_RX_RAM_DIS = 16777216, }; @@ -85050,7 +88829,7 @@ enum { }; enum { - BMU_IDLE = -2147483648, + BMU_IDLE = 2147483648, BMU_RX_TCP_PKT = 1073741824, BMU_RX_IP_PKT = 536870912, BMU_ENA_RX_RSS_HASH = 32768, @@ -85077,7 +88856,7 @@ enum { }; enum { - TBMU_TEST_BMU_TX_CHK_AUTO_OFF = -2147483648, + TBMU_TEST_BMU_TX_CHK_AUTO_OFF = 2147483648, TBMU_TEST_BMU_TX_CHK_AUTO_ON = 1073741824, TBMU_TEST_HOME_ADD_PAD_FIX1_EN = 536870912, TBMU_TEST_HOME_ADD_PAD_FIX1_DIS = 268435456, @@ -85742,7 +89521,7 @@ enum { }; enum { - RX_GCLKMAC_ENA = -2147483648, + RX_GCLKMAC_ENA = 2147483648, RX_GCLKMAC_OFF = 1073741824, RX_STFW_DIS = 536870912, RX_STFW_ENA = 268435456, @@ -85794,7 +89573,7 @@ enum { }; enum { - TX_STFW_DIS = -2147483648, + TX_STFW_DIS = 2147483648, TX_STFW_ENA = 1073741824, TX_VLAN_TAG_ON = 33554432, TX_VLAN_TAG_OFF = 16777216, @@ -86474,7 +90253,7 @@ enum TxStatusBits { TxStatOK = 32768, TxOutOfWindow = 536870912, TxAborted = 1073741824, - TxCarrierLost = -2147483648, + TxCarrierLost = 2147483648, }; enum RxStatusBits { @@ -86940,7 +90719,7 @@ enum rtl_register_content { }; enum rtl_desc_bit { - DescOwn = -2147483648, + DescOwn = 2147483648, RingEnd = 1073741824, FirstFrag = 536870912, LastFrag = 268435456, @@ -86963,7 +90742,7 @@ enum rtl_tx_desc_bit_1 { TD1_IPv6_CS = 268435456, TD1_IPv4_CS = 536870912, TD1_TCP_CS = 1073741824, - TD1_UDP_CS = -2147483648, + TD1_UDP_CS = 2147483648, }; enum rtl_rx_desc_bit { @@ -87524,8 +91303,6 @@ enum { PCMCIA_NUM_RESOURCES = 6, }; -typedef unsigned char cisdata_t; - struct cistpl_longlink_mfc_t { u_char nfn; struct { @@ -87671,6 +91448,8 @@ typedef long unsigned int u_long; typedef struct pccard_io_map pccard_io_map; +typedef unsigned char cisdata_t; + struct cistpl_longlink_t { u_int addr; }; @@ -87953,7 +91732,7 @@ struct yenta_socket { }; enum { - CARDBUS_TYPE_DEFAULT = -1, + CARDBUS_TYPE_DEFAULT = 4294967295, CARDBUS_TYPE_TI = 0, CARDBUS_TYPE_TI113X = 1, CARDBUS_TYPE_TI12XX = 2, @@ -89344,6 +93123,10 @@ struct mon_text_ptr { char *pbuf; }; +enum { + NAMESZ = 10, +}; + struct iso_rec { int error_count; int numdesc; @@ -90762,6 +94545,112 @@ struct trace_event_data_offsets_xhci_log_doorbell {}; struct trace_event_data_offsets_xhci_dbc_log_request {}; +typedef void (*btf_trace_xhci_dbg_address)(void *, struct va_format *); + +typedef void (*btf_trace_xhci_dbg_context_change)(void *, struct va_format *); + +typedef void (*btf_trace_xhci_dbg_quirks)(void *, struct va_format *); + +typedef void (*btf_trace_xhci_dbg_reset_ep)(void *, struct va_format *); + +typedef void (*btf_trace_xhci_dbg_cancel_urb)(void *, struct va_format *); + +typedef void (*btf_trace_xhci_dbg_init)(void *, struct va_format *); + +typedef void (*btf_trace_xhci_dbg_ring_expansion)(void *, struct va_format *); + +typedef void (*btf_trace_xhci_address_ctx)(void *, struct xhci_hcd *, struct xhci_container_ctx *, unsigned int); + +typedef void (*btf_trace_xhci_handle_event)(void *, struct xhci_ring *, struct xhci_generic_trb *); + +typedef void (*btf_trace_xhci_handle_command)(void *, struct xhci_ring *, struct xhci_generic_trb *); + +typedef void (*btf_trace_xhci_handle_transfer)(void *, struct xhci_ring *, struct xhci_generic_trb *); + +typedef void (*btf_trace_xhci_queue_trb)(void *, struct xhci_ring *, struct xhci_generic_trb *); + +typedef void (*btf_trace_xhci_dbc_handle_event)(void *, struct xhci_ring *, struct xhci_generic_trb *); + +typedef void (*btf_trace_xhci_dbc_handle_transfer)(void *, struct xhci_ring *, struct xhci_generic_trb *); + +typedef void (*btf_trace_xhci_dbc_gadget_ep_queue)(void *, struct xhci_ring *, struct xhci_generic_trb *); + +typedef void (*btf_trace_xhci_free_virt_device)(void *, struct xhci_virt_device *); + +typedef void (*btf_trace_xhci_alloc_virt_device)(void *, struct xhci_virt_device *); + +typedef void (*btf_trace_xhci_setup_device)(void *, struct xhci_virt_device *); + +typedef void (*btf_trace_xhci_setup_addressable_virt_device)(void *, struct xhci_virt_device *); + +typedef void (*btf_trace_xhci_stop_device)(void *, struct xhci_virt_device *); + +typedef void (*btf_trace_xhci_urb_enqueue)(void *, struct urb *); + +typedef void (*btf_trace_xhci_urb_giveback)(void *, struct urb *); + +typedef void (*btf_trace_xhci_urb_dequeue)(void *, struct urb *); + +typedef void (*btf_trace_xhci_handle_cmd_stop_ep)(void *, struct xhci_ep_ctx *); + +typedef void (*btf_trace_xhci_handle_cmd_set_deq_ep)(void *, struct xhci_ep_ctx *); + +typedef void (*btf_trace_xhci_handle_cmd_reset_ep)(void *, struct xhci_ep_ctx *); + +typedef void (*btf_trace_xhci_handle_cmd_config_ep)(void *, struct xhci_ep_ctx *); + +typedef void (*btf_trace_xhci_add_endpoint)(void *, struct xhci_ep_ctx *); + +typedef void (*btf_trace_xhci_alloc_dev)(void *, struct xhci_slot_ctx *); + +typedef void (*btf_trace_xhci_free_dev)(void *, struct xhci_slot_ctx *); + +typedef void (*btf_trace_xhci_handle_cmd_disable_slot)(void *, struct xhci_slot_ctx *); + +typedef void (*btf_trace_xhci_discover_or_reset_device)(void *, struct xhci_slot_ctx *); + +typedef void (*btf_trace_xhci_setup_device_slot)(void *, struct xhci_slot_ctx *); + +typedef void (*btf_trace_xhci_handle_cmd_addr_dev)(void *, struct xhci_slot_ctx *); + +typedef void (*btf_trace_xhci_handle_cmd_reset_dev)(void *, struct xhci_slot_ctx *); + +typedef void (*btf_trace_xhci_handle_cmd_set_deq)(void *, struct xhci_slot_ctx *); + +typedef void (*btf_trace_xhci_configure_endpoint)(void *, struct xhci_slot_ctx *); + +typedef void (*btf_trace_xhci_address_ctrl_ctx)(void *, struct xhci_input_control_ctx *); + +typedef void (*btf_trace_xhci_configure_endpoint_ctrl_ctx)(void *, struct xhci_input_control_ctx *); + +typedef void (*btf_trace_xhci_ring_alloc)(void *, struct xhci_ring *); + +typedef void (*btf_trace_xhci_ring_free)(void *, struct xhci_ring *); + +typedef void (*btf_trace_xhci_ring_expansion)(void *, struct xhci_ring *); + +typedef void (*btf_trace_xhci_inc_enq)(void *, struct xhci_ring *); + +typedef void (*btf_trace_xhci_inc_deq)(void *, struct xhci_ring *); + +typedef void (*btf_trace_xhci_handle_port_status)(void *, u32, u32); + +typedef void (*btf_trace_xhci_get_port_status)(void *, u32, u32); + +typedef void (*btf_trace_xhci_hub_status_data)(void *, u32, u32); + +typedef void (*btf_trace_xhci_ring_ep_doorbell)(void *, u32, u32); + +typedef void (*btf_trace_xhci_ring_host_doorbell)(void *, u32, u32); + +typedef void (*btf_trace_xhci_dbc_alloc_request)(void *, struct dbc_request *); + +typedef void (*btf_trace_xhci_dbc_free_request)(void *, struct dbc_request *); + +typedef void (*btf_trace_xhci_dbc_queue_request)(void *, struct dbc_request *); + +typedef void (*btf_trace_xhci_dbc_giveback_request)(void *, struct dbc_request *); + struct xhci_regset { char name[32]; struct debugfs_regset32 regset; @@ -91201,13 +95090,6 @@ struct key_entry { }; }; -struct led_init_data { - struct fwnode_handle *fwnode; - const char *default_label; - const char *devicename; - bool devname_mandatory; -}; - struct input_led { struct led_classdev cdev; struct input_handle *handle; @@ -91536,7 +95418,7 @@ struct min_max_quirk { }; enum { - SYNAPTICS_INTERTOUCH_NOT_SET = -1, + SYNAPTICS_INTERTOUCH_NOT_SET = 4294967295, SYNAPTICS_INTERTOUCH_OFF = 0, SYNAPTICS_INTERTOUCH_ON = 1, }; @@ -91805,6 +95687,30 @@ struct trace_event_data_offsets_rtc_offset_class {}; struct trace_event_data_offsets_rtc_timer_class {}; +typedef void (*btf_trace_rtc_set_time)(void *, time64_t, int); + +typedef void (*btf_trace_rtc_read_time)(void *, time64_t, int); + +typedef void (*btf_trace_rtc_set_alarm)(void *, time64_t, int); + +typedef void (*btf_trace_rtc_read_alarm)(void *, time64_t, int); + +typedef void (*btf_trace_rtc_irq_set_freq)(void *, int, int); + +typedef void (*btf_trace_rtc_irq_set_state)(void *, int, int); + +typedef void (*btf_trace_rtc_alarm_irq_enable)(void *, unsigned int, int); + +typedef void (*btf_trace_rtc_set_offset)(void *, long int, int); + +typedef void (*btf_trace_rtc_read_offset)(void *, long int, int); + +typedef void (*btf_trace_rtc_timer_enqueue)(void *, struct rtc_timer *); + +typedef void (*btf_trace_rtc_timer_dequeue)(void *, struct rtc_timer *); + +typedef void (*btf_trace_rtc_timer_fired)(void *, struct rtc_timer *); + enum { none = 0, day = 1, @@ -91955,17 +95861,25 @@ struct trace_event_data_offsets_i2c_reply { struct trace_event_data_offsets_i2c_result {}; +typedef void (*btf_trace_i2c_write)(void *, const struct i2c_adapter *, const struct i2c_msg *, int); + +typedef void (*btf_trace_i2c_read)(void *, const struct i2c_adapter *, const struct i2c_msg *, int); + +typedef void (*btf_trace_i2c_reply)(void *, const struct i2c_adapter *, const struct i2c_msg *, int); + +typedef void (*btf_trace_i2c_result)(void *, const struct i2c_adapter *, int, int); + struct i2c_dummy_devres { struct i2c_client *client; }; +struct class_compat___2; + struct i2c_cmd_arg { unsigned int cmd; void *arg; }; -struct class_compat___2; - struct i2c_smbus_alert_setup { int irq; }; @@ -92025,6 +95939,14 @@ struct trace_event_data_offsets_smbus_reply {}; struct trace_event_data_offsets_smbus_result {}; +typedef void (*btf_trace_smbus_write)(void *, const struct i2c_adapter *, u16, short unsigned int, char, u8, int, const union i2c_smbus_data *); + +typedef void (*btf_trace_smbus_read)(void *, const struct i2c_adapter *, u16, short unsigned int, char, u8, int); + +typedef void (*btf_trace_smbus_reply)(void *, const struct i2c_adapter *, u16, short unsigned int, char, u8, int, const union i2c_smbus_data *, int); + +typedef void (*btf_trace_smbus_result)(void *, const struct i2c_adapter *, u16, short unsigned int, char, u8, int, int); + struct i2c_acpi_handler_data { struct acpi_connection_info info; struct i2c_adapter *adapter; @@ -92497,6 +96419,12 @@ struct trace_event_data_offsets_hwmon_attr_show_string { u32 label; }; +typedef void (*btf_trace_hwmon_attr_show)(void *, int, const char *, long int); + +typedef void (*btf_trace_hwmon_attr_store)(void *, int, const char *, long int); + +typedef void (*btf_trace_hwmon_attr_show_string)(void *, int, const char *, const char *); + struct hwmon_device { const char *name; struct device dev; @@ -92551,6 +96479,12 @@ struct trace_event_data_offsets_thermal_zone_trip { u32 thermal_zone; }; +typedef void (*btf_trace_thermal_temperature)(void *, struct thermal_zone_device *); + +typedef void (*btf_trace_cdev_update)(void *, struct thermal_cooling_device *, long unsigned int); + +typedef void (*btf_trace_thermal_zone_trip)(void *, struct thermal_zone_device *, int, enum thermal_trip_type); + struct thermal_instance { int id; char name[20]; @@ -94277,12 +98211,6 @@ struct smca_mce_desc { unsigned int num_descs; }; -struct freq_attr { - struct attribute attr; - ssize_t (*show)(struct cpufreq_policy *, char *); - ssize_t (*store)(struct cpufreq_policy *, const char *, size_t); -}; - struct cpufreq_driver { char name[16]; u8 flags; @@ -94515,9 +98443,9 @@ struct cpuidle_governor { char name[16]; struct list_head governor_list; unsigned int rating; - int (*enable)(struct cpuidle_driver *, struct cpuidle_device *); - void (*disable)(struct cpuidle_driver *, struct cpuidle_device *); - int (*select)(struct cpuidle_driver *, struct cpuidle_device *, bool *); + int (*enable)(struct cpuidle_driver___2 *, struct cpuidle_device *); + void (*disable)(struct cpuidle_driver___2 *, struct cpuidle_device *); + int (*select)(struct cpuidle_driver___2 *, struct cpuidle_device *, bool *); void (*reflect)(struct cpuidle_device *, int); }; @@ -94557,6 +98485,13 @@ struct menu_device { int interval_ptr; }; +struct led_init_data { + struct fwnode_handle *fwnode; + const char *default_label; + const char *devicename; + bool devname_mandatory; +}; + struct led_properties { u32 color; bool color_present; @@ -94681,6 +98616,8 @@ typedef struct { efi_memory_desc_t entry[0]; } efi_memory_attributes_table_t; +typedef int (*efi_memattr_perm_setter)(struct mm_struct *, efi_memory_desc_t *); + struct linux_efi_tpm_eventlog { u32 size; u32 final_events_preboot_size; @@ -95194,7 +99131,7 @@ struct lg4ff_wheel { struct lg4ff_compat_mode_switch { const u8 cmd_count; - u8 cmd[0]; + const u8 cmd[0]; }; struct lg4ff_wheel_ident_info { @@ -95817,6 +99754,14 @@ struct trace_event_data_offsets_aer_event { u32 dev_name; }; +typedef void (*btf_trace_mc_event)(void *, const unsigned int, const char *, const char *, const int, const u8, const s8, const s8, const s8, long unsigned int, const u8, long unsigned int, const char *); + +typedef void (*btf_trace_arm_event)(void *, const struct cper_sec_proc_arm *); + +typedef void (*btf_trace_non_standard_event)(void *, const guid_t *, const guid_t *, const char *, const u8, const u8 *, const u32); + +typedef void (*btf_trace_aer_event)(void *, const char *, const u32, const u8, const u8, struct aer_header_log_regs *); + struct nvmem_cell_lookup { const char *nvmem_name; const char *cell_name; @@ -96179,7 +100124,7 @@ struct snd_kcontrol { enum { SNDRV_CTL_TLV_OP_READ = 0, SNDRV_CTL_TLV_OP_WRITE = 1, - SNDRV_CTL_TLV_OP_CMD = -1, + SNDRV_CTL_TLV_OP_CMD = 4294967295, }; struct snd_kcontrol_new { @@ -96290,12 +100235,12 @@ struct snd_ctl_elem_value32 { }; enum { - SNDRV_CTL_IOCTL_ELEM_LIST32 = -1069001456, - SNDRV_CTL_IOCTL_ELEM_INFO32 = -1055894255, - SNDRV_CTL_IOCTL_ELEM_READ32 = -1027320558, - SNDRV_CTL_IOCTL_ELEM_WRITE32 = -1027320557, - SNDRV_CTL_IOCTL_ELEM_ADD32 = -1055894249, - SNDRV_CTL_IOCTL_ELEM_REPLACE32 = -1055894248, + SNDRV_CTL_IOCTL_ELEM_LIST32 = 3225965840, + SNDRV_CTL_IOCTL_ELEM_INFO32 = 3239073041, + SNDRV_CTL_IOCTL_ELEM_READ32 = 3267646738, + SNDRV_CTL_IOCTL_ELEM_WRITE32 = 3267646739, + SNDRV_CTL_IOCTL_ELEM_ADD32 = 3239073047, + SNDRV_CTL_IOCTL_ELEM_REPLACE32 = 3239073048, }; struct snd_pci_quirk { @@ -96447,7 +100392,7 @@ enum { }; enum { - SNDRV_TIMER_CLASS_NONE = -1, + SNDRV_TIMER_CLASS_NONE = 4294967295, SNDRV_TIMER_CLASS_SLAVE = 0, SNDRV_TIMER_CLASS_GLOBAL = 1, SNDRV_TIMER_CLASS_CARD = 2, @@ -96693,7 +100638,7 @@ struct snd_timer_status32 { enum { SNDRV_TIMER_IOCTL_GPARAMS32 = 1077695492, - SNDRV_TIMER_IOCTL_INFO32 = -2132782063, + SNDRV_TIMER_IOCTL_INFO32 = 2162185233, SNDRV_TIMER_IOCTL_STATUS32 = 1079530516, }; @@ -96947,6 +100892,12 @@ struct snd_pcm_hw_constraints { struct snd_pcm_hw_rule *rules; }; +struct snd_pcm_hw_constraint_list { + const unsigned int *list; + unsigned int count; + unsigned int mask; +}; + struct snd_pcm_runtime { struct snd_pcm_substream *trigger_master; struct timespec trigger_tstamp; @@ -97038,14 +100989,15 @@ struct snd_pcm { bool no_device_suspend; }; -typedef u32 u_int32_t; - -typedef u64 u_int64_t; +struct snd_pcm_chmap_elem { + unsigned char channels; + unsigned char map[15]; +}; enum { SNDRV_PCM_MMAP_OFFSET_DATA = 0, - SNDRV_PCM_MMAP_OFFSET_STATUS = -2147483648, - SNDRV_PCM_MMAP_OFFSET_CONTROL = -2130706432, + SNDRV_PCM_MMAP_OFFSET_STATUS = 2147483648, + SNDRV_PCM_MMAP_OFFSET_CONTROL = 2164260864, }; typedef int snd_pcm_hw_param_t; @@ -97120,12 +101072,6 @@ struct snd_pcm_file { unsigned int user_pversion; }; -struct snd_pcm_hw_constraint_list { - const unsigned int *list; - unsigned int count; - unsigned int mask; -}; - struct snd_pcm_hw_params_old { unsigned int flags; unsigned int masks[3]; @@ -97243,20 +101189,20 @@ struct snd_pcm_sync_ptr32 { }; enum { - SNDRV_PCM_IOCTL_HW_REFINE32 = -1034141424, - SNDRV_PCM_IOCTL_HW_PARAMS32 = -1034141423, - SNDRV_PCM_IOCTL_SW_PARAMS32 = -1066909421, - SNDRV_PCM_IOCTL_STATUS32 = -2140389088, - SNDRV_PCM_IOCTL_STATUS_EXT32 = -1066647260, - SNDRV_PCM_IOCTL_DELAY32 = -2147204831, - SNDRV_PCM_IOCTL_CHANNEL_INFO32 = -2146418382, + SNDRV_PCM_IOCTL_HW_REFINE32 = 3260825872, + SNDRV_PCM_IOCTL_HW_PARAMS32 = 3260825873, + SNDRV_PCM_IOCTL_SW_PARAMS32 = 3228057875, + SNDRV_PCM_IOCTL_STATUS32 = 2154578208, + SNDRV_PCM_IOCTL_STATUS_EXT32 = 3228320036, + SNDRV_PCM_IOCTL_DELAY32 = 2147762465, + SNDRV_PCM_IOCTL_CHANNEL_INFO32 = 2148548914, SNDRV_PCM_IOCTL_REWIND32 = 1074020678, SNDRV_PCM_IOCTL_FORWARD32 = 1074020681, SNDRV_PCM_IOCTL_WRITEI_FRAMES32 = 1074544976, - SNDRV_PCM_IOCTL_READI_FRAMES32 = -2146680495, + SNDRV_PCM_IOCTL_READI_FRAMES32 = 2148286801, SNDRV_PCM_IOCTL_WRITEN_FRAMES32 = 1074544978, - SNDRV_PCM_IOCTL_READN_FRAMES32 = -2146680493, - SNDRV_PCM_IOCTL_SYNC_PTR32 = -1065074397, + SNDRV_PCM_IOCTL_READN_FRAMES32 = 2148286803, + SNDRV_PCM_IOCTL_SYNC_PTR32 = 3229892899, }; enum { @@ -97330,11 +101276,6 @@ struct snd_pcm_hw_constraint_ranges { unsigned int mask; }; -struct snd_pcm_chmap_elem { - unsigned char channels; - unsigned char map[15]; -}; - struct snd_pcm_chmap { struct snd_pcm *pcm; int stream; @@ -97839,11 +101780,11 @@ struct snd_seq_port_info32 { }; enum { - SNDRV_SEQ_IOCTL_CREATE_PORT32 = -1062972640, + SNDRV_SEQ_IOCTL_CREATE_PORT32 = 3231994656, SNDRV_SEQ_IOCTL_DELETE_PORT32 = 1084511009, - SNDRV_SEQ_IOCTL_GET_PORT_INFO32 = -1062972638, + SNDRV_SEQ_IOCTL_GET_PORT_INFO32 = 3231994658, SNDRV_SEQ_IOCTL_SET_PORT_INFO32 = 1084511011, - SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT32 = -1062972590, + SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT32 = 3231994706, }; typedef int (*snd_seq_dump_func_t)(void *, void *, int); @@ -98621,6 +102562,18 @@ struct trace_event_data_offsets_azx_get_position {}; struct trace_event_data_offsets_azx_pcm {}; +typedef void (*btf_trace_azx_pcm_trigger)(void *, struct azx *, struct azx_dev *, int); + +typedef void (*btf_trace_azx_get_position)(void *, struct azx *, struct azx_dev *, unsigned int, unsigned int); + +typedef void (*btf_trace_azx_pcm_open)(void *, struct azx *, struct azx_dev *); + +typedef void (*btf_trace_azx_pcm_close)(void *, struct azx *, struct azx_dev *); + +typedef void (*btf_trace_azx_pcm_hw_params)(void *, struct azx *, struct azx_dev *); + +typedef void (*btf_trace_azx_pcm_prepare)(void *, struct azx *, struct azx_dev *); + enum { SNDRV_HWDEP_IFACE_OPL2 = 0, SNDRV_HWDEP_IFACE_OPL3 = 1, @@ -98694,6 +102647,14 @@ struct trace_event_raw_hda_pm { struct trace_event_data_offsets_hda_pm {}; +typedef void (*btf_trace_azx_suspend)(void *, struct azx *); + +typedef void (*btf_trace_azx_resume)(void *, struct azx *); + +typedef void (*btf_trace_azx_runtime_suspend)(void *, struct azx *); + +typedef void (*btf_trace_azx_runtime_resume)(void *, struct azx *); + enum { POS_FIX_AUTO = 0, POS_FIX_LPIB = 1, @@ -98845,6 +102806,16 @@ struct trace_event_data_offsets_hda_unsol_event { struct trace_event_data_offsets_hdac_stream {}; +typedef void (*btf_trace_hda_send_cmd)(void *, struct hdac_bus *, unsigned int); + +typedef void (*btf_trace_hda_get_response)(void *, struct hdac_bus *, unsigned int, unsigned int); + +typedef void (*btf_trace_hda_unsol_event)(void *, struct hdac_bus *, u32, u32); + +typedef void (*btf_trace_snd_hdac_stream_start)(void *, struct hdac_bus *, struct hdac_stream *); + +typedef void (*btf_trace_snd_hdac_stream_stop)(void *, struct hdac_bus *, struct hdac_stream *); + struct component_match___2; struct nhlt_specific_cfg { @@ -98931,11 +102902,6 @@ struct pci_check_idx_range { int end; }; -struct pci_raw_ops { - int (*read)(unsigned int, unsigned int, unsigned int, int, int, u32 *); - int (*write)(unsigned int, unsigned int, unsigned int, int, int, u32); -}; - struct pci_mmcfg_region { struct list_head list; struct resource res; @@ -99231,37 +103197,6 @@ struct scm_ts_pktinfo { __u32 reserved[2]; }; -enum sock_flags { - SOCK_DEAD = 0, - SOCK_DONE = 1, - SOCK_URGINLINE = 2, - SOCK_KEEPOPEN = 3, - SOCK_LINGER = 4, - SOCK_DESTROY = 5, - SOCK_BROADCAST = 6, - SOCK_TIMESTAMP = 7, - SOCK_ZAPPED = 8, - SOCK_USE_WRITE_QUEUE = 9, - SOCK_DBG = 10, - SOCK_RCVTSTAMP = 11, - SOCK_RCVTSTAMPNS = 12, - SOCK_LOCALROUTE = 13, - SOCK_QUEUE_SHRUNK = 14, - SOCK_MEMALLOC = 15, - SOCK_TIMESTAMPING_RX_SOFTWARE = 16, - SOCK_FASYNC = 17, - SOCK_RXQ_OVFL = 18, - SOCK_ZEROCOPY = 19, - SOCK_WIFI_STATUS = 20, - SOCK_NOFCS = 21, - SOCK_FILTER_LOCKED = 22, - SOCK_SELECT_ERR_QUEUE = 23, - SOCK_RCU_FREE = 24, - SOCK_TXTIME = 25, - SOCK_XDP = 26, - SOCK_TSTAMP_NEW = 27, -}; - struct sock_skb_cb { u32 dropcount; }; @@ -99636,6 +103571,12 @@ struct xfrm_address_filter { __u8 dplen; }; +struct offload_callbacks { + struct sk_buff * (*gso_segment)(struct sk_buff *, netdev_features_t); + struct sk_buff * (*gro_receive)(struct list_head *, struct sk_buff *); + int (*gro_complete)(struct sk_buff *, int); +}; + struct xfrm_state_walk { struct list_head all; u8 state; @@ -100239,6 +104180,19 @@ struct net_protocol { unsigned int icmp_strict_tag_validation: 1; }; +struct inet6_protocol { + void (*early_demux)(struct sk_buff *); + void (*early_demux_handler)(struct sk_buff *); + int (*handler)(struct sk_buff *); + int (*err_handler)(struct sk_buff *, struct inet6_skb_parm *, u8, u8, int, __be32); + unsigned int flags; +}; + +struct net_offload { + struct offload_callbacks callbacks; + unsigned int flags; +}; + struct rt6_exception_bucket { struct hlist_head chain; int depth; @@ -100375,10 +104329,6 @@ struct ts_config { void (*finish)(struct ts_config *, struct ts_state *); }; -struct nf_conntrack { - atomic_t use; -}; - enum { SKB_FCLONE_UNAVAILABLE = 0, SKB_FCLONE_ORIG = 1, @@ -100401,11 +104351,6 @@ struct skb_seq_state { __u8 *frag_data; }; -struct skb_checksum_ops { - __wsum (*update)(const void *, int, __wsum); - __wsum (*combine)(__wsum, __wsum, int, int); -}; - struct skb_gso_cb { union { int mac_offset; @@ -100604,10 +104549,6 @@ enum { __NETNSA_MAX = 6, }; -typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, struct netlink_ext_ack *); - -typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *); - enum rtnl_link_flags { RTNL_FLAG_DOIT_UNLOCKED = 1, }; @@ -100631,8 +104572,6 @@ struct rtnl_net_dump_cb { int s_idx; }; -typedef u16 u_int16_t; - struct flow_dissector_key_control { u16 thoff; u16 addr_type; @@ -100787,51 +104726,6 @@ struct flow_keys_digest { u8 data[16]; }; -struct bpf_flow_keys; - -struct bpf_flow_dissector { - struct bpf_flow_keys *flow_keys; - const struct sk_buff *skb; - void *data; - void *data_end; -}; - -struct bpf_flow_keys { - __u16 nhoff; - __u16 thoff; - __u16 addr_proto; - __u8 is_frag; - __u8 is_first_frag; - __u8 is_encap; - __u8 ip_proto; - __be16 n_proto; - __be16 sport; - __be16 dport; - union { - struct { - __be32 ipv4_src; - __be32 ipv4_dst; - }; - struct { - __u32 ipv6_src[4]; - __u32 ipv6_dst[4]; - }; - }; - __u32 flags; - __be32 flow_label; -}; - -enum ip_conntrack_info { - IP_CT_ESTABLISHED = 0, - IP_CT_RELATED = 1, - IP_CT_NEW = 2, - IP_CT_IS_REPLY = 3, - IP_CT_ESTABLISHED_REPLY = 3, - IP_CT_RELATED_REPLY = 4, - IP_CT_NUMBER = 5, - IP_CT_UNTRACKED = 7, -}; - struct xt_table_info; struct xt_table { @@ -100842,38 +104736,7 @@ struct xt_table { u_int8_t af; int priority; int (*table_init)(struct net *); - char name[32]; -}; - -union nf_inet_addr { - __u32 all[4]; - __be32 ip; - __be32 ip6[4]; - struct in_addr in; - struct in6_addr in6; -}; - -struct ip_ct_tcp_state { - u_int32_t td_end; - u_int32_t td_maxend; - u_int32_t td_maxwin; - u_int32_t td_maxack; - u_int8_t td_scale; - u_int8_t flags; -}; - -struct ip_ct_tcp { - struct ip_ct_tcp_state seen[2]; - u_int8_t state; - u_int8_t last_dir; - u_int8_t retrans; - u_int8_t last_index; - u_int32_t last_seq; - u_int32_t last_ack; - u_int32_t last_end; - u_int16_t last_win; - u_int8_t last_wscale; - u_int8_t last_flags; + const char name[32]; }; enum bpf_ret_code { @@ -100883,6 +104746,12 @@ enum bpf_ret_code { BPF_LWT_REROUTE = 128, }; +enum { + BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG = 1, + BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL = 2, + BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP = 4, +}; + enum devlink_port_type { DEVLINK_PORT_TYPE_NOTSET = 0, DEVLINK_PORT_TYPE_AUTO = 1, @@ -101348,139 +105217,6 @@ struct batadv_unicast_packet { __u8 dest[6]; }; -union nf_conntrack_man_proto { - __be16 all; - struct { - __be16 port; - } tcp; - struct { - __be16 port; - } udp; - struct { - __be16 id; - } icmp; - struct { - __be16 port; - } dccp; - struct { - __be16 port; - } sctp; - struct { - __be16 key; - } gre; -}; - -struct nf_conntrack_man { - union nf_inet_addr u3; - union nf_conntrack_man_proto u; - u_int16_t l3num; -}; - -struct nf_conntrack_tuple { - struct nf_conntrack_man src; - struct { - union nf_inet_addr u3; - union { - __be16 all; - struct { - __be16 port; - } tcp; - struct { - __be16 port; - } udp; - struct { - u_int8_t type; - u_int8_t code; - } icmp; - struct { - __be16 port; - } dccp; - struct { - __be16 port; - } sctp; - struct { - __be16 key; - } gre; - } u; - u_int8_t protonum; - u_int8_t dir; - } dst; -}; - -struct nf_conntrack_tuple_hash { - struct hlist_nulls_node hnnode; - struct nf_conntrack_tuple tuple; -}; - -struct nf_ct_dccp { - u_int8_t role[2]; - u_int8_t state; - u_int8_t last_pkt; - u_int8_t last_dir; - u_int64_t handshake_seq; -}; - -enum sctp_conntrack { - SCTP_CONNTRACK_NONE = 0, - SCTP_CONNTRACK_CLOSED = 1, - SCTP_CONNTRACK_COOKIE_WAIT = 2, - SCTP_CONNTRACK_COOKIE_ECHOED = 3, - SCTP_CONNTRACK_ESTABLISHED = 4, - SCTP_CONNTRACK_SHUTDOWN_SENT = 5, - SCTP_CONNTRACK_SHUTDOWN_RECD = 6, - SCTP_CONNTRACK_SHUTDOWN_ACK_SENT = 7, - SCTP_CONNTRACK_HEARTBEAT_SENT = 8, - SCTP_CONNTRACK_HEARTBEAT_ACKED = 9, - SCTP_CONNTRACK_MAX = 10, -}; - -struct ip_ct_sctp { - enum sctp_conntrack state; - __be32 vtag[2]; -}; - -struct nf_ct_udp { - long unsigned int stream_ts; -}; - -struct nf_ct_gre { - unsigned int stream_timeout; - unsigned int timeout; -}; - -union nf_conntrack_proto { - struct nf_ct_dccp dccp; - struct ip_ct_sctp sctp; - struct ip_ct_tcp tcp; - struct nf_ct_udp udp; - struct nf_ct_gre gre; - unsigned int tmpl_padto; -}; - -struct nf_ct_ext; - -struct nf_conn { - struct nf_conntrack ct_general; - spinlock_t lock; - u32 timeout; - struct nf_conntrack_tuple_hash tuplehash[2]; - long unsigned int status; - u16 cpu; - possible_net_t ct_net; - struct hlist_node nat_bysource; - u8 __nfct_init_offset[0]; - struct nf_conn *master; - u_int32_t secmark; - struct nf_ct_ext *ext; - union nf_conntrack_proto proto; -}; - -struct nf_conntrack_zone { - u16 id; - u8 flags; - u8 dir; -}; - struct xt_table_info { unsigned int size; unsigned int number; @@ -101492,6 +105228,27 @@ struct xt_table_info { unsigned char entries[0]; }; +struct nf_conntrack_l4proto { + u_int8_t l4proto; + bool allow_clash; + u16 nlattr_size; + bool (*can_early_drop)(const struct nf_conn *); + int (*to_nlattr)(struct sk_buff *, struct nlattr *, struct nf_conn *); + int (*from_nlattr)(struct nlattr **, struct nf_conn *); + int (*tuple_to_nlattr)(struct sk_buff *, const struct nf_conntrack_tuple *); + unsigned int (*nlattr_tuple_size)(); + int (*nlattr_to_tuple)(struct nlattr **, struct nf_conntrack_tuple *); + const struct nla_policy *nla_policy; + struct { + int (*nlattr_to_obj)(struct nlattr **, struct net *, void *); + int (*obj_to_nlattr)(struct sk_buff *, const void *); + u16 obj_size; + u16 nlattr_max; + const struct nla_policy *nla_policy; + } ctnl_timeout; + void (*print_conntrack)(struct seq_file *, struct nf_conn *); +}; + struct nf_ct_ext { u8 offset[4]; u8 len; @@ -101534,15 +105291,6 @@ enum nf_dev_hooks { NF_NETDEV_NUMHOOKS = 1, }; -struct xdp_buff { - void *data; - void *data_end; - void *data_meta; - void *data_hard_start; - long unsigned int handle; - struct xdp_rxq_info *rxq; -}; - struct ifbond { __s32 bond_mode; __s32 num_slaves; @@ -101576,6 +105324,17 @@ enum { NAPIF_STATE_IN_BUSY_POLL = 64, }; +enum gro_result { + GRO_MERGED = 0, + GRO_MERGED_FREE = 1, + GRO_HELD = 2, + GRO_NORMAL = 3, + GRO_DROP = 4, + GRO_CONSUMED = 5, +}; + +typedef enum gro_result gro_result_t; + struct udp_tunnel_info { short unsigned int type; sa_family_t sa_family; @@ -101593,12 +105352,6 @@ struct packet_type { struct list_head list; }; -struct offload_callbacks { - struct sk_buff * (*gso_segment)(struct sk_buff *, netdev_features_t); - struct sk_buff * (*gro_receive)(struct list_head *, struct sk_buff *); - int (*gro_complete)(struct sk_buff *, int); -}; - struct packet_offload { __be16 type; u16 priority; @@ -101662,15 +105415,6 @@ struct tcf_walker { int (*fn)(struct tcf_proto *, void *, struct tcf_walker *); }; -struct qdisc_skb_cb { - struct { - unsigned int pkt_len; - u16 slave_dev_queue_mapping; - u16 tc_classid; - }; - unsigned char data[20]; -}; - struct udp_hslot; struct udp_table { @@ -101736,6 +105480,12 @@ struct netdev_adjacent { struct callback_head rcu; }; +typedef struct sk_buff *pto_T_____23; + +typedef __u32 pao_T_____9; + +typedef u16 pao_T_____10; + struct ethtool_value { __u32 cmd; __u32 data; @@ -101977,48 +105727,6 @@ struct ethtool_rx_flow_spec_input { u32 rss_ctx; }; -struct xsk_queue; - -struct xdp_umem_page; - -struct xdp_umem_fq_reuse; - -struct xdp_umem { - struct xsk_queue *fq; - struct xsk_queue *cq; - struct xdp_umem_page *pages; - u64 chunk_mask; - u64 size; - u32 headroom; - u32 chunk_size_nohr; - struct user_struct *user; - long unsigned int address; - refcount_t users; - struct work_struct work; - struct page **pgs; - u32 npgs; - u16 queue_id; - u8 need_wakeup; - u8 flags; - int id; - struct net_device *dev; - struct xdp_umem_fq_reuse *fq_reuse; - bool zc; - spinlock_t xsk_list_lock; - struct list_head xsk_list; -}; - -struct xdp_umem_page { - void *addr; - dma_addr_t dma; -}; - -struct xdp_umem_fq_reuse { - u32 nentries; - u32 length; - u64 handles[0]; -}; - struct ethtool_link_usettings { struct ethtool_link_settings base; struct { @@ -102608,6 +106316,10 @@ struct ifinfomsg { unsigned int ifi_change; }; +typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, struct netlink_ext_ack *); + +typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *); + struct rtnl_af_ops { struct list_head list; int family; @@ -102641,124 +106353,46 @@ struct seg6_pernet_data { struct in6_addr *tun_src; }; -enum bpf_func_id { - BPF_FUNC_unspec = 0, - BPF_FUNC_map_lookup_elem = 1, - BPF_FUNC_map_update_elem = 2, - BPF_FUNC_map_delete_elem = 3, - BPF_FUNC_probe_read = 4, - BPF_FUNC_ktime_get_ns = 5, - BPF_FUNC_trace_printk = 6, - BPF_FUNC_get_prandom_u32 = 7, - BPF_FUNC_get_smp_processor_id = 8, - BPF_FUNC_skb_store_bytes = 9, - BPF_FUNC_l3_csum_replace = 10, - BPF_FUNC_l4_csum_replace = 11, - BPF_FUNC_tail_call = 12, - BPF_FUNC_clone_redirect = 13, - BPF_FUNC_get_current_pid_tgid = 14, - BPF_FUNC_get_current_uid_gid = 15, - BPF_FUNC_get_current_comm = 16, - BPF_FUNC_get_cgroup_classid = 17, - BPF_FUNC_skb_vlan_push = 18, - BPF_FUNC_skb_vlan_pop = 19, - BPF_FUNC_skb_get_tunnel_key = 20, - BPF_FUNC_skb_set_tunnel_key = 21, - BPF_FUNC_perf_event_read = 22, - BPF_FUNC_redirect = 23, - BPF_FUNC_get_route_realm = 24, - BPF_FUNC_perf_event_output = 25, - BPF_FUNC_skb_load_bytes = 26, - BPF_FUNC_get_stackid = 27, - BPF_FUNC_csum_diff = 28, - BPF_FUNC_skb_get_tunnel_opt = 29, - BPF_FUNC_skb_set_tunnel_opt = 30, - BPF_FUNC_skb_change_proto = 31, - BPF_FUNC_skb_change_type = 32, - BPF_FUNC_skb_under_cgroup = 33, - BPF_FUNC_get_hash_recalc = 34, - BPF_FUNC_get_current_task = 35, - BPF_FUNC_probe_write_user = 36, - BPF_FUNC_current_task_under_cgroup = 37, - BPF_FUNC_skb_change_tail = 38, - BPF_FUNC_skb_pull_data = 39, - BPF_FUNC_csum_update = 40, - BPF_FUNC_set_hash_invalid = 41, - BPF_FUNC_get_numa_node_id = 42, - BPF_FUNC_skb_change_head = 43, - BPF_FUNC_xdp_adjust_head = 44, - BPF_FUNC_probe_read_str = 45, - BPF_FUNC_get_socket_cookie = 46, - BPF_FUNC_get_socket_uid = 47, - BPF_FUNC_set_hash = 48, - BPF_FUNC_setsockopt = 49, - BPF_FUNC_skb_adjust_room = 50, - BPF_FUNC_redirect_map = 51, - BPF_FUNC_sk_redirect_map = 52, - BPF_FUNC_sock_map_update = 53, - BPF_FUNC_xdp_adjust_meta = 54, - BPF_FUNC_perf_event_read_value = 55, - BPF_FUNC_perf_prog_read_value = 56, - BPF_FUNC_getsockopt = 57, - BPF_FUNC_override_return = 58, - BPF_FUNC_sock_ops_cb_flags_set = 59, - BPF_FUNC_msg_redirect_map = 60, - BPF_FUNC_msg_apply_bytes = 61, - BPF_FUNC_msg_cork_bytes = 62, - BPF_FUNC_msg_pull_data = 63, - BPF_FUNC_bind = 64, - BPF_FUNC_xdp_adjust_tail = 65, - BPF_FUNC_skb_get_xfrm_state = 66, - BPF_FUNC_get_stack = 67, - BPF_FUNC_skb_load_bytes_relative = 68, - BPF_FUNC_fib_lookup = 69, - BPF_FUNC_sock_hash_update = 70, - BPF_FUNC_msg_redirect_hash = 71, - BPF_FUNC_sk_redirect_hash = 72, - BPF_FUNC_lwt_push_encap = 73, - BPF_FUNC_lwt_seg6_store_bytes = 74, - BPF_FUNC_lwt_seg6_adjust_srh = 75, - BPF_FUNC_lwt_seg6_action = 76, - BPF_FUNC_rc_repeat = 77, - BPF_FUNC_rc_keydown = 78, - BPF_FUNC_skb_cgroup_id = 79, - BPF_FUNC_get_current_cgroup_id = 80, - BPF_FUNC_get_local_storage = 81, - BPF_FUNC_sk_select_reuseport = 82, - BPF_FUNC_skb_ancestor_cgroup_id = 83, - BPF_FUNC_sk_lookup_tcp = 84, - BPF_FUNC_sk_lookup_udp = 85, - BPF_FUNC_sk_release = 86, - BPF_FUNC_map_push_elem = 87, - BPF_FUNC_map_pop_elem = 88, - BPF_FUNC_map_peek_elem = 89, - BPF_FUNC_msg_push_data = 90, - BPF_FUNC_msg_pop_data = 91, - BPF_FUNC_rc_pointer_rel = 92, - BPF_FUNC_spin_lock = 93, - BPF_FUNC_spin_unlock = 94, - BPF_FUNC_sk_fullsock = 95, - BPF_FUNC_tcp_sock = 96, - BPF_FUNC_skb_ecn_set_ce = 97, - BPF_FUNC_get_listener_sock = 98, - BPF_FUNC_skc_lookup_tcp = 99, - BPF_FUNC_tcp_check_syncookie = 100, - BPF_FUNC_sysctl_get_name = 101, - BPF_FUNC_sysctl_get_current_value = 102, - BPF_FUNC_sysctl_get_new_value = 103, - BPF_FUNC_sysctl_set_new_value = 104, - BPF_FUNC_strtol = 105, - BPF_FUNC_strtoul = 106, - BPF_FUNC_sk_storage_get = 107, - BPF_FUNC_sk_storage_delete = 108, - BPF_FUNC_send_signal = 109, - BPF_FUNC_tcp_gen_syncookie = 110, - BPF_FUNC_skb_output = 111, - BPF_FUNC_probe_read_user = 112, - BPF_FUNC_probe_read_kernel = 113, - BPF_FUNC_probe_read_user_str = 114, - BPF_FUNC_probe_read_kernel_str = 115, - __BPF_FUNC_MAX_ID = 116, +enum { + BPF_F_RECOMPUTE_CSUM = 1, + BPF_F_INVALIDATE_HASH = 2, +}; + +enum { + BPF_F_HDR_FIELD_MASK = 15, +}; + +enum { + BPF_F_PSEUDO_HDR = 16, + BPF_F_MARK_MANGLED_0 = 32, + BPF_F_MARK_ENFORCE = 64, +}; + +enum { + BPF_F_INGRESS = 1, +}; + +enum { + BPF_F_TUNINFO_IPV6 = 1, +}; + +enum { + BPF_F_ZERO_CSUM_TX = 2, + BPF_F_DONT_FRAGMENT = 4, + BPF_F_SEQ_NUMBER = 8, +}; + +enum { + BPF_F_ADJ_ROOM_FIXED_GSO = 1, + BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 = 2, + BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 = 4, + BPF_F_ADJ_ROOM_ENCAP_L4_GRE = 8, + BPF_F_ADJ_ROOM_ENCAP_L4_UDP = 16, +}; + +enum { + BPF_ADJ_ROOM_ENCAP_L2_MASK = 255, + BPF_ADJ_ROOM_ENCAP_L2_SHIFT = 56, }; enum bpf_adj_room_mode { @@ -102771,58 +106405,10 @@ enum bpf_hdr_start_off { BPF_HDR_START_NET = 1, }; -struct bpf_sock { - __u32 bound_dev_if; - __u32 family; - __u32 type; - __u32 protocol; - __u32 mark; - __u32 priority; - __u32 src_ip4; - __u32 src_ip6[4]; - __u32 src_port; - __u32 dst_port; - __u32 dst_ip4; - __u32 dst_ip6[4]; - __u32 state; -}; - -struct __sk_buff { - __u32 len; - __u32 pkt_type; - __u32 mark; - __u32 queue_mapping; - __u32 protocol; - __u32 vlan_present; - __u32 vlan_tci; - __u32 vlan_proto; - __u32 priority; - __u32 ingress_ifindex; - __u32 ifindex; - __u32 tc_index; - __u32 cb[5]; - __u32 hash; - __u32 tc_classid; - __u32 data; - __u32 data_end; - __u32 napi_id; - __u32 family; - __u32 remote_ip4; - __u32 local_ip4; - __u32 remote_ip6[4]; - __u32 local_ip6[4]; - __u32 remote_port; - __u32 local_port; - __u32 data_meta; - union { - struct bpf_flow_keys *flow_keys; - }; - __u64 tstamp; - __u32 wire_len; - __u32 gso_segs; - union { - struct bpf_sock *sk; - }; +enum bpf_lwt_encap_mode { + BPF_LWT_ENCAP_SEG6 = 0, + BPF_LWT_ENCAP_SEG6_INLINE = 1, + BPF_LWT_ENCAP_IP = 2, }; struct bpf_tunnel_key { @@ -102903,95 +106489,12 @@ enum sk_action { SK_PASS = 1, }; -struct sk_msg_md { - union { - void *data; - }; - union { - void *data_end; - }; - __u32 family; - __u32 remote_ip4; - __u32 local_ip4; - __u32 remote_ip6[4]; - __u32 local_ip6[4]; - __u32 remote_port; - __u32 local_port; - __u32 size; -}; - -struct sk_reuseport_md { - union { - void *data; - }; - union { - void *data_end; - }; - __u32 len; - __u32 eth_protocol; - __u32 ip_protocol; - __u32 bind_inany; - __u32 hash; -}; - -struct bpf_sock_addr { - __u32 user_family; - __u32 user_ip4; - __u32 user_ip6[4]; - __u32 user_port; - __u32 family; - __u32 type; - __u32 protocol; - __u32 msg_src_ip4; - __u32 msg_src_ip6[4]; - union { - struct bpf_sock *sk; - }; -}; - -struct bpf_sock_ops { - __u32 op; - union { - __u32 args[4]; - __u32 reply; - __u32 replylong[4]; - }; - __u32 family; - __u32 remote_ip4; - __u32 local_ip4; - __u32 remote_ip6[4]; - __u32 local_ip6[4]; - __u32 remote_port; - __u32 local_port; - __u32 is_fullsock; - __u32 snd_cwnd; - __u32 srtt_us; - __u32 bpf_sock_ops_cb_flags; - __u32 state; - __u32 rtt_min; - __u32 snd_ssthresh; - __u32 rcv_nxt; - __u32 snd_nxt; - __u32 snd_una; - __u32 mss_cache; - __u32 ecn_flags; - __u32 rate_delivered; - __u32 rate_interval_us; - __u32 packets_out; - __u32 retrans_out; - __u32 total_retrans; - __u32 segs_in; - __u32 data_segs_in; - __u32 segs_out; - __u32 data_segs_out; - __u32 lost_out; - __u32 sacked_out; - __u32 sk_txhash; - __u64 bytes_received; - __u64 bytes_acked; - union { - struct bpf_sock *sk; - }; +enum { + BPF_SOCK_OPS_RTO_CB_FLAG = 1, + BPF_SOCK_OPS_RETRANS_CB_FLAG = 2, + BPF_SOCK_OPS_STATE_CB_FLAG = 4, + BPF_SOCK_OPS_RTT_CB_FLAG = 8, + BPF_SOCK_OPS_ALL_CB_FLAGS = 15, }; enum { @@ -103010,6 +106513,16 @@ enum { BPF_SOCK_OPS_RTT_CB = 12, }; +enum { + TCP_BPF_IW = 1001, + TCP_BPF_SNDCWND_CLAMP = 1002, +}; + +enum { + BPF_FIB_LOOKUP_DIRECT = 1, + BPF_FIB_LOOKUP_OUTPUT = 2, +}; + enum { BPF_FIB_LKUP_RET_SUCCESS = 0, BPF_FIB_LKUP_RET_BLACKHOLE = 1, @@ -103048,63 +106561,6 @@ struct bpf_fib_lookup { __u8 dmac[6]; }; -enum bpf_access_type { - BPF_READ = 1, - BPF_WRITE = 2, -}; - -enum bpf_reg_type { - NOT_INIT = 0, - SCALAR_VALUE = 1, - PTR_TO_CTX = 2, - CONST_PTR_TO_MAP = 3, - PTR_TO_MAP_VALUE = 4, - PTR_TO_MAP_VALUE_OR_NULL = 5, - PTR_TO_STACK = 6, - PTR_TO_PACKET_META = 7, - PTR_TO_PACKET = 8, - PTR_TO_PACKET_END = 9, - PTR_TO_FLOW_KEYS = 10, - PTR_TO_SOCKET = 11, - PTR_TO_SOCKET_OR_NULL = 12, - PTR_TO_SOCK_COMMON = 13, - PTR_TO_SOCK_COMMON_OR_NULL = 14, - PTR_TO_TCP_SOCK = 15, - PTR_TO_TCP_SOCK_OR_NULL = 16, - PTR_TO_TP_BUFFER = 17, - PTR_TO_XDP_SOCK = 18, - PTR_TO_BTF_ID = 19, -}; - -struct bpf_verifier_log; - -struct bpf_insn_access_aux { - enum bpf_reg_type reg_type; - union { - int ctx_field_size; - u32 btf_id; - }; - struct bpf_verifier_log *log; -}; - -struct bpf_verifier_ops { - const struct bpf_func_proto * (*get_func_proto)(enum bpf_func_id, const struct bpf_prog *); - bool (*is_valid_access)(int, int, enum bpf_access_type, const struct bpf_prog *, struct bpf_insn_access_aux *); - int (*gen_prologue)(struct bpf_insn *, bool, const struct bpf_prog *); - int (*gen_ld_abs)(const struct bpf_insn *, struct bpf_insn *); - u32 (*convert_ctx_access)(enum bpf_access_type, const struct bpf_insn *, struct bpf_insn *, struct bpf_prog *, u32 *); -}; - -struct sk_reuseport_kern { - struct sk_buff *skb; - struct sock *sk; - struct sock *selected_sk; - void *data_end; - u32 hash; - u32 reuseport_id; - bool bind_inany; -}; - enum rt_scope_t { RT_SCOPE_UNIVERSE = 0, RT_SCOPE_SITE = 200, @@ -103119,38 +106575,10 @@ enum rt_class_t { RT_TABLE_DEFAULT = 253, RT_TABLE_MAIN = 254, RT_TABLE_LOCAL = 255, - RT_TABLE_MAX = -1, -}; - -struct bpf_skb_data_end { - struct qdisc_skb_cb qdisc_cb; - void *data_meta; - void *data_end; + RT_TABLE_MAX = 4294967295, }; -struct bpf_sock_addr_kern { - struct sock *sk; - struct sockaddr *uaddr; - u64 tmp_reg; - void *t_ctx; -}; - -struct bpf_sock_ops_kern { - struct sock *sk; - u32 op; - union { - u32 args[4]; - u32 reply; - u32 replylong[4]; - }; - u32 is_fullsock; - u64 temp; -}; - -struct ipv6_bpf_stub { - int (*inet6_bind)(struct sock *, struct sockaddr *, int, bool, bool); - struct sock * (*udp6_lib_lookup)(struct net *, const struct in6_addr *, __be16, const struct in6_addr *, __be16, int, int, struct udp_table *, struct sk_buff *); -}; +typedef int (*bpf_aux_classic_check_t)(struct sock_filter *, unsigned int); struct fib_result { __be32 prefix; @@ -103212,56 +106640,45 @@ struct tcp_skb_cb { }; }; -struct sk_msg_sg { - u32 start; - u32 curr; - u32 end; - u32 size; - u32 copybreak; - long unsigned int copy; - struct scatterlist data[19]; -}; - -struct sk_msg { - struct sk_msg_sg sg; - void *data; - void *data_end; - u32 apply_bytes; - u32 cork_bytes; - u32 flags; - struct sk_buff *skb; - struct sock *sk_redir; - struct sock *sk; - struct list_head list; -}; - struct _bpf_dtab_netdev { struct net_device *dev; }; -struct xdp_sock { - struct sock sk; - struct xsk_queue *rx; - struct net_device *dev; - struct xdp_umem *umem; - struct list_head flush_node; - u16 queue_id; - bool zc; - enum { - XSK_READY = 0, - XSK_BOUND = 1, - XSK_UNBOUND = 2, - } state; - struct mutex mutex; - long: 64; - long: 64; - struct xsk_queue *tx; - struct list_head list; - spinlock_t tx_completion_lock; - spinlock_t rx_lock; - u64 rx_dropped; - struct list_head map_list; - spinlock_t map_list_lock; +struct ipv6_sr_hdr { + __u8 nexthdr; + __u8 hdrlen; + __u8 type; + __u8 segments_left; + __u8 first_segment; + __u8 flags; + __u16 tag; + struct in6_addr segments[0]; +}; + +enum { + SEG6_LOCAL_ACTION_UNSPEC = 0, + SEG6_LOCAL_ACTION_END = 1, + SEG6_LOCAL_ACTION_END_X = 2, + SEG6_LOCAL_ACTION_END_T = 3, + SEG6_LOCAL_ACTION_END_DX2 = 4, + SEG6_LOCAL_ACTION_END_DX6 = 5, + SEG6_LOCAL_ACTION_END_DX4 = 6, + SEG6_LOCAL_ACTION_END_DT6 = 7, + SEG6_LOCAL_ACTION_END_DT4 = 8, + SEG6_LOCAL_ACTION_END_B6 = 9, + SEG6_LOCAL_ACTION_END_B6_ENCAP = 10, + SEG6_LOCAL_ACTION_END_BM = 11, + SEG6_LOCAL_ACTION_END_S = 12, + SEG6_LOCAL_ACTION_END_AS = 13, + SEG6_LOCAL_ACTION_END_AM = 14, + SEG6_LOCAL_ACTION_END_BPF = 15, + __SEG6_LOCAL_ACTION_MAX = 16, +}; + +struct seg6_bpf_srh_state { + struct ipv6_sr_hdr *srh; + u16 hdrlen; + bool valid; }; typedef u64 (*btf_bpf_skb_get_pay_offset)(struct sk_buff *); @@ -103377,6 +106794,10 @@ typedef u64 (*btf_bpf_skb_set_tunnel_opt)(struct sk_buff *, const u8 *, u32); typedef u64 (*btf_bpf_skb_under_cgroup)(struct sk_buff *, struct bpf_map *, u32); +typedef u64 (*btf_bpf_skb_cgroup_id)(const struct sk_buff *); + +typedef u64 (*btf_bpf_skb_ancestor_cgroup_id)(const struct sk_buff *, int); + typedef u64 (*btf_bpf_xdp_event_output)(struct xdp_buff *, struct bpf_map *, u64, void *, u64); typedef u64 (*btf_bpf_get_socket_cookie)(struct sk_buff *); @@ -103407,6 +106828,12 @@ typedef u64 (*btf_bpf_lwt_in_push_encap)(struct sk_buff *, u32, void *, u32); typedef u64 (*btf_bpf_lwt_xmit_push_encap)(struct sk_buff *, u32, void *, u32); +typedef u64 (*btf_bpf_lwt_seg6_store_bytes)(struct sk_buff *, u32, const void *, u32); + +typedef u64 (*btf_bpf_lwt_seg6_action)(struct sk_buff *, u32, void *, u32); + +typedef u64 (*btf_bpf_lwt_seg6_adjust_srh)(struct sk_buff *, u32, s32); + typedef u64 (*btf_bpf_skc_lookup_tcp)(struct sk_buff *, struct bpf_sock_tuple *, u32, u64, u64); typedef u64 (*btf_bpf_sk_lookup_tcp)(struct sk_buff *, struct bpf_sock_tuple *, u32, u64, u64); @@ -103443,9 +106870,9 @@ typedef u64 (*btf_sk_reuseport_load_bytes)(const struct sk_reuseport_kern *, u32 typedef u64 (*btf_sk_reuseport_load_bytes_relative)(const struct sk_reuseport_kern *, u32, void *, u32, u32); -struct bpf_dtab_netdev; +struct bpf_dtab_netdev___2; -struct bpf_cpu_map_entry; +struct bpf_cpu_map_entry___2; struct sock_diag_req { __u8 sdiag_family; @@ -103503,37 +106930,6 @@ struct xdp_attachment_info { u32 flags; }; -struct ptr_ring { - int producer; - spinlock_t producer_lock; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - int consumer_head; - int consumer_tail; - spinlock_t consumer_lock; - long: 32; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - int size; - int batch; - void **queue; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; - long: 64; -}; - struct pp_alloc_cache { u32 count; void *cache[128]; @@ -103720,6 +107116,105 @@ struct netdev_queue_attribute { ssize_t (*store)(struct netdev_queue *, const char *, size_t); }; +struct strp_stats { + long long unsigned int msgs; + long long unsigned int bytes; + unsigned int mem_fail; + unsigned int need_more_hdr; + unsigned int msg_too_big; + unsigned int msg_timeouts; + unsigned int bad_hdr_len; +}; + +struct strparser; + +struct strp_callbacks { + int (*parse_msg)(struct strparser *, struct sk_buff *); + void (*rcv_msg)(struct strparser *, struct sk_buff *); + int (*read_sock_done)(struct strparser *, int); + void (*abort_parser)(struct strparser *, int); + void (*lock)(struct strparser *); + void (*unlock)(struct strparser *); +}; + +struct strparser { + struct sock *sk; + u32 stopped: 1; + u32 paused: 1; + u32 aborted: 1; + u32 interrupted: 1; + u32 unrecov_intr: 1; + struct sk_buff **skb_nextp; + struct sk_buff *skb_head; + unsigned int need_bytes; + struct delayed_work msg_timer_work; + struct work_struct work; + struct strp_stats stats; + struct strp_callbacks cb; +}; + +enum __sk_action { + __SK_DROP = 0, + __SK_PASS = 1, + __SK_REDIRECT = 2, + __SK_NONE = 3, +}; + +struct sk_psock_progs { + struct bpf_prog *msg_parser; + struct bpf_prog *skb_parser; + struct bpf_prog *skb_verdict; +}; + +enum sk_psock_state_bits { + SK_PSOCK_TX_ENABLED = 0, +}; + +struct sk_psock_link { + struct list_head list; + struct bpf_map *map; + void *link_raw; +}; + +struct sk_psock_parser { + struct strparser strp; + bool enabled; + void (*saved_data_ready)(struct sock *); +}; + +struct sk_psock_work_state { + struct sk_buff *skb; + u32 len; + u32 off; +}; + +struct sk_psock { + struct sock *sk; + struct sock *sk_redir; + u32 apply_bytes; + u32 cork_bytes; + u32 eval; + struct sk_msg *cork; + struct sk_psock_progs progs; + struct sk_psock_parser parser; + struct sk_buff_head ingress_skb; + struct list_head ingress_msg; + long unsigned int state; + struct list_head link; + spinlock_t link_lock; + refcount_t refcnt; + void (*saved_unhash)(struct sock *); + void (*saved_close)(struct sock *, long int); + void (*saved_write_space)(struct sock *); + struct proto *sk_proto; + struct sk_psock_work_state work_state; + struct work_struct work; + union { + struct callback_head rcu; + struct work_struct gc; + }; +}; + struct fib_rule_uid_range { __u32 start; __u32 end; @@ -103799,6 +107294,12 @@ struct trace_event_data_offsets_consume_skb {}; struct trace_event_data_offsets_skb_copy_datagram_iovec {}; +typedef void (*btf_trace_kfree_skb)(void *, struct sk_buff *, void *); + +typedef void (*btf_trace_consume_skb)(void *, struct sk_buff *); + +typedef void (*btf_trace_skb_copy_datagram_iovec)(void *, const struct sk_buff *, int); + struct trace_event_raw_net_dev_start_xmit { struct trace_entry ent; u32 __data_loc_name; @@ -103899,6 +107400,42 @@ struct trace_event_data_offsets_net_dev_rx_verbose_template { struct trace_event_data_offsets_net_dev_rx_exit_template {}; +typedef void (*btf_trace_net_dev_start_xmit)(void *, const struct sk_buff *, const struct net_device *); + +typedef void (*btf_trace_net_dev_xmit)(void *, struct sk_buff *, int, struct net_device *, unsigned int); + +typedef void (*btf_trace_net_dev_xmit_timeout)(void *, struct net_device *, int); + +typedef void (*btf_trace_net_dev_queue)(void *, struct sk_buff *); + +typedef void (*btf_trace_netif_receive_skb)(void *, struct sk_buff *); + +typedef void (*btf_trace_netif_rx)(void *, struct sk_buff *); + +typedef void (*btf_trace_napi_gro_frags_entry)(void *, const struct sk_buff *); + +typedef void (*btf_trace_napi_gro_receive_entry)(void *, const struct sk_buff *); + +typedef void (*btf_trace_netif_receive_skb_entry)(void *, const struct sk_buff *); + +typedef void (*btf_trace_netif_receive_skb_list_entry)(void *, const struct sk_buff *); + +typedef void (*btf_trace_netif_rx_entry)(void *, const struct sk_buff *); + +typedef void (*btf_trace_netif_rx_ni_entry)(void *, const struct sk_buff *); + +typedef void (*btf_trace_napi_gro_frags_exit)(void *, int); + +typedef void (*btf_trace_napi_gro_receive_exit)(void *, int); + +typedef void (*btf_trace_netif_receive_skb_exit)(void *, int); + +typedef void (*btf_trace_netif_rx_exit)(void *, int); + +typedef void (*btf_trace_netif_rx_ni_exit)(void *, int); + +typedef void (*btf_trace_netif_receive_skb_list_exit)(void *, int); + struct trace_event_raw_napi_poll { struct trace_entry ent; struct napi_struct *napi; @@ -103912,6 +107449,8 @@ struct trace_event_data_offsets_napi_poll { u32 dev_name; }; +typedef void (*btf_trace_napi_poll)(void *, struct napi_struct *, int, int); + enum tcp_ca_state { TCP_CA_Open = 0, TCP_CA_Disorder = 1, @@ -103964,6 +107503,12 @@ struct trace_event_data_offsets_sock_exceed_buf_limit {}; struct trace_event_data_offsets_inet_sock_set_state {}; +typedef void (*btf_trace_sock_rcvqueue_full)(void *, struct sock *, struct sk_buff *); + +typedef void (*btf_trace_sock_exceed_buf_limit)(void *, struct sock *, struct proto *, long int, int); + +typedef void (*btf_trace_inet_sock_set_state)(void *, const struct sock *, const int, const int); + struct trace_event_raw_udp_fail_queue_rcv_skb { struct trace_entry ent; int rc; @@ -103973,6 +107518,8 @@ struct trace_event_raw_udp_fail_queue_rcv_skb { struct trace_event_data_offsets_udp_fail_queue_rcv_skb {}; +typedef void (*btf_trace_udp_fail_queue_rcv_skb)(void *, int, struct sock *); + struct trace_event_raw_tcp_event_sk_skb { struct trace_entry ent; const void *skbaddr; @@ -104040,6 +107587,20 @@ struct trace_event_data_offsets_tcp_retransmit_synack {}; struct trace_event_data_offsets_tcp_probe {}; +typedef void (*btf_trace_tcp_retransmit_skb)(void *, const struct sock *, const struct sk_buff *); + +typedef void (*btf_trace_tcp_send_reset)(void *, const struct sock *, const struct sk_buff *); + +typedef void (*btf_trace_tcp_receive_reset)(void *, struct sock *); + +typedef void (*btf_trace_tcp_destroy_sock)(void *, struct sock *); + +typedef void (*btf_trace_tcp_rcv_space_adjust)(void *, struct sock *); + +typedef void (*btf_trace_tcp_retransmit_synack)(void *, const struct sock *, const struct request_sock *); + +typedef void (*btf_trace_tcp_probe)(void *, struct sock *, struct sk_buff *); + struct trace_event_raw_fib_table_lookup { struct trace_entry ent; u32 tb_id; @@ -104064,6 +107625,8 @@ struct trace_event_data_offsets_fib_table_lookup { u32 name; }; +typedef void (*btf_trace_fib_table_lookup)(void *, u32, const struct flowi4 *, const struct fib_nh_common *, int); + struct trace_event_raw_qdisc_dequeue { struct trace_entry ent; struct Qdisc *qdisc; @@ -104079,6 +107642,8 @@ struct trace_event_raw_qdisc_dequeue { struct trace_event_data_offsets_qdisc_dequeue {}; +typedef void (*btf_trace_qdisc_dequeue)(void *, struct Qdisc *, const struct netdev_queue *, int, struct sk_buff *); + struct trace_event_raw_neigh_create { struct trace_entry ent; u32 family; @@ -104146,6 +107711,132 @@ struct trace_event_data_offsets_neigh__update { u32 dev; }; +typedef void (*btf_trace_neigh_create)(void *, struct neigh_table *, struct net_device *, const void *, const struct neighbour *, bool); + +typedef void (*btf_trace_neigh_update)(void *, struct neighbour *, const u8 *, u8, u32, u32); + +typedef void (*btf_trace_neigh_update_done)(void *, struct neighbour *, int); + +typedef void (*btf_trace_neigh_timer_handler)(void *, struct neighbour *, int); + +typedef void (*btf_trace_neigh_event_send_done)(void *, struct neighbour *, int); + +typedef void (*btf_trace_neigh_event_send_dead)(void *, struct neighbour *, int); + +typedef void (*btf_trace_neigh_cleanup_and_release)(void *, struct neighbour *, int); + +enum lwtunnel_encap_types { + LWTUNNEL_ENCAP_NONE = 0, + LWTUNNEL_ENCAP_MPLS = 1, + LWTUNNEL_ENCAP_IP = 2, + LWTUNNEL_ENCAP_ILA = 3, + LWTUNNEL_ENCAP_IP6 = 4, + LWTUNNEL_ENCAP_SEG6 = 5, + LWTUNNEL_ENCAP_BPF = 6, + LWTUNNEL_ENCAP_SEG6_LOCAL = 7, + __LWTUNNEL_ENCAP_MAX = 8, +}; + +struct rtnexthop { + short unsigned int rtnh_len; + unsigned char rtnh_flags; + unsigned char rtnh_hops; + int rtnh_ifindex; +}; + +struct lwtunnel_encap_ops { + int (*build_state)(struct nlattr *, unsigned int, const void *, struct lwtunnel_state **, struct netlink_ext_ack *); + void (*destroy_state)(struct lwtunnel_state *); + int (*output)(struct net *, struct sock *, struct sk_buff *); + int (*input)(struct sk_buff *); + int (*fill_encap)(struct sk_buff *, struct lwtunnel_state *); + int (*get_encap_size)(struct lwtunnel_state *); + int (*cmp_encap)(struct lwtunnel_state *, struct lwtunnel_state *); + int (*xmit)(struct sk_buff *); + struct module *owner; +}; + +enum { + LWT_BPF_PROG_UNSPEC = 0, + LWT_BPF_PROG_FD = 1, + LWT_BPF_PROG_NAME = 2, + __LWT_BPF_PROG_MAX = 3, +}; + +enum { + LWT_BPF_UNSPEC = 0, + LWT_BPF_IN = 1, + LWT_BPF_OUT = 2, + LWT_BPF_XMIT = 3, + LWT_BPF_XMIT_HEADROOM = 4, + __LWT_BPF_MAX = 5, +}; + +enum { + LWTUNNEL_XMIT_DONE = 0, + LWTUNNEL_XMIT_CONTINUE = 1, +}; + +struct bpf_lwt_prog { + struct bpf_prog *prog; + char *name; +}; + +struct bpf_lwt { + struct bpf_lwt_prog in; + struct bpf_lwt_prog out; + struct bpf_lwt_prog xmit; + int family; +}; + +struct bpf_stab { + struct bpf_map map; + struct sock **sks; + struct sk_psock_progs progs; + raw_spinlock_t lock; + long: 32; + long: 64; + long: 64; + long: 64; +}; + +typedef u64 (*btf_bpf_sock_map_update)(struct bpf_sock_ops_kern *, struct bpf_map *, void *, u64); + +typedef u64 (*btf_bpf_sk_redirect_map)(struct sk_buff *, struct bpf_map *, u32, u64); + +typedef u64 (*btf_bpf_msg_redirect_map)(struct sk_msg *, struct bpf_map *, u32, u64); + +struct bpf_htab_elem { + struct callback_head rcu; + u32 hash; + struct sock *sk; + struct hlist_node node; + u8 key[0]; +}; + +struct bpf_htab_bucket { + struct hlist_head head; + raw_spinlock_t lock; +}; + +struct bpf_htab___2 { + struct bpf_map map; + struct bpf_htab_bucket *buckets; + u32 buckets_num; + u32 elem_size; + struct sk_psock_progs progs; + atomic_t count; + long: 32; + long: 64; + long: 64; +}; + +typedef u64 (*btf_bpf_sock_hash_update)(struct bpf_sock_ops_kern *, struct bpf_map *, void *, u64); + +typedef u64 (*btf_bpf_sk_redirect_hash)(struct sk_buff *, struct bpf_map *, void *, u64); + +typedef u64 (*btf_bpf_msg_redirect_hash)(struct sk_msg *, struct bpf_map *, void *, u64); + struct dst_cache_pcpu { long unsigned int refresh_ts; struct dst_entry *dst; @@ -104167,6 +107858,64 @@ struct gro_cell { struct napi_struct napi; }; +enum { + BPF_SK_STORAGE_GET_F_CREATE = 1, +}; + +struct bpf_sk_storage_data; + +struct bpf_sk_storage { + struct bpf_sk_storage_data *cache[16]; + struct hlist_head list; + struct sock *sk; + struct callback_head rcu; + raw_spinlock_t lock; +}; + +struct bucket___2 { + struct hlist_head list; + raw_spinlock_t lock; +}; + +struct bpf_sk_storage_map { + struct bpf_map map; + struct bucket___2 *buckets; + u32 bucket_log; + u16 elem_size; + u16 cache_idx; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; +}; + +struct bpf_sk_storage_data { + struct bpf_sk_storage_map *smap; + u8 data[0]; +}; + +struct bpf_sk_storage_elem { + struct hlist_node map_node; + struct hlist_node snode; + struct bpf_sk_storage *sk_storage; + struct callback_head rcu; + long: 64; + struct bpf_sk_storage_data sdata; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; +}; + +typedef u64 (*btf_bpf_sk_storage_get)(struct bpf_map *, struct sock *, void *, u64); + +typedef u64 (*btf_bpf_sk_storage_delete)(struct bpf_map *, struct sock *); + struct group_req { __u32 gr_interface; struct __kernel_sockaddr_storage gr_group; @@ -104682,6 +108431,181 @@ struct tcf_skbedit { struct tcf_skbedit_params *params; }; +struct nf_conntrack_tuple_mask { + struct { + union nf_inet_addr u3; + union nf_conntrack_man_proto u; + } src; +}; + +struct nf_conntrack_l4proto___2; + +struct nf_conntrack_helper; + +struct nf_conntrack_expect { + struct hlist_node lnode; + struct hlist_node hnode; + struct nf_conntrack_tuple tuple; + struct nf_conntrack_tuple_mask mask; + void (*expectfn)(struct nf_conn *, struct nf_conntrack_expect *); + struct nf_conntrack_helper *helper; + struct nf_conn *master; + struct timer_list timeout; + refcount_t use; + unsigned int flags; + unsigned int class; + union nf_inet_addr saved_addr; + union nf_conntrack_man_proto saved_proto; + enum ip_conntrack_dir dir; + struct callback_head rcu; +}; + +struct PptpControlHeader { + __be16 messageType; + __u16 reserved; +}; + +struct PptpStartSessionRequest { + __be16 protocolVersion; + __u16 reserved1; + __be32 framingCapability; + __be32 bearerCapability; + __be16 maxChannels; + __be16 firmwareRevision; + __u8 hostName[64]; + __u8 vendorString[64]; +}; + +struct PptpStartSessionReply { + __be16 protocolVersion; + __u8 resultCode; + __u8 generalErrorCode; + __be32 framingCapability; + __be32 bearerCapability; + __be16 maxChannels; + __be16 firmwareRevision; + __u8 hostName[64]; + __u8 vendorString[64]; +}; + +struct PptpStopSessionRequest { + __u8 reason; + __u8 reserved1; + __u16 reserved2; +}; + +struct PptpStopSessionReply { + __u8 resultCode; + __u8 generalErrorCode; + __u16 reserved1; +}; + +struct PptpOutCallRequest { + __be16 callID; + __be16 callSerialNumber; + __be32 minBPS; + __be32 maxBPS; + __be32 bearerType; + __be32 framingType; + __be16 packetWindow; + __be16 packetProcDelay; + __be16 phoneNumberLength; + __u16 reserved1; + __u8 phoneNumber[64]; + __u8 subAddress[64]; +}; + +struct PptpOutCallReply { + __be16 callID; + __be16 peersCallID; + __u8 resultCode; + __u8 generalErrorCode; + __be16 causeCode; + __be32 connectSpeed; + __be16 packetWindow; + __be16 packetProcDelay; + __be32 physChannelID; +}; + +struct PptpInCallRequest { + __be16 callID; + __be16 callSerialNumber; + __be32 callBearerType; + __be32 physChannelID; + __be16 dialedNumberLength; + __be16 dialingNumberLength; + __u8 dialedNumber[64]; + __u8 dialingNumber[64]; + __u8 subAddress[64]; +}; + +struct PptpInCallReply { + __be16 callID; + __be16 peersCallID; + __u8 resultCode; + __u8 generalErrorCode; + __be16 packetWindow; + __be16 packetProcDelay; + __u16 reserved; +}; + +struct PptpInCallConnected { + __be16 peersCallID; + __u16 reserved; + __be32 connectSpeed; + __be16 packetWindow; + __be16 packetProcDelay; + __be32 callFramingType; +}; + +struct PptpClearCallRequest { + __be16 callID; + __u16 reserved; +}; + +struct PptpCallDisconnectNotify { + __be16 callID; + __u8 resultCode; + __u8 generalErrorCode; + __be16 causeCode; + __u16 reserved; + __u8 callStatistics[128]; +}; + +struct PptpWanErrorNotify { + __be16 peersCallID; + __u16 reserved; + __be32 crcErrors; + __be32 framingErrors; + __be32 hardwareOverRuns; + __be32 bufferOverRuns; + __be32 timeoutErrors; + __be32 alignmentErrors; +}; + +struct PptpSetLinkInfo { + __be16 peersCallID; + __u16 reserved; + __be32 sendAccm; + __be32 recvAccm; +}; + +union pptp_ctrl_union { + struct PptpStartSessionRequest sreq; + struct PptpStartSessionReply srep; + struct PptpStopSessionRequest streq; + struct PptpStopSessionReply strep; + struct PptpOutCallRequest ocreq; + struct PptpOutCallReply ocack; + struct PptpInCallRequest icreq; + struct PptpInCallReply icack; + struct PptpInCallConnected iccon; + struct PptpClearCallRequest clrreq; + struct PptpCallDisconnectNotify disc; + struct PptpWanErrorNotify wanerr; + struct PptpSetLinkInfo setlink; +}; + struct nf_nat_range2 { unsigned int flags; union nf_inet_addr min_addr; @@ -104775,10 +108699,111 @@ struct tc_action_net { const struct tc_action_ops *ops; }; +struct tc_act_bpf { + __u32 index; + __u32 capab; + int action; + int refcnt; + int bindcnt; +}; + +enum { + TCA_ACT_BPF_UNSPEC = 0, + TCA_ACT_BPF_TM = 1, + TCA_ACT_BPF_PARMS = 2, + TCA_ACT_BPF_OPS_LEN = 3, + TCA_ACT_BPF_OPS = 4, + TCA_ACT_BPF_FD = 5, + TCA_ACT_BPF_NAME = 6, + TCA_ACT_BPF_PAD = 7, + TCA_ACT_BPF_TAG = 8, + TCA_ACT_BPF_ID = 9, + __TCA_ACT_BPF_MAX = 10, +}; + +struct tcf_bpf { + struct tc_action common; + struct bpf_prog *filter; + union { + u32 bpf_fd; + u16 bpf_num_ops; + }; + struct sock_filter *bpf_ops; + const char *bpf_name; +}; + +struct tcf_bpf_cfg { + struct bpf_prog *filter; + struct sock_filter *bpf_ops; + const char *bpf_name; + u16 bpf_num_ops; + bool is_ebpf; +}; + struct tc_fifo_qopt { __u32 limit; }; +enum { + TCA_BPF_UNSPEC = 0, + TCA_BPF_ACT = 1, + TCA_BPF_POLICE = 2, + TCA_BPF_CLASSID = 3, + TCA_BPF_OPS_LEN = 4, + TCA_BPF_OPS = 5, + TCA_BPF_FD = 6, + TCA_BPF_NAME = 7, + TCA_BPF_FLAGS = 8, + TCA_BPF_FLAGS_GEN = 9, + TCA_BPF_TAG = 10, + TCA_BPF_ID = 11, + __TCA_BPF_MAX = 12, +}; + +struct flow_cls_common_offload { + u32 chain_index; + __be16 protocol; + u32 prio; + struct netlink_ext_ack *extack; +}; + +enum tc_clsbpf_command { + TC_CLSBPF_OFFLOAD = 0, + TC_CLSBPF_STATS = 1, +}; + +struct tc_cls_bpf_offload { + struct flow_cls_common_offload common; + enum tc_clsbpf_command command; + struct tcf_exts *exts; + struct bpf_prog *prog; + struct bpf_prog *oldprog; + const char *name; + bool exts_integrated; +}; + +struct cls_bpf_head { + struct list_head plist; + struct idr handle_idr; + struct callback_head rcu; +}; + +struct cls_bpf_prog { + struct bpf_prog *filter; + struct list_head link; + struct tcf_result res; + bool exts_integrated; + u32 gen_flags; + unsigned int in_hw_count; + struct tcf_exts exts; + u32 handle; + u16 bpf_num_ops; + struct sock_filter *bpf_ops; + const char *bpf_name; + struct tcf_proto *tp; + struct rcu_work rwork; +}; + struct tcf_ematch_tree_hdr { __u16 nmatches; __u16 progid; @@ -105009,24 +109034,19 @@ struct genl_dumpit_info { struct nlattr **attrs; }; -struct nf_hook_entries_rcu_head { - struct callback_head head; - void *allocation; +struct trace_event_raw_bpf_test_finish { + struct trace_entry ent; + int err; + char __data[0]; }; -struct nf_ct_hook { - int (*update)(struct net *, struct sk_buff *); - void (*destroy)(struct nf_conntrack *); - bool (*get_tuple_skb)(struct nf_conntrack_tuple *, const struct sk_buff *); -}; +struct trace_event_data_offsets_bpf_test_finish {}; -struct nfnl_ct_hook { - struct nf_conn * (*get_ct)(const struct sk_buff *, enum ip_conntrack_info *); - size_t (*build_size)(const struct nf_conn *); - int (*build)(struct sk_buff *, struct nf_conn *, enum ip_conntrack_info, u_int16_t, u_int16_t); - int (*parse)(const struct nlattr *, struct nf_conn *); - int (*attach_expect)(const struct nlattr *, struct nf_conn *, u32, u32); - void (*seq_adjust)(struct sk_buff *, struct nf_conn *, enum ip_conntrack_info, s32); +typedef void (*btf_trace_bpf_test_finish)(void *, int *); + +struct nf_hook_entries_rcu_head { + struct callback_head head; + void *allocation; }; struct nf_loginfo { @@ -105307,54 +109327,6 @@ enum ip_conntrack_events { __IPCT_MAX = 12, }; -struct nf_conntrack_tuple_mask { - struct { - union nf_inet_addr u3; - union nf_conntrack_man_proto u; - } src; -}; - -struct nf_conntrack_l4proto { - u_int8_t l4proto; - bool allow_clash; - u16 nlattr_size; - bool (*can_early_drop)(const struct nf_conn *); - int (*to_nlattr)(struct sk_buff *, struct nlattr *, struct nf_conn *); - int (*from_nlattr)(struct nlattr **, struct nf_conn *); - int (*tuple_to_nlattr)(struct sk_buff *, const struct nf_conntrack_tuple *); - unsigned int (*nlattr_tuple_size)(); - int (*nlattr_to_tuple)(struct nlattr **, struct nf_conntrack_tuple *); - const struct nla_policy *nla_policy; - struct { - int (*nlattr_to_obj)(struct nlattr **, struct net *, void *); - int (*obj_to_nlattr)(struct sk_buff *, const void *); - u16 obj_size; - u16 nlattr_max; - const struct nla_policy *nla_policy; - } ctnl_timeout; - void (*print_conntrack)(struct seq_file *, struct nf_conn *); -}; - -struct nf_conntrack_helper; - -struct nf_conntrack_expect { - struct hlist_node lnode; - struct hlist_node hnode; - struct nf_conntrack_tuple tuple; - struct nf_conntrack_tuple_mask mask; - void (*expectfn)(struct nf_conn *, struct nf_conntrack_expect *); - struct nf_conntrack_helper *helper; - struct nf_conn *master; - struct timer_list timeout; - refcount_t use; - unsigned int flags; - unsigned int class; - union nf_inet_addr saved_addr; - union nf_conntrack_man_proto saved_proto; - enum ip_conntrack_dir dir; - struct callback_head rcu; -}; - struct nf_conntrack_expect_policy; struct nf_conntrack_helper { @@ -105491,7 +109463,24 @@ enum nf_ct_sysctl_index { NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_STREAM = 23, NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP = 24, NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6 = 25, - __NF_SYSCTL_CT_LAST_SYSCTL = 26, + NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_CLOSED = 26, + NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_COOKIE_WAIT = 27, + NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_COOKIE_ECHOED = 28, + NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_ESTABLISHED = 29, + NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_SHUTDOWN_SENT = 30, + NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_SHUTDOWN_RECD = 31, + NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_SHUTDOWN_ACK_SENT = 32, + NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_HEARTBEAT_SENT = 33, + NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_HEARTBEAT_ACKED = 34, + NF_SYSCTL_CT_PROTO_TIMEOUT_DCCP_REQUEST = 35, + NF_SYSCTL_CT_PROTO_TIMEOUT_DCCP_RESPOND = 36, + NF_SYSCTL_CT_PROTO_TIMEOUT_DCCP_PARTOPEN = 37, + NF_SYSCTL_CT_PROTO_TIMEOUT_DCCP_OPEN = 38, + NF_SYSCTL_CT_PROTO_TIMEOUT_DCCP_CLOSEREQ = 39, + NF_SYSCTL_CT_PROTO_TIMEOUT_DCCP_CLOSING = 40, + NF_SYSCTL_CT_PROTO_TIMEOUT_DCCP_TIMEWAIT = 41, + NF_SYSCTL_CT_PROTO_DCCP_LOOSE = 42, + __NF_SYSCTL_CT_LAST_SYSCTL = 43, }; enum ip_conntrack_expect_events { @@ -105643,6 +109632,95 @@ struct icmp6hdr { } icmp6_dataun; }; +enum ct_dccp_roles { + CT_DCCP_ROLE_CLIENT = 0, + CT_DCCP_ROLE_SERVER = 1, + __CT_DCCP_ROLE_MAX = 2, +}; + +struct dccp_hdr_ext { + __be32 dccph_seq_low; +}; + +struct dccp_hdr_ack_bits { + __be16 dccph_reserved1; + __be16 dccph_ack_nr_high; + __be32 dccph_ack_nr_low; +}; + +enum dccp_pkt_type { + DCCP_PKT_REQUEST = 0, + DCCP_PKT_RESPONSE = 1, + DCCP_PKT_DATA = 2, + DCCP_PKT_ACK = 3, + DCCP_PKT_DATAACK = 4, + DCCP_PKT_CLOSEREQ = 5, + DCCP_PKT_CLOSE = 6, + DCCP_PKT_RESET = 7, + DCCP_PKT_SYNC = 8, + DCCP_PKT_SYNCACK = 9, + DCCP_PKT_INVALID = 10, +}; + +enum ctattr_protoinfo_dccp { + CTA_PROTOINFO_DCCP_UNSPEC = 0, + CTA_PROTOINFO_DCCP_STATE = 1, + CTA_PROTOINFO_DCCP_ROLE = 2, + CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ = 3, + CTA_PROTOINFO_DCCP_PAD = 4, + __CTA_PROTOINFO_DCCP_MAX = 5, +}; + +enum { + SCTP_CHUNK_FLAG_T = 1, +}; + +enum { + SCTP_MIB_NUM = 0, + SCTP_MIB_CURRESTAB = 1, + SCTP_MIB_ACTIVEESTABS = 2, + SCTP_MIB_PASSIVEESTABS = 3, + SCTP_MIB_ABORTEDS = 4, + SCTP_MIB_SHUTDOWNS = 5, + SCTP_MIB_OUTOFBLUES = 6, + SCTP_MIB_CHECKSUMERRORS = 7, + SCTP_MIB_OUTCTRLCHUNKS = 8, + SCTP_MIB_OUTORDERCHUNKS = 9, + SCTP_MIB_OUTUNORDERCHUNKS = 10, + SCTP_MIB_INCTRLCHUNKS = 11, + SCTP_MIB_INORDERCHUNKS = 12, + SCTP_MIB_INUNORDERCHUNKS = 13, + SCTP_MIB_FRAGUSRMSGS = 14, + SCTP_MIB_REASMUSRMSGS = 15, + SCTP_MIB_OUTSCTPPACKS = 16, + SCTP_MIB_INSCTPPACKS = 17, + SCTP_MIB_T1_INIT_EXPIREDS = 18, + SCTP_MIB_T1_COOKIE_EXPIREDS = 19, + SCTP_MIB_T2_SHUTDOWN_EXPIREDS = 20, + SCTP_MIB_T3_RTX_EXPIREDS = 21, + SCTP_MIB_T4_RTO_EXPIREDS = 22, + SCTP_MIB_T5_SHUTDOWN_GUARD_EXPIREDS = 23, + SCTP_MIB_DELAY_SACK_EXPIREDS = 24, + SCTP_MIB_AUTOCLOSE_EXPIREDS = 25, + SCTP_MIB_T1_RETRANSMITS = 26, + SCTP_MIB_T3_RETRANSMITS = 27, + SCTP_MIB_PMTUD_RETRANSMITS = 28, + SCTP_MIB_FAST_RETRANSMITS = 29, + SCTP_MIB_IN_PKT_SOFTIRQ = 30, + SCTP_MIB_IN_PKT_BACKLOG = 31, + SCTP_MIB_IN_PKT_DISCARDS = 32, + SCTP_MIB_IN_DATA_CHUNK_DISCARDS = 33, + __SCTP_MIB_MAX = 34, +}; + +enum ctattr_protoinfo_sctp { + CTA_PROTOINFO_SCTP_UNSPEC = 0, + CTA_PROTOINFO_SCTP_STATE = 1, + CTA_PROTOINFO_SCTP_VTAG_ORIGINAL = 2, + CTA_PROTOINFO_SCTP_VTAG_REPLY = 3, + __CTA_PROTOINFO_SCTP_MAX = 4, +}; + enum cntl_msg_types { IPCTNL_MSG_CT_NEW = 0, IPCTNL_MSG_CT_GET = 1, @@ -105954,28 +110032,6 @@ enum ctattr_protonat { __CTA_PROTONAT_MAX = 3, }; -struct sctp_bind_hashbucket { - spinlock_t lock; - struct hlist_head chain; -}; - -struct sctp_hashbucket { - rwlock_t lock; - struct hlist_head chain; -}; - -struct sctp_globals { - struct list_head address_families; - struct sctp_hashbucket *ep_hashtable; - struct sctp_bind_hashbucket *port_hashtable; - struct rhltable transport_hashtable; - int ep_hashsize; - int port_hashsize; - __u16 max_instreams; - __u16 max_outstreams; - bool checksum_disable; -}; - struct masq_dev_work { struct work_struct work; struct net *net; @@ -105991,7 +110047,7 @@ struct xt_mtdtor_param; struct xt_match { struct list_head list; - char name[29]; + const char name[29]; u_int8_t revision; bool (*match)(const struct sk_buff *, struct xt_action_param *); int (*checkentry)(const struct xt_mtchk_param *); @@ -106030,7 +110086,7 @@ struct xt_tgdtor_param; struct xt_target { struct list_head list; - char name[29]; + const char name[29]; u_int8_t revision; unsigned int (*target)(struct sk_buff *, const struct xt_action_param *); int (*checkentry)(const struct xt_tgchk_param *); @@ -106313,6 +110369,29 @@ struct xt_tcpmss_info { __u16 mss; }; +struct xt_bpf_info { + __u16 bpf_program_num_elem; + struct sock_filter bpf_program[64]; + struct bpf_prog *filter; +}; + +enum xt_bpf_modes { + XT_BPF_MODE_BYTECODE = 0, + XT_BPF_MODE_FD_PINNED = 1, + XT_BPF_MODE_FD_ELF = 2, +}; + +struct xt_bpf_info_v1 { + __u16 mode; + __u16 bpf_program_num_elem; + __s32 fd; + union { + struct sock_filter bpf_program[64]; + char path[512]; + }; + struct bpf_prog *filter; +}; + enum { XT_CONNTRACK_STATE = 1, XT_CONNTRACK_PROTO = 2, @@ -106608,11 +110687,6 @@ struct fib_prop { u8 scope; }; -struct net_offload { - struct offload_callbacks callbacks; - unsigned int flags; -}; - struct raw_hashinfo { rwlock_t lock; struct hlist_head ht[256]; @@ -106694,11 +110768,6 @@ struct ip_reply_arg { kuid_t uid; }; -enum { - LWTUNNEL_XMIT_DONE = 0, - LWTUNNEL_XMIT_CONTINUE = 1, -}; - struct ip_mreq_source { __be32 imr_multiaddr; __be32 imr_interface; @@ -106719,6 +110788,28 @@ struct in_pktinfo { struct in_addr ipi_addr; }; +enum { + BPFILTER_IPT_SO_SET_REPLACE = 64, + BPFILTER_IPT_SO_SET_ADD_COUNTERS = 65, + BPFILTER_IPT_SET_MAX = 66, +}; + +enum { + BPFILTER_IPT_SO_GET_INFO = 64, + BPFILTER_IPT_SO_GET_ENTRIES = 65, + BPFILTER_IPT_SO_GET_REVISION_MATCH = 66, + BPFILTER_IPT_SO_GET_REVISION_TARGET = 67, + BPFILTER_IPT_GET_MAX = 68, +}; + +struct bpfilter_umh_ops { + struct umh_info info; + struct mutex lock; + int (*sockopt)(struct sock *, int, char *, unsigned int, bool); + int (*start)(); + bool stop; +}; + struct inet_timewait_sock { struct sock_common __tw_common; __u32 tw_mark; @@ -106992,11 +111083,6 @@ struct tcp_timewait_sock { struct tcp_md5sig_key *tw_md5_key; }; -struct icmp_err { - int errno; - unsigned int fatal: 1; -}; - enum tcp_tw_status { TCP_TW_SUCCESS = 0, TCP_TW_RST = 1, @@ -107136,8 +111222,6 @@ struct udp_sock { void (*encap_destroy)(struct sock *); struct sk_buff * (*gro_receive)(struct sock *, struct list_head *, struct sk_buff *); int (*gro_complete)(struct sock *, struct sk_buff *, int); - long: 64; - long: 64; struct sk_buff_head reader_queue; int forward_deficit; long: 32; @@ -107194,6 +111278,10 @@ struct arpreq { char arp_dev[16]; }; +typedef struct { + char ax25_call[7]; +} ax25_address; + enum { AX25_VALUES_IPDEFMODE = 0, AX25_VALUES_AXDEFMODE = 1, @@ -107212,12 +111300,31 @@ enum { AX25_MAX_VALUES = 14, }; +struct ax25_dev { + struct ax25_dev *next; + struct net_device *dev; + struct net_device *forward; + struct ctl_table_header *sysheader; + int values[14]; +}; + +typedef struct ax25_dev ax25_dev; + enum { XFRM_LOOKUP_ICMP = 1, XFRM_LOOKUP_QUEUE = 2, XFRM_LOOKUP_KEEP_DST_REF = 4, }; +struct pingv6_ops { + int (*ipv6_recv_error)(struct sock *, struct msghdr *, int, int *); + void (*ip6_datagram_recv_common_ctl)(struct sock *, struct msghdr *, struct sk_buff *); + void (*ip6_datagram_recv_specific_ctl)(struct sock *, struct msghdr *, struct sk_buff *); + int (*icmpv6_err_convert)(u8, u8, int *); + void (*ipv6_icmp_error)(struct sock *, struct sk_buff *, int, __be16, u32, u8 *); + int (*ipv6_chk_addr)(struct net *, const struct in6_addr *, const struct net_device *, int); +}; + struct icmp_bxm { struct sk_buff *skb; int offset; @@ -107308,15 +111415,6 @@ struct devinet_sysctl_table { struct ctl_table devinet_vars[33]; }; -struct pingv6_ops { - int (*ipv6_recv_error)(struct sock *, struct msghdr *, int, int *); - void (*ip6_datagram_recv_common_ctl)(struct sock *, struct msghdr *, struct sk_buff *); - void (*ip6_datagram_recv_specific_ctl)(struct sock *, struct msghdr *, struct sk_buff *); - int (*icmpv6_err_convert)(u8, u8, int *); - void (*ipv6_icmp_error)(struct sock *, struct sk_buff *, int, __be16, u32, u8 *); - int (*ipv6_chk_addr)(struct net *, const struct in6_addr *, const struct net_device *, int); -}; - struct igmphdr { __u8 type; __u8 code; @@ -107367,13 +111465,6 @@ struct igmp_mcf_iter_state { struct ip_mc_list *im; }; -struct rtnexthop { - short unsigned int rtnh_len; - unsigned char rtnh_flags; - unsigned char rtnh_hops; - int rtnh_ifindex; -}; - struct fib_config { u8 fc_dst_len; u8 fc_tos; @@ -107434,18 +111525,6 @@ struct fib_nh_notifier_info { struct fib_nh *fib_nh; }; -enum lwtunnel_encap_types { - LWTUNNEL_ENCAP_NONE = 0, - LWTUNNEL_ENCAP_MPLS = 1, - LWTUNNEL_ENCAP_IP = 2, - LWTUNNEL_ENCAP_ILA = 3, - LWTUNNEL_ENCAP_IP6 = 4, - LWTUNNEL_ENCAP_SEG6 = 5, - LWTUNNEL_ENCAP_BPF = 6, - LWTUNNEL_ENCAP_SEG6_LOCAL = 7, - __LWTUNNEL_ENCAP_MAX = 8, -}; - struct fib_alias { struct hlist_node fa_list; struct fib_info *fa_info; @@ -107546,16 +111625,61 @@ struct ping_table { rwlock_t lock; }; -struct lwtunnel_encap_ops { - int (*build_state)(struct nlattr *, unsigned int, const void *, struct lwtunnel_state **, struct netlink_ext_ack *); - void (*destroy_state)(struct lwtunnel_state *); - int (*output)(struct net *, struct sock *, struct sk_buff *); - int (*input)(struct sk_buff *); - int (*fill_encap)(struct sk_buff *, struct lwtunnel_state *); - int (*get_encap_size)(struct lwtunnel_state *); - int (*cmp_encap)(struct lwtunnel_state *, struct lwtunnel_state *); - int (*xmit)(struct sk_buff *); - struct module *owner; +enum lwtunnel_ip_t { + LWTUNNEL_IP_UNSPEC = 0, + LWTUNNEL_IP_ID = 1, + LWTUNNEL_IP_DST = 2, + LWTUNNEL_IP_SRC = 3, + LWTUNNEL_IP_TTL = 4, + LWTUNNEL_IP_TOS = 5, + LWTUNNEL_IP_FLAGS = 6, + LWTUNNEL_IP_PAD = 7, + LWTUNNEL_IP_OPTS = 8, + __LWTUNNEL_IP_MAX = 9, +}; + +enum lwtunnel_ip6_t { + LWTUNNEL_IP6_UNSPEC = 0, + LWTUNNEL_IP6_ID = 1, + LWTUNNEL_IP6_DST = 2, + LWTUNNEL_IP6_SRC = 3, + LWTUNNEL_IP6_HOPLIMIT = 4, + LWTUNNEL_IP6_TC = 5, + LWTUNNEL_IP6_FLAGS = 6, + LWTUNNEL_IP6_PAD = 7, + LWTUNNEL_IP6_OPTS = 8, + __LWTUNNEL_IP6_MAX = 9, +}; + +enum { + LWTUNNEL_IP_OPTS_UNSPEC = 0, + LWTUNNEL_IP_OPTS_GENEVE = 1, + LWTUNNEL_IP_OPTS_VXLAN = 2, + LWTUNNEL_IP_OPTS_ERSPAN = 3, + __LWTUNNEL_IP_OPTS_MAX = 4, +}; + +enum { + LWTUNNEL_IP_OPT_GENEVE_UNSPEC = 0, + LWTUNNEL_IP_OPT_GENEVE_CLASS = 1, + LWTUNNEL_IP_OPT_GENEVE_TYPE = 2, + LWTUNNEL_IP_OPT_GENEVE_DATA = 3, + __LWTUNNEL_IP_OPT_GENEVE_MAX = 4, +}; + +enum { + LWTUNNEL_IP_OPT_VXLAN_UNSPEC = 0, + LWTUNNEL_IP_OPT_VXLAN_GBP = 1, + __LWTUNNEL_IP_OPT_VXLAN_MAX = 2, +}; + +enum { + LWTUNNEL_IP_OPT_ERSPAN_UNSPEC = 0, + LWTUNNEL_IP_OPT_ERSPAN_VER = 1, + LWTUNNEL_IP_OPT_ERSPAN_INDEX = 2, + LWTUNNEL_IP_OPT_ERSPAN_DIR = 3, + LWTUNNEL_IP_OPT_ERSPAN_HWID = 4, + __LWTUNNEL_IP_OPT_ERSPAN_MAX = 5, }; struct ip6_tnl_encap_ops { @@ -107564,6 +111688,20 @@ struct ip6_tnl_encap_ops { int (*err_handler)(struct sk_buff *, struct inet6_skb_parm *, u8, u8, int, __be32); }; +struct geneve_opt { + __be16 opt_class; + u8 type; + u8 length: 5; + u8 r3: 1; + u8 r2: 1; + u8 r1: 1; + u8 opt_data[0]; +}; + +struct vxlan_metadata { + u32 gbp; +}; + struct erspan_md2 { __be32 timestamp; __be16 sgt; @@ -107576,6 +111714,14 @@ struct erspan_md2 { __u8 hwid: 4; }; +struct erspan_metadata { + int version; + union { + __be32 index; + struct erspan_md2 md2; + } u; +}; + struct nhmsg { unsigned char nh_family; unsigned char nh_scope; @@ -107700,14 +111846,6 @@ struct ip_tunnel_net { int type; }; -struct inet6_protocol { - void (*early_demux)(struct sk_buff *); - void (*early_demux_handler)(struct sk_buff *); - int (*handler)(struct sk_buff *); - int (*err_handler)(struct sk_buff *, struct inet6_skb_parm *, u8, u8, int, __be32); - unsigned int flags; -}; - struct snmp_mib { const char *name; int entry; @@ -107928,8 +112066,6 @@ struct compat_sioc_vif_req { compat_ulong_t obytes; }; -typedef u64 pao_T_____5; - struct rta_mfc_stats { __u64 mfcs_packets; __u64 mfcs_bytes; @@ -108083,6 +112219,124 @@ struct bictcp { u32 curr_rtt; }; +struct tls_crypto_info { + __u16 version; + __u16 cipher_type; +}; + +struct tls12_crypto_info_aes_gcm_128 { + struct tls_crypto_info info; + unsigned char iv[8]; + unsigned char key[16]; + unsigned char salt[4]; + unsigned char rec_seq[8]; +}; + +struct tls12_crypto_info_aes_gcm_256 { + struct tls_crypto_info info; + unsigned char iv[8]; + unsigned char key[32]; + unsigned char salt[4]; + unsigned char rec_seq[8]; +}; + +struct tls_rec { + struct list_head list; + int tx_ready; + int tx_flags; + struct sk_msg msg_plaintext; + struct sk_msg msg_encrypted; + struct scatterlist sg_aead_in[2]; + struct scatterlist sg_aead_out[2]; + char content_type; + struct scatterlist sg_content_type; + char aad_space[13]; + u8 iv_data[16]; + struct aead_request aead_req; + u8 aead_req_ctx[0]; +}; + +struct tx_work { + struct delayed_work work; + struct sock *sk; +}; + +struct tls_sw_context_tx { + struct crypto_aead *aead_send; + struct crypto_wait async_wait; + struct tx_work tx_work; + struct tls_rec *open_rec; + struct list_head tx_list; + atomic_t encrypt_pending; + int async_notify; + u8 async_capable: 1; + long unsigned int tx_bitmask; +}; + +struct cipher_context { + char *iv; + char *rec_seq; +}; + +union tls_crypto_context { + struct tls_crypto_info info; + union { + struct tls12_crypto_info_aes_gcm_128 aes_gcm_128; + struct tls12_crypto_info_aes_gcm_256 aes_gcm_256; + }; +}; + +struct tls_prot_info { + u16 version; + u16 cipher_type; + u16 prepend_size; + u16 tag_size; + u16 overhead_size; + u16 iv_size; + u16 salt_size; + u16 rec_seq_size; + u16 aad_size; + u16 tail_size; +}; + +struct tls_context { + struct tls_prot_info prot_info; + u8 tx_conf: 3; + u8 rx_conf: 3; + int (*push_pending_record)(struct sock *, int); + void (*sk_write_space)(struct sock *); + void *priv_ctx_tx; + void *priv_ctx_rx; + struct net_device *netdev; + struct cipher_context tx; + struct cipher_context rx; + struct scatterlist *partially_sent_record; + u16 partially_sent_offset; + bool in_tcp_sendpages; + bool pending_open_record_frags; + struct mutex tx_lock; + long unsigned int flags; + struct proto *sk_proto; + void (*sk_destruct)(struct sock *); + union tls_crypto_context crypto_send; + union tls_crypto_context crypto_recv; + struct list_head list; + refcount_t refcount; + struct callback_head rcu; +}; + +enum { + TCP_BPF_IPV4 = 0, + TCP_BPF_IPV6 = 1, + TCP_BPF_NUM_PROTS = 2, +}; + +enum { + TCP_BPF_BASE = 0, + TCP_BPF_TX = 1, + TCP_BPF_NUM_CFGS = 2, +}; + struct netlbl_audit { u32 secid; kuid_t loginuid; @@ -108739,11 +112993,6 @@ struct unix_stream_read_state { unsigned int splice_flags; }; -struct ipv6_params { - __s32 disable_ipv6; - __s32 autoconf; -}; - enum flowlabel_reflect { FLOWLABEL_REFLECT_ESTABLISHED = 1, FLOWLABEL_REFLECT_TCP_RESET = 2, @@ -108778,13 +113027,6 @@ struct ip6_frag_state { u8 nexthdr; }; -struct ip6_ra_chain { - struct ip6_ra_chain *next; - struct sock *sk; - int sel; - void (*destructor)(struct sock *); -}; - struct ipcm6_cookie { struct sockcm_cookie sockc; __s16 hlimit; @@ -109165,8 +113407,6 @@ struct rt6_exception { struct callback_head rcu; }; -typedef struct rt6_info * (*pol_lookup_t)(struct net *, struct fib6_table *, struct flowi6 *, const struct sk_buff *, int); - struct rt6_rtnl_dump_arg { struct sk_buff *skb; struct netlink_callback *cb; @@ -109205,10 +113445,12 @@ struct trace_event_data_offsets_fib6_table_lookup { u32 name; }; +typedef void (*btf_trace_fib6_table_lookup)(void *, const struct net *, const struct fib6_result *, struct fib6_table *, const struct flowi6 *); + enum rt6_nud_state { - RT6_NUD_FAIL_HARD = -3, - RT6_NUD_FAIL_PROBE = -2, - RT6_NUD_FAIL_DO_RR = -1, + RT6_NUD_FAIL_HARD = 4294967293, + RT6_NUD_FAIL_PROBE = 4294967294, + RT6_NUD_FAIL_DO_RR = 4294967295, RT6_NUD_SUCCEED = 1, }; @@ -109380,17 +113622,6 @@ struct ip6_mtuinfo { __u32 ip6m_mtu; }; -struct ipv6_sr_hdr { - __u8 nexthdr; - __u8 hdrlen; - __u8 type; - __u8 segments_left; - __u8 first_segment; - __u8 flags; - __u16 tag; - struct in6_addr segments[0]; -}; - struct nduseroptmsg { unsigned char nduseropt_family; unsigned char nduseropt_pad1; @@ -109444,8 +113675,6 @@ struct raw6_frag_vec { char c[4]; }; -typedef void ip6_icmp_send_t(struct sk_buff *, u8, u8, __u32, const struct in6_addr *); - struct icmpv6_msg { struct sk_buff *skb; int offset; @@ -109582,8 +113811,21 @@ struct br_input_skb_cb { u8 src_port_isolated: 1; }; +struct nf_br_ops { + int (*br_dev_xmit_hook)(struct sk_buff *); +}; + struct nf_bridge_frag_data; +typedef struct rt6_info * (*pol_lookup_t)(struct net *, struct fib6_table *, struct flowi6 *, const struct sk_buff *, int); + +struct fib6_rule { + struct fib_rule common; + struct rt6key src; + struct rt6key dst; + u8 tclass; +}; + struct calipso_doi; struct netlbl_calipso_ops { @@ -109629,6 +113871,76 @@ struct calipso_map_cache_entry { struct list_head list; }; +enum { + SEG6_IPTUNNEL_UNSPEC = 0, + SEG6_IPTUNNEL_SRH = 1, + __SEG6_IPTUNNEL_MAX = 2, +}; + +struct seg6_iptunnel_encap { + int mode; + struct ipv6_sr_hdr srh[0]; +}; + +enum { + SEG6_IPTUN_MODE_INLINE = 0, + SEG6_IPTUN_MODE_ENCAP = 1, + SEG6_IPTUN_MODE_L2ENCAP = 2, +}; + +struct seg6_lwt { + struct dst_cache cache; + struct seg6_iptunnel_encap tuninfo[0]; +}; + +enum { + SEG6_LOCAL_UNSPEC = 0, + SEG6_LOCAL_ACTION = 1, + SEG6_LOCAL_SRH = 2, + SEG6_LOCAL_TABLE = 3, + SEG6_LOCAL_NH4 = 4, + SEG6_LOCAL_NH6 = 5, + SEG6_LOCAL_IIF = 6, + SEG6_LOCAL_OIF = 7, + SEG6_LOCAL_BPF = 8, + __SEG6_LOCAL_MAX = 9, +}; + +enum { + SEG6_LOCAL_BPF_PROG_UNSPEC = 0, + SEG6_LOCAL_BPF_PROG = 1, + SEG6_LOCAL_BPF_PROG_NAME = 2, + __SEG6_LOCAL_BPF_PROG_MAX = 3, +}; + +struct seg6_local_lwt; + +struct seg6_action_desc { + int action; + long unsigned int attrs; + int (*input)(struct sk_buff *, struct seg6_local_lwt *); + int static_headroom; +}; + +struct seg6_local_lwt { + int action; + struct ipv6_sr_hdr *srh; + int table; + struct in_addr nh4; + struct in6_addr nh6; + int iif; + int oif; + struct bpf_lwt_prog bpf; + int headroom; + struct seg6_action_desc *desc; +}; + +struct seg6_action_param { + int (*parse)(struct nlattr **, struct seg6_local_lwt *); + int (*put)(struct sk_buff *, struct seg6_local_lwt *); + int (*cmp)(struct seg6_local_lwt *, struct seg6_local_lwt *); +}; + struct ah_data { int icv_full_len; int icv_trunc_len; @@ -109804,14 +114116,14 @@ struct sit_net { struct net_device *fb_tunnel_dev; }; -struct metadata_dst___2; - enum { IP6_FH_F_FRAG = 1, IP6_FH_F_AUTH = 2, IP6_FH_F_SKIP_RH = 4, }; +typedef void ip6_icmp_send_t(struct sk_buff *, u8, u8, __u32, const struct in6_addr *); + struct sockaddr_pkt { short unsigned int spkt_family; unsigned char spkt_device[14]; @@ -110088,8 +114400,6 @@ struct packet_sock { long: 64; long: 64; long: 64; - long: 64; - long: 64; struct packet_type prot_hook; atomic_t tp_drops; long: 32; @@ -110268,6 +114578,8 @@ struct rpc_buffer { char data[0]; }; +typedef void (*rpc_action)(struct rpc_task *); + struct trace_event_raw_rpc_task_status { struct trace_entry ent; unsigned int task_id; @@ -110710,6 +115022,124 @@ struct trace_event_data_offsets_svc_deferred_event { u32 addr; }; +typedef void (*btf_trace_rpc_call_status)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc_bind_status)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc_connect_status)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc_request)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc_task_begin)(void *, const struct rpc_task *, const void *); + +typedef void (*btf_trace_rpc_task_run_action)(void *, const struct rpc_task *, const void *); + +typedef void (*btf_trace_rpc_task_complete)(void *, const struct rpc_task *, const void *); + +typedef void (*btf_trace_rpc_task_end)(void *, const struct rpc_task *, const void *); + +typedef void (*btf_trace_rpc_task_sleep)(void *, const struct rpc_task *, const struct rpc_wait_queue *); + +typedef void (*btf_trace_rpc_task_wakeup)(void *, const struct rpc_task *, const struct rpc_wait_queue *); + +typedef void (*btf_trace_rpc_bad_callhdr)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc_bad_verifier)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc__prog_unavail)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc__prog_mismatch)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc__proc_unavail)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc__garbage_args)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc__unparsable)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc__mismatch)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc__stale_creds)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc__bad_creds)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc__auth_tooweak)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpc_stats_latency)(void *, const struct rpc_task *, ktime_t, ktime_t, ktime_t); + +typedef void (*btf_trace_rpc_xdr_overflow)(void *, const struct xdr_stream *, size_t); + +typedef void (*btf_trace_rpc_xdr_alignment)(void *, const struct xdr_stream *, size_t, unsigned int); + +typedef void (*btf_trace_rpc_reply_pages)(void *, const struct rpc_rqst *); + +typedef void (*btf_trace_rpc_socket_state_change)(void *, struct rpc_xprt *, struct socket *); + +typedef void (*btf_trace_rpc_socket_connect)(void *, struct rpc_xprt *, struct socket *, int); + +typedef void (*btf_trace_rpc_socket_error)(void *, struct rpc_xprt *, struct socket *, int); + +typedef void (*btf_trace_rpc_socket_reset_connection)(void *, struct rpc_xprt *, struct socket *, int); + +typedef void (*btf_trace_rpc_socket_close)(void *, struct rpc_xprt *, struct socket *); + +typedef void (*btf_trace_rpc_socket_shutdown)(void *, struct rpc_xprt *, struct socket *); + +typedef void (*btf_trace_xprt_timer)(void *, const struct rpc_xprt *, __be32, int); + +typedef void (*btf_trace_xprt_lookup_rqst)(void *, const struct rpc_xprt *, __be32, int); + +typedef void (*btf_trace_xprt_complete_rqst)(void *, const struct rpc_xprt *, __be32, int); + +typedef void (*btf_trace_xprt_transmit)(void *, const struct rpc_rqst *, int); + +typedef void (*btf_trace_xprt_enq_xmit)(void *, const struct rpc_task *, int); + +typedef void (*btf_trace_xprt_ping)(void *, const struct rpc_xprt *, int); + +typedef void (*btf_trace_xprt_reserve_xprt)(void *, const struct rpc_xprt *, const struct rpc_task *); + +typedef void (*btf_trace_xprt_release_xprt)(void *, const struct rpc_xprt *, const struct rpc_task *); + +typedef void (*btf_trace_xprt_reserve_cong)(void *, const struct rpc_xprt *, const struct rpc_task *); + +typedef void (*btf_trace_xprt_release_cong)(void *, const struct rpc_xprt *, const struct rpc_task *); + +typedef void (*btf_trace_xprt_get_cong)(void *, const struct rpc_xprt *, const struct rpc_task *); + +typedef void (*btf_trace_xprt_put_cong)(void *, const struct rpc_xprt *, const struct rpc_task *); + +typedef void (*btf_trace_xs_stream_read_data)(void *, struct rpc_xprt *, ssize_t, size_t); + +typedef void (*btf_trace_xs_stream_read_request)(void *, struct sock_xprt *); + +typedef void (*btf_trace_svc_recv)(void *, struct svc_rqst *, int); + +typedef void (*btf_trace_svc_authenticate)(void *, const struct svc_rqst *, int, __be32); + +typedef void (*btf_trace_svc_process)(void *, const struct svc_rqst *, const char *); + +typedef void (*btf_trace_svc_defer)(void *, const struct svc_rqst *); + +typedef void (*btf_trace_svc_drop)(void *, const struct svc_rqst *); + +typedef void (*btf_trace_svc_send)(void *, struct svc_rqst *, int); + +typedef void (*btf_trace_svc_xprt_do_enqueue)(void *, struct svc_xprt *, struct svc_rqst *); + +typedef void (*btf_trace_svc_xprt_no_write_space)(void *, struct svc_xprt *); + +typedef void (*btf_trace_svc_xprt_dequeue)(void *, struct svc_rqst *); + +typedef void (*btf_trace_svc_wake_up)(void *, int); + +typedef void (*btf_trace_svc_handle_xprt)(void *, struct svc_xprt *, int); + +typedef void (*btf_trace_svc_stats_latency)(void *, const struct svc_rqst *); + +typedef void (*btf_trace_svc_drop_deferred)(void *, const struct svc_deferred_req *); + +typedef void (*btf_trace_svc_revisit_deferred)(void *, const struct svc_deferred_req *); + struct rpc_cred_cache { struct hlist_head *hashtable; unsigned int hashbits; @@ -110717,20 +115147,12 @@ struct rpc_cred_cache { }; enum { - SVC_POOL_AUTO = -1, + SVC_POOL_AUTO = 4294967295, SVC_POOL_GLOBAL = 0, SVC_POOL_PERCPU = 1, SVC_POOL_PERNODE = 2, }; -struct svc_pool_map { - int count; - int mode; - unsigned int npools; - unsigned int *pool_to; - unsigned int *to_pool; -}; - struct unix_domain { struct auth_domain h; }; @@ -111238,6 +115660,46 @@ struct trace_event_data_offsets_rpcgss_oid_to_mech { u32 oid; }; +typedef void (*btf_trace_rpcgss_import_ctx)(void *, int); + +typedef void (*btf_trace_rpcgss_get_mic)(void *, const struct rpc_task *, u32); + +typedef void (*btf_trace_rpcgss_verify_mic)(void *, const struct rpc_task *, u32); + +typedef void (*btf_trace_rpcgss_wrap)(void *, const struct rpc_task *, u32); + +typedef void (*btf_trace_rpcgss_unwrap)(void *, const struct rpc_task *, u32); + +typedef void (*btf_trace_rpcgss_accept_upcall)(void *, __be32, u32, u32); + +typedef void (*btf_trace_rpcgss_unwrap_failed)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpcgss_bad_seqno)(void *, const struct rpc_task *, u32, u32); + +typedef void (*btf_trace_rpcgss_seqno)(void *, const struct rpc_task *); + +typedef void (*btf_trace_rpcgss_need_reencode)(void *, const struct rpc_task *, u32, bool); + +typedef void (*btf_trace_rpcgss_upcall_msg)(void *, const char *); + +typedef void (*btf_trace_rpcgss_upcall_result)(void *, u32, int); + +typedef void (*btf_trace_rpcgss_context)(void *, long unsigned int, long unsigned int, unsigned int, unsigned int, const u8 *); + +typedef void (*btf_trace_rpcgss_createauth)(void *, unsigned int, int); + +typedef void (*btf_trace_rpcgss_oid_to_mech)(void *, const char *); + +struct strp_msg { + int full_len; + int offset; +}; + +struct _strp_msg { + struct strp_msg strp; + int accum_len; +}; + enum nl80211_commands { NL80211_CMD_UNSPEC = 0, NL80211_CMD_GET_WIPHY = 1, @@ -111877,7 +116339,7 @@ enum nl80211_feature_flags { NL80211_FEATURE_TDLS_CHANNEL_SWITCH = 268435456, NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR = 536870912, NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR = 1073741824, - NL80211_FEATURE_ND_RANDOM_MAC_ADDR = -2147483648, + NL80211_FEATURE_ND_RANDOM_MAC_ADDR = 2147483648, }; enum nl80211_ext_feature_index { @@ -112004,6 +116466,8 @@ enum nl80211_preamble { NL80211_PREAMBLE_DMG = 3, }; +typedef int (*sk_read_actor_t___2)(read_descriptor_t *, struct sk_buff___2 *, unsigned int, size_t); + enum ieee80211_bss_type { IEEE80211_BSS_TYPE_ESS = 0, IEEE80211_BSS_TYPE_PBSS = 1, @@ -112056,7 +116520,7 @@ struct wireless_dev { struct wiphy *wiphy; enum nl80211_iftype iftype; struct list_head list; - struct net_device *netdev; + struct net_device___2 *netdev; u32 identifier; struct list_head mgmt_registrations; spinlock_t mgmt_registrations_lock; @@ -112481,7 +116945,7 @@ struct sta_txpwr { struct station_parameters { const u8 *supported_rates; - struct net_device *vlan; + struct net_device___2 *vlan; u32 sta_flags_mask; u32 sta_flags_set; u32 sta_modify_mask; @@ -112810,13 +117274,13 @@ struct wiphy { struct ieee80211_supported_band *bands[4]; void (*reg_notifier)(struct wiphy *, struct regulatory_request *); const struct ieee80211_regdomain *regd; - struct device dev; + struct device___2 dev; bool registered; - struct dentry *debugfsdir; + struct dentry___2 *debugfsdir; const struct ieee80211_ht_cap *ht_capa_mod_mask; const struct ieee80211_vht_cap *vht_capa_mod_mask; struct list_head wdev_list; - possible_net_t _net; + possible_net_t___2 _net; const struct wiphy_coalesce_support *coalesce; const struct wiphy_vendor_command *vendor_commands; const struct nl80211_vendor_cmd_info *vendor_events; @@ -112877,7 +117341,7 @@ struct cfg80211_sched_scan_request { s8 relative_rssi; struct cfg80211_bss_select_adjust rssi_adjust; struct wiphy *wiphy; - struct net_device *dev; + struct net_device___2 *dev; long unsigned int scan_start; bool report_results; struct callback_head callback_head; @@ -113250,110 +117714,110 @@ struct cfg80211_ops { void (*set_wakeup)(struct wiphy *, bool); struct wireless_dev * (*add_virtual_intf)(struct wiphy *, const char *, unsigned char, enum nl80211_iftype, struct vif_params *); int (*del_virtual_intf)(struct wiphy *, struct wireless_dev *); - int (*change_virtual_intf)(struct wiphy *, struct net_device *, enum nl80211_iftype, struct vif_params *); - int (*add_key)(struct wiphy *, struct net_device *, u8, bool, const u8 *, struct key_params *); - int (*get_key)(struct wiphy *, struct net_device *, u8, bool, const u8 *, void *, void (*)(void *, struct key_params *)); - int (*del_key)(struct wiphy *, struct net_device *, u8, bool, const u8 *); - int (*set_default_key)(struct wiphy *, struct net_device *, u8, bool, bool); - int (*set_default_mgmt_key)(struct wiphy *, struct net_device *, u8); - int (*start_ap)(struct wiphy *, struct net_device *, struct cfg80211_ap_settings *); - int (*change_beacon)(struct wiphy *, struct net_device *, struct cfg80211_beacon_data *); - int (*stop_ap)(struct wiphy *, struct net_device *); - int (*add_station)(struct wiphy *, struct net_device *, const u8 *, struct station_parameters *); - int (*del_station)(struct wiphy *, struct net_device *, struct station_del_parameters *); - int (*change_station)(struct wiphy *, struct net_device *, const u8 *, struct station_parameters *); - int (*get_station)(struct wiphy *, struct net_device *, const u8 *, struct station_info *); - int (*dump_station)(struct wiphy *, struct net_device *, int, u8 *, struct station_info *); - int (*add_mpath)(struct wiphy *, struct net_device *, const u8 *, const u8 *); - int (*del_mpath)(struct wiphy *, struct net_device *, const u8 *); - int (*change_mpath)(struct wiphy *, struct net_device *, const u8 *, const u8 *); - int (*get_mpath)(struct wiphy *, struct net_device *, u8 *, u8 *, struct mpath_info *); - int (*dump_mpath)(struct wiphy *, struct net_device *, int, u8 *, u8 *, struct mpath_info *); - int (*get_mpp)(struct wiphy *, struct net_device *, u8 *, u8 *, struct mpath_info *); - int (*dump_mpp)(struct wiphy *, struct net_device *, int, u8 *, u8 *, struct mpath_info *); - int (*get_mesh_config)(struct wiphy *, struct net_device *, struct mesh_config *); - int (*update_mesh_config)(struct wiphy *, struct net_device *, u32, const struct mesh_config *); - int (*join_mesh)(struct wiphy *, struct net_device *, const struct mesh_config *, const struct mesh_setup *); - int (*leave_mesh)(struct wiphy *, struct net_device *); - int (*join_ocb)(struct wiphy *, struct net_device *, struct ocb_setup *); - int (*leave_ocb)(struct wiphy *, struct net_device *); - int (*change_bss)(struct wiphy *, struct net_device *, struct bss_parameters *); - int (*set_txq_params)(struct wiphy *, struct net_device *, struct ieee80211_txq_params *); - int (*libertas_set_mesh_channel)(struct wiphy *, struct net_device *, struct ieee80211_channel *); + int (*change_virtual_intf)(struct wiphy *, struct net_device___2 *, enum nl80211_iftype, struct vif_params *); + int (*add_key)(struct wiphy *, struct net_device___2 *, u8, bool, const u8 *, struct key_params *); + int (*get_key)(struct wiphy *, struct net_device___2 *, u8, bool, const u8 *, void *, void (*)(void *, struct key_params *)); + int (*del_key)(struct wiphy *, struct net_device___2 *, u8, bool, const u8 *); + int (*set_default_key)(struct wiphy *, struct net_device___2 *, u8, bool, bool); + int (*set_default_mgmt_key)(struct wiphy *, struct net_device___2 *, u8); + int (*start_ap)(struct wiphy *, struct net_device___2 *, struct cfg80211_ap_settings *); + int (*change_beacon)(struct wiphy *, struct net_device___2 *, struct cfg80211_beacon_data *); + int (*stop_ap)(struct wiphy *, struct net_device___2 *); + int (*add_station)(struct wiphy *, struct net_device___2 *, const u8 *, struct station_parameters *); + int (*del_station)(struct wiphy *, struct net_device___2 *, struct station_del_parameters *); + int (*change_station)(struct wiphy *, struct net_device___2 *, const u8 *, struct station_parameters *); + int (*get_station)(struct wiphy *, struct net_device___2 *, const u8 *, struct station_info *); + int (*dump_station)(struct wiphy *, struct net_device___2 *, int, u8 *, struct station_info *); + int (*add_mpath)(struct wiphy *, struct net_device___2 *, const u8 *, const u8 *); + int (*del_mpath)(struct wiphy *, struct net_device___2 *, const u8 *); + int (*change_mpath)(struct wiphy *, struct net_device___2 *, const u8 *, const u8 *); + int (*get_mpath)(struct wiphy *, struct net_device___2 *, u8 *, u8 *, struct mpath_info *); + int (*dump_mpath)(struct wiphy *, struct net_device___2 *, int, u8 *, u8 *, struct mpath_info *); + int (*get_mpp)(struct wiphy *, struct net_device___2 *, u8 *, u8 *, struct mpath_info *); + int (*dump_mpp)(struct wiphy *, struct net_device___2 *, int, u8 *, u8 *, struct mpath_info *); + int (*get_mesh_config)(struct wiphy *, struct net_device___2 *, struct mesh_config *); + int (*update_mesh_config)(struct wiphy *, struct net_device___2 *, u32, const struct mesh_config *); + int (*join_mesh)(struct wiphy *, struct net_device___2 *, const struct mesh_config *, const struct mesh_setup *); + int (*leave_mesh)(struct wiphy *, struct net_device___2 *); + int (*join_ocb)(struct wiphy *, struct net_device___2 *, struct ocb_setup *); + int (*leave_ocb)(struct wiphy *, struct net_device___2 *); + int (*change_bss)(struct wiphy *, struct net_device___2 *, struct bss_parameters *); + int (*set_txq_params)(struct wiphy *, struct net_device___2 *, struct ieee80211_txq_params *); + int (*libertas_set_mesh_channel)(struct wiphy *, struct net_device___2 *, struct ieee80211_channel *); int (*set_monitor_channel)(struct wiphy *, struct cfg80211_chan_def *); int (*scan)(struct wiphy *, struct cfg80211_scan_request *); void (*abort_scan)(struct wiphy *, struct wireless_dev *); - int (*auth)(struct wiphy *, struct net_device *, struct cfg80211_auth_request *); - int (*assoc)(struct wiphy *, struct net_device *, struct cfg80211_assoc_request *); - int (*deauth)(struct wiphy *, struct net_device *, struct cfg80211_deauth_request *); - int (*disassoc)(struct wiphy *, struct net_device *, struct cfg80211_disassoc_request *); - int (*connect)(struct wiphy *, struct net_device *, struct cfg80211_connect_params *); - int (*update_connect_params)(struct wiphy *, struct net_device *, struct cfg80211_connect_params *, u32); - int (*disconnect)(struct wiphy *, struct net_device *, u16); - int (*join_ibss)(struct wiphy *, struct net_device *, struct cfg80211_ibss_params *); - int (*leave_ibss)(struct wiphy *, struct net_device *); - int (*set_mcast_rate)(struct wiphy *, struct net_device *, int *); + int (*auth)(struct wiphy *, struct net_device___2 *, struct cfg80211_auth_request *); + int (*assoc)(struct wiphy *, struct net_device___2 *, struct cfg80211_assoc_request *); + int (*deauth)(struct wiphy *, struct net_device___2 *, struct cfg80211_deauth_request *); + int (*disassoc)(struct wiphy *, struct net_device___2 *, struct cfg80211_disassoc_request *); + int (*connect)(struct wiphy *, struct net_device___2 *, struct cfg80211_connect_params *); + int (*update_connect_params)(struct wiphy *, struct net_device___2 *, struct cfg80211_connect_params *, u32); + int (*disconnect)(struct wiphy *, struct net_device___2 *, u16); + int (*join_ibss)(struct wiphy *, struct net_device___2 *, struct cfg80211_ibss_params *); + int (*leave_ibss)(struct wiphy *, struct net_device___2 *); + int (*set_mcast_rate)(struct wiphy *, struct net_device___2 *, int *); int (*set_wiphy_params)(struct wiphy *, u32); int (*set_tx_power)(struct wiphy *, struct wireless_dev *, enum nl80211_tx_power_setting, int); int (*get_tx_power)(struct wiphy *, struct wireless_dev *, int *); - int (*set_wds_peer)(struct wiphy *, struct net_device *, const u8 *); + int (*set_wds_peer)(struct wiphy *, struct net_device___2 *, const u8 *); void (*rfkill_poll)(struct wiphy *); - int (*set_bitrate_mask)(struct wiphy *, struct net_device *, const u8 *, const struct cfg80211_bitrate_mask *); - int (*dump_survey)(struct wiphy *, struct net_device *, int, struct survey_info *); - int (*set_pmksa)(struct wiphy *, struct net_device *, struct cfg80211_pmksa *); - int (*del_pmksa)(struct wiphy *, struct net_device *, struct cfg80211_pmksa *); - int (*flush_pmksa)(struct wiphy *, struct net_device *); + int (*set_bitrate_mask)(struct wiphy *, struct net_device___2 *, const u8 *, const struct cfg80211_bitrate_mask *); + int (*dump_survey)(struct wiphy *, struct net_device___2 *, int, struct survey_info *); + int (*set_pmksa)(struct wiphy *, struct net_device___2 *, struct cfg80211_pmksa *); + int (*del_pmksa)(struct wiphy *, struct net_device___2 *, struct cfg80211_pmksa *); + int (*flush_pmksa)(struct wiphy *, struct net_device___2 *); int (*remain_on_channel)(struct wiphy *, struct wireless_dev *, struct ieee80211_channel *, unsigned int, u64 *); int (*cancel_remain_on_channel)(struct wiphy *, struct wireless_dev *, u64); int (*mgmt_tx)(struct wiphy *, struct wireless_dev *, struct cfg80211_mgmt_tx_params *, u64 *); int (*mgmt_tx_cancel_wait)(struct wiphy *, struct wireless_dev *, u64); - int (*set_power_mgmt)(struct wiphy *, struct net_device *, bool, int); - int (*set_cqm_rssi_config)(struct wiphy *, struct net_device *, s32, u32); - int (*set_cqm_rssi_range_config)(struct wiphy *, struct net_device *, s32, s32); - int (*set_cqm_txe_config)(struct wiphy *, struct net_device *, u32, u32, u32); + int (*set_power_mgmt)(struct wiphy *, struct net_device___2 *, bool, int); + int (*set_cqm_rssi_config)(struct wiphy *, struct net_device___2 *, s32, u32); + int (*set_cqm_rssi_range_config)(struct wiphy *, struct net_device___2 *, s32, s32); + int (*set_cqm_txe_config)(struct wiphy *, struct net_device___2 *, u32, u32, u32); void (*mgmt_frame_register)(struct wiphy *, struct wireless_dev *, u16, bool); int (*set_antenna)(struct wiphy *, u32, u32); int (*get_antenna)(struct wiphy *, u32 *, u32 *); - int (*sched_scan_start)(struct wiphy *, struct net_device *, struct cfg80211_sched_scan_request *); - int (*sched_scan_stop)(struct wiphy *, struct net_device *, u64); - int (*set_rekey_data)(struct wiphy *, struct net_device *, struct cfg80211_gtk_rekey_data *); - int (*tdls_mgmt)(struct wiphy *, struct net_device *, const u8 *, u8, u8, u16, u32, bool, const u8 *, size_t); - int (*tdls_oper)(struct wiphy *, struct net_device *, const u8 *, enum nl80211_tdls_operation); - int (*probe_client)(struct wiphy *, struct net_device *, const u8 *, u64 *); - int (*set_noack_map)(struct wiphy *, struct net_device *, u16); + int (*sched_scan_start)(struct wiphy *, struct net_device___2 *, struct cfg80211_sched_scan_request *); + int (*sched_scan_stop)(struct wiphy *, struct net_device___2 *, u64); + int (*set_rekey_data)(struct wiphy *, struct net_device___2 *, struct cfg80211_gtk_rekey_data *); + int (*tdls_mgmt)(struct wiphy *, struct net_device___2 *, const u8 *, u8, u8, u16, u32, bool, const u8 *, size_t); + int (*tdls_oper)(struct wiphy *, struct net_device___2 *, const u8 *, enum nl80211_tdls_operation); + int (*probe_client)(struct wiphy *, struct net_device___2 *, const u8 *, u64 *); + int (*set_noack_map)(struct wiphy *, struct net_device___2 *, u16); int (*get_channel)(struct wiphy *, struct wireless_dev *, struct cfg80211_chan_def *); int (*start_p2p_device)(struct wiphy *, struct wireless_dev *); void (*stop_p2p_device)(struct wiphy *, struct wireless_dev *); - int (*set_mac_acl)(struct wiphy *, struct net_device *, const struct cfg80211_acl_data *); - int (*start_radar_detection)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *, u32); - void (*end_cac)(struct wiphy *, struct net_device *); - int (*update_ft_ies)(struct wiphy *, struct net_device *, struct cfg80211_update_ft_ies_params *); + int (*set_mac_acl)(struct wiphy *, struct net_device___2 *, const struct cfg80211_acl_data *); + int (*start_radar_detection)(struct wiphy *, struct net_device___2 *, struct cfg80211_chan_def *, u32); + void (*end_cac)(struct wiphy *, struct net_device___2 *); + int (*update_ft_ies)(struct wiphy *, struct net_device___2 *, struct cfg80211_update_ft_ies_params *); int (*crit_proto_start)(struct wiphy *, struct wireless_dev *, enum nl80211_crit_proto_id, u16); void (*crit_proto_stop)(struct wiphy *, struct wireless_dev *); int (*set_coalesce)(struct wiphy *, struct cfg80211_coalesce *); - int (*channel_switch)(struct wiphy *, struct net_device *, struct cfg80211_csa_settings *); - int (*set_qos_map)(struct wiphy *, struct net_device *, struct cfg80211_qos_map *); - int (*set_ap_chanwidth)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *); - int (*add_tx_ts)(struct wiphy *, struct net_device *, u8, const u8 *, u8, u16); - int (*del_tx_ts)(struct wiphy *, struct net_device *, u8, const u8 *); - int (*tdls_channel_switch)(struct wiphy *, struct net_device *, const u8 *, u8, struct cfg80211_chan_def *); - void (*tdls_cancel_channel_switch)(struct wiphy *, struct net_device *, const u8 *); + int (*channel_switch)(struct wiphy *, struct net_device___2 *, struct cfg80211_csa_settings *); + int (*set_qos_map)(struct wiphy *, struct net_device___2 *, struct cfg80211_qos_map *); + int (*set_ap_chanwidth)(struct wiphy *, struct net_device___2 *, struct cfg80211_chan_def *); + int (*add_tx_ts)(struct wiphy *, struct net_device___2 *, u8, const u8 *, u8, u16); + int (*del_tx_ts)(struct wiphy *, struct net_device___2 *, u8, const u8 *); + int (*tdls_channel_switch)(struct wiphy *, struct net_device___2 *, const u8 *, u8, struct cfg80211_chan_def *); + void (*tdls_cancel_channel_switch)(struct wiphy *, struct net_device___2 *, const u8 *); int (*start_nan)(struct wiphy *, struct wireless_dev *, struct cfg80211_nan_conf *); void (*stop_nan)(struct wiphy *, struct wireless_dev *); int (*add_nan_func)(struct wiphy *, struct wireless_dev *, struct cfg80211_nan_func *); void (*del_nan_func)(struct wiphy *, struct wireless_dev *, u64); int (*nan_change_conf)(struct wiphy *, struct wireless_dev *, struct cfg80211_nan_conf *, u32); - int (*set_multicast_to_unicast)(struct wiphy *, struct net_device *, const bool); + int (*set_multicast_to_unicast)(struct wiphy *, struct net_device___2 *, const bool); int (*get_txq_stats)(struct wiphy *, struct wireless_dev *, struct cfg80211_txq_stats *); - int (*set_pmk)(struct wiphy *, struct net_device *, const struct cfg80211_pmk_conf *); - int (*del_pmk)(struct wiphy *, struct net_device *, const u8 *); - int (*external_auth)(struct wiphy *, struct net_device *, struct cfg80211_external_auth_params *); - int (*tx_control_port)(struct wiphy *, struct net_device *, const u8 *, size_t, const u8 *, const __be16, const bool); - int (*get_ftm_responder_stats)(struct wiphy *, struct net_device *, struct cfg80211_ftm_responder_stats *); + int (*set_pmk)(struct wiphy *, struct net_device___2 *, const struct cfg80211_pmk_conf *); + int (*del_pmk)(struct wiphy *, struct net_device___2 *, const u8 *); + int (*external_auth)(struct wiphy *, struct net_device___2 *, struct cfg80211_external_auth_params *); + int (*tx_control_port)(struct wiphy *, struct net_device___2 *, const u8 *, size_t, const u8 *, const __be16, const bool); + int (*get_ftm_responder_stats)(struct wiphy *, struct net_device___2 *, struct cfg80211_ftm_responder_stats *); int (*start_pmsr)(struct wiphy *, struct wireless_dev *, struct cfg80211_pmsr_request *); void (*abort_pmsr)(struct wiphy *, struct wireless_dev *, struct cfg80211_pmsr_request *); - int (*update_owe_info)(struct wiphy *, struct net_device *, struct cfg80211_update_owe_info *); - int (*probe_mesh_link)(struct wiphy *, struct net_device *, const u8 *, size_t); + int (*update_owe_info)(struct wiphy *, struct net_device___2 *, struct cfg80211_update_owe_info *); + int (*probe_mesh_link)(struct wiphy *, struct net_device___2 *, const u8 *, size_t); }; enum wiphy_flags { @@ -113442,7 +117906,7 @@ struct wiphy_vendor_command { struct nl80211_vendor_cmd_info info; u32 flags; int (*doit)(struct wiphy *, struct wireless_dev *, const void *, int); - int (*dumpit)(struct wiphy *, struct wireless_dev *, struct sk_buff *, const void *, int, long unsigned int *); + int (*dumpit)(struct wiphy *, struct wireless_dev *, struct sk_buff___2 *, const void *, int, long unsigned int *); const struct nla_policy *policy; unsigned int maxattr; }; @@ -113558,7 +118022,7 @@ struct cfg80211_registered_device { u32 bss_generation; u32 bss_entries; struct cfg80211_scan_request *scan_req; - struct sk_buff *scan_msg; + struct sk_buff___2 *scan_msg; struct list_head sched_scan_req_list; time64_t suspend_at; struct work_struct scan_done_wk; @@ -113615,6 +118079,86 @@ struct cfg80211_beacon_registration { u32 nlportid; }; +struct iw_param { + __s32 value; + __u8 fixed; + __u8 disabled; + __u16 flags; +}; + +struct iw_point { + void *pointer; + __u16 length; + __u16 flags; +}; + +struct iw_freq { + __s32 m; + __s16 e; + __u8 i; + __u8 flags; +}; + +struct iw_quality { + __u8 qual; + __u8 level; + __u8 noise; + __u8 updated; +}; + +struct iw_discarded { + __u32 nwid; + __u32 code; + __u32 fragment; + __u32 retries; + __u32 misc; +}; + +struct iw_missed { + __u32 beacon; +}; + +struct iw_statistics { + __u16 status; + struct iw_quality qual; + struct iw_discarded discard; + struct iw_missed miss; +}; + +union iwreq_data { + char name[16]; + struct iw_point essid; + struct iw_param nwid; + struct iw_freq freq; + struct iw_param sens; + struct iw_param bitrate; + struct iw_param txpower; + struct iw_param rts; + struct iw_param frag; + __u32 mode; + struct iw_param retry; + struct iw_point encoding; + struct iw_param power; + struct iw_quality qual; + struct sockaddr ap_addr; + struct sockaddr addr; + struct iw_param param; + struct iw_point data; +}; + +struct iw_request_info { + __u16 cmd; + __u16 flags; +}; + +typedef int (*iw_handler)(struct net_device___2 *, struct iw_request_info *, union iwreq_data *, char *); + +struct iw_handler_def { + const iw_handler *standard; + __u16 num_standard; + struct iw_statistics * (*get_wireless_stats)(struct net_device___2 *); +}; + struct radiotap_align_size { uint8_t align: 4; uint8_t size: 4; @@ -114109,6 +118653,12 @@ struct fwdb_country { __be16 coll_ptr; }; +struct fwdb_header { + __be32 magic; + __be32 version; + struct fwdb_country country[0]; +}; + struct fwdb_collection { u8 len; u8 n_rules; @@ -114146,12 +118696,6 @@ struct fwdb_rule { __be16 wmm_ptr; }; -struct fwdb_header { - __be32 magic; - __be32 version; - struct fwdb_country country[0]; -}; - enum nl80211_scan_flags { NL80211_SCAN_FLAG_LOW_PRIORITY = 1, NL80211_SCAN_FLAG_FLUSH = 2, @@ -117233,7 +121777,343 @@ struct trace_event_data_offsets_cfg80211_update_owe_info_event { struct trace_event_data_offsets_rdev_probe_mesh_link {}; -typedef int (*sk_read_actor_t___2)(read_descriptor_t *, struct sk_buff___2 *, unsigned int, size_t); +typedef void (*btf_trace_rdev_suspend)(void *, struct wiphy *, struct cfg80211_wowlan *); + +typedef void (*btf_trace_rdev_return_int)(void *, struct wiphy *, int); + +typedef void (*btf_trace_rdev_scan)(void *, struct wiphy *, struct cfg80211_scan_request *); + +typedef void (*btf_trace_rdev_resume)(void *, struct wiphy *); + +typedef void (*btf_trace_rdev_return_void)(void *, struct wiphy *); + +typedef void (*btf_trace_rdev_get_antenna)(void *, struct wiphy *); + +typedef void (*btf_trace_rdev_rfkill_poll)(void *, struct wiphy *); + +typedef void (*btf_trace_rdev_set_wakeup)(void *, struct wiphy *, bool); + +typedef void (*btf_trace_rdev_add_virtual_intf)(void *, struct wiphy *, char *, enum nl80211_iftype); + +typedef void (*btf_trace_rdev_return_wdev)(void *, struct wiphy *, struct wireless_dev *); + +typedef void (*btf_trace_rdev_del_virtual_intf)(void *, struct wiphy *, struct wireless_dev *); + +typedef void (*btf_trace_rdev_change_virtual_intf)(void *, struct wiphy *, struct net_device___2 *, enum nl80211_iftype); + +typedef void (*btf_trace_rdev_get_key)(void *, struct wiphy *, struct net_device___2 *, u8, bool, const u8 *); + +typedef void (*btf_trace_rdev_del_key)(void *, struct wiphy *, struct net_device___2 *, u8, bool, const u8 *); + +typedef void (*btf_trace_rdev_add_key)(void *, struct wiphy *, struct net_device___2 *, u8, bool, const u8 *, u8); + +typedef void (*btf_trace_rdev_set_default_key)(void *, struct wiphy *, struct net_device___2 *, u8, bool, bool); + +typedef void (*btf_trace_rdev_set_default_mgmt_key)(void *, struct wiphy *, struct net_device___2 *, u8); + +typedef void (*btf_trace_rdev_start_ap)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_ap_settings *); + +typedef void (*btf_trace_rdev_change_beacon)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_beacon_data *); + +typedef void (*btf_trace_rdev_stop_ap)(void *, struct wiphy *, struct net_device___2 *); + +typedef void (*btf_trace_rdev_set_rekey_data)(void *, struct wiphy *, struct net_device___2 *); + +typedef void (*btf_trace_rdev_get_mesh_config)(void *, struct wiphy *, struct net_device___2 *); + +typedef void (*btf_trace_rdev_leave_mesh)(void *, struct wiphy *, struct net_device___2 *); + +typedef void (*btf_trace_rdev_leave_ibss)(void *, struct wiphy *, struct net_device___2 *); + +typedef void (*btf_trace_rdev_leave_ocb)(void *, struct wiphy *, struct net_device___2 *); + +typedef void (*btf_trace_rdev_flush_pmksa)(void *, struct wiphy *, struct net_device___2 *); + +typedef void (*btf_trace_rdev_end_cac)(void *, struct wiphy *, struct net_device___2 *); + +typedef void (*btf_trace_rdev_add_station)(void *, struct wiphy *, struct net_device___2 *, u8 *, struct station_parameters *); + +typedef void (*btf_trace_rdev_change_station)(void *, struct wiphy *, struct net_device___2 *, u8 *, struct station_parameters *); + +typedef void (*btf_trace_rdev_del_station)(void *, struct wiphy *, struct net_device___2 *, struct station_del_parameters *); + +typedef void (*btf_trace_rdev_get_station)(void *, struct wiphy *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_rdev_del_mpath)(void *, struct wiphy *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_rdev_set_wds_peer)(void *, struct wiphy *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_rdev_dump_station)(void *, struct wiphy *, struct net_device___2 *, int, u8 *); + +typedef void (*btf_trace_rdev_return_int_station_info)(void *, struct wiphy *, int, struct station_info *); + +typedef void (*btf_trace_rdev_add_mpath)(void *, struct wiphy *, struct net_device___2 *, u8 *, u8 *); + +typedef void (*btf_trace_rdev_change_mpath)(void *, struct wiphy *, struct net_device___2 *, u8 *, u8 *); + +typedef void (*btf_trace_rdev_get_mpath)(void *, struct wiphy *, struct net_device___2 *, u8 *, u8 *); + +typedef void (*btf_trace_rdev_dump_mpath)(void *, struct wiphy *, struct net_device___2 *, int, u8 *, u8 *); + +typedef void (*btf_trace_rdev_get_mpp)(void *, struct wiphy *, struct net_device___2 *, u8 *, u8 *); + +typedef void (*btf_trace_rdev_dump_mpp)(void *, struct wiphy *, struct net_device___2 *, int, u8 *, u8 *); + +typedef void (*btf_trace_rdev_return_int_mpath_info)(void *, struct wiphy *, int, struct mpath_info *); + +typedef void (*btf_trace_rdev_return_int_mesh_config)(void *, struct wiphy *, int, struct mesh_config *); + +typedef void (*btf_trace_rdev_update_mesh_config)(void *, struct wiphy *, struct net_device___2 *, u32, const struct mesh_config *); + +typedef void (*btf_trace_rdev_join_mesh)(void *, struct wiphy *, struct net_device___2 *, const struct mesh_config *, const struct mesh_setup *); + +typedef void (*btf_trace_rdev_change_bss)(void *, struct wiphy *, struct net_device___2 *, struct bss_parameters *); + +typedef void (*btf_trace_rdev_set_txq_params)(void *, struct wiphy *, struct net_device___2 *, struct ieee80211_txq_params *); + +typedef void (*btf_trace_rdev_libertas_set_mesh_channel)(void *, struct wiphy *, struct net_device___2 *, struct ieee80211_channel *); + +typedef void (*btf_trace_rdev_set_monitor_channel)(void *, struct wiphy *, struct cfg80211_chan_def *); + +typedef void (*btf_trace_rdev_auth)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_auth_request *); + +typedef void (*btf_trace_rdev_assoc)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_assoc_request *); + +typedef void (*btf_trace_rdev_deauth)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_deauth_request *); + +typedef void (*btf_trace_rdev_disassoc)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_disassoc_request *); + +typedef void (*btf_trace_rdev_mgmt_tx_cancel_wait)(void *, struct wiphy *, struct wireless_dev *, u64); + +typedef void (*btf_trace_rdev_set_power_mgmt)(void *, struct wiphy *, struct net_device___2 *, bool, int); + +typedef void (*btf_trace_rdev_connect)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_connect_params *); + +typedef void (*btf_trace_rdev_update_connect_params)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_connect_params *, u32); + +typedef void (*btf_trace_rdev_set_cqm_rssi_config)(void *, struct wiphy *, struct net_device___2 *, s32, u32); + +typedef void (*btf_trace_rdev_set_cqm_rssi_range_config)(void *, struct wiphy *, struct net_device___2 *, s32, s32); + +typedef void (*btf_trace_rdev_set_cqm_txe_config)(void *, struct wiphy *, struct net_device___2 *, u32, u32, u32); + +typedef void (*btf_trace_rdev_disconnect)(void *, struct wiphy *, struct net_device___2 *, u16); + +typedef void (*btf_trace_rdev_join_ibss)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_ibss_params *); + +typedef void (*btf_trace_rdev_join_ocb)(void *, struct wiphy *, struct net_device___2 *, const struct ocb_setup *); + +typedef void (*btf_trace_rdev_set_wiphy_params)(void *, struct wiphy *, u32); + +typedef void (*btf_trace_rdev_get_tx_power)(void *, struct wiphy *, struct wireless_dev *); + +typedef void (*btf_trace_rdev_set_tx_power)(void *, struct wiphy *, struct wireless_dev *, enum nl80211_tx_power_setting, int); + +typedef void (*btf_trace_rdev_return_int_int)(void *, struct wiphy *, int, int); + +typedef void (*btf_trace_rdev_set_bitrate_mask)(void *, struct wiphy *, struct net_device___2 *, const u8 *, const struct cfg80211_bitrate_mask *); + +typedef void (*btf_trace_rdev_mgmt_frame_register)(void *, struct wiphy *, struct wireless_dev *, u16, bool); + +typedef void (*btf_trace_rdev_return_int_tx_rx)(void *, struct wiphy *, int, u32, u32); + +typedef void (*btf_trace_rdev_return_void_tx_rx)(void *, struct wiphy *, u32, u32, u32, u32); + +typedef void (*btf_trace_rdev_set_antenna)(void *, struct wiphy *, u32, u32); + +typedef void (*btf_trace_rdev_sched_scan_start)(void *, struct wiphy *, struct net_device___2 *, u64); + +typedef void (*btf_trace_rdev_sched_scan_stop)(void *, struct wiphy *, struct net_device___2 *, u64); + +typedef void (*btf_trace_rdev_tdls_mgmt)(void *, struct wiphy *, struct net_device___2 *, u8 *, u8, u8, u16, u32, bool, const u8 *, size_t); + +typedef void (*btf_trace_rdev_dump_survey)(void *, struct wiphy *, struct net_device___2 *, int); + +typedef void (*btf_trace_rdev_return_int_survey_info)(void *, struct wiphy *, int, struct survey_info *); + +typedef void (*btf_trace_rdev_tdls_oper)(void *, struct wiphy *, struct net_device___2 *, u8 *, enum nl80211_tdls_operation); + +typedef void (*btf_trace_rdev_probe_client)(void *, struct wiphy *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_rdev_set_pmksa)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_pmksa *); + +typedef void (*btf_trace_rdev_del_pmksa)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_pmksa *); + +typedef void (*btf_trace_rdev_remain_on_channel)(void *, struct wiphy *, struct wireless_dev *, struct ieee80211_channel *, unsigned int); + +typedef void (*btf_trace_rdev_return_int_cookie)(void *, struct wiphy *, int, u64); + +typedef void (*btf_trace_rdev_cancel_remain_on_channel)(void *, struct wiphy *, struct wireless_dev *, u64); + +typedef void (*btf_trace_rdev_mgmt_tx)(void *, struct wiphy *, struct wireless_dev *, struct cfg80211_mgmt_tx_params *); + +typedef void (*btf_trace_rdev_tx_control_port)(void *, struct wiphy *, struct net_device___2 *, const u8 *, size_t, const u8 *, __be16, bool); + +typedef void (*btf_trace_rdev_set_noack_map)(void *, struct wiphy *, struct net_device___2 *, u16); + +typedef void (*btf_trace_rdev_get_channel)(void *, struct wiphy *, struct wireless_dev *); + +typedef void (*btf_trace_rdev_return_chandef)(void *, struct wiphy *, int, struct cfg80211_chan_def *); + +typedef void (*btf_trace_rdev_start_p2p_device)(void *, struct wiphy *, struct wireless_dev *); + +typedef void (*btf_trace_rdev_stop_p2p_device)(void *, struct wiphy *, struct wireless_dev *); + +typedef void (*btf_trace_rdev_start_nan)(void *, struct wiphy *, struct wireless_dev *, struct cfg80211_nan_conf *); + +typedef void (*btf_trace_rdev_nan_change_conf)(void *, struct wiphy *, struct wireless_dev *, struct cfg80211_nan_conf *, u32); + +typedef void (*btf_trace_rdev_stop_nan)(void *, struct wiphy *, struct wireless_dev *); + +typedef void (*btf_trace_rdev_add_nan_func)(void *, struct wiphy *, struct wireless_dev *, const struct cfg80211_nan_func *); + +typedef void (*btf_trace_rdev_del_nan_func)(void *, struct wiphy *, struct wireless_dev *, u64); + +typedef void (*btf_trace_rdev_set_mac_acl)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_acl_data *); + +typedef void (*btf_trace_rdev_update_ft_ies)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_update_ft_ies_params *); + +typedef void (*btf_trace_rdev_crit_proto_start)(void *, struct wiphy *, struct wireless_dev *, enum nl80211_crit_proto_id, u16); + +typedef void (*btf_trace_rdev_crit_proto_stop)(void *, struct wiphy *, struct wireless_dev *); + +typedef void (*btf_trace_rdev_channel_switch)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_csa_settings *); + +typedef void (*btf_trace_rdev_set_qos_map)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_qos_map *); + +typedef void (*btf_trace_rdev_set_ap_chanwidth)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_chan_def *); + +typedef void (*btf_trace_rdev_add_tx_ts)(void *, struct wiphy *, struct net_device___2 *, u8, const u8 *, u8, u16); + +typedef void (*btf_trace_rdev_del_tx_ts)(void *, struct wiphy *, struct net_device___2 *, u8, const u8 *); + +typedef void (*btf_trace_rdev_tdls_channel_switch)(void *, struct wiphy *, struct net_device___2 *, const u8 *, u8, struct cfg80211_chan_def *); + +typedef void (*btf_trace_rdev_tdls_cancel_channel_switch)(void *, struct wiphy *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_rdev_set_pmk)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_pmk_conf *); + +typedef void (*btf_trace_rdev_del_pmk)(void *, struct wiphy *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_rdev_external_auth)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_external_auth_params *); + +typedef void (*btf_trace_rdev_start_radar_detection)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_chan_def *, u32); + +typedef void (*btf_trace_rdev_set_mcast_rate)(void *, struct wiphy *, struct net_device___2 *, int *); + +typedef void (*btf_trace_rdev_set_coalesce)(void *, struct wiphy *, struct cfg80211_coalesce *); + +typedef void (*btf_trace_rdev_abort_scan)(void *, struct wiphy *, struct wireless_dev *); + +typedef void (*btf_trace_rdev_set_multicast_to_unicast)(void *, struct wiphy *, struct net_device___2 *, const bool); + +typedef void (*btf_trace_rdev_get_txq_stats)(void *, struct wiphy *, struct wireless_dev *); + +typedef void (*btf_trace_rdev_get_ftm_responder_stats)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_ftm_responder_stats *); + +typedef void (*btf_trace_rdev_start_pmsr)(void *, struct wiphy *, struct wireless_dev *, u64); + +typedef void (*btf_trace_rdev_abort_pmsr)(void *, struct wiphy *, struct wireless_dev *, u64); + +typedef void (*btf_trace_cfg80211_return_bool)(void *, bool); + +typedef void (*btf_trace_cfg80211_notify_new_peer_candidate)(void *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_cfg80211_send_rx_auth)(void *, struct net_device___2 *); + +typedef void (*btf_trace_cfg80211_send_rx_assoc)(void *, struct net_device___2 *, struct cfg80211_bss *); + +typedef void (*btf_trace_cfg80211_rx_unprot_mlme_mgmt)(void *, struct net_device___2 *, const u8 *, int); + +typedef void (*btf_trace_cfg80211_rx_mlme_mgmt)(void *, struct net_device___2 *, const u8 *, int); + +typedef void (*btf_trace_cfg80211_tx_mlme_mgmt)(void *, struct net_device___2 *, const u8 *, int); + +typedef void (*btf_trace_cfg80211_send_auth_timeout)(void *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_cfg80211_send_assoc_timeout)(void *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_cfg80211_michael_mic_failure)(void *, struct net_device___2 *, const u8 *, enum nl80211_key_type, int, const u8 *); + +typedef void (*btf_trace_cfg80211_ready_on_channel)(void *, struct wireless_dev *, u64, struct ieee80211_channel *, unsigned int); + +typedef void (*btf_trace_cfg80211_ready_on_channel_expired)(void *, struct wireless_dev *, u64, struct ieee80211_channel *); + +typedef void (*btf_trace_cfg80211_tx_mgmt_expired)(void *, struct wireless_dev *, u64, struct ieee80211_channel *); + +typedef void (*btf_trace_cfg80211_new_sta)(void *, struct net_device___2 *, const u8 *, struct station_info *); + +typedef void (*btf_trace_cfg80211_del_sta)(void *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_cfg80211_rx_mgmt)(void *, struct wireless_dev *, int, int); + +typedef void (*btf_trace_cfg80211_mgmt_tx_status)(void *, struct wireless_dev *, u64, bool); + +typedef void (*btf_trace_cfg80211_rx_control_port)(void *, struct net_device___2 *, struct sk_buff___2 *, bool); + +typedef void (*btf_trace_cfg80211_cqm_rssi_notify)(void *, struct net_device___2 *, enum nl80211_cqm_rssi_threshold_event, s32); + +typedef void (*btf_trace_cfg80211_reg_can_beacon)(void *, struct wiphy *, struct cfg80211_chan_def *, enum nl80211_iftype, bool); + +typedef void (*btf_trace_cfg80211_chandef_dfs_required)(void *, struct wiphy *, struct cfg80211_chan_def *); + +typedef void (*btf_trace_cfg80211_ch_switch_notify)(void *, struct net_device___2 *, struct cfg80211_chan_def *); + +typedef void (*btf_trace_cfg80211_ch_switch_started_notify)(void *, struct net_device___2 *, struct cfg80211_chan_def *); + +typedef void (*btf_trace_cfg80211_radar_event)(void *, struct wiphy *, struct cfg80211_chan_def *); + +typedef void (*btf_trace_cfg80211_cac_event)(void *, struct net_device___2 *, enum nl80211_radar_event); + +typedef void (*btf_trace_cfg80211_rx_spurious_frame)(void *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_cfg80211_rx_unexpected_4addr_frame)(void *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_cfg80211_ibss_joined)(void *, struct net_device___2 *, const u8 *, struct ieee80211_channel *); + +typedef void (*btf_trace_cfg80211_probe_status)(void *, struct net_device___2 *, const u8 *, u64, bool); + +typedef void (*btf_trace_cfg80211_cqm_pktloss_notify)(void *, struct net_device___2 *, const u8 *, u32); + +typedef void (*btf_trace_cfg80211_gtk_rekey_notify)(void *, struct net_device___2 *, const u8 *); + +typedef void (*btf_trace_cfg80211_pmksa_candidate_notify)(void *, struct net_device___2 *, int, const u8 *, bool); + +typedef void (*btf_trace_cfg80211_report_obss_beacon)(void *, struct wiphy *, const u8 *, size_t, int, int); + +typedef void (*btf_trace_cfg80211_tdls_oper_request)(void *, struct wiphy *, struct net_device___2 *, const u8 *, enum nl80211_tdls_operation, u16); + +typedef void (*btf_trace_cfg80211_scan_done)(void *, struct cfg80211_scan_request *, struct cfg80211_scan_info *); + +typedef void (*btf_trace_cfg80211_sched_scan_stopped)(void *, struct wiphy *, u64); + +typedef void (*btf_trace_cfg80211_sched_scan_results)(void *, struct wiphy *, u64); + +typedef void (*btf_trace_cfg80211_get_bss)(void *, struct wiphy *, struct ieee80211_channel *, const u8 *, const u8 *, size_t, enum ieee80211_bss_type, enum ieee80211_privacy); + +typedef void (*btf_trace_cfg80211_inform_bss_frame)(void *, struct wiphy *, struct cfg80211_inform_bss *, struct ieee80211_mgmt *, size_t); + +typedef void (*btf_trace_cfg80211_return_bss)(void *, struct cfg80211_bss *); + +typedef void (*btf_trace_cfg80211_return_uint)(void *, unsigned int); + +typedef void (*btf_trace_cfg80211_return_u32)(void *, u32); + +typedef void (*btf_trace_cfg80211_report_wowlan_wakeup)(void *, struct wiphy *, struct wireless_dev *, struct cfg80211_wowlan_wakeup *); + +typedef void (*btf_trace_cfg80211_ft_event)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_ft_event_params *); + +typedef void (*btf_trace_cfg80211_stop_iface)(void *, struct wiphy *, struct wireless_dev *); + +typedef void (*btf_trace_cfg80211_pmsr_report)(void *, struct wiphy *, struct wireless_dev *, u64, const u8 *); + +typedef void (*btf_trace_cfg80211_pmsr_complete)(void *, struct wiphy *, struct wireless_dev *, u64); + +typedef void (*btf_trace_rdev_update_owe_info)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_update_owe_info *); + +typedef void (*btf_trace_cfg80211_update_owe_info_event)(void *, struct wiphy *, struct net_device___2 *, struct cfg80211_update_owe_info *); + +typedef void (*btf_trace_rdev_probe_mesh_link)(void *, struct wiphy *, struct net_device___2 *, const u8 *, const u8 *, size_t); enum nl80211_peer_measurement_status { NL80211_PMSR_STATUS_SUCCESS = 0, @@ -119355,8 +124235,6 @@ enum { SCAN_HW_CANCELLED = 5, }; -typedef struct bio_vec___2 skb_frag_t___2; - struct ieee80211_bar { __le16 frame_control; __le16 duration; @@ -119552,7 +124430,7 @@ enum mac80211_tx_info_flags { IEEE80211_TX_STATUS_EOSP = 268435456, IEEE80211_TX_CTL_USE_MINRATE = 536870912, IEEE80211_TX_CTL_DONTFRAG = 1073741824, - IEEE80211_TX_STAT_NOACK_TRANSMITTED = -2147483648, + IEEE80211_TX_STAT_NOACK_TRANSMITTED = 2147483648, }; enum mac80211_rate_control_flags { @@ -119790,9 +124668,9 @@ enum ieee80211_internal_key_flags { enum { TKIP_DECRYPT_OK = 0, - TKIP_DECRYPT_NO_EXT_IV = -1, - TKIP_DECRYPT_INVALID_KEYIDX = -2, - TKIP_DECRYPT_REPLAY = -3, + TKIP_DECRYPT_NO_EXT_IV = 4294967295, + TKIP_DECRYPT_INVALID_KEYIDX = 4294967294, + TKIP_DECRYPT_REPLAY = 4294967293, }; enum mac80211_rx_encoding { @@ -121503,6 +126381,258 @@ struct trace_event_data_offsets_drv_get_ftm_responder_stats { u32 vif_name; }; +typedef void (*btf_trace_drv_return_void)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_drv_return_int)(void *, struct ieee80211_local *, int); + +typedef void (*btf_trace_drv_return_bool)(void *, struct ieee80211_local *, bool); + +typedef void (*btf_trace_drv_return_u32)(void *, struct ieee80211_local *, u32); + +typedef void (*btf_trace_drv_return_u64)(void *, struct ieee80211_local *, u64); + +typedef void (*btf_trace_drv_start)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_drv_get_et_strings)(void *, struct ieee80211_local *, u32); + +typedef void (*btf_trace_drv_get_et_sset_count)(void *, struct ieee80211_local *, u32); + +typedef void (*btf_trace_drv_get_et_stats)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_drv_suspend)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_drv_resume)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_drv_set_wakeup)(void *, struct ieee80211_local *, bool); + +typedef void (*btf_trace_drv_stop)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_drv_add_interface)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_change_interface)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, enum nl80211_iftype, bool); + +typedef void (*btf_trace_drv_remove_interface)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_config)(void *, struct ieee80211_local *, u32); + +typedef void (*btf_trace_drv_bss_info_changed)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_bss_conf *, u32); + +typedef void (*btf_trace_drv_prepare_multicast)(void *, struct ieee80211_local *, int); + +typedef void (*btf_trace_drv_configure_filter)(void *, struct ieee80211_local *, unsigned int, unsigned int *, u64); + +typedef void (*btf_trace_drv_config_iface_filter)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, unsigned int, unsigned int); + +typedef void (*btf_trace_drv_set_tim)(void *, struct ieee80211_local *, struct ieee80211_sta *, bool); + +typedef void (*btf_trace_drv_set_key)(void *, struct ieee80211_local *, enum set_key_cmd, struct ieee80211_sub_if_data *, struct ieee80211_sta *, struct ieee80211_key_conf *); + +typedef void (*btf_trace_drv_update_tkip_key)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_key_conf *, struct ieee80211_sta *, u32); + +typedef void (*btf_trace_drv_hw_scan)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_cancel_hw_scan)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_sched_scan_start)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_sched_scan_stop)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_sw_scan_start)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, const u8 *); + +typedef void (*btf_trace_drv_sw_scan_complete)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_get_stats)(void *, struct ieee80211_local *, struct ieee80211_low_level_stats *, int); + +typedef void (*btf_trace_drv_get_key_seq)(void *, struct ieee80211_local *, struct ieee80211_key_conf *); + +typedef void (*btf_trace_drv_set_frag_threshold)(void *, struct ieee80211_local *, u32); + +typedef void (*btf_trace_drv_set_rts_threshold)(void *, struct ieee80211_local *, u32); + +typedef void (*btf_trace_drv_set_coverage_class)(void *, struct ieee80211_local *, s16); + +typedef void (*btf_trace_drv_sta_notify)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, enum sta_notify_cmd, struct ieee80211_sta *); + +typedef void (*btf_trace_drv_sta_state)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_sta *, enum ieee80211_sta_state, enum ieee80211_sta_state); + +typedef void (*btf_trace_drv_sta_set_txpwr)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_sta *); + +typedef void (*btf_trace_drv_sta_rc_update)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_sta *, u32); + +typedef void (*btf_trace_drv_sta_statistics)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_sta *); + +typedef void (*btf_trace_drv_sta_add)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_sta *); + +typedef void (*btf_trace_drv_sta_remove)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_sta *); + +typedef void (*btf_trace_drv_sta_pre_rcu_remove)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_sta *); + +typedef void (*btf_trace_drv_sync_rx_queues)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_sta *); + +typedef void (*btf_trace_drv_sta_rate_tbl_update)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_sta *); + +typedef void (*btf_trace_drv_conf_tx)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, u16, const struct ieee80211_tx_queue_params *); + +typedef void (*btf_trace_drv_get_tsf)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_set_tsf)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, u64); + +typedef void (*btf_trace_drv_offset_tsf)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, s64); + +typedef void (*btf_trace_drv_reset_tsf)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_tx_last_beacon)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_drv_ampdu_action)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_ampdu_params *); + +typedef void (*btf_trace_drv_get_survey)(void *, struct ieee80211_local *, int, struct survey_info *); + +typedef void (*btf_trace_drv_flush)(void *, struct ieee80211_local *, u32, bool); + +typedef void (*btf_trace_drv_channel_switch)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_channel_switch *); + +typedef void (*btf_trace_drv_set_antenna)(void *, struct ieee80211_local *, u32, u32, int); + +typedef void (*btf_trace_drv_get_antenna)(void *, struct ieee80211_local *, u32, u32, int); + +typedef void (*btf_trace_drv_remain_on_channel)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_channel *, unsigned int, enum ieee80211_roc_type); + +typedef void (*btf_trace_drv_cancel_remain_on_channel)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_set_ringparam)(void *, struct ieee80211_local *, u32, u32); + +typedef void (*btf_trace_drv_get_ringparam)(void *, struct ieee80211_local *, u32 *, u32 *, u32 *, u32 *); + +typedef void (*btf_trace_drv_tx_frames_pending)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_drv_offchannel_tx_cancel_wait)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_drv_set_bitrate_mask)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, const struct cfg80211_bitrate_mask *); + +typedef void (*btf_trace_drv_set_rekey_data)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct cfg80211_gtk_rekey_data *); + +typedef void (*btf_trace_drv_event_callback)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, const struct ieee80211_event *); + +typedef void (*btf_trace_drv_release_buffered_frames)(void *, struct ieee80211_local *, struct ieee80211_sta *, u16, int, enum ieee80211_frame_release_type, bool); + +typedef void (*btf_trace_drv_allow_buffered_frames)(void *, struct ieee80211_local *, struct ieee80211_sta *, u16, int, enum ieee80211_frame_release_type, bool); + +typedef void (*btf_trace_drv_mgd_prepare_tx)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, u16); + +typedef void (*btf_trace_drv_mgd_protect_tdls_discover)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_add_chanctx)(void *, struct ieee80211_local *, struct ieee80211_chanctx *); + +typedef void (*btf_trace_drv_remove_chanctx)(void *, struct ieee80211_local *, struct ieee80211_chanctx *); + +typedef void (*btf_trace_drv_change_chanctx)(void *, struct ieee80211_local *, struct ieee80211_chanctx *, u32); + +typedef void (*btf_trace_drv_switch_vif_chanctx)(void *, struct ieee80211_local *, struct ieee80211_vif_chanctx_switch *, int, enum ieee80211_chanctx_switch_mode); + +typedef void (*btf_trace_drv_assign_vif_chanctx)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_chanctx *); + +typedef void (*btf_trace_drv_unassign_vif_chanctx)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_chanctx *); + +typedef void (*btf_trace_drv_start_ap)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_bss_conf *); + +typedef void (*btf_trace_drv_stop_ap)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_reconfig_complete)(void *, struct ieee80211_local *, enum ieee80211_reconfig_type); + +typedef void (*btf_trace_drv_ipv6_addr_change)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_join_ibss)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_bss_conf *); + +typedef void (*btf_trace_drv_leave_ibss)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_get_expected_throughput)(void *, struct ieee80211_sta *); + +typedef void (*btf_trace_drv_start_nan)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct cfg80211_nan_conf *); + +typedef void (*btf_trace_drv_stop_nan)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_nan_change_conf)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct cfg80211_nan_conf *, u32); + +typedef void (*btf_trace_drv_add_nan_func)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, const struct cfg80211_nan_func *); + +typedef void (*btf_trace_drv_del_nan_func)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, u8); + +typedef void (*btf_trace_drv_start_pmsr)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_abort_pmsr)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_api_start_tx_ba_session)(void *, struct ieee80211_sta *, u16); + +typedef void (*btf_trace_api_start_tx_ba_cb)(void *, struct ieee80211_sub_if_data *, const u8 *, u16); + +typedef void (*btf_trace_api_stop_tx_ba_session)(void *, struct ieee80211_sta *, u16); + +typedef void (*btf_trace_api_stop_tx_ba_cb)(void *, struct ieee80211_sub_if_data *, const u8 *, u16); + +typedef void (*btf_trace_api_restart_hw)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_api_beacon_loss)(void *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_api_connection_loss)(void *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_api_cqm_rssi_notify)(void *, struct ieee80211_sub_if_data *, enum nl80211_cqm_rssi_threshold_event, s32); + +typedef void (*btf_trace_api_cqm_beacon_loss_notify)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_api_scan_completed)(void *, struct ieee80211_local *, bool); + +typedef void (*btf_trace_api_sched_scan_results)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_api_sched_scan_stopped)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_api_sta_block_awake)(void *, struct ieee80211_local *, struct ieee80211_sta *, bool); + +typedef void (*btf_trace_api_chswitch_done)(void *, struct ieee80211_sub_if_data *, bool); + +typedef void (*btf_trace_api_ready_on_channel)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_api_remain_on_channel_expired)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_api_gtk_rekey_notify)(void *, struct ieee80211_sub_if_data *, const u8 *, const u8 *); + +typedef void (*btf_trace_api_enable_rssi_reports)(void *, struct ieee80211_sub_if_data *, int, int); + +typedef void (*btf_trace_api_eosp)(void *, struct ieee80211_local *, struct ieee80211_sta *); + +typedef void (*btf_trace_api_send_eosp_nullfunc)(void *, struct ieee80211_local *, struct ieee80211_sta *, u8); + +typedef void (*btf_trace_api_sta_set_buffered)(void *, struct ieee80211_local *, struct ieee80211_sta *, u8, bool); + +typedef void (*btf_trace_wake_queue)(void *, struct ieee80211_local *, u16, enum queue_stop_reason); + +typedef void (*btf_trace_stop_queue)(void *, struct ieee80211_local *, u16, enum queue_stop_reason); + +typedef void (*btf_trace_drv_set_default_unicast_key)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, int); + +typedef void (*btf_trace_api_radar_detected)(void *, struct ieee80211_local *); + +typedef void (*btf_trace_drv_channel_switch_beacon)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct cfg80211_chan_def *); + +typedef void (*btf_trace_drv_pre_channel_switch)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_channel_switch *); + +typedef void (*btf_trace_drv_post_channel_switch)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_abort_channel_switch)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *); + +typedef void (*btf_trace_drv_channel_switch_rx_beacon)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_channel_switch *); + +typedef void (*btf_trace_drv_get_txpower)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, int, int); + +typedef void (*btf_trace_drv_tdls_channel_switch)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_sta *, u8, struct cfg80211_chan_def *); + +typedef void (*btf_trace_drv_tdls_cancel_channel_switch)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_sta *); + +typedef void (*btf_trace_drv_tdls_recv_channel_switch)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct ieee80211_tdls_ch_sw_params *); + +typedef void (*btf_trace_drv_wake_tx_queue)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct txq_info *); + +typedef void (*btf_trace_drv_get_ftm_responder_stats)(void *, struct ieee80211_local *, struct ieee80211_sub_if_data *, struct cfg80211_ftm_responder_stats *); + enum ieee80211_he_mcs_support { IEEE80211_HE_MCS_SUPPORT_0_7 = 0, IEEE80211_HE_MCS_SUPPORT_0_9 = 1, @@ -121970,7 +127100,161 @@ enum { dns_key_error = 1, }; -struct warn_args___2; +struct sockaddr_xdp { + __u16 sxdp_family; + __u16 sxdp_flags; + __u32 sxdp_ifindex; + __u32 sxdp_queue_id; + __u32 sxdp_shared_umem_fd; +}; + +struct xdp_ring_offset { + __u64 producer; + __u64 consumer; + __u64 desc; + __u64 flags; +}; + +struct xdp_mmap_offsets { + struct xdp_ring_offset rx; + struct xdp_ring_offset tx; + struct xdp_ring_offset fr; + struct xdp_ring_offset cr; +}; + +struct xdp_umem_reg { + __u64 addr; + __u64 len; + __u32 chunk_size; + __u32 headroom; + __u32 flags; +}; + +struct xdp_statistics { + __u64 rx_dropped; + __u64 rx_invalid_descs; + __u64 tx_invalid_descs; +}; + +struct xdp_options { + __u32 flags; +}; + +struct xdp_desc { + __u64 addr; + __u32 len; + __u32 options; +}; + +struct xdp_ring; + +struct xsk_queue { + u64 chunk_mask; + u64 size; + u32 ring_mask; + u32 nentries; + u32 prod_head; + u32 prod_tail; + u32 cons_head; + u32 cons_tail; + struct xdp_ring *ring; + u64 invalid_descs; +}; + +struct xdp_ring { + u32 producer; + long: 32; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + u32 consumer; + u32 flags; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; + long: 64; +}; + +struct xdp_rxtx_ring { + struct xdp_ring ptrs; + struct xdp_desc desc[0]; +}; + +struct xdp_umem_ring { + struct xdp_ring ptrs; + u64 desc[0]; +}; + +struct xdp_ring_offset_v1 { + __u64 producer; + __u64 consumer; + __u64 desc; +}; + +struct xdp_mmap_offsets_v1 { + struct xdp_ring_offset_v1 rx; + struct xdp_ring_offset_v1 tx; + struct xdp_ring_offset_v1 fr; + struct xdp_ring_offset_v1 cr; +}; + +struct xdp_diag_req { + __u8 sdiag_family; + __u8 sdiag_protocol; + __u16 pad; + __u32 xdiag_ino; + __u32 xdiag_show; + __u32 xdiag_cookie[2]; +}; + +struct xdp_diag_msg { + __u8 xdiag_family; + __u8 xdiag_type; + __u16 pad; + __u32 xdiag_ino; + __u32 xdiag_cookie[2]; +}; + +enum { + XDP_DIAG_NONE = 0, + XDP_DIAG_INFO = 1, + XDP_DIAG_UID = 2, + XDP_DIAG_RX_RING = 3, + XDP_DIAG_TX_RING = 4, + XDP_DIAG_UMEM = 5, + XDP_DIAG_UMEM_FILL_RING = 6, + XDP_DIAG_UMEM_COMPLETION_RING = 7, + XDP_DIAG_MEMINFO = 8, + __XDP_DIAG_MAX = 9, +}; + +struct xdp_diag_info { + __u32 ifindex; + __u32 queue_id; +}; + +struct xdp_diag_ring { + __u32 entries; +}; + +struct xdp_diag_umem { + __u64 size; + __u32 id; + __u32 num_pages; + __u32 chunk_size; + __u32 headroom; + __u32 ifindex; + __u32 queue_id; + __u32 flags; + __u32 refs; +}; struct compress_format { unsigned char magic[2]; @@ -122133,13 +127417,13 @@ enum { st_wordstart = 0, st_wordcmp = 1, st_wordskip = 2, + st_bufcpy = 3, }; enum { st_wordstart___2 = 0, st_wordcmp___2 = 1, st_wordskip___2 = 2, - st_bufcpy = 3, }; struct in6_addr___2; @@ -122153,3 +127437,5 @@ enum reg_type { #ifndef BPF_NO_PRESERVE_ACCESS_INDEX #pragma clang attribute pop #endif + +#endif /* __VMLINUX_H__ */ diff --git a/libbpf-tools/xfsslower.bpf.c b/libbpf-tools/xfsslower.bpf.c new file mode 100644 index 000000000..65644bc36 --- /dev/null +++ b/libbpf-tools/xfsslower.bpf.c @@ -0,0 +1,160 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2020 Wenbo Zhang +#include "vmlinux.h" +#include +#include +#include +#include "xfsslower.h" + +#define NULL 0 + +const volatile pid_t targ_tgid = 0; +const volatile __u64 min_lat = 0; + +struct piddata { + u64 ts; + loff_t start; + loff_t end; + struct file *fp; +}; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __uint(max_entries, 8192); + __type(key, u32); + __type(value, struct piddata); +} start SEC(".maps"); + +struct { + __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY); + __uint(key_size, sizeof(u32)); + __uint(value_size, sizeof(u32)); +} events SEC(".maps"); + +static __always_inline int +probe_entry(struct file *fp, loff_t s, loff_t e) +{ + u64 id = bpf_get_current_pid_tgid(); + struct piddata piddata; + u32 tgid = id >> 32; + u32 pid = id; + + if (!fp) + return 0; + if (targ_tgid && targ_tgid != tgid) + return 0; + + piddata.ts = bpf_ktime_get_ns(); + piddata.start = s; + piddata.end = e; + piddata.fp = fp; + bpf_map_update_elem(&start, &pid, &piddata, 0); + return 0; +} + +SEC("kprobe/xfs_file_read_iter") +int BPF_KPROBE(xfs_file_read_iter, struct kiocb *iocb) +{ + struct file *fp = BPF_CORE_READ(iocb, ki_filp); + loff_t start = BPF_CORE_READ(iocb, ki_pos); + + return probe_entry(fp, start, 0); +} + +SEC("kprobe/xfs_file_write_iter") +int BPF_KPROBE(xfs_file_write_iter, struct kiocb *iocb) +{ + struct file *fp = BPF_CORE_READ(iocb, ki_filp); + loff_t start = BPF_CORE_READ(iocb, ki_pos); + + return probe_entry(fp, start, 0); +} + +SEC("kprobe/xfs_file_open") +int BPF_KPROBE(xfs_file_open, struct inode *inode, struct file *file) +{ + return probe_entry(file, 0, 0); +} + +SEC("kprobe/xfs_file_fsync") +int BPF_KPROBE(xfs_file_fsync, struct file *file, loff_t start, + loff_t end) +{ + return probe_entry(file, start, end); +} + +static __always_inline int +probe_exit(struct pt_regs *ctx, char type, ssize_t size) +{ + u64 id = bpf_get_current_pid_tgid(); + u64 end_ns = bpf_ktime_get_ns(); + struct piddata *piddatap; + struct event event = {}; + struct dentry *dentry; + const u8 *qs_name_ptr; + u32 tgid = id >> 32; + struct file *fp; + u32 pid = id; + u64 delta_us; + u32 qs_len; + + if (targ_tgid && targ_tgid != tgid) + return 0; + + piddatap = bpf_map_lookup_elem(&start, &pid); + if (!piddatap) + return 0; /* missed entry */ + + delta_us = (end_ns - piddatap->ts) / 1000; + bpf_map_delete_elem(&start, &pid); + + if ((s64)delta_us < 0 || delta_us <= min_lat * 1000) + return 0; + + fp = piddatap->fp; + dentry = BPF_CORE_READ(fp, f_path.dentry); + qs_len = BPF_CORE_READ(dentry, d_name.len); + qs_name_ptr = BPF_CORE_READ(dentry, d_name.name); + bpf_probe_read_kernel_str(&event.file, sizeof(event.file), qs_name_ptr); + bpf_get_current_comm(&event.task, sizeof(event.task)); + event.delta_us = delta_us; + event.end_ns = end_ns; + event.offset = piddatap->start; + if (type != TRACE_FSYNC) + event.size = size; + else + event.size = piddatap->end - piddatap->start; + event.type = type; + event.tgid = tgid; + + /* output */ + bpf_perf_event_output(ctx, &events, BPF_F_CURRENT_CPU, + &event, sizeof(event)); + return 0; +} + +SEC("kretprobe/xfs_file_read_iter") +int BPF_KRETPROBE(xfs_file_read_iters_ret, ssize_t ret) +{ + return probe_exit(ctx, TRACE_READ, ret); +} + +SEC("kretprobe/xfs_file_write_iter") +int BPF_KRETPROBE(xfs_file_write_iter_ret, ssize_t ret) +{ + return probe_exit(ctx, TRACE_WRITE, ret); +} + +SEC("kretprobe/xfs_file_open") +int BPF_KRETPROBE(xfs_file_open_ret) +{ + return probe_exit(ctx, TRACE_OPEN, 0); +} + +SEC("kretprobe/xfs_file_fsync") +int BPF_KRETPROBE(xfs_file_sync_ret) +{ + return probe_exit(ctx, TRACE_FSYNC, 0); +} + +char LICENSE[] SEC("license") = "GPL"; diff --git a/libbpf-tools/xfsslower.c b/libbpf-tools/xfsslower.c new file mode 100644 index 000000000..f94216d4d --- /dev/null +++ b/libbpf-tools/xfsslower.c @@ -0,0 +1,238 @@ +// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) +// Copyright (c) 2020 Wenbo Zhang +// +// Based on xfsslower(8) from BCC by Brendan Gregg & Dina Goldshtein. +// 9-Mar-2020 Wenbo Zhang Created this. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "xfsslower.h" +#include "xfsslower.skel.h" +#include "trace_helpers.h" + +#define PERF_BUFFER_PAGES 64 +#define PERF_BUFFER_TIME_MS 10 +#define PERF_POLL_TIMEOUT_MS 100 + + +static struct env { + pid_t pid; + time_t duration; + __u64 min_lat; + bool csv; + bool verbose; +} env = { + .min_lat = 10000, +}; + +const char *argp_program_version = "xfsslower 0.1"; +const char *argp_program_bug_address = ""; +const char argp_program_doc[] = +"Trace common XFS file operations slower than a threshold.\n" +"\n" +"Usage: xfslower [--help] [-p PID] [-m MIN] [-d DURATION] [-c]\n" +"\n" +"EXAMPLES:\n" +" xfsslower # trace operations slower than 10 ms (default)" +" xfsslower 0 # trace all operations (warning: verbose)\n" +" xfsslower -p 123 # trace pid 123\n" +" xfsslower -c -d 1 # ... 1s, parsable output (csv)"; + +static const struct argp_option opts[] = { + { "csv", 'c', NULL, 0, "Output as csv" }, + { "duration", 'd', "DURATION", 0, "Total duration of trace in seconds" }, + { "pid", 'p', "PID", 0, "Process PID to trace" }, + { "min", 'm', "MIN", 0, "Min latency of trace in ms (default 10)" }, + { "verbose", 'v', NULL, 0, "Verbose debug output" }, + {}, +}; + +static error_t parse_arg(int key, char *arg, struct argp_state *state) +{ + long long min_lat; + time_t duration; + int pid; + + switch (key) { + case 'v': + env.verbose = true; + break; + case 'c': + env.csv = true; + break; + case 'd': + errno = 0; + duration = strtol(arg, NULL, 10); + if (errno || duration <= 0) { + fprintf(stderr, "invalid DURATION: %s\n", arg); + argp_usage(state); + } + env.duration = duration; + break; + case 'm': + errno = 0; + min_lat = strtoll(arg, NULL, 10); + if (errno || min_lat < 0) { + fprintf(stderr, "invalid delay (in ms): %s\n", arg); + } + env.min_lat = min_lat; + break; + case 'p': + errno = 0; + pid = strtol(arg, NULL, 10); + if (errno || pid <= 0) { + fprintf(stderr, "invalid PID: %s\n", arg); + argp_usage(state); + } + env.pid = pid; + break; + default: + return ARGP_ERR_UNKNOWN; + } + return 0; +} + +int libbpf_print_fn(enum libbpf_print_level level, + const char *format, va_list args) +{ + if (level == LIBBPF_DEBUG && !env.verbose) + return 0; + return vfprintf(stderr, format, args); +} + +void handle_event(void *ctx, int cpu, void *data, __u32 data_sz) +{ + const struct event *e = data; + struct tm *tm; + char ts[32]; + time_t t; + + time(&t); + tm = localtime(&t); + strftime(ts, sizeof(ts), "%H:%M:%S", tm); + + if (env.csv) { + printf("%lld,%s,%d,%c,", e->end_ns, e->task, e->tgid, e->type); + if (e->size == LLONG_MAX) + printf("LL_MAX,"); + else + printf("%ld,", e->size); + printf("%lld,%lld,%s\n", e->offset, e->delta_us, e->file); + } else { + printf("%-8s %-14.14s %-6d %c ", ts, e->task, e->tgid, e->type); + if (e->size == LLONG_MAX) + printf("%-7s ", "LL_MAX"); + else + printf("%-7ld ", e->size); + printf("%-8lld %7.2f %s\n", e->offset / 1024, + (double)e->delta_us / 1000, e->file); + } +} + +void handle_lost_events(void *ctx, int cpu, __u64 lost_cnt) +{ + fprintf(stderr, "lost %llu events on CPU #%d\n", lost_cnt, cpu); +} + +int main(int argc, char **argv) +{ + static const struct argp argp = { + .options = opts, + .parser = parse_arg, + .doc = argp_program_doc, + }; + struct perf_buffer_opts pb_opts; + struct perf_buffer *pb = NULL; + struct xfsslower_bpf *obj; + __u64 time_end = 0; + int err; + + err = argp_parse(&argp, argc, argv, 0, NULL, NULL); + if (err) + return err; + + libbpf_set_print(libbpf_print_fn); + + err = bump_memlock_rlimit(); + if (err) { + fprintf(stderr, "failed to increase rlimit: %d\n", err); + return 1; + } + + obj = xfsslower_bpf__open(); + if (!obj) { + fprintf(stderr, "failed to open and/or load BPF object\n"); + return 1; + } + + /* initialize global data (filtering options) */ + obj->rodata->min_lat = env.min_lat; + obj->rodata->targ_tgid = env.pid; + + err = xfsslower_bpf__load(obj); + if (err) { + fprintf(stderr, "failed to load BPF object: %d\n", err); + goto cleanup; + } + + err = xfsslower_bpf__attach(obj); + if (err) { + fprintf(stderr, "failed to attach BPF programs\n"); + goto cleanup; + } + + if (env.csv) + printf("ENDTIME_us,TASK,PID,TYPE,BYTES,OFFSET_b,LATENCY_us,FILE"); + else { + if (env.min_lat) + printf("Tracing XFS operations slower than %llu ms", + env.min_lat); + else + printf("Tracing XFS operations"); + if (env.duration) + printf(" for %ld secs.\n", env.duration); + else + printf("... Hit Ctrl-C to end.\n"); + printf("%-8s %-14s %-6s %1s %-7s %-8s %7s %s", + "TIME", "COMM", "PID", "T", "BYTES", "OFF_KB", "LAT(ms)", + "FILENAME\n"); + } + + pb_opts.sample_cb = handle_event; + pb_opts.lost_cb = handle_lost_events; + pb = perf_buffer__new(bpf_map__fd(obj->maps.events), PERF_BUFFER_PAGES, + &pb_opts); + err = libbpf_get_error(pb); + if (err) { + pb = NULL; + fprintf(stderr, "failed to open perf buffer: %d\n", err); + goto cleanup; + } + + /* setup duration */ + if (env.duration) + time_end = get_ktime_ns() + env.duration * NSEC_PER_SEC; + + /* main: poll */ + while (1) { + usleep(PERF_BUFFER_TIME_MS * 1000); + if ((err = perf_buffer__poll(pb, PERF_POLL_TIMEOUT_MS)) < 0) + break; + if (env.duration && get_ktime_ns() > time_end) + goto cleanup; + } + fprintf(stderr, "failed with polling perf buffer: %d\n", err); + +cleanup: + perf_buffer__free(pb); + xfsslower_bpf__destroy(obj); + + return err != 0; +} diff --git a/libbpf-tools/xfsslower.h b/libbpf-tools/xfsslower.h new file mode 100644 index 000000000..16db77ebf --- /dev/null +++ b/libbpf-tools/xfsslower.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#ifndef __XFSSLOWER_H +#define __XFSSLOWER_H + +#define DNAME_INLINE_LEN 32 +#define TASK_COMM_LEN 16 + +#define TRACE_READ 'R' +#define TRACE_WRITE 'W' +#define TRACE_OPEN 'O' +#define TRACE_FSYNC 'F' + +struct event { + char file[DNAME_INLINE_LEN]; + char task[TASK_COMM_LEN]; + __u64 delta_us; + __u64 end_ns; + __s64 offset; + ssize_t size; + pid_t tgid; + char type; +}; + +#endif /* __DRSNOOP_H */ diff --git a/man/man8/bindsnoop.8 b/man/man8/bindsnoop.8 new file mode 100644 index 000000000..f8fa18502 --- /dev/null +++ b/man/man8/bindsnoop.8 @@ -0,0 +1,149 @@ +.TH bindsnoop 8 "12 February 2020" "" "" +.SH NAME +bindsnoop \- Trace bind() system calls. +.SH SYNOPSIS +.B bindsnoop.py [\fB-h\fP] [\fB-w\fP] [\fB-t\fP] [\fB-p\fP PID] [\fB-P\fP PORT] [\fB-E\fP] [\fB-U\fP] [\fB-u\fP UID] [\fB--count\fP] [\fB--cgroupmap MAP\fP] [\fB--mntnsmap MNTNSMAP\fP] +.SH DESCRIPTION +bindsnoop reports socket options set before the bind call that would impact this system call behavior. +.PP +.SH REQUIREMENTS +CONFIG_BPF and bcc. +.SH +OPTIONS: +.RS +.TP +Show help message and exit: +.TP +.B +\fB-h\fP, \fB--help\fP +.TP +Include timestamp on output: +.TP +.B +\fB-t\fP, \fB--timestamp\fP +.TP +Wider columns (fit IPv6): +.TP +.B +\fB-w\fP, \fB--wide\fP +.TP +Trace this PID only: +.TP +.B +\fB-p\fP PID, \fB--pid\fP PID +.TP +Comma-separated list of ports to trace: +.TP +.B +\fB-P\fP PORT, \fB--port\fP PORT +.TP +Trace cgroups in this BPF map: +.TP +.B +\fB--cgroupmap\fP MAP +.TP +Trace mount namespaces in this BPF map: +.TP +.B +\fB--mntnsmap\fP MNTNSMAP +.TP +Include errors in the output: +.TP +.B +\fB-E\fP, \fB--errors\fP +.TP +Include UID on output: +.TP +.B +\fB-U\fP, \fB--print-uid\fP +.TP +Trace this UID only: +.TP +.B +\fB-u\fP UID, \fB--uid\fP UID +.TP +Count binds per src ip and port: +.TP +.B +\fB--count\fP +.RE +.PP +.SH +EXAMPLES: +.RS +.TP +Trace all IPv4 and IPv6 \fBbind\fP()s +.TP +.B +bindsnoop +.TP +Include timestamps +.TP +.B +bindsnoop \fB-t\fP +.TP +Trace PID 181 +.TP +.B +bindsnoop \fB-p\fP 181 +.TP +Trace port 80 +.TP +.B +bindsnoop \fB-P\fP 80 +.TP +Trace port 80 and 81 +.TP +.B +bindsnoop \fB-P\fP 80,81 +.TP +Include UID +.TP +.B +bindsnoop \fB-U\fP +.TP +Trace UID 1000 +.TP +.B +bindsnoop \fB-u\fP 1000 +.TP +Report bind errors +.TP +.B +bindsnoop \fB-E\fP +.TP +Count bind per src ip +.TP +.B +bindsnoop \fB--count\fP +.RE +.PP +Trace IPv4 and IPv6 bind system calls and report socket options that would impact bind call behavior: +.RS +.TP +SOL_IP IP_FREEBIND F\.\.\.\. +.TP +SOL_IP IP_TRANSPARENT \.T\.\.\. +.TP +SOL_IP IP_BIND_ADDRESS_NO_PORT \.\.N\.\. +.TP +SOL_SOCKET SO_REUSEADDR \.\.\.R. +.TP +SOL_SOCKET SO_REUSEPORT \.\.\.\.r +.PP +SO_BINDTODEVICE interface is reported as "IF" index +.SH SOURCE +This is from bcc. +.IP +https://github.com/iovisor/bcc +.PP +Also look in the bcc distribution for a companion _examples.txt file containing +example usage, output, and commentary for this tool. +.SH OS +Linux +.SH STABILITY +Unstable - in development. +.SH AUTHOR +Pavel Dubovitsky +.SH SEE ALSO +tcpaccept(8) diff --git a/man/man8/biolatpcts.8 b/man/man8/biolatpcts.8 new file mode 100644 index 000000000..7a06a11d4 --- /dev/null +++ b/man/man8/biolatpcts.8 @@ -0,0 +1,89 @@ +.TH biolatpcts 8 "2020-04-17" "USER COMMANDS" +.SH NAME +biolatpcts \- Monitor IO latency distribution of a block device. +.SH SYNOPSIS +.B biolatpcts [\-h] [\-i INTERVAL] [\-w which] [\-p PCT,...] [\-j] [\-v] DEV +.SH DESCRIPTION + +biolatpcts traces block device I/O (disk I/O) of the specified device, and +calculates and prints the completion latency distribution percentiles per IO +type periodically. Example: + + # biolatpcts /dev/nvme0n1 + nvme0n1 p1 p5 p10 p16 p25 p50 p75 p84 p90 p95 p99 p100 + read 95us 175us 305us 515us 895us 985us 995us 1.5ms 2.5ms 3.5ms 4.5ms 10ms + write 5us 5us 5us 15us 25us 135us 765us 855us 885us 895us 965us 1.5ms + discard 5us 5us 5us 5us 135us 145us 165us 205us 385us 875us 1.5ms 2.5ms + flush 5us 5us 5us 5us 5us 5us 5us 5us 5us 1.5ms 4.5ms 5.5ms + [...] + +biolatpcts prints a number of pre-set latency percentiles in tabular form +every three seconds. The interval can be changed with the \-i option. + +The latency is measured between issue to the device and completion. The +starting point can be changed with the \-w option. + +Any number of percentiles can be specified using the \-p option. The input +percentile string is used verbatim in the output to ease machine consumption. + +\-j option enables json output. The result for each interval is printed on a +single line. + +This tool works by tracing blk_account_io_done() with kprobe and bucketing the +completion latencies into percpu arrays. It may need updating to match the +changes to the function. + +Since this uses BPF, only the root user can use this tool. +.SH REQUIREMENTS +CONFIG_BPF, CONFIG_KPROBES and bcc. +.SH OPTIONS +\-h +Print usage message. +.TP +\-i INTERVAL, \-\-interval INTERVAL +Report interval. (default: 3) +.TP +\-w {from\-rq\-alloc,after\-rq\-alloc,on\-device}, \-\-which {from\-rq\-alloc,after\-rq\-alloc,on\-device} +Which latency to measure. (default: on-device) +.TP +\-p PCT,..., \-\-pcts PCT,... +Percentiles to calculate. (default: 1,5,10,16,25,50,75,84,90,95,99,100) +.TP +\-j, \-\-json +Output in json. +.TP +\-v, \-\-verbose +Enable debug output. +.TP +DEV +Target block device. /dev/DEVNAME, DEVNAME or MAJ:MIN. +.SH EXAMPLES +.TP +Print sda's I/O latency percentiles every second +# +.B biolatpcts \-i 1 sda +.TP +Print nvme0n1's all-9 I/O latency percentiles in json every second +# +.B biolatpcts \-p 99,99.9,99.99,99.999 \-j \-i 1 /dev/nvme0n1 +.SH OVERHEAD +This traces kernel functions and maintains in-kernel per-cpu latency buckets, +which are asynchronously copied to user-space. This method is very efficient, +and the overhead for most storage I/O rates should be negligible. If you have +an extremely high IOPS storage device, test and quantify the overhead before +use. +.SH SOURCE +This is from bcc. +.IP +https://github.com/iovisor/bcc +.PP +Also look in the bcc distribution for a companion _examples.txt file containing +example usage, output, and commentary for this tool. +.SH OS +Linux +.SH STABILITY +Unstable - in development. +.SH AUTHOR +Tejun Heo +.SH SEE ALSO +biolatency(8), biosnoop(8) diff --git a/man/man8/capable.8 b/man/man8/capable.8 index e20eb78fa..342946f83 100644 --- a/man/man8/capable.8 +++ b/man/man8/capable.8 @@ -1,8 +1,9 @@ -.TH capable 8 "2016-09-13" "USER COMMANDS" +.TH capable 8 "2020-03-08" "USER COMMANDS" .SH NAME capable \- Trace security capability checks (cap_capable()). .SH SYNOPSIS -.B capable [\-h] [\-v] [\-p PID] [\-K] [\-U] +.B capable [\-h] [\-v] [\-p PID] [\-K] [\-U] [\-x] [\-\-cgroupmap MAPPATH] + [\-\-mntnsmap MAPPATH] [--unique] .SH DESCRIPTION This traces security capability checks in the kernel, and prints details for each call. This can be useful for general debugging, and also security @@ -28,6 +29,15 @@ Include user-space stack traces to the output. .TP \-x Show extra fields in TID and INSETID columns. +.TP +\-\-cgroupmap MAPPATH +Trace cgroups in this BPF map only (filtered in-kernel). +.TP +\-\-mntnsmap MAPPATH +Trace mount namespaces in this BPF map only (filtered in-kernel). +.TP +\-\-unique +Don't repeat stacks for the same PID or cgroup. .SH EXAMPLES .TP Trace all capability checks system-wide: @@ -37,6 +47,11 @@ Trace all capability checks system-wide: Trace capability checks for PID 181: # .B capable \-p 181 +.TP +Trace capability checks in a set of cgroups only (see special_filtering.md +from bcc sources for more details): +# +.B capable \-\-cgroupmap /sys/fs/bpf/test01 .SH FIELDS .TP TIME(s) diff --git a/man/man8/compactsnoop.8 b/man/man8/compactsnoop.8 index 8479e8095..a2933d7a2 100644 --- a/man/man8/compactsnoop.8 +++ b/man/man8/compactsnoop.8 @@ -176,4 +176,4 @@ Linux .SH STABILITY Unstable - in development. .SH AUTHOR -Ethercflow +Wenbo Zhang diff --git a/man/man8/dirtop.8 b/man/man8/dirtop.8 new file mode 100644 index 000000000..cc61a676f --- /dev/null +++ b/man/man8/dirtop.8 @@ -0,0 +1,115 @@ +.TH dirtop 8 "2020-03-16" "USER COMMANDS" +.SH NAME +dirtop \- File reads and writes by directory. Top for directories. +.SH SYNOPSIS +.B dirtop \-d directory1,directory2,... [\-h] [\-C] [\-r MAXROWS] [\-s {reads,writes,rbytes,wbytes}] [\-p PID] [interval] [count] +.SH DESCRIPTION +This is top for directories. + +This traces file reads and writes, and prints a per-directory summary every interval +(by default, 1 second). By default the summary is sorted on the highest read +throughput (Kbytes). Sorting order can be changed via -s option. + +This uses in-kernel eBPF maps to store per process summaries for efficiency. + +This script works by tracing the __vfs_read() and __vfs_write() functions using +kernel dynamic tracing, which instruments explicit read and write calls. If +files are read or written using another means (eg, via mmap()), then they +will not be visible using this tool. Also, this tool will need updating to +match any code changes to those vfs functions. + +This should be useful for file system workload characterization when analyzing +the performance of applications. + +Note that tracing VFS level reads and writes can be a frequent activity, and +this tool can begin to cost measurable overhead at high I/O rates. + +Since this uses BPF, only the root user can use this tool. +.SH REQUIREMENTS +CONFIG_BPF and bcc. +.SH OPTIONS +.TP +\-d +Defines a list of directories, comma separated, to observe. +Wildcards are allowed if between single bracket. +.TP +\-C +Don't clear the screen. +.TP +\-r MAXROWS +Maximum number of rows to print. Default is 20. +.TP +\-s {reads,writes,rbytes,wbytes} +Sort column. Default is rbytes (read throughput). +.TP +\-p PID +Trace this PID only. +.TP +interval +Interval between updates, seconds. +.TP +count +Number of interval summaries. + +.SH EXAMPLES +.TP +Summarize block device I/O by directory, 1 second screen refresh: +# +.B dirtop.py +.TP +Don't clear the screen, and top 8 rows only: +# +.B dirtop.py -Cr 8 +.TP +5 second summaries, 10 times only: +# +.B dirtop.py 5 10 +.TP +Report read & write IOs generated in mutliple yarn and data directories: +# +.B dirtop.py -d '/hdfs/uuid/*/yarn,/hdfs/uuid/*/data' +.SH FIELDS +.TP +loadavg: +The contents of /proc/loadavg +.TP +READS +Count of reads during interval. +.TP +WRITES +Count of writes during interval. +.TP +R_Kb +Total read Kbytes during interval. +.TP +W_Kb +Total write Kbytes during interval. +.TP +PATH +The path were the IOs were accounted. +.SH OVERHEAD +Depending on the frequency of application reads and writes, overhead can become +significant, in the worst case slowing applications by over 50%. Hopefully for +real world workloads the overhead is much less -- test before use. The reason +for the high overhead is that VFS reads and writes can be a frequent event, and +despite the eBPF overhead being very small per event, if you multiply this +small overhead by a million events per second, it becomes a million times +worse. Literally. You can gauge the number of reads and writes using the +vfsstat(8) tool, also from bcc. +.SH SOURCE +This is from bcc. +.IP +https://github.com/iovisor/bcc +.PP +Also look in the bcc distribution for a companion _examples.txt file containing +example usage, output, and commentary for this tool. +.SH OS +Linux +.SH STABILITY +Unstable - in development. +.SH AUTHOR +Erwan Velu +.SH INSPIRATION +filetop(8) by Brendan Gregg +.SH SEE ALSO +vfsstat(8), vfscount(8), fileslower(8) diff --git a/man/man8/drsnoop.8 b/man/man8/drsnoop.8 index c4ba2686b..572c0dceb 100644 --- a/man/man8/drsnoop.8 +++ b/man/man8/drsnoop.8 @@ -107,4 +107,4 @@ Linux .SH STABILITY Unstable - in development. .SH AUTHOR -Ethercflow +Wenbo Zhang diff --git a/man/man8/execsnoop.8 b/man/man8/execsnoop.8 index 500a93218..e42ad38ab 100644 --- a/man/man8/execsnoop.8 +++ b/man/man8/execsnoop.8 @@ -1,9 +1,9 @@ -.TH execsnoop 8 "2016-02-07" "USER COMMANDS" +.TH execsnoop 8 "2020-02-20" "USER COMMANDS" .SH NAME execsnoop \- Trace new processes via exec() syscalls. Uses Linux eBPF/bcc. .SH SYNOPSIS -.B execsnoop [\-h] [\-T] [\-t] [\-x] [\-q] [\-n NAME] [\-l LINE] -.B [\-\-max-args MAX_ARGS] +.B execsnoop [\-h] [\-T] [\-t] [\-x] [\-\-cgroupmap CGROUPMAP] [\-\-mntnsmap MAPPATH] +.B [\-u USER] [\-q] [\-n NAME] [\-l LINE] [\-U] [\-\-max-args MAX_ARGS] .SH DESCRIPTION execsnoop traces new processes, showing the filename executed and argument list. @@ -28,15 +28,21 @@ Print usage message. \-T Include a time column (HH:MM:SS). .TP +\-U +Include UID column. +.TP \-t Include a timestamp column. .TP +\-u USER +Filter by UID (or username) +.TP \-x Include failed exec()s .TP \-q Add "quotemarks" around arguments. Escape quotemarks in arguments with a -backslash. For tracing empty arguments or arguments that contain whitespace. +backslash. For tracing empty arguments or arguments that contain whitespace. .TP \-n NAME Only print command lines matching this name (regex) @@ -46,6 +52,13 @@ Only print commands where arg contains this line (regex) .TP \--max-args MAXARGS Maximum number of arguments parsed and displayed, defaults to 20 +.TP +\-\-cgroupmap MAPPATH +Trace cgroups in this BPF map only (filtered in-kernel). +.TP +\-\-mntnsmap MAPPATH +Trace mount namespaces in this BPF map only (filtered in-kernel). +.TP .SH EXAMPLES .TP Trace all exec() syscalls: @@ -56,11 +69,23 @@ Trace all exec() syscalls, and include timestamps: # .B execsnoop \-t .TP +Display process UID: +# +.B execsnoop \-U +.TP +Trace only UID 1000: +# +.B execsnoop \-u 1000 +.TP +Trace only processes launched by root and display UID column: +# +.B execsnoop \-Uu root +.TP Include failed exec()s: # .B execsnoop \-x .TP -Put quotemarks around arguments. +Put quotemarks around arguments. # .B execsnoop \-q .TP @@ -71,6 +96,10 @@ Only trace exec()s where the filename contains "mount": Only trace exec()s where argument's line contains "testpkg": # .B execsnoop \-l testpkg +.TP +Trace a set of cgroups only (see special_filtering.md from bcc sources for more details): +# +.B execsnoop \-\-cgroupmap /sys/fs/bpf/test01 .SH FIELDS .TP TIME @@ -79,6 +108,9 @@ Time of exec() return, in HH:MM:SS format. TIME(s) Time of exec() return, in seconds. .TP +UID +User ID +.TP PCOMM Parent process/command name. .TP diff --git a/man/man8/exitsnoop.8 b/man/man8/exitsnoop.8 index fb1942b42..86a439214 100644 --- a/man/man8/exitsnoop.8 +++ b/man/man8/exitsnoop.8 @@ -2,7 +2,7 @@ .SH NAME exitsnoop \- Trace all process termination (exit, fatal signal). Uses Linux eBPF/bcc. .SH SYNOPSIS -.B exitsnoop [\-h] [\-t] [\-\-utc] [\-x] [\-p PID] [\-\-label LABEL] +.B exitsnoop [\-h] [\-t] [\-\-utc] [\-x] [\-p PID] [\-\-label LABEL] [\-\-per\-thread] .SH DESCRIPTION exitsnoop traces process termination, showing the command name and reason for termination, either an exit or a fatal signal. @@ -35,6 +35,9 @@ Trace this process ID only (filtered in-kernel). .TP \-\-label LABEL Label each line with LABEL (default 'exit') in first column (2nd if timestamp is present). +.TP +\-\-per\-thread +Trace per thread termination .SH EXAMPLES .TP Trace all process termination @@ -56,6 +59,10 @@ Trace PID 181 only: Label each output line with 'EXIT': # .B exitsnoop \-\-label EXIT +.TP +Trace per thread termination +# +.B exitsnoop \-\-per\-thread .SH FIELDS .TP TIME-TZ diff --git a/man/man8/funccount.8 b/man/man8/funccount.8 index 9039ab33a..16ce4fc08 100644 --- a/man/man8/funccount.8 +++ b/man/man8/funccount.8 @@ -38,6 +38,9 @@ Use regular expressions for the search pattern. .TP \-D Print the BPF program before starting (for debugging purposes). +.TP +\-c CPU +Trace on this CPU only. .SH EXAMPLES .TP Count kernel functions beginning with "vfs_", until Ctrl-C is hit: @@ -75,6 +78,10 @@ Count all GC USDT probes in the Node process: Count all malloc() calls in libc: # .B funccount c:malloc +.TP +Count kernel functions beginning with "vfs_" on CPU 1 only: +# +.B funccount \-c 1 'vfs_*' .SH FIELDS .TP FUNC diff --git a/man/man8/funcinterval.8 b/man/man8/funcinterval.8 new file mode 100755 index 000000000..89a4a7b4f --- /dev/null +++ b/man/man8/funcinterval.8 @@ -0,0 +1,115 @@ +.TH funcinterval 8 "2020-05-27" "USER COMMANDS" +.SH NAME +funcinterval \- Time interval between the same function, tracepoint as a histogram. +.SH SYNOPSIS +.B funcinterval [\-h] [\-p PID] [\-i INTERVAL] [\-d DURATION] [\-T] [\-u] [\-m] [\-v] pattern +.SH DESCRIPTION +This tool times interval between the same function as a histogram. + +eBPF/bcc is very suitable for platform performance tuning. +By funclatency, we can profile specific functions to know how latency +this function costs. However, sometimes performance drop is not about the +latency of function but the interval between function calls. +funcinterval is born for this purpose. + +This tool uses in-kernel eBPF maps for storing timestamps and the histogram, +for efficiency. + +WARNING: This uses dynamic tracing of (what can be many) functions, an +activity that has had issues on some kernel versions (risk of panics or +freezes). Test, and know what you are doing, before use. + +Since this uses BPF, only the root user can use this tool. +.SH REQUIREMENTS +CONFIG_BPF and bcc. +.SH OPTIONS +pattern +Function name. +\-h +Print usage message. +.TP +\-p PID +Trace this process ID only. +.TP +\-i INTERVAL +Print output every interval seconds. +.TP +\-d DURATION +Total duration of trace, in seconds. +.TP +\-T +Include timestamps on output. +.TP +\-u +Output histogram in microseconds. +.TP +\-m +Output histogram in milliseconds. +.TP +\-v +Print the BPF program (for debugging purposes). +.SH EXAMPLES +.TP +Time the interval of do_sys_open() kernel function as a histogram: +# +.B funcinterval do_sys_open +.TP +Time the interval of xhci_ring_ep_doorbell(), in microseconds: +# +.B funcinterval -u xhci_ring_ep_doorbell +.TP +Time the interval of do_nanosleep(), in milliseconds +# +.B funcinterval -m do_nanosleep +.TP +Output every 5 seconds, with timestamps: +# +.B funcinterval -mTi 5 vfs_read +.TP +Time process 181 only: +# +.B funcinterval -p 181 vfs_read +.TP +Time the interval of mm_vmscan_direct_reclaim_begin tracepoint: +# +.B funcinterval t:vmscan:mm_vmscan_direct_reclaim_begin +.SH FIELDS +.TP +necs +Nanosecond range +.TP +usecs +Microsecond range +.TP +msecs +Millisecond range +.TP +count +How many calls fell into this range +.TP +distribution +An ASCII bar chart to visualize the distribution (count column) +.SH OVERHEAD +This traces kernel functions and maintains in-kernel timestamps and a histogram, +which are asynchronously copied to user-space. While this method is very +efficient, the rate of kernel functions can also be very high (>1M/sec), at +which point the overhead is expected to be measurable. Measure in a test +environment and understand overheads before use. You can also use funccount +to measure the rate of kernel functions over a short duration, to set some +expectations before use. +.SH SOURCE +This is from bcc. +.IP +https://github.com/iovisor/bcc +.PP +Also look in the bcc distribution for a companion _examples.txt file containing +example usage, output, and commentary for this tool. +.SH OS +Linux +.SH STABILITY +Unstable - in development. +.SH AUTHOR +Edward Wu +.SH SEE ALSO +funclatency(8) +funccount(8) diff --git a/man/man8/killsnoop.8 b/man/man8/killsnoop.8 index b90162f0d..acb376ea1 100644 --- a/man/man8/killsnoop.8 +++ b/man/man8/killsnoop.8 @@ -28,6 +28,9 @@ Only print failed kill() syscalls. .TP \-p PID Trace this process ID only (filtered in-kernel). +.TP +\-s SIGNAL +Trace this signal only (filtered in-kernel). .SH EXAMPLES .TP Trace all kill() syscalls: @@ -41,6 +44,10 @@ Trace only kill() syscalls that failed: Trace PID 181 only: # .B killsnoop \-p 181 +.TP +Trace signal 9 only: +# +.B killsnoop \-s 9 .SH FIELDS .TP TIME diff --git a/man/man8/memleak.8 b/man/man8/memleak.8 index fa52c8cf6..2fd267643 100644 --- a/man/man8/memleak.8 +++ b/man/man8/memleak.8 @@ -3,8 +3,8 @@ memleak \- Print a summary of outstanding allocations and their call stacks to detect memory leaks. Uses Linux eBPF/bcc. .SH SYNOPSIS .B memleak [-h] [-p PID] [-t] [-a] [-o OLDER] [-c COMMAND] [--combined-only] -[-s SAMPLE_RATE] [-T TOP] [-z MIN_SIZE] [-Z MAX_SIZE] [-O OBJ] [INTERVAL] -[COUNT] +[--wa-missing-free] [-s SAMPLE_RATE] [-T TOP] [-z MIN_SIZE] [-Z MAX_SIZE] +[-O OBJ] [INTERVAL] [COUNT] .SH DESCRIPTION memleak traces and matches memory allocation and deallocation requests, and collects call stacks for each allocation. memleak can then print a summary @@ -53,6 +53,9 @@ Use statistics precalculated in kernel space. Amount of data to be pulled from kernel significantly decreases, at the cost of losing capabilities of time-based false positives filtering (\-o). .TP +\-\-wa-missing-free +Make up the action of free to alleviate misjudgments when free is missing. +.TP \-s SAMPLE_RATE Record roughly every SAMPLE_RATE-th allocation to reduce overhead. .TP @@ -109,6 +112,9 @@ Additionally, option \-\-combined-only saves processing time by reusing already calculated allocation statistics from kernel. It's faster, but lacks information about particular allocations. +Also, option \-\-wa-missing-free makes memleak more accuracy in the complicated +environment. + To determine the rate at which your application is calling malloc/free, or the rate at which your kernel is calling kmalloc/kfree, place a probe with perf and collect statistics. For example, to determine how many calls to __kmalloc are diff --git a/man/man8/netqtop.8 b/man/man8/netqtop.8 new file mode 100644 index 000000000..bfa34d11f --- /dev/null +++ b/man/man8/netqtop.8 @@ -0,0 +1,56 @@ +.TH netqtop 8 "2020-07-30" "USER COMMANDS" +.SH NAME +netqtop \- Summarize PPS, BPS, average size of packets and packet counts ordered by packet sizes +on each queue of a network interface. +.SH SYNOPSIS +.B netqtop [\-n nic] [\-i interval] [\-t throughput] +.SH DESCRIPTION +netqtop accounts statistics of both transmitted and received packets on each queue of +a specified network interface to help developers check if its traffic load is balanced. +The result is displayed as a table with columns of PPS, BPS, average size and +packet counts in range [0,64), [64, 5120), [512, 2048), [2048, 16K), [16K, 64K). +This is printed every given interval (default 1) in seconds. + +The tool uses the net:net_dev_start_xmit and net:netif_receive_skb kernel tracepoints. +Since it uses tracepoint, the tool only works on Linux 4.7+. + +netqtop introduces significant overhead while network traffic is large. See OVERHEAD +section below. + +.SH REQUIREMENTS +CONFIG_bpf and bcc +.SH OPTIONS +.TP +\-n NIC +Specify the network interface card +.TP +\-i INTERVAL +Print results every INTERVAL seconds. +The default value is 1. +.TP +\-t THROUGHPUT +Print BPS and PPS of each queue. +.SH EXAMPLES +.TP +Account statistics of eth0 and output every 2 seconds: +# +.B netqtop -n eth0 -i 1 +.SH OVERHEAD +In performance test, netqtop introduces a overhead up to 30% PPS drop +while printing interval is set to 1 second. So be mindful of potential packet drop +when using this tool. + +It also increases ping-pong latency by about 1 usec. +.SH SOURCE +This is from bcc +.IP +https://github.com/iovisor/bcc +.PP +Also look in the bcc distribution for a netqtop_example.txt file containing +example usage, output and commentary for this tool. +.SH OS +Linux +.SH STABILITY +Unstable - in development +.SH AUTHOR +Yolandajn diff --git a/man/man8/offwaketime.8 b/man/man8/offwaketime.8 index cdc49a71b..7334b6f83 100644 --- a/man/man8/offwaketime.8 +++ b/man/man8/offwaketime.8 @@ -2,7 +2,7 @@ .SH NAME offwaketime \- Summarize blocked time by off-CPU stack + waker stack. Uses Linux eBPF/bcc. .SH SYNOPSIS -.B offwaketime [\-h] [\-p PID | \-t TID | \-u | \-k] [\-U | \-K] [\-f] [\-\-stack-storage-size STACK_STORAGE_SIZE] [\-m MIN_BLOCK_TIME] [\-M MAX_BLOCK_TIME] [duration] +.B offwaketime [\-h] [\-p PID | \-t TID | \-u | \-k] [\-U | \-K] [\-f] [\-\-stack-storage-size STACK_STORAGE_SIZE] [\-m MIN_BLOCK_TIME] [\-M MAX_BLOCK_TIME] [\-\-state STATE] [duration] .SH DESCRIPTION This program shows kernel stack traces and task names that were blocked and "off-CPU", along with the stack traces and task names for the threads that woke @@ -36,10 +36,12 @@ Print usage message. Print output in folded stack format. .TP \-p PID -Trace this process ID only (filtered in-kernel). +Trace this process ID only (filtered in-kernel). Can be a comma separated list +of PIDS. .TP \-t TID -Trace this thread ID only (filtered in-kernel). +Trace this thread ID only (filtered in-kernel). Can be a comma separated list +of TIDS. .TP \-u Only trace user threads (no kernel threads). @@ -64,6 +66,10 @@ The amount of time in microseconds over which we store traces (default 1) .TP \-M MAX_BLOCK_TIME The amount of time in microseconds under which we store traces (default U64_MAX) +.TP +\-\-state +Filter on this thread state bitmask (eg, 2 == TASK_UNINTERRUPTIBLE). +See include/linux/sched.h for states. .SH EXAMPLES .TP Trace all thread blocking events, and summarize (in-kernel) by user and kernel off-CPU stack trace, waker stack traces, task names, and total blocked time: diff --git a/man/man8/opensnoop.8 b/man/man8/opensnoop.8 index 874332d47..fee832634 100644 --- a/man/man8/opensnoop.8 +++ b/man/man8/opensnoop.8 @@ -1,9 +1,10 @@ -.TH opensnoop 8 "2015-08-18" "USER COMMANDS" +.TH opensnoop 8 "2020-02-20" "USER COMMANDS" .SH NAME opensnoop \- Trace open() syscalls. Uses Linux eBPF/bcc. .SH SYNOPSIS .B opensnoop.py [\-h] [\-T] [\-U] [\-x] [\-p PID] [\-t TID] [\-u UID] [\-d DURATION] [\-n NAME] [\-e] [\-f FLAG_FILTER] + [--cgroupmap MAPPATH] [--mntnsmap MAPPATH] .SH DESCRIPTION opensnoop traces the open() syscall, showing which processes are attempting to open which files. This can be useful for determining the location of config @@ -54,6 +55,12 @@ Show extended fields. .TP \-f FLAG Filter on open() flags, e.g., O_WRONLY. +.TP +\--cgroupmap MAPPATH +Trace cgroups in this BPF map only (filtered in-kernel). +.TP +\--mntnsmap MAPPATH +Trace mount namespaces in this BPF map only (filtered in-kernel). .SH EXAMPLES .TP Trace all open() syscalls: @@ -95,6 +102,10 @@ Show extended fields: Only print calls for writing: # .B opensnoop \-f O_WRONLY \-f O_RDWR +.TP +Trace a set of cgroups only (see special_filtering.md from bcc sources for more details): +# +.B opensnoop \-\-cgroupmap /sys/fs/bpf/test01 .SH FIELDS .TP TIME(s) @@ -142,4 +153,4 @@ Unstable - in development. .SH AUTHOR Brendan Gregg .SH SEE ALSO -funccount(1) +execsnoop(8), funccount(1) diff --git a/man/man8/profile.8 b/man/man8/profile.8 index 88311e7e2..30871afeb 100644 --- a/man/man8/profile.8 +++ b/man/man8/profile.8 @@ -1,9 +1,9 @@ -.TH profile 8 "2016-07-17" "USER COMMANDS" +.TH profile 8 "2020-03-18" "USER COMMANDS" .SH NAME profile \- Profile CPU usage by sampling stack traces. Uses Linux eBPF/bcc. .SH SYNOPSIS .B profile [\-adfh] [\-p PID | \-L TID] [\-U | \-K] [\-F FREQUENCY | \-c COUNT] -.B [\-\-stack\-storage\-size COUNT] [duration] +.B [\-\-stack\-storage\-size COUNT] [\-\-cgroupmap CGROUPMAP] [\-\-mntnsmap MAPPATH] [duration] .SH DESCRIPTION This is a CPU profiler. It works by taking samples of stack traces at timed intervals. It will help you understand and quantify CPU usage: which code is @@ -62,6 +62,9 @@ The maximum number of unique stack traces that the kernel will count (default \-C cpu Collect stacks only from specified cpu. .TP +\-\-cgroupmap MAPPATH +Profile cgroups in this BPF map only (filtered in-kernel). +.TP duration Duration to trace, in seconds. .SH EXAMPLES @@ -97,6 +100,10 @@ Profile for 5 seconds and output in folded stack format (suitable as input for f Profile kernel stacks only: # .B profile -K +.TP +Profile a set of cgroups only (see special_filtering.md from bcc sources for more details): +# +.B profile \-\-cgroupmap /sys/fs/bpf/test01 .SH DEBUGGING See "[unknown]" frames with bogus addresses? This can happen for different reasons. Your best approach is to get Linux perf to work first, and then to diff --git a/man/man8/readahead.8 b/man/man8/readahead.8 new file mode 100644 index 000000000..a2a109149 --- /dev/null +++ b/man/man8/readahead.8 @@ -0,0 +1,59 @@ +.TH readahead 8 "2020-08-20" "USER COMMANDS" +.SH NAME +readahead \- Show performance of read-ahead cache +.SH SYNOPSIS +.B readahead [-d DURATION] +.SH DESCRIPTION +The tool shows the performance of read-ahead caching on the system under a given load to investigate any +caching issues. It shows a count of unused pages in the cache and also prints a histogram showing how +long they have remained there. + +This tool traces the \fB__do_page_cache_readahead()\fR kernel function to track entry and exit in the +readahead mechanism in the kernel and then uses \fB__page_cache_alloc()\fR and \fBmark_page_accessed()\fR +functions to calculate the age of the page in the cache as well as see how many are left unaccessed. + +Since this uses BPF, only the root user can use this tool. +.SS NOTE ON KPROBES USAGE +Since the tool uses Kprobes, depending on your linux kernel's compilation, these functions may be inlined +and hence not available for Kprobes. To see whether you have the functions available, check \fBvmlinux\fR +source and binary to confirm whether inlining is happening or not. You can also check \fB/proc/kallsyms\fR +on the host and verify if the target functions are present there before using this. +.SH REQUIREMENTS +CONFIG_BPF, bcc +.SH OPTIONS +\-h +Print usage message +.TP +\-d DURATION +Trace the read-ahead caching system for DURATION seconds +.SH EXAMPLES +.TP +Trace for 30 seconds and show histogram of page age (ms) in read-ahead cache along with unused page count: +# +.B readahead -d 30 +.SH OVERHEAD +The kernel functions instrumented by this program could be high-frequency depending on the profile of the +application (for example sequential IO). We advise the users to measure and monitor the overhead before leaving +this turned on in production environments. +.SH SOURCE +This originated as a bpftrace tool from the book "BPF Performance Tools", +published by Addison Wesley (2019): +.IP +http://www.brendangregg.com/bpf-performance-tools-book.html +.PP +See the book for more documentation on this tool. +.PP +This version is in the BCC repository: +.IP +https://github.com/iovisor/bcc +.PP +Also look in the bcc distribution for a companion _examples.txt file containing +example usage, output, and commentary for this tool. +.SH OS +Linux +.SH STABILITY +Unstable - in development. +.SH AUTHOR +Suchakra Sharma +.SH SEE ALSO +readahead(2), madvise(2) diff --git a/man/man8/sslsniff.8 b/man/man8/sslsniff.8 index 72836e27f..7b945b00e 100644 --- a/man/man8/sslsniff.8 +++ b/man/man8/sslsniff.8 @@ -2,7 +2,7 @@ .SH NAME sslsniff \- Print data passed to OpenSSL, GnuTLS or NSS. Uses Linux eBPF/bcc. .SH SYNOPSIS -.B sslsniff [-h] [-p PID] [-c COMM] [-o] [-g] [-n] [-d] +.B sslsniff [-h] [-p PID] [-c COMM] [-o] [-g] [-n] [-d] [--hexdump] .SH DESCRIPTION sslsniff prints data sent to write/send and read/recv functions of OpenSSL, GnuTLS and NSS, allowing us to read plain text content before diff --git a/man/man8/swapin.8 b/man/man8/swapin.8 new file mode 100644 index 000000000..c5ef1ffc0 --- /dev/null +++ b/man/man8/swapin.8 @@ -0,0 +1,58 @@ +.TH swapin 8 "2019-07-05" "USER COMMANDS" +.SH NAME +swapin \- Count swapins by process. Uses BCC/eBPF. +.SH SYNOPSIS +.B swapin +.SH DESCRIPTION +This tool counts swapins by process, to show which process is affected by +swapping (if swap devices are in use). This can explain a significant source +of application latency, if it has began swapping due to memory pressure on +the system. + +This works by tracing the swap_readpage() kernel funciton +using dynamic instrumentation. This tool may need maintenance to keep working +if that function changes in later kernels. + +Since this uses BPF, only the root user can use this tool. +.SH REQUIREMENTS +CONFIG_BPF and BCC. +.SH EXAMPLES +.TP +Count swapins by process, showing per-second summaries. +# +.B swapin +.SH FIELDS +.TP +1st +The process name. +.TP +2nd +The process ID. +.TP +3rd +The count of swapins during that interval. +.SH OVERHEAD +The rate of swapins should be low (bounded by swapin device IOPS), such that +the overhead of this tool is expected to be negligible. +.SH SOURCE +This originated as a bpftrace tool from the book "BPF Performance Tools", +published by Addison Wesley (2019): +.IP +http://www.brendangregg.com/bpf-performance-tools-book.html +.PP +See the book for more documentation on this tool. +.PP +This version is in the BCC repository: +.IP +https://github.com/iovisor/bcc +.PP +Also look in the bcc distribution for a companion _examples.txt file +containing example usage, output, and commentary for this tool. +.SH OS +Linux +.SH STABILITY +Unstable - in development. +.SH AUTHOR +Brendan Gregg +.SH SEE ALSO +swapon(8) diff --git a/man/man8/tcpaccept.8 b/man/man8/tcpaccept.8 index 6e340bd09..603a5ca43 100644 --- a/man/man8/tcpaccept.8 +++ b/man/man8/tcpaccept.8 @@ -1,8 +1,8 @@ -.TH tcpaccept 8 "2019-03-08" "USER COMMANDS" +.TH tcpaccept 8 "2020-02-20" "USER COMMANDS" .SH NAME tcpaccept \- Trace TCP passive connections (accept()). Uses Linux eBPF/bcc. .SH SYNOPSIS -.B tcpaccept [\-h] [\-T] [\-t] [\-p PID] [\-P PORTS] +.B tcpaccept [\-h] [\-T] [\-t] [\-p PID] [\-P PORTS] [\-\-cgroupmap MAPPATH] [\-\-mntnsmap MAPPATH] .SH DESCRIPTION This tool traces passive TCP connections (eg, via an accept() syscall; connect() are active connections). This can be useful for general @@ -33,6 +33,12 @@ Trace this process ID only (filtered in-kernel). .TP \-P PORTS Comma-separated list of local ports to trace (filtered in-kernel). +.TP +\-\-cgroupmap MAPPATH +Trace cgroups in this BPF map only (filtered in-kernel). +.TP +\-\-mntnsmap MAPPATH +Trace mount namespaces in this BPF map only (filtered in-kernel). .SH EXAMPLES .TP Trace all passive TCP connections (accept()s): @@ -50,6 +56,10 @@ Trace connections to local ports 80 and 81 only: Trace PID 181 only: # .B tcpaccept \-p 181 +.TP +Trace a set of cgroups only (see special_filtering.md from bcc sources for more details): +# +.B tcpaccept \-\-cgroupmap /sys/fs/bpf/test01 .SH FIELDS .TP TIME @@ -99,4 +109,4 @@ Unstable - in development. .SH AUTHOR Brendan Gregg .SH SEE ALSO -tcpconnect(8), funccount(8), tcpdump(8) +tcptracer(8), tcpconnect(8), funccount(8), tcpdump(8) diff --git a/man/man8/tcpconnect.8 b/man/man8/tcpconnect.8 index 9bf44e9c9..c96058b0a 100644 --- a/man/man8/tcpconnect.8 +++ b/man/man8/tcpconnect.8 @@ -1,8 +1,8 @@ -.TH tcpconnect 8 "2015-08-25" "USER COMMANDS" +.TH tcpconnect 8 "2020-02-20" "USER COMMANDS" .SH NAME tcpconnect \- Trace TCP active connections (connect()). Uses Linux eBPF/bcc. .SH SYNOPSIS -.B tcpconnect [\-h] [\-c] [\-t] [\-x] [\-p PID] [-P PORT] +.B tcpconnect [\-h] [\-c] [\-t] [\-p PID] [-P PORT] [-u UID] [-U] [\-\-cgroupmap MAPPATH] [\-\-mntnsmap MAPPATH] .SH DESCRIPTION This tool traces active TCP connections (eg, via a connect() syscall; accept() are passive connections). This can be useful for general @@ -33,7 +33,6 @@ Trace this process ID only (filtered in-kernel). .TP \-P PORT Comma-separated list of destination ports to trace (filtered in-kernel). -.SH EXAMPLES .TP \-U Include a UID column. @@ -41,6 +40,13 @@ Include a UID column. \-u UID Trace this UID only (filtered in-kernel). .TP +\-\-cgroupmap MAPPATH +Trace cgroups in this BPF map only (filtered in-kernel). +.TP +\--mntnsmap MAPPATH +Trace mount namespaces in this BPF map only (filtered in-kernel). +.SH EXAMPLES +.TP Trace all active TCP connections: # .B tcpconnect @@ -68,6 +74,14 @@ Trace UID 1000 only: Count connects per src ip and dest ip/port: # .B tcpconnect \-c +.TP +Trace a set of cgroups only (see special_filtering.md from bcc sources for more details): +# +.B tcpconnect \-\-cgroupmap /sys/fs/bpf/test01 +.TP +Trace a set of mount namespaces only (see special_filtering.md from bcc sources for more details): +# +.B tcpconnect \-\-mntnsmap /sys/fs/bpf/mnt_ns_set .SH FIELDS .TP TIME(s) @@ -116,4 +130,4 @@ Unstable - in development. .SH AUTHOR Brendan Gregg .SH SEE ALSO -tcpaccept(8), funccount(8), tcpdump(8) +tcptracer(8), tcpaccept(8), funccount(8), tcpdump(8) diff --git a/man/man8/tcprtt.8 b/man/man8/tcprtt.8 new file mode 100644 index 000000000..729a1abb1 --- /dev/null +++ b/man/man8/tcprtt.8 @@ -0,0 +1,86 @@ +.TH tcprtt 8 "2020-08-23" "USER COMMANDS" +.SH NAME +tcprtt \- Trace TCP RTT of established connections. Uses Linux eBPF/bcc. +.SH SYNOPSIS +.B tcprtt [\-h] [\-T] [\-D] [\-m] [\-i INTERVAL] [\-d DURATION] [\-b] [\-B] +.SH DESCRIPTION +This tool traces established connections RTT(round-trip time) to analyze the +quality of network. This can be useful for general troubleshooting to +distinguish the network latency is from user process or physical network. + +Since this uses BPF, only the root user can use this tool. +.SH REQUIREMENTS +CONFIG_BPF and bcc. +.SH OPTIONS +.TP +\-h +Print usage message. +.TP +\-T +Include a time column on output (HH:MM:SS). +.TP +\-D +Show debug infomation of bpf text. +.TP +\-m +Output histogram in milliseconds. +.TP +\-i INTERVAL +Print output every interval seconds. +.TP +\-d DURATION +Total duration of trace in seconds. +.TP +\-p LPORT +Filter for local port. +.TP +\-P RPORT +Filter for remote port. +.TP +\-a LADDR +Filter for local address. +.TP +\-A RADDR +Filter for remote address. +.TP +\-b +Show sockets histogram by local address. +.TP +\-B +Show sockets histogram by remote address. +.SH EXAMPLES +.TP +Trace TCP RTT and print 1 second summaries, 10 times: +# +.B tcprtt \-i 1 \-d 10 +.TP +Summarize in millisecond, and timestamps: +# +.B tcprtt \-m \-T +.TP +Only trace TCP RTT for remote address 192.168.1.100 and remote port 80: +# +.B tcprtt \-i 1 \-d 10 \-A 192.168.1.100 \-P 80 +.TP +Trace local port and show a breakdown of remote hosts RTT: +# +.B tcprtt \-i 3 --lport 80 --byraddr +.SH OVERHEAD +This traces the kernel tcp_rcv_established function and collects TCP RTT. The +rate of this depends on your server application. If it is a web or proxy server +accepting many tens of thousands of connections per second. +.SH SOURCE +This is from bcc. +.IP +https://github.com/iovisor/bcc +.PP +Also look in the bcc distribution for a companion _examples.txt file containing +example usage, output, and commentary for this tool. +.SH OS +Linux +.SH STABILITY +Unstable - in development. +.SH AUTHOR +zhenwei pi +.SH SEE ALSO +tcptracer(8), tcpconnect(8), funccount(8), tcpdump(8) diff --git a/man/man8/tcpsynbl.8 b/man/man8/tcpsynbl.8 new file mode 100644 index 000000000..4dd38c8a0 --- /dev/null +++ b/man/man8/tcpsynbl.8 @@ -0,0 +1,59 @@ +.TH tcpsynbl 8 "2019-07-03" "USER COMMANDS" +.SH NAME +tcpsynbl \- Show the TCP SYN backlog as a histogram. Uses BCC/eBPF. +.SH SYNOPSIS +.B tcpsynbl +.SH DESCRIPTION +This tool shows the TCP SYN backlog size during SYN arrival as a histogram. +This lets you see how close your applications are to hitting the backlog limit +and dropping SYNs (causing performance issues with SYN retransmits), and is a +measure of workload saturation. The histogram shown is measured at the time of +SYN received, and a separate histogram is shown for each backlog limit. + +This works by tracing the tcp_v4_syn_recv_sock() and tcp_v6_syn_recv_sock() +kernel functions using dynamic instrumentation. Since these functions may +change in future kernels, this tool may need maintenance to keep working. + +Since this uses BPF, only the root user can use this tool. +.SH REQUIREMENTS +CONFIG_BPF and BCC. +.SH EXAMPLES +.TP +Show the TCP SYN backlog as a histogram. +# +.B tcpsynbl +.SH FIELDS +.TP +backlog +The backlog size when a SYN was received. +.TP +count +The number of times this backlog size was encountered. +.TP +distribution +An ASCII visualization of the count column. +.SH OVERHEAD +Inbound SYNs should be relatively low compared to packets and other events, +so the overhead of this tool is expected to be negligible. +.SH SOURCE +This originated as a bpftrace tool from the book "BPF Performance Tools", +published by Addison Wesley (2019): +.IP +http://www.brendangregg.com/bpf-performance-tools-book.html +.PP +See the book for more documentation on this tool. +.PP +This version is in the BCC repository: +.IP +https://github.com/iovisor/bcc +.PP +Also look in the bcc distribution for a companion _examples.txt file +containing example usage, output, and commentary for this tool. +.SH OS +Linux +.SH STABILITY +Unstable - in development. +.SH AUTHOR +Brendan Gregg +.SH SEE ALSO +tcptop(8) diff --git a/man/man8/tcptop.8 b/man/man8/tcptop.8 index 672e8eddd..e636f4569 100644 --- a/man/man8/tcptop.8 +++ b/man/man8/tcptop.8 @@ -1,8 +1,9 @@ -.TH tcptop 8 "2016-09-13" "USER COMMANDS" +.TH tcptop 8 "2020-03-08" "USER COMMANDS" .SH NAME tcptop \- Summarize TCP send/recv throughput by host. Top for TCP. .SH SYNOPSIS -.B tcptop [\-h] [\-C] [\-S] [\-p PID] [interval] [count] +.B tcptop [\-h] [\-C] [\-S] [\-p PID] [\-\-cgroupmap MAPPATH] + [--mntnsmap MAPPATH] [interval] [count] .SH DESCRIPTION This is top for TCP sessions. @@ -35,6 +36,12 @@ Don't print the system summary line (load averages). \-p PID Trace this PID only. .TP +\-\-cgroupmap MAPPATH +Trace cgroups in this BPF map only (filtered in-kernel). +.TP +\--mntnsmap MAPPATH +Trace mount namespaces in this BPF map only (filtered in-kernel). +.TP interval Interval between updates, seconds (default 1). .TP @@ -53,6 +60,10 @@ Don't clear the screen (rolling output), and 5 second summaries: Trace PID 181 only, and don't clear the screen: # .B tcptop \-Cp 181 +.TP +Trace a set of cgroups only (see special_filtering.md from bcc sources for more details): +# +.B tcptop \-\-cgroupmap /sys/fs/bpf/test01 .SH FIELDS .TP loadavg: diff --git a/man/man8/tcptracer.8 b/man/man8/tcptracer.8 index b5b306171..d2346c776 100644 --- a/man/man8/tcptracer.8 +++ b/man/man8/tcptracer.8 @@ -1,8 +1,8 @@ -.TH tcptracer 8 "2017-03-27" "USER COMMANDS" +.TH tcptracer 8 "2020-02-20" "USER COMMANDS" .SH NAME tcptracer \- Trace TCP established connections. Uses Linux eBPF/bcc. .SH SYNOPSIS -.B tcptracer [\-h] [\-v] [\-p PID] [\-N NETNS] +.B tcptracer [\-h] [\-v] [\-p PID] [\-N NETNS] [\-\-cgroupmap MAPPATH] [--mntnsmap MAPPATH] .SH DESCRIPTION This tool traces established TCP connections that open and close while tracing, and prints a line of output per connect, accept and close events. This includes @@ -29,6 +29,11 @@ Trace this process ID only (filtered in-kernel). \-N NETNS Trace this network namespace only (filtered in-kernel). .TP +\-\-cgroupmap MAPPATH +Trace cgroups in this BPF map only (filtered in-kernel). +.TP +\-\-mntnsmap MAPPATH +Trace mount namespaces in the map (filtered in-kernel). .SH EXAMPLES .TP Trace all TCP established connections: @@ -46,6 +51,10 @@ Trace PID 181 only: Trace connections in network namespace 4026531969 only: # .B tcptracer \-N 4026531969 +.TP +Trace a set of cgroups only (see special_filtering.md from bcc sources for more details): +# +.B tcptracer \-\-cgroupmap /sys/fs/bpf/test01 .SH FIELDS .TP TYPE diff --git a/man/man8/threadsnoop.8 b/man/man8/threadsnoop.8 new file mode 100644 index 000000000..3c655f247 --- /dev/null +++ b/man/man8/threadsnoop.8 @@ -0,0 +1,60 @@ +.TH threadsnoop 8 "2019-07-02" "USER COMMANDS" +.SH NAME +threadsnoop \- Trace thread creation via pthread_create(). Uses BCC/eBPF. +.SH SYNOPSIS +.B threadsnoop +.SH DESCRIPTION +threadsnoop traces calls to pthread_create(), showing this path of thread +creation. This can be used for workload characterization and discovery, and is +a companion to execsnoop(8) which traces execve(2). + +This works by tracing the pthread_create() from libpthread.so.0. The path +to this library may need adjusting in the tool source to match your system. + +Since this uses BPF, only the root user can use this tool. +.SH REQUIREMENTS +CONFIG_BPF and BCC. +.SH EXAMPLES +.TP +Trace calls pthread_create(): +# +.B threadsnoop +.SH FIELDS +.TP +TIME(ms) +Elapsed time since the tool began tracing (in milliseconds). +.TP +PID +The process ID. +.TP +COMM +The process (thread) name. +.TP +FUNC +The name of the start routine, if the symbol is available, else a hex address +for the start routine address. +.SH OVERHEAD +Thread creation is expected to be low (<< 1000/s), so the overhead of this +tool is expected to be negligible. +.SH SOURCE +This originated as a bpftrace tool from the book "BPF Performance Tools", +published by Addison Wesley (2019): +.IP +http://www.brendangregg.com/bpf-performance-tools-book.html +.PP +See the book for more documentation on this tool. +.PP +This version is in the BCC repository: +.IP +https://github.com/iovisor/bcc +.PP +Also look in the bcc distribution for a companion _examples.txt file +containing example usage, output, and commentary for this tool. +.SH OS +Linux +.SH STABILITY +Unstable - in development. +.SH AUTHOR +Brendan Gregg +.SH SEE ALSO +execsnoop(8) diff --git a/man/man8/trace.8 b/man/man8/trace.8 index 0b27dbd60..e4f06fc7c 100644 --- a/man/man8/trace.8 +++ b/man/man8/trace.8 @@ -86,7 +86,7 @@ information. See PROBE SYNTAX below. .SH PROBE SYNTAX The general probe syntax is as follows: -.B [{p,r}]:[library]:function[(signature)] [(predicate)] ["format string"[, arguments]] +.B [{p,r}]:[library]:function[+offset][(signature)] [(predicate)] ["format string"[, arguments]] .B {t:category:event,u:library:probe} [(predicate)] ["format string"[, arguments]] .TP @@ -107,6 +107,10 @@ The tracepoint category. For example, "sched" or "irq". .TP .B function The function to probe. +.B offset +The offset after the address of the function where the probe should injected. +For example "kfree_skb+56" in decimal or hexadecimal "kfree_skb+0x38" format. +Only works with kprobes and uprobes. Zero if omitted. .TP .B signature The optional signature of the function to probe. This can make it easier to diff --git a/scripts/build-deb.sh b/scripts/build-deb.sh index 1e450b664..2fe7e3bc1 100755 --- a/scripts/build-deb.sh +++ b/scripts/build-deb.sh @@ -1,6 +1,6 @@ #!/bin/bash -# helper script to be invoked by jenkins/buildbot +# helper script to be invoked by jenkins/buildbot or github actions # $1 [optional]: the build type - release | nightly | test buildtype=${1:-test} diff --git a/scripts/docker/auth.sh b/scripts/docker/auth.sh new file mode 100755 index 000000000..a4166be4d --- /dev/null +++ b/scripts/docker/auth.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +# For now only quay.io is supported, but this could be portable to dockerhub +# and other image repositories. + +# Forks can push using this approach if they create a quay.io bot user +# with name matching of ORGNAME+bcc_buildbot, or by setting QUAY_BOT_NAME + +git_repo=$1 # github.repository format: ORGNAME/REPONAME + +# Set this value as QUAY_TOKEN in the github repository settings "Secrets" tab +[[ -z "${QUAY_TOKEN}" ]] && echo "QUAY_TOKEN not set" && exit 0 + +# Set this to match the name of the bot user on quay.io +[[ -z "${QUAY_BOT_NAME}" ]] && QUAY_BOT_NAME="bcc_buildbot" + +quay_user="$(dirname ${git_repo})+${QUAY_BOT_NAME}" +echo "${QUAY_TOKEN}" | docker login -u="${quay_user}" --password-stdin quay.io diff --git a/scripts/docker/build.sh b/scripts/docker/build.sh new file mode 100755 index 000000000..e2952c337 --- /dev/null +++ b/scripts/docker/build.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e +# Builds debian packages using docker wrapper + +function help() { + message=$1 + echo "USAGE: build.sh DOCKER_REPO DOCKER_TAG OS_TAG [DISTRO]" + echo "hint: ${message}" +} + +docker_repo=$1 +docker_tag=$2 +os_tag=$3 +distro=${4:-ubuntu} + +[ -z "${docker_repo}" ] && help "You must specify repo, eg: quay.io/iovisoc/bcc" && exit 1 +[ -z "${docker_tag}" ] && help "You must specify tag, eg: bionic-release-master, latest, SHA, git tag, etc " && exit 1 +[ -z "${os_tag}" ] && help "You must specify os tag, eg: 18.04, bionic, etc " && exit 1 + + +# The main docker image build, +echo "Building ${distro} ${os_tag} release docker image for ${docker_repo}:${docker_tag}" +docker build -t ${docker_repo}:${docker_tag} --build-arg OS_TAG=${os_tag} -f Dockerfile.${distro} . + +echo "Copying build artifacts to $(pwd)/output" +mkdir -p output +docker run -v $(pwd)/output:/output ${docker_repo}:${docker_tag} /bin/bash -c "cp /root/bcc/* /output" diff --git a/scripts/docker/push.sh b/scripts/docker/push.sh new file mode 100755 index 000000000..8a485263e --- /dev/null +++ b/scripts/docker/push.sh @@ -0,0 +1,64 @@ +#!/bin/bash +set -e + +# Push docker tags to a configured docker repo, defaulting to quay.io +# You must run login.sh before running this script. + +DEFAULT_DOCKER_REPO="quay.io" +DEFAULT_RELEASE_TARGET="bionic-release" # will allow unprefixed tags + +# Currently only support pushing to quay.io +DOCKER_REPO=${DEFAULT_DOCKER_REPO} + +git_repo=$1 # github.repository format: ORGNAME/REPONAME +git_ref=$2 # github.ref format: refs/REMOTE/REF + # eg, refs/heads/BRANCH + # refs/tags/v0.9.6-pre +git_sha=$3 # github.sha GIT_SHA +type_name=$4 # build name, s/+/_/g eg, bionic-release +os_tag=${5:-18.04} # numeric docker tag eg, 18.04 + +# refname will be either a branch like "master" or "some-branch", +# or a tag, like "v1.17.0-pre". +# When a tag is pushed, a build is done for both the branch and the tag, as +# separate builds. +# This is a feature specific to github actions based on the `github.ref` object +refname=$(basename ${git_ref}) + +# The build type needs to be sanitized into a valid tag, replacing + with _ +type_tag="$(echo ${type_name} | sed 's/+/_/g')" + + +echo "Triggering image build" +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +${SCRIPT_DIR}/build.sh ${DOCKER_REPO}/${git_repo} ${git_sha}-${type_tag} ${os_tag} + +echo "Upload image for git sha ${git_sha} to ${DOCKER_REPO}/${git_repo}" +docker push ${DOCKER_REPO}/${git_repo}:${git_sha}-${type_tag} + +echo "Push tags to branch or git tag HEAD refs" +docker tag ${DOCKER_REPO}/${git_repo}:${git_sha}-${type_tag} ${DOCKER_REPO}/${git_repo}:${refname}-${type_tag} +docker push ${DOCKER_REPO}/${git_repo}:${refname}-${type_tag} + +# Only push to un-suffixed tags for the default release target build type +if [[ "${type_name}" == "${DEFAULT_RELEASE_TARGET}"* ]];then + + # Update branch / git tag ref + echo "Pushing tags for ${DOCKER_REPO}/${git_repo}:${refname}" + docker tag ${DOCKER_REPO}/${git_repo}:${git_sha}-${type_tag} ${DOCKER_REPO}/${git_repo}:${refname} + docker push ${DOCKER_REPO}/${git_repo}:${refname} + + if [[ "${refname}" == "master" ]];then + if [[ "${edge}" == "ON" ]];then + echo "This is an edge build on master, pushing ${DOCKER_REPO}/${git_repo}:edge" + docker tag ${DOCKER_REPO}/${git_repo}:${git_sha}-${type_tag} ${DOCKER_REPO}/${git_repo}:edge + docker push ${DOCKER_REPO}/${git_repo}:edge + else + echo "This is a build on master, pushing ${DOCKER_REPO}/${git_repo}:latest :SHA as well" + docker tag ${DOCKER_REPO}/${git_repo}:${git_sha}-${type_tag} ${DOCKER_REPO}/${git_repo}:latest + docker tag ${DOCKER_REPO}/${git_repo}:${git_sha}-${type_tag} ${DOCKER_REPO}/${git_repo}:${git_sha} + docker push ${DOCKER_REPO}/${git_repo}:latest + docker push ${DOCKER_REPO}/${git_repo}:${git_sha} + fi + fi +fi diff --git a/scripts/git-tag.sh b/scripts/git-tag.sh index 073b4a175..5aef730d5 100644 --- a/scripts/git-tag.sh +++ b/scripts/git-tag.sh @@ -1,4 +1,4 @@ -git_tag_latest=$(git describe --abbrev=0) +git_tag_latest=$(git describe --tags --abbrev=0) git_rev_count=$(git rev-list $git_tag_latest.. --count) git_rev_count=$[$git_rev_count+1] git_subject=$(git log --pretty="%s" -n 1) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 500cb9203..950ed7d44 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -135,6 +135,8 @@ apps: command: bcc-wrapper dcstat deadlock: command: bcc-wrapper deadlock + drsnoop: + command: bcc-wrapper drsnoop execsnoop: command: bcc-wrapper execsnoop ext4dist: diff --git a/src/cc/CMakeLists.txt b/src/cc/CMakeLists.txt index cc8b769b9..4021c6621 100644 --- a/src/cc/CMakeLists.txt +++ b/src/cc/CMakeLists.txt @@ -12,8 +12,13 @@ include_directories(${LIBELF_INCLUDE_DIRS}) # todo: if check for kernel version include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libbpf/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libbpf/include/uapi) -add_definitions(${LLVM_DEFINITIONS}) -configure_file(libbcc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libbcc.pc @ONLY) + +# add_definitions has a problem parsing "-D_GLIBCXX_USE_CXX11_ABI=0", this is safer +separate_arguments(LLVM_DEFINITIONS) +add_compile_options(${LLVM_DEFINITIONS}) + +configure_file(libbcc.pc.in libbcc.pc @ONLY) +configure_file(bcc_version.h.in bcc_version.h @ONLY) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DBCC_PROG_TAG_DIR='\"${BCC_PROG_TAG_DIR}\"'") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result") @@ -28,13 +33,15 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLLVM_MAJOR_VERSION=${CMAKE_MATCH_1}") include(static_libstdc++) -if(LIBBPF_FOUND) - # We need to include the libbpf packaged source to get the - # headers location, becaseu they are installed under 'bpf' - # directory, but the libbpf code references them localy - - include_directories(${LIBBPF_INCLUDE_DIR}/bpf) +if(LIBBPF_INCLUDE_DIR) + # Add user libbpf include and notify compilation + # that we are using external libbpf. It's checked + # in src/cc/libbpf.h and proper files are included. + include_directories(${LIBBPF_INCLUDE_DIR}) + add_definitions(-DHAVE_EXTERNAL_LIBBPF) +endif() +if(LIBBPF_FOUND) set(extract_dir ${CMAKE_CURRENT_BINARY_DIR}/libbpf_a_extract) execute_process(COMMAND sh -c "mkdir -p ${extract_dir} && cd ${extract_dir} && ${CMAKE_AR} x ${LIBBPF_STATIC_LIBRARIES}") file(GLOB libbpf_sources "${extract_dir}/*.o") @@ -64,7 +71,7 @@ endif() set(bcc_table_sources table_storage.cc shared_table.cc bpffs_table.cc json_map_decl_visitor.cc) set(bcc_util_sources common.cc) set(bcc_sym_sources bcc_syms.cc bcc_elf.c bcc_perf_map.c bcc_proc.c) -set(bcc_common_headers libbpf.h perf_reader.h) +set(bcc_common_headers libbpf.h perf_reader.h "${CMAKE_CURRENT_BINARY_DIR}/bcc_version.h") set(bcc_table_headers file_desc.h table_desc.h table_storage.h) set(bcc_api_headers bcc_common.h bpf_module.h bcc_exception.h bcc_syms.h bcc_proc.h bcc_elf.h) diff --git a/src/cc/api/BPF.cc b/src/cc/api/BPF.cc index a3a14fee9..1c1242c5b 100644 --- a/src/cc/api/BPF.cc +++ b/src/cc/api/BPF.cc @@ -64,7 +64,7 @@ StatusTuple BPF::init_usdt(const USDT& usdt) { usdt_.push_back(std::move(u)); all_bpf_program_ += usdt_.back().program_text_; - return StatusTuple(0); + return StatusTuple::OK(); } void BPF::init_fail_reset() { @@ -95,7 +95,7 @@ StatusTuple BPF::init(const std::string& bpf_program, return StatusTuple(-1, "Unable to initialize BPF program"); } - return StatusTuple(0); + return StatusTuple::OK(); }; BPF::~BPF() { @@ -138,6 +138,15 @@ StatusTuple BPF::detach_all() { } } + for (auto& it : raw_tracepoints_) { + auto res = detach_raw_tracepoint_event(it.first, it.second); + if (res.code() != 0) { + error_msg += "Failed to detach Raw tracepoint " + it.first + ": "; + error_msg += res.msg() + "\n"; + has_error = true; + } + } + for (auto& it : perf_buffers_) { auto res = it.second->close_all_cpu(); if (res.code() != 0) { @@ -178,7 +187,7 @@ StatusTuple BPF::detach_all() { if (has_error) return StatusTuple(-1, error_msg); else - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::attach_kprobe(const std::string& kernel_func, @@ -208,7 +217,7 @@ StatusTuple BPF::attach_kprobe(const std::string& kernel_func, p.perf_event_fd = res_fd; p.func = probe_func; kprobes_[probe_event] = std::move(p); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::attach_uprobe(const std::string& binary_path, @@ -252,49 +261,64 @@ StatusTuple BPF::attach_uprobe(const std::string& binary_path, p.perf_event_fd = res_fd; p.func = probe_func; uprobes_[probe_event] = std::move(p); - return StatusTuple(0); + return StatusTuple::OK(); +} + +StatusTuple BPF::attach_usdt_without_validation(const USDT& u, pid_t pid) { + auto& probe = *static_cast<::USDT::Probe*>(u.probe_.get()); + if (!probe.enable(u.probe_func_)) + return StatusTuple(-1, "Unable to enable USDT %s" + u.print_name()); + + bool failed = false; + std::string err_msg; + int cnt = 0; + for (const auto& loc : probe.locations_) { + auto res = attach_uprobe(loc.bin_path_, std::string(), u.probe_func_, + loc.address_, BPF_PROBE_ENTRY, pid); + if (!res.ok()) { + failed = true; + err_msg += "USDT " + u.print_name() + " at " + loc.bin_path_ + + " address " + std::to_string(loc.address_); + err_msg += ": " + res.msg() + "\n"; + break; + } + cnt++; + } + if (failed) { + for (int i = 0; i < cnt; i++) { + auto res = detach_uprobe(probe.locations_[i].bin_path_, std::string(), + probe.locations_[i].address_, BPF_PROBE_ENTRY, pid); + if (!res.ok()) + err_msg += "During clean up: " + res.msg() + "\n"; + } + return StatusTuple(-1, err_msg); + } else { + return StatusTuple::OK(); + } } StatusTuple BPF::attach_usdt(const USDT& usdt, pid_t pid) { for (const auto& u : usdt_) { if (u == usdt) { - auto& probe = *static_cast<::USDT::Probe*>(u.probe_.get()); - if (!probe.enable(u.probe_func_)) - return StatusTuple(-1, "Unable to enable USDT " + u.print_name()); - - bool failed = false; - std::string err_msg; - int cnt = 0; - for (const auto& loc : probe.locations_) { - auto res = attach_uprobe(loc.bin_path_, std::string(), u.probe_func_, - loc.address_, BPF_PROBE_ENTRY, pid); - if (res.code() != 0) { - failed = true; - err_msg += "USDT " + u.print_name() + " at " + loc.bin_path_ + - " address " + std::to_string(loc.address_); - err_msg += ": " + res.msg() + "\n"; - break; - } - cnt++; - } - if (failed) { - for (int i = 0; i < cnt; i++) { - auto res = - detach_uprobe(probe.locations_[i].bin_path_, std::string(), - probe.locations_[i].address_, BPF_PROBE_ENTRY, pid); - if (res.code() != 0) - err_msg += "During clean up: " + res.msg() + "\n"; - } - return StatusTuple(-1, err_msg); - } else { - return StatusTuple(0); - } + return attach_usdt_without_validation(u, pid); } } return StatusTuple(-1, "USDT %s not found", usdt.print_name().c_str()); } +StatusTuple BPF::attach_usdt_all() { + for (const auto& u : usdt_) { + auto res = attach_usdt_without_validation(u, -1); + if (!res.ok()) { + return res; + } + } + + return StatusTuple::OK(); +} + + StatusTuple BPF::attach_tracepoint(const std::string& tracepoint, const std::string& probe_func) { if (tracepoints_.find(tracepoint) != tracepoints_.end()) @@ -323,7 +347,30 @@ StatusTuple BPF::attach_tracepoint(const std::string& tracepoint, p.perf_event_fd = res_fd; p.func = probe_func; tracepoints_[tracepoint] = std::move(p); - return StatusTuple(0); + return StatusTuple::OK(); +} + +StatusTuple BPF::attach_raw_tracepoint(const std::string& tracepoint, const std::string& probe_func) { + if (raw_tracepoints_.find(tracepoint) != raw_tracepoints_.end()) + return StatusTuple(-1, "Raw tracepoint %s already attached", + tracepoint.c_str()); + + int probe_fd; + TRY2(load_func(probe_func, BPF_PROG_TYPE_RAW_TRACEPOINT, probe_fd)); + + int res_fd = bpf_attach_raw_tracepoint(probe_fd, tracepoint.c_str()); + + if (res_fd < 0) { + TRY2(unload_func(probe_func)); + return StatusTuple(-1, "Unable to attach Raw tracepoint %s using %s", + tracepoint.c_str(), probe_func.c_str()); + } + + open_probe_t p = {}; + p.perf_event_fd = res_fd; + p.func = probe_func; + raw_tracepoints_[tracepoint] = std::move(p); + return StatusTuple::OK(); } StatusTuple BPF::attach_perf_event(uint32_t ev_type, uint32_t ev_config, @@ -363,7 +410,7 @@ StatusTuple BPF::attach_perf_event(uint32_t ev_type, uint32_t ev_config, p.func = probe_func; p.per_cpu_fd = fds; perf_events_[ev_pair] = std::move(p); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::attach_perf_event_raw(void* perf_event_attr, @@ -404,7 +451,7 @@ StatusTuple BPF::attach_perf_event_raw(void* perf_event_attr, p.func = probe_func; p.per_cpu_fd = fds; perf_events_[ev_pair] = std::move(p); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::detach_kprobe(const std::string& kernel_func, @@ -419,7 +466,7 @@ StatusTuple BPF::detach_kprobe(const std::string& kernel_func, TRY2(detach_kprobe_event(it->first, it->second)); kprobes_.erase(it); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::detach_uprobe(const std::string& binary_path, @@ -440,41 +487,56 @@ StatusTuple BPF::detach_uprobe(const std::string& binary_path, TRY2(detach_uprobe_event(it->first, it->second)); uprobes_.erase(it); - return StatusTuple(0); + return StatusTuple::OK(); +} + +StatusTuple BPF::detach_usdt_without_validation(const USDT& u, pid_t pid) { + auto& probe = *static_cast<::USDT::Probe*>(u.probe_.get()); + bool failed = false; + std::string err_msg; + for (const auto& loc : probe.locations_) { + auto res = detach_uprobe(loc.bin_path_, std::string(), loc.address_, + BPF_PROBE_ENTRY, pid); + if (!res.ok()) { + failed = true; + err_msg += "USDT " + u.print_name() + " at " + loc.bin_path_ + + " address " + std::to_string(loc.address_); + err_msg += ": " + res.msg() + "\n"; + } + } + + if (!probe.disable()) { + failed = true; + err_msg += "Unable to disable USDT " + u.print_name(); + } + + if (failed) + return StatusTuple(-1, err_msg); + else + return StatusTuple::OK(); } StatusTuple BPF::detach_usdt(const USDT& usdt, pid_t pid) { for (const auto& u : usdt_) { if (u == usdt) { - auto& probe = *static_cast<::USDT::Probe*>(u.probe_.get()); - bool failed = false; - std::string err_msg; - for (const auto& loc : probe.locations_) { - auto res = detach_uprobe(loc.bin_path_, std::string(), loc.address_, - BPF_PROBE_ENTRY, pid); - if (res.code() != 0) { - failed = true; - err_msg += "USDT " + u.print_name() + " at " + loc.bin_path_ + - " address " + std::to_string(loc.address_); - err_msg += ": " + res.msg() + "\n"; - } - } - - if (!probe.disable()) { - failed = true; - err_msg += "Unable to disable USDT " + u.print_name(); - } - - if (failed) - return StatusTuple(-1, err_msg); - else - return StatusTuple(0); + return detach_usdt_without_validation(u, pid); } } return StatusTuple(-1, "USDT %s not found", usdt.print_name().c_str()); } +StatusTuple BPF::detach_usdt_all() { + for (const auto& u : usdt_) { + auto ret = detach_usdt_without_validation(u, -1); + if (!ret.ok()) { + return ret; + } + } + + return StatusTuple::OK(); +} + StatusTuple BPF::detach_tracepoint(const std::string& tracepoint) { auto it = tracepoints_.find(tracepoint); if (it == tracepoints_.end()) @@ -482,7 +544,17 @@ StatusTuple BPF::detach_tracepoint(const std::string& tracepoint) { TRY2(detach_tracepoint_event(it->first, it->second)); tracepoints_.erase(it); - return StatusTuple(0); + return StatusTuple::OK(); +} + +StatusTuple BPF::detach_raw_tracepoint(const std::string& tracepoint) { + auto it = raw_tracepoints_.find(tracepoint); + if (it == raw_tracepoints_.end()) + return StatusTuple(-1, "No open Raw tracepoint %s", tracepoint.c_str()); + + TRY2(detach_raw_tracepoint_event(it->first, it->second)); + raw_tracepoints_.erase(it); + return StatusTuple::OK(); } StatusTuple BPF::detach_perf_event(uint32_t ev_type, uint32_t ev_config) { @@ -492,7 +564,7 @@ StatusTuple BPF::detach_perf_event(uint32_t ev_type, uint32_t ev_config) { ev_config); TRY2(detach_perf_event_all_cpu(it->second)); perf_events_.erase(it); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::detach_perf_event_raw(void* perf_event_attr) { @@ -511,7 +583,7 @@ StatusTuple BPF::open_perf_event(const std::string& name, uint32_t type, } auto table = perf_event_arrays_[name]; TRY2(table->open_all_cpu(type, config)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::close_perf_event(const std::string& name) { @@ -519,7 +591,7 @@ StatusTuple BPF::close_perf_event(const std::string& name) { if (it == perf_event_arrays_.end()) return StatusTuple(-1, "Perf Event for %s not open", name.c_str()); TRY2(it->second->close_all_cpu()); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::open_perf_buffer(const std::string& name, @@ -538,7 +610,7 @@ StatusTuple BPF::open_perf_buffer(const std::string& name, return StatusTuple(-1, "open_perf_buffer page_cnt must be a power of two"); auto table = perf_buffers_[name]; TRY2(table->open_all_cpu(cb, lost_cb, cb_cookie, page_cnt)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::close_perf_buffer(const std::string& name) { @@ -546,7 +618,7 @@ StatusTuple BPF::close_perf_buffer(const std::string& name) { if (it == perf_buffers_.end()) return StatusTuple(-1, "Perf buffer for %s not open", name.c_str()); TRY2(it->second->close_all_cpu()); - return StatusTuple(0); + return StatusTuple::OK(); } BPFPerfBuffer* BPF::get_perf_buffer(const std::string& name) { @@ -565,7 +637,7 @@ StatusTuple BPF::load_func(const std::string& func_name, bpf_prog_type type, int& fd) { if (funcs_.find(func_name) != funcs_.end()) { fd = funcs_[func_name]; - return StatusTuple(0); + return StatusTuple::OK(); } uint8_t* func_start = bpf_module_->function_start(func_name); @@ -593,20 +665,20 @@ StatusTuple BPF::load_func(const std::string& func_name, bpf_prog_type type, if (ret < 0) fprintf(stderr, "WARNING: cannot get prog tag, ignore saving source with program tag\n"); funcs_[func_name] = fd; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::unload_func(const std::string& func_name) { auto it = funcs_.find(func_name); if (it == funcs_.end()) - return StatusTuple(0); + return StatusTuple::OK(); int res = close(it->second); if (res != 0) return StatusTuple(-1, "Can't close FD for %s: %d", it->first.c_str(), res); funcs_.erase(it); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::attach_func(int prog_fd, int attachable_fd, @@ -618,7 +690,7 @@ StatusTuple BPF::attach_func(int prog_fd, int attachable_fd, "attach_type %d, flags %ld: error %d", prog_fd, attachable_fd, attach_type, flags, res); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::detach_func(int prog_fd, int attachable_fd, @@ -629,7 +701,7 @@ StatusTuple BPF::detach_func(int prog_fd, int attachable_fd, "attach_type %d: error %d", prog_fd, attachable_fd, attach_type, res); - return StatusTuple(0); + return StatusTuple::OK(); } std::string BPF::get_syscall_fnname(const std::string& name) { @@ -669,7 +741,7 @@ StatusTuple BPF::check_binary_symbol(const std::string& binary_path, module_res = ""; } offset_res = output.offset + symbol_offset; - return StatusTuple(0); + return StatusTuple::OK(); } std::string BPF::get_kprobe_event(const std::string& kernel_func, @@ -768,7 +840,7 @@ StatusTuple BPF::detach_kprobe_event(const std::string& event, TRY2(unload_func(attr.func)); if (bpf_detach_kprobe(event.c_str()) < 0) return StatusTuple(-1, "Unable to detach kprobe %s", event.c_str()); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::detach_uprobe_event(const std::string& event, @@ -777,7 +849,7 @@ StatusTuple BPF::detach_uprobe_event(const std::string& event, TRY2(unload_func(attr.func)); if (bpf_detach_uprobe(event.c_str()) < 0) return StatusTuple(-1, "Unable to detach uprobe %s", event.c_str()); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPF::detach_tracepoint_event(const std::string& tracepoint, @@ -786,7 +858,15 @@ StatusTuple BPF::detach_tracepoint_event(const std::string& tracepoint, TRY2(unload_func(attr.func)); // TODO: bpf_detach_tracepoint currently does nothing. - return StatusTuple(0); + return StatusTuple::OK(); +} + +StatusTuple BPF::detach_raw_tracepoint_event(const std::string& tracepoint, + open_probe_t& attr) { + TRY2(close(attr.perf_event_fd)); + TRY2(unload_func(attr.func)); + + return StatusTuple::OK(); } StatusTuple BPF::detach_perf_event_all_cpu(open_probe_t& attr) { @@ -806,7 +886,7 @@ StatusTuple BPF::detach_perf_event_all_cpu(open_probe_t& attr) { if (has_error) return StatusTuple(-1, err_msg); - return StatusTuple(0); + return StatusTuple::OK(); } int BPF::free_bcc_memory() { @@ -918,7 +998,7 @@ StatusTuple USDT::init() { program_text_ = ::USDT::USDT_PROGRAM_HEADER + stream.str(); initialized_ = true; - return StatusTuple(0); + return StatusTuple::OK(); } } // namespace ebpf diff --git a/src/cc/api/BPF.h b/src/cc/api/BPF.h index 612f2b526..f3096d740 100644 --- a/src/cc/api/BPF.h +++ b/src/cc/api/BPF.h @@ -85,12 +85,18 @@ class BPF { pid_t pid = -1, uint64_t symbol_offset = 0); StatusTuple attach_usdt(const USDT& usdt, pid_t pid = -1); + StatusTuple attach_usdt_all(); StatusTuple detach_usdt(const USDT& usdt, pid_t pid = -1); + StatusTuple detach_usdt_all(); StatusTuple attach_tracepoint(const std::string& tracepoint, const std::string& probe_func); StatusTuple detach_tracepoint(const std::string& tracepoint); + StatusTuple attach_raw_tracepoint(const std::string& tracepoint, + const std::string& probe_func); + StatusTuple detach_raw_tracepoint(const std::string& tracepoint); + StatusTuple attach_perf_event(uint32_t ev_type, uint32_t ev_config, const std::string& probe_func, uint64_t sample_period, uint64_t sample_freq, @@ -170,6 +176,14 @@ class BPF { return BPFPercpuCgStorageTable({}); } + template + BPFQueueStackTable get_queuestack_table(const std::string& name) { + TableStorage::iterator it; + if (bpf_module_->table_storage().Find(Path({bpf_module_->id(), name}), it)) + return BPFQueueStackTable(it->second); + return BPFQueueStackTable({}); + } + void* get_bsymcache(void) { if (bsymcache_ == NULL) { bsymcache_ = bcc_buildsymcache_new(); @@ -244,10 +258,15 @@ class BPF { std::string get_uprobe_event(const std::string& binary_path, uint64_t offset, bpf_probe_attach_type type, pid_t pid); + StatusTuple attach_usdt_without_validation(const USDT& usdt, pid_t pid); + StatusTuple detach_usdt_without_validation(const USDT& usdt, pid_t pid); + StatusTuple detach_kprobe_event(const std::string& event, open_probe_t& attr); StatusTuple detach_uprobe_event(const std::string& event, open_probe_t& attr); StatusTuple detach_tracepoint_event(const std::string& tracepoint, open_probe_t& attr); + StatusTuple detach_raw_tracepoint_event(const std::string& tracepoint, + open_probe_t& attr); StatusTuple detach_perf_event_all_cpu(open_probe_t& attr); std::string attach_type_debug(bpf_probe_attach_type type) { @@ -302,6 +321,7 @@ class BPF { std::map kprobes_; std::map uprobes_; std::map tracepoints_; + std::map raw_tracepoints_; std::map perf_buffers_; std::map perf_event_arrays_; std::map, open_probe_t> perf_events_; @@ -318,6 +338,12 @@ class USDT { USDT(const USDT& usdt); USDT(USDT&& usdt) noexcept; + const std::string &binary_path() const { return binary_path_; } + pid_t pid() const { return pid_; } + const std::string &provider() const { return provider_; } + const std::string &name() const { return name_; } + const std::string &probe_func() const { return probe_func_; } + StatusTuple init(); bool operator==(const USDT& other) const; diff --git a/src/cc/api/BPFTable.cc b/src/cc/api/BPFTable.cc index db62de74b..1ea04e3e5 100644 --- a/src/cc/api/BPFTable.cc +++ b/src/cc/api/BPFTable.cc @@ -78,7 +78,7 @@ StatusTuple BPFTable::get_value(const std::string& key_str, if (r.code() != 0) return r; } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFTable::update_value(const std::string& key_str, @@ -99,7 +99,7 @@ StatusTuple BPFTable::update_value(const std::string& key_str, if (!update(key, value)) return StatusTuple(-1, "error updating element"); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFTable::update_value(const std::string& key_str, @@ -126,7 +126,7 @@ StatusTuple BPFTable::update_value(const std::string& key_str, if (!update(key, value)) return StatusTuple(-1, "error updating element"); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFTable::remove_value(const std::string& key_str) { @@ -141,11 +141,11 @@ StatusTuple BPFTable::remove_value(const std::string& key_str) { if (!remove(key)) return StatusTuple(-1, "error removing element"); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFTable::clear_table_non_atomic() { - if (desc.type == BPF_MAP_TYPE_HASH || desc.type == BPF_MAP_TYPE_PERCPU_HASH || + if (desc.type == BPF_MAP_TYPE_HASH || desc.type == BPF_MAP_TYPE_LRU_HASH || desc.type == BPF_MAP_TYPE_PERCPU_HASH || desc.type == BPF_MAP_TYPE_HASH_OF_MAPS) { @@ -177,7 +177,7 @@ StatusTuple BPFTable::clear_table_non_atomic() { desc.name.c_str()); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFTable::get_table_offline( @@ -225,7 +225,7 @@ StatusTuple BPFTable::get_table_offline( res.clear(); // For other maps, try to use the first() and next() interfaces if (!this->first(key.get())) - return StatusTuple(0); + return StatusTuple::OK(); while (true) { if (!this->lookup(key.get(), value.get())) @@ -243,7 +243,7 @@ StatusTuple BPFTable::get_table_offline( } } - return StatusTuple(0); + return StatusTuple::OK(); } size_t BPFTable::get_possible_cpu_count() { return get_possible_cpus().size(); } @@ -417,7 +417,7 @@ StatusTuple BPFPerfBuffer::open_on_cpu(perf_reader_raw_cb cb, } cpu_readers_[cpu] = reader; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFPerfBuffer::open_all_cpu(perf_reader_raw_cb cb, @@ -437,18 +437,18 @@ StatusTuple BPFPerfBuffer::open_all_cpu(perf_reader_raw_cb cb, return res; } } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFPerfBuffer::close_on_cpu(int cpu) { auto it = cpu_readers_.find(cpu); if (it == cpu_readers_.end()) - return StatusTuple(0); + return StatusTuple::OK(); perf_reader_free(static_cast(it->second)); if (!remove(const_cast(&(it->first)))) return StatusTuple(-1, "Unable to close perf buffer on CPU %d", it->first); cpu_readers_.erase(it); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFPerfBuffer::close_all_cpu() { @@ -479,7 +479,7 @@ StatusTuple BPFPerfBuffer::close_all_cpu() { if (has_error) return StatusTuple(-1, errors); - return StatusTuple(0); + return StatusTuple::OK(); } int BPFPerfBuffer::poll(int timeout_ms) { @@ -519,7 +519,7 @@ StatusTuple BPFPerfEventArray::open_all_cpu(uint32_t type, uint64_t config) { return res; } } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFPerfEventArray::close_all_cpu() { @@ -540,7 +540,7 @@ StatusTuple BPFPerfEventArray::close_all_cpu() { if (has_error) return StatusTuple(-1, errors); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFPerfEventArray::open_on_cpu(int cpu, uint32_t type, @@ -558,17 +558,17 @@ StatusTuple BPFPerfEventArray::open_on_cpu(int cpu, uint32_t type, std::strerror(errno)); } cpu_fds_[cpu] = fd; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFPerfEventArray::close_on_cpu(int cpu) { auto it = cpu_fds_.find(cpu); if (it == cpu_fds_.end()) { - return StatusTuple(0); + return StatusTuple::OK(); } bpf_close_perf_event_fd(it->second); cpu_fds_.erase(it); - return StatusTuple(0); + return StatusTuple::OK(); } BPFPerfEventArray::~BPFPerfEventArray() { @@ -589,13 +589,13 @@ BPFProgTable::BPFProgTable(const TableDesc& desc) StatusTuple BPFProgTable::update_value(const int& index, const int& prog_fd) { if (!this->update(const_cast(&index), const_cast(&prog_fd))) return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFProgTable::remove_value(const int& index) { if (!this->remove(const_cast(&index))) return StatusTuple(-1, "Error removing value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } BPFCgroupArray::BPFCgroupArray(const TableDesc& desc) @@ -609,7 +609,7 @@ StatusTuple BPFCgroupArray::update_value(const int& index, const int& cgroup2_fd) { if (!this->update(const_cast(&index), const_cast(&cgroup2_fd))) return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFCgroupArray::update_value(const int& index, @@ -618,13 +618,13 @@ StatusTuple BPFCgroupArray::update_value(const int& index, if ((int)f < 0) return StatusTuple(-1, "Unable to open %s", cgroup2_path.c_str()); TRY2(update_value(index, (int)f)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFCgroupArray::remove_value(const int& index) { if (!this->remove(const_cast(&index))) return StatusTuple(-1, "Error removing value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } BPFDevmapTable::BPFDevmapTable(const TableDesc& desc) @@ -638,20 +638,20 @@ StatusTuple BPFDevmapTable::update_value(const int& index, const int& value) { if (!this->update(const_cast(&index), const_cast(&value))) return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFDevmapTable::get_value(const int& index, int& value) { if (!this->lookup(const_cast(&index), &value)) return StatusTuple(-1, "Error getting value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFDevmapTable::remove_value(const int& index) { if (!this->remove(const_cast(&index))) return StatusTuple(-1, "Error removing value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } BPFXskmapTable::BPFXskmapTable(const TableDesc& desc) @@ -665,20 +665,20 @@ StatusTuple BPFXskmapTable::update_value(const int& index, const int& value) { if (!this->update(const_cast(&index), const_cast(&value))) return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFXskmapTable::get_value(const int& index, int& value) { if (!this->lookup(const_cast(&index), &value)) return StatusTuple(-1, "Error getting value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFXskmapTable::remove_value(const int& index) { if (!this->remove(const_cast(&index))) return StatusTuple(-1, "Error removing value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } BPFMapInMapTable::BPFMapInMapTable(const TableDesc& desc) @@ -693,13 +693,13 @@ StatusTuple BPFMapInMapTable::update_value(const int& index, const int& inner_map_fd) { if (!this->update(const_cast(&index), const_cast(&inner_map_fd))) return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFMapInMapTable::remove_value(const int& index) { if (!this->remove(const_cast(&index))) return StatusTuple(-1, "Error removing value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } BPFSockmapTable::BPFSockmapTable(const TableDesc& desc) @@ -713,13 +713,13 @@ StatusTuple BPFSockmapTable::update_value(const int& index, const int& value) { if (!this->update(const_cast(&index), const_cast(&value))) return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFSockmapTable::remove_value(const int& index) { if (!this->remove(const_cast(&index))) return StatusTuple(-1, "Error removing value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } BPFSockhashTable::BPFSockhashTable(const TableDesc& desc) @@ -733,13 +733,13 @@ StatusTuple BPFSockhashTable::update_value(const int& key, const int& value) { if (!this->update(const_cast(&key), const_cast(&value))) return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple BPFSockhashTable::remove_value(const int& key) { if (!this->remove(const_cast(&key))) return StatusTuple(-1, "Error removing value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } } // namespace ebpf diff --git a/src/cc/api/BPFTable.h b/src/cc/api/BPFTable.h index f8e3396a4..d75157591 100644 --- a/src/cc/api/BPFTable.h +++ b/src/cc/api/BPFTable.h @@ -36,6 +36,44 @@ namespace ebpf { +template +class BPFQueueStackTableBase { + public: + size_t capacity() const { return desc.max_entries; } + + StatusTuple string_to_leaf(const std::string& value_str, ValueType* value) { + return desc.leaf_sscanf(value_str.c_str(), value); + } + + StatusTuple leaf_to_string(const ValueType* value, std::string& value_str) { + char buf[8 * desc.leaf_size]; + StatusTuple rc = desc.leaf_snprintf(buf, sizeof(buf), value); + if (!rc.code()) + value_str.assign(buf); + return rc; + } + + int get_fd() { return desc.fd; } + + protected: + explicit BPFQueueStackTableBase(const TableDesc& desc) : desc(desc) {} + + bool pop(void *value) { + return bpf_lookup_and_delete(desc.fd, nullptr, value) >= 0; + } + // Flags are extremely useful, since they completely changes extraction behaviour + // (eg. if flag BPF_EXIST, then if the queue/stack is full remove the oldest one) + bool push(void *value, unsigned long long int flags) { + return bpf_update_elem(desc.fd, nullptr, value, flags) >= 0; + } + + bool peek(void *value) { + return bpf_lookup_elem(desc.fd, nullptr, value) >= 0; + } + + const TableDesc& desc; +}; + template class BPFTableBase { public: @@ -124,6 +162,35 @@ void* get_value_addr(std::vector& t) { return t.data(); } +template +class BPFQueueStackTable : public BPFQueueStackTableBase { + public: + explicit BPFQueueStackTable(const TableDesc& desc) : BPFQueueStackTableBase(desc) { + if (desc.type != BPF_MAP_TYPE_QUEUE && + desc.type != BPF_MAP_TYPE_STACK) + throw std::invalid_argument("Table '" + desc.name + + "' is not a queue/stack table"); + } + + virtual StatusTuple pop_value(ValueType& value) { + if (!this->pop(get_value_addr(value))) + return StatusTuple(-1, "Error getting value: %s", std::strerror(errno)); + return StatusTuple::OK(); + } + + virtual StatusTuple push_value(const ValueType& value, unsigned long long int flags = 0) { + if (!this->push(get_value_addr(const_cast(value)), flags)) + return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); + return StatusTuple::OK(); + } + + virtual StatusTuple get_head(const ValueType& value) { + if (!this->peek(get_value_addr(const_cast(value)))) + return StatusTuple(-1, "Error peeking value: %s", std::strerror(errno)); + return StatusTuple::OK(); + } +}; + template class BPFArrayTable : public BPFTableBase { public: @@ -137,14 +204,14 @@ class BPFArrayTable : public BPFTableBase { virtual StatusTuple get_value(const int& index, ValueType& value) { if (!this->lookup(const_cast(&index), get_value_addr(value))) return StatusTuple(-1, "Error getting value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } virtual StatusTuple update_value(const int& index, const ValueType& value) { if (!this->update(const_cast(&index), get_value_addr(const_cast(value)))) return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } ValueType operator[](const int& key) { @@ -211,20 +278,20 @@ class BPFHashTable : public BPFTableBase { virtual StatusTuple get_value(const KeyType& key, ValueType& value) { if (!this->lookup(const_cast(&key), get_value_addr(value))) return StatusTuple(-1, "Error getting value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } virtual StatusTuple update_value(const KeyType& key, const ValueType& value) { if (!this->update(const_cast(&key), get_value_addr(const_cast(value)))) return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } virtual StatusTuple remove_value(const KeyType& key) { if (!this->remove(const_cast(&key))) return StatusTuple(-1, "Error removing value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } ValueType operator[](const KeyType& key) { @@ -260,7 +327,7 @@ class BPFHashTable : public BPFTableBase { while (this->first(&cur)) TRY2(remove_value(cur)); - return StatusTuple(0); + return StatusTuple::OK(); } }; @@ -447,20 +514,20 @@ class BPFSkStorageTable : public BPFTableBase { virtual StatusTuple get_value(const int& sock_fd, ValueType& value) { if (!this->lookup(const_cast(&sock_fd), get_value_addr(value))) return StatusTuple(-1, "Error getting value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } virtual StatusTuple update_value(const int& sock_fd, const ValueType& value) { if (!this->update(const_cast(&sock_fd), get_value_addr(const_cast(value)))) return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } virtual StatusTuple remove_value(const int& sock_fd) { if (!this->remove(const_cast(&sock_fd))) return StatusTuple(-1, "Error removing value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } }; @@ -478,14 +545,14 @@ class BPFCgStorageTable : public BPFTableBase { if (!this->lookup(const_cast(&key), get_value_addr(value))) return StatusTuple(-1, "Error getting value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } virtual StatusTuple update_value(struct bpf_cgroup_storage_key& key, const ValueType& value) { if (!this->update(const_cast(&key), get_value_addr(const_cast(value)))) return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } }; @@ -508,7 +575,7 @@ class BPFPercpuCgStorageTable : public BPFTableBase> if (!this->lookup(const_cast(&key), get_value_addr(value))) return StatusTuple(-1, "Error getting value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } virtual StatusTuple update_value(struct bpf_cgroup_storage_key& key, @@ -517,7 +584,7 @@ class BPFPercpuCgStorageTable : public BPFTableBase> if (!this->update(const_cast(&key), get_value_addr(const_cast&>(value)))) return StatusTuple(-1, "Error updating value: %s", std::strerror(errno)); - return StatusTuple(0); + return StatusTuple::OK(); } private: unsigned int ncpus; diff --git a/src/cc/bcc_btf.cc b/src/cc/bcc_btf.cc index 69d36bc4b..1056950c1 100644 --- a/src/cc/bcc_btf.cc +++ b/src/cc/bcc_btf.cc @@ -19,8 +19,7 @@ #include #include "linux/btf.h" #include "libbpf.h" -#include "libbpf/src/libbpf.h" -#include "libbpf/src/btf.h" +#include "bcc_libbpf_inc.h" #include #define BCC_MAX_ERRNO 4095 @@ -186,7 +185,7 @@ void BTF::adjust(uint8_t *btf_sec, uintptr_t btf_sec_size, } struct btf_header *hdr = (struct btf_header *)btf_sec; - struct btf_ext_header *ehdr = (struct btf_ext_header *)btf_ext_sec; + struct bcc_btf_ext_header *ehdr = (struct bcc_btf_ext_header *)btf_ext_sec; // Fixup btf for old kernels or kernel requirements. fixup_btf(btf_sec + hdr->hdr_len + hdr->type_off, hdr->type_len, diff --git a/src/cc/bcc_btf.h b/src/cc/bcc_btf.h index 438c1f73f..75b47cc36 100644 --- a/src/cc/bcc_btf.h +++ b/src/cc/bcc_btf.h @@ -45,6 +45,23 @@ class BTFStringTable { }; class BTF { + struct bcc_btf_ext_header { + uint16_t magic; + uint8_t version; + uint8_t flags; + uint32_t hdr_len; + + /* All offsets are in bytes relative to the end of this header */ + uint32_t func_info_off; + uint32_t func_info_len; + uint32_t line_info_off; + uint32_t line_info_len; + + /* optional part of .BTF.ext header */ + uint32_t core_relo_off; + uint32_t core_relo_len; +}; + public: BTF(bool debug, sec_map_def §ions); ~BTF(); diff --git a/src/cc/bcc_elf.c b/src/cc/bcc_elf.c index 584257199..c3b24046c 100644 --- a/src/cc/bcc_elf.c +++ b/src/cc/bcc_elf.c @@ -257,16 +257,8 @@ static int list_in_scn(Elf *e, Elf_Scn *section, size_t stridx, size_t symsize, continue; #ifdef __powerpc64__ -#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ - if (opddata && sym.st_shndx == opdidx) { - size_t offset = sym.st_value - opdshdr.sh_addr; - /* Find the function descriptor */ - uint64_t *descr = opddata->d_buf + offset; - /* Read the actual entry point address from the descriptor */ - sym.st_value = *descr; - } -#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - if (option->use_symbol_type & (1 << STT_PPC64LE_SYM_LEP)) { +#if defined(_CALL_ELF) && _CALL_ELF == 2 + if (option->use_symbol_type & (1 << STT_PPC64_ELFV2_SYM_LEP)) { /* * The PowerPC 64-bit ELF v2 ABI says that the 3 most significant bits * in the st_other field of the symbol table specifies the number of @@ -287,6 +279,14 @@ static int list_in_scn(Elf *e, Elf_Scn *section, size_t stridx, size_t symsize, case 6: sym.st_value += 64; break; } } +#else + if (opddata && sym.st_shndx == opdidx) { + size_t offset = sym.st_value - opdshdr.sh_addr; + /* Find the function descriptor */ + uint64_t *descr = opddata->d_buf + offset; + /* Read the actual entry point address from the descriptor */ + sym.st_value = *descr; + } #endif #endif @@ -562,6 +562,10 @@ static char *find_debug_via_symfs(Elf *e, const char* path) { check_build_id = find_buildid(e, buildid); + int ns_prefix_length = 0; + sscanf(path, "/proc/%*u/root/%n", &ns_prefix_length); + path += ns_prefix_length; + snprintf(fullpath, sizeof(fullpath), "%s/%s", symfs, path); if (access(fullpath, F_OK) == -1) goto out; @@ -594,6 +598,25 @@ static char *find_debug_via_symfs(Elf *e, const char* path) { return result; } +static char *find_debug_file(Elf* e, const char* path, int check_crc) { + char *debug_file = NULL; + + // If there is a separate debuginfo file, try to locate and read it, first + // using symfs, then using the build-id section, finally using the debuglink + // section. These rules are what perf and gdb follow. + // See: + // - https://github.com/torvalds/linux/blob/v5.2/tools/perf/Documentation/perf-report.txt#L325 + // - https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html + debug_file = find_debug_via_symfs(e, path); + if (!debug_file) + debug_file = find_debug_via_buildid(e); + if (!debug_file) + debug_file = find_debug_via_debuglink(e, path, check_crc); + + return debug_file; +} + + static int foreach_sym_core(const char *path, bcc_elf_symcb callback, bcc_elf_symcb_lazy callback_lazy, struct bcc_symbol_option *option, void *payload, @@ -608,21 +631,11 @@ static int foreach_sym_core(const char *path, bcc_elf_symcb callback, if (openelf(path, &e, &fd) < 0) return -1; - // If there is a separate debuginfo file, try to locate and read it, first - // using symfs, then using the build-id section, finally using the debuglink - // section. These rules are what perf and gdb follow. - // See: - // - https://github.com/torvalds/linux/blob/v5.2/tools/perf/Documentation/perf-report.txt#L325 - // - https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html if (option->use_debug_file && !is_debug_file) { // The is_debug_file argument helps avoid infinitely resolving debuginfo // files for debuginfo files and so on. - debug_file = find_debug_via_symfs(e, path); - if (!debug_file) - debug_file = find_debug_via_buildid(e); - if (!debug_file) - debug_file = find_debug_via_debuglink(e, path, - option->check_debug_file_crc); + debug_file = find_debug_file(e, path, + option->check_debug_file_crc); if (debug_file) { foreach_sym_core(debug_file, callback, callback_lazy, option, payload, 1); free(debug_file); @@ -998,10 +1011,7 @@ int bcc_elf_symbol_str(const char *path, size_t section_idx, return -1; if (debugfile) { - debug_file = find_debug_via_buildid(e); - if (!debug_file) - debug_file = find_debug_via_debuglink(e, path, 0); // No crc for speed - + debug_file = find_debug_file(e, path, 0); if (!debug_file) { err = -1; goto exit; diff --git a/src/cc/bcc_exception.h b/src/cc/bcc_exception.h index 7933adca7..744036f56 100644 --- a/src/cc/bcc_exception.h +++ b/src/cc/bcc_exception.h @@ -23,6 +23,22 @@ namespace ebpf { class StatusTuple { public: + enum class Code { + // Not an error, indicates success. + OK = 0, + // For any error that is not covered in the existing codes. + UNKNOWN, + + INVALID_ARGUMENT, + PERMISSION_DENIED, + // For any error that was raised when making syscalls. + SYSTEM, + }; + + static StatusTuple OK() { + return StatusTuple(Code::OK, ""); + } + StatusTuple(int ret) : ret_(ret) {} StatusTuple(int ret, const char *msg) : ret_(ret), msg_(msg) {} @@ -36,16 +52,34 @@ class StatusTuple { msg_ = std::string(buf); } + StatusTuple(Code code, const std::string &msg) : use_enum_code_(true), code_(code), msg_(msg) {} + void append_msg(const std::string& msg) { msg_ += msg; } - int code() const { return ret_; } + bool ok() const { + if (use_enum_code_) { + return code_ == Code::OK; + } + return ret_ == 0; + } + + int code() const { + if (use_enum_code_) { + return static_cast(code_); + } + return ret_; + } const std::string& msg() const { return msg_; } private: int ret_; + + bool use_enum_code_ = false; + Code code_; + std::string msg_; }; @@ -57,4 +91,21 @@ class StatusTuple { } \ } while (0) +namespace error { + +#define DECLARE_ERROR(FN, CODE) \ + inline StatusTuple FN(const std::string& msg) { \ + return StatusTuple(::ebpf::StatusTuple::Code::CODE, msg); \ + } \ + inline bool Is##FN(const StatusTuple& status) { \ + return status.code() == static_cast(::ebpf::StatusTuple::Code::CODE); \ + } + +DECLARE_ERROR(Unknown, UNKNOWN) +DECLARE_ERROR(InvalidArgument, INVALID_ARGUMENT) +DECLARE_ERROR(PermissionDenied, PERMISSION_DENIED) +DECLARE_ERROR(System, SYSTEM) + +} // namespace error + } // namespace ebpf diff --git a/src/cc/bcc_libbpf_inc.h b/src/cc/bcc_libbpf_inc.h new file mode 100644 index 000000000..94e389506 --- /dev/null +++ b/src/cc/bcc_libbpf_inc.h @@ -0,0 +1,11 @@ +#pragma once + +#ifdef HAVE_EXTERNAL_LIBBPF +# include +# include +# include +#else +# include "libbpf/src/bpf.h" +# include "libbpf/src/btf.h" +# include "libbpf/src/libbpf.h" +#endif diff --git a/src/cc/bcc_syms.cc b/src/cc/bcc_syms.cc index 45d3f2c53..b3a101677 100644 --- a/src/cc/bcc_syms.cc +++ b/src/cc/bcc_syms.cc @@ -707,12 +707,13 @@ int bcc_resolve_symname(const char *module, const char *symname, const uint64_t addr, int pid, struct bcc_symbol_option *option, struct bcc_symbol *sym) { + int module_type; static struct bcc_symbol_option default_option = { .use_debug_file = 1, .check_debug_file_crc = 1, .lazy_symbolize = 1, -#if defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - .use_symbol_type = BCC_SYM_ALL_TYPES | (1 << STT_PPC64LE_SYM_LEP), +#if defined(__powerpc64__) && defined(_CALL_ELF) && _CALL_ELF == 2 + .use_symbol_type = BCC_SYM_ALL_TYPES | (1 << STT_PPC64_ELFV2_SYM_LEP), #else .use_symbol_type = BCC_SYM_ALL_TYPES, #endif @@ -730,7 +731,7 @@ int bcc_resolve_symname(const char *module, const char *symname, } if (sym->module == NULL) return -1; - if (pid != 0 && pid != -1) { + if (pid != 0 && pid != -1 && strstr(sym->module, "/proc") != sym->module){ char *temp = (char*)sym->module; sym->module = strdup(tfm::format("/proc/%d/root%s", pid, sym->module).c_str()); free(temp); @@ -747,11 +748,10 @@ int bcc_resolve_symname(const char *module, const char *symname, if (sym->offset == 0x0) goto invalid_module; - // For executable (ET_EXEC) binaries, translate the virtual address - // to physical address in the binary file. - // For shared object binaries (ET_DYN), the address from symbol table should - // already be physical address in the binary file. - if (bcc_elf_get_type(sym->module) == ET_EXEC) { + // For executable (ET_EXEC) binaries and shared objects (ET_DYN), translate + // the virtual address to physical address in the binary file. + module_type = bcc_elf_get_type(sym->module); + if (module_type == ET_EXEC || module_type == ET_DYN) { struct load_addr_t addr = { .target_addr = sym->offset, .binary_addr = 0x0, diff --git a/src/cc/bcc_syms.h b/src/cc/bcc_syms.h index 352d385bd..80627debe 100644 --- a/src/cc/bcc_syms.h +++ b/src/cc/bcc_syms.h @@ -38,10 +38,10 @@ struct mod_info; #define STT_GNU_IFUNC 10 #endif -#if defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#if defined(__powerpc64__) && defined(_CALL_ELF) && _CALL_ELF == 2 // Indicate if the Local Entry Point (LEP) should be used as a symbol's // start address -#define STT_PPC64LE_SYM_LEP 31 +#define STT_PPC64_ELFV2_SYM_LEP 31 #endif static const uint32_t BCC_SYM_ALL_TYPES = 65535; diff --git a/src/cc/bcc_usdt.h b/src/cc/bcc_usdt.h index 86e24e4ca..b8b0e0c3c 100644 --- a/src/cc/bcc_usdt.h +++ b/src/cc/bcc_usdt.h @@ -70,13 +70,19 @@ int bcc_usdt_get_argument(void *usdt, const char *provider_name, struct bcc_usdt_argument *argument); int bcc_usdt_enable_probe(void *, const char *, const char *); +int bcc_usdt_addsem_probe(void *, const char *, const char *, int16_t); #define BCC_USDT_HAS_FULLY_SPECIFIED_PROBE int bcc_usdt_enable_fully_specified_probe(void *, const char *, const char *, const char *); +int bcc_usdt_addsem_fully_specified_probe(void *, const char *, const char *, + const char *, int16_t); const char *bcc_usdt_genargs(void **ctx_array, int len); const char *bcc_usdt_get_probe_argctype( void *ctx, const char* probe_name, const int arg_index ); +const char *bcc_usdt_get_fully_specified_probe_argctype( + void *ctx, const char* provider_name, const char* probe_name, const int arg_index +); typedef void (*bcc_usdt_uprobe_cb)(const char *, const char *, uint64_t, int); void bcc_usdt_foreach_uprobe(void *usdt, bcc_usdt_uprobe_cb callback); diff --git a/src/cc/bcc_version.h.in b/src/cc/bcc_version.h.in new file mode 100644 index 000000000..44c61b20e --- /dev/null +++ b/src/cc/bcc_version.h.in @@ -0,0 +1,6 @@ +#ifndef LIBBCC_VERSION_H +#define LIBBCC_VERSION_H + +#define LIBBCC_VERSION "@REVISION@" + +#endif diff --git a/src/cc/bpf_module.cc b/src/cc/bpf_module.cc index 27e8f76d5..8fba8d276 100644 --- a/src/cc/bpf_module.cc +++ b/src/cc/bpf_module.cc @@ -45,7 +45,7 @@ #include "exported_files.h" #include "libbpf.h" #include "bcc_btf.h" -#include "libbpf/src/bpf.h" +#include "bcc_libbpf_inc.h" namespace ebpf { @@ -446,10 +446,18 @@ int BPFModule::finalize() { *sections_p; mod->setTargetTriple("bpf-pc-linux"); +#if LLVM_MAJOR_VERSION >= 11 +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + mod->setDataLayout("e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"); +#else + mod->setDataLayout("E-m:e-p:64:64-i64:64-i128:128-n32:64-S128"); +#endif +#else #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ mod->setDataLayout("e-m:e-p:64:64-i64:64-n32:64-S128"); #else mod->setDataLayout("E-m:e-p:64:64-i64:64-n32:64-S128"); +#endif #endif sections_p = rw_engine_enabled_ ? §ions_ : &tmp_sections; @@ -907,7 +915,10 @@ int BPFModule::bcc_func_load(int prog_type, const char *name, attr.name = name; attr.insns = insns; attr.license = license; - attr.kern_version = kern_version; + if (attr.prog_type != BPF_PROG_TYPE_TRACING && + attr.prog_type != BPF_PROG_TYPE_EXT) { + attr.kern_version = kern_version; + } attr.log_level = log_level; if (dev_name) attr.prog_ifindex = if_nametoindex(dev_name); diff --git a/src/cc/bpf_module_rw_engine.cc b/src/cc/bpf_module_rw_engine.cc index 418355d3b..d7e31a71e 100644 --- a/src/cc/bpf_module_rw_engine.cc +++ b/src/cc/bpf_module_rw_engine.cc @@ -433,7 +433,7 @@ StatusTuple BPFModule::snprintf(string fn_name, char *str, size_t sz, return StatusTuple(rc, "error in snprintf: %s", std::strerror(errno)); if ((size_t)rc == sz) return StatusTuple(-1, "buffer of size %zd too small", sz); - return StatusTuple(0); + return StatusTuple::OK(); } } // namespace ebpf diff --git a/src/cc/common.cc b/src/cc/common.cc index ab7528ce0..a006b6e4a 100644 --- a/src/cc/common.cc +++ b/src/cc/common.cc @@ -63,4 +63,139 @@ std::string get_pid_exe(pid_t pid) { return std::string(exe_path); } +enum class field_kind_t { + common, + data_loc, + regular, + invalid, + pad, +}; + +static inline field_kind_t _get_field_kind(std::string const& line, + std::string& field_type, + std::string& field_name, + int *last_offset) { + auto field_pos = line.find("field:"); + if (field_pos == std::string::npos) + return field_kind_t::invalid; + + auto field_semi_pos = line.find(';', field_pos); + if (field_semi_pos == std::string::npos) + return field_kind_t::invalid; + + auto offset_pos = line.find("offset:", field_semi_pos); + if (offset_pos == std::string::npos) + return field_kind_t::invalid; + + auto semi_pos = line.find(';', offset_pos); + if (semi_pos == std::string::npos) + return field_kind_t::invalid; + + auto offset_str = line.substr(offset_pos + 7, + semi_pos - offset_pos - 7); + int offset = std::stoi(offset_str, nullptr); + + auto size_pos = line.find("size:", semi_pos); + if (size_pos == std::string::npos) + return field_kind_t::invalid; + + semi_pos = line.find(';', size_pos); + if (semi_pos == std::string::npos) + return field_kind_t::invalid; + + auto size_str = line.substr(size_pos + 5, + semi_pos - size_pos - 5); + int size = std::stoi(size_str, nullptr); + + if (*last_offset < offset) { + *last_offset += 1; + return field_kind_t::pad; + } + + *last_offset = offset + size; + + auto field = line.substr(field_pos + 6/*"field:"*/, + field_semi_pos - field_pos - 6); + auto pos = field.find_last_of("\t "); + if (pos == std::string::npos) + return field_kind_t::invalid; + + field_type = field.substr(0, pos); + field_name = field.substr(pos + 1); + if (field_type.find("__data_loc") != std::string::npos) + return field_kind_t::data_loc; + if (field_name.find("common_") == 0) + return field_kind_t::common; + // do not change type definition for array + if (field_name.find("[") != std::string::npos) + return field_kind_t::regular; + + // adjust the field_type based on the size of field + // otherwise, incorrect value may be retrieved for big endian + // and the field may have incorrect structure offset. + if (size == 2) { + if (field_type == "char" || field_type == "int8_t") + field_type = "s16"; + if (field_type == "unsigned char" || field_type == "uint8_t") + field_type = "u16"; + } else if (size == 4) { + if (field_type == "char" || field_type == "short" || + field_type == "int8_t" || field_type == "int16_t") + field_type = "s32"; + if (field_type == "unsigned char" || field_type == "unsigned short" || + field_type == "uint8_t" || field_type == "uint16_t") + field_type = "u32"; + } else if (size == 8) { + if (field_type == "char" || field_type == "short" || field_type == "int" || + field_type == "int8_t" || field_type == "int16_t" || + field_type == "int32_t" || field_type == "pid_t") + field_type = "s64"; + if (field_type == "unsigned char" || field_type == "unsigned short" || + field_type == "unsigned int" || field_type == "uint8_t" || + field_type == "uint16_t" || field_type == "uint32_t" || + field_type == "unsigned" || field_type == "u32" || + field_type == "uid_t" || field_type == "gid_t") + field_type = "u64"; + } + + return field_kind_t::regular; +} + +std::string parse_tracepoint(std::istream &input, std::string const& category, + std::string const& event) { + std::string tp_struct = "struct tracepoint__" + category + "__" + event + " {\n"; + tp_struct += "\tu64 __do_not_use__;\n"; + int last_offset = 0, common_offset = 8; + for (std::string line; getline(input, line); ) { + std::string field_type, field_name; + field_kind_t kind; + + do { + kind = _get_field_kind(line, field_type, field_name, &last_offset); + + switch (kind) { + case field_kind_t::invalid: + continue; + case field_kind_t::common: + for (;common_offset < last_offset; common_offset++) + { + tp_struct += "\tchar __do_not_use__" + std::to_string(common_offset) + ";\n"; + } + continue; + case field_kind_t::data_loc: + tp_struct += "\tint data_loc_" + field_name + ";\n"; + break; + case field_kind_t::regular: + tp_struct += "\t" + field_type + " " + field_name + ";\n"; + break; + case field_kind_t::pad: + tp_struct += "\tchar __pad_" + std::to_string(last_offset - 1) + ";\n"; + break; + } + } while (kind == field_kind_t::pad); + } + + tp_struct += "};\n"; + return tp_struct; +} } // namespace ebpf diff --git a/src/cc/common.h b/src/cc/common.h index 2ef250a2b..bfba4c926 100644 --- a/src/cc/common.h +++ b/src/cc/common.h @@ -39,4 +39,6 @@ std::vector get_possible_cpus(); std::string get_pid_exe(pid_t pid); +std::string parse_tracepoint(std::istream &input, std::string const& category, + std::string const& event); } // namespace ebpf diff --git a/src/cc/compat/linux/virtual_bpf.h b/src/cc/compat/linux/virtual_bpf.h index 7b6b41d3a..a997ab5a4 100644 --- a/src/cc/compat/linux/virtual_bpf.h +++ b/src/cc/compat/linux/virtual_bpf.h @@ -82,6 +82,12 @@ struct bpf_cgroup_storage_key { __u32 attach_type; /* program attach type */ }; +union bpf_iter_link_info { + struct { + __u32 map_fd; + } map; +}; + /* BPF syscall commands, see bpf(2) man-page for details. */ enum bpf_cmd { BPF_MAP_CREATE, @@ -112,6 +118,14 @@ enum bpf_cmd { BPF_MAP_LOOKUP_AND_DELETE_BATCH, BPF_MAP_UPDATE_BATCH, BPF_MAP_DELETE_BATCH, + BPF_LINK_CREATE, + BPF_LINK_UPDATE, + BPF_LINK_GET_FD_BY_ID, + BPF_LINK_GET_NEXT_ID, + BPF_ENABLE_STATS, + BPF_ITER_CREATE, + BPF_LINK_DETACH, + BPF_PROG_BIND_MAP, }; enum bpf_map_type { @@ -142,6 +156,8 @@ enum bpf_map_type { BPF_MAP_TYPE_SK_STORAGE, BPF_MAP_TYPE_DEVMAP_HASH, BPF_MAP_TYPE_STRUCT_OPS, + BPF_MAP_TYPE_RINGBUF, + BPF_MAP_TYPE_INODE_STORAGE, }; /* Note that tracing related programs such as @@ -182,6 +198,8 @@ enum bpf_prog_type { BPF_PROG_TYPE_TRACING, BPF_PROG_TYPE_STRUCT_OPS, BPF_PROG_TYPE_EXT, + BPF_PROG_TYPE_LSM, + BPF_PROG_TYPE_SK_LOOKUP, }; enum bpf_attach_type { @@ -211,11 +229,35 @@ enum bpf_attach_type { BPF_TRACE_RAW_TP, BPF_TRACE_FENTRY, BPF_TRACE_FEXIT, + BPF_MODIFY_RETURN, + BPF_LSM_MAC, + BPF_TRACE_ITER, + BPF_CGROUP_INET4_GETPEERNAME, + BPF_CGROUP_INET6_GETPEERNAME, + BPF_CGROUP_INET4_GETSOCKNAME, + BPF_CGROUP_INET6_GETSOCKNAME, + BPF_XDP_DEVMAP, + BPF_CGROUP_INET_SOCK_RELEASE, + BPF_XDP_CPUMAP, + BPF_SK_LOOKUP, + BPF_XDP, __MAX_BPF_ATTACH_TYPE }; #define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE +enum bpf_link_type { + BPF_LINK_TYPE_UNSPEC = 0, + BPF_LINK_TYPE_RAW_TRACEPOINT = 1, + BPF_LINK_TYPE_TRACING = 2, + BPF_LINK_TYPE_CGROUP = 3, + BPF_LINK_TYPE_ITER = 4, + BPF_LINK_TYPE_NETNS = 5, + BPF_LINK_TYPE_XDP = 6, + + MAX_BPF_LINK_TYPE, +}; + /* cgroup-bpf attach flags used in BPF_PROG_ATTACH command * * NONE(default): No further bpf programs allowed in the subtree. @@ -306,6 +348,14 @@ enum bpf_attach_type { /* The verifier internal test flag. Behavior is undefined */ #define BPF_F_TEST_STATE_FREQ (1U << 3) +/* If BPF_F_SLEEPABLE is used in BPF_PROG_LOAD command, the verifier will + * restrict map and helper usage for such programs. Sleepable BPF programs can + * only be attached to hooks where kernel execution context allows sleeping. + * Such programs are allowed to use helpers that may sleep like + * bpf_copy_from_user(). + */ +#define BPF_F_SLEEPABLE (1U << 4) + /* When BPF ldimm64's insn[0].src_reg != 0 then this can have * two extensions: * @@ -326,44 +376,46 @@ enum bpf_attach_type { #define BPF_PSEUDO_CALL 1 /* flags for BPF_MAP_UPDATE_ELEM command */ -#define BPF_ANY 0 /* create new element or update existing */ -#define BPF_NOEXIST 1 /* create new element if it didn't exist */ -#define BPF_EXIST 2 /* update existing element */ -#define BPF_F_LOCK 4 /* spin_lock-ed map_lookup/map_update */ +enum { + BPF_ANY = 0, /* create new element or update existing */ + BPF_NOEXIST = 1, /* create new element if it didn't exist */ + BPF_EXIST = 2, /* update existing element */ + BPF_F_LOCK = 4, /* spin_lock-ed map_lookup/map_update */ +}; /* flags for BPF_MAP_CREATE command */ -#define BPF_F_NO_PREALLOC (1U << 0) +enum { + BPF_F_NO_PREALLOC = (1U << 0), /* Instead of having one common LRU list in the * BPF_MAP_TYPE_LRU_[PERCPU_]HASH map, use a percpu LRU list * which can scale and perform better. * Note, the LRU nodes (including free nodes) cannot be moved * across different LRU lists. */ -#define BPF_F_NO_COMMON_LRU (1U << 1) + BPF_F_NO_COMMON_LRU = (1U << 1), /* Specify numa node during map creation */ -#define BPF_F_NUMA_NODE (1U << 2) - -#define BPF_OBJ_NAME_LEN 16U + BPF_F_NUMA_NODE = (1U << 2), /* Flags for accessing BPF object from syscall side. */ -#define BPF_F_RDONLY (1U << 3) -#define BPF_F_WRONLY (1U << 4) + BPF_F_RDONLY = (1U << 3), + BPF_F_WRONLY = (1U << 4), /* Flag for stack_map, store build_id+offset instead of pointer */ -#define BPF_F_STACK_BUILD_ID (1U << 5) + BPF_F_STACK_BUILD_ID = (1U << 5), /* Zero-initialize hash function seed. This should only be used for testing. */ -#define BPF_F_ZERO_SEED (1U << 6) + BPF_F_ZERO_SEED = (1U << 6), /* Flags for accessing BPF object from program side. */ -#define BPF_F_RDONLY_PROG (1U << 7) -#define BPF_F_WRONLY_PROG (1U << 8) + BPF_F_RDONLY_PROG = (1U << 7), + BPF_F_WRONLY_PROG = (1U << 8), /* Clone map from listener for newly accepted socket */ -#define BPF_F_CLONE (1U << 9) + BPF_F_CLONE = (1U << 9), /* Enable memory-mapping BPF map */ -#define BPF_F_MMAPABLE (1U << 10) + BPF_F_MMAPABLE = (1U << 10), +}; /* Flags for BPF_PROG_QUERY. */ @@ -373,6 +425,17 @@ enum bpf_attach_type { */ #define BPF_F_QUERY_EFFECTIVE (1U << 0) +/* Flags for BPF_PROG_TEST_RUN */ + +/* If set, run the test on the cpu specified by bpf_attr.test.cpu */ +#define BPF_F_TEST_RUN_ON_CPU (1U << 0) + +/* type for BPF_ENABLE_STATS */ +enum bpf_stats_type { + /* enabled run_time_ns and run_cnt */ + BPF_STATS_RUN_TIME = 0, +}; + enum bpf_stack_build_id_status { /* user space need an empty entry to identify end of a trace */ BPF_STACK_BUILD_ID_EMPTY = 0, @@ -392,6 +455,8 @@ struct bpf_stack_build_id { }; }; +#define BPF_OBJ_NAME_LEN 16U + union bpf_attr { struct { /* anonymous struct used by BPF_MAP_CREATE command */ __u32 map_type; /* one of enum bpf_map_type */ @@ -507,6 +572,8 @@ union bpf_attr { */ __aligned_u64 ctx_in; __aligned_u64 ctx_out; + __u32 flags; + __u32 cpu; } test; struct { /* anonymous struct used by BPF_*_GET_*_ID */ @@ -515,6 +582,7 @@ union bpf_attr { __u32 prog_id; __u32 map_id; __u32 btf_id; + __u32 link_id; }; __u32 next_id; __u32 open_flags; @@ -535,7 +603,7 @@ union bpf_attr { __u32 prog_cnt; } query; - struct { + struct { /* anonymous struct used by BPF_RAW_TRACEPOINT_OPEN command */ __u64 name; __u32 prog_fd; } raw_tracepoint; @@ -563,6 +631,53 @@ union bpf_attr { __u64 probe_offset; /* output: probe_offset */ __u64 probe_addr; /* output: probe_addr */ } task_fd_query; + + struct { /* struct used by BPF_LINK_CREATE command */ + __u32 prog_fd; /* eBPF program to attach */ + union { + __u32 target_fd; /* object to attach to */ + __u32 target_ifindex; /* target ifindex */ + }; + __u32 attach_type; /* attach type */ + __u32 flags; /* extra flags */ + union { + __u32 target_btf_id; /* btf_id of target to attach to */ + struct { + __aligned_u64 iter_info; /* extra bpf_iter_link_info */ + __u32 iter_info_len; /* iter_info length */ + }; + }; + } link_create; + + struct { /* struct used by BPF_LINK_UPDATE command */ + __u32 link_fd; /* link fd */ + /* new program fd to update link with */ + __u32 new_prog_fd; + __u32 flags; /* extra flags */ + /* expected link's program fd; is specified only if + * BPF_F_REPLACE flag is set in flags */ + __u32 old_prog_fd; + } link_update; + + struct { + __u32 link_fd; + } link_detach; + + struct { /* struct used by BPF_ENABLE_STATS command */ + __u32 type; + } enable_stats; + + struct { /* struct used by BPF_ITER_CREATE command */ + __u32 link_fd; + __u32 flags; + } iter_create; + + struct { /* struct used by BPF_PROG_BIND_MAP command */ + __u32 prog_fd; + __u32 map_fd; + __u32 flags; /* extra flags */ + } prog_bind_map; + } __attribute__((aligned(8))); /* The description below is an attempt at providing documentation to eBPF @@ -589,7 +704,7 @@ union bpf_attr { * Map value associated to *key*, or **NULL** if no entry was * found. * - * int bpf_map_update_elem(struct bpf_map *map, const void *key, const void *value, u64 flags) + * long bpf_map_update_elem(struct bpf_map *map, const void *key, const void *value, u64 flags) * Description * Add or update the value of the entry associated to *key* in * *map* with *value*. *flags* is one of: @@ -607,29 +722,31 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_map_delete_elem(struct bpf_map *map, const void *key) + * long bpf_map_delete_elem(struct bpf_map *map, const void *key) * Description * Delete entry with *key* from *map*. * Return * 0 on success, or a negative error in case of failure. * - * int bpf_probe_read(void *dst, u32 size, const void *unsafe_ptr) + * long bpf_probe_read(void *dst, u32 size, const void *unsafe_ptr) * Description * For tracing programs, safely attempt to read *size* bytes from * kernel space address *unsafe_ptr* and store the data in *dst*. * - * Generally, use bpf_probe_read_user() or bpf_probe_read_kernel() - * instead. + * Generally, use **bpf_probe_read_user**\ () or + * **bpf_probe_read_kernel**\ () instead. * Return * 0 on success, or a negative error in case of failure. * * u64 bpf_ktime_get_ns(void) * Description * Return the time elapsed since system boot, in nanoseconds. + * Does not include time the system was suspended. + * See: **clock_gettime**\ (**CLOCK_MONOTONIC**) * Return * Current *ktime*. * - * int bpf_trace_printk(const char *fmt, u32 fmt_size, ...) + * long bpf_trace_printk(const char *fmt, u32 fmt_size, ...) * Description * This helper is a "printk()-like" facility for debugging. It * prints a message defined by format *fmt* (of size *fmt_size*) @@ -679,7 +796,7 @@ union bpf_attr { * * Also, note that **bpf_trace_printk**\ () is slow, and should * only be used for debugging purposes. For this reason, a notice - * bloc (spanning several lines) is printed to kernel logs and + * block (spanning several lines) is printed to kernel logs and * states that the helper should not be used "for production use" * the first time this helper is used (or more precisely, when * **trace_printk**\ () buffers are allocated). For passing values @@ -709,7 +826,7 @@ union bpf_attr { * Return * The SMP id of the processor running the program. * - * int bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags) + * long bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags) * Description * Store *len* bytes from address *from* into the packet * associated to *skb*, at *offset*. *flags* are a combination of @@ -726,7 +843,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_l3_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 size) + * long bpf_l3_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 size) * Description * Recompute the layer 3 (e.g. IP) checksum for the packet * associated to *skb*. Computation is incremental, so the helper @@ -751,7 +868,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_l4_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 flags) + * long bpf_l4_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 flags) * Description * Recompute the layer 4 (e.g. TCP, UDP or ICMP) checksum for the * packet associated to *skb*. Computation is incremental, so the @@ -783,7 +900,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_tail_call(void *ctx, struct bpf_map *prog_array_map, u32 index) + * long bpf_tail_call(void *ctx, struct bpf_map *prog_array_map, u32 index) * Description * This special helper is used to trigger a "tail call", or in * other words, to jump into another eBPF program. The same stack @@ -814,7 +931,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_clone_redirect(struct sk_buff *skb, u32 ifindex, u64 flags) + * long bpf_clone_redirect(struct sk_buff *skb, u32 ifindex, u64 flags) * Description * Clone and redirect the packet associated to *skb* to another * net device of index *ifindex*. Both ingress and egress @@ -850,7 +967,7 @@ union bpf_attr { * A 64-bit integer containing the current GID and UID, and * created as such: *current_gid* **<< 32 \|** *current_uid*. * - * int bpf_get_current_comm(void *buf, u32 size_of_buf) + * long bpf_get_current_comm(void *buf, u32 size_of_buf) * Description * Copy the **comm** attribute of the current task into *buf* of * *size_of_buf*. The **comm** attribute contains the name of @@ -887,7 +1004,7 @@ union bpf_attr { * Return * The classid, or 0 for the default unconfigured classid. * - * int bpf_skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci) + * long bpf_skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci) * Description * Push a *vlan_tci* (VLAN tag control information) of protocol * *vlan_proto* to the packet associated to *skb*, then update @@ -903,7 +1020,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_skb_vlan_pop(struct sk_buff *skb) + * long bpf_skb_vlan_pop(struct sk_buff *skb) * Description * Pop a VLAN header from the packet associated to *skb*. * @@ -915,7 +1032,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_skb_get_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags) + * long bpf_skb_get_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags) * Description * Get tunnel metadata. This helper takes a pointer *key* to an * empty **struct bpf_tunnel_key** of **size**, that will be @@ -945,14 +1062,14 @@ union bpf_attr { * * int ret; * struct bpf_tunnel_key key = {}; - * + * * ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 0); * if (ret < 0) * return TC_ACT_SHOT; // drop packet - * + * * if (key.remote_ipv4 != 0x0a000001) * return TC_ACT_SHOT; // drop packet - * + * * return TC_ACT_OK; // accept packet * * This interface can also be used with all encapsulation devices @@ -966,7 +1083,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_skb_set_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags) + * long bpf_skb_set_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags) * Description * Populate tunnel metadata for packet associated to *skb.* The * tunnel metadata is set to the contents of *key*, of *size*. The @@ -1032,7 +1149,7 @@ union bpf_attr { * The value of the perf event counter read from the map, or a * negative error code in case of failure. * - * int bpf_redirect(u32 ifindex, u64 flags) + * long bpf_redirect(u32 ifindex, u64 flags) * Description * Redirect the packet to another net device of index *ifindex*. * This helper is somewhat similar to **bpf_clone_redirect**\ @@ -1046,9 +1163,9 @@ union bpf_attr { * supports redirection to the egress interface, and accepts no * flag at all. * - * The same effect can be attained with the more generic - * **bpf_redirect_map**\ (), which requires specific maps to be - * used but offers better performance. + * The same effect can also be attained with the more generic + * **bpf_redirect_map**\ (), which uses a BPF map to store the + * redirect target instead of providing it directly to the helper. * Return * For XDP, the helper returns **XDP_REDIRECT** on success or * **XDP_ABORTED** on error. For other program types, the values @@ -1059,7 +1176,7 @@ union bpf_attr { * Description * Retrieve the realm or the route, that is to say the * **tclassid** field of the destination for the *skb*. The - * indentifier retrieved is a user-provided tag, similar to the + * identifier retrieved is a user-provided tag, similar to the * one used with the net_cls cgroup (see description for * **bpf_get_cgroup_classid**\ () helper), but here this tag is * held by a route (a destination entry), not by a task. @@ -1079,7 +1196,7 @@ union bpf_attr { * The realm of the route for the packet associated to *skb*, or 0 * if none was found. * - * int bpf_perf_event_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) + * long bpf_perf_event_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) * Description * Write raw *data* blob into a special BPF perf event held by * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf @@ -1124,7 +1241,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_skb_load_bytes(const void *skb, u32 offset, void *to, u32 len) + * long bpf_skb_load_bytes(const void *skb, u32 offset, void *to, u32 len) * Description * This helper was provided as an easy way to load data from a * packet. It can be used to load *len* bytes from *offset* from @@ -1141,7 +1258,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_get_stackid(void *ctx, struct bpf_map *map, u64 flags) + * long bpf_get_stackid(void *ctx, struct bpf_map *map, u64 flags) * Description * Walk a user or a kernel stack and return its id. To achieve * this, the helper needs *ctx*, which is a pointer to the context @@ -1210,7 +1327,7 @@ union bpf_attr { * The checksum result, or a negative error code in case of * failure. * - * int bpf_skb_get_tunnel_opt(struct sk_buff *skb, void *opt, u32 size) + * long bpf_skb_get_tunnel_opt(struct sk_buff *skb, void *opt, u32 size) * Description * Retrieve tunnel options metadata for the packet associated to * *skb*, and store the raw tunnel option data to the buffer *opt* @@ -1228,7 +1345,7 @@ union bpf_attr { * Return * The size of the option data retrieved. * - * int bpf_skb_set_tunnel_opt(struct sk_buff *skb, void *opt, u32 size) + * long bpf_skb_set_tunnel_opt(struct sk_buff *skb, void *opt, u32 size) * Description * Set tunnel options metadata for the packet associated to *skb* * to the option data contained in the raw buffer *opt* of *size*. @@ -1238,7 +1355,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_skb_change_proto(struct sk_buff *skb, __be16 proto, u64 flags) + * long bpf_skb_change_proto(struct sk_buff *skb, __be16 proto, u64 flags) * Description * Change the protocol of the *skb* to *proto*. Currently * supported are transition from IPv4 to IPv6, and from IPv6 to @@ -1265,7 +1382,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_skb_change_type(struct sk_buff *skb, u32 type) + * long bpf_skb_change_type(struct sk_buff *skb, u32 type) * Description * Change the packet type for the packet associated to *skb*. This * comes down to setting *skb*\ **->pkt_type** to *type*, except @@ -1292,7 +1409,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_skb_under_cgroup(struct sk_buff *skb, struct bpf_map *map, u32 index) + * long bpf_skb_under_cgroup(struct sk_buff *skb, struct bpf_map *map, u32 index) * Description * Check whether *skb* is a descendant of the cgroup2 held by * *map* of type **BPF_MAP_TYPE_CGROUP_ARRAY**, at *index*. @@ -1323,7 +1440,7 @@ union bpf_attr { * Return * A pointer to the current task struct. * - * int bpf_probe_write_user(void *dst, const void *src, u32 len) + * long bpf_probe_write_user(void *dst, const void *src, u32 len) * Description * Attempt in a safe way to write *len* bytes from the buffer * *src* to *dst* in memory. It only works for threads that are in @@ -1342,7 +1459,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_current_task_under_cgroup(struct bpf_map *map, u32 index) + * long bpf_current_task_under_cgroup(struct bpf_map *map, u32 index) * Description * Check whether the probe is being run is the context of a given * subset of the cgroup2 hierarchy. The cgroup2 to test is held by @@ -1350,11 +1467,11 @@ union bpf_attr { * Return * The return value depends on the result of the test, and can be: * - * * 0, if the *skb* task belongs to the cgroup2. - * * 1, if the *skb* task does not belong to the cgroup2. + * * 0, if current task belongs to the cgroup2. + * * 1, if current task does not belong to the cgroup2. * * A negative error code, if an error occurred. * - * int bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags) + * long bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags) * Description * Resize (trim or grow) the packet associated to *skb* to the * new *len*. The *flags* are reserved for future usage, and must @@ -1378,7 +1495,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_skb_pull_data(struct sk_buff *skb, u32 len) + * long bpf_skb_pull_data(struct sk_buff *skb, u32 len) * Description * Pull in non-linear data in case the *skb* is non-linear and not * all of *len* are part of the linear section. Make *len* bytes @@ -1434,7 +1551,7 @@ union bpf_attr { * recalculation the next time the kernel tries to access this * hash or when the **bpf_get_hash_recalc**\ () helper is called. * - * int bpf_get_numa_node_id(void) + * long bpf_get_numa_node_id(void) * Description * Return the id of the current NUMA node. The primary use case * for this helper is the selection of sockets for the local NUMA @@ -1445,7 +1562,7 @@ union bpf_attr { * Return * The id of current NUMA node. * - * int bpf_skb_change_head(struct sk_buff *skb, u32 len, u64 flags) + * long bpf_skb_change_head(struct sk_buff *skb, u32 len, u64 flags) * Description * Grows headroom of packet associated to *skb* and adjusts the * offset of the MAC header accordingly, adding *len* bytes of @@ -1466,7 +1583,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_xdp_adjust_head(struct xdp_buff *xdp_md, int delta) + * long bpf_xdp_adjust_head(struct xdp_buff *xdp_md, int delta) * Description * Adjust (move) *xdp_md*\ **->data** by *delta* bytes. Note that * it is possible to use a negative value for *delta*. This helper @@ -1481,14 +1598,14 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_probe_read_str(void *dst, u32 size, const void *unsafe_ptr) + * long bpf_probe_read_str(void *dst, u32 size, const void *unsafe_ptr) * Description * Copy a NUL terminated string from an unsafe kernel address - * *unsafe_ptr* to *dst*. See bpf_probe_read_kernel_str() for + * *unsafe_ptr* to *dst*. See **bpf_probe_read_kernel_str**\ () for * more details. * - * Generally, use bpf_probe_read_user_str() or bpf_probe_read_kernel_str() - * instead. + * Generally, use **bpf_probe_read_user_str**\ () or + * **bpf_probe_read_kernel_str**\ () instead. * Return * On success, the strictly positive length of the string, * including the trailing NUL character. On error, a negative @@ -1516,7 +1633,7 @@ union bpf_attr { * * u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx) * Description - * Equivalent to bpf_get_socket_cookie() helper that accepts + * Equivalent to **bpf_get_socket_cookie**\ () helper that accepts * *skb*, but gets socket from **struct bpf_sock_ops** context. * Return * A 8-byte long non-decreasing number. @@ -1529,14 +1646,14 @@ union bpf_attr { * is returned (note that **overflowuid** might also be the actual * UID value for the socket). * - * u32 bpf_set_hash(struct sk_buff *skb, u32 hash) + * long bpf_set_hash(struct sk_buff *skb, u32 hash) * Description * Set the full hash for *skb* (set the field *skb*\ **->hash**) * to value *hash*. * Return * 0 * - * int bpf_setsockopt(struct bpf_sock_ops *bpf_socket, int level, int optname, void *optval, int optlen) + * long bpf_setsockopt(void *bpf_socket, int level, int optname, void *optval, int optlen) * Description * Emulate a call to **setsockopt()** on the socket associated to * *bpf_socket*, which must be a full socket. The *level* at @@ -1544,25 +1661,41 @@ union bpf_attr { * must be specified, see **setsockopt(2)** for more information. * The option value of length *optlen* is pointed by *optval*. * + * *bpf_socket* should be one of the following: + * + * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**. + * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT** + * and **BPF_CGROUP_INET6_CONNECT**. + * * This helper actually implements a subset of **setsockopt()**. * It supports the following *level*\ s: * * * **SOL_SOCKET**, which supports the following *optname*\ s: * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**, - * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**. + * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**, + * **SO_BINDTODEVICE**, **SO_KEEPALIVE**. * * **IPPROTO_TCP**, which supports the following *optname*\ s: * **TCP_CONGESTION**, **TCP_BPF_IW**, - * **TCP_BPF_SNDCWND_CLAMP**. + * **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**, + * **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**, + * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**. * * **IPPROTO_IP**, which supports *optname* **IP_TOS**. * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**. * Return * 0 on success, or a negative error in case of failure. * - * int bpf_skb_adjust_room(struct sk_buff *skb, s32 len_diff, u32 mode, u64 flags) + * long bpf_skb_adjust_room(struct sk_buff *skb, s32 len_diff, u32 mode, u64 flags) * Description * Grow or shrink the room for data in the packet associated to * *skb* by *len_diff*, and according to the selected *mode*. * + * By default, the helper will reset any offloaded checksum + * indicator of the skb to CHECKSUM_NONE. This can be avoided + * by the following flag: + * + * * **BPF_F_ADJ_ROOM_NO_CSUM_RESET**: Do not reset offloaded + * checksum data of the skb to CHECKSUM_NONE. + * * There are two supported modes at this time: * * * **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer @@ -1597,7 +1730,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags) + * long bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags) * Description * Redirect the packet to the endpoint referenced by *map* at * index *key*. Depending on its type, this *map* can contain @@ -1608,19 +1741,17 @@ union bpf_attr { * * The lower two bits of *flags* are used as the return code if * the map lookup fails. This is so that the return value can be - * one of the XDP program return codes up to XDP_TX, as chosen by - * the caller. Any higher bits in the *flags* argument must be + * one of the XDP program return codes up to **XDP_TX**, as chosen + * by the caller. Any higher bits in the *flags* argument must be * unset. * - * When used to redirect packets to net devices, this helper - * provides a high performance increase over **bpf_redirect**\ (). - * This is due to various implementation details of the underlying - * mechanisms, one of which is the fact that **bpf_redirect_map**\ - * () tries to send packet as a "bulk" to the device. + * See also **bpf_redirect**\ (), which only supports redirecting + * to an ifindex, but doesn't require a map to do so. * Return - * **XDP_REDIRECT** on success, or **XDP_ABORTED** on error. + * **XDP_REDIRECT** on success, or the value of the two lower bits + * of the *flags* argument on error. * - * int bpf_sk_redirect_map(struct sk_buff *skb, struct bpf_map *map, u32 key, u64 flags) + * long bpf_sk_redirect_map(struct sk_buff *skb, struct bpf_map *map, u32 key, u64 flags) * Description * Redirect the packet to the socket referenced by *map* (of type * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and @@ -1631,7 +1762,7 @@ union bpf_attr { * Return * **SK_PASS** on success, or **SK_DROP** on error. * - * int bpf_sock_map_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags) + * long bpf_sock_map_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags) * Description * Add an entry to, or update a *map* referencing sockets. The * *skops* is used as a new value for the entry associated to @@ -1650,7 +1781,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_xdp_adjust_meta(struct xdp_buff *xdp_md, int delta) + * long bpf_xdp_adjust_meta(struct xdp_buff *xdp_md, int delta) * Description * Adjust the address pointed by *xdp_md*\ **->data_meta** by * *delta* (which can be positive or negative). Note that this @@ -1679,7 +1810,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_perf_event_read_value(struct bpf_map *map, u64 flags, struct bpf_perf_event_value *buf, u32 buf_size) + * long bpf_perf_event_read_value(struct bpf_map *map, u64 flags, struct bpf_perf_event_value *buf, u32 buf_size) * Description * Read the value of a perf event counter, and store it into *buf* * of size *buf_size*. This helper relies on a *map* of type @@ -1723,13 +1854,13 @@ union bpf_attr { * the time running for event since last normalization. The * enabled and running times are accumulated since the perf event * open. To achieve scaling factor between two invocations of an - * eBPF program, users can can use CPU id as the key (which is + * eBPF program, users can use CPU id as the key (which is * typical for perf array usage model) to remember the previous * value and do the calculation inside the eBPF program. * Return * 0 on success, or a negative error in case of failure. * - * int bpf_perf_prog_read_value(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, u32 buf_size) + * long bpf_perf_prog_read_value(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, u32 buf_size) * Description * For en eBPF program attached to a perf event, retrieve the * value of the event counter associated to *ctx* and store it in @@ -1740,7 +1871,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_getsockopt(struct bpf_sock_ops *bpf_socket, int level, int optname, void *optval, int optlen) + * long bpf_getsockopt(void *bpf_socket, int level, int optname, void *optval, int optlen) * Description * Emulate a call to **getsockopt()** on the socket associated to * *bpf_socket*, which must be a full socket. The *level* at @@ -1749,6 +1880,12 @@ union bpf_attr { * The retrieved value is stored in the structure pointed by * *opval* and of length *optlen*. * + * *bpf_socket* should be one of the following: + * + * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**. + * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT** + * and **BPF_CGROUP_INET6_CONNECT**. + * * This helper actually implements a subset of **getsockopt()**. * It supports the following *level*\ s: * @@ -1759,14 +1896,14 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_override_return(struct pt_regs *regs, u64 rc) + * long bpf_override_return(struct pt_regs *regs, u64 rc) * Description * Used for error injection, this helper uses kprobes to override * the return value of the probed function, and to set it to *rc*. * The first argument is the context *regs* on which the kprobe * works. * - * This helper works by setting setting the PC (program counter) + * This helper works by setting the PC (program counter) * to an override function which is run in place of the original * probed function. This means the probed function is not run at * all. The replacement function just returns with the required @@ -1784,7 +1921,7 @@ union bpf_attr { * Return * 0 * - * int bpf_sock_ops_cb_flags_set(struct bpf_sock_ops *bpf_sock, int argval) + * long bpf_sock_ops_cb_flags_set(struct bpf_sock_ops *bpf_sock, int argval) * Description * Attempt to set the value of the **bpf_sock_ops_cb_flags** field * for the full TCP socket associated to *bpf_sock_ops* to @@ -1828,7 +1965,7 @@ union bpf_attr { * be set is returned (which comes down to 0 if all bits were set * as required). * - * int bpf_msg_redirect_map(struct sk_msg_buff *msg, struct bpf_map *map, u32 key, u64 flags) + * long bpf_msg_redirect_map(struct sk_msg_buff *msg, struct bpf_map *map, u32 key, u64 flags) * Description * This helper is used in programs implementing policies at the * socket level. If the message *msg* is allowed to pass (i.e. if @@ -1842,7 +1979,7 @@ union bpf_attr { * Return * **SK_PASS** on success, or **SK_DROP** on error. * - * int bpf_msg_apply_bytes(struct sk_msg_buff *msg, u32 bytes) + * long bpf_msg_apply_bytes(struct sk_msg_buff *msg, u32 bytes) * Description * For socket policies, apply the verdict of the eBPF program to * the next *bytes* (number of bytes) of message *msg*. @@ -1876,7 +2013,7 @@ union bpf_attr { * Return * 0 * - * int bpf_msg_cork_bytes(struct sk_msg_buff *msg, u32 bytes) + * long bpf_msg_cork_bytes(struct sk_msg_buff *msg, u32 bytes) * Description * For socket policies, prevent the execution of the verdict eBPF * program for message *msg* until *bytes* (byte number) have been @@ -1894,7 +2031,7 @@ union bpf_attr { * Return * 0 * - * int bpf_msg_pull_data(struct sk_msg_buff *msg, u32 start, u32 end, u64 flags) + * long bpf_msg_pull_data(struct sk_msg_buff *msg, u32 start, u32 end, u64 flags) * Description * For socket policies, pull in non-linear data from user space * for *msg* and set pointers *msg*\ **->data** and *msg*\ @@ -1925,7 +2062,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_bind(struct bpf_sock_addr *ctx, struct sockaddr *addr, int addr_len) + * long bpf_bind(struct bpf_sock_addr *ctx, struct sockaddr *addr, int addr_len) * Description * Bind the socket associated to *ctx* to the address pointed by * *addr*, of length *addr_len*. This allows for making outgoing @@ -1935,18 +2072,19 @@ union bpf_attr { * * This helper works for IPv4 and IPv6, TCP and UDP sockets. The * domain (*addr*\ **->sa_family**) must be **AF_INET** (or - * **AF_INET6**). Looking for a free port to bind to can be - * expensive, therefore binding to port is not permitted by the - * helper: *addr*\ **->sin_port** (or **sin6_port**, respectively) - * must be set to zero. + * **AF_INET6**). It's advised to pass zero port (**sin_port** + * or **sin6_port**) which triggers IP_BIND_ADDRESS_NO_PORT-like + * behavior and lets the kernel efficiently pick up an unused + * port as long as 4-tuple is unique. Passing non-zero port might + * lead to degraded performance. * Return * 0 on success, or a negative error in case of failure. * - * int bpf_xdp_adjust_tail(struct xdp_buff *xdp_md, int delta) + * long bpf_xdp_adjust_tail(struct xdp_buff *xdp_md, int delta) * Description * Adjust (move) *xdp_md*\ **->data_end** by *delta* bytes. It is - * only possible to shrink the packet as of this writing, - * therefore *delta* must be a negative integer. + * possible to both shrink and grow the packet tail. + * Shrink done via *delta* being a negative integer. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers @@ -1956,7 +2094,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_skb_get_xfrm_state(struct sk_buff *skb, u32 index, struct bpf_xfrm_state *xfrm_state, u32 size, u64 flags) + * long bpf_skb_get_xfrm_state(struct sk_buff *skb, u32 index, struct bpf_xfrm_state *xfrm_state, u32 size, u64 flags) * Description * Retrieve the XFRM state (IP transform framework, see also * **ip-xfrm(8)**) at *index* in XFRM "security path" for *skb*. @@ -1972,7 +2110,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_get_stack(void *ctx, void *buf, u32 size, u64 flags) + * long bpf_get_stack(void *ctx, void *buf, u32 size, u64 flags) * Description * Return a user or a kernel stack in bpf program provided buffer. * To achieve this, the helper needs *ctx*, which is a pointer @@ -2005,7 +2143,7 @@ union bpf_attr { * A non-negative value equal to or less than *size* on success, * or a negative error in case of failure. * - * int bpf_skb_load_bytes_relative(const void *skb, u32 offset, void *to, u32 len, u32 start_header) + * long bpf_skb_load_bytes_relative(const void *skb, u32 offset, void *to, u32 len, u32 start_header) * Description * This helper is similar to **bpf_skb_load_bytes**\ () in that * it provides an easy way to load *len* bytes from *offset* @@ -2027,7 +2165,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_fib_lookup(void *ctx, struct bpf_fib_lookup *params, int plen, u32 flags) + * long bpf_fib_lookup(void *ctx, struct bpf_fib_lookup *params, int plen, u32 flags) * Description * Do FIB lookup in kernel tables using parameters in *params*. * If lookup is successful and result shows packet is to be @@ -2058,7 +2196,7 @@ union bpf_attr { * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the * packet is not forwarded or needs assist from full stack * - * int bpf_sock_hash_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags) + * long bpf_sock_hash_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags) * Description * Add an entry to, or update a sockhash *map* referencing sockets. * The *skops* is used as a new value for the entry associated to @@ -2077,7 +2215,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_msg_redirect_hash(struct sk_msg_buff *msg, struct bpf_map *map, void *key, u64 flags) + * long bpf_msg_redirect_hash(struct sk_msg_buff *msg, struct bpf_map *map, void *key, u64 flags) * Description * This helper is used in programs implementing policies at the * socket level. If the message *msg* is allowed to pass (i.e. if @@ -2091,7 +2229,7 @@ union bpf_attr { * Return * **SK_PASS** on success, or **SK_DROP** on error. * - * int bpf_sk_redirect_hash(struct sk_buff *skb, struct bpf_map *map, void *key, u64 flags) + * long bpf_sk_redirect_hash(struct sk_buff *skb, struct bpf_map *map, void *key, u64 flags) * Description * This helper is used in programs implementing policies at the * skb socket level. If the sk_buff *skb* is allowed to pass (i.e. @@ -2105,7 +2243,7 @@ union bpf_attr { * Return * **SK_PASS** on success, or **SK_DROP** on error. * - * int bpf_lwt_push_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len) + * long bpf_lwt_push_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len) * Description * Encapsulate the packet associated to *skb* within a Layer 3 * protocol header. This header is provided in the buffer at @@ -2142,7 +2280,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_lwt_seg6_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len) + * long bpf_lwt_seg6_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len) * Description * Store *len* bytes from address *from* into the packet * associated to *skb*, at *offset*. Only the flags, tag and TLVs @@ -2157,7 +2295,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_lwt_seg6_adjust_srh(struct sk_buff *skb, u32 offset, s32 delta) + * long bpf_lwt_seg6_adjust_srh(struct sk_buff *skb, u32 offset, s32 delta) * Description * Adjust the size allocated to TLVs in the outermost IPv6 * Segment Routing Header contained in the packet associated to @@ -2173,7 +2311,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_lwt_seg6_action(struct sk_buff *skb, u32 action, void *param, u32 param_len) + * long bpf_lwt_seg6_action(struct sk_buff *skb, u32 action, void *param, u32 param_len) * Description * Apply an IPv6 Segment Routing action of type *action* to the * packet associated to *skb*. Each action takes a parameter @@ -2202,7 +2340,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_rc_repeat(void *ctx) + * long bpf_rc_repeat(void *ctx) * Description * This helper is used in programs implementing IR decoding, to * report a successfully decoded repeat key message. This delays @@ -2221,7 +2359,7 @@ union bpf_attr { * Return * 0 * - * int bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle) + * long bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle) * Description * This helper is used in programs implementing IR decoding, to * report a successfully decoded key press with *scancode*, @@ -2232,7 +2370,7 @@ union bpf_attr { * **bpf_rc_keydown**\ () again with the same values, or calling * **bpf_rc_repeat**\ (). * - * Some protocols include a toggle bit, in case the button was + * Some protocols include a toggle bit, in case the button was * released and pressed again between consecutive scancodes. * * The *ctx* should point to the lirc sample as passed into @@ -2286,7 +2424,7 @@ union bpf_attr { * Return * A pointer to the local storage area. * - * int bpf_sk_select_reuseport(struct sk_reuseport_md *reuse, struct bpf_map *map, void *key, u64 flags) + * long bpf_sk_select_reuseport(struct sk_reuseport_md *reuse, struct bpf_map *map, void *key, u64 flags) * Description * Select a **SO_REUSEPORT** socket from a * **BPF_MAP_TYPE_REUSEPORT_ARRAY** *map*. @@ -2331,7 +2469,7 @@ union bpf_attr { * Look for an IPv6 socket. * * If the *netns* is a negative signed 32-bit integer, then the - * socket lookup table in the netns associated with the *ctx* will + * socket lookup table in the netns associated with the *ctx* * will be used. For the TC hooks, this is the netns of the device * in the skb. For socket hooks, this is the netns of the socket. * If *netns* is any other signed 32-bit value greater than or @@ -2368,7 +2506,7 @@ union bpf_attr { * Look for an IPv6 socket. * * If the *netns* is a negative signed 32-bit integer, then the - * socket lookup table in the netns associated with the *ctx* will + * socket lookup table in the netns associated with the *ctx* * will be used. For the TC hooks, this is the netns of the device * in the skb. For socket hooks, this is the netns of the socket. * If *netns* is any other signed 32-bit value greater than or @@ -2387,7 +2525,7 @@ union bpf_attr { * result is from *reuse*\ **->socks**\ [] using the hash of the * tuple. * - * int bpf_sk_release(struct bpf_sock *sock) + * long bpf_sk_release(void *sock) * Description * Release the reference held by *sock*. *sock* must be a * non-**NULL** pointer that was returned from @@ -2395,7 +2533,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags) + * long bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags) * Description * Push an element *value* in *map*. *flags* is one of: * @@ -2405,19 +2543,19 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_map_pop_elem(struct bpf_map *map, void *value) + * long bpf_map_pop_elem(struct bpf_map *map, void *value) * Description * Pop an element from *map*. * Return * 0 on success, or a negative error in case of failure. * - * int bpf_map_peek_elem(struct bpf_map *map, void *value) + * long bpf_map_peek_elem(struct bpf_map *map, void *value) * Description * Get an element from *map* without removing it. * Return * 0 on success, or a negative error in case of failure. * - * int bpf_msg_push_data(struct sk_msg_buff *msg, u32 start, u32 len, u64 flags) + * long bpf_msg_push_data(struct sk_msg_buff *msg, u32 start, u32 len, u64 flags) * Description * For socket policies, insert *len* bytes into *msg* at offset * *start*. @@ -2433,7 +2571,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_msg_pop_data(struct sk_msg_buff *msg, u32 start, u32 len, u64 flags) + * long bpf_msg_pop_data(struct sk_msg_buff *msg, u32 start, u32 len, u64 flags) * Description * Will remove *len* bytes from a *msg* starting at byte *start*. * This may result in **ENOMEM** errors under certain situations if @@ -2445,7 +2583,7 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_rc_pointer_rel(void *ctx, s32 rel_x, s32 rel_y) + * long bpf_rc_pointer_rel(void *ctx, s32 rel_x, s32 rel_y) * Description * This helper is used in programs implementing IR decoding, to * report a successfully decoded pointer movement. @@ -2459,7 +2597,7 @@ union bpf_attr { * Return * 0 * - * int bpf_spin_lock(struct bpf_spin_lock *lock) + * long bpf_spin_lock(struct bpf_spin_lock *lock) * Description * Acquire a spinlock represented by the pointer *lock*, which is * stored as part of a value of a map. Taking the lock allows to @@ -2507,7 +2645,7 @@ union bpf_attr { * Return * 0 * - * int bpf_spin_unlock(struct bpf_spin_lock *lock) + * long bpf_spin_unlock(struct bpf_spin_lock *lock) * Description * Release the *lock* previously locked by a call to * **bpf_spin_lock**\ (\ *lock*\ ). @@ -2530,7 +2668,7 @@ union bpf_attr { * A **struct bpf_tcp_sock** pointer on success, or **NULL** in * case of failure. * - * int bpf_skb_ecn_set_ce(struct sk_buff *skb) + * long bpf_skb_ecn_set_ce(struct sk_buff *skb) * Description * Set ECN (Explicit Congestion Notification) field of IP header * to **CE** (Congestion Encountered) if current value is **ECT** @@ -2567,7 +2705,7 @@ union bpf_attr { * result is from *reuse*\ **->socks**\ [] using the hash of the * tuple. * - * int bpf_tcp_check_syncookie(struct bpf_sock *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len) + * long bpf_tcp_check_syncookie(void *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len) * Description * Check whether *iph* and *th* contain a valid SYN cookie ACK for * the listening socket in *sk*. @@ -2578,12 +2716,11 @@ union bpf_attr { * * *th* points to the start of the TCP header, while *th_len* * contains **sizeof**\ (**struct tcphdr**). - * * Return * 0 if *iph* and *th* are a valid SYN cookie ACK, or a negative * error otherwise. * - * int bpf_sysctl_get_name(struct bpf_sysctl *ctx, char *buf, size_t buf_len, u64 flags) + * long bpf_sysctl_get_name(struct bpf_sysctl *ctx, char *buf, size_t buf_len, u64 flags) * Description * Get name of sysctl in /proc/sys/ and copy it into provided by * program buffer *buf* of size *buf_len*. @@ -2599,7 +2736,7 @@ union bpf_attr { * **-E2BIG** if the buffer wasn't big enough (*buf* will contain * truncated name in this case). * - * int bpf_sysctl_get_current_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len) + * long bpf_sysctl_get_current_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len) * Description * Get current value of sysctl as it is presented in /proc/sys * (incl. newline, etc), and copy it as a string into provided @@ -2618,7 +2755,7 @@ union bpf_attr { * **-EINVAL** if current value was unavailable, e.g. because * sysctl is uninitialized and read returns -EIO for it. * - * int bpf_sysctl_get_new_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len) + * long bpf_sysctl_get_new_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len) * Description * Get new value being written by user space to sysctl (before * the actual write happens) and copy it as a string into @@ -2635,7 +2772,7 @@ union bpf_attr { * * **-EINVAL** if sysctl is being read. * - * int bpf_sysctl_set_new_value(struct bpf_sysctl *ctx, const char *buf, size_t buf_len) + * long bpf_sysctl_set_new_value(struct bpf_sysctl *ctx, const char *buf, size_t buf_len) * Description * Override new value being written by user space to sysctl with * value provided by program in buffer *buf* of size *buf_len*. @@ -2652,7 +2789,7 @@ union bpf_attr { * * **-EINVAL** if sysctl is being read. * - * int bpf_strtol(const char *buf, size_t buf_len, u64 flags, long *res) + * long bpf_strtol(const char *buf, size_t buf_len, u64 flags, long *res) * Description * Convert the initial part of the string from buffer *buf* of * size *buf_len* to a long integer according to the given base @@ -2676,7 +2813,7 @@ union bpf_attr { * * **-ERANGE** if resulting value was out of range. * - * int bpf_strtoul(const char *buf, size_t buf_len, u64 flags, unsigned long *res) + * long bpf_strtoul(const char *buf, size_t buf_len, u64 flags, unsigned long *res) * Description * Convert the initial part of the string from buffer *buf* of * size *buf_len* to an unsigned long integer according to the @@ -2699,7 +2836,7 @@ union bpf_attr { * * **-ERANGE** if resulting value was out of range. * - * void *bpf_sk_storage_get(struct bpf_map *map, struct bpf_sock *sk, void *value, u64 flags) + * void *bpf_sk_storage_get(struct bpf_map *map, void *sk, void *value, u64 flags) * Description * Get a bpf-local-storage from a *sk*. * @@ -2715,6 +2852,9 @@ union bpf_attr { * "type". The bpf-local-storage "type" (i.e. the *map*) is * searched against all bpf-local-storages residing at *sk*. * + * *sk* is a kernel **struct sock** pointer for LSM program. + * *sk* is a **struct bpf_sock** pointer for other program types. + * * An optional *flags* (**BPF_SK_STORAGE_GET_F_CREATE**) can be * used such that a new bpf-local-storage will be * created if one does not exist. *value* can be used @@ -2727,15 +2867,16 @@ union bpf_attr { * **NULL** if not found or there was an error in adding * a new bpf-local-storage. * - * int bpf_sk_storage_delete(struct bpf_map *map, struct bpf_sock *sk) + * long bpf_sk_storage_delete(struct bpf_map *map, void *sk) * Description * Delete a bpf-local-storage from a *sk*. * Return * 0 on success. * * **-ENOENT** if the bpf-local-storage cannot be found. + * **-EINVAL** if sk is not a fullsock (e.g. a request_sock). * - * int bpf_send_signal(u32 sig) + * long bpf_send_signal(u32 sig) * Description * Send signal *sig* to the process of the current task. * The signal may be delivered to any of this process's threads. @@ -2750,7 +2891,7 @@ union bpf_attr { * * **-EAGAIN** if bpf program can try again. * - * s64 bpf_tcp_gen_syncookie(struct bpf_sock *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len) + * s64 bpf_tcp_gen_syncookie(void *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len) * Description * Try to issue a SYN cookie for the packet with corresponding * IP/TCP headers, *iph* and *th*, on the listening socket in *sk*. @@ -2761,7 +2902,6 @@ union bpf_attr { * * *th* points to the start of the TCP header, while *th_len* * contains the length of the TCP header. - * * Return * On success, lower 32 bits hold the generated SYN cookie in * followed by 16 bits which hold the MSS value for that cookie, @@ -2777,7 +2917,7 @@ union bpf_attr { * * **-EPROTONOSUPPORT** IP packet version is not 4 or 6 * - * int bpf_skb_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) + * long bpf_skb_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) * Description * Write raw *data* blob into a special BPF perf event held by * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf @@ -2801,21 +2941,21 @@ union bpf_attr { * Return * 0 on success, or a negative error in case of failure. * - * int bpf_probe_read_user(void *dst, u32 size, const void *unsafe_ptr) + * long bpf_probe_read_user(void *dst, u32 size, const void *unsafe_ptr) * Description * Safely attempt to read *size* bytes from user space address * *unsafe_ptr* and store the data in *dst*. * Return * 0 on success, or a negative error in case of failure. * - * int bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr) + * long bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr) * Description * Safely attempt to read *size* bytes from kernel space address * *unsafe_ptr* and store the data in *dst*. * Return * 0 on success, or a negative error in case of failure. * - * int bpf_probe_read_user_str(void *dst, u32 size, const void *unsafe_ptr) + * long bpf_probe_read_user_str(void *dst, u32 size, const void *unsafe_ptr) * Description * Copy a NUL terminated string from an unsafe user address * *unsafe_ptr* to *dst*. The *size* should include the @@ -2844,7 +2984,7 @@ union bpf_attr { * // size, after checking its boundaries. * } * - * In comparison, using **bpf_probe_read_user()** helper here + * In comparison, using **bpf_probe_read_user**\ () helper here * instead to read the string would require to estimate the length * at compile time, and would often result in copying more memory * than necessary. @@ -2859,22 +2999,22 @@ union bpf_attr { * including the trailing NUL character. On error, a negative * value. * - * int bpf_probe_read_kernel_str(void *dst, u32 size, const void *unsafe_ptr) + * long bpf_probe_read_kernel_str(void *dst, u32 size, const void *unsafe_ptr) * Description * Copy a NUL terminated string from an unsafe kernel address *unsafe_ptr* - * to *dst*. Same semantics as with bpf_probe_read_user_str() apply. + * to *dst*. Same semantics as with **bpf_probe_read_user_str**\ () apply. * Return - * On success, the strictly positive length of the string, including + * On success, the strictly positive length of the string, including * the trailing NUL character. On error, a negative value. * - * int bpf_tcp_send_ack(void *tp, u32 rcv_nxt) + * long bpf_tcp_send_ack(void *tp, u32 rcv_nxt) * Description - * Send out a tcp-ack. *tp* is the in-kernel struct tcp_sock. + * Send out a tcp-ack. *tp* is the in-kernel struct **tcp_sock**. * *rcv_nxt* is the ack_seq to be sent out. * Return * 0 on success, or a negative error in case of failure. * - * int bpf_send_signal_thread(u32 sig) + * long bpf_send_signal_thread(u32 sig) * Description * Send signal *sig* to the thread corresponding to the current task. * Return @@ -2893,6 +3033,639 @@ union bpf_attr { * Obtain the 64bit jiffies * Return * The 64 bit jiffies + * + * long bpf_read_branch_records(struct bpf_perf_event_data *ctx, void *buf, u32 size, u64 flags) + * Description + * For an eBPF program attached to a perf event, retrieve the + * branch records (**struct perf_branch_entry**) associated to *ctx* + * and store it in the buffer pointed by *buf* up to size + * *size* bytes. + * Return + * On success, number of bytes written to *buf*. On error, a + * negative value. + * + * The *flags* can be set to **BPF_F_GET_BRANCH_RECORDS_SIZE** to + * instead return the number of bytes required to store all the + * branch entries. If this flag is set, *buf* may be NULL. + * + * **-EINVAL** if arguments invalid or **size** not a multiple + * of **sizeof**\ (**struct perf_branch_entry**\ ). + * + * **-ENOENT** if architecture does not support branch records. + * + * long bpf_get_ns_current_pid_tgid(u64 dev, u64 ino, struct bpf_pidns_info *nsdata, u32 size) + * Description + * Returns 0 on success, values for *pid* and *tgid* as seen from the current + * *namespace* will be returned in *nsdata*. + * Return + * 0 on success, or one of the following in case of failure: + * + * **-EINVAL** if dev and inum supplied don't match dev_t and inode number + * with nsfs of current task, or if dev conversion to dev_t lost high bits. + * + * **-ENOENT** if pidns does not exists for the current task. + * + * long bpf_xdp_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) + * Description + * Write raw *data* blob into a special BPF perf event held by + * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf + * event must have the following attributes: **PERF_SAMPLE_RAW** + * as **sample_type**, **PERF_TYPE_SOFTWARE** as **type**, and + * **PERF_COUNT_SW_BPF_OUTPUT** as **config**. + * + * The *flags* are used to indicate the index in *map* for which + * the value must be put, masked with **BPF_F_INDEX_MASK**. + * Alternatively, *flags* can be set to **BPF_F_CURRENT_CPU** + * to indicate that the index of the current CPU core should be + * used. + * + * The value to write, of *size*, is passed through eBPF stack and + * pointed by *data*. + * + * *ctx* is a pointer to in-kernel struct xdp_buff. + * + * This helper is similar to **bpf_perf_eventoutput**\ () but + * restricted to raw_tracepoint bpf programs. + * Return + * 0 on success, or a negative error in case of failure. + * + * u64 bpf_get_netns_cookie(void *ctx) + * Description + * Retrieve the cookie (generated by the kernel) of the network + * namespace the input *ctx* is associated with. The network + * namespace cookie remains stable for its lifetime and provides + * a global identifier that can be assumed unique. If *ctx* is + * NULL, then the helper returns the cookie for the initial + * network namespace. The cookie itself is very similar to that + * of **bpf_get_socket_cookie**\ () helper, but for network + * namespaces instead of sockets. + * Return + * A 8-byte long opaque number. + * + * u64 bpf_get_current_ancestor_cgroup_id(int ancestor_level) + * Description + * Return id of cgroup v2 that is ancestor of the cgroup associated + * with the current task at the *ancestor_level*. The root cgroup + * is at *ancestor_level* zero and each step down the hierarchy + * increments the level. If *ancestor_level* == level of cgroup + * associated with the current task, then return value will be the + * same as that of **bpf_get_current_cgroup_id**\ (). + * + * The helper is useful to implement policies based on cgroups + * that are upper in hierarchy than immediate cgroup associated + * with the current task. + * + * The format of returned id and helper limitations are same as in + * **bpf_get_current_cgroup_id**\ (). + * Return + * The id is returned or 0 in case the id could not be retrieved. + * + * long bpf_sk_assign(struct sk_buff *skb, void *sk, u64 flags) + * Description + * Helper is overloaded depending on BPF program type. This + * description applies to **BPF_PROG_TYPE_SCHED_CLS** and + * **BPF_PROG_TYPE_SCHED_ACT** programs. + * + * Assign the *sk* to the *skb*. When combined with appropriate + * routing configuration to receive the packet towards the socket, + * will cause *skb* to be delivered to the specified socket. + * Subsequent redirection of *skb* via **bpf_redirect**\ (), + * **bpf_clone_redirect**\ () or other methods outside of BPF may + * interfere with successful delivery to the socket. + * + * This operation is only valid from TC ingress path. + * + * The *flags* argument must be zero. + * Return + * 0 on success, or a negative error in case of failure: + * + * **-EINVAL** if specified *flags* are not supported. + * + * **-ENOENT** if the socket is unavailable for assignment. + * + * **-ENETUNREACH** if the socket is unreachable (wrong netns). + * + * **-EOPNOTSUPP** if the operation is not supported, for example + * a call from outside of TC ingress. + * + * **-ESOCKTNOSUPPORT** if the socket type is not supported + * (reuseport). + * + * long bpf_sk_assign(struct bpf_sk_lookup *ctx, struct bpf_sock *sk, u64 flags) + * Description + * Helper is overloaded depending on BPF program type. This + * description applies to **BPF_PROG_TYPE_SK_LOOKUP** programs. + * + * Select the *sk* as a result of a socket lookup. + * + * For the operation to succeed passed socket must be compatible + * with the packet description provided by the *ctx* object. + * + * L4 protocol (**IPPROTO_TCP** or **IPPROTO_UDP**) must + * be an exact match. While IP family (**AF_INET** or + * **AF_INET6**) must be compatible, that is IPv6 sockets + * that are not v6-only can be selected for IPv4 packets. + * + * Only TCP listeners and UDP unconnected sockets can be + * selected. *sk* can also be NULL to reset any previous + * selection. + * + * *flags* argument can combination of following values: + * + * * **BPF_SK_LOOKUP_F_REPLACE** to override the previous + * socket selection, potentially done by a BPF program + * that ran before us. + * + * * **BPF_SK_LOOKUP_F_NO_REUSEPORT** to skip + * load-balancing within reuseport group for the socket + * being selected. + * + * On success *ctx->sk* will point to the selected socket. + * + * Return + * 0 on success, or a negative errno in case of failure. + * + * * **-EAFNOSUPPORT** if socket family (*sk->family*) is + * not compatible with packet family (*ctx->family*). + * + * * **-EEXIST** if socket has been already selected, + * potentially by another program, and + * **BPF_SK_LOOKUP_F_REPLACE** flag was not specified. + * + * * **-EINVAL** if unsupported flags were specified. + * + * * **-EPROTOTYPE** if socket L4 protocol + * (*sk->protocol*) doesn't match packet protocol + * (*ctx->protocol*). + * + * * **-ESOCKTNOSUPPORT** if socket is not in allowed + * state (TCP listening or UDP unconnected). + * + * u64 bpf_ktime_get_boot_ns(void) + * Description + * Return the time elapsed since system boot, in nanoseconds. + * Does include the time the system was suspended. + * See: **clock_gettime**\ (**CLOCK_BOOTTIME**) + * Return + * Current *ktime*. + * + * long bpf_seq_printf(struct seq_file *m, const char *fmt, u32 fmt_size, const void *data, u32 data_len) + * Description + * **bpf_seq_printf**\ () uses seq_file **seq_printf**\ () to print + * out the format string. + * The *m* represents the seq_file. The *fmt* and *fmt_size* are for + * the format string itself. The *data* and *data_len* are format string + * arguments. The *data* are a **u64** array and corresponding format string + * values are stored in the array. For strings and pointers where pointees + * are accessed, only the pointer values are stored in the *data* array. + * The *data_len* is the size of *data* in bytes. + * + * Formats **%s**, **%p{i,I}{4,6}** requires to read kernel memory. + * Reading kernel memory may fail due to either invalid address or + * valid address but requiring a major memory fault. If reading kernel memory + * fails, the string for **%s** will be an empty string, and the ip + * address for **%p{i,I}{4,6}** will be 0. Not returning error to + * bpf program is consistent with what **bpf_trace_printk**\ () does for now. + * Return + * 0 on success, or a negative error in case of failure: + * + * **-EBUSY** if per-CPU memory copy buffer is busy, can try again + * by returning 1 from bpf program. + * + * **-EINVAL** if arguments are invalid, or if *fmt* is invalid/unsupported. + * + * **-E2BIG** if *fmt* contains too many format specifiers. + * + * **-EOVERFLOW** if an overflow happened: The same object will be tried again. + * + * long bpf_seq_write(struct seq_file *m, const void *data, u32 len) + * Description + * **bpf_seq_write**\ () uses seq_file **seq_write**\ () to write the data. + * The *m* represents the seq_file. The *data* and *len* represent the + * data to write in bytes. + * Return + * 0 on success, or a negative error in case of failure: + * + * **-EOVERFLOW** if an overflow happened: The same object will be tried again. + * + * u64 bpf_sk_cgroup_id(void *sk) + * Description + * Return the cgroup v2 id of the socket *sk*. + * + * *sk* must be a non-**NULL** pointer to a socket, e.g. one + * returned from **bpf_sk_lookup_xxx**\ (), + * **bpf_sk_fullsock**\ (), etc. The format of returned id is + * same as in **bpf_skb_cgroup_id**\ (). + * + * This helper is available only if the kernel was compiled with + * the **CONFIG_SOCK_CGROUP_DATA** configuration option. + * Return + * The id is returned or 0 in case the id could not be retrieved. + * + * u64 bpf_sk_ancestor_cgroup_id(void *sk, int ancestor_level) + * Description + * Return id of cgroup v2 that is ancestor of cgroup associated + * with the *sk* at the *ancestor_level*. The root cgroup is at + * *ancestor_level* zero and each step down the hierarchy + * increments the level. If *ancestor_level* == level of cgroup + * associated with *sk*, then return value will be same as that + * of **bpf_sk_cgroup_id**\ (). + * + * The helper is useful to implement policies based on cgroups + * that are upper in hierarchy than immediate cgroup associated + * with *sk*. + * + * The format of returned id and helper limitations are same as in + * **bpf_sk_cgroup_id**\ (). + * Return + * The id is returned or 0 in case the id could not be retrieved. + * + * long bpf_ringbuf_output(void *ringbuf, void *data, u64 size, u64 flags) + * Description + * Copy *size* bytes from *data* into a ring buffer *ringbuf*. + * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification + * of new data availability is sent. + * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification + * of new data availability is sent unconditionally. + * Return + * 0 on success, or a negative error in case of failure. + * + * void *bpf_ringbuf_reserve(void *ringbuf, u64 size, u64 flags) + * Description + * Reserve *size* bytes of payload in a ring buffer *ringbuf*. + * Return + * Valid pointer with *size* bytes of memory available; NULL, + * otherwise. + * + * void bpf_ringbuf_submit(void *data, u64 flags) + * Description + * Submit reserved ring buffer sample, pointed to by *data*. + * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification + * of new data availability is sent. + * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification + * of new data availability is sent unconditionally. + * Return + * Nothing. Always succeeds. + * + * void bpf_ringbuf_discard(void *data, u64 flags) + * Description + * Discard reserved ring buffer sample, pointed to by *data*. + * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification + * of new data availability is sent. + * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification + * of new data availability is sent unconditionally. + * Return + * Nothing. Always succeeds. + * + * u64 bpf_ringbuf_query(void *ringbuf, u64 flags) + * Description + * Query various characteristics of provided ring buffer. What + * exactly is queries is determined by *flags*: + * + * * **BPF_RB_AVAIL_DATA**: Amount of data not yet consumed. + * * **BPF_RB_RING_SIZE**: The size of ring buffer. + * * **BPF_RB_CONS_POS**: Consumer position (can wrap around). + * * **BPF_RB_PROD_POS**: Producer(s) position (can wrap around). + * + * Data returned is just a momentary snapshot of actual values + * and could be inaccurate, so this facility should be used to + * power heuristics and for reporting, not to make 100% correct + * calculation. + * Return + * Requested value, or 0, if *flags* are not recognized. + * + * long bpf_csum_level(struct sk_buff *skb, u64 level) + * Description + * Change the skbs checksum level by one layer up or down, or + * reset it entirely to none in order to have the stack perform + * checksum validation. The level is applicable to the following + * protocols: TCP, UDP, GRE, SCTP, FCOE. For example, a decap of + * | ETH | IP | UDP | GUE | IP | TCP | into | ETH | IP | TCP | + * through **bpf_skb_adjust_room**\ () helper with passing in + * **BPF_F_ADJ_ROOM_NO_CSUM_RESET** flag would require one call + * to **bpf_csum_level**\ () with **BPF_CSUM_LEVEL_DEC** since + * the UDP header is removed. Similarly, an encap of the latter + * into the former could be accompanied by a helper call to + * **bpf_csum_level**\ () with **BPF_CSUM_LEVEL_INC** if the + * skb is still intended to be processed in higher layers of the + * stack instead of just egressing at tc. + * + * There are three supported level settings at this time: + * + * * **BPF_CSUM_LEVEL_INC**: Increases skb->csum_level for skbs + * with CHECKSUM_UNNECESSARY. + * * **BPF_CSUM_LEVEL_DEC**: Decreases skb->csum_level for skbs + * with CHECKSUM_UNNECESSARY. + * * **BPF_CSUM_LEVEL_RESET**: Resets skb->csum_level to 0 and + * sets CHECKSUM_NONE to force checksum validation by the stack. + * * **BPF_CSUM_LEVEL_QUERY**: No-op, returns the current + * skb->csum_level. + * Return + * 0 on success, or a negative error in case of failure. In the + * case of **BPF_CSUM_LEVEL_QUERY**, the current skb->csum_level + * is returned or the error code -EACCES in case the skb is not + * subject to CHECKSUM_UNNECESSARY. + * + * struct tcp6_sock *bpf_skc_to_tcp6_sock(void *sk) + * Description + * Dynamically cast a *sk* pointer to a *tcp6_sock* pointer. + * Return + * *sk* if casting is valid, or **NULL** otherwise. + * + * struct tcp_sock *bpf_skc_to_tcp_sock(void *sk) + * Description + * Dynamically cast a *sk* pointer to a *tcp_sock* pointer. + * Return + * *sk* if casting is valid, or **NULL** otherwise. + * + * struct tcp_timewait_sock *bpf_skc_to_tcp_timewait_sock(void *sk) + * Description + * Dynamically cast a *sk* pointer to a *tcp_timewait_sock* pointer. + * Return + * *sk* if casting is valid, or **NULL** otherwise. + * + * struct tcp_request_sock *bpf_skc_to_tcp_request_sock(void *sk) + * Description + * Dynamically cast a *sk* pointer to a *tcp_request_sock* pointer. + * Return + * *sk* if casting is valid, or **NULL** otherwise. + * + * struct udp6_sock *bpf_skc_to_udp6_sock(void *sk) + * Description + * Dynamically cast a *sk* pointer to a *udp6_sock* pointer. + * Return + * *sk* if casting is valid, or **NULL** otherwise. + * + * long bpf_get_task_stack(struct task_struct *task, void *buf, u32 size, u64 flags) + * Description + * Return a user or a kernel stack in bpf program provided buffer. + * To achieve this, the helper needs *task*, which is a valid + * pointer to **struct task_struct**. To store the stacktrace, the + * bpf program provides *buf* with a nonnegative *size*. + * + * The last argument, *flags*, holds the number of stack frames to + * skip (from 0 to 255), masked with + * **BPF_F_SKIP_FIELD_MASK**. The next bits can be used to set + * the following flags: + * + * **BPF_F_USER_STACK** + * Collect a user space stack instead of a kernel stack. + * **BPF_F_USER_BUILD_ID** + * Collect buildid+offset instead of ips for user stack, + * only valid if **BPF_F_USER_STACK** is also specified. + * + * **bpf_get_task_stack**\ () can collect up to + * **PERF_MAX_STACK_DEPTH** both kernel and user frames, subject + * to sufficient large buffer size. Note that + * this limit can be controlled with the **sysctl** program, and + * that it should be manually increased in order to profile long + * user stacks (such as stacks for Java programs). To do so, use: + * + * :: + * + * # sysctl kernel.perf_event_max_stack= + * Return + * A non-negative value equal to or less than *size* on success, + * or a negative error in case of failure. + * + * long bpf_load_hdr_opt(struct bpf_sock_ops *skops, void *searchby_res, u32 len, u64 flags) + * Description + * Load header option. Support reading a particular TCP header + * option for bpf program (**BPF_PROG_TYPE_SOCK_OPS**). + * + * If *flags* is 0, it will search the option from the + * *skops*\ **->skb_data**. The comment in **struct bpf_sock_ops** + * has details on what skb_data contains under different + * *skops*\ **->op**. + * + * The first byte of the *searchby_res* specifies the + * kind that it wants to search. + * + * If the searching kind is an experimental kind + * (i.e. 253 or 254 according to RFC6994). It also + * needs to specify the "magic" which is either + * 2 bytes or 4 bytes. It then also needs to + * specify the size of the magic by using + * the 2nd byte which is "kind-length" of a TCP + * header option and the "kind-length" also + * includes the first 2 bytes "kind" and "kind-length" + * itself as a normal TCP header option also does. + * + * For example, to search experimental kind 254 with + * 2 byte magic 0xeB9F, the searchby_res should be + * [ 254, 4, 0xeB, 0x9F, 0, 0, .... 0 ]. + * + * To search for the standard window scale option (3), + * the *searchby_res* should be [ 3, 0, 0, .... 0 ]. + * Note, kind-length must be 0 for regular option. + * + * Searching for No-Op (0) and End-of-Option-List (1) are + * not supported. + * + * *len* must be at least 2 bytes which is the minimal size + * of a header option. + * + * Supported flags: + * + * * **BPF_LOAD_HDR_OPT_TCP_SYN** to search from the + * saved_syn packet or the just-received syn packet. + * + * Return + * > 0 when found, the header option is copied to *searchby_res*. + * The return value is the total length copied. On failure, a + * negative error code is returned: + * + * **-EINVAL** if a parameter is invalid. + * + * **-ENOMSG** if the option is not found. + * + * **-ENOENT** if no syn packet is available when + * **BPF_LOAD_HDR_OPT_TCP_SYN** is used. + * + * **-ENOSPC** if there is not enough space. Only *len* number of + * bytes are copied. + * + * **-EFAULT** on failure to parse the header options in the + * packet. + * + * **-EPERM** if the helper cannot be used under the current + * *skops*\ **->op**. + * + * long bpf_store_hdr_opt(struct bpf_sock_ops *skops, const void *from, u32 len, u64 flags) + * Description + * Store header option. The data will be copied + * from buffer *from* with length *len* to the TCP header. + * + * The buffer *from* should have the whole option that + * includes the kind, kind-length, and the actual + * option data. The *len* must be at least kind-length + * long. The kind-length does not have to be 4 byte + * aligned. The kernel will take care of the padding + * and setting the 4 bytes aligned value to th->doff. + * + * This helper will check for duplicated option + * by searching the same option in the outgoing skb. + * + * This helper can only be called during + * **BPF_SOCK_OPS_WRITE_HDR_OPT_CB**. + * + * Return + * 0 on success, or negative error in case of failure: + * + * **-EINVAL** If param is invalid. + * + * **-ENOSPC** if there is not enough space in the header. + * Nothing has been written + * + * **-EEXIST** if the option already exists. + * + * **-EFAULT** on failrue to parse the existing header options. + * + * **-EPERM** if the helper cannot be used under the current + * *skops*\ **->op**. + * + * long bpf_reserve_hdr_opt(struct bpf_sock_ops *skops, u32 len, u64 flags) + * Description + * Reserve *len* bytes for the bpf header option. The + * space will be used by **bpf_store_hdr_opt**\ () later in + * **BPF_SOCK_OPS_WRITE_HDR_OPT_CB**. + * + * If **bpf_reserve_hdr_opt**\ () is called multiple times, + * the total number of bytes will be reserved. + * + * This helper can only be called during + * **BPF_SOCK_OPS_HDR_OPT_LEN_CB**. + * + * Return + * 0 on success, or negative error in case of failure: + * + * **-EINVAL** if a parameter is invalid. + * + * **-ENOSPC** if there is not enough space in the header. + * + * **-EPERM** if the helper cannot be used under the current + * *skops*\ **->op**. + * + * void *bpf_inode_storage_get(struct bpf_map *map, void *inode, void *value, u64 flags) + * Description + * Get a bpf_local_storage from an *inode*. + * + * Logically, it could be thought of as getting the value from + * a *map* with *inode* as the **key**. From this + * perspective, the usage is not much different from + * **bpf_map_lookup_elem**\ (*map*, **&**\ *inode*) except this + * helper enforces the key must be an inode and the map must also + * be a **BPF_MAP_TYPE_INODE_STORAGE**. + * + * Underneath, the value is stored locally at *inode* instead of + * the *map*. The *map* is used as the bpf-local-storage + * "type". The bpf-local-storage "type" (i.e. the *map*) is + * searched against all bpf_local_storage residing at *inode*. + * + * An optional *flags* (**BPF_LOCAL_STORAGE_GET_F_CREATE**) can be + * used such that a new bpf_local_storage will be + * created if one does not exist. *value* can be used + * together with **BPF_LOCAL_STORAGE_GET_F_CREATE** to specify + * the initial value of a bpf_local_storage. If *value* is + * **NULL**, the new bpf_local_storage will be zero initialized. + * Return + * A bpf_local_storage pointer is returned on success. + * + * **NULL** if not found or there was an error in adding + * a new bpf_local_storage. + * + * int bpf_inode_storage_delete(struct bpf_map *map, void *inode) + * Description + * Delete a bpf_local_storage from an *inode*. + * Return + * 0 on success. + * + * **-ENOENT** if the bpf_local_storage cannot be found. + * + * long bpf_d_path(struct path *path, char *buf, u32 sz) + * Description + * Return full path for given **struct path** object, which + * needs to be the kernel BTF *path* object. The path is + * returned in the provided buffer *buf* of size *sz* and + * is zero terminated. + * + * Return + * On success, the strictly positive length of the string, + * including the trailing NUL character. On error, a negative + * value. + * + * long bpf_copy_from_user(void *dst, u32 size, const void *user_ptr) + * Description + * Read *size* bytes from user space address *user_ptr* and store + * the data in *dst*. This is a wrapper of **copy_from_user**\ (). + * Return + * 0 on success, or a negative error in case of failure. + * + * long bpf_snprintf_btf(char *str, u32 str_size, struct btf_ptr *ptr, u32 btf_ptr_size, u64 flags) + * Description + * Use BTF to store a string representation of *ptr*->ptr in *str*, + * using *ptr*->type_id. This value should specify the type + * that *ptr*->ptr points to. LLVM __builtin_btf_type_id(type, 1) + * can be used to look up vmlinux BTF type ids. Traversing the + * data structure using BTF, the type information and values are + * stored in the first *str_size* - 1 bytes of *str*. Safe copy of + * the pointer data is carried out to avoid kernel crashes during + * operation. Smaller types can use string space on the stack; + * larger programs can use map data to store the string + * representation. + * + * The string can be subsequently shared with userspace via + * bpf_perf_event_output() or ring buffer interfaces. + * bpf_trace_printk() is to be avoided as it places too small + * a limit on string size to be useful. + * + * *flags* is a combination of + * + * **BTF_F_COMPACT** + * no formatting around type information + * **BTF_F_NONAME** + * no struct/union member names/types + * **BTF_F_PTR_RAW** + * show raw (unobfuscated) pointer values; + * equivalent to printk specifier %px. + * **BTF_F_ZERO** + * show zero-valued struct/union members; they + * are not displayed by default + * + * Return + * The number of bytes that were written (or would have been + * written if output had to be truncated due to string size), + * or a negative error in cases of failure. + * + * long bpf_seq_printf_btf(struct seq_file *m, struct btf_ptr *ptr, u32 ptr_size, u64 flags) + * Description + * Use BTF to write to seq_write a string representation of + * *ptr*->ptr, using *ptr*->type_id as per bpf_snprintf_btf(). + * *flags* are identical to those used for bpf_snprintf_btf. + * Return + * 0 on success or a negative error in case of failure. + * + * u64 bpf_skb_cgroup_classid(struct sk_buff *skb) + * Description + * See **bpf_get_cgroup_classid**\ () for the main description. + * This helper differs from **bpf_get_cgroup_classid**\ () in that + * the cgroup v1 net_cls class is retrieved only from the *skb*'s + * associated socket instead of the current process. + * Return + * The id is returned or 0 in case the id could not be retrieved. + * + * long bpf_redirect_neigh(u32 ifindex, u64 flags) + * Description + * Redirect the packet to another net device of index *ifindex* + * and fill in L2 addresses from neighboring subsystem. This helper + * is somewhat similar to **bpf_redirect**\ (), except that it + * fills in e.g. MAC addresses based on the L3 information from + * the packet. This helper is supported for IPv4 and IPv6 protocols. + * The *flags* argument is reserved and must be 0. The helper is + * currently only supported for tc BPF program types. + * Return + * The helper returns **TC_ACT_REDIRECT** on success or + * **TC_ACT_SHOT** on error. */ #define __BPF_FUNC_MAPPER(FN) \ FN(unspec), \ @@ -3013,7 +3786,42 @@ union bpf_attr { FN(probe_read_kernel_str), \ FN(tcp_send_ack), \ FN(send_signal_thread), \ - FN(jiffies64), + FN(jiffies64), \ + FN(read_branch_records), \ + FN(get_ns_current_pid_tgid), \ + FN(xdp_output), \ + FN(get_netns_cookie), \ + FN(get_current_ancestor_cgroup_id), \ + FN(sk_assign), \ + FN(ktime_get_boot_ns), \ + FN(seq_printf), \ + FN(seq_write), \ + FN(sk_cgroup_id), \ + FN(sk_ancestor_cgroup_id), \ + FN(ringbuf_output), \ + FN(ringbuf_reserve), \ + FN(ringbuf_submit), \ + FN(ringbuf_discard), \ + FN(ringbuf_query), \ + FN(csum_level), \ + FN(skc_to_tcp6_sock), \ + FN(skc_to_tcp_sock), \ + FN(skc_to_tcp_timewait_sock), \ + FN(skc_to_tcp_request_sock), \ + FN(skc_to_udp6_sock), \ + FN(get_task_stack), \ + FN(load_hdr_opt), \ + FN(store_hdr_opt), \ + FN(reserve_hdr_opt), \ + FN(inode_storage_get), \ + FN(inode_storage_delete), \ + FN(d_path), \ + FN(copy_from_user), \ + FN(snprintf_btf), \ + FN(seq_printf_btf), \ + FN(skb_cgroup_classid), \ + FN(redirect_neigh), \ + /* */ /* integer value in 'imm' field of BPF_CALL instruction selects which helper * function eBPF program intends to call @@ -3028,69 +3836,142 @@ enum bpf_func_id { /* All flags used by eBPF helper functions, placed here. */ /* BPF_FUNC_skb_store_bytes flags. */ -#define BPF_F_RECOMPUTE_CSUM (1ULL << 0) -#define BPF_F_INVALIDATE_HASH (1ULL << 1) +enum { + BPF_F_RECOMPUTE_CSUM = (1ULL << 0), + BPF_F_INVALIDATE_HASH = (1ULL << 1), +}; /* BPF_FUNC_l3_csum_replace and BPF_FUNC_l4_csum_replace flags. * First 4 bits are for passing the header field size. */ -#define BPF_F_HDR_FIELD_MASK 0xfULL +enum { + BPF_F_HDR_FIELD_MASK = 0xfULL, +}; /* BPF_FUNC_l4_csum_replace flags. */ -#define BPF_F_PSEUDO_HDR (1ULL << 4) -#define BPF_F_MARK_MANGLED_0 (1ULL << 5) -#define BPF_F_MARK_ENFORCE (1ULL << 6) +enum { + BPF_F_PSEUDO_HDR = (1ULL << 4), + BPF_F_MARK_MANGLED_0 = (1ULL << 5), + BPF_F_MARK_ENFORCE = (1ULL << 6), +}; /* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */ -#define BPF_F_INGRESS (1ULL << 0) +enum { + BPF_F_INGRESS = (1ULL << 0), +}; /* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */ -#define BPF_F_TUNINFO_IPV6 (1ULL << 0) +enum { + BPF_F_TUNINFO_IPV6 = (1ULL << 0), +}; /* flags for both BPF_FUNC_get_stackid and BPF_FUNC_get_stack. */ -#define BPF_F_SKIP_FIELD_MASK 0xffULL -#define BPF_F_USER_STACK (1ULL << 8) +enum { + BPF_F_SKIP_FIELD_MASK = 0xffULL, + BPF_F_USER_STACK = (1ULL << 8), /* flags used by BPF_FUNC_get_stackid only. */ -#define BPF_F_FAST_STACK_CMP (1ULL << 9) -#define BPF_F_REUSE_STACKID (1ULL << 10) + BPF_F_FAST_STACK_CMP = (1ULL << 9), + BPF_F_REUSE_STACKID = (1ULL << 10), /* flags used by BPF_FUNC_get_stack only. */ -#define BPF_F_USER_BUILD_ID (1ULL << 11) + BPF_F_USER_BUILD_ID = (1ULL << 11), +}; /* BPF_FUNC_skb_set_tunnel_key flags. */ -#define BPF_F_ZERO_CSUM_TX (1ULL << 1) -#define BPF_F_DONT_FRAGMENT (1ULL << 2) -#define BPF_F_SEQ_NUMBER (1ULL << 3) +enum { + BPF_F_ZERO_CSUM_TX = (1ULL << 1), + BPF_F_DONT_FRAGMENT = (1ULL << 2), + BPF_F_SEQ_NUMBER = (1ULL << 3), +}; /* BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and * BPF_FUNC_perf_event_read_value flags. */ -#define BPF_F_INDEX_MASK 0xffffffffULL -#define BPF_F_CURRENT_CPU BPF_F_INDEX_MASK +enum { + BPF_F_INDEX_MASK = 0xffffffffULL, + BPF_F_CURRENT_CPU = BPF_F_INDEX_MASK, /* BPF_FUNC_perf_event_output for sk_buff input context. */ -#define BPF_F_CTXLEN_MASK (0xfffffULL << 32) + BPF_F_CTXLEN_MASK = (0xfffffULL << 32), +}; /* Current network namespace */ -#define BPF_F_CURRENT_NETNS (-1L) +enum { + BPF_F_CURRENT_NETNS = (-1L), +}; + +/* BPF_FUNC_csum_level level values. */ +enum { + BPF_CSUM_LEVEL_QUERY, + BPF_CSUM_LEVEL_INC, + BPF_CSUM_LEVEL_DEC, + BPF_CSUM_LEVEL_RESET, +}; /* BPF_FUNC_skb_adjust_room flags. */ -#define BPF_F_ADJ_ROOM_FIXED_GSO (1ULL << 0) +enum { + BPF_F_ADJ_ROOM_FIXED_GSO = (1ULL << 0), + BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 = (1ULL << 1), + BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 = (1ULL << 2), + BPF_F_ADJ_ROOM_ENCAP_L4_GRE = (1ULL << 3), + BPF_F_ADJ_ROOM_ENCAP_L4_UDP = (1ULL << 4), + BPF_F_ADJ_ROOM_NO_CSUM_RESET = (1ULL << 5), +}; -#define BPF_ADJ_ROOM_ENCAP_L2_MASK 0xff -#define BPF_ADJ_ROOM_ENCAP_L2_SHIFT 56 +enum { + BPF_ADJ_ROOM_ENCAP_L2_MASK = 0xff, + BPF_ADJ_ROOM_ENCAP_L2_SHIFT = 56, +}; -#define BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 (1ULL << 1) -#define BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 (1ULL << 2) -#define BPF_F_ADJ_ROOM_ENCAP_L4_GRE (1ULL << 3) -#define BPF_F_ADJ_ROOM_ENCAP_L4_UDP (1ULL << 4) #define BPF_F_ADJ_ROOM_ENCAP_L2(len) (((__u64)len & \ BPF_ADJ_ROOM_ENCAP_L2_MASK) \ << BPF_ADJ_ROOM_ENCAP_L2_SHIFT) /* BPF_FUNC_sysctl_get_name flags. */ -#define BPF_F_SYSCTL_BASE_NAME (1ULL << 0) +enum { + BPF_F_SYSCTL_BASE_NAME = (1ULL << 0), +}; + +/* BPF_FUNC__storage_get flags */ +enum { + BPF_LOCAL_STORAGE_GET_F_CREATE = (1ULL << 0), + /* BPF_SK_STORAGE_GET_F_CREATE is only kept for backward compatibility + * and BPF_LOCAL_STORAGE_GET_F_CREATE must be used instead. + */ + BPF_SK_STORAGE_GET_F_CREATE = BPF_LOCAL_STORAGE_GET_F_CREATE, +}; + +/* BPF_FUNC_read_branch_records flags. */ +enum { + BPF_F_GET_BRANCH_RECORDS_SIZE = (1ULL << 0), +}; + +/* BPF_FUNC_bpf_ringbuf_commit, BPF_FUNC_bpf_ringbuf_discard, and + * BPF_FUNC_bpf_ringbuf_output flags. + */ +enum { + BPF_RB_NO_WAKEUP = (1ULL << 0), + BPF_RB_FORCE_WAKEUP = (1ULL << 1), +}; + +/* BPF_FUNC_bpf_ringbuf_query flags */ +enum { + BPF_RB_AVAIL_DATA = 0, + BPF_RB_RING_SIZE = 1, + BPF_RB_CONS_POS = 2, + BPF_RB_PROD_POS = 3, +}; + +/* BPF ring buffer constants */ +enum { + BPF_RINGBUF_BUSY_BIT = (1U << 31), + BPF_RINGBUF_DISCARD_BIT = (1U << 30), + BPF_RINGBUF_HDR_SZ = 8, +}; -/* BPF_FUNC_sk_storage_get flags */ -#define BPF_SK_STORAGE_GET_F_CREATE (1ULL << 0) +/* BPF_FUNC_sk_assign flags in bpf_sk_lookup context. */ +enum { + BPF_SK_LOOKUP_F_REPLACE = (1ULL << 0), + BPF_SK_LOOKUP_F_NO_REUSEPORT = (1ULL << 1), +}; /* Mode for BPF_FUNC_skb_adjust_room helper. */ enum bpf_adj_room_mode { @@ -3156,6 +4037,7 @@ struct __sk_buff { __u32 wire_len; __u32 gso_segs; __bpf_md_ptr(struct bpf_sock *, sk); + __u32 gso_size; }; struct bpf_tunnel_key { @@ -3223,6 +4105,7 @@ struct bpf_sock { __u32 dst_ip4; __u32 dst_ip6[4]; __u32 state; + __s32 rx_queue_mapping; }; struct bpf_tcp_sock { @@ -3316,6 +4199,34 @@ struct xdp_md { /* Below access go through struct xdp_rxq_info */ __u32 ingress_ifindex; /* rxq->dev->ifindex */ __u32 rx_queue_index; /* rxq->queue_index */ + + __u32 egress_ifindex; /* txq->dev->ifindex */ +}; + +/* DEVMAP map-value layout + * + * The struct data-layout of map-value is a configuration interface. + * New members can only be added to the end of this structure. + */ +struct bpf_devmap_val { + __u32 ifindex; /* device index */ + union { + int fd; /* prog fd on map write */ + __u32 id; /* prog id on map read */ + } bpf_prog; +}; + +/* CPUMAP map-value layout + * + * The struct data-layout of map-value is a configuration interface. + * New members can only be added to the end of this structure. + */ +struct bpf_cpumap_val { + __u32 qsize; /* queue size to remote target CPU */ + union { + int fd; /* prog fd on map write */ + __u32 id; /* prog id on map read */ + } bpf_prog; }; enum sk_action { @@ -3338,6 +4249,8 @@ struct sk_msg_md { __u32 remote_port; /* Stored in network byte order */ __u32 local_port; /* stored in host byte order */ __u32 size; /* Total size of sk_msg */ + + __bpf_md_ptr(struct bpf_sock *, sk); /* current socket */ }; struct sk_reuseport_md { @@ -3428,9 +4341,44 @@ struct bpf_btf_info { __u32 id; } __attribute__((aligned(8))); +struct bpf_link_info { + __u32 type; + __u32 id; + __u32 prog_id; + union { + struct { + __aligned_u64 tp_name; /* in/out: tp_name buffer ptr */ + __u32 tp_name_len; /* in/out: tp_name buffer len */ + } raw_tracepoint; + struct { + __u32 attach_type; + } tracing; + struct { + __u64 cgroup_id; + __u32 attach_type; + } cgroup; + struct { + __aligned_u64 target_name; /* in/out: target_name buffer ptr */ + __u32 target_name_len; /* in/out: target_name buffer len */ + union { + struct { + __u32 map_id; + } map; + }; + } iter; + struct { + __u32 netns_ino; + __u32 attach_type; + } netns; + struct { + __u32 ifindex; + } xdp; + }; +} __attribute__((aligned(8))); + /* User bpf_sock_addr struct to access socket fields and sockaddr struct passed * by user and intended to be used by socket (e.g. to bind to, depends on - * attach attach type). + * attach type). */ struct bpf_sock_addr { __u32 user_family; /* Allows 4-byte read, but no write. */ @@ -3440,7 +4388,7 @@ struct bpf_sock_addr { __u32 user_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write. * Stored in network byte order. */ - __u32 user_port; /* Allows 4-byte read and write. + __u32 user_port; /* Allows 1,2,4-byte read and 4-byte write. * Stored in network byte order */ __u32 family; /* Allows 4-byte read, but no write */ @@ -3505,16 +4453,90 @@ struct bpf_sock_ops { __u64 bytes_received; __u64 bytes_acked; __bpf_md_ptr(struct bpf_sock *, sk); + /* [skb_data, skb_data_end) covers the whole TCP header. + * + * BPF_SOCK_OPS_PARSE_HDR_OPT_CB: The packet received + * BPF_SOCK_OPS_HDR_OPT_LEN_CB: Not useful because the + * header has not been written. + * BPF_SOCK_OPS_WRITE_HDR_OPT_CB: The header and options have + * been written so far. + * BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB: The SYNACK that concludes + * the 3WHS. + * BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB: The ACK that concludes + * the 3WHS. + * + * bpf_load_hdr_opt() can also be used to read a particular option. + */ + __bpf_md_ptr(void *, skb_data); + __bpf_md_ptr(void *, skb_data_end); + __u32 skb_len; /* The total length of a packet. + * It includes the header, options, + * and payload. + */ + __u32 skb_tcp_flags; /* tcp_flags of the header. It provides + * an easy way to check for tcp_flags + * without parsing skb_data. + * + * In particular, the skb_tcp_flags + * will still be available in + * BPF_SOCK_OPS_HDR_OPT_LEN even though + * the outgoing header has not + * been written yet. + */ }; /* Definitions for bpf_sock_ops_cb_flags */ -#define BPF_SOCK_OPS_RTO_CB_FLAG (1<<0) -#define BPF_SOCK_OPS_RETRANS_CB_FLAG (1<<1) -#define BPF_SOCK_OPS_STATE_CB_FLAG (1<<2) -#define BPF_SOCK_OPS_RTT_CB_FLAG (1<<3) -#define BPF_SOCK_OPS_ALL_CB_FLAGS 0xF /* Mask of all currently - * supported cb flags - */ +enum { + BPF_SOCK_OPS_RTO_CB_FLAG = (1<<0), + BPF_SOCK_OPS_RETRANS_CB_FLAG = (1<<1), + BPF_SOCK_OPS_STATE_CB_FLAG = (1<<2), + BPF_SOCK_OPS_RTT_CB_FLAG = (1<<3), + /* Call bpf for all received TCP headers. The bpf prog will be + * called under sock_ops->op == BPF_SOCK_OPS_PARSE_HDR_OPT_CB + * + * Please refer to the comment in BPF_SOCK_OPS_PARSE_HDR_OPT_CB + * for the header option related helpers that will be useful + * to the bpf programs. + * + * It could be used at the client/active side (i.e. connect() side) + * when the server told it that the server was in syncookie + * mode and required the active side to resend the bpf-written + * options. The active side can keep writing the bpf-options until + * it received a valid packet from the server side to confirm + * the earlier packet (and options) has been received. The later + * example patch is using it like this at the active side when the + * server is in syncookie mode. + * + * The bpf prog will usually turn this off in the common cases. + */ + BPF_SOCK_OPS_PARSE_ALL_HDR_OPT_CB_FLAG = (1<<4), + /* Call bpf when kernel has received a header option that + * the kernel cannot handle. The bpf prog will be called under + * sock_ops->op == BPF_SOCK_OPS_PARSE_HDR_OPT_CB. + * + * Please refer to the comment in BPF_SOCK_OPS_PARSE_HDR_OPT_CB + * for the header option related helpers that will be useful + * to the bpf programs. + */ + BPF_SOCK_OPS_PARSE_UNKNOWN_HDR_OPT_CB_FLAG = (1<<5), + /* Call bpf when the kernel is writing header options for the + * outgoing packet. The bpf prog will first be called + * to reserve space in a skb under + * sock_ops->op == BPF_SOCK_OPS_HDR_OPT_LEN_CB. Then + * the bpf prog will be called to write the header option(s) + * under sock_ops->op == BPF_SOCK_OPS_WRITE_HDR_OPT_CB. + * + * Please refer to the comment in BPF_SOCK_OPS_HDR_OPT_LEN_CB + * and BPF_SOCK_OPS_WRITE_HDR_OPT_CB for the header option + * related helpers that will be useful to the bpf programs. + * + * The kernel gets its chance to reserve space and write + * options first before the BPF program does. + */ + BPF_SOCK_OPS_WRITE_HDR_OPT_CB_FLAG = (1<<6), +/* Mask of all currently supported cb flags */ + BPF_SOCK_OPS_ALL_CB_FLAGS = 0x7F, +}; /* List of known BPF sock_ops operators. * New entries can only be added at the end @@ -3569,6 +4591,63 @@ enum { */ BPF_SOCK_OPS_RTT_CB, /* Called on every RTT. */ + BPF_SOCK_OPS_PARSE_HDR_OPT_CB, /* Parse the header option. + * It will be called to handle + * the packets received at + * an already established + * connection. + * + * sock_ops->skb_data: + * Referring to the received skb. + * It covers the TCP header only. + * + * bpf_load_hdr_opt() can also + * be used to search for a + * particular option. + */ + BPF_SOCK_OPS_HDR_OPT_LEN_CB, /* Reserve space for writing the + * header option later in + * BPF_SOCK_OPS_WRITE_HDR_OPT_CB. + * Arg1: bool want_cookie. (in + * writing SYNACK only) + * + * sock_ops->skb_data: + * Not available because no header has + * been written yet. + * + * sock_ops->skb_tcp_flags: + * The tcp_flags of the + * outgoing skb. (e.g. SYN, ACK, FIN). + * + * bpf_reserve_hdr_opt() should + * be used to reserve space. + */ + BPF_SOCK_OPS_WRITE_HDR_OPT_CB, /* Write the header options + * Arg1: bool want_cookie. (in + * writing SYNACK only) + * + * sock_ops->skb_data: + * Referring to the outgoing skb. + * It covers the TCP header + * that has already been written + * by the kernel and the + * earlier bpf-progs. + * + * sock_ops->skb_tcp_flags: + * The tcp_flags of the outgoing + * skb. (e.g. SYN, ACK, FIN). + * + * bpf_store_hdr_opt() should + * be used to write the + * option. + * + * bpf_load_hdr_opt() can also + * be used to search for a + * particular option that + * has already been written + * by the kernel or the + * earlier bpf-progs. + */ }; /* List of TCP states. There is a build check in net/ipv4/tcp.c to detect @@ -3593,8 +4672,67 @@ enum { BPF_TCP_MAX_STATES /* Leave at the end! */ }; -#define TCP_BPF_IW 1001 /* Set TCP initial congestion window */ -#define TCP_BPF_SNDCWND_CLAMP 1002 /* Set sndcwnd_clamp */ +enum { + TCP_BPF_IW = 1001, /* Set TCP initial congestion window */ + TCP_BPF_SNDCWND_CLAMP = 1002, /* Set sndcwnd_clamp */ + TCP_BPF_DELACK_MAX = 1003, /* Max delay ack in usecs */ + TCP_BPF_RTO_MIN = 1004, /* Min delay ack in usecs */ + /* Copy the SYN pkt to optval + * + * BPF_PROG_TYPE_SOCK_OPS only. It is similar to the + * bpf_getsockopt(TCP_SAVED_SYN) but it does not limit + * to only getting from the saved_syn. It can either get the + * syn packet from: + * + * 1. the just-received SYN packet (only available when writing the + * SYNACK). It will be useful when it is not necessary to + * save the SYN packet for latter use. It is also the only way + * to get the SYN during syncookie mode because the syn + * packet cannot be saved during syncookie. + * + * OR + * + * 2. the earlier saved syn which was done by + * bpf_setsockopt(TCP_SAVE_SYN). + * + * The bpf_getsockopt(TCP_BPF_SYN*) option will hide where the + * SYN packet is obtained. + * + * If the bpf-prog does not need the IP[46] header, the + * bpf-prog can avoid parsing the IP header by using + * TCP_BPF_SYN. Otherwise, the bpf-prog can get both + * IP[46] and TCP header by using TCP_BPF_SYN_IP. + * + * >0: Total number of bytes copied + * -ENOSPC: Not enough space in optval. Only optlen number of + * bytes is copied. + * -ENOENT: The SYN skb is not available now and the earlier SYN pkt + * is not saved by setsockopt(TCP_SAVE_SYN). + */ + TCP_BPF_SYN = 1005, /* Copy the TCP header */ + TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */ + TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */ +}; + +enum { + BPF_LOAD_HDR_OPT_TCP_SYN = (1ULL << 0), +}; + +/* args[0] value during BPF_SOCK_OPS_HDR_OPT_LEN_CB and + * BPF_SOCK_OPS_WRITE_HDR_OPT_CB. + */ +enum { + BPF_WRITE_HDR_TCP_CURRENT_MSS = 1, /* Kernel is finding the + * total option spaces + * required for an established + * sk in order to calculate the + * MSS. No skb is actually + * sent. + */ + BPF_WRITE_HDR_TCP_SYNACK_COOKIE = 2, /* Kernel is in syncookie mode + * when sending a SYN. + */ +}; struct bpf_perf_event_value { __u64 counter; @@ -3602,12 +4740,16 @@ struct bpf_perf_event_value { __u64 running; }; -#define BPF_DEVCG_ACC_MKNOD (1ULL << 0) -#define BPF_DEVCG_ACC_READ (1ULL << 1) -#define BPF_DEVCG_ACC_WRITE (1ULL << 2) +enum { + BPF_DEVCG_ACC_MKNOD = (1ULL << 0), + BPF_DEVCG_ACC_READ = (1ULL << 1), + BPF_DEVCG_ACC_WRITE = (1ULL << 2), +}; -#define BPF_DEVCG_DEV_BLOCK (1ULL << 0) -#define BPF_DEVCG_DEV_CHAR (1ULL << 1) +enum { + BPF_DEVCG_DEV_BLOCK = (1ULL << 0), + BPF_DEVCG_DEV_CHAR = (1ULL << 1), +}; struct bpf_cgroup_dev_ctx { /* access_type encoded as (BPF_DEVCG_ACC_* << 16) | BPF_DEVCG_DEV_* */ @@ -3623,8 +4765,10 @@ struct bpf_raw_tracepoint_args { /* DIRECT: Skip the FIB rules and go to FIB table associated with device * OUTPUT: Do lookup from egress perspective; default is ingress */ -#define BPF_FIB_LOOKUP_DIRECT (1U << 0) -#define BPF_FIB_LOOKUP_OUTPUT (1U << 1) +enum { + BPF_FIB_LOOKUP_DIRECT = (1U << 0), + BPF_FIB_LOOKUP_OUTPUT = (1U << 1), +}; enum { BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */ @@ -3696,9 +4840,11 @@ enum bpf_task_fd_type { BPF_FD_TYPE_URETPROBE, /* filename + offset */ }; -#define BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG (1U << 0) -#define BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL (1U << 1) -#define BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP (1U << 2) +enum { + BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG = (1U << 0), + BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL = (1U << 1), + BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP = (1U << 2), +}; struct bpf_flow_keys { __u16 nhoff; @@ -3764,5 +4910,54 @@ struct bpf_sockopt { __s32 retval; }; +struct bpf_pidns_info { + __u32 pid; + __u32 tgid; +}; + +/* User accessible data for SK_LOOKUP programs. Add new fields at the end. */ +struct bpf_sk_lookup { + __bpf_md_ptr(struct bpf_sock *, sk); /* Selected socket */ + + __u32 family; /* Protocol family (AF_INET, AF_INET6) */ + __u32 protocol; /* IP protocol (IPPROTO_TCP, IPPROTO_UDP) */ + __u32 remote_ip4; /* Network byte order */ + __u32 remote_ip6[4]; /* Network byte order */ + __u32 remote_port; /* Network byte order */ + __u32 local_ip4; /* Network byte order */ + __u32 local_ip6[4]; /* Network byte order */ + __u32 local_port; /* Host byte order */ +}; + +/* + * struct btf_ptr is used for typed pointer representation; the + * type id is used to render the pointer data as the appropriate type + * via the bpf_snprintf_btf() helper described above. A flags field - + * potentially to specify additional details about the BTF pointer + * (rather than its mode of display) - is included for future use. + * Display flags - BTF_F_* - are passed to bpf_snprintf_btf separately. + */ +struct btf_ptr { + void *ptr; + __u32 type_id; + __u32 flags; /* BTF ptr flags; unused at present. */ +}; + +/* + * Flags to control bpf_snprintf_btf() behaviour. + * - BTF_F_COMPACT: no formatting around type information + * - BTF_F_NONAME: no struct/union member names/types + * - BTF_F_PTR_RAW: show raw (unobfuscated) pointer values; + * equivalent to %px. + * - BTF_F_ZERO: show zero-valued struct/union members; they + * are not displayed by default + */ +enum { + BTF_F_COMPACT = (1ULL << 0), + BTF_F_NONAME = (1ULL << 1), + BTF_F_PTR_RAW = (1ULL << 2), + BTF_F_ZERO = (1ULL << 3), +}; + #endif /* _UAPI__LINUX_BPF_H__ */ )********" diff --git a/src/cc/export/helpers.h b/src/cc/export/helpers.h index 49aa66feb..b3d37dfb9 100644 --- a/src/cc/export/helpers.h +++ b/src/cc/export/helpers.h @@ -51,6 +51,7 @@ R"********( #include #include #include +#include #ifndef CONFIG_BPF_SYSCALL #error "CONFIG_BPF_SYSCALL is undefined, please check your .config or ask your Linux distro to enable this feature" @@ -78,6 +79,15 @@ R"********( __attribute__ ((section(".maps." #name), used)) \ ____btf_map_##name = { } +// Associate map with its key/value types for QUEUE/STACK map types +#define BPF_ANNOTATE_KV_PAIR_QUEUESTACK(name, type_val) \ + struct ____btf_map_##name { \ + type_val value; \ + }; \ + struct ____btf_map_##name \ + __attribute__ ((section(".maps." #name), used)) \ + ____btf_map_##name = { } + // Changes to the macro require changes in BFrontendAction classes #define BPF_F_TABLE(_table_type, _key_type, _leaf_type, _name, _max_entries, _flags) \ struct _name##_table_t { \ @@ -99,6 +109,51 @@ __attribute__((section("maps/" _table_type))) \ struct _name##_table_t _name = { .flags = (_flags), .max_entries = (_max_entries) }; \ BPF_ANNOTATE_KV_PAIR(_name, _key_type, _leaf_type) + +// Changes to the macro require changes in BFrontendAction classes +#define BPF_QUEUESTACK(_table_type, _name, _leaf_type, _max_entries, _flags) \ +struct _name##_table_t { \ + _leaf_type leaf; \ + int * (*peek) (_leaf_type *); \ + int * (*pop) (_leaf_type *); \ + int * (*push) (_leaf_type *, u64); \ + u32 max_entries; \ + int flags; \ +}; \ +__attribute__((section("maps/" _table_type))) \ +struct _name##_table_t _name = { .flags = (_flags), .max_entries = (_max_entries) }; \ +BPF_ANNOTATE_KV_PAIR_QUEUESTACK(_name, _leaf_type) + +// define queue with 3 parameters (_type=queue/stack automatically) and default flags to 0 +#define BPF_QUEUE_STACK3(_type, _name, _leaf_type, _max_entries) \ + BPF_QUEUESTACK(_type, _name, _leaf_type, _max_entries, 0) + +// define queue with 4 parameters (_type=queue/stack automatically) +#define BPF_QUEUE_STACK4(_type, _name, _leaf_type, _max_entries, _flags) \ + BPF_QUEUESTACK(_type, _name, _leaf_type, _max_entries, _flags) + +// helper for default-variable macro function +#define BPF_QUEUE_STACKX(_1, _2, _3, _4, NAME, ...) NAME + +#define BPF_QUEUE(...) \ + BPF_QUEUE_STACKX(__VA_ARGS__, BPF_QUEUE_STACK4, BPF_QUEUE_STACK3)("queue", __VA_ARGS__) + +#define BPF_STACK(...) \ + BPF_QUEUE_STACKX(__VA_ARGS__, BPF_QUEUE_STACK4, BPF_QUEUE_STACK3)("stack", __VA_ARGS__) + +#define BPF_QUEUESTACK_PINNED(_table_type, _name, _leaf_type, _max_entries, _flags, _pinned) \ +BPF_QUEUESTACK(_table_type ":" _pinned, _name, _leaf_type, _max_entries, _flags) + +#define BPF_QUEUESTACK_PUBLIC(_table_type, _name, _leaf_type, _max_entries, _flags) \ +BPF_QUEUESTACK(_table_type, _name, _leaf_type, _max_entries, _flags); \ +__attribute__((section("maps/export"))) \ +struct _name##_table_t __##_name + +#define BPF_QUEUESTACK_SHARED(_table_type, _name, _leaf_type, _max_entries, _flags) \ +BPF_QUEUESTACK(_table_type, _name, _leaf_type, _max_entries, _flags); \ +__attribute__((section("maps/shared"))) \ +struct _name##_table_t __##_name + #define BPF_TABLE(_table_type, _key_type, _leaf_type, _name, _max_entries) \ BPF_F_TABLE(_table_type, _key_type, _leaf_type, _name, _max_entries, 0) @@ -128,7 +183,7 @@ struct _name##_table_t __##_name #endif #endif -// Table for pushing custom events to userspace via ring buffer +// Table for pushing custom events to userspace via perf ring buffer #define BPF_PERF_OUTPUT(_name) \ struct _name##_table_t { \ int key; \ @@ -141,6 +196,24 @@ struct _name##_table_t { \ __attribute__((section("maps/perf_output"))) \ struct _name##_table_t _name = { .max_entries = 0 } +// Table for pushing custom events to userspace via ring buffer +#define BPF_RINGBUF_OUTPUT(_name, _num_pages) \ +struct _name##_table_t { \ + int key; \ + u32 leaf; \ + /* map.ringbuf_output(data, data_size, flags) */ \ + int (*ringbuf_output) (void *, u64, u64); \ + /* map.ringbuf_reserve(data_size) */ \ + void* (*ringbuf_reserve) (u64); \ + /* map.ringbuf_discard(data, flags) */ \ + void (*ringbuf_discard) (void *, u64); \ + /* map.ringbuf_submit(data, flags) */ \ + void (*ringbuf_submit) (void *, u64); \ + u32 max_entries; \ +}; \ +__attribute__((section("maps/ringbuf"))) \ +struct _name##_table_t _name = { .max_entries = ((_num_pages) * PAGE_SIZE) } + // Table for reading hw perf cpu counters #define BPF_PERF_ARRAY(_name, _max_entries) \ struct _name##_table_t { \ @@ -448,7 +521,7 @@ static int (*bpf_sysctl_get_new_value)(struct bpf_sysctl *ctx, char *buf, size_t (void *) BPF_FUNC_sysctl_get_new_value; static int (*bpf_sysctl_set_new_value)(struct bpf_sysctl *ctx, const char *buf, size_t buf_len) = (void *) BPF_FUNC_sysctl_set_new_value; -static int (*bpf_tcp_check_syncookie)(struct bpf_sock *sk, void *ip, int ip_len, void *tcp, +static int (*bpf_tcp_check_syncookie)(void *sk, void *ip, int ip_len, void *tcp, int tcp_len) = (void *) BPF_FUNC_tcp_check_syncookie; static int (*bpf_xdp_adjust_meta)(void *ctx, int offset) = @@ -564,7 +637,7 @@ static struct bpf_sock *(*bpf_sk_lookup_udp)(void *ctx, int size, unsigned int netns_id, unsigned long long flags) = (void *) BPF_FUNC_sk_lookup_udp; -static int (*bpf_sk_release)(struct bpf_sock *sk) = +static int (*bpf_sk_release)(void *sk) = (void *) BPF_FUNC_sk_release; static int (*bpf_map_push_elem)(void *map, const void *value, u64 flags) = (void *) BPF_FUNC_map_push_elem; @@ -590,18 +663,19 @@ static int (*bpf_skb_ecn_set_ce)(void *ctx) = (void *) BPF_FUNC_skb_ecn_set_ce; static struct bpf_sock *(*bpf_get_listener_sock)(struct bpf_sock *sk) = (void *) BPF_FUNC_get_listener_sock; -static void *(*bpf_sk_storage_get)(void *map, struct bpf_sock *sk, +static void *(*bpf_sk_storage_get)(void *map, void *sk, void *value, __u64 flags) = (void *) BPF_FUNC_sk_storage_get; -static int (*bpf_sk_storage_delete)(void *map, struct bpf_sock *sk) = +static int (*bpf_sk_storage_delete)(void *map, void *sk) = (void *)BPF_FUNC_sk_storage_delete; static int (*bpf_send_signal)(unsigned sig) = (void *)BPF_FUNC_send_signal; -static long long (*bpf_tcp_gen_syncookie)(struct bpf_sock *sk, void *ip, +static long long (*bpf_tcp_gen_syncookie)(void *sk, void *ip, int ip_len, void *tcp, int tcp_len) = (void *) BPF_FUNC_tcp_gen_syncookie; static int (*bpf_skb_output)(void *ctx, void *map, __u64 flags, void *data, __u64 size) = (void *)BPF_FUNC_skb_output; + static int (*bpf_probe_read_user)(void *dst, __u32 size, const void *unsafe_ptr) = (void *)BPF_FUNC_probe_read_user; @@ -614,11 +688,116 @@ static int (*bpf_probe_read_user_str)(void *dst, __u32 size, static int (*bpf_probe_read_kernel_str)(void *dst, __u32 size, const void *unsafe_ptr) = (void *)BPF_FUNC_probe_read_kernel_str; +static int (*bpf_tcp_send_ack)(void *tp, __u32 rcv_nxt) = + (void *)BPF_FUNC_tcp_send_ack; +static int (*bpf_send_signal_thread)(__u32 sig) = + (void *)BPF_FUNC_send_signal_thread; +static __u64 (*bpf_jiffies64)(void) = (void *)BPF_FUNC_jiffies64; + +struct bpf_perf_event_data; +static int (*bpf_read_branch_records)(struct bpf_perf_event_data *ctx, void *buf, + __u32 size, __u64 flags) = + (void *)BPF_FUNC_read_branch_records; +static int (*bpf_get_ns_current_pid_tgid)(__u64 dev, __u64 ino, + struct bpf_pidns_info *nsdata, + __u32 size) = + (void *)BPF_FUNC_get_ns_current_pid_tgid; + +struct bpf_map; +static int (*bpf_xdp_output)(void *ctx, struct bpf_map *map, __u64 flags, + void *data, __u64 size) = + (void *)BPF_FUNC_xdp_output; +static __u64 (*bpf_get_netns_cookie)(void *ctx) = (void *)BPF_FUNC_get_netns_cookie; +static __u64 (*bpf_get_current_ancestor_cgroup_id)(int ancestor_level) = + (void *)BPF_FUNC_get_current_ancestor_cgroup_id; + +struct sk_buff; +static int (*bpf_sk_assign)(void *skb, void *sk, __u64 flags) = + (void *)BPF_FUNC_sk_assign; + +static __u64 (*bpf_ktime_get_boot_ns)(void) = (void *)BPF_FUNC_ktime_get_boot_ns; + +struct seq_file; +static int (*bpf_seq_printf)(struct seq_file *m, const char *fmt, __u32 fmt_size, + const void *data, __u32 data_len) = + (void *)BPF_FUNC_seq_printf; +static int (*bpf_seq_write)(struct seq_file *m, const void *data, __u32 len) = + (void *)BPF_FUNC_seq_write; + +static __u64 (*bpf_sk_cgroup_id)(void *sk) = (void *)BPF_FUNC_sk_cgroup_id; +static __u64 (*bpf_sk_ancestor_cgroup_id)(void *sk, int ancestor_level) = + (void *)BPF_FUNC_sk_ancestor_cgroup_id; + +static int (*bpf_ringbuf_output)(void *ringbuf, void *data, __u64 size, __u64 flags) = + (void *)BPF_FUNC_ringbuf_output; +static void *(*bpf_ringbuf_reserve)(void *ringbuf, __u64 size, __u64 flags) = + (void *)BPF_FUNC_ringbuf_reserve; +static void (*bpf_ringbuf_submit)(void *data, __u64 flags) = + (void *)BPF_FUNC_ringbuf_submit; +static void (*bpf_ringbuf_discard)(void *data, __u64 flags) = + (void *)BPF_FUNC_ringbuf_discard; +static __u64 (*bpf_ringbuf_query)(void *ringbuf, __u64 flags) = + (void *)BPF_FUNC_ringbuf_query; + +static int (*bpf_csum_level)(struct __sk_buff *skb, __u64 level) = + (void *)BPF_FUNC_csum_level; + +struct tcp6_sock; +struct tcp_sock; +struct tcp_timewait_sock; +struct tcp_request_sock; +struct udp6_sock; +static struct tcp6_sock *(*bpf_skc_to_tcp6_sock)(void *sk) = + (void *)BPF_FUNC_skc_to_tcp6_sock; +static struct tcp_sock *(*bpf_skc_to_tcp_sock)(void *sk) = + (void *)BPF_FUNC_skc_to_tcp_sock; +static struct tcp_timewait_sock *(*bpf_skc_to_tcp_timewait_sock)(void *sk) = + (void *)BPF_FUNC_skc_to_tcp_timewait_sock; +static struct tcp_request_sock *(*bpf_skc_to_tcp_request_sock)(void *sk) = + (void *)BPF_FUNC_skc_to_tcp_request_sock; +static struct udp6_sock *(*bpf_skc_to_udp6_sock)(void *sk) = + (void *)BPF_FUNC_skc_to_udp6_sock; + +struct task_struct; +static long (*bpf_get_task_stack)(struct task_struct *task, void *buf, + __u32 size, __u64 flags) = + (void *)BPF_FUNC_get_task_stack; + +struct bpf_sock_ops; +static long (*bpf_load_hdr_opt)(struct bpf_sock_ops *skops, void *searchby_res, + u32 len, u64 flags) = + (void *)BPF_FUNC_load_hdr_opt; +static long (*bpf_store_hdr_opt)(struct bpf_sock_ops *skops, const void *from, + u32 len, u64 flags) = + (void *)BPF_FUNC_store_hdr_opt; +static long (*bpf_reserve_hdr_opt)(struct bpf_sock_ops *skops, u32 len, + u64 flags) = + (void *)BPF_FUNC_reserve_hdr_opt; +static void *(*bpf_inode_storage_get)(struct bpf_map *map, void *inode, + void *value, u64 flags) = + (void *)BPF_FUNC_inode_storage_get; +static int (*bpf_inode_storage_delete)(struct bpf_map *map, void *inode) = + (void *)BPF_FUNC_inode_storage_delete; +struct path; +static long (*bpf_d_path)(struct path *path, char *buf, u32 sz) = + (void *)BPF_FUNC_d_path; +static long (*bpf_copy_from_user)(void *dst, u32 size, const void *user_ptr) = + (void *)BPF_FUNC_copy_from_user; + +static long (*bpf_snprintf_btf)(char *str, __u32 str_size, struct btf_ptr *ptr, + __u32 btf_ptr_size, __u64 flags) = + (void *)BPF_FUNC_snprintf_btf; +static long (*bpf_seq_printf_btf)(struct seq_file *m, struct btf_ptr *ptr, + __u32 ptr_size, __u64 flags) = + (void *)BPF_FUNC_seq_printf_btf; +static __u64 (*bpf_skb_cgroup_classid)(struct __sk_buff *skb) = + (void *)BPF_FUNC_skb_cgroup_classid; +static long (*bpf_redirect_neigh)(__u32 ifindex, __u64 flags) = + (void *)BPF_FUNC_redirect_neigh; /* llvm builtin functions that eBPF C program may use to * emit BPF_LD_ABS and BPF_LD_IND instructions */ -struct sk_buff; unsigned long long load_byte(void *skb, unsigned long long off) asm("llvm.bpf.load.byte"); unsigned long long load_half(void *skb, @@ -862,8 +1041,8 @@ int bpf_usdt_readarg_p(int argc, struct pt_regs *ctx, void *buf, u64 len) asm("l #if defined(__TARGET_ARCH_x86) #define bpf_target_x86 #define bpf_target_defined -#elif defined(__TARGET_ARCH_s930x) -#define bpf_target_s930x +#elif defined(__TARGET_ARCH_s390x) +#define bpf_target_s390x #define bpf_target_defined #elif defined(__TARGET_ARCH_arm64) #define bpf_target_arm64 @@ -880,7 +1059,7 @@ int bpf_usdt_readarg_p(int argc, struct pt_regs *ctx, void *buf, u64 len) asm("l #if defined(__x86_64__) #define bpf_target_x86 #elif defined(__s390x__) -#define bpf_target_s930x +#define bpf_target_s390x #elif defined(__aarch64__) #define bpf_target_arm64 #elif defined(__powerpc__) @@ -898,7 +1077,7 @@ int bpf_usdt_readarg_p(int argc, struct pt_regs *ctx, void *buf, u64 len) asm("l #define PT_REGS_RC(ctx) ((ctx)->gpr[3]) #define PT_REGS_IP(ctx) ((ctx)->nip) #define PT_REGS_SP(ctx) ((ctx)->gpr[1]) -#elif defined(bpf_target_s930x) +#elif defined(bpf_target_s390x) #define PT_REGS_PARM1(x) ((x)->gprs[2]) #define PT_REGS_PARM2(x) ((x)->gprs[3]) #define PT_REGS_PARM3(x) ((x)->gprs[4]) @@ -945,6 +1124,59 @@ int tracepoint__##category##__##event(struct tracepoint__##category##__##event * #define RAW_TRACEPOINT_PROBE(event) \ int raw_tracepoint__##event(struct bpf_raw_tracepoint_args *ctx) +/* BPF_PROG macro allows to define trampoline function, + * borrowed from kernel bpf selftest code. + */ +#define ___bpf_concat(a, b) a ## b +#define ___bpf_apply(fn, n) ___bpf_concat(fn, n) +#define ___bpf_nth(_, _1, _2, _3, _4, _5, _6, _7, _8, _9, _a, _b, _c, N, ...) N +#define ___bpf_narg(...) \ + ___bpf_nth(_, ##__VA_ARGS__, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + +#define ___bpf_ctx_cast0() ctx +#define ___bpf_ctx_cast1(x) ___bpf_ctx_cast0(), (void *)ctx[0] +#define ___bpf_ctx_cast2(x, args...) ___bpf_ctx_cast1(args), (void *)ctx[1] +#define ___bpf_ctx_cast3(x, args...) ___bpf_ctx_cast2(args), (void *)ctx[2] +#define ___bpf_ctx_cast4(x, args...) ___bpf_ctx_cast3(args), (void *)ctx[3] +#define ___bpf_ctx_cast5(x, args...) ___bpf_ctx_cast4(args), (void *)ctx[4] +#define ___bpf_ctx_cast6(x, args...) ___bpf_ctx_cast5(args), (void *)ctx[5] +#define ___bpf_ctx_cast7(x, args...) ___bpf_ctx_cast6(args), (void *)ctx[6] +#define ___bpf_ctx_cast8(x, args...) ___bpf_ctx_cast7(args), (void *)ctx[7] +#define ___bpf_ctx_cast9(x, args...) ___bpf_ctx_cast8(args), (void *)ctx[8] +#define ___bpf_ctx_cast10(x, args...) ___bpf_ctx_cast9(args), (void *)ctx[9] +#define ___bpf_ctx_cast11(x, args...) ___bpf_ctx_cast10(args), (void *)ctx[10] +#define ___bpf_ctx_cast12(x, args...) ___bpf_ctx_cast11(args), (void *)ctx[11] +#define ___bpf_ctx_cast(args...) \ + ___bpf_apply(___bpf_ctx_cast, ___bpf_narg(args))(args) + +#define BPF_PROG(name, args...) \ +int name(unsigned long long *ctx); \ +__attribute__((always_inline)) \ +static int ____##name(unsigned long long *ctx, ##args); \ +int name(unsigned long long *ctx) \ +{ \ + int __ret; \ + \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wint-conversion\"") \ + __ret = ____##name(___bpf_ctx_cast(args)); \ + _Pragma("GCC diagnostic pop") \ + return __ret; \ +} \ +static int ____##name(unsigned long long *ctx, ##args) + +#define KFUNC_PROBE(event, args...) \ + BPF_PROG(kfunc__ ## event, args) + +#define KRETFUNC_PROBE(event, args...) \ + BPF_PROG(kretfunc__ ## event, args) + +#define LSM_PROBE(event, args...) \ + BPF_PROG(lsm__ ## event, args) + +#define BPF_ITER(target) \ + int bpf_iter__ ## target (struct bpf_iter__ ## target *ctx) + #define TP_DATA_LOC_READ_CONST(dst, field, length) \ do { \ unsigned short __offset = args->data_loc_##field & 0xFFFF; \ diff --git a/src/cc/frontends/b/codegen_llvm.cc b/src/cc/frontends/b/codegen_llvm.cc index 0983c49a2..d8c9470a7 100644 --- a/src/cc/frontends/b/codegen_llvm.cc +++ b/src/cc/frontends/b/codegen_llvm.cc @@ -112,6 +112,17 @@ void CodegenLLVM::emit(const char *s) { //fflush(out_); } +CallInst *CodegenLLVM::createCall(Value *callee, ArrayRef args) +{ +#if LLVM_MAJOR_VERSION >= 11 + auto *calleePtrType = cast(callee->getType()); + auto *calleeType = cast(calleePtrType->getElementType()); + return B.CreateCall(calleeType, callee, args); +#else + return B.CreateCall(callee, args); +#endif +} + StatusTuple CodegenLLVM::visit_block_stmt_node(BlockStmtNode *n) { // enter scope @@ -126,7 +137,7 @@ StatusTuple CodegenLLVM::visit_block_stmt_node(BlockStmtNode *n) { if (n->scope_) scopes_->pop_var(); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_if_stmt_node(IfStmtNode *n) { @@ -159,7 +170,7 @@ StatusTuple CodegenLLVM::visit_if_stmt_node(IfStmtNode *n) { B.SetInsertPoint(label_end); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_onvalid_stmt_node(OnValidStmtNode *n) { @@ -192,7 +203,7 @@ StatusTuple CodegenLLVM::visit_onvalid_stmt_node(OnValidStmtNode *n) { } B.SetInsertPoint(label_end); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_switch_stmt_node(SwitchStmtNode *n) { @@ -213,7 +224,7 @@ StatusTuple CodegenLLVM::visit_switch_stmt_node(SwitchStmtNode *n) { B.SetInsertPoint(resolve_label("DONE")); label_end->eraseFromParent(); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_case_stmt_node(CaseStmtNode *n) { @@ -236,7 +247,7 @@ StatusTuple CodegenLLVM::visit_case_stmt_node(CaseStmtNode *n) { if (!B.GetInsertBlock()->getTerminator()) B.CreateBr(label_end); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_ident_expr_node(IdentExprNode *n) { @@ -308,7 +319,7 @@ StatusTuple CodegenLLVM::visit_ident_expr_node(IdentExprNode *n) { } } } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_assign_expr_node(AssignExprNode *n) { @@ -343,7 +354,7 @@ StatusTuple CodegenLLVM::visit_assign_expr_node(AssignExprNode *n) { } } } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::lookup_var(Node *n, const string &name, Scopes::VarScope *scope, @@ -353,7 +364,7 @@ StatusTuple CodegenLLVM::lookup_var(Node *n, const string &name, Scopes::VarScop auto it = vars_.find(*decl); if (it == vars_.end()) return mkstatus_(n, "unable to find %s memory location", name.c_str()); *mem = it->second; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_packet_expr_node(PacketExprNode *n) { @@ -386,7 +397,7 @@ StatusTuple CodegenLLVM::visit_packet_expr_node(PacketExprNode *n) { LoadInst *offset_ptr = B.CreateLoad(offset_mem); Value *skb_hdr_offset = B.CreateAdd(offset_ptr, B.getInt64(bit_offset >> 3)); Value *rhs = B.CreateIntCast(pop_expr(), B.getInt64Ty(), false); - B.CreateCall(store_fn, vector({skb_ptr8, skb_hdr_offset, B.getInt64(bit_offset & 0x7), + createCall(store_fn, vector({skb_ptr8, skb_hdr_offset, B.getInt64(bit_offset & 0x7), B.getInt64(bit_width), rhs})); } else { emit("bpf_dext_pkt(pkt, %s + %zu, %zu, %zu)", n->id_->c_str(), bit_offset >> 3, bit_offset & 0x7, bit_width); @@ -396,7 +407,7 @@ StatusTuple CodegenLLVM::visit_packet_expr_node(PacketExprNode *n) { Value *skb_ptr8 = B.CreateBitCast(skb_ptr, B.getInt8PtrTy()); LoadInst *offset_ptr = B.CreateLoad(offset_mem); Value *skb_hdr_offset = B.CreateAdd(offset_ptr, B.getInt64(bit_offset >> 3)); - expr_ = B.CreateCall(load_fn, vector({skb_ptr8, skb_hdr_offset, + expr_ = createCall(load_fn, vector({skb_ptr8, skb_hdr_offset, B.getInt64(bit_offset & 0x7), B.getInt64(bit_width)})); // this generates extra trunc insns whereas the bpf.load fns already // trunc the values internally in the bpf interpreter @@ -407,7 +418,7 @@ StatusTuple CodegenLLVM::visit_packet_expr_node(PacketExprNode *n) { return mkstatus_(n, "unsupported"); } } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_integer_expr_node(IntegerExprNode *n) { @@ -416,7 +427,7 @@ StatusTuple CodegenLLVM::visit_integer_expr_node(IntegerExprNode *n) { expr_ = ConstantInt::get(mod_->getContext(), val); if (n->bits_) expr_ = B.CreateIntCast(expr_, B.getIntNTy(n->bits_), false); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_string_expr_node(StringExprNode *n) { @@ -425,14 +436,16 @@ StatusTuple CodegenLLVM::visit_string_expr_node(StringExprNode *n) { Value *global = B.CreateGlobalString(n->val_); Value *ptr = make_alloca(resolve_entry_stack(), B.getInt8Ty(), "", B.getInt64(n->val_.size() + 1)); -#if LLVM_MAJOR_VERSION >= 7 +#if LLVM_MAJOR_VERSION >= 11 + B.CreateMemCpy(ptr, Align(1), global, Align(1), n->val_.size() + 1); +#elif LLVM_MAJOR_VERSION >= 7 B.CreateMemCpy(ptr, 1, global, 1, n->val_.size() + 1); #else B.CreateMemCpy(ptr, global, n->val_.size() + 1, 1); #endif expr_ = ptr; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::emit_short_circuit_and(BinopExprNode *n) { @@ -459,7 +472,7 @@ StatusTuple CodegenLLVM::emit_short_circuit_and(BinopExprNode *n) { phi->addIncoming(pop_expr(), label_then); expr_ = phi; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::emit_short_circuit_or(BinopExprNode *n) { @@ -486,7 +499,7 @@ StatusTuple CodegenLLVM::emit_short_circuit_or(BinopExprNode *n) { phi->addIncoming(pop_expr(), label_then); expr_ = phi; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_binop_expr_node(BinopExprNode *n) { @@ -514,7 +527,7 @@ StatusTuple CodegenLLVM::visit_binop_expr_node(BinopExprNode *n) { case Tok::TLOR: expr_ = B.CreateOr(lhs, rhs); break; default: return mkstatus_(n, "unsupported binary operator"); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_unop_expr_node(UnopExprNode *n) { @@ -524,11 +537,11 @@ StatusTuple CodegenLLVM::visit_unop_expr_node(UnopExprNode *n) { case Tok::TCMPL: expr_ = B.CreateNeg(pop_expr()); break; default: {} } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_bitop_expr_node(BitopExprNode *n) { - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_goto_expr_node(GotoExprNode *n) { @@ -558,7 +571,7 @@ StatusTuple CodegenLLVM::visit_goto_expr_node(GotoExprNode *n) { } } B.CreateBr(resolve_label(jump_label)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_return_expr_node(ReturnExprNode *n) { @@ -567,7 +580,7 @@ StatusTuple CodegenLLVM::visit_return_expr_node(ReturnExprNode *n) { Value *cast_1 = B.CreateIntCast(pop_expr(), parent->getReturnType(), true); B.CreateStore(cast_1, retval_); B.CreateBr(resolve_label("DONE")); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::emit_table_lookup(MethodCallExprNode *n) { @@ -585,14 +598,14 @@ StatusTuple CodegenLLVM::emit_table_lookup(MethodCallExprNode *n) { Function *lookup_fn = mod_->getFunction("bpf_map_lookup_elem_"); if (!lookup_fn) return mkstatus_(n, "bpf_map_lookup_elem_ undefined"); - CallInst *pseudo_call = B.CreateCall(pseudo_fn, vector({B.getInt64(BPF_PSEUDO_MAP_FD), + CallInst *pseudo_call = createCall(pseudo_fn, vector({B.getInt64(BPF_PSEUDO_MAP_FD), B.getInt64(table_fd_it->second)})); Value *pseudo_map_fd = pseudo_call; TRY2(arg0->accept(this)); Value *key_ptr = B.CreateBitCast(pop_expr(), B.getInt8PtrTy()); - expr_ = B.CreateCall(lookup_fn, vector({pseudo_map_fd, key_ptr})); + expr_ = createCall(lookup_fn, vector({pseudo_map_fd, key_ptr})); if (table->type_id()->name_ == "FIXED_MATCH" || table->type_id()->name_ == "INDEXED") { if (n->args_.size() == 2) { @@ -610,7 +623,7 @@ StatusTuple CodegenLLVM::emit_table_lookup(MethodCallExprNode *n) { } else { return mkstatus_(n, "lookup in table type %s unsupported", table->type_id()->c_str()); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::emit_table_update(MethodCallExprNode *n) { @@ -626,7 +639,7 @@ StatusTuple CodegenLLVM::emit_table_update(MethodCallExprNode *n) { Function *update_fn = mod_->getFunction("bpf_map_update_elem_"); if (!update_fn) return mkstatus_(n, "bpf_map_update_elem_ undefined"); - CallInst *pseudo_call = B.CreateCall(pseudo_fn, vector({B.getInt64(BPF_PSEUDO_MAP_FD), + CallInst *pseudo_call = createCall(pseudo_fn, vector({B.getInt64(BPF_PSEUDO_MAP_FD), B.getInt64(table_fd_it->second)})); Value *pseudo_map_fd = pseudo_call; @@ -637,11 +650,11 @@ StatusTuple CodegenLLVM::emit_table_update(MethodCallExprNode *n) { TRY2(arg1->accept(this)); Value *value_ptr = B.CreateBitCast(pop_expr(), B.getInt8PtrTy()); - expr_ = B.CreateCall(update_fn, vector({pseudo_map_fd, key_ptr, value_ptr, B.getInt64(BPF_ANY)})); + expr_ = createCall(update_fn, vector({pseudo_map_fd, key_ptr, value_ptr, B.getInt64(BPF_ANY)})); } else { return mkstatus_(n, "unsupported"); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::emit_table_delete(MethodCallExprNode *n) { @@ -656,7 +669,7 @@ StatusTuple CodegenLLVM::emit_table_delete(MethodCallExprNode *n) { Function *update_fn = mod_->getFunction("bpf_map_update_elem_"); if (!update_fn) return mkstatus_(n, "bpf_map_update_elem_ undefined"); - CallInst *pseudo_call = B.CreateCall(pseudo_fn, vector({B.getInt64(BPF_PSEUDO_MAP_FD), + CallInst *pseudo_call = createCall(pseudo_fn, vector({B.getInt64(BPF_PSEUDO_MAP_FD), B.getInt64(table_fd_it->second)})); Value *pseudo_map_fd = pseudo_call; @@ -664,11 +677,11 @@ StatusTuple CodegenLLVM::emit_table_delete(MethodCallExprNode *n) { Value *key_ptr = B.CreateBitCast(pop_expr(), B.getInt8PtrTy()); if (table->type_id()->name_ == "FIXED_MATCH" || table->type_id()->name_ == "INDEXED") { - expr_ = B.CreateCall(update_fn, vector({pseudo_map_fd, key_ptr})); + expr_ = createCall(update_fn, vector({pseudo_map_fd, key_ptr})); } else { return mkstatus_(n, "unsupported"); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::emit_log(MethodCallExprNode *n) { @@ -688,14 +701,14 @@ StatusTuple CodegenLLVM::emit_log(MethodCallExprNode *n) { Value *printk_fn = B.CreateIntToPtr(B.getInt64(BPF_FUNC_trace_printk), PointerType::getUnqual(printk_fn_type)); - expr_ = B.CreateCall(printk_fn, args); - return StatusTuple(0); + expr_ = createCall(printk_fn, args); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::emit_packet_rewrite_field(MethodCallExprNode *n) { TRY2(n->args_[1]->accept(this)); TRY2(n->args_[0]->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::emit_atomic_add(MethodCallExprNode *n) { @@ -706,7 +719,7 @@ StatusTuple CodegenLLVM::emit_atomic_add(MethodCallExprNode *n) { AtomicRMWInst *atomic_inst = B.CreateAtomicRMW( AtomicRMWInst::Add, lhs, rhs, AtomicOrdering::SequentiallyConsistent); atomic_inst->setVolatile(false); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::emit_incr_cksum(MethodCallExprNode *n, size_t sz) { @@ -742,12 +755,12 @@ StatusTuple CodegenLLVM::emit_incr_cksum(MethodCallExprNode *n, size_t sz) { LoadInst *skb_ptr = B.CreateLoad(skb_mem); Value *skb_ptr8 = B.CreateBitCast(skb_ptr, B.getInt8PtrTy()); - expr_ = B.CreateCall(csum_fn, vector({skb_ptr8, offset, old_val, new_val, flags})); - return StatusTuple(0); + expr_ = createCall(csum_fn, vector({skb_ptr8, offset, old_val, new_val, flags})); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::emit_get_usec_time(MethodCallExprNode *n) { - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_method_call_expr_node(MethodCallExprNode *n) { @@ -773,7 +786,7 @@ StatusTuple CodegenLLVM::visit_method_call_expr_node(MethodCallExprNode *n) { return mkstatus_(n, "unsupported"); } TRY2(n->block_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } /* result = lookup(key) @@ -797,7 +810,7 @@ StatusTuple CodegenLLVM::visit_table_index_expr_node(TableIndexExprNode *n) { TRY2(lookup_struct_type(n->table_->leaf_type_, &leaf_type)); PointerType *leaf_ptype = PointerType::getUnqual(leaf_type); - CallInst *pseudo_call = B.CreateCall(pseudo_fn, vector({B.getInt64(BPF_PSEUDO_MAP_FD), + CallInst *pseudo_call = createCall(pseudo_fn, vector({B.getInt64(BPF_PSEUDO_MAP_FD), B.getInt64(table_fd_it->second)})); Value *pseudo_map_fd = pseudo_call; @@ -805,7 +818,7 @@ StatusTuple CodegenLLVM::visit_table_index_expr_node(TableIndexExprNode *n) { Value *key_ptr = B.CreateBitCast(pop_expr(), B.getInt8PtrTy()); // result = lookup(key) - Value *lookup1 = B.CreateBitCast(B.CreateCall(lookup_fn, vector({pseudo_map_fd, key_ptr})), leaf_ptype); + Value *lookup1 = B.CreateBitCast(createCall(lookup_fn, vector({pseudo_map_fd, key_ptr})), leaf_ptype); Value *result = nullptr; if (n->table_->policy_id()->name_ == "AUTO") { @@ -827,10 +840,10 @@ StatusTuple CodegenLLVM::visit_table_index_expr_node(TableIndexExprNode *n) { B.CreateMemSet(leaf_ptr, B.getInt8(0), B.getInt64(n->table_->leaf_id()->bit_width_ >> 3), 1); #endif // update(key, leaf) - B.CreateCall(update_fn, vector({pseudo_map_fd, key_ptr, leaf_ptr, B.getInt64(BPF_NOEXIST)})); + createCall(update_fn, vector({pseudo_map_fd, key_ptr, leaf_ptr, B.getInt64(BPF_NOEXIST)})); // result = lookup(key) - Value *lookup2 = B.CreateBitCast(B.CreateCall(lookup_fn, vector({pseudo_map_fd, key_ptr})), leaf_ptype); + Value *lookup2 = B.CreateBitCast(createCall(lookup_fn, vector({pseudo_map_fd, key_ptr})), leaf_ptype); B.CreateBr(label_end); B.SetInsertPoint(label_end); @@ -884,7 +897,7 @@ StatusTuple CodegenLLVM::visit_table_index_expr_node(TableIndexExprNode *n) { } else { expr_ = result; } - return StatusTuple(0); + return StatusTuple::OK(); } /// on_match @@ -917,7 +930,7 @@ StatusTuple CodegenLLVM::visit_match_decl_stmt_node(MatchDeclStmtNode *n) { } B.SetInsertPoint(label_end); - return StatusTuple(0); + return StatusTuple::OK(); } /// on_miss @@ -945,7 +958,7 @@ StatusTuple CodegenLLVM::visit_miss_decl_stmt_node(MissDeclStmtNode *n) { } B.SetInsertPoint(label_end); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_failure_decl_stmt_node(FailureDeclStmtNode *n) { @@ -955,12 +968,12 @@ StatusTuple CodegenLLVM::visit_failure_decl_stmt_node(FailureDeclStmtNode *n) { StatusTuple CodegenLLVM::visit_expr_stmt_node(ExprStmtNode *n) { TRY2(n->expr_->accept(this)); expr_ = nullptr; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_struct_variable_decl_stmt_node(StructVariableDeclStmtNode *n) { if (n->struct_id_->name_ == "" || n->struct_id_->name_[0] == '_') { - return StatusTuple(0); + return StatusTuple::OK(); } StructType *stype; @@ -1018,12 +1031,12 @@ StatusTuple CodegenLLVM::visit_struct_variable_decl_stmt_node(StructVariableDecl } } } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_integer_variable_decl_stmt_node(IntegerVariableDeclStmtNode *n) { if (!B.GetInsertBlock()) - return StatusTuple(0); + return StatusTuple::OK(); // uintX var = init AllocaInst *ptr_a = make_alloca(resolve_entry_stack(), @@ -1033,7 +1046,7 @@ StatusTuple CodegenLLVM::visit_integer_variable_decl_stmt_node(IntegerVariableDe // todo if (!n->init_.empty()) TRY2(n->init_[0]->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_struct_decl_stmt_node(StructDeclStmtNode *n) { @@ -1044,7 +1057,7 @@ StatusTuple CodegenLLVM::visit_struct_decl_stmt_node(StructDeclStmtNode *n) { fields.push_back(B.getIntNTy((*it)->bit_width_)); struct_type->setBody(fields, n->is_packed()); structs_[n] = struct_type; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_parser_state_stmt_node(ParserStateStmtNode *n) { @@ -1053,12 +1066,12 @@ StatusTuple CodegenLLVM::visit_parser_state_stmt_node(ParserStateStmtNode *n) { B.SetInsertPoint(label_entry); if (n->next_state_) TRY2(n->next_state_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_state_decl_stmt_node(StateDeclStmtNode *n) { if (!n->id_) - return StatusTuple(0); + return StatusTuple::OK(); string jump_label = n->scoped_name(); BasicBlock *label_entry = resolve_label(jump_label); B.SetInsertPoint(label_entry); @@ -1082,7 +1095,7 @@ StatusTuple CodegenLLVM::visit_state_decl_stmt_node(StateDeclStmtNode *n) { } scopes_->pop_state(); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_table_decl_stmt_node(TableDeclStmtNode *n) { @@ -1124,7 +1137,7 @@ StatusTuple CodegenLLVM::visit_table_decl_stmt_node(TableDeclStmtNode *n) { } else { return mkstatus_(n, "Table %s not implemented", n->table_type_->name_.c_str()); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::lookup_struct_type(StructDeclStmtNode *decl, StructType **stype) const { @@ -1133,7 +1146,7 @@ StatusTuple CodegenLLVM::lookup_struct_type(StructDeclStmtNode *decl, StructType return mkstatus_(decl, "could not find IR for type %s", decl->id_->c_str()); *stype = struct_it->second; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::lookup_struct_type(VariableDeclStmtNode *n, StructType **stype, @@ -1155,7 +1168,7 @@ StatusTuple CodegenLLVM::lookup_struct_type(VariableDeclStmtNode *n, StructType if (decl) *decl = type; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit_func_decl_stmt_node(FuncDeclStmtNode *n) { @@ -1235,7 +1248,7 @@ StatusTuple CodegenLLVM::visit_func_decl_stmt_node(FuncDeclStmtNode *n) { B.CreateRet(B.CreateLoad(retval_)); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::visit(Node *root, TableStorage &ts, const string &id, @@ -1265,7 +1278,7 @@ StatusTuple CodegenLLVM::visit(Node *root, TableStorage &ts, const string &id, table.first->size_, 0, }); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple CodegenLLVM::print_header() { @@ -1293,7 +1306,7 @@ StatusTuple CodegenLLVM::print_header() { continue; TRY2((*it)->accept(this)); } - return StatusTuple(0); + return StatusTuple::OK(); } int CodegenLLVM::get_table_fd(const string &name) const { diff --git a/src/cc/frontends/b/codegen_llvm.h b/src/cc/frontends/b/codegen_llvm.h index c2947f74e..d77c9de82 100644 --- a/src/cc/frontends/b/codegen_llvm.h +++ b/src/cc/frontends/b/codegen_llvm.h @@ -27,8 +27,10 @@ namespace llvm { class AllocaInst; +template class ArrayRef; class BasicBlock; class BranchInst; +class CallInst; class Constant; class Instruction; class IRBuilderBase; @@ -104,6 +106,8 @@ class CodegenLLVM : public Visitor { StatusTuple lookup_struct_type(StructDeclStmtNode *decl, llvm::StructType **stype) const; StatusTuple lookup_struct_type(VariableDeclStmtNode *n, llvm::StructType **stype, StructDeclStmtNode **decl = nullptr) const; + llvm::CallInst *createCall(llvm::Value *Callee, + llvm::ArrayRef Args); template void emit(const char *fmt, Args&&... params); void emit(const char *s); diff --git a/src/cc/frontends/b/lexer.h b/src/cc/frontends/b/lexer.h index 14f31102f..394daa33a 100644 --- a/src/cc/frontends/b/lexer.h +++ b/src/cc/frontends/b/lexer.h @@ -51,7 +51,7 @@ class Lexer : public yyFlexLexer { } std::string text(const position& begin, const position& end) const { std::string result; - for (size_t i = begin.line; i <= end.line; ++i) { + for (auto i = begin.line; i <= end.line; ++i) { if (i == begin.line && i == end.line) { result += lines_.at(i - 1).substr(begin.column - 1, end.column - begin.column); } else if (i == begin.line && i < end.line) { diff --git a/src/cc/frontends/b/printer.cc b/src/cc/frontends/b/printer.cc index e16a8239f..75ff9071c 100644 --- a/src/cc/frontends/b/printer.cc +++ b/src/cc/frontends/b/printer.cc @@ -38,7 +38,7 @@ StatusTuple Printer::visit_block_stmt_node(BlockStmtNode* n) { --indent_; } fprintf(out_, "%*s}", indent_, ""); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_if_stmt_node(IfStmtNode* n) { @@ -50,7 +50,7 @@ StatusTuple Printer::visit_if_stmt_node(IfStmtNode* n) { fprintf(out_, " else "); TRY2(n->false_block_->accept(this)); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_onvalid_stmt_node(OnValidStmtNode* n) { @@ -62,7 +62,7 @@ StatusTuple Printer::visit_onvalid_stmt_node(OnValidStmtNode* n) { fprintf(out_, " else "); TRY2(n->else_block_->accept(this)); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_switch_stmt_node(SwitchStmtNode* n) { @@ -70,7 +70,7 @@ StatusTuple Printer::visit_switch_stmt_node(SwitchStmtNode* n) { TRY2(n->cond_->accept(this)); fprintf(out_, ") "); TRY2(n->block_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_case_stmt_node(CaseStmtNode* n) { @@ -81,7 +81,7 @@ StatusTuple Printer::visit_case_stmt_node(CaseStmtNode* n) { fprintf(out_, "default"); } TRY2(n->block_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_ident_expr_node(IdentExprNode* n) { @@ -92,37 +92,37 @@ StatusTuple Printer::visit_ident_expr_node(IdentExprNode* n) { if (n->sub_name_.size()) { fprintf(out_, ".%s", n->sub_name_.c_str()); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_assign_expr_node(AssignExprNode* n) { TRY2(n->lhs_->accept(this)); fprintf(out_, " = "); TRY2(n->rhs_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_packet_expr_node(PacketExprNode* n) { fprintf(out_, "$"); TRY2(n->id_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_integer_expr_node(IntegerExprNode* n) { fprintf(out_, "%s:%zu", n->val_.c_str(), n->bits_); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_string_expr_node(StringExprNode *n) { fprintf(out_, "%s", n->val_.c_str()); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_binop_expr_node(BinopExprNode* n) { TRY2(n->lhs_->accept(this)); fprintf(out_, "%d", n->op_); TRY2(n->rhs_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_unop_expr_node(UnopExprNode* n) { @@ -135,25 +135,25 @@ StatusTuple Printer::visit_unop_expr_node(UnopExprNode* n) { } fprintf(out_, "%s", s); TRY2(n->expr_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_bitop_expr_node(BitopExprNode* n) { - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_return_expr_node(ReturnExprNode* n) { fprintf(out_, "return "); TRY2(n->expr_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_goto_expr_node(GotoExprNode* n) { const char* s = n->is_continue_ ? "continue " : "goto "; fprintf(out_, "%s", s); TRY2(n->id_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_method_call_expr_node(MethodCallExprNode* n) { @@ -177,19 +177,19 @@ StatusTuple Printer::visit_method_call_expr_node(MethodCallExprNode* n) { --indent_; fprintf(out_, "%*s}", indent_, ""); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_table_index_expr_node(TableIndexExprNode *n) { fprintf(out_, "%s[", n->id_->c_str()); TRY2(n->index_->accept(this)); fprintf(out_, "]"); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_expr_stmt_node(ExprStmtNode* n) { TRY2(n->expr_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_struct_variable_decl_stmt_node(StructVariableDeclStmtNode* n) { @@ -207,7 +207,7 @@ StatusTuple Printer::visit_struct_variable_decl_stmt_node(StructVariableDeclStmt } fprintf(out_, "}"); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_integer_variable_decl_stmt_node(IntegerVariableDeclStmtNode* n) { @@ -218,7 +218,7 @@ StatusTuple Printer::visit_integer_variable_decl_stmt_node(IntegerVariableDeclSt fprintf(out_, "; "); TRY2(n->init_[0]->accept(this)); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_struct_decl_stmt_node(StructDeclStmtNode* n) { @@ -233,12 +233,12 @@ StatusTuple Printer::visit_struct_decl_stmt_node(StructDeclStmtNode* n) { } --indent_; fprintf(out_, "%*s}", indent_, ""); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_state_decl_stmt_node(StateDeclStmtNode* n) { if (!n->id_) { - return StatusTuple(0); + return StatusTuple::OK(); } fprintf(out_, "state "); TRY2(n->id_->accept(this)); @@ -249,11 +249,11 @@ StatusTuple Printer::visit_state_decl_stmt_node(StateDeclStmtNode* n) { // TRY2(n->id2_->accept(this)); //} //TRY2(n->block_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_parser_state_stmt_node(ParserStateStmtNode* n) { - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_match_decl_stmt_node(MatchDeclStmtNode* n) { @@ -268,7 +268,7 @@ StatusTuple Printer::visit_match_decl_stmt_node(MatchDeclStmtNode* n) { } fprintf(out_, ") "); TRY2(n->block_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_miss_decl_stmt_node(MissDeclStmtNode* n) { @@ -283,7 +283,7 @@ StatusTuple Printer::visit_miss_decl_stmt_node(MissDeclStmtNode* n) { } fprintf(out_, ") "); TRY2(n->block_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_failure_decl_stmt_node(FailureDeclStmtNode* n) { @@ -298,7 +298,7 @@ StatusTuple Printer::visit_failure_decl_stmt_node(FailureDeclStmtNode* n) { } fprintf(out_, ") "); TRY2(n->block_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_table_decl_stmt_node(TableDeclStmtNode* n) { @@ -313,7 +313,7 @@ StatusTuple Printer::visit_table_decl_stmt_node(TableDeclStmtNode* n) { fprintf(out_, "> "); TRY2(n->id_->accept(this)); fprintf(out_, "(%zu)", n->size_); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple Printer::visit_func_decl_stmt_node(FuncDeclStmtNode *n) { @@ -328,7 +328,7 @@ StatusTuple Printer::visit_func_decl_stmt_node(FuncDeclStmtNode *n) { } fprintf(out_, ") "); TRY2(n->block_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } } // namespace cc diff --git a/src/cc/frontends/b/type_check.cc b/src/cc/frontends/b/type_check.cc index 7c5b7ce5f..4300c768e 100644 --- a/src/cc/frontends/b/type_check.cc +++ b/src/cc/frontends/b/type_check.cc @@ -37,7 +37,7 @@ StatusTuple TypeCheck::visit_block_stmt_node(BlockStmtNode *n) { if (n->scope_) scopes_->pop_var(); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_if_stmt_node(IfStmtNode *n) { @@ -48,7 +48,7 @@ StatusTuple TypeCheck::visit_if_stmt_node(IfStmtNode *n) { if (n->false_block_) { TRY2(n->false_block_->accept(this)); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_onvalid_stmt_node(OnValidStmtNode *n) { @@ -60,7 +60,7 @@ StatusTuple TypeCheck::visit_onvalid_stmt_node(OnValidStmtNode *n) { if (n->else_block_) { TRY2(n->else_block_->accept(this)); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_switch_stmt_node(SwitchStmtNode *n) { @@ -71,7 +71,7 @@ StatusTuple TypeCheck::visit_switch_stmt_node(SwitchStmtNode *n) { for (auto it = n->block_->stmts_.begin(); it != n->block_->stmts_.end(); ++it) { /// @todo check for duplicates } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_case_stmt_node(CaseStmtNode *n) { @@ -81,7 +81,7 @@ StatusTuple TypeCheck::visit_case_stmt_node(CaseStmtNode *n) { return mkstatus_(n, "Switch condition must be a numeric type"); } TRY2(n->block_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_ident_expr_node(IdentExprNode *n) { @@ -131,7 +131,7 @@ StatusTuple TypeCheck::visit_ident_expr_node(IdentExprNode *n) { n->bit_width_ = n->sub_decl_->bit_width_; n->flags_[ExprNode::WRITE] = true; } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_assign_expr_node(AssignExprNode *n) { @@ -151,7 +151,7 @@ StatusTuple TypeCheck::visit_assign_expr_node(AssignExprNode *n) { return mkstatus_(n, "Right-hand side of assignment must be a numeric type"); } n->typeof_ = ExprNode::VOID; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_packet_expr_node(PacketExprNode *n) { @@ -172,20 +172,20 @@ StatusTuple TypeCheck::visit_packet_expr_node(PacketExprNode *n) { n->bit_width_ = sub_decl->bit_width_; } n->flags_[ExprNode::WRITE] = true; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_integer_expr_node(IntegerExprNode *n) { n->typeof_ = ExprNode::INTEGER; n->bit_width_ = n->bits_; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_string_expr_node(StringExprNode *n) { n->typeof_ = ExprNode::STRING; n->flags_[ExprNode::IS_REF] = true; n->bit_width_ = n->val_.size() << 3; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_binop_expr_node(BinopExprNode *n) { @@ -208,7 +208,7 @@ StatusTuple TypeCheck::visit_binop_expr_node(BinopExprNode *n) { default: n->bit_width_ = std::max(n->lhs_->bit_width_, n->rhs_->bit_width_); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_unop_expr_node(UnopExprNode *n) { @@ -216,26 +216,26 @@ StatusTuple TypeCheck::visit_unop_expr_node(UnopExprNode *n) { if (n->expr_->typeof_ != ExprNode::INTEGER) return mkstatus_(n, "Unary operand must be a numeric type"); n->copy_type(*n->expr_); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_bitop_expr_node(BitopExprNode *n) { if (n->expr_->typeof_ != ExprNode::INTEGER) return mkstatus_(n, "Bitop [] can only operate on numeric types"); n->typeof_ = ExprNode::INTEGER; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_goto_expr_node(GotoExprNode *n) { //n->id_->accept(this); n->typeof_ = ExprNode::VOID; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_return_expr_node(ReturnExprNode *n) { TRY2(n->expr_->accept(this)); n->typeof_ = ExprNode::VOID; - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::expect_method_arg(MethodCallExprNode *n, size_t num, size_t num_def_args = 0) { @@ -248,7 +248,7 @@ StatusTuple TypeCheck::expect_method_arg(MethodCallExprNode *n, size_t num, size return mkstatus_(n, "%s expected %d argument%s (%d default), %zu given", n->id_->sub_name_.c_str(), num, num == 1 ? "" : "s", num_def_args, n->args_.size()); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::check_lookup_method(MethodCallExprNode *n) { @@ -264,7 +264,7 @@ StatusTuple TypeCheck::check_lookup_method(MethodCallExprNode *n) { n->block_->scope_->add("_result", result.get()); n->block_->stmts_.insert(n->block_->stmts_.begin(), move(result)); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::check_update_method(MethodCallExprNode *n) { @@ -275,7 +275,7 @@ StatusTuple TypeCheck::check_update_method(MethodCallExprNode *n) { TRY2(expect_method_arg(n, 2)); else if (table->type_id()->name_ == "LPM") TRY2(expect_method_arg(n, 3)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::check_delete_method(MethodCallExprNode *n) { @@ -286,7 +286,7 @@ StatusTuple TypeCheck::check_delete_method(MethodCallExprNode *n) { TRY2(expect_method_arg(n, 1)); else if (table->type_id()->name_ == "LPM") {} - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_method_call_expr_node(MethodCallExprNode *n) { @@ -339,7 +339,7 @@ StatusTuple TypeCheck::visit_method_call_expr_node(MethodCallExprNode *n) { return mkstatus_(n, "%s does not allow trailing block statements", n->id_->full_name().c_str()); TRY2(n->block_->accept(this)); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_table_index_expr_node(TableIndexExprNode *n) { @@ -359,12 +359,12 @@ StatusTuple TypeCheck::visit_table_index_expr_node(TableIndexExprNode *n) { n->flags_[ExprNode::IS_REF] = true; n->struct_type_ = n->table_->leaf_type_; } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_expr_stmt_node(ExprStmtNode *n) { TRY2(n->expr_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_struct_variable_decl_stmt_node(StructVariableDeclStmtNode *n) { @@ -399,7 +399,7 @@ StatusTuple TypeCheck::visit_struct_variable_decl_stmt_node(StructVariableDeclSt TRY2((*it)->accept(this)); } } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_integer_variable_decl_stmt_node(IntegerVariableDeclStmtNode *n) { @@ -407,7 +407,7 @@ StatusTuple TypeCheck::visit_integer_variable_decl_stmt_node(IntegerVariableDecl if (!n->init_.empty()) { TRY2(n->init_[0]->accept(this)); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_struct_decl_stmt_node(StructDeclStmtNode *n) { @@ -415,16 +415,16 @@ StatusTuple TypeCheck::visit_struct_decl_stmt_node(StructDeclStmtNode *n) { for (auto it = n->stmts_.begin(); it != n->stmts_.end(); ++it) { TRY2((*it)->accept(this)); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_parser_state_stmt_node(ParserStateStmtNode *n) { - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_state_decl_stmt_node(StateDeclStmtNode *n) { if (!n->id_) { - return StatusTuple(0); + return StatusTuple::OK(); } auto s1 = proto_scopes_->top_state()->lookup(n->id_->name_, true); if (s1) { @@ -479,7 +479,7 @@ StatusTuple TypeCheck::visit_state_decl_stmt_node(StateDeclStmtNode *n) { scopes_->pop_state(); } - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_match_decl_stmt_node(MatchDeclStmtNode *n) { @@ -488,7 +488,7 @@ StatusTuple TypeCheck::visit_match_decl_stmt_node(MatchDeclStmtNode *n) { TRY2((*it)->accept(this)); } TRY2(n->block_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_miss_decl_stmt_node(MissDeclStmtNode *n) { @@ -497,7 +497,7 @@ StatusTuple TypeCheck::visit_miss_decl_stmt_node(MissDeclStmtNode *n) { TRY2((*it)->accept(this)); } TRY2(n->block_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_failure_decl_stmt_node(FailureDeclStmtNode *n) { @@ -506,7 +506,7 @@ StatusTuple TypeCheck::visit_failure_decl_stmt_node(FailureDeclStmtNode *n) { TRY2((*it)->accept(this)); } TRY2(n->block_->accept(this)); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_table_decl_stmt_node(TableDeclStmtNode *n) { @@ -524,7 +524,7 @@ StatusTuple TypeCheck::visit_table_decl_stmt_node(TableDeclStmtNode *n) { } if (n->policy_id()->name_ != "AUTO" && n->policy_id()->name_ != "NONE") return mkstatus_(n, "Unsupported policy type %s", n->policy_id()->c_str()); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit_func_decl_stmt_node(FuncDeclStmtNode *n) { @@ -539,7 +539,7 @@ StatusTuple TypeCheck::visit_func_decl_stmt_node(FuncDeclStmtNode *n) { scopes_->push_state(n->scope_); TRY2(n->block_->accept(this)); scopes_->pop_state(); - return StatusTuple(0); + return StatusTuple::OK(); } StatusTuple TypeCheck::visit(Node *root) { @@ -580,7 +580,7 @@ StatusTuple TypeCheck::visit(Node *root) { } return StatusTuple(-1, errors_.begin()->c_str()); } - return StatusTuple(0); + return StatusTuple::OK(); } } // namespace cc diff --git a/src/cc/frontends/clang/arch_helper.h b/src/cc/frontends/clang/arch_helper.h index 76b465102..9240583fe 100644 --- a/src/cc/frontends/clang/arch_helper.h +++ b/src/cc/frontends/clang/arch_helper.h @@ -34,7 +34,7 @@ static void *run_arch_callback(arch_callback_t fn) /* If ARCH is not set, detect from local arch clang is running on */ if (!archenv) { #if defined(__powerpc64__) -#if defined(_CALL_ELF) && _CALL_ELF == 2 +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ return fn(BCC_ARCH_PPC_LE); #else return fn(BCC_ARCH_PPC); @@ -50,7 +50,7 @@ static void *run_arch_callback(arch_callback_t fn) /* Otherwise read it from ARCH */ if (!strcmp(archenv, "powerpc")) { -#if defined(_CALL_ELF) && _CALL_ELF == 2 +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ return fn(BCC_ARCH_PPC_LE); #else return fn(BCC_ARCH_PPC); diff --git a/src/cc/frontends/clang/b_frontend_action.cc b/src/cc/frontends/clang/b_frontend_action.cc index 8beefafb7..154a3794d 100644 --- a/src/cc/frontends/clang/b_frontend_action.cc +++ b/src/cc/frontends/clang/b_frontend_action.cc @@ -34,9 +34,10 @@ #include "loader.h" #include "table_storage.h" #include "arch_helper.h" -#include "libbpf/src/bpf.h" +#include "bcc_libbpf_inc.h" #include "libbpf.h" +#include "bcc_syms.h" namespace ebpf { @@ -82,6 +83,56 @@ const char **get_call_conv(void) { return ret; } +/* Use resolver only once per translation */ +static void *kresolver = NULL; +static void *get_symbol_resolver(void) { + if (!kresolver) + kresolver = bcc_symcache_new(-1, nullptr); + return kresolver; +} + +static std::string check_bpf_probe_read_kernel(void) { + bool is_probe_read_kernel; + void *resolver = get_symbol_resolver(); + uint64_t addr = 0; + is_probe_read_kernel = bcc_symcache_resolve_name(resolver, nullptr, + "bpf_probe_read_kernel", &addr) >= 0 ? true: false; + + /* If bpf_probe_read is not found (ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE) is + * not set in newer kernel, then bcc would anyway fail */ + if (is_probe_read_kernel) + return "bpf_probe_read_kernel"; + else + return "bpf_probe_read"; +} + +static std::string check_bpf_probe_read_user(llvm::StringRef probe, + bool& overlap_addr) { + if (probe.str() == "bpf_probe_read_user" || + probe.str() == "bpf_probe_read_user_str") { + // Check for probe_user symbols in backported kernel before fallback + void *resolver = get_symbol_resolver(); + uint64_t addr = 0; + bool found = bcc_symcache_resolve_name(resolver, nullptr, + "bpf_probe_read_user", &addr) >= 0 ? true: false; + if (found) + return probe.str(); + + /* For arch with overlapping address space, dont use bpf_probe_read for + * user read. Just error out */ +#if defined(__s390x__) + overlap_addr = true; + return ""; +#endif + + if (probe.str() == "bpf_probe_read_user") + return "bpf_probe_read"; + else + return "bpf_probe_read_str"; + } + return ""; +} + using std::map; using std::move; using std::set; @@ -265,7 +316,10 @@ bool MapVisitor::VisitCallExpr(CallExpr *Call) { ProbeVisitor::ProbeVisitor(ASTContext &C, Rewriter &rewriter, set &m, bool track_helpers) : C(C), rewriter_(rewriter), m_(m), track_helpers_(track_helpers), - addrof_stmt_(nullptr), is_addrof_(false) {} + addrof_stmt_(nullptr), is_addrof_(false) { + const char **calling_conv_regs = get_call_conv(); + has_overlap_kuaddr_ = calling_conv_regs == calling_conv_regs_s390x; +} bool ProbeVisitor::assignsExtPtr(Expr *E, int *nbDerefs) { if (IsContextMemberExpr(E)) { @@ -437,7 +491,10 @@ bool ProbeVisitor::VisitUnaryOperator(UnaryOperator *E) { memb_visited_.insert(E); string pre, post; pre = "({ typeof(" + E->getType().getAsString() + ") _val; __builtin_memset(&_val, 0, sizeof(_val));"; - pre += " bpf_probe_read(&_val, sizeof(_val), (u64)"; + if (has_overlap_kuaddr_) + pre += " bpf_probe_read_kernel(&_val, sizeof(_val), (u64)"; + else + pre += " bpf_probe_read(&_val, sizeof(_val), (u64)"; post = "); _val; })"; rewriter_.ReplaceText(expansionLoc(E->getOperatorLoc()), 1, pre); rewriter_.InsertTextAfterToken(expansionLoc(GET_ENDLOC(sub)), post); @@ -498,7 +555,10 @@ bool ProbeVisitor::VisitMemberExpr(MemberExpr *E) { string base_type = base->getType()->getPointeeType().getAsString(); string pre, post; pre = "({ typeof(" + E->getType().getAsString() + ") _val; __builtin_memset(&_val, 0, sizeof(_val));"; - pre += " bpf_probe_read(&_val, sizeof(_val), (u64)&"; + if (has_overlap_kuaddr_) + pre += " bpf_probe_read_kernel(&_val, sizeof(_val), (u64)&"; + else + pre += " bpf_probe_read(&_val, sizeof(_val), (u64)&"; post = rhs + "); _val; })"; rewriter_.InsertText(expansionLoc(GET_BEGINLOC(E)), pre); rewriter_.ReplaceText(expansionRange(SourceRange(member, GET_ENDLOC(E))), post); @@ -549,7 +609,10 @@ bool ProbeVisitor::VisitArraySubscriptExpr(ArraySubscriptExpr *E) { return true; pre = "({ typeof(" + E->getType().getAsString() + ") _val; __builtin_memset(&_val, 0, sizeof(_val));"; - pre += " bpf_probe_read(&_val, sizeof(_val), (u64)(("; + if (has_overlap_kuaddr_) + pre += " bpf_probe_read_kernel(&_val, sizeof(_val), (u64)(("; + else + pre += " bpf_probe_read(&_val, sizeof(_val), (u64)(("; if (isMemberDereference(base)) { pre += "&"; // If the base of the array subscript is a member dereference, we'll rewrite @@ -641,7 +704,10 @@ DiagnosticBuilder ProbeVisitor::error(SourceLocation loc, const char (&fmt)[N]) } BTypeVisitor::BTypeVisitor(ASTContext &C, BFrontendAction &fe) - : C(C), diag_(C.getDiagnostics()), fe_(fe), rewriter_(fe.rewriter()), out_(llvm::errs()) {} + : C(C), diag_(C.getDiagnostics()), fe_(fe), rewriter_(fe.rewriter()), out_(llvm::errs()) { + const char **calling_conv_regs = get_call_conv(); + has_overlap_kuaddr_ = calling_conv_regs == calling_conv_regs_s390x; +} void BTypeVisitor::genParamDirectAssign(FunctionDecl *D, string& preamble, const char **calling_conv_regs) { @@ -682,7 +748,11 @@ void BTypeVisitor::genParamIndirectAssign(FunctionDecl *D, string& preamble, size_t d = idx - 1; const char *reg = calling_conv_regs[d]; preamble += "\n " + text + ";"; - preamble += " bpf_probe_read(&" + arg->getName().str() + ", sizeof(" + + if (has_overlap_kuaddr_) + preamble += " bpf_probe_read_kernel"; + else + preamble += " bpf_probe_read"; + preamble += "(&" + arg->getName().str() + ", sizeof(" + arg->getName().str() + "), &" + new_ctx + "->" + string(reg) + ");"; } @@ -701,7 +771,7 @@ void BTypeVisitor::rewriteFuncParam(FunctionDecl *D) { // it in case of "syscall__" for other architectures. if (strncmp(D->getName().str().c_str(), "syscall__", 9) == 0 || strncmp(D->getName().str().c_str(), "kprobe____x64_sys_", 18) == 0) { - preamble += "#ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER\n"; + preamble += "#if defined(CONFIG_ARCH_HAS_SYSCALL_WRAPPER) && !defined(__s390x__)\n"; genParamIndirectAssign(D, preamble, calling_conv_regs); preamble += "\n#else\n"; genParamDirectAssign(D, preamble, calling_conv_regs); @@ -888,6 +958,62 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) { string flag = rewriter_.getRewrittenText(expansionRange(Call->getArg(2)->getSourceRange())); txt = "bpf_" + string(memb_name) + "(" + ctx + ", " + "bpf_pseudo_fd(1, " + fd + "), " + keyp + ", " + flag + ");"; + } else if (memb_name == "ringbuf_output") { + string name = string(Ref->getDecl()->getName()); + string args = rewriter_.getRewrittenText(expansionRange(SourceRange(GET_BEGINLOC(Call->getArg(0)), + GET_ENDLOC(Call->getArg(2))))); + txt = "bpf_ringbuf_output(bpf_pseudo_fd(1, " + fd + ")"; + txt += ", " + args + ")"; + + // e.g. + // struct data_t { u32 pid; }; data_t data; + // events.ringbuf_output(&data, sizeof(data), 0); + // ... + // &data -> data -> typeof(data) -> data_t + auto type_arg0 = Call->getArg(0)->IgnoreCasts()->getType().getTypePtr()->getPointeeType().getTypePtr(); + if (type_arg0->isStructureType()) { + auto event_type = type_arg0->getAsTagDecl(); + const auto *r = dyn_cast(event_type); + std::vector perf_event; + + for (auto it = r->field_begin(); it != r->field_end(); ++it) { + perf_event.push_back(it->getNameAsString() + "#" + it->getType().getAsString()); //"pid#u32" + } + fe_.perf_events_[name] = perf_event; + } + } else if (memb_name == "ringbuf_reserve") { + string name = string(Ref->getDecl()->getName()); + string arg0 = rewriter_.getRewrittenText(expansionRange(Call->getArg(0)->getSourceRange())); + txt = "bpf_ringbuf_reserve(bpf_pseudo_fd(1, " + fd + ")"; + txt += ", " + arg0 + ", 0)"; // Flags in reserve are meaningless + } else if (memb_name == "ringbuf_discard") { + string name = string(Ref->getDecl()->getName()); + string args = rewriter_.getRewrittenText(expansionRange(SourceRange(GET_BEGINLOC(Call->getArg(0)), + GET_ENDLOC(Call->getArg(1))))); + txt = "bpf_ringbuf_discard(" + args + ")"; + } else if (memb_name == "ringbuf_submit") { + string name = string(Ref->getDecl()->getName()); + string args = rewriter_.getRewrittenText(expansionRange(SourceRange(GET_BEGINLOC(Call->getArg(0)), + GET_ENDLOC(Call->getArg(1))))); + txt = "bpf_ringbuf_submit(" + args + ")"; + + // e.g. + // struct data_t { u32 pid; }; + // data_t *data = events.ringbuf_reserve(sizeof(data_t)); + // events.ringbuf_submit(data, 0); + // ... + // &data -> data -> typeof(data) -> data_t + auto type_arg0 = Call->getArg(0)->IgnoreCasts()->getType().getTypePtr()->getPointeeType().getTypePtr(); + if (type_arg0->isStructureType()) { + auto event_type = type_arg0->getAsTagDecl(); + const auto *r = dyn_cast(event_type); + std::vector perf_event; + + for (auto it = r->field_begin(); it != r->field_end(); ++it) { + perf_event.push_back(it->getNameAsString() + "#" + it->getType().getAsString()); //"pid#u32" + } + fe_.perf_events_[name] = perf_event; + } } else { if (memb_name == "lookup") { prefix = "bpf_map_lookup_elem"; @@ -928,7 +1054,16 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) { } else if (memb_name == "get_local_storage") { prefix = "bpf_get_local_storage"; suffix = ")"; - } else { + } else if (memb_name == "push") { + prefix = "bpf_map_push_elem"; + suffix = ")"; + } else if (memb_name == "pop") { + prefix = "bpf_map_pop_elem"; + suffix = ")"; + } else if (memb_name == "peek") { + prefix = "bpf_map_peek_elem"; + suffix = ")"; + } else { error(GET_BEGINLOC(Call), "invalid bpf_table operation %0") << memb_name; return false; } @@ -947,6 +1082,19 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) { } else if (Call->getCalleeDecl()) { NamedDecl *Decl = dyn_cast(Call->getCalleeDecl()); if (!Decl) return true; + + string text; + + // Bail out when bpf_probe_read_user is unavailable for overlapping address + // space arch. + bool overlap_addr = false; + std::string probe = check_bpf_probe_read_user(Decl->getName(), + overlap_addr); + if (overlap_addr) { + error(GET_BEGINLOC(Call), "bpf_probe_read_user not found. Use latest kernel"); + return false; + } + if (AsmLabelAttr *A = Decl->getAttr()) { // Functions with the tag asm("llvm.bpf.extra") are implemented in the // rewriter rather than as a macro since they may also include nested @@ -959,10 +1107,10 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) { } vector args; + for (auto arg : Call->arguments()) args.push_back(rewriter_.getRewrittenText(expansionRange(arg->getSourceRange()))); - string text; if (Decl->getName() == "incr_cksum_l3") { text = "bpf_l3_csum_replace_(" + fn_args_[0]->getName().str() + ", (u64)"; text += args[0] + ", " + args[1] + ", " + args[2] + ", sizeof(" + args[2] + "))"; @@ -994,8 +1142,16 @@ bool BTypeVisitor::VisitCallExpr(CallExpr *Call) { text = "({ u64 __addr = 0x0; "; text += "_bpf_readarg_" + current_fn_ + "_" + args[0] + "(" + args[1] + ", &__addr, sizeof(__addr));"; - text += "bpf_probe_read(" + args[2] + ", " + args[3] + - ", (void *)__addr);"; + + bool overlap_addr = false; + text += check_bpf_probe_read_user(StringRef("bpf_probe_read_user"), + overlap_addr); + if (overlap_addr) { + error(GET_BEGINLOC(Call), "bpf_probe_read_user not found. Use latest kernel"); + return false; + } + + text += "(" + args[2] + ", " + args[3] + ", (void *)__addr);"; text += "})"; rewriter_.ReplaceText(expansionRange(Call->getSourceRange()), text); } else if (Decl->getName() == "bpf_usdt_readarg") { @@ -1079,13 +1235,21 @@ bool BTypeVisitor::VisitBinaryOperator(BinaryOperator *E) { error(GET_BEGINLOC(E), "cannot use \"packet\" header type inside a macro"); return false; } + + auto EndLoc = GET_ENDLOC(E); + if (EndLoc.isMacroID()) { + error(EndLoc, "cannot have macro at the end of expresssion, " + "workaround: put perentheses around macro \"(MARCO)\""); + return false; + } + uint64_t ofs = C.getFieldOffset(F); uint64_t sz = F->isBitField() ? F->getBitWidthValue(C) : C.getTypeSize(F->getType()); string base = rewriter_.getRewrittenText(expansionRange(Base->getSourceRange())); string text = "bpf_dins_pkt(" + fn_args_[0]->getName().str() + ", (u64)" + base + "+" + to_string(ofs >> 3) + ", " + to_string(ofs & 0x7) + ", " + to_string(sz) + ","; rewriter_.ReplaceText(expansionRange(SourceRange(GET_BEGINLOC(E), E->getOperatorLoc())), text); - rewriter_.InsertTextAfterToken(GET_ENDLOC(E), ")"); + rewriter_.InsertTextAfterToken(EndLoc, ")"); } } } @@ -1275,8 +1439,19 @@ bool BTypeVisitor::VisitVarDecl(VarDecl *Decl) { if (numcpu <= 0) numcpu = 1; table.max_entries = numcpu; + } else if (section_attr == "maps/ringbuf") { + map_type = BPF_MAP_TYPE_RINGBUF; + // values from libbpf/src/libbpf_probes.c + table.key_size = 0; + table.leaf_size = 0; } else if (section_attr == "maps/perf_array") { map_type = BPF_MAP_TYPE_PERF_EVENT_ARRAY; + } else if (section_attr == "maps/queue") { + table.key_size = 0; + map_type = BPF_MAP_TYPE_QUEUE; + } else if (section_attr == "maps/stack") { + table.key_size = 0; + map_type = BPF_MAP_TYPE_STACK; } else if (section_attr == "maps/cgroup_array") { map_type = BPF_MAP_TYPE_CGROUP_ARRAY; } else if (section_attr == "maps/stacktrace") { @@ -1453,6 +1628,7 @@ void BTypeConsumer::HandleTranslationUnit(ASTContext &Context) { btype_visitor_.TraverseDecl(D); } + } BFrontendAction::BFrontendAction(llvm::raw_ostream &os, unsigned flags, @@ -1488,8 +1664,21 @@ void BFrontendAction::DoMiscWorkAround() { // to guard certain fields. The workaround here intends to define // CONFIG_CC_STACKPROTECTOR properly based on other configs, so it relieved any bpf // program (using task_struct, etc.) of patching the below code. - rewriter_->getEditBuffer(rewriter_->getSourceMgr().getMainFileID()).InsertText(0, - "#if defined(BPF_LICENSE)\n" + std::string probefunc = check_bpf_probe_read_kernel(); + if (kresolver) { + bcc_free_symcache(kresolver, -1); + kresolver = NULL; + } + if (probefunc == "bpf_probe_read") { + probefunc = "#define bpf_probe_read_kernel bpf_probe_read\n" + "#define bpf_probe_read_kernel_str bpf_probe_read_str\n" + "#define bpf_probe_read_user bpf_probe_read\n" + "#define bpf_probe_read_user_str bpf_probe_read_str\n"; + } + else { + probefunc = ""; + } + std::string prologue = "#if defined(BPF_LICENSE)\n" "#error BPF_LICENSE cannot be specified through cflags\n" "#endif\n" "#if !defined(CONFIG_CC_STACKPROTECTOR)\n" @@ -1498,7 +1687,10 @@ void BFrontendAction::DoMiscWorkAround() { " || defined(CONFIG_CC_STACKPROTECTOR_STRONG)\n" "#define CONFIG_CC_STACKPROTECTOR\n" "#endif\n" - "#endif\n", + "#endif\n"; + prologue = prologue + probefunc; + rewriter_->getEditBuffer(rewriter_->getSourceMgr().getMainFileID()).InsertText(0, + prologue, false); rewriter_->getEditBuffer(rewriter_->getSourceMgr().getMainFileID()).InsertTextAfter( diff --git a/src/cc/frontends/clang/b_frontend_action.h b/src/cc/frontends/clang/b_frontend_action.h index cea13cc08..bdbbc365a 100644 --- a/src/cc/frontends/clang/b_frontend_action.h +++ b/src/cc/frontends/clang/b_frontend_action.h @@ -90,6 +90,7 @@ class BTypeVisitor : public clang::RecursiveASTVisitor { std::vector fn_args_; std::set visited_; std::string current_fn_; + bool has_overlap_kuaddr_; }; // Do a depth-first search to rewrite all pointers that need to be probed @@ -129,6 +130,7 @@ class ProbeVisitor : public clang::RecursiveASTVisitor { std::list ptregs_returned_; const clang::Stmt *addrof_stmt_; bool is_addrof_; + bool has_overlap_kuaddr_; }; // A helper class to the frontend action, walks the decls diff --git a/src/cc/frontends/clang/kbuild_helper.cc b/src/cc/frontends/clang/kbuild_helper.cc index db5ca7f68..c4e0f074a 100644 --- a/src/cc/frontends/clang/kbuild_helper.cc +++ b/src/cc/frontends/clang/kbuild_helper.cc @@ -74,33 +74,54 @@ int KBuildHelper::get_flags(const char *uname_machine, vector *cflags) { cflags->push_back("-isystem"); cflags->push_back("/virtual/lib/clang/include"); - // some module build directories split headers between source/ and build/ + // The include order from kernel top Makefile: + // + // # Use USERINCLUDE when you must reference the UAPI directories only. + // USERINCLUDE := \ + // -I$(srctree)/arch/$(SRCARCH)/include/uapi \ + // -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \ + // -I$(srctree)/include/uapi \ + // -I$(objtree)/include/generated/uapi \ + // -include $(srctree)/include/linux/kconfig.h + // + // # Use LINUXINCLUDE when you must reference the include/ directory. + // # Needed to be compatible with the O= option + // LINUXINCLUDE := \ + // -I$(srctree)/arch/$(SRCARCH)/include \ + // -I$(objtree)/arch/$(SRCARCH)/include/generated \ + // $(if $(building_out_of_srctree),-I$(srctree)/include) \ + // -I$(objtree)/include \ + // $(USERINCLUDE) + // + // Some distros such as openSUSE/SUSE and Debian splits the headers between + // source/ and build/. In this case, just $(srctree) is source/ and + // $(objtree) is build/. if (has_source_dir_) { - cflags->push_back("-I" + kdir_ + "/build/arch/"+arch+"/include"); - cflags->push_back("-I" + kdir_ + "/build/arch/"+arch+"/include/generated/uapi"); + cflags->push_back("-Iarch/"+arch+"/include/"); cflags->push_back("-I" + kdir_ + "/build/arch/"+arch+"/include/generated"); + cflags->push_back("-Iinclude"); cflags->push_back("-I" + kdir_ + "/build/include"); - cflags->push_back("-I" + kdir_ + "/build/./arch/"+arch+"/include/uapi"); + cflags->push_back("-Iarch/"+arch+"/include/uapi"); cflags->push_back("-I" + kdir_ + "/build/arch/"+arch+"/include/generated/uapi"); - cflags->push_back("-I" + kdir_ + "/build/include/uapi"); - cflags->push_back("-I" + kdir_ + "/build/include/generated"); + cflags->push_back("-Iinclude/uapi"); cflags->push_back("-I" + kdir_ + "/build/include/generated/uapi"); + } else { + cflags->push_back("-Iarch/"+arch+"/include/"); + cflags->push_back("-Iarch/"+arch+"/include/generated"); + cflags->push_back("-Iinclude"); + cflags->push_back("-Iarch/"+arch+"/include/uapi"); + cflags->push_back("-Iarch/"+arch+"/include/generated/uapi"); + cflags->push_back("-Iinclude/uapi"); + cflags->push_back("-Iinclude/generated/uapi"); } - cflags->push_back("-I./arch/"+arch+"/include"); - cflags->push_back("-Iarch/"+arch+"/include/generated/uapi"); - cflags->push_back("-Iarch/"+arch+"/include/generated"); - cflags->push_back("-Iinclude"); - cflags->push_back("-I./arch/"+arch+"/include/uapi"); - cflags->push_back("-Iarch/"+arch+"/include/generated/uapi"); - cflags->push_back("-I./include/uapi"); - cflags->push_back("-Iinclude/generated/uapi"); cflags->push_back("-include"); cflags->push_back("./include/linux/kconfig.h"); cflags->push_back("-D__KERNEL__"); cflags->push_back("-D__HAVE_BUILTIN_BSWAP16__"); cflags->push_back("-D__HAVE_BUILTIN_BSWAP32__"); cflags->push_back("-D__HAVE_BUILTIN_BSWAP64__"); + cflags->push_back("-DKBUILD_MODNAME=\"bcc\""); // If ARCH env variable is set, pass this along. if (archenv) diff --git a/src/cc/frontends/clang/loader.cc b/src/cc/frontends/clang/loader.cc index 9d768d305..5ec778ceb 100644 --- a/src/cc/frontends/clang/loader.cc +++ b/src/cc/frontends/clang/loader.cc @@ -151,7 +151,8 @@ int ClangLoader::parse(unique_ptr *mod, TableStorage &ts, kpath = tmpdir; } else { std::cout << "Unable to find kernel headers. "; - std::cout << "Try rebuilding kernel with CONFIG_IKHEADERS=m (module)\n"; + std::cout << "Try rebuilding kernel with CONFIG_IKHEADERS=m (module) "; + std::cout << "or installing the kernel development package for your running kernel version.\n"; } } @@ -316,6 +317,11 @@ int ClangLoader::do_compile(unique_ptr *mod, TableStorage &ts, string target_triple = get_clang_target(); driver::Driver drv("", target_triple, diags); +#if LLVM_MAJOR_VERSION >= 4 + if (target_triple == "x86_64-unknown-linux-gnu") + flags_cstr.push_back("-fno-jump-tables"); +#endif + drv.setTitle("bcc-clang-driver"); drv.setCheckInputsExist(false); diff --git a/src/cc/frontends/clang/tp_frontend_action.cc b/src/cc/frontends/clang/tp_frontend_action.cc index 6a78aaca1..456283589 100644 --- a/src/cc/frontends/clang/tp_frontend_action.cc +++ b/src/cc/frontends/clang/tp_frontend_action.cc @@ -30,6 +30,7 @@ #include "frontend_action_common.h" #include "tp_frontend_action.h" +#include "common.h" namespace ebpf { @@ -42,6 +43,7 @@ using std::vector; using std::regex; using std::smatch; using std::regex_search; +using std::istream; using std::ifstream; using namespace clang; @@ -49,91 +51,6 @@ TracepointTypeVisitor::TracepointTypeVisitor(ASTContext &C, Rewriter &rewriter) : diag_(C.getDiagnostics()), rewriter_(rewriter), out_(llvm::errs()) { } -enum class field_kind_t { - common, - data_loc, - regular, - invalid -}; - -static inline field_kind_t _get_field_kind(string const& line, - string& field_type, - string& field_name) { - auto field_pos = line.find("field:"); - if (field_pos == string::npos) - return field_kind_t::invalid; - - auto field_semi_pos = line.find(';', field_pos); - if (field_semi_pos == string::npos) - return field_kind_t::invalid; - - auto offset_pos = line.find("offset:", field_semi_pos); - if (offset_pos == string::npos) - return field_kind_t::invalid; - - auto semi_pos = line.find(';', offset_pos); - if (semi_pos == string::npos) - return field_kind_t::invalid; - - auto size_pos = line.find("size:", semi_pos); - if (size_pos == string::npos) - return field_kind_t::invalid; - - semi_pos = line.find(';', size_pos); - if (semi_pos == string::npos) - return field_kind_t::invalid; - - auto size_str = line.substr(size_pos + 5, - semi_pos - size_pos - 5); - int size = std::stoi(size_str, nullptr); - - auto field = line.substr(field_pos + 6/*"field:"*/, - field_semi_pos - field_pos - 6); - auto pos = field.find_last_of("\t "); - if (pos == string::npos) - return field_kind_t::invalid; - - field_type = field.substr(0, pos); - field_name = field.substr(pos + 1); - if (field_type.find("__data_loc") != string::npos) - return field_kind_t::data_loc; - if (field_name.find("common_") == 0) - return field_kind_t::common; - // do not change type definition for array - if (field_name.find("[") != string::npos) - return field_kind_t::regular; - - // adjust the field_type based on the size of field - // otherwise, incorrect value may be retrieved for big endian - // and the field may have incorrect structure offset. - if (size == 2) { - if (field_type == "char" || field_type == "int8_t") - field_type = "s16"; - if (field_type == "unsigned char" || field_type == "uint8_t") - field_type = "u16"; - } else if (size == 4) { - if (field_type == "char" || field_type == "short" || - field_type == "int8_t" || field_type == "int16_t") - field_type = "s32"; - if (field_type == "unsigned char" || field_type == "unsigned short" || - field_type == "uint8_t" || field_type == "uint16_t") - field_type = "u32"; - } else if (size == 8) { - if (field_type == "char" || field_type == "short" || field_type == "int" || - field_type == "int8_t" || field_type == "int16_t" || - field_type == "int32_t" || field_type == "pid_t") - field_type = "s64"; - if (field_type == "unsigned char" || field_type == "unsigned short" || - field_type == "unsigned int" || field_type == "uint8_t" || - field_type == "uint16_t" || field_type == "uint32_t" || - field_type == "unsigned" || field_type == "u32" || - field_type == "uid_t" || field_type == "gid_t") - field_type = "u64"; - } - - return field_kind_t::regular; -} - string TracepointTypeVisitor::GenerateTracepointStruct( SourceLocation loc, string const& category, string const& event) { string format_file = "/sys/kernel/debug/tracing/events/" + @@ -142,25 +59,7 @@ string TracepointTypeVisitor::GenerateTracepointStruct( if (!input) return ""; - string tp_struct = "struct tracepoint__" + category + "__" + event + " {\n"; - tp_struct += "\tu64 __do_not_use__;\n"; - for (string line; getline(input, line); ) { - string field_type, field_name; - switch (_get_field_kind(line, field_type, field_name)) { - case field_kind_t::invalid: - case field_kind_t::common: - continue; - case field_kind_t::data_loc: - tp_struct += "\tint data_loc_" + field_name + ";\n"; - break; - case field_kind_t::regular: - tp_struct += "\t" + field_type + " " + field_name + ";\n"; - break; - } - } - - tp_struct += "};\n"; - return tp_struct; + return ebpf::parse_tracepoint(input, category, event); } static inline bool _is_tracepoint_struct_type(string const& type_name, diff --git a/src/cc/libbpf b/src/cc/libbpf index e5dbc1a96..b6dd2f2b7 160000 --- a/src/cc/libbpf +++ b/src/cc/libbpf @@ -1 +1 @@ -Subproject commit e5dbc1a96f138e7c47324a65269adff0ca0f4f6e +Subproject commit b6dd2f2b7df4d3bd35d64aaf521d9ad18d766f53 diff --git a/src/cc/libbpf.c b/src/cc/libbpf.c index 974dc272e..329741e37 100644 --- a/src/cc/libbpf.c +++ b/src/cc/libbpf.c @@ -52,8 +52,7 @@ // TODO: Remove this when CentOS 6 support is not needed anymore #include "setns.h" -#include "libbpf/src/bpf.h" -#include "libbpf/src/libbpf.h" +#include "bcc_libbpf_inc.h" // TODO: remove these defines when linux-libc-dev exports them properly @@ -216,6 +215,40 @@ static struct bpf_helper helpers[] = { {"tcp_send_ack", "5.5"}, {"send_signal_thread", "5.5"}, {"jiffies64", "5.5"}, + {"read_branch_records", "5.6"}, + {"get_ns_current_pid_tgid", "5.6"}, + {"xdp_output", "5.6"}, + {"get_netns_cookie", "5.6"}, + {"get_current_ancestor_cgroup_id", "5.6"}, + {"sk_assign", "5.6"}, + {"ktime_get_boot_ns", "5.7"}, + {"seq_printf", "5.7"}, + {"seq_write", "5.7"}, + {"sk_cgroup_id", "5.7"}, + {"sk_ancestor_cgroup_id", "5.7"}, + {"csum_level", "5.7"}, + {"ringbuf_output", "5.8"}, + {"ringbuf_reserve", "5.8"}, + {"ringbuf_submit", "5.8"}, + {"ringbuf_discard", "5.8"}, + {"ringbuf_query", "5.8"}, + {"skc_to_tcp6_sock", "5.9"}, + {"skc_to_tcp_sock", "5.9"}, + {"skc_to_tcp_timewait_sock", "5.9"}, + {"skc_to_tcp_request_sock", "5.9"}, + {"skc_to_udp6_sock", "5.9"}, + {"get_task_stack", "5.9"}, + {"load_hdr_opt", "5.10"}, + {"store_hdr_opt", "5.10"}, + {"reserve_hdr_opt", "5.10"}, + {"inode_storage_get", "5.10"}, + {"inode_storage_delete", "5.10"}, + {"d_path", "5.10"}, + {"copy_from_user", "5.10"}, + {"snprintf_btf", "5.10"}, + {"seq_printf_btf", "5.10"}, + {"skb_cgroup_classid", "5.10"}, + {"redirect_neigh", "5.10"}, }; static uint64_t ptr_to_u64(void *ptr) @@ -306,6 +339,11 @@ int bpf_delete_elem(int fd, void *key) return bpf_map_delete_elem(fd, key); } +int bpf_lookup_and_delete(int fd, void *key, void *value) +{ + return bpf_map_lookup_and_delete_elem(fd, key, value); +} + int bpf_get_first_key(int fd, void *key, size_t key_size) { int i, res; @@ -375,8 +413,8 @@ static void bpf_print_hints(int ret, char *log) if (strstr(log, "invalid mem access 'inv'") != NULL) { fprintf(stderr, "HINT: The invalid mem access 'inv' error can happen " "if you try to dereference memory without first using " - "bpf_probe_read() to copy it to the BPF stack. Sometimes the " - "bpf_probe_read is automatic by the bcc rewriter, other times " + "bpf_probe_read_kernel() to copy it to the BPF stack. Sometimes the " + "bpf_probe_read_kernel() is automatic by the bcc rewriter, other times " "you'll need to be explicit.\n\n"); } @@ -511,7 +549,7 @@ int bcc_prog_load_xattr(struct bpf_load_program_attr *attr, int prog_len, unsigned name_len = attr->name ? strlen(attr->name) : 0; char *tmp_log_buf = NULL, *attr_log_buf = NULL; unsigned tmp_log_buf_size = 0, attr_log_buf_size = 0; - int ret = 0, name_offset = 0; + int ret = 0, name_offset = 0, expected_attach_type = 0; char prog_name[BPF_OBJ_NAME_LEN] = {}; unsigned insns_cnt = prog_len / sizeof(struct bpf_insn); @@ -548,6 +586,37 @@ int bcc_prog_load_xattr(struct bpf_load_program_attr *attr, int prog_len, name_offset = 12; else if (strncmp(attr->name, "raw_tracepoint__", 16) == 0) name_offset = 16; + else if (strncmp(attr->name, "kfunc__", 7) == 0) { + name_offset = 7; + expected_attach_type = BPF_TRACE_FENTRY; + } else if (strncmp(attr->name, "kretfunc__", 10) == 0) { + name_offset = 10; + expected_attach_type = BPF_TRACE_FEXIT; + } else if (strncmp(attr->name, "lsm__", 5) == 0) { + name_offset = 5; + expected_attach_type = BPF_LSM_MAC; + } else if (strncmp(attr->name, "bpf_iter__", 10) == 0) { + name_offset = 10; + expected_attach_type = BPF_TRACE_ITER; + } + + if (attr->prog_type == BPF_PROG_TYPE_TRACING || + attr->prog_type == BPF_PROG_TYPE_LSM) { + ret = libbpf_find_vmlinux_btf_id(attr->name + name_offset, + expected_attach_type); + if (ret == -EINVAL) { + fprintf(stderr, "bpf: vmlinux BTF is not found\n"); + return ret; + } else if (ret < 0) { + fprintf(stderr, "bpf: %s is not found in vmlinux BTF\n", + attr->name + name_offset); + return ret; + } + + attr->attach_btf_id = ret; + attr->expected_attach_type = expected_attach_type; + } + memcpy(prog_name, attr->name + name_offset, min(name_len - name_offset, BPF_OBJ_NAME_LEN - 1)); attr->name = prog_name; @@ -672,7 +741,8 @@ int bcc_prog_load(enum bpf_prog_type prog_type, const char *name, attr.name = name; attr.insns = insns; attr.license = license; - attr.kern_version = kern_version; + if (prog_type != BPF_PROG_TYPE_TRACING && prog_type != BPF_PROG_TYPE_EXT) + attr.kern_version = kern_version; attr.log_level = log_level; return bcc_prog_load_xattr(&attr, prog_len, log_buf, log_buf_size, true); } @@ -1136,7 +1206,7 @@ int bpf_detach_tracepoint(const char *tp_category, const char *tp_name) { return 0; } -int bpf_attach_raw_tracepoint(int progfd, char *tp_name) +int bpf_attach_raw_tracepoint(int progfd, const char *tp_name) { int ret; @@ -1146,6 +1216,31 @@ int bpf_attach_raw_tracepoint(int progfd, char *tp_name) return ret; } +bool bpf_has_kernel_btf(void) +{ + return libbpf_find_vmlinux_btf_id("bpf_prog_put", 0) > 0; +} + +int bpf_attach_kfunc(int prog_fd) +{ + int ret; + + ret = bpf_raw_tracepoint_open(NULL, prog_fd); + if (ret < 0) + fprintf(stderr, "bpf_attach_raw_tracepoint (kfunc): %s\n", strerror(errno)); + return ret; +} + +int bpf_attach_lsm(int prog_fd) +{ + int ret; + + ret = bpf_raw_tracepoint_open(NULL, prog_fd); + if (ret < 0) + fprintf(stderr, "bpf_attach_raw_tracepoint (lsm): %s\n", strerror(errno)); + return ret; +} + void * bpf_open_perf_buffer(perf_reader_raw_cb raw_cb, perf_reader_lost_cb lost_cb, void *cb_cookie, int pid, int cpu, int page_cnt) { @@ -1339,3 +1434,50 @@ int bpf_close_perf_event_fd(int fd) { } return error; } + +/* Create a new ringbuf manager to manage ringbuf associated with + * map_fd, associating it with callback sample_cb. */ +void * bpf_new_ringbuf(int map_fd, ring_buffer_sample_fn sample_cb, void *ctx) { + return ring_buffer__new(map_fd, sample_cb, ctx, NULL); +} + +/* Free the ringbuf manager rb and all ring buffers associated with it. */ +void bpf_free_ringbuf(struct ring_buffer *rb) { + ring_buffer__free(rb); +} + +/* Add a new ring buffer associated with map_fd to the ring buffer manager rb, + * associating it with callback sample_cb. */ +int bpf_add_ringbuf(struct ring_buffer *rb, int map_fd, + ring_buffer_sample_fn sample_cb, void *ctx) { + return ring_buffer__add(rb, map_fd, sample_cb, ctx); +} + +/* Poll for available data and consume, if data is available. Returns number + * of records consumed, or a negative number if any callbacks returned an + * error. */ +int bpf_poll_ringbuf(struct ring_buffer *rb, int timeout_ms) { + return ring_buffer__poll(rb, timeout_ms); +} + +/* Consume available data _without_ polling. Good for use cases where low + * latency is desired over performance impact. Returns number of records + * consumed, or a negative number if any callbacks returned an error. */ +int bpf_consume_ringbuf(struct ring_buffer *rb) { + return ring_buffer__consume(rb); +} + +int bcc_iter_attach(int prog_fd, union bpf_iter_link_info *link_info, + uint32_t link_info_len) +{ + DECLARE_LIBBPF_OPTS(bpf_link_create_opts, link_create_opts); + + link_create_opts.iter_info = link_info; + link_create_opts.iter_info_len = link_info_len; + return bpf_link_create(prog_fd, 0, BPF_TRACE_ITER, &link_create_opts); +} + +int bcc_iter_create(int link_fd) +{ + return bpf_iter_create(link_fd); +} diff --git a/src/cc/libbpf.h b/src/cc/libbpf.h index 77bb728c5..a4914cf1a 100644 --- a/src/cc/libbpf.h +++ b/src/cc/libbpf.h @@ -44,6 +44,7 @@ int bpf_lookup_elem(int fd, void *key, void *value); int bpf_delete_elem(int fd, void *key); int bpf_get_first_key(int fd, void *key, size_t key_size); int bpf_get_next_key(int fd, void *key, void *next_key); +int bpf_lookup_and_delete(int fd, void *key, void *value); /* * Load a BPF program, and return the FD of the loaded program. @@ -92,7 +93,13 @@ int bpf_attach_tracepoint(int progfd, const char *tp_category, const char *tp_name); int bpf_detach_tracepoint(const char *tp_category, const char *tp_name); -int bpf_attach_raw_tracepoint(int progfd, char *tp_name); +int bpf_attach_raw_tracepoint(int progfd, const char *tp_name); + +int bpf_attach_kfunc(int prog_fd); + +int bpf_attach_lsm(int prog_fd); + +bool bpf_has_kernel_btf(void); void * bpf_open_perf_buffer(perf_reader_raw_cb raw_cb, perf_reader_lost_cb lost_cb, void *cb_cookie, @@ -115,6 +122,17 @@ int bpf_open_perf_event(uint32_t type, uint64_t config, int pid, int cpu); int bpf_close_perf_event_fd(int fd); +typedef int (*ring_buffer_sample_fn)(void *ctx, void *data, size_t size); + +struct ring_buffer; + +void * bpf_new_ringbuf(int map_fd, ring_buffer_sample_fn sample_cb, void *ctx); +void bpf_free_ringbuf(struct ring_buffer *rb); +int bpf_add_ringbuf(struct ring_buffer *rb, int map_fd, + ring_buffer_sample_fn sample_cb, void *ctx); +int bpf_poll_ringbuf(struct ring_buffer *rb, int timeout_ms); +int bpf_consume_ringbuf(struct ring_buffer *rb); + int bpf_obj_pin(int fd, const char *pathname); int bpf_obj_get(const char *pathname); int bpf_obj_get_info(int prog_map_fd, void *info, uint32_t *info_len); @@ -126,6 +144,10 @@ int bpf_prog_get_fd_by_id(uint32_t id); int bpf_map_get_fd_by_id(uint32_t id); int bpf_obj_get_info_by_fd(int prog_fd, void *info, uint32_t *info_len); +int bcc_iter_attach(int prog_fd, union bpf_iter_link_info *link_info, + uint32_t link_info_len); +int bcc_iter_create(int link_fd); + #define LOG_BUF_SIZE 65536 // Put non-static/inline functions in their own section with this prefix + diff --git a/src/cc/usdt.h b/src/cc/usdt.h index b32e8f38f..aba0441b3 100644 --- a/src/cc/usdt.h +++ b/src/cc/usdt.h @@ -102,6 +102,8 @@ class ArgumentParser { } bool error_return(ssize_t error_start, ssize_t skip_start) { print_error(error_start); + if (isspace(arg_[skip_start])) + skip_start++; // Make sure we skip at least one character skip_until_whitespace_from(skip_start); return false; } @@ -115,9 +117,9 @@ class ArgumentParser { class ArgumentParser_aarch64 : public ArgumentParser { private: - bool parse_register(ssize_t pos, ssize_t &new_pos, optional *reg_num); + bool parse_register(ssize_t pos, ssize_t &new_pos, std::string ®_name); bool parse_size(ssize_t pos, ssize_t &new_pos, optional *arg_size); - bool parse_mem(ssize_t pos, ssize_t &new_pos, optional *reg_num, + bool parse_mem(ssize_t pos, ssize_t &new_pos, std::string ®_name, optional *offset); public: @@ -260,6 +262,8 @@ class Context { void add_probe(const char *binpath, const struct bcc_elf_usdt *probe); std::string resolve_bin_path(const std::string &bin_path); + Probe *get_checked(const std::string &provider_name, + const std::string &probe_name); private: uint8_t mod_match_inode_only_; @@ -283,6 +287,9 @@ class Context { bool enable_probe(const std::string &probe_name, const std::string &fn_name); bool enable_probe(const std::string &provider_name, const std::string &probe_name, const std::string &fn_name); + bool addsem_probe(const std::string &provider_name, + const std::string &probe_name, const std::string &fn_name, + int16_t val); typedef void (*each_cb)(struct bcc_usdt *); void each(each_cb callback); diff --git a/src/cc/usdt/usdt.cc b/src/cc/usdt/usdt.cc index 0c02601ba..0a18c2b14 100644 --- a/src/cc/usdt/usdt.cc +++ b/src/cc/usdt/usdt.cc @@ -308,11 +308,10 @@ bool Context::enable_probe(const std::string &probe_name, return enable_probe("", probe_name, fn_name); } -bool Context::enable_probe(const std::string &provider_name, - const std::string &probe_name, - const std::string &fn_name) { +Probe *Context::get_checked(const std::string &provider_name, + const std::string &probe_name) { if (pid_stat_ && pid_stat_->is_stale()) - return false; + return nullptr; Probe *found_probe = nullptr; for (auto &p : probes_) { @@ -321,12 +320,20 @@ bool Context::enable_probe(const std::string &provider_name, if (found_probe != nullptr) { fprintf(stderr, "Two same-name probes (%s) but different providers\n", probe_name.c_str()); - return false; + return nullptr; } found_probe = p.get(); } } + return found_probe; +} + +bool Context::enable_probe(const std::string &provider_name, + const std::string &probe_name, + const std::string &fn_name) { + Probe *found_probe = get_checked(provider_name, probe_name); + if (found_probe != nullptr) return found_probe->enable(fn_name); @@ -346,6 +353,22 @@ void Context::each(each_cb callback) { } } +bool Context::addsem_probe(const std::string &provider_name, + const std::string &probe_name, + const std::string &fn_name, + int16_t val) { + Probe *found_probe = get_checked(provider_name, probe_name); + + if (found_probe != nullptr) { + if (found_probe->need_enable()) + return found_probe->add_to_semaphore(val); + + return true; + } + + return false; +} + void Context::each_uprobe(each_uprobe_cb callback) { for (auto &p : probes_) { if (!p->enabled()) @@ -420,10 +443,10 @@ void *bcc_usdt_new_frompid(int pid, const char *path) { } else { struct stat buffer; if (strlen(path) >= 1 && path[0] != '/') { - fprintf(stderr, "HINT: Binary path should be absolute.\n\n"); + fprintf(stderr, "HINT: Binary path %s should be absolute.\n\n", path); return nullptr; } else if (stat(path, &buffer) == -1) { - fprintf(stderr, "HINT: Specified binary doesn't exist.\n\n"); + fprintf(stderr, "HINT: Specified binary %s doesn't exist.\n\n", path); return nullptr; } ctx = new USDT::Context(pid, path); @@ -457,6 +480,12 @@ int bcc_usdt_enable_probe(void *usdt, const char *probe_name, return ctx->enable_probe(probe_name, fn_name) ? 0 : -1; } +int bcc_usdt_addsem_probe(void *usdt, const char *probe_name, + const char *fn_name, int16_t val) { + USDT::Context *ctx = static_cast(usdt); + return ctx->addsem_probe("", probe_name, fn_name, val) ? 0 : -1; +} + int bcc_usdt_enable_fully_specified_probe(void *usdt, const char *provider_name, const char *probe_name, const char *fn_name) { @@ -464,6 +493,13 @@ int bcc_usdt_enable_fully_specified_probe(void *usdt, const char *provider_name, return ctx->enable_probe(provider_name, probe_name, fn_name) ? 0 : -1; } +int bcc_usdt_addsem_fully_specified_probe(void *usdt, const char *provider_name, + const char *probe_name, + const char *fn_name, int16_t val) { + USDT::Context *ctx = static_cast(usdt); + return ctx->addsem_probe(provider_name, probe_name, fn_name, val) ? 0 : -1; +} + const char *bcc_usdt_genargs(void **usdt_array, int len) { static std::string storage_; std::ostringstream stream; @@ -506,6 +542,15 @@ const char *bcc_usdt_get_probe_argctype( return ""; } +const char *bcc_usdt_get_fully_specified_probe_argctype( + void *ctx, const char* provider_name, const char* probe_name, const int arg_index +) { + USDT::Probe *p = static_cast(ctx)->get(provider_name, probe_name); + if (p) + return p->get_arg_ctype(arg_index).c_str(); + return ""; +} + void bcc_usdt_foreach(void *usdt, bcc_usdt_cb callback) { USDT::Context *ctx = static_cast(usdt); ctx->each(callback); diff --git a/src/cc/usdt/usdt_args.cc b/src/cc/usdt/usdt_args.cc index a6a04b9a4..1e239bd6e 100644 --- a/src/cc/usdt/usdt_args.cc +++ b/src/cc/usdt/usdt_args.cc @@ -92,7 +92,7 @@ bool Argument::assign_to_local(std::ostream &stream, tfm::format(stream, " %s ", COMPILER_BARRIER); tfm::format(stream, "%s __res = 0x0; " - "bpf_probe_read(&__res, sizeof(__res), (void *)__addr); " + "bpf_probe_read_user(&__res, sizeof(__res), (void *)__addr); " "%s = __res; }", ctype(), local_name); return true; @@ -105,7 +105,7 @@ bool Argument::assign_to_local(std::ostream &stream, tfm::format(stream, "{ u64 __addr = 0x%xull + %d; %s __res = 0x0; " - "bpf_probe_read(&__res, sizeof(__res), (void *)__addr); " + "bpf_probe_read_user(&__res, sizeof(__res), (void *)__addr); " "%s = __res; }", global_address, *deref_offset_, ctype(), local_name); return true; @@ -133,11 +133,27 @@ void ArgumentParser::skip_until_whitespace_from(size_t pos) { } bool ArgumentParser_aarch64::parse_register(ssize_t pos, ssize_t &new_pos, - optional *reg_num) { - new_pos = parse_number(pos, reg_num); - if (new_pos == pos || *reg_num < 0 || *reg_num > 31) + std::string ®_name) { + if (arg_[pos] == 'x') { + optional reg_num; + new_pos = parse_number(pos + 1, ®_num); + if (new_pos == pos + 1 || *reg_num < 0 || *reg_num > 31) + return error_return(pos + 1, pos + 1); + + if (*reg_num == 31) { + reg_name = "sp"; + } else { + reg_name = "regs[" + std::to_string(reg_num.value()) + "]"; + } + + return true; + } else if (arg_[pos] == 's' && arg_[pos + 1] == 'p') { + reg_name = "sp"; + new_pos = pos + 2; + return true; + } else { return error_return(pos, pos); - return true; + } } bool ArgumentParser_aarch64::parse_size(ssize_t pos, ssize_t &new_pos, @@ -156,11 +172,9 @@ bool ArgumentParser_aarch64::parse_size(ssize_t pos, ssize_t &new_pos, } bool ArgumentParser_aarch64::parse_mem(ssize_t pos, ssize_t &new_pos, - optional *reg_num, + std::string ®_name, optional *offset) { - if (arg_[pos] != 'x') - return error_return(pos, pos); - if (parse_register(pos + 1, new_pos, reg_num) == false) + if (parse_register(pos, new_pos, reg_name) == false) return false; if (arg_[new_pos] == ',') { @@ -195,20 +209,22 @@ bool ArgumentParser_aarch64::parse(Argument *dest) { return error_return(new_pos, new_pos); cur_pos = new_pos + 1; - if (arg_[cur_pos] == 'x') { + if (arg_[cur_pos] == 'x' || arg_[cur_pos] == 's') { // Parse ...@ - optional reg_num; - if (parse_register(cur_pos + 1, new_pos, ®_num) == false) + std::string reg_name; + if (parse_register(cur_pos, new_pos, reg_name) == false) return false; + cur_pos_ = new_pos; - dest->base_register_name_ = "regs[" + std::to_string(reg_num.value()) + "]"; + dest->base_register_name_ = reg_name; } else if (arg_[cur_pos] == '[') { // Parse ...@[] and ...@[] - optional reg_num, offset = 0; - if (parse_mem(cur_pos + 1, new_pos, ®_num, &offset) == false) + optional offset = 0; + std::string reg_name; + if (parse_mem(cur_pos + 1, new_pos, reg_name, &offset) == false) return false; cur_pos_ = new_pos; - dest->base_register_name_ = "regs[" + std::to_string(reg_num.value()) + "]"; + dest->base_register_name_ = reg_name; dest->deref_offset_ = offset; } else { // Parse ...@ diff --git a/src/python/bcc/__init__.py b/src/python/bcc/__init__.py index 1c94c7871..8d87945c7 100644 --- a/src/python/bcc/__init__.py +++ b/src/python/bcc/__init__.py @@ -22,11 +22,12 @@ import struct import errno import sys +import platform from .libbcc import lib, bcc_symbol, bcc_symbol_option, bcc_stacktrace_build_id, _SYM_CB_TYPE -from .table import Table, PerfEventArray +from .table import Table, PerfEventArray, RingBuf, BPF_MAP_TYPE_QUEUE, BPF_MAP_TYPE_STACK from .perf import Perf -from .utils import get_online_cpus, printb, _assert_is_bytes, ArgString +from .utils import get_online_cpus, printb, _assert_is_bytes, ArgString, StrcmpRewrite from .version import __version__ from .disassembler import disassemble_prog, decode_map @@ -108,6 +109,10 @@ class PerfType: # From perf_type_id in uapi/linux/perf_event.h HARDWARE = 0 SOFTWARE = 1 + TRACEPOINT = 2 + HW_CACHE = 3 + RAW = 4 + BREAKPOINT = 5 class PerfHWConfig: # From perf_hw_id in uapi/linux/perf_event.h @@ -156,6 +161,8 @@ class BPF(object): SK_MSG = 16 RAW_TRACEPOINT = 17 CGROUP_SOCK_ADDR = 18 + TRACING = 26 + LSM = 29 # from xdp_action uapi/linux/bpf.h XDP_ABORTED = 0 @@ -164,6 +171,10 @@ class BPF(object): XDP_TX = 3 XDP_REDIRECT = 4 + # from bpf_attach_type uapi/linux/bpf.h + TRACE_FENTRY = 24 + TRACE_FEXIT = 25 + _probe_repl = re.compile(b"[^a-zA-Z0-9_]") _sym_caches = {} _bsymcache = lib.bcc_buildsymcache_new() @@ -272,7 +283,7 @@ def is_exe(fpath): else: for path in os.environ["PATH"].split(os.pathsep): path = path.strip('"') - exe_file = os.path.join(path, bin_path) + exe_file = os.path.join(path.encode(), bin_path) if is_exe(exe_file): return exe_file return None @@ -303,8 +314,12 @@ def __init__(self, src_file=b"", hdr_file=b"", text=None, debug=0, self.uprobe_fds = {} self.tracepoint_fds = {} self.raw_tracepoint_fds = {} + self.kfunc_entry_fds = {} + self.kfunc_exit_fds = {} + self.lsm_fds = {} self.perf_buffers = {} self.open_perf_events = {} + self._ringbuf_manager = None self.tracefile = None atexit.register(self.cleanup) @@ -489,9 +504,10 @@ def get_table(self, name, keytype=None, leaftype=None, reducer=None): name = _assert_is_bytes(name) map_id = lib.bpf_table_id(self.module, name) map_fd = lib.bpf_table_fd(self.module, name) + is_queuestack = lib.bpf_table_type_id(self.module, map_id) in [BPF_MAP_TYPE_QUEUE, BPF_MAP_TYPE_STACK] if map_fd < 0: raise KeyError - if not keytype: + if not keytype and not is_queuestack: key_desc = lib.bpf_table_key_desc(self.module, name).decode("utf-8") if not key_desc: raise Exception("Failed to load BPF Table %s key desc" % name) @@ -538,8 +554,15 @@ def attach_raw_socket(fn, dev): @staticmethod def get_kprobe_functions(event_re): - with open("%s/../kprobes/blacklist" % TRACEFS, "rb") as blacklist_f: - blacklist = set([line.rstrip().split()[1] for line in blacklist_f]) + blacklist_file = "%s/../kprobes/blacklist" % TRACEFS + try: + with open(blacklist_file, "rb") as blacklist_f: + blacklist = set([line.rstrip().split()[1] for line in blacklist_f]) + except IOError as e: + if e.errno != errno.EPERM: + raise e + blacklist = set([]) + fns = [] in_init_section = 0 @@ -599,7 +622,7 @@ def _del_kprobe_fd(self, name): global _num_open_probes del self.kprobe_fds[name] _num_open_probes -= 1 - + def _add_uprobe_fd(self, name, fd): global _num_open_probes self.uprobe_fds[name] = fd @@ -635,7 +658,7 @@ def fix_syscall_fnname(self, name): if name.startswith(prefix): return self.get_syscall_fnname(name[len(prefix):]) return name - + def attach_kprobe(self, event=b"", event_off=0, fn_name=b"", event_re=b""): event = _assert_is_bytes(event) fn_name = _assert_is_bytes(fn_name) @@ -869,6 +892,102 @@ def detach_raw_tracepoint(self, tp=b""): os.close(self.raw_tracepoint_fds[tp]) del self.raw_tracepoint_fds[tp] + @staticmethod + def add_prefix(prefix, name): + if not name.startswith(prefix): + name = prefix + name + return name + + @staticmethod + def support_kfunc(): + # there's no trampoline support for other than x86_64 arch + if platform.machine() != 'x86_64': + return False; + if not lib.bpf_has_kernel_btf(): + return False; + # kernel symbol "bpf_trampoline_link_prog" indicates kfunc support + if BPF.ksymname("bpf_trampoline_link_prog") != -1: + return True + return False + + @staticmethod + def support_lsm(): + if not lib.bpf_has_kernel_btf(): + return False + # kernel symbol "bpf_lsm_bpf" indicates BPF LSM support + if BPF.ksymname(b"bpf_lsm_bpf") != -1: + return True + return False + + def detach_kfunc(self, fn_name=b""): + fn_name = _assert_is_bytes(fn_name) + fn_name = BPF.add_prefix(b"kfunc__", fn_name) + + if fn_name not in self.kfunc_entry_fds: + raise Exception("Kernel entry func %s is not attached" % fn_name) + os.close(self.kfunc_entry_fds[fn_name]) + del self.kfunc_entry_fds[fn_name] + + def detach_kretfunc(self, fn_name=b""): + fn_name = _assert_is_bytes(fn_name) + fn_name = BPF.add_prefix(b"kretfunc__", fn_name) + + if fn_name not in self.kfunc_exit_fds: + raise Exception("Kernel exit func %s is not attached" % fn_name) + os.close(self.kfunc_exit_fds[fn_name]) + del self.kfunc_exit_fds[fn_name] + + def attach_kfunc(self, fn_name=b""): + fn_name = _assert_is_bytes(fn_name) + fn_name = BPF.add_prefix(b"kfunc__", fn_name) + + if fn_name in self.kfunc_entry_fds: + raise Exception("Kernel entry func %s has been attached" % fn_name) + + fn = self.load_func(fn_name, BPF.TRACING) + fd = lib.bpf_attach_kfunc(fn.fd) + if fd < 0: + raise Exception("Failed to attach BPF to entry kernel func") + self.kfunc_entry_fds[fn_name] = fd; + return self + + def attach_kretfunc(self, fn_name=b""): + fn_name = _assert_is_bytes(fn_name) + fn_name = BPF.add_prefix(b"kretfunc__", fn_name) + + if fn_name in self.kfunc_exit_fds: + raise Exception("Kernel exit func %s has been attached" % fn_name) + + fn = self.load_func(fn_name, BPF.TRACING) + fd = lib.bpf_attach_kfunc(fn.fd) + if fd < 0: + raise Exception("Failed to attach BPF to exit kernel func") + self.kfunc_exit_fds[fn_name] = fd; + return self + + def detach_lsm(self, fn_name=b""): + fn_name = _assert_is_bytes(fn_name) + fn_name = BPF.add_prefix(b"lsm__", fn_name) + + if fn_name not in self.lsm_fds: + raise Exception("LSM %s is not attached" % fn_name) + os.close(self.lsm_fds[fn_name]) + del self.lsm_fds[fn_name] + + def attach_lsm(self, fn_name=b""): + fn_name = _assert_is_bytes(fn_name) + fn_name = BPF.add_prefix(b"lsm__", fn_name) + + if fn_name in self.lsm_fds: + raise Exception("LSM %s has been attached" % fn_name) + + fn = self.load_func(fn_name, BPF.LSM) + fd = lib.bpf_attach_lsm(fn.fd) + if fd < 0: + raise Exception("Failed to attach LSM") + self.lsm_fds[fn_name] = fd; + return self + @staticmethod def support_raw_tracepoint(): # kernel symbol "bpf_find_raw_tracepoint" indicates raw_tracepoint support @@ -1124,6 +1243,12 @@ def _trace_autoload(self): fn = self.load_func(func_name, BPF.RAW_TRACEPOINT) tp = fn.name[len(b"raw_tracepoint__"):] self.attach_raw_tracepoint(tp=tp, fn_name=fn.name) + elif func_name.startswith(b"kfunc__"): + self.attach_kfunc(fn_name=func_name) + elif func_name.startswith(b"kretfunc__"): + self.attach_kretfunc(fn_name=func_name) + elif func_name.startswith(b"lsm__"): + self.attach_lsm(fn_name=func_name) def trace_open(self, nonblocking=False): """trace_open(nonblocking=False) @@ -1153,7 +1278,10 @@ def trace_fields(self, nonblocking=False): task = line[:16].lstrip() line = line[17:] ts_end = line.find(b":") - pid, cpu, flags, ts = line[:ts_end].split() + try: + pid, cpu, flags, ts = line[:ts_end].split() + except Exception as e: + continue cpu = cpu[1:-1] # line[ts_end:] will have ": [sym_or_addr]: msgs" # For trace_pipe debug output, the addr typically @@ -1165,7 +1293,10 @@ def trace_fields(self, nonblocking=False): line = line[ts_end + 1:] sym_end = line.find(b":") msg = line[sym_end + 2:] - return (task, int(pid), int(cpu), flags, float(ts), msg) + try: + return (task, int(pid), int(cpu), flags, float(ts), msg) + except Exception as e: + return ("Unknown", 0, 0, "Unknown", 0.0, "Unknown") def trace_readline(self, nonblocking=False): """trace_readline(nonblocking=False) @@ -1326,6 +1457,38 @@ def kprobe_poll(self, timeout = -1): """ self.perf_buffer_poll(timeout) + def _open_ring_buffer(self, map_fd, fn, ctx=None): + if not self._ringbuf_manager: + self._ringbuf_manager = lib.bpf_new_ringbuf(map_fd, fn, ctx) + if not self._ringbuf_manager: + raise Exception("Could not open ring buffer") + else: + ret = lib.bpf_add_ringbuf(self._ringbuf_manager, map_fd, fn, ctx) + if ret < 0: + raise Exception("Could not open ring buffer") + + def ring_buffer_poll(self, timeout = -1): + """ring_buffer_poll(self) + + Poll from all open ringbuf buffers, calling the callback that was + provided when calling open_ring_buffer for each entry. + """ + if not self._ringbuf_manager: + raise Exception("No ring buffers to poll") + lib.bpf_poll_ringbuf(self._ringbuf_manager, timeout) + + def ring_buffer_consume(self): + """ring_buffer_consume(self) + + Consume all open ringbuf buffers, regardless of whether or not + they currently contain events data. This is best for use cases + where low latency is desired, but it can impact performance. + If you are unsure, use ring_buffer_poll instead. + """ + if not self._ringbuf_manager: + raise Exception("No ring buffers to poll") + lib.bpf_consume_ringbuf(self._ringbuf_manager) + def free_bcc_memory(self): return lib.bcc_free_memory() @@ -1353,6 +1516,12 @@ def cleanup(self): self.detach_tracepoint(k) for k, v in list(self.raw_tracepoint_fds.items()): self.detach_raw_tracepoint(k) + for k, v in list(self.kfunc_entry_fds.items()): + self.detach_kfunc(k) + for k, v in list(self.kfunc_exit_fds.items()): + self.detach_kretfunc(k) + for k, v in list(self.lsm_fds.items()): + self.detach_lsm(k) # Clean up opened perf ring buffer and perf events table_keys = list(self.tables.keys()) @@ -1371,6 +1540,11 @@ def cleanup(self): lib.bpf_module_destroy(self.module) self.module = None + # Clean up ringbuf + if self._ringbuf_manager: + lib.bpf_free_ringbuf(self._ringbuf_manager) + self._ringbuf_manager = None + def __enter__(self): return self diff --git a/src/python/bcc/containers.py b/src/python/bcc/containers.py new file mode 100644 index 000000000..b55e05002 --- /dev/null +++ b/src/python/bcc/containers.py @@ -0,0 +1,80 @@ +# Copyright 2020 Kinvolk GmbH +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +def _cgroup_filter_func_writer(cgroupmap): + if not cgroupmap: + return """ + static inline int _cgroup_filter() { + return 0; + } + """ + + text = """ + BPF_TABLE_PINNED("hash", u64, u64, cgroupset, 1024, "CGROUP_PATH"); + + static inline int _cgroup_filter() { + u64 cgroupid = bpf_get_current_cgroup_id(); + return cgroupset.lookup(&cgroupid) == NULL; + } + """ + + return text.replace('CGROUP_PATH', cgroupmap) + +def _mntns_filter_func_writer(mntnsmap): + if not mntnsmap: + return """ + static inline int _mntns_filter() { + return 0; + } + """ + text = """ + #include + #include + #include + + /* see mountsnoop.py: + * XXX: struct mnt_namespace is defined in fs/mount.h, which is private + * to the VFS and not installed in any kernel-devel packages. So, let's + * duplicate the important part of the definition. There are actually + * more members in the real struct, but we don't need them, and they're + * more likely to change. + */ + struct mnt_namespace { + atomic_t count; + struct ns_common ns; + }; + + BPF_TABLE_PINNED("hash", u64, u32, mount_ns_set, 1024, "MOUNT_NS_PATH"); + + static inline int _mntns_filter() { + struct task_struct *current_task; + current_task = (struct task_struct *)bpf_get_current_task(); + u64 ns_id = current_task->nsproxy->mnt_ns->ns.inum; + return mount_ns_set.lookup(&ns_id) == NULL; + } + """ + + return text.replace('MOUNT_NS_PATH', mntnsmap) + +def filter_by_containers(args): + filter_by_containers_text = """ + static inline int container_should_be_filtered() { + return _cgroup_filter() || _mntns_filter(); + } + """ + + cgroupmap_text = _cgroup_filter_func_writer(args.cgroupmap) + mntnsmap_text = _mntns_filter_func_writer(args.mntnsmap) + + return cgroupmap_text + mntnsmap_text + filter_by_containers_text diff --git a/src/python/bcc/libbcc.py b/src/python/bcc/libbcc.py index 4c992dda9..86ba5f2db 100644 --- a/src/python/bcc/libbcc.py +++ b/src/python/bcc/libbcc.py @@ -108,6 +108,12 @@ lib.bpf_detach_tracepoint.argtypes = [ct.c_char_p, ct.c_char_p] lib.bpf_attach_raw_tracepoint.restype = ct.c_int lib.bpf_attach_raw_tracepoint.argtypes = [ct.c_int, ct.c_char_p] +lib.bpf_attach_kfunc.restype = ct.c_int +lib.bpf_attach_kfunc.argtypes = [ct.c_int] +lib.bpf_attach_lsm.restype = ct.c_int +lib.bpf_attach_lsm.argtypes = [ct.c_int] +lib.bpf_has_kernel_btf.restype = ct.c_bool +lib.bpf_has_kernel_btf.argtypes = None lib.bpf_open_perf_buffer.restype = ct.c_void_p lib.bpf_open_perf_buffer.argtypes = [_RAW_CB_TYPE, _LOST_CB_TYPE, ct.py_object, ct.c_int, ct.c_int, ct.c_int] lib.bpf_open_perf_event.restype = ct.c_int @@ -129,6 +135,18 @@ lib.bpf_close_perf_event_fd.restype = ct.c_int lib.bpf_close_perf_event_fd.argtype = [ct.c_int] +_RINGBUF_CB_TYPE = ct.CFUNCTYPE(ct.c_int, ct.c_void_p, ct.c_void_p, ct.c_int) +lib.bpf_new_ringbuf.restype = ct.c_void_p +lib.bpf_new_ringbuf.argtypes = [ct.c_int, _RINGBUF_CB_TYPE, ct.c_void_p] +lib.bpf_free_ringbuf.restype = None +lib.bpf_free_ringbuf.argtypes = [ct.c_void_p] +lib.bpf_add_ringbuf.restype = ct.c_int +lib.bpf_add_ringbuf.argtypes = [ct.c_void_p, ct.c_int, _RINGBUF_CB_TYPE, ct.c_void_p] +lib.bpf_poll_ringbuf.restype = ct.c_int +lib.bpf_poll_ringbuf.argtypes = [ct.c_void_p, ct.c_int] +lib.bpf_consume_ringbuf.restype = ct.c_int +lib.bpf_consume_ringbuf.argtypes = [ct.c_void_p] + # bcc symbol helpers class bcc_symbol(ct.Structure): _fields_ = [ @@ -155,6 +173,7 @@ class bcc_symbol_option(ct.Structure): _fields_ = [ ('use_debug_file', ct.c_int), ('check_debug_file_crc', ct.c_int), + ('lazy_symbolize', ct.c_int), ('use_symbol_type', ct.c_uint), ] @@ -222,12 +241,18 @@ class bcc_symbol_option(ct.Structure): lib.bcc_usdt_enable_probe.restype = ct.c_int lib.bcc_usdt_enable_probe.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p] +lib.bcc_usdt_enable_fully_specified_probe.restype = ct.c_int +lib.bcc_usdt_enable_fully_specified_probe.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_char_p] + lib.bcc_usdt_genargs.restype = ct.c_char_p lib.bcc_usdt_genargs.argtypes = [ct.POINTER(ct.c_void_p), ct.c_int] lib.bcc_usdt_get_probe_argctype.restype = ct.c_char_p lib.bcc_usdt_get_probe_argctype.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_int] +lib.bcc_usdt_get_fully_specified_probe_argctype.restype = ct.c_char_p +lib.bcc_usdt_get_fully_specified_probe_argctype.argtypes = [ct.c_void_p, ct.c_char_p, ct.c_char_p, ct.c_int] + class bcc_usdt(ct.Structure): _fields_ = [ ('provider', ct.c_char_p), diff --git a/src/python/bcc/perf.py b/src/python/bcc/perf.py index 44b0128df..b1c13f72d 100644 --- a/src/python/bcc/perf.py +++ b/src/python/bcc/perf.py @@ -27,15 +27,19 @@ class perf_event_attr(ct.Structure): ('read_format', ct.c_ulong), ('flags', ct.c_ulong), ('wakeup_events', ct.c_uint), - ('IGNORE3', ct.c_uint), - ('IGNORE4', ct.c_ulong), - ('IGNORE5', ct.c_ulong), - ('IGNORE6', ct.c_ulong), - ('IGNORE7', ct.c_uint), - ('IGNORE8', ct.c_int), - ('IGNORE9', ct.c_ulong), - ('IGNORE10', ct.c_uint), - ('IGNORE11', ct.c_uint) + ('IGNORE3', ct.c_uint), # bp_type + ('IGNORE4', ct.c_ulong), # bp_addr + ('IGNORE5', ct.c_ulong), # bp_len + ('IGNORE6', ct.c_ulong), # branch_sample_type + ('IGNORE7', ct.c_ulong), # sample_regs_user + ('IGNORE8', ct.c_uint), # sample_stack_user + ('IGNORE9', ct.c_int), # clockid + ('IGNORE10', ct.c_ulong), # sample_regs_intr + ('IGNORE11', ct.c_uint), # aux_watermark + ('IGNORE12', ct.c_uint16), # sample_max_stack + ('IGNORE13', ct.c_uint16), # __reserved_2 + ('IGNORE14', ct.c_uint), # aux_sample_size + ('IGNORE15', ct.c_uint), # __reserved_3 ] # x86 specific, from arch/x86/include/generated/uapi/asm/unistd_64.h diff --git a/src/python/bcc/table.py b/src/python/bcc/table.py index 12ba1bf48..98a91febd 100644 --- a/src/python/bcc/table.py +++ b/src/python/bcc/table.py @@ -12,15 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -from collections import MutableMapping +from __future__ import print_function +try: + from collections.abc import MutableMapping +except ImportError: + from collections import MutableMapping import ctypes as ct from functools import reduce import multiprocessing import os import errno import re +import sys -from .libbcc import lib, _RAW_CB_TYPE, _LOST_CB_TYPE +from .libbcc import lib, _RAW_CB_TYPE, _LOST_CB_TYPE, _RINGBUF_CB_TYPE from .perf import Perf from .utils import get_online_cpus from .utils import get_possible_cpus @@ -44,6 +49,15 @@ BPF_MAP_TYPE_CPUMAP = 16 BPF_MAP_TYPE_XSKMAP = 17 BPF_MAP_TYPE_SOCKHASH = 18 +BPF_MAP_TYPE_CGROUP_STORAGE = 19 +BPF_MAP_TYPE_REUSEPORT_SOCKARRAY = 20 +BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = 21 +BPF_MAP_TYPE_QUEUE = 22 +BPF_MAP_TYPE_STACK = 23 +BPF_MAP_TYPE_SK_STORAGE = 24 +BPF_MAP_TYPE_DEVMAP_HASH = 25 +BPF_MAP_TYPE_STRUCT_OPS = 26 +BPF_MAP_TYPE_RINGBUF = 27 map_type_name = {BPF_MAP_TYPE_HASH: "HASH", BPF_MAP_TYPE_ARRAY: "ARRAY", @@ -62,7 +76,16 @@ BPF_MAP_TYPE_SOCKMAP: "SOCKMAP", BPF_MAP_TYPE_CPUMAP: "CPUMAP", BPF_MAP_TYPE_XSKMAP: "XSKMAP", - BPF_MAP_TYPE_SOCKHASH: "SOCKHASH",} + BPF_MAP_TYPE_SOCKHASH: "SOCKHASH", + BPF_MAP_TYPE_CGROUP_STORAGE: "CGROUP_STORAGE", + BPF_MAP_TYPE_REUSEPORT_SOCKARRAY: "REUSEPORT_SOCKARRAY", + BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE: "PERCPU_CGROUP_STORAGE", + BPF_MAP_TYPE_QUEUE: "QUEUE", + BPF_MAP_TYPE_STACK: "STACK", + BPF_MAP_TYPE_SK_STORAGE: "SK_STORAGE", + BPF_MAP_TYPE_DEVMAP_HASH: "DEVMAP_HASH", + BPF_MAP_TYPE_STRUCT_OPS: "STRUCT_OPS", + BPF_MAP_TYPE_RINGBUF: "RINGBUF",} stars_max = 40 log2_index_max = 65 @@ -149,6 +172,63 @@ def get_table_type_name(ttype): return "" +def _get_event_class(event_map): + ct_mapping = { 'char' : ct.c_char, + 's8' : ct.c_char, + 'unsigned char' : ct.c_ubyte, + 'u8' : ct.c_ubyte, + 'u8 *' : ct.c_char_p, + 'char *' : ct.c_char_p, + 'short' : ct.c_short, + 's16' : ct.c_short, + 'unsigned short' : ct.c_ushort, + 'u16' : ct.c_ushort, + 'int' : ct.c_int, + 's32' : ct.c_int, + 'enum' : ct.c_int, + 'unsigned int' : ct.c_uint, + 'u32' : ct.c_uint, + 'long' : ct.c_long, + 'unsigned long' : ct.c_ulong, + 'long long' : ct.c_longlong, + 's64' : ct.c_longlong, + 'unsigned long long': ct.c_ulonglong, + 'u64' : ct.c_ulonglong, + '__int128' : (ct.c_longlong * 2), + 'unsigned __int128' : (ct.c_ulonglong * 2), + 'void *' : ct.c_void_p } + + # handle array types e.g. "int [16] foo" + array_type = re.compile(r"(.+) \[([0-9]+)\]$") + + fields = [] + num_fields = lib.bpf_perf_event_fields(event_map.bpf.module, event_map._name) + i = 0 + while i < num_fields: + field = lib.bpf_perf_event_field(event_map.bpf.module, event_map._name, i).decode() + m = re.match(r"(.*)#(.*)", field) + field_name = m.group(1) + field_type = m.group(2) + + if re.match(r"enum .*", field_type): + field_type = "enum" + + m = array_type.match(field_type) + try: + if m: + fields.append((field_name, ct_mapping[m.group(1)] * int(m.group(2)))) + else: + fields.append((field_name, ct_mapping[field_type])) + except KeyError: + # Using print+sys.exit instead of raising exceptions, + # because exceptions are caught by the caller. + print("Type: '%s' not recognized. Please define the data with ctypes manually." + % field_type, file=sys.stderr) + sys.exit(1) + i += 1 + return type('', (ct.Structure,), {'_fields_': fields}) + + def Table(bpf, map_id, map_fd, keytype, leaftype, name, **kwargs): """Table(bpf, map_id, map_fd, keytype, leaftype, **kwargs) @@ -188,6 +268,10 @@ def Table(bpf, map_id, map_fd, keytype, leaftype, name, **kwargs): t = MapInMapArray(bpf, map_id, map_fd, keytype, leaftype) elif ttype == BPF_MAP_TYPE_HASH_OF_MAPS: t = MapInMapHash(bpf, map_id, map_fd, keytype, leaftype) + elif ttype == BPF_MAP_TYPE_QUEUE or ttype == BPF_MAP_TYPE_STACK: + t = QueueStack(bpf, map_id, map_fd, leaftype) + elif ttype == BPF_MAP_TYPE_RINGBUF: + t = RingBuf(bpf, map_id, map_fd, keytype, leaftype, name) if t == None: raise Exception("Unknown table type %d" % ttype) return t @@ -597,70 +681,16 @@ def __delitem__(self, key): lib.bpf_close_perf_event_fd(self._open_key_fds[key]) del self._open_key_fds[key] - def _get_event_class(self): - ct_mapping = { 'char' : ct.c_char, - 's8' : ct.c_char, - 'unsigned char' : ct.c_ubyte, - 'u8' : ct.c_ubyte, - 'u8 *' : ct.c_char_p, - 'char *' : ct.c_char_p, - 'short' : ct.c_short, - 's16' : ct.c_short, - 'unsigned short' : ct.c_ushort, - 'u16' : ct.c_ushort, - 'int' : ct.c_int, - 's32' : ct.c_int, - 'enum' : ct.c_int, - 'unsigned int' : ct.c_uint, - 'u32' : ct.c_uint, - 'long' : ct.c_long, - 'unsigned long' : ct.c_ulong, - 'long long' : ct.c_longlong, - 's64' : ct.c_longlong, - 'unsigned long long': ct.c_ulonglong, - 'u64' : ct.c_ulonglong, - '__int128' : (ct.c_longlong * 2), - 'unsigned __int128' : (ct.c_ulonglong * 2), - 'void *' : ct.c_void_p } - - # handle array types e.g. "int [16] foo" - array_type = re.compile(r"(.+) \[([0-9]+)\]$") - - fields = [] - num_fields = lib.bpf_perf_event_fields(self.bpf.module, self._name) - i = 0 - while i < num_fields: - field = lib.bpf_perf_event_field(self.bpf.module, self._name, i).decode() - m = re.match(r"(.*)#(.*)", field) - field_name = m.group(1) - field_type = m.group(2) - - if re.match(r"enum .*", field_type): - field_type = "enum" - - m = array_type.match(field_type) - try: - if m: - fields.append((field_name, ct_mapping[m.group(1)] * int(m.group(2)))) - else: - fields.append((field_name, ct_mapping[field_type])) - except KeyError: - print("Type: '%s' not recognized. Please define the data with ctypes manually." - % field_type) - exit() - i += 1 - return type('', (ct.Structure,), {'_fields_': fields}) - def event(self, data): """event(data) - When ring buffers are opened to receive custom perf event, + When perf buffers are opened to receive custom perf event, the underlying event data struct which is defined in C in the BPF program can be deduced via this function. This avoids redundant definitions in Python. """ if self._event_class == None: - self._event_class = self._get_event_class() + self._event_class = _get_event_class(self) return ct.cast(data, ct.POINTER(self._event_class)).contents def open_perf_buffer(self, callback, page_cnt=8, lost_cb=None): @@ -918,3 +948,108 @@ def __init__(self, *args, **kwargs): class MapInMapHash(HashTable): def __init__(self, *args, **kwargs): super(MapInMapHash, self).__init__(*args, **kwargs) + +class RingBuf(TableBase): + def __init__(self, *args, **kwargs): + super(RingBuf, self).__init__(*args, **kwargs) + self._ringbuf = None + self._event_class = None + + def __delitem(self, key): + pass + + def __del__(self): + pass + + def __len__(self): + return 0 + + def event(self, data): + """event(data) + + When ring buffers are opened to receive custom event, + the underlying event data struct which is defined in C in + the BPF program can be deduced via this function. This avoids + redundant definitions in Python. + """ + if self._event_class == None: + self._event_class = _get_event_class(self) + return ct.cast(data, ct.POINTER(self._event_class)).contents + + def open_ring_buffer(self, callback, ctx=None): + """open_ring_buffer(callback) + + Opens a ring buffer to receive custom event data from the bpf program. + The callback will be invoked for each event submitted from the kernel, + up to millions per second. + """ + + def ringbuf_cb_(ctx, data, size): + try: + ret = callback(ctx, data, size) + # Callback for ringbufs should _always_ return an integer. + # If the function the user registers does not, + # simply fall back to returning 0. + try: + ret = int(ret) + except: + ret = 0 + except IOError as e: + if e.errno == errno.EPIPE: + exit() + else: + raise e + return ret + + fn = _RINGBUF_CB_TYPE(ringbuf_cb_) + self.bpf._open_ring_buffer(self.map_fd, fn, ctx) + # keep a refcnt + self._cbs[0] = fn + +class QueueStack: + # Flag for map.push + BPF_EXIST = 2 + + def __init__(self, bpf, map_id, map_fd, leaftype): + self.bpf = bpf + self.map_id = map_id + self.map_fd = map_fd + self.Leaf = leaftype + self.ttype = lib.bpf_table_type_id(self.bpf.module, self.map_id) + self.flags = lib.bpf_table_flags_id(self.bpf.module, self.map_id) + + def leaf_sprintf(self, leaf): + buf = ct.create_string_buffer(ct.sizeof(self.Leaf) * 8) + res = lib.bpf_table_leaf_snprintf(self.bpf.module, self.map_id, buf, + len(buf), ct.byref(leaf)) + if res < 0: + raise Exception("Could not printf leaf") + return buf.value + + def leaf_scanf(self, leaf_str): + leaf = self.Leaf() + res = lib.bpf_table_leaf_sscanf(self.bpf.module, self.map_id, leaf_str, + ct.byref(leaf)) + if res < 0: + raise Exception("Could not scanf leaf") + return leaf + + def push(self, leaf, flags=0): + res = lib.bpf_update_elem(self.map_fd, None, ct.byref(leaf), flags) + if res < 0: + errstr = os.strerror(ct.get_errno()) + raise Exception("Could not push to table: %s" % errstr) + + def pop(self): + leaf = self.Leaf() + res = lib.bpf_lookup_and_delete(self.map_fd, None, ct.byref(leaf)) + if res < 0: + raise KeyError("Could not pop from table") + return leaf + + def peek(self): + leaf = self.Leaf() + res = lib.bpf_lookup_elem(self.map_fd, None, ct.byref(leaf)) + if res < 0: + raise KeyError("Could not peek table") + return leaf diff --git a/src/python/bcc/usdt.py b/src/python/bcc/usdt.py index 5fb1cda4d..67525c2b2 100644 --- a/src/python/bcc/usdt.py +++ b/src/python/bcc/usdt.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from __future__ import print_function import ctypes as ct import os, sys from .libbcc import lib, _USDT_CB, _USDT_PROBE_CB, \ @@ -146,23 +147,30 @@ def __del__(self): lib.bcc_usdt_close(self.context) def enable_probe(self, probe, fn_name): - if lib.bcc_usdt_enable_probe(self.context, probe.encode('ascii'), - fn_name.encode('ascii')) != 0: + probe_parts = probe.split(":", 1) + if len(probe_parts) == 1: + ret = lib.bcc_usdt_enable_probe( + self.context, probe.encode('ascii'), fn_name.encode('ascii')) + else: + (provider_name, probe_name) = probe_parts + ret = lib.bcc_usdt_enable_fully_specified_probe( + self.context, provider_name.encode('ascii'), probe_name.encode('ascii'), + fn_name.encode('ascii')) + + if ret != 0: raise USDTException( - ("failed to enable probe '%s'; a possible cause " + - "can be that the probe requires a pid to enable") % - probe - ) +"""Failed to enable USDT probe '%s': +the specified pid might not contain the given language's runtime, +or the runtime was not built with the required USDT probes. Look +for a configure flag similar to --with-dtrace or --enable-dtrace. +To check which probes are present in the process, use the tplist tool. +""" % probe) def enable_probe_or_bail(self, probe, fn_name): - if lib.bcc_usdt_enable_probe(self.context, probe.encode('ascii'), - fn_name.encode('ascii')) != 0: - print( -"""Error attaching USDT probes: the specified pid might not contain the -given language's runtime, or the runtime was not built with the required -USDT probes. Look for a configure flag similar to --with-dtrace or ---enable-dtrace. To check which probes are present in the process, use the -tplist tool.""") + try: + self.enable_probe(probe, fn_name) + except USDTException as e: + print(e, file=sys.stderr) sys.exit(1) def get_context(self): @@ -174,8 +182,14 @@ def get_text(self): return lib.bcc_usdt_genargs(ctx_array, 1).decode() def get_probe_arg_ctype(self, probe_name, arg_index): - return lib.bcc_usdt_get_probe_argctype( - self.context, probe_name.encode('ascii'), arg_index).decode() + probe_parts = probe_name.split(":", 1) + if len(probe_parts) == 1: + return lib.bcc_usdt_get_probe_argctype( + self.context, probe_name.encode('ascii'), arg_index).decode() + else: + (provider_name, probe) = probe_parts + return lib.bcc_usdt_get_fully_specified_probe_argctype( + self.context, provider_name.encode('ascii'), probe.encode('ascii'), arg_index).decode() def enumerate_probes(self): probes = [] diff --git a/src/python/bcc/utils.py b/src/python/bcc/utils.py index ef6f81d88..452054233 100644 --- a/src/python/bcc/utils.py +++ b/src/python/bcc/utils.py @@ -15,6 +15,7 @@ import sys import traceback import warnings +import re from .libbcc import lib @@ -97,3 +98,50 @@ def _assert_is_bytes(arg): return ArgString(arg).__bytes__() return arg +class StrcmpRewrite(object): + @staticmethod + def _generate_streq_function(string, probe_read_func, streq_functions, + probeid): + fname = "streq_%d" % probeid + streq_functions += """ +static inline bool %s(char const *ignored, uintptr_t str) { + char needle[] = %s; + char haystack[sizeof(needle)]; + %s(&haystack, sizeof(haystack), (void *)str); + for (int i = 0; i < sizeof(needle) - 1; ++i) { + if (needle[i] != haystack[i]) { + return false; + } + } + return true; +} + """ % (fname, string, probe_read_func) + return fname, streq_functions + + @staticmethod + def rewrite_expr(expr, bin_cmp, is_user, probe_user_list, streq_functions, + probeid): + if bin_cmp: + STRCMP_RE = 'STRCMP\\(\"([^"]+)\\",(.+?)\\)' + else: + STRCMP_RE = 'STRCMP\\(("[^"]+\\"),(.+?)\\)' + matches = re.finditer(STRCMP_RE, expr) + for match in matches: + string = match.group(1) + probe_read_func = "bpf_probe_read" + # if user probe or @user tag is specified, use + # bpf_probe_read_user for char* read + if is_user or \ + match.group(2).strip() in probe_user_list: + probe_read_func = "bpf_probe_read_user" + fname, streq_functions = StrcmpRewrite._generate_streq_function( + string, probe_read_func, + streq_functions, probeid) + probeid += 1 + expr = expr.replace("STRCMP", fname, 1) + rdict = { + "expr" : expr, + "streq_functions" : streq_functions, + "probeid" : probeid + } + return rdict diff --git a/tests/cc/CMakeLists.txt b/tests/cc/CMakeLists.txt index ebcef1c66..1f1334431 100644 --- a/tests/cc/CMakeLists.txt +++ b/tests/cc/CMakeLists.txt @@ -11,8 +11,8 @@ target_link_libraries(test_static bcc-static) add_test(NAME c_test_static COMMAND ${TEST_WRAPPER} c_test_static sudo ${CMAKE_CURRENT_BINARY_DIR}/test_static) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result -fPIC") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-result -fPIC") if(ENABLE_USDT) set(TEST_LIBBCC_SOURCES @@ -26,12 +26,14 @@ set(TEST_LIBBCC_SOURCES test_perf_event.cc test_pinned_table.cc test_prog_table.cc + test_queuestack_table.cc test_shared_table.cc test_sk_storage.cc test_sock_table.cc test_usdt_args.cc test_usdt_probes.cc - utils.cc) + utils.cc + test_parse_tracepoint.cc) add_executable(test_libbcc ${TEST_LIBBCC_SOURCES}) @@ -49,7 +51,7 @@ if(LIBBPF_FOUND) add_executable(test_libbcc_no_libbpf ${TEST_LIBBCC_SOURCES}) add_dependencies(test_libbcc_no_libbpf bcc-shared-no-libbpf) - target_link_libraries(test_libbcc_no_libbpf ${PROJECT_BINARY_DIR}/src/cc/libbcc-no-libbpf.so dl usdt_test_lib bpf) + target_link_libraries(test_libbcc_no_libbpf ${PROJECT_BINARY_DIR}/src/cc/libbcc-no-libbpf.so dl usdt_test_lib ${LIBBPF_LIBRARIES}) set_target_properties(test_libbcc_no_libbpf PROPERTIES INSTALL_RPATH ${PROJECT_BINARY_DIR}/src/cc) target_compile_definitions(test_libbcc_no_libbpf PRIVATE -DLIBBCC_NAME=\"libbcc-no-libbpf.so\") diff --git a/tests/cc/test_c_api.cc b/tests/cc/test_c_api.cc index d1977bfdd..e456840d1 100644 --- a/tests/cc/test_c_api.cc +++ b/tests/cc/test_c_api.cc @@ -205,8 +205,8 @@ TEST_CASE("resolve symbol addresses for a given PID", "[c_api]") { .use_debug_file = 1, .check_debug_file_crc = 1, .lazy_symbolize = 1, -#if defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - .use_symbol_type = BCC_SYM_ALL_TYPES | (1 << STT_PPC64LE_SYM_LEP), +#if defined(__powerpc64__) && defined(_CALL_ELF) && _CALL_ELF == 2 + .use_symbol_type = BCC_SYM_ALL_TYPES | (1 << STT_PPC64_ELFV2_SYM_LEP), #else .use_symbol_type = BCC_SYM_ALL_TYPES, #endif diff --git a/tests/cc/test_parse_tracepoint.cc b/tests/cc/test_parse_tracepoint.cc new file mode 100644 index 000000000..8191b03dd --- /dev/null +++ b/tests/cc/test_parse_tracepoint.cc @@ -0,0 +1,111 @@ +#include "BPF.h" +#include "catch.hpp" +#include "common.h" + +TEST_CASE("test tracepoint parser", "[TracepointParser]") { + std::string format = + "name: sys_enter_read\n" + "ID: 650\n" + "format:\n" + " field:unsigned short common_type; offset:0; size:2; signed:0;\n" + " field:unsigned char common_flags; offset:2; size:1; signed:0;\n" + " field:unsigned char common_preempt_count; offset:3; size:1; signed:0;\n" + " field:int common_pid; offset:4; size:4; signed:1;\n" + "\n" + " field:int __syscall_nr; offset:8; size:4; signed:1;\n" + " field:unsigned int fd; offset:16; size:8; signed:0;\n" + " field:char * buf; offset:24; size:8; signed:0;\n" + " field:size_t count; offset:32; size:8; signed:0;\n" + "\n" + "print fmt: \"fd: 0x%08lx, buf: 0x%08lx, count: 0x%08lx\", ((unsigned long)(REC->fd)), ((unsigned long)(REC->buf)), ((unsigned long)(REC->count))\n"; + + std::string expected = + "struct tracepoint__syscalls__sys_enter_read {\n" + "\tu64 __do_not_use__;\n" + "\tint __syscall_nr;\n" + "\tchar __pad_12;\n" + "\tchar __pad_13;\n" + "\tchar __pad_14;\n" + "\tchar __pad_15;\n" + "\tu64 fd;\n" + "\tchar * buf;\n" + "\tsize_t count;\n" + "};\n"; + + { + std::istringstream input(format); + std::string result = ebpf::parse_tracepoint(input, "syscalls", "sys_enter_read"); + REQUIRE(expected == result); + } + + format = + "name: signal_deliver\n" + "ID: 114\n" + "format:\n" + " field:unsigned short common_type; offset:0; size:2; signed:0;\n" + " field:unsigned char common_flags; offset:2; size:1; signed:0;\n" + " field:unsigned char common_preempt_count; offset:3; size:1; signed:0;\n" + " field:int common_pid; offset:4; size:4; signed:1;\n" + "\n" + " field:int sig; offset:8; size:4; signed:1;\n" + " field:int errno; offset:12; size:4; signed:1;\n" + " field:int code; offset:16; size:4; signed:1;\n" + " field:unsigned long sa_handler; offset:24; size:8; signed:0;\n" + " field:unsigned long sa_flags; offset:32; size:8; signed:0;\n" + "\n" + "print fmt: \"sig=%d errno=%d code=%d sa_handler=%lx sa_flags=%lx\", REC->sig, REC->errno, REC->code, REC->sa_handler, REC->sa_flags\n"; + + expected = + "struct tracepoint__signal__signal_deliver {\n" + "\tu64 __do_not_use__;\n" + "\tint sig;\n" + "\tint errno;\n" + "\tint code;\n" + "\tchar __pad_20;\n" + "\tchar __pad_21;\n" + "\tchar __pad_22;\n" + "\tchar __pad_23;\n" + "\tunsigned long sa_handler;\n" + "\tunsigned long sa_flags;\n" + "};\n"; + + { + std::istringstream input(format); + std::string result = ebpf::parse_tracepoint(input, "signal", "signal_deliver"); + REQUIRE(expected == result); + } + + format = + " field:unsigned short common_type; offset:0; size:2; signed:0;\n" + " field:unsigned char common_flags; offset:2; size:1; signed:0;\n" + " field:unsigned char common_preempt_count; offset:3; size:1; signed:0;\n" + " field:int common_pid; offset:4; size:4; signed:1;\n" + " field:unsigned char common_migrate_disable; offset:8; size:1; signed:0;\n" + " field:unsigned char common_preempt_lazy_count; offset:9; size:1; signed:0;\n" + + " field:char comm[16]; offset:12; size:16; signed:1;\n" + " field:pid_t pid; offset:28; size:4; signed:1;\n" + " field:int prio; offset:32; size:4; signed:1;\n" + " field:int success; offset:36; size:4; signed:1;\n" + " field:int target_cpu; offset:40; size:4; signed:1;\n"; + + expected = + "struct tracepoint__sched__sched_wakeup {\n" + "\tu64 __do_not_use__;\n" + "\tchar __do_not_use__8;\n" + "\tchar __do_not_use__9;\n" + "\tchar __pad_10;\n" + "\tchar __pad_11;\n" + "\tchar comm[16];\n" + "\tpid_t pid;\n" + "\tint prio;\n" + "\tint success;\n" + "\tint target_cpu;\n" + "};\n"; + + { + std::istringstream input(format); + std::string result = ebpf::parse_tracepoint(input, "sched", "sched_wakeup"); + REQUIRE(expected == result); + } +} diff --git a/tests/cc/test_queuestack_table.cc b/tests/cc/test_queuestack_table.cc new file mode 100644 index 000000000..a502d6124 --- /dev/null +++ b/tests/cc/test_queuestack_table.cc @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2020 Politecnico di Torino + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "BPF.h" +#include "catch.hpp" +#include +#include + +//Queue/Stack types are available only from 4.20 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) +TEST_CASE("queue table", "[queue_table]") { + const std::string BPF_PROGRAM = R"( + BPF_QUEUE(myqueue, int, 30); + )"; + + ebpf::BPF bpf; + ebpf::StatusTuple res(0); + res = bpf.init(BPF_PROGRAM); + REQUIRE(res.code() == 0); + + ebpf::BPFQueueStackTable t = bpf.get_queuestack_table("myqueue"); + + SECTION("standard methods") { + int i, val; + std::string value; + + // insert elements + for (i=0; i<30; i++) { + res = t.push_value(i); + REQUIRE(res.code() == 0); + } + + // checking head (peek) + res = t.get_head(val); + REQUIRE(res.code() == 0); + REQUIRE(val == 0); + + // retrieve elements + for (i=0; i<30; i++) { + res = t.pop_value(val); + REQUIRE(res.code() == 0); + REQUIRE(val == i); + } + // get non existing element + res = t.pop_value(val); + REQUIRE(res.code() != 0); + } +} + +TEST_CASE("stack table", "[stack_table]") { + const std::string BPF_PROGRAM = R"( + BPF_STACK(mystack, int, 30); + )"; + + ebpf::BPF bpf; + ebpf::StatusTuple res(0); + res = bpf.init(BPF_PROGRAM); + REQUIRE(res.code() == 0); + + ebpf::BPFQueueStackTable t = bpf.get_queuestack_table("mystack"); + + SECTION("standard methods") { + int i, val; + std::string value; + + // insert elements + for (i=0; i<30; i++) { + res = t.push_value(i); + REQUIRE(res.code() == 0); + } + + // checking head (peek) + res = t.get_head(val); + REQUIRE(res.code() == 0); + REQUIRE(val == 29); + + // retrieve elements + for (i=0; i<30; i++) { + res = t.pop_value(val); + REQUIRE(res.code() == 0); + REQUIRE( val == (30 - 1 - i)); + } + // get non existing element + res = t.pop_value(val); + REQUIRE(res.code() != 0); + } +} +#endif diff --git a/tests/cc/test_usdt_args.cc b/tests/cc/test_usdt_args.cc index db1f8c8e6..b8db58d25 100644 --- a/tests/cc/test_usdt_args.cc +++ b/tests/cc/test_usdt_args.cc @@ -52,6 +52,10 @@ static void verify_register(USDT::ArgumentParser &parser, int arg_size, REQUIRE(arg.scale() == scale); } +/* supported arches only */ +#if defined(__aarch64__) || defined(__powerpc64__) || \ + defined(__s390x__) || defined(__x86_64__) + TEST_CASE("test usdt argument parsing", "[usdt]") { SECTION("parse failure") { #ifdef __aarch64__ @@ -74,11 +78,14 @@ TEST_CASE("test usdt argument parsing", "[usdt]") { } SECTION("argument examples from the Python implementation") { #ifdef __aarch64__ - USDT::ArgumentParser_aarch64 parser("-1@x0 4@5 8@[x12] -4@[x31,-40]"); + USDT::ArgumentParser_aarch64 parser( + "-1@x0 4@5 8@[x12] -4@[x30,-40] -4@[x31,-40] 8@[sp, 120]"); verify_register(parser, -1, "regs[0]"); verify_register(parser, 4, 5); verify_register(parser, 8, "regs[12]", 0); - verify_register(parser, -4, "regs[31]", -40); + verify_register(parser, -4, "regs[30]", -40); + verify_register(parser, -4, "sp", -40); + verify_register(parser, 8, "sp", 120); #elif __powerpc64__ USDT::ArgumentParser_powerpc64 parser( "-4@0 8@%r0 8@i0 4@0(%r0) -2@0(0) " @@ -202,3 +209,5 @@ TEST_CASE("test usdt argument parsing", "[usdt]") { REQUIRE(parser.done()); } } + +#endif /* supported arches only */ diff --git a/tests/cc/test_usdt_probes.cc b/tests/cc/test_usdt_probes.cc index bcae53a61..5652b43f6 100644 --- a/tests/cc/test_usdt_probes.cc +++ b/tests/cc/test_usdt_probes.cc @@ -62,6 +62,16 @@ TEST_CASE("test finding a probe in our own process", "[usdt]") { } } +TEST_CASE("test probe's attributes with C++ API", "[usdt]") { + const ebpf::USDT u("/proc/self/exe", "libbcc_test", "sample_probe_1", "on_event"); + + REQUIRE(u.binary_path() == "/proc/self/exe"); + REQUIRE(u.pid() == -1); + REQUIRE(u.provider() == "libbcc_test"); + REQUIRE(u.name() == "sample_probe_1"); + REQUIRE(u.probe_func() == "on_event"); +} + TEST_CASE("test fine a probe in our own binary with C++ API", "[usdt]") { ebpf::BPF bpf; ebpf::USDT u("/proc/self/exe", "libbcc_test", "sample_probe_1", "on_event"); @@ -76,6 +86,20 @@ TEST_CASE("test fine a probe in our own binary with C++ API", "[usdt]") { REQUIRE(res.code() == 0); } +TEST_CASE("test fine probes in our own binary with C++ API", "[usdt]") { + ebpf::BPF bpf; + ebpf::USDT u("/proc/self/exe", "libbcc_test", "sample_probe_1", "on_event"); + + auto res = bpf.init("int on_event() { return 0; }", {}, {u}); + REQUIRE(res.ok()); + + res = bpf.attach_usdt_all(); + REQUIRE(res.ok()); + + res = bpf.detach_usdt_all(); + REQUIRE(res.ok()); +} + TEST_CASE("test fine a probe in our Process with C++ API", "[usdt]") { ebpf::BPF bpf; ebpf::USDT u(::getpid(), "libbcc_test", "sample_probe_1", "on_event"); @@ -362,5 +386,11 @@ TEST_CASE("test probing running Ruby process in namespaces", res = bpf.detach_usdt(u, ruby_pid); REQUIRE(res.code() == 0); + + struct bcc_symbol sym; + std::string pid_root= "/proc/" + std::to_string(ruby_pid) + "/root/"; + std::string module = pid_root + "usr/local/bin/ruby"; + REQUIRE(bcc_resolve_symname(module.c_str(), "rb_gc_mark", 0x0, ruby_pid, nullptr, &sym) == 0); + REQUIRE(std::string(sym.module).find(pid_root, 1) == std::string::npos); } } diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt index f323ac1b3..e7ce5c632 100644 --- a/tests/python/CMakeLists.txt +++ b/tests/python/CMakeLists.txt @@ -55,6 +55,8 @@ add_test(NAME py_array WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${TEST_WRAPPER} py_array sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_array.py) add_test(NAME py_uprobes WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${TEST_WRAPPER} py_uprobes sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_uprobes.py) +add_test(NAME py_uprobes_2 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${TEST_WRAPPER} py_uprobes2 sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_uprobes2.py) add_test(NAME py_test_stackid WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${TEST_WRAPPER} py_stackid sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_stackid.py) add_test(NAME py_test_tracepoint WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} @@ -85,3 +87,9 @@ add_test(NAME py_test_free_bcc_memory WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_D COMMAND ${TEST_WRAPPER} py_test_free_bcc_memory sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_free_bcc_memory.py) add_test(NAME py_test_rlimit WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${TEST_WRAPPER} py_test_rlimit sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_rlimit.py) +add_test(NAME py_test_lpm_trie WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${TEST_WRAPPER} py_test_lpm_trie sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_lpm_trie.py) +add_test(NAME py_ringbuf WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${TEST_WRAPPER} py_ringbuf sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_ringbuf.py) +add_test(NAME py_queuestack WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${TEST_WRAPPER} py_queuestack sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_queuestack.py) diff --git a/tests/python/test_clang.py b/tests/python/test_clang.py index 886eebedd..1006bee4b 100755 --- a/tests/python/test_clang.py +++ b/tests/python/test_clang.py @@ -78,9 +78,8 @@ def test_probe_read2(self): def test_probe_read3(self): text = """ -#define KBUILD_MODNAME "foo" #include -#define _(P) ({typeof(P) val = 0; bpf_probe_read(&val, sizeof(val), &P); val;}) +#define _(P) ({typeof(P) val = 0; bpf_probe_read_kernel(&val, sizeof(val), &P); val;}) int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { return _(TCP_SKB_CB(skb)->tcp_gso_size); } @@ -90,9 +89,8 @@ def test_probe_read3(self): def test_probe_read4(self): text = """ -#define KBUILD_MODNAME "foo" #include -#define _(P) ({typeof(P) val = 0; bpf_probe_read(&val, sizeof(val), &P); val;}) +#define _(P) ({typeof(P) val = 0; bpf_probe_read_kernel(&val, sizeof(val), &P); val;}) int test(struct pt_regs *ctx, struct sk_buff *skb) { return _(TCP_SKB_CB(skb)->tcp_gso_size) + skb->protocol; } @@ -102,7 +100,6 @@ def test_probe_read4(self): def test_probe_read_whitelist1(self): text = """ -#define KBUILD_MODNAME "foo" #include int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { // The below define is in net/tcp.h: @@ -111,7 +108,7 @@ def test_probe_read_whitelist1(self): // failing below statement // return TCP_SKB_CB(skb)->tcp_gso_size; u16 val = 0; - bpf_probe_read(&val, sizeof(val), &(TCP_SKB_CB(skb)->tcp_gso_size)); + bpf_probe_read_kernel(&val, sizeof(val), &(TCP_SKB_CB(skb)->tcp_gso_size)); return val; } """ @@ -120,7 +117,6 @@ def test_probe_read_whitelist1(self): def test_probe_read_whitelist2(self): text = """ -#define KBUILD_MODNAME "foo" #include int count_tcp(struct pt_regs *ctx, struct sk_buff *skb) { // The below define is in net/tcp.h: @@ -129,7 +125,7 @@ def test_probe_read_whitelist2(self): // failing below statement // return TCP_SKB_CB(skb)->tcp_gso_size; u16 val = 0; - bpf_probe_read(&val, sizeof(val), &(TCP_SKB_CB(skb)->tcp_gso_size)); + bpf_probe_read_kernel(&val, sizeof(val), &(TCP_SKB_CB(skb)->tcp_gso_size)); return val + skb->protocol; } """ @@ -323,6 +319,16 @@ def test_char_array_probe(self): return 0; }""") + @skipUnless(kernel_version_ge(5,7), "requires kernel >= 5.7") + def test_lsm_probe(self): + # Skip if the kernel is not compiled with CONFIG_BPF_LSM + if not BPF.support_lsm(): + return + b = BPF(text=""" +LSM_PROBE(bpf, int cmd, union bpf_attr *uattr, unsigned int size) { + return 0; +}""") + def test_probe_read_helper(self): b = BPF(text=""" #include @@ -1072,7 +1078,6 @@ def test_probe_read_tc_ctx(self): def test_probe_read_return(self): text = """ -#define KBUILD_MODNAME "foo" #include #include static inline unsigned char *my_skb_transport_header(struct sk_buff *skb) { @@ -1088,7 +1093,6 @@ def test_probe_read_return(self): def test_probe_read_multiple_return(self): text = """ -#define KBUILD_MODNAME "foo" #include #include static inline u64 error_function() { @@ -1109,7 +1113,6 @@ def test_probe_read_multiple_return(self): def test_probe_read_return_expr(self): text = """ -#define KBUILD_MODNAME "foo" #include #include static inline unsigned char *my_skb_transport_header(struct sk_buff *skb) { @@ -1125,7 +1128,6 @@ def test_probe_read_return_expr(self): def test_probe_read_return_call(self): text = """ -#define KBUILD_MODNAME "foo" #include #include static inline struct tcphdr *my_skb_transport_header(struct sk_buff *skb) { @@ -1144,7 +1146,7 @@ def test_no_probe_read_addrof(self): #include static inline int test_help(__be16 *addr) { __be16 val = 0; - bpf_probe_read(&val, sizeof(val), addr); + bpf_probe_read_kernel(&val, sizeof(val), addr); return val; } int test(struct pt_regs *ctx) { @@ -1280,5 +1282,53 @@ def test_packed_structure(self): self.assertEqual(st.a, 10) self.assertEqual(st.b, 20) + @skipUnless(kernel_version_ge(4,14), "requires kernel >= 4.14") + def test_jump_table(self): + text = """ +#include +#include +#include + +BPF_PERCPU_ARRAY(rwdf_100ms, u64, 400); + +int do_request(struct pt_regs *ctx, struct request *rq) { + u32 cmd_flags; + u64 base, dur, slot, now = 100000; + + if (!rq->start_time_ns) + return 0; + + if (!rq->rq_disk || rq->rq_disk->major != 5 || + rq->rq_disk->first_minor != 6) + return 0; + + cmd_flags = rq->cmd_flags; + switch (cmd_flags & REQ_OP_MASK) { + case REQ_OP_READ: + base = 0; + break; + case REQ_OP_WRITE: + base = 100; + break; + case REQ_OP_DISCARD: + base = 200; + break; + case REQ_OP_FLUSH: + base = 300; + break; + default: + return 0; + } + + dur = now - rq->start_time_ns; + slot = min_t(size_t, div_u64(dur, 100 * NSEC_PER_MSEC), 99); + rwdf_100ms.increment(base + slot); + + return 0; +} +""" + b = BPF(text=text) + fns = b.load_funcs(BPF.KPROBE) + if __name__ == "__main__": main() diff --git a/tests/python/test_lpm_trie.py b/tests/python/test_lpm_trie.py old mode 100644 new mode 100755 index 560cb4b6c..c95b9cedd --- a/tests/python/test_lpm_trie.py +++ b/tests/python/test_lpm_trie.py @@ -3,10 +3,23 @@ # Licensed under the Apache License, Version 2.0 (the "License") import ctypes as ct -import unittest +import distutils.version +import os +from unittest import main, skipUnless, TestCase from bcc import BPF from netaddr import IPAddress +def kernel_version_ge(major, minor): + # True if running kernel is >= X.Y + version = distutils.version.LooseVersion(os.uname()[2]).version + if version[0] > major: + return True + if version[0] < major: + return False + if minor and version[1] < minor: + return False + return True + class KeyV4(ct.Structure): _fields_ = [("prefixlen", ct.c_uint), ("data", ct.c_ubyte * 4)] @@ -15,10 +28,15 @@ class KeyV6(ct.Structure): _fields_ = [("prefixlen", ct.c_uint), ("data", ct.c_ushort * 8)] -class TestLpmTrie(unittest.TestCase): +@skipUnless(kernel_version_ge(4, 11), "requires kernel >= 4.11") +class TestLpmTrie(TestCase): def test_lpm_trie_v4(self): test_prog1 = """ - BPF_LPM_TRIE(trie, u64, int, 16); + struct key_v4 { + u32 prefixlen; + u32 data[4]; + }; + BPF_LPM_TRIE(trie, struct key_v4, int, 16); """ b = BPF(text=test_prog1) t = b["trie"] @@ -71,4 +89,4 @@ def test_lpm_trie_v6(self): v = t[k] if __name__ == "__main__": - unittest.main() + main() diff --git a/tests/python/test_queuestack.py b/tests/python/test_queuestack.py new file mode 100755 index 000000000..f103cb35c --- /dev/null +++ b/tests/python/test_queuestack.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python +# Copyright (c) PLUMgrid, Inc. +# Licensed under the Apache License, Version 2.0 (the "License") + +from bcc import BPF +import os +import distutils.version +import ctypes as ct +import random +import time +import subprocess +from unittest import main, TestCase, skipUnless + +def kernel_version_ge(major, minor): + # True if running kernel is >= X.Y + version = distutils.version.LooseVersion(os.uname()[2]).version + if version[0] > major: + return True + if version[0] < major: + return False + if minor and version[1] < minor: + return False + return True + +class TestQueueStack(TestCase): + @skipUnless(kernel_version_ge(4,20), "requires kernel >= 4.20") + def test_stack(self): + text = """ + BPF_STACK(stack, u64, 10); + """ + b = BPF(text=text) + stack = b['stack'] + + for i in range(10): + stack.push(ct.c_uint64(i)) + + with self.assertRaises(Exception): + stack.push(ct.c_uint(10)) + + assert stack.peek().value == 9 + + for i in reversed(range(10)): + assert stack.pop().value == i + + with self.assertRaises(KeyError): + stack.peek() + + with self.assertRaises(KeyError): + stack.pop() + + b.cleanup() + + @skipUnless(kernel_version_ge(4,20), "requires kernel >= 4.20") + def test_queue(self): + text = """ + BPF_QUEUE(queue, u64, 10); + """ + b = BPF(text=text) + queue = b['queue'] + + for i in range(10): + queue.push(ct.c_uint64(i)) + + with self.assertRaises(Exception): + queue.push(ct.c_uint(10)) + + assert queue.peek().value == 0 + + for i in range(10): + assert queue.pop().value == i + + with self.assertRaises(KeyError): + queue.peek() + + with self.assertRaises(KeyError): + queue.pop() + + b.cleanup() + +if __name__ == "__main__": + main() diff --git a/tests/python/test_ringbuf.py b/tests/python/test_ringbuf.py new file mode 100755 index 000000000..2c24eada1 --- /dev/null +++ b/tests/python/test_ringbuf.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python +# Copyright (c) PLUMgrid, Inc. +# Licensed under the Apache License, Version 2.0 (the "License") + +from bcc import BPF +import os +import distutils.version +import ctypes as ct +import random +import time +import subprocess +from unittest import main, TestCase, skipUnless + +def kernel_version_ge(major, minor): + # True if running kernel is >= X.Y + version = distutils.version.LooseVersion(os.uname()[2]).version + if version[0] > major: + return True + if version[0] < major: + return False + if minor and version[1] < minor: + return False + return True + +class TestRingbuf(TestCase): + @skipUnless(kernel_version_ge(5,8), "requires kernel >= 5.8") + def test_ringbuf_output(self): + self.counter = 0 + + class Data(ct.Structure): + _fields_ = [("ts", ct.c_ulonglong)] + + def cb(ctx, data, size): + self.assertEqual(size, ct.sizeof(Data)) + event = ct.cast(data, ct.POINTER(Data)).contents + self.counter += 1 + + text = """ +BPF_RINGBUF_OUTPUT(events, 8); +struct data_t { + u64 ts; +}; +int do_sys_nanosleep(void *ctx) { + struct data_t data = {bpf_ktime_get_ns()}; + events.ringbuf_output(&data, sizeof(data), 0); + return 0; +} +""" + b = BPF(text=text) + b.attach_kprobe(event=b.get_syscall_fnname("nanosleep"), + fn_name="do_sys_nanosleep") + b.attach_kprobe(event=b.get_syscall_fnname("clock_nanosleep"), + fn_name="do_sys_nanosleep") + b["events"].open_ring_buffer(cb) + subprocess.call(['sleep', '0.1']) + b.ring_buffer_poll() + self.assertGreater(self.counter, 0) + b.cleanup() + + @skipUnless(kernel_version_ge(5,8), "requires kernel >= 5.8") + def test_ringbuf_consume(self): + self.counter = 0 + + class Data(ct.Structure): + _fields_ = [("ts", ct.c_ulonglong)] + + def cb(ctx, data, size): + self.assertEqual(size, ct.sizeof(Data)) + event = ct.cast(data, ct.POINTER(Data)).contents + self.counter += 1 + + text = """ +BPF_RINGBUF_OUTPUT(events, 8); +struct data_t { + u64 ts; +}; +int do_sys_nanosleep(void *ctx) { + struct data_t data = {bpf_ktime_get_ns()}; + events.ringbuf_output(&data, sizeof(data), 0); + return 0; +} +""" + b = BPF(text=text) + b.attach_kprobe(event=b.get_syscall_fnname("nanosleep"), + fn_name="do_sys_nanosleep") + b.attach_kprobe(event=b.get_syscall_fnname("clock_nanosleep"), + fn_name="do_sys_nanosleep") + b["events"].open_ring_buffer(cb) + subprocess.call(['sleep', '0.1']) + b.ring_buffer_consume() + self.assertGreater(self.counter, 0) + b.cleanup() + + @skipUnless(kernel_version_ge(5,8), "requires kernel >= 5.8") + def test_ringbuf_submit(self): + self.counter = 0 + + class Data(ct.Structure): + _fields_ = [("ts", ct.c_ulonglong)] + + def cb(ctx, data, size): + self.assertEqual(size, ct.sizeof(Data)) + event = ct.cast(data, ct.POINTER(Data)).contents + self.counter += 1 + + text = """ +BPF_RINGBUF_OUTPUT(events, 8); +struct data_t { + u64 ts; +}; +int do_sys_nanosleep(void *ctx) { + struct data_t *data = events.ringbuf_reserve(sizeof(struct data_t)); + if (!data) + return 1; + data->ts = bpf_ktime_get_ns(); + events.ringbuf_submit(data, 0); + return 0; +} +""" + b = BPF(text=text) + b.attach_kprobe(event=b.get_syscall_fnname("nanosleep"), + fn_name="do_sys_nanosleep") + b.attach_kprobe(event=b.get_syscall_fnname("clock_nanosleep"), + fn_name="do_sys_nanosleep") + b["events"].open_ring_buffer(cb) + subprocess.call(['sleep', '0.1']) + b.ring_buffer_poll() + self.assertGreater(self.counter, 0) + b.cleanup() + + @skipUnless(kernel_version_ge(5,8), "requires kernel >= 5.8") + def test_ringbuf_discard(self): + self.counter = 0 + + class Data(ct.Structure): + _fields_ = [("ts", ct.c_ulonglong)] + + def cb(ctx, data, size): + self.assertEqual(size, ct.sizeof(Data)) + event = ct.cast(data, ct.POINTER(Data)).contents + self.counter += 1 + + text = """ +BPF_RINGBUF_OUTPUT(events, 8); +struct data_t { + u64 ts; +}; +int do_sys_nanosleep(void *ctx) { + struct data_t *data = events.ringbuf_reserve(sizeof(struct data_t)); + if (!data) + return 1; + data->ts = bpf_ktime_get_ns(); + events.ringbuf_discard(data, 0); + return 0; +} +""" + b = BPF(text=text) + b.attach_kprobe(event=b.get_syscall_fnname("nanosleep"), + fn_name="do_sys_nanosleep") + b.attach_kprobe(event=b.get_syscall_fnname("clock_nanosleep"), + fn_name="do_sys_nanosleep") + b["events"].open_ring_buffer(cb) + subprocess.call(['sleep', '0.1']) + b.ring_buffer_poll() + self.assertEqual(self.counter, 0) + b.cleanup() + +if __name__ == "__main__": + main() diff --git a/tests/python/test_tools_smoke.py b/tests/python/test_tools_smoke.py index 66fb666bf..9222e3766 100755 --- a/tests/python/test_tools_smoke.py +++ b/tests/python/test_tools_smoke.py @@ -74,6 +74,10 @@ def test_argdist(self): def test_bashreadline(self): self.run_with_int("bashreadline.py") + @skipUnless(kernel_version_ge(4,4), "requires kernel >= 4.4") + def test_bindsnoop(self): + self.run_with_int("bindsnoop.py") + def test_biolatency(self): self.run_with_duration("biolatency.py 1 1") diff --git a/tests/python/test_uprobes2.py b/tests/python/test_uprobes2.py new file mode 100755 index 000000000..6118754a6 --- /dev/null +++ b/tests/python/test_uprobes2.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# +# USAGE: test_uprobe2.py +# +# Copyright 2020 Facebook, Inc +# Licensed under the Apache License, Version 2.0 (the "License") + +from bcc import BPF +from unittest import main, TestCase +from subprocess import Popen, PIPE +from tempfile import NamedTemporaryFile + + +class TestUprobes(TestCase): + def setUp(self): + lib_text = b""" +__attribute__((__visibility__("default"))) void fun() +{ +} +""" + self.bpf_text = """ +int trace_fun_call(void *ctx) {{ + return 1; +}} +""" + # Compile and run the application + self.ftemp = NamedTemporaryFile(delete=False) + self.ftemp.close() + comp = Popen([ + "gcc", + "-x", "c", + "-shared", + "-Wl,-Ttext-segment,0x2000000", + "-o", self.ftemp.name, + "-" + ], stdin=PIPE) + comp.stdin.write(lib_text) + comp.stdin.close() + self.assertEqual(comp.wait(), 0) + + def test_attach1(self): + b = BPF(text=self.bpf_text) + b.attach_uprobe(name=self.ftemp.name, sym="fun", fn_name="trace_fun_call") + + +if __name__ == "__main__": + main() diff --git a/tests/python/test_usdt2.py b/tests/python/test_usdt2.py index a2f461106..c8c47fe6b 100755 --- a/tests/python/test_usdt2.py +++ b/tests/python/test_usdt2.py @@ -149,7 +149,7 @@ def print_event6(cpu, data, size): b["event6"].open_perf_buffer(print_event6) # three iterations to make sure we get some probes and have time to process them - for i in range(3): + for i in range(5): b.perf_buffer_poll() # note that event1 and event4 do not really fire, so their state should be 0 diff --git a/tests/python/test_usdt3.py b/tests/python/test_usdt3.py index 9a40a5ae5..61c1b54ca 100755 --- a/tests/python/test_usdt3.py +++ b/tests/python/test_usdt3.py @@ -20,6 +20,7 @@ def setUp(self): static inline void record_val(int val) { FOLLY_SDT(test, probe, val); + FOLLY_SDT(test_dup_name, probe, val); } extern void record_a(int val); @@ -110,7 +111,7 @@ def _create_file(name, text): def test_attach1(self): # enable USDT probe from given PID and verifier generated BPF programs u = USDT(pid=int(self.app.pid)) - u.enable_probe(probe="probe", fn_name="do_trace") + u.enable_probe(probe="test:probe", fn_name="do_trace") b = BPF(text=self.bpf_text, usdt_contexts=[u]) # processing events diff --git a/tools/argdist.py b/tools/argdist.py index 695b5b3c8..88da0d841 100755 --- a/tools/argdist.py +++ b/tools/argdist.py @@ -9,7 +9,7 @@ # Licensed under the Apache License, Version 2.0 (the "License") # Copyright (C) 2016 Sasha Goldshtein. -from bcc import BPF, USDT +from bcc import BPF, USDT, StrcmpRewrite from time import sleep, strftime import argparse import re @@ -41,6 +41,10 @@ def _parse_signature(self): param_type = param[0:index + 1].strip() param_name = param[index + 1:].strip() self.param_types[param_name] = param_type + # Maintain list of user params. Then later decide to + # switch to bpf_probe_read_kernel or bpf_probe_read_user. + if "__user" in param_type.split(): + self.probe_user_list.add(param_name) def _generate_entry(self): self.entry_probe_func = self.probe_func_name + "_entry" @@ -182,6 +186,8 @@ def __init__(self, tool, type, specifier): self.pid = tool.args.pid self.cumulative = tool.args.cumulative or False self.raw_spec = specifier + self.probe_user_list = set() + self.bin_cmp = False self._validate_specifier() spec_and_label = specifier.split('#') @@ -250,32 +256,16 @@ def _enable_usdt_probe(self): self.usdt_ctx.enable_probe( self.function, self.probe_func_name) - def _generate_streq_function(self, string): - fname = "streq_%d" % Probe.streq_index - Probe.streq_index += 1 - self.streq_functions += """ -static inline bool %s(char const *ignored, char const *str) { - char needle[] = %s; - char haystack[sizeof(needle)]; - bpf_probe_read(&haystack, sizeof(haystack), (void *)str); - for (int i = 0; i < sizeof(needle) - 1; ++i) { - if (needle[i] != haystack[i]) { - return false; - } - } - return true; -} - """ % (fname, string) - return fname - def _substitute_exprs(self): def repl(expr): expr = self._substitute_aliases(expr) - matches = re.finditer('STRCMP\\(("[^"]+\\")', expr) - for match in matches: - string = match.group(1) - fname = self._generate_streq_function(string) - expr = expr.replace("STRCMP", fname, 1) + rdict = StrcmpRewrite.rewrite_expr(expr, + self.bin_cmp, self.library, + self.probe_user_list, self.streq_functions, + Probe.streq_index) + expr = rdict["expr"] + self.streq_functions = rdict["streq_functions"] + Probe.streq_index = rdict["probeid"] return expr.replace("$retval", "PT_REGS_RC(ctx)") for i in range(0, len(self.exprs)): self.exprs[i] = repl(self.exprs[i]) @@ -305,9 +295,14 @@ def _generate_usdt_arg_assignment(self, i): def _generate_field_assignment(self, i): text = self._generate_usdt_arg_assignment(i) if self._is_string(self.expr_types[i]): - return (text + " bpf_probe_read(&__key.v%d.s," + + if self.is_user or \ + self.exprs[i] in self.probe_user_list: + probe_readfunc = "bpf_probe_read_user" + else: + probe_readfunc = "bpf_probe_read_kernel" + return (text + " %s(&__key.v%d.s," + " sizeof(__key.v%d.s), (void *)%s);\n") % \ - (i, i, self.exprs[i]) + (probe_readfunc, i, i, self.exprs[i]) else: return text + " __key.v%d = %s;\n" % \ (i, self.exprs[i]) @@ -367,8 +362,8 @@ def generate_text(self): u32 __tgid = __pid_tgid >> 32; // upper 32 bits PID_FILTER PREFIX - if (!(FILTER)) return 0; KEY_EXPR + if (!(FILTER)) return 0; COLLECT return 0; } diff --git a/tools/argdist_example.txt b/tools/argdist_example.txt index 7098e56c5..9ddfad3d9 100644 --- a/tools/argdist_example.txt +++ b/tools/argdist_example.txt @@ -449,3 +449,12 @@ argdist -I 'kernel/sched/sched.h' \ in kernel/sched/sched.h which is in kernel source tree and not in kernel-devel package. So this command needs to run at the kernel source tree root directory so that the added header file can be found by the compiler. + +argdist -C 'p::do_sys_open(int dfd, const char __user *filename, int flags, + umode_t mode):char*:filename:STRCMP("sample.txt", filename)' + Trace open of the file "sample.txt". It should be noted that 'filename' + passed to the do_sys_open is a char * user pointer. Hence parameter + 'filename' should be tagged with __user for kprobes (const char __user + *filename). This information distinguishes if the 'filename' should be + copied from userspace to the bpf stack or from kernel space to the bpf + stack. diff --git a/tools/bashreadline.py b/tools/bashreadline.py index b7d98272f..ad9cfdc0a 100755 --- a/tools/bashreadline.py +++ b/tools/bashreadline.py @@ -52,7 +52,7 @@ return 0; pid = bpf_get_current_pid_tgid(); data.pid = pid; - bpf_probe_read(&data.str, sizeof(data.str), (void *)PT_REGS_RC(ctx)); + bpf_probe_read_user(&data.str, sizeof(data.str), (void *)PT_REGS_RC(ctx)); bpf_get_current_comm(&comm, sizeof(comm)); if (comm[0] == 'b' && comm[1] == 'a' && comm[2] == 's' && comm[3] == 'h' && comm[4] == 0 ) { diff --git a/tools/bindsnoop.py b/tools/bindsnoop.py new file mode 100755 index 000000000..e1472a40f --- /dev/null +++ b/tools/bindsnoop.py @@ -0,0 +1,503 @@ +#!/usr/bin/python +# +# bindsnoop Trace IPv4 and IPv6 binds()s. +# For Linux, uses BCC, eBPF. Embedded C. +# +# based on tcpconnect utility from Brendan Gregg's suite. +# +# USAGE: bindsnoop [-h] [-t] [-E] [-p PID] [-P PORT[,PORT ...]] [-w] +# [--count] [--cgroupmap mappath] [--mntnsmap mappath] +# +# bindsnoop reports socket options set before the bind call +# that would impact this system call behavior: +# SOL_IP IP_FREEBIND F.... +# SOL_IP IP_TRANSPARENT .T... +# SOL_IP IP_BIND_ADDRESS_NO_PORT ..N.. +# SOL_SOCKET SO_REUSEADDR ...R. +# SOL_SOCKET SO_REUSEPORT ....r +# +# SO_BINDTODEVICE interface is reported as "BOUND_IF" index +# +# This uses dynamic tracing of kernel functions, and will need to be updated +# to match kernel changes. +# +# Copyright (c) 2020-present Facebook. +# Licensed under the Apache License, Version 2.0 (the "License") +# +# 14-Feb-2020 Pavel Dubovitsky Created this. + +from __future__ import print_function, absolute_import, unicode_literals +from bcc import BPF, DEBUG_SOURCE +from bcc.containers import filter_by_containers +from bcc.utils import printb +import argparse +import re +from os import strerror +from socket import ( + inet_ntop, AF_INET, AF_INET6, __all__ as socket_all, __dict__ as socket_dct +) +from struct import pack +from time import sleep + +# arguments +examples = """examples: + ./bindsnoop # trace all TCP bind()s + ./bindsnoop -t # include timestamps + ./tcplife -w # wider columns (fit IPv6) + ./bindsnoop -p 181 # only trace PID 181 + ./bindsnoop -P 80 # only trace port 80 + ./bindsnoop -P 80,81 # only trace port 80 and 81 + ./bindsnoop -U # include UID + ./bindsnoop -u 1000 # only trace UID 1000 + ./bindsnoop -E # report bind errors + ./bindsnoop --count # count bind per src ip + ./bindsnoop --cgroupmap mappath # only trace cgroups in this BPF map + ./bindsnoop --mntnsmap mappath # only trace mount namespaces in the map + +it is reporting socket options set before the bins call +impacting system call behavior: + SOL_IP IP_FREEBIND F.... + SOL_IP IP_TRANSPARENT .T... + SOL_IP IP_BIND_ADDRESS_NO_PORT ..N.. + SOL_SOCKET SO_REUSEADDR ...R. + SOL_SOCKET SO_REUSEPORT ....r + + SO_BINDTODEVICE interface is reported as "IF" index +""" +parser = argparse.ArgumentParser( + description="Trace TCP binds", + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=examples) +parser.add_argument("-t", "--timestamp", action="store_true", + help="include timestamp on output") +parser.add_argument("-w", "--wide", action="store_true", + help="wide column output (fits IPv6 addresses)") +parser.add_argument("-p", "--pid", + help="trace this PID only") +parser.add_argument("-P", "--port", + help="comma-separated list of ports to trace.") +parser.add_argument("-E", "--errors", action="store_true", + help="include errors in the output.") +parser.add_argument("-U", "--print-uid", action="store_true", + help="include UID on output") +parser.add_argument("-u", "--uid", + help="trace this UID only") +parser.add_argument("--count", action="store_true", + help="count binds per src ip and port") +parser.add_argument("--cgroupmap", + help="trace cgroups in this BPF map only") +parser.add_argument("--mntnsmap", + help="trace mount namespaces in this BPF map only") +parser.add_argument("--ebpf", action="store_true", + help=argparse.SUPPRESS) +parser.add_argument("--debug-source", action="store_true", + help=argparse.SUPPRESS) +args = parser.parse_args() + +# define BPF program +bpf_text = """ +#include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtautological-compare" +#include +#pragma clang diagnostic pop +#include +#include +#include + +BPF_HASH(currsock, u32, struct socket *); + +// separate data structs for ipv4 and ipv6 +struct ipv4_bind_data_t { + u64 ts_us; + u32 pid; + u32 uid; + u64 ip; + u32 saddr; + u32 bound_dev_if; + int return_code; + u16 sport; + u8 socket_options; + u8 protocol; + char task[TASK_COMM_LEN]; +}; +BPF_PERF_OUTPUT(ipv4_bind_events); + +struct ipv6_bind_data_t { + // int128 would be aligned on 16 bytes boundary, better to go first + unsigned __int128 saddr; + u64 ts_us; + u32 pid; + u32 uid; + u64 ip; + u32 bound_dev_if; + int return_code; + u16 sport; + u8 socket_options; + u8 protocol; + char task[TASK_COMM_LEN]; +}; +BPF_PERF_OUTPUT(ipv6_bind_events); + +// separate flow keys per address family +struct ipv4_flow_key_t { + u32 saddr; + u16 sport; +}; +BPF_HASH(ipv4_count, struct ipv4_flow_key_t); + +struct ipv6_flow_key_t { + unsigned __int128 saddr; + u16 sport; +}; +BPF_HASH(ipv6_count, struct ipv6_flow_key_t); + +// bind options for event reporting +union bind_options { + u8 data; + struct { + u8 freebind:1; + u8 transparent:1; + u8 bind_address_no_port:1; + u8 reuseaddress:1; + u8 reuseport:1; + } fields; +}; + +// TODO: add reporting for the original bind arguments +int bindsnoop_entry(struct pt_regs *ctx, struct socket *socket) +{ + u64 pid_tgid = bpf_get_current_pid_tgid(); + u32 pid = pid_tgid >> 32; + u32 tid = pid_tgid; + FILTER_PID + + u32 uid = bpf_get_current_uid_gid(); + + FILTER_UID + + if (container_should_be_filtered()) { + return 0; + } + + // stash the sock ptr for lookup on return + currsock.update(&tid, &socket); + + return 0; +}; + + +static int bindsnoop_return(struct pt_regs *ctx, short ipver) +{ + int ret = PT_REGS_RC(ctx); + u64 pid_tgid = bpf_get_current_pid_tgid(); + u32 pid = pid_tgid >> 32; + u32 tid = pid_tgid; + + struct socket **skpp; + skpp = currsock.lookup(&tid); + if (skpp == 0) { + return 0; // missed entry + } + + int ignore_errors = 1; + FILTER_ERRORS + if (ret != 0 && ignore_errors) { + // failed to bind + currsock.delete(&tid); + return 0; + } + + // pull in details + struct socket *skp_ = *skpp; + struct sock *skp = skp_->sk; + + struct inet_sock *sockp = (struct inet_sock *)skp; + + u16 sport = 0; + bpf_probe_read_kernel(&sport, sizeof(sport), &sockp->inet_sport); + sport = ntohs(sport); + + FILTER_PORT + + union bind_options opts = {0}; + u8 bitfield; + // fetching freebind, transparent, and bind_address_no_port bitfields + // via the next struct member, rcv_tos + bitfield = (u8) *(&sockp->rcv_tos - 2) & 0xFF; + // IP_FREEBIND (sockp->freebind) + opts.fields.freebind = bitfield >> 2 & 0x01; + // IP_TRANSPARENT (sockp->transparent) + opts.fields.transparent = bitfield >> 5 & 0x01; + // IP_BIND_ADDRESS_NO_PORT (sockp->bind_address_no_port) + opts.fields.bind_address_no_port = *(&sockp->rcv_tos - 1) & 0x01; + + // SO_REUSEADDR and SO_REUSEPORT are bitfields that + // cannot be accessed directly, fetched via the next struct member, + // __sk_common.skc_bound_dev_if + bitfield = *((u8*)&skp->__sk_common.skc_bound_dev_if - 1); + // SO_REUSEADDR (skp->reuse) + // it is 4 bit, but we are interested in the lowest one + opts.fields.reuseaddress = bitfield & 0x0F; + // SO_REUSEPORT (skp->reuseport) + opts.fields.reuseport = bitfield >> 4 & 0x01; + + // workaround for reading the sk_protocol bitfield (from tcpaccept.py): + u8 protocol; + int gso_max_segs_offset = offsetof(struct sock, sk_gso_max_segs); + int sk_lingertime_offset = offsetof(struct sock, sk_lingertime); + if (sk_lingertime_offset - gso_max_segs_offset == 4) + // 4.10+ with little endian +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + protocol = *(u8 *)((u64)&skp->sk_gso_max_segs - 3); + else + // pre-4.10 with little endian + protocol = *(u8 *)((u64)&skp->sk_wmem_queued - 3); +#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + // 4.10+ with big endian + protocol = *(u8 *)((u64)&skp->sk_gso_max_segs - 1); + else + // pre-4.10 with big endian + protocol = *(u8 *)((u64)&skp->sk_wmem_queued - 1); +#else +# error "Fix your compiler's __BYTE_ORDER__?!" +#endif + + if (ipver == 4) { + IPV4_CODE + } else /* 6 */ { + IPV6_CODE + } + + currsock.delete(&tid); + + return 0; +} + +int bindsnoop_v4_return(struct pt_regs *ctx) +{ + return bindsnoop_return(ctx, 4); +} + +int bindsnoop_v6_return(struct pt_regs *ctx) +{ + return bindsnoop_return(ctx, 6); +} +""" + +struct_init = { + 'ipv4': { + 'count': """ + struct ipv4_flow_key_t flow_key = {}; + flow_key.saddr = skp->__sk_common.skc_rcv_saddr; + flow_key.sport = sport; + ipv4_count.increment(flow_key);""", + 'trace': """ + struct ipv4_bind_data_t data4 = {.pid = pid, .ip = ipver}; + data4.uid = bpf_get_current_uid_gid(); + data4.ts_us = bpf_ktime_get_ns() / 1000; + bpf_probe_read_kernel( + &data4.saddr, sizeof(data4.saddr), &sockp->inet_saddr); + data4.return_code = ret; + data4.sport = sport; + data4.bound_dev_if = skp->__sk_common.skc_bound_dev_if; + data4.socket_options = opts.data; + data4.protocol = protocol; + bpf_get_current_comm(&data4.task, sizeof(data4.task)); + ipv4_bind_events.perf_submit(ctx, &data4, sizeof(data4));""" + }, + 'ipv6': { + 'count': """ + struct ipv6_flow_key_t flow_key = {}; + bpf_probe_read_kernel(&flow_key.saddr, sizeof(flow_key.saddr), + skp->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); + flow_key.sport = sport; + ipv6_count.increment(flow_key);""", + 'trace': """ + struct ipv6_bind_data_t data6 = {.pid = pid, .ip = ipver}; + data6.uid = bpf_get_current_uid_gid(); + data6.ts_us = bpf_ktime_get_ns() / 1000; + bpf_probe_read_kernel(&data6.saddr, sizeof(data6.saddr), + skp->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); + data6.return_code = ret; + data6.sport = sport; + data6.bound_dev_if = skp->__sk_common.skc_bound_dev_if; + data6.socket_options = opts.data; + data6.protocol = protocol; + bpf_get_current_comm(&data6.task, sizeof(data6.task)); + ipv6_bind_events.perf_submit(ctx, &data6, sizeof(data6));""" + }, +} + +# code substitutions +if args.count: + bpf_text = bpf_text.replace("IPV4_CODE", struct_init['ipv4']['count']) + bpf_text = bpf_text.replace("IPV6_CODE", struct_init['ipv6']['count']) +else: + bpf_text = bpf_text.replace("IPV4_CODE", struct_init['ipv4']['trace']) + bpf_text = bpf_text.replace("IPV6_CODE", struct_init['ipv6']['trace']) + +if args.pid: + bpf_text = bpf_text.replace('FILTER_PID', + 'if (pid != %s) { return 0; }' % args.pid) +if args.port: + sports = [int(sport) for sport in args.port.split(',')] + sports_if = ' && '.join(['sport != %d' % sport for sport in sports]) + bpf_text = bpf_text.replace('FILTER_PORT', + 'if (%s) { currsock.delete(&tid); return 0; }' % sports_if) +if args.uid: + bpf_text = bpf_text.replace('FILTER_UID', + 'if (uid != %s) { return 0; }' % args.uid) +if args.errors: + bpf_text = bpf_text.replace('FILTER_ERRORS', 'ignore_errors = 0;') +bpf_text = filter_by_containers(args) + bpf_text +bpf_text = bpf_text.replace('FILTER_PID', '') +bpf_text = bpf_text.replace('FILTER_PORT', '') +bpf_text = bpf_text.replace('FILTER_UID', '') +bpf_text = bpf_text.replace('FILTER_ERRORS', '') + +# selecting output format - 80 characters or wide, fitting IPv6 addresses +header_fmt = "%8s %-12.12s %-4s %-15s %-5s %5s %2s" +output_fmt = b"%8d %-12.12s %-4.4s %-15.15s %5d %-5s %2d" +error_header_fmt = "%3s " +error_output_fmt = b"%3s " +error_value_fmt = str +if args.wide: + header_fmt = "%10s %-12.12s %-4s %-39s %-5s %5s %2s" + output_fmt = b"%10d %-12.12s %-4s %-39s %5d %-5s %2d" + error_header_fmt = "%-25s " + error_output_fmt = b"%-25s " + error_value_fmt = strerror + +if args.ebpf: + print(bpf_text) + exit() + +# L4 protocol resolver +class L4Proto: + def __init__(self): + self.num2str = {} + proto_re = re.compile("IPPROTO_(.*)") + for attr in socket_all: + proto_match = proto_re.match(attr) + if proto_match: + self.num2str[socket_dct[attr]] = proto_match.group(1) + + def proto2str(self, proto): + return self.num2str.get(proto, "UNKNOWN") + +l4 = L4Proto() + +# bind options: +# SOL_IP IP_FREEBIND F.... +# SOL_IP IP_TRANSPARENT .T... +# SOL_IP IP_BIND_ADDRESS_NO_PORT ..N.. +# SOL_SOCKET SO_REUSEADDR ...R. +# SOL_SOCKET SO_REUSEPORT ....r +def opts2str(bitfield): + str_options = "" + bit = 1 + for opt in "FTNRr": + str_options += opt if bitfield & bit else "." + bit *= 2 + return str_options.encode() + + +# process events +def print_ipv4_bind_event(cpu, data, size): + event = b["ipv4_bind_events"].event(data) + global start_ts + if args.timestamp: + if start_ts == 0: + start_ts = event.ts_us + printb(b"%-9.6f " % ((float(event.ts_us) - start_ts) / 1000000), nl="") + if args.print_uid: + printb(b"%6d " % event.uid, nl="") + if args.errors: + printb( + error_output_fmt % error_value_fmt(event.return_code).encode(), + nl="", + ) + printb(output_fmt % (event.pid, event.task, + l4.proto2str(event.protocol).encode(), + inet_ntop(AF_INET, pack("I", event.saddr)).encode(), + event.sport, opts2str(event.socket_options), event.bound_dev_if)) + + +def print_ipv6_bind_event(cpu, data, size): + event = b["ipv6_bind_events"].event(data) + global start_ts + if args.timestamp: + if start_ts == 0: + start_ts = event.ts_us + printb(b"%-9.6f " % ((float(event.ts_us) - start_ts) / 1000000), nl="") + if args.print_uid: + printb(b"%6d " % event.uid, nl="") + if args.errors: + printb( + error_output_fmt % error_value_fmt(event.return_code).encode(), + nl="", + ) + printb(output_fmt % (event.pid, event.task, + l4.proto2str(event.protocol).encode(), + inet_ntop(AF_INET6, event.saddr).encode(), + event.sport, opts2str(event.socket_options), event.bound_dev_if)) + + +def depict_cnt(counts_tab, l3prot='ipv4'): + for k, v in sorted( + counts_tab.items(), key=lambda counts: counts[1].value, reverse=True + ): + depict_key = "" + if l3prot == 'ipv4': + depict_key = "%-32s %20s" % ( + (inet_ntop(AF_INET, pack('I', k.saddr))), k.sport + ) + else: + depict_key = "%-32s %20s" % ( + (inet_ntop(AF_INET6, k.saddr)), k.sport + ) + print("%s %-10d" % (depict_key, v.value)) + + +# initialize BPF +b = BPF(text=bpf_text) +b.attach_kprobe(event="inet_bind", fn_name="bindsnoop_entry") +b.attach_kprobe(event="inet6_bind", fn_name="bindsnoop_entry") +b.attach_kretprobe(event="inet_bind", fn_name="bindsnoop_v4_return") +b.attach_kretprobe(event="inet6_bind", fn_name="bindsnoop_v6_return") + +print("Tracing binds ... Hit Ctrl-C to end") +if args.count: + try: + while 1: + sleep(99999999) + except KeyboardInterrupt: + pass + + # header + print("\n%-32s %20s %-10s" % ( + "LADDR", "LPORT", "BINDS")) + depict_cnt(b["ipv4_count"]) + depict_cnt(b["ipv6_count"], l3prot='ipv6') +# read events +else: + # header + if args.timestamp: + print("%-9s " % ("TIME(s)"), end="") + if args.print_uid: + print("%6s " % ("UID"), end="") + if args.errors: + print(error_header_fmt % ("RC"), end="") + print(header_fmt % ("PID", "COMM", "PROT", "ADDR", "PORT", "OPTS", "IF")) + + start_ts = 0 + + # read events + b["ipv4_bind_events"].open_perf_buffer(print_ipv4_bind_event) + b["ipv6_bind_events"].open_perf_buffer(print_ipv6_bind_event) + while 1: + try: + b.perf_buffer_poll() + except KeyboardInterrupt: + exit() diff --git a/tools/bindsnoop_example.txt b/tools/bindsnoop_example.txt new file mode 100644 index 000000000..c7c513539 --- /dev/null +++ b/tools/bindsnoop_example.txt @@ -0,0 +1,116 @@ +Demonstrations of bindsnoop, the Linux eBPF/bcc version. + +This tool traces the kernel function performing socket binding and +print socket options set before the system call invocation that might +impact bind behavior and bound interface: +SOL_IP IP_FREEBIND F.... +SOL_IP IP_TRANSPARENT .T... +SOL_IP IP_BIND_ADDRESS_NO_PORT ..N.. +SOL_SOCKET SO_REUSEADDR ...R. +SOL_SOCKET SO_REUSEPORT ....r + + +# ./bindsnoop.py +Tracing binds ... Hit Ctrl-C to end +PID COMM PROT ADDR PORT OPTS IF +3941081 test_bind_op TCP 192.168.1.102 0 F.N.. 0 +3940194 dig TCP :: 62087 ..... 0 +3940219 dig UDP :: 48665 ..... 0 +3940893 Acceptor Thr TCP :: 35343 ...R. 0 + +The output shows four bind system calls: +two "test_bind_op" instances, one with IP_FREEBIND and IP_BIND_ADDRESS_NO_PORT +options, dig process called bind for TCP and UDP sockets, +and Acceptor called bind for TCP with SO_REUSEADDR option set. + + +The -t option prints a timestamp column + +# ./bindsnoop.py -t +TIME(s) PID COMM PROT ADDR PORT OPTS IF +0.000000 3956801 dig TCP :: 49611 ..... 0 +0.011045 3956822 dig UDP :: 56343 ..... 0 +2.310629 3956498 test_bind_op TCP 192.168.1.102 39609 F...r 0 + + +The -U option prints a UID column: + +# ./bindsnoop.py -U +Tracing binds ... Hit Ctrl-C to end + UID PID COMM PROT ADDR PORT OPTS IF +127072 3956498 test_bind_op TCP 192.168.1.102 44491 F...r 0 +127072 3960261 Acceptor Thr TCP :: 48869 ...R. 0 + 0 3960729 Acceptor Thr TCP :: 44637 ...R. 0 + 0 3959075 chef-client UDP :: 61722 ..... 0 + + +The -u option filtering UID: + +# ./bindsnoop.py -Uu 0 +Tracing binds ... Hit Ctrl-C to end + UID PID COMM PROT ADDR PORT OPTS IF + 0 3966330 Acceptor Thr TCP :: 39319 ...R. 0 + 0 3968044 python3.7 TCP ::1 59371 ..... 0 + 0 10224 fetch TCP 0.0.0.0 42091 ...R. 0 + + +The --cgroupmap option filters based on a cgroup set. +It is meant to be used with an externally created map. + +# ./bindsnoop.py --cgroupmap /sys/fs/bpf/test01 + +For more details, see docs/special_filtering.md + + +In order to track heavy bind usage one can use --count option +# ./bindsnoop.py --count +Tracing binds ... Hit Ctrl-C to end +LADDR LPORT BINDS +0.0.0.0 6771 4 +0.0.0.0 4433 4 +127.0.0.1 33665 1 + + +Usage message: +# ./bindsnoop.py -h +usage: bindsnoop.py [-h] [-t] [-w] [-p PID] [-P PORT] [-E] [-U] [-u UID] + [--count] [--cgroupmap CGROUPMAP] [--mntnsmap MNTNSMAP] + +Trace TCP binds + +optional arguments: + -h, --help show this help message and exit + -t, --timestamp include timestamp on output + -w, --wide wide column output (fits IPv6 addresses) + -p PID, --pid PID trace this PID only + -P PORT, --port PORT comma-separated list of ports to trace. + -E, --errors include errors in the output. + -U, --print-uid include UID on output + -u UID, --uid UID trace this UID only + --count count binds per src ip and port + --cgroupmap CGROUPMAP + trace cgroups in this BPF map only + +examples: + ./bindsnoop # trace all TCP bind()s + ./bindsnoop -t # include timestamps + ./bindsnoop -w # wider columns (fit IPv6) + ./bindsnoop -p 181 # only trace PID 181 + ./bindsnoop -P 80 # only trace port 80 + ./bindsnoop -P 80,81 # only trace port 80 and 81 + ./bindsnoop -U # include UID + ./bindsnoop -u 1000 # only trace UID 1000 + ./bindsnoop -E # report bind errors + ./bindsnoop --count # count bind per src ip + ./bindsnoop --cgroupmap mappath # only trace cgroups in this BPF map + ./bindsnoop --mntnsmap mappath # only trace mount namespaces in the map + + it is reporting socket options set before the bins call + impacting system call behavior: + SOL_IP IP_FREEBIND F.... + SOL_IP IP_TRANSPARENT .T... + SOL_IP IP_BIND_ADDRESS_NO_PORT ..N.. + SOL_SOCKET SO_REUSEADDR ...R. + SOL_SOCKET SO_REUSEPORT ....r + + SO_BINDTODEVICE interface is reported as "IF" index diff --git a/tools/biolatency.py b/tools/biolatency.py index 86d994370..c608dcb5d 100755 --- a/tools/biolatency.py +++ b/tools/biolatency.py @@ -112,7 +112,7 @@ bpf_text = bpf_text.replace('STORE', 'disk_key_t key = {.slot = bpf_log2l(delta)}; ' + 'void *__tmp = (void *)req->rq_disk->disk_name; ' + - 'bpf_probe_read(&key.disk, sizeof(key.disk), __tmp); ' + + 'bpf_probe_read_kernel(&key.disk, sizeof(key.disk), __tmp); ' + 'dist.increment(key);') elif args.flags: bpf_text = bpf_text.replace('STORAGE', diff --git a/tools/biolatpcts.py b/tools/biolatpcts.py new file mode 100755 index 000000000..7776a6f5e --- /dev/null +++ b/tools/biolatpcts.py @@ -0,0 +1,263 @@ +#!/usr/bin/python +# +# biolatpcts.py Monitor IO latency distribution of a block device. +# +# $ ./biolatpcts.py /dev/nvme0n1 +# nvme0n1 p1 p5 p10 p16 p25 p50 p75 p84 p90 p95 p99 p100 +# read 95us 175us 305us 515us 895us 985us 995us 1.5ms 2.5ms 3.5ms 4.5ms 10ms +# write 5us 5us 5us 15us 25us 135us 765us 855us 885us 895us 965us 1.5ms +# discard 5us 5us 5us 5us 135us 145us 165us 205us 385us 875us 1.5ms 2.5ms +# flush 5us 5us 5us 5us 5us 5us 5us 5us 5us 1.5ms 4.5ms 5.5ms +# +# Copyright (C) 2020 Tejun Heo +# Copyright (C) 2020 Facebook + +from __future__ import print_function +from bcc import BPF +from time import sleep +import argparse +import json +import sys +import os + +description = """ +Monitor IO latency distribution of a block device +""" + +parser = argparse.ArgumentParser(description = description, + formatter_class = argparse.ArgumentDefaultsHelpFormatter) +parser.add_argument('dev', metavar='DEV', type=str, + help='Target block device (/dev/DEVNAME, DEVNAME or MAJ:MIN)') +parser.add_argument('-i', '--interval', type=int, default=3, + help='Report interval') +parser.add_argument('-w', '--which', choices=['from-rq-alloc', 'after-rq-alloc', 'on-device'], + default='on-device', help='Which latency to measure') +parser.add_argument('-p', '--pcts', metavar='PCT,...', type=str, + default='1,5,10,16,25,50,75,84,90,95,99,100', + help='Percentiles to calculate') +parser.add_argument('-j', '--json', action='store_true', + help='Output in json') +parser.add_argument('--verbose', '-v', action='count', default = 0) + +bpf_source = """ +#include +#include +#include + +BPF_PERCPU_ARRAY(rwdf_100ms, u64, 400); +BPF_PERCPU_ARRAY(rwdf_1ms, u64, 400); +BPF_PERCPU_ARRAY(rwdf_10us, u64, 400); + +void kprobe_blk_account_io_done(struct pt_regs *ctx, struct request *rq, u64 now) +{ + unsigned int cmd_flags; + u64 dur; + size_t base, slot; + + if (!rq->__START_TIME_FIELD__) + return; + + if (!rq->rq_disk || + rq->rq_disk->major != __MAJOR__ || + rq->rq_disk->first_minor != __MINOR__) + return; + + cmd_flags = rq->cmd_flags; + switch (cmd_flags & REQ_OP_MASK) { + case REQ_OP_READ: + base = 0; + break; + case REQ_OP_WRITE: + base = 100; + break; + case REQ_OP_DISCARD: + base = 200; + break; + case REQ_OP_FLUSH: + base = 300; + break; + default: + return; + } + + dur = now - rq->__START_TIME_FIELD__; + + slot = min_t(size_t, div_u64(dur, 100 * NSEC_PER_MSEC), 99); + rwdf_100ms.increment(base + slot); + if (slot) + return; + + slot = min_t(size_t, div_u64(dur, NSEC_PER_MSEC), 99); + rwdf_1ms.increment(base + slot); + if (slot) + return; + + slot = min_t(size_t, div_u64(dur, 10 * NSEC_PER_USEC), 99); + rwdf_10us.increment(base + slot); +} +""" + +args = parser.parse_args() +args.pcts = args.pcts.split(',') +args.pcts.sort(key=lambda x: float(x)) + +try: + major = int(args.dev.split(':')[0]) + minor = int(args.dev.split(':')[1]) +except Exception: + if '/' in args.dev: + stat = os.stat(args.dev) + else: + stat = os.stat('/dev/' + args.dev) + + major = os.major(stat.st_rdev) + minor = os.minor(stat.st_rdev) + +if args.which == 'from-rq-alloc': + start_time_field = 'alloc_time_ns' +elif args.which == 'after-rq-alloc': + start_time_field = 'start_time_ns' +elif args.which == 'on-device': + start_time_field = 'io_start_time_ns' +else: + print("Invalid latency measurement {}".format(args.which)) + exit() + +bpf_source = bpf_source.replace('__START_TIME_FIELD__', start_time_field) +bpf_source = bpf_source.replace('__MAJOR__', str(major)) +bpf_source = bpf_source.replace('__MINOR__', str(minor)) + +bpf = BPF(text=bpf_source) +bpf.attach_kprobe(event="blk_account_io_done", fn_name="kprobe_blk_account_io_done") + +# times are in usecs +MSEC = 1000 +SEC = 1000 * 1000 + +cur_rwdf_100ms = bpf["rwdf_100ms"] +cur_rwdf_1ms = bpf["rwdf_1ms"] +cur_rwdf_10us = bpf["rwdf_10us"] + +last_rwdf_100ms = [0] * 400 +last_rwdf_1ms = [0] * 400 +last_rwdf_10us = [0] * 400 + +rwdf_100ms = [0] * 400 +rwdf_1ms = [0] * 400 +rwdf_10us = [0] * 400 + +io_type = ["read", "write", "discard", "flush"] + +def find_pct(req, total, slots, idx, counted): + while idx > 0: + idx -= 1 + if slots[idx] > 0: + counted += slots[idx] + if args.verbose > 1: + print('idx={} counted={} pct={:.1f} req={}' + .format(idx, counted, counted / total, req)) + if (counted / total) * 100 >= 100 - req: + break + return (idx, counted) + +def calc_lat_pct(req_pcts, total, lat_100ms, lat_1ms, lat_10us): + pcts = [0] * len(req_pcts) + + if total == 0: + return pcts + + data = [(100 * MSEC, lat_100ms), (MSEC, lat_1ms), (10, lat_10us)] + data_sel = 0 + idx = 100 + counted = 0 + + for pct_idx in reversed(range(len(req_pcts))): + req = float(req_pcts[pct_idx]) + while True: + last_counted = counted + (gran, slots) = data[data_sel] + (idx, counted) = find_pct(req, total, slots, idx, counted) + if args.verbose > 1: + print('pct_idx={} req={} gran={} idx={} counted={} total={}' + .format(pct_idx, req, gran, idx, counted, total)) + if idx > 0 or data_sel == len(data) - 1: + break + counted = last_counted + data_sel += 1 + idx = 100 + + pcts[pct_idx] = gran * idx + gran / 2 + + return pcts + +def format_usec(lat): + if lat > SEC: + return '{:.1f}s'.format(lat / SEC) + elif lat > 10 * MSEC: + return '{:.0f}ms'.format(lat / MSEC) + elif lat > MSEC: + return '{:.1f}ms'.format(lat / MSEC) + elif lat > 0: + return '{:.0f}us'.format(lat) + else: + return '-' + +# 0 interval can be used to test whether this script would run successfully. +if args.interval == 0: + sys.exit(0) + +while True: + sleep(args.interval) + + rwdf_total = [0] * 4; + + for i in range(400): + v = cur_rwdf_100ms.sum(i).value + rwdf_100ms[i] = max(v - last_rwdf_100ms[i], 0) + last_rwdf_100ms[i] = v + + v = cur_rwdf_1ms.sum(i).value + rwdf_1ms[i] = max(v - last_rwdf_1ms[i], 0) + last_rwdf_1ms[i] = v + + v = cur_rwdf_10us.sum(i).value + rwdf_10us[i] = max(v - last_rwdf_10us[i], 0) + last_rwdf_10us[i] = v + + rwdf_total[int(i / 100)] += rwdf_100ms[i] + + rwdf_lat = [] + for i in range(4): + left = i * 100 + right = left + 100 + rwdf_lat.append( + calc_lat_pct(args.pcts, rwdf_total[i], + rwdf_100ms[left:right], + rwdf_1ms[left:right], + rwdf_10us[left:right])) + + if args.verbose: + print('{:7} 100ms {}'.format(io_type[i], rwdf_100ms[left:right])) + print('{:7} 1ms {}'.format(io_type[i], rwdf_1ms[left:right])) + print('{:7} 10us {}'.format(io_type[i], rwdf_10us[left:right])) + + if args.json: + result = {} + for iot in range(4): + lats = {} + for pi in range(len(args.pcts)): + lats[args.pcts[pi]] = rwdf_lat[iot][pi] / SEC + result[io_type[iot]] = lats + print(json.dumps(result), flush=True) + else: + print('\n{:<7}'.format(os.path.basename(args.dev)), end='') + widths = [] + for pct in args.pcts: + widths.append(max(len(pct), 5)) + print(' {:>5}'.format(pct), end='') + print() + for iot in range(4): + print('{:7}'.format(io_type[iot]), end='') + for pi in range(len(rwdf_lat[iot])): + print(' {:>{}}'.format(format_usec(rwdf_lat[iot][pi]), widths[pi]), end='') + print() diff --git a/tools/biolatpcts_example.txt b/tools/biolatpcts_example.txt new file mode 100644 index 000000000..3176fcc0c --- /dev/null +++ b/tools/biolatpcts_example.txt @@ -0,0 +1,68 @@ +Demonstrations of biolatpcts, the Linux eBPF/bcc version. + + +biolatpcts traces block device I/O (disk I/O), and prints the latency +percentiles per I/O type. Example: + +# ./biolatpcts.py /dev/nvme0n1 +nvme0n1 p1 p5 p10 p16 p25 p50 p75 p84 p90 p95 p99 p100 +read 95us 175us 305us 515us 895us 985us 995us 1.5ms 2.5ms 3.5ms 4.5ms 10ms +write 5us 5us 5us 15us 25us 135us 765us 855us 885us 895us 965us 1.5ms +discard 5us 5us 5us 5us 135us 145us 165us 205us 385us 875us 1.5ms 2.5ms +flush 5us 5us 5us 5us 5us 5us 5us 5us 5us 1.5ms 4.5ms 5.5ms +[...] + +Unless changed with the -i option, the latency percentiles are printed every 3 +seconds. + + +Any number of custom percentiles can be requested with the -p option: + +# ./biolatpcts.py /dev/nvme0n1 -p 01,90.0,99.9,99.99,100.0 + +nvme0n1 01 90.0 99.9 99.99 100.0 +read 5us 4.5ms 16ms 22ms 26ms +write 15us 255us 365us 515us 2.5ms +discard - - - - - +flush 5us 5us 5us 5us 24ms +[...] + +Note that the target percentile strings are preserved as-is to facilitate +exact key matching when the output is consumed by another program. + + +When the output is consumed by another program, parsing can be tedious. The -j +option makes biolatpcts output results in json, one line per interval. + +# ./tools/biolatpcts.py /dev/nvme0n1 -j +{"read": {"1": 2.5e-05, "5": 3.5e-05, "10": 4.5e-05, "16": 0.000145, "25": 0.000195, "50": 0.000355, "75": 0.000605, "84": 0.000775, "90": 0.000965, "95": 0.0015, "99": 0.0025, "100": 0.0235}, "write": {"1": 5e-06, "5": 5e-06, "10": 5e-06, "16": 5e-06, "25": 1.5e-05, "50": 2.5e-05, "75": 4.5e-05, "84": 7.5e-05, "90": 0.000195, "95": 0.000665, "99": 0.0015, "100": 0.0035}, "discard": {"1": 0.0, "5": 0.0, "10": 0.0, "16": 0.0, "25": 0.0, "50": 0.0, "75": 0.0, "84": 0.0, "90": 0.0, "95": 0.0, "99": 0.0, "100": 0.0}, "flush": {"1": 0.0, "5": 0.0, "10": 0.0, "16": 0.0, "25": 0.0, "50": 0.0, "75": 0.0, "84": 0.0, "90": 0.0, "95": 0.0, "99": 0.0, "100": 0.0}} +[...] + + +By default biolatpcts measures the duration each IO was on the device. It can +be changed using the -w option. + + +USAGE message: + +usage: biolatpcts.py [-h] [-i INTERVAL] + [-w {from-rq-alloc,after-rq-alloc,on-device}] + [-p PCT,...] [-j] [--verbose] + DEV + +Monitor IO latency distribution of a block device + +positional arguments: + DEV Target block device (/dev/DEVNAME, DEVNAME or MAJ:MIN) + +optional arguments: + -h, --help show this help message and exit + -i INTERVAL, --interval INTERVAL + Report interval (default: 3) + -w {from-rq-alloc,after-rq-alloc,on-device}, --which {from-rq-alloc,after-rq-alloc,on-device} + Which latency to measure (default: on-device) + -p PCT,..., --pcts PCT,... + Percentiles to calculate (default: + 1,5,10,16,25,50,75,84,90,95,99,100) + -j, --json Output in json (default: False) + --verbose, -v diff --git a/tools/biosnoop.lua b/tools/biosnoop.lua index 705212ee7..3e0441e2a 100755 --- a/tools/biosnoop.lua +++ b/tools/biosnoop.lua @@ -84,13 +84,14 @@ int trace_req_completion(struct pt_regs *ctx, struct request *req) valp = infobyreq.lookup(&req); if (valp == 0) { data.len = req->__data_len; - strcpy(data.name,"?"); + data.name[0] = '?'; + data.name[1] = 0; } else { data.pid = valp->pid; data.len = req->__data_len; data.sector = req->__sector; - bpf_probe_read(&data.name, sizeof(data.name), valp->name); - bpf_probe_read(&data.disk_name, sizeof(data.disk_name), + bpf_probe_read_kernel(&data.name, sizeof(data.name), valp->name); + bpf_probe_read_kernel(&data.disk_name, sizeof(data.disk_name), req->rq_disk->disk_name); } @@ -125,7 +126,7 @@ return function(BPF, utils) bpf:attach_kprobe{event="blk_account_io_start", fn_name="trace_pid_start"} bpf:attach_kprobe{event="blk_start_request", fn_name="trace_req_start"} bpf:attach_kprobe{event="blk_mq_start_request", fn_name="trace_req_start"} - bpf:attach_kprobe{event="blk_account_io_completion", + bpf:attach_kprobe{event="blk_account_io_done", fn_name="trace_req_completion"} print("%-14s %-14s %-6s %-7s %-2s %-9s %-7s %7s" % {"TIME(s)", "COMM", "PID", diff --git a/tools/biosnoop.py b/tools/biosnoop.py index e6f708fae..5bbc77cde 100755 --- a/tools/biosnoop.py +++ b/tools/biosnoop.py @@ -108,7 +108,8 @@ valp = infobyreq.lookup(&req); if (valp == 0) { data.len = req->__data_len; - strcpy(data.name, "?"); + data.name[0] = '?'; + data.name[1] = 0; } else { if (##QUEUE##) { data.qdelta = *tsp - valp->ts; @@ -116,9 +117,9 @@ data.pid = valp->pid; data.len = req->__data_len; data.sector = req->__sector; - bpf_probe_read(&data.name, sizeof(data.name), valp->name); + bpf_probe_read_kernel(&data.name, sizeof(data.name), valp->name); struct gendisk *rq_disk = req->rq_disk; - bpf_probe_read(&data.disk_name, sizeof(data.disk_name), + bpf_probe_read_kernel(&data.disk_name, sizeof(data.disk_name), rq_disk->disk_name); } @@ -159,7 +160,7 @@ if BPF.get_kprobe_functions(b'blk_start_request'): b.attach_kprobe(event="blk_start_request", fn_name="trace_req_start") b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_req_start") -b.attach_kprobe(event="blk_account_io_completion", +b.attach_kprobe(event="blk_account_io_done", fn_name="trace_req_completion") # header diff --git a/tools/biotop.py b/tools/biotop.py index cad3759a9..d3a42ef78 100755 --- a/tools/biotop.py +++ b/tools/biotop.py @@ -178,7 +178,7 @@ def signal_ignore(signal_value, frame): if BPF.get_kprobe_functions(b'blk_start_request'): b.attach_kprobe(event="blk_start_request", fn_name="trace_req_start") b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_req_start") -b.attach_kprobe(event="blk_account_io_completion", +b.attach_kprobe(event="blk_account_io_done", fn_name="trace_req_completion") print('Tracing... Output every %d secs. Hit Ctrl-C to end' % interval) diff --git a/tools/bitesize.py b/tools/bitesize.py index f4cea7cdd..6ae71dcf8 100755 --- a/tools/bitesize.py +++ b/tools/bitesize.py @@ -30,7 +30,7 @@ TRACEPOINT_PROBE(block, block_rq_issue) { struct proc_key_t key = {.slot = bpf_log2l(args->bytes / 1024)}; - bpf_probe_read(&key.name, sizeof(key.name), args->comm); + bpf_probe_read_kernel(&key.name, sizeof(key.name), args->comm); dist.increment(key); return 0; } diff --git a/tools/btrfsslower.py b/tools/btrfsslower.py index b30880a78..9e46243a4 100755 --- a/tools/btrfsslower.py +++ b/tools/btrfsslower.py @@ -233,7 +233,7 @@ qs = de->d_name; if (qs.len == 0) return 0; - bpf_probe_read(&data.file, sizeof(data.file), (void *)qs.name); + bpf_probe_read_kernel(&data.file, sizeof(data.file), (void *)qs.name); // output events.perf_submit(ctx, &data, sizeof(data)); diff --git a/tools/cachetop.py b/tools/cachetop.py index 00b11a8c8..803e2a06b 100755 --- a/tools/cachetop.py +++ b/tools/cachetop.py @@ -136,7 +136,7 @@ def handle_loop(stdscr, args): stdscr.nodelay(1) # set default sorting field sort_field = FIELDS.index(DEFAULT_FIELD) - sort_reverse = False + sort_reverse = True # load BPF program bpf_text = """ diff --git a/tools/capable.py b/tools/capable.py index 69fef3de4..b89f2af9c 100755 --- a/tools/capable.py +++ b/tools/capable.py @@ -15,6 +15,7 @@ from os import getpid from functools import partial from bcc import BPF +from bcc.containers import filter_by_containers import errno import argparse from time import strftime @@ -27,6 +28,9 @@ ./capable -K # add kernel stacks to trace ./capable -U # add user-space stacks to trace ./capable -x # extra fields: show TID and INSETID columns + ./capable --unique # don't repeat stacks for the same pid or cgroup + ./capable --cgroupmap mappath # only trace cgroups in this BPF map + ./capable --mntnsmap mappath # only trace mount namespaces in the map """ parser = argparse.ArgumentParser( description="Trace security capability checks", @@ -42,6 +46,12 @@ help="output user stack trace") parser.add_argument("-x", "--extra", action="store_true", help="show extra fields in TID and INSETID columns") +parser.add_argument("--cgroupmap", + help="trace cgroups in this BPF map only") +parser.add_argument("--mntnsmap", + help="trace mount namespaces in this BPF map only") +parser.add_argument("--unique", action="store_true", + help="don't repeat stacks for the same pid or cgroup") args = parser.parse_args() debug = 0 @@ -87,6 +97,9 @@ 35: "CAP_WAKE_ALARM", 36: "CAP_BLOCK_SUSPEND", 37: "CAP_AUDIT_READ", + 38: "CAP_PERFMON", + 39: "CAP_BPF", + 40: "CAP_CHECKPOINT_RESTORE", } class Enum(set): @@ -122,6 +135,23 @@ def __getattr__(self, name): BPF_PERF_OUTPUT(events); +#if UNIQUESET +struct repeat_t { + int cap; + u32 tgid; +#if CGROUPSET + u64 cgroupid; +#endif +#ifdef KERNEL_STACKS + int kernel_stack_id; +#endif +#ifdef USER_STACKS + int user_stack_id; +#endif +}; +BPF_HASH(seen, struct repeat_t, u64); +#endif + #if defined(USER_STACKS) || defined(KERNEL_STACKS) BPF_STACK_TRACE(stacks, 2048); #endif @@ -147,6 +177,10 @@ def __getattr__(self, name): FILTER2 FILTER3 + if (container_should_be_filtered()) { + return 0; + } + u32 uid = bpf_get_current_uid_gid(); struct data_t data = {.tgid = tgid, .pid = pid, .uid = uid, .cap = cap, .audit = audit, .insetid = insetid}; #ifdef KERNEL_STACKS @@ -155,6 +189,28 @@ def __getattr__(self, name): #ifdef USER_STACKS data.user_stack_id = stacks.get_stackid(ctx, BPF_F_USER_STACK); #endif + +#if UNIQUESET + struct repeat_t repeat = {0,}; + repeat.cap = cap; +#if CGROUP_ID_SET + repeat.cgroupid = bpf_get_current_cgroup_id(); +#else + repeat.tgid = tgid; +#endif +#ifdef KERNEL_STACKS + repeat.kernel_stack_id = data.kernel_stack_id; +#endif +#ifdef USER_STACKS + repeat.user_stack_id = data.user_stack_id; +#endif + if (seen.lookup(&repeat) != NULL) { + return 0; + } + u64 zero = 0; + seen.update(&repeat, &zero); +#endif + bpf_get_current_comm(&data.comm, sizeof(data.comm)); events.perf_submit(ctx, &data, sizeof(data)); @@ -174,6 +230,11 @@ def __getattr__(self, name): bpf_text = bpf_text.replace('FILTER2', '') bpf_text = bpf_text.replace('FILTER3', 'if (pid == %s) { return 0; }' % getpid()) +bpf_text = filter_by_containers(args) + bpf_text +if args.unique: + bpf_text = bpf_text.replace('UNIQUESET', '1') +else: + bpf_text = bpf_text.replace('UNIQUESET', '0') if debug: print(bpf_text) diff --git a/tools/capable_example.txt b/tools/capable_example.txt index 28e44a5d6..1701b6a2e 100644 --- a/tools/capable_example.txt +++ b/tools/capable_example.txt @@ -4,7 +4,7 @@ Demonstrations of capable, the Linux eBPF/bcc version. capable traces calls to the kernel cap_capable() function, which does security capability checks, and prints details for each call. For example: -# ./capable.py +# ./capable.py TIME UID PID COMM CAP NAME AUDIT 22:11:23 114 2676 snmpd 12 CAP_NET_ADMIN 1 22:11:23 0 6990 run 24 CAP_SYS_RESOURCE 1 @@ -88,19 +88,40 @@ TIME UID PID COMM CAP NAME AUDIT Similarly, it is possible to include user-space stack with -U (or they can be used both at the same time to include user and kernel stack). +Some processes can do a lot of security capability checks, generating a lot of +ouput. In this case, the --unique option is useful to only print once the same +set of capability, pid (or cgroup if --cgroupmap is used) and kernel/user +stacks (if -K or -U are used). + +# ./capable.py -K -U --unique + +The --cgroupmap option filters based on a cgroup set. It is meant to be used +with an externally created map. + +# ./capable.py --cgroupmap /sys/fs/bpf/test01 + +For more details, see docs/special_filtering.md + + USAGE: # ./capable.py -h -usage: capable.py [-h] [-v] [-p PID] [-K] [-U] +usage: capable.py [-h] [-v] [-p PID] [-K] [-U] [-x] [--cgroupmap CGROUPMAP] + [--mntnsmap MNTNSMAP] [--unique] Trace security capability checks optional arguments: - -h, --help show this help message and exit - -v, --verbose include non-audit checks - -p PID, --pid PID trace this PID only - -K, --kernel-stack output kernel stack trace - -U, --user-stack output user stack trace + -h, --help show this help message and exit + -v, --verbose include non-audit checks + -p PID, --pid PID trace this PID only + -K, --kernel-stack output kernel stack trace + -U, --user-stack output user stack trace + -x, --extra show extra fields in TID and INSETID columns + --cgroupmap CGROUPMAP + trace cgroups in this BPF map only + --mntnsmap MNTNSMAP trace mount namespaces in this BPF map only + --unique don't repeat stacks for the same pid or cgroup examples: ./capable # trace capability checks @@ -108,3 +129,7 @@ examples: ./capable -p 181 # only trace PID 181 ./capable -K # add kernel stacks to trace ./capable -U # add user-space stacks to trace + ./capable -x # extra fields: show TID and INSETID columns + ./capable --unique # don't repeat stacks for the same pid or cgroup + ./capable --cgroupmap mappath # only trace cgroups in this BPF map + ./capable --mntnsmap mappath # only trace mount namespaces in the map diff --git a/tools/compactsnoop.py b/tools/compactsnoop.py index 7f9ce7ee3..71ef95b08 100755 --- a/tools/compactsnoop.py +++ b/tools/compactsnoop.py @@ -108,7 +108,7 @@ static inline int zone_to_nid_(struct zone *zone) { int node; - bpf_probe_read(&node, sizeof(node), &zone->node); + bpf_probe_read_kernel(&node, sizeof(node), &zone->node); return node; } #else @@ -122,7 +122,7 @@ static inline int zone_idx_(struct zone *zone) { struct pglist_data *zone_pgdat = NULL; - bpf_probe_read(&zone_pgdat, sizeof(zone_pgdat), &zone->zone_pgdat); + bpf_probe_read_kernel(&zone_pgdat, sizeof(zone_pgdat), &zone->zone_pgdat); return zone - zone_pgdat->node_zones; } @@ -132,13 +132,13 @@ u64 _watermark[NR_WMARK] = {}; u64 watermark_boost = 0; - bpf_probe_read(&_watermark, sizeof(_watermark), &zone->_watermark); - bpf_probe_read(&watermark_boost, sizeof(watermark_boost), + bpf_probe_read_kernel(&_watermark, sizeof(_watermark), &zone->_watermark); + bpf_probe_read_kernel(&watermark_boost, sizeof(watermark_boost), &zone->watermark_boost); valp->min = _watermark[WMARK_MIN] + watermark_boost; valp->low = _watermark[WMARK_LOW] + watermark_boost; valp->high = _watermark[WMARK_HIGH] + watermark_boost; - bpf_probe_read(&valp->free, sizeof(valp->free), + bpf_probe_read_kernel(&valp->free, sizeof(valp->free), &zone->vm_stat[NR_FREE_PAGES]); } #endif diff --git a/tools/dbslower.py b/tools/dbslower.py index 2f1b6a8b8..090d5218a 100755 --- a/tools/dbslower.py +++ b/tools/dbslower.py @@ -127,12 +127,12 @@ tmp.timestamp = bpf_ktime_get_ns(); #if defined(MYSQL56) - bpf_probe_read(&tmp.query, sizeof(tmp.query), (void*) PT_REGS_PARM3(ctx)); + bpf_probe_read_user(&tmp.query, sizeof(tmp.query), (void*) PT_REGS_PARM3(ctx)); #elif defined(MYSQL57) void* st = (void*) PT_REGS_PARM2(ctx); char* query; - bpf_probe_read(&query, sizeof(query), st); - bpf_probe_read(&tmp.query, sizeof(tmp.query), query); + bpf_probe_read_user(&query, sizeof(query), st); + bpf_probe_read_user(&tmp.query, sizeof(tmp.query), query); #else //USDT bpf_usdt_readarg(1, ctx, &tmp.query); #endif @@ -157,7 +157,13 @@ data.pid = pid >> 32; // only process id data.timestamp = tempp->timestamp; data.duration = delta; - bpf_probe_read(&data.query, sizeof(data.query), tempp->query); +#if defined(MYSQL56) || defined(MYSQL57) + // We already copied string to the bpf stack. Hence use bpf_probe_read_kernel() + bpf_probe_read_kernel(&data.query, sizeof(data.query), tempp->query); +#else + // USDT - we didnt copy string to the bpf stack before. + bpf_probe_read_user(&data.query, sizeof(data.query), tempp->query); +#endif events.perf_submit(ctx, &data, sizeof(data)); #ifdef THRESHOLD } @@ -188,7 +194,7 @@ args.pids = map(int, subprocess.check_output( "pidof postgres".split()).split()) - usdts = map(lambda pid: USDT(pid=pid), args.pids) + usdts = list(map(lambda pid: USDT(pid=pid), args.pids)) for usdt in usdts: usdt.enable_probe("query__start", "query_start") usdt.enable_probe("query__done", "query_end") diff --git a/tools/dbstat.py b/tools/dbstat.py index a89b09711..72af9f8d1 100755 --- a/tools/dbstat.py +++ b/tools/dbstat.py @@ -39,7 +39,7 @@ help="trace queries slower than this threshold (ms)") parser.add_argument("-u", "--microseconds", action="store_true", help="display query latencies in microseconds (default: milliseconds)") -parser.add_argument("-i", "--interval", type=int, default=99999999999, +parser.add_argument("-i", "--interval", type=int, default=99999999, help="print summary at this interval (seconds)") args = parser.parse_args() @@ -83,7 +83,7 @@ program = program.replace("FILTER", "" if args.threshold == 0 else "if (delta / 1000000 < %d) { return 0; }" % args.threshold) -usdts = map(lambda pid: USDT(pid=pid), args.pids) +usdts = list(map(lambda pid: USDT(pid=pid), args.pids)) for usdt in usdts: usdt.enable_probe("query__start", "probe_start") usdt.enable_probe("query__done", "probe_end") diff --git a/tools/dcsnoop.py b/tools/dcsnoop.py index 331ee30e1..7c50152f3 100755 --- a/tools/dcsnoop.py +++ b/tools/dcsnoop.py @@ -84,7 +84,7 @@ .type = type, }; bpf_get_current_comm(&data.comm, sizeof(data.comm)); - bpf_probe_read(&data.filename, sizeof(data.filename), name); + bpf_probe_read_kernel(&data.filename, sizeof(data.filename), name); events.perf_submit(ctx, &data, sizeof(data)); } @@ -102,7 +102,7 @@ struct entry_t entry = {}; const char *fname = name->name; if (fname) { - bpf_probe_read(&entry.name, sizeof(entry.name), (void *)fname); + bpf_probe_read_kernel(&entry.name, sizeof(entry.name), (void *)fname); } entrybypid.update(&pid, &entry); return 0; diff --git a/tools/deadlock.c b/tools/deadlock.c index a6a6d9155..b34a207dd 100644 --- a/tools/deadlock.c +++ b/tools/deadlock.c @@ -164,7 +164,7 @@ int trace_mutex_release(struct pt_regs *ctx, void *mutex_addr) { // invalid memory access on `leaf->held_mutexes[i]` below. On newer kernels, // we can avoid making this extra copy in `value` and use `leaf` directly. struct thread_to_held_mutex_leaf_t value = {}; - bpf_probe_read(&value, sizeof(struct thread_to_held_mutex_leaf_t), leaf); + bpf_probe_read_user(&value, sizeof(struct thread_to_held_mutex_leaf_t), leaf); #pragma unroll for (int i = 0; i < MAX_HELD_MUTEXES; ++i) { diff --git a/tools/deadlock.py b/tools/deadlock.py index 178487200..81122adb7 100755 --- a/tools/deadlock.py +++ b/tools/deadlock.py @@ -483,7 +483,7 @@ def main(): pid=args.pid, ) except Exception as e: - print('%s. Failed to attach to symbol: %s' % (str(e), symbol)) + print('%s. Failed to attach to symbol: %s\nIs --binary argument missing?' % (str(e), symbol)) sys.exit(1) for symbol in args.lock_symbols: try: diff --git a/tools/dirtop.py b/tools/dirtop.py new file mode 100755 index 000000000..ec6b077ba --- /dev/null +++ b/tools/dirtop.py @@ -0,0 +1,267 @@ +#!/usr/bin/python +# @lint-avoid-python-3-compatibility-imports +# +# dirtop file reads and writes by directory. +# For Linux, uses BCC, eBPF. +# +# USAGE: dirtop.py -d 'directory1,directory2' [-h] [-C] [-r MAXROWS] [interval] [count] +# +# This uses in-kernel eBPF maps to store per process summaries for efficiency. +# +# Copyright 2016 Netflix, Inc. +# Licensed under the Apache License, Version 2.0 (the "License") +# +# 13-Mar-2020 Erwan Velu Created dirtop from filetop +# 06-Feb-2016 Brendan Gregg Created filetop. + +from __future__ import print_function +from bcc import BPF +from time import sleep, strftime +import argparse +import os +import stat +from subprocess import call + +# arguments +examples = """examples: + ./dirtop -d '/hdfs/uuid/*/yarn' # directory I/O top, 1 second refresh + ./dirtop -d '/hdfs/uuid/*/yarn' -C # don't clear the screen + ./dirtop -d '/hdfs/uuid/*/yarn' 5 # 5 second summaries + ./dirtop -d '/hdfs/uuid/*/yarn' 5 10 # 5 second summaries, 10 times only + ./dirtop -d '/hdfs/uuid/*/yarn,/hdfs/uuid/*/data' # Running dirtop on two set of directories +""" +parser = argparse.ArgumentParser( + description="File reads and writes by process", + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=examples) +parser.add_argument("-C", "--noclear", action="store_true", + help="don't clear the screen") +parser.add_argument("-r", "--maxrows", default=20, + help="maximum rows to print, default 20") +parser.add_argument("-s", "--sort", default="all", + choices=["all", "reads", "writes", "rbytes", "wbytes"], + help="sort column, default all") +parser.add_argument("-p", "--pid", type=int, metavar="PID", dest="tgid", + help="trace this PID only") +parser.add_argument("interval", nargs="?", default=1, + help="output interval, in seconds") +parser.add_argument("count", nargs="?", default=99999999, + help="number of outputs") +parser.add_argument("--ebpf", action="store_true", + help=argparse.SUPPRESS) +parser.add_argument("-d", "--root-directories", type=str, required=True, dest="rootdirs", + help="select the directories to observe, separated by commas") +args = parser.parse_args() +interval = int(args.interval) +countdown = int(args.count) +maxrows = int(args.maxrows) +clear = not int(args.noclear) +debug = 0 + +# linux stats +loadavg = "/proc/loadavg" + +# define BPF program +bpf_text = """ +# include +# include + +// the key for the output summary +struct info_t { + unsigned long inode_id; +}; + +// the value of the output summary +struct val_t { + u64 reads; + u64 writes; + u64 rbytes; + u64 wbytes; +}; + +BPF_HASH(counts, struct info_t, struct val_t); + +static int do_entry(struct pt_regs *ctx, struct file *file, + char __user *buf, size_t count, int is_read) +{ + u32 tgid = bpf_get_current_pid_tgid() >> 32; + if (TGID_FILTER) + return 0; + + // The directory inodes we look at + u32 dir_ids[INODES_NUMBER] = DIRECTORY_INODES; + struct info_t info = {.inode_id = 0}; + struct dentry *pde = file->f_path.dentry; + for (int i=0; i<50; i++) { + // If we don't have any parent, we reached the root + if (!pde->d_parent) { + break; + } + pde = pde->d_parent; + // Does the files is part of the directory we look for + for(int dir_id=0; dir_idd_inode->i_ino == dir_ids[dir_id]) { + // Yes, let's export the top directory inode + info.inode_id = pde->d_inode->i_ino; + break; + } + } + } + // If we didn't found any, let's abort + if (info.inode_id == 0) { + return 0; + } + + struct val_t *valp, zero = {}; + valp = counts.lookup_or_try_init(&info, &zero); + if (valp) { + if (is_read) { + valp->reads++; + valp->rbytes += count; + } else { + valp->writes++; + valp->wbytes += count; + } + } + return 0; +} + +int trace_read_entry(struct pt_regs *ctx, struct file *file, + char __user *buf, size_t count) +{ + return do_entry(ctx, file, buf, count, 1); +} + +int trace_write_entry(struct pt_regs *ctx, struct file *file, + char __user *buf, size_t count) +{ + return do_entry(ctx, file, buf, count, 0); +} + +""" + + +def get_searched_ids(root_directories): + """Export the inode numbers of the selected directories.""" + from glob import glob + inode_to_path = {} + inodes = "{" + total_dirs = 0 + for root_directory in root_directories.split(','): + try: + searched_dirs = glob(root_directory, recursive=True) + except TypeError: + searched_dirs = glob(root_directory) + if not searched_dirs: + continue + + for mydir in searched_dirs: + total_dirs = total_dirs + 1 + # If we pass more than 15 dirs, ebpf program fails + if total_dirs > 15: + print('15 directories limit reached') + break + inode_id = os.lstat(mydir)[stat.ST_INO] + if inode_id in inode_to_path: + if inode_to_path[inode_id] == mydir: + print('Skipping {} as already considered'.format(mydir)) + else: + inodes = "{},{}".format(inodes, inode_id) + inode_to_path[inode_id] = mydir + print('Considering {} with inode_id {}'.format(mydir, inode_id)) + + inodes = inodes + '}' + if len(inode_to_path) == 0: + print('Cannot find any valid directory') + exit() + return inodes.replace('{,', '{'), inode_to_path + + +if args.tgid: + bpf_text = bpf_text.replace('TGID_FILTER', 'tgid != %d' % args.tgid) +else: + bpf_text = bpf_text.replace('TGID_FILTER', '0') + +inodes, inodes_to_path = get_searched_ids(args.rootdirs) +bpf_text = bpf_text.replace("DIRECTORY_INODES", inodes) +bpf_text = bpf_text.replace( + "INODES_NUMBER", '{}'.format(len(inodes.split(',')))) + +if debug or args.ebpf: + print(bpf_text) + if args.ebpf: + exit() + +# initialize BPF +b = BPF(text=bpf_text) +b.attach_kprobe(event="vfs_read", fn_name="trace_read_entry") +b.attach_kprobe(event="vfs_write", fn_name="trace_write_entry") + +DNAME_INLINE_LEN = 32 # linux/dcache.h + +print('Tracing... Output every %d secs. Hit Ctrl-C to end' % interval) + + +def sort_fn(counts): + """Define how to sort the columns""" + if args.sort == "all": + return (counts[1].rbytes + counts[1].wbytes + counts[1].reads + counts[1].writes) + else: + return getattr(counts[1], args.sort) + + +# output +exiting = 0 +while 1: + try: + sleep(interval) + except KeyboardInterrupt: + exiting = 1 + + # header + if clear: + call("clear") + else: + print() + with open(loadavg) as stats: + print("%-8s loadavg: %s" % (strftime("%H:%M:%S"), stats.read())) + + print("%-6s %-6s %-8s %-8s %s" % + ("READS", "WRITES", "R_Kb", "W_Kb", "PATH")) + # by-TID output + counts = b.get_table("counts") + line = 0 + reads = {} + writes = {} + reads_Kb = {} + writes_Kb = {} + for k, v in reversed(sorted(counts.items(), + key=sort_fn)): + # If it's the first time we see this inode + if k.inode_id not in reads: + # let's create a new entry + reads[k.inode_id] = v.reads + writes[k.inode_id] = v.writes + reads_Kb[k.inode_id] = v.rbytes / 1024 + writes_Kb[k.inode_id] = v.wbytes / 1024 + else: + # unless add the current performance metrics + # to the previous ones + reads[k.inode_id] += v.reads + writes[k.inode_id] += v.writes + reads_Kb[k.inode_id] += v.rbytes / 1024 + writes_Kb[k.inode_id] += v.wbytes / 1024 + + for node_id in reads: + print("%-6d %-6d %-8d %-8d %s" % + (reads[node_id], writes[node_id], reads_Kb[node_id], writes_Kb[node_id], inodes_to_path[node_id])) + line += 1 + if line >= maxrows: + break + + counts.clear() + + countdown -= 1 + if exiting or countdown == 0: + print("Detaching...") + exit() diff --git a/tools/dirtop_example.txt b/tools/dirtop_example.txt new file mode 100644 index 000000000..91b0b0338 --- /dev/null +++ b/tools/dirtop_example.txt @@ -0,0 +1,108 @@ +Demonstrations of dirtop, the Linux eBPF/bcc version. + + +dirtop shows reads and writes by directory. For example: + +# ./dirtop.py -d '/hdfs/uuid/*/yarn' +Tracing... Output every 1 secs. Hit Ctrl-C to end + +14:28:12 loadavg: 25.00 22.85 21.22 31/2921 66450 + +READS WRITES R_Kb W_Kb PATH +1030 2852 8 147341 /hdfs/uuid/c11da291-28de-4a77-873e-44bb452d238b/yarn +3308 2459 10980 24893 /hdfs/uuid/bf829d08-1455-45b8-81fa-05c3303e8c45/yarn +2227 7165 6484 11157 /hdfs/uuid/76dc0b77-e2fd-4476-818f-2b5c3c452396/yarn +1985 9576 6431 6616 /hdfs/uuid/99c178d5-a209-4af2-8467-7382c7f03c1b/yarn +1986 398 6474 6486 /hdfs/uuid/7d512fe7-b20d-464c-a75a-dbf8b687ee1c/yarn +764 3685 5 7069 /hdfs/uuid/250b21c8-1714-45fe-8c08-d45d0271c6bd/yarn +432 1603 259 6402 /hdfs/uuid/4a833770-767e-43b3-b696-dc98901bce26/yarn +993 5856 320 129 /hdfs/uuid/b94cbf3f-76b1-4ced-9043-02d450b9887c/yarn +612 5645 4 249 /hdfs/uuid/8138a53b-b942-44d3-82df-51575f1a3901/yarn +818 21 6 166 /hdfs/uuid/fada8004-53ff-48df-9396-165d8e42925b/yarn +174 23 1 171 /hdfs/uuid/d04fccd8-bc72-4ed9-bda4-c5b6893f1405/yarn +376 6281 2 97 /hdfs/uuid/0cc3683f-4800-4c73-8075-8d77dc7cf116/yarn +370 4588 2 96 /hdfs/uuid/a78f846a-58c4-4d10-a9f5-42f16a6134a0/yarn +190 6420 1 86 /hdfs/uuid/2c6a7223-cb18-4916-a1b6-8cd02bda1d31/yarn +178 123 1 17 /hdfs/uuid/b3b2a2ed-f6c1-4641-86bf-2989dd932411/yarn +[...] + +This shows various directories read and written when hadoop runs. +By default the output is sorted by the total read size in Kbytes (R_Kb). +Sorting order can be changed via -s option. +This is instrumenting at the VFS interface, so this is reads and writes that +may return entirely from the file system cache (page cache). + +While not printed, the average read and write size can be calculated by +dividing R_Kb by READS, and the same for writes. + +This script works by tracing the vfs_read() and vfs_write() functions using +kernel dynamic tracing, which instruments explicit read and write calls. If +files are read or written using another means (eg, via mmap()), then they +will not be visible using this tool. + +This should be useful for file system workload characterization when analyzing +the performance of applications. + +Note that tracing VFS level reads and writes can be a frequent activity, and +this tool can begin to cost measurable overhead at high I/O rates. + + +A -C option will stop clearing the screen, and -r with a number will restrict +the output to that many rows (20 by default). For example, not clearing +the screen and showing the top 5 only: + +# ./dirtop -d '/hdfs/uuid/*/yarn' -Cr 5 +Tracing... Output every 1 secs. Hit Ctrl-C to end + +14:29:08 loadavg: 25.66 23.42 21.51 17/2850 67167 + +READS WRITES R_Kb W_Kb PATH +100 8429 0 48243 /hdfs/uuid/b94cbf3f-76b1-4ced-9043-02d450b9887c/yarn +2066 4091 8176 26457 /hdfs/uuid/d04fccd8-bc72-4ed9-bda4-c5b6893f1405/yarn +10 2043 0 8172 /hdfs/uuid/b3b2a2ed-f6c1-4641-86bf-2989dd932411/yarn +38 1368 0 2652 /hdfs/uuid/a78f846a-58c4-4d10-a9f5-42f16a6134a0/yarn +86 19 0 123 /hdfs/uuid/c11da291-28de-4a77-873e-44bb452d238b/yarn + +14:29:09 loadavg: 25.66 23.42 21.51 15/2849 67170 + +READS WRITES R_Kb W_Kb PATH +1204 5619 4388 33767 /hdfs/uuid/b94cbf3f-76b1-4ced-9043-02d450b9887c/yarn +2208 3511 8744 22992 /hdfs/uuid/d04fccd8-bc72-4ed9-bda4-c5b6893f1405/yarn +62 4010 0 21181 /hdfs/uuid/8138a53b-b942-44d3-82df-51575f1a3901/yarn +22 2187 0 8748 /hdfs/uuid/b3b2a2ed-f6c1-4641-86bf-2989dd932411/yarn +74 1097 0 4388 /hdfs/uuid/4a833770-767e-43b3-b696-dc98901bce26/yarn + +[..] + + + +USAGE message: + +# ./dirtop.py -h +usage: dirtop.py [-h] [-C] [-r MAXROWS] [-s {all,reads,writes,rbytes,wbytes}] + [-p PID] -d ROOTDIRS + [interval] [count] + +File reads and writes by process + +positional arguments: + interval output interval, in seconds + count number of outputs + +optional arguments: + -h, --help show this help message and exit + -C, --noclear don't clear the screen + -r MAXROWS, --maxrows MAXROWS + maximum rows to print, default 20 + -s {all,reads,writes,rbytes,wbytes}, --sort {all,reads,writes,rbytes,wbytes} + sort column, default all + -p PID, --pid PID trace this PID only + -d ROOTDIRS, --root-directories ROOTDIRS + select the directories to observe, separated by commas + +examples: + ./dirtop -d '/hdfs/uuid/*/yarn' # directory I/O top, 1 second refresh + ./dirtop -d '/hdfs/uuid/*/yarn' -C # don't clear the screen + ./dirtop -d '/hdfs/uuid/*/yarn' 5 # 5 second summaries + ./dirtop -d '/hdfs/uuid/*/yarn' 5 10 # 5 second summaries, 10 times only + ./dirtop -d '/hdfs/uuid/*/yarn,/hdfs/uuid/*/data' # Running dirtop on two set of directories diff --git a/tools/drsnoop.py b/tools/drsnoop.py index c77f52064..e4ea92224 100755 --- a/tools/drsnoop.py +++ b/tools/drsnoop.py @@ -8,11 +8,11 @@ # direct reclaim begin, as well as a starting timestamp for calculating # latency. # -# Copyright (c) 2019 Ethercflow +# Copyright (c) 2019 Wenbo Zhang # Licensed under the Apache License, Version 2.0 (the "License") # -# 20-Feb-2019 Ethercflow Created this. -# 09-Mar-2019 Ethercflow Updated for show sys mem info. +# 20-Feb-2019 Wenbo Zhang Created this. +# 09-Mar-2019 Wenbo Zhang Updated for show sys mem info. from __future__ import print_function from bcc import ArgString, BPF @@ -128,7 +128,7 @@ def K(x): if (bpf_get_current_comm(&val.name, sizeof(val.name)) == 0) { val.id = id; val.ts = bpf_ktime_get_ns(); - bpf_probe_read(&val.vm_stat, sizeof(val.vm_stat), (const void *)%s); + bpf_probe_read_kernel(&val.vm_stat, sizeof(val.vm_stat), (const void *)%s); start.update(&id, &val); } return 0; @@ -150,8 +150,8 @@ def K(x): data.ts = ts / 1000; data.id = valp->id; data.uid = bpf_get_current_uid_gid(); - bpf_probe_read(&data.name, sizeof(data.name), valp->name); - bpf_probe_read(&data.vm_stat, sizeof(data.vm_stat), valp->vm_stat); + bpf_probe_read_kernel(&data.name, sizeof(data.name), valp->name); + bpf_probe_read_kernel(&data.vm_stat, sizeof(data.vm_stat), valp->vm_stat); data.nr_reclaimed = args->nr_reclaimed; events.perf_submit(args, &data, sizeof(data)); diff --git a/tools/execsnoop.py b/tools/execsnoop.py index b8b269808..53052d390 100755 --- a/tools/execsnoop.py +++ b/tools/execsnoop.py @@ -19,24 +19,47 @@ from __future__ import print_function from bcc import BPF +from bcc.containers import filter_by_containers from bcc.utils import ArgString, printb import bcc.utils as utils import argparse import re import time +import pwd from collections import defaultdict from time import strftime + +def parse_uid(user): + try: + result = int(user) + except ValueError: + try: + user_info = pwd.getpwnam(user) + except KeyError: + raise argparse.ArgumentTypeError( + "{0!r} is not valid UID or user entry".format(user)) + else: + return user_info.pw_uid + else: + # Maybe validate if UID < 0 ? + return result + + # arguments examples = """examples: ./execsnoop # trace all exec() syscalls ./execsnoop -x # include failed exec()s ./execsnoop -T # include time (HH:MM:SS) + ./execsnoop -U # include UID + ./execsnoop -u 1000 # only trace UID 1000 + ./execsnoop -u user # get user UID and trace only them ./execsnoop -t # include timestamps ./execsnoop -q # add "quotemarks" around arguments ./execsnoop -n main # only print command lines containing "main" ./execsnoop -l tpkg # only print command where arguments contains "tpkg" - ./opensnoop --cgroupmap ./mappath # only trace cgroups in this BPF map + ./execsnoop --cgroupmap mappath # only trace cgroups in this BPF map + ./execsnoop --mntnsmap mappath # only trace mount namespaces in the map """ parser = argparse.ArgumentParser( description="Trace exec() syscalls", @@ -50,6 +73,10 @@ help="include failed exec()s") parser.add_argument("--cgroupmap", help="trace cgroups in this BPF map only") +parser.add_argument("--mntnsmap", + help="trace mount namespaces in this BPF map only") +parser.add_argument("-u", "--uid", type=parse_uid, metavar='USER', + help="trace this UID only") parser.add_argument("-q", "--quote", action="store_true", help="Add quotemarks (\") around arguments." ) @@ -59,6 +86,8 @@ parser.add_argument("-l", "--line", type=ArgString, help="only print commands where arg contains this line (regex)") +parser.add_argument("-U", "--print-uid", action="store_true", + help="print UID column") parser.add_argument("--max-args", default="20", help="maximum number of arguments parsed and displayed, defaults to 20") parser.add_argument("--ebpf", action="store_true", @@ -81,20 +110,18 @@ struct data_t { u32 pid; // PID as in the userspace term (i.e. task->tgid in kernel) u32 ppid; // Parent PID as in the userspace term (i.e task->real_parent->tgid in kernel) + u32 uid; char comm[TASK_COMM_LEN]; enum event_type type; char argv[ARGSIZE]; int retval; }; -#if CGROUPSET -BPF_TABLE_PINNED("hash", u64, u64, cgroupset, 1024, "CGROUPPATH"); -#endif BPF_PERF_OUTPUT(events); static int __submit_arg(struct pt_regs *ctx, void *ptr, struct data_t *data) { - bpf_probe_read(data->argv, sizeof(data->argv), ptr); + bpf_probe_read_user(data->argv, sizeof(data->argv), ptr); events.perf_submit(ctx, data, sizeof(struct data_t)); return 1; } @@ -102,7 +129,7 @@ static int submit_arg(struct pt_regs *ctx, void *ptr, struct data_t *data) { const char *argp = NULL; - bpf_probe_read(&argp, sizeof(argp), ptr); + bpf_probe_read_user(&argp, sizeof(argp), ptr); if (argp) { return __submit_arg(ctx, (void *)(argp), data); } @@ -114,12 +141,14 @@ const char __user *const __user *__argv, const char __user *const __user *__envp) { -#if CGROUPSET - u64 cgroupid = bpf_get_current_cgroup_id(); - if (cgroupset.lookup(&cgroupid) == NULL) { - return 0; + + u32 uid = bpf_get_current_uid_gid() & 0xffffffff; + + UID_FILTER + + if (container_should_be_filtered()) { + return 0; } -#endif // create data here and pass to submit_arg to save stack space (#555) struct data_t data = {}; @@ -154,17 +183,18 @@ int do_ret_sys_execve(struct pt_regs *ctx) { -#if CGROUPSET - u64 cgroupid = bpf_get_current_cgroup_id(); - if (cgroupset.lookup(&cgroupid) == NULL) { - return 0; + if (container_should_be_filtered()) { + return 0; } -#endif struct data_t data = {}; struct task_struct *task; + u32 uid = bpf_get_current_uid_gid() & 0xffffffff; + UID_FILTER + data.pid = bpf_get_current_pid_tgid() >> 32; + data.uid = uid; task = (struct task_struct *)bpf_get_current_task(); // Some kernels, like Ubuntu 4.13.0-generic, return 0 @@ -182,11 +212,13 @@ """ bpf_text = bpf_text.replace("MAXARG", args.max_args) -if args.cgroupmap: - bpf_text = bpf_text.replace('CGROUPSET', '1') - bpf_text = bpf_text.replace('CGROUPPATH', args.cgroupmap) + +if args.uid: + bpf_text = bpf_text.replace('UID_FILTER', + 'if (uid != %s) { return 0; }' % args.uid) else: - bpf_text = bpf_text.replace('CGROUPSET', '0') + bpf_text = bpf_text.replace('UID_FILTER', '') +bpf_text = filter_by_containers(args) + bpf_text if args.ebpf: print(bpf_text) exit() @@ -202,6 +234,8 @@ print("%-9s" % ("TIME"), end="") if args.timestamp: print("%-8s" % ("TIME(s)"), end="") +if args.print_uid: + print("%-6s" % ("UID"), end="") print("%-16s %-6s %-6s %3s %s" % ("PCOMM", "PID", "PPID", "RET", "ARGS")) class EventType(object): @@ -251,6 +285,8 @@ def print_event(cpu, data, size): printb(b"%-9s" % strftime("%H:%M:%S").encode('ascii'), nl="") if args.timestamp: printb(b"%-8.3f" % (time.time() - start_ts), nl="") + if args.print_uid: + printb(b"%-6d" % event.uid, nl="") ppid = event.ppid if event.ppid > 0 else get_ppid(event.pid) ppid = b"%d" % ppid if ppid > 0 else b"?" argv_text = b' '.join(argv[event.pid]).replace(b'\n', b'\\n') diff --git a/tools/execsnoop_example.txt b/tools/execsnoop_example.txt index 618bcf65e..8cdfe0db7 100644 --- a/tools/execsnoop_example.txt +++ b/tools/execsnoop_example.txt @@ -83,13 +83,34 @@ with an externally created map. # ./execsnoop --cgroupmap /sys/fs/bpf/test01 -For more details, see docs/filtering_by_cgroups.md +For more details, see docs/special_filtering.md +The -U option include UID on output: + +# ./execsnoop -U + +UID PCOMM PID PPID RET ARGS +1000 ls 171318 133702 0 /bin/ls --color=auto +1000 w 171322 133702 0 /usr/bin/w + +The -u options filters output based process UID. You also can use username as +argument, in that cause UID will be looked up using getpwnam (see man 3 getpwnam). + +# ./execsnoop -Uu 1000 +UID PCOMM PID PPID RET ARGS +1000 ls 171335 133702 0 /bin/ls --color=auto +1000 man 171340 133702 0 /usr/bin/man getpwnam +1000 bzip2 171341 171340 0 /bin/bzip2 -dc +1000 bzip2 171342 171340 0 /bin/bzip2 -dc +1000 bzip2 171345 171340 0 /bin/bzip2 -dc +1000 manpager 171355 171340 0 /usr/bin/manpager +1000 less 171355 171340 0 /usr/bin/less USAGE message: # ./execsnoop -h -usage: execsnoop [-h] [-T] [-t] [-x] [-q] [-n NAME] [-l LINE] [--max-args MAX_ARGS] +usage: execsnoop.py [-h] [-T] [-t] [-x] [--cgroupmap CGROUPMAP] [-u USER] [-q] + [-n NAME] [-l LINE] [-U] [--max-args MAX_ARGS] Trace exec() syscalls @@ -98,11 +119,16 @@ optional arguments: -T, --time include time column on output (HH:MM:SS) -t, --timestamp include timestamp on output -x, --fails include failed exec()s - -q, --quote Add quotemarks (") around arguments + --cgroupmap CGROUPMAP + trace cgroups in this BPF map only + --mntnsmap MNTNSMAP trace mount namespaces in this BPF map only + -u USER, --uid USER trace this UID only + -q, --quote Add quotemarks (") around arguments. -n NAME, --name NAME only print commands matching this name (regex), any arg -l LINE, --line LINE only print commands where arg contains this line (regex) + -U, --print-uid print UID column --max-args MAX_ARGS maximum number of arguments parsed and displayed, defaults to 20 @@ -110,7 +136,12 @@ examples: ./execsnoop # trace all exec() syscalls ./execsnoop -x # include failed exec()s ./execsnoop -T # include time (HH:MM:SS) + ./execsnoop -U # include UID + ./execsnoop -u 1000 # only trace UID 1000 + ./execsnoop -u root # get root UID and trace only this ./execsnoop -t # include timestamps ./execsnoop -q # add "quotemarks" around arguments ./execsnoop -n main # only print command lines containing "main" ./execsnoop -l tpkg # only print command where arguments contains "tpkg" + ./execsnoop --cgroupmap mappath # only trace cgroups in this BPF map + ./execsnoop --mntnsmap mappath # only trace mount namespaces in the map diff --git a/tools/exitsnoop.py b/tools/exitsnoop.py index 13a1444c5..db0d40087 100755 --- a/tools/exitsnoop.py +++ b/tools/exitsnoop.py @@ -27,6 +27,7 @@ exitsnoop --utc # include timestamps (UTC) exitsnoop -p 181 # only trace PID 181 exitsnoop --label=exit # label each output line with 'exit' + exitsnoop --per-thread # trace per thread termination """ """ Exit status (from ): @@ -62,6 +63,7 @@ def _getParser(): a("-p", "--pid", help="trace this PID only") a("--label", help="label each line") a("-x", "--failed", action="store_true", help="trace only fails, exclude exit(0)") + a("--per-thread", action="store_true", help="trace per thread termination") # print the embedded C program and exit, for debugging a("--ebpf", action="store_true", help=argparse.SUPPRESS) # RHEL 7.6 keeps task->start_time as struct timespec, convert to u64 nanoseconds @@ -140,11 +142,20 @@ def _embedded_c(args): extern int bpf_static_assert[(condition) ? 1 : -1] #endif """ + + if Global.args.pid: + if Global.args.per_thread: + filter_pid = "task->tgid != %s" % Global.args.pid + else: + filter_pid = "!(task->tgid == %s && task->pid == task->tgid)" % Global.args.pid + else: + filter_pid = '0' if Global.args.per_thread else 'task->pid != task->tgid' + code_substitutions = [ ('EBPF_COMMENT', '' if not Global.args.ebpf else _ebpf_comment()), ("BPF_STATIC_ASSERT_DEF", bpf_static_assert_def), ("CTYPES_SIZEOF_DATA", str(ct.sizeof(Data))), - ('FILTER_PID', '0' if not Global.args.pid else "task->tgid != %s" % Global.args.pid), + ('FILTER_PID', filter_pid), ('FILTER_EXIT_CODE', '0' if not Global.args.failed else 'task->exit_code == 0'), ('PROCESS_START_TIME_NS', 'task->start_time' if not Global.args.timespec else '(task->start_time.tv_sec * 1000000000L) + task->start_time.tv_nsec'), diff --git a/tools/exitsnoop_example.txt b/tools/exitsnoop_example.txt index 3a322dc15..31306e4f3 100644 --- a/tools/exitsnoop_example.txt +++ b/tools/exitsnoop_example.txt @@ -67,7 +67,7 @@ TIME-UTC LABEL PCOMM PID PPID TID AGE(s) EXIT_CODE USAGE message: # ./exitsnoop.py -h -usage: exitsnoop.py [-h] [-t] [--utc] [-p PID] [--label LABEL] [-x] +usage: exitsnoop.py [-h] [-t] [--utc] [-p PID] [--label LABEL] [-x] [--per-thread] Trace all process termination (exit, fatal signal) @@ -78,6 +78,7 @@ optional arguments: -p PID, --pid PID trace this PID only --label LABEL label each line -x, --failed trace only fails, exclude exit(0) + --per-thread trace per thread termination examples: exitsnoop # trace all process termination @@ -86,6 +87,7 @@ examples: exitsnoop --utc # include timestamps (UTC) exitsnoop -p 181 # only trace PID 181 exitsnoop --label=exit # label each output line with 'exit' + exitsnoop --per-thread # trace per thread termination Exit status: diff --git a/tools/ext4slower.py b/tools/ext4slower.py index 0524f22e7..90663a585 100755 --- a/tools/ext4slower.py +++ b/tools/ext4slower.py @@ -226,7 +226,7 @@ qs = de->d_name; if (qs.len == 0) return 0; - bpf_probe_read(&data.file, sizeof(data.file), (void *)qs.name); + bpf_probe_read_kernel(&data.file, sizeof(data.file), (void *)qs.name); // output events.perf_submit(ctx, &data, sizeof(data)); diff --git a/tools/filelife.py b/tools/filelife.py index 2eb4244b1..9b7562f4c 100755 --- a/tools/filelife.py +++ b/tools/filelife.py @@ -57,7 +57,7 @@ // trace file creation time int trace_create(struct pt_regs *ctx, struct inode *dir, struct dentry *dentry) { - u32 pid = bpf_get_current_pid_tgid(); + u32 pid = bpf_get_current_pid_tgid() >> 32; FILTER u64 ts = bpf_ktime_get_ns(); @@ -70,7 +70,7 @@ int trace_unlink(struct pt_regs *ctx, struct inode *dir, struct dentry *dentry) { struct data_t data = {}; - u32 pid = bpf_get_current_pid_tgid(); + u32 pid = bpf_get_current_pid_tgid() >> 32; FILTER @@ -90,7 +90,7 @@ if (bpf_get_current_comm(&data.comm, sizeof(data.comm)) == 0) { data.pid = pid; data.delta = delta; - bpf_probe_read(&data.fname, sizeof(data.fname), d_name.name); + bpf_probe_read_kernel(&data.fname, sizeof(data.fname), d_name.name); } events.perf_submit(ctx, &data, sizeof(data)); diff --git a/tools/fileslower.py b/tools/fileslower.py index 31e3adf9a..07484e031 100755 --- a/tools/fileslower.py +++ b/tools/fileslower.py @@ -112,7 +112,7 @@ struct qstr d_name = de->d_name; val.name_len = d_name.len; - bpf_probe_read(&val.name, sizeof(val.name), d_name.name); + bpf_probe_read_kernel(&val.name, sizeof(val.name), d_name.name); bpf_get_current_comm(&val.comm, sizeof(val.comm)); entryinfo.update(&pid, &val); @@ -159,8 +159,8 @@ data.sz = valp->sz; data.delta_us = delta_us; data.name_len = valp->name_len; - bpf_probe_read(&data.name, sizeof(data.name), valp->name); - bpf_probe_read(&data.comm, sizeof(data.comm), valp->comm); + bpf_probe_read_kernel(&data.name, sizeof(data.name), valp->name); + bpf_probe_read_kernel(&data.comm, sizeof(data.comm), valp->comm); events.perf_submit(ctx, &data, sizeof(data)); return 0; @@ -199,13 +199,18 @@ # do_sync_read/do_sync_write), but those became static. So trace these from # the parent functions, at the cost of more overhead, instead. # Ultimately, we should be using [V]FS tracepoints. -b.attach_kprobe(event="__vfs_read", fn_name="trace_read_entry") -b.attach_kretprobe(event="__vfs_read", fn_name="trace_read_return") +try: + b.attach_kprobe(event="__vfs_read", fn_name="trace_read_entry") + b.attach_kretprobe(event="__vfs_read", fn_name="trace_read_return") +except Exception: + print('Current kernel does not have __vfs_read, try vfs_read instead') + b.attach_kprobe(event="vfs_read", fn_name="trace_read_entry") + b.attach_kretprobe(event="vfs_read", fn_name="trace_read_return") try: b.attach_kprobe(event="__vfs_write", fn_name="trace_write_entry") b.attach_kretprobe(event="__vfs_write", fn_name="trace_write_return") except Exception: - # older kernels don't have __vfs_write so try vfs_write instead + print('Current kernel does not have __vfs_write, try vfs_write instead') b.attach_kprobe(event="vfs_write", fn_name="trace_write_entry") b.attach_kretprobe(event="vfs_write", fn_name="trace_write_return") diff --git a/tools/filetop.py b/tools/filetop.py index dbe7a7da4..34cfebc84 100755 --- a/tools/filetop.py +++ b/tools/filetop.py @@ -108,7 +108,7 @@ def signal_ignore(signal_value, frame): struct info_t info = {.pid = pid}; bpf_get_current_comm(&info.comm, sizeof(info.comm)); info.name_len = d_name.len; - bpf_probe_read(&info.name, sizeof(info.name), d_name.name); + bpf_probe_read_kernel(&info.name, sizeof(info.name), d_name.name); if (S_ISREG(mode)) { info.type = 'R'; } else if (S_ISSOCK(mode)) { diff --git a/tools/funccount.py b/tools/funccount.py index 69dd01c8c..ef7d9cefd 100755 --- a/tools/funccount.py +++ b/tools/funccount.py @@ -4,7 +4,8 @@ # funccount Count functions, tracepoints, and USDT probes. # For Linux, uses BCC, eBPF. # -# USAGE: funccount [-h] [-p PID] [-i INTERVAL] [-d DURATION] [-T] [-r] pattern +# USAGE: funccount [-h] [-p PID] [-i INTERVAL] [-d DURATION] [-T] [-r] +# [-c CPU] pattern # # The pattern is a string with optional '*' wildcards, similar to file # globbing. If you'd prefer to use regular expressions, use the -r option. @@ -34,7 +35,7 @@ def verify_limit(num): (probe_limit, num)) class Probe(object): - def __init__(self, pattern, use_regex=False, pid=None): + def __init__(self, pattern, use_regex=False, pid=None, cpu=None): """Init a new probe. Init the probe from the pattern provided by the user. The supported @@ -79,6 +80,7 @@ def __init__(self, pattern, use_regex=False, pid=None): self.library = libpath self.pid = pid + self.cpu = cpu self.matched = 0 self.trace_functions = {} # map location number to function name @@ -164,7 +166,8 @@ def _generate_functions(self, template): def load(self): trace_count_text = b""" int PROBE_FUNCTION(void *ctx) { - FILTER + FILTERPID + FILTERCPU int loc = LOCATION; u64 *val = counts.lookup(&loc); if (!val) { @@ -182,11 +185,18 @@ def load(self): # We really mean the tgid from the kernel's perspective, which is in # the top 32 bits of bpf_get_current_pid_tgid(). if self.pid: - trace_count_text = trace_count_text.replace(b'FILTER', + trace_count_text = trace_count_text.replace(b'FILTERPID', b"""u32 pid = bpf_get_current_pid_tgid() >> 32; if (pid != %d) { return 0; }""" % self.pid) else: - trace_count_text = trace_count_text.replace(b'FILTER', b'') + trace_count_text = trace_count_text.replace(b'FILTERPID', b'') + + if self.cpu: + trace_count_text = trace_count_text.replace(b'FILTERCPU', + b"""u32 cpu = bpf_get_smp_processor_id(); + if (cpu != %d) { return 0; }""" % int(self.cpu)) + else: + trace_count_text = trace_count_text.replace(b'FILTERCPU', b'') bpf_text += self._generate_functions(trace_count_text) bpf_text = bpf_text.replace(b"NUMLOCATIONS", @@ -224,6 +234,7 @@ def __init__(self): ./funccount go:os.* # count all "os.*" calls in libgo ./funccount -p 185 go:os.* # count all "os.*" calls in libgo, PID 185 ./funccount ./test:read* # count "read*" calls in the ./test binary + ./funccount -c 1 'vfs_*' # count vfs calls on CPU 1 only """ parser = argparse.ArgumentParser( description="Count functions, tracepoints, and USDT probes", @@ -241,13 +252,16 @@ def __init__(self): help="use regular expressions. Default is \"*\" wildcards only.") parser.add_argument("-D", "--debug", action="store_true", help="print BPF program before starting (for debugging purposes)") + parser.add_argument("-c", "--cpu", + help="trace this CPU only") parser.add_argument("pattern", type=ArgString, help="search expression for events") self.args = parser.parse_args() global debug debug = self.args.debug - self.probe = Probe(self.args.pattern, self.args.regexp, self.args.pid) + self.probe = Probe(self.args.pattern, self.args.regexp, self.args.pid, + self.args.cpu) if self.args.duration and not self.args.interval: self.args.interval = self.args.duration if not self.args.interval: diff --git a/tools/funccount_example.txt b/tools/funccount_example.txt index d06cfd98e..e942b9cb3 100644 --- a/tools/funccount_example.txt +++ b/tools/funccount_example.txt @@ -325,11 +325,45 @@ tcp_v4_send_check 30 __tcp_v4_send_check 30 Detaching... +A cpu is specified by "-c CPU", this will only trace the specified CPU. Eg, +trace how many timers setting per sencond of CPU 1 on a x86(Intel) server: + +# funccount.py -i 1 -c 1 lapic_next_deadline +Tracing 1 functions for "lapic_next_deadline"... Hit Ctrl-C to end. + +FUNC COUNT +lapic_next_deadline 3840 + +FUNC COUNT +lapic_next_deadline 3930 + +FUNC COUNT +lapic_next_deadline 4701 + +FUNC COUNT +lapic_next_deadline 5895 + +FUNC COUNT +lapic_next_deadline 5591 + +FUNC COUNT +lapic_next_deadline 4727 + +FUNC COUNT +lapic_next_deadline 5560 + +FUNC COUNT +lapic_next_deadline 5416 +^C +FUNC COUNT +lapic_next_deadline 372 +Detaching... Full USAGE: # ./funccount -h -usage: funccount [-h] [-p PID] [-i INTERVAL] [-d DURATION] [-T] [-r] [-D] +usage: funccount.py [-h] [-p PID] [-i INTERVAL] [-d DURATION] [-T] [-r] [-D] + [-c CPU] pattern Count functions, tracepoints, and USDT probes @@ -349,6 +383,7 @@ optional arguments: only. -D, --debug print BPF program before starting (for debugging purposes) + -c CPU, --cpu CPU trace this CPU only examples: ./funccount 'vfs_*' # count kernel fns starting with "vfs" @@ -362,3 +397,4 @@ examples: ./funccount go:os.* # count all "os.*" calls in libgo ./funccount -p 185 go:os.* # count all "os.*" calls in libgo, PID 185 ./funccount ./test:read* # count "read*" calls in the ./test binary + ./funccount -c 1 'vfs_*' # count vfs calls on CPU 1 only diff --git a/tools/funcinterval.py b/tools/funcinterval.py new file mode 100755 index 000000000..baac73c9a --- /dev/null +++ b/tools/funcinterval.py @@ -0,0 +1,180 @@ +#!/usr/bin/python +# @lint-avoid-python-3-compatibility-imports +# +# funcinterval Time interval between the same function, tracepoint +# as a histogram. +# +# USAGE: funcinterval [-h] [-p PID] [-i INTERVAL] [-T] [-u] [-m] [-v] pattern +# +# Run "funcinterval -h" for full usage. +# +# Copyright (c) 2020 Realtek, Inc. +# Licensed under the Apache License, Version 2.0 (the "License") +# +# 03-Jun-2020 Edward Wu Referenced funclatency and created this. + +from __future__ import print_function +from bcc import BPF +from time import sleep, strftime +import argparse +import signal + +# arguments +examples = """examples: + # time the interval of do_sys_open() + ./funcinterval do_sys_open + # time the interval of xhci_ring_ep_doorbell(), in microseconds + ./funcinterval -u xhci_ring_ep_doorbell + # time the interval of do_nanosleep(), in milliseconds + ./funcinterval -m do_nanosleep + # output every 5 seconds, with timestamps + ./funcinterval -mTi 5 vfs_read + # time process 181 only + ./funcinterval -p 181 vfs_read + # time the interval of mm_vmscan_direct_reclaim_begin tracepoint + ./funcinterval t:vmscan:mm_vmscan_direct_reclaim_begin +""" +parser = argparse.ArgumentParser( + description="Time interval and print latency as a histogram", + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=examples) +parser.add_argument("-p", "--pid", type=int, + help="trace this PID only") +parser.add_argument("-i", "--interval", type=int, + help="summary interval, in seconds") +parser.add_argument("-d", "--duration", type=int, + help="total duration of trace, in seconds") +parser.add_argument("-T", "--timestamp", action="store_true", + help="include timestamp on output") +parser.add_argument("-u", "--microseconds", action="store_true", + help="microsecond histogram") +parser.add_argument("-m", "--milliseconds", action="store_true", + help="millisecond histogram") +parser.add_argument("-v", "--verbose", action="store_true", + help="print the BPF program (for debugging purposes)") +parser.add_argument("pattern", + help="Function/Tracepoint name for tracing") +parser.add_argument("--ebpf", action="store_true", + help=argparse.SUPPRESS) +args = parser.parse_args() +if args.duration and not args.interval: + args.interval = args.duration +if not args.interval: + args.interval = 99999999 + +def bail(error): + print("Error: " + error) + exit(1) + + +parts = args.pattern.split(':') +if len(parts) == 1: + attach_type = "function" + pattern = args.pattern +elif len(parts) == 3: + attach_type = "tracepoint" + pattern = ':'.join(parts[1:]) +else: + bail("unrecognized pattern format '%s'" % pattern) + +# define BPF program +bpf_text = """ +#include + +BPF_HASH(start, u32, u64, 1); +BPF_HISTOGRAM(dist); + +int trace_func_entry(struct pt_regs *ctx) +{ + u64 pid_tgid = bpf_get_current_pid_tgid(); + u32 index = 0, tgid = pid_tgid >> 32; + u64 *tsp, ts = bpf_ktime_get_ns(), delta; + + FILTER + tsp = start.lookup(&index); + if (tsp == 0) + goto out; + + delta = ts - *tsp; + FACTOR + + // store as histogram + dist.increment(bpf_log2l(delta)); + +out: + start.update(&index, &ts); + + return 0; +} +""" + +# code substitutions +if args.pid: + bpf_text = bpf_text.replace('FILTER', + 'if (tgid != %d) { return 0; }' % args.pid) +else: + bpf_text = bpf_text.replace('FILTER', '') +if args.milliseconds: + bpf_text = bpf_text.replace('FACTOR', 'delta /= 1000000;') + label = "msecs" +elif args.microseconds: + bpf_text = bpf_text.replace('FACTOR', 'delta /= 1000;') + label = "usecs" +else: + bpf_text = bpf_text.replace('FACTOR', '') + label = "nsecs" + +if args.verbose or args.ebpf: + print(bpf_text) + if args.ebpf: + exit() + +# signal handler +def signal_ignore(signal, frame): + print() + + +# load BPF program +b = BPF(text=bpf_text) + +if len(parts) == 1: + b.attach_kprobe(event=pattern, fn_name="trace_func_entry") + matched = b.num_open_kprobes() +elif len(parts) == 3: + b.attach_tracepoint(tp=pattern, fn_name="trace_func_entry") + matched = b.num_open_tracepoints() + +if matched == 0: + print("0 %s matched by \"%s\". Exiting." % (attach_type, pattern)) + exit() + +# header +print("Tracing %s for \"%s\"... Hit Ctrl-C to end." % + (attach_type, pattern)) + +exiting = 0 if args.interval else 1 +seconds = 0 +dist = b.get_table("dist") +start = b.get_table("start") +while (1): + try: + sleep(args.interval) + seconds += args.interval + except KeyboardInterrupt: + exiting = 1 + # as cleanup can take many seconds, trap Ctrl-C: + signal.signal(signal.SIGINT, signal_ignore) + if args.duration and seconds >= args.duration: + exiting = 1 + + print() + if args.timestamp: + print("%-8s\n" % strftime("%H:%M:%S"), end="") + + dist.print_log2_hist(label) + dist.clear() + start.clear() + + if exiting: + print("Detaching...") + exit() diff --git a/tools/funcinterval_example.txt b/tools/funcinterval_example.txt new file mode 100755 index 000000000..8f3f8cbed --- /dev/null +++ b/tools/funcinterval_example.txt @@ -0,0 +1,163 @@ +Demonstrations of funcinterval, the Linux eBPF/bcc version. + +eBPF/bcc is very suitable for platform performance tuning. +By funclatency, we can profile specific functions to know how latency +this function costs. However, sometimes performance drop is not about the +latency of function but the interval between function calls. +funcinterval is born for this purpose. + +Another story, hardware performance tuning on the platform we will use +protocol analyzer to analyze performance, but most protocol analyzers lack +the distribution feature. Using a protocol analyzer you need a lot of time +to check every detail latency. By funcinterval, we can save a lot of time +by distribution feature. + +For example: + +# ./funcinterval xhci_ring_ep_doorbell -d 2 -u +Tracing 1 functions for "xhci_ring_ep_doorbell"... Hit Ctrl-C to end. + + usecs : count distribution + 0 -> 1 : 0 | | + 2 -> 3 : 0 | | + 4 -> 7 : 0 | | + 8 -> 15 : 0 | | + 16 -> 31 : 0 | | + 32 -> 63 : 134 | | + 64 -> 127 : 2862 |******************** | + 128 -> 255 : 5552 |****************************************| + 256 -> 511 : 216 |* | + 512 -> 1023 : 2 | | +Detaching... + +This example output shows that the interval latency of xhci_ring_ep_doorbell +took between 64 and 255 microseconds. USB MAC will start its job after USB +doorbell register ringing, above information that can help hardware engineer to +analyze, the performance drop is because software rings the doorbell too +late or just slowly hardware DMA. + +# ./funcinterval blk_start_request -i 2 -u +Tracing 1 functions for "blk_start_request"... Hit Ctrl-C to end. + + usecs : count distribution + 0 -> 1 : 0 | | + 2 -> 3 : 0 | | + 4 -> 7 : 0 | | + 8 -> 15 : 5 |* | + 16 -> 31 : 0 | | + 32 -> 63 : 1 | | + 64 -> 127 : 2 | | + 128 -> 255 : 1 | | + 256 -> 511 : 0 | | + 512 -> 1023 : 1 | | + 1024 -> 2047 : 1 | | + 2048 -> 4095 : 117 |****************************************| + 4096 -> 8191 : 13 |**** | + 8192 -> 16383 : 1 | | + +If using biolatency tool that has no difference between two platforms. +Maybe the problem is related to the interval time instead of block +device I/O latency. + +# ./funcinterval ion_ioctl -i 2 -m +Tracing 1 functions for "ion_ioctl"... Hit Ctrl-C to end. + + msecs : count distribution + 0 -> 1 : 215 |****************************************| + 2 -> 3 : 0 | | + 4 -> 7 : 4 | | + 8 -> 15 : 5 | | + 16 -> 31 : 29 |***** | + +You can also check the ion_ioctl. By the above output, we know the activity +frequency of ion_ioctl() is high mostly(less than 1 ms), but has 29 times low +frequency. + +# ./funcinterval t:block:block_bio_queue -d 30 -u +Tracing tracepoint for "block:block_bio_queue"... Hit Ctrl-C to end. + + usecs : count distribution + 0 -> 1 : 0 | | + 2 -> 3 : 0 | | + 4 -> 7 : 0 | | + 8 -> 15 : 2 | | + 16 -> 31 : 262 | | + 32 -> 63 : 9075 |******************* | + 64 -> 127 : 18668 |****************************************| + 128 -> 255 : 1492 |*** | + 256 -> 511 : 2616 |***** | + 512 -> 1023 : 7226 |*************** | + 1024 -> 2047 : 8982 |******************* | + 2048 -> 4095 : 2394 |***** | + 4096 -> 8191 : 163 | | + 8192 -> 16383 : 42 | | + 16384 -> 32767 : 2 | | + 32768 -> 65535 : 0 | | + 65536 -> 131071 : 0 | | + 131072 -> 262143 : 0 | | + 262144 -> 524287 : 0 | | + 524288 -> 1048575 : 1 | | +Detaching... + +# ./funcinterval t:block:block_rq_issue -d 30 -u +Tracing tracepoint for "block:block_rq_issue"... Hit Ctrl-C to end. + + usecs : count distribution + 0 -> 1 : 0 | | + 2 -> 3 : 0 | | + 4 -> 7 : 0 | | + 8 -> 15 : 0 | | + 16 -> 31 : 5 | | + 32 -> 63 : 18 | | + 64 -> 127 : 32 | | + 128 -> 255 : 95 | | + 256 -> 511 : 2194 |****** | + 512 -> 1023 : 13830 |****************************************| + 1024 -> 2047 : 9001 |************************** | + 2048 -> 4095 : 1569 |**** | + 4096 -> 8191 : 96 | | + 8192 -> 16383 : 17 | | +Detaching... + +funcinterval also supports tracepoint filter. The above two cases are under EMMC +throughput testing, by those results you know which layer has a slower interval +time. In our case, mmc-cmdqd is slower than block layer. + + +USAGE message: + +# ./funcinterval -h +usage: funcinterval [-h] [-p PID] [-i INTERVAL] [-d DURATION] [-T] [-u] [-m] + [-v] + pattern + +Time interval and print latency as a histogram + +positional arguments: + pattern Function name for tracing + +optional arguments: + -h, --help show this help message and exit + -p PID, --pid PID trace this PID only + -i INTERVAL, --interval INTERVAL + summary interval, in seconds + -d DURATION, --duration DURATION + total duration of trace, in seconds + -T, --timestamp include timestamp on output + -u, --microseconds microsecond histogram + -m, --milliseconds millisecond histogram + -v, --verbose print the BPF program (for debugging purposes) + +examples: + # time the interval of do_sys_open() + ./funcinterval do_sys_open + # time the interval of xhci_ring_ep_doorbell(), in microseconds + ./funcinterval -u xhci_ring_ep_doorbell + # time the interval of do_nanosleep(), in milliseconds + ./funcinterval -m do_nanosleep + # output every 5 seconds, with timestamps + ./funcinterval -mTi 5 vfs_read + # time process 181 only + ./funcinterval -p 181 vfs_read + # time the interval of mm_vmscan_direct_reclaim_begin tracepoint + ./funcinterval t:vmscan:mm_vmscan_direct_reclaim_begin diff --git a/tools/funclatency.py b/tools/funclatency.py index 3f08a7e0d..e77f634b8 100755 --- a/tools/funclatency.py +++ b/tools/funclatency.py @@ -111,6 +111,7 @@ def bail(error): } hist_key_t; BPF_HASH(start, u32); +BPF_ARRAY(avg, u64, 2); STORAGE int trace_func_entry(struct pt_regs *ctx) @@ -141,6 +142,14 @@ def bail(error): } delta = bpf_ktime_get_ns() - *tsp; start.delete(&pid); + + u32 lat = 0; + u32 cnt = 1; + u64 *sum = avg.lookup(&lat); + if (sum) lock_xadd(sum, delta); + u64 *cnts = avg.lookup(&cnt); + if (cnts) lock_xadd(cnts, 1); + FACTOR // store as histogram @@ -257,6 +266,16 @@ def print_section(key): dist.print_log2_hist(label) dist.clear() + total = b['avg'][0].value + counts = b['avg'][1].value + if counts > 0: + if label == 'msecs': + total /= 1000000 + elif label == 'usecs': + total /= 1000 + avg = total/counts + print("\navg = %ld %s, total: %ld %s, count: %ld\n" %(total/counts, label, total, label, counts)) + if exiting: print("Detaching...") exit() diff --git a/tools/funclatency_example.txt b/tools/funclatency_example.txt index d8217a236..e2effbecb 100644 --- a/tools/funclatency_example.txt +++ b/tools/funclatency_example.txt @@ -29,6 +29,9 @@ Tracing do_sys_open... Hit Ctrl-C to end. 524288 -> 1048575 : 0 | | 1048576 -> 2097151 : 0 | | 2097152 -> 4194303 : 1 | | + +avg = 13746 nsecs, total: 6543360 nsecs, count: 476 + Detaching... The output shows a histogram of function latency (call time), measured from when @@ -74,6 +77,9 @@ Tracing 1 function for "pthread:pthread_mutex_lock"... Hit Ctrl-C to end. 262144 -> 524287 : 5 | | 524288 -> 1048575 : 1 | | 1048576 -> 2097151 : 9 | | + +avg = 4317 nsecs, total: 2654426112 nsecs, count: 614752 + Detaching... It seems that most calls to pthread_mutex_lock completed rather quickly (in @@ -130,6 +136,9 @@ Function = insert_result [6556] 32768 -> 65535 : 106 | | 65536 -> 131071 : 5 | | 131072 -> 262143 : 4 | | + +avg = 3404 nsecs, total: 5862276096 nsecs, count: 1721727 + Detaching... From the results, we can see that the is_prime function has something resembling @@ -165,6 +174,9 @@ Tracing vfs_read... Hit Ctrl-C to end. 131072 -> 262143 : 7 | | 262144 -> 524287 : 3 | | 524288 -> 1048575 : 7 | | + +avg = 4229 nsecs, total: 8789145 nsecs, count: 2078 + Detaching... This shows a bimodal distribution. Many vfs_read() calls were faster than 15 @@ -195,6 +207,9 @@ Tracing do_nanosleep... Hit Ctrl-C to end. 8192 -> 16383 : 0 | | 16384 -> 32767 : 0 | | 32768 -> 65535 : 2 | | + +avg = 1510 nsecs, total: 546816 nsecs, count: 326 + Detaching... This looks like it has found threads that are sleeping every 1, 5, and 60 @@ -221,6 +236,8 @@ Tracing vfs_read... Hit Ctrl-C to end. 256 -> 511 : 1 | | 512 -> 1023 : 7 | | +avg = 5 nsecs, total: 8259 nsecs, count: 1521 + 20:10:13 msecs : count distribution 0 -> 1 : 1251 |*************************************+| @@ -235,6 +252,8 @@ Tracing vfs_read... Hit Ctrl-C to end. 512 -> 1023 : 6 | | 1024 -> 2047 : 2 | | +avg = 9 nsecs, total: 11736 nsecs, count: 1282 + 20:10:18 msecs : count distribution 0 -> 1 : 1265 |*************************************+| @@ -249,6 +268,9 @@ Tracing vfs_read... Hit Ctrl-C to end. 512 -> 1023 : 5 | | 1024 -> 2047 : 0 | | 2048 -> 4095 : 1 | | + +avg = 8 nsecs, total: 11219 nsecs, count: 1303 + ^C 20:10:20 msecs : count distribution @@ -262,6 +284,9 @@ Tracing vfs_read... Hit Ctrl-C to end. 128 -> 255 : 0 | | 256 -> 511 : 0 | | 512 -> 1023 : 1 | | + +avg = 4 nsecs, total: 1029 nsecs, count: 251 + Detaching... @@ -282,6 +307,9 @@ Tracing vfs_read... Hit Ctrl-C to end. 64 -> 127 : 13 |**************************************| 128 -> 255 : 10 |***************************** | 256 -> 511 : 4 |*********** | + +avg = 153 nsecs, total: 4765 nsecs, count: 31 + Detaching... The distribution between 64 and 511 milliseconds shows keystroke latency. @@ -324,6 +352,9 @@ Function = vfs_rename 8 -> 15 : 0 | | 16 -> 31 : 6 |************* | 32 -> 63 : 18 |****************************************| + +avg = 5087 nsecs, total: 8287001 nsecs, count: 1629 + Detaching... diff --git a/tools/funcslower.py b/tools/funcslower.py index bda6a844c..ffa618d73 100755 --- a/tools/funcslower.py +++ b/tools/funcslower.py @@ -82,7 +82,11 @@ u64 id; u64 start_ns; #ifdef GRAB_ARGS +#ifndef __s390x__ u64 args[6]; +#else + u64 args[5]; +#endif #endif }; @@ -94,7 +98,11 @@ u64 retval; char comm[TASK_COMM_LEN]; #ifdef GRAB_ARGS +#ifndef __s390x__ u64 args[6]; +#else + u64 args[5]; +#endif #endif #ifdef USER_STACKS int user_stack_id; @@ -130,7 +138,9 @@ entry.args[2] = PT_REGS_PARM3(ctx); entry.args[3] = PT_REGS_PARM4(ctx); entry.args[4] = PT_REGS_PARM5(ctx); +#ifndef __s390x__ entry.args[5] = PT_REGS_PARM6(ctx); +#endif #endif entryinfo.update(&tgid_pid, &entry); @@ -196,7 +206,7 @@ #endif #ifdef GRAB_ARGS - bpf_probe_read(&data.args[0], sizeof(data.args), entryp->args); + bpf_probe_read_kernel(&data.args[0], sizeof(data.args), entryp->args); #endif bpf_get_current_comm(&data.comm, sizeof(data.comm)); events.perf_submit(ctx, &data, sizeof(data)); diff --git a/tools/gethostlatency.py b/tools/gethostlatency.py index f7506a868..0ba5a1eb2 100755 --- a/tools/gethostlatency.py +++ b/tools/gethostlatency.py @@ -64,7 +64,7 @@ u32 pid = bpf_get_current_pid_tgid(); if (bpf_get_current_comm(&val.comm, sizeof(val.comm)) == 0) { - bpf_probe_read(&val.host, sizeof(val.host), + bpf_probe_read_user(&val.host, sizeof(val.host), (void *)PT_REGS_PARM1(ctx)); val.pid = bpf_get_current_pid_tgid(); val.ts = bpf_ktime_get_ns(); @@ -86,8 +86,8 @@ if (valp == 0) return 0; // missed start - bpf_probe_read(&data.comm, sizeof(data.comm), valp->comm); - bpf_probe_read(&data.host, sizeof(data.host), (void *)valp->host); + bpf_probe_read_kernel(&data.comm, sizeof(data.comm), valp->comm); + bpf_probe_read_kernel(&data.host, sizeof(data.host), (void *)valp->host); data.pid = valp->pid; data.delta = tsp - valp->ts; events.perf_submit(ctx, &data, sizeof(data)); diff --git a/tools/hardirqs.py b/tools/hardirqs.py index 589a890dd..fda804d49 100755 --- a/tools/hardirqs.py +++ b/tools/hardirqs.py @@ -83,7 +83,7 @@ char *name = (char *)action->name; irq_key_t key = {.slot = 0 /* ignore */}; - bpf_probe_read(&key.name, sizeof(key.name), name); + bpf_probe_read_kernel(&key.name, sizeof(key.name), name); dist.increment(key); return 0; @@ -129,12 +129,12 @@ if args.dist: bpf_text = bpf_text.replace('STORE', 'irq_key_t key = {.slot = bpf_log2l(delta / %d)};' % factor + - 'bpf_probe_read(&key.name, sizeof(key.name), name);' + + 'bpf_probe_read_kernel(&key.name, sizeof(key.name), name);' + 'dist.increment(key);') else: bpf_text = bpf_text.replace('STORE', 'irq_key_t key = {.slot = 0 /* ignore */};' + - 'bpf_probe_read(&key.name, sizeof(key.name), name);' + + 'bpf_probe_read_kernel(&key.name, sizeof(key.name), name);' + 'dist.increment(key, delta);') if debug or args.ebpf: print(bpf_text) diff --git a/tools/killsnoop.py b/tools/killsnoop.py index 2fb1dcb5d..2dc5b8af9 100755 --- a/tools/killsnoop.py +++ b/tools/killsnoop.py @@ -23,6 +23,7 @@ ./killsnoop # trace all kill() signals ./killsnoop -x # only show failed kills ./killsnoop -p 181 # only trace PID 181 + ./killsnoop -s 9 # only trace signal 9 """ parser = argparse.ArgumentParser( description="Trace signals issued by the kill() syscall", @@ -32,6 +33,8 @@ help="only show failed kill syscalls") parser.add_argument("-p", "--pid", help="trace this PID only") +parser.add_argument("-s", "--signal", + help="trace this signal only") parser.add_argument("--ebpf", action="store_true", help=argparse.SUPPRESS) args = parser.parse_args() @@ -63,7 +66,8 @@ int syscall__kill(struct pt_regs *ctx, int tpid, int sig) { u32 pid = bpf_get_current_pid_tgid(); - FILTER + PID_FILTER + SIGNAL_FILTER struct val_t val = {.pid = pid}; if (bpf_get_current_comm(&val.comm, sizeof(val.comm)) == 0) { @@ -87,7 +91,7 @@ return 0; } - bpf_probe_read(&data.comm, sizeof(data.comm), valp->comm); + bpf_probe_read_kernel(&data.comm, sizeof(data.comm), valp->comm); data.pid = pid; data.tpid = valp->tpid; data.ret = PT_REGS_RC(ctx); @@ -100,10 +104,15 @@ } """ if args.pid: - bpf_text = bpf_text.replace('FILTER', + bpf_text = bpf_text.replace('PID_FILTER', 'if (pid != %s) { return 0; }' % args.pid) else: - bpf_text = bpf_text.replace('FILTER', '') + bpf_text = bpf_text.replace('PID_FILTER', '') +if args.signal: + bpf_text = bpf_text.replace('SIGNAL_FILTER', + 'if (sig != %s) { return 0; }' % args.signal) +else: + bpf_text = bpf_text.replace('SIGNAL_FILTER', '') if debug or args.ebpf: print(bpf_text) if args.ebpf: diff --git a/tools/killsnoop_example.txt b/tools/killsnoop_example.txt index 29d56b0a8..7746f2a0c 100644 --- a/tools/killsnoop_example.txt +++ b/tools/killsnoop_example.txt @@ -32,3 +32,4 @@ examples: ./killsnoop # trace all kill() signals ./killsnoop -x # only show failed kills ./killsnoop -p 181 # only trace PID 181 + ./killsnoop -s 9 # only trace signal 9 diff --git a/tools/klockstat.py b/tools/klockstat.py index e20478803..d157b7be1 100755 --- a/tools/klockstat.py +++ b/tools/klockstat.py @@ -61,7 +61,7 @@ def stack_id_err(stack_id): help="total duration of trace in seconds") time_group.add_argument("-i", "--interval", type=int, help="print summary at this interval (seconds)") -parser.add_argument("-n", "--locks", type=int, default=999999999, +parser.add_argument("-n", "--locks", type=int, default=99999999, help="print given number of locks") parser.add_argument("-s", "--stacks", type=int, default=1, help="print given number of stack entries") @@ -124,7 +124,7 @@ def stack_id_err(stack_id): return 1; } -int mutex_lock_enter(struct pt_regs *ctx) +static int do_mutex_lock_enter(void *ctx, int skip) { if (!is_enabled()) return 0; @@ -149,7 +149,7 @@ def stack_id_err(stack_id): return 0; } - int stackid = stack_traces.get_stackid(ctx, 0); + int stackid = stack_traces.get_stackid(ctx, skip); struct depth_id did = { .id = id, .depth = *depth, @@ -237,7 +237,7 @@ def stack_id_err(stack_id): } } -int mutex_lock_return(struct pt_regs *ctx) +static int do_mutex_lock_return(void) { if (!is_enabled()) return 0; @@ -285,7 +285,7 @@ def stack_id_err(stack_id): return 0; } -int mutex_unlock_enter(struct pt_regs *ctx) +static int do_mutex_unlock_enter(void) { if (!is_enabled()) return 0; @@ -330,9 +330,49 @@ def stack_id_err(stack_id): time_held.delete(&did); return 0; } +""" + +program_kprobe = """ +int mutex_unlock_enter(struct pt_regs *ctx) +{ + return do_mutex_unlock_enter(); +} + +int mutex_lock_return(struct pt_regs *ctx) +{ + return do_mutex_lock_return(); +} + +int mutex_lock_enter(struct pt_regs *ctx) +{ + return do_mutex_lock_enter(ctx, 0); +} +""" + +program_kfunc = """ +KFUNC_PROBE(mutex_unlock, void *lock) +{ + return do_mutex_unlock_enter(); +} + +KRETFUNC_PROBE(mutex_lock, void *lock, int ret) +{ + return do_mutex_lock_return(); +} + +KFUNC_PROBE(mutex_lock, void *lock) +{ + return do_mutex_lock_enter(ctx, 3); +} """ +is_support_kfunc = BPF.support_kfunc() +if is_support_kfunc: + program += program_kfunc +else: + program += program_kprobe + def sort_list(maxs, totals, counts): if (not args.sort): return maxs; @@ -387,9 +427,10 @@ def display(sort, maxs, totals, counts): b = BPF(text=program) -b.attach_kprobe(event="mutex_unlock", fn_name="mutex_unlock_enter") -b.attach_kretprobe(event="mutex_lock", fn_name="mutex_lock_return") -b.attach_kprobe(event="mutex_lock", fn_name="mutex_lock_enter") +if not is_support_kfunc: + b.attach_kprobe(event="mutex_unlock", fn_name="mutex_unlock_enter") + b.attach_kretprobe(event="mutex_lock", fn_name="mutex_lock_return") + b.attach_kprobe(event="mutex_lock", fn_name="mutex_lock_enter") enabled = b.get_table("enabled"); @@ -411,7 +452,7 @@ def display(sort, maxs, totals, counts): exiting = 0 if args.interval else 1 exiting = 1 if args.duration else 0 -seconds = 999999999 +seconds = 99999999 if args.interval: seconds = args.interval if args.duration: diff --git a/tools/lib/ucalls.py b/tools/lib/ucalls.py index 307df2527..396d56eb7 100755 --- a/tools/lib/ucalls.py +++ b/tools/lib/ucalls.py @@ -158,9 +158,9 @@ #endif READ_CLASS READ_METHOD - bpf_probe_read(&data.method.clazz, sizeof(data.method.clazz), + bpf_probe_read_user(&data.method.clazz, sizeof(data.method.clazz), (void *)clazz); - bpf_probe_read(&data.method.method, sizeof(data.method.method), + bpf_probe_read_user(&data.method.method, sizeof(data.method.method), (void *)method); #ifndef LATENCY valp = counts.lookup_or_try_init(&data.method, &val); @@ -182,9 +182,9 @@ data.pid = bpf_get_current_pid_tgid(); READ_CLASS READ_METHOD - bpf_probe_read(&data.method.clazz, sizeof(data.method.clazz), + bpf_probe_read_user(&data.method.clazz, sizeof(data.method.clazz), (void *)clazz); - bpf_probe_read(&data.method.method, sizeof(data.method.method), + bpf_probe_read_user(&data.method.method, sizeof(data.method.method), (void *)method); entry_timestamp = entry.lookup(&data); if (!entry_timestamp) { diff --git a/tools/lib/uflow.py b/tools/lib/uflow.py index 4779ba2cc..de3d7e27c 100755 --- a/tools/lib/uflow.py +++ b/tools/lib/uflow.py @@ -81,8 +81,8 @@ READ_CLASS READ_METHOD - bpf_probe_read(&data.clazz, sizeof(data.clazz), (void *)clazz); - bpf_probe_read(&data.method, sizeof(data.method), (void *)method); + bpf_probe_read_user(&data.clazz, sizeof(data.clazz), (void *)clazz); + bpf_probe_read_user(&data.method, sizeof(data.method), (void *)method); FILTER_CLASS FILTER_METHOD diff --git a/tools/lib/ugc.py b/tools/lib/ugc.py index 8841d5faa..8f4c8dee1 100755 --- a/tools/lib/ugc.py +++ b/tools/lib/ugc.py @@ -140,8 +140,8 @@ def format(self, data): u64 manager = 0, pool = 0; bpf_usdt_readarg(1, ctx, &manager); // ptr to manager name bpf_usdt_readarg(3, ctx, &pool); // ptr to pool name - bpf_probe_read(&event.string1, sizeof(event.string1), (void *)manager); - bpf_probe_read(&event.string2, sizeof(event.string2), (void *)pool); + bpf_probe_read_user(&event.string1, sizeof(event.string1), (void *)manager); + bpf_probe_read_user(&event.string2, sizeof(event.string2), (void *)pool); """ def formatter(e): diff --git a/tools/lib/uobjnew.py b/tools/lib/uobjnew.py index b8eed0f74..f75ba0483 100755 --- a/tools/lib/uobjnew.py +++ b/tools/lib/uobjnew.py @@ -98,7 +98,7 @@ u64 classptr = 0, size = 0; bpf_usdt_readarg(2, ctx, &classptr); bpf_usdt_readarg(4, ctx, &size); - bpf_probe_read(&key.name, sizeof(key.name), (void *)classptr); + bpf_probe_read_user(&key.name, sizeof(key.name), (void *)classptr); valp = allocs.lookup_or_try_init(&key, &zero); if (valp) { valp->total_size += size; @@ -132,7 +132,7 @@ struct val_t *valp, zero = {}; u64 classptr = 0; bpf_usdt_readarg(1, ctx, &classptr); - bpf_probe_read(&key.name, sizeof(key.name), (void *)classptr); + bpf_probe_read_user(&key.name, sizeof(key.name), (void *)classptr); valp = allocs.lookup_or_try_init(&key, &zero); if (valp) { valp->num_allocs += 1; // We don't know the size, unfortunately diff --git a/tools/lib/uthreads.py b/tools/lib/uthreads.py index 90d0a745b..9745b3d59 100755 --- a/tools/lib/uthreads.py +++ b/tools/lib/uthreads.py @@ -80,7 +80,7 @@ bpf_usdt_readarg(1, ctx, &nameptr); bpf_usdt_readarg(3, ctx, &id); bpf_usdt_readarg(4, ctx, &native_id); - bpf_probe_read(&te.name, sizeof(te.name), (void *)nameptr); + bpf_probe_read_user(&te.name, sizeof(te.name), (void *)nameptr); te.runtime_id = id; te.native_id = native_id; __builtin_memcpy(&te.type, type, sizeof(te.type)); diff --git a/tools/mdflush.py b/tools/mdflush.py index f1c68aee9..2abe15cfc 100755 --- a/tools/mdflush.py +++ b/tools/mdflush.py @@ -47,7 +47,7 @@ #else struct gendisk *bi_disk = bio->bi_bdev->bd_disk; #endif - bpf_probe_read(&data.disk, sizeof(data.disk), bi_disk->disk_name); + bpf_probe_read_kernel(&data.disk, sizeof(data.disk), bi_disk->disk_name); events.perf_submit(ctx, &data, sizeof(data)); return 0; } diff --git a/tools/memleak.py b/tools/memleak.py index 9fa6805c6..6cda15066 100755 --- a/tools/memleak.py +++ b/tools/memleak.py @@ -4,8 +4,8 @@ # memory leaks in user-mode processes and the kernel. # # USAGE: memleak [-h] [-p PID] [-t] [-a] [-o OLDER] [-c COMMAND] -# [--combined-only] [-s SAMPLE_RATE] [-T TOP] [-z MIN_SIZE] -# [-Z MAX_SIZE] [-O OBJ] +# [--combined-only] [--wa-missing-free] [-s SAMPLE_RATE] +# [-T TOP] [-z MIN_SIZE] [-Z MAX_SIZE] [-O OBJ] # [interval] [count] # # Licensed under the Apache License, Version 2.0 (the "License") @@ -88,6 +88,8 @@ def run_command_get_pid(command): help="execute and trace the specified command") parser.add_argument("--combined-only", default=False, action="store_true", help="show combined allocation statistics only") +parser.add_argument("--wa-missing-free", default=False, action="store_true", + help="Workaround to alleviate misjudgments when free is missing") parser.add_argument("-s", "--sample-rate", default=1, type=int, help="sample every N-th allocation to decrease the overhead") parser.add_argument("-T", "--top", type=int, default=10, @@ -207,10 +209,12 @@ def run_command_get_pid(command): info.size = *size64; sizes.delete(&pid); - info.timestamp_ns = bpf_ktime_get_ns(); - info.stack_id = stack_traces.get_stackid(ctx, STACK_FLAGS); - allocs.update(&address, &info); - update_statistics_add(info.stack_id, info.size); + if (address != 0) { + info.timestamp_ns = bpf_ktime_get_ns(); + info.stack_id = stack_traces.get_stackid(ctx, STACK_FLAGS); + allocs.update(&address, &info); + update_statistics_add(info.stack_id, info.size); + } if (SHOULD_PRINT) { bpf_trace_printk("alloc exited, size = %lu, result = %lx\\n", @@ -287,7 +291,7 @@ def run_command_get_pid(command): memptrs.delete(&pid); - if (bpf_probe_read(&addr, sizeof(void*), (void*)(size_t)*memptr64)) + if (bpf_probe_read_user(&addr, sizeof(void*), (void*)(size_t)*memptr64)) return 0; u64 addr64 = (u64)(size_t)addr; @@ -330,11 +334,15 @@ def run_command_get_pid(command): bpf_source_kernel = """ TRACEPOINT_PROBE(kmem, kmalloc) { + if (WORKAROUND_MISSING_FREE) + gen_free_enter((struct pt_regs *)args, (void *)args->ptr); gen_alloc_enter((struct pt_regs *)args, args->bytes_alloc); return gen_alloc_exit2((struct pt_regs *)args, (size_t)args->ptr); } TRACEPOINT_PROBE(kmem, kmalloc_node) { + if (WORKAROUND_MISSING_FREE) + gen_free_enter((struct pt_regs *)args, (void *)args->ptr); gen_alloc_enter((struct pt_regs *)args, args->bytes_alloc); return gen_alloc_exit2((struct pt_regs *)args, (size_t)args->ptr); } @@ -344,11 +352,15 @@ def run_command_get_pid(command): } TRACEPOINT_PROBE(kmem, kmem_cache_alloc) { + if (WORKAROUND_MISSING_FREE) + gen_free_enter((struct pt_regs *)args, (void *)args->ptr); gen_alloc_enter((struct pt_regs *)args, args->bytes_alloc); return gen_alloc_exit2((struct pt_regs *)args, (size_t)args->ptr); } TRACEPOINT_PROBE(kmem, kmem_cache_alloc_node) { + if (WORKAROUND_MISSING_FREE) + gen_free_enter((struct pt_regs *)args, (void *)args->ptr); gen_alloc_enter((struct pt_regs *)args, args->bytes_alloc); return gen_alloc_exit2((struct pt_regs *)args, (size_t)args->ptr); } @@ -385,6 +397,10 @@ def run_command_get_pid(command): else: bpf_source += bpf_source_kernel +if kernel_trace: + bpf_source = bpf_source.replace("WORKAROUND_MISSING_FREE", "1" + if args.wa_missing_free else "0") + bpf_source = bpf_source.replace("SHOULD_PRINT", "1" if trace_all else "0") bpf_source = bpf_source.replace("SAMPLE_EVERY_N", str(sample_every_n)) bpf_source = bpf_source.replace("PAGE_SIZE", str(resource.getpagesize())) @@ -434,9 +450,9 @@ def attach_probes(sym, fn_prefix=None, can_fail=False): attach_probes("calloc") attach_probes("realloc") attach_probes("posix_memalign") - attach_probes("valloc") + attach_probes("valloc", can_fail=True) # failed on Android, is deprecated in libc.so from bionic directory attach_probes("memalign") - attach_probes("pvalloc") + attach_probes("pvalloc", can_fail=True) # failed on Android, is deprecated in libc.so from bionic directory attach_probes("aligned_alloc", can_fail=True) # added in C11 bpf.attach_uprobe(name=obj, sym="free", fn_name="free_enter", pid=pid) diff --git a/tools/memleak_example.txt b/tools/memleak_example.txt index 307a9fa51..421801702 100644 --- a/tools/memleak_example.txt +++ b/tools/memleak_example.txt @@ -146,13 +146,33 @@ Note that even though the application leaks 16 bytes of memory every second, the report (printed every 5 seconds) doesn't "see" all the allocations because of the sampling rate applied. +Profiling in memory part is hard to be accurate because of BPF infrastructure. +memleak keeps misjudging memory leak on the complicated environment which has +the action of free in hard/soft irq. +Add workaround to alleviate misjudgments when free is missing: + +# ./memleak --wa-missing-free +Attaching to kernel allocators, Ctrl+C to quit. +... + 248 bytes in 4 allocations from stack + bpf_prog_load [kernel] + sys_bpf [kernel] + + 328 bytes in 1 allocations from stack + perf_mmap [kernel] + mmap_region [kernel] + do_mmap [kernel] + vm_mmap_pgoff [kernel] + sys_mmap_pgoff [kernel] + sys_mmap [kernel] + USAGE message: # ./memleak -h usage: memleak.py [-h] [-p PID] [-t] [-a] [-o OLDER] [-c COMMAND] - [--combined-only] [-s SAMPLE_RATE] [-T TOP] [-z MIN_SIZE] - [-Z MAX_SIZE] [-O OBJ] + [--combined-only] [--wa-missing-free] [-s SAMPLE_RATE] + [-T TOP] [-z MIN_SIZE] [-Z MAX_SIZE] [-O OBJ] [interval] [count] Trace outstanding memory allocations that weren't freed. @@ -177,6 +197,8 @@ optional arguments: -c COMMAND, --command COMMAND execute and trace the specified command --combined-only show combined allocation statistics only + --wa-missing-free Workaround to alleviate misjudgments when free is + missing -s SAMPLE_RATE, --sample-rate SAMPLE_RATE sample every N-th allocation to decrease the overhead -T TOP, --top TOP display only this many top allocating stacks (by size) diff --git a/tools/mountsnoop.py b/tools/mountsnoop.py index 17a2edb61..667ea35cd 100755 --- a/tools/mountsnoop.py +++ b/tools/mountsnoop.py @@ -109,22 +109,22 @@ event.type = EVENT_MOUNT_SOURCE; __builtin_memset(event.str, 0, sizeof(event.str)); - bpf_probe_read(event.str, sizeof(event.str), source); + bpf_probe_read_user(event.str, sizeof(event.str), source); events.perf_submit(ctx, &event, sizeof(event)); event.type = EVENT_MOUNT_TARGET; __builtin_memset(event.str, 0, sizeof(event.str)); - bpf_probe_read(event.str, sizeof(event.str), target); + bpf_probe_read_user(event.str, sizeof(event.str), target); events.perf_submit(ctx, &event, sizeof(event)); event.type = EVENT_MOUNT_TYPE; __builtin_memset(event.str, 0, sizeof(event.str)); - bpf_probe_read(event.str, sizeof(event.str), type); + bpf_probe_read_user(event.str, sizeof(event.str), type); events.perf_submit(ctx, &event, sizeof(event)); event.type = EVENT_MOUNT_DATA; __builtin_memset(event.str, 0, sizeof(event.str)); - bpf_probe_read(event.str, sizeof(event.str), data); + bpf_probe_read_user(event.str, sizeof(event.str), data); events.perf_submit(ctx, &event, sizeof(event)); return 0; @@ -164,7 +164,7 @@ event.type = EVENT_UMOUNT_TARGET; __builtin_memset(event.str, 0, sizeof(event.str)); - bpf_probe_read(event.str, sizeof(event.str), target); + bpf_probe_read_user(event.str, sizeof(event.str), target); events.perf_submit(ctx, &event, sizeof(event)); return 0; diff --git a/tools/mysqld_qslower.py b/tools/mysqld_qslower.py index d867d70fd..33ea7ddd1 100755 --- a/tools/mysqld_qslower.py +++ b/tools/mysqld_qslower.py @@ -81,7 +81,7 @@ def usage(): if (delta >= """ + str(min_ns) + """) { // populate and emit data struct struct data_t data = {.pid = pid, .ts = sp->ts, .delta = delta}; - bpf_probe_read(&data.query, sizeof(data.query), (void *)sp->query); + bpf_probe_read_user(&data.query, sizeof(data.query), (void *)sp->query); events.perf_submit(ctx, &data, sizeof(data)); } diff --git a/tools/netqtop.c b/tools/netqtop.c new file mode 100644 index 000000000..52605ddab --- /dev/null +++ b/tools/netqtop.c @@ -0,0 +1,113 @@ + +#include +#include +#if IFNAMSIZ != 16 +#error "IFNAMSIZ != 16 is not supported" +#endif +#define MAX_QUEUE_NUM 1024 + +/** +* This union is use to store name of the specified interface +* and read it as two different data types +*/ +union name_buf{ + char name[IFNAMSIZ]; + struct { + u64 hi; + u64 lo; + }name_int; +}; + +/* data retrieved in tracepoints */ +struct queue_data{ + u64 total_pkt_len; + u32 num_pkt; + u32 size_64B; + u32 size_512B; + u32 size_2K; + u32 size_16K; + u32 size_64K; +}; + +/* array of length 1 for device name */ +BPF_ARRAY(name_map, union name_buf, 1); +/* table for transmit & receive packets */ +BPF_HASH(tx_q, u16, struct queue_data, MAX_QUEUE_NUM); +BPF_HASH(rx_q, u16, struct queue_data, MAX_QUEUE_NUM); + +static inline int name_filter(struct sk_buff* skb){ + /* get device name from skb */ + union name_buf real_devname; + struct net_device *dev; + bpf_probe_read(&dev, sizeof(skb->dev), ((char *)skb + offsetof(struct sk_buff, dev))); + bpf_probe_read(&real_devname, IFNAMSIZ, dev->name); + + int key=0; + union name_buf *leaf = name_map.lookup(&key); + if(!leaf){ + return 0; + } + if((leaf->name_int).hi != real_devname.name_int.hi || (leaf->name_int).lo != real_devname.name_int.lo){ + return 0; + } + + return 1; +} + +static void updata_data(struct queue_data *data, u64 len){ + data->total_pkt_len += len; + data->num_pkt ++; + if(len / 64 == 0){ + data->size_64B ++; + } + else if(len / 512 == 0){ + data->size_512B ++; + } + else if(len / 2048 == 0){ + data->size_2K ++; + } + else if(len / 16384 == 0){ + data->size_16K ++; + } + else if(len / 65536 == 0){ + data->size_64K ++; + } +} + +TRACEPOINT_PROBE(net, net_dev_start_xmit){ + /* read device name */ + struct sk_buff* skb = (struct sk_buff*)args->skbaddr; + if(!name_filter(skb)){ + return 0; + } + + /* update table */ + u16 qid = skb->queue_mapping; + struct queue_data newdata; + __builtin_memset(&newdata, 0, sizeof(newdata)); + struct queue_data *data = tx_q.lookup_or_try_init(&qid, &newdata); + if(!data){ + return 0; + } + updata_data(data, skb->len); + + return 0; +} + +TRACEPOINT_PROBE(net, netif_receive_skb){ + struct sk_buff* skb = (struct sk_buff*)args->skbaddr; + if(!name_filter(skb)){ + return 0; + } + + u16 qid = skb->queue_mapping; + struct queue_data newdata; + __builtin_memset(&newdata, 0, sizeof(newdata)); + struct queue_data *data = rx_q.lookup_or_try_init(&qid, &newdata); + if(!data){ + return 0; + } + updata_data(data, skb->len); + + return 0; +} diff --git a/tools/netqtop.py b/tools/netqtop.py new file mode 100755 index 000000000..47e9103e4 --- /dev/null +++ b/tools/netqtop.py @@ -0,0 +1,219 @@ +#!/usr/bin/python + +from __future__ import print_function +from bcc import BPF +from ctypes import * +import argparse +import os +from time import sleep,time,localtime,asctime + +# pre defines ------------------------------- +ROOT_PATH = "/sys/class/net" +IFNAMSIZ = 16 +COL_WIDTH = 10 +MAX_QUEUE_NUM = 1024 +EBPF_FILE = "netqtop.c" + +# structure for network interface name array +class Devname(Structure): + _fields_=[ + ('name', c_char*IFNAMSIZ) + ] + +################## printer for results ################### +def to_str(num): + s = "" + if num > 1000000: + return str(round(num/(1024*1024.0), 2)) + 'M' + elif num > 1000: + return str(round(num/1024.0, 2)) + 'K' + else: + if isinstance(num, float): + return str(round(num, 2)) + else: + return str(num) + +def print_table(table, qnum): + global print_interval + + # ---- print headers ---------------- + headers = [ + "QueueID", + "avg_size", + "[0, 64)", + "[64, 512)", + "[512, 2K)", + "[2K, 16K)", + "[16K, 64K)" + ] + if args.throughput: + headers.append("BPS") + headers.append("PPS") + + print(" ", end="") + for hd in headers: + print( "%-11s" % hd, end="") + print() + + # ------- calculates -------------- + qids=[] + tBPS = 0 + tPPS = 0 + tAVG = 0 + tGroup = [0,0,0,0,0] + tpkt = 0 + tlen = 0 + for k, v in table.items(): + qids += [k.value] + tlen += v.total_pkt_len + tpkt += v.num_pkt + tGroup[0] += v.size_64B + tGroup[1] += v.size_512B + tGroup[2] += v.size_2K + tGroup[3] += v.size_16K + tGroup[4] += v.size_64K + tBPS = tlen / print_interval + tPPS = tpkt / print_interval + if tpkt != 0: + tAVG = tlen / tpkt + + # -------- print table -------------- + for k in range(qnum): + if k in qids: + item = table[c_ushort(k)] + data = [ + k, + item.total_pkt_len, + item.num_pkt, + item.size_64B, + item.size_512B, + item.size_2K, + item.size_16K, + item.size_64K + ] + else: + data = [k,0,0,0,0,0,0,0] + + # print a line per queue + avg = 0 + if data[2] != 0: + avg = data[1] / data[2] + print(" %-11d%-11s%-11s%-11s%-11s%-11s%-11s" % ( + data[0], + to_str(avg), + to_str(data[3]), + to_str(data[4]), + to_str(data[5]), + to_str(data[6]), + to_str(data[7]) + ), end="") + if args.throughput: + BPS = data[1] / print_interval + PPS = data[2] / print_interval + print("%-11s%-11s" % ( + to_str(BPS), + to_str(PPS) + )) + else: + print() + + # ------- print total -------------- + print(" Total %-11s%-11s%-11s%-11s%-11s%-11s" % ( + to_str(tAVG), + to_str(tGroup[0]), + to_str(tGroup[1]), + to_str(tGroup[2]), + to_str(tGroup[3]), + to_str(tGroup[4]) + ), end="") + + if args.throughput: + print("%-11s%-11s" % ( + to_str(tBPS), + to_str(tPPS) + )) + else: + print() + + +def print_result(b): + # --------- print tx queues --------------- + print(asctime(localtime(time()))) + print("TX") + table = b['tx_q'] + print_table(table, tx_num) + b['tx_q'].clear() + + # --------- print rx queues --------------- + print("") + print("RX") + table = b['rx_q'] + print_table(table, rx_num) + b['rx_q'].clear() + if args.throughput: + print("-"*95) + else: + print("-"*77) + +############## specify network interface ################# +parser = argparse.ArgumentParser(description="") +parser.add_argument("--name", "-n", type=str, default="") +parser.add_argument("--interval", "-i", type=float, default=1) +parser.add_argument("--throughput", "-t", action="store_true") +parser.add_argument("--ebpf", action="store_true", help=argparse.SUPPRESS) +args = parser.parse_args() + +if args.ebpf: + with open(EBPF_FILE) as fileobj: + progtxt = fileobj.read() + print(progtxt) + exit() + +if args.name == "": + print ("Please specify a network interface.") + exit() +else: + dev_name = args.name + +if len(dev_name) > IFNAMSIZ-1: + print ("NIC name too long") + exit() + +print_interval = args.interval + 0.0 +if print_interval == 0: + print ("print interval must be non-zero") + exit() + +################ get number of queues ##################### +tx_num = 0 +rx_num = 0 +path = ROOT_PATH + "/" + dev_name + "/queues" +if not os.path.exists(path): + print ("Net interface", dev_name, "does not exits.") + exit() + +list = os.listdir(path) +for s in list: + if s[0] == 'r': + rx_num += 1 + if s[0] == 't': + tx_num += 1 + +if tx_num > MAX_QUEUE_NUM or rx_num > MAX_QUEUE_NUM: + print ("number of queues over 1024 is not supported.") + exit() + +################## start tracing ################## +b = BPF(src_file = EBPF_FILE) +# --------- set hash array -------- +devname_map = b['name_map'] +_name = Devname() +_name.name = dev_name.encode() +devname_map[0] = _name + +while 1: + try: + sleep(print_interval) + print_result(b) + except KeyboardInterrupt: + exit() diff --git a/tools/netqtop_example.txt b/tools/netqtop_example.txt new file mode 100644 index 000000000..443cfb715 --- /dev/null +++ b/tools/netqtop_example.txt @@ -0,0 +1,190 @@ +Demonstrations of netqtop. + + +netqtop traces the kernel functions performing packet transmit (xmit_one) +and packet receive (__netif_receive_skb_core) on data link layer. The tool +not only traces every packet via a specified network interface, but also accounts +the PPS, BPS and average size of packets as well as packet amounts (categorized by +size range) on sending and receiving direction respectively. Results are printed +as tables, which can be used to understand traffic load allocation on each queue +of interested network interface to see if it is balanced. And the overall performance +is provided in the buttom. + +For example, suppose you want to know current traffic on lo, and print result +every second: +# ./netqtop.py -n lo -i 1 +Thu Sep 10 11:28:39 2020 +TX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) + 0 88 0 9 0 0 0 + Total 88 0 9 0 0 0 + +RX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) + 0 74 4 5 0 0 0 + Total 74 4 5 0 0 0 +---------------------------------------------------------------------------- +Thu Sep 10 11:28:40 2020 +TX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) + 0 233 0 3 1 0 0 + Total 233 0 3 1 0 0 + +RX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) + 0 219 2 1 1 0 0 + Total 219 2 1 1 0 0 +---------------------------------------------------------------------------- + +or you can just use the default mode +# ./netqtop.py -n lo +Thu Sep 10 11:27:45 2020 +TX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) + 0 92 0 7 0 0 0 + Total 92 0 7 0 0 0 + +RX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) + 0 78 3 4 0 0 0 + Total 78 3 4 0 0 0 +---------------------------------------------------------------------------- +Thu Sep 10 11:27:46 2020 +TX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) + 0 179 0 5 1 0 0 + Total 179 0 5 1 0 0 + +RX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) + 0 165 3 2 1 0 0 + Total 165 3 2 1 0 0 +---------------------------------------------------------------------------- + +This NIC only has 1 queue. +If you want the tool to print results after a longer interval, specify seconds with -i: +# ./netqtop.py -n lo -i 3 +Thu Sep 10 11:31:26 2020 +TX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) + 0 85 0 11 0 0 0 + Total 85 0 11 0 0 0 + +RX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) + 0 71 5 6 0 0 0 + Total 71 5 6 0 0 0 +---------------------------------------------------------------------------- +Thu Sep 10 11:31:29 2020 +TX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) + 0 153 0 7 1 0 0 + Total 153 0 7 1 0 0 + +RX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) + 0 139 4 3 1 0 0 + Total 139 4 3 1 0 0 +---------------------------------------------------------------------------- + +To see PPS and BPS of each queue, use -t: +# ./netqtop.py -n lo -i 1 -t +Thu Sep 10 11:37:02 2020 +TX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) BPS PPS + 0 114 0 10 0 0 0 1.11K 10.0 + Total 114 0 10 0 0 0 1.11K 10.0 + +RX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) BPS PPS + 0 100 4 6 0 0 0 1000.0 10.0 + Total 100 4 6 0 0 0 1000.0 10.0 +----------------------------------------------------------------------------------------------- +Thu Sep 10 11:37:03 2020 +TX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) BPS PPS + 0 271 0 3 1 0 0 1.06K 4.0 + Total 271 0 3 1 0 0 1.06K 4.0 + +RX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) BPS PPS + 0 257 2 1 1 0 0 1.0K 4.0 + Total 257 2 1 1 0 0 1.0K 4.0 +----------------------------------------------------------------------------------------------- + +When filtering multi-queue NICs, you do not need to specify the number of queues, +the tool calculates it for you: +# ./netqtop.py -n eth0 -t +Thu Sep 10 11:39:21 2020 +TX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) BPS PPS + 0 0 0 0 0 0 0 0.0 0.0 + 1 0 0 0 0 0 0 0.0 0.0 + 2 0 0 0 0 0 0 0.0 0.0 + 3 0 0 0 0 0 0 0.0 0.0 + 4 0 0 0 0 0 0 0.0 0.0 + 5 0 0 0 0 0 0 0.0 0.0 + 6 0 0 0 0 0 0 0.0 0.0 + 7 0 0 0 0 0 0 0.0 0.0 + 8 54 2 0 0 0 0 108.0 2.0 + 9 161 0 9 0 0 0 1.42K 9.0 + 10 0 0 0 0 0 0 0.0 0.0 + 11 0 0 0 0 0 0 0.0 0.0 + 12 0 0 0 0 0 0 0.0 0.0 + 13 0 0 0 0 0 0 0.0 0.0 + 14 0 0 0 0 0 0 0.0 0.0 + 15 0 0 0 0 0 0 0.0 0.0 + 16 0 0 0 0 0 0 0.0 0.0 + 17 0 0 0 0 0 0 0.0 0.0 + 18 0 0 0 0 0 0 0.0 0.0 + 19 0 0 0 0 0 0 0.0 0.0 + 20 0 0 0 0 0 0 0.0 0.0 + 21 0 0 0 0 0 0 0.0 0.0 + 22 0 0 0 0 0 0 0.0 0.0 + 23 0 0 0 0 0 0 0.0 0.0 + 24 0 0 0 0 0 0 0.0 0.0 + 25 0 0 0 0 0 0 0.0 0.0 + 26 0 0 0 0 0 0 0.0 0.0 + 27 0 0 0 0 0 0 0.0 0.0 + 28 0 0 0 0 0 0 0.0 0.0 + 29 0 0 0 0 0 0 0.0 0.0 + 30 0 0 0 0 0 0 0.0 0.0 + 31 0 0 0 0 0 0 0.0 0.0 + Total 141 2 9 0 0 0 1.52K 11.0 + +RX + QueueID avg_size [0, 64) [64, 512) [512, 2K) [2K, 16K) [16K, 64K) BPS PPS + 0 127 3 9 0 0 0 1.5K 12.0 + 1 0 0 0 0 0 0 0.0 0.0 + 2 0 0 0 0 0 0 0.0 0.0 + 3 0 0 0 0 0 0 0.0 0.0 + 4 0 0 0 0 0 0 0.0 0.0 + 5 0 0 0 0 0 0 0.0 0.0 + 6 0 0 0 0 0 0 0.0 0.0 + 7 0 0 0 0 0 0 0.0 0.0 + 8 0 0 0 0 0 0 0.0 0.0 + 9 0 0 0 0 0 0 0.0 0.0 + 10 0 0 0 0 0 0 0.0 0.0 + 11 0 0 0 0 0 0 0.0 0.0 + 12 0 0 0 0 0 0 0.0 0.0 + 13 0 0 0 0 0 0 0.0 0.0 + 14 0 0 0 0 0 0 0.0 0.0 + 15 0 0 0 0 0 0 0.0 0.0 + 16 0 0 0 0 0 0 0.0 0.0 + 17 0 0 0 0 0 0 0.0 0.0 + 18 0 0 0 0 0 0 0.0 0.0 + 19 0 0 0 0 0 0 0.0 0.0 + 20 0 0 0 0 0 0 0.0 0.0 + 21 0 0 0 0 0 0 0.0 0.0 + 22 0 0 0 0 0 0 0.0 0.0 + 23 0 0 0 0 0 0 0.0 0.0 + 24 0 0 0 0 0 0 0.0 0.0 + 25 0 0 0 0 0 0 0.0 0.0 + 26 0 0 0 0 0 0 0.0 0.0 + 27 0 0 0 0 0 0 0.0 0.0 + 28 0 0 0 0 0 0 0.0 0.0 + 29 0 0 0 0 0 0 0.0 0.0 + 30 0 0 0 0 0 0 0.0 0.0 + 31 0 0 0 0 0 0 0.0 0.0 + Total 127 3 9 0 0 0 1.5K 12.0 +----------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/tools/nfsdist.py b/tools/nfsdist.py index ff78506f6..2243d4070 100755 --- a/tools/nfsdist.py +++ b/tools/nfsdist.py @@ -137,16 +137,21 @@ # common file functions b.attach_kprobe(event="nfs_file_read", fn_name="trace_entry") b.attach_kprobe(event="nfs_file_write", fn_name="trace_entry") -b.attach_kprobe(event="nfs4_file_open", fn_name="trace_entry") b.attach_kprobe(event="nfs_file_open", fn_name="trace_entry") b.attach_kprobe(event="nfs_getattr", fn_name="trace_entry") b.attach_kretprobe(event="nfs_file_read", fn_name="trace_read_return") b.attach_kretprobe(event="nfs_file_write", fn_name="trace_write_return") -b.attach_kretprobe(event="nfs4_file_open", fn_name="trace_open_return") b.attach_kretprobe(event="nfs_file_open", fn_name="trace_open_return") b.attach_kretprobe(event="nfs_getattr", fn_name="trace_getattr_return") +if BPF.get_kprobe_functions(b'nfs4_file_open'): + b.attach_kprobe(event="nfs4_file_open", fn_name="trace_entry") + b.attach_kretprobe(event="nfs4_file_open", fn_name="trace_open_return") +else: + b.attach_kprobe(event="nfs_file_open", fn_name="trace_entry") + b.attach_kretprobe(event="nfs_file_open", fn_name="trace_open_return") + print("Tracing NFS operation latency... Hit Ctrl-C to end.") # output diff --git a/tools/nfsslower.py b/tools/nfsslower.py index 5e344b9b4..6b94f34f7 100755 --- a/tools/nfsslower.py +++ b/tools/nfsslower.py @@ -190,18 +190,18 @@ struct qstr qs = {}; if(type == TRACE_GETATTR) { - bpf_probe_read(&de,sizeof(de), &valp->d); + bpf_probe_read_kernel(&de,sizeof(de), &valp->d); } else { - bpf_probe_read(&de, sizeof(de), &valp->fp->f_path.dentry); + bpf_probe_read_kernel(&de, sizeof(de), &valp->fp->f_path.dentry); } - bpf_probe_read(&qs, sizeof(qs), (void *)&de->d_name); + bpf_probe_read_kernel(&qs, sizeof(qs), (void *)&de->d_name); if (qs.len == 0) return 0; - bpf_probe_read(&data.file, sizeof(data.file), (void *)qs.name); + bpf_probe_read_kernel(&data.file, sizeof(data.file), (void *)qs.name); // output events.perf_submit(ctx, &data, sizeof(data)); return 0; diff --git a/tools/offwaketime.py b/tools/offwaketime.py index 665b66661..117c6e794 100755 --- a/tools/offwaketime.py +++ b/tools/offwaketime.py @@ -20,6 +20,16 @@ # arg validation def positive_int(val): + dest = [] + # Filter up to 5 pids, arbitrary + args_list = val.split(",", 5) + pids_to_add = min(len(args_list), 5) + for i in range(pids_to_add): + dest.append(_positive_int(args_list[i])) + + return dest + +def _positive_int(val): try: ival = int(val) except ValueError: @@ -30,11 +40,21 @@ def positive_int(val): return ival def positive_nonzero_int(val): - ival = positive_int(val) + ival = _positive_int(val) if ival == 0: raise argparse.ArgumentTypeError("must be nonzero") return ival +def build_filter(filter_name, values): + filter_string = "((%s == %d)" % (filter_name, values[0]) + + for val in values[1:]: + filter_string += " || (%s == %d )" % (filter_name , val) + + filter_string += ")" + + return filter_string + def stack_id_err(stack_id): # -EFAULT in get_stackid normally means the stack-trace is not available, # Such as getting kernel stack trace in userspace code @@ -61,10 +81,12 @@ def stack_id_err(stack_id): thread_group = parser.add_mutually_exclusive_group() # Note: this script provides --pid and --tid flags but their arguments are # referred to internally using kernel nomenclature: TGID and PID. -thread_group.add_argument("-p", "--pid", metavar="PID", dest="tgid", - help="trace this PID only", type=positive_int) -thread_group.add_argument("-t", "--tid", metavar="TID", dest="pid", - help="trace this TID only", type=positive_int) +thread_group.add_argument("-p", "--pid", metavar="PIDS", dest="tgid", + type=positive_int, + help="trace these PIDS only. Can be a comma separated list of PIDS.") +thread_group.add_argument("-t", "--tid", metavar="TIDS", dest="pid", + type=positive_int, + help="trace these TIDS only. Can be a comma separated list of TIDS.") thread_group.add_argument("-u", "--user-threads-only", action="store_true", help="user threads only (no kernel threads)") thread_group.add_argument("-k", "--kernel-threads-only", action="store_true", @@ -93,6 +115,9 @@ def stack_id_err(stack_id): type=positive_nonzero_int, help="the amount of time in microseconds under which we " + "store traces (default U64_MAX)") +parser.add_argument("--state", type=_positive_int, + help="filter on this thread state bitmask (eg, 2 == TASK_UNINTERRUPTIBLE" + + ") see include/linux/sched.h") parser.add_argument("--ebpf", action="store_true", help=argparse.SUPPRESS) args = parser.parse_args() @@ -147,7 +172,7 @@ def signal_ignore(signal, frame): u32 pid = p->pid; u32 tgid = p->tgid; - if (!(THREAD_FILTER)) { + if (!((THREAD_FILTER) && (STATE_FILTER))) { return 0; } @@ -171,7 +196,7 @@ def signal_ignore(signal, frame): u64 ts = bpf_ktime_get_ns(); // Record timestamp for the previous Process (Process going into waiting) - if (THREAD_FILTER) { + if ((THREAD_FILTER) && (STATE_FILTER)) { start.update(&pid, &ts); } @@ -218,23 +243,25 @@ def signal_ignore(signal, frame): """ # set thread filter -thread_context = "" if args.tgid is not None: - thread_context = "PID %d" % args.tgid - thread_filter = 'tgid == %d' % args.tgid + thread_filter = build_filter("tgid", args.tgid) elif args.pid is not None: - thread_context = "TID %d" % args.pid - thread_filter = 'pid == %d' % args.pid + thread_filter = build_filter("pid", args.pid) elif args.user_threads_only: - thread_context = "user threads" thread_filter = '!(p->flags & PF_KTHREAD)' elif args.kernel_threads_only: - thread_context = "kernel threads" thread_filter = 'p->flags & PF_KTHREAD' else: - thread_context = "all threads" thread_filter = '1' +if args.state == 0: + state_filter = 'p->state == 0' +elif args.state: + # these states are sometimes bitmask checked + state_filter = 'p->state & %d' % args.state +else: + state_filter = '1' bpf_text = bpf_text.replace('THREAD_FILTER', thread_filter) +bpf_text = bpf_text.replace('STATE_FILTER', state_filter) # set stack storage size bpf_text = bpf_text.replace('STACK_STORAGE_SIZE', str(args.stack_storage_size)) diff --git a/tools/offwaketime_example.txt b/tools/offwaketime_example.txt index 8291e2f76..26bfb3924 100644 --- a/tools/offwaketime_example.txt +++ b/tools/offwaketime_example.txt @@ -307,7 +307,7 @@ USAGE message: # ./offwaketime -h usage: offwaketime [-h] [-p PID | -t TID | -u | -k] [-U | -K] [-d] [-f] [--stack-storage-size STACK_STORAGE_SIZE] - [-m MIN_BLOCK_TIME] [-M MAX_BLOCK_TIME] + [-m MIN_BLOCK_TIME] [-M MAX_BLOCK_TIME] [--state STATE] [duration] Summarize blocked time by kernel stack trace + waker stack @@ -317,8 +317,10 @@ positional arguments: optional arguments: -h, --help show this help message and exit - -p PID, --pid PID trace this PID only - -t TID, --tid TID trace this TID only + -p PID, --pid PID trace these PIDS only. Can be a comma separated list of + PID. + -t TID, --tid TID trace these TIDS only. Can be a comma separated list of + TIDS. -u, --user-threads-only user threads only (no kernel threads) -k, --kernel-threads-only @@ -340,6 +342,8 @@ optional arguments: -M MAX_BLOCK_TIME, --max-block-time MAX_BLOCK_TIME the amount of time in microseconds under which we store traces (default U64_MAX) + --state STATE filter on this thread state bitmask (eg, 2 == + TASK_UNINTERRUPTIBLE) see include/linux/sched.h examples: ./offwaketime # trace off-CPU + waker stack time until Ctrl-C diff --git a/tools/old/biosnoop.py b/tools/old/biosnoop.py index 37ee3f9cb..847ab91bd 100755 --- a/tools/old/biosnoop.py +++ b/tools/old/biosnoop.py @@ -98,7 +98,7 @@ b.attach_kprobe(event="blk_account_io_start", fn_name="trace_pid_start") b.attach_kprobe(event="blk_start_request", fn_name="trace_req_start") b.attach_kprobe(event="blk_mq_start_request", fn_name="trace_req_start") -b.attach_kprobe(event="blk_account_io_completion", +b.attach_kprobe(event="blk_account_io_done", fn_name="trace_req_completion") # header diff --git a/tools/oomkill.py b/tools/oomkill.py index 4f3b6ce75..3d6e927b7 100755 --- a/tools/oomkill.py +++ b/tools/oomkill.py @@ -26,8 +26,8 @@ #include struct data_t { - u64 fpid; - u64 tpid; + u32 fpid; + u32 tpid; u64 pages; char fcomm[TASK_COMM_LEN]; char tcomm[TASK_COMM_LEN]; @@ -40,12 +40,12 @@ unsigned long totalpages; struct task_struct *p = oc->chosen; struct data_t data = {}; - u32 pid = bpf_get_current_pid_tgid(); + u32 pid = bpf_get_current_pid_tgid() >> 32; data.fpid = pid; data.tpid = p->pid; data.pages = oc->totalpages; bpf_get_current_comm(&data.fcomm, sizeof(data.fcomm)); - bpf_probe_read(&data.tcomm, sizeof(data.tcomm), p->comm); + bpf_probe_read_kernel(&data.tcomm, sizeof(data.tcomm), p->comm); events.perf_submit(ctx, &data, sizeof(data)); } """ diff --git a/tools/opensnoop.py b/tools/opensnoop.py index 6d1388b3c..3b508875f 100755 --- a/tools/opensnoop.py +++ b/tools/opensnoop.py @@ -17,6 +17,7 @@ from __future__ import print_function from bcc import ArgString, BPF +from bcc.containers import filter_by_containers from bcc.utils import printb import argparse from datetime import datetime, timedelta @@ -35,7 +36,8 @@ ./opensnoop -n main # only print process names containing "main" ./opensnoop -e # show extended fields ./opensnoop -f O_WRONLY -f O_RDWR # only print calls for writing - ./opensnoop --cgroupmap ./mappath # only trace cgroups in this BPF map + ./opensnoop --cgroupmap mappath # only trace cgroups in this BPF map + ./opensnoop --mntnsmap mappath # only trace mount namespaces in the map """ parser = argparse.ArgumentParser( description="Trace open() syscalls", @@ -53,6 +55,8 @@ help="trace this TID only") parser.add_argument("--cgroupmap", help="trace cgroups in this BPF map only") +parser.add_argument("--mntnsmap", + help="trace mount namespaces in this BPF map only") parser.add_argument("-u", "--uid", help="trace this UID only") parser.add_argument("-d", "--duration", @@ -102,14 +106,58 @@ int flags; // EXTENDED_STRUCT_MEMBER }; -#if CGROUPSET -BPF_TABLE_PINNED("hash", u64, u64, cgroupset, 1024, "CGROUPPATH"); -#endif -BPF_HASH(infotmp, u64, struct val_t); BPF_PERF_OUTPUT(events); +""" -int trace_entry(struct pt_regs *ctx, int dfd, const char __user *filename, int flags) +bpf_text_kprobe = """ +BPF_HASH(infotmp, u64, struct val_t); + +int trace_return(struct pt_regs *ctx) { + u64 id = bpf_get_current_pid_tgid(); + struct val_t *valp; + struct data_t data = {}; + + u64 tsp = bpf_ktime_get_ns(); + + valp = infotmp.lookup(&id); + if (valp == 0) { + // missed entry + return 0; + } + bpf_probe_read_kernel(&data.comm, sizeof(data.comm), valp->comm); + bpf_probe_read_user(&data.fname, sizeof(data.fname), (void *)valp->fname); + data.id = valp->id; + data.ts = tsp / 1000; + data.uid = bpf_get_current_uid_gid(); + data.flags = valp->flags; // EXTENDED_STRUCT_MEMBER + data.ret = PT_REGS_RC(ctx); + + events.perf_submit(ctx, &data, sizeof(data)); + infotmp.delete(&id); + + return 0; +} +""" + +bpf_text_kprobe_header_open = """ +int syscall__trace_entry_open(struct pt_regs *ctx, const char __user *filename, int flags) +{ +""" + +bpf_text_kprobe_header_openat = """ +int syscall__trace_entry_openat(struct pt_regs *ctx, int dfd, const char __user *filename, int flags) +{ +""" + +bpf_text_kprobe_header_openat2 = """ +#include +int syscall__trace_entry_openat2(struct pt_regs *ctx, int dfd, const char __user *filename, struct open_how *how) +{ + int flags = how->flags; +""" + +bpf_text_kprobe_body = """ struct val_t val = {}; u64 id = bpf_get_current_pid_tgid(); u32 pid = id >> 32; // PID is higher part @@ -119,12 +167,11 @@ PID_TID_FILTER UID_FILTER FLAGS_FILTER -#if CGROUPSET - u64 cgroupid = bpf_get_current_cgroup_id(); - if (cgroupset.lookup(&cgroupid) == NULL) { - return 0; + + if (container_should_be_filtered()) { + return 0; } -#endif + if (bpf_get_current_comm(&val.comm, sizeof(val.comm)) == 0) { val.id = id; val.fname = filename; @@ -134,34 +181,112 @@ return 0; }; +""" -int trace_return(struct pt_regs *ctx) +bpf_text_kfunc_header_open = """ +#if defined(CONFIG_ARCH_HAS_SYSCALL_WRAPPER) && !defined(__s390x__) +KRETFUNC_PROBE(FNNAME, struct pt_regs *regs, int ret) { + const char __user *filename = (char *)PT_REGS_PARM1(regs); + int flags = PT_REGS_PARM2(regs); +#else +KRETFUNC_PROBE(FNNAME, const char __user *filename, int flags, int ret) +{ +#endif +""" + +bpf_text_kfunc_header_openat = """ +#if defined(CONFIG_ARCH_HAS_SYSCALL_WRAPPER) && !defined(__s390x__) +KRETFUNC_PROBE(FNNAME, struct pt_regs *regs, int ret) +{ + int dfd = PT_REGS_PARM1(regs); + const char __user *filename = (char *)PT_REGS_PARM2(regs); + int flags = PT_REGS_PARM3(regs); +#else +KRETFUNC_PROBE(FNNAME, int dfd, const char __user *filename, int flags, int ret) +{ +#endif +""" + +bpf_text_kfunc_header_openat2 = """ +#include +#if defined(CONFIG_ARCH_HAS_SYSCALL_WRAPPER) && !defined(__s390x__) +KRETFUNC_PROBE(FNNAME, struct pt_regs *regs, int ret) +{ + int dfd = PT_REGS_PARM1(regs); + const char __user *filename = (char *)PT_REGS_PARM2(regs); + struct open_how __user *how = (struct open_how *)PT_REGS_PARM3(regs); + int flags = how->flags; +#else +KRETFUNC_PROBE(FNNAME, int dfd, const char __user *filename, struct open_how __user *how, int ret) +{ + int flags = how->flags; +#endif +""" + +bpf_text_kfunc_body = """ u64 id = bpf_get_current_pid_tgid(); - struct val_t *valp; + u32 pid = id >> 32; // PID is higher part + u32 tid = id; // Cast and get the lower part + u32 uid = bpf_get_current_uid_gid(); + + PID_TID_FILTER + UID_FILTER + FLAGS_FILTER + if (container_should_be_filtered()) { + return 0; + } + struct data_t data = {}; + bpf_get_current_comm(&data.comm, sizeof(data.comm)); u64 tsp = bpf_ktime_get_ns(); - valp = infotmp.lookup(&id); - if (valp == 0) { - // missed entry - return 0; - } - bpf_probe_read(&data.comm, sizeof(data.comm), valp->comm); - bpf_probe_read(&data.fname, sizeof(data.fname), (void *)valp->fname); - data.id = valp->id; - data.ts = tsp / 1000; - data.uid = bpf_get_current_uid_gid(); - data.flags = valp->flags; // EXTENDED_STRUCT_MEMBER - data.ret = PT_REGS_RC(ctx); + bpf_probe_read_user(&data.fname, sizeof(data.fname), (void *)filename); + data.id = id; + data.ts = tsp / 1000; + data.uid = bpf_get_current_uid_gid(); + data.flags = flags; // EXTENDED_STRUCT_MEMBER + data.ret = ret; events.perf_submit(ctx, &data, sizeof(data)); - infotmp.delete(&id); return 0; } """ + +b = BPF(text='') +# open and openat are always in place since 2.6.16 +fnname_open = b.get_syscall_prefix().decode() + 'open' +fnname_openat = b.get_syscall_prefix().decode() + 'openat' +fnname_openat2 = b.get_syscall_prefix().decode() + 'openat2' +if b.ksymname(fnname_openat2) == -1: + fnname_openat2 = None + +is_support_kfunc = BPF.support_kfunc() +if is_support_kfunc: + bpf_text += bpf_text_kfunc_header_open.replace('FNNAME', fnname_open) + bpf_text += bpf_text_kfunc_body + + bpf_text += bpf_text_kfunc_header_openat.replace('FNNAME', fnname_openat) + bpf_text += bpf_text_kfunc_body + + if fnname_openat2: + bpf_text += bpf_text_kfunc_header_openat2.replace('FNNAME', fnname_openat2) + bpf_text += bpf_text_kfunc_body +else: + bpf_text += bpf_text_kprobe + + bpf_text += bpf_text_kprobe_header_open + bpf_text += bpf_text_kprobe_body + + bpf_text += bpf_text_kprobe_header_openat + bpf_text += bpf_text_kprobe_body + + if fnname_openat2: + bpf_text += bpf_text_kprobe_header_openat2 + bpf_text += bpf_text_kprobe_body + if args.tid: # TID trumps PID bpf_text = bpf_text.replace('PID_TID_FILTER', 'if (tid != %s) { return 0; }' % args.tid) @@ -175,11 +300,7 @@ 'if (uid != %s) { return 0; }' % args.uid) else: bpf_text = bpf_text.replace('UID_FILTER', '') -if args.cgroupmap: - bpf_text = bpf_text.replace('CGROUPSET', '1') - bpf_text = bpf_text.replace('CGROUPPATH', args.cgroupmap) -else: - bpf_text = bpf_text.replace('CGROUPSET', '0') +bpf_text = filter_by_containers(args) + bpf_text if args.flag_filter: bpf_text = bpf_text.replace('FLAGS_FILTER', 'if (!(flags & %d)) { return 0; }' % flag_filter_mask) @@ -195,8 +316,16 @@ # initialize BPF b = BPF(text=bpf_text) -b.attach_kprobe(event="do_sys_open", fn_name="trace_entry") -b.attach_kretprobe(event="do_sys_open", fn_name="trace_return") +if not is_support_kfunc: + b.attach_kprobe(event=fnname_open, fn_name="syscall__trace_entry_open") + b.attach_kretprobe(event=fnname_open, fn_name="trace_return") + + b.attach_kprobe(event=fnname_openat, fn_name="syscall__trace_entry_openat") + b.attach_kretprobe(event=fnname_openat, fn_name="trace_return") + + if fnname_openat2: + b.attach_kprobe(event=fnname_openat2, fn_name="syscall__trace_entry_openat2") + b.attach_kretprobe(event=fnname_openat2, fn_name="trace_return") initial_ts = 0 diff --git a/tools/opensnoop_example.txt b/tools/opensnoop_example.txt index 44f0e337d..f15e84f2b 100644 --- a/tools/opensnoop_example.txt +++ b/tools/opensnoop_example.txt @@ -187,14 +187,15 @@ with an externally created map. # ./opensnoop --cgroupmap /sys/fs/bpf/test01 -For more details, see docs/filtering_by_cgroups.md +For more details, see docs/special_filtering.md USAGE message: # ./opensnoop -h -usage: opensnoop [-h] [-T] [-x] [-p PID] [-t TID] [-d DURATION] [-n NAME] - [-e] [-f FLAG_FILTER] +usage: opensnoop.py [-h] [-T] [-U] [-x] [-p PID] [-t TID] + [--cgroupmap CGROUPMAP] [--mntnsmap MNTNSMAP] [-u UID] + [-d DURATION] [-n NAME] [-e] [-f FLAG_FILTER] Trace open() syscalls @@ -205,6 +206,9 @@ optional arguments: -x, --failed only show failed opens -p PID, --pid PID trace this PID only -t TID, --tid TID trace this TID only + --cgroupmap CGROUPMAP + trace cgroups in this BPF map only + --mntnsmap MNTNSMAP trace mount namespaces in this BPF map on -u UID, --uid UID trace this UID only -d DURATION, --duration DURATION total duration of trace in seconds @@ -226,3 +230,5 @@ examples: ./opensnoop -n main # only print process names containing "main" ./opensnoop -e # show extended fields ./opensnoop -f O_WRONLY -f O_RDWR # only print calls for writing + ./opensnoop --cgroupmap mappath # only trace cgroups in this BPF map + ./opensnoop --mntnsmap mappath # only trace mount namespaces in the map diff --git a/tools/profile.py b/tools/profile.py index b710b797a..093d07c5f 100755 --- a/tools/profile.py +++ b/tools/profile.py @@ -24,10 +24,11 @@ # # 15-Jul-2016 Brendan Gregg Created this. # 20-Oct-2016 " " Switched to use the new 4.9 support. -# 26-Jan-2019 " " Changed to exclude CPU idle by default. +# 26-Jan-2019 " " Changed to exclude CPU idle by default. from __future__ import print_function from bcc import BPF, PerfType, PerfSWConfig +from bcc.containers import filter_by_containers from sys import stderr from time import sleep import argparse @@ -72,6 +73,8 @@ def stack_id_err(stack_id): ./profile -L 185 # only profile thread with TID 185 ./profile -U # only show user space stacks (no kernel) ./profile -K # only show kernel space stacks (no user) + ./profile --cgroupmap mappath # only trace cgroups in this BPF map + ./profile --mntnsmap mappath # only trace mount namespaces in the map """ parser = argparse.ArgumentParser( description="Profile CPU stack traces at a timed interval", @@ -112,6 +115,10 @@ def stack_id_err(stack_id): help="cpu number to run profile on") parser.add_argument("--ebpf", action="store_true", help=argparse.SUPPRESS) +parser.add_argument("--cgroupmap", + help="trace cgroups in this BPF map only") +parser.add_argument("--mntnsmap", + help="trace mount namespaces in this BPF map only") # option logic args = parser.parse_args() @@ -156,6 +163,10 @@ def stack_id_err(stack_id): if (!(THREAD_FILTER)) return 0; + if (container_should_be_filtered()) { + return 0; + } + // create map key struct key_t key = {.pid = tgid}; bpf_get_current_comm(&key.name, sizeof(key.name)); @@ -232,6 +243,7 @@ def stack_id_err(stack_id): stack_context = "user + kernel" bpf_text = bpf_text.replace('USER_STACK_GET', user_stack_get) bpf_text = bpf_text.replace('KERNEL_STACK_GET', kernel_stack_get) +bpf_text = filter_by_containers(args) + bpf_text sample_freq = 0 sample_period = 0 @@ -293,19 +305,18 @@ def aksym(addr): # output stacks missing_stacks = 0 -has_enomem = False +has_collision = False counts = b.get_table("counts") stack_traces = b.get_table("stack_traces") -need_delimiter = args.delimited and not (args.kernel_stacks_only or - args.user_stacks_only) for k, v in sorted(counts.items(), key=lambda counts: counts[1].value): # handle get_stackid errors if not args.user_stacks_only and stack_id_err(k.kernel_stack_id): missing_stacks += 1 - has_enomem = has_enomem or k.kernel_stack_id == -errno.ENOMEM + # hash collision (-EEXIST) suggests that the map size may be too small + has_collision = has_collision or k.kernel_stack_id == -errno.EEXIST if not args.kernel_stacks_only and stack_id_err(k.user_stack_id): missing_stacks += 1 - has_enomem = has_enomem or k.user_stack_id == -errno.ENOMEM + has_collision = has_collision or k.user_stack_id == -errno.EEXIST user_stack = [] if k.user_stack_id < 0 else \ stack_traces.walk(k.user_stack_id) @@ -334,7 +345,7 @@ def aksym(addr): else: line.extend([b.sym(addr, k.pid) for addr in reversed(user_stack)]) if not args.user_stacks_only: - line.extend(b["-"] if (need_delimiter and k.kernel_stack_id >= 0 and k.user_stack_id >= 0) else []) + line.extend([b"-"] if (need_delimiter and k.kernel_stack_id >= 0 and k.user_stack_id >= 0) else []) if stack_id_err(k.kernel_stack_id): line.append(b"[Missed Kernel Stack]") else: @@ -361,7 +372,7 @@ def aksym(addr): # check missing if missing_stacks > 0: - enomem_str = "" if not has_enomem else \ + enomem_str = "" if not has_collision else \ " Consider increasing --stack-storage-size." print("WARNING: %d stack traces could not be displayed.%s" % (missing_stacks, enomem_str), diff --git a/tools/profile_example.txt b/tools/profile_example.txt index 9b1e5c2b9..2c7e702a9 100644 --- a/tools/profile_example.txt +++ b/tools/profile_example.txt @@ -703,12 +703,21 @@ WARNING: 8 stack traces could not be displayed. Consider increasing --stack-stor Run ./profile -h to see the default. +The --cgroupmap option filters based on a cgroup set. It is meant to be used +with an externally created map. + +# ./profile --cgroupmap /sys/fs/bpf/test01 + +For more details, see docs/special_filtering.md + USAGE message: # ./profile -h -usage: profile.py [-h] [-p PID | -L TID] [-U | -K] [-F FREQUENCY | -c COUNT] [-d] [-a] - [-I] [-f] [--stack-storage-size STACK_STORAGE_SIZE] [-C CPU] +usage: profile.py [-h] [-p PID | -L TID] [-U | -K] [-F FREQUENCY | -c COUNT] + [-d] [-a] [-I] [-f] + [--stack-storage-size STACK_STORAGE_SIZE] [-C CPU] + [--cgroupmap CGROUPMAP] [--mntnsmap MNTNSMAP] [duration] Profile CPU stack traces at a timed interval @@ -739,6 +748,9 @@ optional arguments: the number of unique stack traces that can be stored and displayed (default 16384) -C CPU, --cpu CPU cpu number to run profile on + --cgroupmap CGROUPMAP + trace cgroups in this BPF map only + --mntnsmap MNTNSMAP trace mount namespaces in this BPF map only examples: ./profile # profile stack traces at 49 Hertz until Ctrl-C @@ -750,3 +762,5 @@ examples: ./profile -L 185 # only profile thread with TID 185 ./profile -U # only show user space stacks (no kernel) ./profile -K # only show kernel space stacks (no user) + ./profile --cgroupmap mappath # only trace cgroups in this BPF map + ./profile --mntnsmap mappath # only trace mount namespaces in the map diff --git a/tools/readahead.py b/tools/readahead.py new file mode 100755 index 000000000..14182d5ac --- /dev/null +++ b/tools/readahead.py @@ -0,0 +1,122 @@ +#!/usr/bin/python +# @lint-avoid-python-3-compatibility-imports +# +# readahead Show performance of read-ahead cache +# For Linux, uses BCC, eBPF +# +# Copyright (c) 2020 Suchakra Sharma +# Licensed under the Apache License, Version 2.0 (the "License") +# This was originally created for the BPF Performance Tools book +# published by Addison Wesley. ISBN-13: 9780136554820 +# When copying or porting, include this comment. +# +# 20-Aug-2020 Suchakra Sharma Ported from bpftrace to BCC + +from __future__ import print_function +from bcc import BPF +from time import sleep +import ctypes as ct +import argparse + +# arguments +examples = """examples: + ./readahead -d 20 # monitor for 10 seconds and generate stats +""" + +parser = argparse.ArgumentParser( + description="Monitor performance of read ahead cache", + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=examples) +parser.add_argument("-d", "--duration", type=int, + help="total duration to monitor for, in seconds") +args = parser.parse_args() +if not args.duration: + args.duration = 99999999 + +# BPF program +program = """ +#include +#include + +BPF_HASH(flag, u32, u8); // used to track if we are in do_page_cache_readahead() +BPF_HASH(birth, struct page*, u64); // used to track timestamps of cache alloc'ed page +BPF_ARRAY(pages); // increment/decrement readahead pages +BPF_HISTOGRAM(dist); + +int entry__do_page_cache_readahead(struct pt_regs *ctx) { + u32 pid; + u8 one = 1; + pid = bpf_get_current_pid_tgid(); + flag.update(&pid, &one); + return 0; +} + +int exit__do_page_cache_readahead(struct pt_regs *ctx) { + u32 pid; + u8 zero = 0; + pid = bpf_get_current_pid_tgid(); + flag.update(&pid, &zero); + return 0; +} + +int exit__page_cache_alloc(struct pt_regs *ctx) { + u32 pid; + u64 ts; + struct page *retval = (struct page*) PT_REGS_RC(ctx); + u32 zero = 0; // static key for accessing pages[0] + pid = bpf_get_current_pid_tgid(); + u8 *f = flag.lookup(&pid); + if (f != NULL && *f == 1) { + ts = bpf_ktime_get_ns(); + birth.update(&retval, &ts); + + u64 *count = pages.lookup(&zero); + if (count) (*count)++; // increment read ahead pages count + } + return 0; +} + +int entry_mark_page_accessed(struct pt_regs *ctx) { + u64 ts, delta; + struct page *arg0 = (struct page *) PT_REGS_PARM1(ctx); + u32 zero = 0; // static key for accessing pages[0] + u64 *bts = birth.lookup(&arg0); + if (bts != NULL) { + delta = bpf_ktime_get_ns() - *bts; + dist.increment(bpf_log2l(delta/1000000)); + + u64 *count = pages.lookup(&zero); + if (count) (*count)--; // decrement read ahead pages count + + birth.delete(&arg0); // remove the entry from hashmap + } + return 0; +} +""" + +b = BPF(text=program) +b.attach_kprobe(event="__do_page_cache_readahead", fn_name="entry__do_page_cache_readahead") +b.attach_kretprobe(event="__do_page_cache_readahead", fn_name="exit__do_page_cache_readahead") +b.attach_kretprobe(event="__page_cache_alloc", fn_name="exit__page_cache_alloc") +b.attach_kprobe(event="mark_page_accessed", fn_name="entry_mark_page_accessed") + +# header +print("Tracing... Hit Ctrl-C to end.") + +# print +def print_stats(): + print() + print("Read-ahead unused pages: %d" % (b["pages"][ct.c_ulong(0)].value)) + print("Histogram of read-ahead used page age (ms):") + print("") + b["dist"].print_log2_hist("age (ms)") + b["dist"].clear() + b["pages"].clear() + +while True: + try: + sleep(args.duration) + print_stats() + except KeyboardInterrupt: + print_stats() + break diff --git a/tools/readahead_example.txt b/tools/readahead_example.txt new file mode 100644 index 000000000..079dbaae7 --- /dev/null +++ b/tools/readahead_example.txt @@ -0,0 +1,60 @@ +Demonstration of readahead, the Linux eBPF/bcc version + +Read-ahead mechanism is used by operation sytems to optimize sequential operations +by reading ahead some pages to avoid more expensive filesystem operations. This tool +shows the performance of the read-ahead caching on the system under a given load to +investigate any caching issues. It shows a count for unused pages in the cache and +also prints a histogram showing how long they have remianed there. + +Usage Scenario +============== + +Consider that you are developing a React Native application which performs aggressive +reads while re-encoding a video in local-storage. Usually such an app would be multi- +layered and have transitional library dependencies. The actual read may be performed +by some unknown native library which may or may not be using hints to the OS, such as +madvise(p, LEN, MADV_SEQUENTIAL). If high IOPS is observed in such an app, running +readahead may pin the issue much faster in this case as the developer digs deeper +into what may be causing this. + +An example where such an issue can surface is: https://github.com/boltdb/bolt/issues/691 + +# readahead -d 30 +Tracing... Hit Ctrl-C to end. +^C +Read-ahead unused pages: 6765 +Histogram of read-ahead used page age (ms): + + age (ms) : count distribution + 0 -> 1 : 4236 |****************************************| + 2 -> 3 : 394 |*** | + 4 -> 7 : 1670 |*************** | + 8 -> 15 : 2132 |******************** | + 16 -> 31 : 401 |*** | + 32 -> 63 : 1256 |*********** | + 64 -> 127 : 2352 |********************** | + 128 -> 255 : 357 |*** | + 256 -> 511 : 369 |*** | + 512 -> 1023 : 366 |*** | + 1024 -> 2047 : 181 |* | + 2048 -> 4095 : 439 |**** | + 4096 -> 8191 : 188 |* | + +In the example above, we recorded system-wide stats for 30 seconds. We can observe that +while most of the pages stayed in the readahead cache for quite less time, after 30 +seconds 6765 pages still remained in the cache, yet unaccessed. + +Note on Kprobes Usage +===================== + +This tool uses Kprobes on the following kernel functions: + +__do_page_cache_readahead() +__page_cache_alloc() +mark_page_accessed() + +Since the tool uses Kprobes, depending on your linux kernel's compilation, these +functions may be inlined and hence not available for Kprobes. To see whether you have +the functions available, check vmlinux source and binary to confirm whether inlining is +happening or not. You can also check /proc/kallsyms on the host and verify if the target +functions are present there before using this tool. diff --git a/tools/runqslower.py b/tools/runqslower.py index 8f790602a..e1583e54b 100755 --- a/tools/runqslower.py +++ b/tools/runqslower.py @@ -28,7 +28,7 @@ # Licensed under the Apache License, Version 2.0 (the "License") # # 02-May-2018 Ivan Babrou Created this. -# 18-Nov-2019 Gergely Bod BUG fix: Use bpf_probe_read_str() to extract the +# 18-Nov-2019 Gergely Bod BUG fix: Use bpf_probe_read_kernel_str() to extract the # process name from 'task_struct* next' in raw tp code. # bpf_get_current_comm() operates on the current task # which might already be different than 'next'. @@ -50,7 +50,7 @@ formatter_class=argparse.RawDescriptionHelpFormatter, epilog=examples) parser.add_argument("min_us", nargs="?", default='10000', - help="minimum run queue latecy to trace, in ms (default 10000)") + help="minimum run queue latency to trace, in us (default 10000)") parser.add_argument("--ebpf", action="store_true", help=argparse.SUPPRESS) @@ -164,8 +164,8 @@ struct task_struct *p = (struct task_struct *)ctx->args[0]; u32 tgid, pid; - bpf_probe_read(&tgid, sizeof(tgid), &p->tgid); - bpf_probe_read(&pid, sizeof(pid), &p->pid); + bpf_probe_read_kernel(&tgid, sizeof(tgid), &p->tgid); + bpf_probe_read_kernel(&pid, sizeof(pid), &p->pid); return trace_enqueue(tgid, pid); } @@ -178,10 +178,10 @@ long state; // ivcsw: treat like an enqueue event and store timestamp - bpf_probe_read(&state, sizeof(long), (const void *)&prev->state); + bpf_probe_read_kernel(&state, sizeof(long), (const void *)&prev->state); if (state == TASK_RUNNING) { - bpf_probe_read(&tgid, sizeof(prev->tgid), &prev->tgid); - bpf_probe_read(&pid, sizeof(prev->pid), &prev->pid); + bpf_probe_read_kernel(&tgid, sizeof(prev->tgid), &prev->tgid); + bpf_probe_read_kernel(&pid, sizeof(prev->pid), &prev->pid); u64 ts = bpf_ktime_get_ns(); if (pid != 0) { if (!(FILTER_PID) && !(FILTER_TGID)) { @@ -191,7 +191,7 @@ } - bpf_probe_read(&pid, sizeof(next->pid), &next->pid); + bpf_probe_read_kernel(&pid, sizeof(next->pid), &next->pid); u64 *tsp, delta_us; @@ -208,7 +208,7 @@ struct data_t data = {}; data.pid = pid; data.delta_us = delta_us; - bpf_probe_read_str(&data.task, sizeof(data.task), next->comm); + bpf_probe_read_kernel_str(&data.task, sizeof(data.task), next->comm); // output events.perf_submit(ctx, &data, sizeof(data)); diff --git a/tools/slabratetop.py b/tools/slabratetop.py index b947e44e1..182dbd1d5 100755 --- a/tools/slabratetop.py +++ b/tools/slabratetop.py @@ -62,7 +62,13 @@ def signal_ignore(signal, frame): bpf_text = """ #include #include -#include + +// memcg_cache_params is a part of kmem_cache, but is not publicly exposed in +// kernel versions 5.4 to 5.8. Define an empty struct for it here to allow the +// bpf program to compile. It has been completely removed in kernel version +// 5.9, but it does not hurt to have it here for versions 5.4 to 5.8. +struct memcg_cache_params {}; + #ifdef CONFIG_SLUB #include #else @@ -88,7 +94,7 @@ def signal_ignore(signal, frame): { struct info_t info = {}; const char *name = cachep->name; - bpf_probe_read(&info.name, sizeof(info.name), name); + bpf_probe_read_kernel(&info.name, sizeof(info.name), name); struct val_t *valp, zero = {}; valp = counts.lookup_or_try_init(&info, &zero); diff --git a/tools/sofdsnoop.py b/tools/sofdsnoop.py index 6df7fcadc..9bd5bb312 100755 --- a/tools/sofdsnoop.py +++ b/tools/sofdsnoop.py @@ -105,7 +105,7 @@ { val->fd_cnt = min(num, MAX_FD); - if (bpf_probe_read(&val->fd[0], MAX_FD * sizeof(int), data)) + if (bpf_probe_read_kernel(&val->fd[0], MAX_FD * sizeof(int), data)) return -1; events.perf_submit(ctx, val, sizeof(*val)); diff --git a/tools/softirqs.py b/tools/softirqs.py index 1e2daf5f9..32bbef5de 100755 --- a/tools/softirqs.py +++ b/tools/softirqs.py @@ -54,6 +54,11 @@ bpf_text = """ #include +typedef struct entry_key { + u32 pid; + u32 cpu; +} entry_key_t; + typedef struct irq_key { u32 vec; u64 slot; @@ -64,17 +69,22 @@ u32 vec; } account_val_t; -BPF_HASH(start, u32, account_val_t); +BPF_HASH(start, entry_key_t, account_val_t); BPF_HASH(iptr, u32); BPF_HISTOGRAM(dist, irq_key_t); TRACEPOINT_PROBE(irq, softirq_entry) { - u32 pid = bpf_get_current_pid_tgid(); account_val_t val = {}; + entry_key_t key = {}; + + key.pid = bpf_get_current_pid_tgid(); + key.cpu = bpf_get_smp_processor_id(); val.ts = bpf_ktime_get_ns(); val.vec = args->vec; - start.update(&pid, &val); + + start.update(&key, &val); + return 0; } @@ -82,12 +92,15 @@ { u64 delta; u32 vec; - u32 pid = bpf_get_current_pid_tgid(); account_val_t *valp; irq_key_t key = {0}; + entry_key_t entry_key = {}; + + entry_key.pid = bpf_get_current_pid_tgid(); + entry_key.cpu = bpf_get_smp_processor_id(); // fetch timestamp and calculate delta - valp = start.lookup(&pid); + valp = start.lookup(&entry_key); if (valp == 0) { return 0; // missed start } @@ -97,7 +110,7 @@ // store as sum or histogram STORE - start.delete(&pid); + start.delete(&entry_key); return 0; } """ diff --git a/tools/solisten.py b/tools/solisten.py index fc066d84b..71c0a296f 100755 --- a/tools/solisten.py +++ b/tools/solisten.py @@ -111,7 +111,7 @@ if (family == AF_INET) { evt.laddr[0] = inet->inet_rcv_saddr; } else if (family == AF_INET6) { - bpf_probe_read(evt.laddr, sizeof(evt.laddr), + bpf_probe_read_kernel(evt.laddr, sizeof(evt.laddr), sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); } diff --git a/tools/sslsniff.py b/tools/sslsniff.py index e48fbb470..0200750fb 100755 --- a/tools/sslsniff.py +++ b/tools/sslsniff.py @@ -16,6 +16,8 @@ from __future__ import print_function from bcc import BPF import argparse +import binascii +import textwrap # arguments examples = """examples: @@ -25,6 +27,7 @@ ./sslsniff --no-openssl # don't show OpenSSL calls ./sslsniff --no-gnutls # don't show GnuTLS calls ./sslsniff --no-nss # don't show NSS calls + ./sslsniff --hexdump # show data as hex instead of trying to decode it as UTF-8 """ parser = argparse.ArgumentParser( description="Sniff SSL data", @@ -43,6 +46,8 @@ help='debug mode.') parser.add_argument("--ebpf", action="store_true", help=argparse.SUPPRESS) +parser.add_argument("--hexdump", action="store_true", dest="hexdump", + help="show data as hexdump instead of trying to decode it as UTF-8") args = parser.parse_args() @@ -72,7 +77,7 @@ bpf_get_current_comm(&__data.comm, sizeof(__data.comm)); if ( buf != 0) { - bpf_probe_read(&__data.v0, sizeof(__data.v0), buf); + bpf_probe_read_user(&__data.v0, sizeof(__data.v0), buf); } perf_SSL_write.perf_submit(ctx, &__data, sizeof(__data)); @@ -108,7 +113,7 @@ bpf_get_current_comm(&__data.comm, sizeof(__data.comm)); if (bufp != 0) { - bpf_probe_read(&__data.v0, sizeof(__data.v0), (char *)*bufp); + bpf_probe_read_user(&__data.v0, sizeof(__data.v0), (char *)*bufp); } bufs.delete(&pid); @@ -192,7 +197,7 @@ def print_event(cpu, data, size, rw, evt): # Filter events by command if args.comm: - if not args.comm == event.comm: + if not args.comm == event.comm.decode('utf-8', 'replace'): return if start == 0: @@ -209,9 +214,13 @@ def print_event(cpu, data, size, rw, evt): " bytes lost) " + "-" * 5 fmt = "%-12s %-18.9f %-16s %-6d %-6d\n%s\n%s\n%s\n\n" + if args.hexdump: + unwrapped_data = binascii.hexlify(event.v0) + data = textwrap.fill(unwrapped_data.decode('utf-8', 'replace'),width=32) + else: + data = event.v0.decode('utf-8', 'replace') print(fmt % (rw, time_s, event.comm.decode('utf-8', 'replace'), - event.pid, event.len, s_mark, - event.v0.decode('utf-8', 'replace'), e_mark)) + event.pid, event.len, s_mark, data, e_mark)) b["perf_SSL_write"].open_perf_buffer(print_event_write) b["perf_SSL_read"].open_perf_buffer(print_event_read) diff --git a/tools/sslsniff_example.txt b/tools/sslsniff_example.txt index 8c5172265..360561f72 100644 --- a/tools/sslsniff_example.txt +++ b/tools/sslsniff_example.txt @@ -9,8 +9,8 @@ text. Useful, for example, to sniff HTTP before encrypted with SSL. Output of tool executing in other shell "curl https://example.com" % sudo python sslsniff.py -FUNC TIME(s) COMM PID LEN -WRITE/SEND 0.000000000 curl 12915 75 +FUNC TIME(s) COMM PID LEN +WRITE/SEND 0.000000000 curl 12915 75 ----- DATA ----- GET / HTTP/1.1 Host: example.com @@ -20,7 +20,7 @@ Accept: */* ----- END DATA ----- -READ/RECV 0.127144585 curl 12915 333 +READ/RECV 0.127144585 curl 12915 333 ----- DATA ----- HTTP/1.1 200 OK Cache-Control: max-age=604800 @@ -38,7 +38,7 @@ Content-Length: 1270 ----- END DATA ----- -READ/RECV 0.129967972 curl 12915 1270 +READ/RECV 0.129967972 curl 12915 1270 ----- DATA ----- @@ -54,18 +54,58 @@ READ/RECV 0.129967972 curl 12915 1270 margin: 0; padding: 0; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; - + } div { w ----- END DATA (TRUNCATED, 798 bytes lost) ----- +Using the --hexdump option you will get the exact same output, only the lines +between DATA and END DATA will differ. Those will be replaced with a 16 byte +(32 characters) wide hex-dump, an example of a block of output from sslsniff +called with that option is +READ/RECV 7.405609173 curl 201942 1256 +----- DATA ----- +3c21646f63747970652068746d6c3e0a +3c68746d6c3e0a3c686561643e0a2020 +20203c7469746c653e4578616d706c65 +20446f6d61696e3c2f7469746c653e0a +0a202020203c6d657461206368617273 +65743d227574662d3822202f3e0a2020 +20203c6d65746120687474702d657175 +69763d22436f6e74656e742d74797065 +2220636f6e74656e743d22746578742f +68746d6c3b20636861727365743d7574 +662d3822202f3e0a202020203c6d6574 +61206e616d653d2276696577706f7274 +2220636f6e74656e743d227769647468 +3d6465766963652d77696474682c2069 +6e697469616c2d7363616c653d312220 +2f3e0a202020203c7374796c65207479 +70653d22746578742f637373223e0a20 +202020626f6479207b0a202020202020 +20206261636b67726f756e642d636f6c +6f723a20236630663066323b0a202020 +20202020206d617267696e3a20303b0a +202020202020202070616464696e673a +20303b0a2020202020202020666f6e74 +2d66616d696c793a202d6170706c652d +73797374656d2c2073797374656d2d75 +692c20426c696e6b4d61635379737465 +6d466f6e742c20225365676f65205549 +222c20224f70656e2053616e73222c20 +2248656c766574696361204e65756522 +----- END DATA (TRUNCATED, 792 bytes lost) ----- + +This is useful to sniff binary protocols where the UTF-8 decode might insert a +lot of characters that are not printable or even Unicode replacement +characters. USAGE message: -usage: sslsniff.py [-h] [-p PID] [-c COMM] [-o] [-g] [-n] [-d] +usage: sslsniff.py [-h] [-p PID] [-c COMM] [-o] [-g] [-n] [-d] [--hexdump] Sniff SSL data @@ -77,6 +117,8 @@ optional arguments: -g, --no-gnutls do not show GnuTLS calls. -n, --no-nss do not show NSS calls. -d, --debug debug mode. + --hexdump show data as hexdump instead of trying to decode it as + UTF-8 examples: ./sslsniff # sniff OpenSSL and GnuTLS functions @@ -85,3 +127,4 @@ examples: ./sslsniff --no-openssl # don't show OpenSSL calls ./sslsniff --no-gnutls # don't show GnuTLS calls ./sslsniff --no-nss # don't show NSS calls + ./sslsniff --hexdump # show data as hex instead of trying to decode it as UTF-8 diff --git a/tools/stackcount.py b/tools/stackcount.py index a58f9e316..2afb91ff8 100755 --- a/tools/stackcount.py +++ b/tools/stackcount.py @@ -275,6 +275,12 @@ def __init__(self): self.kernel_stack = self.args.kernel_stacks_only self.user_stack = self.args.user_stacks_only + # For tracing single processes in isolation, explicitly set perpid + # to True, if not already set. This is required to generate the correct + # BPF program that can store pid in the tgid field of the key_t object. + if self.args.pid is not None and self.args.pid > 0: + self.args.perpid = True + self.probe = Probe(self.args.pattern, self.kernel_stack, self.user_stack, self.args.regexp, self.args.pid, self.args.perpid, self.args.cpu) diff --git a/tools/stackcount_example.txt b/tools/stackcount_example.txt index 26233d798..805aff36f 100644 --- a/tools/stackcount_example.txt +++ b/tools/stackcount_example.txt @@ -487,7 +487,7 @@ User-space functions can also be traced if a library name is provided. For example, to quickly identify code locations that allocate heap memory for PID 4902 (using -p), by tracing malloc from libc ("c:malloc"): -# ./stackcount -P -p 4902 c:malloc +# ./stackcount -p 4902 c:malloc Tracing 1 functions for "malloc"... Hit Ctrl-C to end. ^C malloc diff --git a/tools/statsnoop.py b/tools/statsnoop.py index 6cdff9459..9c7df0b35 100755 --- a/tools/statsnoop.py +++ b/tools/statsnoop.py @@ -84,7 +84,7 @@ } struct data_t data = {.pid = pid}; - bpf_probe_read(&data.fname, sizeof(data.fname), (void *)valp->fname); + bpf_probe_read_user(&data.fname, sizeof(data.fname), (void *)valp->fname); bpf_get_current_comm(&data.comm, sizeof(data.comm)); data.ts_ns = bpf_ktime_get_ns(); data.ret = PT_REGS_RC(ctx); diff --git a/tools/swapin.py b/tools/swapin.py new file mode 100755 index 000000000..e94000af6 --- /dev/null +++ b/tools/swapin.py @@ -0,0 +1,88 @@ +#!/usr/bin/python +# @lint-avoid-python-3-compatibility-imports +# +# swapin Count swapins by process. +# For Linux, uses BCC, eBPF. Embedded C. +# +# TODO: add -s for total swapin time column (sum) +# +# Copyright (c) 2019 Brendan Gregg. +# Licensed under the Apache License, Version 2.0 (the "License"). +# This was originally created for the BPF Performance Tools book +# published by Addison Wesley. ISBN-13: 9780136554820 +# When copying or porting, include this comment. +# +# 03-Jul-2019 Brendan Gregg Ported from bpftrace to BCC. + +from __future__ import print_function +from bcc import BPF +from time import sleep, strftime +import argparse + +# arguments +parser = argparse.ArgumentParser( + description="Count swapin events by process.") +parser.add_argument("-T", "--notime", action="store_true", + help="do not show the timestamp (HH:MM:SS)") +parser.add_argument("interval", nargs="?", default=1, + help="output interval, in seconds") +parser.add_argument("count", nargs="?", default=99999999, + help="number of outputs") +parser.add_argument("--ebpf", action="store_true", + help=argparse.SUPPRESS) +args = parser.parse_args() +interval = int(args.interval) +countdown = int(args.count) +debug = 0 + +# load BPF program +b = BPF(text=""" +#include + +struct key_t { + u32 pid; + char comm[TASK_COMM_LEN]; +}; + +BPF_HASH(counts, struct key_t, u64); + +int kprobe__swap_readpage(struct pt_regs *ctx) +{ + u64 *val, zero = 0; + u32 tgid = bpf_get_current_pid_tgid() >> 32; + struct key_t key = {.pid = tgid}; + bpf_get_current_comm(&key.comm, sizeof(key.comm)); + val = counts.lookup_or_init(&key, &zero); + ++(*val); + return 0; +} +""") +if debug or args.ebpf: + print(bpf_text) + if args.ebpf: + exit() + +print("Counting swap ins. Ctrl-C to end."); + +# output +exiting = 0 +while 1: + try: + sleep(interval) + except KeyboardInterrupt: + exiting = 1 + + if not args.notime: + print(strftime("%H:%M:%S")) + print("%-16s %-6s %s" % ("COMM", "PID", "COUNT")) + counts = b.get_table("counts") + for k, v in sorted(counts.items(), + key=lambda counts: counts[1].value): + print("%-16s %-6d %d" % (k.comm, k.pid, v.value)) + counts.clear() + print() + + countdown -= 1 + if exiting or countdown == 0: + print("Detaching...") + exit() diff --git a/tools/swapin_example.py b/tools/swapin_example.py new file mode 100644 index 000000000..39ceb470c --- /dev/null +++ b/tools/swapin_example.py @@ -0,0 +1,48 @@ +Demonstrations of swapin, the Linux BCC/eBPF version. + + +This tool counts swapins by process, to show which process is affected by +swapping. For example: + +# swapin.py +Counting swap ins. Ctrl-C to end. +13:36:58 +COMM PID COUNT + +13:36:59 +COMM PID COUNT +gnome-shell 2239 12410 + +13:37:00 +COMM PID COUNT +chrome 4536 14635 + +13:37:01 +COMM PID COUNT +gnome-shell 2239 14 +cron 1180 23 + +13:37:02 +COMM PID COUNT +gnome-shell 2239 2496 +[...] + +While tracing, this showed that PID 2239 (gnome-shell) and PID 4536 (chrome) +suffered over ten thousand swapins. + + + +USAGE: + +# swapin.py -h +usage: swapin.py [-h] [-T] [interval] [count] + +Count swapin events by process. + +positional arguments: + interval output interval, in seconds + count number of outputs + +optional arguments: + -h, --help show this help message and exit + -T, --notime do not show the timestamp (HH:MM:SS) diff --git a/tools/tcpaccept.py b/tools/tcpaccept.py index 7c1042084..1a5f1c7b5 100755 --- a/tools/tcpaccept.py +++ b/tools/tcpaccept.py @@ -16,6 +16,7 @@ # 14-Feb-2016 " " Switch to bpf_perf_output. from __future__ import print_function +from bcc.containers import filter_by_containers from bcc import BPF from socket import inet_ntop, AF_INET, AF_INET6 from struct import pack @@ -29,6 +30,8 @@ ./tcpaccept -t # include timestamps ./tcpaccept -P 80,81 # only trace port 80 and 81 ./tcpaccept -p 181 # only trace PID 181 + ./tcpaccept --cgroupmap mappath # only trace cgroups in this BPF map + ./tcpaccept --mntnsmap mappath # only trace mount namespaces in the map """ parser = argparse.ArgumentParser( description="Trace TCP accepts", @@ -42,6 +45,10 @@ help="trace this PID only") parser.add_argument("-P", "--port", help="comma-separated list of local ports to trace") +parser.add_argument("--cgroupmap", + help="trace cgroups in this BPF map only") +parser.add_argument("--mntnsmap", + help="trace mount namespaces in this BPF map only") parser.add_argument("--ebpf", action="store_true", help=argparse.SUPPRESS) args = parser.parse_args() @@ -89,6 +96,10 @@ bpf_text_kprobe = """ int kretprobe__inet_csk_accept(struct pt_regs *ctx) { + if (container_should_be_filtered()) { + return 0; + } + struct sock *newsk = (struct sock *)PT_REGS_RC(ctx); u32 pid = bpf_get_current_pid_tgid() >> 32; @@ -100,21 +111,21 @@ // check this is TCP u8 protocol = 0; // workaround for reading the sk_protocol bitfield: - + // Following comments add by Joe Yin: // Unfortunately,it can not work since Linux 4.10, // because the sk_wmem_queued is not following the bitfield of sk_protocol. // And the following member is sk_gso_max_segs. // So, we can use this: - // bpf_probe_read(&protocol, 1, (void *)((u64)&newsk->sk_gso_max_segs) - 3); - // In order to diff the pre-4.10 and 4.10+ ,introduce the variables gso_max_segs_offset,sk_lingertime, - // sk_lingertime is closed to the gso_max_segs_offset,and - // the offset between the two members is 4 + // bpf_probe_read_kernel(&protocol, 1, (void *)((u64)&newsk->sk_gso_max_segs) - 3); + // In order to diff the pre-4.10 and 4.10+ ,introduce the variables gso_max_segs_offset,sk_lingertime, + // sk_lingertime is closed to the gso_max_segs_offset,and + // the offset between the two members is 4 int gso_max_segs_offset = offsetof(struct sock, sk_gso_max_segs); int sk_lingertime_offset = offsetof(struct sock, sk_lingertime); - if (sk_lingertime_offset - gso_max_segs_offset == 4) + if (sk_lingertime_offset - gso_max_segs_offset == 4) // 4.10+ with little endian #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ protocol = *(u8 *)((u64)&newsk->sk_gso_max_segs - 3); @@ -156,9 +167,9 @@ } else if (family == AF_INET6) { struct ipv6_data_t data6 = {.pid = pid, .ip = 6}; data6.ts_us = bpf_ktime_get_ns() / 1000; - bpf_probe_read(&data6.saddr, sizeof(data6.saddr), + bpf_probe_read_kernel(&data6.saddr, sizeof(data6.saddr), &newsk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&data6.daddr, sizeof(data6.daddr), + bpf_probe_read_kernel(&data6.daddr, sizeof(data6.daddr), &newsk->__sk_common.skc_v6_daddr.in6_u.u6_addr32); data6.lport = lport; data6.dport = dport; @@ -184,6 +195,7 @@ lports_if = ' && '.join(['lport != %d' % lport for lport in lports]) bpf_text = bpf_text.replace('##FILTER_PORT##', 'if (%s) { return 0; }' % lports_if) +bpf_text = filter_by_containers(args) + bpf_text if debug or args.ebpf: print(bpf_text) if args.ebpf: diff --git a/tools/tcpaccept_example.txt b/tools/tcpaccept_example.txt index 2adee452e..938156556 100644 --- a/tools/tcpaccept_example.txt +++ b/tools/tcpaccept_example.txt @@ -33,22 +33,34 @@ TIME(s) PID COMM IP RADDR RPORT LADDR LPORT 1.984 907 sshd 4 127.0.0.1 51250 127.0.0.1 22 +The --cgroupmap option filters based on a cgroup set. It is meant to be used +with an externally created map. + +# ./tcpaccept --cgroupmap /sys/fs/bpf/test01 + +For more details, see docs/special_filtering.md + + USAGE message: # ./tcpaccept -h -usage: tcpaccept [-h] [-T] [-t] [-p PID] [-P PORTS] +usage: tcpaccept.py [-h] [-T] [-t] [-p PID] [-P PORT] [--cgroupmap CGROUPMAP] Trace TCP accepts optional arguments: - -h, --help show this help message and exit - -T, --time include time column on output (HH:MM:SS) - -t, --timestamp include timestamp on output - -p PID, --pid PID trace this PID only - -P PORTS, --port PORTS comma-separated list of local ports to trace + -h, --help show this help message and exit + -T, --time include time column on output (HH:MM:SS) + -t, --timestamp include timestamp on output + -p PID, --pid PID trace this PID only + -P PORT, --port PORT comma-separated list of local ports to trace + --cgroupmap CGROUPMAP + trace cgroups in this BPF map only examples: ./tcpaccept # trace all TCP accept()s ./tcpaccept -t # include timestamps ./tcpaccept -P 80,81 # only trace port 80 and 81 ./tcpaccept -p 181 # only trace PID 181 + ./tcpaccept --cgroupmap mappath # only trace cgroups in this BPF map + ./tcpaccept --mntnsmap mappath # only trace mount namespaces in the map \ No newline at end of file diff --git a/tools/tcpconnect.py b/tools/tcpconnect.py index eb12667eb..7c2cea126 100755 --- a/tools/tcpconnect.py +++ b/tools/tcpconnect.py @@ -21,6 +21,7 @@ from __future__ import print_function from bcc import BPF +from bcc.containers import filter_by_containers from bcc.utils import printb import argparse from socket import inet_ntop, ntohs, AF_INET, AF_INET6 @@ -37,6 +38,8 @@ ./tcpconnect -U # include UID ./tcpconnect -u 1000 # only trace UID 1000 ./tcpconnect -c # count connects per src ip and dest ip/port + ./tcpconnect --cgroupmap mappath # only trace cgroups in this BPF map + ./tcpconnect --mntnsmap mappath # only trace mount namespaces in the map """ parser = argparse.ArgumentParser( description="Trace TCP connects", @@ -54,6 +57,10 @@ help="trace this UID only") parser.add_argument("-c", "--count", action="store_true", help="count connects per src ip and dest ip/port") +parser.add_argument("--cgroupmap", + help="trace cgroups in this BPF map only") +parser.add_argument("--mntnsmap", + help="trace mount namespaces in this BPF map only") parser.add_argument("--ebpf", action="store_true", help=argparse.SUPPRESS) args = parser.parse_args() @@ -109,6 +116,10 @@ int trace_connect_entry(struct pt_regs *ctx, struct sock *sk) { + if (container_should_be_filtered()) { + return 0; + } + u64 pid_tgid = bpf_get_current_pid_tgid(); u32 pid = pid_tgid >> 32; u32 tid = pid_tgid; @@ -194,9 +205,9 @@ { 'count' : """ struct ipv6_flow_key_t flow_key = {}; - bpf_probe_read(&flow_key.saddr, sizeof(flow_key.saddr), + bpf_probe_read_kernel(&flow_key.saddr, sizeof(flow_key.saddr), skp->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&flow_key.daddr, sizeof(flow_key.daddr), + bpf_probe_read_kernel(&flow_key.daddr, sizeof(flow_key.daddr), skp->__sk_common.skc_v6_daddr.in6_u.u6_addr32); flow_key.dport = ntohs(dport); ipv6_count.increment(flow_key);""", @@ -205,9 +216,9 @@ struct ipv6_data_t data6 = {.pid = pid, .ip = ipver}; data6.uid = bpf_get_current_uid_gid(); data6.ts_us = bpf_ktime_get_ns() / 1000; - bpf_probe_read(&data6.saddr, sizeof(data6.saddr), + bpf_probe_read_kernel(&data6.saddr, sizeof(data6.saddr), skp->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&data6.daddr, sizeof(data6.daddr), + bpf_probe_read_kernel(&data6.daddr, sizeof(data6.daddr), skp->__sk_common.skc_v6_daddr.in6_u.u6_addr32); data6.dport = ntohs(dport); bpf_get_current_comm(&data6.task, sizeof(data6.task)); @@ -230,10 +241,11 @@ dports = [int(dport) for dport in args.port.split(',')] dports_if = ' && '.join(['dport != %d' % ntohs(dport) for dport in dports]) bpf_text = bpf_text.replace('FILTER_PORT', - 'if (%s) { currsock.delete(&pid); return 0; }' % dports_if) + 'if (%s) { currsock.delete(&tid); return 0; }' % dports_if) if args.uid: bpf_text = bpf_text.replace('FILTER_UID', 'if (uid != %s) { return 0; }' % args.uid) +bpf_text = filter_by_containers(args) + bpf_text bpf_text = bpf_text.replace('FILTER_PID', '') bpf_text = bpf_text.replace('FILTER_PORT', '') diff --git a/tools/tcpconnect_example.txt b/tools/tcpconnect_example.txt index e88701e02..7efac4a31 100644 --- a/tools/tcpconnect_example.txt +++ b/tools/tcpconnect_example.txt @@ -68,10 +68,19 @@ LADDR RADDR RPORT CONNECTS [...] +The --cgroupmap option filters based on a cgroup set. It is meant to be used +with an externally created map. + +# ./tcpconnect --cgroupmap /sys/fs/bpf/test01 + +For more details, see docs/special_filtering.md + + USAGE message: # ./tcpconnect -h -usage: tcpconnect [-h] [-c] [-t] [-p PID] [-P PORT] +usage: tcpconnect.py [-h] [-t] [-p PID] [-P PORT] [-U] [-u UID] [-c] + [--cgroupmap CGROUPMAP] [--mntnsmap MNTNSMAP] Trace TCP connects @@ -79,11 +88,12 @@ optional arguments: -h, --help show this help message and exit -t, --timestamp include timestamp on output -p PID, --pid PID trace this PID only - -P PORT, --port PORT - comma-separated list of destination ports to trace. + -P PORT, --port PORT comma-separated list of destination ports to trace. -U, --print-uid include UID on output -u UID, --uid UID trace this UID only -c, --count count connects per src ip and dest ip/port + --cgroupmap CGROUPMAP + trace cgroups in this BPF map only examples: ./tcpconnect # trace all TCP connect()s @@ -94,3 +104,5 @@ examples: ./tcpconnect -U # include UID ./tcpconnect -u 1000 # only trace UID 1000 ./tcpconnect -c # count connects per src ip and dest ip/port + ./tcpconnect --cgroupmap mappath # only trace cgroups in this BPF map + ./tcpconnect --mntnsmap mappath # only trace mount namespaces in the map \ No newline at end of file diff --git a/tools/tcpconnlat.py b/tools/tcpconnlat.py index be6bbbfa1..e28a43a71 100755 --- a/tools/tcpconnlat.py +++ b/tools/tcpconnlat.py @@ -160,9 +160,9 @@ def positive_float(val): } else /* AF_INET6 */ { struct ipv6_data_t data6 = {.pid = infop->pid, .ip = 6}; data6.ts_us = now / 1000; - bpf_probe_read(&data6.saddr, sizeof(data6.saddr), + bpf_probe_read_kernel(&data6.saddr, sizeof(data6.saddr), skp->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&data6.daddr, sizeof(data6.daddr), + bpf_probe_read_kernel(&data6.daddr, sizeof(data6.daddr), skp->__sk_common.skc_v6_daddr.in6_u.u6_addr32); data6.dport = ntohs(dport); data6.delta_us = delta_us; diff --git a/tools/tcpdrop.py b/tools/tcpdrop.py index 14515f75e..f138f131c 100755 --- a/tools/tcpdrop.py +++ b/tools/tcpdrop.py @@ -128,10 +128,12 @@ struct ipv6_data_t data6 = {}; data6.pid = pid; data6.ip = 6; - bpf_probe_read(&data6.saddr, sizeof(data6.saddr), - sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&data6.daddr, sizeof(data6.daddr), + // The remote address (skc_v6_daddr) was the source + bpf_probe_read_kernel(&data6.saddr, sizeof(data6.saddr), sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32); + // The local address (skc_v6_rcv_saddr) was the destination + bpf_probe_read_kernel(&data6.daddr, sizeof(data6.daddr), + sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); data6.dport = dport; data6.sport = sport; data6.state = state; diff --git a/tools/tcplife.lua b/tools/tcplife.lua index 3f4f6afdd..f2fe90695 100755 --- a/tools/tcplife.lua +++ b/tools/tcplife.lua @@ -25,7 +25,6 @@ uint16_t ntohs(uint16_t netshort); local program = [[ #include -#define KBUILD_MODNAME "foo" #include #include #include @@ -154,7 +153,7 @@ int trace_tcp_set_state(struct pt_regs *ctx, struct sock *sk, int state) if (mep == 0) { bpf_get_current_comm(&data4.task, sizeof(data4.task)); } else { - bpf_probe_read(&data4.task, sizeof(data4.task), (void *)mep->task); + bpf_probe_read_kernel(&data4.task, sizeof(data4.task), (void *)mep->task); } ipv4_events.perf_submit(ctx, &data4, sizeof(data4)); @@ -162,9 +161,9 @@ int trace_tcp_set_state(struct pt_regs *ctx, struct sock *sk, int state) struct ipv6_data_t data6 = {.span_us = delta_us, .rx_b = rx_b, .tx_b = tx_b}; data6.ts_us = bpf_ktime_get_ns() / 1000; - bpf_probe_read(&data6.saddr, sizeof(data6.saddr), + bpf_probe_read_kernel(&data6.saddr, sizeof(data6.saddr), sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&data6.daddr, sizeof(data6.daddr), + bpf_probe_read_kernel(&data6.daddr, sizeof(data6.daddr), sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32); // a workaround until data6 compiles with separate lport/dport data6.ports = ntohs(dport) + ((0ULL + lport) << 32); @@ -172,7 +171,7 @@ int trace_tcp_set_state(struct pt_regs *ctx, struct sock *sk, int state) if (mep == 0) { bpf_get_current_comm(&data6.task, sizeof(data6.task)); } else { - bpf_probe_read(&data6.task, sizeof(data6.task), (void *)mep->task); + bpf_probe_read_kernel(&data6.task, sizeof(data6.task), (void *)mep->task); } ipv6_events.perf_submit(ctx, &data6, sizeof(data6)); } diff --git a/tools/tcplife.py b/tools/tcplife.py index d4e679dd7..9fe9804b9 100755 --- a/tools/tcplife.py +++ b/tools/tcplife.py @@ -32,7 +32,7 @@ # arguments examples = """examples: ./tcplife # trace all TCP connect()s - ./tcplife -t # include time column (HH:MM:SS) + ./tcplife -T # include time column (HH:MM:SS) ./tcplife -w # wider columns (fit IPv6) ./tcplife -stT # csv output, with times & timestamps ./tcplife -p 181 # only trace PID 181 @@ -66,7 +66,6 @@ # define BPF program bpf_text = """ #include -#define KBUILD_MODNAME "foo" #include #include #include @@ -206,7 +205,7 @@ if (mep == 0) { bpf_get_current_comm(&data4.task, sizeof(data4.task)); } else { - bpf_probe_read(&data4.task, sizeof(data4.task), (void *)mep->task); + bpf_probe_read_kernel(&data4.task, sizeof(data4.task), (void *)mep->task); } ipv4_events.perf_submit(ctx, &data4, sizeof(data4)); @@ -216,9 +215,9 @@ data6.rx_b = rx_b; data6.tx_b = tx_b; data6.ts_us = bpf_ktime_get_ns() / 1000; - bpf_probe_read(&data6.saddr, sizeof(data6.saddr), + bpf_probe_read_kernel(&data6.saddr, sizeof(data6.saddr), sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&data6.daddr, sizeof(data6.daddr), + bpf_probe_read_kernel(&data6.daddr, sizeof(data6.daddr), sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32); // a workaround until data6 compiles with separate lport/dport data6.ports = dport + ((0ULL + lport) << 32); @@ -226,7 +225,7 @@ if (mep == 0) { bpf_get_current_comm(&data6.task, sizeof(data6.task)); } else { - bpf_probe_read(&data6.task, sizeof(data6.task), (void *)mep->task); + bpf_probe_read_kernel(&data6.task, sizeof(data6.task), (void *)mep->task); } ipv6_events.perf_submit(ctx, &data6, sizeof(data6)); } @@ -332,7 +331,7 @@ if (mep == 0) { bpf_get_current_comm(&data4.task, sizeof(data4.task)); } else { - bpf_probe_read(&data4.task, sizeof(data4.task), (void *)mep->task); + bpf_probe_read_kernel(&data4.task, sizeof(data4.task), (void *)mep->task); } ipv4_events.perf_submit(args, &data4, sizeof(data4)); @@ -350,7 +349,7 @@ if (mep == 0) { bpf_get_current_comm(&data6.task, sizeof(data6.task)); } else { - bpf_probe_read(&data6.task, sizeof(data6.task), (void *)mep->task); + bpf_probe_read_kernel(&data6.task, sizeof(data6.task), (void *)mep->task); } ipv6_events.perf_submit(args, &data6, sizeof(data6)); } diff --git a/tools/tcpretrans.py b/tools/tcpretrans.py index 1b2636ae6..7785d9b34 100755 --- a/tools/tcpretrans.py +++ b/tools/tcpretrans.py @@ -180,9 +180,9 @@ { 'count' : """ struct ipv6_flow_key_t flow_key = {}; - bpf_probe_read(&flow_key.saddr, sizeof(flow_key.saddr), + bpf_probe_read_kernel(&flow_key.saddr, sizeof(flow_key.saddr), skp->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&flow_key.daddr, sizeof(flow_key.daddr), + bpf_probe_read_kernel(&flow_key.daddr, sizeof(flow_key.daddr), skp->__sk_common.skc_v6_daddr.in6_u.u6_addr32); // lport is host order flow_key.lport = lport; @@ -192,9 +192,9 @@ data6.pid = pid; data6.ip = 6; data6.type = type; - bpf_probe_read(&data6.saddr, sizeof(data6.saddr), + bpf_probe_read_kernel(&data6.saddr, sizeof(data6.saddr), skp->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&data6.daddr, sizeof(data6.daddr), + bpf_probe_read_kernel(&data6.daddr, sizeof(data6.daddr), skp->__sk_common.skc_v6_daddr.in6_u.u6_addr32); // lport is host order data6.lport = lport; diff --git a/tools/tcprtt.py b/tools/tcprtt.py new file mode 100755 index 000000000..0b3b3aa44 --- /dev/null +++ b/tools/tcprtt.py @@ -0,0 +1,213 @@ +#!/usr/bin/python +# @lint-avoid-python-3-compatibility-imports +# +# tcprtt Summarize TCP RTT as a histogram. For Linux, uses BCC, eBPF. +# +# USAGE: tcprtt [-h] [-T] [-D] [-m] [-i INTERVAL] [-d DURATION] +# [-p LPORT] [-P RPORT] [-a LADDR] [-A RADDR] [-b] [-B] +# +# Copyright (c) 2020 zhenwei pi +# Licensed under the Apache License, Version 2.0 (the "License") +# +# 23-AUG-2020 zhenwei pi Created this. + +from __future__ import print_function +from bcc import BPF +from time import sleep, strftime +from socket import inet_ntop, AF_INET +import socket, struct +import argparse + +# arguments +examples = """examples: + ./tcprtt # summarize TCP RTT + ./tcprtt -i 1 -d 10 # print 1 second summaries, 10 times + ./tcprtt -m -T # summarize in millisecond, and timestamps + ./tcprtt -p # filter for local port + ./tcprtt -P # filter for remote port + ./tcprtt -a # filter for local address + ./tcprtt -A # filter for remote address + ./tcprtt -b # show sockets histogram by local address + ./tcprtt -B # show sockets histogram by remote address + ./tcprtt -D # show debug bpf text +""" +parser = argparse.ArgumentParser( + description="Summarize TCP RTT as a histogram", + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=examples) +parser.add_argument("-i", "--interval", + help="summary interval, seconds") +parser.add_argument("-d", "--duration", type=int, default=99999, + help="total duration of trace, seconds") +parser.add_argument("-T", "--timestamp", action="store_true", + help="include timestamp on output") +parser.add_argument("-m", "--milliseconds", action="store_true", + help="millisecond histogram") +parser.add_argument("-p", "--lport", + help="filter for local port") +parser.add_argument("-P", "--rport", + help="filter for remote port") +parser.add_argument("-a", "--laddr", + help="filter for local address") +parser.add_argument("-A", "--raddr", + help="filter for remote address") +parser.add_argument("-b", "--byladdr", action="store_true", + help="show sockets histogram by local address") +parser.add_argument("-B", "--byraddr", action="store_true", + help="show sockets histogram by remote address") +parser.add_argument("-D", "--debug", action="store_true", + help="print BPF program before starting (for debugging purposes)") +parser.add_argument("--ebpf", action="store_true", + help=argparse.SUPPRESS) +args = parser.parse_args() +if not args.interval: + args.interval = args.duration + +# define BPF program +bpf_text = """ +#ifndef KBUILD_MODNAME +#define KBUILD_MODNAME "bcc" +#endif +#include +#include +#include +#include +#include + +typedef struct sock_key { + u64 addr; + u64 slot; +} sock_key_t; + +STORAGE + +int trace_tcp_rcv(struct pt_regs *ctx, struct sock *sk, struct sk_buff *skb) +{ + struct tcp_sock *ts = tcp_sk(sk); + u32 srtt = ts->srtt_us >> 3; + const struct inet_sock *inet = inet_sk(sk); + u16 sport = 0; + u16 dport = 0; + u32 saddr = 0; + u32 daddr = 0; + + bpf_probe_read_kernel(&sport, sizeof(sport), (void *)&inet->inet_sport); + bpf_probe_read_kernel(&dport, sizeof(dport), (void *)&inet->inet_dport); + bpf_probe_read_kernel(&saddr, sizeof(saddr), (void *)&inet->inet_saddr); + bpf_probe_read_kernel(&daddr, sizeof(daddr), (void *)&inet->inet_daddr); + + LPORTFILTER + RPORTFILTER + LADDRFILTER + RADDRFILTER + + FACTOR + + STORE + + return 0; +} +""" + +# filter for local port +if args.lport: + bpf_text = bpf_text.replace('LPORTFILTER', + """if (ntohs(sport) != %d) + return 0;""" % int(args.lport)) +else: + bpf_text = bpf_text.replace('LPORTFILTER', '') + +# filter for remote port +if args.rport: + bpf_text = bpf_text.replace('RPORTFILTER', + """if (ntohs(dport) != %d) + return 0;""" % int(args.rport)) +else: + bpf_text = bpf_text.replace('RPORTFILTER', '') + +# filter for local address +if args.laddr: + bpf_text = bpf_text.replace('LADDRFILTER', + """if (saddr != %d) + return 0;""" % struct.unpack("=I", socket.inet_aton(args.laddr))[0]) +else: + bpf_text = bpf_text.replace('LADDRFILTER', '') + +# filter for remote address +if args.raddr: + bpf_text = bpf_text.replace('RADDRFILTER', + """if (daddr != %d) + return 0;""" % struct.unpack("=I", socket.inet_aton(args.raddr))[0]) +else: + bpf_text = bpf_text.replace('RADDRFILTER', '') + +# show msecs or usecs[default] +if args.milliseconds: + bpf_text = bpf_text.replace('FACTOR', 'srtt /= 1000;') + label = "msecs" +else: + bpf_text = bpf_text.replace('FACTOR', '') + label = "usecs" + +print_header = "srtt" +# show byladdr/byraddr histogram +if args.byladdr: + bpf_text = bpf_text.replace('STORAGE', + 'BPF_HISTOGRAM(hist_srtt, sock_key_t);') + bpf_text = bpf_text.replace('STORE', + b"""sock_key_t key; + key.addr = saddr; + key.slot = bpf_log2l(srtt); + hist_srtt.increment(key);""") + print_header = "Local Address: " +elif args.byraddr: + bpf_text = bpf_text.replace('STORAGE', + 'BPF_HISTOGRAM(hist_srtt, sock_key_t);') + bpf_text = bpf_text.replace('STORE', + b"""sock_key_t key; + key.addr = daddr; + key.slot = bpf_log2l(srtt); + hist_srtt.increment(key);""") + print_header = "Remote Address: " +else: + bpf_text = bpf_text.replace('STORAGE', 'BPF_HISTOGRAM(hist_srtt);') + bpf_text = bpf_text.replace('STORE', 'hist_srtt.increment(bpf_log2l(srtt));') + +# debug/dump ebpf enable or not +if args.debug or args.ebpf: + print(bpf_text) + if args.ebpf: + exit() + +# load BPF program +b = BPF(text=bpf_text) +b.attach_kprobe(event="tcp_rcv_established", fn_name="trace_tcp_rcv") + +print("Tracing TCP RTT... Hit Ctrl-C to end.") + +def print_section(addr): + if args.byladdr: + return inet_ntop(AF_INET, struct.pack("I", addr)).encode() + elif args.byraddr: + return inet_ntop(AF_INET, struct.pack("I", addr)).encode() + +# output +exiting = 0 if args.interval else 1 +dist = b.get_table("hist_srtt") +seconds = 0 +while (1): + try: + sleep(int(args.interval)) + seconds = seconds + int(args.interval) + except KeyboardInterrupt: + exiting = 1 + + print() + if args.timestamp: + print("%-8s\n" % strftime("%H:%M:%S"), end="") + + dist.print_log2_hist(label, section_header=print_header, section_print_fn=print_section) + dist.clear() + + if exiting or seconds >= args.duration: + exit() diff --git a/tools/tcprtt_example.txt b/tools/tcprtt_example.txt new file mode 100644 index 000000000..a5e6ed5c8 --- /dev/null +++ b/tools/tcprtt_example.txt @@ -0,0 +1,128 @@ +Demonstrations of tcprtt, the Linux eBPF/bcc version. + + +This program traces TCP RTT(round-trip time) to analyze the quality of +network, then help us to distinguish the network latency trouble is from +user process or physical network. + +For example, wrk show the http request latency distribution: +# wrk -d 30 -c 10 --latency http://192.168.122.100/index.html +Running 30s test @ http://192.168.122.100/index.html + 2 threads and 10 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 86.75ms 153.76ms 1.54s 90.85% + Req/Sec 160.91 76.07 424.00 67.06% + Latency Distribution + 50% 14.55ms + 75% 119.21ms + 90% 230.22ms + 99% 726.90ms + 9523 requests in 30.02s, 69.62MB read + Socket errors: connect 0, read 0, write 0, timeout 1 + +During wrk testing, run tcprtt: +# ./tcprtt -i 1 -d 10 -m +Tracing TCP RTT... Hit Ctrl-C to end. + msecs : count distribution + 0 -> 1 : 4 | | + 2 -> 3 : 0 | | + 4 -> 7 : 1055 |****************************************| + 8 -> 15 : 26 | | + 16 -> 31 : 0 | | + 32 -> 63 : 0 | | + 64 -> 127 : 18 | | + 128 -> 255 : 14 | | + 256 -> 511 : 14 | | + 512 -> 1023 : 12 | | + +The wrk output shows that the latency of web service is not stable, and tcprtt +also shows unstable TCP RTT. So in this situation, we need to make sure the +quality of network is good or not firstly. + + +Use filter for address and(or) port. Ex, only collect local address 192.168.122.200 +and remote address 192.168.122.100 and remote port 80. +# ./tcprtt -i 1 -d 10 -m -a 192.168.122.200 -A 192.168.122.100 -P 80 + + +Tracing at server side, show each clients with its own histogram. +For example, run tcprtt on a storage node to show initiators' rtt histogram: +# ./tcprtt -i 1 -m --lport 3260 --byraddr +Tracing TCP RTT... Hit Ctrl-C to end. + +Remote Address: = 10.131.90.16 + msecs : count distribution + 0 -> 1 : 0 | | + 2 -> 3 : 0 | | + 4 -> 7 : 0 | | + 8 -> 15 : 2 |****************************************| + +Remote Address: = 10.131.90.13 + msecs : count distribution + 0 -> 1 : 0 | | + 2 -> 3 : 0 | | + 4 -> 7 : 4 |************************** | + 8 -> 15 : 6 |****************************************| + +Remote Address: = 10.131.89.153 + msecs : count distribution + 0 -> 1 : 120 |****************************************| + 2 -> 3 : 31 |********** | + 4 -> 7 : 32 |********** | + +Remote Address: = 10.131.89.150 + msecs : count distribution + 0 -> 1 : 12 |****************************************| + 2 -> 3 : 12 |****************************************| + 4 -> 7 : 9 |****************************** | + 8 -> 15 : 3 |********** | + +Remote Address: = 10.131.89.148 + msecs : count distribution + 0 -> 1 : 0 | | + 2 -> 3 : 0 | | + 4 -> 7 : 4 |****************************************| + +.... + + +Full USAGE: + +# ./tcprtt -h +usage: tcprtt.py [-h] [-i INTERVAL] [-d DURATION] [-T] [-m] [-p LPORT] + [-P RPORT] [-a LADDR] [-A RADDR] [-b] [-B] [-D] + +Summarize TCP RTT as a histogram + +optional arguments: + -h, --help show this help message and exit + -i INTERVAL, --interval INTERVAL + summary interval, seconds + -d DURATION, --duration DURATION + total duration of trace, seconds + -T, --timestamp include timestamp on output + -m, --milliseconds millisecond histogram + -p LPORT, --lport LPORT + filter for local port + -P RPORT, --rport RPORT + filter for remote port + -a LADDR, --laddr LADDR + filter for local address + -A RADDR, --raddr RADDR + filter for remote address + -b, --byladdr show sockets histogram by local address + -B, --byraddr show sockets histogram by remote address + -D, --debug print BPF program before starting (for debugging + purposes) + +examples: + ./tcprtt # summarize TCP RTT + ./tcprtt -i 1 -d 10 # print 1 second summaries, 10 times + ./tcprtt -m -T # summarize in millisecond, and timestamps + ./tcprtt -p # filter for local port + ./tcprtt -P # filter for remote port + ./tcprtt -a # filter for local address + ./tcprtt -A # filter for remote address + ./tcprtt -b # show sockets histogram by local address + ./tcprtt -B # show sockets histogram by remote address + ./tcprtt -D # show debug bpf text diff --git a/tools/tcpstates.py b/tools/tcpstates.py index b9a643873..616c2b743 100755 --- a/tools/tcpstates.py +++ b/tools/tcpstates.py @@ -59,9 +59,8 @@ debug = 0 # define BPF program -bpf_text = """ +bpf_header = """ #include -#define KBUILD_MODNAME "foo" #include #include #include @@ -101,7 +100,8 @@ u32 pid; char task[TASK_COMM_LEN]; }; - +""" +bpf_text_tracepoint = """ TRACEPOINT_PROBE(sock, inet_sock_set_state) { if (args->protocol != IPPROTO_TCP) @@ -166,10 +166,77 @@ } """ -if (not BPF.tracepoint_exists("sock", "inet_sock_set_state")): - print("ERROR: tracepoint sock:inet_sock_set_state missing " - "(added in Linux 4.16). Exiting") - exit() +bpf_text_kprobe = """ +int kprobe__tcp_set_state(struct pt_regs *ctx, struct sock *sk, int state) +{ + u32 pid = bpf_get_current_pid_tgid() >> 32; + // sk is used as a UUID + + // lport is either used in a filter here, or later + u16 lport = sk->__sk_common.skc_num; + FILTER_LPORT + + // dport is either used in a filter here, or later + u16 dport = sk->__sk_common.skc_dport; + FILTER_DPORT + + // calculate delta + u64 *tsp, delta_us; + tsp = last.lookup(&sk); + if (tsp == 0) + delta_us = 0; + else + delta_us = (bpf_ktime_get_ns() - *tsp) / 1000; + + u16 family = sk->__sk_common.skc_family; + + if (family == AF_INET) { + struct ipv4_data_t data4 = { + .span_us = delta_us, + .oldstate = sk->__sk_common.skc_state, + .newstate = state }; + data4.skaddr = (u64)sk; + data4.ts_us = bpf_ktime_get_ns() / 1000; + data4.saddr = sk->__sk_common.skc_rcv_saddr; + data4.daddr = sk->__sk_common.skc_daddr; + // a workaround until data4 compiles with separate lport/dport + data4.ports = dport + ((0ULL + lport) << 16); + data4.pid = pid; + + bpf_get_current_comm(&data4.task, sizeof(data4.task)); + ipv4_events.perf_submit(ctx, &data4, sizeof(data4)); + + } else /* 6 */ { + struct ipv6_data_t data6 = { + .span_us = delta_us, + .oldstate = sk->__sk_common.skc_state, + .newstate = state }; + data6.skaddr = (u64)sk; + data6.ts_us = bpf_ktime_get_ns() / 1000; + bpf_probe_read_kernel(&data6.saddr, sizeof(data6.saddr), + sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); + bpf_probe_read_kernel(&data6.daddr, sizeof(data6.daddr), + sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32); + // a workaround until data6 compiles with separate lport/dport + data6.ports = dport + ((0ULL + lport) << 16); + data6.pid = pid; + bpf_get_current_comm(&data6.task, sizeof(data6.task)); + ipv6_events.perf_submit(ctx, &data6, sizeof(data6)); + } + + u64 ts = bpf_ktime_get_ns(); + last.update(&sk, &ts); + + return 0; + +}; +""" + +bpf_text = bpf_header +if (BPF.tracepoint_exists("sock", "inet_sock_set_state")): + bpf_text += bpf_text_tracepoint +else: + bpf_text += bpf_text_kprobe # code substitutions if args.remoteport: diff --git a/tools/tcpsynbl.py b/tools/tcpsynbl.py new file mode 100755 index 000000000..c24eb9607 --- /dev/null +++ b/tools/tcpsynbl.py @@ -0,0 +1,52 @@ +#!/usr/bin/python +# @lint-avoid-python-3-compatibility-imports +# +# tcpsynbl Show TCP SYN backlog. +# For Linux, uses BCC, eBPF. Embedded C. +# +# Copyright (c) 2019 Brendan Gregg. +# Licensed under the Apache License, Version 2.0 (the "License"). +# This was originally created for the BPF Performance Tools book +# published by Addison Wesley. ISBN-13: 9780136554820 +# When copying or porting, include this comment. +# +# 03-Jul-2019 Brendan Gregg Ported from bpftrace to BCC. + +from __future__ import print_function +from bcc import BPF +from time import sleep + +# load BPF program +b = BPF(text=""" +#include + +typedef struct backlog_key { + u32 backlog; + u64 slot; +} backlog_key_t; + +BPF_HISTOGRAM(dist, backlog_key_t); + +int do_entry(struct pt_regs *ctx) { + struct sock *sk = (struct sock *)PT_REGS_PARM1(ctx); + + backlog_key_t key = {}; + key.backlog = sk->sk_max_ack_backlog; + key.slot = bpf_log2l(sk->sk_ack_backlog); + dist.increment(key); + + return 0; +}; +""") +b.attach_kprobe(event="tcp_v4_syn_recv_sock", fn_name="do_entry") +b.attach_kprobe(event="tcp_v6_syn_recv_sock", fn_name="do_entry") + +print("Tracing SYN backlog size. Ctrl-C to end."); + +try: + sleep(99999999) +except KeyboardInterrupt: + print() + +dist = b.get_table("dist") +dist.print_log2_hist("backlog", "backlog_max") diff --git a/tools/tcpsynbl_example.txt b/tools/tcpsynbl_example.txt new file mode 100644 index 000000000..1ac167df3 --- /dev/null +++ b/tools/tcpsynbl_example.txt @@ -0,0 +1,20 @@ +Demonstrations of tcpsynbl, the Linux BCC/eBPF version. + + +This tool shows the TCP SYN backlog size during SYN arrival as a histogram. +This lets you see how close your applications are to hitting the backlog limit +and dropping SYNs (causing performance issues with SYN retransmits). For +example: + +# ./tcpsynbl.py +Tracing SYN backlog size. Ctrl-C to end. +^C + +backlog_max = 500L + backlog : count distribution + 0 -> 1 : 961 |****************************************| + 2 -> 3 : 1 | | + +This output shows that for the backlog limit of 500, there were 961 SYN +arrival where the backlog was zero or one, and one accept where the backlog was +two or three. This indicates that we are nowhere near this limit. diff --git a/tools/tcptop.py b/tools/tcptop.py index 330d5bbbb..e9d0d1a28 100755 --- a/tools/tcptop.py +++ b/tools/tcptop.py @@ -26,6 +26,7 @@ from __future__ import print_function from bcc import BPF +from bcc.containers import filter_by_containers import argparse from socket import inet_ntop, AF_INET, AF_INET6 from struct import pack @@ -45,6 +46,8 @@ def range_check(string): ./tcptop # trace TCP send/recv by host ./tcptop -C # don't clear the screen ./tcptop -p 181 # only trace PID 181 + ./tcptop --cgroupmap mappath # only trace cgroups in this BPF map + ./tcptop --mntnsmap mappath # only trace mount namespaces in the map """ parser = argparse.ArgumentParser( description="Summarize TCP send/recv throughput by host", @@ -60,6 +63,10 @@ def range_check(string): help="output interval, in seconds (default 1)") parser.add_argument("count", nargs="?", default=-1, type=range_check, help="number of outputs") +parser.add_argument("--cgroupmap", + help="trace cgroups in this BPF map only") +parser.add_argument("--mntnsmap", + help="trace mount namespaces in this BPF map only") parser.add_argument("--ebpf", action="store_true", help=argparse.SUPPRESS) args = parser.parse_args() @@ -85,11 +92,12 @@ def range_check(string): BPF_HASH(ipv4_recv_bytes, struct ipv4_key_t); struct ipv6_key_t { - u32 pid; unsigned __int128 saddr; unsigned __int128 daddr; + u32 pid; u16 lport; u16 dport; + u64 __pad__; }; BPF_HASH(ipv6_send_bytes, struct ipv6_key_t); BPF_HASH(ipv6_recv_bytes, struct ipv6_key_t); @@ -97,8 +105,13 @@ def range_check(string): int kprobe__tcp_sendmsg(struct pt_regs *ctx, struct sock *sk, struct msghdr *msg, size_t size) { + if (container_should_be_filtered()) { + return 0; + } + u32 pid = bpf_get_current_pid_tgid() >> 32; - FILTER + FILTER_PID + u16 dport = 0, family = sk->__sk_common.skc_family; if (family == AF_INET) { @@ -112,9 +125,9 @@ def range_check(string): } else if (family == AF_INET6) { struct ipv6_key_t ipv6_key = {.pid = pid}; - bpf_probe_read(&ipv6_key.saddr, sizeof(ipv6_key.saddr), + bpf_probe_read_kernel(&ipv6_key.saddr, sizeof(ipv6_key.saddr), &sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&ipv6_key.daddr, sizeof(ipv6_key.daddr), + bpf_probe_read_kernel(&ipv6_key.daddr, sizeof(ipv6_key.daddr), &sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32); ipv6_key.lport = sk->__sk_common.skc_num; dport = sk->__sk_common.skc_dport; @@ -134,8 +147,13 @@ def range_check(string): */ int kprobe__tcp_cleanup_rbuf(struct pt_regs *ctx, struct sock *sk, int copied) { + if (container_should_be_filtered()) { + return 0; + } + u32 pid = bpf_get_current_pid_tgid() >> 32; - FILTER + FILTER_PID + u16 dport = 0, family = sk->__sk_common.skc_family; u64 *val, zero = 0; @@ -153,9 +171,9 @@ def range_check(string): } else if (family == AF_INET6) { struct ipv6_key_t ipv6_key = {.pid = pid}; - bpf_probe_read(&ipv6_key.saddr, sizeof(ipv6_key.saddr), + bpf_probe_read_kernel(&ipv6_key.saddr, sizeof(ipv6_key.saddr), &sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&ipv6_key.daddr, sizeof(ipv6_key.daddr), + bpf_probe_read_kernel(&ipv6_key.daddr, sizeof(ipv6_key.daddr), &sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32); ipv6_key.lport = sk->__sk_common.skc_num; dport = sk->__sk_common.skc_dport; @@ -170,10 +188,11 @@ def range_check(string): # code substitutions if args.pid: - bpf_text = bpf_text.replace('FILTER', + bpf_text = bpf_text.replace('FILTER_PID', 'if (pid != %s) { return 0; }' % args.pid) else: - bpf_text = bpf_text.replace('FILTER', '') + bpf_text = bpf_text.replace('FILTER_PID', '') +bpf_text = filter_by_containers(args) + bpf_text if debug or args.ebpf: print(bpf_text) if args.ebpf: diff --git a/tools/tcptop_example.txt b/tools/tcptop_example.txt index 63ba2efae..e29e2fa2e 100644 --- a/tools/tcptop_example.txt +++ b/tools/tcptop_example.txt @@ -92,25 +92,38 @@ PID COMM LADDR RADDR RX_KB TX_KB You can disable the loadavg summary line with -S if needed. +The --cgroupmap option filters based on a cgroup set. It is meant to be used +with an externally created map. + +# tcptop --cgroupmap /sys/fs/bpf/test01 + +For more details, see docs/special_filtering.md + USAGE: # tcptop -h -usage: tcptop.py [-h] [-C] [-S] [-p PID] [interval] [count] +usage: tcptop.py [-h] [-C] [-S] [-p PID] [--cgroupmap CGROUPMAP] + [--mntnsmap MNTNSMAP] + [interval] [count] Summarize TCP send/recv throughput by host positional arguments: - interval output interval, in seconds (default 1) - count number of outputs + interval output interval, in seconds (default 1) + count number of outputs optional arguments: - -h, --help show this help message and exit - -C, --noclear don't clear the screen - -S, --nosummary skip system summary line - -p PID, --pid PID trace this PID only + -h, --help show this help message and exit + -C, --noclear don't clear the screen + -S, --nosummary skip system summary line + -p PID, --pid PID trace this PID only + --cgroupmap CGROUPMAP + trace cgroups in this BPF map only examples: ./tcptop # trace TCP send/recv by host ./tcptop -C # don't clear the screen ./tcptop -p 181 # only trace PID 181 + ./tcptop --cgroupmap ./mappath # only trace cgroups in this BPF map + ./tcptop --mntnsmap mappath # only trace mount namespaces in the map diff --git a/tools/tcptracer.py b/tools/tcptracer.py index e61fe9ba7..3220105eb 100755 --- a/tools/tcptracer.py +++ b/tools/tcptracer.py @@ -11,11 +11,12 @@ # The following code should be replaced, and simplified, when static TCP probes # exist. # -# Copyright 2017 Kinvolk GmbH +# Copyright 2017-2020 Kinvolk GmbH # # Licensed under the Apache License, Version 2.0 (the "License") from __future__ import print_function from bcc import BPF +from bcc.containers import filter_by_containers import argparse as ap from socket import inet_ntop, AF_INET, AF_INET6 @@ -29,6 +30,10 @@ help="trace this PID only") parser.add_argument("-N", "--netns", default=0, type=int, help="trace this Network Namespace only") +parser.add_argument("--cgroupmap", + help="trace cgroups in this BPF map only") +parser.add_argument("--mntnsmap", + help="trace mount namespaces in this BPF map only") parser.add_argument("-v", "--verbose", action="store_true", help="include Network Namespace in the output") parser.add_argument("--ebpf", action="store_true", @@ -68,12 +73,12 @@ u32 type; u32 pid; char comm[TASK_COMM_LEN]; - u8 ip; unsigned __int128 saddr; unsigned __int128 daddr; u16 sport; u16 dport; u32 netns; + u8 ip; }; BPF_PERF_OUTPUT(tcp_ipv6_event); @@ -144,9 +149,9 @@ #ifdef CONFIG_NET_NS net_ns_inum = skp->__sk_common.skc_net.net->ns.inum; #endif - bpf_probe_read(&saddr, sizeof(saddr), + bpf_probe_read_kernel(&saddr, sizeof(saddr), skp->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&daddr, sizeof(daddr), + bpf_probe_read_kernel(&daddr, sizeof(daddr), skp->__sk_common.skc_v6_daddr.in6_u.u6_addr32); ##FILTER_NETNS## @@ -173,6 +178,10 @@ int trace_connect_v4_entry(struct pt_regs *ctx, struct sock *sk) { + if (container_should_be_filtered()) { + return 0; + } + u64 pid = bpf_get_current_pid_tgid(); ##FILTER_PID## @@ -220,6 +229,9 @@ int trace_connect_v6_entry(struct pt_regs *ctx, struct sock *sk) { + if (container_should_be_filtered()) { + return 0; + } u64 pid = bpf_get_current_pid_tgid(); ##FILTER_PID## @@ -352,6 +364,10 @@ int trace_close_entry(struct pt_regs *ctx, struct sock *skp) { + if (container_should_be_filtered()) { + return 0; + } + u64 pid = bpf_get_current_pid_tgid(); ##FILTER_PID## @@ -413,6 +429,10 @@ int trace_accept_return(struct pt_regs *ctx) { + if (container_should_be_filtered()) { + return 0; + } + struct sock *newsk = (struct sock *)PT_REGS_RC(ctx); u64 pid = bpf_get_current_pid_tgid(); @@ -471,9 +491,9 @@ evt6.pid = pid >> 32; evt6.ip = ipver; - bpf_probe_read(&evt6.saddr, sizeof(evt6.saddr), + bpf_probe_read_kernel(&evt6.saddr, sizeof(evt6.saddr), newsk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); - bpf_probe_read(&evt6.daddr, sizeof(evt6.daddr), + bpf_probe_read_kernel(&evt6.daddr, sizeof(evt6.daddr), newsk->__sk_common.skc_v6_daddr.in6_u.u6_addr32); evt6.sport = lport; @@ -581,6 +601,7 @@ def print_ipv6_event(cpu, data, size): bpf_text = bpf_text.replace('##FILTER_PID##', pid_filter) bpf_text = bpf_text.replace('##FILTER_NETNS##', netns_filter) +bpf_text = filter_by_containers(args) + bpf_text if args.ebpf: print(bpf_text) diff --git a/tools/tcptracer_example.txt b/tools/tcptracer_example.txt index 2873d036a..0f61ecc7b 100644 --- a/tools/tcptracer_example.txt +++ b/tools/tcptracer_example.txt @@ -35,3 +35,11 @@ TIME(s) T PID COMM IP SADDR DADDR SPORT 3.546 C 748 curl 6 [::1] [::1] 42592 80 4.294 X 31002 telnet 4 192.168.1.2 192.168.1.1 42590 23 ``` + + +The --cgroupmap option filters based on a cgroup set. It is meant to be used +with an externally created map. + +# ./tcptracer --cgroupmap /sys/fs/bpf/test01 + +For more details, see docs/special_filtering.md diff --git a/tools/threadsnoop.py b/tools/threadsnoop.py new file mode 100755 index 000000000..04c5e680d --- /dev/null +++ b/tools/threadsnoop.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# @lint-avoid-python-3-compatibility-imports +# +# threadsnoop List new thread creation. +# For Linux, uses BCC, eBPF. Embedded C. +# +# Copyright (c) 2019 Brendan Gregg. +# Licensed under the Apache License, Version 2.0 (the "License"). +# This was originally created for the BPF Performance Tools book +# published by Addison Wesley. ISBN-13: 9780136554820 +# When copying or porting, include this comment. +# +# 02-Jul-2019 Brendan Gregg Ported from bpftrace to BCC. + +from __future__ import print_function +from bcc import BPF + +# load BPF program +b = BPF(text=""" +#include + +struct data_t { + u64 ts; + u32 pid; + u64 start; + char comm[TASK_COMM_LEN]; +}; + +BPF_PERF_OUTPUT(events); + +void do_entry(struct pt_regs *ctx) { + struct data_t data = {}; + data.ts = bpf_ktime_get_ns(); + data.pid = bpf_get_current_pid_tgid() >> 32; + data.start = PT_REGS_PARM3(ctx); + bpf_get_current_comm(&data.comm, sizeof(data.comm)); + + events.perf_submit(ctx, &data, sizeof(data)); +}; +""") +b.attach_uprobe(name="pthread", sym="pthread_create", fn_name="do_entry") + +print("%-10s %-6s %-16s %s" % ("TIME(ms)", "PID", "COMM", "FUNC")) + +start_ts = 0 + +# process event +def print_event(cpu, data, size): + global start_ts + event = b["events"].event(data) + if start_ts == 0: + start_ts = event.ts + func = b.sym(event.start, event.pid) + if (func == "[unknown]"): + func = hex(event.start) + print("%-10d %-6d %-16s %s" % ((event.ts - start_ts) / 1000000, + event.pid, event.comm, func)) + +b["events"].open_perf_buffer(print_event) +while 1: + try: + b.perf_buffer_poll() + except KeyboardInterrupt: + exit() diff --git a/tools/threadsnoop_example.txt b/tools/threadsnoop_example.txt new file mode 100644 index 000000000..e65b503fa --- /dev/null +++ b/tools/threadsnoop_example.txt @@ -0,0 +1,27 @@ +Demonstrations of threadsnoop, the Linux BCC/eBPF version. + + +Tracing new threads via phtread_create(): + +# ./threadsnoop +Attaching 2 probes... +TIME(ms) PID COMM FUNC +1938 28549 dockerd threadentry +1939 28549 dockerd threadentry +1939 28549 dockerd threadentry +1940 28549 dockerd threadentry +1949 28549 dockerd threadentry +1958 28549 dockerd threadentry +1939 28549 dockerd threadentry +1950 28549 dockerd threadentry +2013 28579 docker-containe 0x562f30f2e710L +2036 28549 dockerd threadentry +2083 28579 docker-containe 0x562f30f2e710L +2116 629 systemd-journal 0x7fb7114955c0L +2116 629 systemd-journal 0x7fb7114955c0L +[...] + +The output shows a dockerd process creating several threads with the start +routine threadentry(), and docker-containe (truncated) and systemd-journal +also starting threads: in their cases, the function had no symbol information +available, so their addresses are printed in hex. diff --git a/tools/trace.py b/tools/trace.py index 8b2ca3587..7a61594f1 100755 --- a/tools/trace.py +++ b/tools/trace.py @@ -11,7 +11,7 @@ # Copyright (C) 2016 Sasha Goldshtein. from __future__ import print_function -from bcc import BPF, USDT +from bcc import BPF, USDT, StrcmpRewrite from functools import partial from time import sleep, strftime import time @@ -65,6 +65,7 @@ def __init__(self, probe, string_size, kernel_stack, user_stack, self.string_size = string_size self.kernel_stack = kernel_stack self.user_stack = user_stack + self.probe_user_list = set() Probe.probe_count += 1 self._parse_probe() self.probe_num = Probe.probe_count @@ -137,6 +138,19 @@ def _parse_probe(self): # The remainder of the text is the printf action self._parse_action(text.lstrip()) + def _parse_offset(self, func_and_offset): + func, offset_str = func_and_offset.split("+") + try: + if "x" in offset_str or "X" in offset_str: + offset = int(offset_str, 16) + else: + offset = int(offset_str) + except ValueError: + self._bail("invalid offset format " + + " '%s', must be decimal or hexadecimal" % offset_str) + + return func, offset + def _parse_spec(self, spec): parts = spec.split(":") # Two special cases: 'func' means 'p::func', 'lib:func' means @@ -154,14 +168,19 @@ def _parse_spec(self, spec): else: self._bail("probe type must be '', 'p', 't', 'r', " + "or 'u', but got '%s'" % parts[0]) + self.offset = 0 + if "+" in parts[-1]: + parts[-1], self.offset = self._parse_offset(parts[-1]) + if self.probe_type == "t": self.tp_category = parts[1] self.tp_event = parts[2] self.library = "" # kernel self.function = "" # from TRACEPOINT_PROBE elif self.probe_type == "u": - self.library = ':'.join(parts[1:-1]) - self.usdt_name = parts[-1] + # u:[:]: where : is optional + self.library = parts[1] + self.usdt_name = ":".join(parts[2:]) self.function = "" # no function, just address # We will discover the USDT provider by matching on # the USDT name in the specified library @@ -180,8 +199,17 @@ def _find_usdt_probe(self): target = Probe.pid if Probe.pid and Probe.pid != -1 \ else Probe.tgid self.usdt = USDT(path=self.library, pid=target) + + parts = self.usdt_name.split(":") + if len(parts) == 1: + provider_name = None + usdt_name = parts[0].encode("ascii") + else: + provider_name = parts[0].encode("ascii") + usdt_name = parts[1].encode("ascii") for probe in self.usdt.enumerate_probes(): - if probe.name == self.usdt_name.encode('ascii'): + if ((not provider_name or probe.provider == provider_name) + and probe.name == usdt_name): return # Found it, will enable later self._bail("unrecognized USDT probe %s" % self.usdt_name) @@ -227,17 +255,17 @@ def _parse_action(self, action): aliases_indarg = { "arg1": "({u64 _val; struct pt_regs *_ctx = (struct pt_regs *)PT_REGS_PARM1(ctx);" - " bpf_probe_read(&_val, sizeof(_val), &(PT_REGS_PARM1(_ctx))); _val;})", + " bpf_probe_read_kernel(&_val, sizeof(_val), &(PT_REGS_PARM1(_ctx))); _val;})", "arg2": "({u64 _val; struct pt_regs *_ctx = (struct pt_regs *)PT_REGS_PARM1(ctx);" - " bpf_probe_read(&_val, sizeof(_val), &(PT_REGS_PARM2(_ctx))); _val;})", + " bpf_probe_read_kernel(&_val, sizeof(_val), &(PT_REGS_PARM2(_ctx))); _val;})", "arg3": "({u64 _val; struct pt_regs *_ctx = (struct pt_regs *)PT_REGS_PARM1(ctx);" - " bpf_probe_read(&_val, sizeof(_val), &(PT_REGS_PARM3(_ctx))); _val;})", + " bpf_probe_read_kernel(&_val, sizeof(_val), &(PT_REGS_PARM3(_ctx))); _val;})", "arg4": "({u64 _val; struct pt_regs *_ctx = (struct pt_regs *)PT_REGS_PARM1(ctx);" - " bpf_probe_read(&_val, sizeof(_val), &(PT_REGS_PARM4(_ctx))); _val;})", + " bpf_probe_read_kernel(&_val, sizeof(_val), &(PT_REGS_PARM4(_ctx))); _val;})", "arg5": "({u64 _val; struct pt_regs *_ctx = (struct pt_regs *)PT_REGS_PARM1(ctx);" - " bpf_probe_read(&_val, sizeof(_val), &(PT_REGS_PARM5(_ctx))); _val;})", + " bpf_probe_read_kernel(&_val, sizeof(_val), &(PT_REGS_PARM5(_ctx))); _val;})", "arg6": "({u64 _val; struct pt_regs *_ctx = (struct pt_regs *)PT_REGS_PARM1(ctx);" - " bpf_probe_read(&_val, sizeof(_val), &(PT_REGS_PARM6(_ctx))); _val;})", + " bpf_probe_read_kernel(&_val, sizeof(_val), &(PT_REGS_PARM6(_ctx))); _val;})", } aliases_common = { @@ -250,47 +278,33 @@ def _parse_action(self, action): "$task" : "((struct task_struct *)bpf_get_current_task())" } - def _generate_streq_function(self, string): - fname = "streq_%d" % Probe.streq_index - Probe.streq_index += 1 - self.streq_functions += """ -static inline bool %s(char const *ignored, uintptr_t str) { - char needle[] = %s; - char haystack[sizeof(needle)]; - bpf_probe_read(&haystack, sizeof(haystack), (void *)str); - for (int i = 0; i < sizeof(needle) - 1; ++i) { - if (needle[i] != haystack[i]) { - return false; - } - } - return true; -} - """ % (fname, string) - return fname - def _rewrite_expr(self, expr): - if self.is_syscall_kprobe: - for alias, replacement in Probe.aliases_indarg.items(): - expr = expr.replace(alias, replacement) - else: - for alias, replacement in Probe.aliases_arg.items(): - # For USDT probes, we replace argN values with the - # actual arguments for that probe obtained using - # bpf_readarg_N macros emitted at BPF construction. - if self.probe_type == "u": - continue + # Find the occurances of any arg[1-6]@user. Use it later to + # identify bpf_probe_read_user + for matches in re.finditer(r'(arg[1-6])(@user)', expr): + if matches.group(1).strip() not in self.probe_user_list: + self.probe_user_list.add(matches.group(1).strip()) + # Remove @user occurrences from arg before resolving to its + # corresponding aliases. + expr = re.sub(r'(arg[1-6])@user', r'\1', expr) + rdict = StrcmpRewrite.rewrite_expr(expr, + self.bin_cmp, self.library, + self.probe_user_list, self.streq_functions, + Probe.streq_index) + expr = rdict["expr"] + self.streq_functions = rdict["streq_functions"] + Probe.streq_index = rdict["probeid"] + alias_to_check = Probe.aliases_indarg \ + if self.is_syscall_kprobe \ + else Probe.aliases_arg + # For USDT probes, we replace argN values with the + # actual arguments for that probe obtained using + # bpf_readarg_N macros emitted at BPF construction. + if not self.probe_type == "u": + for alias, replacement in alias_to_check.items(): expr = expr.replace(alias, replacement) for alias, replacement in Probe.aliases_common.items(): expr = expr.replace(alias, replacement) - if self.bin_cmp: - STRCMP_RE = 'STRCMP\\(\"([^"]+)\\"' - else: - STRCMP_RE = 'STRCMP\\(("[^"]+\\")' - matches = re.finditer(STRCMP_RE, expr) - for match in matches: - string = match.group(1) - fname = self._generate_streq_function(string) - expr = expr.replace("STRCMP", fname, 1) return expr p_type = {"u": ct.c_uint, "d": ct.c_int, "lu": ct.c_ulong, @@ -402,14 +416,24 @@ def _generate_field_assign(self, idx): text = (" %s %s = 0;\n" + " bpf_usdt_readarg(%s, ctx, &%s);\n") \ % (arg_ctype, expr, expr[3], expr) - + probe_read_func = "bpf_probe_read_kernel" if field_type == "s": + if self.library: + probe_read_func = "bpf_probe_read_user" + else: + alias_to_check = Probe.aliases_indarg \ + if self.is_syscall_kprobe \ + else Probe.aliases_arg + for arg, alias in alias_to_check.items(): + if alias == expr and arg in self.probe_user_list: + probe_read_func = "bpf_probe_read_user" + break return text + """ if (%s != 0) { void *__tmp = (void *)%s; - bpf_probe_read(&__data.v%d, sizeof(__data.v%d), __tmp); + %s(&__data.v%d, sizeof(__data.v%d), __tmp); } - """ % (expr, expr, idx, idx) + """ % (expr, expr, probe_read_func, idx, idx) if field_type in Probe.fmt_types: return text + " __data.v%d = (%s)%s;\n" % \ (idx, Probe.c_type[field_type], expr) @@ -622,7 +646,8 @@ def _attach_k(self, bpf): fn_name=self.probe_name) elif self.probe_type == "p": bpf.attach_kprobe(event=self.function, - fn_name=self.probe_name) + fn_name=self.probe_name, + event_off=self.offset) # Note that tracepoints don't need an explicit attach def _attach_u(self, bpf): @@ -644,7 +669,8 @@ def _attach_u(self, bpf): bpf.attach_uprobe(name=libpath, sym=self.function, fn_name=self.probe_name, - pid=Probe.tgid) + pid=Probe.tgid, + sym_off=self.offset) class Tool(object): DEFAULT_PERF_BUFFER_PAGES = 64 @@ -653,6 +679,8 @@ class Tool(object): trace do_sys_open Trace the open syscall and print a default trace message when entered +trace kfree_skb+0x12 + Trace the kfree_skb kernel function after the instruction on the 0x12 offset trace 'do_sys_open "%s", arg2' Trace the open syscall and print the filename being opened trace 'do_sys_open "%s", arg2' -n main @@ -677,6 +705,8 @@ class Tool(object): Trace the block_rq_complete kernel tracepoint and print # of tx sectors trace 'u:pthread:pthread_create (arg4 != 0)' Trace the USDT probe pthread_create when its 4th argument is non-zero +trace 'u:pthread:libpthread:pthread_create (arg4 != 0)' + Ditto, but the provider name "libpthread" is specified. trace 'p::SyS_nanosleep(struct timespec *ts) "sleep for %lld ns", ts->tv_nsec' Trace the nanosleep syscall and print the sleep duration in ns trace -c /sys/fs/cgroup/system.slice/workload.service '__x64_sys_nanosleep' '__x64_sys_clone' diff --git a/tools/trace_example.txt b/tools/trace_example.txt index eb6375079..40c5189a7 100644 --- a/tools/trace_example.txt +++ b/tools/trace_example.txt @@ -54,7 +54,7 @@ Event message filter is useful while you only interesting the specific event. Like the program open thousands file and you only want to see the "temp" file and print stack. -# trace 'do_sys_open "%s", arg2' -UK -f temp +# trace 'do_sys_open "%s", arg2@user' -UK -f temp PID TID COMM FUNC - 9557 9557 a.out do_sys_open temp.1 do_sys_open+0x1 [kernel] @@ -71,7 +71,7 @@ PID TID COMM FUNC - Process name filter is porting from tools/opensnoop -# trace 'do_sys_open "%s", arg2' -UK -n out +# trace 'do_sys_open "%s", arg2@user' -UK -n out PID TID COMM FUNC - 9557 9557 a.out do_sys_open temp.1 do_sys_open+0x1 [kernel] @@ -241,7 +241,7 @@ so it always includes this header file. As a final example, let's trace open syscalls for a specific process. By default, tracing is system-wide, but the -p switch overrides this: -# trace -p 2740 'do_sys_open "%s", arg2' -T +# trace -p 2740 'do_sys_open "%s", arg2@user' -T TIME PID COMM FUNC - 05:36:16 15872 ls do_sys_open /etc/ld.so.cache 05:36:16 15872 ls do_sys_open /lib64/libselinux.so.1 @@ -287,7 +287,52 @@ STRCMP helper in binary mode (--bin_cmp flag) to compare optval array against int value of 108 (parametr of setsockopt call) in hex representation (little endian format) - +For advanced users there is a possibility to insert the kprobes or uprobes +after a certain offset, rather than the start of the function call +This is useful for tracing register values at different places of the +execution of a function. Lets consider the following example: + +int main() +{ + int val = 0xdead; + printf("%d\n", val); + val = 0xbeef; + printf("%d\n", val); +} + +After compiling the code with -O3 optimization the object code looks +like the following (with GCC 10 and x86_64 architecture): + +objdump --disassemble=main --prefix-addresses a.out + +0000000000001060
endbr64 +0000000000001064 sub $0x8,%rsp +0000000000001068 mov $0xdead,%edx +000000000000106d mov $0x1,%edi +0000000000001072 xor %eax,%eax +0000000000001074 lea 0xf89(%rip),%rsi +000000000000107b callq 0000000000001050 <__printf_chk@plt> +0000000000001080 mov $0xbeef,%edx +0000000000001085 lea 0xf78(%rip),%rsi +000000000000108c xor %eax,%eax +000000000000108e mov $0x1,%edi +0000000000001093 callq 0000000000001050 <__printf_chk@plt> +0000000000001098 xor %eax,%eax +000000000000109a add $0x8,%rsp +000000000000109e retq + +The 0xdead and later the 0xbeef values are moved into the edx register. +As the disassembly shows the edx register contains the 0xdead value +after the 0xd offset and 0xbeef after the 0x25 offset. To verify this +with trace lets insert probes to those offsets. The following +command inserts two uprobe one after the 0xd offset and another one +after the 0x25 offset of the main function. The probe print the +value of the edx register which will show us the correct values. + +trace 'p:/tmp/a.out:main+0xd "%x", ctx->dx' 'p:/tmp/a.out:main+0x25 "%x", ctx->dx' +PID TID COMM FUNC - +25754 25754 a.out main dead +25754 25754 a.out main beef USAGE message: @@ -335,11 +380,16 @@ EXAMPLES: trace do_sys_open Trace the open syscall and print a default trace message when entered -trace 'do_sys_open "%s", arg2' - Trace the open syscall and print the filename being opened -trace 'do_sys_open "%s", arg2' -n main +trace kfree_skb+0x12 + Trace the kfree_skb kernel function after the instruction on the 0x12 offset +trace 'do_sys_open "%s", arg2@user' + Trace the open syscall and print the filename being opened. @user is + added to arg2 in kprobes to ensure that char * should be copied from + the userspace stack to the bpf stack. If not specified, previous + behaviour is expected. +trace 'do_sys_open "%s", arg2@user' -n main Trace the open syscall and only print event that process names containing "main" -trace 'do_sys_open "%s", arg2' -f config +trace 'do_sys_open "%s", arg2@user' -f config Trace the open syscall and print the filename being opened filtered by "config" trace 'sys_read (arg3 > 20000) "read %d bytes", arg3' Trace the read syscall and print a message for reads >20000 bytes diff --git a/tools/ttysnoop.py b/tools/ttysnoop.py index 058dc7e34..b576b7ae5 100755 --- a/tools/ttysnoop.py +++ b/tools/ttysnoop.py @@ -77,10 +77,10 @@ def usage(): if (file->f_inode->i_ino != PTS) return 0; - // bpf_probe_read() can only use a fixed size, so truncate to count + // bpf_probe_read_user() can only use a fixed size, so truncate to count // in user space: struct data_t data = {}; - bpf_probe_read(&data.buf, BUFSIZE, (void *)buf); + bpf_probe_read_user(&data.buf, BUFSIZE, (void *)buf); if (count > BUFSIZE) data.count = BUFSIZE; else diff --git a/tools/vfsstat.py b/tools/vfsstat.py index 1764c6012..a3d22db82 100755 --- a/tools/vfsstat.py +++ b/tools/vfsstat.py @@ -37,7 +37,7 @@ def usage(): usage() # load BPF program -b = BPF(text=""" +bpf_text = """ #include enum stat_types { @@ -55,18 +55,38 @@ def usage(): u64 *leaf = stats.lookup(&key); if (leaf) (*leaf)++; } +""" +bpf_text_kprobe = """ void do_read(struct pt_regs *ctx) { stats_increment(S_READ); } void do_write(struct pt_regs *ctx) { stats_increment(S_WRITE); } void do_fsync(struct pt_regs *ctx) { stats_increment(S_FSYNC); } void do_open(struct pt_regs *ctx) { stats_increment(S_OPEN); } void do_create(struct pt_regs *ctx) { stats_increment(S_CREATE); } -""") -b.attach_kprobe(event="vfs_read", fn_name="do_read") -b.attach_kprobe(event="vfs_write", fn_name="do_write") -b.attach_kprobe(event="vfs_fsync", fn_name="do_fsync") -b.attach_kprobe(event="vfs_open", fn_name="do_open") -b.attach_kprobe(event="vfs_create", fn_name="do_create") +""" + +bpf_text_kfunc = """ +KFUNC_PROBE(vfs_read, int unused) { stats_increment(S_READ); return 0; } +KFUNC_PROBE(vfs_write, int unused) { stats_increment(S_WRITE); return 0; } +KFUNC_PROBE(vfs_fsync, int unused) { stats_increment(S_FSYNC); return 0; } +KFUNC_PROBE(vfs_open, int unused) { stats_increment(S_OPEN); return 0; } +KFUNC_PROBE(vfs_create, int unused) { stats_increment(S_CREATE); return 0; } +""" + +is_support_kfunc = BPF.support_kfunc() +#is_support_kfunc = False #BPF.support_kfunc() +if is_support_kfunc: + bpf_text += bpf_text_kfunc +else: + bpf_text += bpf_text_kprobe + +b = BPF(text=bpf_text) +if not is_support_kfunc: + b.attach_kprobe(event="vfs_read", fn_name="do_read") + b.attach_kprobe(event="vfs_write", fn_name="do_write") + b.attach_kprobe(event="vfs_fsync", fn_name="do_fsync") + b.attach_kprobe(event="vfs_open", fn_name="do_open") + b.attach_kprobe(event="vfs_create", fn_name="do_create") # stat column labels and indexes stat_types = { diff --git a/tools/wakeuptime.py b/tools/wakeuptime.py index a22245a7b..e13bdf0f7 100755 --- a/tools/wakeuptime.py +++ b/tools/wakeuptime.py @@ -136,7 +136,7 @@ def signal_ignore(signal, frame): struct key_t key = {}; key.w_k_stack_id = stack_traces.get_stackid(ctx, 0); - bpf_probe_read(&key.target, sizeof(key.target), p->comm); + bpf_probe_read_kernel(&key.target, sizeof(key.target), p->comm); bpf_get_current_comm(&key.waker, sizeof(key.waker)); counts.increment(key, delta); diff --git a/tools/xfsslower.py b/tools/xfsslower.py index 9fa125662..f259e495c 100755 --- a/tools/xfsslower.py +++ b/tools/xfsslower.py @@ -196,7 +196,7 @@ struct qstr qs = valp->fp->f_path.dentry->d_name; if (qs.len == 0) return 0; - bpf_probe_read(&data.file, sizeof(data.file), (void *)qs.name); + bpf_probe_read_kernel(&data.file, sizeof(data.file), (void *)qs.name); // output events.perf_submit(ctx, &data, sizeof(data)); diff --git a/tools/zfsslower.py b/tools/zfsslower.py index 2f05b561e..3a61a36ca 100755 --- a/tools/zfsslower.py +++ b/tools/zfsslower.py @@ -192,7 +192,7 @@ struct qstr qs = valp->fp->f_path.dentry->d_name; if (qs.len == 0) return 0; - bpf_probe_read(&data.file, sizeof(data.file), (void *)qs.name); + bpf_probe_read_kernel(&data.file, sizeof(data.file), (void *)qs.name); // output events.perf_submit(ctx, &data, sizeof(data));