trigger I-pipe trace freezing via proc
PATCH 1/1 trigger I-pipe trace freezing via proc
Hi Philippe,
here is a tiny patch to re-trigger trace freezing by writing a positive number to /proc/ipipe/trace/frozen. Writing 0 provides the old behaviour, i.e. resets the frozen trace so that ipipe_trace_freeze() can capture a new trace.
Please apply.
Jan
kernel/ipipe/tracer.c +20 -3
@@ -1005,11 +1005,28 @@ static int __ipipe_frozen_prtrace_open(s }static ssize_t -__ipipe_frozen_reset (struct file *file,const char __user *pbuffer, -size_t count,loff_t *data) +__ipipe_frozen_ctrl (struct file *file,const char __user *pbuffer, +size_t count,loff_t *data) { +char *end, buf[16 ]; +int val; +int n; + + n = (count >sizeof (buf) -1 ) ?sizeof (buf) -1 : count; + +if (copy_from_user (buf, pbuffer, n)) +return -EFAULT ; + + buf[n] ='\0' ; + val =simple_strtol (buf, &end,0 ); + +if (((*end !='\0' ) && !isspace (*end)) || (val <0 )) +return -EINVAL ; +down (&out_mutex);ipipe_trace_frozen_reset (); +if (val >0 ) +ipipe_trace_freeze (-1 );up (&out_mutex);return count;
@@ -1018,7 +1035,7 @@ __ipipe_frozen_reset(struct file *file,struct file_operations __ipipe_frozen_prtrace_fops = { .open = __ipipe_frozen_prtrace_open, .read = seq_read, - .write = __ipipe_frozen_reset, + .write = __ipipe_frozen_ctrl, .llseek = seq_lseek, .release = seq_release, };
Philippe Gerum
AppliedQuoted 9 lines · Jan Kiszka
Hi Philippe,
here is a tiny patch to re-trigger trace freezing by writing a positive number to
/proc/ipipe/trace/frozen. Writing 0 provides the old behaviour, i.e. resets the frozen trace so thatipipe_trace_freeze()can capture a new trace.Please apply.
Applied, thanks.
Signature · 1 line
Philippe.