Skip to content

Commit

Permalink
Revert "trace2:data: add trace2 instrumentation to index read/write"
Browse files Browse the repository at this point in the history
This reverts commit 517c6d8.
  • Loading branch information
jeffhostetler committed Jan 31, 2019
1 parent b06eaff commit b9ef989
Showing 1 changed file with 1 addition and 46 deletions.
47 changes: 1 addition & 46 deletions read-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2237,14 +2237,6 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist)
load_index_extensions(&p);
}
munmap((void *)mmap, mmap_size);

/*
* TODO trace2: replace "the_repository" with the actual repo instance
* that is associated with the given "istate".
*/
trace2_data_intmax("index", the_repository, "read/version", istate->version);
trace2_data_intmax("index", the_repository, "read/cache_nr", istate->cache_nr);

return istate->cache_nr;

unmap:
Expand Down Expand Up @@ -2276,17 +2268,9 @@ int read_index_from(struct index_state *istate, const char *path,
if (istate->initialized)
return istate->cache_nr;

/*
* TODO trace2: replace "the_repository" with the actual repo instance
* that is associated with the given "istate".
*/
trace2_region_enter_printf("index", "do_read_index", the_repository,
"%s", path);
trace_performance_enter();
ret = do_read_index(istate, path, 0);
trace_performance_leave("read cache %s", path);
trace2_region_leave_printf("index", "do_read_index", the_repository,
"%s", path);

split_index = istate->split_index;
if (!split_index || is_null_oid(&split_index->base_oid)) {
Expand All @@ -2302,11 +2286,7 @@ int read_index_from(struct index_state *istate, const char *path,

base_oid_hex = oid_to_hex(&split_index->base_oid);
base_path = xstrfmt("%s/sharedindex.%s", gitdir, base_oid_hex);
trace2_region_enter_printf("index", "shared/do_read_index", the_repository,
"%s", base_path);
ret = do_read_index(split_index->base, base_path, 1);
trace2_region_leave_printf("index", "shared/do_read_index", the_repository,
"%s", base_path);
if (!oideq(&split_index->base_oid, &split_index->base->oid))
die("broken index, expect %s in %s, got %s",
base_oid_hex, base_path,
Expand Down Expand Up @@ -3017,14 +2997,6 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
istate->timestamp.sec = (unsigned int)st.st_mtime;
istate->timestamp.nsec = ST_MTIME_NSEC(st);
trace_performance_since(start, "write index, changed mask = %x", istate->cache_changed);

/*
* TODO trace2: replace "the_repository" with the actual repo instance
* that is associated with the given "istate".
*/
trace2_data_intmax("index", the_repository, "write/version", istate->version);
trace2_data_intmax("index", the_repository, "write/cache_nr", istate->cache_nr);

return 0;
}

Expand All @@ -3044,18 +3016,7 @@ static int commit_locked_index(struct lock_file *lk)
static int do_write_locked_index(struct index_state *istate, struct lock_file *lock,
unsigned flags)
{
int ret;

/*
* TODO trace2: replace "the_repository" with the actual repo instance
* that is associated with the given "istate".
*/
trace2_region_enter_printf("index", "do_write_index", the_repository,
"%s", lock->tempfile->filename.buf);
ret = do_write_index(istate, lock->tempfile, 0);
trace2_region_leave_printf("index", "do_write_index", the_repository,
"%s", lock->tempfile->filename.buf);

int ret = do_write_index(istate, lock->tempfile, 0);
if (ret)
return ret;
if (flags & COMMIT_LOCK)
Expand Down Expand Up @@ -3149,13 +3110,7 @@ static int write_shared_index(struct index_state *istate,
int ret;

move_cache_to_base_index(istate);

trace2_region_enter_printf("index", "shared/do_write_index",
the_repository, "%s", (*temp)->filename.buf);
ret = do_write_index(si->base, *temp, 1);
trace2_region_enter_printf("index", "shared/do_write_index",
the_repository, "%s", (*temp)->filename.buf);

if (ret)
return ret;
ret = adjust_shared_perm(get_tempfile_path(*temp));
Expand Down

0 comments on commit b9ef989

Please sign in to comment.