From: Avi Kivity <avi@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-users@vger.kernel.org, KVM list <kvm@vger.kernel.org>
Subject: Re: trace_printk() support in trace-cmd
Date: Mon, 13 Dec 2010 19:05:16 +0200 [thread overview]
Message-ID: <4D06524C.7070308@redhat.com> (raw)
In-Reply-To: <1292257730.5015.1551.camel@gandalf.stny.rr.com>
[-- Attachment #1: Type: text/plain, Size: 746 bytes --]
On 12/13/2010 06:28 PM, Steven Rostedt wrote:
> On Mon, 2010-12-13 at 17:43 +0200, Avi Kivity wrote:
>
> > > What's your work flow? Do you
> > > load kvm modules after you start the trace, or are they always loaded?
> >
> > Loaded on boot.
>
> Via initramfs?
No, regular printks.
> >
> > > Are the trace_printk's in the core kernel too, and not being printed?
> >
> > I don't have any trace_printk()s in the core kernel, only in modules.
> > Perhaps module initialization does not communicate trace_printk formats?
>
> They should.
>
> Could you send me a patch that has the trace_printk()s you are using.
>
Attached (with __trace_printk()s, which is what I used).
--
error compiling committee.c: too many arguments to function
[-- Attachment #2: trace-printk.patch --]
[-- Type: text/x-patch, Size: 2400 bytes --]
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index d75ba1e..df86917 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1449,6 +1449,10 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
if (role.direct)
role.cr4_pae = 0;
role.access = access;
+ __trace_printk(_THIS_IP_,
+ "base_role %x access %x role.access %x role %x\n",
+ vcpu->arch.mmu.base_role, access, role.access,
+ role.word);
if (!vcpu->arch.mmu.direct_map
&& vcpu->arch.mmu.root_level <= PT32_ROOT_LEVEL) {
quadrant = gaddr >> (PAGE_SHIFT + (PT64_PT_BITS * level));
@@ -1576,6 +1580,11 @@ static void validate_direct_spte(struct kvm_vcpu *vcpu, u64 *sptep,
if (child->role.access == direct_access)
return;
+ __trace_printk(_THIS_IP_,
+ "child->role %x child->role.access %x direct_access %x\n",
+ child->role.word, child->role.access,
+ direct_access);
+
mmu_page_remove_parent_pte(child, sptep);
__set_spte(sptep, shadow_trap_nonpresent_pte);
kvm_flush_remote_tlbs(vcpu->kvm);
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 4f61fbb..1049729 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -450,6 +450,8 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
if (!is_present_gpte(gw->ptes[gw->level - 1]))
return NULL;
+ __trace_printk(_THIS_IP_, "pt_access %x pte_access %x dirty %d\n",
+ gw->pt_access, gw->pte_access, dirty);
direct_access = gw->pt_access & gw->pte_access;
if (!dirty)
direct_access &= ~ACC_WRITE_MASK;
@@ -592,6 +594,9 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, u32 error_code,
if (is_error_pfn(pfn))
return kvm_handle_bad_page(vcpu->kvm, walker.gfn, pfn);
+ __trace_printk(_THIS_IP_, "page_fault: map_writeable %x\n",
+ map_writable);
+
spin_lock(&vcpu->kvm->mmu_lock);
if (mmu_notifier_retry(vcpu, mmu_seq))
goto out_unlock;
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 83f5bf6..05481a3 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1015,6 +1015,8 @@ static pfn_t hva_to_pfn(struct kvm *kvm, unsigned long addr, bool atomic,
if (unlikely(npages != 1) && !atomic) {
might_sleep();
+ __trace_printk(_THIS_IP_, "%s: addr %lx not writeable\n",
+ __func__, addr);
if (writable)
*writable = write_fault;
next prev parent reply other threads:[~2010-12-13 17:05 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-15 17:09 trace_printk() support in trace-cmd Avi Kivity
2010-11-15 17:11 ` Steven Rostedt
2010-11-15 17:31 ` Avi Kivity
2010-11-15 18:33 ` Steven Rostedt
2010-11-16 9:19 ` Avi Kivity
2010-11-16 13:11 ` Steven Rostedt
2010-11-16 15:12 ` Steven Rostedt
2010-11-23 10:52 ` Avi Kivity
2010-12-12 16:10 ` Avi Kivity
2010-12-13 15:26 ` Steven Rostedt
2010-12-13 15:43 ` Avi Kivity
2010-12-13 16:28 ` Steven Rostedt
2010-12-13 17:05 ` Avi Kivity [this message]
2010-12-13 17:05 ` Avi Kivity
2010-11-16 15:13 ` Steven Rostedt
2010-11-23 11:04 ` Avi Kivity
2010-11-23 14:30 ` Steven Rostedt
2010-11-23 14:37 ` Avi Kivity
2010-11-23 15:45 ` Steven Rostedt
2010-12-12 16:35 ` Avi Kivity
2010-12-12 17:36 ` Arnaldo Carvalho de Melo
2010-12-12 17:42 ` Avi Kivity
2010-12-12 17:43 ` Arnaldo Carvalho de Melo
2010-12-12 17:47 ` Avi Kivity
2010-12-13 11:20 ` Masami Hiramatsu
2010-12-16 10:20 ` Avi Kivity
2010-12-16 13:36 ` Masami Hiramatsu
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=4D06524C.7070308@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-trace-users@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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.