]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fsmonitor: trace the new invalidated cache-entry count
authorJeff Hostetler <jeffhostetler@github.com>
Mon, 26 Feb 2024 21:39:23 +0000 (21:39 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Mar 2024 17:10:06 +0000 (09:10 -0800)
Consolidate the directory/non-directory calls to the refresh handler
code.  Log the resulting count of invalidated cache-entries.

The nr_in_cone value will be used in a later commit to decide if
we also need to try to do case-insensitive lookups.

Signed-off-by: Jeff Hostetler <jeffhostetler@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fsmonitor.c

index c16ed5d87585fcdaf5f2cbb3521b95faace4edca..739ddbf7aca2a643366b43b68c33010714282d36 100644 (file)
@@ -308,16 +308,21 @@ static void fsmonitor_refresh_callback(struct index_state *istate, char *name)
 {
        int len = strlen(name);
        int pos = index_name_pos(istate, name, len);
+       size_t nr_in_cone;
 
        trace_printf_key(&trace_fsmonitor,
                         "fsmonitor_refresh_callback '%s' (pos %d)",
                         name, pos);
 
-       if (name[len - 1] == '/') {
-               handle_path_with_trailing_slash(istate, name, pos);
-       } else {
-               handle_path_without_trailing_slash(istate, name, pos);
-       }
+       if (name[len - 1] == '/')
+               nr_in_cone = handle_path_with_trailing_slash(istate, name, pos);
+       else
+               nr_in_cone = handle_path_without_trailing_slash(istate, name, pos);
+
+       if (nr_in_cone)
+               trace_printf_key(&trace_fsmonitor,
+                                "fsmonitor_refresh_callback CNT: %d",
+                                (int)nr_in_cone);
 }
 
 /*