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

Re: [PATCH] trace2: log progress time and throughput

From
Chris Torek <chris.torek@gmail.com>
Date
Jun 23, 2021, 03:29 UTC
Message-ID
<CAPx1Gve_KqzQHanDDTSJ_2QywzNybq-J3wkG8xBC_DUhwVB5Fg@mail.gmail.com>
In-Reply-To
<YNKiv2Ar77xAxixz@nand.local>
On Tue, Jun 22, 2021 at 7:56 PM Taylor Blau <me@ttaylorr.com> wrote:
>... I was going to comment on the fact that "(*p_progress)->total" could
> be written simply as "*p_progress->total", but I'm (a) not sure that I
> actually prefer the latter to the former, and (b) I find that kind of
> style comment generally useless.

Also, it can't. :-) The binding order is wrong; *p_progress->total binds as *(p_progress->total), and `p_progress` has to be followed first, so this just doesn't work.

(Go does precedence and operator syntax a bit better than does C, but even in Go one must still parenthesize certain pointer-following operations.)

> But it may make sense to sidestep the whole thing and have a "struct
> progress *progress = *p_progress" (that is assigned after we check
> p_progress to make sure it's non-NULL) like in stop_progress_msg, which
> would clean up a lot of this.
This is the way to go.
Chris
Previous: Taylor BlauNext: Taylor Blau
Message 16 of 17 in “trace2: log progress time and throughput”
  1. trace2: log progress time and throughputEmily Shaffer, May 12, 2020
  2. Junio C HamanoMay 12, 2020
  3. Josh SteadmonMay 13, 2020
  4. Derrick StoleeMay 15, 2020
  5. Junio C HamanoMay 15, 2020
  6. Junio C HamanoMay 15, 2020
  7. Derrick StoleeMay 15, 2020
  8. Junio C HamanoMay 15, 2020
  9. Jeff HostetlerMay 15, 2020
  10. Jeff HostetlerMay 15, 2020
  11. Ævar Arnfjörð BjarmasonJun 21, 2021
  12. Elijah NewrenJun 21, 2021
  13. Ævar Arnfjörð BjarmasonJun 21, 2021
  14. Elijah NewrenJun 21, 2021
  15. Taylor BlauJun 23, 2021
  16. Chris TorekJun 23, 2021
  17. Taylor BlauJun 23, 2021

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.