Skip to content

Commit

Permalink
add processor field for /proc/[pid]/stat
Browse files Browse the repository at this point in the history
Signed-off-by: peter wang <wangbo.red@gmail.com>
  • Loading branch information
xixiliguo committed Jul 17, 2022
1 parent f74c35e commit c66e798
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion proc_stat.go
Expand Up @@ -102,6 +102,8 @@ type ProcStat struct {
RSS int
// Soft limit in bytes on the rss of the process.
RSSLimit uint64
// CPU number last executed on.
Processor uint
// Real-time scheduling priority, a number in the range 1 to 99 for processes
// scheduled under a real-time policy, or 0, for non-real-time processes.
RTPriority uint
Expand Down Expand Up @@ -184,7 +186,7 @@ func (p Proc) Stat() (ProcStat, error) {
&ignoreUint64,
&ignoreUint64,
&ignoreInt64,
&ignoreInt64,
&s.Processor,
&s.RTPriority,
&s.Policy,
&s.DelayAcctBlkIOTicks,
Expand Down
1 change: 1 addition & 0 deletions proc_stat_test.go
Expand Up @@ -68,6 +68,7 @@ func TestProcStat(t *testing.T) {
want uint
have uint
}{
{name: "processor", want: 0, have: s.Processor},
{name: "rt_priority", want: 0, have: s.RTPriority},
{name: "policy", want: 0, have: s.Policy},
} {
Expand Down

0 comments on commit c66e798

Please sign in to comment.