Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trace2: A few final fixups from upstream/master targeting 2.22.0-RC #139

Merged
merged 4 commits into from
May 24, 2019

Conversation

jeffhostetler
Copy link

Here are 4 commits that were added to upstream/master after I pulled the last round
of trace2 changes from upstream. These are not essential, but may prevent a few compiler
or runtime problems.

These were taken from the following gitster branches.

jh/trace2:
22a7338 trace2: fix incorrect function pointer check

jh/trace2 and ab/trace2-typofix:
c173542 trace2: fix up a missing "leave" entry point

tb/trace2-va-list-fix:
ad006fe trace2: NULL is not allowed for va_list

jh/trace2-sid-fix:
f672dee trace2: fixup access problem on /etc/gitconfig in read_very_early_config (modified on merge)

I did not bring over the gitster/js/trace2-to-directory branch because we don't
need it with our usage pattern.

steadmon and others added 4 commits May 22, 2019 12:52
Fix trace2_data_json_fl() to check for the presence of pfn_data_json_fl
in its targets, rather than pfn_data_fl, which is not actually called.

Signed-off-by: Josh Steadmon <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Fix a trivial bug that's been here since the shared/do_write_index
tracing was added in 42fee7a ("trace2:data: add trace2
instrumentation to index read/write", 2019-02-22). We should have
enter/leave points, not two enter/enter points. This resulted in an
"enter" event without a corresponding "leave" event.

Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Acked-by: Derrick Stolee <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Some compilers don't allow NULL to be passed for a va_list,
and e.g. "gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516"
errors out like this:
 trace2/tr2_tgt_event.c:193:18:
   error: invalid operands to binary &&
   (have ‘int’ and ‘va_list {aka __va_list}’)
    if (fmt && *fmt && ap) {
                       ^^
I couldn't find any hints that va_list and pointers can be mixed,
and no hints that they can't either. Morten Welinder comments:

"C99, Section 7.15, simply says that va_list "is an object type suitable for
holding information needed by the macros va_start, va_end, and
va_copy". So clearly not guaranteed to be mixable with pointers...

The portable solution is to use "va_list" everywhere in the callchain.
As a consequence, both trace2_region_enter_fl() and trace2_region_leave_fl()
now take a variable argument list.

Signed-off-by: Torsten Bögershausen <[email protected]>
Acked-by: Jeff Hostetler <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
   NOTE: This commit was modified when merged into the vfs-2.21 series
   NOTE: to account for programdata config in addition to etc/gitconfig.

Teach do_git_config_sequence() to optionally gently check for access to
the system config.  Use this option in read_very_early_config() when
initializing trace2.

In [1] SZEDER Gábor reported that my changes in [2] introduced a
regression when the user does not have permission to read the system
config.

This commit addresses that problem by optionally ignoring that error.

[1] https://public-inbox.org/git/285beb2b2d740ce20fdd8af1becf371ab39703db.1554995916.git.gitgitgadget@gmail.com/T/#m342e839289aec515523a98b5e34d7f42d3f1fd79
[2] https://public-inbox.org/git/285beb2b2d740ce20fdd8af1becf371ab39703db.1554995916.git.gitgitgadget@gmail.com/T/#m11b59c9228c698442f750ee8f9b10c629399ae48

Signed-off-by: Jeff Hostetler <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to me!

@jeffhostetler jeffhostetler merged commit a7cf9ec into microsoft:vfs-2.21.0 May 24, 2019
derrickstolee added a commit to microsoft/VFSForGit that referenced this pull request Jun 12, 2019
Updates to v2.22.0.vfs.1 as discussed in  microsoft/git#140.

Includes these changes in microsoft/git:

* microsoft/git#133
* microsoft/git#139
* microsoft/git#141
* microsoft/git#143

Also, the `post-indexchanged` hook was renamed to `post-index-change` as it was upstreamed.
@jeffhostetler jeffhostetler deleted the jh-vfs221-fixups branch November 25, 2019 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants