Commit Graph
20 Commits
Author SHA1 Message Date
Alban Crequy d715ccc391 ebpf: handle fd_install events from tcptracer-bpf
Since https://github.com/weaveworks/tcptracer-bpf/pull/39, tcptracer-bpf
can generate "fd_install" events when a process installs a new file
descriptor in its fd table. Those events must be requested explicitely
on a per-pid basis with tracer.AddFdInstallWatcher(pid).

This is useful to know about "accept" events that would otherwise be
missed because kretprobes are not triggered for functions that were
called before the installation of the kretprobe.

This patch find all the processes that are currently blocked on an
accept() syscall during the EbpfTracker initialization.
feedInitialConnections() will use tracer.AddFdInstallWatcher() to
subscribe to fd_install  events. When a fd_install event is received,
synthesise an accept event with the connection tuple and the network
namespace (from /proc).
2017-05-19 14:49:38 +02:00
Alban Crequy 598c6a0238 proc walker: cache limits and cmdline/name after parsing 2017-05-05 13:05:08 +02:00
Alban Crequy 3a8a09a606 proc walker: optimize readLimits 2017-05-05 13:05:08 +02:00
Alban Crequy bdb09f5f9d proc walker: optimize readStats 2017-05-05 13:05:08 +02:00
Alban Crequy 640b240469 proc walker: optimize open file counter
Golang's ReadDirNames is expensive and better avoided when we don't care
about the names.
2017-05-02 14:45:12 +02:00
Matthias Radestock 245c2e9149 fall back to /proc/<pid>/comm for process name
when proc/<pid>/cmdline is empty, which is the case for some system
and defunct processes.

Fixes #2315
2017-03-09 14:02:32 +00:00
Jonathan Lange e8085b01b6 Use 'common' library 2016-12-07 11:22:38 +00:00
Paul Bellamy c075939379 Forgot debug println 2016-04-07 12:33:34 +01:00
Paul Bellamy b970b0561b Set the memory and open files maximums
process memory limit is not cgroup-aware
2016-04-06 13:07:55 +01:00
Paul Bellamy 44dada25f2 Review Feedback 2016-02-16 10:37:25 +00:00
Paul Bellamy 5bb3d49297 gather file descriptors as process metric 2016-02-12 17:13:27 +00:00
Tom Wilkie e9e152b9a3 Use argv[0] for process name to be more like ps. 2016-01-06 11:55:34 +00:00
Tom Wilkie caff695f96 Gather per-process CPU and memory metrics. 2015-12-16 14:38:21 +00:00
Tom Wilkie cde5920f9a Cache the contents of some files in /proc
Also cache contents of /proc/foo/stat, but only for 10s.
2015-12-11 10:27:15 +00:00
Tom Wilkie 1fcd079563 Use Readdirnames to reduce number of stats we're doing. 2015-12-10 14:43:40 +00:00
Tom Wilkie cc5935a89d Review feedback 2015-12-10 14:10:36 +00:00
Tom Wilkie ed6c4088fa Fix up tests. 2015-12-10 14:00:43 +00:00
Tom Wilkie 7d6b5a540e Revert "Merge pull request #450 from weaveworks/scope-284"
This reverts commit 46345e3bdb, reversing
changes made to bf3e9a1601.

Conflicts:
	probe/process/walker_darwin.go
2015-09-15 03:14:39 +00:00
Alvaro Saurin 4331fb1c79 Drop all the dependencies we had on procspy by moving some code to probe. 2015-09-14 10:44:53 +02:00
Peter Bourgon b585a362ac Naïve process walker for Darwin
This fixes the regression where process names weren't appearing for
Darwin probes. Makes testing easier.

Also, changes the process walker to operate on value types. There's no
performance advantage to using reference types for something of this
size, and there appeared to be a data race in the Darwin port that
caused nodes to gain and lose process names over time.

Also, restructures how to enable docker scraping. Default false when run
manually, and enabled via --probe.docker true in the scope script.
2015-07-16 12:33:59 +02:00