Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse StartCode, EndCode, and StartStack in Proc.Stat() #659

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions proc_stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ type ProcStat struct {
RSS int
// Soft limit in bytes on the rss of the process.
RSSLimit uint64
// The address above which program text can run.
StartCode uint64
// The address below which program text can run.
EndCode uint64
// The address of the start (i.e., bottom) of the stack.
StartStack uint64
// CPU number last executed on.
Processor uint
// Real-time scheduling priority, a number in the range 1 to 99 for processes
Expand Down Expand Up @@ -177,9 +183,9 @@ func (p Proc) Stat() (ProcStat, error) {
&s.VSize,
&s.RSS,
&s.RSSLimit,
&ignoreUint64,
&ignoreUint64,
&ignoreUint64,
&s.StartCode,
&s.EndCode,
&s.StartStack,
&ignoreUint64,
&ignoreUint64,
&ignoreUint64,
Expand Down
3 changes: 3 additions & 0 deletions proc_stat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ func TestProcStat(t *testing.T) {
have uint64
}{
{name: "RSS Limit", want: 18446744073709551615, have: s.RSSLimit},
{name: "Start Code", want: 4194304, have: s.StartCode},
{name: "End Code", want: 6294284, have: s.EndCode},
{name: "Start Stack", want: 140736914091744, have: s.StartStack},
{name: "delayacct_blkio_ticks", want: 31, have: s.DelayAcctBlkIOTicks},
} {
if test.want != test.have {
Expand Down