diff options
author | chris.zn <chris.zn@alibaba-inc.com> | 2019-05-29 16:48:19 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-05-30 12:07:40 -0700 |
commit | b18df9bed6af3ff9b526c9ebdcde33dffeac161e (patch) | |
tree | e5b3b56d1edc92f3d9853245f7161393ead4428b /pkg/sentry/fs/proc | |
parent | 035a8fa38ed21da2e06db22d3dfd6122610fb856 (diff) |
Add VmData field to /proc/{pid}/status
VmData is the size of private data segments.
It has the same meaning as in Linux.
Change-Id: Iebf1ae85940a810524a6cde9c2e767d4233ddb2a
PiperOrigin-RevId: 250593739
Diffstat (limited to 'pkg/sentry/fs/proc')
-rw-r--r-- | pkg/sentry/fs/proc/task.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/sentry/fs/proc/task.go b/pkg/sentry/fs/proc/task.go index 494b195cd..77e03d349 100644 --- a/pkg/sentry/fs/proc/task.go +++ b/pkg/sentry/fs/proc/task.go @@ -578,7 +578,7 @@ func (s *statusData) ReadSeqFileData(ctx context.Context, h seqfile.SeqHandle) ( } fmt.Fprintf(&buf, "TracerPid:\t%d\n", tpid) var fds int - var vss, rss uint64 + var vss, rss, data uint64 s.t.WithMuLocked(func(t *kernel.Task) { if fdm := t.FDMap(); fdm != nil { fds = fdm.Size() @@ -586,11 +586,13 @@ func (s *statusData) ReadSeqFileData(ctx context.Context, h seqfile.SeqHandle) ( if mm := t.MemoryManager(); mm != nil { vss = mm.VirtualMemorySize() rss = mm.ResidentSetSize() + data = mm.VirtualDataSize() } }) fmt.Fprintf(&buf, "FDSize:\t%d\n", fds) fmt.Fprintf(&buf, "VmSize:\t%d kB\n", vss>>10) fmt.Fprintf(&buf, "VmRSS:\t%d kB\n", rss>>10) + fmt.Fprintf(&buf, "VmData:\t%d kB\n", data>>10) fmt.Fprintf(&buf, "Threads:\t%d\n", s.t.ThreadGroup().Count()) creds := s.t.Credentials() fmt.Fprintf(&buf, "CapInh:\t%016x\n", creds.InheritableCaps) |