Skip to content

Commit

Permalink
record: Get rid of UFTRACE_PIPE env variable
Browse files Browse the repository at this point in the history
As it doesn't carry any info now, we can simply omit it.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
  • Loading branch information
namhyung committed Mar 29, 2019
1 parent a3e6883 commit fa06454
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion cmds/record.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ static void setup_child_environ(struct opts *opts, int argc, char *argv[])
setenv("UFTRACE_LOGFD", buf, 1);
}

setenv("UFTRACE_PIPE", "-1", 1);
setenv("UFTRACE_SHMEM", "1", 1);

if (debug) {
Expand Down
15 changes: 7 additions & 8 deletions libmcount/mcount.c
Original file line number Diff line number Diff line change
Expand Up @@ -1678,20 +1678,19 @@ static __used void mcount_startup(void)
if (pipefd_str) {
pfd = strtol(pipefd_str, NULL, 0);

if (pfd < 0) {
char *channel = NULL;

xasprintf(&channel, "%s/%s", dirname, ".channel");
pfd = open(channel, O_WRONLY);
free(channel);
}

/* minimal sanity check */
if (fstat(pfd, &statbuf) < 0 || !S_ISFIFO(statbuf.st_mode)) {
pr_dbg("ignore invalid pipe fd: %d\n", pfd);
pfd = -1;
}
}
else {
char *channel = NULL;

xasprintf(&channel, "%s/%s", dirname, ".channel");
pfd = open(channel, O_WRONLY);
free(channel);
}

if (getenv("UFTRACE_LIST_EVENT")) {
mcount_list_events();
Expand Down

0 comments on commit fa06454

Please sign in to comment.