aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2013-03-11 03:43:12 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-03-15 12:06:01 -0400
commit334fe7a3c63624eb1bba42f81eb088d5665d9f3e (patch)
tree7ac15fc6070870ea30ee85c738d342ed1211e820 /tools/perf
parentb28b130719af6e7f56e0bbdac38ba703a36ba5d5 (diff)
perf evlist: Remove cpus and threads arguments from perf_evlist__new()
It's almost always used with NULL for both arguments. Get rid of the arguments from the signature and use perf_evlist__set_maps() if needed. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1362987798-24969-1-git-send-email-namhyung@kernel.org [ committer note: replaced spaces with tabs in some of the affected lines ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-record.c2
-rw-r--r--tools/perf/builtin-stat.c2
-rw-r--r--tools/perf/builtin-top.c2
-rw-r--r--tools/perf/builtin-trace.c2
-rw-r--r--tools/perf/tests/evsel-roundtrip-name.c4
-rw-r--r--tools/perf/tests/hists_link.c2
-rw-r--r--tools/perf/tests/mmap-basic.c4
-rw-r--r--tools/perf/tests/open-syscall-tp-fields.c2
-rw-r--r--tools/perf/tests/parse-events.c2
-rw-r--r--tools/perf/tests/perf-record.c2
-rw-r--r--tools/perf/util/evlist.c5
-rw-r--r--tools/perf/util/evlist.h3
-rw-r--r--tools/perf/util/header.c4
13 files changed, 18 insertions, 18 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index f1a939ebc19c..e3261eae0ad7 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -964,7 +964,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
964 struct perf_record *rec = &record; 964 struct perf_record *rec = &record;
965 char errbuf[BUFSIZ]; 965 char errbuf[BUFSIZ];
966 966
967 evsel_list = perf_evlist__new(NULL, NULL); 967 evsel_list = perf_evlist__new();
968 if (evsel_list == NULL) 968 if (evsel_list == NULL)
969 return -ENOMEM; 969 return -ENOMEM;
970 970
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 99848761f573..020329dca005 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1336,7 +1336,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
1336 1336
1337 setlocale(LC_ALL, ""); 1337 setlocale(LC_ALL, "");
1338 1338
1339 evsel_list = perf_evlist__new(NULL, NULL); 1339 evsel_list = perf_evlist__new();
1340 if (evsel_list == NULL) 1340 if (evsel_list == NULL)
1341 return -ENOMEM; 1341 return -ENOMEM;
1342 1342
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 72f6eb7b4173..c5601aa7a870 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1116,7 +1116,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
1116 NULL 1116 NULL
1117 }; 1117 };
1118 1118
1119 top.evlist = perf_evlist__new(NULL, NULL); 1119 top.evlist = perf_evlist__new();
1120 if (top.evlist == NULL) 1120 if (top.evlist == NULL)
1121 return -ENOMEM; 1121 return -ENOMEM;
1122 1122
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index d222d7fc7e96..6198eb11e1c6 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -419,7 +419,7 @@ out_dump:
419 419
420static int trace__run(struct trace *trace, int argc, const char **argv) 420static int trace__run(struct trace *trace, int argc, const char **argv)
421{ 421{
422 struct perf_evlist *evlist = perf_evlist__new(NULL, NULL); 422 struct perf_evlist *evlist = perf_evlist__new();
423 struct perf_evsel *evsel; 423 struct perf_evsel *evsel;
424 int err = -1, i; 424 int err = -1, i;
425 unsigned long before; 425 unsigned long before;
diff --git a/tools/perf/tests/evsel-roundtrip-name.c b/tools/perf/tests/evsel-roundtrip-name.c
index 0fd99a9adb91..0197bda9c461 100644
--- a/tools/perf/tests/evsel-roundtrip-name.c
+++ b/tools/perf/tests/evsel-roundtrip-name.c
@@ -8,7 +8,7 @@ static int perf_evsel__roundtrip_cache_name_test(void)
8 char name[128]; 8 char name[128];
9 int type, op, err = 0, ret = 0, i, idx; 9 int type, op, err = 0, ret = 0, i, idx;
10 struct perf_evsel *evsel; 10 struct perf_evsel *evsel;
11 struct perf_evlist *evlist = perf_evlist__new(NULL, NULL); 11 struct perf_evlist *evlist = perf_evlist__new();
12 12
13 if (evlist == NULL) 13 if (evlist == NULL)
14 return -ENOMEM; 14 return -ENOMEM;
@@ -64,7 +64,7 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names)
64{ 64{
65 int i, err; 65 int i, err;
66 struct perf_evsel *evsel; 66 struct perf_evsel *evsel;
67 struct perf_evlist *evlist = perf_evlist__new(NULL, NULL); 67 struct perf_evlist *evlist = perf_evlist__new();
68 68
69 if (evlist == NULL) 69 if (evlist == NULL)
70 return -ENOMEM; 70 return -ENOMEM;
diff --git a/tools/perf/tests/hists_link.c b/tools/perf/tests/hists_link.c
index 1be64a6c5daf..e0c0267858a1 100644
--- a/tools/perf/tests/hists_link.c
+++ b/tools/perf/tests/hists_link.c
@@ -436,7 +436,7 @@ int test__hists_link(void)
436 struct machines machines; 436 struct machines machines;
437 struct machine *machine = NULL; 437 struct machine *machine = NULL;
438 struct perf_evsel *evsel, *first; 438 struct perf_evsel *evsel, *first;
439 struct perf_evlist *evlist = perf_evlist__new(NULL, NULL); 439 struct perf_evlist *evlist = perf_evlist__new();
440 440
441 if (evlist == NULL) 441 if (evlist == NULL)
442 return -ENOMEM; 442 return -ENOMEM;
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
index cdd50755af51..5b1b5aba722b 100644
--- a/tools/perf/tests/mmap-basic.c
+++ b/tools/perf/tests/mmap-basic.c
@@ -53,12 +53,14 @@ int test__basic_mmap(void)
53 goto out_free_cpus; 53 goto out_free_cpus;
54 } 54 }
55 55
56 evlist = perf_evlist__new(cpus, threads); 56 evlist = perf_evlist__new();
57 if (evlist == NULL) { 57 if (evlist == NULL) {
58 pr_debug("perf_evlist__new\n"); 58 pr_debug("perf_evlist__new\n");
59 goto out_free_cpus; 59 goto out_free_cpus;
60 } 60 }
61 61
62 perf_evlist__set_maps(evlist, cpus, threads);
63
62 for (i = 0; i < nsyscalls; ++i) { 64 for (i = 0; i < nsyscalls; ++i) {
63 char name[64]; 65 char name[64];
64 66
diff --git a/tools/perf/tests/open-syscall-tp-fields.c b/tools/perf/tests/open-syscall-tp-fields.c
index 1c52fdc1164e..02cb74174e23 100644
--- a/tools/perf/tests/open-syscall-tp-fields.c
+++ b/tools/perf/tests/open-syscall-tp-fields.c
@@ -18,7 +18,7 @@ int test__syscall_open_tp_fields(void)
18 }; 18 };
19 const char *filename = "/etc/passwd"; 19 const char *filename = "/etc/passwd";
20 int flags = O_RDONLY | O_DIRECTORY; 20 int flags = O_RDONLY | O_DIRECTORY;
21 struct perf_evlist *evlist = perf_evlist__new(NULL, NULL); 21 struct perf_evlist *evlist = perf_evlist__new();
22 struct perf_evsel *evsel; 22 struct perf_evsel *evsel;
23 int err = -1, i, nr_events = 0, nr_polls = 0; 23 int err = -1, i, nr_events = 0, nr_polls = 0;
24 24
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 0d3d0c59f924..88e2f44cb157 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1218,7 +1218,7 @@ static int test_event(struct evlist_test *e)
1218 struct perf_evlist *evlist; 1218 struct perf_evlist *evlist;
1219 int ret; 1219 int ret;
1220 1220
1221 evlist = perf_evlist__new(NULL, NULL); 1221 evlist = perf_evlist__new();
1222 if (evlist == NULL) 1222 if (evlist == NULL)
1223 return -ENOMEM; 1223 return -ENOMEM;
1224 1224
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index 1e8e5128d0da..f6ba75a983a8 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -45,7 +45,7 @@ int test__PERF_RECORD(void)
45 }; 45 };
46 cpu_set_t cpu_mask; 46 cpu_set_t cpu_mask;
47 size_t cpu_mask_size = sizeof(cpu_mask); 47 size_t cpu_mask_size = sizeof(cpu_mask);
48 struct perf_evlist *evlist = perf_evlist__new(NULL, NULL); 48 struct perf_evlist *evlist = perf_evlist__new();
49 struct perf_evsel *evsel; 49 struct perf_evsel *evsel;
50 struct perf_sample sample; 50 struct perf_sample sample;
51 const char *cmd = "sleep"; 51 const char *cmd = "sleep";
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 7626bb49508d..a199f1887bef 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -38,13 +38,12 @@ void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus,
38 evlist->workload.pid = -1; 38 evlist->workload.pid = -1;
39} 39}
40 40
41struct perf_evlist *perf_evlist__new(struct cpu_map *cpus, 41struct perf_evlist *perf_evlist__new(void)
42 struct thread_map *threads)
43{ 42{
44 struct perf_evlist *evlist = zalloc(sizeof(*evlist)); 43 struct perf_evlist *evlist = zalloc(sizeof(*evlist));
45 44
46 if (evlist != NULL) 45 if (evlist != NULL)
47 perf_evlist__init(evlist, cpus, threads); 46 perf_evlist__init(evlist, NULL, NULL);
48 47
49 return evlist; 48 return evlist;
50} 49}
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 2dd07bd60b4f..9a7b76e3a873 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -49,8 +49,7 @@ struct perf_evsel_str_handler {
49 void *handler; 49 void *handler;
50}; 50};
51 51
52struct perf_evlist *perf_evlist__new(struct cpu_map *cpus, 52struct perf_evlist *perf_evlist__new(void);
53 struct thread_map *threads);
54void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus, 53void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus,
55 struct thread_map *threads); 54 struct thread_map *threads);
56void perf_evlist__exit(struct perf_evlist *evlist); 55void perf_evlist__exit(struct perf_evlist *evlist);
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index f4bfd79ef6a7..a9b7349f7c5f 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -2789,7 +2789,7 @@ int perf_session__read_header(struct perf_session *session, int fd)
2789 u64 f_id; 2789 u64 f_id;
2790 int nr_attrs, nr_ids, i, j; 2790 int nr_attrs, nr_ids, i, j;
2791 2791
2792 session->evlist = perf_evlist__new(NULL, NULL); 2792 session->evlist = perf_evlist__new();
2793 if (session->evlist == NULL) 2793 if (session->evlist == NULL)
2794 return -ENOMEM; 2794 return -ENOMEM;
2795 2795
@@ -2940,7 +2940,7 @@ int perf_event__process_attr(union perf_event *event,
2940 struct perf_evlist *evlist = *pevlist; 2940 struct perf_evlist *evlist = *pevlist;
2941 2941
2942 if (evlist == NULL) { 2942 if (evlist == NULL) {
2943 *pevlist = evlist = perf_evlist__new(NULL, NULL); 2943 *pevlist = evlist = perf_evlist__new();
2944 if (evlist == NULL) 2944 if (evlist == NULL)
2945 return -ENOMEM; 2945 return -ENOMEM;
2946 } 2946 }