From patchwork Wed Apr 4 10:24:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qais Yousef X-Patchwork-Id: 150705 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id C5480B7008 for ; Wed, 4 Apr 2012 20:24:59 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CEC14102ACA; Wed, 4 Apr 2012 10:24:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gJWLS89dnR1U; Wed, 4 Apr 2012 10:24:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 37F02101C6E; Wed, 4 Apr 2012 10:24:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 9A6248F753 for ; Wed, 4 Apr 2012 10:24:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 94A45A0164 for ; Wed, 4 Apr 2012 10:24:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fwLd77NNPt6L for ; Wed, 4 Apr 2012 10:24:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from multi.imgtec.com (multi.imgtec.com [194.200.65.239]) by hemlock.osuosl.org (Postfix) with ESMTPS id 002A5A0086 for ; Wed, 4 Apr 2012 10:24:49 +0000 (UTC) From: Qais Yousef To: Date: Wed, 4 Apr 2012 11:24:45 +0100 Message-ID: <1333535085-10290-1-git-send-email-qais.yousef@imgtec.com> X-Mailer: git-send-email 1.7.1 X-OriginalArrivalTime: 04 Apr 2012 10:24:46.0495 (UTC) FILETIME=[288132F0:01CD124D] MIME-Version: 1.0 X-SEF-Processed: 7_3_0_01181__2012_04_04_11_24_46 Subject: [Buildroot] [PATCH] New Package: latencytop X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Signed-off-by: Qais Yousef --- package/Config.in | 1 + package/latencytop/Config.in | 15 ++++++++ package/latencytop/latencytop-makefile.patch | 46 ++++++++++++++++++++++++++ package/latencytop/latencytop.mk | 22 ++++++++++++ 4 files changed, 84 insertions(+), 0 deletions(-) create mode 100644 package/latencytop/Config.in create mode 100644 package/latencytop/latencytop-makefile.patch create mode 100644 package/latencytop/latencytop.mk diff --git a/package/Config.in b/package/Config.in index e1629c8..24e43f6 100644 --- a/package/Config.in +++ b/package/Config.in @@ -37,6 +37,7 @@ source "package/strace/Config.in" source "package/whetstone/Config.in" source "package/valgrind/Config.in" source "package/pv/Config.in" +source "package/latencytop/Config.in" endmenu menu "Development tools" diff --git a/package/latencytop/Config.in b/package/latencytop/Config.in new file mode 100644 index 0000000..1c120c6 --- /dev/null +++ b/package/latencytop/Config.in @@ -0,0 +1,15 @@ +config BR2_PACKAGE_LATENCYTOP + bool "latencytop" + help + There are many types and causes of latency. LatencyTOP + focuses on the type of latency that causes skips in audio, + stutters in your desktop experience or that overloads your + server (while you have plenty of CPU power left). + + LatencyTOP focuses on the cases where the applications want + to run and execute useful code, but there's some resource + that's not currently available (and the kernel then blocks + the process). This is done both on a system level and on a + per process level, so that you can see what's happening to + the system, and which process is suffering and/or causing + the delays. diff --git a/package/latencytop/latencytop-makefile.patch b/package/latencytop/latencytop-makefile.patch new file mode 100644 index 0000000..25be244 --- /dev/null +++ b/package/latencytop/latencytop-makefile.patch @@ -0,0 +1,46 @@ +pkg-config and gcc are always used, which prevents cross compiling. +Use env variables to override the default behaviour. + +Signed-off-by: Qais Yousef + +--- latencytop-0.5/Makefile.old 2012-04-03 14:42:09.135328435 +0100 ++++ latencytop-0.5/Makefile 2012-04-03 15:05:47.878234542 +0100 +@@ -1,16 +1,17 @@ + # FIXME: Use autoconf ? +-HAS_GTK_GUI = 1 ++HAS_GTK_GUI ?= 1 + +-DESTDIR = +-SBINDIR = /usr/sbin +-XCFLAGS = -W -g `pkg-config --cflags glib-2.0` -D_FORTIFY_SOURCE=2 -Wno-sign-compare +-LDF = -Wl,--as-needed `pkg-config --libs glib-2.0` -lncursesw ++DESTDIR ?= ++SBINDIR ?= /usr/sbin ++PKG_CONFIG ?= pkg-config ++XCFLAGS += -W -g `$(PKG_CONFIG) --cflags glib-2.0` -D_FORTIFY_SOURCE=2 -Wno-sign-compare ++LDFLAGS += -Wl,--as-needed `$(PKG_CONFIG) --libs glib-2.0` -lncurses + + OBJS= latencytop.o text_display.o translate.o fsync.o + +-ifdef HAS_GTK_GUI +- XCFLAGS += `pkg-config --cflags gtk+-2.0` -DHAS_GTK_GUI +- LDF += `pkg-config --libs gtk+-2.0` ++ifeq (HAS_GTK_GUI, 1) ++ XCFLAGS += `$(PKG_CONFIG) --cflags gtk+-2.0` -DHAS_GTK_GUI ++ LDFLAGS += `$(PKG_CONFIG) --libs gtk+-2.0` + OBJS += gtk_display.o + endif + +@@ -26,10 +27,10 @@ + + # We write explicity this "implicit rule" + %.o : %.c +- gcc -c $(CFLAGS) $(XCFLAGS) $< -o $@ ++ $(CC) -c $(CFLAGS) $(XCFLAGS) $< -o $@ + + latencytop: $(OBJS) latencytop.h Makefile +- gcc $(CFLAGS) $(OBJS) $(LDF) -o latencytop ++ $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o latencytop + + clean: + rm -f *~ latencytop DEADJOE *.o diff --git a/package/latencytop/latencytop.mk b/package/latencytop/latencytop.mk new file mode 100644 index 0000000..c33eee9 --- /dev/null +++ b/package/latencytop/latencytop.mk @@ -0,0 +1,22 @@ +############################################################# +# +# latencytop +# +############################################################# + +LATENCYTOP_VERSION = 0.5 +LATENCYTOP_SITE = http://www.latencytop.org/download/ +LATENCYTOP_DEPENDENCIES = libglib2 ncurses + +# NOTE: GTK is heavy weight, we intentionally build the text (ncurses) +# version only +define LATENCYTOP_BUILD_CMDS + $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" \ + PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" HAS_GTK_GUI=0 -C $(@D) +endef + +define LATENCYTOP_INSTALL_TARGET_CMDS + $(MAKE) install -C $(@D) DESTDIR=$(TARGET_DIR) +endef + +$(eval $(call GENTARGETS))