Skip to content
Here is version 3.
[] It incorporates Ævar's suggestions WRT the format and uniqueness of the
SID. [] It now reads both system and global config for trace2 settings and
handles includes as Jonathan suggested.

I added a read_very_early_config() function that is similar to
read_early_config()but omits repo local, worktree, and -c command line
settings. This felt like a little bit of a hack, but it made the intent
clear. And it avoided asserting the various global variables were in a
certain known state before calling the read_early_config().

In doing so, I uncovered an uninitialized opts variable in
read_repo_config(). The first patch in this series addresses it in
isolation. As the commit message suggests, this went undetected because opts
variable doesn't get passed all the way down, but I'm not familiar enough
with that code to know whether that's an accident or by design. Callers of
config_with_options() all setopts.respect_includes and that changes the args
that config_with_options()passes to the functions that it calls. What makes
this a little more troubling is theopts.event_fn field added in
8032cc4462b8af268fe457c2a0431473334dfd18 that might not be initialized.
Again, I'm not familiar enough with this code and the actually observable
control flows thru it to know if that could cause an issue.

Jeff Hostetler (10):
  config: initialize opts structure in repo_read_config()
  trace2: refactor setting process starting time
  trace2: add absolute elapsed time to start event
  trace2: find exec-dir before trace2 initialization
  config: add read_very_early_config()
  trace2: use system/global config for default trace2 settings
  trace2: report peak memory usage of the process
  trace2: clarify UTC datetime formatting
  trace2: make SIDs more unique
  trace2: update docs to describe system/global config settings

 Documentation/config.txt                 |   2 +
 Documentation/config/trace2.txt          |  56 ++++++++
 Documentation/technical/api-trace2.txt   | 176 +++++++++++++----------
 Documentation/trace2-target-values.txt   |  10 ++
 Makefile                                 |   1 +
 common-main.c                            |   8 +-
 compat/mingw.c                           |   2 +
 compat/win32/trace2_win32_process_info.c |  50 ++++++-
 config.c                                 |  27 +++-
 config.h                                 |   4 +
 t/t0210-trace2-normal.sh                 |  49 ++++++-
 t/t0211-trace2-perf.sh                   |  43 ++++--
 t/t0212-trace2-event.sh                  |  42 +++++-
 trace2.c                                 |  21 ++-
 trace2.h                                 |  43 ++++--
 trace2/tr2_cfg.c                         |   7 +-
 trace2/tr2_dst.c                         |  24 ++--
 trace2/tr2_dst.h                         |   3 +-
 trace2/tr2_sid.c                         |  55 ++++++-
 trace2/tr2_sysenv.c                      | 127 ++++++++++++++++
 trace2/tr2_sysenv.h                      |  36 +++++
 trace2/tr2_tbuf.c                        |  20 ++-
 trace2/tr2_tbuf.h                        |   5 +-
 trace2/tr2_tgt.h                         |   1 +
 trace2/tr2_tgt_event.c                   |  53 +++----
 trace2/tr2_tgt_normal.c                  |  19 +--
 trace2/tr2_tgt_perf.c                    |  23 +--
 trace2/tr2_tls.c                         |  38 +++--
 trace2/tr2_tls.h                         |   8 +-
 29 files changed, 750 insertions(+), 203 deletions(-)
 create mode 100644 Documentation/config/trace2.txt
 create mode 100644 Documentation/trace2-target-values.txt
 create mode 100644 trace2/tr2_sysenv.c
 create mode 100644 trace2/tr2_sysenv.h

base-commit: 041f5ea1cf987a4068ef5f39ba0a09be85952064

Submitted-As: https://public-inbox.org/git/pull.169.v3.git.gitgitgadget@gmail.com
In-Reply-To: https://public-inbox.org/git/pull.169.git.gitgitgadget@gmail.com
In-Reply-To: https://public-inbox.org/git/pull.169.v2.git.gitgitgadget@gmail.com
Assets 2
You can’t perform that action at this time.