调试和剖分析
此表包含的所有事件的引发通过 sys.audit() or PySys_Audit() calls throughout the CPython runtime and the standard library. These calls were added in 3.8 or later (see PEP 578 ).
sys.audit()
PySys_Audit()
见 sys.addaudithook() and PySys_AddAuditHook() 了解处理这些事件的有关信息。
sys.addaudithook()
PySys_AddAuditHook()
CPython 实现细节: 此表生成自 CPython 文档编制,且不能表示由其它实现引发的事件。见特定运行时文档编制,了解引发的实际事件。
审计事件
自变量
参考
function , args , kwargs
function
args
kwargs
[1]
typecode , initializer
typecode
initializer
breakpointhook
id
prompt
result
code , filename , name , argcount , posonlyargcount , kwonlyargcount , nlocals , stacksize , flags
code
filename
name
argcount
posonlyargcount
kwonlyargcount
nlocals
stacksize
flags
source , filename
source
command
hook
module-name
obj
func_pointer , arguments
func_pointer
arguments
address
pointer , size , offset
pointer
size
offset
[1] [2]
init , size
init
library , name
library
handle , name
handle
errno
error
ptr , size
ptr
root
code_object
fd , cmd , arg
fd
cmd
arg
fd , operation
operation
fd , request , arg
request
fd , cmd , len , start , whence
len
start
whence
self , host , port
self
host
port
self , cmd
generation
objs
pathname , recursive
pathname
recursive
pathname , recursive , root_dir , dir_fd
root_dir
dir_fd
self , data
data
module , filename , sys.path , sys.meta_path , sys.path_hooks
module
sys.path
sys.meta_path
sys.path_hooks
value , version
value
version
bytes
fileno , length , access , offset
fileno
length
access
fd , mode , nbytes
mode
nbytes
handle , flags
self , line
line
obj , name
obj , name , value
file , mode , flags
file
[1] [2] [3]
path
path , flags
path , mode , dir_fd
path , uid , gid , dir_fd
uid
gid
path , args , env
env
top , topdown , onerror , follow_symlinks , dir_fd
top
topdown
onerror
follow_symlinks
path , attribute
attribute
pid , sig
pid
sig
pgid , sig
pgid
src , dst , src_dir_fd , dst_dir_fd
src
dst
src_dir_fd
dst_dir_fd
volume
fd , cmd , len
path , argv , env
argv
key , value
key
path , dir_fd
path , attribute , value , flags
mode , path , args , env
path , operation
path , operation , arguments , cwd , show_cmd
cwd
show_cmd
src , dst , dir_fd
fd , length
path , times , ns , dir_fd
times
ns
top , topdown , onerror , followlinks
followlinks
self , pattern
pattern
module , name
pid , resource , limits
resource
limits
resource , limits
path , user , group
user
group
src , dst
base_name , format , root_dir , base_dir
base_name
format
base_dir
filename , extract_dir , format
extract_dir
thread_id , signalnum
thread_id
signalnum
self , family , type , protocol
family
type
protocol
self , address
host , port , family , type , protocol
ip_address
hostname
sockaddr
servicename , protocolname
servicename
protocolname
port , protocolname
database
connection_handle
connection , enabled
connection
enabled
connection , path
executable , args , cwd , env
executable
frame
depth
hook , type , value , traceback
traceback
hook , unraisable
unraisable
ident , logoption , facility
ident
logoption
facility
maskpri
priority , message
priority
message
self , buffer
buffer
fullpath
fullurl , data , headers , method
fullurl
headers
method
url
computer_name , key
computer_name
key , sub_key , access
sub_key
key , index
index
str
key , sub_key , file_name
file_name
key , sub_key , value_name
value_name
key , file_name
key , sub_key , type , value
以下事件在内部引发,且不对应 CPython 的任何公共 API:
file_name , desired_access , share_mode , creation_disposition , flags_and_attributes
desired_access
share_mode
creation_disposition
flags_and_attributes
src_path , dst_path
src_path
dst_path
name , open_mode , pipe_mode
open_mode
pipe_mode
application_name , command_line , current_directory
application_name
command_line
current_directory
process_id , desired_access
process_id
handle , exit_code
exit_code
bdb — 调试器框架
bdb
键入搜索术语或模块、类、函数名称。