Summary:
Now that fmt is available in Folly builds (D14813810), use it to reduce binary code size in Folly Logger. This is done by moving most of the formatting logic behind the type-erased `vformat` API. Previously it was instantiated for all combinations of formatting argument types used in calls to `FB_LOGF` and `XLOGF` in a program.
The effect of this change can be illustrated by looking at symbol sizes as given by `nm -S -td` for the following test function:
```
void test_log() {
FB_LOGF(logger, WARN, "num events: {:06d}, duration: {:6.3f}", 1234, 5.6789);
}
```
compiled in `opt` mode.
`nm` before:
```
0000000004236736 0000000000000231 T test_log()
0000000004236992 0000000000001002 W std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > folly::LogStreamProcessor::formatLogString<int, double>(folly::Range<char const*>, int const&, double const&)
```
`nm` after:
```
0000000004237536 0000000000000231 T test_log()
0000000004237792 0000000000000251 W std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > folly::LogStreamProcessor::formatLogString<int, double>(folly::Range<char const*>, int const&, double const&)
0000000004238048 0000000000000740 W folly::LogStreamProcessor::vformatLogString[abi:cxx11](folly::Range<char const*>, fmt::v5::format_args, bool&)
```
Before we had one 1002 byte instantiation of `formatLogString<int, double>`. With this change it was reduced 4x to 251 bytes and non-template function `vformatLogString` was added which is shared among all logging calls. The size of `test_log` remained unchanged. There are even bigger savings from Folly Formatter instantiations which are no longer needed, e.g.
```
0000000004238032 0000000000001363 W _ZNK5folly13BaseFormatterINS_9FormatterILb0EJRKiRKdEEELb0EJS3_S5_EEclIZNKS7_8appendToINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENSt9enable_ifIXsr12IsSomeStringIT_EE5valueEvE4typeERSH_EUlNS_5RangeIPKcEEE_EEvSK_
```
So in total this change results in ~5x per-call/instantiation binary size. It is possible to reduce binary size even further but it is not done in the current diff to keep it manageable.
In addition to binary size improvements, switching to fmt will potentially
* allow catching errors in format strings at compile time,
* simplify future migration to C++20 [`std::format`](http://eel.is/c++draft/format).
Reviewed By: simpkins
Differential Revision: D15485589
fbshipit-source-id: 06db4436839f11c2c3dbed7b36658e2193343411
Summary:
The external Travis CI builds for fbzmq are still using the older
fbcode_builder spec (as opposed to the newer getdeps manifest file).
D16577367 moved the CMakeLists.txt file to the top-level directory, but the
fbzmq spec file was still looking for it in the fbzmq subdirectory.
Reviewed By: jstrizich
Differential Revision: D17005361
fbshipit-source-id: 3f7664eadfb60ec7606124a14445b44ae586b8a7
Summary: This diff allows zmq socket to run on folly::fibers
Reviewed By: saifhhasan
Differential Revision: D15113447
fbshipit-source-id: 8a0e1f91d719a9deda48837d4ff1065408280b72
Summary:
Add resource monitor object to fbzmq library to monitor CPU and memory. User can use
the object to query RSS memory, cpu usage, and optionally call API to monitor memory periodicially
and crash when reaches beyond a specified threshold limit.
Reviewed By: cenzhao
Differential Revision: D8873504
fbshipit-source-id: a445fdd580da82c55fba09c43f46f60bb9f1149a
Summary: Makes a spec for libsodium.
Reviewed By: knekritz
Differential Revision: D8228801
fbshipit-source-id: 18f623bce0bbc07f711129b15b78d56b6c852bf7
Summary:
fbthrift generate errorneous code when cpp type IOBuf pointer is used. Let's use
IOBuf object instead as it is cheap to copy construct and underlying buffer is
anyway shared when objects are copied.
Reviewed By: plapukhov
Differential Revision: D8130040
fbshipit-source-id: 3c109a85951054fed890707f56170b46cfefc917
Summary: needed to update this here as well
Reviewed By: plapukhov
Differential Revision: D5986326
fbshipit-source-id: 4913eb1b3d5521d08b65dcdb4696f42d86269c3e
Summary:
this diff provides ci builds for our two open source projects, openr and fbzmq, by leveraging snarkmaster 's awesome tool, fbcode builder. this will run our external cmake build process on lego-linux sandcastle boxes and also generates scripts for building on travis with docker externally.
this diff is modeled on D4441467. it also includes some changes to fbcode builder itself and some minor changes in our cmake files.
snarkmaster , please take a look at my fbcode builder changes. I needed to make some modifications in order to build some of our dependencies which have slightly non-standard build steps and to run tests. I split up the configure step, and I addressed an issue around workdir with cmake. the last workdir was just a relative path, `build`, so it was hard to get back to it in a future step to run tests.
Reviewed By: saifhhasan
Differential Revision: D5141184
fbshipit-source-id: 94cacab807a3a0da4d0d81016d7f36f37656145d