From patchwork Thu May 19 22:07:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 1633584 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=nK4DLXvS; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L43rp4j9Tz9sFx for ; Fri, 20 May 2022 08:08:07 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 0429E42529; Thu, 19 May 2022 22:08:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0EjNyQoYgXlZ; Thu, 19 May 2022 22:08:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id B368B4251D; Thu, 19 May 2022 22:08:02 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 2413F1BF59C for ; Thu, 19 May 2022 22:08:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 1205D401D2 for ; Thu, 19 May 2022 22:08:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8FJE3Dq8EBXM for ; Thu, 19 May 2022 22:08:00 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3FA8F4012B for ; Thu, 19 May 2022 22:08:00 +0000 (UTC) Received: by mail-pg1-x532.google.com with SMTP id v10so6178790pgl.11 for ; Thu, 19 May 2022 15:08:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dB0uEOTAaTNFXd5gBFNl59IaJKISwT+f3avI6x15twc=; b=nK4DLXvSRbjB15Fl/fsl8tqG6emwKGo6UGBYaxvAc9Skl9QFsXqZeqkiK4p9GLvER/ Ru8w3KFl19olJ7xVwZ56s6dyAN1eWGH3iQ7yYoosI+ZHrnNvGSQpTd+WZytSBhmpCGce p0jUg/pHqkaWely0MZijOqNlJD9i16E5FUhP7ZdPp3znWt6/6XGL+nBpWNkRrUUjkFHC pdxlevTqfUcS5ms4QBIVzJk+VVGXxpEhCSA+3Ob/dgdiw3m6ElUATG60889X6czInMQA af5XBVlHMWvzlKXH0e72bvEwQTB5otHgFwx63DEDDTMZSHYLTcyz5XuMOvlZy6ElJRp7 0fEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dB0uEOTAaTNFXd5gBFNl59IaJKISwT+f3avI6x15twc=; b=S40QpsfOMj33PHVviBNm3b3zRkwhhaieK8CaFnhyYO+TLcG3GP5aAlVxj9BRFGVVM/ R+S0U18r2BN9ho/2viAI7jo9v9SPC+rNcwBNW/KlL4u3oGezV93AiepsKGzuMutB7XrY WcKlNEzFu+bXHNtgUkrWL2K968judnqWV7Ho7BsilypLopS71jObqTSXVv/o6UATR18y yRni++nyKsEoYlKRU97+4KG2jDnjJ1j6Rky2NtUM/o6fqWcNyiRFInwFvahQML7qexWd 805J38HUQgV1XYw0CMTGhnqInL5orAnFcZl/2RxZc0gKeklI6m1NSY7swQR9uvC2ZwSi jSLg== X-Gm-Message-State: AOAM532sZz9UAd2DLYW+QaHd+q1ZIX6S8om3bPSmqA8gKPskN6ZfWLfI 0ZeCox904VHxB0rIii+ynsd4pYGPS8k= X-Google-Smtp-Source: ABdhPJzBFd414bF+RlLZaUBUpbAvgNKes3oRvi9dGiY3QNm2S5XP5a0ygFkwt9OeeK79Qc/q7lPwSA== X-Received: by 2002:a63:5c02:0:b0:3f6:4b48:d5e7 with SMTP id q2-20020a635c02000000b003f64b48d5e7mr3259881pgb.229.1652998079053; Thu, 19 May 2022 15:07:59 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id u2-20020a1709026e0200b00161455d8029sm4290075plk.12.2022.05.19.15.07.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 15:07:58 -0700 (PDT) From: Florian Fainelli To: buildroot@buildroot.org Date: Thu, 19 May 2022 15:07:46 -0700 Message-Id: <20220519220747.455528-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] package/cpulimit: Backport a fix for an infrequent crash X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , mmayer@broadcom.com, thomas.petazzoni@bootlin.com, yann.morin.1998@free.fr Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Backport the fix submitted from this pull request: https://github.com/opsengine/cpulimit/pull/61 to fix an infrequent crash. Signed-off-by: Florian Fainelli --- .../0003-Fix-an-infrequent-crash.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 package/cpulimit/0003-Fix-an-infrequent-crash.patch diff --git a/package/cpulimit/0003-Fix-an-infrequent-crash.patch b/package/cpulimit/0003-Fix-an-infrequent-crash.patch new file mode 100644 index 000000000000..a19fb6e304d4 --- /dev/null +++ b/package/cpulimit/0003-Fix-an-infrequent-crash.patch @@ -0,0 +1,26 @@ +From 512998f967a9dab5e98010e1043985fc855d9f4e Mon Sep 17 00:00:00 2001 +From: Pavel Timofeev +Date: Thu, 14 Jul 2016 13:50:35 +0300 +Subject: [PATCH] Fix an infrequent crash + +Signed-off-by: Florian Fainelli +[Upstream: https://github.com/opsengine/cpulimit/pull/61] +--- + src/process_iterator_linux.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/process_iterator_linux.c b/src/process_iterator_linux.c +index c8cdd07adcbe..93b44bab1755 100644 +--- a/src/process_iterator_linux.c ++++ b/src/process_iterator_linux.c +@@ -98,6 +98,7 @@ static int read_process_info(pid_t pid, struct process *p) + //read command line + sprintf(exefile,"/proc/%d/cmdline", p->pid); + fd = fopen(exefile, "r"); ++ if (fd==NULL) return -1; + if (fgets(buffer, sizeof(buffer), fd)==NULL) { + fclose(fd); + return -1; +-- +2.25.1 + From patchwork Thu May 19 22:07:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 1633585 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=UfEcduOu; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L43s301Nfz9sFx for ; Fri, 20 May 2022 08:08:22 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 24EBA42525; Thu, 19 May 2022 22:08:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V8viNDiY7LEP; Thu, 19 May 2022 22:08:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id D350942541; Thu, 19 May 2022 22:08:16 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id D906A1BF59C for ; Thu, 19 May 2022 22:08:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D51A660AD5 for ; Thu, 19 May 2022 22:08:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KyWhgPTI7bC3 for ; Thu, 19 May 2022 22:08:01 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by smtp3.osuosl.org (Postfix) with ESMTPS id DAC2D60A79 for ; Thu, 19 May 2022 22:08:01 +0000 (UTC) Received: by mail-pf1-x429.google.com with SMTP id a11so6245533pff.1 for ; Thu, 19 May 2022 15:08:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sdylRcvjFL7zSwEX11P7GUh8W33RWVZS14l/4qX1SaA=; b=UfEcduOuScvmMAI9mkqS/71ZTS5WL1QUtQaqpyAts2GBSAVUONyKXcQPFWuuzmhB8h zXGt8Gm0uoINq3EpDpupVHoK4DYrggfrlA5CTqfjO4FCWC91xoM4CurS2KfMKW6GEV8n uR5iAvC/uOgV4ir/NcfwXU7vHpGDyRtJEm4STZAdeK0d1tAC0g+QWoZdXZIB8V5Ol3Jb K2nCSCeNABcKLYFhhxMZAOjG9WDguK4ghj296KQA4oF4qyyk8mP6iX418TmNXmJ0xSeh rnvMRUkpXp6nwQaXKo2QsHwwzpH9ZWXdUYjQNpoMuXPW3Ml+XfwZ+r64qskcswJjQ3OR VCgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sdylRcvjFL7zSwEX11P7GUh8W33RWVZS14l/4qX1SaA=; b=4XzQMvkHBsDhU+cq4ALg4As0zakW8fxsrRqDkBWmpqmlXuS1+yuWqmYjF7q016ncwm qlXfGV/eqQuc5tJYkenld617qfbr/8aEodWra+o2ygq8200UGj9tpKALH8Yw8vjTxaAF 0nmZBzNBuRtaltp6E6cndx0+p16YLuEOLCFWQ6qcmPsjEmTUkgqvUXu5RgHFZjc0EZHR gHQjU5czbEO4KLnnSl6JBJ/F7m1aNu+o8HJ9dM3garsEnxl9pgHATiZ+2pf5S795nbda 5DxRtySW+IsiVaFeLB7L9AE/WasU+Z4leSMpz7WhN6uNBvaQ7i5SnHaYrtz62HMmiqTL PxRQ== X-Gm-Message-State: AOAM530W863hP3gvJEkenJ2Q8rOpaAfewI03RGS+Q72IAhMgn2PlDCy/ v3yb0sddl6RiaEHlXxyIjEzTxRyecRQ= X-Google-Smtp-Source: ABdhPJyUT3okT3ob8NAr0b/18ITUxK9BwJ3ozcmmjPi4mf+E8F8kOsYaeA9HMPnf2sef5fhExGBLVQ== X-Received: by 2002:a63:1645:0:b0:3c2:4706:f62b with SMTP id 5-20020a631645000000b003c24706f62bmr5734807pgw.11.1652998080760; Thu, 19 May 2022 15:08:00 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id u2-20020a1709026e0200b00161455d8029sm4290075plk.12.2022.05.19.15.07.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 15:08:00 -0700 (PDT) From: Florian Fainelli To: buildroot@buildroot.org Date: Thu, 19 May 2022 15:07:47 -0700 Message-Id: <20220519220747.455528-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220519220747.455528-1-f.fainelli@gmail.com> References: <20220519220747.455528-1-f.fainelli@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] package/cpulimit: Remove or1k/musl limitation X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , mmayer@broadcom.com, thomas.petazzoni@bootlin.com, yann.morin.1998@free.fr Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" It turns out that we can build cpulimit for or1k using musl-libc if we remove the inclusion of the problematic procfs.h header file which is not required at all. This is a backport of the following upstream pull request: https://github.com/opsengine/cpulimit/pull/110 Signed-off-by: Florian Fainelli --- .../0004-Remove-procfs.h-inclusion.patch | 30 +++++++++++++++++++ package/cpulimit/Config.in | 5 ++-- 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 package/cpulimit/0004-Remove-procfs.h-inclusion.patch diff --git a/package/cpulimit/0004-Remove-procfs.h-inclusion.patch b/package/cpulimit/0004-Remove-procfs.h-inclusion.patch new file mode 100644 index 000000000000..771c2fe12c71 --- /dev/null +++ b/package/cpulimit/0004-Remove-procfs.h-inclusion.patch @@ -0,0 +1,30 @@ +From 48a88c033c5704d37645051ca51799a8b5a7e059 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 19 May 2022 14:22:40 -0700 +Subject: [PATCH] Remove procfs.h inclusion + +We do not use anything from this header + +Signed-off-by: Florian Fainelli +[Upstream: https://github.com/opsengine/cpulimit/pull/110] +--- + src/process_iterator.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/src/process_iterator.c b/src/process_iterator.c +index 8b4019d237f2..5b6c651bc5d0 100644 +--- a/src/process_iterator.c ++++ b/src/process_iterator.c +@@ -22,9 +22,6 @@ + #include + #include + #include +-#ifndef __APPLE__ +-#include +-#endif + #include + #include "process_iterator.h" + +-- +2.25.1 + diff --git a/package/cpulimit/Config.in b/package/cpulimit/Config.in index cca74afc9955..11a4f1da01e2 100644 --- a/package/cpulimit/Config.in +++ b/package/cpulimit/Config.in @@ -1,12 +1,11 @@ -comment "cpulimit needs a toolchain w/ threads, does not build open openrisc with musl" +comment "cpulimit needs a toolchain w/ threads" depends on BR2_USE_MMU - depends on !BR2_TOOLCHAIN_HAS_THREADS || (BR2_or1k && BR2_TOOLCHAIN_USES_MUSL) + depends on !BR2_TOOLCHAIN_HAS_THREADS config BR2_PACKAGE_CPULIMIT bool "cpulimit" depends on BR2_USE_MMU # fork() depends on BR2_TOOLCHAIN_HAS_THREADS - depends on !(BR2_or1k && BR2_TOOLCHAIN_USES_MUSL) help Cpulimit is a tool which limits the CPU usage of a process (expressed in percentage, not in CPU time)