Commit Graph

625 Commits

Author SHA1 Message Date
Kefu Chai
7d1679f1d3 cmake: define HAVE_STDLIB_MAP_SPLICING for both libstdc++ and libc++
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-04-08 09:57:36 +08:00
Kefu Chai
2e45598d8a cmake: detect if std::map::merge() is supported
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-04-07 13:25:19 +08:00
Sage Weil
aea80d9afb osd/PG: move peering event type out of PG class
We will create these directly from peering Messages shortly.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-04-03 10:12:35 -05:00
lvshanchun
714ffe0d5f mgr,osd: make osd_metric more popular
Signed-off-by: lvshanchun <lvshanchun@gmail.com>
2018-03-28 11:08:34 +08:00
Nathan Cutler
495742f7dd tools: cleanup: rip out ceph-rest-api
Obsoleted by the mgr REST API.

Fixes: http://tracker.ceph.com/issues/21264
Signed-off-by: Nathan Cutler <ncutler@suse.com>
2018-03-05 22:01:51 +01:00
Radoslaw Zarzynski
d96bf57879 core: make SubsystemMap more statical and optimize should_gather().
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2018-02-27 11:38:47 +01:00
Kefu Chai
b06dd3bb0a
Merge pull request #20443 from rzarzynski/wip-common-inlineable-ceph_clock_now
common: make ceph_clock_now() inlineable.

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2018-02-21 10:14:44 +08:00
Radoslaw Zarzynski
cbdd7c9b4c common: make ceph_clock_now() inlineable.
The `ceph_clock_now()` is a widely spread but thin routine.
All it does is wrap `clock_gettime` or `gettimeofday` with
accompanying conversion to `utime_t`.

Unfortunately, as it is defined outside of header, compilers
are enforced to generate a full-blown function. The overhead
is related not only the well visible stack smashing protection
but also to enforcing callers to go through PLT each time.

Taking into account the time getters are usually *user-space
syscalls* (leveraging e.g. the VDSO mechanism), eradicating
even small boilerplate might be beneficial.

```
0000000000000000 <ceph_clock_now()>:
   0:   48 83 ec 28             sub    $0x28,%rsp
   4:   31 ff                   xor    %edi,%edi
   6:   48 89 e6                mov    %rsp,%rsi
   9:   64 48 8b 04 25 28 00    mov    %fs:0x28,%rax
  10:   00 00
  12:   48 89 44 24 18          mov    %rax,0x18(%rsp)
  17:   31 c0                   xor    %eax,%eax
  19:   e8 00 00 00 00          callq  1e <ceph_clock_now()+0x1e>
  1e:   8b 44 24 08             mov    0x8(%rsp),%eax
  22:   48 c1 e0 20             shl    $0x20,%rax
  26:   48 89 c2                mov    %rax,%rdx
  29:   8b 04 24                mov    (%rsp),%eax
  2c:   48 09 d0                or     %rdx,%rax
  2f:   48 8b 4c 24 18          mov    0x18(%rsp),%rcx
  34:   64 48 33 0c 25 28 00    xor    %fs:0x28,%rcx
  3b:   00 00
  3d:   75 05                   jne    44 <ceph_clock_now()+0x44>
  3f:   48 83 c4 28             add    $0x28,%rsp
  43:   c3                      retq
  44:   e8 00 00 00 00          callq  49 <SubProcess::spawn()::__PRETTY_FUNCTION__+0x9>
```

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2018-02-14 21:43:50 +01:00
Kefu Chai
c8baadf3c0 cmake: depend on the right version of python bindings
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-02-11 14:12:16 +08:00
Kefu Chai
9e45edaab2 cmake: build ceph-mgr with specified version of python
* add an option named "MGR_PYTHON_VERSION", so we can build ceph-mgr
  which use py3 for running plugins
* also drop the line to specify the "Python_ADDITIONAL_VERSIONS", because
  2.7 is listed by all the the FindPythonInterp and FindPythonLibs in
  cmake 2.8.12 and up.
* use ${MGR_PYTHON_EXECUTABLE} for holding the path to the python
  interpreter used by mgr. because this variable might be overwritten by
  "find_package(PythonInterp 2 REQUIRED)" when checking for building env
  of pybinding for python2.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-01-26 20:24:54 +08:00
Kefu Chai
8b21ba9242 cmake: add WITH_PYTHON2 option
* add WITH_PYTHON2 option, so we can build python3 bindings only.
* change the default value of WITH_PYTHON3 option to "OFF", as the
option() command in cmake only allow the initial value to be "ON" or
"OFF". we could use a cached string for this option, but i think it
would be more explicit to continue using the option() command.
* fix the installation dir of "ceph_rest_api.py". please note, we still
have a *default* python version, which is specified by the last element
of ${py_vers}. for instance, ${PYTHON_VERSION} will be 3 if ${py_vers}
is 2;3. in this change, 2 is still the default python version, if both
WITH_PYTHON2 and WITH_PYTHON3 are enabled.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-01-26 20:06:21 +08:00
John Spray
6a8da7ca73 mgr: load all modules (not just active ones)
This is to enable us to learn more about the module
before it is enabled, such as whether its can_run method
return true.

We can also use this to enable loading a module's
commands before it is enabled, to give the user
a better response when they try to use a command
belong to a module that is not loaded.

Signed-off-by: John Spray <john.spray@redhat.com>
2018-01-24 13:08:20 -05:00
Jason Dillaman
80f6c5cc4b
Merge pull request #20014 from liewegas/wip-rbd-validate
common/options,librbd/Utils: refactor RBD feature validation

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2018-01-23 08:34:58 -05:00
Casey Bodley
ba85740955 cmake: remove cryptopp option
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-01-19 10:25:41 -05:00
Sage Weil
fa2faeefd8 common/options,librbd/Utils: refactor RBD feature validation
Move conversion of RBD features to/from string/uint64_t to helpers, and
use those from the option validator.

Keep the resulting features in integer form to avoid breaking Cinder.
Meh.

Change behavior from prior version:

- fail to parse if any of the specified features is invalid (previously
  we would parse the ones we understood and ignore the others).

Signed-off-by: Sage Weil <sage@redhat.com>
2018-01-19 08:48:53 -06:00
Patrick Donnelly
1f530c0fa8
Merge PR #19894 into master
* refs/pull/19894/head:
	cmake: link against ceph-common instead of common

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2018-01-12 14:37:39 -08:00
Sage Weil
c4a7881876
Merge pull request #19881 from liewegas/wip-kill-crush-location
ceph-crush-location: remove

Reviewed-by: Wido den Hollander <wido@widodh.nl>
2018-01-11 15:48:29 -06:00
Kefu Chai
02a720b6e9 cmake: link against ceph-common instead of common
this change repeats e6695bb and partially reverts df9a598.
it's always nice to reuse shared library: smaller size of executable,
less debug symbol, and smaller memory footprints at run-time, if the
shared library is "shared" by multiple executables.

See-also: http://tracker.ceph.com/issues/22438
See-also: https://github.com/ceph/teuthology/pull/1143
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-01-10 17:00:46 +08:00
Sage Weil
fb3220ff3e ceph-crush-location: remove
This script is pointless.  It is equivalent to the built-in default
behavior, which makes it only useful as a sample for what a location
hook's output should be.  The documentation has been updated to provide
that.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-01-09 16:38:12 -06:00
Kefu Chai
142f2a56d0 cmake: do not build/install boost::regex
we now use std::regex now, since we've dropped the support of GCC 4.8

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-01-09 17:29:08 +08:00
Adam C. Emerson
da1457cdc0 build: Bump language to C++17
Fix up all of the fallout from that.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2018-01-08 15:30:03 -05:00
Casey Bodley
688cc25755 common: add streaming interfaces for json/xml escaping
adds stream output operators that escape json/xml strings without having
to allocate a separate output buffer

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-01-05 13:26:25 -05:00
Kefu Chai
75c5e5cc26 cmake: pass static linkflags to the linker who links libcommon
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-01-04 19:44:04 +08:00
Kefu Chai
258b10cc01
Merge pull request #19515 from tchaikov/wip-cmake-lttng-leak
cmake: link libcommon with libstdc++ statically if WITH_STATIC_LIBSTDCXX

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2017-12-16 12:31:57 +08:00
Kefu Chai
df9a598942 cmake: link libcommon with libstdc++ statically if WITH_STATIC_LIBSTDCXX
this matches the linkage of libceph-common, because valgrind reports
Leak_StillReachable if daemons are linked against libceph-common, will
link daemons against common instead, and let common link libstdc++
statically, if WITH_STATIC_LIBSTDCXX=ON.

this change also reverts e6695bb6

Fixes: http://tracker.ceph.com/issues/22438
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-12-14 19:01:34 +08:00
Adam C. Emerson
70da1eed80 build: Uplevel to C++14
Fix a couple problems.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2017-12-13 22:39:52 -05:00
Kefu Chai
e6695bb63a cmake: link executables against ceph-common
so they can have access to libstdc++ if it is linked statically.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-12-12 00:26:52 +08:00
Kefu Chai
4c2216de6a cmake: add WITH_STATIC_LIBSTDCXX option
to link libceph-common with libstdc++ if it is enabled.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-12-12 00:26:52 +08:00
Kefu Chai
bcc0511d3b cmake: bail out if GCC version is less than 5.1
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-12-05 22:59:48 +08:00
Kefu Chai
704b6db0be
Merge pull request #19100 from tchaikov/wip-log-reuse-streambuf
common/log: Speed improvement for log

Reviewed-by: Adam Kupczyk <akupczyk@redhat.com>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
2017-12-01 10:34:54 +08:00
Kefu Chai
12dc5733c9
Merge pull request #18938 from tchaikov/wip-cmake
cmake: check gcc version not release date for libstdc++ saneness

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2017-11-29 15:38:16 +08:00
Adam Kupczyk
b08ae658e8 common/log: Added new version of PrebufferedStreambuf, tuned for log usage
Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-28 16:15:24 +08:00
Kefu Chai
7e7978732d mgr: summarize osd metrics in MMgrReport and sent it to mon
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-23 13:55:15 +08:00
Kefu Chai
dbe04b4a85 cmake: refactor dpdk related code
* move the check of `USE_CRYPTOPP` to $top_srcdir/CMakeLists.txt
* remove reference of DPDK_LIBRARY, it's defined nowhere
* move the dpdk code to a single place

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-18 10:43:33 +08:00
Kefu Chai
306edd149b cmake: check gcc version not release date for libstdc++ saneness
there is chance that the release date of a minor or patch version of
libstdc++/gcc is *greater* than that of a major version. so this renders
the existing approach to check the __GLIBCPP__ useless. let's check the
gcc version instead. it's far from a perfect solution. but it's good
enough to cover most cases. assuming that most users use gcc with
libstdc++ comes with it. instead of using 1) gcc with a newer libstdc++,
or 2) clang with a old libstdc++.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-15 15:22:36 +08:00
Kefu Chai
800234a96d
Merge pull request #16369 from bspark8/wip_dmc2_client_tracker
dmclock: Delivery of the dmclock delta, rho and phase parameter + Enabling the client service tracker

Reviewed-by: J. Eric Ivancich <ivancich@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-11-14 14:59:52 +08:00
Kefu Chai
1d0866af35 cmake: warn if libstdc++ older than 5.1.0 is used
__GLIBCPP__ is used before 3.4.0, and gcc 4.8.0 and up is required to
build c++11 source, hence it's safe to check __GLIBCXX__. for the
versioning of libstdc++, see
https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning,
for the magic number of 20150422ul see
https://gcc.gnu.org/develop.html#timeline.
for the reason why we want to have this warning, see
https://github.com/ceph/ceph/pull/18755#issuecomment-342736554 .

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-13 12:35:15 +08:00
Taewoong Kim
9b702cf8fc osdc/Objecter: Add dmclock tracker for client.
Signed-off-by: Taewoong Kim <taewoong.kim@sk.com>
2017-11-08 21:43:45 +09:00
Kefu Chai
10ab96be4d
Merge pull request #18711 from adamemerson/wip-system-includes
cmake: System Includes to silence warnings from submodules and libraries!

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-11-04 16:03:37 +08:00
Adam C. Emerson
8d4a07f89f build: Mark dependency includes as SYSTEM
It is not really our business to debug python, boost, or our other
dependencies. Mark them as system includes.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2017-11-03 23:58:41 -04:00
Kefu Chai
c8d4005558 cmake,deb: remove the last trace of atomic_ops
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-03 16:23:42 +08:00
Kefu Chai
c43bac48b0 cmake: fix indent
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-03 16:23:26 +08:00
John Spray
df8797320b mgr: cut down duplication between active+standby
...by using PyModuleRunner class from ActivePyModule too.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-11-01 08:20:21 -04:00
John Spray
25566d1edc mgr: enable running modules in standby mode
Modules can implement a second, separate class
that has access to very little state about the
system and can't implement commands.

They have just enough information to redirect
or forward incoming requests/traffic to the
active instance of the module on the active mgr.

This enables module authors to create modules
that end users can access via any (running) mgr node
at any time, rather than having to first work out
which mgr node is active.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-11-01 08:20:21 -04:00
John Spray
70d45a6b93 mgr: clean up python source file naming
Signed-off-by: John Spray <john.spray@redhat.com>
2017-11-01 08:20:20 -04:00
John Spray
9718896c8b mgr: refactor python module management
Separate out the *loading* of modules from
the *running* of modules.

This is a precursor to enabling modules to run
in standby mode.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-11-01 08:20:20 -04:00
Sage Weil
028e15d62f Merge pull request #18496 from liewegas/wip-pgmap
build: remove PGMap.cc from libcommon

Reviewed-by: Kefu Chai <kchai@redhat.com>
2017-10-25 21:53:07 -05:00
Sage Weil
3a6255d206 build: remove PGMap.cc from libcommon
Not needed.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-10-23 17:01:11 -05:00
Ali Maredia
73f75c5365 cmake: add cython_rbd as a dependency to vstart target
Without cython_rbd, there are import errors
in the mgr log and the ceph-mgr dashboard cannot be
viewed by building just the vstart target.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2017-10-19 13:04:46 -04:00
John Spray
23c3a075ee mgr: move Gil implementation into .cc
The inclusion of Python.h in the .h was awkward
for other files including Gil.h.

Signed-off-by: John Spray <john.spray@redhat.com>
2017-10-16 07:06:23 -04:00