summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAliaksey Kandratsenka <alk@tut.by>2015-09-29 11:43:09 -0700
committerAliaksey Kandratsenka <alkondratenko@gmail.com>2015-10-05 20:56:28 -0700
commitd7fdc3fc9ddc0937eb7961b1d8c864cc8182f0d9 (patch)
tree90631da9a25aa69afddcdac3365adb3724739a9b
parent3a054d37c1f5323462bd77f55be02c5b0d764611 (diff)
downloadgperftools-d7fdc3fc9ddc0937eb7961b1d8c864cc8182f0d9.tar.gz
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.
-rwxr-xr-xMakefile.am1
-rw-r--r--src/base/spinlock.cc19
-rw-r--r--src/base/synchronization_profiling.h51
3 files changed, 0 insertions, 71 deletions
diff --git a/Makefile.am b/Makefile.am
index 6fed874..ce40ecd 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -239,7 +239,6 @@ SPINLOCK_INCLUDES = src/base/spinlock.h \
src/base/spinlock_win32-inl.h \
src/base/spinlock_linux-inl.h \
src/base/spinlock_posix-inl.h \
- src/base/synchronization_profiling.h \
src/base/atomicops-internals-macosx.h \
src/base/atomicops-internals-linuxppc.h \
src/base/atomicops-internals-arm-generic.h \
diff --git a/src/base/spinlock.cc b/src/base/spinlock.cc
index 088785f..bee82f0 100644
--- a/src/base/spinlock.cc
+++ b/src/base/spinlock.cc
@@ -34,7 +34,6 @@
#include <config.h>
#include "base/spinlock.h"
-#include "base/synchronization_profiling.h"
#include "base/spinlock_internal.h"
#include "base/cycleclock.h"
#include "base/sysinfo.h" /* for NumCPUs() */
@@ -151,24 +150,6 @@ enum { PROFILE_TIMESTAMP_SHIFT = 7 };
void SpinLock::SlowUnlock(uint64 wait_cycles) {
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) {
diff --git a/src/base/synchronization_profiling.h b/src/base/synchronization_profiling.h
deleted file mode 100644
index b495034..0000000
--- a/src/base/synchronization_profiling.h
+++ /dev/null
@@ -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_