Function report |
Source Code:kernel\events\core.c |
Create Date:2022-07-28 13:41:32 |
| Last Modify:2022-05-20 07:50:19 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Inherit an event from parent task to child task.* Returns:* - valid pointer on success* - NULL for orphaned events* - IS_ERR() on error
Proto:static struct perf_event *inherit_event(struct perf_event *parent_event, struct task_struct *parent, struct perf_event_context *parent_ctx, struct task_struct *child, struct perf_event *group_leader, struct perf_event_context *child_ctx)
Type:struct perf_event
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct perf_event * | parent_event | |
| struct task_struct * | parent | |
| struct perf_event_context * | parent_ctx | |
| struct task_struct * | child | |
| struct perf_event * | group_leader | |
| struct perf_event_context * | child_ctx |
| 12067 | parent_state = state |
| 12077 | If parent Then parent_event = parent |
| 12085 | If IS_ERR(child_event) Then Return child_event |
| 12089 | If attach_state & PERF_ATTACH_TASK_DATA && Not pmu specific data Then |
| 12093 | pmu specific data = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). |
| 12095 | If Not pmu specific data Then |
| 12107 | mutex_lock( & child_mutex) |
| 12108 | If is_orphaned_event(parent_event) || Not atomic_long_inc_not_zero( & refcount) Then |
| 12113 | Return NULL |
| 12123 | If parent_state >= PERF_EVENT_STATE_INACTIVE Then state = PERF_EVENT_STATE_INACTIVE |
| 12125 | Else state = PERF_EVENT_STATE_OFF |
| 12128 | If freq Then |
| 12129 | sample_period = sample_period |
| 12132 | sample_period = sample_period |
| 12133 | last_period = sample_period |
| 12135 | local64_set( & period_left, sample_period) |
| 12139 | overflow_handler = overflow_handler |
| 12152 | raw_spin_lock_irqsave( & Protect the states of the events in the list,* nr_active, and the list:, flags) |
| 12153 | add_event_to_ctx(child_event, child_ctx) |
| 12154 | raw_spin_unlock_irqrestore( & Protect the states of the events in the list,* nr_active, and the list:, flags) |
| 12162 | Return child_event |
| Name | Describe |
|---|---|
| inherit_group | Inherits an event group.* This will quietly suppress orphaned events; !inherit_event() is not an error.* This matches with perf_event_release_kernel() removing all child events.* Returns:* - 0 on success* - <0 on error |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |