aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorDave Martin <dave.martin@linaro.org>2010-07-27 10:46:12 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-07-27 10:46:12 -0400
commit88ca895dd4e0e64ebd942adb7925fa60ca5b2a98 (patch)
treef3680bbdcd63e60068fe18ec0c34d8f99e0519fe /tools/perf
parent361d13462585474267a0c41e956f1a1c19a93f17 (diff)
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>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-buildid-list.c4
-rw-r--r--tools/perf/builtin-diff.c2
-rw-r--r--tools/perf/builtin-report.c2
-rw-r--r--tools/perf/util/session.c22
-rw-r--r--tools/perf/util/symbol.h1
5 files changed, 2 insertions, 29 deletions
diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c
index 99890728409e..44a47e13bd67 100644
--- a/tools/perf/builtin-buildid-list.c
+++ b/tools/perf/builtin-buildid-list.c
@@ -43,10 +43,8 @@ static int __cmd_buildid_list(void)
43 if (session == NULL) 43 if (session == NULL)
44 return -1; 44 return -1;
45 45
46 if (with_hits) { 46 if (with_hits)
47 symbol_conf.full_paths = true;
48 perf_session__process_events(session, &build_id__mark_dso_hit_ops); 47 perf_session__process_events(session, &build_id__mark_dso_hit_ops);
49 }
50 48
51 perf_session__fprintf_dsos_buildid(session, stdout, with_hits); 49 perf_session__fprintf_dsos_buildid(session, stdout, with_hits);
52 50
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 39e6627ebb96..fca1d4402910 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -180,8 +180,6 @@ static const struct option options[] = {
180 OPT_BOOLEAN('f', "force", &force, "don't complain, do it"), 180 OPT_BOOLEAN('f', "force", &force, "don't complain, do it"),
181 OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules, 181 OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules,
182 "load module symbols - WARNING: use only with -k and LIVE kernel"), 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 OPT_STRING('d', "dsos", &symbol_conf.dso_list_str, "dso[,dso...]", 183 OPT_STRING('d', "dsos", &symbol_conf.dso_list_str, "dso[,dso...]",
186 "only consider symbols in these dsos"), 184 "only consider symbols in these dsos"),
187 OPT_STRING('C', "comms", &symbol_conf.comm_list_str, "comm[,comm...]", 185 OPT_STRING('C', "comms", &symbol_conf.comm_list_str, "comm[,comm...]",
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index ce42bbaa252d..2f4b92925b26 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -441,8 +441,6 @@ static const struct option options[] = {
441 "pretty printing style key: normal raw"), 441 "pretty printing style key: normal raw"),
442 OPT_STRING('s', "sort", &sort_order, "key[,key2...]", 442 OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
443 "sort by key(s): pid, comm, dso, symbol, parent"), 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 OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization, 444 OPT_BOOLEAN(0, "showcpuutilization", &symbol_conf.show_cpu_utilization,
447 "Show sample percentage for different cpu modes"), 445 "Show sample percentage for different cpu modes"),
448 OPT_STRING('p', "parent", &parent_pattern, "regex", 446 OPT_STRING('p', "parent", &parent_pattern, "regex",
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;
840out_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);
859out_err: 839
860 return err; 840 return err;
861} 841}
862 842
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index bb1aab9fa34f..6452a07425a2 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -68,7 +68,6 @@ struct symbol_conf {
68 show_nr_samples, 68 show_nr_samples,
69 use_callchain, 69 use_callchain,
70 exclude_other, 70 exclude_other,
71 full_paths,
72 show_cpu_utilization; 71 show_cpu_utilization;
73 const char *vmlinux_name, 72 const char *vmlinux_name,
74 *source_prefix, 73 *source_prefix,