This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tapsets/6525] need utrace task-finder-based pid->execname, pid->cwd-path-name tables


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]