dropped unused and unsupported synchronization profiling facility

Spinlock usage of cycle counter is due do tracking of time it's spent
waiting for lock. But this tracking is only useful we actually have
synchronization profiling working, which dont have. Thus I'm dropping
calls to this facility with eye towards further removal of cycle clock
usage.
This commit is contained in:
Aliaksey Kandratsenka 2015-09-29 11:43:09 -07:00 committed by Aliaksey Kandratsenka
parent 3a054d37c1
commit d7fdc3fc9d
3 changed files with 0 additions and 71 deletions

View File

@ -239,7 +239,6 @@ SPINLOCK_INCLUDES = src/base/spinlock.h \
src/base/spinlock_win32-inl.h \ src/base/spinlock_win32-inl.h \
src/base/spinlock_linux-inl.h \ src/base/spinlock_linux-inl.h \
src/base/spinlock_posix-inl.h \ src/base/spinlock_posix-inl.h \
src/base/synchronization_profiling.h \
src/base/atomicops-internals-macosx.h \ src/base/atomicops-internals-macosx.h \
src/base/atomicops-internals-linuxppc.h \ src/base/atomicops-internals-linuxppc.h \
src/base/atomicops-internals-arm-generic.h \ src/base/atomicops-internals-arm-generic.h \

View File

@ -34,7 +34,6 @@
#include <config.h> #include <config.h>
#include "base/spinlock.h" #include "base/spinlock.h"
#include "base/synchronization_profiling.h"
#include "base/spinlock_internal.h" #include "base/spinlock_internal.h"
#include "base/cycleclock.h" #include "base/cycleclock.h"
#include "base/sysinfo.h" /* for NumCPUs() */ #include "base/sysinfo.h" /* for NumCPUs() */
@ -151,24 +150,6 @@ enum { PROFILE_TIMESTAMP_SHIFT = 7 };
void SpinLock::SlowUnlock(uint64 wait_cycles) { void SpinLock::SlowUnlock(uint64 wait_cycles) {
base::internal::SpinLockWake(&lockword_, false); // wake waiter if necessary base::internal::SpinLockWake(&lockword_, false); // wake waiter if necessary
// Collect contentionz profile info, expanding the wait_cycles back out to
// the full value. If wait_cycles is <= kSpinLockSleeper, then no wait
// was actually performed, so don't record the wait time. Note, that the
// CalculateWaitCycles method adds in kSpinLockSleeper cycles
// unconditionally to guarantee the wait time is not kSpinLockFree or
// kSpinLockHeld. The adding in of these small number of cycles may
// overestimate the contention by a slight amount 50% of the time. However,
// if this code tried to correct for that addition by subtracting out the
// kSpinLockSleeper amount that would underestimate the contention slightly
// 50% of the time. Both ways get the wrong answer, so the code
// overestimates to be more conservative. Overestimating also makes the code
// a little simpler.
//
if (wait_cycles > kSpinLockSleeper) {
base::SubmitSpinLockProfileData(this,
wait_cycles << PROFILE_TIMESTAMP_SHIFT);
}
} }
inline int32 SpinLock::CalculateWaitCycles(int64 wait_start_time) { inline int32 SpinLock::CalculateWaitCycles(int64 wait_start_time) {

View File

@ -1,51 +0,0 @@
// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*-
/* Copyright (c) 2010, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ---
* Author: Chris Ruemmler
*/
#ifndef BASE_AUXILIARY_SYNCHRONIZATION_PROFILING_H_
#define BASE_AUXILIARY_SYNCHRONIZATION_PROFILING_H_
#include "base/basictypes.h"
namespace base {
// We can do contention-profiling of SpinLocks, but the code is in
// mutex.cc, which is not always linked in with spinlock. Hence we
// provide a weak definition, which are used if mutex.cc isn't linked in.
// Submit the number of cycles the spinlock spent contending.
ATTRIBUTE_WEAK extern void SubmitSpinLockProfileData(const void *, int64);
extern void SubmitSpinLockProfileData(const void *contendedlock,
int64 wait_cycles) {}
}
#endif // BASE_AUXILIARY_SYNCHRONIZATION_PROFILING_H_