public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/20377] New: stable functions converted to @const aren't optimized
@ 2016-07-16  0:49 jistone at redhat dot com
  2016-11-11 16:50 ` [Bug translator/20377] " mcermak at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: jistone at redhat dot com @ 2016-07-16  0:49 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20377

            Bug ID: 20377
           Summary: stable functions converted to @const aren't optimized
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: jistone at redhat dot com
  Target Milestone: ---

Although @const does specify /* stable */ underneath, that doesn't let the
function containing it be treated as stable.  We have quite a few tapset
functions that were converted from full embedded-c to this @const form, and
those have thus regressed in getting stable treatment.

Consider tid():

$ stap -e 'probe oneshot { println(tid(), tid()) }' -v -p2 \
| sed -ne '/^begin/,$p'
begin /* <- oneshot += begin <- oneshot */
{
println(__global_tid__overload_0(), __global_tid__overload_0());
__global_exit__overload_0();
}

Compare to ns_tid(), which didn't get converted to @const:

$ stap -e 'probe oneshot { println(ns_tid(), ns_tid()) }' -v -p2 \
| sed -ne '/^begin/,$p'
begin /* <- oneshot += begin <- oneshot */
  # locals
  __stable___global_ns_tid__overload_0_value:long
{
(__stable___global_ns_tid__overload_0_value) = (__global_ns_tid__overload_0());
println(__stable___global_ns_tid__overload_0_value,
__stable___global_ns_tid__overload_0_value);
__global_exit__overload_0();
}


We could treat this as a simple regression, and convert these functions back to
full embedded-c functions where /* stable */ works.

We could also treat this as an enhancement request to infer stable functions
from their contents.  This is surely a hard problem, but we don't have to be
perfect as long as there are no false positives.  A function that's nothing but
'return @const("foo")' should be an easy case.

-- 
You are receiving this mail because:
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug translator/20377] stable functions converted to @const aren't optimized
  2016-07-16  0:49 [Bug translator/20377] New: stable functions converted to @const aren't optimized jistone at redhat dot com
@ 2016-11-11 16:50 ` mcermak at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: mcermak at redhat dot com @ 2016-11-11 16:50 UTC (permalink / raw)
  To: systemtap

https://sourceware.org/bugzilla/show_bug.cgi?id=20377

Martin Cermak <mcermak at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mcermak at redhat dot com

-- 
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-11-11 16:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-16  0:49 [Bug translator/20377] New: stable functions converted to @const aren't optimized jistone at redhat dot com
2016-11-11 16:50 ` [Bug translator/20377] " mcermak 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).