This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug runtime/5154] aux_syscalls lookup tables needlessly included
- From: "dsmith at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Thu, 20 Mar 2014 17:48:28 +0000
- Subject: [Bug runtime/5154] aux_syscalls lookup tables needlessly included
- Auto-submitted: auto-generated
- References: <bug-5154-6586 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=5154
David Smith <dsmith at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |---
--- Comment #2 from David Smith <dsmith at redhat dot com> ---
>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.