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
40874491
Commit
40874491
authored
Dec 18, 2008
by
Ingo Molnar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branches 'tracing/ftrace' and 'tracing/hw-branch-tracing' into tracing/core
parents
d680fe44
d072c25f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
33 deletions
+28
-33
arch/x86/kernel/ds.c
arch/x86/kernel/ds.c
+28
-33
No files found.
arch/x86/kernel/ds.c
View file @
40874491
...
@@ -232,53 +232,45 @@ static DEFINE_PER_CPU(struct ds_context *, system_context_array);
...
@@ -232,53 +232,45 @@ static DEFINE_PER_CPU(struct ds_context *, system_context_array);
#define system_context per_cpu(system_context_array, smp_processor_id())
#define system_context per_cpu(system_context_array, smp_processor_id())
static
struct
ds_context
*
ds_get_context
(
struct
task_struct
*
task
)
static
inline
struct
ds_context
*
ds_get_context
(
struct
task_struct
*
task
)
{
{
struct
ds_context
**
p_context
=
struct
ds_context
**
p_context
=
(
task
?
&
task
->
thread
.
ds_ctx
:
&
system_context
);
(
task
?
&
task
->
thread
.
ds_ctx
:
&
system_context
);
struct
ds_context
*
context
=
*
p_context
;
struct
ds_context
*
context
=
NULL
;
struct
ds_context
*
new_context
=
NULL
;
unsigned
long
irq
;
unsigned
long
irq
;
if
(
!
context
)
{
/* Chances are small that we already have a context. */
context
=
kzalloc
(
sizeof
(
*
context
),
GFP_KERNEL
);
new_context
=
kzalloc
(
sizeof
(
*
new_context
),
GFP_KERNEL
);
if
(
!
context
)
if
(
!
new_context
)
return
NULL
;
return
NULL
;
spin_lock_irqsave
(
&
ds_lock
,
irq
);
if
(
*
p_context
)
{
kfree
(
context
);
context
=
*
p_context
;
spin_lock_irqsave
(
&
ds_lock
,
irq
);
}
else
{
*
p_context
=
context
;
context
->
this
=
p_context
;
context
=
*
p_context
;
context
->
task
=
task
;
if
(
!
context
)
{
context
=
new_context
;
if
(
task
)
context
->
this
=
p_context
;
set_tsk_thread_flag
(
task
,
TIF_DS_AREA_MSR
);
context
->
task
=
task
;
context
->
count
=
0
;
if
(
!
task
||
(
task
==
current
))
if
(
task
)
wrmsrl
(
MSR_IA32_DS_AREA
,
set_tsk_thread_flag
(
task
,
TIF_DS_AREA_MSR
);
(
unsigned
long
)
context
->
ds
);
}
context
->
count
++
;
if
(
!
task
||
(
task
==
current
))
wrmsrl
(
MSR_IA32_DS_AREA
,
(
unsigned
long
)
context
->
ds
);
spin_unlock_irqrestore
(
&
ds_lock
,
irq
);
*
p_context
=
context
;
}
else
{
}
spin_lock_irqsave
(
&
ds_lock
,
irq
);
context
=
*
p_context
;
context
->
count
++
;
if
(
context
)
context
->
count
++
;
spin_unlock_irqrestore
(
&
ds_lock
,
irq
);
spin_unlock_irqrestore
(
&
ds_lock
,
irq
);
if
(
!
context
)
if
(
context
!=
new_context
)
context
=
ds_get_context
(
task
);
kfree
(
new_context
);
}
return
context
;
return
context
;
}
}
...
@@ -492,6 +484,9 @@ static int bts_read(struct bts_tracer *tracer, const void *at,
...
@@ -492,6 +484,9 @@ static int bts_read(struct bts_tracer *tracer, const void *at,
out
->
qualifier
=
bts_branch
;
out
->
qualifier
=
bts_branch
;
out
->
variant
.
lbr
.
from
=
bts_get
(
at
,
bts_from
);
out
->
variant
.
lbr
.
from
=
bts_get
(
at
,
bts_from
);
out
->
variant
.
lbr
.
to
=
bts_get
(
at
,
bts_to
);
out
->
variant
.
lbr
.
to
=
bts_get
(
at
,
bts_to
);
if
(
!
out
->
variant
.
lbr
.
from
&&
!
out
->
variant
.
lbr
.
to
)
out
->
qualifier
=
bts_invalid
;
}
}
return
ds_cfg
.
sizeof_rec
[
ds_bts
];
return
ds_cfg
.
sizeof_rec
[
ds_bts
];
...
...
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