qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, "Lluís Vilanova" <vilanova@ac.upc.edu>,
	"Stefan Hajnoczi" <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 11/20] trace: emit name <-> ID mapping in simpletrace header
Date: Wed, 5 Oct 2016 15:09:47 +0100	[thread overview]
Message-ID: <20161005140947.GJ863@stefanha-x1.localdomain> (raw)
In-Reply-To: <1475588159-30598-12-git-send-email-berrange@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2153 bytes --]

On Tue, Oct 04, 2016 at 02:35:50PM +0100, Daniel P. Berrange wrote:
> Currently simpletrace assumes that events are given IDs
> starting from 0, based on the order in which they appear
> in the trace-events file, with no gaps. When the
> trace-events file is split up, this assumption becomes
> problematic.
> 
> To deal with this, extend the simpletrace format so that
> it outputs a table of event name <-> ID mappings. That
> will allow QEMU to assign arbitrary IDs to events without
> breaking simpletrace parsing.
> 
> The v3 simple trace format was
> 
>   FILE HEADER
>   EVENT TRACE RECORD 0
>   EVENT TRACE RECORD 1
>   ...
>   EVENT TRACE RECORD N
> 
> The v4 simple trace format is now
> 
>   FILE HEADER
>   EVENT MAPPING RECORD 0
>   EVENT MAPPING RECORD 1
>   ...
>   EVENT MAPPING RECORD M
>   EVENT TRACE RECORD RECORD 0
>   EVENT TRACE RECORD RECORD 1
>   ...
>   EVENT TRACE RECORD N
> 
> Although this shows all the mapping records being emitted
> upfront, this is not required by the format. While the main
> simpletrace backend will emit all mappings at startup,
> the systemtap simpletrace.stp script will emit the mappings
> at first use. eg
> 
>   FILE HEADER
>   ...
>   EVENT MAPPING RECORD 0
>   EVENT TRACE RECORD RECORD 0
>   EVENT TRACE RECORD RECORD 1
>   EVENT MAPPING RECORD 1
>   EVENT TRACE RECORD RECORD 2
>   ...
>   EVENT TRACE RECORD N
> 
> This is more space efficient given that most trace records
> only include a subset of events.
> 
> In modifying the systemtap simpletrace code, a 'begin' probe
> was added to emit the trace event header, so you no longer
> need to add '--no-header' when running simpletrace.py for
> systemtap generated trace files.
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
>  scripts/simpletrace.py                       | 50 ++++++++++++++++++++--------
>  scripts/tracetool/format/simpletrace_stap.py | 24 +++++++++++--
>  trace/simple.c                               | 33 ++++++++++++++++--
>  3 files changed, 89 insertions(+), 18 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2016-10-05 14:09 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-04 13:35 [Qemu-devel] [PATCH v6 00/20] Refactor trace to allow modular build Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 01/20] trace: move colo trace events to net/ sub-directory Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 02/20] trace: remove double-underscore in event name Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 03/20] trace: add trace event iterator APIs Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 04/20] trace: convert code to use event iterators Daniel P. Berrange
2016-10-05  9:48   ` Lluís Vilanova
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 05/20] trace: remove some now unused functions Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 06/20] trace: remove global 'uint16 dstate[]' array Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 07/20] trace: remove duplicate control.h includes in generated-tracers.h Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 08/20] trace: break circular dependency in event-internal.h Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 09/20] trace: give each trace event a named TraceEvent struct Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 10/20] trace: remove the TraceEventID and TraceEventVCPUID enums Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 11/20] trace: emit name <-> ID mapping in simpletrace header Daniel P. Berrange
2016-10-05 14:09   ` Stefan Hajnoczi [this message]
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 12/20] trace: don't abort qemu if ftrace can't be initialized Daniel P. Berrange
2016-10-04 20:12   ` Eric Blake
2016-10-05 15:39     ` Stefan Hajnoczi
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 13/20] trace: provide mechanism for registering trace events Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 14/20] trace: dynamically allocate trace_dstate in CPUState Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 15/20] trace: dynamically allocate event IDs at runtime Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 16/20] trace: get rid of generated-events.h/generated-events.c Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 17/20] trace: rename _read_events to read_events Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 18/20] trace: push reading of events up a level to tracetool main Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 19/20] trace: pass trace-events to tracetool as a positional param Daniel P. Berrange
2016-10-04 13:35 ` [Qemu-devel] [PATCH v6 20/20] trace: introduce a formal group name for trace events Daniel P. Berrange
2016-10-05  9:53   ` Lluís Vilanova
2016-10-05 15:31 ` [Qemu-devel] [PATCH v6 00/20] Refactor trace to allow modular build Stefan Hajnoczi
2016-10-06  8:21   ` Daniel P. Berrange
2016-10-06  9:12   ` Daniel P. Berrange
2016-10-05 15:32 ` Stefan Hajnoczi
2016-10-07 13:51 ` [Qemu-devel] [PATCH v6 21/20] linux-user/bsd-user: initialize trace events subsystem Daniel P. Berrange
2016-10-07 14:14   ` Daniel P. Berrange
2016-10-12  7:50   ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161005140947.GJ863@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vilanova@ac.upc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).