Commit Graph

95 Commits (6286bea32a8f2c713218dfd925638220a5990ad2)

Author SHA1 Message Date
Sergey Vinogradov 065e609cbf Refactor "process" package
* All context-less wrapping functions (the ones without WithContext
suffix) were moved into process.go since they all are the same.
* Call context is now passed to all underlying functions in
*WithContext() functions.
* All common *BSD bits were moved to process_bsd.go.
* Process.Tgid() method lacked a WithContext counterpart, so
Process.TgidWithContext() was added for uniformity.
* NewProcessWithContext() function was added since NewProcess() is
used a lot throughout the module, and there is no way to pass a
context to it.

This is a part of #761 effort.
shirou 7e94bb8bcd
Merge pull request #775 from TakayukiBGoto/add_additional_gids_support
[Process] Implement Groups() to get additional gids.
Tyler Davis 8d28f1b305 Clean up boolean condition
Tyler Davis 9473d01f0f Fix MemoryMaps on ARM
ARM has some tab characters in smaps instead of spaces, hence switching to strings.Fields instead of strings.Split which handles splitting on all whitespace instead of just spaces.
JuanLeon Lahoz 426b5148e3 Provide an estimation of Iowait metric per process
TakayukiB Goto a93796494b [Process] Define the Groups() only once
TakayukiB Goto f55f202e81 [Process] Implement Groups() to get additional gids.
Lomanic 547679f88e [process] Fix #760 implement IsRunning by checking process with same PID has same CreateTime as current process
Lomanic 36aa63bdd1 [process][linux] Propagate context internally
Lomanic 3eefe64948 [process] Fix #752 sort PIDS returned by process.Pids()
Lomanic 3465186bca [process] Fix #729 check process existence in NewProcess()
Lomanic 2ac72f1fa1 [process][linux] Fix NewProcess() on Linux
Related to #704.
Don't break previous API where a Process is always returned, fix undefined variable p.
Jose De La O 258343806a Preventing file open and bad defer close. Allocating mem as late as
possible
Tyler Dixon 4e81681ab3 code review
Tyler Dixon a02925055c Remove cycle between process and host packages
gopsutil is a transitive dependency of another project that I am integrating
into an internal build system. We target multiple platforms and as a part
of the build system for the large internal repo, we calculate the build
graph used to determine what targets have changed and need to be build /
tested as a single DAG for all platforms.

gopsutil currently does not form a DAG if linux and any other platform are
considered at the same time. linux is the only platform where the process
package imports the host package.

To remove this cycle, the relevant methods have been moved to internal/common
with the linux build tag and are consumed the host and process packages.
mingrammer 017c9f9cbc Fix typos
Lomanic 41e774419f
Merge pull request #643 from wcc526/master
Update process_linux.go for Add process ConnectionsMax
wcc526 462e0f6c2f Update process_linux.go for Add process ConnectionsMax
shirou 457f04671d [process] move PageFaultsStat to process.go
shirou 98c84ed30a [process]: move HWM to MemoryInfo
at least FreeBSD and Darwin has HWM.
shirou a33a26bd97
Merge pull request #567 from tagirb/grouped_memorymaps
implement grouped memorymaps output
shirou 48b37fa45e
Merge pull request #616 from nefeli/linux_page_faults
[process][linux] Export process page fault info
chi-chi weng ec5a8b2a50
Add VmHWM
VmHWM: Peak resident set size ("high water mark").

http://man7.org/linux/man-pages/man5/proc.5.html
David Naylor 414c76f159 [process][linux] Export process page fault info
Add a function for retrieving page fault counts from /proc/[pid]/stat on
Linux.
Lomanic 878e0a701b Fix #596 Implement process.Background and process.Foreground functions
Lomanic e38ea9f318 [process] Don't lose context in ProcessesWithContext() on Windows and Linux
Tagir Bakirov 29b3c3719b fix slice indices
Tagir Bakirov 47166d6a81 implement grouped memorymaps output
Aleksandr Balezin e2c79a1af7 use full cmdline in case of proc renaming
Michal Rostecki 91ac1d66ac process: Check for error objects
shirou 145dca90f7 change to use CommandContext.
shirou 26a4a2f995 [process]: move ErrorNoChildren to platform independent.
Ihde 44ef466a5a Resolve issue #492 to reduce CPU overhead associated with fillFromStat
shirou 6a368fb7cd [process]: add ProcessesWithContext.
shirou cd61c36c4f
Merge branch 'master' into feature/add_context_support
Nick Kirsch 482ca3af6d Parses the tgid field, which is the thread group id (aka user-space process id) on Linux. Returns error on other platforms.
shirou 4c73494c78 Add WithContext functions.
tycho garen 08a382b207 make process.processes function public
Leonid Podolny 7ee4a4c6ff Fix Threads() signature to better match python original
Leonid Podolny 7ad3836ad3 Implement Threads() for Linux
shirou a452de7c73 Merge pull request #346 from phemmer/rlimit-current
add current values to rlimit retrieval
Shirou WAKAYAMA 3aa2ffab12 [process] linux: fix NumFD type inconversion.
Conor Branagan 7b058c7436 Just look at filenames for linux NumFDs call.
In NumFDs we don't care about the contents of the fields, just how many
there are.
WAKAYAMA Shirou 5329f8ba79 [process] fix Document of CreatTime seconds -> milliseconds
Sean Chittenden 635b971c0e
Move from the `syscall` package to the `golang.org/x/sys/{unix,windows}`
Patrick Hemmer 60c32eb847 add current values to rlimit retrieval
Jorick Caberio c432d48337 fix truncated process name of linux
Vyacheslav Kuznetsov 4de4e17f06 Added limit constants. Implemented function to parse process limits from /proc.
Thomas Hipp 68ad8d603c
process: make `ClockTicks` arch-independent
The value for `ClockTicks` is defined as `100` by the Linux kernel for
all currently supported architectures in Go. Therefore, there is no need
to define this constant for each architecture separately.

This fixes #260.

Signed-off-by: Thomas Hipp <thomashipp@gmail.com>
Thomas Hipp eb4a57117f
process: determine page sizes via function
Instead of hard-coding the page size for linux systems, use Go's
`Getpagesize` function.

This resolves #258.

Signed-off-by: Thomas Hipp <thipp@suse.de>