Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
90bb6fc5
Commit
90bb6fc5
authored
Dec 31, 2009
by
Avi Kivity
Committed by
Marcelo Tosatti
Mar 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: MMU: Add tracepoint for guest page aging
Signed-off-by:
Avi Kivity
<
avi@redhat.com
>
parent
43db6697
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
arch/x86/kvm/mmu.c
arch/x86/kvm/mmu.c
+8
-3
include/trace/events/kvm.h
include/trace/events/kvm.h
+22
-0
No files found.
arch/x86/kvm/mmu.c
View file @
90bb6fc5
...
...
@@ -151,6 +151,9 @@ module_param(oos_shadow, bool, 0644);
#define ACC_USER_MASK PT_USER_MASK
#define ACC_ALL (ACC_EXEC_MASK | ACC_WRITE_MASK | ACC_USER_MASK)
#include <trace/events/kvm.h>
#undef TRACE_INCLUDE_FILE
#define CREATE_TRACE_POINTS
#include "mmutrace.h"
...
...
@@ -792,6 +795,7 @@ static int kvm_handle_hva(struct kvm *kvm, unsigned long hva,
unsigned
long
data
))
{
int
i
,
j
;
int
ret
;
int
retval
=
0
;
struct
kvm_memslots
*
slots
;
...
...
@@ -806,16 +810,17 @@ static int kvm_handle_hva(struct kvm *kvm, unsigned long hva,
if
(
hva
>=
start
&&
hva
<
end
)
{
gfn_t
gfn_offset
=
(
hva
-
start
)
>>
PAGE_SHIFT
;
retval
|=
handler
(
kvm
,
&
memslot
->
rmap
[
gfn_offset
],
data
);
ret
=
handler
(
kvm
,
&
memslot
->
rmap
[
gfn_offset
],
data
);
for
(
j
=
0
;
j
<
KVM_NR_PAGE_SIZES
-
1
;
++
j
)
{
int
idx
=
gfn_offset
;
idx
/=
KVM_PAGES_PER_HPAGE
(
PT_DIRECTORY_LEVEL
+
j
);
ret
val
|=
handler
(
kvm
,
ret
|=
handler
(
kvm
,
&
memslot
->
lpage_info
[
j
][
idx
].
rmap_pde
,
data
);
}
trace_kvm_age_page
(
hva
,
memslot
,
ret
);
retval
|=
ret
;
}
}
...
...
include/trace/events/kvm.h
View file @
90bb6fc5
...
...
@@ -164,6 +164,28 @@ TRACE_EVENT(kvm_fpu,
TP_printk
(
"%s"
,
__print_symbolic
(
__entry
->
load
,
kvm_fpu_load_symbol
))
);
TRACE_EVENT
(
kvm_age_page
,
TP_PROTO
(
ulong
hva
,
struct
kvm_memory_slot
*
slot
,
int
ref
),
TP_ARGS
(
hva
,
slot
,
ref
),
TP_STRUCT__entry
(
__field
(
u64
,
hva
)
__field
(
u64
,
gfn
)
__field
(
u8
,
referenced
)
),
TP_fast_assign
(
__entry
->
hva
=
hva
;
__entry
->
gfn
=
slot
->
base_gfn
+
((
hva
-
slot
->
userspace_addr
)
>>
PAGE_SHIFT
);
__entry
->
referenced
=
ref
;
),
TP_printk
(
"hva %llx gfn %llx %s"
,
__entry
->
hva
,
__entry
->
gfn
,
__entry
->
referenced
?
"YOUNG"
:
"OLD"
)
);
#endif
/* _TRACE_KVM_MAIN_H */
/* This part must be outside protection */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment