Skip to content

Commit 0b7ba67

Browse files
committed
Revert "trace2: (V3) create new combined trace facility"
This reverts commit c849c28.
1 parent 14fc29d commit 0b7ba67

37 files changed

Lines changed: 11 additions & 3750 deletions

Makefile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,16 +1000,6 @@ LIB_OBJS += tempfile.o
10001000
LIB_OBJS += thread-utils.o
10011001
LIB_OBJS += tmp-objdir.o
10021002
LIB_OBJS += trace.o
1003-
LIB_OBJS += trace2.o
1004-
LIB_OBJS += trace2/tr2_cfg.o
1005-
LIB_OBJS += trace2/tr2_dst.o
1006-
LIB_OBJS += trace2/tr2_sid.o
1007-
LIB_OBJS += trace2/tr2_tbuf.o
1008-
LIB_OBJS += trace2/tr2_tgt_event.o
1009-
LIB_OBJS += trace2/tr2_tgt_normal.o
1010-
LIB_OBJS += trace2/tr2_tgt_perf.o
1011-
LIB_OBJS += trace2/tr2_tls.o
1012-
LIB_OBJS += trace2/tr2_verb.o
10131003
LIB_OBJS += trailer.o
10141004
LIB_OBJS += transport.o
10151005
LIB_OBJS += transport-helper.o

cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "gettext.h"
1010
#include "convert.h"
1111
#include "trace.h"
12-
#include "trace2.h"
1312
#include "string-list.h"
1413
#include "pack-revindex.h"
1514
#include "hash.h"

common-main.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,12 @@ static void restore_sigpipe_to_default(void)
2525

2626
int main(int argc, const char **argv)
2727
{
28-
int result;
29-
3028
/*
3129
* Always open file descriptors 0/1/2 to avoid clobbering files
3230
* in die(). It also avoids messing up when the pipes are dup'ed
3331
* onto stdin/stdout/stderr in the child processes we spawn.
3432
*/
3533
sanitize_stdfds();
36-
restore_sigpipe_to_default();
37-
38-
trace2_initialize();
39-
trace2_cmd_start(argv);
4034

4135
git_resolve_executable_dir(argv[0]);
4236

@@ -46,9 +40,7 @@ int main(int argc, const char **argv)
4640

4741
attr_start();
4842

49-
result = cmd_main(argc, argv);
50-
51-
trace2_cmd_exit(result);
43+
restore_sigpipe_to_default();
5244

53-
return result;
45+
return cmd_main(argc, argv);
5446
}

compat/mingw.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,6 @@ static int try_shell_exec(const char *cmd, char *const *argv)
19451945
return 0;
19461946
prog = path_lookup(interpr, 1);
19471947
if (prog) {
1948-
int exec_id;
19491948
int argc = 0;
19501949
#ifndef _MSC_VER
19511950
const
@@ -1955,16 +1954,13 @@ static int try_shell_exec(const char *cmd, char *const *argv)
19551954
ALLOC_ARRAY(argv2, argc + 1);
19561955
argv2[0] = (char *)cmd; /* full path to the script file */
19571956
memcpy(&argv2[1], &argv[1], sizeof(*argv) * argc);
1958-
exec_id = trace2_exec(prog, argv2);
19591957
pid = mingw_spawnv(prog, argv2, interpr);
19601958
if (pid >= 0) {
19611959
int status;
19621960
if (waitpid(pid, &status, 0) < 0)
19631961
status = 255;
1964-
trace2_exec_result(exec_id, status);
19651962
exit(status);
19661963
}
1967-
trace2_exec_result(exec_id, -1);
19681964
pid = 1; /* indicate that we tried but failed */
19691965
free(prog);
19701966
free(argv2);
@@ -1977,17 +1973,12 @@ int mingw_execv(const char *cmd, char *const *argv)
19771973
/* check if git_command is a shell script */
19781974
if (!try_shell_exec(cmd, argv)) {
19791975
int pid, status;
1980-
int exec_id;
19811976

1982-
exec_id = trace2_exec(cmd, (const char **)argv);
19831977
pid = mingw_spawnv(cmd, (const char **)argv, NULL);
1984-
if (pid < 0) {
1985-
trace2_exec_result(exec_id, -1);
1978+
if (pid < 0)
19861979
return -1;
1987-
}
19881980
if (waitpid(pid, &status, 0) < 0)
19891981
status = 255;
1990-
trace2_exec_result(exec_id, status);
19911982
exit(status);
19921983
}
19931984
return -1;

compat/mingw.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ static inline int fcntl(int fd, int cmd, ...)
165165
errno = EINVAL;
166166
return -1;
167167
}
168-
168+
/* bash cannot reliably detect negative return codes as failure */
169+
#define exit(code) exit((code) & 0xff)
169170
#define sigemptyset(x) (void)0
170171
static inline int sigaddset(sigset_t *set, int signum)
171172
{ return 0; }

config.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2709,8 +2709,6 @@ int git_config_set_gently(const char *key, const char *value)
27092709
void git_config_set(const char *key, const char *value)
27102710
{
27112711
git_config_set_multivar(key, value, NULL, 0);
2712-
2713-
trace2_cmd_set_config(key, value);
27142712
}
27152713

27162714
/*

exec-cmd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ static int git_get_exec_path(struct strbuf *buf, const char *argv0)
209209
return -1;
210210
}
211211

212-
trace2_cmd_path(buf->buf);
213-
214212
return 0;
215213
}
216214

git-compat-util.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,13 +1291,6 @@ struct fscache;
12911291

12921292
extern int cmd_main(int, const char **);
12931293

1294-
/*
1295-
* Intercept all calls to exit() and route them to trace2 to
1296-
* optionally emit a message before calling the real exit().
1297-
*/
1298-
int trace2_cmd_exit_fl(const char *file, int line, int code);
1299-
#define exit(code) exit(trace2_cmd_exit_fl(__FILE__, __LINE__, (code)))
1300-
13011294
/*
13021295
* You can mark a stack variable with UNLEAK(var) to avoid it being
13031296
* reported as a leak by tools like LSAN or valgrind. The argument

git.c

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -149,20 +149,16 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
149149
git_set_exec_path(cmd + 1);
150150
else {
151151
puts(git_exec_path());
152-
trace2_cmd_verb("_query_");
153152
exit(0);
154153
}
155154
} else if (!strcmp(cmd, "--html-path")) {
156155
puts(system_path(GIT_HTML_PATH));
157-
trace2_cmd_verb("_query_");
158156
exit(0);
159157
} else if (!strcmp(cmd, "--man-path")) {
160158
puts(system_path(GIT_MAN_PATH));
161-
trace2_cmd_verb("_query_");
162159
exit(0);
163160
} else if (!strcmp(cmd, "--info-path")) {
164161
puts(system_path(GIT_INFO_PATH));
165-
trace2_cmd_verb("_query_");
166162
exit(0);
167163
} else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) {
168164
use_pager = 1;
@@ -291,7 +287,6 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
291287
(*argv)++;
292288
(*argc)--;
293289
} else if (skip_prefix(cmd, "--list-cmds=", &cmd)) {
294-
trace2_cmd_verb("_query_");
295290
if (!strcmp(cmd, "parseopt")) {
296291
struct string_list list = STRING_LIST_INIT_DUP;
297292
int i;
@@ -339,14 +334,9 @@ static int handle_alias(int *argcp, const char ***argv)
339334
commit_pager_choice();
340335

341336
child.use_shell = 1;
342-
child.trace2_child_class = "shell_alias";
343337
argv_array_push(&child.args, alias_string + 1);
344338
argv_array_pushv(&child.args, (*argv) + 1);
345339

346-
trace2_cmd_alias(alias_command, child.args.argv);
347-
trace2_cmd_list_config();
348-
trace2_cmd_verb("_run_shell_alias_");
349-
350340
ret = run_command(&child);
351341
if (ret >= 0) /* normal exit */
352342
exit(ret);
@@ -381,9 +371,6 @@ static int handle_alias(int *argcp, const char ***argv)
381371
/* insert after command name */
382372
memcpy(new_argv + count, *argv + 1, sizeof(char *) * *argcp);
383373

384-
trace2_cmd_alias(alias_command, new_argv);
385-
trace2_cmd_list_config();
386-
387374
*argv = new_argv;
388375
*argcp += count - 1;
389376

@@ -496,8 +483,6 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
496483
die("pre-command hook aborted command");
497484

498485
trace_argv_printf(argv, "trace: built-in: git");
499-
trace2_cmd_verb(p->cmd);
500-
trace2_cmd_list_config();
501486

502487
validate_cache_entries(&the_index);
503488
exit_code = status = p->fn(argc, argv, prefix);
@@ -755,15 +740,10 @@ static void execv_dashed_external(const char **argv)
755740
cmd.clean_on_exit = 1;
756741
cmd.wait_after_clean = 1;
757742
cmd.silent_exec_failure = 1;
758-
cmd.trace2_child_class = "dashed";
759743

760744
if (run_pre_command_hook(cmd.args.argv))
761745
die("pre-command hook aborted command");
762746

763-
/*
764-
* The code in run_command() logs trace2 child_start/child_exit
765-
* events, so we do not need to report exec/exec_result events here.
766-
*/
767747
trace_argv_printf(cmd.args.argv, "trace: exec:");
768748

769749
/*
@@ -773,20 +753,10 @@ static void execv_dashed_external(const char **argv)
773753
* the program.
774754
*/
775755
exit_code = status = run_command(&cmd);
776-
777-
/*
778-
* If the child process ran and we are now going to exit, emit a
779-
* generic string as our trace2 command verb to indicate that we
780-
* launched a dashed command.
781-
*/
782-
if (status >= 0) {
783-
trace2_cmd_verb("_run_dashed_");
756+
if (status >= 0)
784757
exit(status);
785-
}
786-
else if (errno != ENOENT) {
787-
trace2_cmd_verb("_run_dashed_");
758+
else if (errno != ENOENT)
788759
exit(128);
789-
}
790760

791761
run_post_command_hook();
792762
}
@@ -813,15 +783,6 @@ static int run_argv(int *argcp, const char ***argv)
813783
struct argv_array args = ARGV_ARRAY_INIT;
814784
int i;
815785

816-
/*
817-
* The current process is committed to launching a
818-
* child process to run the command named in (**argv)
819-
* and exiting. Log a generic string as the trace2
820-
* command verb to indicate this. Note that the child
821-
* process will log the actual verb when it runs.
822-
*/
823-
trace2_cmd_verb("_run_git_alias_");
824-
825786
if (get_super_prefix())
826787
die("%s doesn't support --super-prefix", **argv);
827788

@@ -837,8 +798,8 @@ static int run_argv(int *argcp, const char ***argv)
837798
* if we fail because the command is not found, it is
838799
* OK to return. Otherwise, we just pass along the status code.
839800
*/
840-
i = run_command_v_opt_tr2(args.argv, RUN_SILENT_EXEC_FAILURE |
841-
RUN_CLEAN_ON_EXIT, "git_alias");
801+
i = run_command_v_opt(args.argv, RUN_SILENT_EXEC_FAILURE |
802+
RUN_CLEAN_ON_EXIT);
842803
if (i >= 0 || errno != ENOENT)
843804
exit(i);
844805
die("could not execute builtin %s", **argv);

remote-curl.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,13 +1340,6 @@ int cmd_main(int argc, const char **argv)
13401340
string_list_init(&options.deepen_not, 1);
13411341
string_list_init(&options.push_options, 1);
13421342

1343-
/*
1344-
* Just report "remote-curl" here (folding all the various aliases
1345-
* ("git-remote-http", "git-remote-https", and etc.) here since they
1346-
* are all just copies of the same actual executable.
1347-
*/
1348-
trace2_cmd_verb("remote-curl");
1349-
13501343
remote = remote_get(argv[1]);
13511344

13521345
if (argc > 2) {

0 commit comments

Comments
 (0)