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

Re: [PATCH v2] trace2: prevent segfault on config collection where no value specified

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 22, 2025, 18:12 UTC
Message-ID
<xmqqfrlawwd9.fsf@gitster.g>
In-Reply-To
<c1398676-ddd7-c161-e114-2249316b5311@gmx.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> This patch looks good to me!

Thanks. As I punted on reviewing the tgt_perf part, it is very good to see somebody else step in to look it over.

Will queue.
Show 22 quoted lines
>> diff --git a/trace2/tr2_tgt_perf.c b/trace2/tr2_tgt_perf.c
>> index a6f9a8a193e..19ae7433ef8 100644
>> --- a/trace2/tr2_tgt_perf.c
>> +++ b/trace2/tr2_tgt_perf.c
>> @@ -446,8 +446,9 @@ static void fn_param_fl(const char *file, int line, const char *param,
>>  	struct strbuf scope_payload = STRBUF_INIT;
>>  	enum config_scope scope = kvi->scope;
>>  	const char *scope_name = config_scope_name(scope);
>> -
>> -	strbuf_addf(&buf_payload, "%s:%s", param, value);
>> +	strbuf_addstr(&buf_payload, param);
>> +	if (value)
>> +		strbuf_addf(&buf_payload, ":%s", value);
>>  	strbuf_addf(&scope_payload, "%s:%s", "scope", scope_name);
>>
>>  	perf_io_write_fl(file, line, event_name, NULL, NULL, NULL,
>>
>> base-commit: 8f8d6eee531b3fa1a8ef14f169b0cb5035f7a772
>> --
>> gitgitgadget
>>
>>
Previous: Johannes SchindelinNext: Junio C Hamano
Message 7 of 11 in “trace2: prevent segfault on config collection where no value specified”
  1. trace2: prevent segfault on config collection where no value specifiedAdam Murray via GitGitGadget, Nov 7, 2024
  2. Jeff KingNov 7, 2024
  3. Junio C HamanoNov 7, 2024
  4. trace2: prevent segfault on config collection where no value specifiedAdam Murray via GitGitGadget, Jan 10, 2025
  5. Junio C HamanoJan 10, 2025
  6. Johannes SchindelinJan 22, 2025
  7. Junio C HamanoJan 22, 2025
  8. Junio C HamanoJan 22, 2025
  9. D. Ben KnobleJan 23, 2025
  10. Junio C HamanoJan 23, 2025
  11. D. Ben KnobleJan 23, 2025

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.