git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [RFC PATCH 0/3] trace2: log "signal" end events if we invoke BUG()
@ 2022-05-26  0:30 Ævar Arnfjörð Bjarmason
  2022-05-26  0:30 ` [RFC PATCH 1/3] test-tool: don't fake up BUG() exits as code 99 Ævar Arnfjörð Bjarmason
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-05-26  0:30 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Josh Steadmon, Calvin Wan, Emily Shaffer,
	Glen Choo, John Cai, Ævar Arnfjörð Bjarmason

Josh Steadmon noted in the Review Club tonight/today/yesterday
(depending on the TZ) that he'd encountered trace2 event streams
without an "exit" event, which as discussed can be seen from usage.c
is due to our invoking of abort() there.

This RFC series aims to rectify that, first we back out of test-tool
specific behavior for BUG() in 1/3, and in 3/3 define abort() to be a
wrapper macro like what we do for exit() already.

I'm not sure about the direction of emitting such a "signal" event,
should we just "fake it" and emit an "exit" event? Probably not, but
I'm not confident in that. For one is the exit code (as in what a
shell would get from $?) when we're killed with SIGABRT guaranteed to
be portable?

But hopefully this gets the ball rolling on a good fix for this by
starting a discussion about what we should be doing here.

One alternate way of dealing with this would be to first split up the
"error" event so that we don't emit "error" for all of BUG(), die(),
error() and warning(), and to instead split those up into "BUG",
"die", "error", "warning".

Once we did that we could pretty much declare that the current
behavior before this series is a feature, and that anyone parsing
trace2 output needs to deal with the stream potentially ending in a
"BUG" event.

Any such event parser will need to deal with at least:

    "start" -> ["exit" | "signal"] (with this series)

So perhaps it's OK to simply say that consumers should expect?

   # Or "error" now, but then you can't distinguish "BUG()" from the
   # rest.
    "start" -> ["exit" | "BUG"]

I think I like that less, but it's worth pointing out as an
alternative. The implementation would certainly be smaller than this
proposed RFC.

Ævar Arnfjörð Bjarmason (3):
  test-tool: don't fake up BUG() exits as code 99
  refs API: rename "abort" callback to avoid macro clash
  trace2: emit "signal" events after calling BUG()

 Documentation/technical/api-trace2.txt | 13 +++++++++----
 git-compat-util.h                      |  9 +++++++++
 refs/debug.c                           |  4 ++--
 refs/files-backend.c                   |  4 ++--
 refs/iterator.c                        |  8 ++++----
 refs/packed-backend.c                  |  2 +-
 refs/ref-cache.c                       |  2 +-
 refs/refs-internal.h                   |  2 +-
 t/helper/test-tool.c                   |  1 -
 t/t0210-trace2-normal.sh               |  5 ++---
 t/t1406-submodule-ref-store.sh         | 10 +++++-----
 t/test-lib-functions.sh                | 13 +++++++++++++
 trace2.c                               | 19 +++++++++++++++++++
 trace2.h                               |  8 ++++++++
 trace2/tr2_tgt.h                       |  3 +++
 trace2/tr2_tgt_event.c                 | 11 +++++++++--
 trace2/tr2_tgt_normal.c                | 11 +++++++++--
 trace2/tr2_tgt_perf.c                  | 11 +++++++++--
 usage.c                                |  5 -----
 19 files changed, 106 insertions(+), 35 deletions(-)

-- 
2.36.1.1046.g586767a6996


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-06-09 15:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26  0:30 [RFC PATCH 0/3] trace2: log "signal" end events if we invoke BUG() Ævar Arnfjörð Bjarmason
2022-05-26  0:30 ` [RFC PATCH 1/3] test-tool: don't fake up BUG() exits as code 99 Ævar Arnfjörð Bjarmason
2022-06-03 19:25   ` Junio C Hamano
2022-06-03 21:05     ` Junio C Hamano
2022-06-03 23:05       ` Ævar Arnfjörð Bjarmason
2022-06-08 19:17       ` Jeff King
2022-06-08 21:03         ` Junio C Hamano
2022-06-09  8:09         ` Ævar Arnfjörð Bjarmason
2022-06-09 15:23           ` Jeff King
2022-06-03 23:03     ` Ævar Arnfjörð Bjarmason
2022-05-26  0:30 ` [RFC PATCH 2/3] refs API: rename "abort" callback to avoid macro clash Ævar Arnfjörð Bjarmason
2022-05-26  0:30 ` [RFC PATCH 3/3] trace2: emit "signal" events after calling BUG() Ævar Arnfjörð Bjarmason
2022-05-26  3:04   ` Bagas Sanjaya
2022-05-31 18:16   ` Josh Steadmon
2022-05-26  1:20 ` [RFC PATCH 0/3] trace2: log "signal" end events if we invoke BUG() Junio C Hamano
2022-05-31 17:59   ` Josh Steadmon

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).