From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 3 17:52:13 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 078C616A419 for ; Thu, 3 Jan 2008 17:52:13 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.228]) by mx1.freebsd.org (Postfix) with ESMTP id A05B513C447 for ; Thu, 3 Jan 2008 17:52:12 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by wr-out-0506.google.com with SMTP id 68so211698wra.13 for ; Thu, 03 Jan 2008 09:52:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=flwCVwxxLSgm2TzF2R9X0+sTDlVKvXVU4leHM3eO+OE=; b=Dc311aXNHcyV+uYWfidT0/Rk6zljsR6B6Dc+rtjqA6S97En2QheGokbMJ+2LxvD92GnfkQSsCGr3fFylKRL680Q2fqsSHnZkpIKLKkDlMeekADIHgf2RilOaYOMVeEzT7L8pBGcucM5wJ87p37mcjR8H96E1Qj76TxgjUX+of5c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=nUOIiCqjjXmPlV4dtOJo7ztOoHjbgImd3GiEZMTrGoszARQLTDhNrb5ZI3XGel/s/ejVKl/TJanZvH9Vms4JXjWX9HD0Eh2fgSjiHGa8yvnEAscZBWKTRFIQUvXXs+zq2Iy2QwOvt9yL/QYeRB3SG49XTTvYLGLINf62EWZavj4= Received: by 10.150.202.17 with SMTP id z17mr2294459ybf.70.1199381181154; Thu, 03 Jan 2008 09:26:21 -0800 (PST) Received: by 10.150.178.13 with HTTP; Thu, 3 Jan 2008 09:26:21 -0800 (PST) Message-ID: <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com> Date: Thu, 3 Jan 2008 18:26:21 +0100 From: "=?ISO-8859-1?Q?Fernando_Apestegu=EDa?=" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Porting from Linux to FreeBSD (procfs question) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2008 17:52:13 -0000 Hi all, I post my question in this list cause Ivan Voras (ivoras@freebsd.org) suggested that here I could find more help. I have an application written in C + Gtk + Glib that gathers information from procfs under Linux. Now, I'm trying to port this application to FreeBSD (I'm working with 7.0 RC1). I've been pointed to get rid of the procfs stuff in the freebsd code and use sysctl instead. However, I can't find some of the information that is present under /proc in Linux. I can only get for the CPU for instance some small bits of info in "hw.model" but I can't get the cache size, supported extensions, etc. I have the same problem with the memory (how much memory is cached, in buffers, marked as dirty, etc...). How can I get all that information? Could you point me to some source I can look at? Is this information (that I suppose it is known by the kernel) somehow exported to userland? Here is a small list of the information the Linux application is available to show: - CPU info: (vendor, model, clock speed, stepping, cache size, supported extensions) - Memory: total, free, shared, cached, used in buffers, marked as dirty, etc.. - Devices: list of block and char devices - Filesystems loaded in the kernel - Network information (bytes sent and received, packets, errors, for each NIC) - Loaded modules (sizes of the modules, if they are used by other modules...) - Some kernel parameters (max files per process, semaphores, etc...) I've seen this is fully covered with sysctl. Thanks in advance.... and Happy New Year.