YugabyteDB (2.13.0.0-b42, bfc6a6643e7399ac8a0e81d06a3ee6d6571b33ab)

Coverage Report

Created: 2022-03-09 17:30

/Users/deen/code/yugabyte-db/src/yb/rocksdb/port/port_posix.h
Line
Count
Source (jump to first uncovered line)
1
//  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
2
//  This source code is licensed under the BSD-style license found in the
3
//  LICENSE file in the root directory of this source tree. An additional grant
4
//  of patent rights can be found in the PATENTS file in the same directory.
5
//
6
// The following only applies to changes made to this file as part of YugaByte development.
7
//
8
// Portions Copyright (c) YugaByte, Inc.
9
//
10
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
11
// in compliance with the License.  You may obtain a copy of the License at
12
//
13
// http://www.apache.org/licenses/LICENSE-2.0
14
//
15
// Unless required by applicable law or agreed to in writing, software distributed under the License
16
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
17
// or implied.  See the License for the specific language governing permissions and limitations
18
// under the License.
19
//
20
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
21
// Use of this source code is governed by a BSD-style license that can be
22
// found in the LICENSE file. See the AUTHORS file for names of contributors.
23
//
24
// See port_example.h for documentation for the following types/functions.
25
26
#pragma once
27
28
// size_t printf formatting named in the manner of C99 standard formatting
29
// strings such as PRIu64
30
// in fact, we could use that one
31
110k
#define ROCKSDB_PRIszt "zu"
32
33
#define __declspec(S)
34
35
#define ROCKSDB_NOEXCEPT noexcept
36
37
#undef PLATFORM_IS_LITTLE_ENDIAN
38
#if defined(OS_MACOSX)
39
  #include <machine/endian.h>
40
  #if defined(__DARWIN_LITTLE_ENDIAN) && defined(__DARWIN_BYTE_ORDER)
41
    #define PLATFORM_IS_LITTLE_ENDIAN \
42
        (__DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN)
43
  #endif
44
#elif defined(OS_SOLARIS)
45
  #include <sys/isa_defs.h>
46
  #ifdef _LITTLE_ENDIAN
47
    #define PLATFORM_IS_LITTLE_ENDIAN true
48
  #else
49
    #define PLATFORM_IS_LITTLE_ENDIAN false
50
  #endif
51
#elif defined(OS_FREEBSD) || defined(OS_OPENBSD) || defined(OS_NETBSD) || \
52
    defined(OS_DRAGONFLYBSD) || defined(OS_ANDROID)
53
  #include <sys/endian.h>
54
  #include <sys/types.h>
55
  #define PLATFORM_IS_LITTLE_ENDIAN (_BYTE_ORDER == _LITTLE_ENDIAN)
56
#else
57
  #include <endian.h>
58
#endif
59
#include <pthread.h>
60
61
#include <stdint.h>
62
#include <string.h>
63
#include <limits>
64
#include <string>
65
66
#ifndef PLATFORM_IS_LITTLE_ENDIAN
67
#define PLATFORM_IS_LITTLE_ENDIAN (__BYTE_ORDER == __LITTLE_ENDIAN)
68
#endif
69
70
#if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\
71
    defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\
72
    defined(OS_ANDROID) || defined(CYGWIN)
73
// Use fread/fwrite/fflush on platforms without _unlocked variants
74
#define fread_unlocked fread
75
#define fwrite_unlocked fwrite
76
#define fflush_unlocked fflush
77
#endif
78
79
#if defined(OS_MACOSX) || defined(OS_FREEBSD) ||\
80
    defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD)
81
// Use fsync() on platforms without fdatasync()
82
515k
#define fdatasync fsync
83
#endif
84
85
#if defined(OS_ANDROID) && __ANDROID_API__ < 9
86
// fdatasync() was only introduced in API level 9 on Android. Use fsync()
87
// when targeting older platforms.
88
#define fdatasync fsync
89
#endif
90
91
namespace rocksdb {
92
namespace port {
93
94
// For use at db/file_indexer.h kLevelMaxIndex
95
const int kMaxInt32 = std::numeric_limits<int32_t>::max();
96
const uint64_t kMaxUint64 = std::numeric_limits<uint64_t>::max();
97
const size_t kMaxSizet = std::numeric_limits<size_t>::max();
98
99
static const bool kLittleEndian = PLATFORM_IS_LITTLE_ENDIAN;
100
#undef PLATFORM_IS_LITTLE_ENDIAN
101
102
class CondVar;
103
104
class Mutex {
105
 public:
106
  /* implicit */ Mutex(bool adaptive = false);
107
  ~Mutex();
108
109
  void Lock();
110
  void Unlock();
111
  // this will assert if the mutex is not locked
112
  // it does NOT verify that mutex is held by a calling thread
113
  void AssertHeld();
114
115
 private:
116
  friend class CondVar;
117
  pthread_mutex_t mu_;
118
#ifndef NDEBUG
119
  bool locked_;
120
#endif
121
122
  // No copying
123
  Mutex(const Mutex&);
124
  void operator=(const Mutex&);
125
};
126
127
class RWMutex {
128
 public:
129
  RWMutex();
130
  ~RWMutex();
131
132
  void ReadLock();
133
  void WriteLock();
134
  void ReadUnlock();
135
  void WriteUnlock();
136
0
  void AssertHeld() { }
137
138
 private:
139
  pthread_rwlock_t mu_; // the underlying platform mutex
140
141
  // No copying allowed
142
  RWMutex(const RWMutex&);
143
  void operator=(const RWMutex&);
144
};
145
146
class CondVar {
147
 public:
148
  explicit CondVar(Mutex* mu);
149
  ~CondVar();
150
  void Wait();
151
  // Timed condition wait.  Returns true if timeout occurred.
152
  bool TimedWait(uint64_t abs_time_us);
153
  void Signal();
154
  void SignalAll();
155
 private:
156
  pthread_cond_t cv_;
157
  Mutex* mu_;
158
};
159
160
212M
static inline void AsmVolatilePause() {
161
#if defined(__i386__) || defined(__x86_64__)
162
  asm volatile("pause");
163
#elif defined(__aarch64__)
164
212M
  asm volatile("wfe");
165
#elif defined(__powerpc64__)
166
  asm volatile("or 27,27,27");
167
#endif
168
  // it's okay for other platforms to be no-ops
169
212M
}
Unexecuted instantiation: data-patcher.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_bench_tool.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_repl_stress.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_stress.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: sst_dump.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: yb-bulk_load.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: backup-txn-test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: ql-tablet-test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: snapshot-schedule-test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: compaction_file_filter-test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: doc_key-test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: doc_operation-test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: docdb-test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: docrowwiseiterator-test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: randomized_docdb-test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: flush-test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: arena_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: auto_roll_logger_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: autovector_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: block_based_filter_block_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: block_hash_index_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: block_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: bloom_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: cache_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: checkpoint_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: coding_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: column_family_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: compact_files_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: compaction_job_stats_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: compaction_job_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: compaction_picker_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: comparator_db_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: corruption_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_block_cache_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_bloom_filter_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_compaction_filter_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_compaction_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_dynamic_level_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_inplace_update_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_iter_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_log_iter_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_properties_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_sst_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_table_properties_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_tailing_iter_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_test2.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_universal_compaction_deletion_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_universal_compaction_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_wal_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: dbformat_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: delete_scheduler_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: deletefile_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: document_db_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: dynamic_bloom_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: env_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: event_logger_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: fault_injection_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: file_indexer_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: filelock_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: filename_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: fixed_size_filter_block_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: flush_job_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: full_filter_block_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: geodb_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: histogram_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: inlineskiplist_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: json_document_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: ldb_cmd_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: listener_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: log_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: manual_compaction_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: memenv_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: memory_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: merge_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: merger_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: mock_env_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: optimistic_transaction_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: options_file_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: options_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: options_util_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: perf_context_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: plain_table_db_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: prefix_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: rate_limiter_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: redis_lists_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: reduce_levels_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: skiplist_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: slice_transform_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: sst_dump_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: stringappend_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: table_properties_collector_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: table_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: thread_local_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: transaction_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: ttl_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: user_op_id_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: version_builder_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: version_edit_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: version_set_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: wal_manager_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: write_batch_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: write_batch_with_index_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: write_callback_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: write_controller_test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: encrypted_sstable-test.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: bulk_load_docdb_util.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: cdcsdk_producer.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: mini_cluster.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: catalog_manager.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: auto_roll_logger.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: builder.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: column_family.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: compacted_db_impl.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: compaction.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: compaction_iterator.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: compaction_job.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: compaction_picker.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: convenience.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_filesnapshot.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: dbformat.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_impl.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_impl_debug.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_impl_readonly.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_impl_experimental.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_iter.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: experimental.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: event_helpers.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: file_indexer.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
file_numbers.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Line
Count
Source
160
2.33k
static inline void AsmVolatilePause() {
161
#if defined(__i386__) || defined(__x86_64__)
162
  asm volatile("pause");
163
#elif defined(__aarch64__)
164
2.33k
  asm volatile("wfe");
165
#elif defined(__powerpc64__)
166
  asm volatile("or 27,27,27");
167
#endif
168
  // it's okay for other platforms to be no-ops
169
2.33k
}
Unexecuted instantiation: filename.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: flush_job.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: flush_scheduler.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: forward_iterator.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: internal_stats.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: log_reader.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: log_writer.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: managed_iterator.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: memtable.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: memtable_list.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: merge_helper.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: repair.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: table_cache.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: table_properties_collector.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: transaction_log_impl.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: version_builder.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: version_edit.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: version_set.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: wal_manager.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: write_batch.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
write_thread.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Line
Count
Source
160
212M
static inline void AsmVolatilePause() {
161
#if defined(__i386__) || defined(__x86_64__)
162
  asm volatile("pause");
163
#elif defined(__aarch64__)
164
212M
  asm volatile("wfe");
165
#elif defined(__powerpc64__)
166
  asm volatile("or 27,27,27");
167
#endif
168
  // it's okay for other platforms to be no-ops
169
212M
}
Unexecuted instantiation: hash_linklist_rep.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: hash_skiplist_rep.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: skiplistrep.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: vectorrep.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: port_posix.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: block_based_filter_block.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: block_based_table_builder.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: block_based_table_factory.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: block_based_table_reader.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: block_builder.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: block.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: block_hash_index.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: block_prefix_index.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: bloom_block.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: format.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: get_context.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: index_builder.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: index_reader.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: iterator.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: merger.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: meta_blocks.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: sst_file_writer.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: plain_table_builder.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: plain_table_factory.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: plain_table_index.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: plain_table_key_coding.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: plain_table_reader.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: table_properties.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: two_level_iterator.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_dump_tool.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: arena.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: bloom.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: cache.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: coding.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: concurrent_arena.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: crc32c.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: delete_scheduler.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: dynamic_bloom.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: env_posix.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: io_posix.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: sst_file_manager_impl.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: file_util.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: file_reader_writer.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: hash.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: instrumented_mutex.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: checkpoint.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: remove_emptyvalue_compactionfilter.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: document_db.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: json_document.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: geodb_impl.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: uint64add.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: redis_lists.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: optimistic_transaction_impl.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: transaction_base.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: transaction_db_impl.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: transaction_lock_mgr.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: transaction_impl.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: transaction_util.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_ttl_impl.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: write_batch_with_index.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: write_batch_with_index_internal.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: event_logger.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: log_buffer.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: memenv.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: mutable_cf_options.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: options.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: options_helper.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: random.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: rate_limiter.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: sync_point.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: thread_local.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: mock_table.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: mock_env.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: testutil.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: db_test_util.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: ldb_cmd.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: ldb_tool.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: sst_dump_tool.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: tablet.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: tablet_peer.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: history_cutoff_operation.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: tablet_retention_policy.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: backup_service.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: doc_boundary_values_extractor.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: docdb_util.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: docdb_compaction_filter.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: docdb_compaction_filter_intents.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: docdb_rocksdb_util.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: doc_pgsql_scanspec.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: doc_ql_scanspec.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: doc_rowwise_iterator.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: compaction_file_filter.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: docdb_test_util.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: docdb_test_base.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
Unexecuted instantiation: in_mem_docdb.cc:_ZN7rocksdb4portL16AsmVolatilePauseEv
170
171
// Returns -1 if not available on this platform
172
extern int PhysicalCoreID();
173
174
typedef pthread_once_t OnceType;
175
#define LEVELDB_ONCE_INIT PTHREAD_ONCE_INIT
176
extern void InitOnce(OnceType* once, void (*initializer)());
177
178
51.8M
#define CACHE_LINE_SIZE 64U
179
180
0
#define PREFETCH(addr, rw, locality) __builtin_prefetch(addr, rw, locality)
181
182
extern void Crash(const std::string& srcfile, int srcline);
183
184
extern int GetMaxOpenFiles();
185
186
} // namespace port
187
} // namespace rocksdb