diff options
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r-- | tools/perf/util/session.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 030791870e33..8cbea122e349 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -96,8 +96,6 @@ struct perf_session *perf_session__new(const char *filename, int mode, bool forc | |||
96 | self->hists_tree = RB_ROOT; | 96 | self->hists_tree = RB_ROOT; |
97 | self->last_match = NULL; | 97 | self->last_match = NULL; |
98 | self->mmap_window = 32; | 98 | self->mmap_window = 32; |
99 | self->cwd = NULL; | ||
100 | self->cwdlen = 0; | ||
101 | self->machines = RB_ROOT; | 99 | self->machines = RB_ROOT; |
102 | self->repipe = repipe; | 100 | self->repipe = repipe; |
103 | INIT_LIST_HEAD(&self->ordered_samples.samples_head); | 101 | INIT_LIST_HEAD(&self->ordered_samples.samples_head); |
@@ -130,7 +128,6 @@ void perf_session__delete(struct perf_session *self) | |||
130 | { | 128 | { |
131 | perf_header__exit(&self->header); | 129 | perf_header__exit(&self->header); |
132 | close(self->fd); | 130 | close(self->fd); |
133 | free(self->cwd); | ||
134 | free(self); | 131 | free(self); |
135 | } | 132 | } |
136 | 133 | ||
@@ -832,23 +829,6 @@ int perf_session__process_events(struct perf_session *self, | |||
832 | if (perf_session__register_idle_thread(self) == NULL) | 829 | if (perf_session__register_idle_thread(self) == NULL) |
833 | return -ENOMEM; | 830 | return -ENOMEM; |
834 | 831 | ||
835 | if (!symbol_conf.full_paths) { | ||
836 | char bf[PATH_MAX]; | ||
837 | |||
838 | if (getcwd(bf, sizeof(bf)) == NULL) { | ||
839 | err = -errno; | ||
840 | out_getcwd_err: | ||
841 | pr_err("failed to get the current directory\n"); | ||
842 | goto out_err; | ||
843 | } | ||
844 | self->cwd = strdup(bf); | ||
845 | if (self->cwd == NULL) { | ||
846 | err = -ENOMEM; | ||
847 | goto out_getcwd_err; | ||
848 | } | ||
849 | self->cwdlen = strlen(self->cwd); | ||
850 | } | ||
851 | |||
852 | if (!self->fd_pipe) | 832 | if (!self->fd_pipe) |
853 | err = __perf_session__process_events(self, | 833 | err = __perf_session__process_events(self, |
854 | self->header.data_offset, | 834 | self->header.data_offset, |
@@ -856,7 +836,7 @@ out_getcwd_err: | |||
856 | self->size, ops); | 836 | self->size, ops); |
857 | else | 837 | else |
858 | err = __perf_session__process_pipe_events(self, ops); | 838 | err = __perf_session__process_pipe_events(self, ops); |
859 | out_err: | 839 | |
860 | return err; | 840 | return err; |
861 | } | 841 | } |
862 | 842 | ||