[PATCH/RFC] don't store struct sysent::native_scno member if we aren't using it.
Dmitry V. Levin
ldv at altlinux.org
Mon Feb 20 22:34:29 UTC 2012
On Tue, Feb 07, 2012 at 02:14:11PM +0100, Denys Vlasenko wrote:
> On 02/07/2012 01:17 PM, Dmitry V. Levin wrote:
> >> I noticed that this structure member is used only if
> >> we have more than one personality.
> >
> > This native_scno thing is not so much used in the code than before.
> > For example, there are 21 initialized native_scno entries in
> > linux/i386/syscallent.h:
> >
> > { 1, TP, sys_exit, "_exit", SYS_exit }, /* 1 */
> > { 0, TP, sys_fork, "fork", SYS_fork }, /* 2 */
> > { 3, TD, sys_read, "read", SYS_read }, /* 3 */
> > { 3, TD, sys_write, "write", SYS_write }, /* 4 */
> > { 3, TP, sys_waitpid, "waitpid", SYS_wait4 }, /* 7 */
> > { 3, TF|TP, sys_execve, "execve", SYS_execve }, /* 11 */
> > { 2, TD, sys_socketcall, "socketcall", SYS_socketcall }, /* 102 */
> > { 4, TP, sys_wait4, "wait4", SYS_wait4 }, /* 114 */
> > { 6, TI, sys_ipc, "ipc", SYS_ipc }, /* 117 */
> > { 5, TP, sys_clone, "clone", SYS_clone }, /* 120 */
> > { 3, 0, sys_sysfs, "sysfs", SYS_sysfs }, /* 135 */
> > { 3, TD, sys_readv, "readv", SYS_readv }, /* 145 */
> > { 3, TD, sys_writev, "writev", SYS_writev }, /* 146 */
> > { 5, TD, sys_pread, "pread64", SYS_read }, /* 180 */
> > { 5, TD, sys_pwrite, "pwrite64", SYS_write }, /* 181 */
> > { 0, TP, sys_vfork, "vfork", SYS_vfork }, /* 190 */
> > { 5, TP, sys_waitid, "waitid", SYS_waitid }, /* 284 */
> > { 4, TN, sys_send, "send", SYS_sub_send }, /* 409 */
> > { 4, TN, sys_recv, "recv", SYS_sub_recv }, /* 410 */
> > { 6, TN, sys_sendto, "sendto", SYS_sub_sendto }, /* 411 */
> > { 6, TN, sys_recvfrom, "recvfrom", SYS_sub_recvfrom }, /* 412 */
>
> Hmm... in fact it's the only arch which has them....
The only arch that uses this feature is x86-64; other two (x86 and ia64)
where this code is also compiled have no benefits from it.
> > Most of them are no longer used, and I guess all the rest could be
> > replaced by sys_func checks.
Here it is, tested on x86 and x86-64, please give it a try:
http://strace.git.sourceforge.net/git/gitweb.cgi?p=strace/strace;a=shortlog;h=ldv/master
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20120221/14a38f38/attachment.bin>
More information about the Strace-devel
mailing list