From: Gleb Natapov <gleb@redhat.com>
To: Sanjay Lal <sanjayl@kymasys.com>
Cc: kvm@vger.kernel.org, linux-mips@linux-mips.org
Subject: Re: [PATCH v2 09/18] KVM/MIPS32: COP0 accesses profiling.
Date: Wed, 6 Feb 2013 15:17:15 +0200 [thread overview]
Message-ID: <20130206131715.GB7837@redhat.com> (raw)
In-Reply-To: <1353551656-23579-10-git-send-email-sanjayl@kymasys.com>
On Wed, Nov 21, 2012 at 06:34:07PM -0800, Sanjay Lal wrote:
>
> Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
> ---
> arch/mips/kvm/kvm_mips_stats.c | 81 ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 81 insertions(+)
> create mode 100644 arch/mips/kvm/kvm_mips_stats.c
>
> diff --git a/arch/mips/kvm/kvm_mips_stats.c b/arch/mips/kvm/kvm_mips_stats.c
> new file mode 100644
> index 0000000..e442a26
> --- /dev/null
> +++ b/arch/mips/kvm/kvm_mips_stats.c
> @@ -0,0 +1,81 @@
> +/*
> +* This file is subject to the terms and conditions of the GNU General Public
> +* License. See the file "COPYING" in the main directory of this archive
> +* for more details.
> +*
> +* KVM/MIPS: COP0 access histogram
> +*
> +* Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
> +* Authors: Sanjay Lal <sanjayl@kymasys.com>
> +*/
> +
> +#include <linux/kvm_host.h>
> +
> +char *kvm_mips_exit_types_str[MAX_KVM_MIPS_EXIT_TYPES] = {
> + "WAIT",
> + "CACHE",
> + "Signal",
> + "Interrupt",
> + "COP0/1 Unusable",
> + "TLB Mod",
> + "TLB Miss (LD)",
> + "TLB Miss (ST)",
> + "Address Err (ST)",
> + "Address Error (LD)",
> + "System Call",
> + "Reserved Inst",
> + "Break Inst",
> + "D-Cache Flushes",
> +};
> +
> +char *kvm_cop0_str[N_MIPS_COPROC_REGS] = {
> + "Index",
> + "Random",
> + "EntryLo0",
> + "EntryLo1",
> + "Context",
> + "PG Mask",
> + "Wired",
> + "HWREna",
> + "BadVAddr",
> + "Count",
> + "EntryHI",
> + "Compare",
> + "Status",
> + "Cause",
> + "EXC PC",
> + "PRID",
> + "Config",
> + "LLAddr",
> + "Watch Lo",
> + "Watch Hi",
> + "X Context",
> + "Reserved",
> + "Impl Dep",
> + "Debug",
> + "DEPC",
> + "PerfCnt",
> + "ErrCtl",
> + "CacheErr",
> + "TagLo",
> + "TagHi",
> + "ErrorEPC",
> + "DESAVE"
> +};
> +
> +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.
next prev parent reply other threads:[~2013-02-06 13:17 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-22 2:33 [PATCH v2 00/18] KVM for MIPS32 Processors Sanjay Lal
2012-11-22 2:33 ` [PATCH v2 01/18] KVM/MIPS32: Infrastructure/build files Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 02/18] KVM/MIPS32: Arch specific KVM data structures Sanjay Lal
2012-12-26 13:14 ` Gleb Natapov
2013-01-24 13:22 ` Ralf Baechle
2013-01-31 20:12 ` David Daney
2013-02-06 13:11 ` Gleb Natapov
2012-11-22 2:34 ` [PATCH v2 03/18] KVM/MIPS32: Entry point for trampolining to the guest and trap handlers Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 04/18] KVM/MIPS32: MIPS arch specific APIs for KVM Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 05/18] KVM/MIPS32: KVM Guest kernel support Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 06/18] KVM/MIPS32: Privileged instruction/target branch emulation Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 07/18] KVM/MIPS32: MMU/TLB operations for the Guest Sanjay Lal
2013-02-06 12:08 ` Gleb Natapov
2013-02-15 18:19 ` Sanjay Lal
2013-02-15 18:41 ` Gleb Natapov
2013-02-16 15:57 ` Sanjay Lal
2013-02-16 16:21 ` Gleb Natapov
2012-11-22 2:34 ` [PATCH v2 08/18] KVM/MIPS32: Release notes and KVM module Makefile Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 09/18] KVM/MIPS32: COP0 accesses profiling Sanjay Lal
2012-11-22 11:45 ` Sergei Shtylyov
2013-02-06 13:17 ` Gleb Natapov [this message]
2013-02-15 18:22 ` Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 10/18] KVM/MIPS32: Guest interrupt delivery Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 11/18] KVM/MIPS32: Routines to handle specific traps/exceptions while executing the guest Sanjay Lal
2013-02-06 13:20 ` Gleb Natapov
2013-02-15 16:10 ` Sanjay Lal
2013-02-18 9:44 ` Gleb Natapov
2013-02-19 2:31 ` Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 12/18] MIPS: Export routines needed by the KVM module Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 13/18] MIPS: If KVM is enabled then use the KVM specific routine to flush the TLBs on a ASID wrap Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 14/18] MIPS: ASM offsets for VCPU arch specific fields Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 15/18] MIPS: Pull in MIPS fix: fix endless loop when processing signals for kernel tasks Sanjay Lal
2013-01-24 13:07 ` Ralf Baechle
2012-11-22 2:34 ` [PATCH v2 16/18] MIPS: Export symbols used by KVM/MIPS module Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 17/18] KVM/MIPS32: Do not call vcpu_load when injecting interrupts Sanjay Lal
2012-11-22 2:34 ` [PATCH v2 18/18] KVM/MIPS32: Binary patching of select privileged instructions Sanjay Lal
2012-11-26 18:53 ` [PATCH v2 00/18] KVM for MIPS32 Processors David Daney
2012-11-27 19:35 ` Sanjay Lal
2013-01-24 15:05 ` Ralf Baechle
2013-01-24 15:59 ` Sanjay Lal
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=20130206131715.GB7837@redhat.com \
--to=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=sanjayl@kymasys.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox