perf evlist: Remove cpus and threads arguments from perf_evlist__new()
authorNamhyung Kim <namhyung.kim@lge.com>
Mon, 11 Mar 2013 07:43:12 +0000 (16:43 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 15 Mar 2013 16:06:01 +0000 (13:06 -0300)
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>
13 files changed:
tools/perf/builtin-record.c
tools/perf/builtin-stat.c
tools/perf/builtin-top.c
tools/perf/builtin-trace.c
tools/perf/tests/evsel-roundtrip-name.c
tools/perf/tests/hists_link.c
tools/perf/tests/mmap-basic.c
tools/perf/tests/open-syscall-tp-fields.c
tools/perf/tests/parse-events.c
tools/perf/tests/perf-record.c
tools/perf/util/evlist.c
tools/perf/util/evlist.h
tools/perf/util/header.c

index f1a939ebc19c5d4aad0afbe1b96201aadbdb0511..e3261eae0ad7c375ae0f2f995e2a857f37a24d0d 100644 (file)
@@ -964,7 +964,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
        struct perf_record *rec = &record;
        char errbuf[BUFSIZ];
 
-       evsel_list = perf_evlist__new(NULL, NULL);
+       evsel_list = perf_evlist__new();
        if (evsel_list == NULL)
                return -ENOMEM;
 
index 99848761f573883e320f2db06071c5c16984b123..020329dca005fbbb8afeab2d9a079133562316e6 100644 (file)
@@ -1336,7 +1336,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
 
        setlocale(LC_ALL, "");
 
-       evsel_list = perf_evlist__new(NULL, NULL);
+       evsel_list = perf_evlist__new();
        if (evsel_list == NULL)
                return -ENOMEM;
 
index 72f6eb7b4173c86f84fcf3b001f6eb9ae1bdd8b4..c5601aa7a8701606b9a379b7a92271ee766080d7 100644 (file)
@@ -1116,7 +1116,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
                NULL
        };
 
-       top.evlist = perf_evlist__new(NULL, NULL);
+       top.evlist = perf_evlist__new();
        if (top.evlist == NULL)
                return -ENOMEM;
 
index d222d7fc7e960c7b541d507d524b66790a7d93b0..6198eb11e1c6994d248c00f26ab9b2c45241fa5a 100644 (file)
@@ -419,7 +419,7 @@ out_dump:
 
 static int trace__run(struct trace *trace, int argc, const char **argv)
 {
-       struct perf_evlist *evlist = perf_evlist__new(NULL, NULL);
+       struct perf_evlist *evlist = perf_evlist__new();
        struct perf_evsel *evsel;
        int err = -1, i;
        unsigned long before;
index 0fd99a9adb916293d91cd80797355b92940906d8..0197bda9c461c582659d91a80dd074149c4584e8 100644 (file)
@@ -8,7 +8,7 @@ static int perf_evsel__roundtrip_cache_name_test(void)
        char name[128];
        int type, op, err = 0, ret = 0, i, idx;
        struct perf_evsel *evsel;
-        struct perf_evlist *evlist = perf_evlist__new(NULL, NULL);
+       struct perf_evlist *evlist = perf_evlist__new();
 
         if (evlist == NULL)
                 return -ENOMEM;
@@ -64,7 +64,7 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names)
 {
        int i, err;
        struct perf_evsel *evsel;
-        struct perf_evlist *evlist = perf_evlist__new(NULL, NULL);
+       struct perf_evlist *evlist = perf_evlist__new();
 
         if (evlist == NULL)
                 return -ENOMEM;
index 1be64a6c5dafbda094a075faeb1556abbeee0f9f..e0c0267858a16b668eed92ebaf8119ab712403a0 100644 (file)
@@ -436,7 +436,7 @@ int test__hists_link(void)
        struct machines machines;
        struct machine *machine = NULL;
        struct perf_evsel *evsel, *first;
-        struct perf_evlist *evlist = perf_evlist__new(NULL, NULL);
+       struct perf_evlist *evlist = perf_evlist__new();
 
        if (evlist == NULL)
                 return -ENOMEM;
index cdd50755af51d6155e1fcf875965ae5576fe70d1..5b1b5aba722b545fb21fb96bc11ca3887868d286 100644 (file)
@@ -53,12 +53,14 @@ int test__basic_mmap(void)
                goto out_free_cpus;
        }
 
-       evlist = perf_evlist__new(cpus, threads);
+       evlist = perf_evlist__new();
        if (evlist == NULL) {
                pr_debug("perf_evlist__new\n");
                goto out_free_cpus;
        }
 
+       perf_evlist__set_maps(evlist, cpus, threads);
+
        for (i = 0; i < nsyscalls; ++i) {
                char name[64];
 
index 1c52fdc1164e49e0001f61cad9df75a48c5d97ce..02cb74174e237cb57a4501bcd4a11f5e361b63e9 100644 (file)
@@ -18,7 +18,7 @@ int test__syscall_open_tp_fields(void)
        };
        const char *filename = "/etc/passwd";
        int flags = O_RDONLY | O_DIRECTORY;
-       struct perf_evlist *evlist = perf_evlist__new(NULL, NULL);
+       struct perf_evlist *evlist = perf_evlist__new();
        struct perf_evsel *evsel;
        int err = -1, i, nr_events = 0, nr_polls = 0;
 
index 0d3d0c59f924d709eeee82fb6581a8b2b5c0e4bf..88e2f44cb157c6df8d9d10a5b3b751139faab7ff 100644 (file)
@@ -1218,7 +1218,7 @@ static int test_event(struct evlist_test *e)
        struct perf_evlist *evlist;
        int ret;
 
-       evlist = perf_evlist__new(NULL, NULL);
+       evlist = perf_evlist__new();
        if (evlist == NULL)
                return -ENOMEM;
 
index 1e8e5128d0da31a94fccfadc036cd8e0e48da8f4..f6ba75a983a8e1c767b1c3caf72a0343123ee389 100644 (file)
@@ -45,7 +45,7 @@ int test__PERF_RECORD(void)
        };
        cpu_set_t cpu_mask;
        size_t cpu_mask_size = sizeof(cpu_mask);
-       struct perf_evlist *evlist = perf_evlist__new(NULL, NULL);
+       struct perf_evlist *evlist = perf_evlist__new();
        struct perf_evsel *evsel;
        struct perf_sample sample;
        const char *cmd = "sleep";
index 7626bb49508d16f142805d4ff2eb6c04545cee59..a199f1887beff4b505c6619cf72c8d806dec93c9 100644 (file)
@@ -38,13 +38,12 @@ void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus,
        evlist->workload.pid = -1;
 }
 
-struct perf_evlist *perf_evlist__new(struct cpu_map *cpus,
-                                    struct thread_map *threads)
+struct perf_evlist *perf_evlist__new(void)
 {
        struct perf_evlist *evlist = zalloc(sizeof(*evlist));
 
        if (evlist != NULL)
-               perf_evlist__init(evlist, cpus, threads);
+               perf_evlist__init(evlist, NULL, NULL);
 
        return evlist;
 }
index 2dd07bd60b4f7048a41752a92aa7dc4dc23fced8..9a7b76e3a8739da5841f53d136f760cb5f01b53e 100644 (file)
@@ -49,8 +49,7 @@ struct perf_evsel_str_handler {
        void       *handler;
 };
 
-struct perf_evlist *perf_evlist__new(struct cpu_map *cpus,
-                                    struct thread_map *threads);
+struct perf_evlist *perf_evlist__new(void);
 void perf_evlist__init(struct perf_evlist *evlist, struct cpu_map *cpus,
                       struct thread_map *threads);
 void perf_evlist__exit(struct perf_evlist *evlist);
index f4bfd79ef6a7e04aded216bb2c0540ce1dd17deb..a9b7349f7c5fc7e35a42dd446b98b84ee256b392 100644 (file)
@@ -2789,7 +2789,7 @@ int perf_session__read_header(struct perf_session *session, int fd)
        u64                     f_id;
        int nr_attrs, nr_ids, i, j;
 
-       session->evlist = perf_evlist__new(NULL, NULL);
+       session->evlist = perf_evlist__new();
        if (session->evlist == NULL)
                return -ENOMEM;
 
@@ -2940,7 +2940,7 @@ int perf_event__process_attr(union perf_event *event,
        struct perf_evlist *evlist = *pevlist;
 
        if (evlist == NULL) {
-               *pevlist = evlist = perf_evlist__new(NULL, NULL);
+               *pevlist = evlist = perf_evlist__new();
                if (evlist == NULL)
                        return -ENOMEM;
        }