From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 26 01:58:33 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 62617C8E for ; Tue, 26 Mar 2013 01:58:33 +0000 (UTC) (envelope-from paul.koch137@gmail.com) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx1.freebsd.org (Postfix) with ESMTP id 41F96F3E for ; Tue, 26 Mar 2013 01:58:33 +0000 (UTC) Received: by mail-pa0-f46.google.com with SMTP id wp1so1336625pac.33 for ; Mon, 25 Mar 2013 18:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:subject:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=9+6VbZKDbnEYx8sRlZitktLouYA8c8xzIgMmvBoFTmE=; b=ibSvl/dOLI7jYdhM7eJUUS4wdWFNLvz6fI6pXxX0C+VmSX7TQIZJ5+a4DZl73sdj8Q SSJ6NBT118o0HaO44pE8RhalsY2dYj+G0VDyHCOdcjksXVjIW0ReKkrhx452NnaZIaba ZacuFAxUCTTEOc05HoLzrn/AiFl/gXnzMMpfHRJws85Busvv8/td5skg5xbmGHQSkhMB lt3AtZ/53S5Ht+ftk3CCDYbYbeDbrme+ixHVMwaTjUsEVrleSyYQSR4FfBhQE2QXM0fj +qozrlVIEUdRMid2K5z0IFFWRpZTzKwq4ZL2qcpBti0deKdAyQYup9uj7q+qI2Ty/7NG aU0A== X-Received: by 10.68.91.66 with SMTP id cc2mr20936752pbb.51.1364263107316; Mon, 25 Mar 2013 18:58:27 -0700 (PDT) Received: from speedy (CPE-121-222-103-202.lnse2.cha.bigpond.net.au. [121.222.103.202]) by mx.google.com with ESMTPS id ri1sm15431724pbc.16.2013.03.25.18.58.25 (version=SSLv3 cipher=RC4-SHA bits=128/128); Mon, 25 Mar 2013 18:58:26 -0700 (PDT) Date: Tue, 26 Mar 2013 11:58:02 +1000 From: Paul Koch To: hackers@freebsd.org Subject: syscalls per process ? Message-ID: <20130326115802.15ce1626@speedy> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.6; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 01:58:33 -0000 Hi, 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. 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(). We don't want to run an external program (eg. truss/dtrace) on each program. Paul.