mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: add per region precise timestamps property methods
This commit is contained in:
parent
f4262026b6
commit
567189cc76
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user