Todd Lipcon has submitted this change and it was merged.

Change subject: Add metrics for tcmalloc spinlock contention
......................................................................


Add metrics for tcmalloc spinlock contention

tcmalloc uses a similar spinlock implementation to ours and supports reporting
contention metrics using the same weak symbol scheme. We previously did not
hook up tcmalloc's contention profiling to our own method due to a reentrancy
issue: tcmalloc can hit contention while it holds a heap-wide lock, which then
causes a deadlock if the profiling mechanism allocates memory.

This patch hooks it up to a very light-weight (allocation-free) profiling path
which adds the contention as a trace metric and a global counter metric. The
trace metric is slightly hacky since we can't safely use std::map in a context
where allocation is disallowed, but I think this metric is valuable enough to
be worth the hack.

Change-Id: I2f6ed322541b161e6d9e347e0d75e62d1b6b05ec
Reviewed-on: http://gerrit.cloudera.org:8080/3007
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <[email protected]>
---
M src/kudu/util/spinlock_profiling-test.cc
M src/kudu/util/spinlock_profiling.cc
M src/kudu/util/spinlock_profiling.h
M src/kudu/util/trace_metrics.h
4 files changed, 78 insertions(+), 3 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Kudu Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/3007
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2f6ed322541b161e6d9e347e0d75e62d1b6b05ec
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to