From 90f98cc36060df795f79379e512d151d0e7c74a4 Mon Sep 17 00:00:00 2001 From: dsmith Date: Wed, 28 Mar 2007 20:11:37 +0000 Subject: 2007-03-28 David Smith PR 2341 (partial fix) * elaborate.h (struct derived_probe): Added needs_global_locks() member function. Unless overridden, will return true indicating that this probe needs locks around global variable references. * tapsets.cxx (struct be_derived_probe): Added override of default needs_global_locks() returning false. begin/end probes don't need locks around global variables, since they aren't run concurrently with any other probes. * translate.cxx (c_unparser::emit_common_header): Updated probe_contents logic to match the logic in emit_probe. (c_unparser::emit_probe): Added whether the probe needs global variable locks to the probe string (that helps eliminate duplicate probes). The generated C changes based on whether or not global variable locks are needed, but the pass 2 output doesn't differ between a probe that needs global variable locks and one that doesn't. If the probe doesn't need global variable locks, doesn't output them. --- tapsets.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tapsets.cxx') diff --git a/tapsets.cxx b/tapsets.cxx index d05b548a..463cbf68 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -85,6 +85,10 @@ struct be_derived_probe: public derived_probe static inline bool comp(be_derived_probe const *a, be_derived_probe const *b) { return a->priority < b->priority; } + + bool needs_global_locks () { return false; } + // begin/end probes don't need locks around global variables, since + // they aren't run concurrently with any other probes }; -- cgit