From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 26 06:57:37 2013 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B3E158F3 for ; Tue, 26 Mar 2013 06:57:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2EF5EFBA for ; Tue, 26 Mar 2013 06:57:37 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r2Q6vQm4034690; Tue, 26 Mar 2013 08:57:26 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.0 kib.kiev.ua r2Q6vQm4034690 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r2Q6vQkZ034689; Tue, 26 Mar 2013 08:57:26 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 26 Mar 2013 08:57:26 +0200 From: Konstantin Belousov To: Paul Koch Subject: Re: syscalls per process ? Message-ID: <20130326065726.GM3794@kib.kiev.ua> References: <20130326115802.15ce1626@speedy> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qJd89WIdOyaVRnzq" Content-Disposition: inline In-Reply-To: <20130326115802.15ce1626@speedy> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Mar 2013 06:57:37 -0000 --qJd89WIdOyaVRnzq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 26, 2013 at 11:58:02AM +1000, Paul Koch wrote: > Hi, >=20 > At the start of all our programs, we set up a SIGALRM signal handler > to retrieve rusage stats each second and log this info for analysis. > It is useful for long running programs. One of the things we > would really really like to get is the number of system calls the > process has performed. >=20 > Is there a simple way for a process to retrieve its own number of > syscalls it has performed ? Pity it's not available via getrusage(). >=20 > We don't want to run an external program (eg. truss/dtrace) on each > program. AFAIR, the per-threads syscalls are not accounted. The accounting was performed for some short time, but it was only used as a workaround for some nfs client issue, and since the alternate approach was used, the td_syscalls was removed. Only global system count of the syscalls is maintained. --qJd89WIdOyaVRnzq Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRUUbVAAoJEJDCuSvBvK1Bn/YP/jCe3TtEYugmKlPZZPdOxYZq CEQQz68gdiD71n1dH09V3J1DAQVVZi3cre4trdR4BBb+h34npY3IdlMsLA7qaL1Z bwUAwkFcQ6jejcZYKcKKeFKbsrhG5uNdPaWoDrxBcVSXUHkoiMBDq3HzDxzVQBdO RsmwN89WTA9JhVIQJq/wuc+zzjhEPxI2KOKuzLIE71qsFqcMeKc6gvWCPjnrvye6 ArLIUr45lETFsqido6Yp2ylWfClF1tQNjtuGxixKuAv6uf2ZB8rbr7vaIROv+jV3 efe6dB7TZLBogvz9i9Zj1/A36ooSY7+KOqviIbjpN82Epx3IGoBeq7KgzmrPZ205 6x7YUPlGU86D+L4X/9P3xatROS8hMjVU13WYeFSf3NGIiL7tAly4m3W5vpoVGOgb oAZ/rqAQi8+NRL/+NJ3kluGNq55fY8PDELk7Ubk1CbxFzRvRy/lYvoIhnYlIoZ3+ 2uHN0S1eXAU/5H0AUevZJJOiIVa8FFnBs8pTLjAFHFg6sdHY+KMpK4nZQfY3m4lY XbZY9f/GWBd5TsJLliK6rYOYo6UihYq2gIwDc0zb0dw5wiqDYHm6irmQqEz1Z+8H CJbMn2WT6v/+ZS/2ZQjGGG6RjX+QBakmA2aECFOxCjA99Dd7cCmogeNFP2laqePR K0rl9pBbch2bA0JiNnjE =90md -----END PGP SIGNATURE----- --qJd89WIdOyaVRnzq--