aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-08-18 15:51:44 -0400
committerIngo Molnar <mingo@elte.hu>2011-08-18 15:51:44 -0400
commitfe4c51b22080691792d3e28d86acb4d4ccb7e8e8 (patch)
treea88323ad10bb2ad6b19b5ea5fbb41a210096bd5f
parent72ed62bdc46d76c965fb95aecb5d0bf97c976723 (diff)
parent43bece79796c2a39ec98998fd3f1071f04f3d8c3 (diff)
Merge branch 'perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
-rw-r--r--MAINTAINERS2
-rw-r--r--tools/perf/builtin-record.c4
-rw-r--r--tools/perf/builtin-stat.c7
-rw-r--r--tools/perf/util/evlist.c11
-rw-r--r--tools/perf/util/include/linux/compiler.h2
-rw-r--r--tools/perf/util/parse-events.c8
6 files changed, 26 insertions, 8 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 1d445f572987..069ee3b5c651 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4971,7 +4971,7 @@ M: Paul Mackerras <paulus@samba.org>
4971M: Ingo Molnar <mingo@elte.hu> 4971M: Ingo Molnar <mingo@elte.hu>
4972M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> 4972M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
4973S: Supported 4973S: Supported
4974F: kernel/perf_event*.c 4974F: kernel/events/*
4975F: include/linux/perf_event.h 4975F: include/linux/perf_event.h
4976F: arch/*/kernel/perf_event*.c 4976F: arch/*/kernel/perf_event*.c
4977F: arch/*/kernel/*/perf_event*.c 4977F: arch/*/kernel/*/perf_event*.c
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index f6426b496f4a..6b0519f885e4 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -45,7 +45,7 @@ static int freq = 1000;
45static int output; 45static int output;
46static int pipe_output = 0; 46static int pipe_output = 0;
47static const char *output_name = NULL; 47static const char *output_name = NULL;
48static int group = 0; 48static bool group = false;
49static int realtime_prio = 0; 49static int realtime_prio = 0;
50static bool nodelay = false; 50static bool nodelay = false;
51static bool raw_samples = false; 51static bool raw_samples = false;
@@ -753,6 +753,8 @@ const struct option record_options[] = {
753 "child tasks do not inherit counters"), 753 "child tasks do not inherit counters"),
754 OPT_UINTEGER('F', "freq", &user_freq, "profile at this frequency"), 754 OPT_UINTEGER('F', "freq", &user_freq, "profile at this frequency"),
755 OPT_UINTEGER('m', "mmap-pages", &mmap_pages, "number of mmap data pages"), 755 OPT_UINTEGER('m', "mmap-pages", &mmap_pages, "number of mmap data pages"),
756 OPT_BOOLEAN(0, "group", &group,
757 "put the counters into a counter group"),
756 OPT_BOOLEAN('g', "call-graph", &call_graph, 758 OPT_BOOLEAN('g', "call-graph", &call_graph,
757 "do call-graph (stack chain/backtrace) recording"), 759 "do call-graph (stack chain/backtrace) recording"),
758 OPT_INCR('v', "verbose", &verbose, 760 OPT_INCR('v', "verbose", &verbose,
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 1ad04ce29c34..5deb17d9e795 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -193,6 +193,7 @@ static int big_num_opt = -1;
193static const char *cpu_list; 193static const char *cpu_list;
194static const char *csv_sep = NULL; 194static const char *csv_sep = NULL;
195static bool csv_output = false; 195static bool csv_output = false;
196static bool group = false;
196 197
197static volatile int done = 0; 198static volatile int done = 0;
198 199
@@ -280,14 +281,14 @@ static int create_perf_stat_counter(struct perf_evsel *evsel)
280 attr->inherit = !no_inherit; 281 attr->inherit = !no_inherit;
281 282
282 if (system_wide) 283 if (system_wide)
283 return perf_evsel__open_per_cpu(evsel, evsel_list->cpus, false); 284 return perf_evsel__open_per_cpu(evsel, evsel_list->cpus, group);
284 285
285 if (target_pid == -1 && target_tid == -1) { 286 if (target_pid == -1 && target_tid == -1) {
286 attr->disabled = 1; 287 attr->disabled = 1;
287 attr->enable_on_exec = 1; 288 attr->enable_on_exec = 1;
288 } 289 }
289 290
290 return perf_evsel__open_per_thread(evsel, evsel_list->threads, false); 291 return perf_evsel__open_per_thread(evsel, evsel_list->threads, group);
291} 292}
292 293
293/* 294/*
@@ -1043,6 +1044,8 @@ static const struct option options[] = {
1043 "stat events on existing thread id"), 1044 "stat events on existing thread id"),
1044 OPT_BOOLEAN('a', "all-cpus", &system_wide, 1045 OPT_BOOLEAN('a', "all-cpus", &system_wide,
1045 "system-wide collection from all CPUs"), 1046 "system-wide collection from all CPUs"),
1047 OPT_BOOLEAN('g', "group", &group,
1048 "put the counters into a counter group"),
1046 OPT_BOOLEAN('c', "scale", &scale, 1049 OPT_BOOLEAN('c', "scale", &scale,
1047 "scale/normalize counters"), 1050 "scale/normalize counters"),
1048 OPT_INCR('v', "verbose", &verbose, 1051 OPT_INCR('v', "verbose", &verbose,
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index e03e7bc8205e..c12bd476c6f7 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -85,10 +85,19 @@ int perf_evlist__add_default(struct perf_evlist *evlist)
85 struct perf_evsel *evsel = perf_evsel__new(&attr, 0); 85 struct perf_evsel *evsel = perf_evsel__new(&attr, 0);
86 86
87 if (evsel == NULL) 87 if (evsel == NULL)
88 return -ENOMEM; 88 goto error;
89
90 /* use strdup() because free(evsel) assumes name is allocated */
91 evsel->name = strdup("cycles");
92 if (!evsel->name)
93 goto error_free;
89 94
90 perf_evlist__add(evlist, evsel); 95 perf_evlist__add(evlist, evsel);
91 return 0; 96 return 0;
97error_free:
98 perf_evsel__delete(evsel);
99error:
100 return -ENOMEM;
92} 101}
93 102
94void perf_evlist__disable(struct perf_evlist *evlist) 103void perf_evlist__disable(struct perf_evlist *evlist)
diff --git a/tools/perf/util/include/linux/compiler.h b/tools/perf/util/include/linux/compiler.h
index 791f9dd27ebf..547628e97f3d 100644
--- a/tools/perf/util/include/linux/compiler.h
+++ b/tools/perf/util/include/linux/compiler.h
@@ -5,7 +5,9 @@
5#define __always_inline inline 5#define __always_inline inline
6#endif 6#endif
7#define __user 7#define __user
8#ifndef __attribute_const__
8#define __attribute_const__ 9#define __attribute_const__
10#endif
9 11
10#define __used __attribute__((__unused__)) 12#define __used __attribute__((__unused__))
11 13
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 4ea7e19f5251..928918b796b2 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -697,7 +697,11 @@ parse_raw_event(const char **strp, struct perf_event_attr *attr)
697 return EVT_FAILED; 697 return EVT_FAILED;
698 n = hex2u64(str + 1, &config); 698 n = hex2u64(str + 1, &config);
699 if (n > 0) { 699 if (n > 0) {
700 *strp = str + n + 1; 700 const char *end = str + n + 1;
701 if (*end != '\0' && *end != ',' && *end != ':')
702 return EVT_FAILED;
703
704 *strp = end;
701 attr->type = PERF_TYPE_RAW; 705 attr->type = PERF_TYPE_RAW;
702 attr->config = config; 706 attr->config = config;
703 return EVT_HANDLED; 707 return EVT_HANDLED;
@@ -1097,6 +1101,4 @@ void print_events(const char *event_glob)
1097 printf("\n"); 1101 printf("\n");
1098 1102
1099 print_tracepoint_events(NULL, NULL); 1103 print_tracepoint_events(NULL, NULL);
1100
1101 exit(129);
1102} 1104}