Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jan 2008 18:26:21 +0100
From:      "=?ISO-8859-1?Q?Fernando_Apestegu=EDa?=" <fernando.apesteguia@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Porting from Linux to FreeBSD (procfs question)
Message-ID:  <1bd550a00801030926h7b3f0aaayfd04244a3305619c@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1bd550a00801030926h7b3f0aaayfd04244a3305619c>