https://github.com/mdlayher/taskstats
Package taskstats provides access to Linux's taskstats interface, for sending per-task and per-process statistics from the kernel to userspace. MIT Licensed.
https://github.com/mdlayher/taskstats
genetlink golang linux netlink taskstats
Last synced: 12 months ago
JSON representation
Package taskstats provides access to Linux's taskstats interface, for sending per-task and per-process statistics from the kernel to userspace. MIT Licensed.
- Host: GitHub
- URL: https://github.com/mdlayher/taskstats
- Owner: mdlayher
- License: mit
- Created: 2017-09-08T21:11:23.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2025-03-13T01:28:22.000Z (about 1 year ago)
- Last Synced: 2025-04-13T00:47:29.467Z (12 months ago)
- Topics: genetlink, golang, linux, netlink, taskstats
- Language: Go
- Size: 53.7 KB
- Stars: 64
- Watchers: 5
- Forks: 17
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# taskstats [](https://github.com/mdlayher/taskstats/actions) [](https://pkg.go.dev/github.com/mdlayher/taskstats) [](https://goreportcard.com/report/github.com/mdlayher/taskstats)
Package `taskstats` provides access to Linux's taskstats interface, for sending
per-task, per-process, and cgroup statistics from the kernel to userspace. MIT
Licensed.
For more information on taskstats, please see:
- https://www.kernel.org/doc/Documentation/accounting/cgroupstats.txt
- https://www.kernel.org/doc/Documentation/accounting/taskstats.txt
- https://www.kernel.org/doc/Documentation/accounting/taskstats-struct.txt
- https://andrestc.com/post/linux-delay-accounting/
## Notes
* When instrumenting Go programs, use either the `taskstats.Self()` or
`taskstats.TGID()` method. Using the `PID()` method on multithreaded
programs, including Go programs, will produce inaccurate results.
* Access to taskstats requires that the application have at least `CAP_NET_RAW`
capability (see
[capabilities(7)](http://man7.org/linux/man-pages/man7/capabilities.7.html)).
Otherwise, the application must be run as root.
* If running the application in a container (e.g. via Docker), it cannot be run
in a network namespace -- usually this means that host networking must be
used.