Re: [PATCH v5] tr2: log parent process name
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 16, 2021, 08:42 UTC
- Message-ID
- <xmqqo8c6p5e9.fsf@gitster.g>
- In-Reply-To
- <20210608221059.1935021-1-emilyshaffer@google.com>
Emily Shaffer <emilyshaffer@google.com> writes:
Other than your back-and-forth with Randall on NonStop specifics that didn't result in any code change, there was no comment on this patch. Are other people totally happy with this version, or are they totally uninterested?
Show 18 quoted lines
> + if (reason == TRACE2_PROCESS_INFO_STARTUP) {
> + /*
> + * NEEDSWORK: we could do the entire ptree in an array instead,
> + * see compat/win32/trace2_win32_process_info.c.
> + */
> + struct strvec names = STRVEC_INIT;
> +
> + get_ancestry_names(&names);
> +
> + if (names.nr == 0) {
>
> + strvec_clear(&names);
> + return;
> + }
>
> + trace2_cmd_ancestry(names.v);
> +
> + strvec_clear(&names);Micronit. CodingGuidelines tells us not to explicitly compare with constant 0, '\0', or NULL. It may be more concise and easier to follow if written like this:
get_ancestry_names(&names); if (names.nr) trace2_cmd_ancestry(names.v); strvec_clear(&names);
Thanks.