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 translator/13187] New: Reconsider the semantics of process(number).thread.begin/end


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

             Bug #: 13187
           Summary: Reconsider the semantics of
                    process(number).thread.begin/end
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap@sourceware.org
        ReportedBy: brolley@redhat.com
                CC: dsmith@redhat.com, fche@redhat.com
    Classification: Unclassified


The current semantics of process(number).thread.begin and
process(number).thread.end are to select threads with the given task id and to
fire probes as these threads begin and end respectively.

While this is logical, given the internal semantics of process(number).begin
and process(number).end, which fire probes at the corresponding beginning and
end of the main threads of a process, it is not very useful. This is because
the task ids of individual threads within a process are difficult, if not
impossible, to predict in advance. The result is that these probes serve no
reasonably useful purpose.

The difference, which makes process(number).begin and process(number).end
useful is that, for these probes, the task id matches the process id, which is
easily obtained by the user.

Other variants of thread.begin and thread.end are useful because of additional
semantics:

- process("PATH").thread.begin and process("path").thread.end fire at the
beginning and end of each child thread of processes corresponding to the given
path. From a user's point of view this represents all child threads beginning
and ending within the processes associated with that path.

- the commands
    stap -e 'process.thread.begin {}' -c PATH
and
    stap -e 'process.thread.end {} -c PATH
have a similar effect with the firing of the probes at the beginning and end of
each child thread within the process started by running the executable at PATH.
Once again, from the user's point of view, this represents all child threads
beginning and ending within that process.

So, when a user wants to probe the same thing against an already-running
process, it would seem reasonable that process(PID).thread.begin and
process(PID).thread.end might do the same thing. That is, fire at the beginning
and end of each child thread within the process PID. After all, she has simply
substituted the process ID for the path used in the previous examples. In other
words, she has attempted to identify the target process(es) in a different
manner.

However, for a running process, these probes will currently never fire, because
the task ids of the child threads do not match the given process id.

I propose that the process(PID).thread.begin and process(PID).thread.end probes
assume the same semantics as the other thread.begin and thread.end variants by
firing at the beginning and end of the child threads of the given process as
the other variants do. That is these probes should adopt the same "follow all
children" semantics as the other variants.

-- 
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]