Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113593
b: refs/heads/master
c: 7939d2b
h: refs/heads/master
i:
  113591: 2b1ed56
v: v3
  • Loading branch information
Robert Richter authored and Ingo Molnar committed Jul 26, 2008
1 parent a4cc2bf commit 5ab2e1f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 56784f11df473b4c1d9d0e37777fd7c0b77b6bca
refs/heads/master: 7939d2bf7e30353d40d14f967b7fe2b2a7be5bd9
45 changes: 28 additions & 17 deletions trunk/arch/x86/oprofile/op_model_athlon.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,27 +195,18 @@ static void op_amd_setup_ctrs(struct op_msrs const * const msrs)
}
}


static int op_amd_check_ctrs(struct pt_regs * const regs,
struct op_msrs const * const msrs)
static inline int
op_amd_handle_ibs(struct pt_regs * const regs,
struct op_msrs const * const msrs)
{
unsigned int low, high;
int i;
struct ibs_fetch_sample ibs_fetch;
struct ibs_op_sample ibs_op;

for (i = 0 ; i < NUM_COUNTERS; ++i) {
if (!reset_value[i])
continue;
CTR_READ(low, high, msrs, i);
if (CTR_OVERFLOWED(low)) {
oprofile_add_sample(regs, i);
CTR_WRITE(reset_value[i], msrs, i);
}
}
if (!ibs_allowed)
return 1;

/*If AMD and IBS is available */
if (ibs_allowed && ibs_config.fetch_enabled) {
if (ibs_config.fetch_enabled) {
rdmsr(MSR_AMD64_IBSFETCHCTL, low, high);
if (high & IBS_FETCH_VALID_BIT) {
ibs_fetch.ibs_fetch_ctl_high = high;
Expand All @@ -240,7 +231,7 @@ static int op_amd_check_ctrs(struct pt_regs * const regs,
}
}

if (ibs_allowed && ibs_config.op_enabled) {
if (ibs_config.op_enabled) {
rdmsr(MSR_AMD64_IBSOPCTL, low, high);
if (low & IBS_OP_VALID_BIT) {
rdmsr(MSR_AMD64_IBSOPRIP, low, high);
Expand Down Expand Up @@ -273,10 +264,30 @@ static int op_amd_check_ctrs(struct pt_regs * const regs,
}
}

/* See op_model_ppro.c */
return 1;
}

static int op_amd_check_ctrs(struct pt_regs * const regs,
struct op_msrs const * const msrs)
{
unsigned int low, high;
int i;

for (i = 0 ; i < NUM_COUNTERS; ++i) {
if (!reset_value[i])
continue;
CTR_READ(low, high, msrs, i);
if (CTR_OVERFLOWED(low)) {
oprofile_add_sample(regs, i);
CTR_WRITE(reset_value[i], msrs, i);
}
}

op_amd_handle_ibs(regs, msrs);

/* See op_model_ppro.c */
return 1;
}

static void op_amd_start(struct op_msrs const * const msrs)
{
Expand Down

0 comments on commit 5ab2e1f

Please sign in to comment.