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

Re: [PATCH] Trace into open fd and refactor tracing code.

From
Junio C Hamano <junkio@cox.net>
Date
Aug 31, 2006, 21:31 UTC
Message-ID
<7vsljc8udx.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0608311409470.27779@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 7 quoted lines
> That way, if you want to do the fd thing, you can always just do
>
> 	GIT_TRACE=/proc/self/fd/9 make test 9>/var/tmp/trace.log
>
> although I really don't know how well that works across a fork/exec that 
> may or may not be closing the file descriptor (I think it's much simpler 
> and more obvious to just give the filename directly).

Actually it was me who suggested the use of fd directly, along with trying to do one message in a single write (i.e. not doing stdio as much as possible).

Process A has fd=9 opened to /var/tmp/trace.log and forks process B.

(1) process B execs something else, and just writes into fd=9
or
(2) process B execs something else, perhaps after closing fd=9,
    and the exec'ed image opens /var/tmp/trace.log with
    "O_APPEND|O_CREAT" and gets a fd; it writes into this fd.

I somehow felt there would be less interference between writes issued by process A and process B, but probably I am mistaken.

Previous: Linus TorvaldsNext: Linus Torvalds
Message 3 of 4 in “Trace into open fd and refactor tracing code.”
  1. Trace into open fd and refactor tracing code.Christian Couder, Aug 31, 2006
  2. Linus TorvaldsAug 31, 2006
  3. Junio C HamanoAug 31, 2006
  4. Linus TorvaldsAug 31, 2006

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.