From patchwork Thu Oct 29 17:40:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 315279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B76BC4363A for ; Thu, 29 Oct 2020 17:41:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D8E082076D for ; Thu, 29 Oct 2020 17:41:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pWfgL2/W" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726295AbgJ2RlO (ORCPT ); Thu, 29 Oct 2020 13:41:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725777AbgJ2RlO (ORCPT ); Thu, 29 Oct 2020 13:41:14 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E45DC0613D2 for ; Thu, 29 Oct 2020 10:41:14 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id r7so2678970qkf.3 for ; Thu, 29 Oct 2020 10:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=leRIDG02papUstmLrtBLIquBNWjJYmKb/wG67ywkCYw=; b=pWfgL2/W86Lo+VOzxtTgyd5/Od1W759F7mY7xH1sHiTCcccW/Bujlx7lIhjKDn8Xbh QC46Nwb0s09vcUL6qSgur0HJYLQg10Ot7XSZ5NhA4oQPjqNIn9vYFZdGbTuIc4pX5nAJ sOFLdTClnNMbR66bBAjhK67RS/I6BNExBVssAXvGzQwxuieE0iQJ6LIKauPZbrOMkUo6 vMnkqv6rzGhXLRi1i/xt/6T9xSHWo52/PRJ5YNq/IlMAQ6MCDvIpqOvPoEmB6sK8S8ll 2JylrQaa9i1JQkA2FY7PDnF1bspXD8k+U7aVAoEg3B8+/3WGbVzDw0WJIkBClAcR8H78 x/EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=leRIDG02papUstmLrtBLIquBNWjJYmKb/wG67ywkCYw=; b=EvePvL4YYXQTkrTxV0rvwtzK/9h4SNSxZxJdYI22d9wTA6weI5/hLLcrmuCHrEMjd6 gDBVK+aqgOkeXwbyvrHKJMyO+u2DB+y7aaZt4M9SqZF0g5/BpWHGJZs2l6HMWBhpd4Jz QB9qKlhX+3CEgAs5rsoMcDnC/JMzbgA4VXlQB9B+O/XEu9ay3mr/A6lNVx0jwV5QNpDA 18euOOqVZCs00wF8odzDCLA8bsOpn5pAnhhzdC9WhDs9g6XrHeDSK2qNdqv8GEjSQvSU ihUeindE8U0v4fY2fJCPtmgxGJ9Ccw0MEknpnpAGmjeY7Z+LzfE5Jq6x3sctqGf55BYm NUKQ== X-Gm-Message-State: AOAM5303n67PS6Qs6iDEKlvBymIBu/0i5+diCirLntecwH07ixzSFKy1 +l/efdmW3k6hYzYJH5c72fvFDWhiif+GAw== X-Google-Smtp-Source: ABdhPJyA/pnlxe1y7jn/ku2klMCcgbFN3ESE0TLkMFq0uzRsSADEBKbm2GR2fNx2t7PXGhScGWUlJQ== X-Received: by 2002:a37:aa49:: with SMTP id t70mr4749068qke.165.1603993273001; Thu, 29 Oct 2020 10:41:13 -0700 (PDT) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-10-174-88-120-216.dsl.bell.ca. [174.88.120.216]) by smtp.gmail.com with ESMTPSA id z13sm1472460qkl.2.2020.10.29.10.41.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 10:41:12 -0700 (PDT) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 01/16] rt-tests: remove pi_tests.spec Date: Thu, 29 Oct 2020 13:40:42 -0400 Message-Id: <20201029174057.20033-2-jkacur@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201029174057.20033-1-jkacur@redhat.com> References: <20201029174057.20033-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org This is an ancient spec file from way back before this program was included in the rt-tests suite. There is no need to keep it around anymore. Signed-off-by: John Kacur --- src/pi_tests/pi_tests.spec | 81 -------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 src/pi_tests/pi_tests.spec diff --git a/src/pi_tests/pi_tests.spec b/src/pi_tests/pi_tests.spec deleted file mode 100644 index 7526faaadff1..000000000000 --- a/src/pi_tests/pi_tests.spec +++ /dev/null @@ -1,81 +0,0 @@ -Summary: Programs used to test Priority Inheritance Mutexes -Name: pi_tests -Version: 1.17 -Release: 1%{?dist} -License: GPL -Group: Development/Tools -URL: http://people.redhat.com/~williams/tests -Source0: %{name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root - -%define mandir usr/share/man - -%description -The pi_tests package contains programs used to test the functionality of -the priority inheritance attribute of POSIX mutexes on the Linux kernel - -%prep -%setup -q - -%build -make all - -%install -rm -rf $RPM_BUILD_ROOT -mkdir $RPM_BUILD_ROOT -install -D -m 755 classic_pi $RPM_BUILD_ROOT/usr/sbin/classic_pi -install -D -m 755 pi_stress $RPM_BUILD_ROOT/usr/sbin/pi_stress -install -D -m 644 pi_stress.8 $RPM_BUILD_ROOT/%{mandir}/man8/pi_stress.8 -gzip $RPM_BUILD_ROOT/%{mandir}/man8/pi_stress.8 -install -D -m 644 COPYING $RPM_BUILD_ROOT/usr/share/doc/%{name}-%{version}/COPYING -install -D -m 644 README $RPM_BUILD_ROOT/usr/share/doc/%{name}-%{version}/README - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root,-) -/usr/sbin/classic_pi -/usr/sbin/pi_stress -%doc -/usr/share/man/man8/pi_stress.8.gz -/usr/share/doc/%{name}-%{version}/COPYING -/usr/share/doc/%{name}-%{version}/README - -%changelog -* Wed Jan 2 2008 Clark Williams - 1.17-1 -- fixed logic error with watchdog_check() - -* Wed Jul 11 2007 Clark Williams - 1.16-1 -- bumped version for packaging in RHEL-RT -- added usage() to classic_pi -- removed --signal option in pi_stress - -* Wed Jul 11 2007 Clark Williams - 1.15-1 -- added rpmlint target to Makefile -- fixed rpmlint complaints in specfile - -* Wed Dec 12 2006 Clark Williams - 1.14-1 -- changed how pi_stress shutdown is handled -- fixed dealing with --iterations shutdown - -* Thu Dec 7 2006 Clark Williams - 1.13-1 -- Added README and COPYING files - -* Wed Dec 6 2006 Clark Williams - 1.12-1 -- changed shutdown variable to volatile -- bumped version - -* Mon Dec 4 2006 Clark Williams - 1.11-1 -- Modified priorities to be just above minimum (as opposed to just below max) - -* Thu Nov 30 2006 Clark Williams - 1.10-1 -- added timing logic to pi_stress.c -- refactored function order in pi_stress.c - -* Wed Nov 29 2006 Clark Williams - 1.9-1 -- added --duration logic to pi_stress.c - -* Mon Nov 27 2006 Clark Williams - 1.8-1 -- Initial packaging. - From patchwork Thu Oct 29 17:40:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 315278 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03386C55179 for ; Thu, 29 Oct 2020 17:41:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8992D2076D for ; Thu, 29 Oct 2020 17:41:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IDAST6Ka" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727105AbgJ2RlQ (ORCPT ); Thu, 29 Oct 2020 13:41:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726257AbgJ2RlP (ORCPT ); Thu, 29 Oct 2020 13:41:15 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7026DC0613CF for ; Thu, 29 Oct 2020 10:41:15 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id h19so2375479qtq.4 for ; Thu, 29 Oct 2020 10:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2uf+FAP3ODLwbLc0p28eQToNS0/OzS2kNZLxQGtomwk=; b=IDAST6Kaehkoamf3JZ+F3WmQn5BtM+r2zAoLnaQe2Cen9E4TIHD2ry0nhYyrWfBCKW lAjj1HGoaESexuV0CF9v3arEbOKMiwUCH2PqrNQuRh12Wvd/Wh+9Uy25bdBvLhaNgOec yneQlbWLp7sU5YG1ZhyqkWswfqjqj+9H6nYVEhpoEga/DEazAkeoUSpT7X/KjIycfAQW 8YDFHbm/nzYeGXB55No50yyu2LW5E+xZueJhBqoVLNMomCRYrye9FUxOT2bOM+FfSR9d NC2EPacgxOIFRA/HKmX5kI2yelWOmw8MCmvr6TDn+BYypWbDXhD7tSrkX7+AS2QZIfbG 8RKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2uf+FAP3ODLwbLc0p28eQToNS0/OzS2kNZLxQGtomwk=; b=HcxnEiLHRHug0e0/10zZfVgOt6GWvfCa13rtbApJqTB+BSF28DxZVckI7nfMem8+1b Il4cjHtOmLN2EwU4kqqd7nmU/3xayH9LwDkyENjpWC2hkshbpAtFRweCFnlAtuJ+2M/a Jqkoaws+Gs5Gj5Stsnmk+Af+SPAfZLdLyjrX9WbwB2hqIPUcGskVlVKJIzRbey82WG0z xNQugB6jv8T7a/ZpEOjCUEozFZYeH9NwSCp67voRPys1wPFi3wBJy1Q8OmTs9tc1wo2Y hVLb3+CWV31fUzRQ4s8gMp5JOqb8nhml+3IPt0byFDOBfJ2xkTXe2WrSihUYZik5lGxS pEFw== X-Gm-Message-State: AOAM533gPLFJsojgbC3zyPDTUDJu7mTE5JjWbDnzboHrPuVlYq48LXnW jgkyK/wS4kTPB+la3lk7Ei9HlNggGnY3/Q== X-Google-Smtp-Source: ABdhPJygRTAgP5vxf9bpbLC+7vOLgLNAeUxun5u4jK/RbipNtv5M/WZMf8ntJ7mh9vF8oha3kQLVwg== X-Received: by 2002:aed:2d62:: with SMTP id h89mr4801666qtd.108.1603993274360; Thu, 29 Oct 2020 10:41:14 -0700 (PDT) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-10-174-88-120-216.dsl.bell.ca. [174.88.120.216]) by smtp.gmail.com with ESMTPSA id z13sm1472460qkl.2.2020.10.29.10.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 10:41:13 -0700 (PDT) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 02/16] rt-tests: cyclictest: A few style changes from checkpatch.pl Date: Thu, 29 Oct 2020 13:40:43 -0400 Message-Id: <20201029174057.20033-3-jkacur@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201029174057.20033-1-jkacur@redhat.com> References: <20201029174057.20033-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org A few style changes as suggested by checkpatch.pl Please note not everything that checkpatch reports will be applicable to rt-tests. Signed-off-by: John Kacur --- src/cyclictest/cyclictest.c | 86 ++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 48 deletions(-) diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index fda7b0f4280f..34aa9be583f8 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -62,12 +62,12 @@ static int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec if (clock_id == CLOCK_THREAD_CPUTIME_ID) return -EINVAL; if (clock_id == CLOCK_PROCESS_CPUTIME_ID) - clock_id = MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED); + clock_id = MAKE_PROCESS_CPUCLOCK(0, CPUCLOCK_SCHED); return syscall(__NR_clock_nanosleep, clock_id, flags, req, rem); } -int sched_setaffinity (__pid_t __pid, size_t __cpusetsize, +int sched_setaffinity(__pid_t __pid, size_t __cpusetsize, __const cpu_set_t *__cpuset) { return -EINVAL; @@ -292,7 +292,7 @@ static int tracemark_fd = -1; * if a call fails, return the error * if successful return 0 * if fails, return -1 -*/ + */ static int raise_soft_prio(int policy, const struct sched_param *param) { int err; @@ -352,7 +352,8 @@ try_again: if (err == EPERM) { int err1; err1 = raise_soft_prio(policy, param); - if (!err1) goto try_again; + if (!err1) + goto try_again; } } @@ -551,7 +552,7 @@ static void *timerthread(void *param) fatal("timerthread%d: failed to set priority to %d\n", par->cpu, par->prio); - if(smi) { + if (smi) { par->msr_fd = open_msr_file(par->cpu); if (par->msr_fd < 0) fatal("Could not open MSR interface, errno: %d\n", @@ -569,7 +570,7 @@ static void *timerthread(void *param) clock_gettime(par->clock, &globalt); if (secaligned) { /* Ensure that the thread start timestamp is not - in the past */ + * in the past */ if (globalt.tv_nsec > 900000000) globalt.tv_sec += 2; else @@ -709,10 +710,8 @@ static void *timerthread(void *param) } stat->avg += (double) diff; - if (trigger && (diff > trigger)) { + if (trigger && (diff > trigger)) trigger_update(par, diff, calctime(now)); - } - if (duration && (calcdiff(now, stop) >= 0)) shutdown++; @@ -831,7 +830,7 @@ static void display_help(int error) " --latency=PM_QOS write PM_QOS to /dev/cpu_dma_latency\n" "-F --fifo= create a named pipe at path and write stats to it\n" "-h --histogram=US dump a latency histogram to stdout after the run\n" - " US is the max latency time to be be tracked in microseconds\n" + " US is the max latency time to be tracked in microseconds\n" " This option runs all threads at the same priority.\n" "-H --histofall=US same as -h except with an additional summary column\n" " --histfile= dump the latency histogram to instead of stdout\n" @@ -933,9 +932,8 @@ static int cpu_for_thread_sp(int thread_num, int max_cpus) num_cpus = rt_numa_bitmask_count(affinity_mask); - if (num_cpus == 0) { + if (num_cpus == 0) fatal("No allowable cpus to run on\n"); - } m = thread_num % num_cpus; @@ -962,9 +960,8 @@ static int cpu_for_thread_ua(int thread_num, int max_cpus) CPU_ZERO(&cpuset); res = pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset); - if (res != 0) { + if (res != 0) fatal("pthread_getaffinity_np failed: %s\n", strerror(res)); - } num_cpus = CPU_COUNT(&cpuset); m = thread_num % num_cpus; @@ -983,7 +980,8 @@ static int cpu_for_thread_ua(int thread_num, int max_cpus) /* After this function is called, affinity_mask is the intersection of the user - * supplied affinity mask and the affinity mask from the run time environment */ + * supplied affinity mask and the affinity mask from the run time environment + */ static void use_current_cpuset(const int max_cpus) { int i; @@ -996,11 +994,11 @@ static void use_current_cpuset(const int max_cpus) numa_sched_getaffinity(pid, curmask); /* Clear bits that are not set in both the cpuset from the environment, - * and in the user specified affinity for cyclictest */ + * and in the user specified affinity for cyclictest + */ for (i=0; i < max_cpus; i++) { - if ((!rt_numa_bitmask_isbitset(affinity_mask, i)) || (!rt_numa_bitmask_isbitset(curmask, i))) { + if ((!rt_numa_bitmask_isbitset(affinity_mask, i)) || (!rt_numa_bitmask_isbitset(curmask, i))) numa_bitmask_clearbit(affinity_mask, i); - } } numa_bitmask_free(curmask); @@ -1097,7 +1095,7 @@ static void numa_initialize(void) } /* Process commandline options */ -static void process_options (int argc, char *argv[], int max_cpus) +static void process_options(int argc, char *argv[], int max_cpus) { int error = 0; int option_affinity = 0; @@ -1163,7 +1161,7 @@ static void process_options (int argc, char *argv[], int max_cpus) if (optarg != NULL) { parse_cpumask(optarg, max_cpus); setaffinity = AFFINITY_SPECIFIED; - } else if (optindavg/stat->cycles) : 0, stat->max); if (smi) - fprintf(fp," SMI:%8ld", stat->smi_count); + fprintf(fp, " SMI:%8ld", stat->smi_count); fprintf(fp, "\n"); } @@ -1646,7 +1644,7 @@ static void rstat_print_stat(struct thread_param *par, int index, int verbose, i (long)(stat->avg/stat->cycles) : 0, stat->max); if (smi) - dprintf(fd," SMI:%8ld", stat->smi_count); + dprintf(fd, " SMI:%8ld", stat->smi_count); dprintf(fd, "\n"); } @@ -1745,7 +1743,8 @@ static void trigger_print() struct thread_trigger *trig = head; char *fmt = "T:%2d Spike:%8ld: TS: %12ld\n"; - if (current == head) return; + if (current == head) + return; printf("\n"); while (trig->next != current) { fprintf(stdout, fmt, trig->tnum, trig->diff, trig->ts); @@ -1788,9 +1787,8 @@ static int rstat_shm_open(void) errno = 9; fd = shm_open(shm_name, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); - if (fd == -1) { + if (fd == -1) fprintf(stderr, "ERROR: shm_open %s\n", strerror(errno)); - } rstat_fd = fd; @@ -1803,9 +1801,8 @@ static int rstat_ftruncate(int fd, off_t len) errno = 0; err = ftruncate(fd, len); - if (err) { + if (err) fprintf(stderr, "ftruncate error %s\n", strerror(errno)); - } return err; } @@ -1817,9 +1814,8 @@ static void *rstat_mmap(int fd) errno = 0; mptr = mmap(0, _SC_PAGE_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); - if (mptr == (void*)-1) { + if (mptr == (void*)-1) fprintf(stderr, "ERROR: mmap, %s\n", strerror(errno)); - } return mptr; } @@ -1830,9 +1826,8 @@ static int rstat_mlock(void *mptr) errno = 0; err = mlock(mptr, _SC_PAGE_SIZE); - if (err == -1) { + if (err == -1) fprintf(stderr, "ERROR, mlock %s\n", strerror(errno)); - } return err; } @@ -1895,9 +1890,8 @@ int main(int argc, char **argv) errno = 0; res = numa_sched_setaffinity(getpid(), affinity_mask); - if (res != 0) { + if (res != 0) warn("Couldn't setaffinity in main thread: %s\n", strerror(errno)); - } } if (trigger) { @@ -1939,11 +1933,10 @@ int main(int argc, char **argv) clock = clocksources[clocksel]; - if (clock_getres(clock, &res)) { + if (clock_getres(clock, &res)) warn("clock_getres failed"); - } else { + else reported_resolution = (NSEC_PER_SEC * res.tv_sec) + res.tv_nsec; - } /* @@ -1954,9 +1947,8 @@ int main(int argc, char **argv) */ times = 1000; clock_gettime(clock, &prev); - for (k=0; k < times; k++) { + for (k=0; k < times; k++) clock_gettime(clock, &now); - } diff = calcdiff_ns(now, prev); if (diff == 0) { @@ -1979,9 +1971,8 @@ int main(int argc, char **argv) time = calloc(times, sizeof(*time)); - for (k=0; k < times; k++) { + for (k=0; k < times; k++) clock_gettime(clock, &time[k]); - } if (ct_debug) { info("For %d consecutive calls to clock_gettime():\n", times); @@ -1994,9 +1985,8 @@ int main(int argc, char **argv) diff = calcdiff_ns(time[k], prev); prev = time[k]; - if (diff && (diff < min_non_zero_diff)) { + if (diff && (diff < min_non_zero_diff)) min_non_zero_diff = diff; - } if (ct_debug) info("%ld.%06ld %5llu\n", @@ -2027,7 +2017,7 @@ int main(int argc, char **argv) sigemptyset(&sigset); sigaddset(&sigset, signum); - sigprocmask (SIG_BLOCK, &sigset, NULL); + sigprocmask(SIG_BLOCK, &sigset, NULL); signal(SIGINT, sighand); signal(SIGTERM, sighand); @@ -2076,7 +2066,7 @@ int main(int argc, char **argv) /* find the memory node associated with the cpu i */ node = rt_numa_numa_node_of_cpu(cpu); - /* get the stack size set for for this thread */ + /* get the stack size set for this thread */ if (pthread_attr_getstack(&attr, &currstk, &stksize)) fatal("failed to get stack size for thread %d\n", i); @@ -2207,7 +2197,7 @@ int main(int argc, char **argv) for (i = 0; i < num_threads; i++) { print_stat(stdout, parameters[i], i, verbose, quiet); - if(max_cycles && statistics[i]->cycles >= max_cycles) + if (max_cycles && statistics[i]->cycles >= max_cycles) allstopped++; } From patchwork Thu Oct 29 17:40:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 315277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBC9BC55179 for ; Thu, 29 Oct 2020 17:41:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E4472076D for ; Thu, 29 Oct 2020 17:41:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EIIPE3Wz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727067AbgJ2RlT (ORCPT ); Thu, 29 Oct 2020 13:41:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbgJ2RlR (ORCPT ); Thu, 29 Oct 2020 13:41:17 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D9D6C0613CF for ; Thu, 29 Oct 2020 10:41:16 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id i7so2364072qti.6 for ; Thu, 29 Oct 2020 10:41:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QXu3PfrX/DTaVcn8thcSEL8HLfqJ0w3SnZL0jimNThw=; b=EIIPE3WzD3o7tpu0YnRP5W89X/NlZDRpDj4OBP+G6kv/B8gsUPy7clOdEBeZ7CoGhn XwQQ6ru0uehbUpZB1qWHM65UhCYUemhRlpRADP3XzV3KRhbu6JeLcyr1Gw3IcoHTux2S BZbbE8vu3uAkdbqx9XyElHmUick5t4uqNNGhvqxNcaYMIzpPjibyG7o5vERRg5umLuNh auW0EzH8Zul64yRU0UA+BZz7GwR5AfBTUHaqS/r3kjmVvAuXnQDnByMCa7t84nb9Y8An BLiAI5XzPR5suKkZey5vIkactSwa+xv9su9tV7Pc77j9H8/+L3m7lPbcRS/7MD0pC13Y Rkag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QXu3PfrX/DTaVcn8thcSEL8HLfqJ0w3SnZL0jimNThw=; b=NhdpVnXSK7/GSWnmoJjPPqQ8M4u5eHDyWcQSL82Jmdh8ikFLumBTRAls2jFLN+CP9e ZBg56eRcoUVmv9MD1TSKFucHoxTgFfVNgs1vEekm5/3TVwFtpvi8nlQtVrXFVbzKvRyl 9al+ozn9FA6D9fuhEM+Aw/VXYQM1iZxU6e8+7W54feXCp9ExX/eN5+mdPPqr/6OaazsY L1msLooVT9tWVdTYqQTkXOnSZSftQV5jDxFlKZ92qVR5VnINj49Q0+VApli7GH1rchVN uJoOr6SpcPP4GKcn6QTeY/DILJWdwdkBZGbCz8ThinR8MjG7vucNgPD9TivW++DPUjjI VGyA== X-Gm-Message-State: AOAM531lHtrzcOEYWZ+OQklqHbDWFC0XNcq3n6ngn51N1hJVI01t9U+v k1Gju4fHE89GEkKIvXWA3SD6BxBWM9CNeQ== X-Google-Smtp-Source: ABdhPJyN1FeRpGezlG+SRvXsyKfT47x0+Pq4mQap0nDycLPiSL+JnX0//8u1Md/3zNXYUj8lRhOBTg== X-Received: by 2002:ac8:4b79:: with SMTP id g25mr4750237qts.19.1603993275342; Thu, 29 Oct 2020 10:41:15 -0700 (PDT) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-10-174-88-120-216.dsl.bell.ca. [174.88.120.216]) by smtp.gmail.com with ESMTPSA id z13sm1472460qkl.2.2020.10.29.10.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 10:41:14 -0700 (PDT) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 03/16] rt-tests: rt-sched.c: Style change Date: Thu, 29 Oct 2020 13:40:44 -0400 Message-Id: <20201029174057.20033-4-jkacur@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201029174057.20033-1-jkacur@redhat.com> References: <20201029174057.20033-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Style change from checkpatch.pl Signed-off-by: John Kacur --- src/lib/rt-sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/rt-sched.c b/src/lib/rt-sched.c index 2aaf02d42aee..8023bc70c473 100644 --- a/src/lib/rt-sched.c +++ b/src/lib/rt-sched.c @@ -26,5 +26,5 @@ int sched_getattr(pid_t pid, unsigned int size, unsigned int flags) { - return syscall(__NR_sched_getattr, pid, attr, size, flags); + return syscall(__NR_sched_getattr, pid, attr, size, flags); } From patchwork Thu Oct 29 17:40:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 315276 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64E65C4363A for ; Thu, 29 Oct 2020 17:41:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D05A20796 for ; Thu, 29 Oct 2020 17:41:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SA/Ynozi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726083AbgJ2RlU (ORCPT ); Thu, 29 Oct 2020 13:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727277AbgJ2RlT (ORCPT ); Thu, 29 Oct 2020 13:41:19 -0400 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DDE2C0613CF for ; Thu, 29 Oct 2020 10:41:19 -0700 (PDT) Received: by mail-qv1-xf43.google.com with SMTP id 63so1674661qva.7 for ; Thu, 29 Oct 2020 10:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7jzHq9bPBFbNPcWdQmAQy1FpY+UgbdjuV27KpQTUWq8=; b=SA/YnozinHRS+q3Ivsz2Xh/nRGUK6kP6k5Yhv3OghVRKXwOLRL5YIOvjrKCTOqsHFf NLCgsvbrObQ+9vVLOHapGOQvrd7sJ2lLjtRmBl1SUHkIiVmhQrYiDFDrlfFI3nIbDa2L hyDPenw56Gp6GMHPe1O6FhRDnPhmv3Elz17huGp++ni7GDgUYsDcE+fnl9R9RnHGyMws Zm4QWxIT0DxOwYQ4rFwzzvUgy2Xj1d9zg4o68Oxpimr4rCBwKWZBKZ6ZuxzbCFujOOHw o0XGSlLIu0VrcGggjMoGzn5vLGE3JFODaNsewhoIiM+Mt9gfjq/9uPW/dmT8YBCrXVVd gx4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7jzHq9bPBFbNPcWdQmAQy1FpY+UgbdjuV27KpQTUWq8=; b=T8NM3HAA7J8B1ngidiEmGqOGVtnjy7w7xM6/u+QZkHkj+ihYkBN7y7zRiOwTxx5xOh dXeT8F0lgXq4/wpfLnLvM6WrQlIyRBuhtbGDKdGl9JC6PbVZpQB7xT+HmpaktUCTmlWM 7WEepCjVRplgiAfSzOXDiSUY1CgwONKaPmjJdoNUJu+x49INLO3ONGHHholZYqNaVe9B x0gLgzDXdolRNoaLlV490vXO6YJy2i8W3Lf3E+Y4UmjHx9cnOBHhoRIoBLLm6MyTBOL1 XqFlGtCOGz3kr+n8p0GFIXZPuPYgPAIQnMu7LsBduqEF9DDn17rZi5VAHErM2egotU11 9hdQ== X-Gm-Message-State: AOAM532Y2ARj8mlVcy7y2G96qWJ4jyik+e0oAMwgP/zjbzBl2m4kX0eP Z67qhctVf56X+brMCVg52ACy7Yix7u+hVA== X-Google-Smtp-Source: ABdhPJzJ/aZGL5GdDQb2Yu2Zjt1vu/76xYTUpE2YsZ2Cpn4W2Ru6MYHcKevGnChRhkxV8SZXV9P5Yg== X-Received: by 2002:a0c:f38b:: with SMTP id i11mr5502510qvk.41.1603993278335; Thu, 29 Oct 2020 10:41:18 -0700 (PDT) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-10-174-88-120-216.dsl.bell.ca. [174.88.120.216]) by smtp.gmail.com with ESMTPSA id z13sm1472460qkl.2.2020.10.29.10.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 10:41:17 -0700 (PDT) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 06/16] rt-tests: pip_stress.c: Remove unnecessary brackets Date: Thu, 29 Oct 2020 13:40:47 -0400 Message-Id: <20201029174057.20033-7-jkacur@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201029174057.20033-1-jkacur@redhat.com> References: <20201029174057.20033-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Remove unnecessary brackets as suggested by checkpatch.pl Signed-off-by: John Kacur --- src/pi_tests/pip_stress.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pi_tests/pip_stress.c b/src/pi_tests/pip_stress.c index 74cf53dcfa7a..4583aa40a6b8 100644 --- a/src/pi_tests/pip_stress.c +++ b/src/pi_tests/pip_stress.c @@ -216,9 +216,8 @@ void high(pid_t pid) Pthread_mutex_lock(resource); Pthread_mutex_lock(statep->mutex); statep->high_owns_resource = 1; - if (!statep->low_owns_resource || !statep->medium_started) { + if (!statep->low_owns_resource || !statep->medium_started) statep->inversion = 0; - } Pthread_mutex_unlock(statep->mutex); Pthread_mutex_unlock(resource); kill(pid, SIGKILL); /* kill the medium thread */ @@ -228,9 +227,8 @@ void high(pid_t pid) if (statep->inversion) printf("Successfully used priority inheritance to handle an inversion\n"); - else { + else printf("No inversion incurred\n"); - } Pthread_mutex_unlock(statep->mutex); } From patchwork Thu Oct 29 17:40:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 315275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14284C2D0A3 for ; Thu, 29 Oct 2020 17:41:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A83E32076D for ; Thu, 29 Oct 2020 17:41:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Yx7IK+FT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727499AbgJ2RlX (ORCPT ); Thu, 29 Oct 2020 13:41:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726310AbgJ2RlW (ORCPT ); Thu, 29 Oct 2020 13:41:22 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 879E0C0613D2 for ; Thu, 29 Oct 2020 10:41:22 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id l2so2687850qkf.0 for ; Thu, 29 Oct 2020 10:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s+nj8yV7sWGiF2yQNq8JnEMQL9UmPx8G5edovCxTPO0=; b=Yx7IK+FTbcnXI1a5hpY8lOOCqEsyxNNEQ39bkU5/YeT6go4Y49ykvNf6XwpYT+4SZY v4T/O7e6lnOpa5lT2fY+TKD+p8GuZ0WfNpjk73PCPZfcPJfjhVR0JLqAjRuyKlfIuDQ0 t8z7e+n2YYsNOCtLF9utfvcmGT7yQnWliwmMLOn6xG1p/zRS5BqKlwsZQJOKElbnwx3Q /OPrSdAnI3TY8J4iep0Ou+45hKlAVxUKVQxY/8ryl/8pMM24oeHW/H0u6Ol1f2OihdSh imWMVVI+tH2oOewlPQnMrmkG50g+JMP0ltE1+lQo1mrWBemvvaaDovx0ei84odnXNytz 7qLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=s+nj8yV7sWGiF2yQNq8JnEMQL9UmPx8G5edovCxTPO0=; b=PNpS2zJDz2Mw6MOanhkBtFkh7w7t/OzwPGHferXRRqTjDeEaJE2wqhctDoPCdfoEDm jA6Y8Trd5mIaZ9dLeFqmD7q0OyWNQoYV+AUHKAivsZS9X5l6XiPESWXpFjiDGmsf95He Vgp21g9juI/7XfkgDJq4EZeJr6FuhnVUr/ygFTOx/fHcy5hGUMksWBRqAJefqNiEs9Bc VhTJYq+n+PTR9CI48UVseseZ8nStzMvPXJcoUi+HjOipj94GrCQ8sDRXclntX7V3T0nA 0P1i8+lDJgBXN2p8CGQCr9BVAgPLklaDNCjta4B0p9AHI6Bk7GMm6IGJVhxVnDF7plwQ LsuQ== X-Gm-Message-State: AOAM531YxEumppyiEN/OQEomoCXaQj6w0QnprMFjZXYjtcunFjdSMSU7 vgdHCPG7OQdpHOoiYwbrWqfFYle3Wjdkmw== X-Google-Smtp-Source: ABdhPJx3I05ZWDLC9PRLk1j1NsstplY6xE48mqLgC36m6sJLQgjG6g8CiptcTyLddVo5geq2rCq2Jg== X-Received: by 2002:a37:9c46:: with SMTP id f67mr4773974qke.213.1603993281548; Thu, 29 Oct 2020 10:41:21 -0700 (PDT) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-10-174-88-120-216.dsl.bell.ca. [174.88.120.216]) by smtp.gmail.com with ESMTPSA id z13sm1472460qkl.2.2020.10.29.10.41.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 10:41:21 -0700 (PDT) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 09/16] rt-tests: queuelat.c: Fix various style problems Date: Thu, 29 Oct 2020 13:40:50 -0400 Message-Id: <20201029174057.20033-10-jkacur@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201029174057.20033-1-jkacur@redhat.com> References: <20201029174057.20033-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Fix various style problems such as spaces in indentation instead of tabs, unsigned long long int, to just unsigned long long, and so on. Signed-off-by: John Kacur --- src/queuelat/queuelat.c | 58 +++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/src/queuelat/queuelat.c b/src/queuelat/queuelat.c index fbe5239ee81e..ead8ee5f4898 100644 --- a/src/queuelat/queuelat.c +++ b/src/queuelat/queuelat.c @@ -26,12 +26,12 @@ * mpps(million-packet-per-sec): million packets per second (float). * tsc_freq_mhz: TSC frequency in MHz, as measured by TSC PIT calibration * (search for "Detected XXX MHz processor" in dmesg, and use the integer part). - * + * * How it works * ============ * * The program in essence does: - * + * * b = rdtsc(); * memmove(dest, src, n); * a = rdtsc(); @@ -44,8 +44,8 @@ * if (queue_size > max_queue_len) * FAIL(); * - * packets_processed is fixed, and is estimated as follows: - * n is determined first, so that the stats bucket with highest count + * packets_processed is fixed, and is estimated as follows: + * n is determined first, so that the stats bucket with highest count * takes max_latency/2. * for max_latency/2, we calculate how many packets can be drained * in that time (using cycles_per_packet). @@ -74,17 +74,16 @@ int nr_packets_drain_per_block; #define VALS_PER_BUCKET 100 #define NR_BUCKETS LAST_VAL/VALS_PER_BUCKET -unsigned long long int buckets[NR_BUCKETS+1]; -unsigned long long int total_count; +unsigned long long buckets[NR_BUCKETS+1]; +unsigned long long total_count; #define OUTLIER_BUCKET NR_BUCKETS static int val_to_bucket(unsigned long long val) { int bucket_nr = val / VALS_PER_BUCKET; - if (bucket_nr >= NR_BUCKETS) { + if (bucket_nr >= NR_BUCKETS) return OUTLIER_BUCKET; - } return bucket_nr; } @@ -100,9 +99,8 @@ static unsigned long long total_samples(void) int i; unsigned long long total = 0; - for (i = 0; i <= OUTLIER_BUCKET; i++) { + for (i = 0; i <= OUTLIER_BUCKET; i++) total += buckets[i]; - } return total; } @@ -151,9 +149,8 @@ static void print_max_bucketsec(void) bucket_nr = val_to_bucket(val); - if (buckets[bucket_nr] != 0) { + if (buckets[bucket_nr] != 0) highest_val = val; - } } bucket_nr = val_to_bucket(highest_val); @@ -196,7 +193,7 @@ static void print_avg_bucketsec(void) for (i = 0; i <= OUTLIER_BUCKET; i++) { unsigned long long val = i*VALS_PER_BUCKET; - unsigned long long maxtime; + unsigned long long maxtime; bucket_nr = val_to_bucket(val); @@ -236,9 +233,9 @@ static void print_all_buckets_drainlength(void) mindelta = val; maxdelta = val + VALS_PER_BUCKET-1; - nr_packets_minfill = mindelta * mpps * 1000000 / NSEC_PER_SEC; - nr_packets_maxfill = maxdelta * mpps * 1000000 / NSEC_PER_SEC; - + nr_packets_minfill = mindelta * mpps * 1000000 / NSEC_PER_SEC; + nr_packets_maxfill = maxdelta * mpps * 1000000 / NSEC_PER_SEC; + printf("[%lld - %lld] = %lld packetfillrates=[%d - %d]\n", val, val + VALS_PER_BUCKET-1, buckets[bucket_nr], @@ -275,11 +272,11 @@ typedef unsigned long long u64; static inline unsigned long long __rdtscll(void) { - DECLARE_ARGS(val, low, high); + DECLARE_ARGS(val, low, high); - asm volatile("mfence; rdtsc" : EAX_EDX_RET(val, low, high)); + asm volatile("mfence; rdtsc" : EAX_EDX_RET(val, low, high)); - return EAX_EDX_VAL(val, low, high); + return EAX_EDX_VAL(val, low, high); } #define gettick(val) do { (val) = __rdtscll(); } while (0) @@ -316,7 +313,7 @@ static int find_highest_count_bucket(void) { int i; int max_bucket = 0; - unsigned long long int max_val = 0; + unsigned long long max_val = 0; for (i=0; i <= NR_BUCKETS; i++) { if (buckets[i] > max_val) { @@ -335,7 +332,7 @@ static void trace_open(void) fd = open("/sys/kernel/debug/tracing/trace_marker", O_RDWR); - if (fd == -1) { + if (fd == -1) { perror("open"); exit(0); } @@ -347,7 +344,7 @@ static void trace_write(char *buf, int len) int ret; ret = write(tracing_mark_fd, buf, len); - if (ret == -1) { + if (ret == -1) { perror("write"); exit(0); } @@ -487,10 +484,10 @@ void main_loop(void) queue_size += nr_packets_fill; /* decrease the queue by the amount of packets - * processed in maxlatency/2 nanoseconds of - * full processing. - */ - + * processed in maxlatency/2 nanoseconds of + * full processing. + */ + queue_size -= nr_packets_drain_per_block; if (queue_size < 0) @@ -641,9 +638,9 @@ int main(int argc, char **argv) install_signals(); maxlatency = atoi(mvalue); - cycles_per_packet = atoi(cvalue); - mpps = atof(pvalue); - tsc_freq_mhz = atof(fvalue); + cycles_per_packet = atoi(cvalue); + mpps = atof(pvalue); + tsc_freq_mhz = atof(fvalue); if (tvalue) { int alarm_secs; @@ -651,9 +648,8 @@ int main(int argc, char **argv) alarm(alarm_secs); } - if (qvalue) { + if (qvalue) min_queue_size_to_print = atoi(qvalue); - } convert_to_ghz(tsc_freq_mhz); From patchwork Thu Oct 29 17:40:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 315274 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6457AC55179 for ; Thu, 29 Oct 2020 17:41:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0722E2076D for ; Thu, 29 Oct 2020 17:41:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="erF07UGD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727386AbgJ2RlY (ORCPT ); Thu, 29 Oct 2020 13:41:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726310AbgJ2RlX (ORCPT ); Thu, 29 Oct 2020 13:41:23 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C270C0613CF for ; Thu, 29 Oct 2020 10:41:23 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id q199so2629234qke.10 for ; Thu, 29 Oct 2020 10:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z3SF53m8V8qlEwJCfHBnJloWqF/+m7kpLihcx1RckBM=; b=erF07UGD5PYT396uslQ/DVWrm//K98nOQ2a3E/8so0Nb45Rcs/LAIcLpY6YfHxjHxt 6jLN2bA+0bM14b6WyVOfBFug6ZeQrrPgBb6TfVAD43ugmBgrVkYaX3FKTqdwbroxRYQM HYRIB2KwavcdF9wKthQ863AcBrNltLnOqtB2nBW6W+EEy+jDO4xqEKcWmwU9XrIMckG2 uNSJ/lV2lgKO+rxNn1tae/gBea+NKEWi+YFaar3IuOM/l9eKDuGfEG4HgPjIKhgX/st5 XlFdVlV16rRKBmv9XFKZy/FTp6FhjprEKYT5jLjA8S1HP5hPv/oFyncGnfHxTgxlG+fa E0Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Z3SF53m8V8qlEwJCfHBnJloWqF/+m7kpLihcx1RckBM=; b=fFTNS9yUHKEMmUh9vZacFs9Y931dMGvKnZkX42yxWz3IGQ8wInu/3MZxqvhB68/dn5 f5d/N6HX63vMol01SahDVM+Zx5UdL+Kbqw/FztKkNzDzA2fJzYdMvcWsJIZ7kh1MXnUQ tE2KcM4jddtbibAQjZyABPIQX97tLz1yCv+QzRWUp7YaJsbqLzsaR+ei9UlTwnMoFQU0 9kZ2JgCyzrZ6bnLFamGW/0jyDG00lDemXsEjlUDluI6jNlO4DYy9JcXTvEnUHEHV1eb9 RDOD2UjTT/JimrWIS2LDTdN9NY7Cw+dZFJ66kgJey4srDNymCP3ynGl41AfjE1B9k6JU 52mA== X-Gm-Message-State: AOAM530bPsMmF1miQd37pUeMFWBMlcdgiu5Uk7jYyKTjxHt5+vmQ0KKN kuarjQRgbbjqeyHfNsZl56B1bn5/3aEDbQ== X-Google-Smtp-Source: ABdhPJxv1tL83UbdVZme92FGQpW2RmOmh3r8mODHJN6DAr+2qHy7pETxqS4qQWU0QCYpJqIf1ixV1A== X-Received: by 2002:ae9:e708:: with SMTP id m8mr5011812qka.296.1603993282413; Thu, 29 Oct 2020 10:41:22 -0700 (PDT) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-10-174-88-120-216.dsl.bell.ca. [174.88.120.216]) by smtp.gmail.com with ESMTPSA id z13sm1472460qkl.2.2020.10.29.10.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 10:41:21 -0700 (PDT) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 10/16] rt-tests: rt-migrate-test.c: Fix spacing around parentheses Date: Thu, 29 Oct 2020 13:40:51 -0400 Message-Id: <20201029174057.20033-11-jkacur@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201029174057.20033-1-jkacur@redhat.com> References: <20201029174057.20033-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Fix improper spacing around parentheses Signed-off-by: John Kacur --- src/rt-migrate-test/rt-migrate-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rt-migrate-test/rt-migrate-test.c b/src/rt-migrate-test/rt-migrate-test.c index 68824606faf1..f1b7e5e4fe8c 100644 --- a/src/rt-migrate-test/rt-migrate-test.c +++ b/src/rt-migrate-test/rt-migrate-test.c @@ -552,7 +552,7 @@ int main (int argc, char **argv) nanosleep(&intv, NULL); - print_progress_bar((loop * 100)/ nr_runs); + print_progress_bar((loop * 100)/nr_runs); end = get_time(); ftrace_write("Loop %d end now=%lld diff=%lld\n", loop, end, end - now); From patchwork Thu Oct 29 17:40:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 315273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B5E5C4363A for ; Thu, 29 Oct 2020 17:41:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B59632076D for ; Thu, 29 Oct 2020 17:41:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rb08vBf6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725876AbgJ2Rl1 (ORCPT ); Thu, 29 Oct 2020 13:41:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726310AbgJ2RlZ (ORCPT ); Thu, 29 Oct 2020 13:41:25 -0400 Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52A4DC0613D2 for ; Thu, 29 Oct 2020 10:41:25 -0700 (PDT) Received: by mail-qv1-xf41.google.com with SMTP id g13so1684923qvu.1 for ; Thu, 29 Oct 2020 10:41:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t9oiVSl6mSYYSXlclsIwtpojApqA+RfyCJ6ktBTGLQY=; b=rb08vBf6qQXiU3udlPOWL4OIeFXjub2/3BnZQJVndWCUnsNPUw8FUfcUSJ4Ynf4a94 Ujtg+JC56dLlLACXkQClPMZvfTzO89TN+fMGRlrKZAvQXpdgZnXzrmmXZ+6nIJzluorK DN06gnZSzdqAyMsXTWoDN1TXPfIOyjZ1qafqmCE2A2DJcasMlkcwypgKP06TearssS44 QuhV5/cgxVO0l8R7Gnp3cfNstX4pEZ0F6xZwmgQCxV6hF7hO7G+YscOPITgC21jpAO/K cVb9ge2yTP+cFJnky1ihNrQn0Zy9U1AZzMRsaCtWfxpW2Y1RK53sr9Tg/dMy8J+em/XZ 5E4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=t9oiVSl6mSYYSXlclsIwtpojApqA+RfyCJ6ktBTGLQY=; b=doFAGOyUV++XmBOR9BxJIBnlXmYzWpFbwrT1bNHni0hQIcI1IqQWJPvvhsGsIMJmNh tGNEiQNy5q42+9bG1HWP0yUeP7CPNcyK7RGJ5ABfa4d7f93uHfDGKleT77mSykvgl5CM nk/Hzl400ZC0tdR0f6K12CFWerEeKo1DaDyyzK7UsYCWtekqH+0aTzwhlo0nPqtzfv5I rIwx3f9LL8/9x/1FRuxHZIE9BLQ9gmssD4jkGgDr07yGbXkhiwl2vCX0nBusoEhwRcGH OIb1Fg+UqzWrR/TuGS6mGXJt0shrNHZa5Gtnca5FGxiPKub69S7cHX0UXWH1SvoRX05h QZFg== X-Gm-Message-State: AOAM531Ol3kZTyif3mkEL+LValX3vu9eMwn8W5ZRN43mRPYr5fK4gmY4 ka4TLdxdUSPj3fOWA8epqX/XU+x136Vgew== X-Google-Smtp-Source: ABdhPJxkeaHExG3BxMrzbQ8ME7P1LQ0NtcG3qWuPO8pAmBJcm/9+DXRBhIoQ+W+fjlbl75Oc1usGZA== X-Received: by 2002:a05:6214:1541:: with SMTP id t1mr5286739qvw.61.1603993284353; Thu, 29 Oct 2020 10:41:24 -0700 (PDT) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-10-174-88-120-216.dsl.bell.ca. [174.88.120.216]) by smtp.gmail.com with ESMTPSA id z13sm1472460qkl.2.2020.10.29.10.41.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 10:41:23 -0700 (PDT) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 12/16] rt-tests: deadline_test.c: Fix spacing around commas Date: Thu, 29 Oct 2020 13:40:53 -0400 Message-Id: <20201029174057.20033-13-jkacur@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201029174057.20033-1-jkacur@redhat.com> References: <20201029174057.20033-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Fix spacing around commas and remove unnecessary brackets Signed-off-by: John Kacur --- src/sched_deadline/deadline_test.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/sched_deadline/deadline_test.c b/src/sched_deadline/deadline_test.c index 060ac896aef2..395c2370f69a 100644 --- a/src/sched_deadline/deadline_test.c +++ b/src/sched_deadline/deadline_test.c @@ -49,7 +49,7 @@ * @error: Exit error code to be used * * This is defined here to show peoplde looking at this code how - * to use this program as well. + * to use this program as well. */ static void usage(int error) { @@ -185,7 +185,7 @@ static int find_mount(const char *mount, char *debugfs) char type[100]; FILE *fp; - if ((fp = fopen("/proc/mounts","r")) == NULL) + if ((fp = fopen("/proc/mounts", "r")) == NULL) return 0; while (fscanf(fp, "%*s %" @@ -218,7 +218,7 @@ static const char *find_debugfs(void) if (!find_mount("debugfs", debugfs)) return ""; - + debugfs_found = 1; return debugfs; @@ -705,8 +705,8 @@ static const char *make_cpuset(const char *name, const char *cpus, fd = open_cpuset(path, "tasks"); snprintf(path, MAXPATH - 1, "%s/tasks", CPUSET_PATH); - if ((fp = fopen(path,"r")) == NULL) { - close (fd); + if ((fp = fopen(path, "r")) == NULL) { + close(fd); return "opening cpuset tasks"; } @@ -768,7 +768,7 @@ static void destroy_cpuset(const char *name, int print) * in this cpuset, that must be moved before destroying the cpuset. */ strncat(path, "/tasks", MAXPATH - 1); - if ((fp = fopen(path,"r")) == NULL) { + if ((fp = fopen(path, "r")) == NULL) { fprintf(stderr, "Failed opening %s\n", path); perror("fopen"); return; @@ -1276,7 +1276,7 @@ void *run_deadline(void *data) sched_yield(); period = get_time_us(); - + while (!done) { period = do_runtime(tid, sched_data, period); sched_yield(); @@ -1335,9 +1335,8 @@ void *run_rt_spin(void *data) if (fail) return NULL; - while (!done) { + while (!done) get_time_us(); - } return NULL; } @@ -1689,7 +1688,7 @@ static u64 calculate_loops_per_ms(u64 *overhead) return loops; } -int main (int argc, char **argv) +int main(int argc, char **argv) { struct sched_data *sched_data; struct sched_data *sd; @@ -1819,9 +1818,8 @@ int main (int argc, char **argv) exit(-1); } - if (mlockall(MCL_CURRENT|MCL_FUTURE) == -1) { + if (mlockall(MCL_CURRENT|MCL_FUTURE) == -1) perror("mlockall"); - } /* * Run at prio 99 bound to the last CPU, and try to calculate @@ -1920,9 +1918,8 @@ int main (int argc, char **argv) pthread_barrier_wait(&barrier); - if (fail) { + if (fail) exit(-1); - } if (!all_cpus) { int *pids; From patchwork Thu Oct 29 17:40:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 315271 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23A1AC55179 for ; Thu, 29 Oct 2020 17:41:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD8952076D for ; Thu, 29 Oct 2020 17:41:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FI6mU9bu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727909AbgJ2Rlb (ORCPT ); Thu, 29 Oct 2020 13:41:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727847AbgJ2Rla (ORCPT ); Thu, 29 Oct 2020 13:41:30 -0400 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BCA9C0613CF for ; Thu, 29 Oct 2020 10:41:29 -0700 (PDT) Received: by mail-qt1-x842.google.com with SMTP id f6so1431442qtc.7 for ; Thu, 29 Oct 2020 10:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yOEdj5PFeldJ8EvZKOASBZF7Us66jWBNYr/vvztJQf8=; b=FI6mU9buzw/kXk734xBc5CGOxHEmKcw+cEV7zUyTmhWVCp8CxMNORKXCmXY4idvvOU tUoEH5FichvqmmLot+q70QT5Q3IfVdzZeKh5Nz/9Qqq9bJSMlfZPbAxw3IvjeJVa74fa nXA61LRBPVVqL36oUylV8tKsEu7/kSzQa6DxIGiXchDpe7OCt32YSzHRYuLrYjUFALzA F92xmZYZhoyvDN+o3G0/hx9eRe/t0UytAnJ9Ng3fvPy8J1YAfejDbuFOQ31YvmscXj52 3rXInPAJjm16Ot5EmdR+/Q8PMGlgYGFiqhg0izqh6kjyaOLJZ/xoiWVgug6FJcctss9O j6rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=yOEdj5PFeldJ8EvZKOASBZF7Us66jWBNYr/vvztJQf8=; b=Go/KHsCFy+Jxsbs2q3dfPNaxF1kcs68pYmPyiTkPSRPH6SSwp1E1g2jcpFE35+lRBe HMx+6+ExhJH2lPzXP2M61bktYEXmIVScyjGaxpcWCOkeMkMROI+564xY0vljychpU+m/ heY5EQKsTeHGBuwUcCM2Itr/+Jkz778EuKI/+UvQ3VOOci4nNWfv3jon5zQEfyhHhGGU dJBenb02k6B/NqWvuaFBakv4z8avgopLkFVzevRS7DjHXmHB2UkQOkGoxhCqfZcGWFMG rJblX2hXn1dUPpc65VsT4AnJ+pcg+Feh9YJLl7v8WGSfdq+7sqeyojHPpT/PNJ4oMPwD Y49Q== X-Gm-Message-State: AOAM533wri8Smn+WITbR/WIkwAaIa6OMW03Lq1iFRhIr9ec6KYp8PHJE 8H27MJgzzZuZrQyQkR0q2a9rzgWh/JBkvA== X-Google-Smtp-Source: ABdhPJzhgmeyuZys979ekQBk6uK5oq4l1AEwW4wr9bcmKvTursUDE7YxnFV6jJj9p8611jTJcmwITQ== X-Received: by 2002:aed:3147:: with SMTP id 65mr4800835qtg.295.1603993286488; Thu, 29 Oct 2020 10:41:26 -0700 (PDT) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-10-174-88-120-216.dsl.bell.ca. [174.88.120.216]) by smtp.gmail.com with ESMTPSA id z13sm1472460qkl.2.2020.10.29.10.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 10:41:25 -0700 (PDT) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 14/16] rt-tests: sigwaittest.c: Fix spacing around brackets Date: Thu, 29 Oct 2020 13:40:55 -0400 Message-Id: <20201029174057.20033-15-jkacur@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201029174057.20033-1-jkacur@redhat.com> References: <20201029174057.20033-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Fix spacing around brackets, Fix indented lable, etc Signed-off-by: John Kacur --- src/sigwaittest/sigwaittest.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/sigwaittest/sigwaittest.c b/src/sigwaittest/sigwaittest.c index 12b55e901ce5..8a5d73b14fc2 100644 --- a/src/sigwaittest/sigwaittest.c +++ b/src/sigwaittest/sigwaittest.c @@ -93,15 +93,15 @@ void *semathread(void *param) if (par->cpu != -1) { CPU_ZERO(&mask); CPU_SET(par->cpu, &mask); - if(sched_setaffinity(0, sizeof(mask), &mask) == -1) + if (sched_setaffinity(0, sizeof(mask), &mask) == -1) fprintf(stderr, "WARNING: Could not set CPU affinity " "to CPU #%d\n", par->cpu); } else { - int max_cpus = sysconf(_SC_NPROCESSORS_CONF); + int max_cpus = sysconf(_SC_NPROCESSORS_CONF); - if (max_cpus > 1) - mustgetcpu = 1; - else + if (max_cpus > 1) + mustgetcpu = 1; + else par->cpu = 0; } @@ -133,12 +133,11 @@ void *semathread(void *param) else pthread_kill(neighbor->threadid, SIGUSR2); par->samples++; - if(par->max_cycles && par->samples >= par->max_cycles) + if (par->max_cycles && par->samples >= par->max_cycles) par->shutdown = 1; - if (mustgetcpu) { + if (mustgetcpu) par->cpu = get_cpu(); - } sigwait(&sigset, &sig); } else { /* Receiver */ @@ -160,9 +159,8 @@ void *semathread(void *param) if (par->max_cycles && par->samples >= par->max_cycles) par->shutdown = 1; - if (mustgetcpu) { + if (mustgetcpu) par->cpu = get_cpu(); - } /* * Latency is the time spent between sending and * receiving the signal. @@ -242,7 +240,7 @@ static int duration; static int interval = 1000; static int distance = 500; -static void process_options (int argc, char *argv[]) +static void process_options(int argc, char *argv[]) { int error = 0; int max_cpus = sysconf(_SC_NPROCESSORS_CONF); @@ -273,7 +271,7 @@ static void process_options (int argc, char *argv[]) if (optarg != NULL) { affinity = atoi(optarg); setaffinity = AFFINITY_SPECIFIED; - } else if (optind X-Patchwork-Id: 315272 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9843C2D0A3 for ; Thu, 29 Oct 2020 17:41:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70E5C20796 for ; Thu, 29 Oct 2020 17:41:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dy8FI8Jo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727800AbgJ2Rl3 (ORCPT ); Thu, 29 Oct 2020 13:41:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726424AbgJ2Rl2 (ORCPT ); Thu, 29 Oct 2020 13:41:28 -0400 Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 370A9C0613CF for ; Thu, 29 Oct 2020 10:41:28 -0700 (PDT) Received: by mail-qv1-xf41.google.com with SMTP id de3so1676849qvb.5 for ; Thu, 29 Oct 2020 10:41:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l6zT/NK7ENrVpkoAC1cidgRL7wUpNHJ+OABss1svSxc=; b=dy8FI8JosgNfedyNoeP1zbq9dE2qZNhyRiIoi5REyJPPPwbsE/pX4+nHTGsj8fbj2D yg4gJCB4uVQ5jNnebKVc/o5mXWx07bOoFINPLjs2gm0XYbdnYbZYQIgquJINqIJxVHSx hrCOLNbxeOI8ku4krW/5yTzC7mQpdmPZA/0Dz3jIzu3H2a3eLSQIapBMh7Q3efUJFI8M h0sbl5Kpq0EuQaizvcbZL5hBqIOXvk1VH/8EhCShfEs7UC9DTEL7eMK3pBsNBSxbMs4C U7tEdGDLd4Mpg2tyFzXD+RSni3TfTGEmw3ORWzJCQGY6axFvkDTvrrDWjPvwH7XANf16 TGig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=l6zT/NK7ENrVpkoAC1cidgRL7wUpNHJ+OABss1svSxc=; b=KqwyfQj+feC/lbQIzkHFkArY3d8CUWM/xFwVS7nPSK3V6oVH+GvflGTHzOQZykT4XE CzghvP5s962f87DjSYWwa4JG/BU3eqs5lG96UGXJgUcVsJ0CpJqx/VXlw0gGb3pBcAbz z2xcPRLwWO0RIl9rqc8jd3IIBXUVGQSf9AYYcmzpLKO+gILb/qx1IHK5uJn5aeKiY6aN +eqGEEj9XGL/riJcqi7apQz5JIb6wNy8PXKBK3y2GPSf/lfrM/mw620ImKiEpxA1MPHS S3fd3bIs4rFuvgiqLg3xHPNLfNzJTrEbyiOao3qGAfpPOFGkLTuG4uZcGCPQ8EFoOJLn xGbg== X-Gm-Message-State: AOAM53073CdTgu7XAG05t7T5tyY0hOg/xX0Ko1+SlvLTlrBboKFWjfqB vfqAEusxTfBqGRX5DorCld4NmJuqadeijg== X-Google-Smtp-Source: ABdhPJz03nI3AAYk31Rb5thNWLOAud0Os7z4MPYO4OfCXNwzPlwS4Mq1dj2LmQwldkqN32PFW8kbJg== X-Received: by 2002:a05:6214:11b3:: with SMTP id u19mr5641659qvv.51.1603993287333; Thu, 29 Oct 2020 10:41:27 -0700 (PDT) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-10-174-88-120-216.dsl.bell.ca. [174.88.120.216]) by smtp.gmail.com with ESMTPSA id z13sm1472460qkl.2.2020.10.29.10.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 10:41:26 -0700 (PDT) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 15/16] rt-tests: ssdd.c: Remove unncessary "else" Date: Thu, 29 Oct 2020 13:40:56 -0400 Message-Id: <20201029174057.20033-16-jkacur@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201029174057.20033-1-jkacur@redhat.com> References: <20201029174057.20033-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org remove unnecessary "else" and also fix function header. Signed-off-by: John Kacur --- src/ssdd/ssdd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ssdd/ssdd.c b/src/ssdd/ssdd.c index 66d6009dc572..9fa61f39f6e3 100644 --- a/src/ssdd/ssdd.c +++ b/src/ssdd/ssdd.c @@ -147,7 +147,7 @@ static pid_t parent; static int nforks = 10; static int nsteps = 10000; -static void sigchld(int sig, unused siginfo_t * info, unused void *arg) +static void sigchld(int sig, unused siginfo_t *info, unused void *arg) { got_sigchld = 1; } @@ -218,7 +218,7 @@ static int forktests(int testid) ret_sig); exit(1); } - else if (!check_sigchld()) { + if (!check_sigchld()) { printf("forktest#%d/%d: EXITING, ERROR: " "wait on PTRACE_ATTACH saw a SIGCHLD count of %d, should be 1\n", testid, getpid(), got_sigchld);