fsmonitor: log FSMN token when reading and writing the index

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Reviewed-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff Hostetler committed Feb 3, 2021 at 15:34 UTC 29fbbf43a031cefb6fe6e3f723d78f82af4979b0
1 file changed +10 -2
fsmonitor.c
+10 -2
@@ -87,7 +87,11 @@ int read_fsmonitor_extension(struct index_state *istate, const void *data,
87 BUG("fsmonitor_dirty has more entries than the index (%"PRIuMAX" > %u)",
88 (uintmax_t)istate->fsmonitor_dirty->bit_size, istate->cache_nr);
89
90 - trace_printf_key(&trace_fsmonitor, "read fsmonitor extension successful");
90 + trace2_data_string("index", NULL, "extension/fsmn/read/token",
91 + istate->fsmonitor_last_update);
92 + trace_printf_key(&trace_fsmonitor,
93 + "read fsmonitor extension successful '%s'",
94 + istate->fsmonitor_last_update);
95 return 0;
96 }
97
@@ -133,7 +137,11 @@ void write_fsmonitor_extension(struct strbuf *sb, struct index_state *istate)
137 put_be32(&ewah_size, sb->len - ewah_start);
138 memcpy(sb->buf + fixup, &ewah_size, sizeof(uint32_t));
139
136 - trace_printf_key(&trace_fsmonitor, "write fsmonitor extension successful");
140 + trace2_data_string("index", NULL, "extension/fsmn/write/token",
141 + istate->fsmonitor_last_update);
142 + trace_printf_key(&trace_fsmonitor,
143 + "write fsmonitor extension successful '%s'",
144 + istate->fsmonitor_last_update);
145 }
146
147 /*