From a5b40a28450c965bb4b77656820fdd0a78768fe4 Mon Sep 17 00:00:00 2001 From: Raman Tenneti Date: Tue, 16 Mar 2021 14:24:14 -0700 Subject: repo: Add a new "command" event type to git trace2 logging in repo. Add a new "event": "command", which is emitted at when all command arguments have been processed. Additional fields: "name": Name of the primary command (ex: repo, git) "subcommands"': List of the sub-commands once command-line arguments are processed Examples: Command: repo --version Event: {"event": "command", , "name": "repo", "subcommands": ["version"] } Bug: [google internal] b/178507266 Testing: - Unit tests - Verified repo git trace2 logs had expected data Change-Id: I825bd0ecedee45135382461a4ba10f987f09aef3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/300343 Reviewed-by: Ian Kasprzak Reviewed-by: Mike Frysinger Tested-by: Raman Tenneti --- main.py | 1 + 1 file changed, 1 insertion(+) (limited to 'main.py') diff --git a/main.py b/main.py index ba5d9d20..9abda6a9 100755 --- a/main.py +++ b/main.py @@ -254,6 +254,7 @@ class _Repo(object): cmd_event = cmd.event_log.Add(name, event_log.TASK_COMMAND, start) cmd.event_log.SetParent(cmd_event) git_trace2_event_log.StartEvent() + git_trace2_event_log.CommandEvent(name='repo', subcommands=[name]) try: cmd.ValidateOptions(copts, cargs) -- cgit v1.2.3-54-g00ecf