master - libdm: add stats group and region iterators and properties
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d6aea67a1786baf306287e722fda61f4da2e2b95 Commit: d6aea67a1786baf306287e722fda61f4da2e2b95 Parent: a7ff854ec853cf5cef398b6dff9fe06aa0f9c3ad Author: Bryn M. Reeves <[email protected]> AuthorDate: Sun Jun 19 13:30:46 2016 +0100 Committer: Bryn M. Reeves <[email protected]> CommitterDate: Tue Jul 5 19:29:50 2016 +0100
libdm: add stats group and region iterators and properties
Add support do dm_stats_walk*() to walk over the set of available groups using the cursor embedded in the dm_stats handle, and to obtain the type of the object at the current stats cursor location. A set of flags is introduced to control which objects are visited:
DM_STATS_WALK_AREA
DM_STATS_WALK_REGION
DM_STATS_WALK_GROUP
DM_STATS_WALK_ALL
A final flag suppresses visits to regions that contain only a single area - since the aggregate of such a region is idential to the area it contains this allows these duplicates to be filtered out:
DM_STATS_WALK_SKIP_SINGLE_AREA
If flags are not initialised before beginning a walk the default set matches the behaviour of previous versions of the library.
Also accept group identifiers as immediate arguments to the counter, metric, and property functions by adding control flags to the region and area identifiers passed in.
Region and area properties are mapped to their equivalents for the group (for example: group size is reported as the sum of all regions contained in the group). Counter and metric values are aggregated for the region or group.
--- WHATS_NEW_DM | 4 +- libdm/.exported_symbols.DM_1_02_129 | 3 + libdm/libdevmapper.h | 127 +++++++- libdm/libdm-stats.c | 585 +++++++++++++++++++++++++++++++---- 4 files changed, 641 insertions(+), 78 deletions(-)
WHATS_NEW_DM +3 -1
@@ -1,7 +1,9 @@ Version 1.02.129 - ================================= + Add dm_stats_get_object_type() to return the type of object present. + Add dm_stats_walk_init() allowing control of objects visited by walks. Add dm_stats_get_group_descriptor() to return the member list as a string. - Add dm_stats_get_nr_groups() and dm_stats_group_present(). + Introduce dm_stats_get_nr_groups() and dm_stats_group_present(). Add dm_stats_{get,set}_alias() to set and retrieve alias names for groups. Add dm_stats_get_group_id() to return the group ID for a given region. Add dm_stats_{create,delete}_group() to allow grouping of stats regions.
libdm/.exported_symbols.DM_1_02_129 +3 -0
@@ -1,5 +1,6 @@ dm_bitset_parse_list dm_stats_create_group +dm_stats_current_object_type dm_stats_delete_group dm_stats_get_alias dm_stats_get_counter
@@ -8,4 +9,6 @@ dm_stats_get_group_id dm_stats_get_metric dm_stats_get_nr_groups dm_stats_group_present +dm_stats_object_type dm_stats_set_alias +dm_stats_walk_init
libdm/libdevmapper.h +110 -17
177 lines not on this page · raw message
libdm/libdm-stats.c +525 -60
833 lines not on this page · raw message