lkml.org 
[lkml]   [2010]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH V5 1/3] perf & kvm: Enhance perf to collect KVM guest os statistics from host side

    * 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


    \
     
     \ /
      Last update: 2010-04-20 08:09    [W:0.021 / U:33.228 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site