Signed-off-by: Stanislav Kinsburskiy <skinsbur...@virtuozzo.com> --- drivers/connector/cn_proc.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-)
diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c index 2d5ff7c..312f30f 100644 --- a/drivers/connector/cn_proc.c +++ b/drivers/connector/cn_proc.c @@ -222,31 +222,17 @@ void proc_comm_connector(struct task_struct *task) proc_event_connector(task, PROC_EVENT_COMM, 0, fill_comm_event); } -void proc_coredump_connector(struct task_struct *task) +static bool fill_coredump_event(struct proc_event *ev, struct task_struct *task, + int unused) { - struct cn_msg *msg; - struct proc_event *ev; - __u8 buffer[CN_PROC_MSG_SIZE] __aligned(8); - struct timespec ts; - - if (atomic_read(&proc_event_num_listeners) < 1) - return; - - msg = buffer_to_cn_msg(buffer); - ev = (struct proc_event *)msg->data; - memset(&ev->event_data, 0, sizeof(ev->event_data)); - get_seq(&msg->seq, &ev->cpu); - ktime_get_ts(&ts); /* get high res monotonic timestamp */ - ev->timestamp_ns = timespec_to_ns(&ts); - ev->what = PROC_EVENT_COREDUMP; ev->event_data.coredump.process_pid = task->pid; ev->event_data.coredump.process_tgid = task->tgid; + return true; +} - memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); - msg->ack = 0; /* not used */ - msg->len = sizeof(*ev); - msg->flags = 0; /* not used */ - cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); +void proc_coredump_connector(struct task_struct *task) +{ + proc_event_connector(task, PROC_EVENT_COREDUMP, 0, fill_coredump_event); } void proc_exit_connector(struct task_struct *task) _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel