[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120213184008.GI15955@infradead.org>
Date: Mon, 13 Feb 2012 16:40:08 -0200
From: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To: Namhyung Kim <namhyung.kim@....com>
Cc: Namhyung Kim <namhyung@...il.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...e.hu>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 09/11] perf stat: Use perf_evlist__create_maps
Em Mon, Feb 13, 2012 at 04:27:41PM +0900, Namhyung Kim escreveu:
> Use same function with perf record and top to share the code
> checks combinations of different switches.
Haven't fully checked, but if equivalent, nice cleanup!
- Arnaldo
> Signed-off-by: Namhyung Kim <namhyung.kim@....com>
> ---
> tools/perf/builtin-stat.c | 16 ++--------------
> 1 files changed, 2 insertions(+), 14 deletions(-)
>
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index d080254a2d0c..be2667236bea 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -196,6 +196,7 @@ static int output_fd;
> static struct perf_maps_opts maps = {
> .target_pid = -1,
> .target_tid = -1,
> + .uid = UINT_MAX,
> };
>
> static volatile int done = 0;
> @@ -1208,20 +1209,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used)
>
> check_target_maps(&maps);
>
> - evsel_list->threads = thread_map__new(maps.target_pid, maps.target_tid,
> - UINT_MAX);
> - if (evsel_list->threads == NULL) {
> - pr_err("Problems finding threads of monitor\n");
> - usage_with_options(stat_usage, options);
> - }
> -
> - if (maps.system_wide)
> - evsel_list->cpus = cpu_map__new(maps.cpu_list);
> - else
> - evsel_list->cpus = cpu_map__dummy_new();
> -
> - if (evsel_list->cpus == NULL) {
> - perror("failed to parse CPUs map");
> + if (perf_evlist__create_maps(evsel_list, &maps) < 0) {
> usage_with_options(stat_usage, options);
> return -1;
> }
> --
> 1.7.9
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists