summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-02-23 15:10:13 -0800
committerJosh Stone <jistone@redhat.com>2009-02-23 15:10:13 -0800
commit7b6e55916c072b5e2496635a8c43711d7cba821d (patch)
tree7fb433132a0b310637ccfbb8d6d7f7a96f5579b0 /runtime
parent9e67aff9f4c269e0a56524c3f2fafaf8e038bda7 (diff)
parentbf2a0399419306bf26cd57236822c51be893dfb0 (diff)
downloadsystemtap-steved-7b6e55916c072b5e2496635a8c43711d7cba821d.tar.gz
systemtap-steved-7b6e55916c072b5e2496635a8c43711d7cba821d.tar.xz
systemtap-steved-7b6e55916c072b5e2496635a8c43711d7cba821d.zip
Merge branch 'gtod'
Diffstat (limited to 'runtime')
-rw-r--r--runtime/time.c8
-rw-r--r--runtime/transport/transport.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/runtime/time.c b/runtime/time.c
index ad7cef9d..58c23e57 100644
--- a/runtime/time.c
+++ b/runtime/time.c
@@ -223,6 +223,7 @@ _stp_kill_time(void)
#endif
_stp_free_percpu(stp_time);
+ stp_time = NULL;
}
}
@@ -232,6 +233,8 @@ _stp_init_time(void)
{
int ret = 0;
+ _stp_kill_time();
+
stp_time = _stp_alloc_percpu(sizeof(stp_time_t));
if (unlikely(stp_time == 0))
return -1;
@@ -263,7 +266,7 @@ _stp_init_time(void)
}
}
#endif
- if (ret)
+ if (ret)
_stp_kill_time();
return ret;
}
@@ -278,6 +281,9 @@ _stp_gettimeofday_ns(void)
stp_time_t *time;
int i = 0;
+ if (!stp_time)
+ return -1;
+
preempt_disable();
time = per_cpu_ptr(stp_time, smp_processor_id());
diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c
index 0755781e..7fcebd42 100644
--- a/runtime/transport/transport.c
+++ b/runtime/transport/transport.c
@@ -188,7 +188,6 @@ static void _stp_transport_close()
_stp_unregister_ctl_channel();
if (_stp_utt)
utt_trace_remove(_stp_utt);
- _stp_kill_time(); /* Go to a beach. Drink a beer. */
_stp_print_cleanup(); /* free print buffers */
_stp_mem_debug_done();
dbug_trans(1, "---- CLOSED ----\n");
@@ -244,10 +243,6 @@ static int _stp_transport_init(void)
dbug_trans(1, "Using %d subbufs of size %d\n", _stp_nsubbufs, _stp_subbuf_size);
}
- /* initialize timer code */
- if (_stp_init_time())
- return -1;
-
#if !defined (STP_OLD_TRANSPORT) || defined (STP_BULKMODE)
/* open utt (relayfs) channel to send data to userspace */
_stp_utt = _stp_utt_open();
@@ -286,7 +281,6 @@ err1:
if (_stp_utt)
utt_trace_remove(_stp_utt);
err0:
- _stp_kill_time();
return -1;
}