Commit 88ca895dd4e0e64ebd942adb7925fa60ca5b2a98

Authored by Dave Martin
Committed by Arnaldo Carvalho de Melo
1 parent 361d134625

perf tools: Remove unneeded code for tracking the cwd in perf sessions

Tidy-up patch to remove some code and struct perf_session data members
which are no longer needed due to the previous patch: "perf tools: Don't
abbreviate file paths relative to the cwd".

LKML-Reference: <new-submission>
Signed-off-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Showing 5 changed files with 2 additions and 29 deletions Side-by-side Diff

tools/perf/builtin-buildid-list.c
... ... @@ -43,10 +43,8 @@
43 43 if (session == NULL)
44 44 return -1;
45 45  
46   - if (with_hits) {
47   - symbol_conf.full_paths = true;
  46 + if (with_hits)
48 47 perf_session__process_events(session, &build_id__mark_dso_hit_ops);
49   - }
50 48  
51 49 perf_session__fprintf_dsos_buildid(session, stdout, with_hits);
52 50  
tools/perf/builtin-diff.c
... ... @@ -180,8 +180,6 @@
180 180 OPT_BOOLEAN('f', "force", &force, "don't complain, do it"),
181 181 OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules,
182 182 "load module symbols - WARNING: use only with -k and LIVE kernel"),
183   - OPT_BOOLEAN('P', "full-paths", &symbol_conf.full_paths,
184   - "Don't shorten the pathnames taking into account the cwd"),
185 183 OPT_STRING('d', "dsos", &symbol_conf.dso_list_str, "dso[,dso...]",
186 184 "only consider symbols in these dsos"),
187 185 OPT_STRING('C', "comms", &symbol_conf.comm_list_str, "comm[,comm...]",
tools/perf/builtin-report.c
... ... @@ -441,8 +441,6 @@
441 441 "pretty printing style key: normal raw"),
442 442 OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
443 443 "sort by key(s): pid, comm, dso, symbol, parent"),
444   - OPT_BOOLEAN('P', "full-paths", &symbol_conf.full_paths,
445   - "Don't shorten the pathnames taking into account the cwd"),
446 444 OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization,
447 445 "Show sample percentage for different cpu modes"),
448 446 OPT_STRING('p', "parent", &parent_pattern, "regex",
tools/perf/util/session.c
... ... @@ -96,8 +96,6 @@
96 96 self->hists_tree = RB_ROOT;
97 97 self->last_match = NULL;
98 98 self->mmap_window = 32;
99   - self->cwd = NULL;
100   - self->cwdlen = 0;
101 99 self->machines = RB_ROOT;
102 100 self->repipe = repipe;
103 101 INIT_LIST_HEAD(&self->ordered_samples.samples_head);
... ... @@ -130,7 +128,6 @@
130 128 {
131 129 perf_header__exit(&self->header);
132 130 close(self->fd);
133   - free(self->cwd);
134 131 free(self);
135 132 }
136 133  
... ... @@ -832,23 +829,6 @@
832 829 if (perf_session__register_idle_thread(self) == NULL)
833 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 832 if (!self->fd_pipe)
853 833 err = __perf_session__process_events(self,
854 834 self->header.data_offset,
... ... @@ -856,7 +836,7 @@
856 836 self->size, ops);
857 837 else
858 838 err = __perf_session__process_pipe_events(self, ops);
859   -out_err:
  839 +
860 840 return err;
861 841 }
862 842  
tools/perf/util/symbol.h
... ... @@ -68,7 +68,6 @@
68 68 show_nr_samples,
69 69 use_callchain,
70 70 exclude_other,
71   - full_paths,
72 71 show_cpu_utilization;
73 72 const char *vmlinux_name,
74 73 *source_prefix,