aboutsummaryrefslogtreecommitdiff
path: root/include/dm/tag.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-05-08 04:39:25 -0600
committerSimon Glass <sjg@chromium.org>2022-06-28 03:09:52 +0100
commit0dfda34ca594c701955cfcb71711a7599f97bae3 (patch)
treebc1741d705ae3a62c98477e510535d3193c97802 /include/dm/tag.h
parent930a3ddadebf3660cc3163081671de189300afdd (diff)
dm: core: Add a way to collect memory usage
Add a function for collecting the amount of memory used by driver model, including devices, uclasses and attached data and tags. This information can provide insights into how to reduce the memory required by driver model. Future work may look at execution speed also. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/tag.h')
-rw-r--r--include/dm/tag.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/dm/tag.h b/include/dm/tag.h
index 9cb5d68f0a..1ea3c9f7af 100644
--- a/include/dm/tag.h
+++ b/include/dm/tag.h
@@ -10,6 +10,7 @@
#include <linux/list.h>
#include <linux/types.h>
+struct dm_stats;
struct udevice;
enum dm_tag_t {
@@ -118,4 +119,14 @@ int dev_tag_del(struct udevice *dev, enum dm_tag_t tag);
*/
int dev_tag_del_all(struct udevice *dev);
+/**
+ * dev_tag_collect_stats() - Collect information on driver model performance
+ *
+ * This collects information on how driver model is performing. For now it only
+ * includes memory usage
+ *
+ * @stats: Place to put the collected information
+ */
+void dev_tag_collect_stats(struct dm_stats *stats);
+
#endif /* _DM_TAG_H */