All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [PATCH] trigger I-pipe trace freezing via proc
@ 2006-04-09 12:08 Jan Kiszka
  2006-04-09 12:50 ` [Xenomai-core] " Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2006-04-09 12:08 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: adeos-main, xenomai-core


[-- Attachment #1.1: Type: text/plain, Size: 273 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: ipipe-trace-trigger.patch --]
[-- Type: text/x-patch; name="ipipe-trace-trigger.patch", Size: 1333 bytes --]

Index: linux-2.6.15.3-kgdb/kernel/ipipe/tracer.c
===================================================================
--- linux-2.6.15.3-kgdb.orig/kernel/ipipe/tracer.c
+++ linux-2.6.15.3-kgdb/kernel/ipipe/tracer.c
@@ -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,
 };

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Xenomai-core] Re: [PATCH] trigger I-pipe trace freezing via proc
  2006-04-09 12:08 [Xenomai-core] [PATCH] trigger I-pipe trace freezing via proc Jan Kiszka
@ 2006-04-09 12:50 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2006-04-09 12:50 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: adeos-main, xenomai-core

Jan Kiszka wrote:
> 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.
> 

Applied, thanks.

-- 

Philippe.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-09 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-09 12:08 [Xenomai-core] [PATCH] trigger I-pipe trace freezing via proc Jan Kiszka
2006-04-09 12:50 ` [Xenomai-core] " Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.