mirror of https://github.com/shirou/gopsutil
disk: add disk_io_counter to FreeBSD by using sysctl(kern.devstat.all).
parent
be5b5a5754
commit
0451709fe3
@ -1,104 +1,111 @@
|
|||||||
// +build freebsd
|
// Created by cgo -godefs - DO NOT EDIT
|
||||||
// +build amd64
|
// cgo -godefs types_freebsd.go
|
||||||
|
|
||||||
package disk
|
package disk
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MntWait = 1
|
sizeofPtr = 0x8
|
||||||
MfsNameLen = 16 /* length of type name including null */
|
sizeofShort = 0x2
|
||||||
MNameLen = 88 /* size of on/from name bufs */
|
sizeofInt = 0x4
|
||||||
|
sizeofLong = 0x8
|
||||||
|
sizeofLongLong = 0x8
|
||||||
|
sizeofLongDouble = 0x8
|
||||||
|
|
||||||
|
DEVSTAT_NO_DATA = 0x00
|
||||||
|
DEVSTAT_READ = 0x01
|
||||||
|
DEVSTAT_WRITE = 0x02
|
||||||
|
DEVSTAT_FREE = 0x03
|
||||||
|
|
||||||
|
MNT_RDONLY = 0x00000001
|
||||||
|
MNT_SYNCHRONOUS = 0x00000002
|
||||||
|
MNT_NOEXEC = 0x00000004
|
||||||
|
MNT_NOSUID = 0x00000008
|
||||||
|
MNT_UNION = 0x00000020
|
||||||
|
MNT_ASYNC = 0x00000040
|
||||||
|
MNT_SUIDDIR = 0x00100000
|
||||||
|
MNT_SOFTDEP = 0x00200000
|
||||||
|
MNT_NOSYMFOLLOW = 0x00400000
|
||||||
|
MNT_GJOURNAL = 0x02000000
|
||||||
|
MNT_MULTILABEL = 0x04000000
|
||||||
|
MNT_ACLS = 0x08000000
|
||||||
|
MNT_NOATIME = 0x10000000
|
||||||
|
MNT_NOCLUSTERR = 0x40000000
|
||||||
|
MNT_NOCLUSTERW = 0x80000000
|
||||||
|
MNT_NFS4ACLS = 0x00000010
|
||||||
|
|
||||||
|
MNT_WAIT = 1
|
||||||
|
MNT_NOWAIT = 2
|
||||||
|
MNT_LAZY = 3
|
||||||
|
MNT_SUSPEND = 4
|
||||||
)
|
)
|
||||||
|
|
||||||
// sys/mount.h
|
type (
|
||||||
const (
|
_C_short int16
|
||||||
MntReadOnly = 0x00000001 /* read only filesystem */
|
_C_int int32
|
||||||
MntSynchronous = 0x00000002 /* filesystem written synchronously */
|
_C_long int64
|
||||||
MntNoExec = 0x00000004 /* can't exec from filesystem */
|
_C_long_long int64
|
||||||
MntNoSuid = 0x00000008 /* don't honor setuid bits on fs */
|
_C_long_double int64
|
||||||
MntUnion = 0x00000020 /* union with underlying filesystem */
|
|
||||||
MntAsync = 0x00000040 /* filesystem written asynchronously */
|
|
||||||
MntSuidDir = 0x00100000 /* special handling of SUID on dirs */
|
|
||||||
MntSoftDep = 0x00200000 /* soft updates being done */
|
|
||||||
MntNoSymFollow = 0x00400000 /* do not follow symlinks */
|
|
||||||
MntGEOMJournal = 0x02000000 /* GEOM journal support enabled */
|
|
||||||
MntMultilabel = 0x04000000 /* MAC support for individual objects */
|
|
||||||
MntACLs = 0x08000000 /* ACL support enabled */
|
|
||||||
MntNoATime = 0x10000000 /* disable update of file access time */
|
|
||||||
MntClusterRead = 0x40000000 /* disable cluster read */
|
|
||||||
MntClusterWrite = 0x80000000 /* disable cluster write */
|
|
||||||
MntNFS4ACLs = 0x00000010
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Statfs struct {
|
type Statfs struct {
|
||||||
FVersion uint32 /* structure version number */
|
Version uint32
|
||||||
FType uint32 /* type of filesystem */
|
Type uint32
|
||||||
FFlags uint64 /* copy of mount exported flags */
|
Flags uint64
|
||||||
FBsize uint64 /* filesystem fragment size */
|
Bsize uint64
|
||||||
FIosize uint64 /* optimal transfer block size */
|
Iosize uint64
|
||||||
FBlocks uint64 /* total data blocks in filesystem */
|
Blocks uint64
|
||||||
FBfree uint64 /* free blocks in filesystem */
|
Bfree uint64
|
||||||
FBavail int64 /* free blocks avail to non-superuser */
|
Bavail int64
|
||||||
FFiles uint64 /* total file nodes in filesystem */
|
Files uint64
|
||||||
FFfree int64 /* free nodes avail to non-superuser */
|
Ffree int64
|
||||||
FSyncwrites uint64 /* count of sync writes since mount */
|
Syncwrites uint64
|
||||||
FAsyncwrites uint64 /* count of async writes since mount */
|
Asyncwrites uint64
|
||||||
FSyncreads uint64 /* count of sync reads since mount */
|
Syncreads uint64
|
||||||
FAsyncreads uint64 /* count of async reads since mount */
|
Asyncreads uint64
|
||||||
FSpare [10]uint64 /* unused spare */
|
Spare [10]uint64
|
||||||
FNamemax uint32 /* maximum filename length */
|
Namemax uint32
|
||||||
FOwner uint32 /* user that mounted the filesystem */
|
Owner uint32
|
||||||
FFsid int32 /* filesystem id */
|
Fsid Fsid
|
||||||
FCharspare [80]byte /* spare string space */
|
Charspare [80]int8
|
||||||
FFstypename [MfsNameLen]byte /* filesystem type name */
|
Fstypename [16]int8
|
||||||
FMntfromname [MNameLen]byte /* mounted filesystem */
|
Mntfromname [88]int8
|
||||||
FMntonname [MNameLen]byte /* directory on which mounted */
|
Mntonname [88]int8
|
||||||
|
}
|
||||||
|
type Fsid struct {
|
||||||
|
Val [2]int32
|
||||||
}
|
}
|
||||||
|
|
||||||
// /usr/include/devstat.h
|
type Devstat struct {
|
||||||
// devstat_getdevs()
|
Sequence0 uint32
|
||||||
// kern.devstat.all -> devstats list struct
|
Allocated int32
|
||||||
|
Start_count uint32
|
||||||
// struct devinfo {
|
End_count uint32
|
||||||
// struct devstat *devices;
|
Busy_from Bintime
|
||||||
// u_int8_t *mem_ptr;
|
Dev_links _Ctype_struct___0
|
||||||
// long generation;
|
Device_number uint32
|
||||||
// int numdevs;
|
Device_name [16]int8
|
||||||
// };
|
Unit_number int32
|
||||||
//
|
Bytes [4]uint64
|
||||||
// struct statinfo {
|
Operations [4]uint64
|
||||||
// long cp_time[CPUSTATES];
|
Duration [4]Bintime
|
||||||
// long tk_nin;
|
Busy_time Bintime
|
||||||
// long tk_nout;
|
Creation_time Bintime
|
||||||
// struct devinfo *dinfo;
|
Block_size uint32
|
||||||
// long double snap_time;
|
Pad_cgo_0 [4]byte
|
||||||
// };
|
Tag_types [3]uint64
|
||||||
|
Flags uint32
|
||||||
// /usr/include/devinfo.h
|
Device_type uint32
|
||||||
|
Priority uint32
|
||||||
|
Pad_cgo_1 [4]byte
|
||||||
|
Id *byte
|
||||||
|
Sequence1 uint32
|
||||||
|
Pad_cgo_2 [4]byte
|
||||||
|
}
|
||||||
|
type Bintime struct {
|
||||||
|
Sec int64
|
||||||
|
Frac uint64
|
||||||
|
}
|
||||||
|
|
||||||
// struct devinfo_dev {
|
type _Ctype_struct___0 struct {
|
||||||
// devinfo_handle_t dd_handle; /* device handle */
|
Empty uint64
|
||||||
// devinfo_handle_t dd_parent; /* parent handle */
|
}
|
||||||
// char *dd_name; /* name of device */
|
|
||||||
// char *dd_desc; /* device description */
|
|
||||||
// char *dd_drivername; /* name of attached driver */
|
|
||||||
// char *dd_pnpinfo; /* pnp info from parent bus */
|
|
||||||
// char *dd_location; /* Where bus thinks dev at */
|
|
||||||
// uint32_t dd_devflags; /* API flags */
|
|
||||||
// uint16_t dd_flags; /* internal dev flags */
|
|
||||||
// device_state_t dd_state; /* attachment state of dev */
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// struct devinfo_rman {
|
|
||||||
// devinfo_handle_t dm_handle; /* resource manager handle */
|
|
||||||
// u_long dm_start; /* resource start */
|
|
||||||
// u_long dm_size; /* resource size */
|
|
||||||
// char *dm_desc; /* resource description */
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// struct devinfo_res {
|
|
||||||
// devinfo_handle_t dr_handle; /* resource handle */
|
|
||||||
// devinfo_handle_t dr_rman; /* resource manager handle */
|
|
||||||
// devinfo_handle_t dr_device; /* owning device */
|
|
||||||
// u_long dr_start; /* region start */
|
|
||||||
// u_long dr_size; /* region size */
|
|
||||||
// };
|
|
||||||
|
Loading…
Reference in New Issue