Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Issue 842673002: [tcmalloc]: Remove calls to __system_property_get in tcmalloc. (Closed)

Created:
5 years, 11 months ago by rmcilroy
Modified:
5 years, 4 months ago
CC:
chromium-reviews, Dai Mikurube (NOT FULLTIME)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[tcmalloc]: Remove calls to __system_property_get in tcmalloc. Removes calls to __system_property_get in tcmalloc since this is not a public API and has been removed from the 'L' Android NDK. Since Android does not use tcmalloc by default, this will only affect builds which explicitly configure use_allocator=tcmalloc and profiling=1 (which is likely only used when building for deep memory profiler). BUG=394841

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -46 lines) Patch
M third_party/tcmalloc/README.chromium View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/tcmalloc/chromium/src/base/commandlineflags.h View 2 chunks +1 line, -46 lines 2 comments Download

Messages

Total messages: 9 (2 generated)
rmcilroy
Jar: could you please take a look, thanks. As mentioned in the description, tcmalloc is ...
5 years, 11 months ago (2015-01-07 18:29:49 UTC) #2
jar (doing other things)
https://codereview.chromium.org/842673002/diff/1/third_party/tcmalloc/chromium/src/base/commandlineflags.h File third_party/tcmalloc/chromium/src/base/commandlineflags.h (right): https://codereview.chromium.org/842673002/diff/1/third_party/tcmalloc/chromium/src/base/commandlineflags.h#newcode118 third_party/tcmalloc/chromium/src/base/commandlineflags.h:118: #error TCMalloc does not support profiling on Android I'm ...
5 years, 11 months ago (2015-01-07 19:39:57 UTC) #4
jar (doing other things)
https://codereview.chromium.org/842673002/diff/1/third_party/tcmalloc/chromium/src/base/commandlineflags.h File third_party/tcmalloc/chromium/src/base/commandlineflags.h (right): https://codereview.chromium.org/842673002/diff/1/third_party/tcmalloc/chromium/src/base/commandlineflags.h#newcode118 third_party/tcmalloc/chromium/src/base/commandlineflags.h:118: #error TCMalloc does not support profiling on Android On ...
5 years, 11 months ago (2015-01-07 20:28:21 UTC) #5
bulach
On 2015/01/07 20:28:21, jar (doing other things) wrote: > https://codereview.chromium.org/842673002/diff/1/third_party/tcmalloc/chromium/src/base/commandlineflags.h > File third_party/tcmalloc/chromium/src/base/commandlineflags.h (right): > ...
5 years, 11 months ago (2015-01-07 20:42:16 UTC) #6
jar (doing other things)
On 2015/01/07 20:42:16, bulach wrote: > On 2015/01/07 20:28:21, jar (doing other things) wrote: > ...
5 years, 11 months ago (2015-01-07 21:53:36 UTC) #7
rmcilroy
On 2015/01/07 21:53:36, jar (doing other things) wrote: > On 2015/01/07 20:42:16, bulach wrote: > ...
5 years, 11 months ago (2015-01-07 22:57:59 UTC) #8
jar (doing other things)
5 years, 11 months ago (2015-01-08 00:48:47 UTC) #9
On 2015/01/07 22:57:59, rmcilroy wrote:
> On 2015/01/07 21:53:36, jar (doing other things) wrote:
> > On 2015/01/07 20:42:16, bulach wrote:
> > > On 2015/01/07 20:28:21, jar (doing other things) wrote:
> > > >
> > >
> >
>
https://codereview.chromium.org/842673002/diff/1/third_party/tcmalloc/chromiu...
> > > > File third_party/tcmalloc/chromium/src/base/commandlineflags.h (right):
> > > > 
> > > >
> > >
> >
>
https://codereview.chromium.org/842673002/diff/1/third_party/tcmalloc/chromiu...
> > > > third_party/tcmalloc/chromium/src/base/commandlineflags.h:118: #error
> > TCMalloc
> > > > does not support profiling on Android
> > > > On 2015/01/07 19:39:57, jar (doing other things) wrote:
> > > > > I'm missing the connection to TCMalloc.
> > > > > 
> > > > > You are removing calls to __system_property_get(), presumably because
it
> > may
> > > > not
> > > > > be available at some point.
> > > > > 
> > > > > You have changed the code to not compile this file for Android (in
fact,
> > you
> > > > > can't compile it on Android).
> > > > > 
> > > > > Can you clarify the connection to TCMalloc, and explain why blocking
> > > > compilation
> > > > > of this file on Android is a good thing?
> > > > 
> > > > <DOH!>  I misread the file name (I stopped looking up the path after
> base...
> > > > src... chromium (which is about where I have the root of my tree!?!).  I
> now
> > > see
> > > > it was under third_party/tcmalloc.
> > > > 
> > > > One obvious question: If Android is not using TCMalloc, why is this even
> > > trying
> > > > to get compiled?  If it is not, why are you conditioning to preclude
> > > compilation
> > > > at this point??  Why not pull all mentions of Android?   .... and if you
> > want
> > > it
> > > > to "sort of compile" (?) then why are you putting in a #error?
> > > 
> > > FYI :)
> > > this was all added quite a while ago:
> > > https://chromiumcodereview.appspot.com/14645016
> > > 
> > > back then, myself and dmikirube needed to run deep-memory-profiler on
> android,
> > > which required TCMalloc.
> > > on android, we never used TCMalloc in any other scenario (production,
debug,
> > > etc...), except when explicitly building for DMProf.
> > > I suppose we could try to revert that entire patch by now that there are
> > better
> > > memory profiling tools in place (and no plans for TCMalloc)?
> > > 
> > > there were a few other ones too if we want to pull all android-related
> changes
> > > that were made at that time..
> > 
> > The code you linked to appears to have more than just Android porting
code....
> > but I would argue that IF you are removing Android support for TCMalloc, you
> > should clean the code more thoroughly, and remove the resulting (now) dead
> code.
> >  At a minimum, any mention of "android" (in #if, etc.) should be removed.  
> > 
> > It is too easy to just leave dead code around.... and make the codebase
> > progressively less readable.
> 
> This intention of this CL is not actually to remove Android support for
TCMalloc
> compilation - the #error I added will only be triggered if ENABLE_PROFILING is
> defined (in the case when it is not, the EnvToXXX macros are null defined on
all
> platforms).  Thus, this will only break on Android if both the "profiling=1"
and
> "use_allocator=tcmalloc" gyp_defines are set, but will succeed if either one
or
> neither of them are set.
> 
> I'm happy to revert all the Android porting code from TCMalloc instead if
there
> are no plans to every use TCMalloc for any other reasons on Android though. 
> Would you prefer this even though Android support for TCMalloc would still be
> possible without the use of __system_properties_get?

Can you give an example where TCMalloc is used for Android?

In general, we don't land features into chrome that "might someday be used," and
we'd probably nuke a feature when we decide it is not to be used.  We always
have revision history to look at if we "want to go back."

Powered by Google App Engine
This is Rietveld 408576698