From cf088d5dbb077a1f689cfed907d48cbdbe487dc7 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 13 Jul 2010 20:26:11 +0200 Subject: fix oprofile package --- mk/modules.mk | 7 +++++ package/binutils/Makefile | 25 ++++++++-------- package/oprofile/Makefile | 18 +++++++----- .../patches/patch-daemon_liblegacy_opd_kernel_c | 34 ++++++++++++++++++++++ package/oprofile/patches/patch-doc_oprofile_1 | 26 +++++++++++++++++ target/linux/config/Config.in.debug | 12 ++++++++ 6 files changed, 102 insertions(+), 20 deletions(-) create mode 100644 package/oprofile/patches/patch-daemon_liblegacy_opd_kernel_c create mode 100644 package/oprofile/patches/patch-doc_oprofile_1 diff --git a/mk/modules.mk b/mk/modules.mk index 23f76df11..a4fbc734a 100644 --- a/mk/modules.mk +++ b/mk/modules.mk @@ -1530,3 +1530,10 @@ $(eval $(call KMOD_template,PARPORT,parport,\ $(eval $(call KMOD_template,PLIP,plip,\ $(MODULES_DIR)/kernel/drivers/net/plip \ ,51)) + +# +# Profiling +# +$(eval $(call KMOD_template,OPROFILE,oprofile,\ + $(MODULES_DIR)/kernel/arch/x86/oprofile/oprofile \ +,10)) diff --git a/package/binutils/Makefile b/package/binutils/Makefile index 8bcda8249..bedcef275 100644 --- a/package/binutils/Makefile +++ b/package/binutils/Makefile @@ -6,11 +6,18 @@ include ${TOPDIR}/toolchain/binutils/Makefile.inc PKG_DESCR:= binary utilities (nm, objdump, ar, as, ..) PKG_SECTION:= lang + +# subpackage +PKG_NAME_LIBBFD:= libbfd +PKG_DESCR_LIBBFD:= bfd library +PKG_SECTION_LIBBFD:= libs + PKG_HOST_DEPENDS:= !cygwin include ${TOPDIR}/mk/package.mk $(eval $(call PKG_template,BINUTILS,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) +$(eval $(call PKG_template,LIBBFD,${PKG_NAME_LIBBFD},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR_LIBBFD},${PKG_SECTION_LIBBFD})) TCFLAGS+= -fPIC CONFIGURE_ARGS+= --disable-werror \ @@ -18,18 +25,12 @@ CONFIGURE_ARGS+= --disable-werror \ --target=$(REAL_GNU_TARGET_NAME) post-install: - ${INSTALL_DIR} ${IDIR_BINUTILS}/usr/lib - $(CP) ${WRKINST}/usr/lib/*.so ${IDIR_BINUTILS}/usr/lib + ${INSTALL_DIR} ${IDIR_LIBBFD}/usr/lib + $(CP) ${WRKINST}/usr/lib/*.so ${IDIR_LIBBFD}/usr/lib ${INSTALL_DIR} ${IDIR_BINUTILS}/usr/bin - ${INSTALL_BIN} ${WRKINST}/usr/bin/nm ${IDIR_BINUTILS}/usr/bin/ - ${INSTALL_BIN} ${WRKINST}/usr/bin/size ${IDIR_BINUTILS}/usr/bin/ - ${INSTALL_BIN} ${WRKINST}/usr/bin/ar ${IDIR_BINUTILS}/usr/bin/ - ${INSTALL_BIN} ${WRKINST}/usr/bin/as ${IDIR_BINUTILS}/usr/bin/ - ${INSTALL_BIN} ${WRKINST}/usr/bin/ld ${IDIR_BINUTILS}/usr/bin/ - ${INSTALL_BIN} ${WRKINST}/usr/bin/strip ${IDIR_BINUTILS}/usr/bin/ - ${INSTALL_BIN} ${WRKINST}/usr/bin/objdump ${IDIR_BINUTILS}/usr/bin/ - ${INSTALL_BIN} ${WRKINST}/usr/bin/objcopy ${IDIR_BINUTILS}/usr/bin/ - ${INSTALL_BIN} ${WRKINST}/usr/bin/ranlib ${IDIR_BINUTILS}/usr/bin/ - ${INSTALL_BIN} ${WRKINST}/usr/bin/readelf ${IDIR_BINUTILS}/usr/bin/ + ${INSTALL_BIN} ${WRKINST}/usr/bin/{ar,as,ld,strip,size,nm} \ + ${IDIR_BINUTILS}/usr/bin/ + ${INSTALL_BIN} ${WRKINST}/usr/bin/{objcopy,ranlib,readelf,objdump} \ + ${IDIR_BINUTILS}/usr/bin/ include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/oprofile/Makefile b/package/oprofile/Makefile index c54ef06e1..c7373642e 100644 --- a/package/oprofile/Makefile +++ b/package/oprofile/Makefile @@ -4,27 +4,29 @@ include $(TOPDIR)/rules.mk PKG_NAME:= oprofile -PKG_VERSION:= 0.9.4 +PKG_VERSION:= 0.9.6 PKG_RELEASE:= 1 -PKG_MD5SUM:= 82b059379895cf125261d7d773465915 +PKG_MD5SUM:= 4e407093ac06200185d5a5e6437d7242 PKG_DESCR:= system-wide profiles PKG_SECTION:= debug -PKG_DEPENDS:= libpopt -PKG_BUILDDEP+= popt +PKG_DEPENDS:= libpopt kmod-oprofile libbfd libstdcxx +PKG_BUILDDEP+= popt binutils PKG_URL:= http://oprofile.sourceforge.net PKG_SITES:= ${MASTER_SITE_SOURCEFORGE:=oprofile/} +CFLINE_OPROFILE:= select BUSYBOX_EXPR + include $(TOPDIR)/mk/package.mk $(eval $(call PKG_template,OPROFILE,${PKG_NAME},$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) -TLDFLAGS+= -shared -TCFLAGS+= -fPIC -TCXXFLAGS+= -fPIC -CONFIGURE_ARGS+= --with-kernel-support --with-linux=${LINUX_DIR} +CONFIGURE_ARGS+= --with-kernel-support post-install: $(INSTALL_DIR) $(IDIR_OPROFILE)/usr/bin $(INSTALL_BIN) $(WRKINST)/usr/bin/opcontrol $(IDIR_OPROFILE)/usr/bin/ + $(INSTALL_BIN) $(WRKINST)/usr/bin/ophelp $(IDIR_OPROFILE)/usr/bin/ + $(INSTALL_BIN) $(WRKINST)/usr/bin/opreport $(IDIR_OPROFILE)/usr/bin/ + $(INSTALL_BIN) $(WRKINST)/usr/bin/oprofiled $(IDIR_OPROFILE)/usr/bin/ include ${TOPDIR}/mk/pkg-bottom.mk diff --git a/package/oprofile/patches/patch-daemon_liblegacy_opd_kernel_c b/package/oprofile/patches/patch-daemon_liblegacy_opd_kernel_c new file mode 100644 index 000000000..226522e40 --- /dev/null +++ b/package/oprofile/patches/patch-daemon_liblegacy_opd_kernel_c @@ -0,0 +1,34 @@ +--- oprofile-0.9.6.orig/daemon/liblegacy/opd_kernel.c 2009-11-24 16:25:17.000000000 +0100 ++++ oprofile-0.9.6/daemon/liblegacy/opd_kernel.c 2010-07-13 18:20:26.727084854 +0200 +@@ -148,6 +148,7 @@ void opd_clear_module_info(void) + */ + static void opd_get_module_info(void) + { ++#if 0 + char * line; + char * cp, * cp2, * cp3; + FILE * fp; +@@ -252,6 +253,7 @@ static void opd_get_module_info(void) + if (line) + free(line); + op_close_file(fp); ++#endif + } + + +@@ -270,6 +272,7 @@ static void opd_get_module_info(void) + */ + static void opd_drop_module_sample(unsigned long eip) + { ++#if 0 + char * module_names; + char * name; + size_t size = 1024; +@@ -307,6 +310,7 @@ static void opd_drop_module_sample(unsig + + if (module_names) + free(module_names); ++#endif + } + + diff --git a/package/oprofile/patches/patch-doc_oprofile_1 b/package/oprofile/patches/patch-doc_oprofile_1 new file mode 100644 index 000000000..2694725cd --- /dev/null +++ b/package/oprofile/patches/patch-doc_oprofile_1 @@ -0,0 +1,26 @@ +--- oprofile-0.9.6.orig/doc/oprofile.1 2009-11-24 16:26:33.000000000 +0100 ++++ oprofile-0.9.6/doc/oprofile.1 2010-07-13 17:55:07.343074887 +0200 +@@ -1,4 +1,4 @@ +-.TH OPROFILE 1 "Tue 24 November 2009" "oprofile 0.9.6" ++.TH OPROFILE 1 "Tue 13 July 2010" "oprofile 0.9.6" + .UC 4 + .SH NAME + oprofile \- a system-wide profiler +@@ -153,7 +153,7 @@ Configuration files + .I /root/.oprofile/daemonrc + Configuration file for opcontrol + .TP +-.I /usr/local/share/oprofile/ ++.I /usr/share/oprofile/ + Event description files used by OProfile. + .TP + .I /var/lib/oprofile/samples/oprofiled.log +@@ -173,7 +173,7 @@ The location of the generated sample fil + This man page is current for oprofile-0.9.6. + + .SH SEE ALSO +-.BR /usr/local/share/doc/oprofile/, ++.BR /usr/share/doc/oprofile/, + .BR opcontrol(1), + .BR opreport(1), + .BR opannotate(1), diff --git a/target/linux/config/Config.in.debug b/target/linux/config/Config.in.debug index 87fc57052..eedb9a97c 100644 --- a/target/linux/config/Config.in.debug +++ b/target/linux/config/Config.in.debug @@ -1,5 +1,9 @@ menu "Kernel debugging" +config ADK_KERNEL_PROFILING + boolean + default n + config ADK_KERNEL_DEBUG_KERNEL boolean default n @@ -51,4 +55,12 @@ config ADK_KERNEL_DEBUG_WITH_KGDB select ADK_KERNEL_KGDB_SERIAL_CONSOLE select ADK_KERNEL_FRAME_POINTER +config ADK_KPACKAGE_KMOD_OPROFILE + tristate + prompt "kernel support for oprofile" + select ADK_KERNEL_PROFILING + default n + help + use oprofile package to make use of the kernel support. + endmenu -- cgit v1.2.3