[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH 5/6] trace-state: [simple] add "-trace event
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] Re: [PATCH 5/6] trace-state: [simple] add "-trace events" argument to control initial state |
Date: |
Wed, 6 Apr 2011 21:30:58 +0100 |
On Wed, Apr 6, 2011 at 3:15 PM, Lluís <address@hidden> wrote:
> Stefan Hajnoczi writes:
>
>>> + if (len > 1) { /* skip empty lines */
>>> + line[len - 1] = '\0';
>>> + if (!st_change_trace_event_state(line, true)) {
>
>> The build breaks when --enable-trace-backend != 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.
The benefit to stubbing out these functions is that callers don't have
#ifdefs. And caller code is always built (i.e. syntax checked by the
parser) so it helps avoid bitrot. vl.c:main() is already a long and
ugly function so it would be nice to avoid #ifdefs there.
> This also reminds me that I didn't see any "-trace" option parsing in
> the OS-specific frontends (at least in linux-user).
User emulation does not have any way to control simpletrace today.
Stefan
- [Qemu-devel] [RFC][PATCH 0/6] trace-state: make the behaviour of "disable" consistent across all backends, Lluís, 2011/04/04
- [Qemu-devel] [PATCH 1/6] trace: [ust] fix generation of 'trace.c' on events without args, Lluís, 2011/04/04
- [Qemu-devel] [PATCH 2/6] trace: generalize the "property" concept in the trace-events file, Lluís, 2011/04/04
- [Qemu-devel] [PATCH 3/6] trace-state: always use the "nop" backend on events with the "disable" keyword, Lluís, 2011/04/04
- [Qemu-devel] [PATCH 4/6] trace-state: [simple] disable all trace points by default, Lluís, 2011/04/04
- [Qemu-devel] [PATCH 5/6] trace-state: [simple] add "-trace events" argument to control initial state, Lluís, 2011/04/04
[Qemu-devel] [PATCH 6/6] trace: enable all events, Lluís, 2011/04/04
[Qemu-devel] Re: [RFC][PATCH 0/6] trace-state: make the behaviour of "disable" consistent across all backends, Stefan Hajnoczi, 2011/04/05