eina evlog - remove stolen count - unecessary
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sun, 10 May 2015 13:27:37 +0000 (22:27 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sun, 10 May 2015 13:27:37 +0000 (22:27 +0900)
src/bin/efl/efl_debugd.c
src/lib/eina/eina_debug_monitor.c
src/lib/eina/eina_evlog.c
src/lib/eina/eina_evlog.h

index 3cfe65d..c4a5e5a 100644 (file)
@@ -145,7 +145,6 @@ _do(Client *c, char *op, unsigned char *d, int size)
    else if (!strcmp(op, "EVLG"))
      {
 //        unsigned int *overflow = (unsigned int *)(d + 0);
-//        unsigned int *stolen = (unsigned int *)(d + 4);
         unsigned char *end = d + size;
         unsigned char *p = d + 8;
         char *event_str, *detail_str;
index c06d5e9..0ed6a05 100644 (file)
@@ -194,18 +194,16 @@ _eina_debug_monitor(void *data EINA_UNUSED)
                        Eina_Evlog_Buf *evlog = eina_evlog_steal();
                        if ((evlog) && (evlog->buf))
                          {
-                            char          tmp[16];
+                            char          tmp[12];
                             unsigned int *size     = (unsigned int *)(tmp + 0);
                             char         *op2 = "EVLG";
                             unsigned int *overflow = (unsigned int *)(tmp + 8);
-                            unsigned int *stolen   = (unsigned int *)(tmp + 12);
 
                             *size = (sizeof(tmp) - 4) + evlog->top;
                             memcpy(tmp + 4, op2, 4);
                             *overflow = evlog->overflow;
-                            *stolen = evlog->stolen;
                             write(_eina_debug_monitor_service_fd,
-                                  tmp, 16);
+                                  tmp, sizeof(tmp));
                             write(_eina_debug_monitor_service_fd,
                                   evlog->buf, evlog->top);
                          }
index 4703c96..f476e69 100644 (file)
@@ -42,7 +42,6 @@ alloc_buf(Eina_Evlog_Buf *b, unsigned int size)
    b->buf = malloc(size);
 # endif
    b->overflow = 0;
-   b->stolen = 0;
 }
 
 static void
@@ -127,15 +126,15 @@ eina_evlog_steal(void)
      {
         buf = &(buffers[1]);
         buf->top = 0;
+        buf->overflow--;
         stolen = &(buffers[0]);
-        stolen->stolen++;
      }
    else
      {
         buf = &(buffers[0]);
         buf->top = 0;
+        buf->overflow--;
         stolen = &(buffers[1]);
-        stolen->stolen++;
      }
    eina_spinlock_release(&_evlog_lock);
    return stolen;
index 82a8dd6..51e2b02 100644 (file)
@@ -31,8 +31,7 @@ struct _Eina_Evlog_Buf
    unsigned char *buf; // current buffer we fill with event logs
    unsigned int size; // the max size of the evlog buffer
    unsigned int top; // the current top byte for a new evlog item
-   unsigned int overflow; // how many times this biffer has overflown
-   unsigned int stolen; // how many times this buffer has been stolen
+   unsigned int overflow; // how many times this buffer has overflown
 };
 
 /**