/home/fernape/Projects/lkmonitor/src/lininfo.h File Reference

#include <glib.h>

Go to the source code of this file.

Data Structures

struct  modules_info
 Contains modules information This struct contains a dumpe of the /proc/modules file. More...
struct  fs_info
 Filesystem information This structure keeps information about filesystems loaded in the kernel. The filesystems are splitted in two categories depending on if they are attached to any devices or not. More...
struct  net_dev_info
 Contains statistics for net usage with a certain device Contains information about usage of this net device. When the field is an array, the first element [0] if for received and the second one [1] for transmitted elements. More...
struct  settings_info
 Contains system settings. This struct contains several fields that represent different system settings like hostname maximum for a shared memory segment, etc. More...
struct  dev_info
 Contains device lists. This struct contains two device lists. More...
struct  cpu_info
 Contains cpu characteristics. This struct contains several fields that represent different cpu characteristics as clock MHz or cache size. More...
struct  mem_info
 Contains memory data and statistics. Contains fields for total, free and other interesting information. More...
struct  stats_info
 Contains statistics about cpu time usage. Contains fields for global and per cpu/core statistics. Context switches is also provided. More...
struct  battery_info
 Battery status information. Contains fields for charge and capacity data. Referenced by acpi_info structure. More...
struct  acpi_info
 Contains temperature and battery statistics. Uses the battery_info structure. More...
struct  cmd_ver
 Contains information for cmdline, system version and load average This structure is used to store cmdline information (like kernel parameters) the system version (kernel, gcc..) and the load average. More...
struct  channels_info

Defines

#define PROC_DIR   "/proc/"
#define CPU_FILE   "/proc/cpuinfo"
#define CMD_FILE   "/proc/cmdline"
#define VER_FILE   "/proc/version"
#define LOAD_FILE   "/proc/loadavg"
#define IOMEM_FILE   "/proc/iomem"
#define IOPORTS_FILE   "/proc/ioports"
#define DMA_FILE   "/proc/dma"
#define MEM_FILE   "/proc/meminfo"
#define DEV_FILE   "/proc/devices"
#define FILES   "/proc/sys/fs/file-nr"
#define FILE_MAX   "/proc/sys/fs/file-max"
#define INODES   "/proc/sys/fs/inode-nr"
#define HOST_NAME   "/proc/sys/kernel/hostname"
#define DOMAIN_NAME   "/proc/sys/kernel/domainname"
#define P_MAX_Q   "/proc/sys/fs/mqueue/queues_max"
#define P_MAX_M   "/proc/sys/fs/mqueue/msg_max"
#define P_MAX_S   "/proc/sys/fs/mqueue/msgsize_max"
#define PAGE_MAX   "/proc/sys/kernel/shmall"
#define SEG_MAX   "/proc/sys/kernel/shmmni"
#define SEG_SIZE   "/proc/sys/kernel/shmmax"
#define THREADS_MAX   "/proc/sys/kernel/threads-max"
#define SEM   "/proc/sys/kernel/sem"
#define STATS_FILE   "/proc/stat"
#define BATT_STATE   "/proc/acpi/battery/BAT0/state"
#define BATT_INFO   "/proc/acpi/battery/BAT0/info"
#define BATT_STATE1   "/proc/acpi/battery/BAT1/state"
#define BATT_INFO1   "/proc/acpi/battery/BAT1/info"
#define TEMPERATURE   "/proc/acpi/thermal_zone/THRM/temperature"
#define TEMP_TRIP   "/proc/acpi/thermal_zone/THRM/trip_points"
#define NET_DEVS   "/proc/net/dev"
#define NET_PROTOCOLS   "/proc/net/protocols"
#define FS_FILE   "/proc/filesystems"
#define MOD_FILE   "/proc/modules"
#define MAX_FIELD_SZ   255
#define FIELD_SZ   15
#define TV_DEVS   0
#define TV_MODS   1

Functions

int get_cpu_info ()
 Fills cpu_info struct fields.
int get_mhz_info ()
 Updates Mhz (for Centrino, AMD64...).
int get_mem_info ()
 Fills mem_struct fields.
int get_devs_info ()
 Fills devs_struct fields.
int get_settings_info ()
 Get settings values.
int get_stats_info ()
 Get cpu times.
int get_acpi_info ()
 Collects ACPI data.
int get_battery_info ()
 Get static information about the battery.
int get_cmd_ver_info ()
 Get cmdline and version kernel information.
int get_loadavg_info ()
 Get load average information.
int get_channels_info ()
 Get infor for communication channels.
int get_net_info ()
 Get info for net devices.
int get_fs_info ()
 Get info about filesystems.
int get_mod_info ()


Define Documentation

#define BATT_INFO   "/proc/acpi/battery/BAT0/info"

Definition at line 51 of file lininfo.h.

Referenced by main().

#define BATT_INFO1   "/proc/acpi/battery/BAT1/info"

Definition at line 53 of file lininfo.h.

Referenced by main().

#define BATT_STATE   "/proc/acpi/battery/BAT0/state"

Definition at line 50 of file lininfo.h.

Referenced by get_acpi_info().

#define BATT_STATE1   "/proc/acpi/battery/BAT1/state"

Definition at line 52 of file lininfo.h.

Referenced by get_acpi_info().

#define CMD_FILE   "/proc/cmdline"

Definition at line 28 of file lininfo.h.

Referenced by get_cmd_ver_info().

#define CPU_FILE   "/proc/cpuinfo"

Definition at line 27 of file lininfo.h.

Referenced by get_cpu_info(), and get_mhz_info().

#define DEV_FILE   "/proc/devices"

Definition at line 35 of file lininfo.h.

Referenced by get_devs_info().

#define DMA_FILE   "/proc/dma"

Definition at line 33 of file lininfo.h.

Referenced by get_channels_info().

#define DOMAIN_NAME   "/proc/sys/kernel/domainname"

Definition at line 40 of file lininfo.h.

Referenced by get_settings_info(), and lkmonitor_write_settings().

#define FIELD_SZ   15

Definition at line 62 of file lininfo.h.

#define FILE_MAX   "/proc/sys/fs/file-max"

Definition at line 37 of file lininfo.h.

Referenced by lkmonitor_write_settings().

#define FILES   "/proc/sys/fs/file-nr"

Definition at line 36 of file lininfo.h.

Referenced by get_settings_info().

#define FS_FILE   "/proc/filesystems"

Definition at line 58 of file lininfo.h.

Referenced by get_fs_info().

#define HOST_NAME   "/proc/sys/kernel/hostname"

Definition at line 39 of file lininfo.h.

Referenced by get_settings_info(), and lkmonitor_write_settings().

#define INODES   "/proc/sys/fs/inode-nr"

Definition at line 38 of file lininfo.h.

Referenced by get_settings_info(), and lkmonitor_write_settings().

#define IOMEM_FILE   "/proc/iomem"

Definition at line 31 of file lininfo.h.

Referenced by get_channels_info().

#define IOPORTS_FILE   "/proc/ioports"

Definition at line 32 of file lininfo.h.

Referenced by get_channels_info().

#define LOAD_FILE   "/proc/loadavg"

Definition at line 30 of file lininfo.h.

Referenced by get_loadavg_info().

#define MAX_FIELD_SZ   255

Definition at line 61 of file lininfo.h.

#define MEM_FILE   "/proc/meminfo"

Definition at line 34 of file lininfo.h.

Referenced by get_mem_info().

#define MOD_FILE   "/proc/modules"

Definition at line 59 of file lininfo.h.

Referenced by get_mod_info().

#define NET_DEVS   "/proc/net/dev"

Definition at line 56 of file lininfo.h.

Referenced by get_net_info(), and lkmonitor_load_net_dev().

#define NET_PROTOCOLS   "/proc/net/protocols"

Definition at line 57 of file lininfo.h.

#define P_MAX_M   "/proc/sys/fs/mqueue/msg_max"

Definition at line 42 of file lininfo.h.

Referenced by get_settings_info(), and lkmonitor_write_settings().

#define P_MAX_Q   "/proc/sys/fs/mqueue/queues_max"

Definition at line 41 of file lininfo.h.

Referenced by get_settings_info(), and lkmonitor_write_settings().

#define P_MAX_S   "/proc/sys/fs/mqueue/msgsize_max"

Definition at line 43 of file lininfo.h.

Referenced by get_settings_info(), and lkmonitor_write_settings().

#define PAGE_MAX   "/proc/sys/kernel/shmall"

Definition at line 44 of file lininfo.h.

Referenced by get_settings_info(), and lkmonitor_write_settings().

#define PROC_DIR   "/proc/"

Definition at line 26 of file lininfo.h.

#define SEG_MAX   "/proc/sys/kernel/shmmni"

Definition at line 45 of file lininfo.h.

Referenced by get_settings_info(), and lkmonitor_write_settings().

#define SEG_SIZE   "/proc/sys/kernel/shmmax"

Definition at line 46 of file lininfo.h.

Referenced by get_settings_info(), and lkmonitor_write_settings().

#define SEM   "/proc/sys/kernel/sem"

Definition at line 48 of file lininfo.h.

Referenced by get_settings_info(), and lkmonitor_write_settings().

#define STATS_FILE   "/proc/stat"

Definition at line 49 of file lininfo.h.

Referenced by get_stats_info().

#define TEMP_TRIP   "/proc/acpi/thermal_zone/THRM/trip_points"

Definition at line 55 of file lininfo.h.

Referenced by get_acpi_info().

#define TEMPERATURE   "/proc/acpi/thermal_zone/THRM/temperature"

Definition at line 54 of file lininfo.h.

Referenced by get_acpi_info().

#define THREADS_MAX   "/proc/sys/kernel/threads-max"

Definition at line 47 of file lininfo.h.

Referenced by get_settings_info(), and lkmonitor_write_settings().

#define TV_DEVS   0

Definition at line 65 of file lininfo.h.

Referenced by lkmonitor_fill_tv(), and update_devs().

#define TV_MODS   1

Definition at line 66 of file lininfo.h.

Referenced by lkmonitor_fill_tv(), and update_modules_info().

#define VER_FILE   "/proc/version"

Definition at line 29 of file lininfo.h.

Referenced by get_cmd_ver_info().


Function Documentation

int get_acpi_info (  ) 

Collects ACPI data.

int get_battery_info (  ) 

Get static information about the battery.

int get_channels_info (  ) 

Get infor for communication channels.

int get_cmd_ver_info (  ) 

Get cmdline and version kernel information.

int get_cpu_info (  ) 

Fills cpu_info struct fields.

int get_devs_info (  ) 

Fills devs_struct fields.

int get_fs_info (  ) 

Get info about filesystems.

int get_loadavg_info (  ) 

Get load average information.

int get_mem_info (  ) 

Fills mem_struct fields.

int get_mhz_info (  ) 

Updates Mhz (for Centrino, AMD64...).

int get_mod_info (  ) 

int get_net_info (  ) 

Get info for net devices.

int get_settings_info (  ) 

Get settings values.

int get_stats_info (  ) 

Get cpu times.


Generated on Tue Apr 1 22:52:55 2008 for lkmonitor by  doxygen 1.5.1