diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
commit | 48ae5fc270ea3bbb965b4bd07cb1691a5c115642 (patch) | |
tree | 639ac5dd123a7fd28dfe4c86743b37c23b199b46 /libop | |
parent | cc2ee177dbb3befca43e36cfc56778b006c3d050 (diff) | |
download | oprofile-48ae5fc270ea3bbb965b4bd07cb1691a5c115642.tar.gz |
Initial Contributionandroid-1.0release-1.0
Diffstat (limited to 'libop')
-rw-r--r-- | libop/Android.mk | 18 | ||||
-rw-r--r-- | libop/Makefile.am | 23 | ||||
-rw-r--r-- | libop/Makefile.in | 570 | ||||
-rw-r--r-- | libop/op_config.h | 9 | ||||
-rw-r--r-- | libop/op_cpu_type.c | 5 | ||||
-rw-r--r-- | libop/op_get_interface.c | 5 | ||||
-rw-r--r-- | libop/tests/Makefile.am | 33 | ||||
-rw-r--r-- | libop/tests/Makefile.in | 554 | ||||
-rw-r--r-- | libop/tests/alloc_counter_tests.c | 207 | ||||
-rw-r--r-- | libop/tests/cpu_type_tests.c | 79 | ||||
-rw-r--r-- | libop/tests/load_events_files_tests.c | 31 | ||||
-rw-r--r-- | libop/tests/mangle_tests.c | 67 | ||||
-rw-r--r-- | libop/tests/parse_event_tests.c | 60 |
13 files changed, 33 insertions, 1628 deletions
diff --git a/libop/Android.mk b/libop/Android.mk new file mode 100644 index 0000000..99fd081 --- /dev/null +++ b/libop/Android.mk @@ -0,0 +1,18 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES:= \ + op_alloc_counter.c \ + op_cpu_type.c \ + op_events.c \ + op_get_interface.c \ + op_mangle.c \ + op_parse_event.c + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/.. \ + $(LOCAL_PATH)/../libutil + +LOCAL_MODULE := libop + +include $(BUILD_STATIC_LIBRARY) diff --git a/libop/Makefile.am b/libop/Makefile.am deleted file mode 100644 index 1caebb8..0000000 --- a/libop/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -SUBDIRS = . tests - -AM_CPPFLAGS=-I${top_srcdir}/libutil -AM_CFLAGS = @OP_CFLAGS@ - -noinst_LIBRARIES = libop.a -libop_a_SOURCES = \ - op_events.c \ - op_events.h \ - op_parse_event.c \ - op_parse_event.h \ - op_cpu_type.c \ - op_cpu_type.h \ - op_mangle.c \ - op_mangle.h \ - op_get_interface.c \ - op_interface.h \ - op_alloc_counter.c \ - op_alloc_counter.h \ - op_hw_config.h \ - op_config.h \ - op_config_24.h \ - op_sample_file.h diff --git a/libop/Makefile.in b/libop/Makefile.in deleted file mode 100644 index 07e2240..0000000 --- a/libop/Makefile.in +++ /dev/null @@ -1,570 +0,0 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -SOURCES = $(libop_a_SOURCES) - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -subdir = libop -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \ - $(top_srcdir)/m4/builtinexpect.m4 \ - $(top_srcdir)/m4/compileroption.m4 \ - $(top_srcdir)/m4/configmodule.m4 \ - $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \ - $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \ - $(top_srcdir)/m4/kerneloption.m4 \ - $(top_srcdir)/m4/kernelversion.m4 \ - $(top_srcdir)/m4/mallocattribute.m4 \ - $(top_srcdir)/m4/poptconst.m4 \ - $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \ - $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -AR = ar -ARFLAGS = cru -libop_a_AR = $(AR) $(ARFLAGS) -libop_a_LIBADD = -am_libop_a_OBJECTS = op_events.$(OBJEXT) op_parse_event.$(OBJEXT) \ - op_cpu_type.$(OBJEXT) op_mangle.$(OBJEXT) \ - op_get_interface.$(OBJEXT) op_alloc_counter.$(OBJEXT) -libop_a_OBJECTS = $(am_libop_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libop_a_SOURCES) -DIST_SOURCES = $(libop_a_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BFD_LIBS = @BFD_LIBS@ -CAT_ENTRY_END = @CAT_ENTRY_END@ -CAT_ENTRY_START = @CAT_ENTRY_START@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DATE = @DATE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_ROOT = @DOCBOOK_ROOT@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -KINC = @KINC@ -KSRC = @KSRC@ -KVERS = @KVERS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBERTY_LIBS = @LIBERTY_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MOC = @MOC@ -MODINSTALLDIR = @MODINSTALLDIR@ -OBJEXT = @OBJEXT@ -OPROFILE_DIR = @OPROFILE_DIR@ -OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@ -OP_CFLAGS = @OP_CFLAGS@ -OP_CXXFLAGS = @OP_CXXFLAGS@ -OP_DOCDIR = @OP_DOCDIR@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -POPT_LIBS = @POPT_LIBS@ -PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@ -QT_INCLUDES = @QT_INCLUDES@ -QT_LDFLAGS = @QT_LDFLAGS@ -QT_LIB = @QT_LIB@ -QT_VERSION = @QT_VERSION@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SIZE_T_TYPE = @SIZE_T_TYPE@ -STRIP = @STRIP@ -UIC = @UIC@ -VERSION = @VERSION@ -XML_CATALOG = @XML_CATALOG@ -XSLTPROC = @XSLTPROC@ -XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ -X_CFLAGS = @X_CFLAGS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_LIBS = @X_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -datadir = @datadir@ -enable_abi_FALSE = @enable_abi_FALSE@ -enable_abi_TRUE = @enable_abi_TRUE@ -exec_prefix = @exec_prefix@ -have_qt_FALSE = @have_qt_FALSE@ -have_qt_TRUE = @have_qt_TRUE@ -have_xsltproc_FALSE = @have_xsltproc_FALSE@ -have_xsltproc_TRUE = @have_xsltproc_TRUE@ -host_alias = @host_alias@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -kernel_support_FALSE = @kernel_support_FALSE@ -kernel_support_TRUE = @kernel_support_TRUE@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -topdir = @topdir@ -SUBDIRS = . tests -AM_CPPFLAGS = -I${top_srcdir}/libutil -AM_CFLAGS = @OP_CFLAGS@ -noinst_LIBRARIES = libop.a -libop_a_SOURCES = \ - op_events.c \ - op_events.h \ - op_parse_event.c \ - op_parse_event.h \ - op_cpu_type.c \ - op_cpu_type.h \ - op_mangle.c \ - op_mangle.h \ - op_get_interface.c \ - op_interface.h \ - op_alloc_counter.c \ - op_alloc_counter.h \ - op_hw_config.h \ - op_config.h \ - op_config_24.h \ - op_sample_file.h - -all: all-recursive - -.SUFFIXES: -.SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libop/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign libop/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libop.a: $(libop_a_OBJECTS) $(libop_a_DEPENDENCIES) - -rm -f libop.a - $(libop_a_AR) libop.a $(libop_a_OBJECTS) $(libop_a_LIBADD) - $(RANLIB) libop.a - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_alloc_counter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_cpu_type.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_events.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_get_interface.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_mangle.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_parse_event.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile $(LIBRARIES) -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am - -distclean: distclean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-noinstLIBRARIES clean-recursive \ - ctags ctags-recursive distclean distclean-compile \ - distclean-generic distclean-recursive distclean-tags distdir \ - dvi dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/libop/op_config.h b/libop/op_config.h index 6b4cfbc..5e16ede 100644 --- a/libop/op_config.h +++ b/libop/op_config.h @@ -15,7 +15,11 @@ #define OP_CONFIG_H /* various paths, duplicated in opcontrol */ -#define OP_BASE_DIR "/var/lib/oprofile/" + +#define OP_DRIVER_BASE "/dev.oprofile" +#define OP_BASE_DIR "/tmp/oprofile/" +//#define OP_BASE_DIR "/var/lib/oprofile/" + #define OP_SAMPLES_DIR OP_BASE_DIR "samples/" #define OP_SAMPLES_CURRENT_DIR OP_SAMPLES_DIR "current/" #define OP_LOCK_FILE OP_BASE_DIR "lock" @@ -24,7 +28,8 @@ /* Global directory that stores debug files */ #ifndef DEBUGDIR -#define DEBUGDIR "/usr/lib/debug" +//#define DEBUGDIR "/usr/lib/debug" +#define DEBUGDIR "/tmp/debug" #endif #define OPD_MAGIC "DAE\n" diff --git a/libop/op_cpu_type.c b/libop/op_cpu_type.c index a2574a0..d7ff4a7 100644 --- a/libop/op_cpu_type.c +++ b/libop/op_cpu_type.c @@ -9,11 +9,14 @@ * @author Philippe Elie */ +#include "config.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> #include "op_cpu_type.h" +#include "op_config.h" struct cpu_descr { char const * pretty; @@ -68,7 +71,7 @@ op_cpu op_get_cpu_type(void) fp = fopen("/proc/sys/dev/oprofile/cpu_type", "r"); if (!fp) { /* Try 2.6's oprofilefs one instead. */ - fp = fopen("/dev/oprofile/cpu_type", "r"); + fp = fopen(OP_DRIVER_BASE"/cpu_type", "r"); if (!fp) { fprintf(stderr, "Unable to open cpu_type file for reading\n"); fprintf(stderr, "Make sure you have done opcontrol --init\n"); diff --git a/libop/op_get_interface.c b/libop/op_get_interface.c index bdf72a5..b57a79f 100644 --- a/libop/op_get_interface.c +++ b/libop/op_get_interface.c @@ -8,12 +8,15 @@ * @author Will Cohen */ +#include "config.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> #include "op_cpu_type.h" #include "op_file.h" +#include "op_config.h" op_interface op_get_interface(void) { @@ -24,7 +27,7 @@ op_interface op_get_interface(void) if (op_file_readable("/proc/sys/dev/oprofile/cpu_type")) { current_interface = OP_INTERFACE_24; - } else if (op_file_readable("/dev/oprofile/cpu_type")) { + } else if (op_file_readable(OP_DRIVER_BASE"/cpu_type")) { current_interface = OP_INTERFACE_26; } diff --git a/libop/tests/Makefile.am b/libop/tests/Makefile.am deleted file mode 100644 index cf5e8fc..0000000 --- a/libop/tests/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -AM_CPPFLAGS = \ - -I ${top_srcdir}/libutil \ - -I ${top_srcdir}/libop - -AM_CFLAGS = @OP_CFLAGS@ -DOPROFILE_SRCDIR=\"@top_srcdir@\" - -COMMON_LIBS = ../libop.a ../../libutil/libutil.a - -LIBS = @LIBERTY_LIBS@ - -check_PROGRAMS = \ - cpu_type_tests \ - parse_event_tests \ - load_events_files_tests \ - alloc_counter_tests \ - mangle_tests - -cpu_type_tests_SOURCES = cpu_type_tests.c -cpu_type_tests_LDADD = ${COMMON_LIBS} - -parse_event_tests_SOURCES = parse_event_tests.c -parse_event_tests_LDADD = ${COMMON_LIBS} - -alloc_counter_tests_SOURCES = alloc_counter_tests.c -alloc_counter_tests_LDADD = ${COMMON_LIBS} - -load_events_files_tests_SOURCES = load_events_files_tests.c -load_events_files_tests_LDADD = ${COMMON_LIBS} - -mangle_tests_SOURCES = mangle_tests.c -mangle_tests_LDADD = ${COMMON_LIBS} - -TESTS = ${check_PROGRAMS} diff --git a/libop/tests/Makefile.in b/libop/tests/Makefile.in deleted file mode 100644 index 4992cec..0000000 --- a/libop/tests/Makefile.in +++ /dev/null @@ -1,554 +0,0 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -SOURCES = $(alloc_counter_tests_SOURCES) $(cpu_type_tests_SOURCES) $(load_events_files_tests_SOURCES) $(mangle_tests_SOURCES) $(parse_event_tests_SOURCES) - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -check_PROGRAMS = cpu_type_tests$(EXEEXT) parse_event_tests$(EXEEXT) \ - load_events_files_tests$(EXEEXT) alloc_counter_tests$(EXEEXT) \ - mangle_tests$(EXEEXT) -subdir = libop/tests -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \ - $(top_srcdir)/m4/builtinexpect.m4 \ - $(top_srcdir)/m4/compileroption.m4 \ - $(top_srcdir)/m4/configmodule.m4 \ - $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \ - $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \ - $(top_srcdir)/m4/kerneloption.m4 \ - $(top_srcdir)/m4/kernelversion.m4 \ - $(top_srcdir)/m4/mallocattribute.m4 \ - $(top_srcdir)/m4/poptconst.m4 \ - $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \ - $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -am_alloc_counter_tests_OBJECTS = alloc_counter_tests.$(OBJEXT) -alloc_counter_tests_OBJECTS = $(am_alloc_counter_tests_OBJECTS) -am__DEPENDENCIES_1 = ../libop.a ../../libutil/libutil.a -alloc_counter_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_cpu_type_tests_OBJECTS = cpu_type_tests.$(OBJEXT) -cpu_type_tests_OBJECTS = $(am_cpu_type_tests_OBJECTS) -cpu_type_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_load_events_files_tests_OBJECTS = \ - load_events_files_tests.$(OBJEXT) -load_events_files_tests_OBJECTS = \ - $(am_load_events_files_tests_OBJECTS) -load_events_files_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_mangle_tests_OBJECTS = mangle_tests.$(OBJEXT) -mangle_tests_OBJECTS = $(am_mangle_tests_OBJECTS) -mangle_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_parse_event_tests_OBJECTS = parse_event_tests.$(OBJEXT) -parse_event_tests_OBJECTS = $(am_parse_event_tests_OBJECTS) -parse_event_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(alloc_counter_tests_SOURCES) $(cpu_type_tests_SOURCES) \ - $(load_events_files_tests_SOURCES) $(mangle_tests_SOURCES) \ - $(parse_event_tests_SOURCES) -DIST_SOURCES = $(alloc_counter_tests_SOURCES) \ - $(cpu_type_tests_SOURCES) $(load_events_files_tests_SOURCES) \ - $(mangle_tests_SOURCES) $(parse_event_tests_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BFD_LIBS = @BFD_LIBS@ -CAT_ENTRY_END = @CAT_ENTRY_END@ -CAT_ENTRY_START = @CAT_ENTRY_START@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DATE = @DATE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_ROOT = @DOCBOOK_ROOT@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -KINC = @KINC@ -KSRC = @KSRC@ -KVERS = @KVERS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBERTY_LIBS = @LIBERTY_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBERTY_LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MOC = @MOC@ -MODINSTALLDIR = @MODINSTALLDIR@ -OBJEXT = @OBJEXT@ -OPROFILE_DIR = @OPROFILE_DIR@ -OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@ -OP_CFLAGS = @OP_CFLAGS@ -OP_CXXFLAGS = @OP_CXXFLAGS@ -OP_DOCDIR = @OP_DOCDIR@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -POPT_LIBS = @POPT_LIBS@ -PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@ -QT_INCLUDES = @QT_INCLUDES@ -QT_LDFLAGS = @QT_LDFLAGS@ -QT_LIB = @QT_LIB@ -QT_VERSION = @QT_VERSION@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SIZE_T_TYPE = @SIZE_T_TYPE@ -STRIP = @STRIP@ -UIC = @UIC@ -VERSION = @VERSION@ -XML_CATALOG = @XML_CATALOG@ -XSLTPROC = @XSLTPROC@ -XSLTPROC_FLAGS = @XSLTPROC_FLAGS@ -X_CFLAGS = @X_CFLAGS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_LIBS = @X_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -datadir = @datadir@ -enable_abi_FALSE = @enable_abi_FALSE@ -enable_abi_TRUE = @enable_abi_TRUE@ -exec_prefix = @exec_prefix@ -have_qt_FALSE = @have_qt_FALSE@ -have_qt_TRUE = @have_qt_TRUE@ -have_xsltproc_FALSE = @have_xsltproc_FALSE@ -have_xsltproc_TRUE = @have_xsltproc_TRUE@ -host_alias = @host_alias@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -kernel_support_FALSE = @kernel_support_FALSE@ -kernel_support_TRUE = @kernel_support_TRUE@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -topdir = @topdir@ -AM_CPPFLAGS = \ - -I ${top_srcdir}/libutil \ - -I ${top_srcdir}/libop - -AM_CFLAGS = @OP_CFLAGS@ -DOPROFILE_SRCDIR=\"@top_srcdir@\" -COMMON_LIBS = ../libop.a ../../libutil/libutil.a -cpu_type_tests_SOURCES = cpu_type_tests.c -cpu_type_tests_LDADD = ${COMMON_LIBS} -parse_event_tests_SOURCES = parse_event_tests.c -parse_event_tests_LDADD = ${COMMON_LIBS} -alloc_counter_tests_SOURCES = alloc_counter_tests.c -alloc_counter_tests_LDADD = ${COMMON_LIBS} -load_events_files_tests_SOURCES = load_events_files_tests.c -load_events_files_tests_LDADD = ${COMMON_LIBS} -mangle_tests_SOURCES = mangle_tests.c -mangle_tests_LDADD = ${COMMON_LIBS} -TESTS = ${check_PROGRAMS} -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libop/tests/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign libop/tests/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-checkPROGRAMS: - -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) -alloc_counter_tests$(EXEEXT): $(alloc_counter_tests_OBJECTS) $(alloc_counter_tests_DEPENDENCIES) - @rm -f alloc_counter_tests$(EXEEXT) - $(LINK) $(alloc_counter_tests_LDFLAGS) $(alloc_counter_tests_OBJECTS) $(alloc_counter_tests_LDADD) $(LIBS) -cpu_type_tests$(EXEEXT): $(cpu_type_tests_OBJECTS) $(cpu_type_tests_DEPENDENCIES) - @rm -f cpu_type_tests$(EXEEXT) - $(LINK) $(cpu_type_tests_LDFLAGS) $(cpu_type_tests_OBJECTS) $(cpu_type_tests_LDADD) $(LIBS) -load_events_files_tests$(EXEEXT): $(load_events_files_tests_OBJECTS) $(load_events_files_tests_DEPENDENCIES) - @rm -f load_events_files_tests$(EXEEXT) - $(LINK) $(load_events_files_tests_LDFLAGS) $(load_events_files_tests_OBJECTS) $(load_events_files_tests_LDADD) $(LIBS) -mangle_tests$(EXEEXT): $(mangle_tests_OBJECTS) $(mangle_tests_DEPENDENCIES) - @rm -f mangle_tests$(EXEEXT) - $(LINK) $(mangle_tests_LDFLAGS) $(mangle_tests_OBJECTS) $(mangle_tests_LDADD) $(LIBS) -parse_event_tests$(EXEEXT): $(parse_event_tests_OBJECTS) $(parse_event_tests_DEPENDENCIES) - @rm -f parse_event_tests$(EXEEXT) - $(LINK) $(parse_event_tests_LDFLAGS) $(parse_event_tests_OBJECTS) $(parse_event_tests_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc_counter_tests.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu_type_tests.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_events_files_tests.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mangle_tests.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_event_tests.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` -uninstall-info-am: - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -check-TESTS: $(TESTS) - @failed=0; all=0; xfail=0; xpass=0; skip=0; \ - srcdir=$(srcdir); export srcdir; \ - list='$(TESTS)'; \ - if test -n "$$list"; then \ - for tst in $$list; do \ - if test -f ./$$tst; then dir=./; \ - elif test -f $$tst; then dir=; \ - else dir="$(srcdir)/"; fi; \ - if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *" $$tst "*) \ - xpass=`expr $$xpass + 1`; \ - failed=`expr $$failed + 1`; \ - echo "XPASS: $$tst"; \ - ;; \ - *) \ - echo "PASS: $$tst"; \ - ;; \ - esac; \ - elif test $$? -ne 77; then \ - all=`expr $$all + 1`; \ - case " $(XFAIL_TESTS) " in \ - *" $$tst "*) \ - xfail=`expr $$xfail + 1`; \ - echo "XFAIL: $$tst"; \ - ;; \ - *) \ - failed=`expr $$failed + 1`; \ - echo "FAIL: $$tst"; \ - ;; \ - esac; \ - else \ - skip=`expr $$skip + 1`; \ - echo "SKIP: $$tst"; \ - fi; \ - done; \ - if test "$$failed" -eq 0; then \ - if test "$$xfail" -eq 0; then \ - banner="All $$all tests passed"; \ - else \ - banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ - fi; \ - else \ - if test "$$xpass" -eq 0; then \ - banner="$$failed of $$all tests failed"; \ - else \ - banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ - fi; \ - fi; \ - dashes="$$banner"; \ - skipped=""; \ - if test "$$skip" -ne 0; then \ - skipped="($$skip tests were not run)"; \ - test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$skipped"; \ - fi; \ - report=""; \ - if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ - report="Please report to $(PACKAGE_BUGREPORT)"; \ - test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ - dashes="$$report"; \ - fi; \ - dashes=`echo "$$dashes" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - test -z "$$skipped" || echo "$$skipped"; \ - test -z "$$report" || echo "$$report"; \ - echo "$$dashes"; \ - test "$$failed" -eq 0; \ - else :; fi - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) - $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-checkPROGRAMS clean-generic ctags distclean \ - distclean-compile distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/libop/tests/alloc_counter_tests.c b/libop/tests/alloc_counter_tests.c deleted file mode 100644 index 8a82974..0000000 --- a/libop/tests/alloc_counter_tests.c +++ /dev/null @@ -1,207 +0,0 @@ -/** - * @file alloc_counter_tests.c - * - * @remark Copyright 2003 OProfile authors - * @remark Read the file COPYING - * - * @author John Levon - * @author Philippe Elie - */ - -#include <stdlib.h> -#include <stdio.h> - -#include "op_parse_event.h" -#include "op_alloc_counter.h" -#include "op_events.h" -#include "op_hw_config.h" -#include "op_cpu_type.h" -#include "op_events.h" - -/* FIXME: alpha description events need 20 but when running test on x86 - * OP_MAX_COUNTERS is 8, so we can't use it */ -#define MAX_EVENTS 20 - - -/* some test are setup to fail in a known way */ -enum failure_type { - no_failure, - fail_to_find_event, - fail_to_alloc_counter -}; - -struct allocated_counter { - op_cpu cpu_type; - char const * const * events; - size_t alloc_map[MAX_EVENTS]; - /* expected failure for this test */ - enum failure_type failure; -}; - - -/* not more than MAX_EVENTS string for all these arrays */ -static char const * const events_alpha_ev4_1[] = { - "ISSUES:4096:0:1:1", - NULL -}; - -static char const * const events_alpha_ev4_2[] = { - "UNKNOWN_EVENT:4096:0:1:1", - NULL -}; - -static char const * const events_ppro_1[] = { - "CPU_CLK_UNHALTED:4096:0:1:1", - NULL -}; - -static char const * const events_ppro_2[] = { - "CPU_CLK_UNHALTED:4096:0:1:1", - "DATA_MEM_REFS:4096:0:1:1", - NULL -}; - -static char const * const events_ppro_3[] = { - /* fail_to_alloc_counter: 2 event to counter 0 */ - "COMP_FLOP_RET:4096:0:1:1", - "FLOPS:4096:0:1:1", - NULL -}; - -static char const * const events_ppro_4[] = { - "FLOPS:4096:0:1:1", - "FP_ASSIST:4096:0:1:1", - NULL -}; - -static char const * const events_ppro_5[] = { - "FP_ASSIST:4096:0:1:1", - "FLOPS:4096:0:1:1", - NULL -}; - -static char const * const events_p4_1[] = { - "BRANCH_RETIRED:4096:0:1:1", - "MISPRED_BRANCH_RETIRED:4096:0:1:1", - "BPU_FETCH_REQUEST:4096:0:1:1", - "ITLB_REFERENCE:4096:0:1:1", - "MEMORY_CANCEL:4096:0:1:1", - "MEMORY_COMPLETE:4096:0:1:1", - "TC_MS_XFER:4096:0:1:1", - "UOP_QUEUE_WRITES:4096:0:1:1", - NULL -}; - -static char const * const events_p4_2[] = { - /* fail_to_alloc_counter: 3 event to counter 3, 7 */ - "BRANCH_RETIRED:4096:0:1:1", - "MISPRED_BRANCH_RETIRED:4096:0:1:1", - "INSTR_RETIRED:4096:0:1:1", - "BPU_FETCH_REQUEST:4096:0:1:1", - "ITLB_REFERENCE:4096:0:1:1", - "MEMORY_CANCEL:4096:0:1:1", - "MEMORY_COMPLETE:4096:0:1:1", - "TC_MS_XFER:4096:0:1:1", - NULL -}; - -static struct allocated_counter const tests[] = { - { CPU_AXP_EV4, events_alpha_ev4_1, { 0 }, no_failure }, - { CPU_AXP_EV4, events_alpha_ev4_2, { -1 }, fail_to_find_event }, - { CPU_PPRO, events_ppro_1, { 0 }, no_failure }, - { CPU_PPRO, events_ppro_2, { 1, 0 }, no_failure }, - { CPU_PPRO, events_ppro_3, { 1, 0 }, fail_to_alloc_counter }, - { CPU_PPRO, events_ppro_4, { 0, 1 }, no_failure }, - { CPU_PPRO, events_ppro_5, { 1, 0 }, no_failure }, - { CPU_P4, events_p4_1, { 7, 3, 4, 0, 6, 2, 5, 1 }, no_failure }, - { CPU_P4, events_p4_2, { -1 }, fail_to_alloc_counter }, - { CPU_NO_GOOD, 0, { 0 }, 0 } -}; - - -static void show_events(char const * const * events) -{ - for ( ; *events; ++events) - printf("%s\n", *events); -} - - -static void show_counter_map(size_t const * counter_map, size_t nr_events) -{ - size_t i; - for (i = 0; i < nr_events; ++i) - printf("%lu ", (unsigned long)counter_map[i]); - printf("\n"); -} - - -static void do_test(struct allocated_counter const * it) -{ - size_t i; - size_t * counter_map; - size_t nr_events; - struct parsed_event parsed[MAX_EVENTS]; - struct op_event const * event[MAX_EVENTS]; - - op_events(it->cpu_type); - - nr_events = parse_events(parsed, MAX_EVENTS, it->events); - - for (i = 0; i < nr_events; ++i) { - event[i] = find_event_by_name(parsed[i].name); - if (!event[i]) { - if (it->failure == fail_to_find_event) - goto free_events; - printf("Can't find events %s for cpu %s\n", - parsed[i].name, - op_get_cpu_type_str(it->cpu_type)); - exit(EXIT_FAILURE); - } - } - - counter_map = map_event_to_counter(event, nr_events, it->cpu_type); - if (!counter_map) { - if (it->failure == fail_to_alloc_counter) - goto free_events; - printf("Can't map this set of events to counter:\n"); - show_events(it->events); - exit(EXIT_FAILURE); - } - - for (i = 0; i < nr_events; ++i) { - if (counter_map[i] != it->alloc_map[i]) { - printf("Incorrect allocation map for these events:\n"); - show_events(it->events); - printf("(expect, found):\n"); - show_counter_map(it->alloc_map, nr_events); - show_counter_map(counter_map, nr_events); - exit(EXIT_FAILURE); - } - } - - if (it->failure != no_failure) { - /* test should fail but success! */ - printf("test should fail with a failure type %d but succeed " - "for events:\n", it->failure); - for (i = 0; i < nr_events; ++i) - printf("%s\n", it->events[i]); - exit(EXIT_FAILURE); - } - - free(counter_map); -free_events: - op_free_events(); -} - - -int main(void) -{ - struct allocated_counter const * it; - - setenv("OPROFILE_EVENTS_DIR", OPROFILE_SRCDIR "/events", 1); - - for (it = tests; it->cpu_type != CPU_NO_GOOD; ++it) { - do_test(it); - } - return 0; -} diff --git a/libop/tests/cpu_type_tests.c b/libop/tests/cpu_type_tests.c deleted file mode 100644 index 2b0f6ba..0000000 --- a/libop/tests/cpu_type_tests.c +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @file cpu_type_tests.c - * - * @remark Copyright 2003 OProfile authors - * @remark Read the file COPYING - * - * @author John Levon - * @author Philippe Elie - */ - -#include <stddef.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "op_cpu_type.h" - -static struct cpu_type { - char const * name; - op_cpu type; -} cpu_str[] = { - { "i386/ppro", CPU_PPRO }, - { "i386/pii", CPU_PII }, - { "i386/piii", CPU_PIII }, - { "i386/athlon", CPU_ATHLON }, - { "timer", CPU_TIMER_INT }, - { "rtc", CPU_RTC }, - { "i386/p4", CPU_P4 }, - { "ia64/ia64", CPU_IA64 }, - { "ia64/itanium", CPU_IA64_1 }, - { "ia64/itanium2", CPU_IA64_2 }, - { "x86-64/hammer", CPU_HAMMER }, - { "i386/p4-ht", CPU_P4_HT2 }, - { "alpha/ev4", CPU_AXP_EV4 }, - { "alpha/ev5", CPU_AXP_EV5 }, - { "alpha/pca56", CPU_AXP_PCA56 }, - { "alpha/ev6", CPU_AXP_EV6 }, - { "alpha/ev67", CPU_AXP_EV67 }, - { "foo", CPU_NO_GOOD }, - { "-3", CPU_NO_GOOD }, - { "2927", CPU_NO_GOOD }, - { "", CPU_NO_GOOD }, - { NULL, CPU_NO_GOOD } -}; - - -static void test(struct cpu_type const * cpu) -{ - char const * name; - op_cpu type; - - name = op_get_cpu_name(cpu->type); - if (cpu->type != CPU_NO_GOOD && strcmp(cpu->name, name)) { - printf("for %d expect %s found %s\n", cpu->type, cpu->name, - name); - exit(EXIT_FAILURE); - } - if (cpu->type == CPU_NO_GOOD && strcmp("invalid cpu type", name)) { - printf("for %d expect %s found %s\n", cpu->type, - "invalid cpu type", name); - exit(EXIT_FAILURE); - } - - type = op_get_cpu_number(cpu->name); - if (type != cpu->type) { - printf("for %s expect %d found %d\n", cpu->name, cpu->type, - type); - exit(EXIT_FAILURE); - } -} - - -int main(void) -{ - struct cpu_type * cpu; - for (cpu = cpu_str; cpu->name; ++cpu) - test(cpu); - return 0; -} diff --git a/libop/tests/load_events_files_tests.c b/libop/tests/load_events_files_tests.c deleted file mode 100644 index de548e5..0000000 --- a/libop/tests/load_events_files_tests.c +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @file load_events_files_tests.c - * - * @remark Copyright 2003 OProfile authors - * @remark Read the file COPYING - * - * @author John Levon - * @author Philippe Elie - */ - -#include <stdlib.h> -#include <stdio.h> - -#include "op_events.h" -#include "op_cpu_type.h" - -int main(void) -{ - op_cpu cpu_type; - - setenv("OPROFILE_EVENTS_DIR", OPROFILE_SRCDIR "/events", 1); - - for (cpu_type = CPU_NO_GOOD + 1; cpu_type < MAX_CPU_TYPE; ++cpu_type) { - if (cpu_type != CPU_TIMER_INT) { - op_events(cpu_type); - op_free_events(); - } - } - - return 0; -} diff --git a/libop/tests/mangle_tests.c b/libop/tests/mangle_tests.c deleted file mode 100644 index 30607bf..0000000 --- a/libop/tests/mangle_tests.c +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @file mangle_tests.c - * - * @remark Copyright 2003 OProfile authors - * @remark Read the file COPYING - * - * @author John Levon - * @author Philippe Elie - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "op_libiberty.h" -#include "op_mangle.h" -#include "op_config.h" - -struct test_input { - struct mangle_values values; - char const * result; -}; - -static struct test_input const tests[] = { - { { MANGLE_NONE, "foo", "bar", NULL, "EVENT", 0, 0, 0, 0, 0 }, - "{root}/bar/{dep}/{root}/foo/EVENT.0.0.all.all.all" }, - { { MANGLE_CPU, "foo", "bar", NULL, "EVENT", 0, 0, 0, 0, 2 }, - "{root}/bar/{dep}/{root}/foo/EVENT.0.0.all.all.2" }, - { { MANGLE_TID, "foo", "bar", NULL, "EVENT", 0, 0, 0, 33, 0 }, - "{root}/bar/{dep}/{root}/foo/EVENT.0.0.all.33.all" }, - { { MANGLE_TGID, "foo", "bar", NULL, "EVENT", 0, 0, 34, 0, 0 }, - "{root}/bar/{dep}/{root}/foo/EVENT.0.0.34.all.all" }, - { { MANGLE_KERNEL, "foo", "bar", NULL, "EVENT", 0, 0, 0, 0, 0 }, - "{kern}/bar/{dep}/{kern}/foo/EVENT.0.0.all.all.all" }, - { { MANGLE_CALLGRAPH, "foo-from", "bar-from", "foo-to", "EVENT", 0, 0, 0, 0, 0 }, - "{root}/bar-from/{dep}/{root}/foo-from/{cg}/{root}/foo-to/EVENT.0.0.all.all.all" }, - { { MANGLE_CPU|MANGLE_TID|MANGLE_TID|MANGLE_TGID|MANGLE_KERNEL, "foo", "bar", NULL, "EVENT", 1234, 8192, 34, 35, 2 }, - "{kern}/bar/{dep}/{kern}/foo/EVENT.1234.8192.34.35.2" }, - { { MANGLE_CPU|MANGLE_TID|MANGLE_TID|MANGLE_TGID|MANGLE_KERNEL, "foo1/foo2", "bar1/bar2", NULL, "EVENT", 1234, 8192, 34, 35, 2 }, - "{root}/bar1/bar2/{dep}/{root}/foo1/foo2/EVENT.1234.8192.34.35.2" }, - { { MANGLE_CALLGRAPH|MANGLE_CPU|MANGLE_TID|MANGLE_TID|MANGLE_TGID|MANGLE_KERNEL, "bar1/bar2", "bar1/bar2", "bar1/bar2-to", "EVENT", 1234, 8192, 34, 35, 2 }, - "{root}/bar1/bar2/{dep}/{root}/bar1/bar2/{cg}/{root}/bar1/bar2-to/EVENT.1234.8192.34.35.2" }, - - { { 0, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0 }, NULL } -}; - - -int main(void) -{ - struct test_input const * test; - for (test = tests; test->result; ++test) { - char * result = op_mangle_filename(&test->values); - char * expect = xmalloc(strlen(test->result) + - strlen(OP_SAMPLES_CURRENT_DIR) + 1); - strcpy(expect, OP_SAMPLES_CURRENT_DIR); - strcat(expect, test->result); - if (strcmp(result, expect)) { - fprintf(stderr, "test %d:\nfound: %s\nexpect: %s\n", - (int)(test - tests), result, expect); - exit(EXIT_FAILURE); - } - free(expect); - free(result); - } - - return EXIT_SUCCESS; -} diff --git a/libop/tests/parse_event_tests.c b/libop/tests/parse_event_tests.c deleted file mode 100644 index b1c3394..0000000 --- a/libop/tests/parse_event_tests.c +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file parse_event_tests.c - * - * @remark Copyright 2003 OProfile authors - * @remark Read the file COPYING - * - * @author John Levon - * @author Philippe Elie - */ - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> - -#include "op_parse_event.h" - -struct events_test { - /* second pointer is the null terminating array marker */ - char const * const tests[2]; - struct parsed_event expected; -}; - -static struct events_test const events[] = -{ - { { "FOO:3000:0:0:0", 0 }, { "FOO", 3000, 0, 0, 0 } }, - { { "BAR:3000", 0 }, { "BAR", 3000, 0, 1, 1 } }, - { { "FOOBAR:3000:1:1:1", 0 }, { "FOOBAR", 3000, 1, 1, 1 } }, - { { NULL, NULL }, { 0, 0, 0, 0, 0 } } -}; - -static void do_test(struct events_test const * ev) -{ - struct parsed_event parsed; - - parse_events(&parsed, 1, ev->tests); - - if (strcmp(ev->expected.name, parsed.name) || - ev->expected.count != parsed.count || - ev->expected.unit_mask != parsed.unit_mask || - ev->expected.kernel != parsed.kernel || - ev->expected.user != parsed.user) { - printf("for %s expect { %s, %d, %d, %d, %d } found " - "{ %s, %d, %d, %d, %d }\n", - ev->tests[0], ev->expected.name, ev->expected.count, - ev->expected.unit_mask, ev->expected.kernel, - ev->expected.user, parsed.name, parsed.count, - parsed.unit_mask, parsed.kernel, parsed.user); - exit(EXIT_FAILURE); - } -} - -int main(void) -{ - struct events_test const * ev; - for (ev = events; ev->tests[0]; ++ev) { - do_test(ev); - } - - return 0; -} |