RFC: path display and path filtering features.

Grant Edwards grant.b.edwards at gmail.com
Fri Feb 18 17:25:30 UTC 2011


On 2011-02-18, Grant Edwards <grant.b.edwards at gmail.com> wrote:
> On 2011-02-18, Grant Edwards <grant.b.edwards at gmail.com> wrote:
>
>>> I'm not sure that we can ignore all cases where syscalls return file
>>> descriptor as their return value.
>>
>> That wasn't my intent, and I don't think that's what the code does.
>>
>> I meant to ignore system calls who returned file descriptors (and
>> therefore had the TRACE_DESC flag set), but didn't have arguments that
>> were file paths or open file descriptors.
>
> Doh!  I just realized that I completely misunderstood that.
>
> You weren't talking about sys_calls returning descriptors that were
> being explicity ignored like fdtimer_create.  You were refering to fd
> return values from syscalls like open() that were being ignore.

[...]

> I agree that the fd's returned from open() and creat() should be
> checked for a match.

However, I now see that checking the file descriptors returned by a
system call is problematic.  When the check is done in
trace_syscall_exiting(), the syscall may have already been ignored
(not printed) by trace_syscall_entering().  Deciding to print just the
return value of the syscall isn't very useful.

Converting paths specified by -P to canonical form and checking
canonicalized path arguments might be a better way to go.  There are
still probably cases it will miss, but I can't think of a better
option.

-- 
Grant Edwards               grant.b.edwards        Yow! Is this an out-take
                                  at               from the "BRADY BUNCH"?
                              gmail.com            





More information about the Strace-devel mailing list