All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 07 of 10] xenalyze: decode PV_HYPERCALL_V2 records
Date: Thu, 7 Jun 2012 12:35:12 +0100	[thread overview]
Message-ID: <4FD091F0.4040209@eu.citrix.com> (raw)
In-Reply-To: <d5f631485ce7fb1f1f4f.1338462983@qabil.uk.xensource.com>

On 31/05/12 12:16, David Vrabel wrote:
> Newer version of Xen produce TRC_PV_HYPERCALL_V2 records instead of
> the older TRC_PV_HYPERCALL format.  This updated format doesn't
> included the IP but it does include select hypercall arguments.
>
> Signed-off-by: David Vrabel<david.vrabel@citrix.com>
>
> diff --git a/pv.h b/pv.h
> new file mode 100644
> --- /dev/null
> +++ b/pv.h
Why does this need its own file?
> +static const char *grant_table_op_cmd_to_str(uint32_t cmd)
Hmm -- this is a different style to the other lists of this type.  I 
guess I like having it in a function.
> +{
> +    const char *cmd_str[] = {
> +        "map_grant_ref", "unmap_grant_ref", "setup_table", "dump_table",
> +        "transfer", "copy", "query_size", "unmap_and_replace",
> +        "set_version", "get_status_frames", "get_version", "swap_grant_ref",
> +    };
I'm a bit wary of having stuff just in a big list like this -- it seems 
like it makes it harder to double-check that you've gotten the right 
match-up.  I'd prefer it look like hvm_event_handler_name[], where the 
number is annotated with a comment from time to time.
> +    static char buf[32];
> +
> +    if (cmd<= 11)
> +        return cmd_str[cmd];
Instead of hardcoding the number of elements, could you use some 
calculation involving sizeof() to get that automatically?  In any case, 
it should be "cmd < N", rather than "cmd <= N-1" (where N is the number 
of elements in the array).
> +        switch(op) {
> +        case HYPERCALL_mmu_update:
> +            {
I'm not a fan of indenting a brace within a case statement -- I think 
this is emacs' default C mode, but I prefer it the other way.   (Not 
sure which config option sets this, though.)

Other than that, looks good.

  -George

  reply	other threads:[~2012-06-07 11:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <338462397-32111-1-git-send-email-david.vrabel@citrix.com>
2012-05-31 11:16 ` [PATCH 00 of 10] xenalyze: build, hypercall tracing and plugins (v2) David Vrabel
2012-05-31 11:16   ` [PATCH 01 of 10] xenalyze: add .hgignore David Vrabel
2012-05-31 11:16   ` [PATCH 02 of 10] xenalyze: automatically generate dependencies David Vrabel
2012-06-06 17:00     ` George Dunlap
2012-05-31 11:16   ` [PATCH 03 of 10] xenalyze: remove decode of unused events David Vrabel
2012-06-06 17:03     ` George Dunlap
2012-05-31 11:16   ` [PATCH 04 of 10] xenalyze: update trace.h to match xen-unstable David Vrabel
2012-06-07 10:14     ` George Dunlap
2012-06-07 10:15     ` George Dunlap
2012-05-31 11:16   ` [PATCH 05 of 10] xenalyze: correctly display of count of HW events David Vrabel
2012-06-07 10:16     ` George Dunlap
2012-05-31 11:16   ` [PATCH 06 of 10] xenalyze: move struct record_info into a header David Vrabel
2012-06-07 11:11     ` George Dunlap
2012-06-07 11:31       ` David Vrabel
2012-05-31 11:16   ` [PATCH 07 of 10] xenalyze: decode PV_HYPERCALL_V2 records David Vrabel
2012-06-07 11:35     ` George Dunlap [this message]
2012-06-07 15:20       ` David Vrabel
2012-05-31 11:16   ` [PATCH 08 of 10] xenalyze: decode PV_HYPERCALL_SUBCALL events David Vrabel
2012-05-31 11:16   ` [PATCH 09 of 10] xenalyze: add a basic plugin infrastructure David Vrabel
2012-06-07 11:05     ` George Dunlap
2012-06-07 15:26       ` David Vrabel
2012-06-07 16:02         ` George Dunlap
2012-05-31 11:16   ` [PATCH 10 of 10] xenalyze: add a batch-size plugin David Vrabel

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=4FD091F0.4040209@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=david.vrabel@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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 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.