Re: [PATCH] Avoid running lstat(2) on the same cache entry.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <gitster@...>
Cc: Git Mailing List <git@...>
Date: Saturday, January 19, 2008 - 3:58 pm

On Sat, 19 Jan 2008, Linus Torvalds wrote:

Btw, the easiest way to do this on Linux isn't totally obvious, because 
you cannot do a simple breakpoint on "lstat()", since GNU libc internally 
uses other names.

So if anybody wants to work on this and runs Linux, the way to do this 
trivially (once you know how) is to do

	gdb git
	..
	.. run the startup to wait for the libraries to be loaded 
	..	
	(gdb) b main
	(gdb) run commit
	..
	.. modern glibc low-level lstat() call is __lxstat64
	.. at least on x86-64
	..
	(gdb) b __lxstat64
	..
	.. Ignore the first few ones (we have 23000+ files in the index, 
	.. so don't worry about getting the *first* one)
	..
	(gdb) ignore 2 1000
	(gdb) c
	..
	.. Ok, look at that backtrace, then go to the next one by
	.. just knowing that we'll be doing 23,000+ for each iteration
	.. over the index.
	..
	.. Rinse and repeat this as required:
	..
	(gdb) where
	(gdb) ignore 2 24000
	(gdb) c

which gets you the backtraces I showed you, without having to think too 
much about all the odd lstat() calls we do for resolving refs etc.

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Updated in-memory index cleanup, Linus Torvalds, (Fri Jan 18, 11:25 pm)
[PATCH] Avoid running lstat(2) on the same cache entry., Junio C Hamano, (Sat Jan 19, 3:45 am)
Re: [PATCH] Avoid running lstat(2) on the same cache entry., Johannes Schindelin, (Sat Jan 19, 10:42 pm)
Re: [PATCH] Avoid running lstat(2) on the same cache entry., Johannes Schindelin, (Sat Jan 19, 9:48 pm)
Re: [PATCH] Avoid running lstat(2) on the same cache entry., Steffen Prohaska, (Sun Jan 20, 11:10 am)
Re: [PATCH] Avoid running lstat(2) on the same cache entry., Steffen Prohaska, (Sun Jan 20, 5:40 pm)
Re: [PATCH] Avoid running lstat(2) on the same cache entry., Johannes Schindelin, (Sun Jan 20, 11:18 am)
[PATCH] Try to resurrect the handling for 'diff-index -m', Johannes Schindelin, (Sun Jan 20, 11:21 am)
[PATCH] Also use unpack_trees() in do_diff_cache(), Johannes Schindelin, (Sun Jan 20, 11:19 am)
Re: [PATCH] Also use unpack_trees() in do_diff_cache(), Linus Torvalds, (Sun Jan 20, 4:32 pm)
Re: [PATCH] Also use unpack_trees() in do_diff_cache(), Linus Torvalds, (Sun Jan 20, 5:53 pm)
Re: [PATCH] Also use unpack_trees() in do_diff_cache(), Johannes Schindelin, (Sun Jan 20, 7:34 pm)
Re: [PATCH] Also use unpack_trees() in do_diff_cache(), Linus Torvalds, (Sun Jan 20, 7:58 pm)
Re: [PATCH] Also use unpack_trees() in do_diff_cache(), Johannes Schindelin, (Sun Jan 20, 8:19 pm)
Re: [PATCH] Avoid running lstat(2) on the same cache entry., Steffen Prohaska, (Sun Jan 20, 6:33 am)
Re: [PATCH] Avoid running lstat(2) on the same cache entry., Johannes Schindelin, (Sun Jan 20, 10:15 am)
Re: [PATCH] Avoid running lstat(2) on the same cache entry., Linus Torvalds, (Sat Jan 19, 10:02 pm)
Re: [PATCH] Avoid running lstat(2) on the same cache entry., Linus Torvalds, (Sat Jan 19, 3:58 pm)
[PATCH] index: be careful when handling long names, Junio C Hamano, (Sat Jan 19, 3:42 am)