Bug Summary

File:dev/dt/dt_prov_static.c
Warning:line 223, column 22
Assigned value is garbage or undefined

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple amd64-unknown-openbsd7.4 -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name dt_prov_static.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model static -mframe-pointer=all -relaxed-aliasing -ffp-contract=on -fno-rounding-math -mconstructor-aliases -ffreestanding -mcmodel=kernel -target-cpu x86-64 -target-feature +retpoline-indirect-calls -target-feature +retpoline-indirect-branches -target-feature -sse2 -target-feature -sse -target-feature -3dnow -target-feature -mmx -target-feature +save-args -target-feature +retpoline-external-thunk -disable-red-zone -no-implicit-float -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/usr/src/sys/arch/amd64/compile/GENERIC.MP/obj -nostdsysteminc -nobuiltininc -resource-dir /usr/local/llvm16/lib/clang/16 -I /usr/src/sys -I /usr/src/sys/arch/amd64/compile/GENERIC.MP/obj -I /usr/src/sys/arch -I /usr/src/sys/dev/pci/drm/include -I /usr/src/sys/dev/pci/drm/include/uapi -I /usr/src/sys/dev/pci/drm/amd/include/asic_reg -I /usr/src/sys/dev/pci/drm/amd/include -I /usr/src/sys/dev/pci/drm/amd/amdgpu -I /usr/src/sys/dev/pci/drm/amd/display -I /usr/src/sys/dev/pci/drm/amd/display/include -I /usr/src/sys/dev/pci/drm/amd/display/dc -I /usr/src/sys/dev/pci/drm/amd/display/amdgpu_dm -I /usr/src/sys/dev/pci/drm/amd/pm/inc -I /usr/src/sys/dev/pci/drm/amd/pm/legacy-dpm -I /usr/src/sys/dev/pci/drm/amd/pm/swsmu -I /usr/src/sys/dev/pci/drm/amd/pm/swsmu/inc -I /usr/src/sys/dev/pci/drm/amd/pm/swsmu/smu11 -I /usr/src/sys/dev/pci/drm/amd/pm/swsmu/smu12 -I /usr/src/sys/dev/pci/drm/amd/pm/swsmu/smu13 -I /usr/src/sys/dev/pci/drm/amd/pm/powerplay/inc -I /usr/src/sys/dev/pci/drm/amd/pm/powerplay/hwmgr -I /usr/src/sys/dev/pci/drm/amd/pm/powerplay/smumgr -I /usr/src/sys/dev/pci/drm/amd/pm/swsmu/inc -I /usr/src/sys/dev/pci/drm/amd/pm/swsmu/inc/pmfw_if -I /usr/src/sys/dev/pci/drm/amd/display/dc/inc -I /usr/src/sys/dev/pci/drm/amd/display/dc/inc/hw -I /usr/src/sys/dev/pci/drm/amd/display/dc/clk_mgr -I /usr/src/sys/dev/pci/drm/amd/display/modules/inc -I /usr/src/sys/dev/pci/drm/amd/display/modules/hdcp -I /usr/src/sys/dev/pci/drm/amd/display/dmub/inc -I /usr/src/sys/dev/pci/drm/i915 -D DDB -D DIAGNOSTIC -D KTRACE -D ACCOUNTING -D KMEMSTATS -D PTRACE -D POOL_DEBUG -D CRYPTO -D SYSVMSG -D SYSVSEM -D SYSVSHM -D UVM_SWAP_ENCRYPT -D FFS -D FFS2 -D FFS_SOFTUPDATES -D UFS_DIRHASH -D QUOTA -D EXT2FS -D MFS -D NFSCLIENT -D NFSSERVER -D CD9660 -D UDF -D MSDOSFS -D FIFO -D FUSE -D SOCKET_SPLICE -D TCP_ECN -D TCP_SIGNATURE -D INET6 -D IPSEC -D PPP_BSDCOMP -D PPP_DEFLATE -D PIPEX -D MROUTING -D MPLS -D BOOT_CONFIG -D USER_PCICONF -D APERTURE -D MTRR -D NTFS -D SUSPEND -D HIBERNATE -D PCIVERBOSE -D USBVERBOSE -D WSDISPLAY_COMPAT_USL -D WSDISPLAY_COMPAT_RAWKBD -D WSDISPLAY_DEFAULTSCREENS=6 -D X86EMU -D ONEWIREVERBOSE -D MULTIPROCESSOR -D MAXUSERS=80 -D _KERNEL -O2 -Wno-pointer-sign -Wno-address-of-packed-member -Wno-constant-conversion -Wno-unused-but-set-variable -Wno-gnu-folding-constant -fdebug-compilation-dir=/usr/src/sys/arch/amd64/compile/GENERIC.MP/obj -ferror-limit 19 -fwrapv -D_RET_PROTECTOR -ret-protector -fcf-protection=branch -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-valloc -fno-builtin-free -fno-builtin-strdup -fno-builtin-strndup -analyzer-output=html -faddrsig -o /home/ben/Projects/scan/2024-01-11-110808-61670-1 -x c /usr/src/sys/dev/dt/dt_prov_static.c
1/* $OpenBSD: dt_prov_static.c,v 1.22 2023/08/28 14:50:01 bluhm Exp $ */
2
3/*
4 * Copyright (c) 2019 Martin Pieuchot <mpi@openbsd.org>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19#include <sys/types.h>
20#include <sys/systm.h>
21#include <sys/param.h>
22#include <sys/tracepoint.h>
23
24#include <dev/dt/dtvar.h>
25
26int dt_prov_static_alloc(struct dt_probe *, struct dt_softc *,
27 struct dt_pcb_list *, struct dtioc_req *);
28int dt_prov_static_hook(struct dt_provider *, ...);
29
30struct dt_provider dt_prov_static = {
31 .dtpv_name = "tracepoint",
32 .dtpv_alloc = dt_prov_static_alloc,
33 .dtpv_enter = dt_prov_static_hook,
34 .dtpv_dealloc = NULL((void *)0),
35};
36
37/*
38 * Scheduler
39 */
40DT_STATIC_PROBE2(sched, dequeue, "pid_t", "pid_t")struct dt_probe (dt_static_sched_dequeue) = { .dtp_next = { (
(void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "sched", .dtp_name = "dequeue", .dtp_pbn = 0, .
dtp_sysnum = 0, .dtp_argtype = { "pid_t", "pid_t", ((void *)0
), ((void *)0), ((void *)0) }, .dtp_nargs = 2, }
;
41DT_STATIC_PROBE2(sched, enqueue, "pid_t", "pid_t")struct dt_probe (dt_static_sched_enqueue) = { .dtp_next = { (
(void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "sched", .dtp_name = "enqueue", .dtp_pbn = 0, .
dtp_sysnum = 0, .dtp_argtype = { "pid_t", "pid_t", ((void *)0
), ((void *)0), ((void *)0) }, .dtp_nargs = 2, }
;
42DT_STATIC_PROBE3(sched, fork, "pid_t", "pid_t", "int")struct dt_probe (dt_static_sched_fork) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "sched", .dtp_name = "fork", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "pid_t", "pid_t", "int", ((void *)0), (
(void *)0) }, .dtp_nargs = 3, }
;
43DT_STATIC_PROBE2(sched, off__cpu, "pid_t", "pid_t")struct dt_probe (dt_static_sched_off__cpu) = { .dtp_next = { (
(void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "sched", .dtp_name = "off__cpu", .dtp_pbn = 0, .
dtp_sysnum = 0, .dtp_argtype = { "pid_t", "pid_t", ((void *)0
), ((void *)0), ((void *)0) }, .dtp_nargs = 2, }
;
44DT_STATIC_PROBE0(sched, on__cpu)struct dt_probe (dt_static_sched_on__cpu) = { .dtp_next = { (
(void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "sched", .dtp_name = "on__cpu", .dtp_pbn = 0, .
dtp_sysnum = 0, .dtp_argtype = { ((void *)0), ((void *)0), ((
void *)0), ((void *)0), ((void *)0) }, .dtp_nargs = 0, }
;
45DT_STATIC_PROBE0(sched, remain__cpu)struct dt_probe (dt_static_sched_remain__cpu) = { .dtp_next =
{ ((void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &
dt_prov_static, .dtp_func = "sched", .dtp_name = "remain__cpu"
, .dtp_pbn = 0, .dtp_sysnum = 0, .dtp_argtype = { ((void *)0)
, ((void *)0), ((void *)0), ((void *)0), ((void *)0) }, .dtp_nargs
= 0, }
;
46DT_STATIC_PROBE0(sched, sleep)struct dt_probe (dt_static_sched_sleep) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "sched", .dtp_name = "sleep", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { ((void *)0), ((void *)0), ((void *)0),
((void *)0), ((void *)0) }, .dtp_nargs = 0, }
;
47DT_STATIC_PROBE3(sched, steal, "pid_t", "pid_t", "int")struct dt_probe (dt_static_sched_steal) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "sched", .dtp_name = "steal", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "pid_t", "pid_t", "int", ((void *)0), (
(void *)0) }, .dtp_nargs = 3, }
;
48DT_STATIC_PROBE2(sched, unsleep, "pid_t", "pid_t")struct dt_probe (dt_static_sched_unsleep) = { .dtp_next = { (
(void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "sched", .dtp_name = "unsleep", .dtp_pbn = 0, .
dtp_sysnum = 0, .dtp_argtype = { "pid_t", "pid_t", ((void *)0
), ((void *)0), ((void *)0) }, .dtp_nargs = 2, }
;
49DT_STATIC_PROBE3(sched, wakeup, "pid_t", "pid_t", "int")struct dt_probe (dt_static_sched_wakeup) = { .dtp_next = { ((
void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "sched", .dtp_name = "wakeup", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "pid_t", "pid_t", "int", ((void *)0), (
(void *)0) }, .dtp_nargs = 3, }
;
50
51/*
52 * Raw syscalls
53 */
54DT_STATIC_PROBE1(raw_syscalls, sys_enter, "register_t")struct dt_probe (dt_static_raw_syscalls_sys_enter) = { .dtp_next
= { ((void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &
dt_prov_static, .dtp_func = "raw_syscalls", .dtp_name = "sys_enter"
, .dtp_pbn = 0, .dtp_sysnum = 0, .dtp_argtype = { "register_t"
, ((void *)0), ((void *)0), ((void *)0), ((void *)0) }, .dtp_nargs
= 1, }
;
55DT_STATIC_PROBE1(raw_syscalls, sys_exit, "register_t")struct dt_probe (dt_static_raw_syscalls_sys_exit) = { .dtp_next
= { ((void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &
dt_prov_static, .dtp_func = "raw_syscalls", .dtp_name = "sys_exit"
, .dtp_pbn = 0, .dtp_sysnum = 0, .dtp_argtype = { "register_t"
, ((void *)0), ((void *)0), ((void *)0), ((void *)0) }, .dtp_nargs
= 1, }
;
56
57/*
58 * UVM
59 */
60DT_STATIC_PROBE3(uvm, fault, "vaddr_t", "vm_fault_t", "vm_prot_t")struct dt_probe (dt_static_uvm_fault) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "uvm", .dtp_name = "fault", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "vaddr_t", "vm_fault_t", "vm_prot_t", (
(void *)0), ((void *)0) }, .dtp_nargs = 3, }
;
61DT_STATIC_PROBE3(uvm, map_insert, "vaddr_t", "vaddr_t", "vm_prot_t")struct dt_probe (dt_static_uvm_map_insert) = { .dtp_next = { (
(void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "uvm", .dtp_name = "map_insert", .dtp_pbn = 0, .
dtp_sysnum = 0, .dtp_argtype = { "vaddr_t", "vaddr_t", "vm_prot_t"
, ((void *)0), ((void *)0) }, .dtp_nargs = 3, }
;
62DT_STATIC_PROBE3(uvm, map_remove, "vaddr_t", "vaddr_t", "vm_prot_t")struct dt_probe (dt_static_uvm_map_remove) = { .dtp_next = { (
(void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "uvm", .dtp_name = "map_remove", .dtp_pbn = 0, .
dtp_sysnum = 0, .dtp_argtype = { "vaddr_t", "vaddr_t", "vm_prot_t"
, ((void *)0), ((void *)0) }, .dtp_nargs = 3, }
;
63DT_STATIC_PROBE4(uvm, malloc, "int", "void *", "size_t", "int")struct dt_probe (dt_static_uvm_malloc) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "uvm", .dtp_name = "malloc", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "int", "void *", "size_t", "int", ((void
*)0) }, .dtp_nargs = 4, }
;
64DT_STATIC_PROBE3(uvm, free, "int", "void *", "size_t")struct dt_probe (dt_static_uvm_free) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "uvm", .dtp_name = "free", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "int", "void *", "size_t", ((void *)0)
, ((void *)0) }, .dtp_nargs = 3, }
;
65DT_STATIC_PROBE3(uvm, pool_get, "void *", "void *", "int")struct dt_probe (dt_static_uvm_pool_get) = { .dtp_next = { ((
void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "uvm", .dtp_name = "pool_get", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "void *", "void *", "int", ((void *)0)
, ((void *)0) }, .dtp_nargs = 3, }
;
66DT_STATIC_PROBE2(uvm, pool_put, "void *", "void *")struct dt_probe (dt_static_uvm_pool_put) = { .dtp_next = { ((
void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "uvm", .dtp_name = "pool_put", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "void *", "void *", ((void *)0), ((void
*)0), ((void *)0) }, .dtp_nargs = 2, }
;
67
68/*
69 * VFS
70 */
71DT_STATIC_PROBE3(vfs, bufcache_rel, "long", "int", "int64_t")struct dt_probe (dt_static_vfs_bufcache_rel) = { .dtp_next = {
((void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &
dt_prov_static, .dtp_func = "vfs", .dtp_name = "bufcache_rel"
, .dtp_pbn = 0, .dtp_sysnum = 0, .dtp_argtype = { "long", "int"
, "int64_t", ((void *)0), ((void *)0) }, .dtp_nargs = 3, }
;
72DT_STATIC_PROBE3(vfs, bufcache_take, "long", "int", "int64_t")struct dt_probe (dt_static_vfs_bufcache_take) = { .dtp_next =
{ ((void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &
dt_prov_static, .dtp_func = "vfs", .dtp_name = "bufcache_take"
, .dtp_pbn = 0, .dtp_sysnum = 0, .dtp_argtype = { "long", "int"
, "int64_t", ((void *)0), ((void *)0) }, .dtp_nargs = 3, }
;
73DT_STATIC_PROBE4(vfs, cleaner, "long", "int", "long", "long")struct dt_probe (dt_static_vfs_cleaner) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "vfs", .dtp_name = "cleaner", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "long", "int", "long", "long", ((void *
)0) }, .dtp_nargs = 4, }
;
74
75#ifdef __amd64__1
76/*
77 * VMM
78 */
79DT_STATIC_PROBE2(vmm, guest_enter, "void *", "void *")struct dt_probe (dt_static_vmm_guest_enter) = { .dtp_next = {
((void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &
dt_prov_static, .dtp_func = "vmm", .dtp_name = "guest_enter",
.dtp_pbn = 0, .dtp_sysnum = 0, .dtp_argtype = { "void *", "void *"
, ((void *)0), ((void *)0), ((void *)0) }, .dtp_nargs = 2, }
;
80DT_STATIC_PROBE3(vmm, guest_exit, "void *", "void *", "uint64_t")struct dt_probe (dt_static_vmm_guest_exit) = { .dtp_next = { (
(void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "vmm", .dtp_name = "guest_exit", .dtp_pbn = 0, .
dtp_sysnum = 0, .dtp_argtype = { "void *", "void *", "uint64_t"
, ((void *)0), ((void *)0) }, .dtp_nargs = 3, }
;
81DT_STATIC_PROBE4(vmm, inout, "void *", "uint16_t", "uint8_t", "uint32_t")struct dt_probe (dt_static_vmm_inout) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "vmm", .dtp_name = "inout", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "void *", "uint16_t", "uint8_t", "uint32_t"
, ((void *)0) }, .dtp_nargs = 4, }
;
82#endif /* __amd64__ */
83
84/*
85 * SMR
86 */
87DT_STATIC_PROBE3(smr, call, "void *", "void *", "int")struct dt_probe (dt_static_smr_call) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "smr", .dtp_name = "call", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "void *", "void *", "int", ((void *)0)
, ((void *)0) }, .dtp_nargs = 3, }
;
88DT_STATIC_PROBE2(smr, called, "void *", "void *")struct dt_probe (dt_static_smr_called) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "smr", .dtp_name = "called", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "void *", "void *", ((void *)0), ((void
*)0), ((void *)0) }, .dtp_nargs = 2, }
;
89DT_STATIC_PROBE1(smr, barrier_enter, "int")struct dt_probe (dt_static_smr_barrier_enter) = { .dtp_next =
{ ((void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &
dt_prov_static, .dtp_func = "smr", .dtp_name = "barrier_enter"
, .dtp_pbn = 0, .dtp_sysnum = 0, .dtp_argtype = { "int", ((void
*)0), ((void *)0), ((void *)0), ((void *)0) }, .dtp_nargs = 1
, }
;
90DT_STATIC_PROBE1(smr, barrier_exit, "int")struct dt_probe (dt_static_smr_barrier_exit) = { .dtp_next = {
((void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &
dt_prov_static, .dtp_func = "smr", .dtp_name = "barrier_exit"
, .dtp_pbn = 0, .dtp_sysnum = 0, .dtp_argtype = { "int", ((void
*)0), ((void *)0), ((void *)0), ((void *)0) }, .dtp_nargs = 1
, }
;
91DT_STATIC_PROBE0(smr, wakeup)struct dt_probe (dt_static_smr_wakeup) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "smr", .dtp_name = "wakeup", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { ((void *)0), ((void *)0), ((void *)0),
((void *)0), ((void *)0) }, .dtp_nargs = 0, }
;
92DT_STATIC_PROBE2(smr, thread, "uint64_t", "uint64_t")struct dt_probe (dt_static_smr_thread) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "smr", .dtp_name = "thread", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "uint64_t", "uint64_t", ((void *)0), (
(void *)0), ((void *)0) }, .dtp_nargs = 2, }
;
93
94/*
95 * reference counting, keep in sync with sys/refcnt.h
96 */
97DT_STATIC_PROBE0(refcnt, none)struct dt_probe (dt_static_refcnt_none) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "refcnt", .dtp_name = "none", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { ((void *)0), ((void *)0), ((void *)0),
((void *)0), ((void *)0) }, .dtp_nargs = 0, }
;
98DT_STATIC_PROBE3(refcnt, ethmulti, "void *", "int", "int")struct dt_probe (dt_static_refcnt_ethmulti) = { .dtp_next = {
((void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &
dt_prov_static, .dtp_func = "refcnt", .dtp_name = "ethmulti",
.dtp_pbn = 0, .dtp_sysnum = 0, .dtp_argtype = { "void *", "int"
, "int", ((void *)0), ((void *)0) }, .dtp_nargs = 3, }
;
99DT_STATIC_PROBE3(refcnt, ifaddr, "void *", "int", "int")struct dt_probe (dt_static_refcnt_ifaddr) = { .dtp_next = { (
(void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "refcnt", .dtp_name = "ifaddr", .dtp_pbn = 0, .
dtp_sysnum = 0, .dtp_argtype = { "void *", "int", "int", ((void
*)0), ((void *)0) }, .dtp_nargs = 3, }
;
100DT_STATIC_PROBE3(refcnt, ifmaddr, "void *", "int", "int")struct dt_probe (dt_static_refcnt_ifmaddr) = { .dtp_next = { (
(void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "refcnt", .dtp_name = "ifmaddr", .dtp_pbn = 0, .
dtp_sysnum = 0, .dtp_argtype = { "void *", "int", "int", ((void
*)0), ((void *)0) }, .dtp_nargs = 3, }
;
101DT_STATIC_PROBE3(refcnt, inpcb, "void *", "int", "int")struct dt_probe (dt_static_refcnt_inpcb) = { .dtp_next = { ((
void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "refcnt", .dtp_name = "inpcb", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "void *", "int", "int", ((void *)0), (
(void *)0) }, .dtp_nargs = 3, }
;
102DT_STATIC_PROBE3(refcnt, rtentry, "void *", "int", "int")struct dt_probe (dt_static_refcnt_rtentry) = { .dtp_next = { (
(void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "refcnt", .dtp_name = "rtentry", .dtp_pbn = 0, .
dtp_sysnum = 0, .dtp_argtype = { "void *", "int", "int", ((void
*)0), ((void *)0) }, .dtp_nargs = 3, }
;
103DT_STATIC_PROBE3(refcnt, syncache, "void *", "int", "int")struct dt_probe (dt_static_refcnt_syncache) = { .dtp_next = {
((void *)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &
dt_prov_static, .dtp_func = "refcnt", .dtp_name = "syncache",
.dtp_pbn = 0, .dtp_sysnum = 0, .dtp_argtype = { "void *", "int"
, "int", ((void *)0), ((void *)0) }, .dtp_nargs = 3, }
;
104DT_STATIC_PROBE3(refcnt, tdb, "void *", "int", "int")struct dt_probe (dt_static_refcnt_tdb) = { .dtp_next = { ((void
*)0) }, .dtp_pcbs = { ((void *)0) }, .dtp_prov = &dt_prov_static
, .dtp_func = "refcnt", .dtp_name = "tdb", .dtp_pbn = 0, .dtp_sysnum
= 0, .dtp_argtype = { "void *", "int", "int", ((void *)0), (
(void *)0) }, .dtp_nargs = 3, }
;
105
106/*
107 * List of all static probes
108 */
109struct dt_probe *const dtps_static[] = {
110 /* Scheduler */
111 &_DT_STATIC_P(sched, dequeue)(dt_static_sched_dequeue),
112 &_DT_STATIC_P(sched, enqueue)(dt_static_sched_enqueue),
113 &_DT_STATIC_P(sched, fork)(dt_static_sched_fork),
114 &_DT_STATIC_P(sched, off__cpu)(dt_static_sched_off__cpu),
115 &_DT_STATIC_P(sched, on__cpu)(dt_static_sched_on__cpu),
116 &_DT_STATIC_P(sched, remain__cpu)(dt_static_sched_remain__cpu),
117 &_DT_STATIC_P(sched, sleep)(dt_static_sched_sleep),
118 &_DT_STATIC_P(sched, steal)(dt_static_sched_steal),
119 &_DT_STATIC_P(sched, unsleep)(dt_static_sched_unsleep),
120 &_DT_STATIC_P(sched, wakeup)(dt_static_sched_wakeup),
121 /* Raw syscalls */
122 &_DT_STATIC_P(raw_syscalls, sys_enter)(dt_static_raw_syscalls_sys_enter),
123 &_DT_STATIC_P(raw_syscalls, sys_exit)(dt_static_raw_syscalls_sys_exit),
124 /* UVM */
125 &_DT_STATIC_P(uvm, fault)(dt_static_uvm_fault),
126 &_DT_STATIC_P(uvm, map_insert)(dt_static_uvm_map_insert),
127 &_DT_STATIC_P(uvm, map_remove)(dt_static_uvm_map_remove),
128 &_DT_STATIC_P(uvm, malloc)(dt_static_uvm_malloc),
129 &_DT_STATIC_P(uvm, free)(dt_static_uvm_free),
130 &_DT_STATIC_P(uvm, pool_get)(dt_static_uvm_pool_get),
131 &_DT_STATIC_P(uvm, pool_put)(dt_static_uvm_pool_put),
132 /* VFS */
133 &_DT_STATIC_P(vfs, bufcache_rel)(dt_static_vfs_bufcache_rel),
134 &_DT_STATIC_P(vfs, bufcache_take)(dt_static_vfs_bufcache_take),
135 &_DT_STATIC_P(vfs, cleaner)(dt_static_vfs_cleaner),
136#ifdef __amd64__1
137 /* VMM */
138 &_DT_STATIC_P(vmm, guest_enter)(dt_static_vmm_guest_enter),
139 &_DT_STATIC_P(vmm, guest_exit)(dt_static_vmm_guest_exit),
140 &_DT_STATIC_P(vmm, inout)(dt_static_vmm_inout),
141#endif /* __amd64__ */
142 /* SMR */
143 &_DT_STATIC_P(smr, call)(dt_static_smr_call),
144 &_DT_STATIC_P(smr, called)(dt_static_smr_called),
145 &_DT_STATIC_P(smr, barrier_enter)(dt_static_smr_barrier_enter),
146 &_DT_STATIC_P(smr, barrier_exit)(dt_static_smr_barrier_exit),
147 &_DT_STATIC_P(smr, wakeup)(dt_static_smr_wakeup),
148 &_DT_STATIC_P(smr, thread)(dt_static_smr_thread),
149 /* refcnt */
150 &_DT_STATIC_P(refcnt, none)(dt_static_refcnt_none),
151 &_DT_STATIC_P(refcnt, ethmulti)(dt_static_refcnt_ethmulti),
152 &_DT_STATIC_P(refcnt, ifaddr)(dt_static_refcnt_ifaddr),
153 &_DT_STATIC_P(refcnt, ifmaddr)(dt_static_refcnt_ifmaddr),
154 &_DT_STATIC_P(refcnt, inpcb)(dt_static_refcnt_inpcb),
155 &_DT_STATIC_P(refcnt, rtentry)(dt_static_refcnt_rtentry),
156 &_DT_STATIC_P(refcnt, syncache)(dt_static_refcnt_syncache),
157 &_DT_STATIC_P(refcnt, tdb)(dt_static_refcnt_tdb),
158};
159
160struct dt_probe *const *dtps_index_refcnt;
161
162int
163dt_prov_static_init(void)
164{
165 int i;
166
167 for (i = 0; i < nitems(dtps_static)(sizeof((dtps_static)) / sizeof((dtps_static)[0])); i++) {
168 if (dtps_static[i] == &_DT_STATIC_P(refcnt, none)(dt_static_refcnt_none))
169 dtps_index_refcnt = &dtps_static[i];
170 dt_dev_register_probe(dtps_static[i]);
171 }
172
173 return i;
174}
175
176int
177dt_prov_static_alloc(struct dt_probe *dtp, struct dt_softc *sc,
178 struct dt_pcb_list *plist, struct dtioc_req *dtrq)
179{
180 struct dt_pcb *dp;
181
182 KASSERT(dtioc_req_isvalid(dtrq))((dtioc_req_isvalid(dtrq)) ? (void)0 : __assert("diagnostic "
, "/usr/src/sys/dev/dt/dt_prov_static.c", 182, "dtioc_req_isvalid(dtrq)"
))
;
183 KASSERT(TAILQ_EMPTY(plist))(((((plist)->tqh_first) == ((void *)0))) ? (void)0 : __assert
("diagnostic ", "/usr/src/sys/dev/dt/dt_prov_static.c", 183, "TAILQ_EMPTY(plist)"
))
;
184
185 dp = dt_pcb_alloc(dtp, sc);
186 if (dp == NULL((void *)0))
187 return ENOMEM12;
188
189 dp->dp_filter = dtrq->dtrq_filter;
190 dp->dp_evtflags = dtrq->dtrq_evtflags;
191 TAILQ_INSERT_HEAD(plist, dp, dp_snext)do { if (((dp)->dp_snext.tqe_next = (plist)->tqh_first)
!= ((void *)0)) (plist)->tqh_first->dp_snext.tqe_prev =
&(dp)->dp_snext.tqe_next; else (plist)->tqh_last =
&(dp)->dp_snext.tqe_next; (plist)->tqh_first = (dp
); (dp)->dp_snext.tqe_prev = &(plist)->tqh_first; }
while (0)
;
192
193 return 0;
194}
195
196int
197dt_prov_static_hook(struct dt_provider *dtpv, ...)
198{
199 struct dt_probe *dtp;
200 struct dt_pcb *dp;
201 uintptr_t args[5];
202 va_list ap;
203 int i;
204
205 va_start(ap, dtpv)__builtin_va_start((ap), dtpv);
206 dtp = va_arg(ap, struct dt_probe *)__builtin_va_arg((ap), struct dt_probe *);
207 for (i = 0; i < dtp->dtp_nargs; i++) {
1
Assuming 'i' is < field 'dtp_nargs'
2
Loop condition is true. Entering loop body
3
Assuming 'i' is >= field 'dtp_nargs'
4
Loop condition is false. Execution continues on line 210
208 args[i] = va_arg(ap, uintptr_t)__builtin_va_arg((ap), uintptr_t);
209 }
210 va_end(ap)__builtin_va_end((ap));
211
212 KASSERT(dtpv == dtp->dtp_prov)((dtpv == dtp->dtp_prov) ? (void)0 : __assert("diagnostic "
, "/usr/src/sys/dev/dt/dt_prov_static.c", 212, "dtpv == dtp->dtp_prov"
))
;
5
Assuming 'dtpv' is equal to field 'dtp_prov'
6
'?' condition is true
213
214 smr_read_enter();
215 SMR_SLIST_FOREACH(dp, &dtp->dtp_pcbs, dp_pnext)for ((dp) = ({ typeof(*&(&dtp->dtp_pcbs)->smr_slh_first
) __tmp = *(volatile typeof(*&(&dtp->dtp_pcbs)->
smr_slh_first) *)&(*&(&dtp->dtp_pcbs)->smr_slh_first
); membar_datadep_consumer(); __tmp; }); (dp) != ((void *)0);
(dp) = ({ typeof(*&(dp)->dp_pnext.smr_sle_next) __tmp
= *(volatile typeof(*&(dp)->dp_pnext.smr_sle_next) *)
&(*&(dp)->dp_pnext.smr_sle_next); membar_datadep_consumer
(); __tmp; }))
{
7
Assuming 'dp' is not equal to null
8
Loop condition is true. Entering loop body
216 struct dt_evt *dtev;
217
218 dtev = dt_pcb_ring_get(dp, 0);
219 if (dtev == NULL((void *)0))
9
Assuming 'dtev' is not equal to NULL
10
Taking false branch
220 continue;
221
222 dtev->dtev_args_args.E_entry[0] = args[0];
223 dtev->dtev_args_args.E_entry[1] = args[1];
11
Assigned value is garbage or undefined
224 dtev->dtev_args_args.E_entry[2] = args[2];
225 dtev->dtev_args_args.E_entry[3] = args[3];
226 dtev->dtev_args_args.E_entry[4] = args[4];
227
228 dt_pcb_ring_consume(dp, dtev);
229 }
230 smr_read_leave();
231 return 1;
232}