coresight-etm4x: Controls pertaining to tracer configuration
authorPratik Patel <pratikp@codeaurora.org>
Wed, 13 May 2015 16:34:10 +0000 (10:34 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 May 2015 18:11:20 +0000 (11:11 -0700)
Tracers can be configured with various options at synthesis
time and knowing what resources are available is important for
SW configuration purposes.

As such adding RO sysfs entries for characteristics related to the
tracer implementation.

Signed-off-by: Pratik Patel <pratikp@codeaurora.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

index d1e513991fcb4eba714b7f048d60797c39f59703..c731ed9943b32120272116e047a7c824195b48a0 100644 (file)
@@ -13,3 +13,65 @@ Date:                April 2015
 KernelVersion: 4.01
 Contact:       Mathieu Poirier <mathieu.poirier@linaro.org>
 Description:   (R) The CPU this tracing entity is associated with.
+
+What:          /sys/bus/coresight/devices/<memory_map>.etm/nr_pe_cmp
+Date:          April 2015
+KernelVersion: 4.01
+Contact:       Mathieu Poirier <mathieu.poirier@linaro.org>
+Description:   (R) Indicates the number of PE comparator inputs that are
+               available for tracing.
+
+What:          /sys/bus/coresight/devices/<memory_map>.etm/nr_addr_cmp
+Date:          April 2015
+KernelVersion: 4.01
+Contact:       Mathieu Poirier <mathieu.poirier@linaro.org>
+Description:   (R) Indicates the number of address comparator pairs that are
+               available for tracing.
+
+What:          /sys/bus/coresight/devices/<memory_map>.etm/nr_cntr
+Date:          April 2015
+KernelVersion: 4.01
+Contact:       Mathieu Poirier <mathieu.poirier@linaro.org>
+Description:   (R) Indicates the number of counters that are available for
+               tracing.
+
+What:          /sys/bus/coresight/devices/<memory_map>.etm/nr_ext_inp
+Date:          April 2015
+KernelVersion: 4.01
+Contact:       Mathieu Poirier <mathieu.poirier@linaro.org>
+Description:   (R) Indicates how many external inputs are implemented.
+
+What:          /sys/bus/coresight/devices/<memory_map>.etm/numcidc
+Date:          April 2015
+KernelVersion: 4.01
+Contact:       Mathieu Poirier <mathieu.poirier@linaro.org>
+Description:   (R) Indicates the number of Context ID comparators that are
+               available for tracing.
+
+What:          /sys/bus/coresight/devices/<memory_map>.etm/numvmidc
+Date:          April 2015
+KernelVersion: 4.01
+Contact:       Mathieu Poirier <mathieu.poirier@linaro.org>
+Description:   (R) Indicates the number of VMID comparators that are available
+               for tracing.
+
+What:          /sys/bus/coresight/devices/<memory_map>.etm/nrseqstate
+Date:          April 2015
+KernelVersion: 4.01
+Contact:       Mathieu Poirier <mathieu.poirier@linaro.org>
+Description:   (R) Indicates the number of sequencer states that are
+               implemented.
+
+What:          /sys/bus/coresight/devices/<memory_map>.etm/nr_resource
+Date:          April 2015
+KernelVersion: 4.01
+Contact:       Mathieu Poirier <mathieu.poirier@linaro.org>
+Description:   (R) Indicates the number of resource selection pairs that are
+               available for tracing.
+
+What:          /sys/bus/coresight/devices/<memory_map>.etm/nr_ss_cmp
+Date:          April 2015
+KernelVersion: 4.01
+Contact:       Mathieu Poirier <mathieu.poirier@linaro.org>
+Description:   (R) Indicates the number of single-shot comparator controls that
+               are available for tracing.
index 169d8011c8b5a70555612aa425854efb1f713c59..859e061722d8a1d887d706328966e89580ccd2af 100644 (file)
@@ -268,6 +268,114 @@ static const struct coresight_ops etm4_cs_ops = {
        .source_ops     = &etm4_source_ops,
 };
 
+static ssize_t nr_pe_cmp_show(struct device *dev,
+                             struct device_attribute *attr,
+                             char *buf)
+{
+       unsigned long val;
+       struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
+
+       val = drvdata->nr_pe_cmp;
+       return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+static DEVICE_ATTR_RO(nr_pe_cmp);
+
+static ssize_t nr_addr_cmp_show(struct device *dev,
+                               struct device_attribute *attr,
+                               char *buf)
+{
+       unsigned long val;
+       struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
+
+       val = drvdata->nr_addr_cmp;
+       return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+static DEVICE_ATTR_RO(nr_addr_cmp);
+
+static ssize_t nr_cntr_show(struct device *dev,
+                           struct device_attribute *attr,
+                           char *buf)
+{
+       unsigned long val;
+       struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
+
+       val = drvdata->nr_cntr;
+       return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+static DEVICE_ATTR_RO(nr_cntr);
+
+static ssize_t nr_ext_inp_show(struct device *dev,
+                              struct device_attribute *attr,
+                              char *buf)
+{
+       unsigned long val;
+       struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
+
+       val = drvdata->nr_ext_inp;
+       return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+static DEVICE_ATTR_RO(nr_ext_inp);
+
+static ssize_t numcidc_show(struct device *dev,
+                           struct device_attribute *attr,
+                           char *buf)
+{
+       unsigned long val;
+       struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
+
+       val = drvdata->numcidc;
+       return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+static DEVICE_ATTR_RO(numcidc);
+
+static ssize_t numvmidc_show(struct device *dev,
+                            struct device_attribute *attr,
+                            char *buf)
+{
+       unsigned long val;
+       struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
+
+       val = drvdata->numvmidc;
+       return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+static DEVICE_ATTR_RO(numvmidc);
+
+static ssize_t nrseqstate_show(struct device *dev,
+                              struct device_attribute *attr,
+                              char *buf)
+{
+       unsigned long val;
+       struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
+
+       val = drvdata->nrseqstate;
+       return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+static DEVICE_ATTR_RO(nrseqstate);
+
+static ssize_t nr_resource_show(struct device *dev,
+                               struct device_attribute *attr,
+                               char *buf)
+{
+       unsigned long val;
+       struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
+
+       val = drvdata->nr_resource;
+       return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+static DEVICE_ATTR_RO(nr_resource);
+
+static ssize_t nr_ss_cmp_show(struct device *dev,
+                             struct device_attribute *attr,
+                             char *buf)
+{
+       unsigned long val;
+       struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent);
+
+       val = drvdata->nr_ss_cmp;
+       return scnprintf(buf, PAGE_SIZE, "%#lx\n", val);
+}
+static DEVICE_ATTR_RO(nr_ss_cmp);
+
 static ssize_t cpu_show(struct device *dev,
                        struct device_attribute *attr, char *buf)
 {
@@ -281,6 +389,15 @@ static ssize_t cpu_show(struct device *dev,
 static DEVICE_ATTR_RO(cpu);
 
 static struct attribute *coresight_etmv4_attrs[] = {
+       &dev_attr_nr_pe_cmp.attr,
+       &dev_attr_nr_addr_cmp.attr,
+       &dev_attr_nr_cntr.attr,
+       &dev_attr_nr_ext_inp.attr,
+       &dev_attr_numcidc.attr,
+       &dev_attr_numvmidc.attr,
+       &dev_attr_nrseqstate.attr,
+       &dev_attr_nr_resource.attr,
+       &dev_attr_nr_ss_cmp.attr,
        &dev_attr_cpu.attr,
        NULL,
 };