From: "Jeff Hostetler via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: jeffhost@microsoft.com, Junio C Hamano <gitster@pobox.com>,
Jeff Hostetler <jeffhost@microsoft.com>
Subject: [PATCH v5 09/15] trace2:data: add trace2 instrumentation to index read/write
Date: Fri, 01 Feb 2019 09:59:06 -0800 (PST) [thread overview]
Message-ID: <57b23542b3812222e7e36c63da8d85f257de5c6c.1549043936.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.108.v5.git.gitgitgadget@gmail.com>
From: Jeff Hostetler <jeffhost@microsoft.com>
Add trace2 events to measure reading and writing the index.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
---
read-cache.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)
diff --git a/read-cache.c b/read-cache.c
index bfff271a3d..240531d70d 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2232,6 +2232,16 @@ 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:
@@ -2263,9 +2273,17 @@ 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)) {
@@ -2281,7 +2299,11 @@ 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,
@@ -2988,6 +3010,16 @@ 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;
}
@@ -3007,7 +3039,18 @@ 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 = do_write_index(istate, lock->tempfile, 0);
+ 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);
+
if (ret)
return ret;
if (flags & COMMIT_LOCK)
@@ -3092,7 +3135,13 @@ 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));
--
gitgitgadget
next prev parent reply other threads:[~2019-02-01 17:59 UTC|newest]
Thread overview: 154+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 21:22 [PATCH 00/14] Trace2 tracing facility Jeff Hostetler via GitGitGadget
2019-01-22 21:22 ` [PATCH 01/14] trace2: Documentation/technical/api-trace2.txt Jeff Hostetler via GitGitGadget
2019-01-23 20:51 ` Junio C Hamano
2019-01-25 21:13 ` Jeff Hostetler
2019-01-25 13:19 ` SZEDER Gábor
2019-01-25 17:53 ` Josh Steadmon
2019-01-22 21:22 ` [PATCH 02/14] trace2: create new combined trace facility Jeff Hostetler via GitGitGadget
2019-01-25 11:22 ` SZEDER Gábor
2019-01-25 19:13 ` Junio C Hamano
2019-01-22 21:22 ` [PATCH 03/14] trace2: collect platform-specific process information Jeff Hostetler via GitGitGadget
2019-01-22 21:22 ` [PATCH 04/14] trace2:data: add trace2 regions to wt-status Jeff Hostetler via GitGitGadget
2019-01-22 21:22 ` [PATCH 05/14] trace2:data: add editor/pager child classification Jeff Hostetler via GitGitGadget
2019-01-22 21:22 ` [PATCH 06/14] trace2:data: add trace2 sub-process classification Jeff Hostetler via GitGitGadget
2019-01-22 21:22 ` [PATCH 07/14] trace2:data: add trace2 transport child classification Jeff Hostetler via GitGitGadget
2019-01-22 21:22 ` [PATCH 09/14] trace2:data: add trace2 instrumentation to index read/write Jeff Hostetler via GitGitGadget
2019-01-22 21:22 ` [PATCH 08/14] trace2:data: add trace2 hook classification Jeff Hostetler via GitGitGadget
2019-01-22 21:22 ` [PATCH 10/14] pack-objects: add trace2 regions Derrick Stolee via GitGitGadget
2019-01-23 1:19 ` Derrick Stolee
2019-01-22 21:22 ` [PATCH 11/14] trace2:data: add subverb to checkout command Jeff Hostetler via GitGitGadget
2019-01-22 21:22 ` [PATCH 12/14] trace2:data: add subverb to reset command Jeff Hostetler via GitGitGadget
2019-01-22 21:22 ` [PATCH 13/14] trace2:data: add subverb for rebase Jeff Hostetler via GitGitGadget
2019-01-22 21:22 ` [PATCH 14/14] trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh Jeff Hostetler via GitGitGadget
2019-01-22 23:21 ` [PATCH 00/14] Trace2 tracing facility Junio C Hamano
2019-01-25 20:03 ` Josh Steadmon
2019-01-30 18:45 ` Jeff Hostetler
2019-01-28 16:15 ` Jeff Hostetler
2019-01-28 18:07 ` Junio C Hamano
2019-01-28 21:47 ` [PATCH v2 " Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 01/14] trace2: Documentation/technical/api-trace2.txt Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 02/14] trace2: create new combined trace facility Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 03/14] trace2: collect platform-specific process information Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 04/14] trace2:data: add trace2 regions to wt-status Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 05/14] trace2:data: add editor/pager child classification Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 06/14] trace2:data: add trace2 sub-process classification Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 07/14] trace2:data: add trace2 transport child classification Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 08/14] trace2:data: add trace2 hook classification Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 09/14] trace2:data: add trace2 instrumentation to index read/write Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 11/14] trace2:data: add subverb to checkout command Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 10/14] pack-objects: add trace2 regions Derrick Stolee via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 12/14] trace2:data: add subverb to reset command Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 13/14] trace2:data: add subverb for rebase Jeff Hostetler via GitGitGadget
2019-01-28 21:47 ` [PATCH v2 14/14] trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh Jeff Hostetler via GitGitGadget
2019-01-28 22:23 ` Junio C Hamano
2019-01-29 22:08 ` Jeff Hostetler
2019-01-30 19:51 ` [PATCH v3 00/14] Trace2 tracing facility Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 01/14] trace2: Documentation/technical/api-trace2.txt Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 02/14] trace2: create new combined trace facility Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 03/14] trace2: collect platform-specific process information Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 04/14] trace2:data: add trace2 regions to wt-status Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 05/14] trace2:data: add editor/pager child classification Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 06/14] trace2:data: add trace2 sub-process classification Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 07/14] trace2:data: add trace2 transport child classification Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 08/14] trace2:data: add trace2 hook classification Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 09/14] trace2:data: add trace2 instrumentation to index read/write Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 10/14] pack-objects: add trace2 regions Derrick Stolee via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 11/14] trace2:data: add subverb to checkout command Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 12/14] trace2:data: add subverb to reset command Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 13/14] trace2:data: add subverb for rebase Jeff Hostetler via GitGitGadget
2019-01-30 19:51 ` [PATCH v3 14/14] trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh Jeff Hostetler via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 00/14] Trace2 tracing facility Jeff Hostetler via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 01/14] trace2: Documentation/technical/api-trace2.txt Jeff Hostetler via GitGitGadget
2019-01-31 14:11 ` SZEDER Gábor
2019-01-31 22:33 ` Jeff Hostetler
2019-01-31 23:39 ` Junio C Hamano
2019-01-30 20:56 ` [PATCH v4 02/14] trace2: create new combined trace facility Jeff Hostetler via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 03/14] trace2: collect platform-specific process information Jeff Hostetler via GitGitGadget
2019-01-31 23:15 ` SZEDER Gábor
2019-02-01 11:12 ` Jeff Hostetler
2019-01-30 20:56 ` [PATCH v4 04/14] trace2:data: add trace2 regions to wt-status Jeff Hostetler via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 05/14] trace2:data: add editor/pager child classification Jeff Hostetler via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 06/14] trace2:data: add trace2 sub-process classification Jeff Hostetler via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 07/14] trace2:data: add trace2 transport child classification Jeff Hostetler via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 08/14] trace2:data: add trace2 hook classification Jeff Hostetler via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 09/14] trace2:data: add trace2 instrumentation to index read/write Jeff Hostetler via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 10/14] pack-objects: add trace2 regions Derrick Stolee via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 11/14] trace2:data: add subverb to checkout command Jeff Hostetler via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 12/14] trace2:data: add subverb to reset command Jeff Hostetler via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 13/14] trace2:data: add subverb for rebase Jeff Hostetler via GitGitGadget
2019-01-30 20:56 ` [PATCH v4 14/14] trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh Jeff Hostetler via GitGitGadget
2019-01-31 23:28 ` SZEDER Gábor
2019-01-31 23:41 ` Junio C Hamano
2019-02-01 11:08 ` Jeff Hostetler
2019-01-31 18:46 ` [PATCH v4 00/14] Trace2 tracing facility Junio C Hamano
2019-02-01 17:58 ` [PATCH v5 00/15] " Jeff Hostetler via GitGitGadget
2019-02-01 17:58 ` [PATCH v5 01/15] trace2: Documentation/technical/api-trace2.txt Jeff Hostetler via GitGitGadget
2019-02-01 17:59 ` [PATCH v5 02/15] trace2: create new combined trace facility Jeff Hostetler via GitGitGadget
2019-02-01 17:59 ` [PATCH v5 03/15] trace2: collect Windows-specific process information Jeff Hostetler via GitGitGadget
2019-02-01 17:59 ` [PATCH v5 05/15] trace2:data: add editor/pager child classification Jeff Hostetler via GitGitGadget
2019-02-01 17:59 ` [PATCH v5 04/15] trace2:data: add trace2 regions to wt-status Jeff Hostetler via GitGitGadget
2019-02-01 17:59 ` [PATCH v5 06/15] trace2:data: add trace2 sub-process classification Jeff Hostetler via GitGitGadget
2019-02-01 17:59 ` [PATCH v5 07/15] trace2:data: add trace2 transport child classification Jeff Hostetler via GitGitGadget
2019-02-01 17:59 ` [PATCH v5 08/15] trace2:data: add trace2 hook classification Jeff Hostetler via GitGitGadget
2019-02-01 17:59 ` Jeff Hostetler via GitGitGadget [this message]
2019-02-01 17:59 ` [PATCH v5 10/15] trace2:data: pack-objects: add trace2 regions Derrick Stolee via GitGitGadget
2019-02-01 17:59 ` [PATCH v5 11/15] trace2:data: add subverb to checkout command Jeff Hostetler via GitGitGadget
2019-02-01 17:59 ` [PATCH v5 12/15] trace2:data: add subverb to reset command Jeff Hostetler via GitGitGadget
2019-02-01 17:59 ` [PATCH v5 14/15] trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh Jeff Hostetler via GitGitGadget
2019-02-13 13:15 ` Ævar Arnfjörð Bjarmason
2019-02-01 17:59 ` [PATCH v5 13/15] trace2:data: add subverb for rebase Jeff Hostetler via GitGitGadget
2019-02-01 17:59 ` [PATCH v5 15/15] trace2: add for_each macros to clang-format Jeff Hostetler via GitGitGadget
2019-02-06 17:15 ` [PATCH v6 00/15] Trace2 tracing facility Jeff Hostetler via GitGitGadget
2019-02-06 17:15 ` [PATCH v6 01/15] trace2: Documentation/technical/api-trace2.txt Jeff Hostetler via GitGitGadget
2019-02-06 17:15 ` [PATCH v6 02/15] trace2: create new combined trace facility Jeff Hostetler via GitGitGadget
2019-02-15 16:00 ` Ævar Arnfjörð Bjarmason
2019-02-15 17:57 ` Jeff Hostetler
2019-02-06 17:15 ` [PATCH v6 03/15] trace2: collect Windows-specific process information Jeff Hostetler via GitGitGadget
2019-02-06 17:15 ` [PATCH v6 04/15] trace2:data: add trace2 regions to wt-status Jeff Hostetler via GitGitGadget
2019-02-06 17:15 ` [PATCH v6 05/15] trace2:data: add editor/pager child classification Jeff Hostetler via GitGitGadget
2019-02-06 17:15 ` [PATCH v6 06/15] trace2:data: add trace2 sub-process classification Jeff Hostetler via GitGitGadget
2019-02-06 17:15 ` [PATCH v6 07/15] trace2:data: add trace2 transport child classification Jeff Hostetler via GitGitGadget
2019-02-06 17:16 ` [PATCH v6 09/15] trace2:data: add trace2 instrumentation to index read/write Jeff Hostetler via GitGitGadget
2019-02-06 17:16 ` [PATCH v6 08/15] trace2:data: add trace2 hook classification Jeff Hostetler via GitGitGadget
2019-02-06 17:16 ` [PATCH v6 10/15] trace2:data: pack-objects: add trace2 regions Derrick Stolee via GitGitGadget
2019-02-06 17:16 ` [PATCH v6 11/15] trace2:data: add subverb to checkout command Jeff Hostetler via GitGitGadget
2019-02-06 17:16 ` [PATCH v6 12/15] trace2:data: add subverb to reset command Jeff Hostetler via GitGitGadget
2019-02-06 17:16 ` [PATCH v6 13/15] trace2:data: add subverb for rebase Jeff Hostetler via GitGitGadget
2019-02-06 17:16 ` [PATCH v6 14/15] trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh Jeff Hostetler via GitGitGadget
2019-02-06 17:16 ` [PATCH v6 15/15] trace2: add for_each macros to clang-format Jeff Hostetler via GitGitGadget
2019-02-14 12:33 ` [PATCH v6 00/15] Trace2 tracing facility Ævar Arnfjörð Bjarmason
2019-02-15 17:25 ` Jeff Hostetler
2019-03-17 14:22 ` Ævar Arnfjörð Bjarmason
2019-03-21 14:30 ` Johannes Schindelin
2019-03-21 14:48 ` Ævar Arnfjörð Bjarmason
2019-03-22 13:17 ` Johannes Schindelin
2019-03-22 14:01 ` Jeff Hostetler
2019-03-22 14:53 ` Ævar Arnfjörð Bjarmason
2019-03-22 15:21 ` Jeff Hostetler
2019-02-22 22:24 ` [PATCH v7 " Jeff Hostetler via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 01/15] trace2: Documentation/technical/api-trace2.txt Jeff Hostetler via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 02/15] trace2: create new combined trace facility Jeff Hostetler via GitGitGadget
2019-05-10 17:28 ` SZEDER Gábor
2019-05-10 19:54 ` Derrick Stolee
2019-02-22 22:25 ` [PATCH v7 03/15] trace2: collect Windows-specific process information Jeff Hostetler via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 04/15] trace2:data: add trace2 regions to wt-status Jeff Hostetler via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 05/15] trace2:data: add editor/pager child classification Jeff Hostetler via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 06/15] trace2:data: add trace2 sub-process classification Jeff Hostetler via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 07/15] trace2:data: add trace2 transport child classification Jeff Hostetler via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 08/15] trace2:data: add trace2 hook classification Jeff Hostetler via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 09/15] trace2:data: add trace2 instrumentation to index read/write Jeff Hostetler via GitGitGadget
2019-05-10 13:37 ` [PATCH] trace2: fix up a missing "leave" entry point Ævar Arnfjörð Bjarmason
2019-05-10 13:45 ` Derrick Stolee
2019-05-20 16:50 ` Jeff Hostetler
2019-02-22 22:25 ` [PATCH v7 10/15] trace2:data: pack-objects: add trace2 regions Derrick Stolee via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 11/15] trace2:data: add subverb to checkout command Jeff Hostetler via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 12/15] trace2:data: add subverb to reset command Jeff Hostetler via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 13/15] trace2:data: add subverb for rebase Jeff Hostetler via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 14/15] trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh Jeff Hostetler via GitGitGadget
2019-02-22 22:25 ` [PATCH v7 15/15] trace2: add for_each macros to clang-format Jeff Hostetler via GitGitGadget
2019-01-31 14:38 ` [PATCH v3 00/14] Trace2 tracing facility SZEDER Gábor
2019-01-31 14:53 ` Jeff Hostetler
2019-01-31 18:51 ` Junio C Hamano
2019-01-31 19:45 ` Jeff Hostetler
2019-01-31 22:11 ` Jeff Hostetler
2019-01-31 23:30 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57b23542b3812222e7e36c63da8d85f257de5c6c.1549043936.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jeffhost@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).