提交 96c3c9e7 编写于 作者: C Catalin Udma 提交者: Scott Wood

powerpc/perf: increase the perf HW events to 6

This change is required after the e6500 perf support has been added.
There are 6 counters in e6500 core instead of 4 in e500 core and
the MAX_HWEVENTS counter should be changed accordingly from 4 to 6.
Added also runtime check for counters overflow.
Signed-off-by: NCatalin Udma <catalin.udma@freescale.com>
Signed-off-by: NLijun Pan <Lijun.Pan@freescale.com>
Signed-off-by: NScott Wood <scottwood@freescale.com>
上级 a9a5cda0
......@@ -13,7 +13,7 @@
#include <linux/types.h>
#include <asm/hw_irq.h>
#define MAX_HWEVENTS 4
#define MAX_HWEVENTS 6
/* event flags */
#define FSL_EMB_EVENT_VALID 1
......
......@@ -462,6 +462,12 @@ static int fsl_emb_pmu_event_init(struct perf_event *event)
int num_restricted;
int i;
if (ppmu->n_counter > MAX_HWEVENTS) {
WARN(1, "No. of perf counters (%d) is higher than max array size(%d)\n",
ppmu->n_counter, MAX_HWEVENTS);
ppmu->n_counter = MAX_HWEVENTS;
}
switch (event->attr.type) {
case PERF_TYPE_HARDWARE:
ev = event->attr.config;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册