All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/4] Tracing patches
@ 2012-07-19 10:52 Stefan Hajnoczi
  2012-07-19 10:52 ` [Qemu-devel] [PATCH 1/4] trace: added ability to comment out events in the list Stefan Hajnoczi
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Stefan Hajnoczi @ 2012-07-19 10:52 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel, Stefan Hajnoczi

Simpletrace v2 has landed:
 * Strings are now logged instead of their pointers
 * Variable-length arguments allow for >6 trace event arguments

Thanks to Harsh Prateek Bora for this improvement!

The following changes since commit dfe1ce5d80cba603bafaac91b239d683abe19cf7:

  Merge remote-tracking branch 'kwolf/for-anthony' into staging (2012-07-18 14:44:50 -0500)

are available in the git repository at:


  git://github.com/stefanha/qemu.git tracing

for you to fetch changes up to 90a147a275da3a432bdf00238ebf438eff1d2c1b:

  Update simpletrace.py for new log format (2012-07-19 11:34:33 +0100)

----------------------------------------------------------------
Alexey Kardashevskiy (1):
      trace: added ability to comment out events in the list

Harsh Prateek Bora (3):
      monitor: remove unused do_info_trace
      Simpletrace v2: Support multiple arguments, strings.
      Update simpletrace.py for new log format

 monitor.c                           |   16 ---
 scripts/simpletrace.py              |  116 +++++++++------
 scripts/tracetool/backend/simple.py |   90 +++++++++---
 trace/control.c                     |    3 +
 trace/simple.c                      |  271 ++++++++++++++++++++---------------
 trace/simple.h                      |   40 ++++--
 6 files changed, 340 insertions(+), 196 deletions(-)

-- 
1.7.10.4

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

* [Qemu-devel] [PATCH 1/4] trace: added ability to comment out events in the list
  2012-07-19 10:52 [Qemu-devel] [PULL 0/4] Tracing patches Stefan Hajnoczi
@ 2012-07-19 10:52 ` Stefan Hajnoczi
  2012-07-19 10:52 ` [Qemu-devel] [PATCH 2/4] monitor: remove unused do_info_trace Stefan Hajnoczi
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 20+ messages in thread
From: Stefan Hajnoczi @ 2012-07-19 10:52 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Alexey Kardashevskiy, qemu-devel, Stefan Hajnoczi

From: Alexey Kardashevskiy <aik@ozlabs.ru>

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>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 trace/control.c |    3 +++
 1 file changed, 3 insertions(+)

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.10.4

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

* [Qemu-devel] [PATCH 2/4] monitor: remove unused do_info_trace
  2012-07-19 10:52 [Qemu-devel] [PULL 0/4] Tracing patches Stefan Hajnoczi
  2012-07-19 10:52 ` [Qemu-devel] [PATCH 1/4] trace: added ability to comment out events in the list Stefan Hajnoczi
@ 2012-07-19 10:52 ` Stefan Hajnoczi
  2012-07-19 10:52 ` [Qemu-devel] [PATCH 3/4] Simpletrace v2: Support multiple arguments, strings Stefan Hajnoczi
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 20+ messages in thread
From: Stefan Hajnoczi @ 2012-07-19 10:52 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Harsh Prateek Bora, qemu-devel, Stefan Hajnoczi

From: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>

Going forward with simpletrace v2 variable size trace records, we cannot
have a generic function to print trace event info and therefore this
interface becomes invalid.

As per Stefan Hajnoczi:

"This command is only available from the human monitor.  It's not very
useful because it historically hasn't been able to pretty-print events
or show them in the right order (we use a ringbuffer but it prints
them out from index 0).

Therefore, I don't think we're under any obligation to keep this
command around.  No one has complained about it's limitations - I
think this is a sign that no one has used it.  I'd be okay with a
patch that removes it."

Ref: http://lists.gnu.org/archive/html/qemu-devel/2012-01/msg01268.html

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 monitor.c      |   16 ----------------
 trace/simple.c |   18 ------------------
 trace/simple.h |    1 -
 3 files changed, 35 deletions(-)

diff --git a/monitor.c b/monitor.c
index 09aa3cd..49dccfe 100644
--- a/monitor.c
+++ b/monitor.c
@@ -941,13 +941,6 @@ static void do_info_cpu_stats(Monitor *mon)
 }
 #endif
 
-#if defined(CONFIG_TRACE_SIMPLE)
-static void do_info_trace(Monitor *mon)
-{
-    st_print_trace((FILE *)mon, &monitor_fprintf);
-}
-#endif
-
 static void do_trace_print_events(Monitor *mon)
 {
     trace_print_events((FILE *)mon, &monitor_fprintf);
@@ -2689,15 +2682,6 @@ static mon_cmd_t info_cmds[] = {
         .help       = "show roms",
         .mhandler.info = do_info_roms,
     },
-#if defined(CONFIG_TRACE_SIMPLE)
-    {
-        .name       = "trace",
-        .args_type  = "",
-        .params     = "",
-        .help       = "show current contents of trace buffer",
-        .mhandler.info = do_info_trace,
-    },
-#endif
     {
         .name       = "trace-events",
         .args_type  = "",
diff --git a/trace/simple.c b/trace/simple.c
index b4a3c6e..b64bcf4 100644
--- a/trace/simple.c
+++ b/trace/simple.c
@@ -291,24 +291,6 @@ void st_print_trace_file_status(FILE *stream, int (*stream_printf)(FILE *stream,
                   trace_file_name, trace_fp ? "on" : "off");
 }
 
-void st_print_trace(FILE *stream, int (*stream_printf)(FILE *stream, const char *fmt, ...))
-{
-    unsigned int i;
-
-    for (i = 0; i < TRACE_BUF_LEN; i++) {
-        TraceRecord record;
-
-        if (!get_trace_record(i, &record)) {
-            continue;
-        }
-        stream_printf(stream, "Event %" PRIu64 " : %" PRIx64 " %" PRIx64
-                      " %" PRIx64 " %" PRIx64 " %" PRIx64 " %" PRIx64 "\n",
-                      record.event, record.x1, record.x2,
-                      record.x3, record.x4, record.x5,
-                      record.x6);
-    }
-}
-
 void st_flush_trace_buffer(void)
 {
     flush_trace_file(true);
diff --git a/trace/simple.h b/trace/simple.h
index 466e75b..6b5358c 100644
--- a/trace/simple.h
+++ b/trace/simple.h
@@ -29,7 +29,6 @@ void trace3(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3);
 void trace4(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4);
 void trace5(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5);
 void trace6(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5, uint64_t x6);
-void st_print_trace(FILE *stream, fprintf_function stream_printf);
 void st_print_trace_file_status(FILE *stream, fprintf_function stream_printf);
 void st_set_trace_file_enabled(bool enable);
 bool st_set_trace_file(const char *file);
-- 
1.7.10.4

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

* [Qemu-devel] [PATCH 3/4] Simpletrace v2: Support multiple arguments, strings.
  2012-07-19 10:52 [Qemu-devel] [PULL 0/4] Tracing patches Stefan Hajnoczi
  2012-07-19 10:52 ` [Qemu-devel] [PATCH 1/4] trace: added ability to comment out events in the list Stefan Hajnoczi
  2012-07-19 10:52 ` [Qemu-devel] [PATCH 2/4] monitor: remove unused do_info_trace Stefan Hajnoczi
@ 2012-07-19 10:52 ` Stefan Hajnoczi
  2012-07-19 10:52 ` [Qemu-devel] [PATCH 4/4] Update simpletrace.py for new log format Stefan Hajnoczi
  2012-07-19 11:52 ` [Qemu-devel] [PULL 0/4] Tracing patches Harsh Bora
  4 siblings, 0 replies; 20+ messages in thread
From: Stefan Hajnoczi @ 2012-07-19 10:52 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Harsh Prateek Bora, qemu-devel, Stefan Hajnoczi

From: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>

Existing simpletrace backend allows to trace at max 6 args and does not
support strings. This newer tracelog format gets rid of fixed size records
and therefore allows to trace variable number of args including strings.

Sample trace with strings:
v9fs_version 0.000 tag=0xffff id=0x64 msize=0x2000 version=9P2000.L
v9fs_version_return 6.705 tag=0xffff id=0x64 msize=0x2000 version=9P2000.L

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 scripts/tracetool/backend/simple.py |   90 ++++++++++---
 trace/simple.c                      |  253 ++++++++++++++++++++++-------------
 trace/simple.h                      |   39 +++++-
 3 files changed, 262 insertions(+), 120 deletions(-)

diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py
index fbb5717..c7e47d6 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -15,9 +15,16 @@ __email__      = "stefanha@linux.vnet.ibm.com"
 
 from tracetool import out
 
+def is_string(arg):
+    strtype = ('const char*', 'char*', 'const char *', 'char *')
+    if arg.lstrip().startswith(strtype):
+        return True
+    else:
+        return False
 
 def c(events):
     out('#include "trace.h"',
+        '#include "trace/simple.h"',
         '',
         'TraceEvent trace_list[] = {')
 
@@ -26,30 +33,75 @@ def c(events):
             name = e.name,
             )
 
-    out('};')
+    out('};',
+        '')
+
+    for num, event in enumerate(events):
+        out('void trace_%(name)s(%(args)s)',
+            '{',
+            '    TraceBufferRecord rec;',
+            name = event.name,
+            args = event.args,
+            )
+        sizes = []
+        for type_, name in event.args:
+            if is_string(type_):
+                out('    size_t arg%(name)s_len = %(name)s ? MIN(strlen(%(name)s), MAX_TRACE_STRLEN) : 0;',
+                    name = name,
+                   )
+                strsizeinfo = "4 + arg%s_len" % name
+                sizes.append(strsizeinfo)
+            else:
+                sizes.append("8")
+        sizestr = " + ".join(sizes)
+        if len(event.args) == 0:
+            sizestr = '0'
+
+
+        out('',
+            '    if (!trace_list[%(event_id)s].state) {',
+            '        return;',
+            '    }',
+            '',
+            '    if (trace_record_start(&rec, %(event_id)s, %(size_str)s)) {',
+            '        return; /* Trace Buffer Full, Event Dropped ! */',
+            '    }',
+            event_id = num,
+            size_str = sizestr,
+            )
+
+        if len(event.args) > 0:
+            for type_, name in event.args:
+                # string
+                if is_string(type_):
+                    out('    trace_record_write_str(&rec, %(name)s, arg%(name)s_len);',
+                        name = name,
+                       )
+                # pointer var (not string)
+                elif type_.endswith('*'):
+                    out('    trace_record_write_u64(&rec, (uint64_t)(uint64_t *)%(name)s);',
+                        name = name,
+                       )
+                # primitive data type
+                else:
+                    out('    trace_record_write_u64(&rec, (uint64_t)%(name)s);',
+                       name = name,
+                       )
+
+        out('    trace_record_finish(&rec);',
+            '}',
+            '')
+
 
 def h(events):
     out('#include "trace/simple.h"',
         '')
 
-    for num, e in enumerate(events):
-        if len(e.args):
-            argstr = e.args.names()
-            arg_prefix = ', (uint64_t)(uintptr_t)'
-            cast_args = arg_prefix + arg_prefix.join(argstr)
-            simple_args = (str(num) + cast_args)
-        else:
-            simple_args = str(num)
-
-        out('static inline void trace_%(name)s(%(args)s)',
-            '{',
-            '    trace%(argc)d(%(trace_args)s);',
-            '}',
-            name = e.name,
-            args = e.args,
-            argc = len(e.args),
-            trace_args = simple_args,
+    for event in events:
+        out('void trace_%(name)s(%(args)s);',
+            name = event.name,
+            args = event.args,
             )
-
+    out('')
     out('#define NR_TRACE_EVENTS %d' % len(events))
     out('extern TraceEvent trace_list[NR_TRACE_EVENTS];')
diff --git a/trace/simple.c b/trace/simple.c
index b64bcf4..b700ea3 100644
--- a/trace/simple.c
+++ b/trace/simple.c
@@ -27,7 +27,7 @@
 #define HEADER_MAGIC 0xf2b177cb0aa429b4ULL
 
 /** Trace file version number, bump if format changes */
-#define HEADER_VERSION 0
+#define HEADER_VERSION 2
 
 /** Records were dropped event ID */
 #define DROPPED_EVENT_ID (~(uint64_t)0 - 1)
@@ -35,23 +35,6 @@
 /** Trace record is valid */
 #define TRACE_RECORD_VALID ((uint64_t)1 << 63)
 
-/** Trace buffer entry */
-typedef struct {
-    uint64_t event;
-    uint64_t timestamp_ns;
-    uint64_t x1;
-    uint64_t x2;
-    uint64_t x3;
-    uint64_t x4;
-    uint64_t x5;
-    uint64_t x6;
-} TraceRecord;
-
-enum {
-    TRACE_BUF_LEN = 4096,
-    TRACE_BUF_FLUSH_THRESHOLD = TRACE_BUF_LEN / 4,
-};
-
 /*
  * Trace records are written out by a dedicated thread.  The thread waits for
  * records to become available, writes them out, and then waits again.
@@ -62,11 +45,48 @@ static GCond *trace_empty_cond;
 static bool trace_available;
 static bool trace_writeout_enabled;
 
-static TraceRecord trace_buf[TRACE_BUF_LEN];
+enum {
+    TRACE_BUF_LEN = 4096 * 64,
+    TRACE_BUF_FLUSH_THRESHOLD = TRACE_BUF_LEN / 4,
+};
+
+uint8_t trace_buf[TRACE_BUF_LEN];
 static unsigned int trace_idx;
+static unsigned int writeout_idx;
+static uint64_t dropped_events;
 static FILE *trace_fp;
 static char *trace_file_name = NULL;
 
+/* * Trace buffer entry */
+typedef struct {
+    uint64_t event; /*   TraceEventID */
+    uint64_t timestamp_ns;
+    uint32_t length;   /*    in bytes */
+    uint32_t reserved; /*    unused */
+    uint8_t arguments[];
+} TraceRecord;
+
+typedef struct {
+    uint64_t header_event_id; /* HEADER_EVENT_ID */
+    uint64_t header_magic;    /* HEADER_MAGIC    */
+    uint64_t header_version;  /* HEADER_VERSION  */
+} TraceRecordHeader;
+
+
+static void read_from_buffer(unsigned int idx, void *dataptr, size_t size);
+static unsigned int write_to_buffer(unsigned int idx, void *dataptr, size_t size);
+
+static void clear_buffer_range(unsigned int idx, size_t len)
+{
+    uint32_t num = 0;
+    while (num < len) {
+        if (idx >= TRACE_BUF_LEN) {
+            idx = idx % TRACE_BUF_LEN;
+        }
+        trace_buf[idx++] = 0;
+        num++;
+    }
+}
 /**
  * Read a trace record from the trace buffer
  *
@@ -75,16 +95,30 @@ static char *trace_file_name = NULL;
  *
  * Returns false if the record is not valid.
  */
-static bool get_trace_record(unsigned int idx, TraceRecord *record)
+static bool get_trace_record(unsigned int idx, TraceRecord **recordptr)
 {
-    if (!(trace_buf[idx].event & TRACE_RECORD_VALID)) {
+    uint64_t event_flag = 0;
+    TraceRecord record;
+    /* read the event flag to see if its a valid record */
+    read_from_buffer(idx, &record, sizeof(event_flag));
+
+    if (!(record.event & TRACE_RECORD_VALID)) {
         return false;
     }
 
-    __sync_synchronize(); /* read memory barrier before accessing record */
-
-    *record = trace_buf[idx];
-    record->event &= ~TRACE_RECORD_VALID;
+    smp_rmb(); /* read memory barrier before accessing record */
+    /* read the record header to know record length */
+    read_from_buffer(idx, &record, sizeof(TraceRecord));
+    *recordptr = malloc(record.length); /* dont use g_malloc, can deadlock when traced */
+    /* make a copy of record to avoid being overwritten */
+    read_from_buffer(idx, *recordptr, record.length);
+    smp_rmb(); /* memory barrier before clearing valid flag */
+    (*recordptr)->event &= ~TRACE_RECORD_VALID;
+    /* clear the trace buffer range for consumed record otherwise any byte
+     * with its MSB set may be considered as a valid event id when the writer
+     * thread crosses this range of buffer again.
+     */
+    clear_buffer_range(idx, record.length);
     return true;
 }
 
@@ -120,29 +154,39 @@ static void wait_for_trace_records_available(void)
 
 static gpointer writeout_thread(gpointer opaque)
 {
-    TraceRecord record;
-    unsigned int writeout_idx = 0;
-    unsigned int num_available, idx;
+    TraceRecord *recordptr;
+    union {
+        TraceRecord rec;
+        uint8_t bytes[sizeof(TraceRecord) + sizeof(uint64_t)];
+    } dropped;
+    unsigned int idx = 0;
+    uint64_t dropped_count;
     size_t unused __attribute__ ((unused));
 
     for (;;) {
         wait_for_trace_records_available();
 
-        num_available = trace_idx - writeout_idx;
-        if (num_available > TRACE_BUF_LEN) {
-            record = (TraceRecord){
-                .event = DROPPED_EVENT_ID,
-                .x1 = num_available,
-            };
-            unused = fwrite(&record, sizeof(record), 1, trace_fp);
-            writeout_idx += num_available;
+        if (dropped_events) {
+            dropped.rec.event = DROPPED_EVENT_ID,
+            dropped.rec.timestamp_ns = get_clock();
+            dropped.rec.length = sizeof(TraceRecord) + sizeof(dropped_events),
+            dropped.rec.reserved = 0;
+            while (1) {
+                dropped_count = dropped_events;
+                if (g_atomic_int_compare_and_exchange((gint *)&dropped_events,
+                                                      dropped_count, 0)) {
+                    break;
+                }
+            }
+            memcpy(dropped.rec.arguments, &dropped_count, sizeof(uint64_t));
+            unused = fwrite(&dropped.rec, dropped.rec.length, 1, trace_fp);
         }
 
-        idx = writeout_idx % TRACE_BUF_LEN;
-        while (get_trace_record(idx, &record)) {
-            trace_buf[idx].event = 0; /* clear valid bit */
-            unused = fwrite(&record, sizeof(record), 1, trace_fp);
-            idx = ++writeout_idx % TRACE_BUF_LEN;
+        while (get_trace_record(idx, &recordptr)) {
+            unused = fwrite(recordptr, recordptr->length, 1, trace_fp);
+            writeout_idx += recordptr->length;
+            free(recordptr); /* dont use g_free, can deadlock when traced */
+            idx = writeout_idx % TRACE_BUF_LEN;
         }
 
         fflush(trace_fp);
@@ -150,73 +194,93 @@ static gpointer writeout_thread(gpointer opaque)
     return NULL;
 }
 
-static void trace(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3,
-                  uint64_t x4, uint64_t x5, uint64_t x6)
+void trace_record_write_u64(TraceBufferRecord *rec, uint64_t val)
 {
-    unsigned int idx;
-    uint64_t timestamp;
-
-    if (!trace_list[event].state) {
-        return;
-    }
-
-    timestamp = get_clock();
-#if GLIB_CHECK_VERSION(2, 30, 0)
-    idx = g_atomic_int_add((gint *)&trace_idx, 1) % TRACE_BUF_LEN;
-#else
-    idx = g_atomic_int_exchange_and_add((gint *)&trace_idx, 1) % TRACE_BUF_LEN;
-#endif
-    trace_buf[idx] = (TraceRecord){
-        .event = event,
-        .timestamp_ns = timestamp,
-        .x1 = x1,
-        .x2 = x2,
-        .x3 = x3,
-        .x4 = x4,
-        .x5 = x5,
-        .x6 = x6,
-    };
-    __sync_synchronize(); /* write barrier before marking as valid */
-    trace_buf[idx].event |= TRACE_RECORD_VALID;
-
-    if ((idx + 1) % TRACE_BUF_FLUSH_THRESHOLD == 0) {
-        flush_trace_file(false);
-    }
+    rec->rec_off = write_to_buffer(rec->rec_off, &val, sizeof(uint64_t));
 }
 
-void trace0(TraceEventID event)
+void trace_record_write_str(TraceBufferRecord *rec, const char *s, uint32_t slen)
 {
-    trace(event, 0, 0, 0, 0, 0, 0);
+    /* Write string length first */
+    rec->rec_off = write_to_buffer(rec->rec_off, &slen, sizeof(slen));
+    /* Write actual string now */
+    rec->rec_off = write_to_buffer(rec->rec_off, (void*)s, slen);
 }
 
-void trace1(TraceEventID event, uint64_t x1)
+int trace_record_start(TraceBufferRecord *rec, TraceEventID event, size_t datasize)
 {
-    trace(event, x1, 0, 0, 0, 0, 0);
-}
+    unsigned int idx, rec_off, old_idx, new_idx;
+    uint32_t rec_len = sizeof(TraceRecord) + datasize;
+    uint64_t timestamp_ns = get_clock();
+
+    while (1) {
+        old_idx = trace_idx;
+        smp_rmb();
+        new_idx = old_idx + rec_len;
+
+        if (new_idx - writeout_idx > TRACE_BUF_LEN) {
+            /* Trace Buffer Full, Event dropped ! */
+            g_atomic_int_inc((gint *)&dropped_events);
+            return -ENOSPC;
+        }
 
-void trace2(TraceEventID event, uint64_t x1, uint64_t x2)
-{
-    trace(event, x1, x2, 0, 0, 0, 0);
-}
+        if (g_atomic_int_compare_and_exchange((gint *)&trace_idx,
+                                              old_idx, new_idx)) {
+            break;
+        }
+    }
 
-void trace3(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3)
-{
-    trace(event, x1, x2, x3, 0, 0, 0);
+    idx = old_idx % TRACE_BUF_LEN;
+    /*  To check later if threshold crossed */
+    rec->next_tbuf_idx = new_idx % TRACE_BUF_LEN;
+
+    rec_off = idx;
+    rec_off = write_to_buffer(rec_off, (uint8_t*)&event, sizeof(event));
+    rec_off = write_to_buffer(rec_off, (uint8_t*)&timestamp_ns, sizeof(timestamp_ns));
+    rec_off = write_to_buffer(rec_off, (uint8_t*)&rec_len, sizeof(rec_len));
+
+    rec->tbuf_idx = idx;
+    rec->rec_off  = (idx + sizeof(TraceRecord)) % TRACE_BUF_LEN;
+    return 0;
 }
 
-void trace4(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4)
+static void read_from_buffer(unsigned int idx, void *dataptr, size_t size)
 {
-    trace(event, x1, x2, x3, x4, 0, 0);
+    uint8_t *data_ptr = dataptr;
+    uint32_t x = 0;
+    while (x < size) {
+        if (idx >= TRACE_BUF_LEN) {
+            idx = idx % TRACE_BUF_LEN;
+        }
+        data_ptr[x++] = trace_buf[idx++];
+    }
 }
 
-void trace5(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5)
+static unsigned int write_to_buffer(unsigned int idx, void *dataptr, size_t size)
 {
-    trace(event, x1, x2, x3, x4, x5, 0);
+    uint8_t *data_ptr = dataptr;
+    uint32_t x = 0;
+    while (x < size) {
+        if (idx >= TRACE_BUF_LEN) {
+            idx = idx % TRACE_BUF_LEN;
+        }
+        trace_buf[idx++] = data_ptr[x++];
+    }
+    return idx; /* most callers wants to know where to write next */
 }
 
-void trace6(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5, uint64_t x6)
+void trace_record_finish(TraceBufferRecord *rec)
 {
-    trace(event, x1, x2, x3, x4, x5, x6);
+    uint8_t temp_rec[sizeof(TraceRecord)];
+    TraceRecord *record = (TraceRecord *) temp_rec;
+    read_from_buffer(rec->tbuf_idx, temp_rec, sizeof(TraceRecord));
+    smp_wmb(); /* write barrier before marking as valid */
+    record->event |= TRACE_RECORD_VALID;
+    write_to_buffer(rec->tbuf_idx, temp_rec, sizeof(TraceRecord));
+
+    if ((trace_idx - writeout_idx) > TRACE_BUF_FLUSH_THRESHOLD) {
+        flush_trace_file(false);
+    }
 }
 
 void st_set_trace_file_enabled(bool enable)
@@ -231,10 +295,11 @@ void st_set_trace_file_enabled(bool enable)
     flush_trace_file(true);
 
     if (enable) {
-        static const TraceRecord header = {
-            .event = HEADER_EVENT_ID,
-            .timestamp_ns = HEADER_MAGIC,
-            .x1 = HEADER_VERSION,
+        static const TraceRecordHeader header = {
+            .header_event_id = HEADER_EVENT_ID,
+            .header_magic = HEADER_MAGIC,
+            /* Older log readers will check for version at next location */
+            .header_version = HEADER_VERSION,
         };
 
         trace_fp = fopen(trace_file_name, "wb");
diff --git a/trace/simple.h b/trace/simple.h
index 6b5358c..7e521c1 100644
--- a/trace/simple.h
+++ b/trace/simple.h
@@ -22,16 +22,41 @@ typedef struct {
     bool state;
 } TraceEvent;
 
-void trace0(TraceEventID event);
-void trace1(TraceEventID event, uint64_t x1);
-void trace2(TraceEventID event, uint64_t x1, uint64_t x2);
-void trace3(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3);
-void trace4(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4);
-void trace5(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5);
-void trace6(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5, uint64_t x6);
 void st_print_trace_file_status(FILE *stream, fprintf_function stream_printf);
 void st_set_trace_file_enabled(bool enable);
 bool st_set_trace_file(const char *file);
 void st_flush_trace_buffer(void);
 
+typedef struct {
+    unsigned int tbuf_idx;
+    unsigned int next_tbuf_idx;
+    unsigned int rec_off;
+} TraceBufferRecord;
+
+/* Note for hackers: Make sure MAX_TRACE_LEN < sizeof(uint32_t) */
+#define MAX_TRACE_STRLEN 512
+/**
+ * Initialize a trace record and claim space for it in the buffer
+ *
+ * @arglen  number of bytes required for arguments
+ */
+int trace_record_start(TraceBufferRecord *rec, TraceEventID id, size_t arglen);
+
+/**
+ * Append a 64-bit argument to a trace record
+ */
+void trace_record_write_u64(TraceBufferRecord *rec, uint64_t val);
+
+/**
+ * Append a string argument to a trace record
+ */
+void trace_record_write_str(TraceBufferRecord *rec, const char *s, uint32_t slen);
+
+/**
+ * Mark a trace record completed
+ *
+ * Don't append any more arguments to the trace record after calling this.
+ */
+void trace_record_finish(TraceBufferRecord *rec);
+
 #endif /* TRACE_SIMPLE_H */
-- 
1.7.10.4

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

* [Qemu-devel] [PATCH 4/4] Update simpletrace.py for new log format
  2012-07-19 10:52 [Qemu-devel] [PULL 0/4] Tracing patches Stefan Hajnoczi
                   ` (2 preceding siblings ...)
  2012-07-19 10:52 ` [Qemu-devel] [PATCH 3/4] Simpletrace v2: Support multiple arguments, strings Stefan Hajnoczi
@ 2012-07-19 10:52 ` Stefan Hajnoczi
  2012-07-19 11:52 ` [Qemu-devel] [PULL 0/4] Tracing patches Harsh Bora
  4 siblings, 0 replies; 20+ messages in thread
From: Stefan Hajnoczi @ 2012-07-19 10:52 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Harsh Prateek Bora, qemu-devel, Stefan Hajnoczi

From: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>

Support new tracelog format for multiple arguments and strings.

Signed-off-by: Harsh Prateek Bora <harsh@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 scripts/simpletrace.py |  116 +++++++++++++++++++++++++++++++-----------------
 1 file changed, 75 insertions(+), 41 deletions(-)

diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py
index f55e5e6..9b4419f 100755
--- a/scripts/simpletrace.py
+++ b/scripts/simpletrace.py
@@ -12,53 +12,69 @@
 import struct
 import re
 import inspect
+from tracetool import _read_events, Event
+from tracetool.backend.simple import is_string
 
 header_event_id = 0xffffffffffffffff
 header_magic    = 0xf2b177cb0aa429b4
-header_version  = 0
 dropped_event_id = 0xfffffffffffffffe
 
-trace_fmt = '=QQQQQQQQ'
-trace_len = struct.calcsize(trace_fmt)
-event_re  = re.compile(r'(disable\s+)?([a-zA-Z0-9_]+)\(([^)]*)\).*')
+log_header_fmt = '=QQQ'
+rec_header_fmt = '=QQII'
 
-def parse_events(fobj):
-    """Parse a trace-events file into {event_num: (name, arg1, ...)}."""
-
-    def get_argnames(args):
-        """Extract argument names from a parameter list."""
-        return tuple(arg.split()[-1].lstrip('*') for arg in args.split(','))
-
-    events = {dropped_event_id: ('dropped', 'count')}
-    event_num = 0
-    for line in fobj:
-        m = event_re.match(line.strip())
-        if m is None:
-            continue
-
-        disable, name, args = m.groups()
-        events[event_num] = (name,) + get_argnames(args)
-        event_num += 1
-    return events
+def read_header(fobj, hfmt):
+    '''Read a trace record header'''
+    hlen = struct.calcsize(hfmt)
+    hdr = fobj.read(hlen)
+    if len(hdr) != hlen:
+        return None
+    return struct.unpack(hfmt, hdr)
 
-def read_record(fobj):
+def get_record(edict, rechdr, fobj):
     """Deserialize a trace record from a file into a tuple (event_num, timestamp, arg1, ..., arg6)."""
-    s = fobj.read(trace_len)
-    if len(s) != trace_len:
+    if rechdr is None:
         return None
-    return struct.unpack(trace_fmt, s)
+    rec = (rechdr[0], rechdr[1])
+    if rechdr[0] != dropped_event_id:
+        event_id = rechdr[0]
+        event = edict[event_id]
+        for type, name in event.args:
+            if is_string(type):
+                l = fobj.read(4)
+                (len,) = struct.unpack('=L', l)
+                s = fobj.read(len)
+                rec = rec + (s,)
+            else:
+                (value,) = struct.unpack('=Q', fobj.read(8))
+                rec = rec + (value,)
+    else:
+        (value,) = struct.unpack('=Q', fobj.read(8))
+        rec = rec + (value,)
+    return rec
+
+
+def read_record(edict, fobj):
+    """Deserialize a trace record from a file into a tuple (event_num, timestamp, arg1, ..., arg6)."""
+    rechdr = read_header(fobj, rec_header_fmt)
+    return get_record(edict, rechdr, fobj) # return tuple of record elements
 
-def read_trace_file(fobj):
+def read_trace_file(edict, fobj):
     """Deserialize trace records from a file, yielding record tuples (event_num, timestamp, arg1, ..., arg6)."""
-    header = read_record(fobj)
+    header = read_header(fobj, log_header_fmt)
     if header is None or \
        header[0] != header_event_id or \
-       header[1] != header_magic or \
-       header[2] != header_version:
-        raise ValueError('not a trace file or incompatible version')
+       header[1] != header_magic:
+        raise ValueError('Not a valid trace file!')
+    if header[2] != 0 and \
+       header[2] != 2:
+        raise ValueError('Unknown version of tracelog format!')
+
+    log_version = header[2]
+    if log_version == 0:
+        raise ValueError('Older log format, not supported with this Qemu release!')
 
     while True:
-        rec = read_record(fobj)
+        rec = read_record(edict, fobj)
         if rec is None:
             break
 
@@ -89,16 +105,29 @@ class Analyzer(object):
 def process(events, log, analyzer):
     """Invoke an analyzer on each event in a log."""
     if isinstance(events, str):
-        events = parse_events(open(events, 'r'))
+        events = _read_events(open(events, 'r'))
     if isinstance(log, str):
         log = open(log, 'rb')
 
+    enabled_events = []
+    dropped_event = Event.build("Dropped_Event(uint64_t num_events_dropped)")
+    edict = {dropped_event_id: dropped_event}
+
+    for e in events:
+        if 'disable' not in e.properties:
+            enabled_events.append(e)
+    for num, event in enumerate(enabled_events):
+        edict[num] = event
+
     def build_fn(analyzer, event):
-        fn = getattr(analyzer, event[0], None)
+        if isinstance(event, str):
+            return analyzer.catchall
+
+        fn = getattr(analyzer, event.name, None)
         if fn is None:
             return analyzer.catchall
 
-        event_argcount = len(event) - 1
+        event_argcount = len(event.args)
         fn_argcount = len(inspect.getargspec(fn)[0]) - 1
         if fn_argcount == event_argcount + 1:
             # Include timestamp as first argument
@@ -109,9 +138,9 @@ def process(events, log, analyzer):
 
     analyzer.begin()
     fn_cache = {}
-    for rec in read_trace_file(log):
+    for rec in read_trace_file(edict, log):
         event_num = rec[0]
-        event = events[event_num]
+        event = edict[event_num]
         if event_num not in fn_cache:
             fn_cache[event_num] = build_fn(analyzer, event)
         fn_cache[event_num](event, rec)
@@ -128,7 +157,7 @@ def run(analyzer):
         sys.stderr.write('usage: %s <trace-events> <trace-file>\n' % sys.argv[0])
         sys.exit(1)
 
-    events = parse_events(open(sys.argv[1], 'r'))
+    events = _read_events(open(sys.argv[1], 'r'))
     process(events, sys.argv[2], analyzer)
 
 if __name__ == '__main__':
@@ -137,15 +166,20 @@ if __name__ == '__main__':
             self.last_timestamp = None
 
         def catchall(self, event, rec):
+            i = 1
             timestamp = rec[1]
             if self.last_timestamp is None:
                 self.last_timestamp = timestamp
             delta_ns = timestamp - self.last_timestamp
             self.last_timestamp = timestamp
 
-            fields = [event[0], '%0.3f' % (delta_ns / 1000.0)]
-            for i in xrange(1, len(event)):
-                fields.append('%s=0x%x' % (event[i], rec[i + 1]))
+            fields = [event.name, '%0.3f' % (delta_ns / 1000.0)]
+            for type, name in event.args:
+                if is_string(type):
+                    fields.append('%s=%s' % (name, rec[i + 1]))
+                else:
+                    fields.append('%s=0x%x' % (name, rec[i + 1]))
+                i += 1
             print ' '.join(fields)
 
     run(Formatter())
-- 
1.7.10.4

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

* Re: [Qemu-devel] [PULL 0/4] Tracing patches
  2012-07-19 10:52 [Qemu-devel] [PULL 0/4] Tracing patches Stefan Hajnoczi
                   ` (3 preceding siblings ...)
  2012-07-19 10:52 ` [Qemu-devel] [PATCH 4/4] Update simpletrace.py for new log format Stefan Hajnoczi
@ 2012-07-19 11:52 ` Harsh Bora
  4 siblings, 0 replies; 20+ messages in thread
From: Harsh Bora @ 2012-07-19 11:52 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Anthony Liguori, qemu-devel

On 07/19/2012 04:22 PM, Stefan Hajnoczi wrote:
> Simpletrace v2 has landed:
>   * Strings are now logged instead of their pointers
>   * Variable-length arguments allow for >6 trace event arguments
>
> Thanks to Harsh Prateek Bora for this improvement!

Thanks very much to Stefan Hajnoczi for his effective, detailed reviews 
without which it would have taken longer.

regards,
Harsh

>
> The following changes since commit dfe1ce5d80cba603bafaac91b239d683abe19cf7:
>
>    Merge remote-tracking branch 'kwolf/for-anthony' into staging (2012-07-18 14:44:50 -0500)
>
> are available in the git repository at:
>
>
>    git://github.com/stefanha/qemu.git tracing
>
> for you to fetch changes up to 90a147a275da3a432bdf00238ebf438eff1d2c1b:
>
>    Update simpletrace.py for new log format (2012-07-19 11:34:33 +0100)
>
> ----------------------------------------------------------------
> Alexey Kardashevskiy (1):
>        trace: added ability to comment out events in the list
>
> Harsh Prateek Bora (3):
>        monitor: remove unused do_info_trace
>        Simpletrace v2: Support multiple arguments, strings.
>        Update simpletrace.py for new log format
>
>   monitor.c                           |   16 ---
>   scripts/simpletrace.py              |  116 +++++++++------
>   scripts/tracetool/backend/simple.py |   90 +++++++++---
>   trace/control.c                     |    3 +
>   trace/simple.c                      |  271 ++++++++++++++++++++---------------
>   trace/simple.h                      |   40 ++++--
>   6 files changed, 340 insertions(+), 196 deletions(-)
>

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

* Re: [Qemu-devel] [PULL 0/4] Tracing patches
  2017-12-18 14:47 Stefan Hajnoczi
@ 2017-12-19 12:48 ` Peter Maydell
  0 siblings, 0 replies; 20+ messages in thread
From: Peter Maydell @ 2017-12-19 12:48 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 18 December 2017 at 14:47, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 411ad78115ebeb3411cf4b7622784b93dfabe259:
>
>   Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2017-12-15-1' into staging (2017-12-17 15:27:41 +0000)
>
> are available in the Git repository at:
>
>   git://github.com/stefanha/qemu.git tags/tracing-pull-request
>
> for you to fetch changes up to 5c9522b358faf9688fd83cd0a881e1990bb84516:
>
>   gdbstub: add tracing (2017-12-18 14:37:36 +0000)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------
>

Applied, thanks.

-- PMM

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

* [Qemu-devel] [PULL 0/4] Tracing patches
@ 2017-12-18 14:47 Stefan Hajnoczi
  2017-12-19 12:48 ` Peter Maydell
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Hajnoczi @ 2017-12-18 14:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit 411ad78115ebeb3411cf4b7622784b93dfabe259:

  Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2017-12-15-1' into staging (2017-12-17 15:27:41 +0000)

are available in the Git repository at:

  git://github.com/stefanha/qemu.git tags/tracing-pull-request

for you to fetch changes up to 5c9522b358faf9688fd83cd0a881e1990bb84516:

  gdbstub: add tracing (2017-12-18 14:37:36 +0000)

----------------------------------------------------------------

----------------------------------------------------------------

Doug Gale (1):
  gdbstub: add tracing

Namhyung Kim (3):
  trace: Simplify find_debugfs()
  trace: Generalize searching for debugfs
  trace: Try using tracefs first

 gdbstub.c      | 113 +++++++++++++++++++++++++++++++++++++++------------------
 trace/ftrace.c |  33 ++++++++++-------
 trace-events   |  28 ++++++++++++++
 3 files changed, 125 insertions(+), 49 deletions(-)

-- 
2.14.3

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

* Re: [Qemu-devel] [PULL 0/4] Tracing patches
  2017-01-16 13:44 Stefan Hajnoczi
@ 2017-01-19 10:46 ` Peter Maydell
  0 siblings, 0 replies; 20+ messages in thread
From: Peter Maydell @ 2017-01-19 10:46 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 16 January 2017 at 13:44, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 2ccede18bd24fce5db83fef3674563a1f256717b:
>
>   Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.9-pull-request' into staging (2017-01-16 12:41:35 +0000)
>
> are available in the git repository at:
>
>   git://github.com/stefanha/qemu.git tags/tracing-pull-request
>
> for you to fetch changes up to a47e87151e785977d34e7b726495e7781860ca9f:
>
>   trace: Add event "guest_cpu_exit" (2017-01-16 13:40:56 +0000)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------
>

Applied, thanks.

-- PMM

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

* [Qemu-devel] [PULL 0/4] Tracing patches
@ 2017-01-16 13:44 Stefan Hajnoczi
  2017-01-19 10:46 ` Peter Maydell
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Hajnoczi @ 2017-01-16 13:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit 2ccede18bd24fce5db83fef3674563a1f256717b:

  Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.9-pull-request' into staging (2017-01-16 12:41:35 +0000)

are available in the git repository at:

  git://github.com/stefanha/qemu.git tags/tracing-pull-request

for you to fetch changes up to a47e87151e785977d34e7b726495e7781860ca9f:

  trace: Add event "guest_cpu_exit" (2017-01-16 13:40:56 +0000)

----------------------------------------------------------------

----------------------------------------------------------------

Lluís Vilanova (3):
  trace: Lock vCPU list when initializing dynamic tracing state
  trace: Fix dynamic event state on vCPU hot-unplug
  trace: Add event "guest_cpu_exit"

Marc-André Lureau (1):
  trace-events: spelling fix

 trace/control.h        |  8 ++++++++
 qom/cpu.c              |  2 ++
 trace/control-target.c | 11 ++++++++++-
 trace/control.c        | 19 +++++++++++++++++++
 trace-events           |  8 +++++++-
 5 files changed, 46 insertions(+), 2 deletions(-)

-- 
2.9.3

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

* Re: [Qemu-devel] [PULL 0/4] Tracing patches
  2016-03-31 12:35 Stefan Hajnoczi
@ 2016-03-31 13:58 ` Peter Maydell
  0 siblings, 0 replies; 20+ messages in thread
From: Peter Maydell @ 2016-03-31 13:58 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 31 March 2016 at 13:35, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 9370a3bbc478f623dd21d783560629ea2064625b:
>
>   Update version for v2.6.0-rc0 release (2016-03-30 19:25:40 +0100)
>
> are available in the git repository at:
>
>   git://github.com/stefanha/qemu.git tags/tracing-pull-request
>
> for you to fetch changes up to a6d4953b6057dfc0b9b6b2d775231648fca3ca2b:
>
>   trace-events: Fix typos (found by codespell) (2016-03-31 10:37:00 +0100)

Applied, thanks.

-- PMM

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

* [Qemu-devel] [PULL 0/4] Tracing patches
@ 2016-03-31 12:35 Stefan Hajnoczi
  2016-03-31 13:58 ` Peter Maydell
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Hajnoczi @ 2016-03-31 12:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit 9370a3bbc478f623dd21d783560629ea2064625b:

  Update version for v2.6.0-rc0 release (2016-03-30 19:25:40 +0100)

are available in the git repository at:

  git://github.com/stefanha/qemu.git tags/tracing-pull-request

for you to fetch changes up to a6d4953b6057dfc0b9b6b2d775231648fca3ca2b:

  trace-events: Fix typos (found by codespell) (2016-03-31 10:37:00 +0100)

----------------------------------------------------------------

----------------------------------------------------------------

Denis V. Lunev (2):
  trace: do not always call exit() in trace_enable_events
  log: move qemu_log_close/qemu_log_flush from header to log.c

Richard W.M. Jones (1):
  docs: Update documentation for stderr (now log) tracing backend.

Stefan Weil (1):
  trace-events: Fix typos (found by codespell)

 docs/tracing.txt   |  4 ++--
 include/qemu/log.h | 22 +++++-----------------
 trace-events       |  4 ++--
 trace/control.c    |  5 ++++-
 util/log.c         | 17 +++++++++++++++++
 5 files changed, 30 insertions(+), 22 deletions(-)

-- 
2.5.5

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

* Re: [Qemu-devel] [PULL 0/4] Tracing patches
  2016-01-07  9:13 Stefan Hajnoczi
@ 2016-01-07 11:22 ` Peter Maydell
  0 siblings, 0 replies; 20+ messages in thread
From: Peter Maydell @ 2016-01-07 11:22 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers

On 7 January 2016 at 09:13, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 38a762fec63fd5c035aae29ba9a77d357e21e4a7:
>
>   Merge remote-tracking branch 'remotes/berrange/tags/pull-crypto-fixes-2015-12-23-1' into staging (2015-12-23 13:53:32 +0000)
>
> are available in the git repository at:
>
>   git://github.com/stefanha/qemu.git tags/tracing-pull-request
>
> for you to fetch changes up to cef517ca4bf890ef5405aac1b95f75dcda043d6a:
>
>   trace: add make dependencies on tracetool source (2016-01-07 16:59:56 +0800)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------

Applied, thanks. (Hopefully this fixes the travis builds.)

-- PMM

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

* [Qemu-devel] [PULL 0/4] Tracing patches
@ 2016-01-07  9:13 Stefan Hajnoczi
  2016-01-07 11:22 ` Peter Maydell
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Hajnoczi @ 2016-01-07  9:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi

The following changes since commit 38a762fec63fd5c035aae29ba9a77d357e21e4a7:

  Merge remote-tracking branch 'remotes/berrange/tags/pull-crypto-fixes-2015-12-23-1' into staging (2015-12-23 13:53:32 +0000)

are available in the git repository at:

  git://github.com/stefanha/qemu.git tags/tracing-pull-request

for you to fetch changes up to cef517ca4bf890ef5405aac1b95f75dcda043d6a:

  trace: add make dependencies on tracetool source (2016-01-07 16:59:56 +0800)

----------------------------------------------------------------

----------------------------------------------------------------

Mark Cave-Ayland (1):
  trace: fix PRIx64 constants in trace-events

Qinghua Jin (1):
  trace: reflect the file name change

Stefan Hajnoczi (2):
  trace: fix make foo-timestamp rules
  trace: add make dependencies on tracetool source

 trace-events        | 14 ++++++++------
 trace/Makefile.objs | 48 ++++++++++++++++++++++++++++--------------------
 2 files changed, 36 insertions(+), 26 deletions(-)

-- 
2.5.0

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

* Re: [Qemu-devel] [PULL 0/4] Tracing patches
  2014-01-27 14:53 Stefan Hajnoczi
@ 2014-01-31 11:22 ` Peter Maydell
  0 siblings, 0 replies; 20+ messages in thread
From: Peter Maydell @ 2014-01-31 11:22 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: QEMU Developers, Anthony Liguori

On 27 January 2014 14:53, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> The following changes since commit 0169c511554cb0014a00290b0d3d26c31a49818f:
>
>   Merge remote-tracking branch 'qemu-kvm/uq/master' into staging (2014-01-24 15:52:44 -0800)
>
> are available in the git repository at:
>
>
>   git://github.com/stefanha/qemu.git tags/tracing-pull-request
>
> for you to fetch changes up to 736ec1677f1ae7e64f2f3436ca3775c48f79678c:
>
>   trace: fix simple trace "disable" keyword (2014-01-27 15:49:39 +0100)
>
> ----------------------------------------------------------------
> Tracing pull request
>

Applied, thanks.

-- PMM

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

* [Qemu-devel] [PULL 0/4] Tracing patches
@ 2014-01-27 14:53 Stefan Hajnoczi
  2014-01-31 11:22 ` Peter Maydell
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Hajnoczi @ 2014-01-27 14:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Anthony Liguori

The following changes since commit 0169c511554cb0014a00290b0d3d26c31a49818f:

  Merge remote-tracking branch 'qemu-kvm/uq/master' into staging (2014-01-24 15:52:44 -0800)

are available in the git repository at:


  git://github.com/stefanha/qemu.git tags/tracing-pull-request

for you to fetch changes up to 736ec1677f1ae7e64f2f3436ca3775c48f79678c:

  trace: fix simple trace "disable" keyword (2014-01-27 15:49:39 +0100)

----------------------------------------------------------------
Tracing pull request

----------------------------------------------------------------
Lluís Vilanova (1):
      trace: [simple] Do not include "trace/simple.h" in generated tracer headers

Michael Mueller (1):
      tracing: start trace processing thread in final child process

Stefan Hajnoczi (2):
      trace: add glib 2.32+ static GMutex support
      trace: fix simple trace "disable" keyword

 scripts/tracetool/backend/simple.py |  6 ++----
 trace/simple.c                      | 24 +++++++++++++++++-------
 vl.c                                | 12 ++++++++++--
 3 files changed, 29 insertions(+), 13 deletions(-)

-- 
1.8.4.2

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

* [Qemu-devel] [PULL 0/4] Tracing patches
@ 2013-05-03 12:01 Stefan Hajnoczi
  0 siblings, 0 replies; 20+ messages in thread
From: Stefan Hajnoczi @ 2013-05-03 12:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Stefan Hajnoczi

This tracing pull request is long overdue for QEMU 1.5.

Eiichi Tsukata's ftrace backend makes it easy to correlate QEMU events with
host kernel events.  He also reports good performance.

Kazuya Saito's trace events make it easier to observe the KVM run loop.

The following changes since commit 8ca27ce2e1150486ea2db4116a03706b28294f16:

  Merge remote-tracking branch 'afaerber/qom-cpu' into staging (2013-05-02 10:57:01 -0500)

are available in the git repository at:


  git://github.com/stefanha/qemu.git tracing

for you to fetch changes up to e64dd5efb2c6d522a3bc9d096cd49a4e53f0ae10:

  trace: document ftrace backend (2013-05-03 13:58:09 +0200)

----------------------------------------------------------------
Eiichi Tsukata (2):
      trace: Add ftrace tracing backend
      trace: document ftrace backend

Kazuya Saito (2):
      kvm-all: add kvm_ioctl, kvm_vm_ioctl, kvm_vcpu_ioctl tracepoints
      kvm-all: add kvm_run_exit tracepoint

 configure                           |   8 +++
 docs/tracing.txt                    |  16 ++++++
 kvm-all.c                           |   5 ++
 scripts/tracetool/backend/ftrace.py |  54 +++++++++++++++++++
 trace-events                        |   7 +++
 trace/Makefile.objs                 |   1 +
 trace/ftrace.c                      | 102 ++++++++++++++++++++++++++++++++++++
 trace/ftrace.h                      |  10 ++++
 8 files changed, 203 insertions(+)
 create mode 100644 scripts/tracetool/backend/ftrace.py
 create mode 100644 trace/ftrace.c
 create mode 100644 trace/ftrace.h

-- 
1.8.1.4

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

* [Qemu-devel] [PULL 0/4] Tracing patches
@ 2012-11-16 13:19 Stefan Hajnoczi
  0 siblings, 0 replies; 20+ messages in thread
From: Stefan Hajnoczi @ 2012-11-16 13:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi

The following changes since commit 6801038bc52d61f81ac8a25fbe392f1bad982887:

  target-mips: fix wrong microMIPS opcode encoding (2012-11-15 14:48:16 +0100)

are available in the git repository at:

  git://github.com/stefanha/qemu.git tracing

for you to fetch changes up to e94c4c9287392e9c4de5e9cc3a0fa40da959ccb5:

  trace: Remove "info trace" from documents (2012-11-16 13:35:48 +0100)

----------------------------------------------------------------
Daniel P. Berrange (1):
      Avoid all systemtap reserved words

Gerd Hoffmann (1):
      trace: allow disabling events in events file

Liming Wang (1):
      trace: Remove "info trace" from documents

Stefan Hajnoczi (1):
      trace: document '-' syntax for disabling events

 docs/tracing.txt                    | 13 ++++---------
 hmp-commands.hx                     |  7 -------
 scripts/tracetool/backend/dtrace.py | 11 ++++++++++-
 trace/control.c                     |  9 ++++++++-
 4 files changed, 22 insertions(+), 18 deletions(-)

-- 
1.8.0

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

* Re: [Qemu-devel] [PULL 0/4] Tracing patches
  2011-10-03 11:30 Stefan Hajnoczi
@ 2011-10-08 16:35 ` Blue Swirl
  0 siblings, 0 replies; 20+ messages in thread
From: Blue Swirl @ 2011-10-08 16:35 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Anthony Liguori, qemu-devel

On Mon, Oct 3, 2011 at 11:30 AM, Stefan Hajnoczi
<stefanha@linux.vnet.ibm.com> wrote:
> The following changes since commit d11cf8cc80d946dfc9a23597cd9a0bb1c487cfa7:
>
>  etrax-dma: Remove bogus if statement (2011-10-03 10:20:13 +0200)
>
> are available in the git repository at:
>  ssh://repo.or.cz/srv/git/qemu/stefanha.git tracing

Thanks, pulled.

>
> Michael Roth (1):
>      hmp: re-enable trace-file command
>
> Stefan Hajnoczi (3):
>      trace: trace bdrv_open_common()
>      trace: trace monitor qmp dispatch/completion
>      trace: add arguments to bdrv_co_io_em() trace event
>
>  block.c         |    4 +++-
>  hmp-commands.hx |    2 +-
>  monitor.c       |    7 +++++--
>  trace-events    |    7 ++++++-
>  4 files changed, 15 insertions(+), 5 deletions(-)
>
> --
> 1.7.6.3
>
>

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

* [Qemu-devel] [PULL 0/4] Tracing patches
@ 2011-10-03 11:30 Stefan Hajnoczi
  2011-10-08 16:35 ` Blue Swirl
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Hajnoczi @ 2011-10-03 11:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Stefan Hajnoczi

The following changes since commit d11cf8cc80d946dfc9a23597cd9a0bb1c487cfa7:

  etrax-dma: Remove bogus if statement (2011-10-03 10:20:13 +0200)

are available in the git repository at:
  ssh://repo.or.cz/srv/git/qemu/stefanha.git tracing

Michael Roth (1):
      hmp: re-enable trace-file command

Stefan Hajnoczi (3):
      trace: trace bdrv_open_common()
      trace: trace monitor qmp dispatch/completion
      trace: add arguments to bdrv_co_io_em() trace event

 block.c         |    4 +++-
 hmp-commands.hx |    2 +-
 monitor.c       |    7 +++++--
 trace-events    |    7 ++++++-
 4 files changed, 15 insertions(+), 5 deletions(-)

-- 
1.7.6.3

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

end of thread, other threads:[~2017-12-19 12:49 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19 10:52 [Qemu-devel] [PULL 0/4] Tracing patches Stefan Hajnoczi
2012-07-19 10:52 ` [Qemu-devel] [PATCH 1/4] trace: added ability to comment out events in the list Stefan Hajnoczi
2012-07-19 10:52 ` [Qemu-devel] [PATCH 2/4] monitor: remove unused do_info_trace Stefan Hajnoczi
2012-07-19 10:52 ` [Qemu-devel] [PATCH 3/4] Simpletrace v2: Support multiple arguments, strings Stefan Hajnoczi
2012-07-19 10:52 ` [Qemu-devel] [PATCH 4/4] Update simpletrace.py for new log format Stefan Hajnoczi
2012-07-19 11:52 ` [Qemu-devel] [PULL 0/4] Tracing patches Harsh Bora
  -- strict thread matches above, loose matches on Subject: below --
2017-12-18 14:47 Stefan Hajnoczi
2017-12-19 12:48 ` Peter Maydell
2017-01-16 13:44 Stefan Hajnoczi
2017-01-19 10:46 ` Peter Maydell
2016-03-31 12:35 Stefan Hajnoczi
2016-03-31 13:58 ` Peter Maydell
2016-01-07  9:13 Stefan Hajnoczi
2016-01-07 11:22 ` Peter Maydell
2014-01-27 14:53 Stefan Hajnoczi
2014-01-31 11:22 ` Peter Maydell
2013-05-03 12:01 Stefan Hajnoczi
2012-11-16 13:19 Stefan Hajnoczi
2011-10-03 11:30 Stefan Hajnoczi
2011-10-08 16:35 ` Blue Swirl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.