Removed multiple buffer functionality
authorVasiliy Ulyanov <v.ulyanov@samsung.com>
Mon, 10 Dec 2012 09:42:37 +0000 (13:42 +0400)
committerVasiliy Ulyanov <v.ulyanov@samsung.com>
Mon, 10 Dec 2012 09:42:37 +0000 (13:42 +0400)
driver/Kbuild
driver/device_driver.c
driver/ec.c
driver/ec.h
driver/module.h
driver/storage.c
driver/storage.h

index 64d5a01..1a4ab38 100644 (file)
@@ -1,4 +1,4 @@
-EXTRA_CFLAGS := -I$(src)/../../common -I$(src)/../../profile -DEC_ARCH_$(ARCH) -D__DEBUG -D__DISABLE_RELAYFS $(memchecker) $(debug_opt) $(android_opt) $(slp_opt) $(android_app_opt) $(board_opt)
+EXTRA_CFLAGS := -I$(src)/../../common -I$(src)/../../profile -DEC_ARCH_$(ARCH) -D__DEBUG $(memchecker) $(debug_opt) $(android_opt) $(slp_opt) $(android_app_opt) $(board_opt)
 
 obj-m := swap_driver.o
 swap_driver-y := device_driver.o ec.o legacy.o module.o probes.o probes_manager.o storage.o us_proc_inst.o
index 26a2fa0..2cbd4b0 100644 (file)
@@ -286,17 +286,7 @@ static long device_ioctl (struct file *file UNUSED, unsigned int cmd, unsigned l
                {
                        static ec_info_t ec_info_copy;
                        int nIgnoredBytes = 0;
-#ifndef __DISABLE_RELAYFS
-                       struct rchan* pRelayChannel = NULL;
-                       struct rchan_buf *buf = NULL;
-                       unsigned int nNumOfSubbufs = 0;
-                       void* pConsume = NULL;
-                       unsigned int nPaddingLength = 0;
-                       unsigned int nSubbufSize = 0;
-                       unsigned int nDataSize = 0;
-                       unsigned int nEffectSize = 0;
-                       unsigned int nSubbufDiscardedCount = 0;
-#endif
+
                        nIgnoredBytes = copy_from_user (&ec_info_copy, (ec_info_t *) arg, sizeof (ec_info_t));
                        if(nIgnoredBytes > 0)
                        {
@@ -306,44 +296,18 @@ static long device_ioctl (struct file *file UNUSED, unsigned int cmd, unsigned l
                        }
 
                        spin_lock_irqsave (&ec_spinlock, spinlock_flags);
-                       if((ec_info_copy.m_nMode & MODEMASK_MULTIPLE_BUFFER) == 0) {
-                               // Original buffer
-                               if(ec_info.after_last > ec_info.first) {
-                                       ec_info.buffer_effect = ec_info.buffer_size;
-                               }
-                               if (ec_info.after_last == ec_info.buffer_effect) {
-                                    ec_info.first = 0;
-                               } else {
-                                    ec_info.first = ec_info_copy.after_last;
-                               }
-                               ec_info.trace_size = ec_info.trace_size - ec_info_copy.trace_size;
 
+                       // Original buffer
+                       if(ec_info.after_last > ec_info.first) {
+                               ec_info.buffer_effect = ec_info.buffer_size;
+                       }
+                       if (ec_info.after_last == ec_info.buffer_effect) {
+                                ec_info.first = 0;
                        } else {
-                               // Relay FS buffer
-#ifndef __DISABLE_RELAYFS
-                               pRelayChannel = GetRelayChannel();
-                               if(pRelayChannel == NULL) {
-                                       EPRINTF("Null pointer to relay channel!");
-                                       result = -1;
-                                       break;
-                               }
-                               buf = pRelayChannel->buf[0];
-                               nNumOfSubbufs = pRelayChannel->n_subbufs;
-
-                               nSubbufSize = pRelayChannel->subbuf_size;
-                               pConsume = buf->start + buf->subbufs_consumed % nNumOfSubbufs * nSubbufSize;
-                               memcpy(&nPaddingLength, pConsume, sizeof(unsigned int));
-                               memcpy(&nSubbufDiscardedCount, pConsume + sizeof(unsigned int), sizeof(unsigned int));
-                               nEffectSize = nSubbufSize - nPaddingLength;
-                               nDataSize = nEffectSize - RELAY_SUBBUF_HEADER_SIZE;
-                               relay_subbufs_consumed(pRelayChannel, 0, 1);
-                               ec_info.m_nBeginSubbufNum = buf->subbufs_consumed % nNumOfSubbufs;
-                               ec_info.m_nEndSubbufNum = buf->subbufs_produced % nNumOfSubbufs;
-                               ec_info.buffer_effect -= nEffectSize;
-                               ec_info.trace_size -= nDataSize;
-                               buf->dentry->d_inode->i_size = ec_info.trace_size;
-#endif
+                                ec_info.first = ec_info_copy.after_last;
                        }
+                       ec_info.trace_size = ec_info.trace_size - ec_info_copy.trace_size;
+
                        spin_unlock_irqrestore (&ec_spinlock, spinlock_flags);
                        result = 0;
 //                     DPRINTF("Consume Buffer"); // Frequent call
index 154dd2f..64c9125 100644 (file)
@@ -25,8 +25,6 @@ ec_info_t ec_info = {
        .m_nMode = 0L,
        .buffer_size = EC_BUFFER_SIZE_DEFAULT,
        .ignored_events_count = 0,
-       .m_nNumOfSubbuffers = 0,
-       .m_nSubbufSize = DEFAULT_SUBBUF_SIZE,
 };
 
 ////////////////////////////////////////////////////////////////////////////////////////////
@@ -63,10 +61,6 @@ void reset_ec_info_nolock(void)
        ec_info.discarded_events_count = 0;
        ec_info.collision_count = 0;
        ec_info.lost_events_count = 0;
-       ec_info.m_nBeginSubbufNum = 0;
-       ec_info.m_nEndSubbufNum = 0;
-       ec_info.m_nEndOffset = 0;
-       ec_info.m_nSubbufSavedEvents = 0;
 }
 
 void ResetECInfo(void) {
@@ -90,24 +84,11 @@ void CleanECInfo(void) {
 
 int IsECMode(unsigned long nMask) { return ((ec_info.m_nMode & nMask) != 0); }
 
-int IsMultipleBuffer() { return IsECMode(MODEMASK_MULTIPLE_BUFFER); }
-
 int IsContinuousRetrieval() { return IsECMode(MODEMASK_CONTINUOUS_RETRIEVAL); }
 
 int SetECMode(unsigned long nECMode) {
        unsigned long spinlock_flags = 0L;
 
-       if((nECMode & MODEMASK_MULTIPLE_BUFFER) != 0) {
-               if(EnableMultipleBuffer() == -1) {
-                       EPRINTF("Cannot enable multiple buffer!");
-                       return -1;
-               }
-       } else {
-               if(DisableMultipleBuffer() == -1) {
-                       EPRINTF("Cannot disable multiple buffer!");
-                       return -1;
-               }
-       }
        if((nECMode & MODEMASK_CONTINUOUS_RETRIEVAL) != 0) {
                if(EnableContinuousRetrieval() == -1) {
                        EPRINTF("Cannot enable continuous retrieval!");
@@ -145,13 +126,6 @@ int is_java_inst_enabled(void)
        return !!(GetECMode() & MODEMASK_JAVA_INST);
 }
 
-unsigned int GetNumOfSubbuffers(unsigned long nBufferSize)
-{
-       if(nBufferSize % ec_info.m_nSubbufSize > 0)
-            EPRINTF("The buffer size is not divisible by a subbuffer size! (nBufferSize = %lu, ec_info.m_nSubbufSize = %u)", nBufferSize ,ec_info.m_nSubbufSize);
-       return nBufferSize / ec_info.m_nSubbufSize;
-};
-
 #if defined(__DEBUG)
 static UNUSED char * ec_state_name (ec_state_t ec_state)
 {
index e33a69c..4c1728e 100644 (file)
@@ -41,12 +41,10 @@ extern void reset_ec_info_nolock(void);
 extern void ResetECInfo(void);
 extern void CleanECInfo(void);
 extern int IsECMode(unsigned long nMask);
-extern int IsMultipleBuffer(void);
 extern int IsContinuousRetrieval(void);
 extern int SetECMode(unsigned long nECMode);
 extern unsigned long GetECMode(void);
 extern int is_java_inst_enabled(void);
-extern unsigned int GetNumOfSubbuffers(unsigned long nBufferSize);
 extern struct timeval last_attach_time;
 extern int paused;
 
index 8439d35..da0ffee 100644 (file)
 #include <linux/cdev.h>
 #include <linux/jiffies.h>
 #include <linux/time.h>
-#include <linux/proc_fs.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14))
-#ifndef __DISABLE_RELAYFS
-#define __DISABLE_RELAYFS
-#warning "RELAY FS was disabled since not supported!"
-#endif // __DISABLE_RELAYFS
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) & LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17))
-#include <linux/debugfs.h>
-#include <linux/relayfs_fs.h>
-#else
-#include <linux/debugfs.h>
-#include <linux/relay.h>
-#endif
 
 #include "events.h"
 
index a0dc1e7..92699c5 100644 (file)
@@ -261,19 +261,14 @@ int AllocateSingleBuffer(unsigned int nSize)
 {
        unsigned long spinlock_flags = 0L;
 
-       unsigned int nSubbufferSize = ec_info.m_nSubbufSize;
-       unsigned int nNumOfSubbufers = GetNumOfSubbuffers(nSize);
-       unsigned long nAllocatedSize = nSubbufferSize * nNumOfSubbufers;
-
-       p_buffer = vmalloc_user(nAllocatedSize);
+       p_buffer = vmalloc_user(nSize);
        if(!p_buffer) {
-               EPRINTF("Memory allocation error! [Size=%lu KB]", nAllocatedSize / 1024);
+               EPRINTF("Memory allocation error! [Size=%lu KB]", nSize / 1024);
                return -1;
        }
 
        spin_lock_irqsave (&ec_spinlock, spinlock_flags);
-       ec_info.m_nNumOfSubbuffers = nNumOfSubbufers;
-       ec_info.buffer_effect = ec_info.buffer_size = nAllocatedSize;
+       ec_info.buffer_effect = ec_info.buffer_size = nSize;
        spin_unlock_irqrestore (&ec_spinlock, spinlock_flags);
 
        return 0;
@@ -309,374 +304,15 @@ int DisableContinuousRetrieval() {
 
 //////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifndef __DISABLE_RELAYFS
-
-struct rchan* gl_pRelayChannel = NULL;
-struct rchan* GetRelayChannel(void) { return gl_pRelayChannel; };
-
-struct dentry* gl_pdirRelay = NULL;
-struct dentry* GetRelayDir(void) { return gl_pdirRelay; };
-
-#ifdef __USE_PROCFS
-
-struct proc_dir_entry* alt_pde = NULL;
-
-static inline struct dentry *_dir_create (const char *dirname, struct dentry *parent, struct proc_dir_entry **p2pde)
-{
-    struct dentry *dir;
-    struct proc_dir_entry *pde;
-
-    pde = proc_mkdir (dirname, PDE (parent->d_inode));
-    if (pde == NULL)
-    {
-        dir = NULL;
-    }
-    else
-    {
-        mutex_lock (&parent->d_inode->i_mutex);
-        dir = lookup_one_len (dirname, parent, strlen (dirname));
-        mutex_unlock (&parent->d_inode->i_mutex);
-
-        if (IS_ERR (dir))
-        {
-            dir = NULL;
-            remove_proc_entry (dirname, PDE (parent->d_inode));
-        }
-
-        *p2pde = pde;
-    }
-
-    return dir;
-}
-
-static inline struct dentry *_get_proc_root (void)
-{
-    struct file_system_type *procfs_type;
-    struct super_block *procfs_sb;
-
-    procfs_type = get_fs_type ("proc");
-
-    if (!procfs_type || list_empty (&procfs_type->fs_supers))
-        return NULL;
-
-    procfs_sb = list_entry (procfs_type->fs_supers.next, \
-        struct super_block, s_instances);
-
-    return procfs_sb->s_root;
-
-}
-
-static struct dentry *create_buf (const char *filename, struct dentry *parent, int mode, struct rchan_buf *buf, int *is_global)
-{
-    struct proc_dir_entry *pde;
-    struct proc_dir_entry *parent_pde = NULL;
-    struct dentry *dentry;
-
-    if (parent)
-        parent_pde = PDE (parent->d_inode);
-    else
-        parent = _get_proc_root ();
-
-    pde = create_proc_entry (filename, S_IFREG|S_IRUSR, parent_pde);
-
-    if(unlikely(!pde))
-        return NULL;
-
-    pde->proc_fops = &relay_file_operations;
-
-    mutex_lock (&parent->d_inode->i_mutex);
-    dentry = lookup_one_len (filename, parent, strlen (filename));
-    mutex_unlock (&parent->d_inode->i_mutex);
-
-    if (IS_ERR(dentry)) {
-        remove_proc_entry (filename, parent_pde);
-       }
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18))
-       dentry->d_inode->i_private = buf;
-#else
-       dentry->d_inode->u.generic_ip = buf;
-#endif
-
-    return dentry;
-
-}
-
-static int remove_buf (struct dentry *dentry)
-{
-    if (dentry != NULL)
-    {
-        struct proc_dir_entry *pde = PDE (dentry->d_inode);
-        dput (dentry);
-        remove_proc_entry (pde->name, pde->parent);
-    }
-
-    return 0;
-}
-
-#endif // __USE_PROCFS
-       /*
-          * subbuf_start - called on buffer-switch to a new sub-buffer
-          * @buf: the channel buffer containing the new sub-buffer
-          * @subbuf: the start of the new sub-buffer
-          * @prev_subbuf: the start of the previous sub-buffer
-          * @prev_padding: unused space at the end of previous sub-buffer
-          *
-          * The client should return 1 to continue logging, 0 to stop
-          * logging.
-          *
-          * NOTE: subbuf_start will also be invoked when the buffer is
-          *       created, so that the first sub-buffer can be initialized
-          *       if necessary.  In this case, prev_subbuf will be NULL.
-          *
-          * NOTE: the client can reserve bytes at the beginning of the new
-          *       sub-buffer by calling subbuf_start_reserve() in this callback.
-          */
-int RelayCallbackSubbufStart(struct rchan_buf *buf,
-                              void *subbuf,
-                              void *prev_subbuf,
-                              size_t prev_padding)
-{
-       struct rchan* pRelayChannel = NULL;
-       unsigned int nNumOfSubbufs = 0;
-
-       unsigned long spinlock_flags = 0L;
-       spin_lock_irqsave (&ec_spinlock, spinlock_flags);
-
-       subbuf_start_reserve(buf, RELAY_SUBBUF_HEADER_SIZE);
-       ec_info.buffer_effect += RELAY_SUBBUF_HEADER_SIZE;
-       ec_info.m_nEndOffset = RELAY_SUBBUF_HEADER_SIZE;
-
-       if(prev_subbuf == NULL) {
-               spin_unlock_irqrestore (&ec_spinlock, spinlock_flags);
-               return 1;
-       }
-       memcpy(prev_subbuf, &prev_padding, sizeof(unsigned int));
-       memcpy(prev_subbuf + sizeof(unsigned int), &ec_info.m_nSubbufSavedEvents, sizeof(unsigned int));
-       ec_info.m_nSubbufSavedEvents = 0;
-       pRelayChannel = GetRelayChannel();
-       if(pRelayChannel == NULL) {
-               spin_unlock_irqrestore (&ec_spinlock, spinlock_flags);
-               EPRINTF("Null pointer to relay channel!");
-               return 0;
-       }
-       nNumOfSubbufs = pRelayChannel->n_subbufs;
-       ec_info.m_nBeginSubbufNum = buf->subbufs_consumed % nNumOfSubbufs;
-       ec_info.m_nEndSubbufNum = buf->subbufs_produced % nNumOfSubbufs;
-       if(relay_buf_full(buf)) {
-               void* pConsume = NULL;
-               unsigned int nPaddingLength = 0;
-               unsigned int nSubbufSize = 0;
-               unsigned int nDataSize = 0;
-               unsigned int nEffectSize = 0;
-               unsigned int nSubbufDiscardedCount = 0;
-               nSubbufSize = pRelayChannel->subbuf_size;
-               pConsume = buf->start + buf->subbufs_consumed % nNumOfSubbufs * nSubbufSize;
-               memcpy(&nPaddingLength, pConsume, sizeof(unsigned int));
-               memcpy(&nSubbufDiscardedCount, pConsume + sizeof(unsigned int), sizeof(unsigned int));
-               nEffectSize = nSubbufSize - nPaddingLength;
-               nDataSize = nEffectSize - RELAY_SUBBUF_HEADER_SIZE;
-               ec_info.discarded_events_count += nSubbufDiscardedCount;
-               relay_subbufs_consumed(pRelayChannel, 0, 1);
-               ec_info.m_nBeginSubbufNum = buf->subbufs_consumed % nNumOfSubbufs;
-               ec_info.m_nEndSubbufNum = buf->subbufs_produced % nNumOfSubbufs;
-               ec_info.buffer_effect -= nEffectSize;
-               ec_info.trace_size -= nDataSize;
-               buf->dentry->d_inode->i_size = ec_info.trace_size;
-               spin_unlock_irqrestore (&ec_spinlock, spinlock_flags);
-               return 1; // Overwrite mode
-       }
-       spin_unlock_irqrestore (&ec_spinlock, spinlock_flags);
-       return 1;
-}
-
-       /*
-          * buf_mapped - relay buffer mmap notification
-          * @buf: the channel buffer
-          * @filp: relay file pointer
-          *
-          * Called when a relay file is successfully mmapped
-          */
-void RelayCallbackBufMapped(struct rchan_buf *buf,
-                            struct file *filp)
-{
-}
-
-       /*
-          * buf_unmapped - relay buffer unmap notification
-          * @buf: the channel buffer
-          * @filp: relay file pointer
-          *
-          * Called when a relay file is successfully unmapped
-          */
-void RelayCallbackBufUnmapped(struct rchan_buf *buf,
-                             struct file *filp)
-{
-}
-       /*
-          * create_buf_file - create file to represent a relay channel buffer
-          * @filename: the name of the file to create
-          * @parent: the parent of the file to create
-          * @mode: the mode of the file to create
-          * @buf: the channel buffer
-          * @is_global: outparam - set non-zero if the buffer should be global
-          *
-          * Called during relay_open(), once for each per-cpu buffer,
-          * to allow the client to create a file to be used to
-          * represent the corresponding channel buffer.  If the file is
-          * created outside of relay, the parent must also exist in
-          * that filesystem.
-          *
-          * The callback should return the dentry of the file created
-          * to represent the relay buffer.
-          *
-          * Setting the is_global outparam to a non-zero value will
-          * cause relay_open() to create a single global buffer rather
-          * than the default set of per-cpu buffers.
-          *
-          * See Documentation/filesystems/relayfs.txt for more info.
-          */
-struct dentry * RelayCallbackCreateBufFile(const char *filename,
-                                           struct dentry *parent,
-                                           int mode,
-                                           struct rchan_buf *buf,
-                                           int *is_global)
-{
-       *is_global = 1;
-#ifdef __USE_PROCFS
-       DPRINTF("\"%s\" is creating in procfs...!", filename);
-       return create_buf(filename, parent, mode, buf, is_global);
-#else
-       DPRINTF("\"%s\" is creating in debugfs...!", filename);
-       return debugfs_create_file(filename, (mode_t)mode, parent, buf, &relay_file_operations);
-#endif // __USE_PROCFS
-}
-
-       /*
-          * remove_buf_file - remove file representing a relay channel buffer
-          * @dentry: the dentry of the file to remove
-          *
-          * Called during relay_close(), once for each per-cpu buffer,
-          * to allow the client to remove a file used to represent a
-          * channel buffer.
-          *
-          * The callback should return 0 if successful, negative if not.
-          */
-int RelayCallbackRemoveBufFile(struct dentry *dentry)
-{
-#ifdef __USE_PROCFS
-       remove_buf(dentry);
-#else
-       debugfs_remove(dentry);
-#endif // __USE_PROCFS
-       return 0;
-}
-
-struct rchan_callbacks gl_RelayCallbacks = {
-       .subbuf_start = RelayCallbackSubbufStart,
-       .buf_mapped = RelayCallbackBufMapped,
-       .buf_unmapped = RelayCallbackBufUnmapped,
-       .create_buf_file = RelayCallbackCreateBufFile,
-       .remove_buf_file = RelayCallbackRemoveBufFile
-};
-#endif //__DISABLE_RELAYFS
-
-int AllocateMultipleBuffer(unsigned int nSize) {
-#ifndef __DISABLE_RELAYFS
-       unsigned long spinlock_flags = 0L;
-
-       unsigned int nSubbufferSize = ec_info.m_nSubbufSize;
-       unsigned int nNumOfSubbufers = GetNumOfSubbuffers(nSize);
-
-       gl_pRelayChannel = relay_open(DEFAULT_RELAY_BASE_FILENAME,
-                                       GetRelayDir(),
-                                       nSubbufferSize,
-                                       nNumOfSubbufers,
-                                       &gl_RelayCallbacks
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18))
-                                       ,NULL
-#endif
-                                       );
-       if(gl_pRelayChannel == NULL) {
-               EPRINTF("Cannot create relay buffer channel! [%d subbufers by %u Kb = %u Kb]",
-                       nNumOfSubbufers, nSubbufferSize / 1024, nSize / 1024);
-               return -1;
-       }
-
-       spin_lock_irqsave (&ec_spinlock, spinlock_flags);
-       ec_info.m_nNumOfSubbuffers = nNumOfSubbufers;
-       ec_info.buffer_effect = ec_info.buffer_size = nSubbufferSize * nNumOfSubbufers;
-       spin_unlock_irqrestore (&ec_spinlock, spinlock_flags);
-
-       return 0;
-#else
-       EPRINTF("RelayFS not supported!");
-       return -1;
-#endif //__DISABLE_RELAYFS
-}
-
-void FreeMultipleBuffer(void) {
-#ifndef __DISABLE_RELAYFS
-       relay_close(gl_pRelayChannel);
-       CleanECInfo();
-#else
-       EPRINTF("RelayFS not supported!");
-#endif //__DISABLE_RELAYFS
-}
-
 int InitializeBuffer(unsigned int nSize) {
-       if(IsMultipleBuffer())
-               return AllocateMultipleBuffer(nSize);
        return AllocateSingleBuffer(nSize);
 }
 
 int UninitializeBuffer(void) {
-       if(IsMultipleBuffer())
-               FreeMultipleBuffer();
        FreeSingleBuffer();
        return 0;
 }
 
-int EnableMultipleBuffer() {
-       unsigned long spinlock_flags = 0L;
-
-       if(IsMultipleBuffer())
-               return 0;
-
-       if(UninitializeBuffer() == -1)
-               EPRINTF("Cannot uninitialize buffer!");
-
-       spin_lock_irqsave (&ec_spinlock, spinlock_flags);
-       ec_info.m_nMode |= MODEMASK_MULTIPLE_BUFFER;
-       spin_unlock_irqrestore (&ec_spinlock, spinlock_flags);
-
-       if(InitializeBuffer(GetBufferSize()) == -1) {
-               EPRINTF("Cannot initialize buffer!");
-               return -1;
-       }
-       return 0;
-}
-
-int DisableMultipleBuffer() {
-       unsigned long spinlock_flags = 0L;
-
-       if(!IsMultipleBuffer())
-               return 0;
-
-       if(UninitializeBuffer() == -1)
-               EPRINTF("Cannot uninitialize buffer!");
-
-       spin_lock_irqsave (&ec_spinlock, spinlock_flags);
-       ec_info.m_nMode &= ~MODEMASK_MULTIPLE_BUFFER;
-       spin_unlock_irqrestore (&ec_spinlock, spinlock_flags);
-
-       if(InitializeBuffer(GetBufferSize()) == -1) {
-               EPRINTF("Cannot initialize buffer!");
-               return -1;
-       }
-       return 0;
-}
-
 unsigned int GetBufferSize(void) { return ec_info.buffer_size; };
 
 int SetBufferSize(unsigned int nSize) {
@@ -716,14 +352,6 @@ int SetPid(unsigned int pid)
 void ResetSingleBuffer(void) {
 }
 
-void ResetMultipleBuffer(void) {
-#ifndef __DISABLE_RELAYFS
-       relay_reset(gl_pRelayChannel);
-#else
-       EPRINTF("RelayFS not supported!");
-#endif //__DISABLE_RELAYFS
-}
-
 int ResetBuffer(void) {
        unsigned long spinlock_flags = 0L;
 
@@ -732,10 +360,7 @@ int ResetBuffer(void) {
                return -1;
        }
 
-       if(IsMultipleBuffer())
-               ResetMultipleBuffer();
-       else
-               ResetSingleBuffer();
+       ResetSingleBuffer();
 
        detach_selected_probes ();
 
@@ -802,22 +427,6 @@ int WriteEventIntoSingleBuffer(char* pEvent, unsigned long nEventSize) {
        return 0;
 }
 
-int WriteEventIntoMultipleBuffer(char* pEvent, unsigned long nEventSize) {
-#ifndef __DISABLE_RELAYFS
-       unsigned long spinlock_flags = 0L;
-       __relay_write(GetRelayChannel(), pEvent, nEventSize);
-       ec_info.buffer_effect += nEventSize;
-       ec_info.trace_size += nEventSize;
-       ec_info.saved_events_count++;
-       ec_info.m_nEndOffset += nEventSize;
-       ec_info.m_nSubbufSavedEvents++;
-       return 0;
-#else
-       EPRINTF("RelayFS not supported!");
-       return -1;
-#endif //__DISABLE_RELAYFS
-}
-
 int WriteEventIntoBuffer(char* pEvent, unsigned long nEventSize) {
 
        /*unsigned long i;
@@ -825,8 +434,6 @@ int WriteEventIntoBuffer(char* pEvent, unsigned long nEventSize) {
                printk("%02X ", pEvent[i]);
        printk("\n");*/
 
-       if(IsMultipleBuffer())
-               return WriteEventIntoMultipleBuffer(pEvent, nEventSize);
        return WriteEventIntoSingleBuffer(pEvent, nEventSize);
 }
 
@@ -1460,28 +1067,8 @@ int storage_init (void)
 
        spin_lock_irqsave (&ec_spinlock, spinlock_flags);
        ec_info.m_nMode = 0; // MASK IS CLEAR (SINGLE NON_CONTINUOUS BUFFER)
-//     ec_info.m_nMode |= ECMODEMASK_MULTIPLE_BUFFER;
        spin_unlock_irqrestore (&ec_spinlock, spinlock_flags);
 
-#ifndef __DISABLE_RELAYFS
-
-#ifdef __USE_PROCFS
-       gl_pdirRelay = _dir_create (DEFAULT_RELAY_BASE_DIR, _get_proc_root(), &alt_pde);
-       if(gl_pdirRelay == NULL) {
-               EPRINTF("Cannot create procfs directory for relay buffer!");
-               return -1;
-       }
-#else
-       gl_pdirRelay = debugfs_create_dir(DEFAULT_RELAY_BASE_DIR, NULL);
-       if(gl_pdirRelay == NULL) {
-               EPRINTF("Cannot create directory for relay buffer!");
-               return -1;
-       }
-
-#endif // __USE_PROCFS
-
-#endif //__DISABLE_RELAYFS
-
        if(InitializeBuffer(EC_BUFFER_SIZE_DEFAULT) == -1) {
                EPRINTF("Cannot initialize buffer! [Size=%u KB]", EC_BUFFER_SIZE_DEFAULT / 1024 );
                return -1;
@@ -1504,16 +1091,6 @@ void storage_down (void)
        if(UninitializeBuffer() == -1)
                EPRINTF("Cannot uninitialize buffer!");
 
-#ifndef __DISABLE_RELAYFS
-
-#ifdef __USE_PROCFS
-//     remove_buf(gl_pdirRelay);
-#else
-       debugfs_remove(gl_pdirRelay);
-#endif // __USE_PROCFS
-
-#endif //__DISABLE_RELAYFS
-
        if (ec_info.collision_count)
                EPRINTF ("ec_info.collision_count=%d", ec_info.collision_count);
        if (ec_info.lost_events_count)
index e9fe0a4..baa8fb9 100644 (file)
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifndef __DISABLE_RELAYFS
-extern struct rchan* GetRelayChannel(void);
-extern struct dentry* GetRelayDir(void);
-#endif //__DISABLE_RELAYFS
-
-extern int EnableMultipleBuffer(void);
-extern int DisableMultipleBuffer(void);
 extern int EnableContinuousRetrieval(void);
 extern int DisableContinuousRetrieval(void);