Skip to content

Commit 6a9372f

Browse files
derrickstoleegitster
authored andcommitted
name-hash: use trace2 regions for init
The lazy_init_name_hash() populates a hashset with all filenames and another with all directories represented in the index. This is run only if we need to use the hashsets to check for existence or case-folding renames. Place trace2 regions where there is already a performance trace. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1fd9ae5 commit 6a9372f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

name-hash.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
#include "cache.h"
99
#include "thread-utils.h"
10+
#include "trace2.h"
1011

1112
struct dir_entry {
1213
struct hashmap_entry ent;
@@ -577,6 +578,7 @@ static void lazy_init_name_hash(struct index_state *istate)
577578
if (istate->name_hash_initialized)
578579
return;
579580
trace_performance_enter();
581+
trace2_region_enter("index", "name-hash-init", istate->repo);
580582
hashmap_init(&istate->name_hash, cache_entry_cmp, NULL, istate->cache_nr);
581583
hashmap_init(&istate->dir_hash, dir_entry_cmp, NULL, istate->cache_nr);
582584

@@ -597,6 +599,7 @@ static void lazy_init_name_hash(struct index_state *istate)
597599
}
598600

599601
istate->name_hash_initialized = 1;
602+
trace2_region_leave("index", "name-hash-init", istate->repo);
600603
trace_performance_leave("initialize name hash");
601604
}
602605

0 commit comments

Comments
 (0)