All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
Cc: Avi Kivity <avi@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Sheng Yang <sheng@linux.intel.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Marcelo Tosatti <mtosatti@redhat.com>,
	oerg Roedel <joro@8bytes.org>,
	Jes Sorensen <Jes.Sorensen@redhat.com>,
	Gleb Natapov <gleb@redhat.com>,
	Zachary Amsden <zamsden@redhat.com>,
	zhiteng.huang@intel.com, tim.c.chen@intel.com,
	Arnaldo Carvalho de Melo <acme@infradead.org>
Subject: Re: [PATCH V5 1/3] perf & kvm: Enhance perf to collect KVM guest os statistics from host side
Date: Tue, 20 Apr 2010 08:06:40 +0200	[thread overview]
Message-ID: <20100420060640.GB22277@elte.hu> (raw)
In-Reply-To: <1271729638.2078.624.camel@ymzhang.sh.intel.com>


* Zhang, Yanmin <yanmin_zhang@linux.intel.com> wrote:

>  unsigned long perf_misc_flags(struct pt_regs *regs)
>  {
>  	int misc = 0;
> +
>  	if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
> +		if (perf_guest_cbs->is_user_mode())
> +			misc |= PERF_RECORD_MISC_GUEST_USER;
> +		else
> +			misc |= PERF_RECORD_MISC_GUEST_KERNEL;
> +	} else if (user_mode(regs))
> +		misc |= PERF_RECORD_MISC_USER;
> +	else
> +		misc |= PERF_RECORD_MISC_KERNEL;
> +

We try to use balanced curly braces. I.e.:

	if (x) {
		boo();
	} else {
		if (y)
			foo();
		else	
			bar();
	}	

And avoid unbalanced ones:

	if (x) {
		boo();
	} else
		if (y)
			foo();
		else	
			bar();

	Ingo

  reply	other threads:[~2010-04-20  6:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19  5:32 [PATCH V5 1/3] perf & kvm: Enhance perf to collect KVM guest os statistics from host side Zhang, Yanmin
2010-04-19  8:37 ` Avi Kivity
2010-04-19  8:55   ` Zhang, Yanmin
2010-04-19  8:59     ` Avi Kivity
2010-04-19  9:09       ` Avi Kivity
2010-04-19  9:22       ` Zhang, Yanmin
2010-04-19 10:00         ` Avi Kivity
2010-04-19 18:11 ` Ingo Molnar
2010-04-20  2:13   ` Zhang, Yanmin
2010-04-20  6:06     ` Ingo Molnar [this message]
2010-04-20  6:09       ` Ingo Molnar
2010-04-20  6:21         ` Zhang, Yanmin
2010-04-20 17:54     ` [tip:perf/core] perf & kvm: Clean up some of the guest profiling callback API details tip-bot for Zhang, Yanmin
2010-04-22 10:27 ` [PATCH V5 1/3] perf & kvm: Enhance perf to collect KVM guest os statistics from host side Liu Yu-B13201
2010-04-23 10:50   ` Avi Kivity
2010-04-26  6:11     ` Zhang, Yanmin

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=20100420060640.GB22277@elte.hu \
    --to=mingo@elte.hu \
    --cc=Jes.Sorensen@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@infradead.org \
    --cc=avi@redhat.com \
    --cc=gleb@redhat.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=sheng@linux.intel.com \
    --cc=tim.c.chen@intel.com \
    --cc=yanmin_zhang@linux.intel.com \
    --cc=zamsden@redhat.com \
    --cc=zhiteng.huang@intel.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.