Skip to contentSkip to conversation

master - libdm: add stats group and region iterators and properties

PATCH Bryn Reeves 1 participant 1 message Jul 5, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f1f2df7bc0a219afebb86823513516e002a2916f
Commit:        f1f2df7bc0a219afebb86823513516e002a2916f
Parent:        62050760aa15e7059ea768b81abcd4d773ed6cab
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:53:16 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
index 853dd00..04ba142 100644
@@ -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
index 46c706d..88d3f1b 100644
@@ -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