From patchwork Sun Jul 4 20:36:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 470039 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3400810jao; Sun, 4 Jul 2021 13:36:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhPMbH0bpwrxexbP+wmMrDIcTf0SH+OQ3t/AYPrEXQ0/XNBY2IuX/E2DPIqebRbG52n6qZ X-Received: by 2002:a17:906:2582:: with SMTP id m2mr10122724ejb.97.1625431001934; Sun, 04 Jul 2021 13:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625431001; cv=none; d=google.com; s=arc-20160816; b=qVKuIyIEVByOt8u33clC94dPQAv11kOu7c56yRnhFLUwvk4sku8pRrVwiGpQZ/mxxD DO/HKVN+ANroE3C3h1TMtEM1g1txdcD0ZKTRMUV4jbUTfs1BGwFEhThiHT6jNoc0bocU K5XaWwN6i+RLmJIeziCbJCo1oEixOWAqVva4RDq9Wx69fnmSsKBg6djL3nEFo3rLAtEl ajNXLKNiDlrifV93mMXYSRVrGjzREHRQjqRqLtOYZIBjQkHQM3xC14J0hT8fth8+JhA7 HXVWmsPeuQm5BtTYH3lyA0cvd3YRSY4YiQktEPAQPbh7AHyRLR2aL+HouPtd5i1oQ2D4 z52g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=A9Ko76ZMx8BVV+fx9hb93kPIzDQ4seYJiGBHhFarsFY=; b=p99bKLCbzhho8s7+QbRc6Sq5vxucNDSF3vOW/1eu/tln5bdrt0fgBUhpkRq49a64z4 yFiMdHQmTUBAF4C3ld8TP/TEKUNRSCLMzuYGHnyP+oPIcqvgoJ/qQNiiQGUo1tpXvGUM g5C3Myq+yBeMtq7aGne7rswCKw4C7J4AKMFlBECGT34kxagCSHW2rl7/JH0BbWtFiVyw YZHk63cWt6i+tYjyvTl2+NaG+PqO7Kof/OWap9qUvSGOyXh5ZVJpQ6nE5BLpnCRx1zBX rB9ooMwKoFV4vlvSpvM/ec62/YyLYnkRWn4puiH302QxBLNh63qDHmAHSUvtZ1toxOMq 8tPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-rt-users-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-rt-users-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=monom.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si3034453edq.421.2021.07.04.13.36.41; Sun, 04 Jul 2021 13:36:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-rt-users-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-rt-users-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-rt-users-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=monom.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230127AbhGDUjN (ORCPT + 3 others); Sun, 4 Jul 2021 16:39:13 -0400 Received: from mail.monom.org ([188.138.9.77]:39748 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229731AbhGDUjG (ORCPT ); Sun, 4 Jul 2021 16:39:06 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id D8445500665; Sun, 4 Jul 2021 22:36:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.monom.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (unknown [94.31.98.41]) by mail.monom.org (Postfix) with ESMTPSA id 80896500609; Sun, 4 Jul 2021 22:36:28 +0200 (CEST) From: Daniel Wagner To: Clark Williams , John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH rt-tests v1 1/3] rt-numa: Use sched_getaffinity() instead of pthread_getaffinity_np() Date: Sun, 4 Jul 2021 22:36:19 +0200 Message-Id: <20210704203621.5612-2-wagi@monom.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210704203621.5612-1-wagi@monom.org> References: <20210704203621.5612-1-wagi@monom.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Daniel Wagner pthread_getaffinity_np() prevents static builds as glibc does not expose it for this configuration. Instead use sched_getaffinity() which is always present and has the exact same semantics. Fixes: f240656b056b ("rt-tests: cyclictest: Fix -t without a user specified [NUM]") Signed-off-by: Daniel Wagner --- src/lib/rt-numa.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.32.0 diff --git a/src/lib/rt-numa.c b/src/lib/rt-numa.c index babcc634d57e..2d34ae36cc03 100644 --- a/src/lib/rt-numa.c +++ b/src/lib/rt-numa.c @@ -68,13 +68,11 @@ int cpu_for_thread_sp(int thread_num, int max_cpus, struct bitmask *cpumask) int cpu_for_thread_ua(int thread_num, int max_cpus) { int res, num_cpus, i, m, cpu; - pthread_t thread; cpu_set_t cpuset; - thread = pthread_self(); CPU_ZERO(&cpuset); - res = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset); + res = sched_getaffinity(0, sizeof(cpu_set_t), &cpuset); if (res != 0) fatal("pthread_getaffinity_np failed: %s\n", strerror(res)); From patchwork Sun Jul 4 20:36:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 470038 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3400803jao; Sun, 4 Jul 2021 13:36:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKICl76a0Wpp8/EffJy7fodBaVycRgoJ9PWElwFBKB4WmtyDix5eCuzTs/9vXqx+xRCxQ1 X-Received: by 2002:a05:6402:51d0:: with SMTP id r16mr12016796edd.378.1625431001545; Sun, 04 Jul 2021 13:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625431001; cv=none; d=google.com; s=arc-20160816; b=RpEBOapX4YAPa7R9MHP8/+C3eadoNRZ7CgSSjiy98ivC7+MV62/wAE79ihHVA+bjZv DIb5C8vZw6ztV5CHSLzutJ7P4CtkYhKowU7gxpi2m2QzC2iFMmFQZhiiSfxTFT21lypP HRgCF+u2hBdaNjrm+4BgoGZ3LfjY7wqh+f4GeVM2EQVCrFm3GOVeuaA4DopyHzp+yuo/ AdHtloSW71pi+BGJkskhnpYZf/eQiKjbpVGE2FPL7g5jI7Pj4jwWbZX9TmUd67bJAHuK RkJAMA3Gr7vnuhpVL38pEbezicsncMuMxz5UW/yw1zXXvYTKhRMw97Vp38UstO38RBcv Ip7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=huDWM7QImRcJI6ASaKGOksR2+25maE1CDDb7YuGZqTs=; b=OmUltIh73Rj7GzSg+bWzcEBrxTKETTz/bw/jwqjODUsGEsesGUBtaVAd993eAvuQbT C1ggDFkSvPZyG5RKMp5SQXZZELrlFRqKcVnCJVrmpvUqsGMRXp4HGGHY4WCW96uFualm 1zug+WS0AHcJy7oXPmaS/1mLfdnzQmXHWJ7Jc44FsZ27NqoLg6rJOOOFAmeMWP6DL/PC TJTL0oeh0XJP4ZvBpGoXVybvvtKPIZfLAIPOzttu+T86LrnZBuJkbUDmJuYyqRCzkVrw ouanZhUW3jZU1RZ1Ehv5KoeGSh5cfb77EmhOh73EM2Yakz02HBwtfUEPh5bkreXHZDZe bjrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-rt-users-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-rt-users-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=monom.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si3034453edq.421.2021.07.04.13.36.41; Sun, 04 Jul 2021 13:36:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-rt-users-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-rt-users-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-rt-users-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=monom.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbhGDUjN (ORCPT + 3 others); Sun, 4 Jul 2021 16:39:13 -0400 Received: from mail.monom.org ([188.138.9.77]:39760 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbhGDUjG (ORCPT ); Sun, 4 Jul 2021 16:39:06 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id 4DC415002BC; Sun, 4 Jul 2021 22:36:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.monom.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (unknown [94.31.98.41]) by mail.monom.org (Postfix) with ESMTPSA id 12C115005CA; Sun, 4 Jul 2021 22:36:29 +0200 (CEST) From: Daniel Wagner To: Clark Williams , John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH rt-tests v1 2/3] signaltest: Fix printf format specifier Date: Sun, 4 Jul 2021 22:36:20 +0200 Message-Id: <20210704203621.5612-3-wagi@monom.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210704203621.5612-1-wagi@monom.org> References: <20210704203621.5612-1-wagi@monom.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Daniel Wagner The fields are not uint64 just longs, update the printf format specifiers. Signed-off-by: Daniel Wagner --- src/signaltest/signaltest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.32.0 diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c index 6e8f6b51b003..4d89a1aba9d9 100644 --- a/src/signaltest/signaltest.c +++ b/src/signaltest/signaltest.c @@ -393,9 +393,9 @@ static void write_stats(FILE *f, void *data) for (i = 0; i < num_threads; i++) { fprintf(f, " \"%u\": {\n", i); s = &par->stats[i]; - fprintf(f, " \"cycles\": %" PRIu64 ",\n", s->cycles); - fprintf(f, " \"min\": %" PRIu64 ",\n", s->min); - fprintf(f, " \"max\": %" PRIu64 ",\n", s->max); + fprintf(f, " \"cycles\": %ld,\n", s->cycles); + fprintf(f, " \"min\": %ld,\n", s->min); + fprintf(f, " \"max\": %ld,\n", s->max); fprintf(f, " \"avg\": %.2f,\n", s->avg/s->cycles); fprintf(f, " \"cpu\": %d\n", par->cpu); fprintf(f, " }%s\n", i == num_threads - 1 ? "" : ","); From patchwork Sun Jul 4 20:36:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 470040 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3401425jao; Sun, 4 Jul 2021 13:38:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzB1BPNPbVTOTHm28dYB7Z3pJkQ6MKD2iqxOW2SOvVBLYVY1jgYqhK7Key2FZf/IL6qnaJQ X-Received: by 2002:a05:6402:204:: with SMTP id t4mr12172752edv.34.1625431092163; Sun, 04 Jul 2021 13:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625431092; cv=none; d=google.com; s=arc-20160816; b=sXYg80dsl7ZnnVPrtGfdlfDh/H0mrLTl5vhdvWEt5fVGrQv6mVGXfozW+tbBSSJxsX pCa6P4piDPhCKqZw56+OBNCelzP1hHW80qGopTLI6PwGqAhNG+8GC9xSzAS/PmsLY4bA B/S6j69yD19oYODFKlLrDfYRiF/Ks2abz1+SMYjsG79xwgPCfGISl/FjrCGSr4Tk0V74 oN/lO+pj7FkW19YcvzbPGTb1ljZU9kcXJhd8Wsh5EARt9H11q0gBlFZ9W1XXvAAVusMx 0x/6Gy1540sg/5tAbxyBsC8O5C1UyhpIrj+GuTmNWYRnkoGawudWeCt0hGe8pXw3pXaR ad7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Dkypp1P62JpH0H4PIwrFkH6DTmzWpRFtFhQ7x5sWfvA=; b=SsSftECveGfwhtV9vJqc3TGDPRdwL+eYQ9GXrCFDAkXGKXan/bLq/TMYltZKDMAFUP VODz9lDmZQyP792vCTWZj5aVSBi4AcjFmo+0ihaLAiQcg2hPOUiZ8smTEovN4BFdjZgK Q8TwcbZdy4VJYuRphLZOOIQzqJZlAgkFOe+gKR0vM4jRbVdq/V7ygQOr4tJz9t4F07B3 n4XQMZRiJA4bHY9Y9kLb5xZA1sZvQFEgI2qJ0k7EAxhDWq0X6WKBwfjT+xiHF3ZO8mc/ QqTP8i95N7qELyWguWBmCgakB3cYToyQcgfgFI1FjqPsfQc1gxx07awbdtHVlJzlZvaZ ekrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-rt-users-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-rt-users-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=monom.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si3034453edq.421.2021.07.04.13.38.12; Sun, 04 Jul 2021 13:38:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-rt-users-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-rt-users-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-rt-users-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=monom.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229731AbhGDUkr (ORCPT + 3 others); Sun, 4 Jul 2021 16:40:47 -0400 Received: from mail.monom.org ([188.138.9.77]:39764 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbhGDUjH (ORCPT ); Sun, 4 Jul 2021 16:39:07 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id C458B500609; Sun, 4 Jul 2021 22:36:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.monom.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (unknown [94.31.98.41]) by mail.monom.org (Postfix) with ESMTPSA id 7E0DA5006B4; Sun, 4 Jul 2021 22:36:29 +0200 (CEST) From: Daniel Wagner To: Clark Williams , John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH rt-tests v1 3/3] cyclicdeadline: Fix buffer allocation Date: Sun, 4 Jul 2021 22:36:21 +0200 Message-Id: <20210704203621.5612-4-wagi@monom.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210704203621.5612-1-wagi@monom.org> References: <20210704203621.5612-1-wagi@monom.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Daniel Wagner gcc complains with "‘sprintf’ output between 2 and 12 bytes" but the buffer is only 10 bytes long. Update the buffer size to hold the complete range of [-2147483648, 2147483646]. Signed-off-by: Daniel Wagner --- src/sched_deadline/cyclicdeadline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.32.0 diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c index ffefa9e6fecb..8447424273ee 100644 --- a/src/sched_deadline/cyclicdeadline.c +++ b/src/sched_deadline/cyclicdeadline.c @@ -1092,7 +1092,7 @@ int main(int argc, char **argv) /* Default cpu to use is the last one */ if (!all_cpus && !setcpu) { - setcpu_buf = malloc(10); + setcpu_buf = malloc(12); if (!setcpu_buf) fatal("malloc"); sprintf(setcpu_buf, "%d", cpu_count - 1);