coresight-etm4x: Change the name of the ctxid_val to ctxid_pid
authorChunyan Zhang <zhang.chunyan@linaro.org>
Fri, 31 Jul 2015 15:37:25 +0000 (09:37 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2015 20:30:15 +0000 (13:30 -0700)
'ctxid_val' array was used to store the value of ETM context ID comparator
which actually stores the process ID to be traced, so using 'ctxid_pid' as
its name instead make it easier to understand.

This patch also changes the ABI, it is normally not allowed, but
fortunately it is a testing ABI and very new for now. Nevertheless,
if you don't think it should be changed, we could always add an alias
for userspace.

Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/ABI/testing/sysfs-bus-coresight-devices-etm4x
drivers/hwtracing/coresight/coresight-etm4x.c
drivers/hwtracing/coresight/coresight-etm4x.h

index 2fe2e3dae487a094c7e6aba3def141ee3544ffca..2355ed8ae31f732d1567f2b9085d86574f817523 100644 (file)
@@ -249,7 +249,7 @@ KernelVersion:      4.01
 Contact:       Mathieu Poirier <mathieu.poirier@linaro.org>
 Description:   (RW) Select which context ID comparator to work with.
 
-What:          /sys/bus/coresight/devices/<memory_map>.etm/ctxid_val
+What:          /sys/bus/coresight/devices/<memory_map>.etm/ctxid_pid
 Date:          April 2015
 KernelVersion: 4.01
 Contact:       Mathieu Poirier <mathieu.poirier@linaro.org>
index 1312e993c5017b6f28d87197f9201479af1eb877..9afbda54b0137317cab77729471683c92ba7e46c 100644 (file)
@@ -155,7 +155,7 @@ static void etm4_enable_hw(void *info)
                               drvdata->base + TRCACATRn(i));
        }
        for (i = 0; i < drvdata->numcidc; i++)
-               writeq_relaxed(drvdata->ctxid_val[i],
+               writeq_relaxed(drvdata->ctxid_pid[i],
                               drvdata->base + TRCCIDCVRn(i));
        writel_relaxed(drvdata->ctxid_mask0, drvdata->base + TRCCIDCCTLR0);
        writel_relaxed(drvdata->ctxid_mask1, drvdata->base + TRCCIDCCTLR1);
@@ -507,7 +507,7 @@ static ssize_t reset_store(struct device *dev,
 
        drvdata->ctxid_idx = 0x0;
        for (i = 0; i < drvdata->numcidc; i++)
-               drvdata->ctxid_val[i] = 0x0;
+               drvdata->ctxid_pid[i] = 0x0;
        drvdata->ctxid_mask0 = 0x0;
        drvdata->ctxid_mask1 = 0x0;
 
@@ -1815,7 +1815,7 @@ static ssize_t ctxid_idx_store(struct device *dev,
 }
 static DEVICE_ATTR_RW(ctxid_idx);
 
-static ssize_t ctxid_val_show(struct device *dev,
+static ssize_t ctxid_pid_show(struct device *dev,
                              struct device_attribute *attr,
                              char *buf)
 {
@@ -1825,12 +1825,12 @@ static ssize_t ctxid_val_show(struct device *dev,
 
        spin_lock(&drvdata->spinlock);
        idx = drvdata->ctxid_idx;
-       val = (unsigned long)drvdata->ctxid_val[idx];
+       val = (unsigned long)drvdata->ctxid_pid[idx];
        spin_unlock(&drvdata->spinlock);
        return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
 }
 
-static ssize_t ctxid_val_store(struct device *dev,
+static ssize_t ctxid_pid_store(struct device *dev,
                               struct device_attribute *attr,
                               const char *buf, size_t size)
 {
@@ -1850,11 +1850,11 @@ static ssize_t ctxid_val_store(struct device *dev,
 
        spin_lock(&drvdata->spinlock);
        idx = drvdata->ctxid_idx;
-       drvdata->ctxid_val[idx] = (u64)val;
+       drvdata->ctxid_pid[idx] = (u64)val;
        spin_unlock(&drvdata->spinlock);
        return size;
 }
-static DEVICE_ATTR_RW(ctxid_val);
+static DEVICE_ATTR_RW(ctxid_pid);
 
 static ssize_t ctxid_masks_show(struct device *dev,
                                struct device_attribute *attr,
@@ -1949,7 +1949,7 @@ static ssize_t ctxid_masks_store(struct device *dev,
                 */
                for (j = 0; j < 8; j++) {
                        if (maskbyte & 1)
-                               drvdata->ctxid_val[i] &= ~(0xFF << (j * 8));
+                               drvdata->ctxid_pid[i] &= ~(0xFF << (j * 8));
                        maskbyte >>= 1;
                }
                /* Select the next ctxid comparator mask value */
@@ -2193,7 +2193,7 @@ static struct attribute *coresight_etmv4_attrs[] = {
        &dev_attr_res_idx.attr,
        &dev_attr_res_ctrl.attr,
        &dev_attr_ctxid_idx.attr,
-       &dev_attr_ctxid_val.attr,
+       &dev_attr_ctxid_pid.attr,
        &dev_attr_ctxid_masks.attr,
        &dev_attr_vmid_idx.attr,
        &dev_attr_vmid_val.attr,
@@ -2514,7 +2514,7 @@ static void etm4_init_default_data(struct etmv4_drvdata *drvdata)
        }
 
        for (i = 0; i < drvdata->numcidc; i++)
-               drvdata->ctxid_val[i] = 0x0;
+               drvdata->ctxid_pid[i] = 0x0;
        drvdata->ctxid_mask0 = 0x0;
        drvdata->ctxid_mask1 = 0x0;
 
index e08e983dd2d9968bcec20ef4e806bfd9d4fd6f2e..1e8fb369daafaf06a3ca1e0765a373e3cecb7f53 100644 (file)
  * @addr_type: Current status of the comparator register.
  * @ctxid_idx: Context ID index selector.
  * @ctxid_size:        Size of the context ID field to consider.
- * @ctxid_val: Value of the context ID comparator.
+ * @ctxid_pid: Value of the context ID comparator.
  * @ctxid_mask0:Context ID comparator mask for comparator 0-3.
  * @ctxid_mask1:Context ID comparator mask for comparator 4-7.
  * @vmid_idx:  VM ID index selector.
@@ -352,7 +352,7 @@ struct etmv4_drvdata {
        u8                              addr_type[ETM_MAX_SINGLE_ADDR_CMP];
        u8                              ctxid_idx;
        u8                              ctxid_size;
-       u64                             ctxid_val[ETMv4_MAX_CTXID_CMP];
+       u64                             ctxid_pid[ETMv4_MAX_CTXID_CMP];
        u32                             ctxid_mask0;
        u32                             ctxid_mask1;
        u8                              vmid_idx;