From aa22dd4990e38700b1855555aa0def5215859abb Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Wed, 16 May 2012 18:45:47 +0900 Subject: perf target: Rename functions to avoid double negation Rename perf_target__no_{cpu,task} to perf_target__has_{cpu,task} because it's more intuitive and easy to parse (for human beings) when used with negation. The names are came out from David Ahern. It is intended to be a mechanical substitution without any functional change. The perf_target__none remains unchanged since I couldn't find a right name and it is hardly used with negation. Signed-off-by: Namhyung Kim Suggested-by: David Ahern Suggested-by: Ingo Molnar Cc: Ingo Molnar Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1337161549-9870-1-git-send-email-namhyung.kim@lge.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-stat.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tools/perf/builtin-stat.c') diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index d0605689bad9..0f4b51ae4be7 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -292,10 +292,10 @@ static int create_perf_stat_counter(struct perf_evsel *evsel, attr->inherit = !no_inherit; - if (!perf_target__no_cpu(&target)) + if (perf_target__has_cpu(&target)) return perf_evsel__open_per_cpu(evsel, evsel_list->cpus, group, group_fd); - if (perf_target__no_task(&target) && (!group || evsel == first)) { + if (!perf_target__has_task(&target) && (!group || evsel == first)) { attr->disabled = 1; attr->enable_on_exec = 1; } @@ -972,7 +972,7 @@ static void print_stat(int argc, const char **argv) if (!csv_output) { fprintf(output, "\n"); fprintf(output, " Performance counter stats for "); - if (perf_target__no_task(&target)) { + if (!perf_target__has_task(&target)) { fprintf(output, "\'%s", argv[0]); for (i = 1; i < argc; i++) fprintf(output, " %s", argv[i]); @@ -1194,13 +1194,13 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used) } else if (big_num_opt == 0) /* User passed --no-big-num */ big_num = false; - if (!argc && perf_target__no_task(&target)) + if (!argc && !perf_target__has_task(&target)) usage_with_options(stat_usage, options); if (run_count <= 0) usage_with_options(stat_usage, options); /* no_aggr, cgroup are for system-wide only */ - if ((no_aggr || nr_cgroups) && perf_target__no_cpu(&target)) { + if ((no_aggr || nr_cgroups) && !perf_target__has_cpu(&target)) { fprintf(stderr, "both cgroup and no-aggregation " "modes only available in system-wide mode\n"); @@ -1213,9 +1213,9 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used) perf_target__validate(&target); if (perf_evlist__create_maps(evsel_list, &target) < 0) { - if (!perf_target__no_task(&target)) + if (perf_target__has_task(&target)) pr_err("Problems finding threads of monitor\n"); - if (!perf_target__no_cpu(&target)) + if (perf_target__has_cpu(&target)) perror("failed to parse CPUs map"); usage_with_options(stat_usage, options); -- cgit v1.2.3