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 runtime/5154] aux_syscalls lookup tables needlessly included


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.


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