[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 10/12] trace: [tracetool] Automatically establis
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 10/12] trace: [tracetool] Automatically establish available backends and formats |
Date: |
Thu, 22 Mar 2012 08:07:53 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Mar 21, 2012 at 03:10:49PM +0100, Lluís Vilanova wrote:
> Stefan Hajnoczi writes:
> [...]
> >> Maybe this would work nice for everybody:
> >>
> >> tracetool.py # main program (just parse cmdline opts and
> >> call tracetool module)
> >> tracetool/__init__.py # common boilerplate code (e.g., event
> >> parsing and call dispatching)
> >> tracetool/format/__init__.py # format auto-registration/lookup code
> >> tracetool/format/h.py # code for the 'h' format
> >> # __doc__ [mandatory, format
> >> description]
> >> # def begin(events) [optional]
> >> # def end(events) [optional]
> >> tracetool/backend/__init__.py # backend auto-registration/lookup code
> >> tracetool/backend/simple.py # code for the 'simple' backend
> >> # __doc__ [mandatory, backend
> >> description]
> >> # PUBLIC = [True|False] [optional,
> >> # defaults to False,
> >> # indicates it's
> >> listed on --list-backends]
> >> # def format(events) [optional,
> >> # backend-specific code
> >> for given format,
> >> # implicitly indicates
> >> format compatibility]
>
> > Let's call this function backend.generate(events) instead of "format"
> > since we already use that term and it's a Python builtin too. This is
> > a code generation function.
>
> Maybe I wasn't clear. I meant that for tracetool/backend/simple.py to work
> with
> the format 'h', it must have the following routine:
>
> def h (events):
> ...
>
> That is, there must exist a routine with the same name of the format (with '-'
> replaced with '_', when necessary) for the backend to be compatible with that
> format.
Ah, yes. That makes sense, I misunderstood.
Stefan
- [Qemu-devel] [PATCH 04/12] trace: [tracetool] Simplify event line parsing, (continued)
- [Qemu-devel] [PATCH 04/12] trace: [tracetool] Simplify event line parsing, Lluís Vilanova, 2012/03/13
- [Qemu-devel] [PATCH 08/12] trace: [tracetool] Rewrite event argument parsing, Lluís Vilanova, 2012/03/13
- [Qemu-devel] [PATCH 09/12] trace: [tracetool] Make format-specific code optional and with access to events, Lluís Vilanova, 2012/03/13
- [Qemu-devel] [PATCH 10/12] trace: [tracetool] Automatically establish available backends and formats, Lluís Vilanova, 2012/03/13
- Re: [Qemu-devel] [PATCH 10/12] trace: [tracetool] Automatically establish available backends and formats, Stefan Hajnoczi, 2012/03/20
- Re: [Qemu-devel] [PATCH 10/12] trace: [tracetool] Automatically establish available backends and formats, Lluís Vilanova, 2012/03/20
- Re: [Qemu-devel] [PATCH 10/12] trace: [tracetool] Automatically establish available backends and formats, Stefan Hajnoczi, 2012/03/20
- Re: [Qemu-devel] [PATCH 10/12] trace: [tracetool] Automatically establish available backends and formats, Lluís Vilanova, 2012/03/20
- Re: [Qemu-devel] [PATCH 10/12] trace: [tracetool] Automatically establish available backends and formats, Stefan Hajnoczi, 2012/03/21
- Re: [Qemu-devel] [PATCH 10/12] trace: [tracetool] Automatically establish available backends and formats, Lluís Vilanova, 2012/03/21
- Re: [Qemu-devel] [PATCH 10/12] trace: [tracetool] Automatically establish available backends and formats,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PATCH 10/12] trace: [tracetool] Automatically establish available backends and formats, Lluís Vilanova, 2012/03/21
- Re: [Qemu-devel] [PATCH 10/12] trace: [tracetool] Automatically establish available backends and formats, Lluís Vilanova, 2012/03/21
[Qemu-devel] [PATCH 11/12] trace: Provide a per-event status define for conditional compilation, Lluís Vilanova, 2012/03/13
[Qemu-devel] [PATCH 12/12] trace: [tracetool] Add error-reporting functions, Lluís Vilanova, 2012/03/13
Re: [Qemu-devel] [PATCH 00/12] Rewrite tracetool using python, Stefan Hajnoczi, 2012/03/20