|
@@ -18,7 +18,7 @@
|
|
struct p4_event_bind {
|
|
struct p4_event_bind {
|
|
unsigned int opcode; /* Event code and ESCR selector */
|
|
unsigned int opcode; /* Event code and ESCR selector */
|
|
unsigned int escr_msr[2]; /* ESCR MSR for this event */
|
|
unsigned int escr_msr[2]; /* ESCR MSR for this event */
|
|
- unsigned char cntr[2][P4_CNTR_LIMIT]; /* counter index (offset), -1 on abscence */
|
|
|
|
|
|
+ char cntr[2][P4_CNTR_LIMIT]; /* counter index (offset), -1 on abscence */
|
|
};
|
|
};
|
|
|
|
|
|
struct p4_cache_event_bind {
|
|
struct p4_cache_event_bind {
|
|
@@ -747,11 +747,11 @@ static int p4_get_escr_idx(unsigned int addr)
|
|
static int p4_next_cntr(int thread, unsigned long *used_mask,
|
|
static int p4_next_cntr(int thread, unsigned long *used_mask,
|
|
struct p4_event_bind *bind)
|
|
struct p4_event_bind *bind)
|
|
{
|
|
{
|
|
- int i = 0, j;
|
|
|
|
|
|
+ int i, j;
|
|
|
|
|
|
for (i = 0; i < P4_CNTR_LIMIT; i++) {
|
|
for (i = 0; i < P4_CNTR_LIMIT; i++) {
|
|
- j = bind->cntr[thread][i++];
|
|
|
|
- if (j == -1 || !test_bit(j, used_mask))
|
|
|
|
|
|
+ j = bind->cntr[thread][i];
|
|
|
|
+ if (j != -1 && !test_bit(j, used_mask))
|
|
return j;
|
|
return j;
|
|
}
|
|
}
|
|
|
|
|