Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221803
b: refs/heads/master
c: e8719ad
h: refs/heads/master
i:
  221801: 3fd81b9
  221799: 8e758c0
v: v3
  • Loading branch information
Tom Zanussi committed Nov 10, 2010
1 parent efc3533 commit 335f09e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01797c599816d39dfea47864c0f90cd50845811f
refs/heads/master: e8719adf30c136319a77824d032b3a185148f8f9
12 changes: 12 additions & 0 deletions trunk/tools/perf/builtin-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ static struct script_desc *script_desc__new(const char *name)
static void script_desc__delete(struct script_desc *s)
{
free(s->name);
free(s->half_liner);
free(s->args);
free(s);
}

Expand Down Expand Up @@ -626,6 +628,9 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used)
close(live_pipe[0]);

__argv = malloc(6 * sizeof(const char *));
if (!__argv)
die("malloc");

__argv[0] = "/bin/sh";
__argv[1] = record_script_path;
__argv[2] = "-q";
Expand All @@ -634,13 +639,16 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used)
__argv[5] = NULL;

execvp("/bin/sh", (char **)__argv);
free(__argv);
exit(-1);
}

dup2(live_pipe[0], 0);
close(live_pipe[1]);

__argv = malloc((argc + 3) * sizeof(const char *));
if (!__argv)
die("malloc");
__argv[0] = "/bin/sh";
__argv[1] = report_script_path;
for (i = 2; i < argc; i++)
Expand All @@ -650,6 +658,7 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used)
__argv[i++] = NULL;

execvp("/bin/sh", (char **)__argv);
free(__argv);
exit(-1);
}

Expand All @@ -661,13 +670,16 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used)
}

__argv = malloc((argc + 1) * sizeof(const char *));
if (!__argv)
die("malloc");
__argv[0] = "/bin/sh";
__argv[1] = script_path;
for (i = 3; i < argc; i++)
__argv[i - 1] = argv[i];
__argv[argc - 1] = NULL;

execvp("/bin/sh", (char **)__argv);
free(__argv);
exit(-1);
}

Expand Down

0 comments on commit 335f09e

Please sign in to comment.