Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 May 2014 13:54:51 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r265181 - user/dchagin/lemul/sys/compat/linux
Message-ID:  <201405011354.s41DspxN069831@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Thu May  1 13:54:51 2014
New Revision: 265181
URL: http://svnweb.freebsd.org/changeset/base/265181

Log:
  Add more KTR records to linux for debug threading.

Modified:
  user/dchagin/lemul/sys/compat/linux/linux_emul.c
  user/dchagin/lemul/sys/compat/linux/linux_fork.c
  user/dchagin/lemul/sys/compat/linux/linux_futex.c
  user/dchagin/lemul/sys/compat/linux/linux_util.h

Modified: user/dchagin/lemul/sys/compat/linux/linux_emul.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_emul.c	Thu May  1 13:52:14 2014	(r265180)
+++ user/dchagin/lemul/sys/compat/linux/linux_emul.c	Thu May  1 13:54:51 2014	(r265181)
@@ -133,10 +133,14 @@ linux_proc_init(struct thread *td, struc
 		em->robust_futexes = NULL;
 		if (flags & LINUX_CLONE_THREAD) {
 			LIN_SDT_PROBE0(emul, proc_init, create_thread);
+			LINUX_CTR1(proc_init, "thread newtd(%d)",
+			    newtd->td_tid);
 
 			em->em_tid = newtd->td_tid;
 		} else {
 			LIN_SDT_PROBE0(emul, proc_init, fork);
+			LINUX_CTR1(proc_init, "fork newtd(%d)",
+			    newtd->td_proc->p_pid);
 
 			em->em_tid = newtd->td_proc->p_pid;
 		}
@@ -144,6 +148,8 @@ linux_proc_init(struct thread *td, struc
 	} else {
 		/* exec */
 		LIN_SDT_PROBE0(emul, proc_init, exec);
+		LINUX_CTR1(proc_init, "exec newtd(%d)",
+		    td->td_proc->p_pid);
 
 		/* lookup the old one */
 		em = em_find(td);

Modified: user/dchagin/lemul/sys/compat/linux/linux_fork.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_fork.c	Thu May  1 13:52:14 2014	(r265180)
+++ user/dchagin/lemul/sys/compat/linux/linux_fork.c	Thu May  1 13:54:51 2014	(r265181)
@@ -230,6 +230,10 @@ linux_clone_proc(struct thread *td, stru
 		    exit_signal);
 #endif
 
+	LINUX_CTR4(clone, "thread(%d): successful rfork to %d, "
+	    "stack %p sig = %d", td->td_tid, (int)p2->p_pid,
+	    args->stack, exit_signal);
+
 	if (args->flags & LINUX_CLONE_VFORK) {
 	   	PROC_LOCK(p2);
 	   	p2->p_flag |= P_PPWAIT;

Modified: user/dchagin/lemul/sys/compat/linux/linux_futex.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_futex.c	Thu May  1 13:52:14 2014	(r265180)
+++ user/dchagin/lemul/sys/compat/linux/linux_futex.c	Thu May  1 13:54:51 2014	(r265181)
@@ -809,6 +809,10 @@ linux_sys_futex(struct thread *td, struc
 			LIN_SDT_PROBE0(futex, linux_sys_futex,
 			    invalid_cmp_requeue_use);
 			LIN_SDT_PROBE1(futex, linux_sys_futex, return, EINVAL);
+
+			LINUX_CTR2(sys_futex, "CMP_REQUEUE second %p eq first %p",
+			    args->uaddr2, args->uaddr);
+
 			return (EINVAL);
 		}
 
@@ -828,6 +832,8 @@ linux_sys_futex(struct thread *td, struc
 		error = futex_get(args->uaddr2, NULL, &f2,
 		    flags | FUTEX_DONTEXISTS);
 		if (error) {
+			LINUX_CTR2(sys_futex, "CMP_REQUEUE second %p exists %d",
+			    args->uaddr2, error);
 			futex_put(f, NULL);
 
 			LIN_SDT_PROBE1(futex, linux_sys_futex, return, error);

Modified: user/dchagin/lemul/sys/compat/linux/linux_util.h
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_util.h	Thu May  1 13:52:14 2014	(r265180)
+++ user/dchagin/lemul/sys/compat/linux/linux_util.h	Thu May  1 13:54:51 2014	(r265181)
@@ -115,9 +115,8 @@ void	linux_free_get_char_devices(char *s
 #define	LINUX_CTRFMT(nm, fmt)	#nm"("fmt")"
 
 #define	LINUX_CTR6(f, m, p1, p2, p3, p4, p5, p6) do {			\
-	if (ldebug(f))							\
-		CTR6(KTR_LINUX, LINUX_CTRFMT(f, m),			\
-		    p1, p2, p3, p4, p5, p6);				\
+	CTR6(KTR_LINUX, LINUX_CTRFMT(f, m),				\
+	    p1, p2, p3, p4, p5, p6);					\
 } while (0)
 
 #define	LINUX_CTR(f)			LINUX_CTR6(f, "", 0, 0, 0, 0, 0, 0)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405011354.s41DspxN069831>