Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/prometheus/procfs
/ functions
Functions
791 in github.com/prometheus/procfs
⨍
Functions
791
◇
Types & classes
274
↓ 138 callers
Method
Path
Path is a helper function to get configfs path.
iscsi/iscsi.go:67
↓ 66 callers
Function
NewFS
NewFS returns a new FS mounted under the given mountPoint. It will error if the mount point can't be read.
sysfs/fs.go:39
↓ 61 callers
Function
getProcFixtures
(t *testing.T)
fs_test.go:33
↓ 54 callers
Method
Err
Err returns the last error, if any, encountered by the ValueParser.
internal/parsers/valueparser.go:89
↓ 52 callers
Method
Name
()
sysfs/pci_device.go:102
↓ 45 callers
Method
Proc
Proc returns a process for the given pid.
proc.go:97
↓ 44 callers
Function
ReadFileNoStat
ReadFileNoStat uses io.ReadAll to read contents of entire file. This is similar to os.ReadFile but without the call to os.Stat, because many files in
internal/parsers/readfile.go:26
↓ 39 callers
Function
SysReadFile
SysReadFile is here implemented as a noop for builds that do not support the read syscall. For example Windows, or Linux on Google App Engine.
internal/parsers/sysreadfile_compat.go:24
↓ 34 callers
Function
NewFS
NewFS returns a new proc FS mounted under the given proc mountPoint. It will error if the mount point directory can't be read or is a file.
fs.go:44
↓ 30 callers
Method
path
(pa ...string)
proc.go:306
↓ 24 callers
Method
Stat
Stat returns information about current cpu/process statistics. See: https://www.kernel.org/doc/Documentation/filesystems/proc.txt
stat.go:168
↓ 19 callers
Function
NewValueParser
NewValueParser creates a ValueParser using the input string.
internal/parsers/valueparser.go:32
↓ 15 callers
Function
ReadUintFromFile
ReadUintFromFile reads a file and attempts to parse a uint64 from it.
internal/parsers/parse.go:84
↓ 10 callers
Method
PUInt64
PUInt64 interprets the underlying value as an uint64 and returns a pointer to that value.
internal/parsers/valueparser.go:71
↓ 9 callers
Function
NewFS
NewFS returns a new blockdevice fs using the given mountPoints for proc and sys. It will error if either of these mount points can't be read.
blockdevice/stats.go:237
↓ 8 callers
Method
NewStatus
NewStatus returns the current status information of the process.
proc_status.go:102
↓ 8 callers
Method
PInt64
PInt64 interprets the underlying value as an int64 and returns a pointer to that value.
internal/parsers/valueparser.go:41
↓ 7 callers
Function
NewFS
NewFS returns a new FS mounted under the given mountPoint. It will error if the mount point can't be read.
internal/fs/fs.go:45
↓ 7 callers
Function
canIgnoreError
canIgnoreError returns true if the error is non-fatal and can be ignored. Some kernels and some devices don't expose specific attributes or return err
sysfs/net_class.go:136
↓ 7 callers
Function
firstNonEmptyLine
firstNonEmptyLine advances the scanner to the first non-empty line and returns the contents of that line.
cpuinfo.go:510
↓ 7 callers
Function
parseHumanReadableBytes
(s string)
bcachefs/get.go:175
↓ 7 callers
Function
testProcStatm
(pid int)
proc_statm_test.go:124
↓ 6 callers
Function
NewFS
NewFS returns a new FS mounted under the given mountPoint. It will error if the mount point can't be read.
resctrlfs/fs.go:57
↓ 6 callers
Function
openIfExists
(path string)
bcachefs/get.go:585
↓ 6 callers
Function
parseMountInfo
Reads each line of the mountinfo file, and returns a list of formatted MountInfo structs.
mountinfo.go:56
↓ 5 callers
Method
SASPortClass
SASPortClass parses ports in /sys/class/sas_port. A SAS port in this context is a collection of SAS PHYs operating together. For example, it's commo
sysfs/class_sas_port.go:52
↓ 5 callers
Method
SysBlockDevices
SysBlockDevices lists the device names from /sys/block/<dev>.
blockdevice/stats.go:309
↓ 5 callers
Function
readMountInfo
readMountInfo reads a full mountinfo file (no 1 MiB cap, unlike parsers.ReadFileNoStat).
mountinfo.go:164
↓ 5 callers
Function
testProcStat
(pid int)
proc_stat_test.go:176
↓ 4 callers
Method
GetByName
GetByName returns the SASPhy with the provided name.
sysfs/class_sas_phy.go:163
↓ 4 callers
Method
Int
Int interprets the underlying value as an int and returns that value.
internal/parsers/valueparser.go:37
↓ 4 callers
Method
NVMeClass
NVMeClass returns info for all NVMe devices read from /sys/class/nvme.
sysfs/class_nvme.go:61
↓ 4 callers
Method
NetClassDevices
NetClassDevices scans /sys/class/net for devices and returns them as a list of names.
sysfs/net_class.go:67
↓ 4 callers
Method
NetClassPCIDevice
NetClassPCIDevice returns the PciDevice backing the given network interface by resolving the /sys/class/net/<iface>/device symlink and parsing the cor
sysfs/net_class.go:102
↓ 4 callers
Function
NewFS
NewFS returns a new FS mounted under the given mountPoint. It will error if the mount point can't be read.
selinuxfs/fs.go:39
↓ 4 callers
Function
ParseStats
ParseStats parses a Stats from an input io.Reader, using the format found in /proc/fs/xfs/stat.
xfs/parse.go:27
↓ 4 callers
Method
SASDeviceClass
SASDeviceClass parses devices in /sys/class/sas_device.
sysfs/class_sas_device.go:75
↓ 4 callers
Method
SASHostClass
SASHostClass parses host[0-9]+ devices in /sys/class/sas_host. This generally only exists so that it can pull in SAS Port and SAS PHY entries. The sa
sysfs/class_sas_host.go:49
↓ 4 callers
Function
dehumanize
Dehumanize converts a human-readable byte slice into a uint64.
bcache/get.go:119
↓ 4 callers
Method
fileDescriptors
()
proc.go:291
↓ 4 callers
Function
parseIPPort
(s string)
ipvs.go:209
↓ 4 callers
Function
parseMountStats
parseMountStats parses a /proc/[pid]/mountstats file and returns a slice of Mount structures containing detailed information about each mount. If avai
mountstats.go:274
↓ 4 callers
Function
parseNetIPSocketLine
parseNetIPSocketLine parses a single line, represented by a list of fields.
net_ip_socket.go:163
↓ 4 callers
Method
readValue
readValues reads a number of numerical values into an uint64 slice.
btrfs/get.go:108
↓ 3 callers
Method
AllThreads
AllThreads returns a list of all currently available threads for PID.
thread.go:38
↓ 3 callers
Method
CPUs
CPUs returns a slice of all CPUs in `/sys/devices/system/cpu`.
sysfs/system_cpu.go:75
↓ 3 callers
Method
GetByPhy
GetByPhy finds the SASHost that contains the provided PHY name.
sysfs/class_sas_host.go:101
↓ 3 callers
Function
GetPowerMeters
GetPowerMeters returns a slice of PowerMeter, one for each ACPI 4.0 power meter discovered via /sys/bus/acpi/drivers/power_meter/. Returns nil, nil wh
sysfs/class_power_meter.go:83
↓ 3 callers
Function
GetRaplZones
GetRaplZones returns a slice of RaplZones. When RAPL files are not present, returns nil with error. - https://www.kernel.org/doc/Documentation/power/p
sysfs/class_powercap.go:39
↓ 3 callers
Method
NVMeSubsystemClass
NVMeSubsystemClass returns info for all NVMe subsystems read from sys/class/nvme-subsystem.
sysfs/class_nvme_subsystem.go:72
↓ 3 callers
Method
NetClassByIface
NetClassByIface returns info for a single net interfaces (iface).
sysfs/net_class.go:87
↓ 3 callers
Function
ParseUint64s
ParseUint64s parses a slice of strings into a slice of uint64s.
internal/parsers/parse.go:39
↓ 3 callers
Method
Schedstat
Schedstat returns task scheduling information for the process.
proc.go:332
↓ 3 callers
Method
Strings
()
sysfs/pci_device.go:61
↓ 3 callers
Function
newNetTCP
newNetTCP creates a new NetTCP{,6} from the contents of the given file.
net_tcp.go:59
↓ 3 callers
Function
newNetTCPSummary
(file string)
net_tcp.go:65
↓ 3 callers
Function
newNetUDP
newNetUDP creates a new NetUDP{,6} from the contents of the given file.
net_udp.go:51
↓ 3 callers
Function
newNetUDPSummary
(file string)
net_udp.go:57
↓ 3 callers
Function
parseBuddyInfo
(r io.Reader)
buddyinfo.go:45
↓ 3 callers
Function
parseCPUInfoARM
(info []byte)
cpuinfo.go:190
↓ 3 callers
Function
parseCPURange
(data []byte)
sysfs/system_cpu.go:412
↓ 3 callers
Function
parseConntrackStat
Reads the contents of a conntrack statistics file and parses a slice of ConntrackStatEntries.
net_conntrackstat.go:68
↓ 3 callers
Function
parseMountInfoString
Parses a mountinfo file line, and converts it to a MountInfo struct. An important check here is to see if the hyphen separator, as if it does not exis
mountinfo.go:75
↓ 3 callers
Function
parseProcSchedstat
(contents string)
schedstat.go:98
↓ 3 callers
Method
parseSASDeviceClass
sasDeviceClasses reads all of the SAS devices from a specific set of /sys/class/sas*/ entries. The sas_device, sas_end_device, and sas_expander class
sysfs/class_sas_device.go:52
↓ 3 callers
Function
readSockstat
readSockstat opens and parses a NetSockstat from the input file.
net_sockstat.go:61
↓ 2 callers
Method
AllProcs
AllProcs returns a list of all currently available processes.
proc.go:105
↓ 2 callers
Method
Crypto
Crypto parses an crypto-file (/proc/crypto) and returns a slice of structs containing the relevant info. More information available here: https://ker
crypto.go:56
↓ 2 callers
Method
DMMultipathDevices
DMMultipathDevices discovers DM-multipath devices by scanning sys/block/dm-* and filtering on dm/uuid prefix "mpath-". It returns a slice of DMMultip
blockdevice/dm_multipath.go:57
↓ 2 callers
Method
FileDescriptorsInfo
FileDescriptorsInfo retrieves information about all file descriptors of the process.
proc.go:312
↓ 2 callers
Method
GetByPort
GetByPort finds the SASHost that contains the provided SAS Port name.
sysfs/class_sas_host.go:111
↓ 2 callers
Method
InfiniBandClass
InfiniBandClass returns info for all InfiniBand devices read from sys/class/infiniband.
sysfs/class_infiniband.go:159
↓ 2 callers
Method
InfiniBandClassDevices
InfiniBandClassDevices returns the names of the InfiniBand devices found in sys/class/infiniband without reading any device attributes or counters.
sysfs/class_infiniband.go:141
↓ 2 callers
Method
InfiniBandDevice
InfiniBandDevice returns info for a single InfiniBand device read from sys/class/infiniband/<Name>.
sysfs/class_infiniband.go:180
↓ 2 callers
Method
L3MonInfo
L3MonInfo returns the L3 monitoring capabilities of the CPU. It errors if info/L3_MON is missing, which means the CPU or the kernel does not support
resctrlfs/info.go:43
↓ 2 callers
Method
Limits
Limits returns the current soft limits of the process.
proc_limits.go:89
↓ 2 callers
Method
MonData
MonData returns the monitoring counters of the root control group, one entry per monitoring domain. A domain is a socket, or a CCX on AMD. It errors
resctrlfs/mon_data.go:50
↓ 2 callers
Method
NetDev
NetDev returns kernel/system statistics read from /proc/net/dev.
net_dev.go:51
↓ 2 callers
Method
NetDevSNMP6
Returns kernel/system statistics read from interface files within the /proc/net/dev_snmp6/ directory.
net_dev_snmp6.go:34
↓ 2 callers
Method
NetSoftnetStat
NetSoftnetStat reads data from /proc/net/softnet_stat.
net_softnet.go:59
↓ 2 callers
Function
NewFS
NewFS returns a new Btrfs filesystem using the given sys fs mount point. It will error if the mount point can't be read.
btrfs/get.go:44
↓ 2 callers
Function
NewFS
NewFS returns a new Bcache using the given sys fs mount point. It will error if the mount point can't be read.
bcache/get.go:42
↓ 2 callers
Function
NewFS
NewFS returns a new Bcachefs filesystem using the given sys fs mount point. It will error if the mount point can't be read.
bcachefs/get.go:42
↓ 2 callers
Method
NewTLSStat
NewTLSStat reads the tls_stat statistics.
net_tls_stat.go:64
↓ 2 callers
Method
NewXfrmStat
NewXfrmStat reads the xfrm_stat statistics from the 'proc' filesystem.
net_xfrm.go:102
↓ 2 callers
Function
ParseBool
ParseBool parses a string into a boolean pointer.
internal/parsers/parse.go:102
↓ 2 callers
Function
ParseClientRPCStats
ParseClientRPCStats returns stats read from /proc/net/rpc/nfs.
nfs/parse_nfs.go:26
↓ 2 callers
Function
ParseEcnEnable
parses the ECN enable directory. It takes a path which should be a directory. This directory should have filenames that are uint8 and the content of t
sysfs/net_class_ecn.go:330
↓ 2 callers
Function
ParseEcnIfaceInfo
ParseEcnIfaceInfo scans predefined files in /sys/class/net/<iface>/ecn directory and gets their contents.
sysfs/net_class_ecn.go:181
↓ 2 callers
Function
ParseServerRPCStats
ParseServerRPCStats returns stats read from /proc/net/rpc/nfsd.
nfs/parse_nfsd.go:26
↓ 2 callers
Function
PathExistsAndIsDir
Utility function that given a path will return if the path is a dir or not.
sysfs/net_class_ecn.go:379
↓ 2 callers
Method
PciDeviceVFAddress
PciDeviceVFAddress returns the PCI BDF address of a Virtual Function by resolving the virtfn symlink at /sys/bus/pci/devices/<bdf>/virtfn<vfIndex>.
sysfs/pci_device.go:108
↓ 2 callers
Method
ProcMaps
ProcMaps reads from /proc/[pid]/maps to get the memory-mappings of the process.
proc_maps.go:189
↓ 2 callers
Method
ProcSMapsRollup
ProcSMapsRollup reads from /proc/[pid]/smaps_rollup to get summed memory information of the process. If smaps_rollup does not exists (require kernel
proc_smaps.go:62
↓ 2 callers
Method
ProcStat
ProcStat retrieves XFS filesystem runtime statistics from proc/fs/xfs/stat given the profs mount point.
xfs/xfs.go:516
↓ 2 callers
Method
SASPhyClass
SASPhyClass parses entries in /sys/class/sas_phy.
sysfs/class_sas_phy.go:54
↓ 2 callers
Method
Self
Self returns a process for the current process.
proc.go:77
↓ 2 callers
Method
Stat
Stat returns the current status information of the process.
proc_stat.go:136
↓ 2 callers
Method
Statm
Statm returns the current memory usage information of the process.
proc_statm.go:55
↓ 2 callers
Method
String
()
net_unix.go:224
next →
1–100 of 791, ranked by callers