qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] trace: added ability to comment out events in the list
@ 2012-06-14  4:41 Alexey Kardashevskiy
  2012-06-14 13:18 ` Stefan Hajnoczi
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Kardashevskiy @ 2012-06-14  4:41 UTC (permalink / raw)
  To: kvm-ppc, qemu-devel@nongnu.org, Benjamin Herrenschmidt

It is convenient for debug to be able to switch on/off some events easily.
The only possibility now is to remove event name from the file completely
and type it again when we want it back.

The patch adds '#' symbol handling as a comment specifier.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 trace/control.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/trace/control.c b/trace/control.c
index 4c5527d..22d5863 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -27,6 +27,9 @@ void trace_backend_init_events(const char *fname)
         size_t len = strlen(line_buf);
         if (len > 1) {              /* skip empty lines */
             line_buf[len - 1] = '\0';
+            if ('#' == line_buf[0]) { /* skip commented lines */
+                continue;
+            }
             if (!trace_event_set_state(line_buf, true)) {
                 fprintf(stderr,
                         "error: trace event '%s' does not exist\n", line_buf);
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] trace: added ability to comment out events in the list
  2012-06-14  4:41 [Qemu-devel] [PATCH] trace: added ability to comment out events in the list Alexey Kardashevskiy
@ 2012-06-14 13:18 ` Stefan Hajnoczi
  2012-06-15  4:36   ` Alexey Kardashevskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Hajnoczi @ 2012-06-14 13:18 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: qemu-devel@nongnu.org, kvm-ppc

On Thu, Jun 14, 2012 at 02:41:40PM +1000, Alexey Kardashevskiy wrote:
> It is convenient for debug to be able to switch on/off some events easily.
> The only possibility now is to remove event name from the file completely
> and type it again when we want it back.
> 
> The patch adds '#' symbol handling as a comment specifier.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  trace/control.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)

Thanks, applied to the tracing patches tree:
https://github.com/stefanha/qemu/commits/tracing

Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] trace: added ability to comment out events in the list
  2012-06-14 13:18 ` Stefan Hajnoczi
@ 2012-06-15  4:36   ` Alexey Kardashevskiy
  2012-06-15  8:35     ` Stefan Hajnoczi
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Kardashevskiy @ 2012-06-15  4:36 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel@nongnu.org, kvm-ppc

On 14/06/12 23:18, Stefan Hajnoczi wrote:
> On Thu, Jun 14, 2012 at 02:41:40PM +1000, Alexey Kardashevskiy wrote:
>> It is convenient for debug to be able to switch on/off some events easily.
>> The only possibility now is to remove event name from the file completely
>> and type it again when we want it back.
>>
>> The patch adds '#' symbol handling as a comment specifier.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>>  trace/control.c |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> Thanks, applied to the tracing patches tree:
> https://github.com/stefanha/qemu/commits/tracing

Cannot find it there though :)



-- 
Alexey

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] trace: added ability to comment out events in the list
  2012-06-15  4:36   ` Alexey Kardashevskiy
@ 2012-06-15  8:35     ` Stefan Hajnoczi
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2012-06-15  8:35 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: qemu-devel@nongnu.org, kvm-ppc

On Fri, Jun 15, 2012 at 5:36 AM, Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
> On 14/06/12 23:18, Stefan Hajnoczi wrote:
>> On Thu, Jun 14, 2012 at 02:41:40PM +1000, Alexey Kardashevskiy wrote:
>>> It is convenient for debug to be able to switch on/off some events easily.
>>> The only possibility now is to remove event name from the file completely
>>> and type it again when we want it back.
>>>
>>> The patch adds '#' symbol handling as a comment specifier.
>>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>> ---
>>>  trace/control.c |    3 +++
>>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> Thanks, applied to the tracing patches tree:
>> https://github.com/stefanha/qemu/commits/tracing
>
> Cannot find it there though :)

I just pushed the 'tracing' branch, sorry for the delay!

Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-15  8:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14  4:41 [Qemu-devel] [PATCH] trace: added ability to comment out events in the list Alexey Kardashevskiy
2012-06-14 13:18 ` Stefan Hajnoczi
2012-06-15  4:36   ` Alexey Kardashevskiy
2012-06-15  8:35     ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).