[PATCH v7 14/16] git: add performance tracing for git's main() function to debug scripts

2014-07-01 Thread Karsten Blees
7 s: git command: 'git' 'config' '--get-color' 'color.interactive.help' 'red bold' 23:57:38.650465 trace.c:405 performance: 0.000243063 s: git command: 'git' 'config' '--get-color' '' 'reset&#

[PATCH v7 13/16] trace: add trace_performance facility to debug performance issues

2014-07-01 Thread Karsten Blees
/* ignore */ } trace_performance(t, "frotz"); Signed-off-by: Karsten Blees --- trace.c | 47 +++ trace.h | 18 ++ 2 files changed, 65 insertions(+) diff --git a/trace.c b/trace.c index b9d7272..af64dbb 100644 --- a/trace.c +++ b/trace.c @@ -1

[PATCH v7 12/16] trace: add high resolution timer function to debug performance issues

2014-07-01 Thread Karsten Blees
h_absolute_time + mach_timebase_info Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- Makefile | 7 + config.mak.uname | 1 + trace.c | 82 trace.h | 1 + 4 files changed, 91 insertions(+) diff --g

[PATCH v7 10/16] trace: move code around, in preparation to file:line output

2014-07-01 Thread Karsten Blees
No functional changes, just move stuff around so that the next patch isn't that ugly... Signed-off-by: Karsten Blees --- trace.c | 36 ++-- trace.h | 12 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/trace.c b/trace.c index 18

[PATCH v7 11/16] trace: add 'file:line' to all trace output

2014-07-01 Thread Karsten Blees
er (currently there are 30 *.c files of length 18 and just 11 of 19). Trace output from longer source files (e.g. builtin/receive-pack.c) will not be aligned. Signed-off-by: Karsten Blees --- git-compat-util.h | 4 trace.c | 72 +

[PATCH v7 09/16] trace: add current timestamp to all trace output

2014-07-01 Thread Karsten Blees
processes are involved). Signed-off-by: Karsten Blees --- trace.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/trace.c b/trace.c index a194b16..18e5d93 100644 --- a/trace.c +++ b/trace.c @@ -88,6 +88,9 @@ static const char err_msg[] = "Could not trace into fd

[PATCH v7 08/16] trace: disable additional trace output for unit tests

2014-07-01 Thread Karsten Blees
Some unit-tests use trace output to verify internal state, and unstable output such as timestamps and line numbers are not useful there. Disable additional trace output if GIT_TRACE_BARE is set. Signed-off-by: Karsten Blees --- t/test-lib.sh | 4 trace.c | 6 ++ 2 files changed

[PATCH v7 07/16] trace: add infrastructure to augment trace output with additional info

2014-07-01 Thread Karsten Blees
an print arbitrary binary data (without barfing on '%' or stopping at '\0'), so 'data' seems more appropriate. Signed-off-by: Karsten Blees --- trace.c | 47 +-- trace.h | 2 +- 2 files changed, 34 insertions(+), 1

[PATCH v7 06/16] sha1_file: change GIT_TRACE_PACK_ACCESS logging to use trace API

2014-07-01 Thread Karsten Blees
This changes GIT_TRACE_PACK_ACCESS functionality as follows: * supports the same options as GIT_TRACE (e.g. printing to stderr) * no longer supports relative paths * appends to the trace file rather than overwriting Signed-off-by: Karsten Blees --- Documentation/git.txt | 4

[PATCH v7 05/16] Documentation/git.txt: improve documentation of 'GIT_TRACE*' variables

2014-07-01 Thread Karsten Blees
Separate GIT_TRACE description into what it prints and how to configure where trace output is printed to. Change other GIT_TRACE_* descriptions to refer to GIT_TRACE. Add descriptions for GIT_TRACE_SETUP and GIT_TRACE_SHALLOW. Signed-off-by: Karsten Blees --- Documentation/git.txt | 50

[PATCH v7 04/16] trace: improve trace performance

2014-07-01 Thread Karsten Blees
use a static 'struct trace_key' instead of a string constant. In trace.c::get_trace_fd(), save and reuse the file descriptor in 'struct trace_key'. Add a 'trace_disable()' API, so that packet_trace() can cleanly disable tracing when it encounters packed data (instead o

[PATCH v7 03/16] trace: remove redundant printf format attribute

2014-07-01 Thread Karsten Blees
trace_printf_key() is the only non-static function that duplicates the printf format attribute in the .c file, remove it for consistency. Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- trace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/trace.c b/trace.c index 37a7fa9

[PATCH v7 01/16] trace: move trace declarations from cache.h to new trace.h

2014-07-01 Thread Karsten Blees
Also include direct dependencies (strbuf.h and git-compat-util.h for __attribute__) so that trace.h can be used independently of cache.h, e.g. in test programs. Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- cache.h | 13 ++--- trace.h | 17 + 2 files

[PATCH v7 02/16] trace: consistently name the format parameter

2014-07-01 Thread Karsten Blees
The format parameter to trace_printf functions is sometimes abbreviated 'fmt'. Rename to 'format' everywhere (consistent with POSIX' printf specification). Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- trace.c | 22 +++--- trace.h |

[PATCH v7 00/16] add performance tracing facility

2014-07-01 Thread Karsten Blees
anged save resolving conflicts. Karsten Blees (16): trace: move trace declarations from cache.h to new trace.h trace: consistently name the format parameter trace: remove redundant printf format attribute trace: improve trace performance Documentation/git.txt: improve documentation of &#

Re: [RFC/PATCH] notes-util.c: replace git_config with git_config_get_string

2014-06-30 Thread Karsten Blees
Am 30.06.2014 16:39, schrieb Tanay Abhra: > > On 6/30/2014 7:04 PM, Karsten Blees wrote: >> Am 29.06.2014 13:01, schrieb Eric Sunshine: >>> On Thu, Jun 26, 2014 at 4:19 AM, Tanay Abhra wrote: >>>> On 6/25/2014 1:24 PM, Eric Sunshine wrote: >>>>&

Re: [RFC/PATCH] notes-util.c: replace git_config with git_config_get_string

2014-06-30 Thread Karsten Blees
Am 30.06.2014 16:32, schrieb Eric Sunshine: > On Mon, Jun 30, 2014 at 9:34 AM, Karsten Blees > wrote: >> Am 29.06.2014 13:01, schrieb Eric Sunshine: >>> On Thu, Jun 26, 2014 at 4:19 AM, Tanay Abhra wrote: >>>> On 6/25/2014 1:24 PM, Eric Sunshine wrote: >

Re: [RFC/PATCH] notes-util.c: replace git_config with git_config_get_string

2014-06-30 Thread Karsten Blees
Am 29.06.2014 13:01, schrieb Eric Sunshine: > On Thu, Jun 26, 2014 at 4:19 AM, Tanay Abhra wrote: >> On 6/25/2014 1:24 PM, Eric Sunshine wrote: >>> On Mon, Jun 23, 2014 at 6:41 AM, Tanay Abhra wrote: Use git_config_get_string instead of git_config to take advantage of the config hash-ta

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-28 Thread Karsten Blees
Am 28.06.2014 08:01, schrieb Matthieu Moy: > Karsten Blees writes: > >> I still don't like that the invalidation is done in git_config_set, though, >> as >> this is also used to write completely unrelated files. > > I don't get it. It is used to w

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-27 Thread Karsten Blees
ly to have multiple copies may reduce memory footprint and speed up string comparisons. Add a strintern() API that uses a hashmap to manage the pool of interned strings. Signed-off-by: Karsten Blees --- Documentation/technical/api-hashmap.txt | 11 +++ hashmap.c

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-27 Thread Karsten Blees
Am 27.06.2014 13:55, schrieb Matthieu Moy: > Karsten Blees writes: > >> If for some reason a config string is accessed after config_cache_free() >> (which would be a bug), you won't notice if strings are xstrdup()ed (i.e. git >> will continue to run with some invali

Re: [PATCH v3 2/3] config: add hashtable for config parsing & retrieval

2014-06-27 Thread Karsten Blees
Am 26.06.2014 23:21, schrieb Junio C Hamano: > Karsten Blees writes: > >>> Because I had an experience under my belt of a painful refactoring >>> of "the_index" which turned out to be not just a single array, I >>> simply suspect that the final data

Re: [RFC/PATCH] imap-send.c: replace git_config with git_config_get_string

2014-06-26 Thread Karsten Blees
Am 26.06.2014 18:50, schrieb Matthieu Moy: > Tanay Abhra writes: > >> +if (!git_config_get_string("imap.user", &value)) >> +server.user = xstrdup(value); >> +if (!git_config_get_string("imap.pass", &value)) >> +server.pass = xstrdup(value); >> +if (!git_config_

Re: [PATCH v3 2/3] config: add hashtable for config parsing & retrieval

2014-06-26 Thread Karsten Blees
Am 26.06.2014 21:00, schrieb Junio C Hamano: > Matthieu Moy writes: > >> Junio C Hamano writes: >> >>> When the submodule script that uses "git config -f .gitmodules" is >>> converted into C, if the updated config API is ready, it may be able >>> to do something like these in a single program: >

Re: [RFC/PATCH] pager.c: replace git_config with git_config_get_string

2014-06-26 Thread Karsten Blees
Am 25.06.2014 05:59, schrieb Eric Sunshine: > On Mon, Jun 23, 2014 at 6:41 AM, Tanay Abhra wrote: [...] >> /* returns 0 for "no pager", 1 for "use pager", and -1 for "not specified" >> */ >> int check_pager_config(const char *cmd) >> { >> - struct pager_config c; >> - c.cmd = cmd

Re: [PATCH v20 13/48] refs.c: make resolve_ref_unsafe set errno to something meaningful on error

2014-06-26 Thread Karsten Blees
Am 20.06.2014 16:42, schrieb Ronnie Sahlberg: > + errno = ELOOP; This fails on MinGW and MSVC < 2010. Perhaps add this to compat/mingw.h? #ifndef ELOOP #define ELOOP EMLINK #endif -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to

Re: [PATCH v3 2/3] config: add hashtable for config parsing & retrieval

2014-06-25 Thread Karsten Blees
Am 23.06.2014 12:11, schrieb Tanay Abhra: [...] > + > +static struct config_cache_entry *config_cache_find_entry(const char *key) > +{ > + struct hashmap *config_cache; > + struct config_cache_entry k; > + struct config_cache_entry *found_entry; > + char *normalized_key; > + i

Re: [PATCH v3 2/3] config: add hashtable for config parsing & retrieval

2014-06-25 Thread Karsten Blees
Am 24.06.2014 14:06, schrieb Tanay Abhra: > On 6/23/2014 5:25 PM, Matthieu Moy wrote: >> Tanay Abhra writes: >> >>> +/* for NULL values, 'util' for each `string_list_item` is flagged as 1 */ >> >> It's a void *, so just saying that it is flagged as 1 does not say how >> it's encoded. How about "..

Re: [PATCH v3 2/3] config: add hashtable for config parsing & retrieval

2014-06-25 Thread Karsten Blees
Am 25.06.2014 20:13, schrieb Junio C Hamano: > Ramsay Jones writes: > >> On 24/06/14 00:25, Junio C Hamano wrote: >> ... >>> Yup, that is a very good point. There needs an infrastructure to >>> tie a set of files (i.e. the standard one being the chain of >>> system-global /etc/gitconfig to repo-

Re: [PATCH v5 00/11] add performance tracing facility

2014-06-25 Thread Karsten Blees
Am 25.06.2014 16:28, schrieb Duy Nguyen: > On Wed, Jun 11, 2014 at 2:55 PM, Karsten Blees > wrote: >> Here's v5 of the performance tracing patch series, now including a bunch of >> cleanups and adding timestamp, file and line to all trace output. >> >> I&#x

Re: Git-status / preload_index() performance

2014-06-24 Thread Karsten Blees
Am 25.06.2014 01:12, schrieb David Turner: > On Wed, 2014-06-25 at 00:52 +0200, Karsten Blees wrote: >> Even more time is spent unpacking the HEAD tree, even with hot cache >> (repacking with depth 10 reduces this to ~250ms, on SSD its just 7ms). >> Perhaps caching the

[PATCH (performance tracing)] test git-status performance

2014-06-24 Thread Karsten Blees
Add trace_performance output to functions involved in git-status. Signed-off-by: Karsten Blees --- Applies on top of performance-tracing topic. builtin/commit.c | 8 preload-index.c | 4 read-cache.c | 2 ++ wt-status.c | 11 +++ 4 files changed, 25

[PATCH (experimental)] preload-index: make parallel IO configurable

2014-06-24 Thread Karsten Blees
IO). Signed-off-by: Karsten Blees --- Applies on top of "preload-index: optimize for sequential IO". preload-index.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/preload-index.c b/preload-index.c index 6ac368d..5fe5521 100644 --- a/prelo

[PATCH] preload-index: optimize for sequential IO

2014-06-24 Thread Karsten Blees
by path, this implicitly increases IO locality. This improves cold cache performance of preload_index() by ~20% and hot cache performance by ~15%. Total improvement of e.g. 'git status -uno' on WebKit is ~15% (cold cache) and ~5% (hot cache). Signed-off-by: Karsten Blees --- preload-in

Git-status / preload_index() performance

2014-06-24 Thread Karsten Blees
Putting the new trace_performance functions to good use, here are a few observations about git-status performance. Comes with three patches (mostly independent, not a patch series!): * [PATCH] preload-index: optimize for sequential IO Improves preload-index performance, should apply anywhere

Re: [PATCH v6 00/11] add performance tracing facility

2014-06-20 Thread Karsten Blees
Am 21.06.2014 00:49, schrieb Philip Oakley: > Should there be some documentation as well? Perhaps in t/README, or in > Documentation/howto. I'll add Documentation/technical/api-trace.txt when I find the time. But lets settle on the final API first. -- To unsubscribe from this list: send the line "

Re: [PATCH v6 05/11] trace: add infrastructure to augment trace output with additional info

2014-06-20 Thread Karsten Blees
Am 21.06.2014 00:33, schrieb Junio C Hamano: > Karsten Blees writes: > >> To be able to add a common prefix or suffix to all trace output (e.g. >> a timestamp or file:line of the caller), factor out common setup and >> cleanup tasks of the trace* functions. >> >&

[PATCH v6 11/11] git: add performance tracing for git's main() function to debug scripts

2014-06-20 Thread Karsten Blees
7 s: git command: 'git' 'config' '--get-color' 'color.interactive.help' 'red bold' 23:57:38.650465 trace.c:405 performance: 0.000243063 s: git command: 'git' 'config' '--get-color' '' 'reset' 23:57:38.654

[PATCH v6 09/11] trace: add high resolution timer function to debug performance issues

2014-06-20 Thread Karsten Blees
h_absolute_time + mach_timebase_info Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- Makefile | 7 + config.mak.uname | 1 + trace.c | 82 trace.h | 1 + 4 files changed, 91 insertions(+) diff --g

[PATCH v6 10/11] trace: add trace_performance facility to debug performance issues

2014-06-20 Thread Karsten Blees
/* ignore */ } trace_performance(t, "frotz"); Signed-off-by: Karsten Blees --- trace.c | 47 +++ trace.h | 18 ++ 2 files changed, 65 insertions(+) diff --git a/trace.c b/trace.c index 88e05b9..65cd887 100644 --- a/trace.c +++ b/trace.c @@ -1

[PATCH v6 08/11] trace: add 'file:line' to all trace output

2014-06-20 Thread Karsten Blees
er (currently there are 30 *.c files of length 18 and just 11 of 19). Trace output from longer source files (e.g. builtin/receive-pack.c) will not be aligned. Signed-off-by: Karsten Blees --- git-compat-util.h | 4 trace.c | 72 +

[PATCH v6 07/11] trace: move code around, in preparation to file:line output

2014-06-20 Thread Karsten Blees
No functional changes, just move stuff around so that the next patch isn't that ugly... Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- trace.c | 36 ++-- trace.h | 12 2 files changed, 26 insertions(+), 22 deletions(-) diff --

[PATCH v6 06/11] trace: add current timestamp to all trace output

2014-06-20 Thread Karsten Blees
processes are involved). Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- trace.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/trace.c b/trace.c index 9fa406e..9fa6cc7 100644 --- a/trace.c +++ b/trace.c @@ -81,6 +81,10 @@ static int trace_bare = -1

[PATCH v6 05/11] trace: add infrastructure to augment trace output with additional info

2014-06-20 Thread Karsten Blees
al file IO). While we're at it, rename trace_strbuf's 'buf' argument, which suggests that the function is modifying the buffer. Trace_strbuf() currently is the only trace API that can print arbitrary binary data (without barfing on '%' or stopping at '\0'), so 

[PATCH v6 04/11] trace: factor out printing to the trace file

2014-06-20 Thread Karsten Blees
formatting. Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- trace.c | 37 +++-- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/trace.c b/trace.c index 3e31558..b7ca51b 100644 --- a/trace.c +++ b/trace.c @@ -62,6 +62,21 @@ static int

[PATCH v6 02/11] trace: consistently name the format parameter

2014-06-20 Thread Karsten Blees
The format parameter to trace_printf functions is sometimes abbreviated 'fmt'. Rename to 'format' everywhere (consistent with POSIX' printf specification). Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- trace.c | 22 +++--- trace.h |

[PATCH v6 03/11] trace: remove redundant printf format attribute

2014-06-20 Thread Karsten Blees
trace_printf_key() is the only non-static function that duplicates the printf format attribute in the .c file, remove it for consistency. Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- trace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/trace.c b/trace.c index 37a7fa9

[PATCH v6 00/11] add performance tracing facility

2014-06-20 Thread Karsten Blees
e_performance[_since]() return value and the respective usage example. Renamed trace_performance_vfl to trace_performance_vprintf_fl. The other patches are the versions from pu. Karsten Blees (11): trace: move trace declarations from cache.h to new trace.h trace: consiste

[PATCH v6 01/11] trace: move trace declarations from cache.h to new trace.h

2014-06-20 Thread Karsten Blees
Also include direct dependencies (strbuf.h and git-compat-util.h for __attribute__) so that trace.h can be used independently of cache.h, e.g. in test programs. Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- cache.h | 13 ++--- trace.h | 17 + 2 files

Re: [PATCH v5 00/11] add performance tracing facility

2014-06-18 Thread Karsten Blees
Am 12.06.2014 20:30, schrieb Junio C Hamano: > Karsten Blees writes: > >> Here's v5 of the performance tracing patch series, now including a bunch of >> cleanups and adding timestamp, file and line to all trace output. >> >> I'm particularly interested in

Re: [PATCH v5 09/11] trace: add high resolution timer function to debug performance issues

2014-06-18 Thread Karsten Blees
Am 17.06.2014 18:44, schrieb Junio C Hamano: > Karsten Blees writes: > >> Am 11.06.2014 10:01, schrieb Karsten Blees: >>> the epoch allows using the results (div 10e9) with other time-related APIs. >> >> s/10e9/1e9/ > > That replacement is fine but the &q

Re: [PATCH v5 10/11] trace: add trace_performance facility to debug performance issues

2014-06-18 Thread Karsten Blees
Am 17.06.2014 19:11, schrieb Junio C Hamano: > Karsten Blees writes: > >> Simple use case (measure one code section): >> >> uint64_t start = getnanotime(); >> /* code section to measure */ >> trace_performance_since(start, "foobar"); >> &

Re: [PATCH 0/7] Second part of msysgit/unicode

2014-06-17 Thread Karsten Blees
Am 11.06.2014 11:37, schrieb Stepan Kasal: > This is the second part of the time-proven unicode suport branch from msysgit. > This batch is a collection of small independent changes, limited to mingw.c. > The only exception is the last patch: it changes gitk and git-gui. > I'm missing the other t

Re: [PATCH 1/5] hashmap: add enum for hashmap free_entries option

2014-06-17 Thread Karsten Blees
Am 12.06.2014 21:12, schrieb Junio C Hamano: > Karsten Blees writes: > >> Am 10.06.2014 12:17, schrieb Heiko Voigt: >>> The intention of Jonathans critique here[1] was that you do not see what >>> this parameter does on the callsite. I.e.: >>> >>>

[PATCH 7/6] Win32: reliably detect console pipe handles

2014-06-13 Thread Karsten Blees
pping the handles in MSVCRT's internal data structures, as we do in winansi_init(). Reported-by: Johannes Sixt Signed-off-by: Karsten Blees --- Thanks for reporting this. The fix applies on top of [6/6] Win32: fix broken pipe detection (should probably not be squashed, as its obviously

Re: [PATCH 1/5] hashmap: add enum for hashmap free_entries option

2014-06-11 Thread Karsten Blees
Am 10.06.2014 12:17, schrieb Heiko Voigt: > On Fri, Jun 06, 2014 at 07:52:03PM +0200, Karsten Blees wrote: >> Am 05.06.2014 08:06, schrieb Heiko Voigt: >>> This allows a reader to immediately know which options can be used and >>> what this parameter is about. >>

Re: [PATCH v5 09/11] trace: add high resolution timer function to debug performance issues

2014-06-11 Thread Karsten Blees
Am 11.06.2014 10:01, schrieb Karsten Blees: > the epoch allows using the results (div 10e9) with other time-related APIs. s/10e9/1e9/ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo

[PATCH v5 11/11] git: add performance tracing for git's main() function to debug scripts

2014-06-11 Thread Karsten Blees
7 s: git command: 'git' 'config' '--get-color' 'color.interactive.help' 'red bold' 23:57:38.650465 trace.c:405 performance: 0.000243063 s: git command: 'git' 'config' '--get-color' '' 'reset' 23:57:38.6548

[PATCH v5 10/11] trace: add trace_performance facility to debug performance issues

2014-06-11 Thread Karsten Blees
rformance(t, "frotz"); Signed-off-by: Karsten Blees --- trace.c | 49 + trace.h | 24 2 files changed, 73 insertions(+) diff --git a/trace.c b/trace.c index 4bd52f2..0551509 100644 --- a/trace.c +++ b/trace.c @

[PATCH v5 09/11] trace: add high resolution timer function to debug performance issues

2014-06-11 Thread Karsten Blees
ion, e.g. using mach_absolute_time + mach_timebase_info Signed-off-by: Karsten Blees --- Makefile | 7 + config.mak.uname | 1 + trace.c | 82 trace.h | 1 + 4 files changed, 91 insertions(+) diff --git a/Makefile b/Makefil

[PATCH v5 08/11] trace: add 'file:line' to all trace output

2014-06-11 Thread Karsten Blees
2005+ (_MSC_VER 1400). This has the nice side effect that the old C-style declarations serve as documentation how the macros are to be used. Signed-off-by: Karsten Blees --- git-compat-util.h | 4 trace.c | 69 +-- tr

[PATCH v5 07/11] trace: move code around, in preparation to file:line output

2014-06-11 Thread Karsten Blees
No functional changes, just move stuff around so that the next patch isn't that ugly... Signed-off-by: Karsten Blees --- trace.c | 36 ++-- trace.h | 12 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/trace.c b/trace.c index 5a

[PATCH v5 06/11] trace: add current timestamp to all trace output

2014-06-11 Thread Karsten Blees
processes are involved). Signed-off-by: Karsten Blees --- trace.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/trace.c b/trace.c index c920429..5a3393a 100644 --- a/trace.c +++ b/trace.c @@ -79,12 +79,21 @@ static void do_trace_print(const char *key, const struct

[PATCH v5 05/11] trace: add infrastructure to augment trace output with additional info

2014-06-11 Thread Karsten Blees
an print arbitrary binary data (without barfing on '%' or stopping at '\0'), so 'data' seems more appropriate. Signed-off-by: Karsten Blees --- trace.c | 45 ++--- trace.h | 2 +- 2 files changed, 35 insertions(+), 12 deletio

[PATCH v5 04/11] trace: factor out printing to the trace file

2014-06-11 Thread Karsten Blees
formatting. Signed-off-by: Karsten Blees --- trace.c | 37 +++-- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/trace.c b/trace.c index 3e31558..b7ca51b 100644 --- a/trace.c +++ b/trace.c @@ -62,6 +62,21 @@ static int get_trace_fd(const char *key

[PATCH v5 02/11] trace: consistently name the format parameter

2014-06-11 Thread Karsten Blees
The format parameter to trace_printf functions is sometimes abbreviated 'fmt'. Rename to 'format' everywhere (consistent with POSIX' printf specification). Signed-off-by: Karsten Blees --- trace.c | 22 +++--- trace.h | 2 +- 2 files changed, 12 in

[PATCH v5 03/11] trace: remove redundant printf format attribute

2014-06-11 Thread Karsten Blees
trace_printf_key() is the only non-static function that duplicates the printf format attribute in the .c file, remove it for consistency. Signed-off-by: Karsten Blees --- trace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/trace.c b/trace.c index 37a7fa9..3e31558 100644 --- a/trace.c

[PATCH v5 01/11] trace: move trace declarations from cache.h to new trace.h

2014-06-11 Thread Karsten Blees
Also include direct dependencies (strbuf.h and git-compat-util.h for __attribute__) so that trace.h can be used independently of cache.h, e.g. in test programs. Signed-off-by: Karsten Blees --- cache.h | 13 ++--- trace.h | 17 + 2 files changed, 19 insertions(+), 11

[PATCH v5 00/11] add performance tracing facility

2014-06-11 Thread Karsten Blees
.649779 git.c:312] trace: built-in: git 'rev-parse' '--git-dir' Or print file:line at the end (but what about multi-line messages, such as packet-trace?): > GIT_TRACE=1 git stash list 00:12:10.544266 trace: exec: 'git-stash' 'list' (git.c:512) 00:12:10.

Re: [PATCH 5/5] Win32: Thread-safe windows console output

2014-06-06 Thread Karsten Blees
Am 06.06.2014 23:29, schrieb Peter Krefting: > Stepan Kasal: > >> +/* only called from console_thread, so a static buffer will do */ >> +static wchar_t wbuf[2 * BUFFER_SIZE + 1]; > > Wouldn't BUFFER_SIZE + 1 (or even BUFFER_SIZE) do here? If you convert from > up to BUFFER_SIZE octets of

Re: [PATCH 2/2] mingw: avoid const warning

2014-06-06 Thread Karsten Blees
Am 06.06.2014 21:13, schrieb Junio C Hamano: > Karsten Blees writes: > >> Am 29.05.2014 12:47, schrieb Stepan Kasal: >>> Fix const warnings in http-fetch.c and remote-curl.c main() where is >>> argv declared as const. >>> >>> The fix should wor

Re: [msysGit] [PATCH] mingw: redefine the wrapper macro after the corresponding function

2014-06-06 Thread Karsten Blees
Am 06.06.2014 13:10, schrieb Stepan Kasal: > Hi Karsten, > > On Fri, Jun 06, 2014 at 11:43:03AM +0200, Karsten Blees wrote: >> Thinking about this some more, the best solution is probably to >> eliminate the problem altogether by adding inline-wrappers for >>

Re: [PATCH 1/5] hashmap: add enum for hashmap free_entries option

2014-06-06 Thread Karsten Blees
Am 05.06.2014 08:06, schrieb Heiko Voigt: > This allows a reader to immediately know which options can be used and > what this parameter is about. > [...] > -void hashmap_free(struct hashmap *map, int free_entries) > +void hashmap_free(struct hashmap *map, enum hashmap_free_options > free_entries

Re: [PATCH 0/5] First part of Unicode console support for msysgit

2014-06-06 Thread Karsten Blees
in. > The fourth one is just a trivial prerequisite for > the last one, that was written in Jan 2012, with a fixup from Mar 2012. > The dates are missing from the patches. It would also have been nice to name (or link to) the patches you sqashed. > Regards, > Stepan > &g

Re: [PATCH 0/5] Windows dirent patches

2014-06-06 Thread Karsten Blees
Am 06.06.2014 15:43, schrieb Stepan Kasal: > Hello, > > This is a series of dirent modifications, 4 tiny ones and one bigger. > As the date indicates, these are battle tested in mysgit for several years. > The dates are actually missing from the patches, otherwise full ack from me. Thanks! --

Re: [PATCH 2/2] mingw: avoid const warning

2014-06-06 Thread Karsten Blees
Am 29.05.2014 12:47, schrieb Stepan Kasal: > Fix const warnings in http-fetch.c and remote-curl.c main() where is > argv declared as const. > > The fix should work for all future declarations of main, no matter > whether the second parameter's type is "char**", "const char**", or > "char *[]". I'

Re: [msysGit] [PATCH] mingw: redefine the wrapper macro after the corresponding function

2014-06-06 Thread Karsten Blees
Am 06.06.2014 10:32, schrieb Stepan Kasal: > Hello, > > On Fri, Jun 06, 2014 at 12:00:51AM +0200, Karsten Blees wrote: >> Am 05.06.2014 18:56, schrieb Johannes Sixt: >>> Within mingw.c, if some other function inside mingw.c wants to use >>> mingw_unlink, then it s

Re: [msysGit] Re: [PATCH] mingw: redefine the wrapper macro after the corresponding function

2014-06-05 Thread Karsten Blees
Am 05.06.2014 17:13, schrieb Stepan Kasal: > Hello Karsten, > > On Thu, Jun 05, 2014 at 04:51:39PM +0200, Karsten Blees wrote: >> In the current msysgit HEAD, most of these #undef's can simply be >> removed or have already been removed [...] > > not "most of

Re: [msysGit] [PATCH] mingw: redefine the wrapper macro after the corresponding function

2014-06-05 Thread Karsten Blees
Am 05.06.2014 18:56, schrieb Johannes Sixt: > Am 05.06.2014 10:05, schrieb Stepan Kasal: >> mingw.c defines several wrapper functionsi, like mingw_unlink(). >> These wrappers are deployed by macros like this: >> #define unlink mingw_unlink >> The function itself is preceded by #undef, leaving

Re: [PATCH v2] Add a Windows-specific fallback to getenv("HOME");

2014-06-05 Thread Karsten Blees
Am 05.06.2014 11:58, schrieb Erik Faye-Lund: > On Thu, Jun 5, 2014 at 11:40 AM, Karsten Blees > wrote: >> Am 05.06.2014 10:03, schrieb Stepan Kasal: >>> From: Johannes Schindelin >>> Date: Wed, 2 Jun 2010 00:41:33 +0200 >>> >>> If HOME is not se

Re: [PATCH v2] Add a Windows-specific fallback to getenv("HOME");

2014-06-05 Thread Karsten Blees
Am 05.06.2014 15:39, schrieb Johannes Schindelin: > And in particular with your changes to Unicodify the complete environment, > I am *highly* doubtful that child processes will be able to handle > themselves properly, unless we spend a whole lot of time converting back > and forth the environment

Re: [PATCH] mingw: redefine the wrapper macro after the corresponding function

2014-06-05 Thread Karsten Blees
Am 05.06.2014 10:05, schrieb Stepan Kasal: > mingw.c defines several wrapper functionsi, like mingw_unlink(). > These wrappers are deployed by macros like this: > #define unlink mingw_unlink > The function itself is preceded by #undef, leaving the wrapper out > of the game for the rest of min

Re: [msysGit] Re: [PATCH] Add a Windows-specific fallback to getenv("HOME");

2014-06-05 Thread Karsten Blees
Am 05.06.2014 14:03, schrieb Johannes Schindelin: > Hi Karsten, > > On Thu, 5 Jun 2014, Karsten Blees wrote: > >> After a bit of digging in the history and the old googlegroups issue >> tracker, I think this patch is completely unrelated to the non-ASCII >> problems

Re: [PATCH v2] Add a Windows-specific fallback to getenv("HOME");

2014-06-05 Thread Karsten Blees
Am 05.06.2014 10:03, schrieb Stepan Kasal: > From: Johannes Schindelin > Date: Wed, 2 Jun 2010 00:41:33 +0200 > > If HOME is not set, use $HOMEDRIVE$HOMEPATH > > Signed-off-by: Johannes Schindelin > Signed-off-by: Stepan Kasal > --- > > Hello Karsten, > thanks for your explanation. There are

Re: [msysGit] Re: [PATCH] Add a Windows-specific fallback to getenv("HOME");

2014-06-04 Thread Karsten Blees
Am 04.06.2014 17:46, schrieb Johannes Schindelin: > Hi kusma, > > On Wed, 4 Jun 2014, Johannes Schindelin wrote: > >> The problem arises whenever git.exe calls subprocesses. You can pollute >> the environment by setting HOME, I do not recall the details, but I >> remember that we had to be very c

Re: [msysGit] Re: [PATCH] Add a Windows-specific fallback to getenv("HOME");

2014-06-04 Thread Karsten Blees
Am 04.06.2014 16:05, schrieb Erik Faye-Lund: > On Wed, Jun 4, 2014 at 3:47 PM, Duy Nguyen wrote: >> On Wed, Jun 4, 2014 at 6:47 PM, Stepan Kasal wrote: >>> @@ -133,7 +133,7 @@ char *git_path(const char *fmt, ...) >>> void home_config_paths(char **global, char **xdg, char *file) >>> { >>>

Re: [PATCH] environment: enable core.preloadindex by default

2014-06-03 Thread Karsten Blees
Am 03.06.2014 08:18, schrieb Steve Hoelzer: > On Mon, Jun 2, 2014 at 3:01 PM, Karsten Blees wrote: >> Git for Windows users may want to try core.fscache=true as well [1]. This >> eliminates the UAC penalties for repositories located on the Windows system >> drive

Re: [PATCH] environment: enable core.preloadindex by default

2014-06-02 Thread Karsten Blees
Am 02.06.2014 18:43, schrieb Steve Hoelzer: > There is consensus that the default should change because it will > benefit nearly all users (some just a little, but some a lot). > See [1] and replies. Git for Windows users may want to try core.fscache=true as well [1]. This eliminates the UAC pena

Re: [RFC/PATCH v4 3/3] add command performance tracing to debug scripted commands

2014-05-23 Thread Karsten Blees
Am 22.05.2014 11:59, schrieb Jeff King: > On Thu, May 22, 2014 at 02:40:48AM +0200, Karsten Blees wrote: > >> E.g. if I'm interested in a particular code section, I throw in 2 >> lines of code (before and after the code section). This gives very >> accurate r

Re: [RFC/PATCH v4 1/3] add high resolution timer function to debug performance issues

2014-05-21 Thread Karsten Blees
Am 22.05.2014 00:14, schrieb Richard Hansen: > On 2014-05-20 15:11, Karsten Blees wrote: >> Add a getnanotime() function that returns nanoseconds since 01/01/1970 as >> unsigned 64-bit integer (i.e. overflows in july 2554). > > Must it be relative to epoch? If it was re

Re: [RFC/PATCH v4 3/3] add command performance tracing to debug scripted commands

2014-05-21 Thread Karsten Blees
Am 21.05.2014 18:55, schrieb Jeff King: > On Tue, May 20, 2014 at 09:11:24PM +0200, Karsten Blees wrote: > >> Add performance tracing to identify which git commands are called and how >> long they execute. This is particularly useful to debug performance issues >&

Re: [RFC/PATCH v4 2/3] add trace_performance facility to debug performance issues

2014-05-21 Thread Karsten Blees
Am 21.05.2014 18:58, schrieb Jeff King: > On Tue, May 20, 2014 at 09:11:19PM +0200, Karsten Blees wrote: > >> Add trace_performance and trace_performance_since macros that print file >> name, line number, time and an optional printf-formatted text to the file >> specified

Re: [RFC/PATCH v4 1/3] add high resolution timer function to debug performance issues

2014-05-21 Thread Karsten Blees
Am 21.05.2014 09:31, schrieb Noel Grandin: > On 2014-05-20 21:11, Karsten Blees wrote: >> * implement Mac OSX version using mach_absolute_time >> >> > > > Note that unlike the Windows and Linux APIs, mach_absolute_time does not do > correction for frequency

[RFC/PATCH v4 2/3] add trace_performance facility to debug performance issues

2014-05-20 Thread Karsten Blees
case (measure repetitive code sections): uint64_t t = 0; for (;;) { /* ignore */ t -= getnanotime(); /* code section to measure */ t += getnanotime(); /* ignore */ } trace_performance(t, "frotz"); Signed-off-by: Karsten Blees --- cache

[RFC/PATCH v4 1/3] add high resolution timer function to debug performance issues

2014-05-20 Thread Karsten Blees
following platforms: * Linux: using clock_gettime(CLOCK_MONOTONIC) * Windows: using QueryPerformanceCounter() Todo: * enable clock_gettime() on more platforms * implement Mac OSX version using mach_absolute_time Signed-off-by: Karsten Blees --- Makefile | 7 + cache.h

[RFC/PATCH v4 3/3] add command performance tracing to debug scripted commands

2014-05-20 Thread Karsten Blees
' 'config' '--get-color' 'color.interactive.help' 'red bold' performance: at trace.c:319, time: 0.000280701 s: git command: 'git' 'config' '--get-color' '' 'reset' performance: at trace.c:319, time: 0.00

[RFC/PATCH v4 0/3] add performance tracing facility

2014-05-20 Thread Karsten Blees
This is the POSIX port of the patches I typically use to track down msysgit performance issues (thus v4, the latest windows-only version is here [1]). Sebastian and Dscho thought this might be useful in core git, so here it is. [1] https://github.com/msysgit/git/pull/46 Karsten Blees (3): add

Re: [PATCH 08/12] MINGW: fix main() signature in http-fetch.c and remote-curl.c

2014-04-30 Thread Karsten Blees
Am 29.04.2014 11:12, schrieb Marat Radchenko: > On MinGW, compat/mingw.h defines a 'mingw_main' wrapper function. > Fix `warning: passing argument 2 of 'mingw_main' from incompatible > pointer type` in http-fetch.c and remote-curl.c by dropping 'const'. > Would you mind cross checking your change

Re: [RFC] Speed up "git status" by caching untracked file info

2014-04-22 Thread Karsten Blees
Am 22.04.2014 12:35, schrieb Duy Nguyen: > On Tue, Apr 22, 2014 at 5:13 PM, Duy Nguyen wrote: >>> IIRC name_hash.c::lazy_init_name_hash took ~100ms on my system, so >>> hopefully you did a dummy 'cache_name_exists("anything")' before starting >>> the measurement of the first run? >> >> No I didn

Re: [RFC] Speed up "git status" by caching untracked file info

2014-04-22 Thread Karsten Blees
Am 17.04.2014 07:51, schrieb Nguyễn Thái Ngọc Duy: > This patch serves as a heads up about a feature I'm working on. I hope > that by posting it early, people could double check if I have made > some fundamental mistakes that completely ruin the idea. It's about > speeding up "git status" by cachin

<    1   2   3   4   >