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>
* 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>
* 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>
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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>