dm_freebsd Module

Abstraction layer over FreeBSD-specific APIs.


Uses

  • module~~dm_freebsd~~UsesGraph module~dm_freebsd dm_freebsd module~dm_error dm_error module~dm_freebsd->module~dm_error module~dm_kind dm_kind module~dm_freebsd->module~dm_kind module~dm_pipe dm_pipe module~dm_freebsd->module~dm_pipe module~dm_platform dm_platform module~dm_freebsd->module~dm_platform module~dm_error->module~dm_kind module~dm_ascii dm_ascii module~dm_error->module~dm_ascii iso_fortran_env iso_fortran_env module~dm_kind->iso_fortran_env module~dm_pipe->module~dm_error module~dm_pipe->module~dm_kind unix unix module~dm_pipe->unix

Used by

  • module~~dm_freebsd~~UsedByGraph module~dm_freebsd dm_freebsd module~dmpack dmpack module~dmpack->module~dm_freebsd proc~dm_system_cpu_cores dm_system_cpu_cores proc~dm_system_cpu_cores->module~dm_freebsd proc~dm_system_cpu_model dm_system_cpu_model proc~dm_system_cpu_model->module~dm_freebsd proc~dm_system_cpu_temperature dm_system_cpu_temperature proc~dm_system_cpu_temperature->module~dm_freebsd proc~dm_system_disk_free dm_system_disk_free proc~dm_system_disk_free->module~dm_freebsd proc~dm_system_load_average dm_system_load_average proc~dm_system_load_average->module~dm_freebsd

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: FREEBSD_VMSTAT_PROCS_R = 1

Threads running.

integer, public, parameter :: FREEBSD_VMSTAT_PROCS_B = 2

Threads blocked.

integer, public, parameter :: FREEBSD_VMSTAT_PROCS_W = 3

Threads swapped.

integer, public, parameter :: FREEBSD_VMSTAT_MEMORY_AVM = 4

Virtual memory [byte].

integer, public, parameter :: FREEBSD_VMSTAT_MEMORY_FRE = 5

Free memory [byte].

integer, public, parameter :: FREEBSD_VMSTAT_PAGE_FLT = 6

Page faults.

integer, public, parameter :: FREEBSD_VMSTAT_PAGE_RE = 7

Pages reactivated.

integer, public, parameter :: FREEBSD_VMSTAT_PAGE_PI = 8

Pages paged in.

integer, public, parameter :: FREEBSD_VMSTAT_PAGE_PO = 9

Pages paged out

integer, public, parameter :: FREEBSD_VMSTAT_PAGE_FR = 10

Pages freed.

integer, public, parameter :: FREEBSD_VMSTAT_PAGE_SR = 11

Pages scanned.

integer, public, parameter :: FREEBSD_VMSTAT_FAULTS_IN = 12

Device interrupts.

integer, public, parameter :: FREEBSD_VMSTAT_FAULTS_SY = 13

System calls.

integer, public, parameter :: FREEBSD_VMSTAT_FAULTS_CS = 14

Context switches.

integer, public, parameter :: FREEBSD_VMSTAT_CPU_US = 15

User time [%].

integer, public, parameter :: FREEBSD_VMSTAT_CPU_SY = 16

System time [%].

integer, public, parameter :: FREEBSD_VMSTAT_CPU_ID = 17

Idle time [%].

integer, public, parameter :: FREEBSD_VMSTAT_LAST = 17

Never use this.

integer, public, parameter :: FREEBSD_NVMSTAT = 17

Size of vmstat array.


Functions

public function dm_freebsd_disk_free(path, file_system, size, used, available, capacity, mounted_on) result(rc)

Returns free disk space of file or directory. Argument path must be a file or directory, for example, / or .. For security reasons, path must not be a file system or ZFS pool. The function calls df(1) internally and expects sizes in 512K blocks.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: path

File or directory.

character(len=*), intent(inout), optional :: file_system

File system path (device, ZFS pool).

integer(kind=i8), intent(out), optional :: size

Size [byte].

integer(kind=i8), intent(out), optional :: used

Used space [byte].

integer(kind=i8), intent(out), optional :: available

Available space [byte]

integer, intent(out), optional :: capacity

Capacity [%]

character(len=*), intent(inout), optional :: mounted_on

Mount point.

Return Value integer

public function dm_freebsd_sysctl_battery_life(life) result(rc)

Returns the current battery life [%] from sysctl(8).

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: life

Battery life [%].

Return Value integer

public function dm_freebsd_sysctl_cpu_cores(ncore) result(rc)

Returns number of CPU cores from sysctl(8) (hw.ncpu).

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: ncore

Number of CPUs.

Return Value integer

public function dm_freebsd_sysctl_cpu_model(model) result(rc)

Returns model name of first CPU from sysctl(8) (hw.model).

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: model

Hardware model.

Return Value integer

public function dm_freebsd_sysctl_cpu_temperature(temperature) result(rc)

Reads temperature of first CPU in °C from sysctl(8) (dev.cpu.0.temperature).

Read more…

Arguments

Type IntentOptional Attributes Name
real, intent(out) :: temperature

Temperature [°C]

Return Value integer

public function dm_freebsd_sysctl_memory(phys_mem, real_mem, user_mem) result(rc)

Returns physical, real, and user memory [byte] from sysctl(8).

Read more…

Arguments

Type IntentOptional Attributes Name
integer(kind=i8), intent(out), optional :: phys_mem

Physical memory [byte].

integer(kind=i8), intent(out), optional :: real_mem

Real memory [byte].

integer(kind=i8), intent(out), optional :: user_mem

User memory [byte].

Return Value integer

public function dm_freebsd_sysctl_mqueue(max_mqueues, max_messages, max_message_size) result(rc)

Returns POSIX message queue variables from sysctl(8).

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(out), optional :: max_mqueues

Max. number of mqueues.

integer, intent(out), optional :: max_messages

Max. number of messages.

integer, intent(out), optional :: max_message_size

Max. message size [byte].

Return Value integer

public function dm_freebsd_uptime_load_average(avg1, avg5, avg15) result(rc)

Returns load averages from uptime(1).

Read more…

Arguments

Type IntentOptional Attributes Name
real, intent(out), optional :: avg1

Average, 1 min.

real, intent(out), optional :: avg5

Average, 5 min.

real, intent(out), optional :: avg15

Average, 15 min.

Return Value integer

public function dm_freebsd_vmstat(vmstat) result(rc)

Returns output of vmstat(8). The procedure runs for > 0.1 seconds! Executes the following command and reads the last output values:

Read more…

Arguments

Type IntentOptional Attributes Name
integer(kind=i8), intent(out) :: vmstat(FREEBSD_NVMSTAT)

Values.

Return Value integer

public function dm_freebsd_vmstat_cpu_idle(idle) result(rc)

Returns CPU idle time from vmstat(8). The procedure runs for > 0.1 sec!

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: idle

Idle time [%].

Return Value integer