public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "dsmith at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug runtime/5154] aux_syscalls lookup tables needlessly included
Date: Thu, 20 Mar 2014 18:10:00 -0000	[thread overview]
Message-ID: <bug-5154-6586-sXDnpKbWqA@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-5154-6586@http.sourceware.org/bugzilla/>

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

David Smith <dsmith at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from David Smith <dsmith at redhat dot com> ---
(In reply to Josh Stone from comment #3)
> When not used, do the tables actually survive through compilation?  For
> unreferenced static const data, I'd expect gcc would just drop them.

Good question. It looks like you are correct, gcc is discarding that data. See
the following:

====
# stap -p3 -e 'probe begin { println(_mmap_flags(0)); exit() }' | egrep
_stp_.+_list
static const _stp_val_array const _stp_sockopt_level_list[] = {
static const _stp_val_array const _stp_signal_list[] = {
    const _stp_val_array * const array = _stp_signal_list;
static const _stp_val_array const _stp_semctl_list[] = {
static const _stp_val_array const _stp_fork_list[] = {
static const _stp_val_array const _stp_atflag_list[] = {
static const _stp_val_array const _stp_shmat_list[] = {
static const _stp_val_array const _stp_mprotect_list[] = {
static const _stp_val_array const _stp_mmap_list[] = {
  static const _stp_val_array const _stp_sa_handler_list[] = {
  static const _stp_val_array const _stp_sa_flags_list[] = {
  _stp_lookup_str(_stp_sa_handler_list, (long)act->sa_handler,
      _stp_lookup_or_str(_stp_sa_flags_list, act->sa_flags, ptr, len);
static const _stp_val_array const _stp_irq_list[] = {
    _stp_lookup_or_str(_stp_mmap_list, STAP_ARG_flags, STAP_RETVALUE,
MAXSTRINGLEN);
#  stap -m test -p4 -e 'probe begin { println(_mmap_flags(0)); exit() }'
test.ko
# nm test.ko | egrep _stp_.+_list
0000000000000100 r _stp_mmap_list
====

From the above output, the source (-p3 output) contained ~15 lookup tables. But
the final module only contained the one actually used.

I'll reclose this one.

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

      parent reply	other threads:[~2014-03-20 18:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-5154-6586@http.sourceware.org/bugzilla/>
2014-02-13 15:02 ` dsmith at redhat dot com
2014-03-20 17:48 ` dsmith at redhat dot com
2014-03-20 17:59 ` jistone at redhat dot com
2014-03-20 18:10 ` dsmith at redhat dot com [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-5154-6586-sXDnpKbWqA@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).