Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

coresight-etm4x: Change the name of the ctxid_val to ctxid_pid

'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>

authored by

Chunyan Zhang and committed by
Greg Kroah-Hartman
cd196ac3 414a1417

+13 -13
+1 -1
Documentation/ABI/testing/sysfs-bus-coresight-devices-etm4x
··· 249 249 Contact: Mathieu Poirier <mathieu.poirier@linaro.org> 250 250 Description: (RW) Select which context ID comparator to work with. 251 251 252 - What: /sys/bus/coresight/devices/<memory_map>.etm/ctxid_val 252 + What: /sys/bus/coresight/devices/<memory_map>.etm/ctxid_pid 253 253 Date: April 2015 254 254 KernelVersion: 4.01 255 255 Contact: Mathieu Poirier <mathieu.poirier@linaro.org>
+10 -10
drivers/hwtracing/coresight/coresight-etm4x.c
··· 155 155 drvdata->base + TRCACATRn(i)); 156 156 } 157 157 for (i = 0; i < drvdata->numcidc; i++) 158 - writeq_relaxed(drvdata->ctxid_val[i], 158 + writeq_relaxed(drvdata->ctxid_pid[i], 159 159 drvdata->base + TRCCIDCVRn(i)); 160 160 writel_relaxed(drvdata->ctxid_mask0, drvdata->base + TRCCIDCCTLR0); 161 161 writel_relaxed(drvdata->ctxid_mask1, drvdata->base + TRCCIDCCTLR1); ··· 507 507 508 508 drvdata->ctxid_idx = 0x0; 509 509 for (i = 0; i < drvdata->numcidc; i++) 510 - drvdata->ctxid_val[i] = 0x0; 510 + drvdata->ctxid_pid[i] = 0x0; 511 511 drvdata->ctxid_mask0 = 0x0; 512 512 drvdata->ctxid_mask1 = 0x0; 513 513 ··· 1815 1815 } 1816 1816 static DEVICE_ATTR_RW(ctxid_idx); 1817 1817 1818 - static ssize_t ctxid_val_show(struct device *dev, 1818 + static ssize_t ctxid_pid_show(struct device *dev, 1819 1819 struct device_attribute *attr, 1820 1820 char *buf) 1821 1821 { ··· 1825 1825 1826 1826 spin_lock(&drvdata->spinlock); 1827 1827 idx = drvdata->ctxid_idx; 1828 - val = (unsigned long)drvdata->ctxid_val[idx]; 1828 + val = (unsigned long)drvdata->ctxid_pid[idx]; 1829 1829 spin_unlock(&drvdata->spinlock); 1830 1830 return scnprintf(buf, PAGE_SIZE, "%#lx\n", val); 1831 1831 } 1832 1832 1833 - static ssize_t ctxid_val_store(struct device *dev, 1833 + static ssize_t ctxid_pid_store(struct device *dev, 1834 1834 struct device_attribute *attr, 1835 1835 const char *buf, size_t size) 1836 1836 { ··· 1850 1850 1851 1851 spin_lock(&drvdata->spinlock); 1852 1852 idx = drvdata->ctxid_idx; 1853 - drvdata->ctxid_val[idx] = (u64)val; 1853 + drvdata->ctxid_pid[idx] = (u64)val; 1854 1854 spin_unlock(&drvdata->spinlock); 1855 1855 return size; 1856 1856 } 1857 - static DEVICE_ATTR_RW(ctxid_val); 1857 + static DEVICE_ATTR_RW(ctxid_pid); 1858 1858 1859 1859 static ssize_t ctxid_masks_show(struct device *dev, 1860 1860 struct device_attribute *attr, ··· 1949 1949 */ 1950 1950 for (j = 0; j < 8; j++) { 1951 1951 if (maskbyte & 1) 1952 - drvdata->ctxid_val[i] &= ~(0xFF << (j * 8)); 1952 + drvdata->ctxid_pid[i] &= ~(0xFF << (j * 8)); 1953 1953 maskbyte >>= 1; 1954 1954 } 1955 1955 /* Select the next ctxid comparator mask value */ ··· 2193 2193 &dev_attr_res_idx.attr, 2194 2194 &dev_attr_res_ctrl.attr, 2195 2195 &dev_attr_ctxid_idx.attr, 2196 - &dev_attr_ctxid_val.attr, 2196 + &dev_attr_ctxid_pid.attr, 2197 2197 &dev_attr_ctxid_masks.attr, 2198 2198 &dev_attr_vmid_idx.attr, 2199 2199 &dev_attr_vmid_val.attr, ··· 2514 2514 } 2515 2515 2516 2516 for (i = 0; i < drvdata->numcidc; i++) 2517 - drvdata->ctxid_val[i] = 0x0; 2517 + drvdata->ctxid_pid[i] = 0x0; 2518 2518 drvdata->ctxid_mask0 = 0x0; 2519 2519 drvdata->ctxid_mask1 = 0x0; 2520 2520
+2 -2
drivers/hwtracing/coresight/coresight-etm4x.h
··· 265 265 * @addr_type: Current status of the comparator register. 266 266 * @ctxid_idx: Context ID index selector. 267 267 * @ctxid_size: Size of the context ID field to consider. 268 - * @ctxid_val: Value of the context ID comparator. 268 + * @ctxid_pid: Value of the context ID comparator. 269 269 * @ctxid_mask0:Context ID comparator mask for comparator 0-3. 270 270 * @ctxid_mask1:Context ID comparator mask for comparator 4-7. 271 271 * @vmid_idx: VM ID index selector. ··· 352 352 u8 addr_type[ETM_MAX_SINGLE_ADDR_CMP]; 353 353 u8 ctxid_idx; 354 354 u8 ctxid_size; 355 - u64 ctxid_val[ETMv4_MAX_CTXID_CMP]; 355 + u64 ctxid_pid[ETMv4_MAX_CTXID_CMP]; 356 356 u32 ctxid_mask0; 357 357 u32 ctxid_mask1; 358 358 u8 vmid_idx;