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/20377] New: stable functions converted to @const aren't optimized


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]