lkml.org 
[lkml]   [2012]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 09/11] perf stat: Use perf_evlist__create_maps
    Date
    Use same function with perf record and top to share the code
    checks combinations of different switches.

    Signed-off-by: Namhyung Kim <namhyung.kim@lge.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


    \
     
     \ /
      Last update: 2012-02-13 08:15    [W:0.023 / U:30.600 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site