Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
8d3b9323
Commit
8d3b9323
authored
Apr 23, 2010
by
Avi Kivity
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote branch 'tip/perf/core'
Signed-off-by:
Avi Kivity
<
avi@redhat.com
>
parents
d1476937
6eca8cc3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
13 deletions
+23
-13
arch/x86/kernel/cpu/perf_event.c
arch/x86/kernel/cpu/perf_event.c
+14
-6
arch/x86/kvm/x86.c
arch/x86/kvm/x86.c
+4
-0
include/linux/perf_event.h
include/linux/perf_event.h
+4
-6
tools/perf/util/probe-event.c
tools/perf/util/probe-event.c
+1
-1
No files found.
arch/x86/kernel/cpu/perf_event.c
View file @
8d3b9323
...
@@ -1752,23 +1752,31 @@ void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int ski
...
@@ -1752,23 +1752,31 @@ void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int ski
unsigned
long
perf_instruction_pointer
(
struct
pt_regs
*
regs
)
unsigned
long
perf_instruction_pointer
(
struct
pt_regs
*
regs
)
{
{
unsigned
long
ip
;
unsigned
long
ip
;
if
(
perf_guest_cbs
&&
perf_guest_cbs
->
is_in_guest
())
if
(
perf_guest_cbs
&&
perf_guest_cbs
->
is_in_guest
())
ip
=
perf_guest_cbs
->
get_guest_ip
();
ip
=
perf_guest_cbs
->
get_guest_ip
();
else
else
ip
=
instruction_pointer
(
regs
);
ip
=
instruction_pointer
(
regs
);
return
ip
;
return
ip
;
}
}
unsigned
long
perf_misc_flags
(
struct
pt_regs
*
regs
)
unsigned
long
perf_misc_flags
(
struct
pt_regs
*
regs
)
{
{
int
misc
=
0
;
int
misc
=
0
;
if
(
perf_guest_cbs
&&
perf_guest_cbs
->
is_in_guest
())
{
if
(
perf_guest_cbs
&&
perf_guest_cbs
->
is_in_guest
())
{
misc
|=
perf_guest_cbs
->
is_user_mode
()
?
if
(
perf_guest_cbs
->
is_user_mode
())
PERF_RECORD_MISC_GUEST_USER
:
misc
|=
PERF_RECORD_MISC_GUEST_USER
;
PERF_RECORD_MISC_GUEST_KERNEL
;
else
}
else
misc
|=
PERF_RECORD_MISC_GUEST_KERNEL
;
misc
|=
user_mode
(
regs
)
?
PERF_RECORD_MISC_USER
:
}
else
{
PERF_RECORD_MISC_KERNEL
;
if
(
user_mode
(
regs
))
misc
|=
PERF_RECORD_MISC_USER
;
else
misc
|=
PERF_RECORD_MISC_KERNEL
;
}
if
(
regs
->
flags
&
PERF_EFLAGS_EXACT
)
if
(
regs
->
flags
&
PERF_EFLAGS_EXACT
)
misc
|=
PERF_RECORD_MISC_EXACT
;
misc
|=
PERF_RECORD_MISC_EXACT
;
...
...
arch/x86/kvm/x86.c
View file @
8d3b9323
...
@@ -3965,16 +3965,20 @@ static int kvm_is_in_guest(void)
...
@@ -3965,16 +3965,20 @@ static int kvm_is_in_guest(void)
static
int
kvm_is_user_mode
(
void
)
static
int
kvm_is_user_mode
(
void
)
{
{
int
user_mode
=
3
;
int
user_mode
=
3
;
if
(
percpu_read
(
current_vcpu
))
if
(
percpu_read
(
current_vcpu
))
user_mode
=
kvm_x86_ops
->
get_cpl
(
percpu_read
(
current_vcpu
));
user_mode
=
kvm_x86_ops
->
get_cpl
(
percpu_read
(
current_vcpu
));
return
user_mode
!=
0
;
return
user_mode
!=
0
;
}
}
static
unsigned
long
kvm_get_guest_ip
(
void
)
static
unsigned
long
kvm_get_guest_ip
(
void
)
{
{
unsigned
long
ip
=
0
;
unsigned
long
ip
=
0
;
if
(
percpu_read
(
current_vcpu
))
if
(
percpu_read
(
current_vcpu
))
ip
=
kvm_rip_read
(
percpu_read
(
current_vcpu
));
ip
=
kvm_rip_read
(
percpu_read
(
current_vcpu
));
return
ip
;
return
ip
;
}
}
...
...
include/linux/perf_event.h
View file @
8d3b9323
...
@@ -941,10 +941,8 @@ static inline void perf_event_mmap(struct vm_area_struct *vma)
...
@@ -941,10 +941,8 @@ static inline void perf_event_mmap(struct vm_area_struct *vma)
}
}
extern
struct
perf_guest_info_callbacks
*
perf_guest_cbs
;
extern
struct
perf_guest_info_callbacks
*
perf_guest_cbs
;
extern
int
perf_register_guest_info_callbacks
(
extern
int
perf_register_guest_info_callbacks
(
struct
perf_guest_info_callbacks
*
callbacks
);
struct
perf_guest_info_callbacks
*
);
extern
int
perf_unregister_guest_info_callbacks
(
struct
perf_guest_info_callbacks
*
callbacks
);
extern
int
perf_unregister_guest_info_callbacks
(
struct
perf_guest_info_callbacks
*
);
extern
void
perf_event_comm
(
struct
task_struct
*
tsk
);
extern
void
perf_event_comm
(
struct
task_struct
*
tsk
);
extern
void
perf_event_fork
(
struct
task_struct
*
tsk
);
extern
void
perf_event_fork
(
struct
task_struct
*
tsk
);
...
@@ -1016,9 +1014,9 @@ static inline void
...
@@ -1016,9 +1014,9 @@ static inline void
perf_bp_event
(
struct
perf_event
*
event
,
void
*
data
)
{
}
perf_bp_event
(
struct
perf_event
*
event
,
void
*
data
)
{
}
static
inline
int
perf_register_guest_info_callbacks
static
inline
int
perf_register_guest_info_callbacks
(
struct
perf_guest_info_callbacks
*
)
{
return
0
;
}
(
struct
perf_guest_info_callbacks
*
callbacks
)
{
return
0
;
}
static
inline
int
perf_unregister_guest_info_callbacks
static
inline
int
perf_unregister_guest_info_callbacks
(
struct
perf_guest_info_callbacks
*
)
{
return
0
;
}
(
struct
perf_guest_info_callbacks
*
callbacks
)
{
return
0
;
}
static
inline
void
perf_event_mmap
(
struct
vm_area_struct
*
vma
)
{
}
static
inline
void
perf_event_mmap
(
struct
vm_area_struct
*
vma
)
{
}
static
inline
void
perf_event_comm
(
struct
task_struct
*
tsk
)
{
}
static
inline
void
perf_event_comm
(
struct
task_struct
*
tsk
)
{
}
...
...
tools/perf/util/probe-event.c
View file @
8d3b9323
...
@@ -1263,7 +1263,7 @@ static struct strlist *get_kprobe_trace_event_names(int fd, bool include_group)
...
@@ -1263,7 +1263,7 @@ static struct strlist *get_kprobe_trace_event_names(int fd, bool include_group)
static
int
write_kprobe_trace_event
(
int
fd
,
struct
kprobe_trace_event
*
tev
)
static
int
write_kprobe_trace_event
(
int
fd
,
struct
kprobe_trace_event
*
tev
)
{
{
int
ret
;
int
ret
=
0
;
char
*
buf
=
synthesize_kprobe_trace_command
(
tev
);
char
*
buf
=
synthesize_kprobe_trace_command
(
tev
);
if
(
!
buf
)
{
if
(
!
buf
)
{
...
...
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