Does anyone use tcmalloc's debugging envvars?

542 views
Skip to first unread message

Nico Weber

unread,
May 14, 2014, 9:50:20 AM5/14/14
to Chromium-dev
Hi,

tcmalloc contains a bunch of flags that are defined like

  DEFINE_int32(verbose, EnvToInt("PERFTOOLS_VERBOSE", 0), "Verbose description.");

where EnvToFoo is defined as

  #define EnvToInt(envname, dflt) \
    (!getenv(envname) ? (dflt) : strtol(getenv(envname), NULL, 10))

So ever one of these flags add a static initializer. My guess is that nobody ever uses any of tcmalloc's debug env vars, so I'd like to change EnvToFoo in tcmalloc/chromium to just always evaluate to `dftl`.

If you do use tcmalloc's debugging envvars, shout, then I'd make EnvToFoo use the env conditionally on some define and add a gyp define to set that define – then you can set that define for your things, but prod builds won't get these initializers.

Thanks,
Nico

Dai Mikurube

unread,
May 14, 2014, 10:17:11 AM5/14/14
to Nico Weber, Chromium-dev
Deep Memory Profiler actually depends on some of these envvars: HEAPPROFILE, HEAP_PROFILE_TIME_INTERVAL, HEAP_PROFILE_MMAP and DEEP_HEAP_PROFILE... http://dev.chromium.org/developers/deep-memory-profiler

I guess some other profiling features may be using them.


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev



--
Dai MIKURUBE

Nico Weber

unread,
May 14, 2014, 10:24:06 AM5/14/14
to Dai Mikurube, Chromium-dev
Does DMP set some preprocessor define?

William Chan (陈智昌)

unread,
May 14, 2014, 10:31:40 AM5/14/14
to Nico Weber, Dai Mikurube, Chromium-dev
I've used the environment variables before. Not the first one you mentioned, but some of the others that Dai did. Specifically, I use the ones for profiling, which gets enabled using the profiling gyp flag. So you might just use that gyp flag for the relevant environment variables.

Dai Mikurube

unread,
May 14, 2014, 10:42:05 AM5/14/14
to William Chan (陈智昌), Nico Weber, Chromium-dev
DMP depends on tcmalloc's heap-profiler which is started with the envvars (in third_party/tcmalloc/chromium/src/heap-profiler.cc and deep-heap-profile.cc).  DMP also depends on the 'profiling' gyp flag. So, yes, it'd be okay if it's turned on when 'profiling=1'.
--
Dai MIKURUBE

Nico Weber

unread,
May 14, 2014, 10:45:12 AM5/14/14
to Dai Mikurube, William Chan (陈智昌), Chromium-dev
Reply all
Reply to author
Forward
0 new messages