Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147157
b: refs/heads/master
c: 2b9ff0d
h: refs/heads/master
i:
  147155: c6776d7
v: v3
  • Loading branch information
Ingo Molnar committed Dec 14, 2008
1 parent 06ee464 commit d88bda1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e06c61a879910869aa5bf3f8f634abfee1a7bebc
refs/heads/master: 2b9ff0db19b5e2c77000b7201525f9c3d6e8328d
10 changes: 10 additions & 0 deletions trunk/arch/x86/kernel/cpu/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,31 @@ static int __hw_perf_counter_init(struct perf_counter *counter)

void hw_perf_enable_all(void)
{
if (unlikely(!perf_counters_initialized))
return;

wrmsr(MSR_CORE_PERF_GLOBAL_CTRL, perf_counter_mask, 0);
}

u64 hw_perf_save_disable(void)
{
u64 ctrl;

if (unlikely(!perf_counters_initialized))
return 0;

rdmsrl(MSR_CORE_PERF_GLOBAL_CTRL, ctrl);
wrmsr(MSR_CORE_PERF_GLOBAL_CTRL, 0, 0);

return ctrl;
}
EXPORT_SYMBOL_GPL(hw_perf_save_disable);

void hw_perf_restore(u64 ctrl)
{
if (unlikely(!perf_counters_initialized))
return;

wrmsr(MSR_CORE_PERF_GLOBAL_CTRL, ctrl, 0);
}
EXPORT_SYMBOL_GPL(hw_perf_restore);
Expand Down

0 comments on commit d88bda1

Please sign in to comment.