* [Bug translator/20341] New: optimizer does not remove variables that are read in probe aliases but not end-user probes
@ 2016-07-08 21:02 flu at redhat dot com
2016-07-08 21:41 ` [Bug translator/20341] " fche at redhat dot com
0 siblings, 1 reply; 2+ messages in thread
From: flu at redhat dot com @ 2016-07-08 21:02 UTC (permalink / raw)
To: systemtap
https://sourceware.org/bugzilla/show_bug.cgi?id=20341
Bug ID: 20341
Summary: optimizer does not remove variables that are read in
probe aliases but not end-user probes
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: translator
Assignee: systemtap at sourceware dot org
Reporter: flu at redhat dot com
Target Milestone: ---
Sometimes a string or integer must be constructed through accumulation in a
tapset:
result = ""
result2 = 0
while (condition) {
result .= "str"
result += 1
}
If this accumulation were to be done in a probe alias, the compiler marks these
variables as being read even though consumer of the probe alias may not have
used these variables.
probe alias = begin {
read = "TEST"
unused = "1"
unused = unused . "2"
}
$ stap -p2 -e 'probe alias {print(read)}'
begin /* <- alias = begin <- alias */
# locals
read:string
unused:string
{
(read) = ("TEST");
(unused) = ("1");
(unused) = ((unused) . ("2"));
print(read);
}
Here, only the variable "read" is read by the consumer probe but the variable
"unused" does not get elided by the optimizer. The accumulation may be
expensive and the user should not be penalized by the unused variable.
The current workaround is to wrap the accumulation in a function to prevent the
compiler from marking the variable as being read but this may be cumbersome for
a tapset library author.
Currently, there are not that many patterns like this in the library.
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug translator/20341] optimizer does not remove variables that are read in probe aliases but not end-user probes
2016-07-08 21:02 [Bug translator/20341] New: optimizer does not remove variables that are read in probe aliases but not end-user probes flu at redhat dot com
@ 2016-07-08 21:41 ` fche at redhat dot com
0 siblings, 0 replies; 2+ messages in thread
From: fche at redhat dot com @ 2016-07-08 21:41 UTC (permalink / raw)
To: systemtap
https://sourceware.org/bugzilla/show_bug.cgi?id=20341
Frank Ch. Eigler <fche at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fche at redhat dot com
--- Comment #1 from Frank Ch. Eigler <fche at redhat dot com> ---
This is not probe-alias-specific. We don't drop assignments to variables that
are never subsequently used.
% stap -e 'probe begin {j = i+0; i= j} ' -p2 --vp 03
# probes
begin /* <- begin */
# locals
j:long
i:long
{
(j) = (i);
(i) = (j);
}
We may need a mini SSA pass.
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-08 21:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 21:02 [Bug translator/20341] New: optimizer does not remove variables that are read in probe aliases but not end-user probes flu at redhat dot com
2016-07-08 21:41 ` [Bug translator/20341] " fche at redhat dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).