From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8pVt-000361-Li for qemu-devel@nongnu.org; Tue, 15 Dec 2015 08:19:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8pVo-0005X5-VS for qemu-devel@nongnu.org; Tue, 15 Dec 2015 08:19:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:3782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8pVo-0005X0-Q7 for qemu-devel@nongnu.org; Tue, 15 Dec 2015 08:19:28 -0500 References: <1449916587-18312-1-git-send-email-pbonzini@redhat.com> <1449916796-18664-1-git-send-email-pbonzini@redhat.com> <566FBA3D.6090208@redhat.com> From: Paolo Bonzini Message-ID: <5670135C.6000808@redhat.com> Date: Tue, 15 Dec 2015 14:19:24 +0100 MIME-Version: 1.0 In-Reply-To: <566FBA3D.6090208@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 11/11] linux-user: convert DEBUG_SIGNAL logging to tracepoints List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org On 15/12/2015 07:59, Thomas Huth wrote: > On 12/12/15 11:39, Paolo Bonzini wrote: >> "Unimplemented" messages go to stderr, everything else goes to tracepo= ints >> >> Signed-off-by: Paolo Bonzini >> --- > [...] >> diff --git a/linux-user/signal.c b/linux-user/signal.c >> index 9d62e02..919aa83 100644 >> --- a/linux-user/signal.c >> +++ b/linux-user/signal.c > [...] >> @@ -3972,14 +3974,15 @@ give_sigsegv: >> =20 >> long do_sigreturn(CPUOpenRISCState *env) >> { >> - >> - qemu_log("do_sigreturn: not implemented\n"); >> + trace_user_do_sigreturn(env, 0); >> + fprintf(stderr, "do_sigreturn: not implemented\n"); >> return -TARGET_ENOSYS; >> } >> =20 >> long do_rt_sigreturn(CPUOpenRISCState *env) >> { >> - qemu_log("do_rt_sigreturn: not implemented\n"); >> + trace_user_do_rt_sigreturn(env, 0); >> + fprintf(stderr, "do_rt_sigreturn: not implemented\n"); >> return -TARGET_ENOSYS; >> } >=20 > Why not simply using qemu_log_mask(LOG_UNIMP, ...) instead? Isn't that > what the LOG_UNIMP flag is good for? LOG_UNIMP has to be enabled explicitly, because it is guest-triggerable. Here the error is really fatal, so I decided to use fprintf. In fact, it would probably be better to abort after printing an error, but I left the "return" untouched because I didn't want to do too many changes in the same patch. Paolo