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

Re: [PATCH] trace2 tests: guard pthread test with "PTHREAD"

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 25, 2022, 06:41 UTC
Message-ID
<xmqqilj3edtr.fsf@gitster.g>
In-Reply-To
<patch-1.1-f7f21c94a6c-20221124T214813Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
Show 9 quoted lines
> Since 81071626ba1 (trace2: add global counter mechanism, 2022-10-24)
> these tests have been failing when git is compiled with NO_PTHREADS=Y,
> which is always the case e.g. if 'uname -s' is "NONSTOP_KERNEL".
>
> Reported-by: Randall S. Becker <randall.becker@nexbridge.ca>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  t/t0211-trace2-perf.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
Makes sense, to sweep the immediate breakage under prerequisite.

But why would a global counter need threading? I know that the counters can optionally report per-thread stats, but that is optional and it would still be useful if we can count events in a single-threaded program, no?

Show 23 quoted lines
>
> diff --git a/t/t0211-trace2-perf.sh b/t/t0211-trace2-perf.sh
> index 0b3436e8cac..b4e91351181 100755
> --- a/t/t0211-trace2-perf.sh
> +++ b/t/t0211-trace2-perf.sh
> @@ -203,7 +203,7 @@ test_expect_success 'stopwatch timer test/test1' '
>  	have_timer_event "main" "timer" "test" "test1" 5 actual
>  '
>  
> -test_expect_success 'stopwatch timer test/test2' '
> +test_expect_success PTHREAD 'stopwatch timer test/test2' '
>  	test_when_finished "rm trace.perf actual" &&
>  	test_config_global trace2.perfBrief 1 &&
>  	test_config_global trace2.perfTarget "$(pwd)/trace.perf" &&
> @@ -249,7 +249,7 @@ test_expect_success 'global counter test/test1' '
>  	have_counter_event "main" "counter" "test" "test1" 15 actual
>  '
>  
> -test_expect_success 'global counter test/test2' '
> +test_expect_success PTHREAD 'global counter test/test2' '
>  	test_when_finished "rm trace.perf actual" &&
>  	test_config_global trace2.perfBrief 1 &&
>  	test_config_global trace2.perfTarget "$(pwd)/trace.perf" &&
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 2 of 6 in “trace2 tests: guard pthread test with "PTHREAD"”
  1. trace2 tests: guard pthread test with "PTHREAD"Ævar Arnfjörð Bjarmason, Nov 24, 2022
  2. Junio C HamanoNov 25, 2022
  3. Ævar Arnfjörð BjarmasonNov 25, 2022
  4. Jeff HostetlerNov 28, 2022
  5. Ævar Arnfjörð BjarmasonNov 28, 2022
  6. Jeff HostetlerNov 30, 2022

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.