[PATCH/RFC] don't store struct sysent::native_scno member if we aren't using it.

Dmitry V. Levin ldv at altlinux.org
Tue Feb 7 12:17:25 UTC 2012


Hi,

On Tue, Feb 07, 2012 at 12:23:24PM +0100, Denys Vlasenko wrote:
> Hi Dmitry.
> 
> 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 */

Most of them are no longer used, and I guess all the rest could be
replaced by sys_func checks.


-- 
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/20120207/3f512eac/attachment.bin>


More information about the Strace-devel mailing list