aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2013-11-12 14:46:16 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-11-12 14:51:03 -0500
commit602ad878d41ef097cc9aa2def7830d5bb27a15d8 (patch)
tree6383b40cf015a1fd74a51c4cbfadd8756cde8dee
parent48095b721ca54ffa70427185c00473530f4aef06 (diff)
perf target: Shorten perf_target__ to target__
Getting unwieldly long, for this app domain should be descriptive enough and the use of __ to separate the class from the method names should help with avoiding clashes with other code bases. Reported-by: David Ahern <dsahern@gmail.com> Suggested-by: Ingo Molnar <mingo@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/20131112113427.GA4053@ghostprotocols.net Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/builtin-kvm.c6
-rw-r--r--tools/perf/builtin-record.c14
-rw-r--r--tools/perf/builtin-stat.c21
-rw-r--r--tools/perf/builtin-top.c14
-rw-r--r--tools/perf/builtin-trace.c10
-rw-r--r--tools/perf/perf.h2
-rw-r--r--tools/perf/tests/task-exit.c2
-rw-r--r--tools/perf/util/evlist.c12
-rw-r--r--tools/perf/util/evlist.h5
-rw-r--r--tools/perf/util/evsel.c9
-rw-r--r--tools/perf/util/evsel.h3
-rw-r--r--tools/perf/util/machine.c6
-rw-r--r--tools/perf/util/machine.h4
-rw-r--r--tools/perf/util/target.c54
-rw-r--r--tools/perf/util/target.h44
-rw-r--r--tools/perf/util/top.c2
16 files changed, 99 insertions, 109 deletions
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 346bb5909e3d..f8bf5f244d77 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1510,13 +1510,13 @@ static int kvm_events_live(struct perf_kvm_stat *kvm,
1510 /* 1510 /*
1511 * target related setups 1511 * target related setups
1512 */ 1512 */
1513 err = perf_target__validate(&kvm->opts.target); 1513 err = target__validate(&kvm->opts.target);
1514 if (err) { 1514 if (err) {
1515 perf_target__strerror(&kvm->opts.target, err, errbuf, BUFSIZ); 1515 target__strerror(&kvm->opts.target, err, errbuf, BUFSIZ);
1516 ui__warning("%s", errbuf); 1516 ui__warning("%s", errbuf);
1517 } 1517 }
1518 1518
1519 if (perf_target__none(&kvm->opts.target)) 1519 if (target__none(&kvm->opts.target))
1520 kvm->opts.target.system_wide = true; 1520 kvm->opts.target.system_wide = true;
1521 1521
1522 1522
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 880227eae20f..4d644fe2d5b7 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -506,7 +506,7 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
506 * (apart from group members) have enable_on_exec=1 set, 506 * (apart from group members) have enable_on_exec=1 set,
507 * so don't spoil it by prematurely enabling them. 507 * so don't spoil it by prematurely enabling them.
508 */ 508 */
509 if (!perf_target__none(&opts->target)) 509 if (!target__none(&opts->target))
510 perf_evlist__enable(evsel_list); 510 perf_evlist__enable(evsel_list);
511 511
512 /* 512 /*
@@ -535,7 +535,7 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
535 * die with the process and we wait for that. Thus no need to 535 * die with the process and we wait for that. Thus no need to
536 * disable events in this case. 536 * disable events in this case.
537 */ 537 */
538 if (done && !disabled && !perf_target__none(&opts->target)) { 538 if (done && !disabled && !target__none(&opts->target)) {
539 perf_evlist__disable(evsel_list); 539 perf_evlist__disable(evsel_list);
540 disabled = true; 540 disabled = true;
541 } 541 }
@@ -906,7 +906,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
906 906
907 argc = parse_options(argc, argv, record_options, record_usage, 907 argc = parse_options(argc, argv, record_options, record_usage,
908 PARSE_OPT_STOP_AT_NON_OPTION); 908 PARSE_OPT_STOP_AT_NON_OPTION);
909 if (!argc && perf_target__none(&rec->opts.target)) 909 if (!argc && target__none(&rec->opts.target))
910 usage_with_options(record_usage, record_options); 910 usage_with_options(record_usage, record_options);
911 911
912 if (nr_cgroups && !rec->opts.target.system_wide) { 912 if (nr_cgroups && !rec->opts.target.system_wide) {
@@ -936,17 +936,17 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
936 goto out_symbol_exit; 936 goto out_symbol_exit;
937 } 937 }
938 938
939 err = perf_target__validate(&rec->opts.target); 939 err = target__validate(&rec->opts.target);
940 if (err) { 940 if (err) {
941 perf_target__strerror(&rec->opts.target, err, errbuf, BUFSIZ); 941 target__strerror(&rec->opts.target, err, errbuf, BUFSIZ);
942 ui__warning("%s", errbuf); 942 ui__warning("%s", errbuf);
943 } 943 }
944 944
945 err = perf_target__parse_uid(&rec->opts.target); 945 err = target__parse_uid(&rec->opts.target);
946 if (err) { 946 if (err) {
947 int saved_errno = errno; 947 int saved_errno = errno;
948 948
949 perf_target__strerror(&rec->opts.target, err, errbuf, BUFSIZ); 949 target__strerror(&rec->opts.target, err, errbuf, BUFSIZ);
950 ui__error("%s", errbuf); 950 ui__error("%s", errbuf);
951 951
952 err = -saved_errno; 952 err = -saved_errno;
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 0fc1c941a73c..ee0d565f83e3 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -108,7 +108,7 @@ enum {
108 108
109static struct perf_evlist *evsel_list; 109static struct perf_evlist *evsel_list;
110 110
111static struct perf_target target = { 111static struct target target = {
112 .uid = UINT_MAX, 112 .uid = UINT_MAX,
113}; 113};
114 114
@@ -294,11 +294,10 @@ static int create_perf_stat_counter(struct perf_evsel *evsel)
294 294
295 attr->inherit = !no_inherit; 295 attr->inherit = !no_inherit;
296 296
297 if (perf_target__has_cpu(&target)) 297 if (target__has_cpu(&target))
298 return perf_evsel__open_per_cpu(evsel, perf_evsel__cpus(evsel)); 298 return perf_evsel__open_per_cpu(evsel, perf_evsel__cpus(evsel));
299 299
300 if (!perf_target__has_task(&target) && 300 if (!target__has_task(&target) && perf_evsel__is_group_leader(evsel)) {
301 perf_evsel__is_group_leader(evsel)) {
302 attr->disabled = 1; 301 attr->disabled = 1;
303 if (!initial_delay) 302 if (!initial_delay)
304 attr->enable_on_exec = 1; 303 attr->enable_on_exec = 1;
@@ -1236,7 +1235,7 @@ static void print_stat(int argc, const char **argv)
1236 fprintf(output, "\'system wide"); 1235 fprintf(output, "\'system wide");
1237 else if (target.cpu_list) 1236 else if (target.cpu_list)
1238 fprintf(output, "\'CPU(s) %s", target.cpu_list); 1237 fprintf(output, "\'CPU(s) %s", target.cpu_list);
1239 else if (!perf_target__has_task(&target)) { 1238 else if (!target__has_task(&target)) {
1240 fprintf(output, "\'%s", argv[0]); 1239 fprintf(output, "\'%s", argv[0]);
1241 for (i = 1; i < argc; i++) 1240 for (i = 1; i < argc; i++)
1242 fprintf(output, " %s", argv[i]); 1241 fprintf(output, " %s", argv[i]);
@@ -1667,7 +1666,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
1667 } else if (big_num_opt == 0) /* User passed --no-big-num */ 1666 } else if (big_num_opt == 0) /* User passed --no-big-num */
1668 big_num = false; 1667 big_num = false;
1669 1668
1670 if (!argc && perf_target__none(&target)) 1669 if (!argc && target__none(&target))
1671 usage_with_options(stat_usage, options); 1670 usage_with_options(stat_usage, options);
1672 1671
1673 if (run_count < 0) { 1672 if (run_count < 0) {
@@ -1680,8 +1679,8 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
1680 } 1679 }
1681 1680
1682 /* no_aggr, cgroup are for system-wide only */ 1681 /* no_aggr, cgroup are for system-wide only */
1683 if ((aggr_mode != AGGR_GLOBAL || nr_cgroups) 1682 if ((aggr_mode != AGGR_GLOBAL || nr_cgroups) &&
1684 && !perf_target__has_cpu(&target)) { 1683 !target__has_cpu(&target)) {
1685 fprintf(stderr, "both cgroup and no-aggregation " 1684 fprintf(stderr, "both cgroup and no-aggregation "
1686 "modes only available in system-wide mode\n"); 1685 "modes only available in system-wide mode\n");
1687 1686
@@ -1694,14 +1693,14 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
1694 if (add_default_attributes()) 1693 if (add_default_attributes())
1695 goto out; 1694 goto out;
1696 1695
1697 perf_target__validate(&target); 1696 target__validate(&target);
1698 1697
1699 if (perf_evlist__create_maps(evsel_list, &target) < 0) { 1698 if (perf_evlist__create_maps(evsel_list, &target) < 0) {
1700 if (perf_target__has_task(&target)) { 1699 if (target__has_task(&target)) {
1701 pr_err("Problems finding threads of monitor\n"); 1700 pr_err("Problems finding threads of monitor\n");