procfs

Rust library for reading the Linux procfs filesystem

OTHER License

Downloads
23.7M
Stars
367
Committers
72

Bot releases are hidden (Show)

procfs - v0.16.0 Latest Release

Published by eminence 12 months ago

This release contains a fairly large internal restructuring, which has noticeable public API changes. A lot of core functionality has been brought into a new procfs-core crate that contains platform-independent data structures and parsing. This crate can be used on all platforms. The procfs crate now depends on procfs-core, and contains all of the Linux-specific code (and thus remains only usable on Linux).

Some procfs functions require information about the running system. For example, the rss_bytes() function needs to know the page size. These functions now have a more complicated API. See the docs for more information, but generally you now have to add a call to .get(), for example:

Old:

let prc = procfs::process::Process::myself().unwrap();
let stat = prc.stat().unwrap();
println!("RSS:   {} bytes", stat.rss_bytes());

New:

use procfs::prelude::*;  // to bring `WithCurrentSystemInfo` into scope

let prc = procfs::process::Process::myself().unwrap();
let stat = prc.stat().unwrap();
println!("RSS:   {} bytes", stat.rss_bytes().get());

We think this new complication is unavoidable, but if you have some thoughts on this, your ideas are welcome in a new issue or discussion thread

New Features

Bug Fixes

Full Changelog: https://github.com/eminence/procfs/compare/v0.15.1...v0.16.0

procfs - v0.15.1

Published by eminence over 1 year ago

New features

New Contributors

Full Changelog: https://github.com/eminence/procfs/compare/v0.15.0...v0.15.1

procfs - v0.15.0

Published by eminence over 1 year ago

New Features

Bug fixes

Breaking changes

New Contributors

Full Changelog: https://github.com/eminence/procfs/compare/v0.14.2...v0.15.0

MSRV Note

This v0.15 release is only tested against the latest stable rust compiler, but is known to work with older versions (down to rust 1.48). Support for these older compilers may break in procfs patch releases. See also #223

procfs - v0.14.2

Published by eminence almost 2 years ago

New Features

Bug fixes

Dependency Updates

Full Changelog: https://github.com/eminence/procfs/compare/v0.14.0...v0.14.2

procfs - v0.14.1

Published by eminence about 2 years ago

Bug fixes

Full Changelog: https://github.com/eminence/procfs/compare/v0.14.0...v0.14.1

procfs - v0.13.3

Published by eminence about 2 years ago

Bug fixes

Full Changelog: https://github.com/eminence/procfs/compare/v0.13.2...v0.13.3

procfs - v0.14.0

Published by eminence about 2 years ago

Breaking changes

New features

Other changes

Full Changelog: https://github.com/eminence/procfs/compare/v0.13.2...v0.14.0

procfs - v0.13.2

Published by eminence over 2 years ago

New features

procfs - v0.13.1

Published by eminence over 2 years ago

Bug fixes

Note: This fix is technically a breaking change, as the return value for a public API changed from HashMap<u32, u32> to HashMap<u64, u64>. However, since this function has been 100% broken for 4 years, I feel confident that no one is actually using this API.

New features

Other improvements

Full Changelog: https://github.com/eminence/procfs/compare/v0.13.0...v0.13.1

procfs - v0.13.0

Published by eminence over 2 years ago

Breaking changes

This release has several breaking API changes you should be aware of:

  • MSRV has been changed from 1.34 to 1.48
  • The Process struct has been changed in some important ways:
    • Internally, it now maintains a handle to an opened /proc/<pid> directory. So each Process will have an open file handle, which can matter in extreme cases when you have a large number of Process objects created.
    • Because each Process has a handle to its opened proc directory, there is no longer any PID reuse problems (that is, there is no risk of accidentally getting process information for a new process that has reused a PID)
    • Process no longer implements Clone.
    • Process no longer has a public member stats member that gets pre-populated on construction. If you want this info, you now need to explicitly call the Process::stat() function

New features

Internal changes

Full Changelog: https://github.com/eminence/procfs/compare/v0.12.0...v0.13.0

procfs - v0.12.0

Published by eminence almost 3 years ago

Breaking changes

The flate2 dependencies was used only in the kernel_config method, which would try to read a compressed /proc/config.gz file if it existed. The flate2 dependency is now optional (and enabled by default). If you are using procfs with "default-features = false" and you are using the kernel_config method, pay special attention here -- you might want to manually enable the flate2 feature.

New features

Bug fixes

Full Changelog: https://github.com/eminence/procfs/compare/v0.11.0...v0.12.0

procfs - v0.11.1

Published by eminence almost 3 years ago

Bug fixes

procfs - v0.11.0

Published by eminence about 3 years ago

Breaking changes

  • Switch to u64 from usize in many places by @h33p in https://github.com/eminence/procfs/pull/147
    • On 64-bit machines, this change should have no impact on behavior, but it is still a breaking change as these types are part of the public API.
  • Remove unwraps from our lazy statics by @eminence in https://github.com/eminence/procfs/pull/150
    • This change should make procfs panic even less, but as the cost of a breaking API change that wraps the return value of some functions in a Result

New Features

Bug fixes

New Contributors

Full Changelog: https://github.com/eminence/procfs/compare/v0.10.1...v0.11.0

procfs - v0.10.1

Published by eminence about 3 years ago

Note The v0.10.1 release was actually released August 26, 2021. This release created in github was done after the fact

What's Changed

New features

Bug fixes

New Contributors

Full Changelog: https://github.com/eminence/procfs/compare/v0.10.0...v0.10.1

procfs - v0.10.0

Published by eminence about 3 years ago

Breaking changes

  • Use u16 for kernel patch version number #137
  • Changed inodes to u64, fixed a test, and updated a doc string #132

New features

  • Derive Clone for all public structs and enums. #128
  • Get all processes with a custom root of /proc path #122
  • Create FDInfo from raw fd and pid #123
  • feat: create task by specify pid and tid #134
  • Add support for /proc/pid/ns #135

Bug fixes

  • When writing files, don't open the file for read #120
  • Pin hex to 0.4.2 to restore MSRV of 1.34 #129
procfs - v0.9.0

Published by eminence almost 4 years ago

Please note that this are several API incompatible changes, compared to the 0.8.x release. Also, the Minimum Supported Rust Version has been changed from 1.33.0 to 1.34.0

New features

  • Swap libflate for flate2 (#100)
  • Support /proc/[pid]/task/[tid]/status (#110)
  • Introduce fd_count() in addition to fd() (#105)
  • Add Android support (#95)

Bug fixes

  • Handle locks that are marked as "blocked" (#109)

Breaking changes

  • Minimum supported rust version has been changed from 1.33.0 to 1.34.0
  • Remove deprecated functions (#107)
  • Store cputime in ticks, not fractional seconds (#106)
  • Add a private field to some large structs (#101)
procfs - v0.8.1

Published by eminence about 4 years ago

(Released September 8, 2020)

New Features

  • A new method Process::task_main_thread to get the task for the main thread (#93)
  • A new method Task::Io() (#91)

Bug fixes

  • Fixed parsing of /proc/cpuinfo on systems that add extra info at the end of the file (like on a Raspberry Pi) (#92)
procfs - v0.8.0

Published by eminence over 4 years ago

New features

Several new sysctl functions are added, in the following areas:

  • epoll
  • fs
  • keyring
  • kernel

Support for parsing new files, in the following areas:

  • kernel keyrings
  • Listing tasks (threads) in a process
  • File locks
  • ARP table

Bug fixes

  • Procfs should panic even less often now, when parsing garbage data

Breaking changes

  • A typo is fixed in the name of a public field: hugetlbpages (#83)
procfs - v0.7.9

Published by eminence over 4 years ago

New Features:

  • Update version of libflate to v1.0. #73
  • Add support for diskstat info. #71
  • Add support for reading /proc/modules
procfs - v0.7.8

Published by eminence over 4 years ago

New features:

  • Cache boottime to improve performance (for example, when calling starttime()). #64

Bug fixes:

  • Fix parsing of IPv6 addresses. #67