From: juhosg Date: Sun, 20 Oct 2013 15:58:09 +0000 (+0000) Subject: packages: add sysprof tool X-Git-Url: http://git.archive.openwrt.org/?p=packages.git;a=commitdiff_plain;h=8886dca03c432ba5ff920de22d39af1c1446cdcf packages: add sysprof tool Add sysprof - preformance profiler for Linux - to the development tools. Patches for mips/arm are from openembedded code. sysprof-cli get required events/stack frames. Next outfile can be loaded/displayed on PC using sysprof. Tool using: - PERF events - /proc/kallsyms for kernel symbols You should compile kernel with profiling enabled, debug information, symbol table information. Signed-off-by: Janusz Dziedzic Signed-off-by: Gabor Juhos git-svn-id: svn://svn.openwrt.org/openwrt/packages@38466 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/devel/sysprof/Makefile b/devel/sysprof/Makefile new file mode 100644 index 000000000..9242cf473 --- /dev/null +++ b/devel/sysprof/Makefile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2009-2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sysprof +PKG_VERSION:=1.2.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://sysprof.com +PKG_MD5SUM:=a81808d847732f8dafb59d26ec2eebbf + +PKG_BUILD_DEPENDS:= glib2 +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define Package/sysprof + SECTION:=devel + CATEGORY:=Development + TITLE:=Sysprof System Profiler + URL:=http://sysprof.com + DEPENDS:=+glib2 +endef + + +define Package/sysprof/description + Sysprof is a statistical, system-wide profiler for Linux +endef + +define Package/sysprof/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sysprof-cli $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,sysprof)) diff --git a/devel/sysprof/patches/define-NT_GNU_BUILD_ID.patch b/devel/sysprof/patches/define-NT_GNU_BUILD_ID.patch new file mode 100644 index 000000000..dcc2cbe67 --- /dev/null +++ b/devel/sysprof/patches/define-NT_GNU_BUILD_ID.patch @@ -0,0 +1,22 @@ +On uclibc elf.h does not have GNU extentions but we need this define +so we define it locally if its not getting it from elf.h + +Signed-off-by: Khem Raj + +Upstream-Status: Pending + +Index: git/elfparser.h +=================================================================== +--- git.orig/elfparser.h 2011-07-16 18:57:41.000000000 -0700 ++++ git/elfparser.h 2011-07-16 20:28:54.733829895 -0700 +@@ -17,6 +17,10 @@ + */ + #include + ++#ifndef NT_GNU_BUILD_ID ++#define NT_GNU_BUILD_ID 3 ++#endif ++ + typedef struct ElfSym ElfSym; + typedef struct ElfParser ElfParser; + diff --git a/devel/sysprof/patches/rmb-arm.patch b/devel/sysprof/patches/rmb-arm.patch new file mode 100644 index 000000000..a44034868 --- /dev/null +++ b/devel/sysprof/patches/rmb-arm.patch @@ -0,0 +1,21 @@ + +Upstream-Status: Pending + +Index: git/util.h +=================================================================== +--- git.orig/util.h 2010-12-07 22:41:57.156243001 -0600 ++++ git/util.h 2010-12-07 22:43:47.616243002 -0600 +@@ -37,4 +37,13 @@ + #define cpu_relax() asm volatile("" ::: "memory"); + #endif + ++#ifdef __arm__ ++/* ++ * Use the __kuser_memory_barrier helper in the CPU helper page. See ++ * arch/arm/kernel/entry-armv.S in the kernel source for details. ++ */ ++#define rmb() ((void(*)(void))0xffff0fa0)() ++#define cpu_relax() asm volatile("":::"memory") ++#endif ++ + #endif diff --git a/devel/sysprof/patches/rmb-mips.patch b/devel/sysprof/patches/rmb-mips.patch new file mode 100644 index 000000000..e055b8ad8 --- /dev/null +++ b/devel/sysprof/patches/rmb-mips.patch @@ -0,0 +1,22 @@ +Upstream-Status: Pending + +Index: git/util.h +=================================================================== +--- git.orig/util.h 2010-12-08 01:22:44.486243001 -0600 ++++ git/util.h 2010-12-08 01:23:27.836243001 -0600 +@@ -37,4 +37,15 @@ + #define cpu_relax() asm volatile("" ::: "memory"); + #endif + ++#ifdef __mips__ ++#define rmb() asm volatile( \ ++ ".set mips2\n\t" \ ++ "sync\n\t" \ ++ ".set mips0" \ ++ : /* no output */ \ ++ : /* no input */ \ ++ : "memory") ++#define cpu_relax() asm volatile("" ::: "memory") ++#endif ++ + #endif