This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug tapsets/6525] need utrace task-finder-based pid->execname, pid->cwd-path-name tables
- From: "dsmith at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Thu, 08 Oct 2015 14:54:30 +0000
- Subject: [Bug tapsets/6525] need utrace task-finder-based pid->execname, pid->cwd-path-name tables
- Auto-submitted: auto-generated
- References: <bug-6525-6586 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=6525
--- Comment #17 from David Smith <dsmith at redhat dot com> ---
After working on bug #19065 recently, I believe we can actually do this without
the task_finder keeping a table of information around just in case we need it.
Instead we'd look up this information on the fly as needed.
The current kernel code to do /proc/PID/cwd looks like this:
====
task_lock(task);
if (task->fs) {
get_fs_pwd(task->fs, path);
result = 0;
}
task_unlock(task);
put_task_struct(task);
====
The current kernel code to do /proc/PID/exe looks like:
====
mm = get_task_mm(task);
put_task_struct(task);
if (!mm)
return -ENOENT;
exe_file = get_mm_exe_file(mm);
mmput(mm);
====
I believe everything called above is either inlined or exported, so it should
be reasonable to call from a systemtap module.
Note that this method might be harder to implement on older kernels, I'm
unsure.
--
You are receiving this mail because:
You are the assignee for the bug.