summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Moll <pawel.moll@arm.com>2015-04-02 16:01:06 +0300
committerPawel Moll <pawel.moll@arm.com>2015-05-01 19:51:03 +0300
commit8f06c51fac1ca4104b8b64872f310e28186aea42 (patch)
tree0126c9f9e7d3b0f3299fb7fe8d9bbffa6e2fae68
parentffa415245b8666c44ddfb5ba1bca5b940828ecdd (diff)
downloadlinux-8f06c51fac1ca4104b8b64872f310e28186aea42.tar.xz
bus: arm-ccn: Provide required event arguments
Since 688d4dfcdd624192cbf03c08402e444d1d11f294 "perf tools: Support parsing parameterized events" the perf userspace tools understands "argument=?" syntax in the events file, making sure that required arguments are provided by the user and not defaulting to 0, causing confusion. This patch adds the required arguments lists for CCN events. Signed-off-by: Pawel Moll <pawel.moll@arm.com>
-rw-r--r--Documentation/arm/CCN.txt2
-rw-r--r--drivers/bus/arm-ccn.c17
2 files changed, 18 insertions, 1 deletions
diff --git a/Documentation/arm/CCN.txt b/Documentation/arm/CCN.txt
index 3a7604874762..ffca443a19b4 100644
--- a/Documentation/arm/CCN.txt
+++ b/Documentation/arm/CCN.txt
@@ -45,7 +45,7 @@ Example of perf tool use:
/ # perf list | grep ccn
ccn/cycles/ [Kernel PMU event]
<...>
- ccn/xp_valid_flit/ [Kernel PMU event]
+ ccn/xp_valid_flit,xp=?,port=?,vc=?,dir=?/ [Kernel PMU event]
<...>
/ # perf stat -a -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ \
diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
index 3374dcb12f1e..572360f1f493 100644
--- a/drivers/bus/arm-ccn.c
+++ b/drivers/bus/arm-ccn.c
@@ -340,6 +340,23 @@ static ssize_t arm_ccn_pmu_event_show(struct device *dev,
if (event->mask)
res += snprintf(buf + res, PAGE_SIZE - res, ",mask=0x%x",
event->mask);
+
+ /* Arguments required by an event */
+ switch (event->type) {
+ case CCN_TYPE_CYCLES:
+ break;
+ case CCN_TYPE_XP:
+ res += snprintf(buf + res, PAGE_SIZE - res,
+ ",xp=?,port=?,vc=?,dir=?");
+ if (event->event == CCN_EVENT_WATCHPOINT)
+ res += snprintf(buf + res, PAGE_SIZE - res,
+ ",cmp_l=?,cmp_h=?,mask=?");
+ break;
+ default:
+ res += snprintf(buf + res, PAGE_SIZE - res, ",node=?");
+ break;
+ }
+
res += snprintf(buf + res, PAGE_SIZE - res, "\n");
return res;