diff options
| author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-08-08 10:22:41 +0400 | 
|---|---|---|
| committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-08-08 10:22:41 +0400 | 
| commit | 1a43f2012455a977397deffe35912fd3f3ce17b9 (patch) | |
| tree | 5189f337df44e7a495fbd097cd476b0380babd8c /tools/perf/builtin-annotate.c | |
| parent | e1b96ada659431669efaf3defa997abf5db68130 (diff) | |
| parent | 322a8b034003c0d46d39af85bf24fee27b902f48 (diff) | |
| download | linux-1a43f2012455a977397deffe35912fd3f3ce17b9.tar.xz | |
Merge commit 'v3.1-rc1' into imx-fixes
Diffstat (limited to 'tools/perf/builtin-annotate.c')
| -rw-r--r-- | tools/perf/builtin-annotate.c | 15 | 
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 7b139e1e7e86..555aefd7fe01 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -28,6 +28,8 @@  #include "util/hist.h"  #include "util/session.h" +#include <linux/bitmap.h> +  static char		const *input_name = "perf.data";  static bool		force, use_tui, use_stdio; @@ -38,6 +40,9 @@ static bool		print_line;  static const char *sym_hist_filter; +static const char	*cpu_list; +static DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); +  static int perf_evlist__add_sample(struct perf_evlist *evlist,  				   struct perf_sample *sample,  				   struct perf_evsel *evsel, @@ -90,6 +95,9 @@ static int process_sample_event(union perf_event *event,  		return -1;  	} +	if (cpu_list && !test_bit(sample->cpu, cpu_bitmap)) +		return 0; +  	if (!al.filtered &&  	    perf_evlist__add_sample(session->evlist, sample, evsel, &al)) {  		pr_warning("problem incrementing symbol count, " @@ -177,6 +185,12 @@ static int __cmd_annotate(void)  	if (session == NULL)  		return -ENOMEM; +	if (cpu_list) { +		ret = perf_session__cpu_bitmap(session, cpu_list, cpu_bitmap); +		if (ret) +			goto out_delete; +	} +  	ret = perf_session__process_events(session, &event_ops);  	if (ret)  		goto out_delete; @@ -252,6 +266,7 @@ static const struct option options[] = {  		    "print matching source lines (may be slow)"),  	OPT_BOOLEAN('P', "full-paths", &full_paths,  		    "Don't shorten the displayed pathnames"), +	OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"),  	OPT_END()  };  | 
