trace: introduce lock cost estimator