You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apisix.apache.org by yo...@apache.org on 2022/10/27 02:45:20 UTC
[apisix-profiler] branch main updated: change: add profiler cmd tool (#2)
This is an automated email from the ASF dual-hosted git repository.
yousa pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/apisix-profiler.git
The following commit(s) were added to refs/heads/main by this push:
new b6c2e6e change: add profiler cmd tool (#2)
b6c2e6e is described below
commit b6c2e6e9f906d4f6df4de8c26bd130f43a5fdd8b
Author: 云微 <10...@qq.com>
AuthorDate: Thu Oct 27 10:45:14 2022 +0800
change: add profiler cmd tool (#2)
* change: remove download vmlinux and tools
* change: add wget to download vmlinux
* profiler: add Makefile and gitignore
* profiler: add lua_state define header from luajit
Add LuaJIT common internal definitions for profiler to get BTF format.
The data struct is copied from luajit 5.1 and modified.
* profiler: add eBPF program to get lua stack trace
* profiler: add lua stacks map to handle stack info
* profiler: add stack printer to export info
* profiler: add cmd entry
* fix: various compile issues
* feat: add max frame depth as an option
---
.gitignore | 3 +
profiler/Makefile | 20 +-
profiler/lua_stacks_map.cpp | 37 +
profiler/lua_stacks_map.h | 29 +
profiler/lua_state.h | 884 +
profiler/profile.bpf.c | 264 +
profiler/profile.cpp | 502 +
profiler/profile.h | 66 +
profiler/stack_printer.cpp | 397 +
profiler/stack_printer.h | 7 +
tools/bpftool | Bin 2453464 -> 0 bytes
tools/gen_vmlinux_h.sh | 8 -
vmlinux/arm64/vmlinux.h | 1 -
vmlinux/arm64/vmlinux_516.h | 160927 -----------------------------------------
vmlinux/vmlinux.h | 1 -
vmlinux/x86/vmlinux.h | 1 -
vmlinux/x86/vmlinux_508.h | 128607 --------------------------------
17 files changed, 2203 insertions(+), 289551 deletions(-)
diff --git a/.gitignore b/.gitignore
index 2eda0b7..3c633ec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
profiler/.output/*
profiler/*.o
profiler/profile
+tools/
+vmlinux/
+profiler/vmlinux.tar
diff --git a/profiler/Makefile b/profiler/Makefile
index 8424ed3..5dd37fc 100644
--- a/profiler/Makefile
+++ b/profiler/Makefile
@@ -13,7 +13,7 @@ HELPERS := $(abspath ../helpers)
# libbpf to avoid dependency on system-wide headers, which could be missing or
# outdated
INCLUDES := -I$(OUTPUT) -I../libbpf/include/uapi -I$(dir $(VMLINUX)) -I$(HELPERS)
-CFLAGS := -g -Wall -fsanitize=address
+CFLAGS := -g -Wall # -fsanitize=address
APPS = profile
@@ -43,6 +43,11 @@ endif
.PHONY: all
all: $(APPS)
+$(VMLINUX):
+ $(Q)wget https://github.com/yunwei37/apisix-profiler/releases/download/vmlinux/vmlinux.tar
+ $(Q)cd ../ && tar -xvf profiler/vmlinux.tar
+ $(Q)rm vmlinux.tar
+
.PHONY: clean
clean:
$(call msg,CLEAN)
@@ -74,9 +79,9 @@ $(OUTPUT)/%.skel.h: $(OUTPUT)/%.bpf.o | $(OUTPUT)
# Build user-space code
$(patsubst %,$(OUTPUT)/%.o,$(APPS)): %.o: %.skel.h
-$(OUTPUT)/%.o: %.c $(wildcard %.h) | $(OUTPUT)
+$(OUTPUT)/%.o: %.cpp $(wildcard %.h) | $(OUTPUT)
$(call msg,CC,$@)
- $(Q)$(CC) $(CFLAGS) $(INCLUDES) -c $(filter %.c,$^) -o $@
+ $(Q)$(CXX) $(CFLAGS) $(INCLUDES) -c $(filter %.cpp,$^) -o $@
trace_helpers.o: $(HELPERS)/trace_helpers.c
$(Q)$(CC) $(CFLAGS) $(INCLUDES) -c $(filter %.c,$^) -o $@
@@ -84,11 +89,14 @@ trace_helpers.o: $(HELPERS)/trace_helpers.c
uprobe_helpers.o: $(HELPERS)/uprobe_helpers.c
$(Q)$(CC) $(CFLAGS) $(INCLUDES) -c $(filter %.c,$^) -o $@
-lua_stacks_helper.o: lua_stacks_helper.cpp profile.h lua_stacks_helper.h
- $(CC) $(CFLAGS) $(INCLUDES) -c $(filter %.cpp,$^) -o $@
+lua_stacks_map.o: lua_stacks_map.cpp profile.h lua_stacks_map.h
+ $(CXX) $(CFLAGS) $(INCLUDES) -c $(filter %.cpp,$^) -o $@
+
+stack_printer.o: stack_printer.cpp profile.h stack_printer.h
+ $(CXX) $(CFLAGS) $(INCLUDES) -c $(filter %.cpp,$^) -o $@
# Build application binary
-$(APPS): %: $(OUTPUT)/%.o uprobe_helpers.o trace_helpers.o lua_stacks_helper.o $(LIBBPF_OBJ) | $(OUTPUT)
+$(APPS): %: $(OUTPUT)/%.o uprobe_helpers.o trace_helpers.o lua_stacks_map.o stack_printer.o $(LIBBPF_OBJ) | $(OUTPUT)
$(call msg,BINARY,$@)
$(Q)$(CXX) $(CFLAGS) $^ -lelf -lz -o $@
diff --git a/profiler/lua_stacks_map.cpp b/profiler/lua_stacks_map.cpp
new file mode 100644
index 0000000..2f3585e
--- /dev/null
+++ b/profiler/lua_stacks_map.cpp
@@ -0,0 +1,37 @@
+#include "lua_stacks_map.h"
+#include <map>
+
+void lua_stack_map::insert_lua_stack_map(const struct lua_stack_event *e)
+{
+ if (!e)
+ {
+ return;
+ }
+ auto it = map.find(e->user_stack_id);
+ if (it == map.end())
+ {
+ lua_stack_backtrace stack = {*e};
+ map[e->user_stack_id] = stack; // insert
+ return;
+ }
+ lua_stack_backtrace *stack = &it->second;
+ stack->push_back(*e);
+ return;
+}
+
+// return the level of stack in the map
+int lua_stack_map::get_lua_stack_backtrace(int user_stack_id, lua_stack_backtrace *stack)
+{
+ if (!stack)
+ {
+ return -1;
+ }
+ auto it = map.find(user_stack_id);
+ if (it == map.end())
+ {
+ *stack = lua_stack_backtrace{};
+ return -1;
+ }
+ *stack = it->second;
+ return stack->size();
+}
\ No newline at end of file
diff --git a/profiler/lua_stacks_map.h b/profiler/lua_stacks_map.h
new file mode 100644
index 0000000..b7e004b
--- /dev/null
+++ b/profiler/lua_stacks_map.h
@@ -0,0 +1,29 @@
+#ifndef LUA_STACKS_HELPER_H
+#define LUA_STACKS_HELPER_H
+
+#define MAX_STACK_DEPTH 64
+
+#include "profile.h"
+#include <map>
+#include <vector>
+
+// lua stack backtrace events
+using lua_stack_backtrace = std::vector<struct lua_stack_event>;
+
+// The map to collect and reserved the stack event found in perf event.
+// The stack info will be printed when the profiler stopped.
+class lua_stack_map
+{
+private:
+ std::map<int, lua_stack_backtrace> map;
+
+public:
+ // insert a lua stack event into the map.
+ // The event will be push into the backtrace vector with the same stack_id.
+ void insert_lua_stack_map(const struct lua_stack_event *event);
+ // get the lua stack backtrace with the stack_id.
+ // return the level of stack in the map
+ int get_lua_stack_backtrace(int user_stack_id, lua_stack_backtrace *stack);
+};
+
+#endif
\ No newline at end of file
diff --git a/profiler/lua_state.h b/profiler/lua_state.h
new file mode 100644
index 0000000..e92a89d
--- /dev/null
+++ b/profiler/lua_state.h
@@ -0,0 +1,884 @@
+/*
+** LuaJIT common internal definitions for profiler to get BTF format.
+** Copyright (C) 2005-2022 Mike Pall. See Copyright Notice in luajit.h
+**
+** 17-Jul-2022 Yusheng Zheng modified this from lua.h, lua_state.h and
+** lj_def.h.
+*/
+
+#ifndef __LUA_STATE_H
+#define __LUA_STATE_H
+
+#include <vmlinux.h>
+#include <bpf/bpf_helpers.h>
+#include <bpf/bpf_core_read.h>
+#include <bpf/bpf_tracing.h>
+
+#define LJ_TARGET_GC64 1
+
+/* 64 bit GC references. */
+#if LJ_TARGET_GC64
+#define LJ_GC64 1
+#else
+#define LJ_GC64 0
+#endif
+
+/* GCobj reference */
+typedef struct GCRef
+{
+#if LJ_GC64
+ uint64_t gcptr64; /* True 64 bit pointer. */
+#else
+ uint32_t gcptr32; /* Pseudo 32 bit pointer. */
+#endif
+} GCRef;
+
+/* 2-slot frame info. */
+#if LJ_GC64
+#define LJ_FR2 1
+#else
+#define LJ_FR2 0
+#endif
+
+/* Optional defines. */
+#ifndef LJ_FASTCALL
+#define LJ_FASTCALL
+#endif
+#ifndef LJ_NORET
+#define LJ_NORET
+#endif
+#ifndef LJ_NOAPI
+#define LJ_NOAPI extern
+#endif
+#ifndef LJ_LIKELY
+#define LJ_LIKELY(x) (x)
+#define LJ_UNLIKELY(x) (x)
+#endif
+
+/* Attributes for internal functions. */
+#define LJ_DATA LJ_NOAPI
+#define LJ_DATADEF
+#define LJ_ASMF LJ_NOAPI
+#define LJ_FUNCA LJ_NOAPI
+#if defined(ljamalg_c)
+#define LJ_FUNC static
+#else
+#define LJ_FUNC LJ_NOAPI
+#endif
+#define LJ_FUNC_NORET LJ_FUNC LJ_NORET
+#define LJ_FUNCA_NORET LJ_FUNCA LJ_NORET
+#define LJ_ASMF_NORET LJ_ASMF LJ_NORET
+
+/* Internal assertions. */
+#if defined(LUA_USE_ASSERT) || defined(LUA_USE_APICHECK)
+#define lj_assert_check(g, c, ...) \
+ ((c) ? (void)0 : (lj_assert_fail((g), __FILE__, __LINE__, __func__, __VA_ARGS__), 0))
+#define lj_checkapi(c, ...) lj_assert_check(G(L), (c), __VA_ARGS__)
+#else
+#define lj_checkapi(c, ...) ((void)L)
+#endif
+
+#ifdef LUA_USE_ASSERT
+#define lj_assertG_(g, c, ...) lj_assert_check((g), (c), __VA_ARGS__)
+#define lj_assertG(c, ...) lj_assert_check(g, (c), __VA_ARGS__)
+#define lj_assertL(c, ...) lj_assert_check(G(L), (c), __VA_ARGS__)
+#define lj_assertX(c, ...) lj_assert_check(NULL, (c), __VA_ARGS__)
+#define check_exp(c, e) (lj_assertX((c), #c), (e))
+#else
+#define lj_assertG_(g, c, ...) ((void)0)
+#define lj_assertG(c, ...) ((void)g)
+#define lj_assertL(c, ...) ((void)L)
+#define lj_assertX(c, ...) ((void)0)
+#define check_exp(c, e) (e)
+#endif
+
+/* Static assertions. */
+#define LJ_ASSERT_NAME2(name, line) name##line
+#define LJ_ASSERT_NAME(line) LJ_ASSERT_NAME2(lj_assert_, line)
+#ifdef __COUNTER__
+#define LJ_STATIC_ASSERT(cond) \
+ extern void LJ_ASSERT_NAME(__COUNTER__)(int STATIC_ASSERTION_FAILED[(cond) ? 1 : -1])
+#else
+#define LJ_STATIC_ASSERT(cond) \
+ extern void LJ_ASSERT_NAME(__LINE__)(int STATIC_ASSERTION_FAILED[(cond) ? 1 : -1])
+#endif
+
+/* PRNG state. Need this here, details in lj_prng.h. */
+typedef struct PRNGState
+{
+ uint64_t u[4];
+} PRNGState;
+
+/* Common GC header for all collectable objects. */
+#define GCHeader \
+ GCRef nextgc; \
+ uint8_t marked; \
+ uint8_t gct
+/* This occupies 6 bytes, so use the next 2 bytes for non-32 bit fields. */
+
+/* Memory reference */
+typedef struct MRef
+{
+#if LJ_GC64
+ uint64_t ptr64; /* True 64 bit pointer. */
+#else
+ uint32_t ptr32; /* Pseudo 32 bit pointer. */
+#endif
+} MRef;
+
+#if LJ_GC64
+#define mref(r, t) ((t *)(void *)(r).ptr64)
+#define mrefu(r) ((r).ptr64)
+
+#define setmref(r, p) ((r).ptr64 = (uint64_t)(void *)(p))
+#define setmrefu(r, u) ((r).ptr64 = (uint64_t)(u))
+#define setmrefr(r, v) ((r).ptr64 = (v).ptr64)
+#else
+#define mref(r, t) ((t *)(void *)(uintptr_t)(r).ptr32)
+#define mrefu(r) ((r).ptr32)
+
+#define setmref(r, p) ((r).ptr32 = (uint32_t)(uintptr_t)(void *)(p))
+#define setmrefu(r, u) ((r).ptr32 = (uint32_t)(u))
+#define setmrefr(r, v) ((r).ptr32 = (v).ptr32)
+#endif
+
+#define LJ_ALIGN(n) __attribute__((aligned(n)))
+
+#define LUA_NUMBER double
+
+/* type of numbers in Lua */
+typedef LUA_NUMBER lua_Number;
+
+#if LJ_ARCH_ENDIAN == LUAJIT_BE
+#define LJ_LE 0
+#define LJ_BE 1
+#define LJ_ENDIAN_SELECT(le, be) be
+#define LJ_ENDIAN_LOHI(lo, hi) hi lo
+#else
+#define LJ_LE 1
+#define LJ_BE 0
+#define LJ_ENDIAN_SELECT(le, be) le
+#define LJ_ENDIAN_LOHI(lo, hi) lo hi
+#endif
+
+/* Frame link. */
+typedef union
+{
+ int32_t ftsz; /* Frame type and size of previous frame. */
+ MRef pcr; /* Or PC for Lua frames. */
+} FrameLink;
+
+/* Tagged value. */
+typedef LJ_ALIGN(8) union TValue
+{
+ uint64_t u64; /* 64 bit pattern overlaps number. */
+ lua_Number n; /* Number object overlaps split tag/value object. */
+#if LJ_GC64
+ GCRef gcr; /* GCobj reference with tag. */
+ int64_t it64;
+ struct
+ {
+ LJ_ENDIAN_LOHI(
+ int32_t i; /* Integer value. */
+ , uint32_t it; /* Internal object tag. Must overlap MSW of number. */
+ )
+ };
+#else
+ struct
+ {
+ LJ_ENDIAN_LOHI(
+ union {
+ GCRef gcr; /* GCobj reference (if any). */
+ int32_t i; /* Integer value. */
+ };
+ , uint32_t it; /* Internal object tag. Must overlap MSW of number. */
+ )
+ };
+#endif
+#if LJ_FR2
+ int64_t ftsz; /* Frame type and size of previous frame, or PC. */
+#else
+ struct
+ {
+ LJ_ENDIAN_LOHI(
+ GCRef func; /* Function for next frame (or dummy L). */
+ , FrameLink tp; /* Link to previous frame. */
+ )
+ } fr;
+#endif
+ struct
+ {
+ LJ_ENDIAN_LOHI(
+ uint32_t lo; /* Lower 32 bits of number. */
+ , uint32_t hi; /* Upper 32 bits of number. */
+ )
+ } u32;
+} TValue;
+
+/* Memory and GC object sizes. */
+typedef uint32_t MSize;
+#if LJ_GC64
+typedef uint64_t GCSize;
+#else
+typedef uint32_t GCSize;
+#endif
+
+/* Per-thread state object. */
+struct lua_State
+{
+ GCHeader;
+ uint8_t dummy_ffid; /* Fake FF_C for curr_funcisL() on dummy frames. */
+ uint8_t status; /* Thread status. */
+ MRef glref; /* Link to global state. */
+ GCRef gclist; /* GC chain. */
+ TValue *base; /* Base of currently executing function. */
+ TValue *top; /* First free slot in the stack. */
+ MRef maxstack; /* Last free slot in the stack. */
+ MRef stack; /* Stack base. */
+ GCRef openupval; /* List of open upvalues in the stack. */
+ GCRef env; /* Thread environment (table of globals). */
+ void *cframe; /* End of C stack frame chain. */
+ MSize stacksize; /* True stack size (incl. LJ_STACK_EXTRA). */
+ void *exdata; /* user extra data pointer. added by OpenResty */
+ void *exdata2; /* the 2nd user extra data pointer. added by OpenResty */
+#if LJ_TARGET_ARM
+ uint32_t unused1;
+ uint32_t unused2;
+#endif
+};
+
+typedef struct lua_State lua_State;
+
+typedef int (*lua_CFunction)(lua_State *L);
+
+typedef const TValue cTValue;
+/* Internal object tags.
+**
+** Format for 32 bit GC references (!LJ_GC64):
+**
+** Internal tags overlap the MSW of a number object (must be a double).
+** Interpreted as a double these are special NaNs. The FPU only generates
+** one type of NaN (0xfff8_0000_0000_0000). So MSWs > 0xfff80000 are available
+** for use as internal tags. Small negative numbers are used to shorten the
+** encoding of type comparisons (reg/mem against sign-ext. 8 bit immediate).
+**
+** ---MSW---.---LSW---
+** primitive types | itype | |
+** lightuserdata | itype | void * | (32 bit platforms)
+** lightuserdata |ffff|seg| ofs | (64 bit platforms)
+** GC objects | itype | GCRef |
+** int (LJ_DUALNUM)| itype | int |
+** number -------double------
+**
+** Format for 64 bit GC references (LJ_GC64):
+**
+** The upper 13 bits must be 1 (0xfff8...) for a special NaN. The next
+** 4 bits hold the internal tag. The lowest 47 bits either hold a pointer,
+** a zero-extended 32 bit integer or all bits set to 1 for primitive types.
+**
+** ------MSW------.------LSW------
+** primitive types |1..1|itype|1..................1|
+** GC objects |1..1|itype|-------GCRef--------|
+** lightuserdata |1..1|itype|seg|------ofs-------|
+** int (LJ_DUALNUM) |1..1|itype|0..0|-----int-------|
+** number ------------double-------------
+**
+** ORDER LJ_T
+** Primitive types nil/false/true must be first, lightuserdata next.
+** GC objects are at the end, table/userdata must be lowest.
+** Also check lj_ir.h for similar ordering constraints.
+*/
+#define LJ_TNIL (~0u)
+#define LJ_TFALSE (~1u)
+#define LJ_TTRUE (~2u)
+#define LJ_TLIGHTUD (~3u)
+#define LJ_TSTR (~4u)
+#define LJ_TUPVAL (~5u)
+#define LJ_TTHREAD (~6u)
+#define LJ_TPROTO (~7u)
+#define LJ_TFUNC (~8u)
+#define LJ_TTRACE (~9u)
+#define LJ_TCDATA (~10u)
+#define LJ_TTAB (~11u)
+#define LJ_TUDATA (~12u)
+/* This is just the canonical number type used in some places. */
+#define LJ_TNUMX (~13u)
+
+/* Integers have itype == LJ_TISNUM doubles have itype < LJ_TISNUM */
+#if LJ_64 && !LJ_GC64
+#define LJ_TISNUM 0xfffeffffu
+#else
+#define LJ_TISNUM LJ_TNUMX
+#endif
+#define LJ_TISTRUECOND LJ_TFALSE
+#define LJ_TISPRI LJ_TTRUE
+#define LJ_TISGCV (LJ_TSTR + 1)
+#define LJ_TISTABUD LJ_TTAB
+
+/* Type marker for slot holding a traversal index. Must be lightuserdata. */
+#define LJ_KEYINDEX 0xfffe7fffu
+
+#if LJ_GC64
+#define LJ_GCVMASK (((uint64_t)1 << 47) - 1)
+#endif
+
+#if LJ_64
+/* To stay within 47 bits, lightuserdata is segmented. */
+#define LJ_LIGHTUD_BITS_SEG 8
+#define LJ_LIGHTUD_BITS_LO (47 - LJ_LIGHTUD_BITS_SEG)
+#endif
+
+/* -- Common type definitions --------------------------------------------- */
+
+/* Types for handling bytecodes. Need this here, details in lj_bc.h. */
+typedef uint32_t BCIns; /* Bytecode instruction. */
+typedef uint32_t BCPos; /* Bytecode position. */
+typedef uint32_t BCReg; /* Bytecode register. */
+typedef int32_t BCLine; /* Bytecode line number. */
+
+/* Internal assembler functions. Never call these directly from C. */
+typedef void (*ASMFunction)(void);
+
+/* Resizable string buffer. Need this here, details in lj_buf.h. */
+#define SBufHeader \
+ char *w, *e, *b; \
+ MRef L
+typedef struct SBuf
+{
+ SBufHeader;
+} SBuf;
+
+/* Operand ranges and related constants. */
+#define BCMAX_A 0xff
+#define BCMAX_B 0xff
+#define BCMAX_C 0xff
+#define BCMAX_D 0xffff
+#define BCBIAS_J 0x8000
+#define NO_REG BCMAX_A
+#define NO_JMP (~(BCPos)0)
+
+/* Macros to get instruction fields. */
+#define bc_op(i) ((BCOp)((i)&0xff))
+#define bc_a(i) ((BCReg)(((i) >> 8) & 0xff))
+#define bc_b(i) ((BCReg)((i) >> 24))
+#define bc_c(i) ((BCReg)(((i) >> 16) & 0xff))
+#define bc_d(i) ((BCReg)((i) >> 16))
+#define bc_j(i) ((ptrdiff_t)bc_d(i) - BCBIAS_J)
+
+/* Macros to set instruction fields. */
+#define setbc_byte(p, x, ofs) \
+ ((uint8_t *)(p))[LJ_ENDIAN_SELECT(ofs, 3 - ofs)] = (uint8_t)(x)
+#define setbc_op(p, x) setbc_byte(p, (x), 0)
+#define setbc_a(p, x) setbc_byte(p, (x), 1)
+#define setbc_b(p, x) setbc_byte(p, (x), 3)
+#define setbc_c(p, x) setbc_byte(p, (x), 2)
+#define setbc_d(p, x) \
+ ((uint16_t *)(p))[LJ_ENDIAN_SELECT(1, 0)] = (uint16_t)(x)
+#define setbc_j(p, x) setbc_d(p, (BCPos)((int32_t)(x) + BCBIAS_J))
+
+/* Macros to compose instructions. */
+#define BCINS_ABC(o, a, b, c) \
+ (((BCIns)(o)) | ((BCIns)(a) << 8) | ((BCIns)(b) << 24) | ((BCIns)(c) << 16))
+#define BCINS_AD(o, a, d) \
+ (((BCIns)(o)) | ((BCIns)(a) << 8) | ((BCIns)(d) << 16))
+#define BCINS_AJ(o, a, j) BCINS_AD(o, a, (BCPos)((int32_t)(j) + BCBIAS_J))
+
+#if LJ_GC64
+#define gcref(r) ((GCobj *)(r).gcptr64)
+#define gcrefp(r, t) ((t *)(void *)(r).gcptr64)
+#define gcrefu(r) ((r).gcptr64)
+#define gcrefeq(r1, r2) ((r1).gcptr64 == (r2).gcptr64)
+
+#define setgcref(r, gc) ((r).gcptr64 = (uint64_t) & (gc)->gch)
+#define setgcreft(r, gc, it) \
+ (r).gcptr64 = (uint64_t) & (gc)->gch | (((uint64_t)(it)) << 47)
+#define setgcrefp(r, p) ((r).gcptr64 = (uint64_t)(p))
+#define setgcrefnull(r) ((r).gcptr64 = 0)
+#define setgcrefr(r, v) ((r).gcptr64 = (v).gcptr64)
+#else
+#define gcref(r) ((GCobj *)(uintptr_t)(r).gcptr32)
+#define gcrefp(r, t) ((t *)(void *)(uintptr_t)(r).gcptr32)
+#define gcrefu(r) ((r).gcptr32)
+#define gcrefeq(r1, r2) ((r1).gcptr32 == (r2).gcptr32)
+
+#define setgcref(r, gc) ((r).gcptr32 = (uint32_t)(uintptr_t) & (gc)->gch)
+#define setgcrefp(r, p) ((r).gcptr32 = (uint32_t)(uintptr_t)(p))
+#define setgcrefnull(r) ((r).gcptr32 = 0)
+#define setgcrefr(r, v) ((r).gcptr32 = (v).gcptr32)
+#endif
+
+#define tvref(r) (mref(r, TValue))
+
+/* -- String object ------------------------------------------------------- */
+
+typedef uint32_t StrHash; /* String hash value. */
+typedef uint32_t StrID; /* String ID. */
+
+/* String object header. String payload follows. */
+typedef struct GCstr
+{
+ GCHeader;
+ uint8_t reserved; /* Used by lexer for fast lookup of reserved words. */
+ uint8_t hashalg; /* Hash algorithm. */
+ StrID sid; /* Interned string ID. */
+ StrHash hash; /* Hash of string. */
+ MSize len; /* Size of string. */
+} GCstr;
+
+#define strref(r) (&gcref((r))->str)
+#define strdata(s) ((const char *)((s) + 1))
+#define strdatawr(s) ((char *)((s) + 1))
+/* -- Userdata object ----------------------------------------------------- */
+
+/* Userdata object. Payload follows. */
+typedef struct GCudata
+{
+ GCHeader;
+ uint8_t udtype; /* Userdata type. */
+ uint8_t unused2;
+ GCRef env; /* Should be at same offset in GCfunc. */
+ MSize len; /* Size of payload. */
+ GCRef metatable; /* Must be at same offset in GCtab. */
+ uint32_t align1; /* To force 8 byte alignment of the payload. */
+} GCudata;
+
+/* Userdata types. */
+enum
+{
+ UDTYPE_USERDATA, /* Regular userdata. */
+ UDTYPE_IO_FILE, /* I/O library FILE. */
+ UDTYPE_FFI_CLIB, /* FFI C library namespace. */
+ UDTYPE_BUFFER, /* String buffer. */
+ UDTYPE__MAX
+};
+
+#define uddata(u) ((void *)((u) + 1))
+#define sizeudata(u) (sizeof(struct GCudata) + (u)->len)
+
+/* -- C data object ------------------------------------------------------- */
+
+/* C data object. Payload follows. */
+typedef struct GCcdata
+{
+ GCHeader;
+ uint16_t ctypeid; /* C type ID. */
+} GCcdata;
+
+/* Prepended to variable-sized or realigned C data objects. */
+typedef struct GCcdataVar
+{
+ uint16_t offset; /* Offset to allocated memory (relative to GCcdata). */
+ uint16_t extra; /* Extra space allocated (incl. GCcdata + GCcdatav). */
+ MSize len; /* Size of payload. */
+} GCcdataVar;
+
+#define cdataptr(cd) ((void *)((cd) + 1))
+#define cdataisv(cd) ((cd)->marked & 0x80)
+#define cdatav(cd) ((GCcdataVar *)((char *)(cd) - sizeof(GCcdataVar)))
+#define cdatavlen(cd) check_exp(cdataisv(cd), cdatav(cd)->len)
+#define sizecdatav(cd) (cdatavlen(cd) + cdatav(cd)->extra)
+#define memcdatav(cd) ((void *)((char *)(cd)-cdatav(cd)->offset))
+
+/* -- Prototype object ---------------------------------------------------- */
+
+#define SCALE_NUM_GCO ((int32_t)sizeof(lua_Number) / sizeof(GCRef))
+#define round_nkgc(n) (((n) + SCALE_NUM_GCO - 1) & ~(SCALE_NUM_GCO - 1))
+
+typedef struct GCproto
+{
+ GCHeader;
+ uint8_t numparams; /* Number of parameters. */
+ uint8_t framesize; /* Fixed frame size. */
+ MSize sizebc; /* Number of bytecode instructions. */
+#if LJ_GC64
+ uint32_t unused_gc64;
+#endif
+ GCRef gclist;
+ MRef k; /* Split constant array (points to the middle). */
+ MRef uv; /* Upvalue list. local slot|0x8000 or parent uv idx. */
+ MSize sizekgc; /* Number of collectable constants. */
+ MSize sizekn; /* Number of lua_Number constants. */
+ MSize sizept; /* Total size including colocated arrays. */
+ uint8_t sizeuv; /* Number of upvalues. */
+ uint8_t flags; /* Miscellaneous flags (see below). */
+ uint16_t trace; /* Anchor for chain of root traces. */
+ /* ------ The following fields are for debugging/tracebacks only ------ */
+ GCRef chunkname; /* Name of the chunk this function was defined in. */
+ BCLine firstline; /* First line of the function definition. */
+ BCLine numline; /* Number of lines for the function definition. */
+ MRef lineinfo; /* Compressed map from bytecode ins. to source line. */
+ MRef uvinfo; /* Upvalue names. */
+ MRef varinfo; /* Names and compressed extents of local variables. */
+} GCproto;
+
+/* Flags for prototype. */
+#define PROTO_CHILD 0x01 /* Has child prototypes. */
+#define PROTO_VARARG 0x02 /* Vararg function. */
+#define PROTO_FFI 0x04 /* Uses BC_KCDATA for FFI datatypes. */
+#define PROTO_NOJIT 0x08 /* JIT disabled for this function. */
+#define PROTO_ILOOP 0x10 /* Patched bytecode with ILOOP etc. */
+/* Only used during parsing. */
+#define PROTO_HAS_RETURN 0x20 /* Already emitted a return. */
+#define PROTO_FIXUP_RETURN 0x40 /* Need to fixup emitted returns. */
+/* Top bits used for counting created closures. */
+#define PROTO_CLCOUNT 0x20 /* Base of saturating 3 bit counter. */
+#define PROTO_CLC_BITS 3
+#define PROTO_CLC_POLY (3 * PROTO_CLCOUNT) /* Polymorphic threshold. */
+
+#define PROTO_UV_LOCAL 0x8000 /* Upvalue for local slot. */
+#define PROTO_UV_IMMUTABLE 0x4000 /* Immutable upvalue. */
+
+#define proto_kgc(pt, idx) \
+ check_exp((uintptr_t)(intptr_t)(idx) >= (uintptr_t) - (intptr_t)(pt)->sizekgc, \
+ gcref(mref((pt)->k, GCRef)[(idx)]))
+#define proto_knumtv(pt, idx) \
+ check_exp((uintptr_t)(idx) < (pt)->sizekn, &mref((pt)->k, TValue)[(idx)])
+#define proto_bc(pt) ((BCIns *)((char *)(pt) + sizeof(GCproto)))
+#define proto_bcpos(pt, pc) ((BCPos)((pc)-proto_bc(pt)))
+#define proto_uv(pt) (mref((pt)->uv, uint16_t))
+
+#define proto_chunkname(pt) (strref(BPF_PROBE_READ_USER(pt, chunkname)))
+
+#define proto_chunknamestr(pt) (strdata(proto_chunkname((pt))))
+#define proto_lineinfo(pt) (mref((pt)->lineinfo, const void))
+#define proto_uvinfo(pt) (mref((pt)->uvinfo, const uint8_t))
+#define proto_varinfo(pt) (mref((pt)->varinfo, const uint8_t))
+
+/* -- Upvalue object ------------------------------------------------------ */
+
+typedef struct GCupval
+{
+ GCHeader;
+ uint8_t closed; /* Set if closed (i.e. uv->v == &uv->u.value). */
+ uint8_t immutable; /* Immutable value. */
+ union
+ {
+ TValue tv; /* If closed: the value itself. */
+ struct
+ { /* If open: double linked list, anchored at thread. */
+ GCRef prev;
+ GCRef next;
+ };
+ };
+ MRef v; /* Points to stack slot (open) or above (closed). */
+ uint32_t dhash; /* Disambiguation hash: dh1 != dh2 => cannot alias. */
+} GCupval;
+
+#define uvprev(uv_) (&gcref((uv_)->prev)->uv)
+#define uvnext(uv_) (&gcref((uv_)->next)->uv)
+#define uvval(uv_) (mref((uv_)->v, TValue))
+
+/* GC header for generic access to common fields of GC objects. */
+typedef struct GChead
+{
+ GCHeader;
+ uint8_t unused1;
+ uint8_t unused2;
+ GCRef env;
+ GCRef gclist;
+ GCRef metatable;
+} GChead;
+
+/* -- Function object (closures) ------------------------------------------ */
+
+/* Common header for functions. env should be at same offset in GCudata. */
+#define GCfuncHeader \
+ GCHeader; \
+ uint8_t ffid; \
+ uint8_t nupvalues; \
+ GCRef env; \
+ GCRef gclist; \
+ MRef pc
+
+typedef struct GCfuncC
+{
+ GCfuncHeader;
+ lua_CFunction f; /* C function to be called. */
+ TValue upvalue[1]; /* Array of upvalues (TValue). */
+} GCfuncC;
+
+typedef struct GCfuncL
+{
+ GCfuncHeader;
+ GCRef uvptr[1]; /* Array of _pointers_ to upvalue objects (GCupval). */
+} GCfuncL;
+
+typedef union GCfunc
+{
+ GCfuncC c;
+ GCfuncL l;
+} GCfunc;
+
+#define FF_LUA 0
+#define FF_C 1
+#define isluafunc(fn) (BPF_PROBE_READ_USER(fn, c.ffid) == FF_LUA)
+#define iscfunc(fn) (BPF_PROBE_READ_USER(fn, c.ffid) == FF_C)
+#define isffunc(fn) (BPF_PROBE_READ_USER(fn, c.ffid) > FF_C)
+#define funcproto(fn) \
+ check_exp(isluafunc(fn), (GCproto *)(mref(BPF_PROBE_READ_USER((fn), l.pc), char) - sizeof(GCproto)))
+#define sizeCfunc(n) (sizeof(GCfuncC) - sizeof(TValue) + sizeof(TValue) * (n))
+#define sizeLfunc(n) (sizeof(GCfuncL) - sizeof(GCRef) + sizeof(GCRef) * (n))
+
+typedef struct GCtab
+{
+ GCHeader;
+ uint8_t nomm; /* Negative cache for fast metamethods. */
+ char colo; /* Array colocation. */
+ MRef array; /* Array part. */
+ GCRef gclist;
+ GCRef metatable; /* Must be at same offset in GCudata. */
+ MRef node; /* Hash part. */
+ uint32_t asize; /* Size of array part (keys [0, asize-1]). */
+ uint32_t hmask; /* Hash part mask (size of hash part - 1). */
+#if LJ_GC64
+ MRef freetop; /* Top of free elements. */
+#endif
+} GCtab;
+
+#define sizetabcolo(n) ((n) * sizeof(TValue) + sizeof(GCtab))
+#define tabref(r) (&gcref((r))->tab)
+#define noderef(r) (mref((r), Node))
+#define nextnode(n) (mref((n)->next, Node))
+#if LJ_GC64
+#define getfreetop(t, n) (noderef((t)->freetop))
+#define setfreetop(t, n, v) (setmref((t)->freetop, (v)))
+#else
+#define getfreetop(t, n) (noderef((n)->freetop))
+#define setfreetop(t, n, v) (setmref((n)->freetop, (v)))
+#endif
+
+typedef union GCobj
+{
+ GChead gch;
+ GCstr str;
+ GCupval uv;
+ lua_State th;
+ GCproto pt;
+ GCfunc fn;
+ GCcdata cd;
+ GCtab tab;
+ GCudata ud;
+} GCobj;
+
+/* Macros to convert a GCobj pointer into a specific value. */
+#define gco2str(o) check_exp((o)->gch.gct == ~LJ_TSTR, &(o)->str)
+#define gco2uv(o) check_exp((o)->gch.gct == ~LJ_TUPVAL, &(o)->uv)
+#define gco2th(o) check_exp((o)->gch.gct == ~LJ_TTHREAD, &(o)->th)
+#define gco2pt(o) check_exp((o)->gch.gct == ~LJ_TPROTO, &(o)->pt)
+#define gco2func(o) check_exp((o)->gch.gct == ~LJ_TFUNC, &(o)->fn)
+#define gco2cd(o) check_exp((o)->gch.gct == ~LJ_TCDATA, &(o)->cd)
+#define gco2tab(o) check_exp((o)->gch.gct == ~LJ_TTAB, &(o)->tab)
+#define gco2ud(o) check_exp((o)->gch.gct == ~LJ_TUDATA, &(o)->ud)
+
+/* Macro to convert any collectable object into a GCobj pointer. */
+#define obj2gco(v) ((GCobj *)(v))
+
+#if LJ_GC64
+#define gcval(o) ((GCobj *)(gcrefu(BPF_PROBE_READ_USER(o, gcr)) & LJ_GCVMASK))
+
+#else
+#define gcval(o) (gcref((o)->gcr))
+#endif
+
+/* -- Lua stack frame ----------------------------------------------------- */
+
+/* Frame type markers in LSB of PC (4-byte aligned) or delta (8-byte aligned:
+**
+** PC 00 Lua frame
+** delta 001 C frame
+** delta 010 Continuation frame
+** delta 011 Lua vararg frame
+** delta 101 cpcall() frame
+** delta 110 ff pcall() frame
+** delta 111 ff pcall() frame with active hook
+*/
+enum
+{
+ FRAME_LUA,
+ FRAME_C,
+ FRAME_CONT,
+ FRAME_VARG,
+ FRAME_LUAP,
+ FRAME_CP,
+ FRAME_PCALL,
+ FRAME_PCALLH
+};
+#define FRAME_TYPE 3
+#define FRAME_P 4
+#define FRAME_TYPEP (FRAME_TYPE | FRAME_P)
+
+/* Macros to access and modify Lua frames. */
+#if LJ_FR2
+/* Two-slot frame info, required for 64 bit PC/GCRef:
+**
+** base-2 base-1 | base base+1 ...
+** [func PC/delta/ft] | [slots ...]
+** ^-- frame | ^-- base ^-- top
+**
+** Continuation frames:
+**
+** base-4 base-3 base-2 base-1 | base base+1 ...
+** [cont PC ] [func PC/delta/ft] | [slots ...]
+** ^-- frame | ^-- base ^-- top
+*/
+#define frame_gc(f) (gcval((f)-1))
+#define frame_ftsz(f) ((ptrdiff_t)BPF_PROBE_READ_USER(frame, ftsz))
+
+#define frame_pc(f) ((const BCIns *)frame_ftsz(f))
+#define setframe_ftsz(f, sz) ((f)->ftsz = (sz))
+#define setframe_pc(f, pc) ((f)->ftsz = (int64_t)(intptr_t)(pc))
+#else
+/* One-slot frame info, sufficient for 32 bit PC/GCRef:
+**
+** base-1 | base base+1 ...
+** lo hi |
+** [func | PC/delta/ft] | [slots ...]
+** ^-- frame | ^-- base ^-- top
+**
+** Continuation frames:
+**
+** base-2 base-1 | base base+1 ...
+** lo hi lo hi |
+** [cont | PC] [func | PC/delta/ft] | [slots ...]
+** ^-- frame | ^-- base ^-- top
+*/
+#define frame_gc(f) (gcref((f)->fr.func))
+#define frame_ftsz(f) ((ptrdiff_t)BPF_PROBE_READ_USER(f, fr.tp.ftsz))
+
+#define frame_pc(f) (mref((f)->fr.tp.pcr, const BCIns))
+#define setframe_gc(f, p, tp) (setgcref((f)->fr.func, (p)), UNUSED(tp))
+#define setframe_ftsz(f, sz) ((f)->fr.tp.ftsz = (int32_t)(sz))
+#define setframe_pc(f, pc) (setmref((f)->fr.tp.pcr, (pc)))
+#endif
+
+#define frame_type(f) (frame_ftsz(f) & FRAME_TYPE)
+#define frame_typep(f) (frame_ftsz(f) & FRAME_TYPEP)
+#define frame_islua(f) (frame_type(f) == FRAME_LUA)
+#define frame_isc(f) (frame_type(f) == FRAME_C)
+#define frame_iscont(f) (frame_typep(f) == FRAME_CONT)
+#define frame_isvarg(f) (frame_typep(f) == FRAME_VARG)
+#define frame_ispcall(f) ((frame_ftsz(f) & 6) == FRAME_PCALL)
+#define frame_func(f) (&frame_gc(f)->fn)
+
+#define frame_delta(f) (frame_ftsz(f) >> 3)
+#define frame_sized(f) (frame_ftsz(f) & ~FRAME_TYPEP)
+
+enum
+{
+ LJ_CONT_TAILCALL,
+ LJ_CONT_FFI_CALLBACK
+}; /* Special continuations. */
+
+#define frame_iscont_fficb(f) \
+ (LJ_HASFFI && frame_contv(f) == LJ_CONT_FFI_CALLBACK)
+
+static __always_inline BCIns frame_pc_prev(const BCIns *bcins)
+{
+ const BCIns bcins_prev;
+ bpf_probe_read_user((void *)&bcins_prev, sizeof(bcins_prev), bcins - 1);
+ return bcins_prev;
+}
+
+#define frame_prevl(f) ((f) - (1 + LJ_FR2 + bc_a(frame_pc_prev(frame_pc(f)))))
+#define frame_prevd(f) ((TValue *)((char *)(f)-frame_sized(f)))
+#define frame_prev(f) (frame_islua(f) ? frame_prevl(f) : frame_prevd(f))
+
+/* -- State objects ------------------------------------------------------- */
+
+/* VM states. */
+enum
+{
+ LJ_VMST_INTERP, /* Interpreter. */
+ LJ_VMST_C, /* C function. */
+ LJ_VMST_GC, /* Garbage collector. */
+ LJ_VMST_EXIT, /* Trace exit handler. */
+ LJ_VMST_RECORD, /* Trace recorder. */
+ LJ_VMST_OPT, /* Optimizer. */
+ LJ_VMST_ASM, /* Assembler. */
+ LJ_VMST__MAX
+};
+
+#define setvmstate(g, st) ((g)->vmstate = ~LJ_VMST_##st)
+
+/* Metamethods. ORDER MM */
+#ifdef LJ_HASFFI
+#define MMDEF_FFI(_) _(new)
+#else
+#define MMDEF_FFI(_)
+#endif
+
+#if LJ_52 || LJ_HASFFI
+#define MMDEF_PAIRS(_) _(pairs) _(ipairs)
+#else
+#define MMDEF_PAIRS(_)
+#define MM_pairs 255
+#define MM_ipairs 255
+#endif
+
+#define MMDEF(_) \
+ _(index) \
+ _(newindex) _(gc) _(mode) _(eq) _(len) /* Only the above (fast) metamethods are negative cached (max. 8). */ \
+ _(lt) _(le) _(concat) _(call) /* The following must be in ORDER ARITH. */ \
+ _(add) _(sub) _(mul) _(div) _(mod) _(pow) _(unm) /* The following are used in the standard libraries. */ \
+ _(metatable) _(tostring) MMDEF_FFI(_) MMDEF_PAIRS(_)
+
+typedef enum
+{
+#define MMENUM(name) MM_##name,
+ MMDEF(MMENUM)
+#undef MMENUM
+ MM__MAX,
+ MM____ = MM__MAX,
+ MM_FAST = MM_len
+} MMS;
+
+/* GC root IDs. */
+typedef enum
+{
+ GCROOT_MMNAME, /* Metamethod names. */
+ GCROOT_MMNAME_LAST = GCROOT_MMNAME + MM__MAX - 1,
+ GCROOT_BASEMT, /* Metatables for base types. */
+ GCROOT_BASEMT_NUM = GCROOT_BASEMT + ~LJ_TNUMX,
+ GCROOT_IO_INPUT, /* Userdata for default I/O input file. */
+ GCROOT_IO_OUTPUT, /* Userdata for default I/O output file. */
+ GCROOT_MAX
+} GCRootID;
+
+/* Garbage collector state. */
+typedef struct GCState
+{
+ GCSize total; /* Memory currently allocated. */
+ GCSize threshold; /* Memory threshold. */
+ uint8_t currentwhite; /* Current white color. */
+ uint8_t state; /* GC state. */
+ uint8_t nocdatafin; /* No cdata finalizer called. */
+#if LJ_64
+ uint8_t lightudnum; /* Number of lightuserdata segments - 1. */
+#else
+ uint8_t unused1;
+#endif
+ MSize sweepstr; /* Sweep position in string table. */
+ GCRef root; /* List of all collectable objects. */
+ MRef sweep; /* Sweep position in root list. */
+ GCRef gray; /* List of gray objects. */
+ GCRef grayagain; /* List of objects for atomic traversal. */
+ GCRef weak; /* List of weak tables (to be cleared). */
+ GCRef mmudata; /* List of userdata (to be finalized). */
+ GCSize debt; /* Debt (how much GC is behind schedule). */
+ GCSize estimate; /* Estimate of memory actually in use. */
+ MSize stepmul; /* Incremental GC step granularity. */
+ MSize pause; /* Pause between successive GC cycles. */
+#if LJ_64
+ MRef lightudseg; /* Upper bits of lightuserdata segments. */
+#endif
+} GCState;
+
+/* thread status */
+#define LUA_OK 0
+#define LUA_YIELD 1
+#define LUA_ERRRUN 2
+#define LUA_ERRSYNTAX 3
+#define LUA_ERRMEM 4
+#define LUA_ERRERR 5
+
+#endif
diff --git a/profiler/profile.bpf.c b/profiler/profile.bpf.c
new file mode 100644
index 0000000..af4f7fd
--- /dev/null
+++ b/profiler/profile.bpf.c
@@ -0,0 +1,264 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+/* Copyright (c) 2022 LG Electronics */
+#include "lua_state.h"
+#include "profile.h"
+#include "maps.bpf.h"
+
+const volatile bool kernel_stacks_only = false;
+const volatile bool user_stacks_only = false;
+const volatile bool disable_lua_user_trace = false;
+const volatile bool include_idle = false;
+const volatile pid_t targ_pid = -1;
+const volatile pid_t targ_tid = -1;
+const volatile int frame_depth = 15;
+
+struct
+{
+ __uint(type, BPF_MAP_TYPE_STACK_TRACE);
+ __type(key, u32);
+} stackmap SEC(".maps");
+
+struct
+{
+ __uint(type, BPF_MAP_TYPE_HASH);
+ __type(key, struct stack_key);
+ __type(value, sizeof(u64));
+ __uint(max_entries, MAX_ENTRIES);
+} counts SEC(".maps");
+
+#define MAX_ENTRIES 10240
+
+// for collecting lua stack trace function name
+// and pass the pointer of Lua_state to perf event
+struct
+{
+ __uint(type, BPF_MAP_TYPE_HASH);
+ __uint(max_entries, MAX_ENTRIES);
+ __type(key, __u32);
+ __type(value, struct lua_stack_event);
+} lua_events SEC(".maps");
+
+// output the lua stack to user space because we cannot keep all of them in
+// ebpf maps
+struct
+{
+ __uint(type, BPF_MAP_TYPE_PERF_EVENT_ARRAY);
+ __uint(key_size, sizeof(__u32));
+ __uint(value_size, sizeof(__u32));
+} lua_event_output SEC(".maps");
+
+/*
+ * If PAGE_OFFSET macro is not available in vmlinux.h, determine ip whose MSB
+ * (Most Significant Bit) is 1 as the kernel address.
+ * TODO: use end address of user space to determine the address space of ip
+ */
+#if defined(__TARGET_ARCH_arm64) || defined(__TARGET_ARCH_x86)
+#define BITS_PER_ADDR (64)
+#define MSB_SET_ULONG (1UL << (BITS_PER_ADDR - 1))
+static __always_inline bool is_kernel_addr(u64 addr)
+{
+ return !!(addr & MSB_SET_ULONG);
+}
+#else
+static __always_inline bool is_kernel_addr(u64 addr)
+{
+ return false;
+}
+#endif /* __TARGET_ARCH_arm64 || __TARGET_ARCH_x86 */
+
+static inline int lua_get_funcdata(struct bpf_perf_event_data *ctx, cTValue *frame, struct lua_stack_event *eventp, int level)
+{
+ if (!frame)
+ return -1;
+ GCfunc *fn = frame_func(frame);
+ if (!fn)
+ return -1;
+ if (isluafunc(fn))
+ {
+ eventp->type = FUNC_TYPE_LUA;
+ GCproto *pt = funcproto(fn);
+ if (!pt)
+ return -1;
+ eventp->ffid = BPF_PROBE_READ_USER(pt, firstline);
+ GCstr *name = proto_chunkname(pt); /* GCstr *name */
+ const char *src = strdata(name);
+ if (!src)
+ return -1;
+ bpf_probe_read_user_str(eventp->name, sizeof(eventp->name), src);
+ bpf_printk("level= %d, fn_name=%s\n", level, eventp->name);
+ }
+ else if (iscfunc(fn))
+ {
+ eventp->type = FUNC_TYPE_C;
+ eventp->funcp = BPF_PROBE_READ_USER(fn, c.f);
+ }
+ else if (isffunc(fn))
+ {
+ eventp->type = FUNC_TYPE_F;
+ eventp->ffid = BPF_PROBE_READ_USER(fn, c.ffid);
+ }
+ eventp->level = level;
+ bpf_perf_event_output(ctx, &lua_event_output, BPF_F_CURRENT_CPU, eventp, sizeof(*eventp));
+ return 0;
+}
+
+static int fix_lua_stack(struct bpf_perf_event_data *ctx, __u32 tid, int stack_id)
+{
+ if (stack_id == 0)
+ {
+ return 0;
+ }
+ struct lua_stack_event *eventp;
+
+ eventp = bpf_map_lookup_elem(&lua_events, &tid);
+ if (!eventp)
+ return 0;
+
+ eventp->user_stack_id = stack_id;
+ lua_State *L = eventp->L;
+ if (!L)
+ return 0;
+
+ // start from the top of the stack and trace back
+ // count the number of function calls founded
+ int level = 1, count = 0;
+
+ cTValue *frame, *nextframe, *bot = tvref(BPF_PROBE_READ_USER(L, stack)) + LJ_FR2;
+ int i = 0;
+ frame = nextframe = BPF_PROBE_READ_USER(L, base) - 1;
+ /* Traverse frames backwards. */
+ // for the ebpf verifier insns (limit 1000000), we need to limit the max loop times to 13
+ for (; i < frame_depth && frame > bot; i++)
+ {
+ if (frame_gc(frame) == obj2gco(L))
+ {
+ level++; /* Skip dummy frames. See lj_err_optype_call(). */
+ }
+ if (level-- == 0)
+ {
+ level++;
+ /* Level found. */
+ if (lua_get_funcdata(ctx, frame, eventp, count) != 0)
+ {
+ continue;
+ }
+ count++;
+ }
+ nextframe = frame;
+ if (frame_islua(frame))
+ {
+ frame = frame_prevl(frame);
+ }
+ else
+ {
+ if (frame_isvarg(frame))
+ level++; /* Skip vararg pseudo-frame. */
+ frame = frame_prevd(frame);
+ }
+ }
+ return 0;
+}
+
+SEC("perf_event")
+int do_perf_event(struct bpf_perf_event_data *ctx)
+{
+ __u64 id = bpf_get_current_pid_tgid();
+ __u32 pid = id >> 32;
+ __u32 tid = id;
+ __u64 *valp;
+ static const __u64 zero;
+ struct stack_key key = {};
+
+ if (!include_idle && tid == 0)
+ return 0;
+
+ if (targ_pid != -1 && targ_pid != pid)
+ return 0;
+ if (targ_tid != -1 && targ_tid != tid)
+ return 0;
+
+ key.pid = pid;
+ bpf_get_current_comm(&key.name, sizeof(key.name));
+
+ if (user_stacks_only)
+ key.kern_stack_id = -1;
+ else
+ key.kern_stack_id = bpf_get_stackid(&ctx->regs, &stackmap, 0);
+
+ if (kernel_stacks_only)
+ key.user_stack_id = -1;
+ else
+ key.user_stack_id = bpf_get_stackid(&ctx->regs, &stackmap, BPF_F_USER_STACK);
+
+ if (key.kern_stack_id >= 0)
+ {
+ // populate extras to fix the kernel stack
+ __u64 ip = PT_REGS_IP(&ctx->regs);
+
+ if (is_kernel_addr(ip))
+ {
+ key.kernel_ip = ip;
+ }
+ }
+
+ valp = bpf_map_lookup_or_try_init(&counts, &key, &zero);
+ if (valp)
+ __sync_fetch_and_add(valp, 1);
+
+ if (!disable_lua_user_trace && (!valp || *valp <= 1))
+ {
+ // only get lua stack the first time we found a new stack id
+ fix_lua_stack(ctx, tid, key.user_stack_id);
+ }
+ return 0;
+}
+
+static int probe_entry_lua_cancel(struct pt_regs *ctx)
+{
+ if (!PT_REGS_PARM2(ctx))
+ return 0;
+ if (!PT_REGS_PARM4(ctx))
+ return 0;
+
+ __u64 pid_tgid = bpf_get_current_pid_tgid();
+ __u32 pid = pid_tgid >> 32;
+ __u32 tid = (__u32)pid_tgid;
+
+ if (targ_pid != -1 && targ_pid != pid)
+ return 0;
+ bpf_map_delete_elem(&lua_events, &tid);
+ return 0;
+}
+
+SEC("uprobe/handle_entry_lua_cancel")
+int handle_entry_lua_cancel(struct pt_regs *ctx)
+{
+ return probe_entry_lua_cancel(ctx);
+}
+
+static int probe_entry_lua(struct pt_regs *ctx)
+{
+ if (!PT_REGS_PARM1(ctx))
+ return 0;
+
+ __u64 pid_tgid = bpf_get_current_pid_tgid();
+ __u32 pid = pid_tgid >> 32;
+ __u32 tid = (__u32)pid_tgid;
+ struct lua_stack_event event = {};
+
+ if (targ_pid != -1 && targ_pid != pid)
+ return 0;
+
+ event.pid = pid;
+ event.L = (void *)PT_REGS_PARM1(ctx);
+ bpf_map_update_elem(&lua_events, &tid, &event, BPF_ANY);
+ return 0;
+}
+
+SEC("uprobe/handle_entry_lua")
+int handle_entry_lua(struct pt_regs *ctx)
+{
+ return probe_entry_lua(ctx);
+}
+
+char LICENSE[] SEC("license") = "GPL";
diff --git a/profiler/profile.cpp b/profiler/profile.cpp
new file mode 100644
index 0000000..0365b85
--- /dev/null
+++ b/profiler/profile.cpp
@@ -0,0 +1,502 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/*
+ * Copyright (c) 2022 LG Electronics
+ *
+ * Based on profile(8) from BCC by Brendan Gregg.
+ * 28-Dec-2021 Eunseon Lee Created this,
+ * 17-Jul-2022 Yusheng Zheng modified this.
+ */
+#include <argp.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <unistd.h>
+#include <time.h>
+#include <linux/perf_event.h>
+#include <asm/unistd.h>
+#include <bpf/libbpf.h>
+#include <bpf/bpf.h>
+#include "profile.h"
+#include "lua_stacks_map.h"
+#include "profile.skel.h"
+#include "stack_printer.h"
+
+extern "C"
+{
+#include "trace_helpers.h"
+#include "uprobe_helpers.h"
+}
+
+bool exiting = false;
+class lua_stack_map lua_bt_map;
+
+#define warn(...) fprintf(stderr, __VA_ARGS__)
+
+struct profile_env env = {
+ .pid = -1,
+ .tid = -1,
+ .stack_storage_size = 8192,
+ .perf_max_stack_depth = 127,
+ .duration = 3,
+ .freq = 1,
+ .sample_freq = 49,
+ .cpu = -1,
+ .frame_depth = 15
+};
+
+#define UPROBE_SIZE 3
+
+const char *argp_program_version = "profile 0.1";
+const char *argp_program_bug_address =
+ "https://github.com/iovisor/bcc/tree/master/libbpf-tools";
+const char argp_program_doc[] =
+ "Profile CPU usage by sampling stack traces at a timed interval.\n"
+ "\n"
+ "USAGE: profile [OPTIONS...] [duration]\n"
+ "EXAMPLES:\n"
+ " profile # profile stack traces at 49 Hertz until Ctrl-C\n"
+ " profile -F 99 # profile stack traces at 99 Hertz\n"
+ " profile -c 1000000 # profile stack traces every 1 in a million events\n"
+ " profile 5 # profile at 49 Hertz for 5 seconds only\n"
+ " profile -f # output in folded format for flame graphs\n"
+ " profile -p 185 # only profile process with PID 185\n"
+ " profile -U # only show user space stacks (no kernel)\n"
+ " profile -K # only show kernel space stacks (no user)\n";
+
+#define OPT_PERF_MAX_STACK_DEPTH 1 /* --perf-max-stack-depth */
+#define OPT_STACK_STORAGE_SIZE 2 /* --stack-storage-size */
+#define OPT_LUA_USER_STACK_ONLY 3 /* --lua-user-stacks-only */
+#define OPT_DISABLE_LUA_USER_TRACE 4 /* --disable-lua-user-trace */
+#define PERF_BUFFER_PAGES 16
+#define PERF_POLL_TIMEOUT_MS 100
+
+static const struct argp_option opts[] = {
+ {"pid", 'p', "PID", 0, "profile process with this PID only"},
+ {"tid", 'L', "TID", 0, "profile thread with this TID only"},
+ {"user-stacks-only", 'U', NULL, 0,
+ "show stacks from user space only (no kernel space stacks)"},
+ {"kernel-stacks-only", 'K', NULL, 0,
+ "show stacks from kernel space only (no user space stacks)"},
+ {"lua-user-stacks-only", OPT_LUA_USER_STACK_ONLY, NULL, 0,
+ "replace user stacks with lua stack traces (no other user space stacks)"},
+ {"disable-lua-user-trace", OPT_DISABLE_LUA_USER_TRACE, NULL, 0,
+ "disable lua user space stack trace"},
+ {"frequency", 'F', "FREQUENCY", 0, "sample frequency, Hertz"},
+ {"delimited", 'd', NULL, 0, "insert delimiter between kernel/user stacks"},
+ {"include-idle ", 'I', NULL, 0, "include CPU idle stacks"},
+ {"folded", 'f', NULL, 0, "output folded format, one line per stack (for flame graphs)"},
+ {"stack-storage-size", OPT_STACK_STORAGE_SIZE, "STACK-STORAGE-SIZE", 0,
+ "the number of unique stack traces that can be stored and displayed (default 1024)"},
+ {"cpu", 'C', "CPU", 0, "cpu number to run profile on"},
+ {"perf-max-stack-depth", OPT_PERF_MAX_STACK_DEPTH,
+ "PERF-MAX-STACK-DEPTH", 0, "the limit for both kernel and user stack traces (default 127)"},
+ {"max-frame-depth", 'D', "DEPTH", 0, "max frame depth for eBPF to travel in the stack (default 15)"},
+ {"verbose", 'v', NULL, 0, "Verbose debug output"},
+ {NULL, 'h', NULL, OPTION_HIDDEN, "Show the full help"},
+ {},
+};
+
+static error_t parse_arg(int key, char *arg, struct argp_state *state)
+{
+ static int pos_args;
+
+ switch (key)
+ {
+ case 'h':
+ argp_state_help(state, stderr, ARGP_HELP_STD_HELP);
+ break;
+ 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 'L':
+ errno = 0;
+ env.tid = strtol(arg, NULL, 10);
+ if (errno || env.tid <= 0)
+ {
+ fprintf(stderr, "Invalid TID: %s\n", arg);
+ argp_usage(state);
+ }
+ break;
+ case 'U':
+ env.user_stacks_only = true;
+ break;
+ case 'K':
+ env.kernel_stacks_only = true;
+ break;
+ case 'F':
+ errno = 0;
+ env.sample_freq = strtol(arg, NULL, 10);
+ if (errno || env.sample_freq <= 0)
+ {
+ fprintf(stderr, "invalid FREQUENCY: %s\n", arg);
+ argp_usage(state);
+ }
+ break;
+ case 'D':
+ errno = 0;
+ env.frame_depth = strtol(arg, NULL, 10);
+ if (errno || env.frame_depth <= 0)
+ {
+ fprintf(stderr, "invalid FREQUENCY: %s\n", arg);
+ argp_usage(state);
+ }
+ break;
+ case 'd':
+ env.delimiter = true;
+ break;
+ case 'I':
+ env.include_idle = true;
+ break;
+ case 'f':
+ env.folded = true;
+ break;
+ case 'C':
+ errno = 0;
+ env.cpu = strtol(arg, NULL, 10);
+ if (errno)
+ {
+ fprintf(stderr, "invalid CPU: %s\n", arg);
+ argp_usage(state);
+ }
+ break;
+ case OPT_PERF_MAX_STACK_DEPTH:
+ errno = 0;
+ env.perf_max_stack_depth = strtol(arg, NULL, 10);
+ if (errno)
+ {
+ fprintf(stderr, "invalid perf max stack depth: %s\n", arg);
+ argp_usage(state);
+ }
+ break;
+ case OPT_STACK_STORAGE_SIZE:
+ errno = 0;
+ env.stack_storage_size = strtol(arg, NULL, 10);
+ if (errno)
+ {
+ fprintf(stderr, "invalid stack storage size: %s\n", arg);
+ argp_usage(state);
+ }
+ break;
+ case OPT_LUA_USER_STACK_ONLY:
+ env.lua_user_stacks_only = true;
+ break;
+ case OPT_DISABLE_LUA_USER_TRACE:
+ env.disable_lua_user_trace = true;
+ 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 || env.duration <= 0)
+ {
+ fprintf(stderr, "Invalid duration (in s): %s\n", arg);
+ argp_usage(state);
+ }
+ 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,
+ .config = PERF_COUNT_SW_CPU_CLOCK,
+ .sample_freq = env.sample_freq,
+ .freq = env.freq,
+ };
+ int i, fd;
+
+ for (i = 0; i < nr_cpus; i++)
+ {
+ if (env.cpu != -1 && env.cpu != i)
+ continue;
+
+ fd = syscall(__NR_perf_event_open, &attr, -1, i, -1, 0);
+ if (fd < 0)
+ {
+ /* Ignore CPU that is offline */
+ if (errno == ENODEV)
+ continue;
+ fprintf(stderr, "failed to init perf sampling: %s\n",
+ strerror(errno));
+ return -1;
+ }
+ links[i] = bpf_program__attach_perf_event(prog, fd);
+ if (!links[i])
+ {
+ fprintf(stderr, "failed to attach perf event on cpu: "
+ "%d\n",
+ i);
+ links[i] = NULL;
+ close(fd);
+ return -1;
+ }
+ }
+
+ 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 void sig_handler(int sig)
+{
+ exiting = true;
+}
+
+static void handle_lua_stack_event(void *ctx, int cpu, void *data, __u32 data_sz)
+{
+ const struct lua_stack_event *e = static_cast<const struct lua_stack_event *>(data);
+ lua_bt_map.insert_lua_stack_map(e);
+}
+
+static void handle_lua_stack_lost_events(void *ctx, int cpu, __u64 lost_cnt)
+{
+ warn("lost %llu events on CPU #%d\n", lost_cnt, cpu);
+}
+
+static struct bpf_link *
+attach_lua_func(const char *lua_path, const char *func_name, const bpf_program *prog)
+{
+ off_t func_off = get_elf_func_offset(lua_path, func_name);
+ if (func_off < 0)
+ {
+ warn("could not find %s in %s\n", func_name, lua_path);
+ return NULL;
+ }
+ struct bpf_link *link = bpf_program__attach_uprobe(prog, false,
+ -1, lua_path, func_off);
+ if (!link)
+ {
+ warn("failed to attach %s: %d\n", func_name, -errno);
+ return NULL;
+ }
+ return link;
+}
+
+static int attach_lua_uprobes(struct profile_bpf *obj, struct bpf_link *links[])
+{
+ char lua_path[128];
+ if (env.pid)
+ {
+ int res = 0;
+
+ res = get_pid_lib_path(env.pid, "luajit-5.1.so", lua_path, sizeof(lua_path));
+ if (res < 0)
+ {
+ fprintf(stderr, "warning: failed to get lib path for pid %d\n", env.pid);
+ return -1;
+ }
+ }
+
+ links[0] = attach_lua_func(lua_path, "lua_resume", obj->progs.handle_entry_lua);
+ if (!links[0])
+ {
+ return -1;
+ }
+
+ links[1] = attach_lua_func(lua_path, "lua_pcall", obj->progs.handle_entry_lua);
+ if (!links[1])
+ {
+ return -1;
+ }
+
+ links[2] = attach_lua_func(lua_path, "lua_yield", obj->progs.handle_entry_lua_cancel);
+ if (!links[2])
+ {
+ return -1;
+ }
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ static const struct argp argp = {
+ .options = opts,
+ .parser = parse_arg,
+ .doc = argp_program_doc,
+ };
+ struct syms_cache *syms_cache = NULL;
+ struct ksyms *ksyms = NULL;
+ struct bpf_link *cpu_links[MAX_CPU_NR] = {};
+ struct bpf_link *uprobe_links[UPROBE_SIZE] = {};
+ struct profile_bpf *obj = nullptr;
+ struct perf_buffer *pb = nullptr;
+ int err, i;
+ const char *stack_context = "user + kernel";
+ char thread_context[64];
+ char sample_context[64];
+
+ err = argp_parse(&argp, argc, argv, 0, NULL, NULL);
+ if (err)
+ return err;
+ if (env.user_stacks_only && env.kernel_stacks_only)
+ {
+ fprintf(stderr, "user_stacks_only and kernel_stacks_only cannot be used together.\n");
+ return 1;
+ }
+
+ libbpf_set_print(libbpf_print_fn);
+ libbpf_set_strict_mode(LIBBPF_STRICT_ALL);
+
+ nr_cpus = libbpf_num_possible_cpus();
+ if (nr_cpus < 0)
+ {
+ printf("failed to get # of possible cpus: '%s'!\n",
+ strerror(-nr_cpus));
+ return 1;
+ }
+ if (nr_cpus > MAX_CPU_NR)
+ {
+ fprintf(stderr, "the number of cpu cores is too big, please "
+ "increase MAX_CPU_NR's value and recompile");
+ return 1;
+ }
+
+ obj = profile_bpf__open();
+ if (!obj)
+ {
+ fprintf(stderr, "failed to open BPF object\n");
+ return 1;
+ }
+
+ /* initialize global data (filtering options) */
+ obj->rodata->targ_pid = env.pid;
+ obj->rodata->targ_tid = env.tid;
+ obj->rodata->user_stacks_only = env.user_stacks_only;
+ obj->rodata->kernel_stacks_only = env.kernel_stacks_only;
+ obj->rodata->include_idle = env.include_idle;
+ obj->rodata->frame_depth = env.frame_depth;
+
+ bpf_map__set_value_size(obj->maps.stackmap,
+ env.perf_max_stack_depth * sizeof(unsigned long));
+ bpf_map__set_max_entries(obj->maps.stackmap, env.stack_storage_size);
+
+ err = profile_bpf__load(obj);
+ if (err)
+ {
+ fprintf(stderr, "failed to load BPF programs\n");
+ fprintf(stderr, "try decrease the max frame depth with -D and rerun with sudo?\n");
+ goto cleanup;
+ }
+ ksyms = ksyms__load();
+ if (!ksyms)
+ {
+ fprintf(stderr, "failed to load kallsyms\n");
+ goto cleanup;
+ }
+ syms_cache = syms_cache__new(0);
+ if (!syms_cache)
+ {
+ fprintf(stderr, "failed to create syms_cache\n");
+ goto cleanup;
+ }
+
+ err = attach_lua_uprobes(obj, uprobe_links);
+ if (err < 0)
+ {
+ // cannot found lua lib, so skip lua uprobe
+ env.disable_lua_user_trace = true;
+ }
+
+ pb = perf_buffer__new(bpf_map__fd(obj->maps.lua_event_output), PERF_BUFFER_PAGES,
+ handle_lua_stack_event, handle_lua_stack_lost_events, NULL, NULL);
+ if (!pb)
+ {
+ err = -errno;
+ warn("failed to open perf buffer: %d\n", err);
+ goto cleanup;
+ }
+
+ err = open_and_attach_perf_event(env.freq, obj->progs.do_perf_event, cpu_links);
+ if (err)
+ goto cleanup;
+
+ signal(SIGINT, sig_handler);
+
+ if (env.pid != -1)
+ snprintf(thread_context, sizeof(thread_context), "PID %d", env.pid);
+ else if (env.tid != -1)
+ snprintf(thread_context, sizeof(thread_context), "TID %d", env.tid);
+ else
+ snprintf(thread_context, sizeof(thread_context), "all threads");
+
+ snprintf(sample_context, sizeof(sample_context), "%d Hertz", env.sample_freq);
+
+ if (env.user_stacks_only)
+ stack_context = "user";
+ else if (env.kernel_stacks_only)
+ stack_context = "kernel";
+
+ if (!env.folded)
+ {
+ printf("Sampling at %s of %s by %s stack", sample_context, thread_context, stack_context);
+ if (env.cpu != -1)
+ printf(" on CPU#%d", env.cpu);
+ if (env.duration < 99999999)
+ printf(" for %d secs.\n", env.duration);
+ else
+ printf("... Hit Ctrl-C to end.\n");
+ }
+
+ /*
+ * We'll get sleep interrupted when someone presses Ctrl-C (which will
+ * be "handled" with noop by sig_handler).
+ */
+ while (!exiting)
+ {
+ // print perf event to get stack trace
+ err = perf_buffer__poll(pb, PERF_POLL_TIMEOUT_MS);
+ if (err < 0 && err != -EINTR)
+ {
+ warn("error polling perf buffer: %s\n", strerror(-err));
+ goto cleanup;
+ }
+ /* reset err to return 0 if exiting */
+ err = 0;
+ }
+
+ print_stack_trace(ksyms, syms_cache, obj);
+
+cleanup:
+ if (env.cpu != -1)
+ bpf_link__destroy(cpu_links[env.cpu]);
+ else
+ {
+ for (i = 0; i < nr_cpus; i++)
+ bpf_link__destroy(cpu_links[i]);
+ }
+ for (i = 0; i < UPROBE_SIZE; i++)
+ bpf_link__destroy(uprobe_links[i]);
+ profile_bpf__destroy(obj);
+ perf_buffer__free(pb);
+ syms_cache__free(syms_cache);
+ ksyms__free(ksyms);
+ return err != 0;
+}
diff --git a/profiler/profile.h b/profiler/profile.h
new file mode 100644
index 0000000..fcc2da7
--- /dev/null
+++ b/profiler/profile.h
@@ -0,0 +1,66 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+#ifndef __PROFILE_H
+#define __PROFILE_H
+
+#define TASK_COMM_LEN 16
+#define MAX_CPU_NR 128
+#define MAX_ENTRIES 10240
+#define HOST_LEN 80
+
+struct stack_key
+{
+ unsigned int pid;
+ unsigned long long kernel_ip;
+ int user_stack_id;
+ int kern_stack_id;
+ char name[TASK_COMM_LEN];
+};
+
+enum func_type {
+ FUNC_TYPE_LUA,
+ FUNC_TYPE_C,
+ FUNC_TYPE_F,
+ FUNC_TYPE_UNKNOWN,
+};
+
+struct lua_stack_event
+{
+ unsigned int pid;
+ // key for user_stack_id
+ int user_stack_id;
+ // stack level
+ int level;
+ // function type
+ int type;
+ // function name
+ char name[HOST_LEN];
+ void *funcp;
+ // line number(lua func) or ffid(ffunc)
+ int ffid;
+ // lua state
+ void *L;
+};
+
+struct profile_env
+{
+ int pid;
+ int tid;
+ bool user_stacks_only;
+ bool kernel_stacks_only;
+ // control lua user space stack trace
+ bool disable_lua_user_trace;
+ bool lua_user_stacks_only;
+ int stack_storage_size;
+ unsigned int perf_max_stack_depth;
+ int duration;
+ bool verbose;
+ bool freq;
+ unsigned int sample_freq;
+ bool delimiter;
+ bool include_idle;
+ bool folded;
+ int cpu;
+ int frame_depth;
+};
+
+#endif /* __PROFILE_H */
diff --git a/profiler/stack_printer.cpp b/profiler/stack_printer.cpp
new file mode 100644
index 0000000..403320e
--- /dev/null
+++ b/profiler/stack_printer.cpp
@@ -0,0 +1,397 @@
+#include <argp.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <unistd.h>
+#include <time.h>
+#include <linux/perf_event.h>
+#include <asm/unistd.h>
+#include <bpf/libbpf.h>
+#include <bpf/bpf.h>
+#include "profile.h"
+#include "lua_stacks_map.h"
+#include "profile.skel.h"
+extern "C"
+{
+#include "trace_helpers.h"
+#include "uprobe_helpers.h"
+}
+
+#define warn(...) fprintf(stderr, __VA_ARGS__)
+
+extern struct profile_env env;
+extern class lua_stack_map lua_bt_map;
+
+/* This structure combines key_t and count which should be sorted together */
+struct key_ext_t
+{
+ struct stack_key k;
+ __u64 v;
+};
+
+static int stack_id_err(int stack_id)
+{
+ return (stack_id < 0) && (stack_id != -EFAULT);
+}
+
+static int cmp_counts(const void *dx, const void *dy)
+{
+ __u64 x = ((struct key_ext_t *)dx)->v;
+ __u64 y = ((struct key_ext_t *)dy)->v;
+ return x > y ? -1 : !(x == y);
+}
+
+static bool batch_map_ops = true; /* hope for the best */
+
+static bool read_batch_counts_map(int fd, struct key_ext_t *items, __u32 *count)
+{
+ void *in = NULL, *out;
+ __u32 i, n, n_read = 0;
+ int err = 0;
+ __u32 vals[*count];
+ struct stack_key keys[*count];
+
+ while (n_read < *count && !err)
+ {
+ n = *count - n_read;
+ err = bpf_map_lookup_batch(fd, &in, &out, keys + n_read,
+ 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_batch: %s\n",
+ strerror(-err));
+ return false;
+ }
+ n_read += n;
+ in = out;
+ }
+
+ for (i = 0; i < n_read; i++)
+ {
+ items[i].k.pid = keys[i].pid;
+ items[i].k.kernel_ip = keys[i].kernel_ip;
+ items[i].k.user_stack_id = keys[i].user_stack_id;
+ items[i].k.kern_stack_id = keys[i].kern_stack_id;
+ strncpy(items[i].k.name, keys[i].name, TASK_COMM_LEN);
+ items[i].v = vals[i];
+ }
+
+ *count = n_read;
+ return true;
+}
+
+static bool read_counts_map(int fd, struct key_ext_t *items, __u32 *count)
+{
+ struct stack_key empty = {};
+ struct stack_key *lookup_key = ∅
+ int i = 0;
+ int err;
+
+ if (batch_map_ops)
+ {
+ bool ok = read_batch_counts_map(fd, items, count);
+ if (!ok && errno == EINVAL)
+ {
+ /* fall back to a racy variant */
+ batch_map_ops = false;
+ }
+ else
+ {
+ return ok;
+ }
+ }
+
+ if (!items || !count || !*count)
+ return true;
+
+ while (!bpf_map_get_next_key(fd, lookup_key, &items[i].k))
+ {
+
+ err = bpf_map_lookup_elem(fd, &items[i].k, &items[i].v);
+ if (err < 0)
+ {
+ fprintf(stderr, "failed to lookup counts: %d\n", err);
+ return false;
+ }
+ if (items[i].v == 0)
+ continue;
+
+ lookup_key = &items[i].k;
+ i++;
+ }
+
+ *count = i;
+ return true;
+}
+
+static void print_fold_lua_func(const struct syms *syms, const struct lua_stack_event *eventp)
+{
+ if (!eventp)
+ {
+ return;
+ }
+ if (eventp->type == FUNC_TYPE_LUA)
+ {
+ if (eventp->ffid)
+ {
+ printf(";L:%s:%d", eventp->name, eventp->ffid);
+ }
+ else
+ {
+ printf(";L:%s", eventp->name);
+ }
+ }
+ else if (eventp->type == FUNC_TYPE_C)
+ {
+ const struct sym *sym = syms__map_addr(syms, (unsigned long)eventp->funcp);
+ if (sym)
+ {
+ printf(";C:%s", sym ? sym->name : "[unknown]");
+ }
+ }
+ else if (eventp->type == FUNC_TYPE_F)
+ {
+ printf(";builtin#%d", eventp->ffid);
+ }
+ else
+ {
+ printf(";[unknown]");
+ }
+}
+
+static void print_fold_user_stack_with_lua(const lua_stack_backtrace *lua_bt, const struct syms *syms, unsigned long *uip, unsigned int nr_uip)
+{
+ const struct sym *sym = NULL;
+ int lua_bt_count = lua_bt->size() - 1;
+ for (int j = nr_uip - 1; j >= 0; j--)
+ {
+ sym = syms__map_addr(syms, uip[j]);
+ if (sym)
+ {
+ if (!env.lua_user_stacks_only)
+ {
+ printf(";%s", sym->name);
+ }
+ }
+ else
+ {
+ if (lua_bt_count >= 0)
+ {
+ print_fold_lua_func(syms, &((*lua_bt)[lua_bt_count]));
+ lua_bt_count--;
+ }
+ }
+ }
+ while (lua_bt_count >= 0)
+ {
+ print_fold_lua_func(syms, &((*lua_bt)[lua_bt_count]));
+ lua_bt_count--;
+ }
+}
+
+void print_stack_trace(struct ksyms *ksyms, struct syms_cache *syms_cache,
+ struct profile_bpf *obj)
+{
+ const struct ksym *ksym;
+ const struct syms *syms = NULL;
+ const struct sym *sym;
+ int cfd, sfd;
+ lua_stack_backtrace lua_bt = {};
+ __u32 nr_count;
+ struct stack_key *k;
+ __u64 v;
+ unsigned long *kip;
+ unsigned long *uip;
+ bool has_collision = false;
+ unsigned int missing_stacks = 0;
+ struct key_ext_t counts[MAX_ENTRIES];
+ unsigned int nr_kip;
+ unsigned int nr_uip;
+ int idx = 0;
+
+ /* add 1 for kernel_ip */
+ kip = (unsigned long *)calloc(env.perf_max_stack_depth + 1, sizeof(*kip));
+ if (!kip)
+ {
+ fprintf(stderr, "failed to alloc kernel ip\n");
+ return;
+ }
+
+ uip = (unsigned long *)calloc(env.perf_max_stack_depth, sizeof(*uip));
+ if (!uip)
+ {
+ fprintf(stderr, "failed to alloc user ip\n");
+ return;
+ }
+
+ cfd = bpf_map__fd(obj->maps.counts);
+ sfd = bpf_map__fd(obj->maps.stackmap);
+
+ nr_count = MAX_ENTRIES;
+ if (!read_counts_map(cfd, counts, &nr_count))
+ {
+ goto cleanup;
+ }
+
+ qsort(counts, nr_count, sizeof(counts[0]), cmp_counts);
+
+ for (std::size_t i = 0; i < nr_count; i++)
+ {
+ k = &counts[i].k;
+ v = counts[i].v;
+ nr_uip = 0;
+ nr_kip = 0;
+ idx = 0;
+
+ if (!env.user_stacks_only && stack_id_err(k->kern_stack_id))
+ {
+ missing_stacks += 1;
+ has_collision |= (k->kern_stack_id == -EEXIST);
+ }
+ if (!env.kernel_stacks_only && stack_id_err(k->user_stack_id))
+ {
+ missing_stacks += 1;
+ has_collision |= (k->user_stack_id == -EEXIST);
+ }
+
+ if (!env.kernel_stacks_only && k->user_stack_id >= 0)
+ {
+ if (bpf_map_lookup_elem(sfd, &k->user_stack_id, uip) == 0)
+ {
+ /* count the number of ips */
+ while (nr_uip < env.perf_max_stack_depth && uip[nr_uip])
+ nr_uip++;
+ syms = syms_cache__get_syms(syms_cache, k->pid);
+ }
+ int stack_level = lua_bt_map.get_lua_stack_backtrace(k->user_stack_id, &lua_bt);
+ if (env.lua_user_stacks_only && env.folded)
+ {
+ if (stack_level <= 0)
+ {
+ // if show lua user stack only, then we do not count the stack if it is not lua stack
+ continue;
+ }
+ }
+ }
+
+ if (!env.user_stacks_only && k->kern_stack_id >= 0)
+ {
+ if (k->kernel_ip)
+ kip[nr_kip++] = k->kernel_ip;
+ if (bpf_map_lookup_elem(sfd, &k->kern_stack_id, kip + nr_kip) == 0)
+ {
+ /* count the number of ips */
+ while (nr_kip < env.perf_max_stack_depth && kip[nr_kip])
+ nr_kip++;
+ }
+ }
+
+ if (env.folded)
+ {
+ // print folded stack output
+ printf("%s", k->name);
+
+ if (!env.kernel_stacks_only)
+ {
+ if (stack_id_err(k->user_stack_id))
+ printf(";[Missed User Stack]");
+ if (syms)
+ {
+ if (!env.disable_lua_user_trace)
+ {
+ print_fold_user_stack_with_lua(&lua_bt, syms, uip, nr_uip);
+ }
+ else
+ {
+ const struct sym *sym = NULL;
+ for (int j = nr_uip - 1; j >= 0; j--)
+ {
+ sym = syms__map_addr(syms, uip[j]);
+ printf(";%s", sym ? sym->name : "[unknown]");
+ }
+ }
+ }
+ }
+ if (!env.user_stacks_only)
+ {
+ if (env.delimiter && k->user_stack_id >= 0 &&
+ k->kern_stack_id >= 0)
+ printf(";-");
+
+ if (stack_id_err(k->kern_stack_id))
+ printf(";[Missed Kernel Stack]");
+ for (std::size_t j = nr_kip - 1; j >= 0; j--)
+ {
+ ksym = ksyms__map_addr(ksyms, kip[j]);
+ printf(";%s", ksym ? ksym->name : "[unknown]");
+ }
+ }
+ printf(" %lld\n", v);
+ }
+ else
+ {
+ // print default multi-line stack output
+ if (!env.user_stacks_only)
+ {
+ if (stack_id_err(k->kern_stack_id))
+ printf(" [Missed Kernel Stack]\n");
+ for (std::size_t j = 0; j < nr_kip; j++)
+ {
+ ksym = ksyms__map_addr(ksyms, kip[j]);
+ if (ksym)
+ printf(" #%-2d 0x%lx %s+0x%lx\n", idx++, kip[j], ksym->name, kip[j] - ksym->addr);
+ else
+ printf(" #%-2d 0x%lx [unknown]\n", idx++, kip[j]);
+ }
+ }
+
+ if (!env.kernel_stacks_only)
+ {
+ if (env.delimiter && k->kern_stack_id >= 0 &&
+ k->user_stack_id >= 0)
+ printf(" --\n");
+
+ if (stack_id_err(k->user_stack_id))
+ printf(" [Missed User Stack]\n");
+ if (!syms)
+ {
+ for (std::size_t j = 0; j < nr_uip; j++)
+ printf(" #%-2d 0x%016lx [unknown]\n", idx++, uip[j]);
+ }
+ else
+ {
+ for (std::size_t j = 0; j < nr_uip; j++)
+ {
+ char *dso_name;
+ uint64_t dso_offset;
+ sym = syms__map_addr_dso(syms, uip[j], &dso_name, &dso_offset);
+
+ printf(" #%-2d 0x%016lx", idx++, uip[j]);
+ if (sym)
+ printf(" %s+0x%lx", sym->name, sym->offset);
+ if (dso_name)
+ printf(" (%s+0x%lx)", dso_name, dso_offset);
+ printf("\n");
+ }
+ }
+ }
+
+ printf(" %-16s %s (%d)\n", "-", k->name, k->pid);
+ printf(" %lld\n\n", v);
+ }
+ }
+
+ if (missing_stacks > 0)
+ {
+ fprintf(stderr, "WARNING: %d stack traces could not be displayed.%s\n",
+ missing_stacks, has_collision ? " Consider increasing --stack-storage-size." : "");
+ }
+
+cleanup:
+ free(kip);
+ free(uip);
+}
diff --git a/profiler/stack_printer.h b/profiler/stack_printer.h
new file mode 100644
index 0000000..10565d4
--- /dev/null
+++ b/profiler/stack_printer.h
@@ -0,0 +1,7 @@
+#ifndef STACK_PRINTER_H
+#define STACK_PRINTER_H
+
+void print_stack_trace(struct ksyms *ksyms, struct syms_cache *syms_cache,
+ struct profile_bpf *obj);
+
+#endif
diff --git a/tools/bpftool b/tools/bpftool
deleted file mode 100755
index c562988..0000000
Binary files a/tools/bpftool and /dev/null differ
diff --git a/tools/gen_vmlinux_h.sh b/tools/gen_vmlinux_h.sh
deleted file mode 100755
index 57e7635..0000000
--- a/tools/gen_vmlinux_h.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#/bin/sh
-
-# Copyright 2017 Netflix, Inc.
-# Licensed under the Apache License, Version 2.0 (the "License")
-#
-# 10-Apr-2017 Brendan Gregg Created this.
-
-$(dirname "$0")/bpftool btf dump file ${1:-/sys/kernel/btf/vmlinux} format c
diff --git a/vmlinux/arm64/vmlinux.h b/vmlinux/arm64/vmlinux.h
deleted file mode 120000
index a8f8eed..0000000
--- a/vmlinux/arm64/vmlinux.h
+++ /dev/null
@@ -1 +0,0 @@
-vmlinux_516.h
\ No newline at end of file
diff --git a/vmlinux/arm64/vmlinux_516.h b/vmlinux/arm64/vmlinux_516.h
deleted file mode 100644
index 4802dc4..0000000
--- a/vmlinux/arm64/vmlinux_516.h
+++ /dev/null
@@ -1,160927 +0,0 @@
-#ifndef __VMLINUX_H__
-#define __VMLINUX_H__
-
-#ifndef BPF_NO_PRESERVE_ACCESS_INDEX
-#pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record)
-#endif
-
-typedef signed char __s8;
-
-typedef unsigned char __u8;
-
-typedef short int __s16;
-
-typedef short unsigned int __u16;
-
-typedef int __s32;
-
-typedef unsigned int __u32;
-
-typedef long long int __s64;
-
-typedef long long unsigned int __u64;
-
-typedef __s8 s8;
-
-typedef __u8 u8;
-
-typedef __s16 s16;
-
-typedef __u16 u16;
-
-typedef __s32 s32;
-
-typedef __u32 u32;
-
-typedef __s64 s64;
-
-typedef __u64 u64;
-
-enum {
- false = 0,
- true = 1,
-};
-
-typedef long int __kernel_long_t;
-
-typedef long unsigned int __kernel_ulong_t;
-
-typedef int __kernel_pid_t;
-
-typedef unsigned int __kernel_uid32_t;
-
-typedef unsigned int __kernel_gid32_t;
-
-typedef __kernel_ulong_t __kernel_size_t;
-
-typedef __kernel_long_t __kernel_ssize_t;
-
-typedef long long int __kernel_loff_t;
-
-typedef long long int __kernel_time64_t;
-
-typedef __kernel_long_t __kernel_clock_t;
-
-typedef int __kernel_timer_t;
-
-typedef int __kernel_clockid_t;
-
-typedef __u32 __le32;
-
-typedef unsigned int __poll_t;
-
-typedef u32 __kernel_dev_t;
-
-typedef __kernel_dev_t dev_t;
-
-typedef short unsigned int umode_t;
-
-typedef __kernel_pid_t pid_t;
-
-typedef __kernel_clockid_t clockid_t;
-
-typedef _Bool bool;
-
-typedef __kernel_uid32_t uid_t;
-
-typedef __kernel_gid32_t gid_t;
-
-typedef __kernel_loff_t loff_t;
-
-typedef __kernel_size_t size_t;
-
-typedef __kernel_ssize_t ssize_t;
-
-typedef s32 int32_t;
-
-typedef u16 uint16_t;
-
-typedef u32 uint32_t;
-
-typedef u64 sector_t;
-
-typedef u64 blkcnt_t;
-
-typedef unsigned int gfp_t;
-
-typedef unsigned int fmode_t;
-
-typedef u64 phys_addr_t;
-
-typedef long unsigned int irq_hw_number_t;
-
-typedef struct {
- int counter;
-} atomic_t;
-
-typedef struct {
- s64 counter;
-} atomic64_t;
-
-struct list_head {
- struct list_head *next;
- struct list_head *prev;
-};
-
-struct hlist_node;
-
-struct hlist_head {
- struct hlist_node *first;
-};
-
-struct hlist_node {
- struct hlist_node *next;
- struct hlist_node **pprev;
-};
-
-struct callback_head {
- struct callback_head *next;
- void (*func)(struct callback_head *);
-};
-
-typedef int (*initcall_t)();
-
-typedef int initcall_entry_t;
-
-struct lock_class_key {};
-
-struct fs_context;
-
-struct fs_parameter_spec;
-
-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_spec *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 invalidate_lock_key;
- struct lock_class_key i_mutex_dir_key;
-};
-
-struct obs_kernel_param {
- const char *str;
- int (*setup_func)(char *);
- int early;
-};
-
-struct kernel_symbol {
- int value_offset;
- int name_offset;
- int namespace_offset;
-};
-
-struct jump_entry {
- s32 code;
- s32 target;
- long int key;
-};
-
-struct static_key_mod;
-
-struct static_key {
- atomic_t enabled;
- union {
- long unsigned int type;
- struct jump_entry *entries;
- struct static_key_mod *next;
- };
-};
-
-struct static_key_true {
- struct static_key key;
-};
-
-struct static_key_false {
- struct static_key key;
-};
-
-typedef atomic64_t atomic_long_t;
-
-typedef __s64 time64_t;
-
-struct __kernel_timespec {
- __kernel_time64_t tv_sec;
- long long int tv_nsec;
-};
-
-struct timespec64 {
- time64_t tv_sec;
- long int tv_nsec;
-};
-
-struct qspinlock {
- union {
- atomic_t val;
- struct {
- u8 locked;
- u8 pending;
- };
- struct {
- u16 locked_pending;
- u16 tail;
- };
- };
-};
-
-typedef struct qspinlock arch_spinlock_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 lockdep_map {};
-
-struct raw_spinlock {
- arch_spinlock_t raw_lock;
-};
-
-typedef struct raw_spinlock raw_spinlock_t;
-
-struct spinlock {
- union {
- struct raw_spinlock rlock;
- };
-};
-
-typedef struct spinlock spinlock_t;
-
-typedef struct {
- arch_rwlock_t raw_lock;
-} rwlock_t;
-
-struct ratelimit_state {
- raw_spinlock_t lock;
- int interval;
- int burst;
- int printed;
- int missed;
- long unsigned int begin;
- long unsigned int flags;
-};
-
-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;
-};
-
-typedef void *fl_owner_t;
-
-struct file;
-
-struct kiocb;
-
-struct iov_iter;
-
-struct io_comp_batch;
-
-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 *, struct io_comp_batch *, unsigned int);
- 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 bug_entry {
- int bug_addr_disp;
- int file_disp;
- short unsigned int line;
- short unsigned int flags;
-};
-
-struct static_call_key {
- void *func;
-};
-
-enum system_states {
- SYSTEM_BOOTING = 0,
- SYSTEM_SCHEDULING = 1,
- SYSTEM_FREEING_INITMEM = 2,
- SYSTEM_RUNNING = 3,
- SYSTEM_HALT = 4,
- SYSTEM_POWER_OFF = 5,
- SYSTEM_RESTART = 6,
- SYSTEM_SUSPEND = 7,
-};
-
-struct cpumask {
- long unsigned int bits[4];
-};
-
-typedef struct cpumask cpumask_t;
-
-typedef struct cpumask cpumask_var_t[1];
-
-struct llist_node;
-
-struct llist_head {
- struct llist_node *first;
-};
-
-struct llist_node {
- struct llist_node *next;
-};
-
-struct __call_single_node {
- struct llist_node llist;
- union {
- unsigned int u_flags;
- atomic_t a_flags;
- };
- u16 src;
- u16 dst;
-};
-
-enum timespec_type {
- TT_NONE = 0,
- TT_NATIVE = 1,
- TT_COMPAT = 2,
-};
-
-typedef s32 old_time32_t;
-
-struct old_timespec32 {
- old_time32_t tv_sec;
- s32 tv_nsec;
-};
-
-struct pollfd {
- int fd;
- short int events;
- short int revents;
-};
-
-struct restart_block {
- long unsigned int arch_data;
- long int (*fn)(struct restart_block *);
- union {
- struct {
- u32 *uaddr;
- u32 val;
- u32 flags;
- u32 bitset;
- u64 time;
- u32 *uaddr2;
- } futex;
- struct {
- clockid_t clockid;
- enum timespec_type type;
- union {
- struct __kernel_timespec *rmtp;
- struct old_timespec32 *compat_rmtp;
- };
- u64 expires;
- } nanosleep;
- struct {
- struct pollfd *ufds;
- int nfds;
- int has_timeout;
- long unsigned int tv_sec;
- long unsigned int tv_nsec;
- } poll;
- };
-};
-
-struct thread_info {
- long unsigned int flags;
- u64 ttbr0;
- union {
- u64 preempt_count;
- struct {
- u32 count;
- u32 need_resched;
- } preempt;
- };
- u32 cpu;
-};
-
-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 util_est {
- unsigned int enqueued;
- unsigned int ewma;
-};
-
-struct sched_avg {
- u64 last_update_time;
- u64 load_sum;
- u64 runnable_sum;
- u32 util_sum;
- u32 period_contrib;
- long unsigned int load_avg;
- long unsigned int runnable_avg;
- long unsigned int util_avg;
- struct util_est util_est;
-};
-
-struct cfs_rq;
-
-struct sched_entity {
- struct load_weight load;
- 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;
- int depth;
- struct sched_entity *parent;
- struct cfs_rq *cfs_rq;
- struct cfs_rq *my_q;
- long unsigned int runnable_weight;
- long: 64;
- long: 64;
- long: 64;
- 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_yielded: 1;
- unsigned int dl_non_contending: 1;
- unsigned int dl_overrun: 1;
- struct hrtimer dl_timer;
- struct hrtimer inactive_timer;
- struct sched_dl_entity *pi_se;
-};
-
-struct uclamp_se {
- unsigned int value: 11;
- unsigned int bucket_id: 3;
- unsigned int active: 1;
- unsigned int user_defined: 1;
-};
-
-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;
- s64 sum_block_runtime;
- 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;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
-};
-
-union rcu_special {
- struct {
- u8 blocked;
- u8 need_qs;
- u8 exp_hint;
- u8 need_mb;
- } b;
- u32 s;
-};
-
-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 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 posix_cputimers_work {
- struct callback_head work;
- unsigned int scheduled;
-};
-
-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;
- atomic_t filter_count;
- struct seccomp_filter *filter;
-};
-
-struct syscall_user_dispatch {};
-
-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;
-};
-
-typedef struct {
- long unsigned int bits[1];
-} nodemask_t;
-
-struct seqcount {
- unsigned int sequence;
-};
-
-typedef struct seqcount seqcount_t;
-
-struct seqcount_spinlock {
- seqcount_t seqcount;
-};
-
-typedef struct seqcount_spinlock seqcount_spinlock_t;
-
-struct optimistic_spin_queue {
- atomic_t tail;
-};
-
-struct mutex {
- atomic_long_t owner;
- raw_spinlock_t wait_lock;
- struct optimistic_spin_queue osq;
- struct list_head wait_list;
-};
-
-struct tlbflush_unmap_batch {};
-
-struct page_frag {
- struct page *page;
- __u32 offset;
- __u32 size;
-};
-
-struct kmap_ctrl {};
-
-struct cpu_context {
- long unsigned int x19;
- long unsigned int x20;
- long unsigned int x21;
- long unsigned int x22;
- long unsigned int x23;
- long unsigned int x24;
- long unsigned int x25;
- long unsigned int x26;
- long unsigned int x27;
- long unsigned int x28;
- long unsigned int fp;
- long unsigned int sp;
- long unsigned int pc;
-};
-
-struct user_fpsimd_state {
- __int128 unsigned vregs[32];
- __u32 fpsr;
- __u32 fpcr;
- __u32 __reserved[2];
-};
-
-struct perf_event;
-
-struct debug_info {
- int suspended_step;
- int bps_disabled;
- int wps_disabled;
- struct perf_event *hbp_break[16];
- struct perf_event *hbp_watch[16];
-};
-
-struct ptrauth_key {
- long unsigned int lo;
- long unsigned int hi;
-};
-
-struct ptrauth_keys_user {
- struct ptrauth_key apia;
- struct ptrauth_key apib;
- struct ptrauth_key apda;
- struct ptrauth_key apdb;
- struct ptrauth_key apga;
-};
-
-struct ptrauth_keys_kernel {
- struct ptrauth_key apia;
-};
-
-struct thread_struct {
- struct cpu_context cpu_context;
- long: 64;
- struct {
- long unsigned int tp_value;
- long unsigned int tp2_value;
- struct user_fpsimd_state fpsimd_state;
- } uw;
- unsigned int fpsimd_cpu;
- void *sve_state;
- unsigned int vl[1];
- unsigned int vl_onexec[1];
- long unsigned int fault_address;
- long unsigned int fault_code;
- struct debug_info debug;
- struct ptrauth_keys_user keys_user;
- struct ptrauth_keys_kernel keys_kernel;
- u64 mte_ctrl;
- u64 sctlr_user;
- long: 64;
-};
-
-struct sched_class;
-
-struct task_group;
-
-struct mm_struct;
-
-struct pid;
-
-struct completion;
-
-struct cred;
-
-struct key;
-
-struct nameidata;
-
-struct fs_struct;
-
-struct files_struct;
-
-struct io_uring_task;
-
-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 io_context;
-
-struct capture_control;
-
-struct kernel_siginfo;
-
-typedef struct kernel_siginfo kernel_siginfo_t;
-
-struct css_set;
-
-struct robust_list_head;
-
-struct compat_robust_list_head;
-
-struct futex_pi_state;
-
-struct perf_event_context;
-
-struct mempolicy;
-
-struct numa_group;
-
-struct rseq;
-
-struct task_delay_info;
-
-struct ftrace_ret_stack;
-
-struct mem_cgroup;
-
-struct request_queue;
-
-struct uprobe_task;
-
-struct vm_struct;
-
-struct bpf_local_storage;
-
-struct bpf_run_ctx;
-
-struct task_struct {
- struct thread_info thread_info;
- unsigned int __state;
- void *stack;
- refcount_t usage;
- unsigned int flags;
- unsigned int ptrace;
- int on_cpu;
- struct __call_single_node wake_entry;
- unsigned int wakee_flips;
- long unsigned int wakee_flip_decay_ts;
- struct task_struct *last_wakee;
- int recent_used_cpu;
- int wake_cpu;
- int on_rq;
- int prio;
- int static_prio;
- int normal_prio;
- unsigned int rt_priority;
- long: 32;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- struct sched_entity se;
- struct sched_rt_entity rt;
- struct sched_dl_entity dl;
- const struct sched_class *sched_class;
- struct rb_node core_node;
- long unsigned int core_cookie;
- unsigned int core_occupation;
- struct task_group *sched_task_group;
- struct uclamp_se uclamp_req[2];
- struct uclamp_se uclamp[2];
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- struct sched_statistics stats;
- struct hlist_head preempt_notifiers;
- unsigned int btrace_seq;
- unsigned int policy;
- int nr_cpus_allowed;
- const cpumask_t *cpus_ptr;
- cpumask_t *user_cpus_ptr;
- cpumask_t cpus_mask;
- void *migration_pending;
- short unsigned int migration_disabled;
- short unsigned int migration_flags;
- int trc_reader_nesting;
- int trc_ipi_to_cpu;
- union rcu_special trc_reader_special;
- bool trc_reader_checked;
- struct list_head trc_holdout_list;
- struct sched_info sched_info;
- struct list_head tasks;
- struct plist_node pushable_tasks;
- struct rb_node pushable_dl_tasks;
- struct mm_struct *mm;
- struct mm_struct *active_mm;
- struct vmacache 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_psi_wake_requeue: 1;
- int: 28;
- unsigned int sched_remote_wakeup: 1;
- unsigned int in_execve: 1;
- unsigned int in_iowait: 1;
- unsigned int in_user_fault: 1;
- unsigned int no_cgroup_migration: 1;
- unsigned int frozen: 1;
- unsigned int use_memdelay: 1;
- unsigned int in_memstall: 1;
- unsigned int in_eventfd_signal: 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 *real_parent;
- struct task_struct *parent;
- struct list_head children;
- struct list_head sibling;
- struct task_struct *group_leader;
- struct list_head ptraced;
- struct list_head ptrace_entry;
- struct pid *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;
- void *pf_io_worker;
- 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;
- struct posix_cputimers_work posix_cputimers_work;
- const struct cred *ptracer_cred;
- const struct cred *real_cred;
- const struct cred *cred;
- struct key *cached_requested_key;
- char comm[16];
- struct nameidata *nameidata;
- struct sysv_sem sysvsem;
- struct sysv_shm sysvshm;
- long unsigned int last_switch_count;
- long unsigned int last_switch_time;
- struct fs_struct *fs;
- struct files_struct *files;
- struct io_uring_task *io_uring;
- struct nsproxy *nsproxy;
- struct signal_struct *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;
- struct syscall_user_dispatch syscall_dispatch;
- u64 parent_exec_id;
- u64 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 *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;
- unsigned int psi_flags;
- u64 acct_rss_mem1;
- u64 acct_vm_mem1;
- u64 acct_timexpd;
- nodemask_t mems_allowed;
- seqcount_spinlock_t mems_allowed_seq;
- int cpuset_mem_spread_rotor;
- int cpuset_slab_spread_rotor;
- struct css_set *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 *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;
- int numa_scan_seq;
- unsigned int numa_scan_period;
- unsigned int numa_scan_period_max;
- int numa_preferred_nid;
- long unsigned int numa_migrate_retry;
- u64 node_stamp;
- u64 last_task_numa_placement;
- u64 last_sum_exec_runtime;
- struct callback_head numa_work;
- struct numa_group *numa_group;
- long unsigned int *numa_faults;
- long unsigned int total_numa_faults;
- long unsigned int numa_faults_locality[3];
- long unsigned int numa_pages_migrated;
- 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 *splice_pipe;
- struct page_frag 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;
- int curr_ret_stack;
- int curr_ret_depth;
- struct ftrace_ret_stack *ret_stack;
- long long unsigned int ftrace_timestamp;
- atomic_t trace_overrun;
- atomic_t tracing_graph_pause;
- long unsigned int trace;
- long unsigned int trace_recursion;
- struct mem_cgroup *memcg_in_oom;
- gfp_t memcg_oom_gfp_mask;
- int memcg_oom_order;
- unsigned int memcg_nr_pages_over_high;
- struct mem_cgroup *active_memcg;
- struct request_queue *throttle_queue;
- struct uprobe_task *utask;
- unsigned int sequential_io;
- unsigned int sequential_io_avg;
- struct kmap_ctrl kmap_ctrl;
- int pagefault_disabled;
- struct task_struct *oom_reaper_list;
- struct vm_struct *stack_vm_area;
- refcount_t stack_refcount;
- void *security;
- struct bpf_local_storage *bpf_storage;
- struct bpf_run_ctx *bpf_ctx;
- struct llist_head kretprobe_instances;
- struct thread_struct thread;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
-};
-
-typedef s32 compat_long_t;
-
-typedef u32 compat_uptr_t;
-
-struct user_pt_regs {
- __u64 regs[31];
- __u64 sp;
- __u64 pc;
- __u64 pstate;
-};
-
-struct pt_regs {
- union {
- struct user_pt_regs user_regs;
- struct {
- u64 regs[31];
- u64 sp;
- u64 pc;
- u64 pstate;
- };
- };
- u64 orig_x0;
- s32 syscallno;
- u32 unused2;
- u64 sdei_ttbr1;
- u64 pmr_save;
- u64 stackframe[2];
- u64 lockdep_hardirqs;
- u64 exit_rcu;
-};
-
-struct arch_hw_breakpoint_ctrl {
- u32 __reserved: 19;
- u32 len: 8;
- u32 type: 2;
- u32 privilege: 2;
- u32 enabled: 1;
-};
-
-struct arch_hw_breakpoint {
- u64 address;
- u64 trigger;
- struct arch_hw_breakpoint_ctrl ctrl;
-};
-
-typedef u64 pteval_t;
-
-typedef u64 pmdval_t;
-
-typedef u64 pudval_t;
-
-typedef u64 pgdval_t;
-
-typedef struct {
- pteval_t pte;
-} pte_t;
-
-typedef struct {
- pmdval_t pmd;
-} pmd_t;
-
-typedef struct {
- pudval_t pud;
-} pud_t;
-
-typedef struct {
- pgdval_t pgd;
-} pgd_t;
-
-typedef struct {
- pteval_t pgprot;
-} pgprot_t;
-
-enum module_state {
- MODULE_STATE_LIVE = 0,
- MODULE_STATE_COMING = 1,
- MODULE_STATE_GOING = 2,
- MODULE_STATE_UNFORMED = 3,
-};
-
-struct kref {
- refcount_t refcount;
-};
-
-struct kset;
-
-struct kobj_type;
-
-struct kernfs_node;
-
-struct kobject {
- const char *name;
- struct list_head entry;
- struct kobject *parent;
- struct kset *kset;
- struct kobj_type *ktype;
- struct kernfs_node *sd;
- struct kref kref;
- unsigned int state_initialized: 1;
- unsigned int state_in_sysfs: 1;
- unsigned int state_add_uevent_sent: 1;
- unsigned int state_remove_uevent_sent: 1;
- unsigned int uevent_suppress: 1;
-};
-
-struct module_param_attrs;
-
-struct module_kobject {
- struct kobject kobj;
- struct module *mod;
- struct kobject *drivers_dir;
- struct module_param_attrs *mp;
- struct completion *kobj_completion;
-};
-
-struct latch_tree_node {
- struct rb_node node[2];
-};
-
-struct mod_tree_node {
- struct module *mod;
- struct latch_tree_node node;
-};
-
-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 mod_plt_sec {
- int plt_shndx;
- int plt_num_entries;
- int plt_max_entries;
-};
-
-struct plt_entry;
-
-struct mod_arch_specific {
- struct mod_plt_sec core;
- struct mod_plt_sec init;
- struct plt_entry *ftrace_trampolines;
-};
-
-struct elf64_sym;
-
-typedef struct elf64_sym Elf64_Sym;
-
-struct mod_kallsyms {
- Elf64_Sym *symtab;
- unsigned int num_symtab;
- char *strtab;
- char *typetab;
-};
-
-typedef const int tracepoint_ptr_t;
-
-struct module_attribute;
-
-struct kernel_param;
-
-struct exception_table_entry;
-
-struct module_sect_attrs;
-
-struct module_notes_attrs;
-
-struct srcu_struct;
-
-struct bpf_raw_event_map;
-
-struct trace_event_call;
-
-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 using_gplonly_symbols;
- bool sig_ok;
- bool async_probe_requested;
- unsigned int num_exentries;
- struct exception_table_entry *extable;
- int (*init)();
- 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;
- void *noinstr_text_start;
- unsigned int noinstr_text_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;
- unsigned int btf_data_size;
- void *btf_data;
- 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;
- unsigned int num_ftrace_callsites;
- long unsigned int *ftrace_callsites;
- void *kprobes_text_start;
- unsigned int kprobes_text_size;
- long unsigned int *kprobe_blacklist;
- unsigned int num_kprobe_blacklist;
- 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;
-};
-
-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 {
- atomic_long_t a;
-} local_t;
-
-typedef struct {
- local_t a;
-} local64_t;
-
-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 cgroup: 1;
- __u64 text_poke: 1;
- __u64 build_id: 1;
- __u64 inherit_thread: 1;
- __u64 remove_on_exec: 1;
- __u64 sigtrap: 1;
- __u64 __reserved_1: 26;
- 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;
- __u64 sig_data;
-};
-
-struct hw_perf_event_extra {
- u64 config;
- unsigned int reg;
- int alloc;
- int idx;
-};
-
-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;
- union {
- struct {
- u64 last_period;
- local64_t period_left;
- };
- struct {
- u64 saved_metric;
- u64 saved_slots;
- };
- };
- u64 interrupts_seq;
- u64 interrupts;
- u64 freq_time_stamp;
- u64 freq_count_stamp;
-};
-
-struct wait_queue_head {
- spinlock_t lock;
- struct list_head head;
-};
-
-typedef struct wait_queue_head wait_queue_head_t;
-
-struct rcuwait {
- struct task_struct *task;
-};
-
-struct irq_work {
- struct __call_single_node node;
- void (*func)(struct irq_work *);
- struct rcuwait irqwait;
-};
-
-struct perf_addr_filters_head {
- struct list_head list;
- raw_spinlock_t lock;
- unsigned int nr_file_filters;
-};
-
-struct perf_sample_data;
-
-typedef void (*perf_overflow_handler_t)(struct perf_event *, struct perf_sample_data *, struct pt_regs *);
-
-struct ftrace_ops;
-
-struct ftrace_regs;
-
-typedef void (*ftrace_func_t)(long unsigned int, long unsigned int, struct ftrace_ops *, struct ftrace_regs *);
-
-struct ftrace_hash;
-
-struct ftrace_ops_hash {
- struct ftrace_hash *notrace_hash;
- struct ftrace_hash *filter_hash;
- struct mutex regex_lock;
-};
-
-struct ftrace_ops {
- ftrace_func_t func;
- struct ftrace_ops *next;
- long unsigned int flags;
- void *private;
- ftrace_func_t saved_func;
- struct ftrace_ops_hash local_hash;
- struct ftrace_ops_hash *func_hash;
- struct ftrace_ops_hash old_hash;
- long unsigned int trampoline;
- long unsigned int trampoline_size;
- struct list_head list;
-};
-
-struct pmu;
-
-struct perf_buffer;
-
-struct fasync_struct;
-
-struct perf_addr_filter_range;
-
-struct pid_namespace;
-
-struct bpf_prog;
-
-struct event_filter;
-
-struct perf_cgroup;
-
-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 perf_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;
- long unsigned int pending_addr;
- 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;
- u64 bpf_cookie;
- struct trace_event_call *tp_event;
- struct event_filter *filter;
- struct ftrace_ops ftrace_ops;
- struct perf_cgroup *cgrp;
- void *security;
- struct list_head sb_list;
-};
-
-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;
-};
-
-typedef struct wait_queue_entry wait_queue_entry_t;
-
-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,
-};
-
-enum pid_type {
- PIDTYPE_PID = 0,
- PIDTYPE_TGID = 1,
- PIDTYPE_PGID = 2,
- PIDTYPE_SID = 3,
- PIDTYPE_MAX = 4,
-};
-
-struct upid {
- int nr;
- struct pid_namespace *ns;
-};
-
-struct xarray {
- spinlock_t xa_lock;
- gfp_t xa_flags;
- void *xa_head;
-};
-
-struct idr {
- struct xarray idr_rt;
- unsigned int idr_base;
- unsigned int idr_next;
-};
-
-struct proc_ns_operations;
-
-struct ns_common {
- atomic_long_t stashed;
- const struct proc_ns_operations *ops;
- unsigned int inum;
- refcount_t count;
-};
-
-struct kmem_cache;
-
-struct fs_pin;
-
-struct user_namespace;
-
-struct ucounts;
-
-struct pid_namespace {
- 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 fs_pin *bacct;
- struct user_namespace *user_ns;
- struct ucounts *ucounts;
- int reboot;
- struct ns_common ns;
-};
-
-struct pid {
- refcount_t count;
- unsigned int level;
- spinlock_t lock;
- struct hlist_head tasks[4];
- struct hlist_head inodes;
- wait_queue_head_t wait_pidfd;
- struct callback_head rcu;
- struct upid numbers[1];
-};
-
-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;
- };
- };
-};
-
-typedef struct {
- gid_t val;
-} kgid_t;
-
-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 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;
-};
-
-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;
-};
-
-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 user_namespace {
- struct uid_gid_map uid_map;
- struct uid_gid_map gid_map;
- struct uid_gid_map projid_map;
- struct user_namespace *parent;
- int level;
- kuid_t owner;
- kgid_t group;
- struct ns_common ns;
- long unsigned int flags;
- bool parent_could_setfcap;
- struct list_head keyring_name_list;
- struct key *user_keyring_register;
- struct rw_semaphore keyring_sem;
- struct key *persistent_keyring_register;
- struct work_struct work;
- struct ctl_table_set set;
- struct ctl_table_header *sysctls;
- struct ucounts *ucounts;
- long int ucount_max[16];
-};
-
-struct timer_list {
- struct hlist_node entry;
- long unsigned int expires;
- void (*function)(struct timer_list *);
- u32 flags;
-};
-
-struct workqueue_struct;
-
-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;
-};
-
-typedef struct page *pgtable_t;
-
-struct address_space;
-
-struct page_pool;
-
-struct dev_pagemap;
-
-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 {
- long unsigned int pp_magic;
- struct page_pool *pp;
- long unsigned int _pp_mapping_pad;
- long unsigned int dma_addr;
- union {
- long unsigned int dma_addr_upper;
- atomic_long_t pp_frag_count;
- };
- };
- struct {
- union {
- struct list_head slab_list;
- struct {
- struct page *next;
- int pages;
- };
- };
- 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;
- unsigned int compound_nr;
- };
- struct {
- long unsigned int _compound_pad_1;
- atomic_t hpage_pinned_refcount;
- 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 unsigned int memcg_data;
-};
-
-struct seqcount_raw_spinlock {
- seqcount_t seqcount;
-};
-
-typedef struct seqcount_raw_spinlock seqcount_raw_spinlock_t;
-
-typedef struct {
- seqcount_spinlock_t seqcount;
- spinlock_t lock;
-} seqlock_t;
-
-struct hrtimer_cpu_base;
-
-struct hrtimer_clock_base {
- struct hrtimer_cpu_base *cpu_base;
- unsigned int index;
- clockid_t clockid;
- seqcount_raw_spinlock_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];
-};
-
-enum node_states {
- N_POSSIBLE = 0,
- N_ONLINE = 1,
- N_NORMAL_MEMORY = 2,
- N_HIGH_MEMORY = 2,
- N_MEMORY = 3,
- N_CPU = 4,
- N_GENERIC_INITIATOR = 5,
- NR_NODE_STATES = 6,
-};
-
-struct rlimit {
- __kernel_ulong_t rlim_cur;
- __kernel_ulong_t rlim_max;
-};
-
-struct task_cputime {
- u64 stime;
- u64 utime;
- long long unsigned int sum_exec_runtime;
-};
-
-typedef void __signalfn_t(int);
-
-typedef __signalfn_t *__sighandler_t;
-
-typedef void __restorefn_t();
-
-typedef __restorefn_t *__sigrestore_t;
-
-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 {
- int _trapno;
- short int _addr_lsb;
- struct {
- char _dummy_bnd[8];
- void *_lower;
- void *_upper;
- } _addr_bnd;
- struct {
- char _dummy_pkey[8];
- __u32 _pkey;
- } _addr_pkey;
- struct {
- long unsigned int _data;
- __u32 _type;
- } _perf;
- };
- } _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 ucounts {
- struct hlist_node node;
- struct user_namespace *ns;
- kuid_t uid;
- atomic_t count;
- atomic_long_t ucount[16];
-};
-
-struct sigaction {
- __sighandler_t sa_handler;
- long unsigned int sa_flags;
- __sigrestore_t sa_restorer;
- sigset_t sa_mask;
-};
-
-struct k_sigaction {
- struct sigaction sa;
-};
-
-struct userfaultfd_ctx;
-
-struct vm_userfaultfd_ctx {
- struct userfaultfd_ctx *ctx;
-};
-
-struct anon_vma;
-
-struct vm_operations_struct;
-
-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 mm_rss_stat {
- atomic_long_t count[4];
-};
-
-struct cpu_itimer {
- u64 expires;
- u64 incr;
-};
-
-struct task_cputime_atomic {
- atomic64_t utime;
- atomic64_t stime;
- atomic64_t sum_exec_runtime;
-};
-
-struct thread_group_cputimer {
- struct task_cputime_atomic cputime_atomic;
-};
-
-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 core_state;
-
-struct tty_struct;
-
-struct autogroup;
-
-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;
- struct core_state *core_state;
- 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;
- struct autogroup *autogroup;
- 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 rw_semaphore exec_update_lock;
-};
-
-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 {
- int uclamp_enabled;
- 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 *);
- 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);
- struct task_struct * (*pick_task)(struct rq *);
- 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 *, u32);
- void (*rq_online)(struct rq *);
- void (*rq_offline)(struct rq *);
- struct rq * (*find_lock_rq)(struct task_struct *, 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);
-};
-
-typedef struct {
- atomic64_t id;
- void *sigpage;
- refcount_t pinned;
- void *vdso;
- long unsigned int flags;
-} mm_context_t;
-
-struct xol_area;
-
-struct uprobes_state {
- struct xol_area *xol_area;
-};
-
-struct linux_binfmt;
-
-struct kioctx_table;
-
-struct mmu_notifier_subscriptions;
-
-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 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_lock;
- 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;
- seqcount_t write_protect_seq;
- 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;
- spinlock_t ioctx_lock;
- struct kioctx_table *ioctx_table;
- struct task_struct *owner;
- struct user_namespace *user_ns;
- struct file *exe_file;
- struct mmu_notifier_subscriptions *notifier_subscriptions;
- long unsigned int numa_next_scan;
- long unsigned int numa_scan_offset;
- int numa_scan_seq;
- atomic_t tlb_flush_pending;
- struct uprobes_state uprobes_state;
- atomic_long_t hugetlb_usage;
- struct work_struct async_put_work;
- u32 pasid;
- };
- long unsigned int cpu_bitmap[0];
-};
-
-struct swait_queue_head {
- raw_spinlock_t lock;
- struct list_head task_list;
-};
-
-struct completion {
- unsigned int done;
- struct swait_queue_head wait;
-};
-
-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 ucounts *ucounts;
- struct group_info *group_info;
- union {
- int non_rcu;
- struct callback_head rcu;
- };
-};
-
-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 {
- u16 desc_len;
- char desc[6];
- };
- long unsigned int x;
- };
- struct key_type *type;
- struct key_tag *domain_tag;
- const char *description;
-};
-
-union key_payload {
- void *rcu_data0;
- void *data[4];
-};
-
-struct assoc_array_ptr;
-
-struct assoc_array {
- struct assoc_array_ptr *root;
- long unsigned int nr_leaves_on_tree;
-};
-
-struct watch_list;
-
-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 watch_list *watchers;
- 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 uts_namespace;
-
-struct ipc_namespace;
-
-struct mnt_namespace;
-
-struct net;
-
-struct time_namespace;
-
-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 time_namespace *time_ns;
- struct time_namespace *time_ns_for_children;
- struct cgroup_namespace *cgroup_ns;
-};
-
-struct sighand_struct {
- spinlock_t siglock;
- refcount_t count;
- wait_queue_head_t signalfd_wqh;
- struct k_sigaction action[64];
-};
-
-struct bio;
-
-struct bio_list {
- struct bio *head;
- struct bio *tail;
-};
-
-struct request;
-
-struct blk_plug {
- struct request *mq_list;
- struct request *cached_rq;
- short unsigned int nr_ios;
- short unsigned int rq_count;
- bool multiple_queues;
- bool has_elevator;
- bool nowait;
- struct list_head cb_list;
-};
-
-struct reclaim_state {
- long unsigned int reclaimed_slab;
-};
-
-struct percpu_counter {
- raw_spinlock_t lock;
- s64 count;
- struct list_head list;
- s32 *counters;
-};
-
-struct fprop_local_percpu {
- struct percpu_counter events;
- unsigned int period;
- raw_spinlock_t lock;
-};
-
-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_FS_FREE_SPACE = 5,
- WB_REASON_FORKER_THREAD = 6,
- WB_REASON_FOREIGN_FLUSH = 7,
- WB_REASON_MAX = 8,
-};
-
-struct percpu_ref_data;
-
-struct percpu_ref {
- long unsigned int percpu_count_ptr;
- struct percpu_ref_data *data;
-};
-
-struct cgroup_subsys_state;
-
-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;
- atomic_t writeback_inodes;
- struct percpu_counter stat[4];
- long unsigned int 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;
- struct delayed_work bw_dwork;
- long unsigned int dirty_sleep;
- struct list_head bdi_node;
- struct percpu_ref refcnt;
- struct fprop_local_percpu memcg_completions;
- struct cgroup_subsys_state *memcg_css;
- struct cgroup_subsys_state *blkcg_css;
- struct list_head memcg_node;
- struct list_head blkcg_node;
- struct list_head b_attached;
- struct list_head offline_node;
- union {
- struct work_struct release_work;
- struct callback_head rcu;
- };
-};
-
-struct device;
-
-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;
- 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 xarray cgwb_tree;
- struct mutex cgwb_release_mutex;
- struct rw_semaphore wb_switch_rwsem;
- wait_queue_head_t wb_waitq;
- struct device *dev;
- char dev_name[64];
- struct device *owner;
- struct timer_list laptop_mode_wb_timer;
- struct dentry *debug_dir;
-};
-
-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;
- struct xarray icq_tree;
- struct io_cq *icq_hint;
- struct hlist_head icq_list;
- struct work_struct release_work;
-};
-
-struct cgroup;
-
-struct css_set {
- struct cgroup_subsys_state *subsys[14];
- 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[14];
- 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 compat_robust_list {
- compat_uptr_t next;
-};
-
-struct compat_robust_list_head {
- struct compat_robust_list list;
- compat_long_t futex_offset;
- compat_uptr_t list_op_pending;
-};
-
-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;
- int nr_cgroups;
- void *task_ctx_data;
- struct callback_head callback_head;
-};
-
-struct mempolicy {
- atomic_t refcnt;
- short unsigned int mode;
- short unsigned int flags;
- nodemask_t nodes;
- union {
- nodemask_t cpuset_mems_allowed;
- nodemask_t user_nodemask;
- } w;
-};
-
-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 ftrace_ret_stack {
- long unsigned int ret;
- long unsigned int func;
- long long unsigned int calltime;
- long long unsigned int subtime;
- long unsigned int fp;
- long unsigned int *retp;
-};
-
-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 mem_cgroup_id {
- int id;
- refcount_t ref;
-};
-
-struct page_counter {
- atomic_long_t usage;
- long unsigned int min;
- long unsigned int low;
- long unsigned int high;
- long unsigned int max;
- long unsigned int emin;
- atomic_long_t min_usage;
- atomic_long_t children_min_usage;
- long unsigned int elow;
- atomic_long_t low_usage;
- atomic_long_t children_low_usage;
- long unsigned int watermark;
- long unsigned int failcnt;
- struct page_counter *parent;
-};
-
-struct vmpressure {
- long unsigned int scanned;
- long unsigned int reclaimed;
- long unsigned int tree_scanned;
- long unsigned int tree_reclaimed;
- spinlock_t sr_lock;
- struct list_head events;
- struct mutex events_lock;
- struct work_struct work;
-};
-
-struct cgroup_file {
- struct kernfs_node *kn;
- long unsigned int notified_at;
- struct timer_list notify_timer;
-};
-
-struct mem_cgroup_threshold_ary;
-
-struct mem_cgroup_thresholds {
- struct mem_cgroup_threshold_ary *primary;
- struct mem_cgroup_threshold_ary *spare;
-};
-
-struct memcg_padding {
- char x[0];
-};
-
-struct memcg_vmstats {
- long int state[43];
- long unsigned int events[99];
- long int state_pending[43];
- long unsigned int events_pending[99];
-};
-
-struct fprop_global {
- struct percpu_counter events;
- unsigned int period;
- seqcount_t sequence;
-};
-
-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;
-};
-
-struct wb_completion {
- atomic_t cnt;
- wait_queue_head_t *waitq;
-};
-
-struct memcg_cgwb_frn {
- u64 bdi_id;
- int memcg_id;
- u64 at;
- struct wb_completion done;
-};
-
-struct deferred_split {
- spinlock_t split_queue_lock;
- struct list_head split_queue;
- long unsigned int split_queue_len;
-};
-
-struct obj_cgroup;
-
-struct memcg_vmstats_percpu;
-
-struct mem_cgroup_per_node;
-
-struct mem_cgroup {
- struct cgroup_subsys_state css;
- struct mem_cgroup_id id;
- struct page_counter memory;
- union {
- struct page_counter swap;
- struct page_counter memsw;
- };
- struct page_counter kmem;
- struct page_counter tcpmem;
- struct work_struct high_work;
- long unsigned int soft_limit;
- struct vmpressure vmpressure;
- bool oom_group;
- bool oom_lock;
- int under_oom;
- int swappiness;
- int oom_kill_disable;
- struct cgroup_file events_file;
- struct cgroup_file events_local_file;
- struct cgroup_file swap_events_file;
- struct mutex thresholds_lock;
- struct mem_cgroup_thresholds thresholds;
- struct mem_cgroup_thresholds memsw_thresholds;
- struct list_head oom_notify;
- long unsigned int move_charge_at_immigrate;
- spinlock_t move_lock;
- long unsigned int move_lock_flags;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- struct memcg_padding _pad1_;
- struct memcg_vmstats vmstats;
- atomic_long_t memory_events[8];
- atomic_long_t memory_events_local[8];
- long unsigned int socket_pressure;
- bool tcpmem_active;
- int tcpmem_pressure;
- int kmemcg_id;
- struct obj_cgroup *objcg;
- struct list_head objcg_list;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- struct memcg_padding _pad2_;
- atomic_t moving_account;
- struct task_struct *move_lock_task;
- struct memcg_vmstats_percpu *vmstats_percpu;
- struct list_head cgwb_list;
- struct wb_domain cgwb_domain;
- struct memcg_cgwb_frn cgwb_frn[4];
- struct list_head event_list;
- spinlock_t event_list_lock;
- struct deferred_split deferred_split_queue;
- struct mem_cgroup_per_node *nodeinfo[0];
- long: 64;
-};
-
-struct blk_integrity_profile;
-
-struct blk_integrity {
- const struct blk_integrity_profile *profile;
- unsigned char flags;
- unsigned char tuple_size;
- unsigned char interval_exp;
- unsigned char tag_size;
-};
-
-enum rpm_status {
- RPM_ACTIVE = 0,
- RPM_RESUMING = 1,
- RPM_SUSPENDED = 2,
- RPM_SUSPENDING = 3,
-};
-
-struct blk_rq_stat {
- u64 mean;
- u64 min;
- u64 max;
- u32 nr_samples;
- u64 batch;
-};
-
-enum blk_bounce {
- BLK_BOUNCE_NONE = 0,
- BLK_BOUNCE_HIGH = 1,
-};
-
-enum blk_zoned_model {
- BLK_ZONED_NONE = 0,
- BLK_ZONED_HA = 1,
- BLK_ZONED_HM = 2,
-};
-
-struct queue_limits {
- enum blk_bounce bounce;
- 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 max_zone_append_sectors;
- unsigned int discard_granularity;
- unsigned int discard_alignment;
- unsigned int zone_write_granularity;
- 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;
-};
-
-typedef void *mempool_alloc_t(gfp_t, void *);
-
-typedef void mempool_free_t(void *, void *);
-
-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;
-};
-
-typedef struct mempool_s mempool_t;
-
-struct bio_alloc_cache;
-
-struct bio_set {
- struct kmem_cache *bio_slab;
- unsigned int front_pad;
- struct bio_alloc_cache *cache;
- mempool_t bio_pool;
- mempool_t bvec_pool;
- mempool_t bio_integrity_pool;
- mempool_t bvec_integrity_pool;
- unsigned int back_pad;
- spinlock_t rescue_lock;
- struct bio_list rescue_list;
- struct work_struct rescue_work;
- struct workqueue_struct *rescue_workqueue;
- struct hlist_node cpuhp_dead;
-};
-
-struct elevator_queue;
-
-struct blk_queue_stats;
-
-struct rq_qos;
-
-struct blk_mq_ops;
-
-struct blk_mq_ctx;
-
-struct blk_mq_hw_ctx;
-
-struct gendisk;
-
-struct blk_crypto_profile;
-
-struct blk_stat_callback;
-
-struct blk_mq_tags;
-
-struct blkcg_gq;
-
-struct blk_trace;
-
-struct blk_flush_queue;
-
-struct throtl_data;
-
-struct blk_mq_tag_set;
-
-struct blk_independent_access_ranges;
-
-struct request_queue {
- struct request *last_merge;
- struct elevator_queue *elevator;
- struct percpu_ref q_usage_counter;
- struct blk_queue_stats *stats;
- struct rq_qos *rq_qos;
- 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;
- void *queuedata;
- long unsigned int queue_flags;
- atomic_t pm_only;
- int id;
- spinlock_t queue_lock;
- struct gendisk *disk;
- struct kobject kobj;
- struct kobject *mq_kobj;
- struct blk_integrity integrity;
- struct device *dev;
- enum rpm_status rpm_status;
- long unsigned int nr_requests;
- unsigned int dma_pad_mask;
- unsigned int dma_alignment;
- struct blk_crypto_profile *crypto_profile;
- 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;
- atomic_t nr_active_requests_shared_tags;
- struct blk_mq_tags *sched_shared_tags;
- struct list_head icq_list;
- long unsigned int blkcg_pols[1];
- struct blkcg_gq *root_blkg;
- struct list_head blkg_list;
- struct queue_limits limits;
- unsigned int required_elevator_features;
- unsigned int nr_zones;
- long unsigned int *conv_zones_bitmap;
- long unsigned int *seq_zones_wlock;
- unsigned int max_open_zones;
- unsigned int max_active_zones;
- int node;
- struct mutex debugfs_mutex;
- struct blk_trace *blk_trace;
- 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 throtl_data *td;
- struct callback_head callback_head;
- wait_queue_head_t mq_freeze_wq;
- struct mutex mq_freeze_lock;
- int quiesce_depth;
- 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;
- u64 write_hints[5];
- struct blk_independent_access_ranges *ia_ranges;
-};
-
-enum uprobe_task_state {
- UTASK_RUNNING = 0,
- UTASK_SSTEP = 1,
- UTASK_SSTEP_ACK = 2,
- UTASK_SSTEP_TRAPPED = 3,
-};
-
-struct arch_uprobe_task {};
-
-struct uprobe;
-
-struct return_instance;
-
-struct uprobe_task {
- enum uprobe_task_state state;
- union {
- struct {
- struct arch_uprobe_task autask;
- long unsigned int vaddr;
- };
- struct {
- struct callback_head dup_xol_work;
- long unsigned int dup_xol_addr;
- };
- };
- struct uprobe *active_uprobe;
- long unsigned int xol_vaddr;
- struct return_instance *return_instances;
- unsigned int depth;
-};
-
-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 bpf_run_ctx {};
-
-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;
- u64 mnt_id;
-};
-
-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 u32 errseq_t;
-
-struct address_space_operations;
-
-struct address_space {
- struct inode *host;
- struct xarray i_pages;
- struct rw_semaphore invalidate_lock;
- 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 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 {
- 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 memory_type {
- MEMORY_DEVICE_PRIVATE = 1,
- MEMORY_DEVICE_FS_DAX = 2,
- MEMORY_DEVICE_GENERIC = 3,
- MEMORY_DEVICE_PCI_P2PDMA = 4,
-};
-
-struct range {
- u64 start;
- u64 end;
-};
-
-struct dev_pagemap_ops;
-
-struct dev_pagemap {
- struct vmem_altmap altmap;
- 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;
- void *owner;
- int nr_range;
- union {
- struct range range;
- struct range ranges[0];
- };
-};
-
-struct folio {
- union {
- struct {
- long unsigned int flags;
- struct list_head lru;
- struct address_space *mapping;
- long unsigned int index;
- void *private;
- atomic_t _mapcount;
- atomic_t _refcount;
- long unsigned int memcg_data;
- };
- struct page page;
- };
-};
-
-struct vfsmount;
-
-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,
-};
-
-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 {
- 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 hlist_head *f_ep;
- struct address_space *f_mapping;
- errseq_t f_wb_err;
- errseq_t f_sb_err;
-};
-
-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;
-};
-
-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 (*may_split)(struct vm_area_struct *, long unsigned int);
- int (*mremap)(struct vm_area_struct *);
- int (*mprotect)(struct vm_area_struct *, long unsigned int, long unsigned int, long unsigned int);
- vm_fault_t (*fault)(struct vm_fault *);
- vm_fault_t (*huge_fault)(struct vm_fault *, enum page_entry_size);
- vm_fault_t (*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 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;
-};
-
-enum fault_flag {
- FAULT_FLAG_WRITE = 1,
- FAULT_FLAG_MKWRITE = 2,
- FAULT_FLAG_ALLOW_RETRY = 4,
- FAULT_FLAG_RETRY_NOWAIT = 8,
- FAULT_FLAG_KILLABLE = 16,
- FAULT_FLAG_TRIED = 32,
- FAULT_FLAG_USER = 64,
- FAULT_FLAG_REMOTE = 128,
- FAULT_FLAG_INSTRUCTION = 256,
- FAULT_FLAG_INTERRUPTIBLE = 512,
-};
-
-struct vm_fault {
- const struct {
- struct vm_area_struct *vma;
- gfp_t gfp_mask;
- long unsigned int pgoff;
- long unsigned int address;
- };
- enum fault_flag flags;
- pmd_t *pmd;
- pud_t *pud;
- union {
- pte_t orig_pte;
- pmd_t orig_pmd;
- };
- struct page *cow_page;
- struct page *page;
- pte_t *pte;
- spinlock_t *ptl;
- pgtable_t prealloc_pte;
-};
-
-struct free_area {
- struct list_head free_list[6];
- long unsigned int nr_free;
-};
-
-struct zone_padding {
- char x[0];
-};
-
-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_B = 5,
- NR_SLAB_UNRECLAIMABLE_B = 6,
- NR_ISOLATED_ANON = 7,
- NR_ISOLATED_FILE = 8,
- WORKINGSET_NODES = 9,
- WORKINGSET_REFAULT_BASE = 10,
- WORKINGSET_REFAULT_ANON = 10,
- WORKINGSET_REFAULT_FILE = 11,
- WORKINGSET_ACTIVATE_BASE = 12,
- WORKINGSET_ACTIVATE_ANON = 12,
- WORKINGSET_ACTIVATE_FILE = 13,
- WORKINGSET_RESTORE_BASE = 14,
- WORKINGSET_RESTORE_ANON = 14,
- WORKINGSET_RESTORE_FILE = 15,
- WORKINGSET_NODERECLAIM = 16,
- NR_ANON_MAPPED = 17,
- NR_FILE_MAPPED = 18,
- NR_FILE_PAGES = 19,
- NR_FILE_DIRTY = 20,
- NR_WRITEBACK = 21,
- NR_WRITEBACK_TEMP = 22,
- NR_SHMEM = 23,
- NR_SHMEM_THPS = 24,
- NR_SHMEM_PMDMAPPED = 25,
- NR_FILE_THPS = 26,
- NR_FILE_PMDMAPPED = 27,
- NR_ANON_THPS = 28,
- NR_VMSCAN_WRITE = 29,
- NR_VMSCAN_IMMEDIATE = 30,
- NR_DIRTIED = 31,
- NR_WRITTEN = 32,
- NR_THROTTLED_WRITTEN = 33,
- NR_KERNEL_MISC_RECLAIMABLE = 34,
- NR_FOLL_PIN_ACQUIRED = 35,
- NR_FOLL_PIN_RELEASED = 36,
- NR_KERNEL_STACK_KB = 37,
- NR_PAGETABLE = 38,
- NR_SWAPCACHE = 39,
- NR_VM_NODE_STAT_ITEMS = 40,
-};
-
-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 pglist_data;
-
-struct lruvec {
- struct list_head lists[5];
- spinlock_t lru_lock;
- long unsigned int anon_cost;
- long unsigned int file_cost;
- atomic_long_t nonresident_age;
- long unsigned int refaults[2];
- long unsigned int flags;
- struct pglist_data *pgdat;
-};
-
-struct per_cpu_pages;
-
-struct per_cpu_zonestat;
-
-struct zone {
- long unsigned int _watermark[3];
- long unsigned int watermark_boost;
- long unsigned int nr_reserved_highatomic;
- long int lowmem_reserve[5];
- int node;
- struct pglist_data *zone_pgdat;
- struct per_cpu_pages *per_cpu_pageset;
- struct per_cpu_zonestat *per_cpu_zonestats;
- int pageset_high;
- int pageset_batch;
- long unsigned int zone_start_pfn;
- atomic_long_t managed_pages;
- long unsigned int spanned_pages;
- long unsigned int present_pages;
- long unsigned int present_early_pages;
- long unsigned int cma_pages;
- const char *name;
- long unsigned int nr_isolate_pageblock;
- seqlock_t span_seqlock;
- int initialized;
- long: 32;
- 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;
- long: 64;
- 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[11];
- atomic_long_t vm_numa_event[6];
- long: 64;
- 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[321];
-};
-
-enum zone_type {
- ZONE_DMA = 0,
- ZONE_DMA32 = 1,
- ZONE_NORMAL = 2,
- ZONE_MOVABLE = 3,
- ZONE_DEVICE = 4,
- __MAX_NR_ZONES = 5,
-};
-
-struct per_cpu_nodestat;
-
-struct pglist_data {
- struct zone node_zones[5];
- struct zonelist node_zonelists[2];
- int nr_zones;
- spinlock_t node_size_lock;
- 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;
- wait_queue_head_t reclaim_wait[4];
- atomic_t nr_writeback_throttled;
- long unsigned int nr_reclaim_start;
- struct task_struct *kswapd;
- int kswapd_order;
- enum zone_type kswapd_highest_zoneidx;
- int kswapd_failures;
- int kcompactd_max_order;
- enum zone_type kcompactd_highest_zoneidx;
- wait_queue_head_t kcompactd_wait;
- struct task_struct *kcompactd;
- bool proactive_compact_trigger;
- 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;
- long: 64;
- struct zone_padding _pad1_;
- struct deferred_split deferred_split_queue;
- struct lruvec __lruvec;
- long unsigned int flags;
- long: 64;
- struct zone_padding _pad2_;
- struct per_cpu_nodestat *per_cpu_nodestats;
- atomic_long_t vm_stat[40];
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
-};
-
-typedef unsigned int isolate_mode_t;
-
-struct per_cpu_pages {
- int count;
- int high;
- int batch;
- short int free_factor;
- short int expire;
- struct list_head lists[15];
-};
-
-struct per_cpu_zonestat {
- s8 vm_stat_diff[11];
- s8 stat_threshold;
- long unsigned int vm_numa_event[6];
-};
-
-struct per_cpu_nodestat {
- s8 stat_threshold;
- s8 vm_node_stat_diff[40];
-};
-
-typedef struct pglist_data pg_data_t;
-
-struct rcu_segcblist {
- struct callback_head *head;
- struct callback_head **tails[4];
- long unsigned int gp_seq[4];
- long int len;
- long int seglen[4];
- u8 flags;
-};
-
-struct srcu_node;
-
-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;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- 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[17];
- 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 lockdep_map dep_map;
-};
-
-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 ctl_table_poll {
- atomic_t event;
- wait_queue_head_t wait;
-};
-
-struct ctl_node {
- struct rb_node node;
- struct ctl_table_header *header;
-};
-
-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 *);
-};
-
-typedef __u64 Elf64_Addr;
-
-typedef __u16 Elf64_Half;
-
-typedef __u32 Elf64_Word;
-
-typedef __u64 Elf64_Xword;
-
-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 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 dentry {
- unsigned int d_flags;
- seqcount_spinlock_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 cdev;
-
-struct fsnotify_mark_connector;
-
-struct fscrypt_info;
-
-struct fsverity_info;
-
-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 bdi_writeback *i_wb;
- int i_wb_frn_winner;
- u16 i_wb_frn_avg_time;
- u16 i_wb_frn_history;
- 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;
- atomic64_t i_sequence;
- 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 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;
- struct fscrypt_info *i_crypt_info;
- struct fsverity_info *i_verity_info;
- 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 percpu_rw_semaphore {
- struct rcu_sync rss;
- unsigned int *read_count;
- struct rcuwait writer;
- wait_queue_head_t waiters;
- atomic_t 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 shrink_control;
-
-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;
- int id;
- atomic_long_t *nr_deferred;
-};
-
-struct list_lru_node;
-
-struct list_lru {
- struct list_lru_node *node;
- struct list_head list;
- int shrinker_id;
- bool memcg_aware;
-};
-
-struct super_operations;
-
-struct dquot_operations;
-
-struct quotactl_ops;
-
-struct export_operations;
-
-struct xattr_handler;
-
-struct fscrypt_operations;
-
-struct fsverity_operations;
-
-struct unicode_map;
-
-struct block_device;
-
-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;
- const struct fscrypt_operations *s_cop;
- struct key *s_master_keys;
- const struct fsverity_operations *s_vop;
- struct unicode_map *s_encoding;
- __u16 s_encoding_flags;
- 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_connectors;
- int s_readonly_remount;
- errseq_t s_wb_err;
- 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;
- int: 32;
- 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 vfsmount {
- struct dentry *mnt_root;
- struct super_block *mnt_sb;
- int mnt_flags;
- struct user_namespace *mnt_userns;
-};
-
-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 list_lru_one {
- struct list_head list;
- long int nr_items;
-};
-
-struct list_lru_memcg {
- struct callback_head rcu;
- struct list_lru_one *lru[0];
-};
-
-struct list_lru_node {
- spinlock_t lock;
- struct list_lru_one lru;
- struct list_lru_memcg *memcg_lrus;
- long int nr_items;
- long: 64;
- long: 64;
-};
-
-enum migrate_mode {
- MIGRATE_ASYNC = 0,
- MIGRATE_SYNC_LIGHT = 1,
- MIGRATE_SYNC = 2,
- MIGRATE_SYNC_NO_COPY = 3,
-};
-
-struct exception_table_entry {
- int insn;
- int fixup;
- short int type;
- short int data;
-};
-
-struct cgroup_base_stat {
- struct task_cputime cputime;
-};
-
-struct psi_group_cpu;
-
-struct psi_group {
- struct mutex avgs_lock;
- struct psi_group_cpu *pcpu;
- u64 avg_total[6];
- u64 avg_last_update;
- u64 avg_next_update;
- struct delayed_work avgs_work;
- u64 total[12];
- long unsigned int avg[18];
- struct task_struct *poll_task;
- struct timer_list poll_timer;
- wait_queue_head_t poll_wait;
- atomic_t poll_wakeup;
- struct mutex trigger_lock;
- struct list_head triggers;
- u32 nr_triggers[6];
- u32 poll_states;
- u64 poll_min_period;
- u64 polling_total[6];
- u64 polling_next_update;
- u64 polling_until;
-};
-
-struct bpf_prog_array;
-
-struct cgroup_bpf {
- struct bpf_prog_array *effective[23];
- struct list_head progs[23];
- u32 flags[23];
- struct list_head storages;
- struct bpf_prog_array *inactive;
- struct percpu_ref refcnt;
- struct work_struct release_work;
-};
-
-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[14];
- struct cgroup_root *root;
- struct list_head cset_links;
- struct list_head e_csets[14];
- 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 key_tag {
- struct callback_head rcu;
- refcount_t usage;
- bool removed;
-};
-
-typedef int (*request_key_actor_t)(struct key *, void *);
-
-struct key_preparsed_payload;
-
-struct key_match_data;
-
-struct kernel_pkey_params;
-
-struct kernel_pkey_query;
-
-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;
-};
-
-typedef int (*key_restrict_link_func_t)(struct key *, const struct key_type *, const union key_payload *, struct key *);
-
-struct key_restriction {
- key_restrict_link_func_t check;
- struct key *key;
- struct key_type *keytype;
-};
-
-struct user_struct {
- refcount_t __count;
- struct percpu_counter epoll_watches;
- long unsigned int unix_inflight;
- atomic_long_t pipe_bufs;
- struct hlist_node uidhash_node;
- kuid_t uid;
- atomic_long_t locked_vm;
- atomic_t nr_watches;
- struct ratelimit_state ratelimit;
-};
-
-struct group_info {
- atomic_t usage;
- int ngroups;
- kgid_t gid[0];
-};
-
-struct core_thread {
- struct task_struct *task;
- struct core_thread *next;
-};
-
-struct core_state {
- atomic_t nr_threads;
- struct core_thread dumper;
- struct completion startup;
-};
-
-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;
- __u64 ac_btime64;
-};
-
-struct delayed_call {
- void (*fn)(void *);
- void *arg;
-};
-
-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 wait_page_queue;
-
-struct kiocb {
- struct file *ki_filp;
- loff_t ki_pos;
- void (*ki_complete)(struct kiocb *, long int);
- void *private;
- int ki_flags;
- u16 ki_hint;
- u16 ki_ioprio;
- struct wait_page_queue *ki_waitq;
-};
-
-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;
-};
-
-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 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 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 wait_page_queue {
- struct folio *folio;
- int bit_nr;
- wait_queue_entry_t wait;
-};
-
-struct writeback_control;
-
-struct readahead_control;
-
-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);
- void (*readahead)(struct readahead_control *);
- 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 *);
-};
-
-enum writeback_sync_modes {
- WB_SYNC_NONE = 0,
- WB_SYNC_ALL = 1,
-};
-
-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 bdi_writeback *wb;
- struct inode *inode;
- int wb_id;
- int wb_lcand_id;
- int wb_tcand_id;
- size_t wb_bytes;
- size_t wb_lcand_bytes;
- size_t wb_tcand_bytes;
-};
-
-struct readahead_control {
- struct file *file;
- struct address_space *mapping;
- struct file_ra_state *ra;
- long unsigned int _index;
- unsigned int _nr_pages;
- unsigned int _batch_count;
-};
-
-struct iovec;
-
-struct kvec;
-
-struct bio_vec;
-
-struct iov_iter {
- u8 iter_type;
- bool nofault;
- bool data_source;
- size_t iov_offset;
- size_t count;
- union {
- const struct iovec *iov;
- const struct kvec *kvec;
- const struct bio_vec *bvec;
- struct xarray *xarray;
- struct pipe_inode_info *pipe;
- };
- union {
- long unsigned int nr_segs;
- struct {
- unsigned int head;
- unsigned int start_head;
- };
- loff_t xarray_start;
- };
-};
-
-struct swap_cluster_info {
- spinlock_t lock;
- unsigned int data: 24;
- unsigned int flags: 8;
-};
-
-struct swap_cluster_list {
- struct swap_cluster_info head;
- struct swap_cluster_info tail;
-};
-
-struct percpu_cluster;
-
-struct swap_info_struct {
- struct percpu_ref users;
- 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;
- unsigned int *cluster_next_cpu;
- struct percpu_cluster *percpu_cluster;
- struct rb_root swap_extent_root;
- struct block_device *bdev;
- struct file *swap_file;
- unsigned int old_block_size;
- struct completion comp;
- long unsigned int *frontswap_map;
- atomic_t frontswap_pages;
- 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 cdev {
- struct kobject kobj;
- struct module *owner;
- const struct file_operations *ops;
- struct list_head list;
- dev_t dev;
- unsigned int count;
-};
-
-struct fiemap_extent_info;
-
-struct fileattr;
-
-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 user_namespace *, struct inode *, int);
- struct posix_acl * (*get_acl)(struct inode *, int, bool);
- int (*readlink)(struct dentry *, char *, int);
- int (*create)(struct user_namespace *, struct inode *, struct dentry *, umode_t, bool);
- int (*link)(struct dentry *, struct inode *, struct dentry *);
- int (*unlink)(struct inode *, struct dentry *);
- int (*symlink)(struct user_namespace *, struct inode *, struct dentry *, const char *);
- int (*mkdir)(struct user_namespace *, struct inode *, struct dentry *, umode_t);
- int (*rmdir)(struct inode *, struct dentry *);
- int (*mknod)(struct user_namespace *, struct inode *, struct dentry *, umode_t, dev_t);
- int (*rename)(struct user_namespace *, struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int);
- int (*setattr)(struct user_namespace *, struct dentry *, struct iattr *);
- int (*getattr)(struct user_namespace *, 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 user_namespace *, struct inode *, struct dentry *, umode_t);
- int (*set_acl)(struct user_namespace *, struct inode *, struct posix_acl *, int);
- int (*fileattr_set)(struct user_namespace *, struct dentry *, struct fileattr *);
- int (*fileattr_get)(struct dentry *, struct fileattr *);
- 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 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 **);
- bool (*lm_breaker_owns_lease)(struct file_lock *);
-};
-
-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 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 *);
- 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 fid;
-
-struct export_operations {
- int (*encode_fh)(struct inode *, __u32 *, int *, struct inode *);
- struct dentry * (*fh_to_dentry)(struct super_block *, struct fid *, int, int);
- struct dentry * (*fh_to_parent)(struct super_block *, struct fid *, int, int);
- int (*get_name)(struct dentry *, char *, struct dentry *);
- struct dentry * (*get_parent)(struct dentry *);
- int (*commit_metadata)(struct inode *);
- int (*get_uuid)(struct super_block *, u8 *, u32 *, u64 *);
- int (*map_blocks)(struct inode *, loff_t, u64, struct iomap *, bool, u32 *);
- int (*commit_blocks)(struct inode *, struct iomap *, int, struct iattr *);
- u64 (*fetch_iversion)(struct inode *);
- long unsigned int flags;
-};
-
-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 user_namespace *, struct dentry *, struct inode *, const char *, const void *, size_t, int);
-};
-
-union fscrypt_policy;
-
-struct fscrypt_operations {
- unsigned int flags;
- const char *key_prefix;
- int (*get_context)(struct inode *, void *, size_t);
- int (*set_context)(struct inode *, const void *, size_t, void *);
- const union fscrypt_policy * (*get_dummy_policy)(struct super_block *);
- bool (*empty_dir)(struct inode *);
- bool (*has_stable_inodes)(struct super_block *);
- void (*get_ino_and_lblk_bits)(struct super_block *, int *, int *);
- int (*get_num_devices)(struct super_block *);
- void (*get_devices)(struct super_block *, struct request_queue **);
-};
-
-struct fsverity_operations {
- int (*begin_enable_verity)(struct file *);
- int (*end_enable_verity)(struct file *, const void *, size_t, u64);
- int (*get_verity_descriptor)(struct inode *, void *, size_t);
- struct page * (*read_merkle_tree_page)(struct inode *, long unsigned int, long unsigned int);
- int (*write_merkle_tree_block)(struct inode *, const void *, u64, int);
-};
-
-enum dl_dev_state {
- DL_DEV_NO_DRIVER = 0,
- DL_DEV_PROBING = 1,
- DL_DEV_DRIVER_BOUND = 2,
- DL_DEV_UNBINDING = 3,
-};
-
-struct dev_links_info {
- struct list_head suppliers;
- struct list_head consumers;
- struct list_head defer_sync;
- enum dl_dev_state status;
-};
-
-struct pm_message {
- int event;
-};
-
-typedef struct pm_message pm_message_t;
-
-enum rpm_request {
- RPM_REQ_NONE = 0,
- RPM_REQ_IDLE = 1,
- RPM_REQ_SUSPEND = 2,
- RPM_REQ_AUTOSUSPEND = 3,
- RPM_REQ_RESUME = 4,
-};
-
-struct wakeup_source;
-
-struct wake_irq;
-
-struct pm_subsys_data;
-
-struct dev_pm_qos;
-
-struct dev_pm_info {
- pm_message_t power_state;
- unsigned int can_wakeup: 1;
- unsigned int async_suspend: 1;
- bool in_dpm_list: 1;
- bool is_prepared: 1;
- bool is_suspended: 1;
- bool is_noirq_suspended: 1;
- bool is_late_suspended: 1;
- bool no_pm: 1;
- bool early_init: 1;
- bool direct_complete: 1;
- u32 driver_flags;
- spinlock_t lock;
- struct list_head entry;
- struct completion completion;
- struct wakeup_source *wakeup;
- bool wakeup_path: 1;
- bool syscore: 1;
- bool no_pm_callbacks: 1;
- unsigned int must_resume: 1;
- unsigned int may_skip_resume: 1;
- struct hrtimer suspend_timer;
- u64 timer_expires;
- struct work_struct work;
- wait_queue_head_t wait_queue;
- struct wake_irq *wakeirq;
- atomic_t usage_count;
- atomic_t child_count;
- unsigned int disable_depth: 3;
- unsigned int idle_notification: 1;
- unsigned int request_pending: 1;
- unsigned int deferred_resume: 1;
- unsigned int needs_force_resume: 1;
- unsigned int runtime_auto: 1;
- bool ignore_children: 1;
- unsigned int no_callbacks: 1;
- unsigned int irq_safe: 1;
- unsigned int use_autosuspend: 1;
- unsigned int timer_autosuspends: 1;
- unsigned int memalloc_noio: 1;
- unsigned int links_count;
- enum rpm_request request;
- enum rpm_status runtime_status;
- int runtime_error;
- int autosuspend_delay;
- u64 last_busy;
- u64 active_time;
- u64 suspended_time;
- u64 accounting_timestamp;
- struct pm_subsys_data *subsys_data;
- void (*set_latency_tolerance)(struct device *, s32);
- struct dev_pm_qos *qos;
-};
-
-struct dev_archdata {};
-
-enum device_removable {
- DEVICE_REMOVABLE_NOT_SUPPORTED = 0,
- DEVICE_REMOVABLE_UNKNOWN = 1,
- DEVICE_FIXED = 2,
- DEVICE_REMOVABLE = 3,
-};
-
-struct device_private;
-
-struct device_type;
-
-struct bus_type;
-
-struct device_driver;
-
-struct dev_pm_domain;
-
-struct em_perf_domain;
-
-struct irq_domain;
-
-struct dev_pin_info;
-
-struct dma_map_ops;
-
-struct bus_dma_region;
-
-struct device_dma_parameters;
-
-struct dma_coherent_mem;
-
-struct cma;
-
-struct io_tlb_mem;
-
-struct device_node;
-
-struct fwnode_handle;
-
-struct class;
-
-struct attribute_group;
-
-struct iommu_group;
-
-struct dev_iommu;
-
-struct device {
- struct kobject kobj;
- struct device *parent;
- struct device_private *p;
- const char *init_name;
- const struct device_type *type;
- struct bus_type *bus;
- struct device_driver *driver;
- void *platform_data;
- void *driver_data;
- struct mutex mutex;
- struct dev_links_info links;
- struct dev_pm_info power;
- struct dev_pm_domain *pm_domain;
- struct em_perf_domain *em_pd;
- struct irq_domain *msi_domain;
- struct dev_pin_info *pins;
- raw_spinlock_t msi_lock;
- struct list_head msi_list;
- const struct dma_map_ops *dma_ops;
- u64 *dma_mask;
- u64 coherent_dma_mask;
- u64 bus_dma_limit;
- const struct bus_dma_region *dma_range_map;
- struct device_dma_parameters *dma_parms;
- struct list_head dma_pools;
- struct dma_coherent_mem *dma_mem;
- struct cma *cma_area;
- struct io_tlb_mem *dma_io_tlb_mem;
- struct dev_archdata archdata;
- struct device_node *of_node;
- struct fwnode_handle *fwnode;
- int numa_node;
- dev_t devt;
- u32 id;
- spinlock_t devres_lock;
- struct list_head devres_head;
- struct class *class;
- const struct attribute_group **groups;
- void (*release)(struct device *);
- struct iommu_group *iommu_group;
- struct dev_iommu *iommu;
- enum device_removable removable;
- bool offline_disabled: 1;
- bool offline: 1;
- bool of_node_reused: 1;
- bool state_synced: 1;
- bool can_match: 1;
- bool dma_coherent: 1;
-};
-
-struct disk_stats;
-
-struct partition_meta_info;
-
-struct block_device {
- sector_t bd_start_sect;
- sector_t bd_nr_sectors;
- struct disk_stats *bd_stats;
- long unsigned int bd_stamp;
- bool bd_read_only;
- dev_t bd_dev;
- int bd_openers;
- struct inode *bd_inode;
- struct super_block *bd_super;
- void *bd_claiming;
- struct device bd_device;
- void *bd_holder;
- int bd_holders;
- bool bd_write_holder;
- struct kobject *bd_holder_dir;
- u8 bd_partno;
- spinlock_t bd_size_lock;
- struct gendisk *bd_disk;
- struct request_queue *bd_queue;
- int bd_fsfreeze_count;
- struct mutex bd_fsfreeze_mutex;
- struct super_block *bd_fsfreeze_sb;
- struct partition_meta_info *bd_meta_info;
-};
-
-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 io_comp_batch {
- struct request *req_list;
- bool need_ts;
- void (*complete)(struct io_comp_batch *);
-};
-
-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 seq_operations;
-
-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;
- struct mutex lock;
- const struct seq_operations *op;
- int poll_event;
- const struct file *file;
- void *private;
-};
-
-struct fc_log;
-
-struct p_log {
- const char *prefix;
- struct fc_log *log;
-};
-
-enum fs_context_purpose {
- FS_CONTEXT_FOR_MOUNT = 0,
- FS_CONTEXT_FOR_SUBMOUNT = 1,
- FS_CONTEXT_FOR_RECONFIGURE = 2,
-};
-
-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 fs_context_operations;
-
-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 p_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;
- bool oldapi: 1;
-};
-
-struct fs_parameter;
-
-struct fs_parse_result;
-
-typedef int fs_param_type(struct p_log *, const struct fs_parameter_spec *, struct fs_parameter *, struct fs_parse_result *);
-
-struct fs_parameter_spec {
- const char *name;
- fs_param_type *type;
- u8 opt;
- short unsigned int flags;
- const void *data;
-};
-
-struct audit_names;
-
-struct filename {
- const char *name;
- const char *uptr;
- int refcnt;
- struct audit_names *aname;
- const char iname[0];
-};
-
-typedef u8 blk_status_t;
-
-struct bvec_iter {
- sector_t bi_sector;
- unsigned int bi_size;
- unsigned int bi_idx;
- unsigned int bi_bvec_done;
-} __attribute__((packed));
-
-typedef unsigned int blk_qc_t;
-
-typedef void bio_end_io_t(struct bio *);
-
-struct bio_issue {
- u64 value;
-};
-
-struct bio_vec {
- struct page *bv_page;
- unsigned int bv_len;
- unsigned int bv_offset;
-};
-
-struct bio_crypt_ctx;
-
-struct bio_integrity_payload;
-
-struct bio {
- struct bio *bi_next;
- struct block_device *bi_bdev;
- 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;
- atomic_t __bi_remaining;
- struct bvec_iter bi_iter;
- blk_qc_t bi_cookie;
- bio_end_io_t *bi_end_io;
- void *bi_private;
- struct blkcg_gq *bi_blkg;
- struct bio_issue bi_issue;
- u64 bi_iocost_cost;
- struct bio_crypt_ctx *bi_crypt_context;
- union {
- struct bio_integrity_payload *bi_integrity;
- };
- 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 kernfs_root;
-
-struct kernfs_elem_dir {
- long unsigned int subdirs;
- struct rb_root children;
- struct kernfs_root *root;
- long unsigned int rev;
-};
-
-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 kernfs_elem_symlink {
- struct kernfs_node *target_kn;
-};
-
-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;
-};
-
-struct kernfs_iattrs;
-
-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 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 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 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 kobj_ns_type {
- KOBJ_NS_TYPE_NONE = 0,
- KOBJ_NS_TYPE_NET = 1,
- KOBJ_NS_TYPES = 2,
-};
-
-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 *);
-};
-
-struct attribute {
- const char *name;
- umode_t mode;
-};
-
-struct bin_attribute;
-
-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 bin_attribute {
- struct attribute attr;
- size_t size;
- void *private;
- struct address_space * (*f_mapping)();
- 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 sysfs_ops {
- ssize_t (*show)(struct kobject *, struct attribute *, char *);
- ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t);
-};
-
-struct kset_uevent_ops;
-
-struct kset {
- struct list_head list;
- spinlock_t list_lock;
- struct kobject kobj;
- const struct kset_uevent_ops *uevent_ops;
-};
-
-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 kobj_uevent_env {
- char *argv[3];
- char *envp[64];
- int envp_idx;
- char buf[2048];
- int buflen;
-};
-
-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 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 kparam_string;
-
-struct kparam_array;
-
-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 kparam_string {
- unsigned int maxlen;
- char *string;
-};
-
-struct kparam_array {
- unsigned int max;
- unsigned int elemsize;
- unsigned int *num;
- const struct kernel_param_ops *ops;
- void *elem;
-};
-
-struct error_injection_entry {
- long unsigned int addr;
- int etype;
-};
-
-struct tracepoint_func {
- void *func;
- void *data;
- int prio;
-};
-
-struct tracepoint {
- const char *name;
- struct static_key key;
- struct static_call_key *static_call_key;
- void *static_call_tramp;
- void *iterator;
- int (*regfunc)();
- void (*unregfunc)();
- struct tracepoint_func *funcs;
-};
-
-struct bpf_raw_event_map {
- struct tracepoint *tp;
- void *bpf_func;
- u32 num_args;
- u32 writable_size;
- long: 64;
-};
-
-struct plt_entry {
- __le32 adrp;
- __le32 add;
- __le32 br;
-};
-
-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 trace_event_functions;
-
-struct trace_event {
- struct hlist_node node;
- struct list_head list;
- int type;
- struct trace_event_functions *funcs;
-};
-
-struct trace_event_class;
-
-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;
- union {
- void *module;
- atomic_t refcnt;
- };
- 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 *);
-};
-
-struct trace_eval_map {
- const char *system;
- const char *eval_string;
- long unsigned int eval_value;
-};
-
-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 have_execfd: 1;
- unsigned int execfd_creds: 1;
- unsigned int secureexec: 1;
- unsigned int point_of_no_return: 1;
- struct file *executable;
- struct file *interpreter;
- struct file *file;
- struct cred *cred;
- int unsafe;
- unsigned int per_clear;
- int argc;
- int envc;
- const char *filename;
- const char *interp;
- const char *fdpath;
- unsigned int interp_flags;
- int execfd;
- long unsigned int loader;
- long unsigned int exec;
- struct rlimit rlim_stack;
- char buf[256];
-};
-
-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;
- loff_t to_skip;
-};
-
-struct em_perf_state {
- long unsigned int frequency;
- long unsigned int power;
- long unsigned int cost;
- long unsigned int flags;
-};
-
-struct em_perf_domain {
- struct em_perf_state *table;
- int nr_perf_states;
- long unsigned int flags;
- long unsigned int cpus[0];
-};
-
-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_domain_data;
-
-struct pm_subsys_data {
- spinlock_t lock;
- unsigned int refcount;
- unsigned int clock_op_might_sleep;
- struct mutex clock_mutex;
- struct list_head clock_list;
- struct pm_domain_data *domain_data;
-};
-
-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 *);
- void (*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,
-};
-
-typedef u64 dma_addr_t;
-
-enum iommu_dev_features {
- IOMMU_DEV_FEAT_AUX = 0,
- IOMMU_DEV_FEAT_SVA = 1,
- IOMMU_DEV_FEAT_IOPF = 2,
-};
-
-struct iommu_domain;
-
-struct iommu_iotlb_gather;
-
-struct iommu_device;
-
-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);
- int (*map_pages)(struct iommu_domain *, long unsigned int, phys_addr_t, size_t, size_t, int, gfp_t, size_t *);
- size_t (*unmap)(struct iommu_domain *, long unsigned int, size_t, struct iommu_iotlb_gather *);
- size_t (*unmap_pages)(struct iommu_domain *, long unsigned int, size_t, size_t, struct iommu_iotlb_gather *);
- void (*flush_iotlb_all)(struct iommu_domain *);
- void (*iotlb_sync_map)(struct iommu_domain *, long unsigned int, size_t);
- void (*iotlb_sync)(struct iommu_domain *, struct iommu_iotlb_gather *);
- phys_addr_t (*iova_to_phys)(struct iommu_domain *, dma_addr_t);
- struct iommu_device * (*probe_device)(struct device *);
- void (*release_device)(struct device *);
- void (*probe_finalize)(struct device *);
- struct iommu_group * (*device_group)(struct device *);
- int (*enable_nesting)(struct iommu_domain *);
- int (*set_pgtable_quirks)(struct iommu_domain *, long unsigned int);
- 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 (*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 *);
- u32 (*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 *, u32);
- int (*def_domain_type)(struct device *);
- long unsigned int pgsize_bitmap;
- struct module *owner;
-};
-
-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 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 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 device_dma_parameters {
- unsigned int max_segment_size;
- unsigned int min_align_mask;
- long unsigned int segment_boundary_mask;
-};
-
-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,
- DOMAIN_BUS_VMD_MSI = 10,
-};
-
-struct irq_domain_ops;
-
-struct irq_domain_chip_generic;
-
-struct irq_data;
-
-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_size;
- struct xarray revmap_tree;
- struct mutex revmap_mutex;
- struct irq_data *revmap[0];
-};
-
-enum dma_data_direction {
- DMA_BIDIRECTIONAL = 0,
- DMA_TO_DEVICE = 1,
- DMA_FROM_DEVICE = 2,
- DMA_NONE = 3,
-};
-
-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);
- struct page * (*alloc_pages)(struct device *, size_t, dma_addr_t *, enum dma_data_direction, gfp_t);
- void (*free_pages)(struct device *, size_t, struct page *, dma_addr_t, enum dma_data_direction);
- struct sg_table * (*alloc_noncontiguous)(struct device *, size_t, enum dma_data_direction, gfp_t, long unsigned int);
- void (*free_noncontiguous)(struct device *, size_t, struct sg_table *, enum dma_data_direction);
- 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 bus_dma_region {
- phys_addr_t cpu_start;
- dma_addr_t dma_start;
- u64 size;
- u64 offset;
-};
-
-typedef u32 phandle;
-
-struct fwnode_operations;
-
-struct fwnode_handle {
- struct fwnode_handle *secondary;
- const struct fwnode_operations *ops;
- struct device *dev;
- struct list_head suppliers;
- struct list_head consumers;
- u8 flags;
-};
-
-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;
- struct kobject kobj;
- long unsigned int _flags;
- void *data;
-};
-
-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_DEBUG_OBJ_DEAD = 12,
- CPUHP_MM_WRITEBACK_DEAD = 13,
- CPUHP_MM_DEMOTION_DEAD = 14,
- CPUHP_MM_VMSTAT_DEAD = 15,
- CPUHP_SOFTIRQ_DEAD = 16,
- CPUHP_NET_MVNETA_DEAD = 17,
- CPUHP_CPUIDLE_DEAD = 18,
- CPUHP_ARM64_FPSIMD_DEAD = 19,
- CPUHP_ARM_OMAP_WAKE_DEAD = 20,
- CPUHP_IRQ_POLL_DEAD = 21,
- CPUHP_BLOCK_SOFTIRQ_DEAD = 22,
- CPUHP_BIO_DEAD = 23,
- CPUHP_ACPI_CPUDRV_DEAD = 24,
- CPUHP_S390_PFAULT_DEAD = 25,
- CPUHP_BLK_MQ_DEAD = 26,
- CPUHP_FS_BUFF_DEAD = 27,
- CPUHP_PRINTK_DEAD = 28,
- CPUHP_MM_MEMCQ_DEAD = 29,
- CPUHP_XFS_DEAD = 30,
- CPUHP_PERCPU_CNT_DEAD = 31,
- CPUHP_RADIX_DEAD = 32,
- CPUHP_PAGE_ALLOC = 33,
- CPUHP_NET_DEV_DEAD = 34,
- CPUHP_PCI_XGENE_DEAD = 35,
- CPUHP_IOMMU_IOVA_DEAD = 36,
- CPUHP_LUSTRE_CFS_DEAD = 37,
- CPUHP_AP_ARM_CACHE_B15_RAC_DEAD = 38,
- CPUHP_PADATA_DEAD = 39,
- CPUHP_AP_DTPM_CPU_DEAD = 40,
- CPUHP_WORKQUEUE_PREP = 41,
- CPUHP_POWER_NUMA_PREPARE = 42,
- CPUHP_HRTIMERS_PREPARE = 43,
- CPUHP_PROFILE_PREPARE = 44,
- CPUHP_X2APIC_PREPARE = 45,
- CPUHP_SMPCFD_PREPARE = 46,
- CPUHP_RELAY_PREPARE = 47,
- CPUHP_SLAB_PREPARE = 48,
- CPUHP_MD_RAID5_PREPARE = 49,
- CPUHP_RCUTREE_PREP = 50,
- CPUHP_CPUIDLE_COUPLED_PREPARE = 51,
- CPUHP_POWERPC_PMAC_PREPARE = 52,
- CPUHP_POWERPC_MMU_CTX_PREPARE = 53,
- CPUHP_XEN_PREPARE = 54,
- CPUHP_XEN_EVTCHN_PREPARE = 55,
- CPUHP_ARM_SHMOBILE_SCU_PREPARE = 56,
- CPUHP_SH_SH3X_PREPARE = 57,
- CPUHP_NET_FLOW_PREPARE = 58,
- CPUHP_TOPOLOGY_PREPARE = 59,
- CPUHP_NET_IUCV_PREPARE = 60,
- CPUHP_ARM_BL_PREPARE = 61,
- CPUHP_TRACE_RB_PREPARE = 62,
- CPUHP_MM_ZS_PREPARE = 63,
- CPUHP_MM_ZSWP_MEM_PREPARE = 64,
- CPUHP_MM_ZSWP_POOL_PREPARE = 65,
- CPUHP_KVM_PPC_BOOK3S_PREPARE = 66,
- CPUHP_ZCOMP_PREPARE = 67,
- CPUHP_TIMERS_PREPARE = 68,
- CPUHP_MIPS_SOC_PREPARE = 69,
- CPUHP_BP_PREPARE_DYN = 70,
- CPUHP_BP_PREPARE_DYN_END = 90,
- CPUHP_BRINGUP_CPU = 91,
- CPUHP_AP_IDLE_DEAD = 92,
- CPUHP_AP_OFFLINE = 93,
- CPUHP_AP_SCHED_STARTING = 94,
- CPUHP_AP_RCUTREE_DYING = 95,
- CPUHP_AP_CPU_PM_STARTING = 96,
- CPUHP_AP_IRQ_GIC_STARTING = 97,
- CPUHP_AP_IRQ_HIP04_STARTING = 98,
- CPUHP_AP_IRQ_APPLE_AIC_STARTING = 99,
- CPUHP_AP_IRQ_ARMADA_XP_STARTING = 100,
- CPUHP_AP_IRQ_BCM2836_STARTING = 101,
- CPUHP_AP_IRQ_MIPS_GIC_STARTING = 102,
- CPUHP_AP_IRQ_RISCV_STARTING = 103,
- CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING = 104,
- CPUHP_AP_ARM_MVEBU_COHERENCY = 105,
- CPUHP_AP_MICROCODE_LOADER = 106,
- CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING = 107,
- CPUHP_AP_PERF_X86_STARTING = 108,
- CPUHP_AP_PERF_X86_AMD_IBS_STARTING = 109,
- CPUHP_AP_PERF_X86_CQM_STARTING = 110,
- CPUHP_AP_PERF_X86_CSTATE_STARTING = 111,
- CPUHP_AP_PERF_XTENSA_STARTING = 112,
- CPUHP_AP_MIPS_OP_LOONGSON3_STARTING = 113,
- CPUHP_AP_ARM_SDEI_STARTING = 114,
- CPUHP_AP_ARM_VFP_STARTING = 115,
- CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING = 116,
- CPUHP_AP_PERF_ARM_HW_BREAKPOINT_STARTING = 117,
- CPUHP_AP_PERF_ARM_ACPI_STARTING = 118,
- CPUHP_AP_PERF_ARM_STARTING = 119,
- CPUHP_AP_ARM_L2X0_STARTING = 120,
- CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING = 121,
- CPUHP_AP_ARM_ARCH_TIMER_STARTING = 122,
- CPUHP_AP_ARM_GLOBAL_TIMER_STARTING = 123,
- CPUHP_AP_JCORE_TIMER_STARTING = 124,
- CPUHP_AP_ARM_TWD_STARTING = 125,
- CPUHP_AP_QCOM_TIMER_STARTING = 126,
- CPUHP_AP_TEGRA_TIMER_STARTING = 127,
- CPUHP_AP_ARMADA_TIMER_STARTING = 128,
- CPUHP_AP_MARCO_TIMER_STARTING = 129,
- CPUHP_AP_MIPS_GIC_TIMER_STARTING = 130,
- CPUHP_AP_ARC_TIMER_STARTING = 131,
- CPUHP_AP_RISCV_TIMER_STARTING = 132,
- CPUHP_AP_CLINT_TIMER_STARTING = 133,
- CPUHP_AP_CSKY_TIMER_STARTING = 134,
- CPUHP_AP_TI_GP_TIMER_STARTING = 135,
- CPUHP_AP_HYPERV_TIMER_STARTING = 136,
- CPUHP_AP_KVM_STARTING = 137,
- CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING = 138,
- CPUHP_AP_KVM_ARM_VGIC_STARTING = 139,
- CPUHP_AP_KVM_ARM_TIMER_STARTING = 140,
- CPUHP_AP_DUMMY_TIMER_STARTING = 141,
- CPUHP_AP_ARM_XEN_STARTING = 142,
- CPUHP_AP_ARM_CORESIGHT_STARTING = 143,
- CPUHP_AP_ARM_CORESIGHT_CTI_STARTING = 144,
- CPUHP_AP_ARM64_ISNDEP_STARTING = 145,
- CPUHP_AP_SMPCFD_DYING = 146,
- CPUHP_AP_X86_TBOOT_DYING = 147,
- CPUHP_AP_ARM_CACHE_B15_RAC_DYING = 148,
- CPUHP_AP_ONLINE = 149,
- CPUHP_TEARDOWN_CPU = 150,
- CPUHP_AP_ONLINE_IDLE = 151,
- CPUHP_AP_SCHED_WAIT_EMPTY = 152,
- CPUHP_AP_SMPBOOT_THREADS = 153,
- CPUHP_AP_X86_VDSO_VMA_ONLINE = 154,
- CPUHP_AP_IRQ_AFFINITY_ONLINE = 155,
- CPUHP_AP_BLK_MQ_ONLINE = 156,
- CPUHP_AP_ARM_MVEBU_SYNC_CLOCKS = 157,
- CPUHP_AP_X86_INTEL_EPB_ONLINE = 158,
- CPUHP_AP_PERF_ONLINE = 159,
- CPUHP_AP_PERF_X86_ONLINE = 160,
- CPUHP_AP_PERF_X86_UNCORE_ONLINE = 161,
- CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE = 162,
- CPUHP_AP_PERF_X86_AMD_POWER_ONLINE = 163,
- CPUHP_AP_PERF_X86_RAPL_ONLINE = 164,
- CPUHP_AP_PERF_X86_CQM_ONLINE = 165,
- CPUHP_AP_PERF_X86_CSTATE_ONLINE = 166,
- CPUHP_AP_PERF_X86_IDXD_ONLINE = 167,
- CPUHP_AP_PERF_S390_CF_ONLINE = 168,
- CPUHP_AP_PERF_S390_SF_ONLINE = 169,
- CPUHP_AP_PERF_ARM_CCI_ONLINE = 170,
- CPUHP_AP_PERF_ARM_CCN_ONLINE = 171,
- CPUHP_AP_PERF_ARM_HISI_DDRC_ONLINE = 172,
- CPUHP_AP_PERF_ARM_HISI_HHA_ONLINE = 173,
- CPUHP_AP_PERF_ARM_HISI_L3_ONLINE = 174,
- CPUHP_AP_PERF_ARM_HISI_PA_ONLINE = 175,
- CPUHP_AP_PERF_ARM_HISI_SLLC_ONLINE = 176,
- CPUHP_AP_PERF_ARM_L2X0_ONLINE = 177,
- CPUHP_AP_PERF_ARM_QCOM_L2_ONLINE = 178,
- CPUHP_AP_PERF_ARM_QCOM_L3_ONLINE = 179,
- CPUHP_AP_PERF_ARM_APM_XGENE_ONLINE = 180,
- CPUHP_AP_PERF_ARM_CAVIUM_TX2_UNCORE_ONLINE = 181,
- CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE = 182,
- CPUHP_AP_PERF_POWERPC_CORE_IMC_ONLINE = 183,
- CPUHP_AP_PERF_POWERPC_THREAD_IMC_ONLINE = 184,
- CPUHP_AP_PERF_POWERPC_TRACE_IMC_ONLINE = 185,
- CPUHP_AP_PERF_POWERPC_HV_24x7_ONLINE = 186,
- CPUHP_AP_PERF_POWERPC_HV_GPCI_ONLINE = 187,
- CPUHP_AP_PERF_CSKY_ONLINE = 188,
- CPUHP_AP_WATCHDOG_ONLINE = 189,
- CPUHP_AP_WORKQUEUE_ONLINE = 190,
- CPUHP_AP_RCUTREE_ONLINE = 191,
- CPUHP_AP_BASE_CACHEINFO_ONLINE = 192,
- CPUHP_AP_ONLINE_DYN = 193,
- CPUHP_AP_ONLINE_DYN_END = 223,
- CPUHP_AP_MM_DEMOTION_ONLINE = 224,
- CPUHP_AP_X86_HPET_ONLINE = 225,
- CPUHP_AP_X86_KVM_CLK_ONLINE = 226,
- CPUHP_AP_ACTIVE = 227,
- CPUHP_ONLINE = 228,
-};
-
-typedef void percpu_ref_func_t(struct percpu_ref *);
-
-struct percpu_ref_data {
- atomic_long_t count;
- percpu_ref_func_t *release;
- percpu_ref_func_t *confirm_switch;
- bool force_atomic: 1;
- bool allow_reinit: 1;
- struct callback_head rcu;
- struct percpu_ref *ref;
-};
-
-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 *);
-};
-
-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,
- PGREUSE = 24,
- PGSTEAL_KSWAPD = 25,
- PGSTEAL_DIRECT = 26,
- PGDEMOTE_KSWAPD = 27,
- PGDEMOTE_DIRECT = 28,
- PGSCAN_KSWAPD = 29,
- PGSCAN_DIRECT = 30,
- PGSCAN_DIRECT_THROTTLE = 31,
- PGSCAN_ANON = 32,
- PGSCAN_FILE = 33,
- PGSTEAL_ANON = 34,
- PGSTEAL_FILE = 35,
- PGSCAN_ZONE_RECLAIM_FAILED = 36,
- PGINODESTEAL = 37,
- SLABS_SCANNED = 38,
- KSWAPD_INODESTEAL = 39,
- KSWAPD_LOW_WMARK_HIT_QUICKLY = 40,
- KSWAPD_HIGH_WMARK_HIT_QUICKLY = 41,
- PAGEOUTRUN = 42,
- PGROTATED = 43,
- DROP_PAGECACHE = 44,
- DROP_SLAB = 45,
- OOM_KILL = 46,
- NUMA_PTE_UPDATES = 47,
- NUMA_HUGE_PTE_UPDATES = 48,
- NUMA_HINT_FAULTS = 49,
- NUMA_HINT_FAULTS_LOCAL = 50,
- NUMA_PAGE_MIGRATE = 51,
- PGMIGRATE_SUCCESS = 52,
- PGMIGRATE_FAIL = 53,
- THP_MIGRATION_SUCCESS = 54,
- THP_MIGRATION_FAIL = 55,
- THP_MIGRATION_SPLIT = 56,
- COMPACTMIGRATE_SCANNED = 57,
- COMPACTFREE_SCANNED = 58,
- COMPACTISOLATED = 59,
- COMPACTSTALL = 60,
- COMPACTFAIL = 61,
- COMPACTSUCCESS = 62,
- KCOMPACTD_WAKE = 63,
- KCOMPACTD_MIGRATE_SCANNED = 64,
- KCOMPACTD_FREE_SCANNED = 65,
- HTLB_BUDDY_PGALLOC = 66,
- HTLB_BUDDY_PGALLOC_FAIL = 67,
- CMA_ALLOC_SUCCESS = 68,
- CMA_ALLOC_FAIL = 69,
- UNEVICTABLE_PGCULLED = 70,
- UNEVICTABLE_PGSCANNED = 71,
- UNEVICTABLE_PGRESCUED = 72,
- UNEVICTABLE_PGMLOCKED = 73,
- UNEVICTABLE_PGMUNLOCKED = 74,
- UNEVICTABLE_PGCLEARED = 75,
- UNEVICTABLE_PGSTRANDED = 76,
- THP_FAULT_ALLOC = 77,
- THP_FAULT_FALLBACK = 78,
- THP_FAULT_FALLBACK_CHARGE = 79,
- THP_COLLAPSE_ALLOC = 80,
- THP_COLLAPSE_ALLOC_FAILED = 81,
- THP_FILE_ALLOC = 82,
- THP_FILE_FALLBACK = 83,
- THP_FILE_FALLBACK_CHARGE = 84,
- THP_FILE_MAPPED = 85,
- THP_SPLIT_PAGE = 86,
- THP_SPLIT_PAGE_FAILED = 87,
- THP_DEFERRED_SPLIT_PAGE = 88,
- THP_SPLIT_PMD = 89,
- THP_ZERO_PAGE_ALLOC = 90,
- THP_ZERO_PAGE_ALLOC_FAILED = 91,
- THP_SWPOUT = 92,
- THP_SWPOUT_FALLBACK = 93,
- BALLOON_INFLATE = 94,
- BALLOON_DEFLATE = 95,
- BALLOON_MIGRATE = 96,
- SWAP_RA = 97,
- SWAP_RA_HIT = 98,
- NR_VM_EVENT_ITEMS = 99,
-};
-
-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 ring_buffer_event {
- u32 type_len: 5;
- u32 time_delta: 27;
- u32 array[0];
-};
-
-struct seq_buf {
- char *buffer;
- size_t size;
- size_t len;
- loff_t readpos;
-};
-
-struct trace_seq {
- char buffer[4096];
- struct seq_buf seq;
- int full;
-};
-
-struct irq_desc;
-
-typedef void (*irq_flow_handler_t)(struct irq_desc *);
-
-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;
- unsigned int ipi_offset;
-};
-
-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 irqaction;
-
-struct irq_affinity_notify;
-
-struct proc_dir_entry;
-
-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;
- 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;
- long: 64;
- long: 64;
-};
-
-enum irqreturn {
- IRQ_NONE = 0,
- IRQ_HANDLED = 1,
- IRQ_WAKE_THREAD = 2,
-};
-
-typedef enum irqreturn irqreturn_t;
-
-struct fwnode_reference_args;
-
-struct fwnode_endpoint;
-
-struct fwnode_operations {
- struct fwnode_handle * (*get)(struct fwnode_handle *);
- void (*put)(struct fwnode_handle *);
- bool (*device_is_available)(const struct fwnode_handle *);
- const void * (*device_get_match_data)(const struct fwnode_handle *, const struct device *);
- bool (*property_present)(const struct fwnode_handle *, const char *);
- int (*property_read_int_array)(const struct fwnode_handle *, const char *, unsigned int, void *, size_t);
- int (*property_read_string_array)(const struct fwnode_handle *, const char *, const char **, size_t);
- const char * (*get_name)(const struct fwnode_handle *);
- const char * (*get_name_prefix)(const struct fwnode_handle *);
- struct fwnode_handle * (*get_parent)(const struct fwnode_handle *);
- struct fwnode_handle * (*get_next_child_node)(const struct fwnode_handle *, struct fwnode_handle *);
- struct fwnode_handle * (*get_named_child_node)(const struct fwnode_handle *, const char *);
- int (*get_reference_args)(const struct fwnode_handle *, const char *, const char *, unsigned int, unsigned int, struct fwnode_reference_args *);
- struct fwnode_handle * (*graph_get_next_endpoint)(const struct fwnode_handle *, struct fwnode_handle *);
- struct fwnode_handle * (*graph_get_remote_endpoint)(const struct fwnode_handle *);
- struct fwnode_handle * (*graph_get_port_parent)(struct fwnode_handle *);
- int (*graph_parse_endpoint)(const struct fwnode_handle *, struct fwnode_endpoint *);
- int (*add_links)(struct fwnode_handle *);
-};
-
-struct fwnode_endpoint {
- unsigned int port;
- unsigned int id;
- const struct fwnode_handle *local_fwnode;
-};
-
-struct fwnode_reference_args {
- struct fwnode_handle *fwnode;
- unsigned int nargs;
- u64 args[8];
-};
-
-enum kmalloc_cache_type {
- KMALLOC_NORMAL = 0,
- KMALLOC_CGROUP = 1,
- KMALLOC_RECLAIM = 2,
- KMALLOC_DMA = 3,
- NR_KMALLOC_TYPES = 4,
-};
-
-enum irqchip_irq_state {
- IRQCHIP_STATE_PENDING = 0,
- IRQCHIP_STATE_ACTIVE = 1,
- IRQCHIP_STATE_MASKED = 2,
- IRQCHIP_STATE_LINE_LEVEL = 3,
-};
-
-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_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;
-};
-
-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 *);
-};
-
-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;
-};
-
-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;
-};
-
-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];
-};
-
-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 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];
-};
-
-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_CGROUP_SWITCHES = 11,
- PERF_COUNT_SW_MAX = 12,
-};
-
-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_blk: 3;
- __u64 mem_hops: 3;
- __u64 mem_rsvd: 18;
- };
-};
-
-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 perf_sample_weight {
- __u64 full;
- struct {
- __u32 var1_dw;
- __u16 var2_w;
- __u16 var3_w;
- };
-};
-
-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 new_utsname name;
- struct user_namespace *user_ns;
- struct ucounts *ucounts;
- struct ns_common ns;
-};
-
-struct cgroup_namespace {
- struct ns_common ns;
- struct user_namespace *user_ns;
- struct ucounts *ucounts;
- struct css_set *root_cset;
-};
-
-struct nsset {
- unsigned int flags;
- struct nsproxy *nsproxy;
- struct fs_struct *fs;
- const struct cred *cred;
-};
-
-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 nsset *, struct ns_common *);
- struct user_namespace * (*owner)(struct ns_common *);
- struct ns_common * (*get_parent)(struct ns_common *);
-};
-
-struct iovec {
- void *iov_base;
- __kernel_size_t iov_len;
-};
-
-struct kvec {
- void *iov_base;
- size_t iov_len;
-};
-
-struct ftrace_regs {
- struct pt_regs regs;
-};
-
-struct perf_regs {
- __u64 abi;
- struct pt_regs *regs;
-};
-
-struct u64_stats_sync {};
-
-struct bpf_cgroup_storage_key {
- __u64 cgroup_inode_id;
- __u32 attach_type;
-};
-
-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_map;
- struct list_head list_cg;
- struct rb_node node;
- struct callback_head rcu;
-};
-
-struct bpf_prog_array_item {
- struct bpf_prog *prog;
- union {
- struct bpf_cgroup_storage *cgroup_storage[2];
- u64 bpf_cookie;
- };
-};
-
-struct bpf_prog_array {
- struct callback_head rcu;
- struct bpf_prog_array_item items[0];
-};
-
-struct bpf_storage_buffer {
- struct callback_head rcu;
- char data[0];
-};
-
-struct psi_group_cpu {
- seqcount_t seq;
- unsigned int tasks[4];
- u32 state_mask;
- u32 times[7];
- u64 state_start;
- u32 times_prev[14];
- long: 64;
-};
-
-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 *, struct css_set *);
- void (*cancel_fork)(struct task_struct *, struct css_set *);
- 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;
- 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;
- __u64 hw_idx;
- 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);
- struct kmem_cache *task_ctx_cache;
- 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 perf_cgroup *cgrp;
- struct list_head cgrp_cpuctx_entry;
- struct list_head sched_cb_entry;
- int sched_cb_usage;
- int online;
- int heap_size;
- struct perf_event **heap;
- struct perf_event *heap_default[2];
-};
-
-struct perf_output_handle {
- struct perf_event *event;
- struct perf_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;
- union perf_sample_weight 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 perf_regs regs_intr;
- u64 stack_user_size;
- u64 phys_addr;
- u64 cgroup;
- u64 data_page_size;
- u64 code_page_size;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
- long: 64;
-};
-
-struct perf_cgroup_info;
-
-struct perf_cgroup {
- struct cgroup_subsys_state css;
- struct perf_cgroup_info *info;
-};
-
-struct perf_cgroup_info {
- u64 time;
- u64 timestamp;
-};
-
-struct trace_entry {
- short unsigned int type;
- unsigned char flags;
- unsigned char preempt_count;
- int pid;
-};
-
-struct trace_array;
-
-struct tracer;
-
-struct array_buffer;
-
-struct ring_buffer_iter;
-
-struct trace_iterator {
- struct trace_array *tr;
- struct tracer *trace;
- struct array_buffer *array_buffer;
- void *private;
- int cpu_file;
- struct mutex mutex;
- struct ring_buffer_iter **buffer_iter;
- long unsigned int iter_flags;
- void *temp;
- unsigned int temp_size;
- char *fmt;
- unsigned int fmt_size;
- 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 trace_event_fields {
- const char *type;
- union {
- struct {
- const char *name;
- const int size;
- const int align;
- const int is_signed;
- const int filter_type;
- };
- int (*define_fields)(struct trace_event_call *);
- };
-};
-
-struct trace_event_class {
- const char *system;
- void *probe;
- void *perf_probe;
- int (*reg)(struct trace_event_call *, enum trace_reg, void *);
- struct trace_event_fields *fields_array;
- struct list_head * (*get_fields)(struct trace_event_call *);
- struct list_head fields;
- int (*raw_init)(struct trace_event_call *);
-};
-
-struct trace_buffer;
-
-struct trace_event_file;
-
-struct trace_event_buffer {
- struct trace_buffer *buffer;
- struct ring_buffer_event *event;
- struct trace_event_file *trace_file;
- void *entry;
- unsigned int trace_ctx;
- struct pt_regs *regs;
-};
-
-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_DYNAMIC_BIT = 5,
- TRACE_EVENT_FL_KPROBE_BIT = 6,
- TRACE_EVENT_FL_UPROBE_BIT = 7,
- TRACE_EVENT_FL_EPROBE_BIT = 8,
-};
-
-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_DYNAMIC = 32,
- TRACE_EVENT_FL_KPROBE = 64,
- TRACE_EVENT_FL_UPROBE = 128,
- TRACE_EVENT_FL_EPROBE = 256,
-};
-
-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,
- ETT_EVENT_EPROBE = 64,
-};
-
-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;
- long unsigned int _flags;
- struct bin_attribute attr;
-};
-
-struct irq_fwspec {
- struct fwnode_handle *fwnode;
- int param_count;
- u32 param[16];
-};
-
-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 xbc_node {
- uint16_t next;
- uint16_t child;
- uint16_t parent;
- uint16_t data;
-};
-
-enum wb_stat_item {
- WB_RECLAIMABLE = 0,
- WB_WRITEBACK = 1,
- WB_DIRTIED = 2,
- WB_WRITTEN = 3,
- NR_WB_STAT_ITEMS = 4,
-};
-
-struct block_device_operations;
-
-struct timer_rand_state;
-
-struct disk_events;
-
-struct cdrom_device_info;
-
-struct badblocks;
-
-struct gendisk {
- int major;
- int first_minor;
- int minors;
- char disk_name[32];
- short unsigned int events;
- short unsigned int event_flags;
- struct xarray part_tbl;
- struct block_device *part0;
- const struct block_device_operations *fops;
- struct request_queue *queue;
- void *private_data;
- int flags;
- long unsigned int state;
- struct mutex open_mutex;
- unsigned int open_partitions;
- struct backing_dev_info *bdi;
- struct kobject *slave_dir;
- struct list_head slave_bdevs;
- struct timer_rand_state *random;
- atomic_t sync_io;
- struct disk_events *ev;
- struct kobject integrity_kobj;
- struct cdrom_device_info *cdi;
- int node_id;
- struct badblocks *bb;
- struct lockdep_map lockdep_map;
- u64 diskseq;
-};
-
-struct partition_meta_info {
- char uuid[37];
- u8 volname[64];
-};
-
-struct bio_integrity_payload {
- struct bio *bip_bio;
- struct bvec_iter bip_iter;
- short unsigned int bip_vcnt;
- short unsigned int bip_max_vcnt;
- short unsigned int bip_flags;
- struct bvec_iter bio_iter;
- short: 16;
- struct work_struct bip_work;
- struct bio_vec *bip_vec;
- struct bio_vec bip_inline_vecs[0];
-} __attribute__((packed));
-
-enum memcg_stat_item {
- MEMCG_SWAP = 40,
- MEMCG_SOCK = 41,
- MEMCG_PERCPU_B = 42,
- MEMCG_NR_STAT = 43,
-};
-
-enum memcg_memory_event {
- MEMCG_LOW = 0,
- MEMCG_HIGH = 1,
- MEMCG_MAX = 2,
- MEMCG_OOM = 3,
- MEMCG_OOM_KILL = 4,
- MEMCG_SWAP_HIGH = 5,
- MEMCG_SWAP_MAX = 6,
- MEMCG_SWAP_FAIL = 7,
- MEMCG_NR_MEMORY_EVENTS = 8,
-};
-
-enum mem_cgroup_events_target {
- MEM_CGROUP_TARGET_THRESH = 0,
- MEM_CGROUP_TARGET_SOFTLIMIT = 1,
- MEM_CGROUP_NTARGETS = 2,
-};
-
-struct memcg_vmstats_percpu {
- long int state[43];
- long unsigned int events[99];
- long int state_prev[43];
- long unsigned int events_prev[99];
- long unsigned int nr_page_events;
- long unsigned int targets[2];
-};
-
-struct mem_cgroup_reclaim_iter {
- struct mem_cgroup *position;
- unsigned int generation;
-};
-
-struct shrinker_info {
- struct callback_head rcu;
- atomic_long_t *nr_deferred;
- long unsigned int *map;
-};
-
-struct lruvec_stats_percpu {
- long int state[40];
- long int state_prev[40];
-};
-
-struct lruvec_stats {
- long int state[40];
- long int state_pending[40];
-};
-
-struct mem_cgroup_per_node {
- struct lruvec lruvec;
- struct lruvec_stats_percpu *lruvec_stats_percpu;
- struct lruvec_stats lruvec_stats;
- long unsigned int lru_zone_size[25];
- struct mem_cgroup_reclaim_iter iter;
- struct shrinker_info *shrinker_info;
- struct rb_node tree_node;
- long unsigned int usage_in_excess;
- bool on_tree;
- struct mem_cgroup *memcg;
-};
-
-struct eventfd_ctx;
-
-struct mem_cgroup_threshold {
- struct eventfd_ctx *eventfd;
- long unsigned int threshold;
-};
-
-struct mem_cgroup_threshold_ary {
- int current_threshold;
- unsigned int size;
- struct mem_cgroup_threshold entries[0];
-};
-
-struct obj_cgroup {
- struct percpu_ref refcnt;
- struct mem_cgroup *memcg;
- atomic_t nr_charged_bytes;
- union {
- struct list_head list;
- struct callback_head rcu;
- };
-};
-
-struct percpu_cluster {
- struct swap_cluster_info index;
- unsigned int next;
-};
-
-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_file = 5,
-};
-
-struct fs_parameter {
- const char *key;
- enum fs_value_type type: 8;
- union {
- char *string;
- void *blob;
- struct filename *name;
- struct file *file;
- };
- size_t size;
- int dirfd;
-};
-
-struct fc_log {
- refcount_t usage;
- u8 head;
- u8 tail;
- u8 need_free;
- struct module *owner;
- char *buffer[8];
-};
-
-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 *);
... 281942 lines suppressed ...