From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 16:09:35 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F20CA848 for ; Mon, 4 Aug 2014 16:09:35 +0000 (UTC) Received: from systemdatarecorder.org (mail.systemdatarecorder.org [54.246.96.61]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "localhost" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7849F2486 for ; Mon, 4 Aug 2014 16:09:34 +0000 (UTC) Received: from nereid (84-253-211-213.bb.dnainternet.fi [84.253.211.213]) (authenticated bits=0) by systemdatarecorder.org (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id s74G7Fse029271 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 4 Aug 2014 16:07:16 GMT Date: Mon, 4 Aug 2014 19:09:23 +0300 From: Stefan Parvu To: freebsd-hackers@freebsd.org Subject: cpu utilization break down via sysctl Message-Id: <20140804190923.95fec6a00d175ffee89c4af5@systemdatarecorder.org> Organization: systemdatarecorder.org X-Mailer: Sylpheed 3.4.2 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) 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.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 16:09:36 -0000 Hi, Im trying to understand if there is a simple way, without writing C code, to consume sysctl interface via BSD::Sysctl or using sysctl(8) and output user, system and idle across all CPUs from a running system ? Im trying to port sysrec [1] to FreeBSD and it seems a bit harder to find the correct approach. Pointers, comments ? [1] - http://www.systemdatarecorder.org/recording/sysrec.html Many thanks, -- Stefan Parvu