Commit fec7a613 authored by ananta@chromium.org's avatar ananta@chromium.org

Reverting this to see if it fixes the redness on the ChromiumOS bots.

Revert 150135 - Enable memory profiler on Linux when TC_MALLOC is enabled.

Added a tc_malloc memory extension to get bytes allocated on
current thread (GetBytesAllocatedOnCurrentThread API call).

R=jam@chromium.org,jar@chromium.org
BUG=139667
TEST=test about:profiler after setting the env variable 
     CHROME_PROFILER_TIME=1. In about:profiler, it will
     show the memory allocated per thread. This change
     impacts linux only.

Review URL: https://chromiumcodereview.appspot.com/10820063

TBR=rtenneti@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10855010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150142 0039d316-1c4b-4281-b951-d872f2087c98
parent 2b49f843
......@@ -4,8 +4,6 @@
#include "content/public/app/content_main_runner.h"
#include <stdlib.h>
#include "base/allocator/allocator_extension.h"
#include "base/at_exit.h"
#include "base/command_line.h"
......@@ -19,7 +17,6 @@
#include "base/metrics/stats_table.h"
#include "base/path_service.h"
#include "base/process_util.h"
#include "base/profiler/alternate_timer.h"
#include "base/stringprintf.h"
#include "base/string_number_conversions.h"
#include "content/browser/browser_main.h"
......@@ -453,17 +450,6 @@ static void ReleaseFreeMemoryThunk() {
// On windows, we've already set these thunks up in _heap_init()
base::allocator::SetGetStatsFunction(GetStatsThunk);
base::allocator::SetReleaseFreeMemoryFunction(ReleaseFreeMemoryThunk);
// Provide optional hook for monitoring allocation quantities on a
// per-thread basis. Only set the hook if the environment indicates this
// needs to be enabled.
const char* profiling = getenv(tracked_objects::kAlternateProfilerTime);
if (profiling &&
(atoi(profiling) == tracked_objects::TIME_SOURCE_TYPE_TCMALLOC)) {
tracked_objects::SetAlternateTimeSource(
MallocExtension::GetBytesAllocatedOnCurrentThread,
tracked_objects::TIME_SOURCE_TYPE_TCMALLOC);
}
#endif
// On Android,
......
// Copyright (c) 2012, Google Inc.
// Copyright (c) 2005, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
......@@ -307,10 +307,6 @@ class PERFTOOLS_DLL_DECL MallocExtension {
// malloc implementation during initialization.
static void Register(MallocExtension* implementation);
// On the current thread, return the total number of bytes allocated.
// (Currently only implemented in tcmalloc.)
static unsigned int GetBytesAllocatedOnCurrentThread();
// Returns detailed information about malloc's freelists. For each list,
// return a FreeListInfo:
struct FreeListInfo {
......
// Copyright (c) 2012, Google Inc.
// Copyright (c) 2005, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
......@@ -50,7 +50,6 @@
#include "gperftools/malloc_extension.h"
#include "gperftools/malloc_extension_c.h"
#include "maybe_threads.h"
#include "thread_cache.h"
using STL_NAMESPACE::string;
using STL_NAMESPACE::vector;
......@@ -221,10 +220,6 @@ void MallocExtension::Register(MallocExtension* implementation) {
}
}
unsigned int MallocExtension::GetBytesAllocatedOnCurrentThread() {
return tcmalloc::ThreadCache::GetBytesAllocatedOnCurrentThread();
}
// -----------------------------------------------------------------------
// Heap sampling support
// -----------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment