fsmonitor: trace the new invalidated cache-entry count

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>
maint
Jeff Hostetler 2024-02-26 21:39:23 +00:00 committed by Junio C Hamano
parent 9e34e56280
commit 84d441f2f0
1 changed files with 10 additions and 5 deletions

View File

@ -308,16 +308,21 @@ static void fsmonitor_refresh_callback(struct index_state *istate, char *name)
{ {
int len = strlen(name); int len = strlen(name);
int pos = index_name_pos(istate, name, len); int pos = index_name_pos(istate, name, len);
size_t nr_in_cone;


trace_printf_key(&trace_fsmonitor, trace_printf_key(&trace_fsmonitor,
"fsmonitor_refresh_callback '%s' (pos %d)", "fsmonitor_refresh_callback '%s' (pos %d)",
name, pos); name, pos);


if (name[len - 1] == '/') { if (name[len - 1] == '/')
handle_path_with_trailing_slash(istate, name, pos); nr_in_cone = handle_path_with_trailing_slash(istate, name, pos);
} else { else
handle_path_without_trailing_slash(istate, name, pos); 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);
} }


/* /*