The option log_coarse_timestamps can be set to Log::clock
successfully,but the Log::clock has no effect on time accuracy
because the dout_impl really use is Entry::clock.So we should
set Entry::clock by log_coarse_timestamps option instead of
Log:clock.In addition, i think the Log::clock can be removed
because i didn't see what it was for.
Fixes: https://tracker.ceph.com/issues/44409
Signed-off-by: Guan yunfei <yunfei.guan@xtaotech.com>
pthread_t m_thread;
short m_prio, m_subsys;
-private:
static log_clock& clock() {
static log_clock clock;
return clock;
void Log::set_coarse_timestamps(bool coarse) {
std::scoped_lock lock(m_flush_mutex);
if (coarse)
- clock.coarsen();
+ Entry::clock().coarsen();
else
- clock.refine();
+ Entry::clock().refine();
}
void Log::set_flush_on_exit()
static const std::size_t DEFAULT_MAX_RECENT = 10000;
Log **m_indirect_this;
- log_clock clock;
const SubsystemMap *m_subs;