#include "common/perf_counters.h"
#include "include/types.h" // for operator<<(std::vector)
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
virtual ~RefCountedObjectSafe() override {}
};
-#if !defined(WITH_SEASTAR)|| defined(WITH_ALIEN)
+#ifndef WITH_SEASTAR
/**
* RefCountedCond
static inline void intrusive_ptr_release(RefCountedWaitObject *p) {
p->put();
}
-#endif // !defined(WITH_SEASTAR)|| defined(WITH_ALIEN)
+#endif // ifndef WITH_SEASTAR
static inline void intrusive_ptr_add_ref(const RefCountedObject *p) {
p->get();
#include "include/Context.h"
#include "common/ThrottleInterface.h"
#include "common/Timer.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "include/spinlock.h"
#include "msg/Message.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#ifndef CEPH_WORKQUEUE_H
#define CEPH_WORKQUEUE_H
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
// for ObjectStore.h
struct ThreadPool {
struct TPHandle {
#ifndef CEPH_COMMON_ADMIN_SOCKET_H
#define CEPH_COMMON_ADMIN_SOCKET_H
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/admin/admin_socket.h"
#else
#include "common/PluginRegistry.h"
#include "common/valgrind.h"
#include "include/spinlock.h"
-#if !(defined(WITH_SEASTAR) && !defined(WITH_ALIEN))
+#ifndef WITH_SEASTAR
#include "mon/MonMap.h"
#endif
using ceph::HeartbeatMap;
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
namespace crimson::common {
CephContext::CephContext()
: _conf{crimson::common::local_conf()},
#include "common/cmdparse.h"
#include "common/code_environment.h"
#include "msg/msg_types.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/config_proxy.h"
#include "crimson/common/perf_counters_collection.h"
#else
}
}
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
namespace crimson::common {
class CephContext {
public:
#endif
#endif // WITH_SEASTAR
-#if !(defined(WITH_SEASTAR) && !defined(WITH_ALIEN)) && defined(__cplusplus)
+#if !defined(WITH_SEASTAR) && defined(__cplusplus)
namespace ceph::common {
inline void intrusive_ptr_add_ref(CephContext* cct)
{
cct->put();
}
}
-#endif // !(defined(WITH_SEASTAR) && !defined(WITH_ALIEN)) && defined(__cplusplus)
+#endif // !defined(WITH_SEASTAR) && defined(__cplusplus)
#endif
// and make_recursive_mutex() factory methods, which take a string
// naming the mutex for the purposes of the lockdep debug variant.
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include <seastar/core/condition-variable.hh>
#include "crimson/common/log.h"
#define ceph_mutex_is_locked_by_me(m) true
}
-#else // defined (WITH_SEASTAR) && !defined(WITH_ALIEN)
+#else // ifdef WITH_SEASTAR
//
// For legacy Mutex users that passed recursive=true, use
// ceph::make_recursive_mutex. For legacy Mutex users that passed
#include "include/ceph_assert.h"
#include "include/common_fwd.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include <seastar/util/log.hh>
#include "crimson/common/log.h"
#include "crimson/common/config_proxy.h"
// generic macros
#define dout_prefix *_dout
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#define dout_impl(cct, sub, v) \
do { \
if (crimson::common::local_conf()->subsys.should_gather(sub, v)) { \
#include "include/mempool.h"
#include "include/demangle.h"
-#if defined(_GNU_SOURCE) && defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#if defined(_GNU_SOURCE) && defined(WITH_SEASTAR)
#else
// Thread local variables should save index, not &shard[index],
// because shard[] is defined in the class
void mempool::pool_t::adjust_count(ssize_t items, ssize_t bytes)
{
-#if defined(_GNU_SOURCE) && defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#if defined(_GNU_SOURCE) && defined(WITH_SEASTAR)
// the expected path: we alway pick the shard for a cpu core
// a thread is executing on.
const size_t shard_index = pick_a_shard_int();
for (auto &p : type_map) {
std::string n = ceph_demangle(p.second.type_name);
stats_t &s = (*by_type)[n];
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
s.bytes = 0;
s.items = 0;
for (size_t i = 0 ; i < num_shards; ++i) {
m_lower_bound(lower_bound),
m_upper_bound(upper_bound),
m_name(name)
-#if !defined(WITH_SEASTAR) || defined(WITH_ALIEN)
+#ifndef WITH_SEASTAR
,
m_lock_name(std::string("PerfCounters::") + name.c_str()),
m_lock(ceph::make_mutex(m_lock_name))
int prio_adjust = 0;
-#if !defined(WITH_SEASTAR) || defined(WITH_ALIEN)
+#ifndef WITH_SEASTAR
const std::string m_lock_name;
/** Protects m_data */
ceph::mutex m_lock;
#include <string.h>
#include "common/ceph_context.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/config_proxy.h"
#endif
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
namespace ceph::global {
int __attribute__((weak)) g_conf_set_val(const std::string& key, const std::string& s) {
return 0;
namespace TOPNSPC::global {
CephContext *g_ceph_context = NULL;
ConfigProxy& g_conf() {
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
return crimson::common::local_conf();
#else
return g_ceph_context->_conf;
#endif
}
-#ifdef WITH_ALIEN
+#ifndef WITH_SEASTAR
int g_conf_set_val(const std::string& key, const std::string& s)
{
if (g_ceph_context != NULL)
#pragma once
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#define TOPNSPC crimson
#else
#define TOPNSPC ceph
#include <boost/container/flat_set.hpp>
#include <boost/container/flat_map.hpp>
-#if defined(_GNU_SOURCE) && defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#if defined(_GNU_SOURCE) && defined(WITH_SEASTAR)
# include <sched.h>
#endif
};
static size_t pick_a_shard_int() {
-#if defined(_GNU_SOURCE) && defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#if defined(_GNU_SOURCE) && defined(WITH_SEASTAR)
// a thread local storage is actually just an approximation;
// what we truly want is a _cpu local storage_.
//
struct type_t {
const char *type_name;
size_t item_size;
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
struct type_shard_t {
ceph::atomic<ssize_t> items = {0}; // signed
char __padding[128 - sizeof(ceph::atomic<ssize_t>)];
shard.bytes += total;
shard.items += n;
if (type) {
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
type->shards[shid].items += n;
#else
type->items += n;
shard.bytes -= total;
shard.items -= n;
if (type) {
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
type->shards[shid].items -= n;
#else
type->items -= n;
shard.bytes += total;
shard.items += n;
if (type) {
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
type->shards[shid].items += n;
#else
type->items += n;
shard.bytes -= total;
shard.items -= n;
if (type) {
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
type->shards[shid].items -= n;
#else
type->items -= n;
#include <time.h>
#include <errno.h>
-#if defined(WITH_SEASTAR)
+#ifdef WITH_SEASTAR
#include <seastar/core/lowres_clock.hh>
#endif
tv.tv_nsec = std::max<common_t>((std::chrono::duration_cast<std::chrono::nanoseconds>(dur) %
std::chrono::seconds(1)).count(), 0);
}
-#if defined(WITH_SEASTAR)
+#ifdef WITH_SEASTAR
explicit utime_t(const seastar::lowres_system_clock::time_point& t) {
tv.tv_sec = std::chrono::duration_cast<std::chrono::seconds>(
t.time_since_epoch()).count();
#include "common/debug.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "include/libcephsqlite.h"
#include "SimpleRADOSStriper.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "CInode.h"
#include "Mutation.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "auth/none/AuthNoneClientHandler.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "common/Timer.h"
#include "messages/PaxosServiceMessage.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "msg/async/Event.h"
#include "msg/msg_types.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "include/ceph_assert.h"
#include "common/admin_socket.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
psdout(10) << "activate peer osd." << peer << " " << pi << dendl;
- #if defined(WITH_SEASTAR)
+ #ifdef WITH_SEASTAR
MURef<MOSDPGLog> m;
#else
MRef<MOSDPGLog> m;
// [primary only] content recovery state
struct BufferedRecoveryMessages {
-#if defined(WITH_SEASTAR)
+#ifdef WITH_SEASTAR
std::map<int, std::vector<MessageURef>> message_map;
#else
std::map<int, std::vector<MessageRef>> message_map;
virtual uint64_t get_snap_trimq_size() const = 0;
/// Send cluster message to osd
- #if defined(WITH_SEASTAR)
+ #ifdef WITH_SEASTAR
virtual void send_cluster_message(
int osd, MessageURef m, epoch_t epoch, bool share_map_update=false) = 0;
#else
#include <unordered_map>
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "common/config.h"
#include "rgw_dmclock.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "rgw_dmclock_sync_scheduler.h"
#include "rgw_dmclock_scheduler_ctx.h"
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"
#include "include/ceph_assert.h" // fio.h clobbers our assert.h
#include <algorithm>
-#if defined(WITH_SEASTAR) && !defined(WITH_ALIEN)
+#ifdef WITH_SEASTAR
#include "crimson/common/perf_counters_collection.h"
#else
#include "common/perf_counters_collection.h"