Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/sys/unix: add linux cachestat system call #176

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions unix/linux/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,20 @@ struct my_can_bittiming_const {

struct riscv_hwprobe {};
#endif

// copied from /usr/include/uapi/linux/mman.h
struct cachestat_range {
__u64 off;
__u64 len;
};

struct cachestat {
__u64 nr_cache;
__u64 nr_dirty;
__u64 nr_writeback;
__u64 nr_evicted;
__u64 nr_recently_evicted;
};
*/
import "C"

Expand Down Expand Up @@ -5813,3 +5827,6 @@ const (
type SchedAttr C.struct_sched_attr

const SizeofSchedAttr = C.sizeof_struct_sched_attr

type Cachestat_t C.struct_cachestat
type CachestatRange C.struct_cachestat_range
2 changes: 2 additions & 0 deletions unix/syscall_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -2482,3 +2482,5 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) {
}
return attr, nil
}

//sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error)
10 changes: 10 additions & 0 deletions unix/zsyscall_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions unix/ztypes_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.