diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-03-15 15:09:17 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-03-16 13:29:35 -0400 |
commit | cd82a32e9924d3a82bd27f830755d23e4ded25bc (patch) | |
tree | 63ff4fe274d372c22de3937bb867cfe37c7737d6 /tools/perf/Makefile | |
parent | 8f707d843c2f4023490a873dbc182f632a3a5906 (diff) |
perf tools: Add perf pmu object to access pmu format definition
Adding pmu object which provides interface to pmu's sysfs
event format definition located at:
${sysfs_mount}/bus/event_source/devices/${pmu}/format
Following interface is exported:
struct perf_pmu* perf_pmu__find(char *name);
- this function returns pmu object, which is then
passed as a handle to other interface functions
int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr,
struct list_head *head_terms);
- this function configures perf_event_attr struct based
on pmu's format definitions and config terms data,
containined in head_terms list.
Parser generator is used to retrive the pmu's format definition.
The generated parser is part of the patch. Added makefile rule
'pmu-parser' to generate the parser code out of the bison/flex
sources.
Added builtin test 'Test perf pmu format parsing', which could
be run like:
perf test pmu
Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-errz96u1668gj9wlop1zhpht@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/Makefile')
-rw-r--r-- | tools/perf/Makefile | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index dfc80289d7ff..e07fbd838749 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -276,6 +276,7 @@ LIB_H += util/build-id.h | |||
276 | LIB_H += util/debug.h | 276 | LIB_H += util/debug.h |
277 | LIB_H += util/debugfs.h | 277 | LIB_H += util/debugfs.h |
278 | LIB_H += util/sysfs.h | 278 | LIB_H += util/sysfs.h |
279 | LIB_H += util/pmu.h | ||
279 | LIB_H += util/event.h | 280 | LIB_H += util/event.h |
280 | LIB_H += util/evsel.h | 281 | LIB_H += util/evsel.h |
281 | LIB_H += util/evlist.h | 282 | LIB_H += util/evlist.h |
@@ -323,6 +324,7 @@ LIB_OBJS += $(OUTPUT)util/config.o | |||
323 | LIB_OBJS += $(OUTPUT)util/ctype.o | 324 | LIB_OBJS += $(OUTPUT)util/ctype.o |
324 | LIB_OBJS += $(OUTPUT)util/debugfs.o | 325 | LIB_OBJS += $(OUTPUT)util/debugfs.o |
325 | LIB_OBJS += $(OUTPUT)util/sysfs.o | 326 | LIB_OBJS += $(OUTPUT)util/sysfs.o |
327 | LIB_OBJS += $(OUTPUT)util/pmu.o | ||
326 | LIB_OBJS += $(OUTPUT)util/environment.o | 328 | LIB_OBJS += $(OUTPUT)util/environment.o |
327 | LIB_OBJS += $(OUTPUT)util/event.o | 329 | LIB_OBJS += $(OUTPUT)util/event.o |
328 | LIB_OBJS += $(OUTPUT)util/evlist.o | 330 | LIB_OBJS += $(OUTPUT)util/evlist.o |
@@ -361,6 +363,8 @@ LIB_OBJS += $(OUTPUT)util/thread_map.o | |||
361 | LIB_OBJS += $(OUTPUT)util/trace-event-parse.o | 363 | LIB_OBJS += $(OUTPUT)util/trace-event-parse.o |
362 | LIB_OBJS += $(OUTPUT)util/parse-events-flex.o | 364 | LIB_OBJS += $(OUTPUT)util/parse-events-flex.o |
363 | LIB_OBJS += $(OUTPUT)util/parse-events-bison.o | 365 | LIB_OBJS += $(OUTPUT)util/parse-events-bison.o |
366 | LIB_OBJS += $(OUTPUT)util/pmu-flex.o | ||
367 | LIB_OBJS += $(OUTPUT)util/pmu-bison.o | ||
364 | LIB_OBJS += $(OUTPUT)util/trace-event-read.o | 368 | LIB_OBJS += $(OUTPUT)util/trace-event-read.o |
365 | LIB_OBJS += $(OUTPUT)util/trace-event-info.o | 369 | LIB_OBJS += $(OUTPUT)util/trace-event-info.o |
366 | LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o | 370 | LIB_OBJS += $(OUTPUT)util/trace-event-scripting.o |
@@ -773,6 +777,9 @@ $(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS | |||
773 | $(OUTPUT)util/parse-events-flex.o: util/parse-events-flex.c $(OUTPUT)PERF-CFLAGS | 777 | $(OUTPUT)util/parse-events-flex.o: util/parse-events-flex.c $(OUTPUT)PERF-CFLAGS |
774 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $< | 778 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $< |
775 | 779 | ||
780 | $(OUTPUT)util/pmu-flex.o: util/pmu-flex.c $(OUTPUT)PERF-CFLAGS | ||
781 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $< | ||
782 | |||
776 | $(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS | 783 | $(OUTPUT)util/scripting-engines/trace-event-perl.o: util/scripting-engines/trace-event-perl.c $(OUTPUT)PERF-CFLAGS |
777 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $< | 784 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow $< |
778 | 785 | ||
@@ -810,6 +817,7 @@ help: | |||
810 | @echo ' info - make GNU info documentation (access with info <foo>)' | 817 | @echo ' info - make GNU info documentation (access with info <foo>)' |
811 | @echo ' pdf - make pdf documentation' | 818 | @echo ' pdf - make pdf documentation' |
812 | @echo ' event-parser - make event parser code' | 819 | @echo ' event-parser - make event parser code' |
820 | @echo ' pmu-parser - make pmu format parser code' | ||
813 | @echo ' TAGS - use etags to make tag information for source browsing' | 821 | @echo ' TAGS - use etags to make tag information for source browsing' |
814 | @echo ' tags - use ctags to make tag information for source browsing' | 822 | @echo ' tags - use ctags to make tag information for source browsing' |
815 | @echo ' cscope - use cscope to make interactive browsing database' | 823 | @echo ' cscope - use cscope to make interactive browsing database' |
@@ -863,6 +871,10 @@ event-parser: | |||
863 | $(QUIET_BISON)$(BISON) -v util/parse-events.y -d -o util/parse-events-bison.c | 871 | $(QUIET_BISON)$(BISON) -v util/parse-events.y -d -o util/parse-events-bison.c |
864 | $(QUIET_FLEX)$(FLEX) --header-file=util/parse-events-flex.h -t util/parse-events.l > util/parse-events-flex.c | 872 | $(QUIET_FLEX)$(FLEX) --header-file=util/parse-events-flex.h -t util/parse-events.l > util/parse-events-flex.c |
865 | 873 | ||
874 | pmu-parser: | ||
875 | $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o util/pmu-bison.c | ||
876 | $(QUIET_FLEX)$(FLEX) --header-file=util/pmu-flex.h -t util/pmu.l > util/pmu-flex.c | ||
877 | |||
866 | ### Detect prefix changes | 878 | ### Detect prefix changes |
867 | TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\ | 879 | TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\ |
868 | $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) | 880 | $(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ) |