* [Bug runtime/10013] Support ENABLED sdt probe macro
2009-03-30 12:14 [Bug runtime/10013] New: Support ENABLED sdt probe macro mjw at redhat dot com
@ 2009-03-30 18:48 ` fche at redhat dot com
2009-04-05 19:17 ` mjw at redhat dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2009-03-30 18:48 UTC (permalink / raw)
To: systemtap
------- Additional Comments From fche at redhat dot com 2009-03-30 15:37 -------
One way to implement this could be to add a word-sized counter to the
.probes section that describes the probe point. Translator-generated
code could attempt to atomically increment/decrement that when the
corresponding uprobe is placed/removed. The ENABLED() macro would read that
value.
One way to make this somewhat less flaky/racy is to have all the counters
be set/cleared on a object-file-wide basis, when task-finder tells us it has
been loaded -- so before the user-space code starts to run.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10013
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug runtime/10013] Support ENABLED sdt probe macro
2009-03-30 12:14 [Bug runtime/10013] New: Support ENABLED sdt probe macro mjw at redhat dot com
2009-03-30 18:48 ` [Bug runtime/10013] " fche at redhat dot com
@ 2009-04-05 19:17 ` mjw at redhat dot com
2009-04-05 21:56 ` fche at redhat dot com
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: mjw at redhat dot com @ 2009-04-05 19:17 UTC (permalink / raw)
To: systemtap
------- Additional Comments From mjw at redhat dot com 2009-04-05 19:17 -------
Maybe we can teach uprobes to replace with a specific move/assignment
instruction instead of a trap instruction. Then you could define ENABLE_PROBE()
with something like:
#define ENABLED_PROBE() ({char e = 0; asm ("mov $0x0, %0" :"=r"(e):"0"(e)); e;})
(of course with the magic macro label .probe section stuff to know the actual
address of the mov instruction)
Then instead of with a normal STAP_PROBE replacing a "nop" with "int3", you
would replace the "mov $0x0, %somereg" with "mov $0x1, %somereg".
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10013
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug runtime/10013] Support ENABLED sdt probe macro
2009-03-30 12:14 [Bug runtime/10013] New: Support ENABLED sdt probe macro mjw at redhat dot com
2009-03-30 18:48 ` [Bug runtime/10013] " fche at redhat dot com
2009-04-05 19:17 ` mjw at redhat dot com
@ 2009-04-05 21:56 ` fche at redhat dot com
2009-04-05 22:22 ` mjw at redhat dot com
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2009-04-05 21:56 UTC (permalink / raw)
To: systemtap
------- Additional Comments From fche at redhat dot com 2009-04-05 21:56 -------
> Maybe we can teach uprobes to replace with a specific move/assignment
> instruction instead of a trap instruction.
This optimization is the same as in the "move immediate" kernel markers.
However, it is not a *substitute* for a trap. It is only a substitute
for a condition evaluation.
> Then instead of with a normal STAP_PROBE replacing a "nop" with "int3", you
> would replace the "mov $0x0, %somereg" with "mov $0x1, %somereg".
You still need some way to enter the kernel.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10013
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug runtime/10013] Support ENABLED sdt probe macro
2009-03-30 12:14 [Bug runtime/10013] New: Support ENABLED sdt probe macro mjw at redhat dot com
` (2 preceding siblings ...)
2009-04-05 21:56 ` fche at redhat dot com
@ 2009-04-05 22:22 ` mjw at redhat dot com
2009-04-16 15:21 ` scox at redhat dot com
2009-11-05 13:57 ` fche at redhat dot com
5 siblings, 0 replies; 7+ messages in thread
From: mjw at redhat dot com @ 2009-04-05 22:22 UTC (permalink / raw)
To: systemtap
------- Additional Comments From mjw at redhat dot com 2009-04-05 22:22 -------
(In reply to comment #3)
> This optimization is the same as in the "move immediate" kernel markers.
> However, it is not a *substitute* for a trap. It is only a substitute
> for a condition evaluation.
> [...]
> You still need some way to enter the kernel.
It isn't meant as substitute of the trap. That will still be the STAP_PROBE itself.
So the idea is that when enabling a probe, you first enable the PROBE itself,
replacing the nop with a trap, then, if there is also an associated ENABLED
conditional, you replace the move to enable the code path leading to the probe.
So user code would be written as:
if (STAP_PROBE_ENABLED(myapp, mymark))
{
do_expensive_argument_setup();
STAP_PROBE(myapp, mymark, args);
}
--
http://sourceware.org/bugzilla/show_bug.cgi?id=10013
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug runtime/10013] Support ENABLED sdt probe macro
2009-03-30 12:14 [Bug runtime/10013] New: Support ENABLED sdt probe macro mjw at redhat dot com
` (3 preceding siblings ...)
2009-04-05 22:22 ` mjw at redhat dot com
@ 2009-04-16 15:21 ` scox at redhat dot com
2009-11-05 13:57 ` fche at redhat dot com
5 siblings, 0 replies; 7+ messages in thread
From: scox at redhat dot com @ 2009-04-16 15:21 UTC (permalink / raw)
To: systemtap
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|systemtap at sources dot |scox at redhat dot com
|redhat dot com |
Status|NEW |ASSIGNED
http://sourceware.org/bugzilla/show_bug.cgi?id=10013
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug runtime/10013] Support ENABLED sdt probe macro
2009-03-30 12:14 [Bug runtime/10013] New: Support ENABLED sdt probe macro mjw at redhat dot com
` (4 preceding siblings ...)
2009-04-16 15:21 ` scox at redhat dot com
@ 2009-11-05 13:57 ` fche at redhat dot com
5 siblings, 0 replies; 7+ messages in thread
From: fche at redhat dot com @ 2009-11-05 13:57 UTC (permalink / raw)
To: systemtap
--
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |10907
nThis| |
http://sourceware.org/bugzilla/show_bug.cgi?id=10013
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
^ permalink raw reply [flat|nested] 7+ messages in thread