Skip to content

Commit

Permalink
s390/cpum_cf: update counter numbers to ecctr limits
Browse files Browse the repository at this point in the history
Use the highest counter number that can be specified for the
ecctr (extract CPU counter) instruction for perf.

Signed-off-by: Hendrik Brueckner <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
hbrueckner authored and Martin Schwidefsky committed Mar 31, 2017
1 parent 4d6e51c commit 20ba46d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions arch/s390/include/asm/perf_event.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Performance event support - s390 specific definitions.
*
* Copyright IBM Corp. 2009, 2013
* Copyright IBM Corp. 2009, 2017
* Author(s): Martin Schwidefsky <[email protected]>
* Hendrik Brueckner <[email protected]>
*/
Expand Down Expand Up @@ -47,7 +47,7 @@ struct perf_sf_sde_regs {
};

/* Perf PMU definitions for the counter facility */
#define PERF_CPUM_CF_MAX_CTR 256
#define PERF_CPUM_CF_MAX_CTR 0xffffUL /* Max ctr for ECCTR */

/* Perf PMU definitions for the sampling facility */
#define PERF_CPUM_SF_MAX_CTR 2
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kernel/perf_cpum_cf.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ static int __hw_perf_event_init(struct perf_event *event)
if (ev == -1)
return -ENOENT;

if (ev >= PERF_CPUM_CF_MAX_CTR)
if (ev > PERF_CPUM_CF_MAX_CTR)
return -EINVAL;

/* Use the hardware perf event structure to store the counter number
Expand Down

0 comments on commit 20ba46d

Please sign in to comment.