Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\trace_kprobe.c Create Date:2022-07-28 12:39:09
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Enable trace_probe* if the file is NULL, enable "perf" handler, or enable "trace" handler.

Proto:static int enable_trace_kprobe(struct trace_event_call *call, struct trace_event_file *file)

Type:int

Parameter:

TypeParameterName
struct trace_event_call *call
struct trace_event_file *file
357  ret = 0
359  tp = trace_probe_primary_from_call(call)
360  If WARN_ON_ONCE(!tp) Then Return -ENODEV
362  enabled = trace_probe_is_enabled(tp)
365  If file Then
366  ret = trace_probe_add_file(tp, file)
367  If ret Then Return ret
369  Else trace_probe_set_flag(tp, TP_FLAG_PROFILE)
372  If enabled Then Return 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  If trace_kprobe_has_gone(tk) Then Continue
379  ret = __enable_trace_kprobe(tk)
380  If ret Then Break
382  enabled = true
385  If ret Then
387  If enabled Then __disable_trace_kprobe(tp)
389  If file Then trace_probe_remove_file(tp, file)
391  Else trace_probe_clear_flag(tp, TP_FLAG_PROFILE)
395  Return ret
Caller
NameDescribe
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.