From: David Smith Date: Thu, 18 Jun 2009 18:09:31 +0000 (-0500) Subject: Enabled overwrite processing on original transports. X-Git-Tag: release-0.9.9~137^2~8 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=24a5e9a6a87b2f7c8b7264ceb94c65a3a9550d47;p=systemtap.git Enabled overwrite processing on original transports. * runtime/transport/relay_v2.c (_stp_transport_data_fs_overwrite): Renamed from stp_relay_set_overwrite(). * runtime/transport/relayfs.c (stp_relay_set_overwrite): Ditto. * runtime/transport/ring_buffer.c (_stp_transport_data_fs_overwrite): New place holder function. * runtime/transport/transport.c (_stp_detach): Calls _stp_transport_data_fs_overwrite(). (_stp_attach): Calls _stp_transport_data_fs_overwrite(). * runtime/transport/transport.h: Added prototype for _stp_transport_data_fs_overwrite(). --- diff --git a/runtime/transport/relay_v2.c b/runtime/transport/relay_v2.c index 246c4965d..aa6f7b997 100644 --- a/runtime/transport/relay_v2.c +++ b/runtime/transport/relay_v2.c @@ -147,7 +147,7 @@ static void __stp_relay_timer_init(void) smp_mb(); } -static void stp_relay_set_overwrite(int overwrite) +static void _stp_transport_data_fs_overwrite(int overwrite) { _stp_relay_data.overwrite_flag = overwrite; } diff --git a/runtime/transport/relayfs.c b/runtime/transport/relayfs.c index 191b932f1..c557efbc2 100644 --- a/runtime/transport/relayfs.c +++ b/runtime/transport/relayfs.c @@ -136,7 +136,7 @@ err: return rc; } -static void stp_relay_set_overwrite(int overwrite) +static void _stp_transport_data_fs_overwrite(int overwrite) { _stp_relay_data.rchan->overwrite = overwrite; } diff --git a/runtime/transport/ring_buffer.c b/runtime/transport/ring_buffer.c index bed441e55..45ad8e2b8 100644 --- a/runtime/transport/ring_buffer.c +++ b/runtime/transport/ring_buffer.c @@ -448,3 +448,7 @@ static void _stp_transport_data_fs_close(void) __stp_free_ring_buffer(); } +static void _stp_transport_data_fs_overwrite(int overwrite) +{ + /* FIXME: Just a place holder for now. */ +} diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c index 84959f716..a1d90dcff 100644 --- a/runtime/transport/transport.c +++ b/runtime/transport/transport.c @@ -20,13 +20,6 @@ #include #include -#if 0 -static void utt_set_overwrite(int overwrite) -{ - return; -} -#endif - static int _stp_exit_flag = 0; static uid_t _stp_uid = 0; @@ -166,10 +159,8 @@ static void _stp_detach(void) _stp_ctl_attached = 0; _stp_pid = 0; -#if 0 if (!_stp_exit_flag) - utt_set_overwrite(1); -#endif + _stp_transport_data_fs_overwrite(1); cancel_delayed_work(&_stp_work); wake_up_interruptible(&_stp_ctl_wq); @@ -183,9 +174,7 @@ static void _stp_attach(void) dbug_trans(1, "attach\n"); _stp_ctl_attached = 1; _stp_pid = current->pid; -#if 0 - utt_set_overwrite(0); -#endif + _stp_transport_data_fs_overwrite(0); queue_delayed_work(_stp_wq, &_stp_work, STP_WORK_TIMER); } diff --git a/runtime/transport/transport.h b/runtime/transport/transport.h index df2d496d1..b3d15ef31 100644 --- a/runtime/transport/transport.h +++ b/runtime/transport/transport.h @@ -11,19 +11,11 @@ /* amount of data a print can send. */ #define STP_BUFFER_SIZE 8192 -struct utt_trace; - static int _stp_ctl_write(int type, void *data, unsigned len); static int _stp_transport_init(void); static void _stp_transport_close(void); -static inline void *utt_reserve(struct utt_trace *utt, size_t length) -{ - return NULL; -} - - /* STP_CTL_BUFFER_SIZE is the maximum size of a message */ /* exchanged on the control channel. */ #if STP_TRANSPORT_VERSION == 1 @@ -96,6 +88,15 @@ static void _stp_transport_data_fs_stop(void); */ static void _stp_transport_data_fs_close(void); +/* + * _stp_transport_data_fs_overwrite - set data overwrite mode + * overwrite: boolean + * + * When in overwrite mode and the transport buffers are full, older + * data gets overwritten. + */ +static void _stp_transport_data_fs_overwrite(int overwrite); + /* * _stp_data_write_reserve - reserve bytes * size_request: number of bytes to reserve