Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753462Ab0DTGHA (ORCPT ); Tue, 20 Apr 2010 02:07:00 -0400 Received: from mx3.mail.elte.hu ([157.181.1.138]:54707 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753343Ab0DTGG7 (ORCPT ); Tue, 20 Apr 2010 02:06:59 -0400 Date: Tue, 20 Apr 2010 08:06:40 +0200 From: Ingo Molnar To: "Zhang, Yanmin" Cc: Avi Kivity , Peter Zijlstra , Sheng Yang , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Marcelo Tosatti , oerg Roedel , Jes Sorensen , Gleb Natapov , Zachary Amsden , zhiteng.huang@intel.com, tim.c.chen@intel.com, Arnaldo Carvalho de Melo Subject: Re: [PATCH V5 1/3] perf & kvm: Enhance perf to collect KVM guest os statistics from host side Message-ID: <20100420060640.GB22277@elte.hu> References: <1271655161.2078.603.camel@ymzhang.sh.intel.com> <20100419181154.GA14631@elte.hu> <1271729638.2078.624.camel@ymzhang.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1271729638.2078.624.camel@ymzhang.sh.intel.com> User-Agent: Mutt/1.5.20 (2009-08-17) X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 -2.0 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 915 Lines: 45 * Zhang, Yanmin 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/