-
Notifications
You must be signed in to change notification settings - Fork 712
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
Improve process code in probe #272
Conversation
be6c4d7
to
574379f
Compare
@@ -43,7 +43,7 @@ func (t *Tagger) Tag(r report.Report) (report.Report, error) { | |||
return r, nil | |||
} | |||
|
|||
func (t *Tagger) tag(pidTree tag.PIDTree, topology *report.Topology) { | |||
func (t *Tagger) tag(pidTree process.Tree, topology *report.Topology) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
574379f
to
a645956
Compare
) | ||
|
||
// Walk | ||
var Walk = func(procRoot string, f func(*Process)) error { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
a645956
to
16bba90
Compare
} | ||
if val, ok := nmd["ppid"]; ok { | ||
rows = append(rows, Row{"Parent PID", val, ""}) | ||
for _, tuple := range []struct{ key, human string }{ |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
16bba90
to
8c694e3
Compare
if err != nil { | ||
continue | ||
} | ||
splits := strings.Split(string(stat), " ") |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
8c694e3
to
e68cb7d
Compare
|
||
cmdline := "" | ||
if cmdlineBuf, err := ReadFile(path.Join(procRoot, filename, "cmdline")); err == nil { | ||
cmdlineBuf = bytes.Replace(cmdlineBuf, []byte{'\000'}, []byte{' '}, -1) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
e68cb7d
to
daeba37
Compare
- Move pidtree to its own module and disaggregate it into tree, walker and reporter. - Extend testing for probe/process - Extend process metadata; add command line & # threads.
daeba37
to
560cf66
Compare
LGTM |
Improve process code in probe
might help towards #238