1. 20 Mar, 2019 1 commit
    • Torsten Bögershausen's avatar
      trace2: NULL is not allowed for va_list · ad006fe4
      Torsten Bögershausen authored
      Some compilers don't allow NULL to be passed for a va_list,
      and e.g. "gcc (Raspbian 6.3.0-18+rpi1+deb9u1) 6.3.0 20170516"
      errors out like this:
         error: invalid operands to binary &&
         (have ‘int’ and ‘va_list {aka __va_list}’)
          if (fmt && *fmt && ap) {
      I couldn't find any hints that va_list and pointers can be mixed,
      and no hints that they can't either. Morten Welinder comments:
      "C99, Section 7.15, simply says that va_list "is an object type suitable for
      holding information needed by the macros va_start, va_end, and
      va_copy". So clearly not guaranteed to be mixable with pointers...
      The portable solution is to use "va_list" everywhere in the callchain.
      As a consequence, both trace2_region_enter_fl() and trace2_region_leave_fl()
      now take a variable argument list.
      Signed-off-by: default avatarTorsten Bögershausen <tboegi@web.de>
      Acked-by: default avatarJeff Hostetler <jeffhost@microsoft.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
  2. 22 Feb, 2019 2 commits
    • Jeff Hostetler's avatar
      trace2: collect Windows-specific process information · 353d3d77
      Jeff Hostetler authored
      Add platform-specific interface to log information about the current
      On Windows, this interface is used to indicate whether the git process
      is running under a debugger and list names of the process ancestors.
      Information for other platforms is left for a future effort.
      Signed-off-by: default avatarJeff Hostetler <jeffhost@microsoft.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    • Jeff Hostetler's avatar
      trace2: create new combined trace facility · ee4512ed
      Jeff Hostetler authored
      Create a new unified tracing facility for git.  The eventual intent is to
      replace the current trace_printf* and trace_performance* routines with a
      unified set of git_trace2* routines.
      In addition to the usual printf-style API, trace2 provides higer-level
      event verbs with fixed-fields allowing structured data to be written.
      This makes post-processing and analysis easier for external tools.
      Trace2 defines 3 output targets.  These are set using the environment
      variables "GIT_TR2", "GIT_TR2_PERF", and "GIT_TR2_EVENT".  These may be
      set to "1" or to an absolute pathname (just like the current GIT_TRACE).
      * GIT_TR2 is intended to be a replacement for GIT_TRACE and logs command
        summary data.
      * GIT_TR2_PERF is intended as a replacement for GIT_TRACE_PERFORMANCE.
        It extends the output with columns for the command process, thread,
        repo, absolute and relative elapsed times.  It reports events for
        child process start/stop, thread start/stop, and per-thread function
      * GIT_TR2_EVENT is a new structured format. It writes event data as a
        series of JSON records.
      Calls to trace2 functions log to any of the 3 output targets enabled
      without the need to call different trace_printf* or trace_performance*
      Signed-off-by: default avatarJeff Hostetler <jeffhost@microsoft.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>