diff options
author | Dave Hansen <[email protected]> | 2014-05-16 12:45:15 -0700 |
---|---|---|
committer | Paolo Bonzini <[email protected]> | 2014-05-22 17:47:17 +0200 |
commit | 65a7f03f6b534916e279e403dff41e1015dd0dce (patch) | |
tree | 5dc9c99b61cb7aa94ddf27a79793d1583159ac32 /tools/perf/scripts/python/syscall-counts.py | |
parent | ae9fedc793c4d98aa9bb298585b2b9246096ce65 (diff) |
x86: fix page fault tracing when KVM guest support enabled
I noticed on some of my systems that page fault tracing doesn't
work:
cd /sys/kernel/debug/tracing
echo 1 > events/exceptions/enable
cat trace;
# nothing shows up
I eventually traced it down to CONFIG_KVM_GUEST. At least in a
KVM VM, enabling that option breaks page fault tracing, and
disabling fixes it. I tried on some old kernels and this does
not appear to be a regression: it never worked.
There are two page-fault entry functions today. One when tracing
is on and another when it is off. The KVM code calls do_page_fault()
directly instead of calling the traced version:
> dotraplinkage void __kprobes
> do_async_page_fault(struct pt_regs *regs, unsigned long
> error_code)
> {
> enum ctx_state prev_state;
>
> switch (kvm_read_and_reset_pf_reason()) {
> default:
> do_page_fault(regs, error_code);
> break;
> case KVM_PV_REASON_PAGE_NOT_PRESENT:
I'm also having problems with the page fault tracing on bare
metal (same symptom of no trace output). I'm unsure if it's
related.
Steven had an alternative to this which has zero overhead when
tracing is off where this includes the standard noops even when
tracing is disabled. I'm unconvinced that the extra complexity
of his apporach:
http://lkml.kernel.org/r/[email protected]
is worth it, expecially considering that the KVM code is already
making page fault entry slower here. This solution is
dirt-simple.
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: Peter Zijlstra <[email protected]>
Cc: Gleb Natapov <[email protected]>
Cc: [email protected]
Cc: Paolo Bonzini <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Acked-by: "H. Peter Anvin" <[email protected]>
Acked-by: Steven Rostedt <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts.py')
0 files changed, 0 insertions, 0 deletions