1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 01:55:10 +03:00

libdm: add per region precise timestamps property methods

This commit is contained in:
Bryn M. Reeves 2015-08-17 18:08:18 +01:00
parent f4262026b6
commit 567189cc76
3 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,5 @@
dm_message_supports_precise_timestamps
dm_stats_create_region
dm_stats_driver_supports_precise
dm_stats_get_current_region_precise_timestamps
dm_stats_get_region_precise_timestamps

View File

@ -480,6 +480,22 @@ int dm_message_supports_precise_timestamps(void);
*/
int dm_stats_driver_supports_precise(void);
/*
* Returns 1 if the specified region has the precise_timestamps feature
* enabled (i.e. produces nanosecond-precision counter values) or 0 for
* a region using the default milisecond precision.
*/
int dm_stats_get_region_precise_timestamps(const struct dm_stats *dms,
uint64_t region_id);
/*
* Returns 1 if the region at the current cursor location has the
* precise_timestamps feature enabled (i.e. produces
* nanosecond-precision counter values) or 0 for a region using the
* default milisecond precision.
*/
int dm_stats_get_current_region_precise_timestamps(const struct dm_stats *dms);
#define DM_STATS_ALL_PROGRAMS ""
/*
* Parse the response from a @stats_list message. dm_stats_list will

View File

@ -1489,3 +1489,15 @@ const char *dm_stats_get_current_region_aux_data(const struct dm_stats *dms)
{
return dm_stats_get_region_aux_data(dms, dms->cur_region);
}
int dm_stats_get_region_precise_timestamps(const struct dm_stats *dms,
uint64_t region_id)
{
struct dm_stats_region *region = &dms->regions[region_id];
return region->timescale == 1;
}
int dm_stats_get_current_region_precise_timestamps(const struct dm_stats *dms)
{
return dm_stats_get_region_precise_timestamps(dms, dms->cur_region);
}