[gvfs] google: Improved debug info being logged while insert/delete/query



commit 14fa8dc5ca1b72018bd46e42f377100bd899f866
Author: Mayank Sharma <mayank8019 gmail com>
Date:   Sun Aug 18 03:06:57 2019 +0530

    google: Improved debug info being logged while insert/delete/query
    
    query_info operation is the most called operation, and generally gives a
    good idea about the state of cache before and after any other operation.
    We now log the whole cache while doing query_info operation.
    
    Also, some other debug information in `insert_entry_full` and
    `remove_entry_full` has also been improved, i.e. it now logs
    conditionally while inserting/removing any entry.

 daemon/gvfsbackendgoogle.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gvfsbackendgoogle.c b/daemon/gvfsbackendgoogle.c
index 05031874..bddd8b6d 100644
--- a/daemon/gvfsbackendgoogle.c
+++ b/daemon/gvfsbackendgoogle.c
@@ -723,8 +723,8 @@ remove_entry_full (GVfsBackendGoogle *self,
       g_hash_table_remove (self->dir_timestamps, parent_id);
 
       k = dir_entries_key_new (id, parent_id);
-      g_debug ("  remove_entry: Removed (%s, %s) -> %p\n", id, parent_id, entry);
-      g_hash_table_remove (self->dir_entries, k);
+      if (g_hash_table_remove (self->dir_entries, k))
+        g_debug ("  remove_entry: Removed real      (%s, %s) -> %p\n", id, parent_id, entry);
       dir_entries_key_free (k);
 
       k = dir_entries_key_new (title, parent_id);
@@ -1403,6 +1403,7 @@ g_vfs_backend_google_copy (GVfsBackend           *_self,
 
   g_rec_mutex_lock (&self->mutex);
   g_debug ("+ copy: %s -> %s, %d\n", source, destination, flags);
+  log_dir_entries (self);
 
   if (flags & G_FILE_COPY_BACKUP)
     {
@@ -1611,6 +1612,7 @@ g_vfs_backend_google_copy (GVfsBackend           *_self,
   g_free (destination_basename);
   g_free (entry_path);
   g_free (parent_path);
+  log_dir_entries (self);
   g_debug ("- copy\n");
   g_rec_mutex_unlock (&self->mutex);
 }
@@ -2463,6 +2465,7 @@ g_vfs_backend_google_query_info (GVfsBackend           *_self,
 
   g_rec_mutex_lock (&self->mutex);
   g_debug ("+ query_info: %s, %d\n", filename, flags);
+  log_dir_entries (self);
 
   error = NULL;
   entry = resolve (self, filename, cancellable, &entry_path, &error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]