bus: arm-ccn: Provide required event arguments
authorPawel Moll <pawel.moll@arm.com>
Thu, 2 Apr 2015 13:01:06 +0000 (14:01 +0100)
committerSasha Levin <alexander.levin@verizon.com>
Thu, 22 Dec 2016 03:45:34 +0000 (22:45 -0500)
[ Upstream commit 8f06c51fac1ca4104b8b64872f310e28186aea42 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Documentation/arm/CCN.txt
drivers/bus/arm-ccn.c

index 0632b3aad83e7068f663964c77870b9e54cf6826..715776f06df6680b4f26c7a2cf98f76f6a54c20d 100644 (file)
@@ -38,7 +38,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 -C 0 -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ \
index 27fd0dacad5f88e7e7fdb73ec055016eaf583906..d465cf097dbb28c5366c4a840f32b246976456eb 100644 (file)
@@ -336,6 +336,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;