Skip to content

fix(dkapture): honor parsed pid in read(vector<path>, cb) callback mode - #141

Open
JoeSergen wants to merge 1 commit into
DKapture:mainfrom
JoeSergen:fix/dkapture-paths-callback-pid
Open

fix(dkapture): honor parsed pid in read(vector<path>, cb) callback mode#141
JoeSergen wants to merge 1 commit into
DKapture:mainfrom
JoeSergen:fix/dkapture-paths-callback-pid

Conversation

@JoeSergen

Copy link
Copy Markdown

Fixes #134

ead(std::vector<const char*>&, DKCallback, void*)parsed the pid out of each/proc//path but then ignored it and calledread(dt, cb, ctx), which iterates ALL processes. Read the specific process' data via the buffer API and invoke the callback once per DataHdrrecord, so/proc/1234/statonly reports pid 1234. Guards against zero/oversizeddsz` to avoid an infinite loop on bad records.

The overload read(std::vector<const char*>&, DKCallback, void*) parsed
the pid out of each /proc/<pid>/<node> path but then ignored it and
called read(dt, cb, ctx), which iterates ALL processes. Read the
specific process' data via the buffer API and invoke the callback once
per DataHdr record, so /proc/1234/stat only reports pid 1234. Guard
against zero/oversized dsz to avoid an infinite loop on bad records.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: dkapture::read(paths, cb, ctx) 忽略解析出的 pid,返回所有进程数据

1 participant