函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\trace_kprobe.c Create Date:2022-07-27 13:49:46
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Enable trace_probe* if the file is NULL, enable "perf" handler, or enable "trace" handler.

函数原型:static int enable_trace_kprobe(struct trace_event_call *call, struct trace_event_file *file)

返回类型:int

参数:

类型参数名称
struct trace_event_call *call
struct trace_event_file *file
357  ret等于0
359  tp等于trace_probe_primary_from_call(call)
360  如果WARN_ON_ONCE(!tp)则返回:负ENODEV
362  enabled等于trace_probe_is_enabled(tp)
365  如果file
366  ret等于trace_probe_add_file(tp, file)
367  如果ret则返回:ret
369  否则trace_probe_set_flag(tp, TP_FLAG_PROFILE)
372  如果enabled则返回:0
376  tk等于container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(pos, structtrace_kprobe, tp)
377  如果trace_kprobe_has_gone(tk)则继续下一循环
379  ret等于__enable_trace_kprobe(tk)
380  如果ret退出
382  enabled = true
385  如果ret
387  如果enabled__disable_trace_kprobe(tp)
389  如果filetrace_probe_remove_file(tp, file)
391  否则trace_probe_clear_flag(tp, TP_FLAG_PROFILE)
395  返回:ret
调用者
名称描述
kprobe_registeralled by perf_trace_init() or __ftrace_set_clr_event() under event_mutex.* kprobe_trace_self_tests_init() does enable_trace_probe/disable_trace_probe* lockless, but we can't race with this __init function.