trace2:gvfs:experiment: add unpack_entry() counter to unpack_trees() and report_tracking()

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
This commit is contained in:
Jeff Hostetler 2019-07-16 10:40:56 -04:00 коммит произвёл Johannes Schindelin
Родитель 5b2520ffb4
Коммит 23f9c10edd
4 изменённых файлов: 25 добавлений и 0 удалений

Просмотреть файл

@ -18,6 +18,7 @@
#include "merge-recursive.h"
#include "object-name.h"
#include "object-store-ll.h"
#include "packfile.h"
#include "parse-options.h"
#include "path.h"
#include "preload-index.h"
@ -1040,8 +1041,13 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
if (!opts->quiet &&
!opts->force_detach &&
(new_branch_info->path || !strcmp(new_branch_info->name, "HEAD"))) {
unsigned long nr_unpack_entry_at_start;
trace2_region_enter("exp", "report_tracking", the_repository);
nr_unpack_entry_at_start = get_nr_unpack_entry();
report_tracking(new_branch_info);
trace2_data_intmax("exp", NULL, "report_tracking/nr_unpack_entries",
(intmax_t)(get_nr_unpack_entry() - nr_unpack_entry_at_start));
trace2_region_leave("exp", "report_tracking", the_repository);
}
}

Просмотреть файл

@ -1665,6 +1665,13 @@ struct unpack_entry_stack_ent {
unsigned long size;
};
static unsigned long g_nr_unpack_entry;
unsigned long get_nr_unpack_entry(void)
{
return g_nr_unpack_entry;
}
void *unpack_entry(struct repository *r, struct packed_git *p, off_t obj_offset,
enum object_type *final_type, unsigned long *final_size)
{
@ -1678,6 +1685,8 @@ void *unpack_entry(struct repository *r, struct packed_git *p, off_t obj_offset,
int delta_stack_nr = 0, delta_stack_alloc = UNPACK_ENTRY_STACK_PREALLOC;
int base_from_cache = 0;
g_nr_unpack_entry++;
write_pack_access_log(p, obj_offset);
/* PHASE 1: drill down to the innermost base object */

Просмотреть файл

@ -208,4 +208,9 @@ int is_promisor_object(const struct object_id *oid);
int load_idx(const char *path, const unsigned int hashsz, void *idx_map,
size_t idx_size, struct packed_git *p);
/*
* Return the number of objects fetched from a packfile.
*/
unsigned long get_nr_unpack_entry(void);
#endif

Просмотреть файл

@ -14,6 +14,7 @@
#include "tree-walk.h"
#include "cache-tree.h"
#include "unpack-trees.h"
#include "packfile.h"
#include "progress.h"
#include "refs.h"
#include "attr.h"
@ -1895,6 +1896,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
struct pattern_list pl;
int free_pattern_list = 0;
struct dir_struct dir = DIR_INIT;
unsigned long nr_unpack_entry_at_start;
if (o->reset == UNPACK_RESET_INVALID)
BUG("o->reset had a value of 1; should be UNPACK_TREES_*_UNTRACKED");
@ -1909,6 +1911,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
BUG("o->df_conflict_entry is an output only field");
trace2_region_enter("exp", "unpack_trees", NULL);
nr_unpack_entry_at_start = get_nr_unpack_entry();
trace_performance_enter();
trace2_region_enter("unpack_trees", "unpack_trees", the_repository);
@ -2114,6 +2117,8 @@ done:
}
trace2_region_leave("unpack_trees", "unpack_trees", the_repository);
trace_performance_leave("unpack_trees");
trace2_data_intmax("unpack_trees", NULL, "unpack_trees/nr_unpack_entries",
(intmax_t)(get_nr_unpack_entry() - nr_unpack_entry_at_start));
trace2_region_leave("exp", "unpack_trees", NULL);
return ret;