summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorhunt <hunt>2005-10-18 04:34:05 +0000
committerhunt <hunt>2005-10-18 04:34:05 +0000
commit1eb8c9ca274c82762a357cf1e7641b113bceb16c (patch)
tree485b9c2f24100057eacff7073f7aa48608174230 /runtime
parent75eaeba72745c796c3d3ab0374b9f301ad7aae33 (diff)
downloadsystemtap-steved-1eb8c9ca274c82762a357cf1e7641b113bceb16c.tar.gz
systemtap-steved-1eb8c9ca274c82762a357cf1e7641b113bceb16c.tar.xz
systemtap-steved-1eb8c9ca274c82762a357cf1e7641b113bceb16c.zip
2005-10-17 Martin Hunt <hunt@redhat.com>
* transport.c (_stp_handle_start): Grab semaphore before calling probe_start() and release after it is done. (_stp_handle_exit): Ditto for exiting. This prevents exiting before probe_start() is finished.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/transport/ChangeLog7
-rw-r--r--runtime/transport/transport.c8
2 files changed, 15 insertions, 0 deletions
diff --git a/runtime/transport/ChangeLog b/runtime/transport/ChangeLog
index f2a8c54d..62baa416 100644
--- a/runtime/transport/ChangeLog
+++ b/runtime/transport/ChangeLog
@@ -1,3 +1,10 @@
+2005-10-17 Martin Hunt <hunt@redhat.com>
+
+ * transport.c (_stp_handle_start): Grab semaphore before
+ calling probe_start() and release after it is done.
+ (_stp_handle_exit): Ditto for exiting. This prevents
+ exiting before probe_start() is finished.
+
2005-10-14 Tom Zanussi <zanussi@us.ibm.com>
* relayfs.h: Add ifdef'ed relayfs_fs.h include for mainline
diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c
index 89c90c96..36d5fc5a 100644
--- a/runtime/transport/transport.c
+++ b/runtime/transport/transport.c
@@ -19,6 +19,8 @@ static struct rchan *_stp_chan;
static struct dentry *_stp_dir;
#endif
+static DECLARE_MUTEX(_stp_start_mutex);
+
static int _stp_dpid;
static int _stp_pid;
@@ -95,7 +97,11 @@ static void _stp_handle_buf_info(int *cpuptr)
void _stp_handle_start (struct transport_start *st)
{
kbug ("stp_handle_start pid=%d\n", st->pid);
+
+ down (&_stp_start_mutex);
st->pid = probe_start();
+ up (&_stp_start_mutex);
+
if (st->pid < 0)
_stp_exit_called = 1;
_stp_transport_send(STP_START, st, sizeof(*st));
@@ -140,7 +146,9 @@ static void _stp_cleanup_and_exit (int closing)
*/
static void _stp_handle_exit (void *data)
{
+ down (&_stp_start_mutex);
_stp_cleanup_and_exit(0);
+ up (&_stp_start_mutex);
}
/**