Received: from [140.186.70.92] (port=41114 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7TXN-0005rz-92 for qemu-devel@nongnu.org; Wed, 06 Apr 2011 10:16:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7TXL-0006mY-Ne for qemu-devel@nongnu.org; Wed, 06 Apr 2011 10:16:49 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:32882) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Q7TXL-0006k9-4A for qemu-devel@nongnu.org; Wed, 06 Apr 2011 10:16:47 -0400 From: =?utf-8?Q?Llu=C3=ADs?= Subject: Re: [Qemu-devel] Re: [PATCH 5/6] trace-state: [simple] add "-trace events" argument to control initial state References: <20110404214900.9761.49418.stgit@ginnungagap.bsc.es> <20110404214933.9761.62154.stgit@ginnungagap.bsc.es> Date: Wed, 06 Apr 2011 16:15:40 +0200 In-Reply-To: (Stefan Hajnoczi's message of "Wed, 6 Apr 2011 12:37:38 +0100") Message-ID: <874o6bbh4j.fsf@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Stefan Hajnoczi writes: >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (len > 1) { =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* skip empty lines */ >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0line[len - 1] = =3D '\0'; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!st_change_= trace_event_state(line, true)) { > The build breaks when --enable-trace-backend !=3D simple because this > code is outside an #ifdef CONFIG_SIMPLE_TRACE. Please add this: > diff --git a/simpletrace.h b/simpletrace.h > index 8d893bd..5d9d2ec 100644 > --- a/simpletrace.h > +++ b/simpletrace.h > @@ -43,6 +43,11 @@ static inline bool st_init(const char *file) > { > return true; > } > + > +static bool st_change_trace_event_state(const char *tname, bool tstate) > +{ > + return true; > +} > #endif /* !CONFIG_SIMPLE_TRACE */ > #endif /* SIMPLETRACE_H */ Hmmm... why don't simply conditionally call st_init (put it into an #ifdef) and remove the "#else" in simpletrace.h. I've looked at it and it's not called from anywhere else. This also reminds me that I didn't see any "-trace" option parsing in the OS-specific frontends (at least in linux-user). Lluis -- "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth