lkml.org 
[lkml]   [2018]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/8] perf: Allow to block process in syscall tracepoints
On Wed, Dec 05, 2018 at 05:05:02PM +0100, Jiri Olsa wrote:
> +static void trace_block_syscall(struct pt_regs *regs, bool enter)
> +{
> + current->perf_blocked = true;
> +
> + do {
> + schedule_timeout(100 * HZ);
> + current->perf_blocked_cnt = 0;
> +
> + if (enter) {
> + /* perf syscalls:* enter */
> + perf_trace_syscall_enter(regs);
> +
> + /* perf raw_syscalls:* enter */
> + perf_trace_sys_enter(&event_sys_enter, regs, regs->orig_ax);
> + } else {
> + /* perf syscalls:* enter */
> + perf_trace_syscall_exit(regs);
> +
> + /* perf raw_syscalls:* enter */
> + perf_trace_sys_exit(&event_sys_exit, regs, regs->ax);
> + }
> + } while (current->perf_blocked_cnt);
> +
> + current->perf_blocked = false;
> +}

I don't understand this.. why are we using schedule_timeout() and all
that?

\
 
 \ /
  Last update: 2018-12-06 09:11    [W:0.189 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site