Trace operations on a particular file/device?

Grant Edwards grant.b.edwards at gmail.com
Fri Feb 11 20:40:26 UTC 2011


On 2011-02-09, Grant Edwards <grant.b.edwards at gmail.com> wrote:

> I've been testing new features I've added to the Python
> implementation of strace, and I'm pretty happy with them:
>
>  1) I've added code to keep track of the paths associated with file
>     descriptors by watching for open/close/dup/dup2/clone calls.
>
>  2) I've added a command-line option to display the associated path[s]
>     for all syscalls that have file descriptors as parameters.
>
>  3) I've added a command-line option to filter the display of syscalls
>     based on a list of paths.  It will output only syscalls who's
>     parameters include either a one of the specified paths or a file
>     descriptor associated with one of the specified paths.
>
> That required a total of 90 lines of code.
>
> I'm going to start working on re-implementing the above in C...

I've got #1 and #3 working.

Number 2 is going to be a bit more work because the formatting of
arguments appears to be scattered around in hundreds of different
functions [as opposed to the Python code where there is a single
function that formats/prints the arguments for all syscalls].

If anybody is interested, I can post code...

-- 
Grant Edwards               grant.b.edwards        Yow! I guess it was all a
                                  at               DREAM ... or an episode of
                              gmail.com            HAWAII FIVE-O ...





More information about the Strace-devel mailing list