summaryrefslogtreecommitdiff
path: root/drivers/hwtracing/coresight/coresight-syscfg.c
diff options
context:
space:
mode:
authorMike Leach <mike.leach@linaro.org>2021-08-18 13:40:15 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-08-18 22:33:27 +0200
commit94d2bac540762e7517933d365dd6289f54963c97 (patch)
tree7b10cb3f391903824bab383e9b81c29dca877b82 /drivers/hwtracing/coresight/coresight-syscfg.c
parentf53e93ac8cf705fffdefe79573ce001d81c3c6fe (diff)
coresight: etm-perf: Update to handle configuration selection
Loaded coresight configurations are registered in the cs_etm\events sub directory. This extends the etm-perf code to handle these registrations, and the cs_syscfg driver to perform the registration on load. Link: https://lore.kernel.org/r/20210723165444.1048-5-mike.leach@linaro.org Signed-off-by: Mike Leach <mike.leach@linaro.org> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20210818194022.379573-5-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing/coresight/coresight-syscfg.c')
-rw-r--r--drivers/hwtracing/coresight/coresight-syscfg.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/hwtracing/coresight/coresight-syscfg.c b/drivers/hwtracing/coresight/coresight-syscfg.c
index 5e4bd86f369e..b93f2b4a777e 100644
--- a/drivers/hwtracing/coresight/coresight-syscfg.c
+++ b/drivers/hwtracing/coresight/coresight-syscfg.c
@@ -7,6 +7,7 @@
#include <linux/platform_device.h>
#include "coresight-config.h"
+#include "coresight-etm-perf.h"
#include "coresight-syscfg.h"
/*
@@ -275,6 +276,11 @@ static int cscfg_load_config(struct cscfg_config_desc *config_desc)
if (err)
return err;
+ /* add config to perf fs to allow selection */
+ err = etm_perf_add_symlink_cscfg(cscfg_device(), config_desc);
+ if (err)
+ return err;
+
list_add(&config_desc->item, &cscfg_mgr->config_desc_list);
return 0;
}
@@ -508,7 +514,12 @@ create_dev_exit_unlock:
static void cscfg_clear_device(void)
{
+ struct cscfg_config_desc *cfg_desc;
+
mutex_lock(&cscfg_mutex);
+ list_for_each_entry(cfg_desc, &cscfg_mgr->config_desc_list, item) {
+ etm_perf_del_symlink_cscfg(cfg_desc);
+ }
device_unregister(cscfg_device());
mutex_unlock(&cscfg_mutex);
}