Module ProcfsSource

Sourcemodule Procfs_intf : sig ... end
Sourcemodule Make (IO : Procfs_intf.IO) : Procfs_intf.S with type 'a io := 'a IO.io and type file_descr = IO.file_descr
include Procfs_intf.S with type 'a io := 'a and type file_descr = Core_unix.File_descr.t
Sourcetype bigint = Big_int.big_int
Sourceval sexp_of_bigint : bigint -> Sexplib0.Sexp.t
Sourcemodule Process : sig ... end
Sourcemodule Meminfo : sig ... end
Sourcemodule Kstat : sig ... end
Sourcemodule Loadavg : sig ... end
Sourcemodule Net : sig ... end
Sourcemodule Mount : sig ... end
Sourcemodule Diskstat : sig ... end
Sourceval mounts : unit -> Mount.t list
Sourceval mounts_of_fstab : unit -> Mount.t list
Sourceval supported_filesystems : unit -> string list
Sourcetype 'a with_process_load_args = ?load_tasks:bool -> 'a

Options when returning process details: load_tasks (default true) indicates that individual task (thread) info should be loaded into task_stats.

Sourceval get_all_procs : (unit -> Process.t list) with_process_load_args

get_all_procs returns a list of all processes on the system.

Sourceval get_pid_ancestry_unsafe : (Core.Pid.t -> Process.t list) with_process_load_args

get_pid_ancestry_unsafe returns a list of processes, with the given PID at the head following parents to the tail (typically the init task). This is inherently racey, as a process could reparent (or seemingly reparent) mid-walk.

with_pid returns a single process that matches the given pid. If there is no such process, with_pid returns None.

with_pid_exn is like with_pid, except it raises Not_found instead of returning None.

Sourceval with_uid : (int -> Process.t list) with_process_load_args

with_uid uid returns all processes owned by uid.

Sourceval pgrep : ((Process.t -> bool) -> Process.t list) with_process_load_args

pgrep f returns all processes for which f is true.

Sourceval pkill : signal:Core.Signal.t -> (Process.t -> bool) -> (Core.Pid.t * (unit, Core_unix.Error.t) Core.Result.t) list

pkill ~signal f sends the signal to all processes for which f returns true. It returns the list of processes that were signaled, and the resulting errors if any.

Sourceval with_username : (string -> Process.t list option) with_process_load_args

with_username calls with_uid after looking up the user's uid

Sourceval with_username_exn : (string -> Process.t list) with_process_load_args

with_username_exn is like with_username, except it raises instead of returning None.

Sourceval jiffies_per_second : unit -> float option

jiffies_per_second. A jiffy "is one tick of the system timer interrupt. It is not an absolute time interval unit, since its duration depends on the clock interrupt frequency of the particular hardware platform."

Further reading: https://en.wikipedia.org/wiki/Jiffy_(time)

Sourceval jiffies_per_second_exn : unit -> float

jiffies_per_second_exn is like jiffies_per_second, except it raises instead of returning None.

Sourceval meminfo : unit -> Meminfo.t option

meminfo queries /proc/meminfo and fills out Meminfo.t. All values in bytes.

Sourceval meminfo_exn : unit -> Meminfo.t

meminfo_exn is like meminfo, except it raises instead of returning None.

Sourceval loadavg : unit -> Loadavg.t option

loadavg parses /proc/loadavg.

Sourceval loadavg_exn : unit -> Loadavg.t

loadavg_exn is like loadavg, except it raises instead of returning None.

Sourceval uptime : unit -> Core.Time_ns.Span.t
Sourceval diskstats : unit -> Diskstat.t list option

diskstats queries /proc/diskstats and returns a list of Diskstat.t.

Sourceval diskstats_exn : unit -> Diskstat.t list

diskstats_exn is like diskstats except it raises instead of returning None.

Sourceval process_age : Process.t -> Core.Time_ns.Span.t option
Sourceval process_age' : jiffies_per_second:float -> Process.t -> Core.Time_ns.Span.t
Sourcemodule Pagemap : sig ... end
Sourcemodule Device_number : sig ... end
Sourcemodule Lock : sig ... end
Sourceval get_locks : unit -> Lock.t list
Sourceval get_pids_holding_flock : File_path.t -> Core.Pid.t list

This is a helper function to get the list of processes holding an advisory flock-style lock on a given path.

Sourcemodule For_testing : sig ... end
Sourceval input_all_with_reused_buffer : unit -> (string -> string) Core.Staged.t