linux-mips
[Top] [All Lists]

Re: [PATCH v2 09/18] KVM/MIPS32: COP0 accesses profiling.

To: Gleb Natapov <gleb@redhat.com>
Subject: Re: [PATCH v2 09/18] KVM/MIPS32: COP0 accesses profiling.
From: Sanjay Lal <sanjayl@kymasys.com>
Date: Fri, 15 Feb 2013 13:22:15 -0500
Cc: kvm@vger.kernel.org, linux-mips@linux-mips.org
In-reply-to: <20130206131715.GB7837@redhat.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1353551656-23579-1-git-send-email-sanjayl@kymasys.com> <1353551656-23579-10-git-send-email-sanjayl@kymasys.com> <20130206131715.GB7837@redhat.com>
Sender: linux-mips-bounce@linux-mips.org
On Feb 6, 2013, at 8:17 AM, Gleb Natapov wrote:

> On Wed, Nov 21, 2012 at 06:34:07PM -0800, Sanjay Lal wrote:
>> 
>> +int kvm_mips_dump_stats(struct kvm_vcpu *vcpu)
>> +{
>> +    int i, j __unused;
>> +#ifdef CONFIG_KVM_MIPS_DEBUG_COP0_COUNTERS
>> +    printk("\nKVM VCPU[%d] COP0 Access Profile:\n", vcpu->vcpu_id);
>> +    for (i = 0; i < N_MIPS_COPROC_REGS; i++) {
>> +            for (j = 0; j < N_MIPS_COPROC_SEL; j++) {
>> +                    if (vcpu->arch.cop0->stat[i][j])
>> +                            printk("%s[%d]: %lu\n", kvm_cop0_str[i], j,
>> +                                   vcpu->arch.cop0->stat[i][j]);
>> +            }
>> +    }
>> +#endif
>> +
>> +    return 0;
>> +}
> You need to use ftrace event for that. Much more flexible with perf
> integration and no need to recompile to enabled/disable.
> 
> --
>                       Gleb.

Agreed, I'll start using trace for keeping track of COP0 accesses.

Regards
Sanjay


<Prev in Thread] Current Thread [Next in Thread>