summaryrefslogtreecommitdiff
path: root/include/dm/root.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-07-08 14:39:07 -0400
committerTom Rini <trini@konsulko.com>2022-07-08 14:39:07 -0400
commit9ff4ce8abc627b8696c9bd6fd726dd1dbf4b9a5c (patch)
treed28c5d99d4996b080ec0c38f24a0232d611ea847 /include/dm/root.h
parent7bc0be96f79344d7b103dd64c31be0574f7b39e9 (diff)
parente87da5704ffa6fc782d93d137fa30a37a5df3566 (diff)
Merge tag 'dm-pull-28jun22' of https://source.denx.de/u-boot/custodians/u-boot-dm into next
nman external-symbol improvements Driver model memory-usage reporting patman test-reporting improvements Add bloblist design goals
Diffstat (limited to 'include/dm/root.h')
-rw-r--r--include/dm/root.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/dm/root.h b/include/dm/root.h
index e888fb993c0..b2f30a842f5 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -9,12 +9,50 @@
#ifndef _DM_ROOT_H_
#define _DM_ROOT_H_
+#include <dm/tag.h>
+
struct udevice;
/* Head of the uclass list if CONFIG_OF_PLATDATA_INST is enabled */
extern struct list_head uclass_head;
/**
+ * struct dm_stats - Information about driver model memory usage
+ *
+ * @total_size: All data
+ * @dev_count: Number of devices
+ * @dev_size: Size of all devices (just the struct udevice)
+ * @dev_name_size: Bytes used by device names
+ * @uc_count: Number of uclasses
+ * @uc_size: Size of all uclasses (just the struct uclass)
+ * @tag_count: Number of tags
+ * @tag_size: Bytes used by all tags
+ * @uc_attach_count: Number of uclasses with attached data (priv)
+ * @uc_attach_size: Total size of that attached data
+ * @attach_count_total: Total number of attached data items for all udevices and
+ * uclasses
+ * @attach_size_total: Total number of bytes of attached data
+ * @attach_count: Number of devices with attached, for each type
+ * @attach_size: Total number of bytes of attached data, for each type
+ */
+struct dm_stats {
+ int total_size;
+ int dev_count;
+ int dev_size;
+ int dev_name_size;
+ int uc_count;
+ int uc_size;
+ int tag_count;
+ int tag_size;
+ int uc_attach_count;
+ int uc_attach_size;
+ int attach_count_total;
+ int attach_size_total;
+ int attach_count[DM_TAG_ATTACH_COUNT];
+ int attach_size[DM_TAG_ATTACH_COUNT];
+};
+
+/**
* dm_root() - Return pointer to the top of the driver tree
*
* This function returns pointer to the root node of the driver tree,
@@ -141,4 +179,11 @@ static inline int dm_remove_devices_flags(uint flags) { return 0; }
*/
void dm_get_stats(int *device_countp, int *uclass_countp);
+/**
+ * dm_get_mem() - Get stats on memory usage in driver model
+ *
+ * @stats: Place to put the information
+ */
+void dm_get_mem(struct dm_stats *stats);
+
#endif