From owner-svn-src-all@freebsd.org Tue May 21 08:23:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65E5415A6995; Tue, 21 May 2019 08:23:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 047AB83469; Tue, 21 May 2019 08:23:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCFFA304A; Tue, 21 May 2019 08:23:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4L8NO8B032570; Tue, 21 May 2019 08:23:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4L8NO2W032569; Tue, 21 May 2019 08:23:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905210823.x4L8NO2W032569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 21 May 2019 08:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348049 - head/sys/amd64/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/amd64/linux X-SVN-Commit-Revision: 348049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 047AB83469 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2019 08:23:25 -0000 Author: trasz Date: Tue May 21 08:23:24 2019 New Revision: 348049 URL: https://svnweb.freebsd.org/changeset/base/348049 Log: Make linux_ptrace() use linux_msg() instead of printf(). MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/linux/linux_ptrace.c Modified: head/sys/amd64/linux/linux_ptrace.c ============================================================================== --- head/sys/amd64/linux/linux_ptrace.c Tue May 21 04:27:52 2019 (r348048) +++ head/sys/amd64/linux/linux_ptrace.c Tue May 21 08:23:24 2019 (r348049) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define LINUX_PTRACE_TRACEME 0 #define LINUX_PTRACE_PEEKTEXT 1 @@ -123,7 +124,7 @@ linux_ptrace_status(struct thread *td, pid_t pid, int error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); td->td_retval[0] = saved_retval; if (error != 0) { - printf("%s: PT_LWPINFO failed with error %d\n", __func__, error); + linux_msg(td, "PT_LWPINFO failed with error %d", error); return (status); } @@ -320,9 +321,9 @@ linux_ptrace_setoptions(struct thread *td, pid_t pid, mask = 0; if (data & ~LINUX_PTRACE_O_MASK) { - printf("%s: unknown ptrace option %lx set; " - "returning EINVAL\n", - __func__, data & ~LINUX_PTRACE_O_MASK); + linux_msg(td, "unknown ptrace option %lx set; " + "returning EINVAL", + data & ~LINUX_PTRACE_O_MASK); return (EINVAL); } @@ -357,8 +358,8 @@ linux_ptrace_setoptions(struct thread *td, pid_t pid, mask |= PTRACE_VFORK; /* XXX: Close enough? */ if (data & LINUX_PTRACE_O_TRACEEXIT) { - printf("%s: PTRACE_O_TRACEEXIT not implemented; " - "returning EINVAL\n", __func__); + linux_msg(td, "PTRACE_O_TRACEEXIT not implemented; " + "returning EINVAL"); return (EINVAL); } @@ -381,7 +382,7 @@ linux_ptrace_getregs(struct thread *td, pid_t pid, voi error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); if (error != 0) { - printf("%s: PT_LWPINFO failed with error %d\n", __func__, error); + linux_msg(td, "PT_LWPINFO failed with error %d", error); return (error); } if (lwpinfo.pl_flags & PL_FLAG_SCE) { @@ -433,7 +434,7 @@ linux_ptrace_getregset_prstatus(struct thread *td, pid error = copyin((const void *)data, &iov, sizeof(iov)); if (error != 0) { - printf("%s: copyin error %d\n", __func__, error); + linux_msg(td, "copyin error %d", error); return (error); } @@ -451,8 +452,7 @@ linux_ptrace_getregset_prstatus(struct thread *td, pid error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); if (error != 0) { - printf("%s: PT_LWPINFO failed with error %d\n", - __func__, error); + linux_msg(td, "PT_LWPINFO failed with error %d", error); return (error); } if (lwpinfo.pl_flags & PL_FLAG_SCE) { @@ -474,14 +474,14 @@ linux_ptrace_getregset_prstatus(struct thread *td, pid len = MIN(iov.iov_len, sizeof(l_regset)); error = copyout(&l_regset, (void *)iov.iov_base, len); if (error != 0) { - printf("%s: copyout error %d\n", __func__, error); + linux_msg(td, "copyout error %d", error); return (error); } iov.iov_len -= len; error = copyout(&iov, (void *)data, sizeof(iov)); if (error != 0) { - printf("%s: iov copyout error %d\n", __func__, error); + linux_msg(td, "iov copyout error %d", error); return (error); } @@ -496,8 +496,8 @@ linux_ptrace_getregset(struct thread *td, pid_t pid, l case LINUX_NT_PRSTATUS: return (linux_ptrace_getregset_prstatus(td, pid, data)); default: - printf("%s: PTRACE_GETREGSET request %ld not implemented; " - "returning EINVAL\n", __func__, addr); + linux_msg(td, "PTRACE_GETREGSET request %ld not implemented; " + "returning EINVAL", addr); return (EINVAL); } } @@ -506,7 +506,7 @@ static int linux_ptrace_seize(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) { - printf("%s: PTRACE_SEIZE not implemented; returning EINVAL\n", __func__); + linux_msg(td, "PTRACE_SEIZE not implemented; returning EINVAL"); return (EINVAL); } @@ -587,8 +587,8 @@ linux_ptrace(struct thread *td, struct linux_ptrace_ar error = linux_ptrace_seize(td, pid, uap->addr, uap->data); break; default: - printf("%s: ptrace(%ld, ...) not implemented; returning EINVAL\n", - __func__, uap->req); + linux_msg(td, "ptrace(%ld, ...) not implemented; " + "returning EINVAL", uap->req); error = EINVAL; break; }