diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2016-03-07 18:01:45 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2016-07-05 19:53:16 +0100 |
commit | b4cbc8f2838ce52233151700a59e09b17a3d9a0d (patch) | |
tree | 8175091f679bc524eb33a3f85384a5a59061a1f2 | |
parent | cda1622fef6c2160f92c88f4eab0200e4864d781 (diff) | |
download | lvm2-b4cbc8f2838ce52233151700a59e09b17a3d9a0d.tar.gz |
dmstats: add group_id report field type
-rw-r--r-- | tools/dmsetup.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/dmsetup.c b/tools/dmsetup.c index 8ba12ddbe..5cd0ef476 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -3416,6 +3416,25 @@ static int _dm_stats_area_count_disp(struct dm_report *rh, return dm_report_field_uint64(rh, field, &area_count); } +static int _dm_stats_group_id_disp(struct dm_report *rh, + struct dm_pool *mem __attribute__((unused)), + struct dm_report_field *field, const void *data, + void *private __attribute__((unused))) +{ + const struct dm_stats *dms = (const struct dm_stats *) data; + uint64_t group_id; + + group_id = dm_stats_get_group_id(dms, + dm_stats_get_current_region(dms)); + + if (group_id == UINT64_MAX) { + dm_report_field_set_value(field, "-", &group_id); + return 1; + } + + return dm_report_field_uint64(rh, field, &group_id); +} + static int _dm_stats_program_id_disp(struct dm_report *rh, struct dm_pool *mem __attribute__((unused)), struct dm_report_field *field, const void *data, @@ -4200,6 +4219,7 @@ FIELD_F(STATS_META, SIZ, "ArStart", 7, dm_stats_area_start, "area_start", "Area FIELD_F(STATS_META, SIZ, "ArSize", 6, dm_stats_area_len, "area_len", "Area length.") FIELD_F(STATS_META, SIZ, "ArOff", 5, dm_stats_area_offset, "area_offset", "Area offset from start of region.") FIELD_F(STATS_META, NUM, "#Areas", 6, dm_stats_area_count, "area_count", "Area count.") +FIELD_F(STATS_META, NUM, "GrpID", 5, dm_stats_group_id, "group_id", "Group ID.") FIELD_F(STATS_META, STR, "ProgID", 6, dm_stats_program_id, "program_id", "Program ID.") FIELD_F(STATS_META, STR, "AuxDat", 6, dm_stats_aux_data, "aux_data", "Auxiliary data.") FIELD_F(STATS_META, STR, "Precise", 7, dm_stats_precise, "precise", "Set if nanosecond precision counters are enabled.") |