git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v6 00/15] Trace2 tracing facility

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Mar 22, 2019, 15:21 UTC
Message-ID
<4c5cef43-2f35-124a-b88c-397866b6111f@jeffhostetler.com>
In-Reply-To
<87h8bvc65j.fsf@evledraar.gmail.com>
On 3/22/2019 10:53 AM, Ævar Arnfjörð Bjarmason wrote:
Show 109 quoted lines
> 
> On Fri, Mar 22 2019, Jeff Hostetler wrote:
> 
>> On 3/22/2019 9:17 AM, Johannes Schindelin wrote:
>>> Hi Ævar,
>>>
>>> On Thu, 21 Mar 2019, Ævar Arnfjörð Bjarmason wrote:
>>>
>>>> On Thu, Mar 21 2019, Johannes Schindelin wrote:
>>>>
>>>>> On Sun, 17 Mar 2019, Ævar Arnfjörð Bjarmason wrote:
>>>>>
>>>>>>
>>>>>> On Fri, Feb 15 2019, Jeff Hostetler wrote:
>>>>>>
>>>>>>> I could see having a "~/.git_tr2_config" or something similar in
>>>>>>> some place like "/etc" that only contained the Trace2 settings. It
>>>>>>> would be safe to read very early inside main() and we would not
>>>>>>> consider it to be part of the real config.  For example, "git
>>>>>>> config" would not know about it.  Then you could enforce a
>>>>>>> system-wide setting without any of the env var issues.
>>>>>>
>>>>>> I haven't written a patch for this, but it seems to me that we could
>>>>>> just start reading /etc/gitconfig via some custom config callback
>>>>>> code early as e.g. 58b284a2e91 ("worktree: add per-worktree config
>>>>>> files", 2018-10-21) does for the worktree config.
>>>>>
>>>>> Oy. Oy, oy, oy.
>>>>>
>>>>> Maybe use `read_early_config()` instead? That would be *a lot*
>>>>> cleaner. You could maybe use a9bcf6586d1a (alias: use the early config
>>>>> machinery to expand aliases, 2017-06-14) as an inspiration.
>>>>
>>>> Thanks. I was thinking *only* to do /etc/gitconfig and not the whole
>>>> .git/config -> ~/.gitconfig etc. sequence just in terms of saving
>>>> critical time (this is the performance trace path, after all...).
>>>>
>>>> But on a second reading I see that read_early_config() can do that if
>>>> you set config_source->file, opts->respect_includes etc. I.e. it just
>>>> (depending on options) resolves to git_config_from_file() which
>>>> 58b284a2e91 used directly.
>>>
>>> Sure, it can exclude the repo and user config, but would that not be
>>> rather confusing?
>>
>> This was hidden in my earlier message.
>>
>> There's a lot a config machinery here with lots of chicken-n-egg
>> problems.  I want to know at the top of main() as quickly as possible
>> whether trace2 should be enabled.
>>
>> I don't want to slow down git by spinning up a bunch of trace2 state
>> and wait until the git-dir is discovered, the "-c" args are processed,
>> and we dispatch into the builtin layer and the config is enumerated
>> to know if it should really be on or not.
>>
>> I also didn't want to introduce another full iteration of the full
>> config system for startup performance reasons.
>>
>> I played with read_early_config() at one point and it always seemed
>> to introduce side-effects.  Perhaps I was calling it earlier than it
>> was expecting and that triggered some of the git-dir discovery or
>> something. I don't remember all the details, I just remember that it
>> changed some behaviors in subtle ways.
>>
>> Perhaps I could call something like git_config_from_file() with the
>> right set of magic bits to get it to parse exactly 1 system config
>> file that would contain my trace2 settings.  Hopefully, this will
>> not have any side-effects.
> 
> Right, it also occurred to me that e.g. /home tends to be on NFS on some
> systems, but very rarely /etc. I'd hate for trace reporting for git to
> stall because NFS slows to a halt, so aside from temporary
> implementation details (e.g. -c on the CLI not working) there's a good
> case to be made for "read this from /etc/gitconfig only".
> 
>> But if we lump them in with the main /etc/gitconfig settings, we
>> would have to explain that these trace2 config settings are
>> system-only and ARE NOT overridden by "-c", global, local, ...
>> config settings.  This would get confusing if the user tried to
>> set local values and did:
>> 	git config --list --show-origin
>> and it showed system and local values but yet "stubbornly" refused
>> to use the local values over the system values. (I think this was
>> Johannes' point.)
>>
>> That's why I was suggesting a system trace2 config file that is a
>> peer of /etc/gitconfig (maybe /etc/gittrace2) that would have these
>> values and not be expected to interact with the main config system.
>> That is, we just use the git_config_ routines to parse the file format,
>> rather than inventing another file format, but not change the
>> expectation of the established config value inheritance system.
>>
>> If there's no objections, I'll take a look at doing this.
> 
> I'd much rather just drop it in /etc/gitconfig with documented caveats
> than introduce a new and permanent thing like /etc/gittrace2 due to a
> current implementation detail.
> 
> Unlike something in core.* or whatever this facility is specialized
> enough that I think it's fine to make it a bit of a special snowflake
> given what it does and the target audience.
> 
> But even with those caveats it's still useful to see it in 'git config
> -l --show-origin' for inspecting, and e.g. have it just work out of the
> box with say the default puppetry for the likes of GitLab that now knows
> how to set stuff in its /etc/gitconfig, but would need a special case
> just for this.
> 

ok, if we're comfortable with those caveats, i'll proceed as you suggested. thanks for the quick response.

Jeff
Previous: Ævar Arnfjörð BjarmasonNext: Jeff Hostetler via GitGitGadget
Message 127 of 154 in “Trace2 tracing facility”
  1. 00/14 Trace2 tracing facilityJeff Hostetler via GitGitGadget, Jan 22, 2019
  2. 04/14 trace2:data: add trace2 regions to wt-statusJeff Hostetler via GitGitGadget, Jan 22, 2019
  3. 03/14 trace2: collect platform-specific process informationJeff Hostetler via GitGitGadget, Jan 22, 2019
  4. 07/14 trace2:data: add trace2 transport child classificationJeff Hostetler via GitGitGadget, Jan 22, 2019
  5. 05/14 trace2:data: add editor/pager child classificationJeff Hostetler via GitGitGadget, Jan 22, 2019
  6. 08/14 trace2:data: add trace2 hook classificationJeff Hostetler via GitGitGadget, Jan 22, 2019
  7. 02/14 trace2: create new combined trace facilityJeff Hostetler via GitGitGadget, Jan 22, 2019
  8. SZEDER GáborJan 25, 2019
  9. Junio C HamanoJan 25, 2019
  10. 11/14 trace2:data: add subverb to checkout commandJeff Hostetler via GitGitGadget, Jan 22, 2019
  11. 12/14 trace2:data: add subverb to reset commandJeff Hostetler via GitGitGadget, Jan 22, 2019
  12. 14/14 trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.shJeff Hostetler via GitGitGadget, Jan 22, 2019
  13. 10/14 pack-objects: add trace2 regionsDerrick Stolee via GitGitGadget, Jan 22, 2019
  14. Derrick StoleeJan 23, 2019
  15. 09/14 trace2:data: add trace2 instrumentation to index read/writeJeff Hostetler via GitGitGadget, Jan 22, 2019
  16. 13/14 trace2:data: add subverb for rebaseJeff Hostetler via GitGitGadget, Jan 22, 2019
  17. 06/14 trace2:data: add trace2 sub-process classificationJeff Hostetler via GitGitGadget, Jan 22, 2019
  18. 01/14 trace2: Documentation/technical/api-trace2.txtJeff Hostetler via GitGitGadget, Jan 22, 2019
  19. Junio C HamanoJan 23, 2019
  20. Jeff HostetlerJan 25, 2019
  21. SZEDER GáborJan 25, 2019
  22. Josh SteadmonJan 25, 2019
  23. Junio C HamanoJan 22, 2019
  24. Josh SteadmonJan 25, 2019
  25. Jeff HostetlerJan 30, 2019
  26. Jeff HostetlerJan 28, 2019
  27. Junio C HamanoJan 28, 2019
  28. 00/14 Trace2 tracing facilityJeff Hostetler via GitGitGadget, Jan 28, 2019
  29. 03/14 trace2: collect platform-specific process informationJeff Hostetler via GitGitGadget, Jan 28, 2019
  30. 01/14 trace2: Documentation/technical/api-trace2.txtJeff Hostetler via GitGitGadget, Jan 28, 2019
  31. 05/14 trace2:data: add editor/pager child classificationJeff Hostetler via GitGitGadget, Jan 28, 2019
  32. 07/14 trace2:data: add trace2 transport child classificationJeff Hostetler via GitGitGadget, Jan 28, 2019
  33. 08/14 trace2:data: add trace2 hook classificationJeff Hostetler via GitGitGadget, Jan 28, 2019
  34. 09/14 trace2:data: add trace2 instrumentation to index read/writeJeff Hostetler via GitGitGadget, Jan 28, 2019
  35. 12/14 trace2:data: add subverb to reset commandJeff Hostetler via GitGitGadget, Jan 28, 2019
  36. 11/14 trace2:data: add subverb to checkout commandJeff Hostetler via GitGitGadget, Jan 28, 2019
  37. 13/14 trace2:data: add subverb for rebaseJeff Hostetler via GitGitGadget, Jan 28, 2019
  38. 14/14 trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.shJeff Hostetler via GitGitGadget, Jan 28, 2019
  39. Junio C HamanoJan 28, 2019
  40. Jeff HostetlerJan 29, 2019
  41. 10/14 pack-objects: add trace2 regionsDerrick Stolee via GitGitGadget, Jan 28, 2019
  42. 02/14 trace2: create new combined trace facilityJeff Hostetler via GitGitGadget, Jan 28, 2019
  43. 06/14 trace2:data: add trace2 sub-process classificationJeff Hostetler via GitGitGadget, Jan 28, 2019
  44. 04/14 trace2:data: add trace2 regions to wt-statusJeff Hostetler via GitGitGadget, Jan 28, 2019
  45. 00/14 Trace2 tracing facilityJeff Hostetler via GitGitGadget, Jan 30, 2019
  46. 03/14 trace2: collect platform-specific process informationJeff Hostetler via GitGitGadget, Jan 30, 2019
  47. 04/14 trace2:data: add trace2 regions to wt-statusJeff Hostetler via GitGitGadget, Jan 30, 2019
  48. 01/14 trace2: Documentation/technical/api-trace2.txtJeff Hostetler via GitGitGadget, Jan 30, 2019
  49. 06/14 trace2:data: add trace2 sub-process classificationJeff Hostetler via GitGitGadget, Jan 30, 2019
  50. 08/14 trace2:data: add trace2 hook classificationJeff Hostetler via GitGitGadget, Jan 30, 2019
  51. 10/14 pack-objects: add trace2 regionsDerrick Stolee via GitGitGadget, Jan 30, 2019
  52. 09/14 trace2:data: add trace2 instrumentation to index read/writeJeff Hostetler via GitGitGadget, Jan 30, 2019
  53. 05/14 trace2:data: add editor/pager child classificationJeff Hostetler via GitGitGadget, Jan 30, 2019
  54. 11/14 trace2:data: add subverb to checkout commandJeff Hostetler via GitGitGadget, Jan 30, 2019
  55. 12/14 trace2:data: add subverb to reset commandJeff Hostetler via GitGitGadget, Jan 30, 2019
  56. 14/14 trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.shJeff Hostetler via GitGitGadget, Jan 30, 2019
  57. 02/14 trace2: create new combined trace facilityJeff Hostetler via GitGitGadget, Jan 30, 2019
  58. 13/14 trace2:data: add subverb for rebaseJeff Hostetler via GitGitGadget, Jan 30, 2019
  59. 07/14 trace2:data: add trace2 transport child classificationJeff Hostetler via GitGitGadget, Jan 30, 2019
  60. 00/14 Trace2 tracing facilityJeff Hostetler via GitGitGadget, Jan 30, 2019
  61. 13/14 trace2:data: add subverb for rebaseJeff Hostetler via GitGitGadget, Jan 30, 2019
  62. 14/14 trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.shJeff Hostetler via GitGitGadget, Jan 30, 2019
  63. SZEDER GáborJan 31, 2019
  64. Junio C HamanoJan 31, 2019
  65. Jeff HostetlerFeb 1, 2019
  66. 12/14 trace2:data: add subverb to reset commandJeff Hostetler via GitGitGadget, Jan 30, 2019
  67. 11/14 trace2:data: add subverb to checkout commandJeff Hostetler via GitGitGadget, Jan 30, 2019
  68. 02/14 trace2: create new combined trace facilityJeff Hostetler via GitGitGadget, Jan 30, 2019
  69. 09/14 trace2:data: add trace2 instrumentation to index read/writeJeff Hostetler via GitGitGadget, Jan 30, 2019
  70. 10/14 pack-objects: add trace2 regionsDerrick Stolee via GitGitGadget, Jan 30, 2019
  71. 07/14 trace2:data: add trace2 transport child classificationJeff Hostetler via GitGitGadget, Jan 30, 2019
  72. 08/14 trace2:data: add trace2 hook classificationJeff Hostetler via GitGitGadget, Jan 30, 2019
  73. 06/14 trace2:data: add trace2 sub-process classificationJeff Hostetler via GitGitGadget, Jan 30, 2019
  74. 05/14 trace2:data: add editor/pager child classificationJeff Hostetler via GitGitGadget, Jan 30, 2019
  75. 04/14 trace2:data: add trace2 regions to wt-statusJeff Hostetler via GitGitGadget, Jan 30, 2019
  76. 03/14 trace2: collect platform-specific process informationJeff Hostetler via GitGitGadget, Jan 30, 2019
  77. SZEDER GáborJan 31, 2019
  78. Jeff HostetlerFeb 1, 2019
  79. 01/14 trace2: Documentation/technical/api-trace2.txtJeff Hostetler via GitGitGadget, Jan 30, 2019
  80. SZEDER GáborJan 31, 2019
  81. Jeff HostetlerJan 31, 2019
  82. Junio C HamanoJan 31, 2019
  83. Junio C HamanoJan 31, 2019
  84. 00/15 Trace2 tracing facilityJeff Hostetler via GitGitGadget, Feb 1, 2019
  85. 03/15 trace2: collect Windows-specific process informationJeff Hostetler via GitGitGadget, Feb 1, 2019
  86. 04/15 trace2:data: add trace2 regions to wt-statusJeff Hostetler via GitGitGadget, Feb 1, 2019
  87. 01/15 trace2: Documentation/technical/api-trace2.txtJeff Hostetler via GitGitGadget, Feb 1, 2019
  88. 06/15 trace2:data: add trace2 sub-process classificationJeff Hostetler via GitGitGadget, Feb 1, 2019
  89. 08/15 trace2:data: add trace2 hook classificationJeff Hostetler via GitGitGadget, Feb 1, 2019
  90. 09/15 trace2:data: add trace2 instrumentation to index read/writeJeff Hostetler via GitGitGadget, Feb 1, 2019
  91. 11/15 trace2:data: add subverb to checkout commandJeff Hostetler via GitGitGadget, Feb 1, 2019
  92. 02/15 trace2: create new combined trace facilityJeff Hostetler via GitGitGadget, Feb 1, 2019
  93. 15/15 trace2: add for_each macros to clang-formatJeff Hostetler via GitGitGadget, Feb 1, 2019
  94. 14/15 trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.shJeff Hostetler via GitGitGadget, Feb 1, 2019
  95. Ævar Arnfjörð BjarmasonFeb 13, 2019
  96. 13/15 trace2:data: add subverb for rebaseJeff Hostetler via GitGitGadget, Feb 1, 2019
  97. 10/15 trace2:data: pack-objects: add trace2 regionsDerrick Stolee via GitGitGadget, Feb 1, 2019
  98. 12/15 trace2:data: add subverb to reset commandJeff Hostetler via GitGitGadget, Feb 1, 2019
  99. 07/15 trace2:data: add trace2 transport child classificationJeff Hostetler via GitGitGadget, Feb 1, 2019
  100. 05/15 trace2:data: add editor/pager child classificationJeff Hostetler via GitGitGadget, Feb 1, 2019
  101. 00/15 Trace2 tracing facilityJeff Hostetler via GitGitGadget, Feb 6, 2019
  102. 04/15 trace2:data: add trace2 regions to wt-statusJeff Hostetler via GitGitGadget, Feb 6, 2019
  103. 01/15 trace2: Documentation/technical/api-trace2.txtJeff Hostetler via GitGitGadget, Feb 6, 2019
  104. 07/15 trace2:data: add trace2 transport child classificationJeff Hostetler via GitGitGadget, Feb 6, 2019
  105. 06/15 trace2:data: add trace2 sub-process classificationJeff Hostetler via GitGitGadget, Feb 6, 2019
  106. 08/15 trace2:data: add trace2 hook classificationJeff Hostetler via GitGitGadget, Feb 6, 2019
  107. 11/15 trace2:data: add subverb to checkout commandJeff Hostetler via GitGitGadget, Feb 6, 2019
  108. 12/15 trace2:data: add subverb to reset commandJeff Hostetler via GitGitGadget, Feb 6, 2019
  109. 15/15 trace2: add for_each macros to clang-formatJeff Hostetler via GitGitGadget, Feb 6, 2019
  110. 02/15 trace2: create new combined trace facilityJeff Hostetler via GitGitGadget, Feb 6, 2019
  111. Ævar Arnfjörð BjarmasonFeb 15, 2019
  112. Jeff HostetlerFeb 15, 2019
  113. 14/15 trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.shJeff Hostetler via GitGitGadget, Feb 6, 2019
  114. 09/15 trace2:data: add trace2 instrumentation to index read/writeJeff Hostetler via GitGitGadget, Feb 6, 2019
  115. 13/15 trace2:data: add subverb for rebaseJeff Hostetler via GitGitGadget, Feb 6, 2019
  116. 05/15 trace2:data: add editor/pager child classificationJeff Hostetler via GitGitGadget, Feb 6, 2019
  117. 10/15 trace2:data: pack-objects: add trace2 regionsDerrick Stolee via GitGitGadget, Feb 6, 2019
  118. 03/15 trace2: collect Windows-specific process informationJeff Hostetler via GitGitGadget, Feb 6, 2019
  119. Ævar Arnfjörð BjarmasonFeb 14, 2019
  120. Jeff HostetlerFeb 15, 2019
  121. Ævar Arnfjörð BjarmasonMar 17, 2019
  122. Johannes SchindelinMar 21, 2019
  123. Ævar Arnfjörð BjarmasonMar 21, 2019
  124. Johannes SchindelinMar 22, 2019
  125. Jeff HostetlerMar 22, 2019
  126. Ævar Arnfjörð BjarmasonMar 22, 2019
  127. Jeff HostetlerMar 22, 2019
  128. 00/15 Trace2 tracing facilityJeff Hostetler via GitGitGadget, Feb 22, 2019
  129. 03/15 trace2: collect Windows-specific process informationJeff Hostetler via GitGitGadget, Feb 22, 2019
  130. 01/15 trace2: Documentation/technical/api-trace2.txtJeff Hostetler via GitGitGadget, Feb 22, 2019
  131. 07/15 trace2:data: add trace2 transport child classificationJeff Hostetler via GitGitGadget, Feb 22, 2019
  132. 08/15 trace2:data: add trace2 hook classificationJeff Hostetler via GitGitGadget, Feb 22, 2019
  133. 11/15 trace2:data: add subverb to checkout commandJeff Hostetler via GitGitGadget, Feb 22, 2019
  134. 13/15 trace2:data: add subverb for rebaseJeff Hostetler via GitGitGadget, Feb 22, 2019
  135. 15/15 trace2: add for_each macros to clang-formatJeff Hostetler via GitGitGadget, Feb 22, 2019
  136. 09/15 trace2:data: add trace2 instrumentation to index read/writeJeff Hostetler via GitGitGadget, Feb 22, 2019
  137. trace2: fix up a missing "leave" entry pointÆvar Arnfjörð Bjarmason, May 10, 2019
  138. Derrick StoleeMay 10, 2019
  139. Jeff HostetlerMay 20, 2019
  140. 14/15 trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.shJeff Hostetler via GitGitGadget, Feb 22, 2019
  141. 10/15 trace2:data: pack-objects: add trace2 regionsDerrick Stolee via GitGitGadget, Feb 22, 2019
  142. 12/15 trace2:data: add subverb to reset commandJeff Hostetler via GitGitGadget, Feb 22, 2019
  143. 02/15 trace2: create new combined trace facilityJeff Hostetler via GitGitGadget, Feb 22, 2019
  144. SZEDER GáborMay 10, 2019
  145. Derrick StoleeMay 10, 2019
  146. 06/15 trace2:data: add trace2 sub-process classificationJeff Hostetler via GitGitGadget, Feb 22, 2019
  147. 05/15 trace2:data: add editor/pager child classificationJeff Hostetler via GitGitGadget, Feb 22, 2019
  148. 04/15 trace2:data: add trace2 regions to wt-statusJeff Hostetler via GitGitGadget, Feb 22, 2019
  149. SZEDER GáborJan 31, 2019
  150. Jeff HostetlerJan 31, 2019
  151. Junio C HamanoJan 31, 2019
  152. Jeff HostetlerJan 31, 2019
  153. Jeff HostetlerJan 31, 2019
  154. Junio C HamanoJan 31, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.