From owner-freebsd-stable@FreeBSD.ORG Sun Dec 4 12:00:43 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AB871065723 for ; Sun, 4 Dec 2011 12:00:43 +0000 (UTC) (envelope-from rumrunner@rumrunner.mine.nu) Received: from mail47.e.nsc.no (mail47.e.nsc.no [193.213.115.47]) by mx1.freebsd.org (Postfix) with ESMTP id 3512B8FC15 for ; Sun, 4 Dec 2011 12:00:41 +0000 (UTC) Received: from rumrunner.mine.nu (ti0027a380-0216.bb.online.no [88.89.180.216]) by mail47.nsc.no (8.14.4/8.14.4) with ESMTP id pB4C0NjY019056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 4 Dec 2011 13:00:25 +0100 (MET) Received: from rumrunner.mine.nu (localhost [127.0.0.1]) by rumrunner.mine.nu (8.14.5/8.14.2) with ESMTP id pB4C0Mj0039332; Sun, 4 Dec 2011 13:00:23 +0100 (CET) (envelope-from rumrunner@rumrunner.mine.nu) Received: (from rumrunner@localhost) by rumrunner.mine.nu (8.14.5/8.13.8/Submit) id pB4C0MAB039331; Sun, 4 Dec 2011 13:00:22 +0100 (CET) (envelope-from rumrunner) Date: Sun, 4 Dec 2011 13:00:21 +0100 From: Eivind Evensen To: Dan Nelson Message-ID: <20111204120021.GB26675@klump.hjerdalen.lokalnett> References: <20111202094502.GA20626@klump.hjerdalen.lokalnett> <20111203195458.GF7771@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111203195458.GF7771@dan.emsphone.com> Cc: freebsd-stable@freebsd.org Subject: Re: Something missing in truss X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Dec 2011 12:00:43 -0000 On Sat, Dec 03, 2011 at 01:54:58PM -0600, Dan Nelson wrote: > In the last episode (Dec 02), Eivind Evensen said: > > Does anybody else see this or know why? > > > > The machine here is running : > > > > > uname -a > > FreeBSD elg.hjerdalen.lokalnett 8.2-STABLE FreeBSD 8.2-STABLE #36: Wed Nov 30 22:03:07 CET 2011 rumrunner@elg.hjerdalen.lokalnett:/usr/obj/usr/src/sys/RUM amd64 > > > > While trying to weed out some firefox problems, I've noticed > > that truss doesn't recognise certain syscalls : > > > > getpid() = 1519 (0x5ef) > > clock_gettime(4,{48496.335142903 }) = 0 (0x0) > > kevent(20,{0x23,EVFILT_READ,EV_ADD,0,0x0,0x809ec9d80},1,{0x15,EVFILT_READ,0x0,0,0x1,0x809ec9e80},64,0x0) = 1 (0x1) > > clock_gettime(4,{48496.335293202 }) = 0 (0x0) > > read(21,"\0",1) = 1 (0x1) > > clock_gettime(4,{48496.335382599 }) = 0 (0x0) > > umask(0x80a52ee20,0x8,0x0,0x80a52ee00,0x7fffff1f9eb0,0x80a52ee00) = 116 (0x74) > > -- UNKNOWN SYSCALL -14704864 -- > > syscall(0x7fffff1f9ec0,0x0,0x18745,0x7fffff1f9eb0,0x1,0x7fffff1f9e90) = 454 (0x1c6) > > umask(0x80a52ee20,0x8,0x0,0x80a52ee00,0x7fffff1f9eb0,0x80a52ee00) = 116 (0x74) > > -- UNKNOWN SYSCALL -14704864 -- > > syscall(0x7fffff1f9ec0,0x0,0x18745,0x7fffff1f9eb0,0x1,0x7fffff1f9e90) = 454 (0x1c6) > > umask(0x80a52ee20,0x8,0x0,0x80a52ee00,0x7fffff1f9eb0,0x80a52ee00) = 116 (0x74) > > -- UNKNOWN SYSCALL -14704864 -- > > syscall(0x7fffff1f9ec0,0x0,0x18745,0x7fffff1f9eb0,0x1,0x7fffff1f9e90) = 454 (0x1c6) > > umask(0x80a52ee20,0x8,0x0,0x80a52ee00,0x7fffff1f9eb0,0x80a52ee00) = 116 (0x74) > > -- UNKNOWN SYSCALL -14704864 -- > > syscall(0x7fffff1f9ec0,0x0,0x18745,0x7fffff1f9eb0,0x1,0x7fffff1f9e90) = 454 (0x1c6) > > umask(0x80a52ee20,0x8,0x0,0x80a52ee00,0x7fffff1f9eb0,0x80a52ee00) = 116 (0x74) > > -- UNKNOWN SYSCALL -14704864 -- > > syscall(0x7fffff1f9ec0,0x0,0x18745,0x7fffff1f9eb0,0x1,0x7fffff1f9e90) = 454 (0x1c6) > > Two problems: truss get confused when you attach to a process that's > currently executing a syscall, and it gets even more confused when you have > a threaded process waiting in many syscalls at once. > > The following patch fixes problem #1, but problem #2 involves keeping more > per-thread state and ends up touching a lot of the truss code. See > http://www.evoy.net/FreeBSD/truss.diff for one solution (and more syscall > decodes). Thanks for the explanation. I'll try the patch. -- _ _ // \\// Eivind Evensen \/