- if (true) {
- ANNOTATE_BENIGN_RACE_SIZED(expected_size, sizeof(*expected_size),
- "Log hint");
- size_t size = __atomic_load_n(expected_size, __ATOMIC_RELAXED);
- void *ptr = ::operator new(sizeof(Entry) + size);
- return new(ptr) Entry(ceph_clock_now(),
- pthread_self(), level, subsys,
- reinterpret_cast<char*>(ptr) + sizeof(Entry), size, expected_size);
- } else {
- // kludge for perf testing
- Entry *e = m_recent.dequeue();
- e->m_stamp = ceph_clock_now();
- e->m_thread = pthread_self();
- e->m_prio = level;
- e->m_subsys = subsys;
- return e;
+ if (m_fd < 0)
+ return;
+ int r = safe_write(m_fd, sv.data(), sv.size());
+ if (r != m_fd_last_error) {
+ if (r < 0)
+ std::cerr << "problem writing to " << m_log_file
+ << ": " << cpp_strerror(r)
+ << std::endl;
+ m_fd_last_error = r;