From b7e6a4162207785c66a1de6f4530499925b762b6 Mon Sep 17 00:00:00 2001 From: Emily Shaffer Date: Wed, 21 Jul 2021 18:27:06 -0700 Subject: 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 Helped-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- trace2.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'trace2.h') diff --git a/trace2.h b/trace2.h index ede18c2e06..0d990db817 100644 --- a/trace2.h +++ b/trace2.h @@ -492,13 +492,7 @@ enum trace2_process_info_reason { TRACE2_PROCESS_INFO_EXIT, }; -#if defined(GIT_WINDOWS_NATIVE) void trace2_collect_process_info(enum trace2_process_info_reason reason); -#else -#define trace2_collect_process_info(reason) \ - do { \ - } while (0) -#endif const char *trace2_session_id(void); -- cgit v1.2.3