From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21644 invoked by alias); 20 Mar 2014 17:48:33 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 21547 invoked by uid 48); 20 Mar 2014 17:48:28 -0000 From: "dsmith at redhat dot com" To: systemtap@sourceware.org Subject: [Bug runtime/5154] aux_syscalls lookup tables needlessly included Date: Thu, 20 Mar 2014 17:48:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dsmith at redhat dot com X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q1/txt/msg00316.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=5154 David Smith changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |--- --- Comment #2 from David Smith --- >From looking at pass 3 output, the lookup tables are still being needlessly included. The *functions* are marked as pure (and get elided when not used), but the lookup tables themselves are always included. Here's what the code looks like: ==== # ... %{ static const _stp_val_array const _stp_XXXX_list[] = { V(XXX_1), V(XXX_2), {0, NULL} }; %} function _XXXX_str:string(val:long) %{ /* pure */ _stp_lookup_str(_stp_XXXX_list, STAP_ARG_val, STAP_RETVALUE, MAXSTRINGLEN); %} ==== Here the translator can know that _XXXX_str() isn't used and elide it. However, it can't really know that that embedded-C block above it is used or unused, so it always includes it. One possible solution here would be to move the lookup table inside the function, but still static. The lookup table would need to be static so it wouldn't be put on the limited kernel stack. In this scenario, if the translator elides the function, it would automatically elide the lookup table. -- You are receiving this mail because: You are the assignee for the bug.