Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: In this approach, we create a weakly defined symbol in TargetHooks.cpp that is defined in the mcrouter-core target and conditionally checked and invoked in the gen utils visitor. This approach minimizes the amount of changes we want to make as opposed to previous approaches (most of which required making changes to hundreds of target files). Here we do a few things to make this work: 1. In rim's stats.cpp TARGET, we have to change the odsl library to use the "via_mcrouter" flavor of those targets. autodeps wants to change it back, but that will immediately trigger circular dependencies. For good measure I added, autodeps-skip nocodemods to that target. 2. stuclar taught me about nm and how I can dump the symbols that are compiled in the different modes (dev/opt). I dumped the symbols when building mcrouter_core in both dev and opt mode and I see that gRIMReport is NOT a weak symbol, which IIUC is what we desire. P1430729979, P1430693327 have the full pastes. opt mode: > 0000000000000000 W _ZN8facebook8memcache8mcrouter10gRIMReportERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EERKSt13unordered_mapIS8_mSt4hashIS8_ESt8equal_toIS8_ESaISt4pairIKS8_mEEE > 0000000000000000 b _ZZN8facebook8memcache8mcrouter10gRIMReportERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EERKSt13unordered_mapIS8_mSt4hashIS8_ESt8equal_toIS8_ESaISt4pairIKS8_mEEEE14LOGGING_helper dev mode: > 00000000002055f0 W _ZN8facebook8memcache8mcrouter10gRIMReportERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EERKSt13unordered_mapIS8_mSt4hashIS8_ESt8equal_toIS8_ESaISt4pairIKS8_mEEE > _ZZN8facebook8memcache8mcrouter10gRIMReportERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS8_EERKSt13unordered_mapIS8_mSt4hashIS8_ESt8equal_toIS8_ESaISt4pairIKS8_mEEEE14LOGGING_helper Edit on Version 6: 1. I've extracted productId and plumbed it to RIM. 2. Swayze Test: https://www.internalfb.com/intern/hhvm/automator/workflows/134338/ Another Swayze Test (with CD_MEMCACHE_ATTRIBUTION used): https://www.internalfb.com/intern/hhvm/automator/workflows/140328/ Reviewed By: stuclar Differential Revision: D57884193 fbshipit-source-id: 77f67f14b2db93018b668411a9cdc40c043ae4cf
- Loading branch information