diff mbox

trace: added ability to comment out events in the list

Message ID 4FD96B84.6080907@ozlabs.ru
State New, archived
Headers show

Commit Message

Alexey Kardashevskiy June 14, 2012, 4:41 a.m. UTC
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(-)

Comments

Stefan Hajnoczi June 14, 2012, 1:18 p.m. UTC | #1
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
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexey Kardashevskiy June 15, 2012, 4:36 a.m. UTC | #2
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 :)
Stefan Hajnoczi June 15, 2012, 8:35 a.m. UTC | #3
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
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);