From patchwork Sat Nov 4 19:11:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Prado X-Patchwork-Id: 834211 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=e-labworks-com.20150623.gappssmtp.com header.i=@e-labworks-com.20150623.gappssmtp.com header.b="bM17976h"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yTpNz4Vg4z9s7f for ; Sun, 5 Nov 2017 06:12:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7385530317; Sat, 4 Nov 2017 19:12:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4kGM4Ir9-P3d; Sat, 4 Nov 2017 19:12:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 461DD302CF; Sat, 4 Nov 2017 19:12:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id D900C1C1650 for ; Sat, 4 Nov 2017 19:12:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CE69988B6B for ; Sat, 4 Nov 2017 19:12:26 +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 URzsezb2Znux for ; Sat, 4 Nov 2017 19:12:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by fraxinus.osuosl.org (Postfix) with ESMTPS id E7A2988B6A for ; Sat, 4 Nov 2017 19:12:25 +0000 (UTC) Received: by mail-qk0-f194.google.com with SMTP id f199so6833643qke.2 for ; Sat, 04 Nov 2017 12:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=e-labworks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=1B6woX/G1d9Nu6k7yP4Z9+jhc5i2isQnH1zeFa/nxGg=; b=bM17976h9D+u4/RYbnTJ8vSNpj/vI2ICi3wmr/tinjh7fEKOEAoG+0VkNu7720JO4c Ai0bn1TJM6HNvDfo6cn0XNd6KatmbUNcQSH13sRQXPlCj/v8g4XM7ilyWuFy+jJ68RWP OsTCtfmRnUR3rVCcjI5CvRqbRuDayfNr8x0sr5Oq1Cp9ZwwRJ6vqdEI8rcFJoJHHyBF3 zd56tVZdlBfsTnZjmGLLaoDtWHCjX5Tt5g5ms6eqkaNpO0gYT/2r1pgTZjcMMdSRuoOy FV/oedgUTAzEmeJMlmwZGvpryMLeTWdt/43Y4Rxhaq5dHsODlFBi3LHhQeOF+kQ9fRr5 T/Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1B6woX/G1d9Nu6k7yP4Z9+jhc5i2isQnH1zeFa/nxGg=; b=BJByHsIxV0lVcNV6pJ9RMiHM9PABpmQZ5mgsLpiCvET00/XNIUpeXvbv5gjm7GDz6Q HatwUWGOBoVIUxI5tsRdkWJhXIzGLmtwh87hJwOkYlA15DkHQ8OD9wnHtv031T0v5h0i x9pITE6vbXAV2mLiWmFiiRH0XfwX6jYDwF86x9noL9E+FuxBTL0NUl6RR2AM98VRW75R CaV3MnFMabiP1+PEvPDVC3XRAmjLO9R06BgDogoPJ9+BbkohGB7wkcDiAaBGAOSIzFSp P8CJDHYdSJ3FX9zADYj+7rqBJYi+DaHx1YU7fGB/0jb2pqXMShy6btRMBpdbVKaOc+CE gH2A== X-Gm-Message-State: AJaThX4dr1qt0EvMBKfQb9Wc7j3y4/anHvnRIItGE3yhJhc9741LHEhJ zGWSznFVisjEVD8Y13GyYR83ANHh X-Google-Smtp-Source: ABhQp+RwHM0/d7mb0anJ+qt6xHQcvm8bErhMYkBJTjCOWuLjmeblCpYqzQqKTA6G5O80k9ExY96wkQ== X-Received: by 10.55.65.23 with SMTP id o23mr15750402qka.49.1509822744409; Sat, 04 Nov 2017 12:12:24 -0700 (PDT) Received: from localhost.localdomain ([189.100.34.201]) by smtp.gmail.com with ESMTPSA id m6sm5786714qkh.90.2017.11.04.12.12.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Nov 2017 12:12:23 -0700 (PDT) From: Sergio Prado To: buildroot@buildroot.org Date: Sat, 4 Nov 2017 17:11:54 -0200 Message-Id: <1509822714-17178-1-git-send-email-sergio.prado@e-labworks.com> X-Mailer: git-send-email 1.9.1 Subject: [Buildroot] [PATCH] schedtop: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sergio Prado MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Sergio Prado --- DEVELOPERS | 1 + package/Config.in | 1 + ...ix-build-with-Boost-Filesystem-library-V3.patch | 54 ++++++++++++++++++++++ package/schedtop/Config.in | 25 ++++++++++ package/schedtop/schedtop.mk | 30 ++++++++++++ 5 files changed, 111 insertions(+) create mode 100644 package/schedtop/0001-Fix-build-with-Boost-Filesystem-library-V3.patch create mode 100644 package/schedtop/Config.in create mode 100644 package/schedtop/schedtop.mk diff --git a/DEVELOPERS b/DEVELOPERS index f0f83b0f4291..8516a6c81e55 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1412,6 +1412,7 @@ F: package/xr819-xradio/ N: Sergio Prado F: package/libgdiplus/ F: package/mongodb/ +F: package/schedtop/ F: package/stella/ F: package/tunctl/ F: package/ubus/ diff --git a/package/Config.in b/package/Config.in index 55fe80139eaa..bda63c0804fb 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1936,6 +1936,7 @@ menu "System tools" source "package/s6-linux-utils/Config.in" source "package/s6-portable-utils/Config.in" source "package/s6-rc/Config.in" + source "package/schedtop/Config.in" source "package/scrub/Config.in" source "package/scrypt/Config.in" source "package/smack/Config.in" diff --git a/package/schedtop/0001-Fix-build-with-Boost-Filesystem-library-V3.patch b/package/schedtop/0001-Fix-build-with-Boost-Filesystem-library-V3.patch new file mode 100644 index 000000000000..d0dc278dfb70 --- /dev/null +++ b/package/schedtop/0001-Fix-build-with-Boost-Filesystem-library-V3.patch @@ -0,0 +1,54 @@ +From 845e74ffc0d280163b66d81df963b4c3738f9666 Mon Sep 17 00:00:00 2001 +From: Sergio Prado +Date: Sun, 29 Oct 2017 13:20:10 -0200 +Subject: [PATCH] Fix build with Boost Filesystem library V3 + +In version 3 of the boost filesystem library, string() is a member of +path(), not directory_entry. + +Signed-off-by: Sergio Prado +--- + schedtop.cc | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/schedtop.cc b/schedtop.cc +index 08aebae7170c..887b5e8b2f8f 100644 +--- a/schedtop.cc ++++ b/schedtop.cc +@@ -267,21 +267,21 @@ void ProcSnapshot(StatMap &smap) + fs::directory_iterator end; + for (fs::directory_iterator iter("/proc"); iter != end; ++iter) { + +- std::string path(iter->string() + "/schedstat"); ++ std::string path(iter->path().string() + "/schedstat"); + if (fs::exists(path)) { + std::ifstream is(path.c_str()); + + if (!is.is_open()) + throw std::runtime_error("could not open " + path); + +- Importer importer(smap, is, iter->string() + "/"); ++ Importer importer(smap, is, iter->path().string() + "/"); + + importer += "sched_info.cpu_time"; + importer += "sched_info.run_delay"; + importer += "sched_info.pcount"; + } + +- path = iter->string() + "/sched"; ++ path = iter->path().string() + "/sched"; + if (fs::exists(path)) { + std::ifstream is(path.c_str()); + +@@ -312,7 +312,7 @@ void ProcSnapshot(StatMap &smap) + lis >> tmp; + + Importer importer(smap, lis, +- iter->string() + "/"); ++ iter->path().string() + "/"); + + importer += type; + } +-- +1.9.1 + diff --git a/package/schedtop/Config.in b/package/schedtop/Config.in new file mode 100644 index 000000000000..2c13e50bb8e2 --- /dev/null +++ b/package/schedtop/Config.in @@ -0,0 +1,25 @@ +config BR2_PACKAGE_SCHEDTOP + bool "schedtop" + depends on BR2_INSTALL_LIBSTDCPP # boost + depends on BR2_TOOLCHAIN_HAS_THREADS # boost + depends on BR2_USE_WCHAR # boost + select BR2_PACKAGE_BOOST + select BR2_PACKAGE_BOOST_REGEX + select BR2_PACKAGE_BOOST_SYSTEM + select BR2_PACKAGE_BOOST_FILESYSTEM + select BR2_PACKAGE_BOOST_PROGRAM_OPTIONS + select BR2_PACKAGE_NCURSES + help + This utility will process statistics from /proc/schedstat + such that the busiest stats will bubble up to the top. It + can alternately be sorted by the largest stat, or by name. + Stats can be included or excluded based on reg-ex pattern + matching. + + You should enable CONFIG_SCHEDSTATS in your Linux kernel + configuration to use this utility. + + https://github.com/ghaskins/schedtop + +comment "schedtop needs a toolchain w/ C++, threads, wchar" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR diff --git a/package/schedtop/schedtop.mk b/package/schedtop/schedtop.mk new file mode 100644 index 000000000000..656e3716f26b --- /dev/null +++ b/package/schedtop/schedtop.mk @@ -0,0 +1,30 @@ +################################################################################ +# +# schedtop +# +################################################################################ + +SCHEDTOP_VERSION = 68dee649f96b3bf6db883de67f68ccc0b45cbc6e +SCHEDTOP_SITE = $(call github,ghaskins,schedtop,$(SCHEDTOP_VERSION)) +SCHEDTOP_LICENSE = GPL-2.0 +SCHEDTOP_LICENSE_FILES = COPYING + +SCHEDTOP_DEPENDENCIES = boost ncurses + +SCHEDTOP_MAKE_ENV = $(TARGET_MAKE_ENV) OBJDIR="$(@D)/obj" LIBRARIES="-lboost_system" + +# uses __atomic_fetch_add_4 +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +SCHEDTOP_MAKE_ENV += LIBRARIES+=" -latomic" +endif + +define SCHEDTOP_BUILD_CMDS + $(SCHEDTOP_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) +endef + +define SCHEDTOP_INSTALL_TARGET_CMDS + $(SCHEDTOP_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \ + PREFIX=$(TARGET_DIR) install +endef + +$(eval $(generic-package))