]> git.ipfire.org Git - thirdparty/git.git/commit - Makefile
tr2: make process info collection platform-generic
authorEmily Shaffer <emilyshaffer@google.com>
Thu, 22 Jul 2021 01:27:06 +0000 (18:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 22 Jul 2021 20:35:20 +0000 (13:35 -0700)
commitb7e6a4162207785c66a1de6f4530499925b762b6
treee4d4e75422a2435439211246b53c106eda46adba
parent107691cb07aab771585844fcd39d5e1c7f1ed14b
tr2: make process info collection platform-generic

To pave the way for non-Windows platforms to define
trace2_collect_process_info(), reorganize the stub-or-definition schema
to something which doesn't directly reference Windows.

Platforms which want to collect parent process information in the
future should:

 1. Add an implementation to compat/ (e.g. compat/somearch/procinfo.c)
 2. Add that object to COMPAT_OBJS to config.mak.uname
    (e.g. COMPAT_OBJS += compat/somearch/procinfo.o)
 3. Define HAVE_PLATFORM_PROCINFO in config.mak.uname

In the Windows case, this definition lives in
compat/win32/trace2_win32_process_info.c, which is already conditionally
added to COMPAT_OBJS; so let's add HAVE_PLATFORM_PROCINFO to hint to the
build that compat/stub/procinfo.c should not be used.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
compat/stub/procinfo.c [new file with mode: 0644]
config.mak.uname
trace2.h