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.
6 years ago
Jose De La O
258343806a
Preventing file open and bad defer close. Allocating mem as late as
...
possible
6 years ago
Tyler Dixon
4e81681ab3
code review
6 years ago
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.
6 years ago
mingrammer
017c9f9cbc
Fix typos
6 years ago
Lomanic
41e774419f
Merge pull request #643 from wcc526/master
...
Update process_linux.go for Add process ConnectionsMax
6 years ago
wcc526
462e0f6c2f
Update process_linux.go for Add process ConnectionsMax
6 years ago
shirou
457f04671d
[process] move PageFaultsStat to process.go
6 years ago
shirou
98c84ed30a
[process]: move HWM to MemoryInfo
...
at least FreeBSD and Darwin has HWM.
6 years ago
shirou
a33a26bd97
Merge pull request #567 from tagirb/grouped_memorymaps
...
implement grouped memorymaps output
6 years ago
shirou
48b37fa45e
Merge pull request #616 from nefeli/linux_page_faults
...
[process][linux] Export process page fault info
6 years ago
chi-chi weng
ec5a8b2a50
Add VmHWM
...
VmHWM: Peak resident set size ("high water mark").
http://man7.org/linux/man-pages/man5/proc.5.html
6 years ago
David Naylor
414c76f159
[process][linux] Export process page fault info
...
Add a function for retrieving page fault counts from /proc/[pid]/stat on
Linux.
6 years ago
Lomanic
878e0a701b
Fix #596 Implement process.Background and process.Foreground functions
6 years ago
Lomanic
e38ea9f318
[process] Don't lose context in ProcessesWithContext() on Windows and Linux
7 years ago
Tagir Bakirov
29b3c3719b
fix slice indices
7 years ago
Tagir Bakirov
47166d6a81
implement grouped memorymaps output
7 years ago
Aleksandr Balezin
e2c79a1af7
use full cmdline in case of proc renaming
7 years ago
Michal Rostecki
91ac1d66ac
process: Check for error objects
7 years ago
shirou
145dca90f7
change to use CommandContext.
7 years ago
shirou
26a4a2f995
[process]: move ErrorNoChildren to platform independent.
7 years ago
Ihde
44ef466a5a
Resolve issue #492 to reduce CPU overhead associated with fillFromStat
7 years ago
shirou
6a368fb7cd
[process]: add ProcessesWithContext.
7 years ago
shirou
cd61c36c4f
Merge branch 'master' into feature/add_context_support
7 years ago
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.
7 years ago
shirou
4c73494c78
Add WithContext functions.
7 years ago
tycho garen
08a382b207
make process.processes function public
7 years ago
Leonid Podolny
7ee4a4c6ff
Fix Threads() signature to better match python original
8 years ago
Leonid Podolny
7ad3836ad3
Implement Threads() for Linux
8 years ago
shirou
a452de7c73
Merge pull request #346 from phemmer/rlimit-current
...
add current values to rlimit retrieval
8 years ago
Shirou WAKAYAMA
3aa2ffab12
[process] linux: fix NumFD type inconversion.
8 years ago
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.
8 years ago
WAKAYAMA Shirou
5329f8ba79
[process] fix Document of CreatTime seconds -> milliseconds
8 years ago
Sean Chittenden
635b971c0e
Move from the `syscall` package to the `golang.org/x/sys/{unix,windows}`
8 years ago
Patrick Hemmer
60c32eb847
add current values to rlimit retrieval
8 years ago
Jorick Caberio
c432d48337
fix truncated process name of linux
8 years ago
Vyacheslav Kuznetsov
4de4e17f06
Added limit constants. Implemented function to parse process limits from /proc.
8 years ago
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>
9 years ago
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>
9 years ago
Nick Cabatoff
28640e5d73
fix incorrect names for fields in proc/pid/io
9 years ago
Shirou WAKAYAMA
860f5a0803
[process]linux: update comment to show godoc.org.
9 years ago
Shirou WAKAYAMA
bd1b04fe67
[process]linux: add document to Status.
9 years ago
Shannon Wynter
f99d495462
Run goimports before committing...
9 years ago
Shannon Wynter
a4387d0c92
emulate original behaviour
9 years ago
Shannon Wynter
c903f14189
Remove the requirement to use lsof by using the information provided in status to get the parent pid
9 years ago
Shirou WAKAYAMA
613a8a90e1
fixed by golint.
9 years ago
Shirou WAKAYAMA
15a7edb712
[process]linux: linux process status change to "R" not "Running" see #173
9 years ago
Shirou WAKAYAMA
4bb84648bf
JSON representation is renamed to fit Google JSON style, camelCase.
9 years ago
Shirou WAKAYAMA
46ddd57c72
process has NetIOCounters and IOCounters.
9 years ago
Shirou WAKAYAMA
ea152ea901
[BREAKING CHANGE] rename functions to pass golint. ex) net.NetIOCounters -> net.IOCounters
9 years ago
raviparimi
be2dab5a40
Provide correct length for slice creation.
...
- Creating a slice of length numFDs and later appending elements to it
results in a slice whose first numFDs elements are all nil. It is
sufficient to create a slice of zero length since we are appending
elements to it.
- The current allocation will make ret a slice of length 0. What's
needed is a slice of length len(ofs).
9 years ago
Alexander Inozemtsev
f4902fae49
Properly close opened file
9 years ago
shirou
1ab11f7afd
Merge pull request #167 from cgilling/cmdline_slice
...
process: add CmdlineSlice function for linux + freebsd
9 years ago
Chris Gilling
a3bbd9e3cd
process: change linux NewProcess to only stat /proc/[pid]
...
Before it was doing a fillFromStatus() call which was much slower
and none of the information was needed, except by the Name() func
which now will call fillFromStatus() if p.name is not set.
9 years ago
Chris Gilling
d098bf135f
process: fix bug in CmdlineSlice where cmdline is empty
...
Sometimes (at least on linux) cmdline is empty, this was causing
a panic.
9 years ago
Chris Gilling
b8c40ac83c
process: add CmdlineSlice function for linux + freebsd
...
This allows for getting more exact information about each argument
especially if there are arguments that have spaces in them.
This was not implemented for darwin or for windows because they
both currently have not way of properly parsing the cmdline string.
Darwin parses the output of 'ps' which is already whitespace
segmented, and windows just has the cmdline string.
9 years ago
Shirou WAKAYAMA
97bcc355a6
[process]linux: change to use exec.LookPath to invoke lsof.
9 years ago
Johan Walles
70444b571b
process: Implement platform independent MemoryPercent()
...
It calls mem.VirtualMemory() and process.MemoryInfo(), so on the platforms where
those work MemoryPercent() will as well.
Tested on Darwin.
9 years ago
Ben Aldrich
faeb99d327
fix meminfo output on consecutive calls
9 years ago
Robert Weber
c804a9e755
Per suggestions
9 years ago
Robert Weber
4dcb099f3d
no or
9 years ago
Robert Weber
6496b57b3d
Need to promote this error
9 years ago
Shirou WAKAYAMA
d680853370
net,process[linux]: add process.NetIOCounter and net.NetIOCounterByFile.
9 years ago
Jimmi Dyson
7e4cef7a30
Handle process filenames with spaces in the name
...
Fixes #120
9 years ago
shirou
d49c4afc40
Merge pull request #96 from shirou/process/fix_openfiles
...
process[linux]: implements OpenFiles.
9 years ago
Shirou WAKAYAMA
dd13300833
process[linux,freebsd,darwin]: implements Children using pgrep.
9 years ago
Daniel Theophanes
0af895258e
common: rename package common to internal/common. Add ENV helper funcs.
...
Package common wasn't used for public functions. Place it in an
internal directory to prevent other packages from using.
Remove the distributed references to "HOST_PROC" and "HOST_SYS"
consts and combine into a common function. This also helps so that
if a env var is defined with a trailing slash all will continue to
work as expected.
Fixes #100
10 years ago
Jonathan Chauncey
0461c50666
chore(*): Fixes #94
...
Added the ability to fetch an alternative location for /proc via an
environment variable. If the env var is not set it will return /proc as
the default value.
10 years ago
Shirou WAKAYAMA
42af4a3e60
process[linux]: implements OpenFiles.
10 years ago
andy
cf5660bfd3
process[linux]: calculate the CreateTime and then convert to microseconds
10 years ago
Shirou WAKAYAMA
b3cf7354f6
process[linux, darwin]: implements Connections using lsof.
10 years ago
Shirou WAKAYAMA
d6ac361a24
process[darwin,linux]: implements Parent using lsof.
10 years ago
Shirou WAKAYAMA
a00c5af817
process[linux]: return up-to-date information when invoked.
10 years ago
choplin
cc3a104593
Ensure that process.MemoryInfo returns a up-to-date value.
10 years ago
Shirou WAKAYAMA
a22c0c27d9
linux: fix ctime in linux.
10 years ago
Shirou WAKAYAMA
0921e1f153
[linux] Process.CreateTime was returned msec, not sec.
10 years ago
Nikolay Sivko
889c8c0bd5
enable Process.NumFds() for linux
10 years ago
Shirou WAKAYAMA
1f5fdd1fba
process: user and system should be divide by ClockTicks directly.
10 years ago
Shirou WAKAYAMA
e39f17afd7
process: fix process status parsing.
10 years ago
Shirou WAKAYAMA
2093d43c2a
process: implement cpu_percent on linux.
10 years ago
Shirou WAKAYAMA
4ead971d70
fix CPUTimes type change problem on other packages.
10 years ago
Shirou WAKAYAMA
13cd195a7e
change package name.
10 years ago
Shirou WAKAYAMA
a1c1d7b25f
fix on Linux.
10 years ago
Shirou WAKAYAMA
a4671fcc2a
move subdirectories. refer to issue #24
10 years ago