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/14353] New: more than 1 syscall.dup2 probe alias in syscalls.stp


http://sourceware.org/bugzilla/show_bug.cgi?id=14353

             Bug #: 14353
           Summary: more than 1 syscall.dup2 probe alias in syscalls.stp
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tapsets
        AssignedTo: systemtap@sourceware.org
        ReportedBy: dsmith@redhat.com
    Classification: Unclassified


There are two syscall.dup2 probe aliases (and 2 return probe aliases) in
syscalls.stp:

====
# dup2 _______________________________________________________
# long sys_dup2(unsigned int oldfd, unsigned int newfd)
# Only handles corner case, others handled by dup3.
probe syscall.dup2 = kernel.function("sys_dup2").call
{
        if ($oldfd != $newfd) next;

        name = "dup2"
        oldfd = $oldfd
        newfd = $newfd
        flags = 0
        argstr = sprintf("%d, %d", $oldfd, $newfd)
}
probe syscall.dup2.return = kernel.function("sys_dup2").return
{
        if ($oldfd != $newfd) next;

        name = "dup2"
        retstr = return_str(1, $return)
}

# dup3 (handles both dup2 and dup3 except for corner case)___________
# long sys_dup2(unsigned int oldfd, unsigned int newfd)
# SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
probe syscall.dup2 = kernel.function("sys_dup3").call !,
                     kernel.function("sys_dup2").call
{
        oldfd = $oldfd
        newfd = $newfd
        flags = @defined($flags) ? $flags : 0;

        # Corner case handled by dup2
        if ($oldfd == $newfd && flags == 0) next

        if (flags == 0) {
                name = "dup2";
                argstr = sprintf("%d, %d", $oldfd, $newfd);
        } else {
                name = "dup3";
                argstr = sprintf("%d, %d, %s", $oldfd, $newfd,
                                 _dup3_flag_str(flags));
        }
}

probe syscall.dup2.return = kernel.function("sys_dup3").return !,
                            kernel.function("sys_dup2").return
{
        flags = @defined($flags) ? $flags : 0;

        # Corner case handled by dup2
        if ($oldfd == $newfd && flags == 0) next

        name = flags == 0 ? "dup2" : "dup3";
        retstr = return_str(1, $return)
}
====

This might be the result of a cut-and-paste error. There are at least 2
possible solutions to this problem:

- rename the 2nd instances 'syscall.dup3'
- delete the 1st instances, since the 2nd should handle both dup2 and dup3

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]