[PATCH 4/6] ptrace_get_syscall_info: factor out ptrace_get_syscall_info_op

Oleg Nesterov oleg at redhat.com
Thu Jan 9 10:41:47 UTC 2025


On 01/08, Dmitry V. Levin wrote:
>
> +ptrace_get_syscall_info_op(struct task_struct *child)
>  {
...
>  	case SIGTRAP | 0x80:
>  		switch (child->ptrace_message) {
>  		case PTRACE_EVENTMSG_SYSCALL_ENTRY:
> -			actual_size = ptrace_get_syscall_info_entry(child, regs,
> -								    &info);
> -			break;
> +			return PTRACE_SYSCALL_INFO_ENTRY;
>  		case PTRACE_EVENTMSG_SYSCALL_EXIT:
> -			actual_size = ptrace_get_syscall_info_exit(child, regs,
> -								   &info);
> -			break;
> +			return PTRACE_SYSCALL_INFO_EXIT;
>  		}
>  		break;
>  	case SIGTRAP | (PTRACE_EVENT_SECCOMP << 8):
> -		actual_size = ptrace_get_syscall_info_seccomp(child, regs,
> -							      &info);
> +		return PTRACE_SYSCALL_INFO_SECCOMP;
> +	}
> +
> +	return PTRACE_SYSCALL_INFO_NONE;

Cosmetic, I won't insist, but I'd suggest to do

	default:
		return PTRACE_SYSCALL_INFO_SECCOMP;
	}

to make it more symmetric.

Oleg.



More information about the Strace-devel mailing list