From nobody Thu Apr 2 22:07:12 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F000F145355 for ; Fri, 6 Mar 2026 19:54:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772826859; cv=none; b=jZwHh8Q9RFmi0NeANUbqLVtvuDgayUbyiY6iFUkmmAWl+eh9rBgC831TLas50Nz9tXUcnVXnwd7RQ6SKvZhj/rdxf17C3gszD3SZyb5WruLDGRTeMk8mapMTyZYGkV0B43UySDD+PA13zBWeDbngxasztutO6u+VtxG9g4E+ZzM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772826859; c=relaxed/simple; bh=S/SKHxHdcMr1QfdvIXxApGtmWBodmKNCEKaTN0iTkn4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=shPrwXZwdGDJWa/xXpN4yff6835C1kIpsJTiz+lPXrTog884B8twZE0KBgrso5ydYHFFPyaXKABK7RnBeTIWYZeRxT/s7ZpWKbl9Fi750SvBU8YG0HZoYfeb+f1cF8e2qOTlFgrJp7IYzt+/mk7vsGASEZizJ9fM0U6dJLlg/IU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=J2/S4FSj; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=etXIFe8W; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="J2/S4FSj"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="etXIFe8W" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772826857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UCk5SXr8JRhBJjx3kalF2SaqtbteDwoDGZPqMuj8Nbw=; b=J2/S4FSjas95SyW2OxxxmyILUMNKrQxuHd+kbY1sMDQ7/NZZENyeFpAY/A3ox968Lq824E lTYHwH3YTdWpkvE98iSqau54OqL6kvpukT3AgVd8U08v9QyQX4odcw/koXUBfHySLYuvcV HQIzSs8883gbPx/5B0+gEE6TQ40Y/YE= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-696-64JkIft7MjG_yUCAF5RhOw-1; Fri, 06 Mar 2026 14:54:15 -0500 X-MC-Unique: 64JkIft7MjG_yUCAF5RhOw-1 X-Mimecast-MFC-AGG-ID: 64JkIft7MjG_yUCAF5RhOw_1772826855 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-48378df3469so68408865e9.1 for ; Fri, 06 Mar 2026 11:54:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1772826855; x=1773431655; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=UCk5SXr8JRhBJjx3kalF2SaqtbteDwoDGZPqMuj8Nbw=; b=etXIFe8WHe+NORyTymg945Qp6Bk4lvpPVZt76ufM01Zx+8jr0sdx23WDaDCgtSOINc ujiiuO9QR9OaCwcPloUFM7FI+WF2IOZL/+VYanh2pSgTbLiGr+svY69NEcnsA1YiAhRI g7wwB506J78Wi0aAeAjoaSWvBefMfLOEimLRE/WNRbSFozVu1A95h7FvhfkV/nSrVmA9 pc/2Ptwsokhzio7A3Wkog/pcZwNOJCMvrsfsoSLJQKeTvJEK+/UuSkJ7bkS6SgruXyEp u4ifXTZ5j4xro9A7twMvZUZt7Oc4kM/YjIMAF1Oi6OtTld7M9yQqTdNJFMrvWOS5DJSl xTeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772826855; x=1773431655; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=UCk5SXr8JRhBJjx3kalF2SaqtbteDwoDGZPqMuj8Nbw=; b=gWwK+AT7x4qoMDhvc7S6JRxYKIbGugWHfovCXdIlfaILESQaFNe9rmBAIG0heUHjWn YZTdjhkUqsdPLEtN6vVGa6yAXPGjFQTy4RFuHxFSnzOsO0LGb1ZDqZFeMNxpbEYxvJO7 +QMBLJHCI7NfiDqKryyNPCmPJc3LODUntO/kTr5jDU6f1Q/iyVgFT5pODjEP1AT17LHt 3l4Z1wlP/sDtXGe7fdKyaiyzAL2ywi9oX4yqsN+KgSodYCl/1xhD40Pf0pJxjjz536Wq 1wN/v1Jt6FBZeJoXpq4VTyGfK0FjcAPdyN8aZYKw2fi7XMDb7X+YGucytdo+4TQvuTF/ wl3g== X-Forwarded-Encrypted: i=1; AJvYcCVkLHQNlD3nluIS7bHYYw7L4Go8KCQtJf8gQKv28DT3SOGRQBtK+e/BEo63V4Oj2BeyhW46elNSycvVtxg=@vger.kernel.org X-Gm-Message-State: AOJu0YxxHW32sHhNGMlxnnjzENZDDO9O9vvsBGONlNcBGuH0E2vi8or/ VPaZinlY7TFmx31V6t1rsfUgjxArk9GTO5H5xMhjAR3Is7rHXLdTe/1DDlnHxLWw4yKD59oU6v6 js9XOribYcsa1g04yGax4YfRlbwOL1lcT4p/ZTssPaes1Wf97ruuIk/rywd+76Qia7A== X-Gm-Gg: ATEYQzzHDfmh7CP0r33q/GFe5actt4fAG2p+BoLkR6b33xOTxSDBnB1ew9ODOSms1+Z oi0j1auikV6NYxZzb99MEu5YfZxnSeM/W6LbbnsdnrauJF4gPLgxUf0pPlcNSo775LfesguE+Om AUj/GnAlBIvnHi5X13kwSNiz18oICt0XQtAR6DCF9ToEeFR/UglsFg3+VRBrDuyhelTEfADZ/Mh AIkxz9k+Imoc7hgevnrvBjI1Uvxg1V/dvTjOB0zmar3k0tNu2kZffExZlBgmJ0OfCL5+2Z6U31b eZ26XHj1hsOrBoGhVU4mpAzE0BR9jiqAoSF3s+/l9wlcSaHlXTY/hQITV20yT0Z1SmDXITgys6+ PryoKxR1/5ZHrS96gU/sDHt+X2CS5mNtoIgNsKA== X-Received: by 2002:a05:600c:3147:b0:481:a662:b3f3 with SMTP id 5b1f17b1804b1-4852671cbebmr51861255e9.7.1772826854483; Fri, 06 Mar 2026 11:54:14 -0800 (PST) X-Received: by 2002:a05:600c:3147:b0:481:a662:b3f3 with SMTP id 5b1f17b1804b1-4852671cbebmr51860805e9.7.1772826853882; Fri, 06 Mar 2026 11:54:13 -0800 (PST) Received: from costa-tp.redhat.com ([2a00:a041:e223:1b00:fe51:8bb:7986:c897]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-485276b75eesm48596485e9.14.2026.03.06.11.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2026 11:54:13 -0800 (PST) From: Costa Shulyupin To: Steven Rostedt , Tomas Glozar , Costa Shulyupin , Crystal Wood , Wander Lairson Costa , John Kacur , Ivan Pravdin , Tiezhu Yang , linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH v4 1/4] tools/rtla: Consolidate nr_cpus usage across all tools Date: Fri, 6 Mar 2026 21:49:49 +0200 Message-ID: <20260306194953.2511960-2-costa.shul@redhat.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260306194953.2511960-1-costa.shul@redhat.com> References: <20260306194953.2511960-1-costa.shul@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" sysconf(_SC_NPROCESSORS_CONF) (via get_nprocs_conf) reflects cpu_possible_mask, which is fixed at boot time, so querying it repeatedly is unnecessary. Replace multiple calls to sysconf(_SC_NPROCESSORS_CONF) with a single global nr_cpus variable initialized once at startup. `#pragma once` in timerlat_u.h is needed for pre-C23 compilers to avoid redefinition errors. Signed-off-by: Costa Shulyupin --- tools/tracing/rtla/src/common.c | 7 +++- tools/tracing/rtla/src/common.h | 2 + tools/tracing/rtla/src/osnoise_hist.c | 3 -- tools/tracing/rtla/src/osnoise_top.c | 7 ---- tools/tracing/rtla/src/timerlat.c | 5 +-- tools/tracing/rtla/src/timerlat_aa.c | 1 - tools/tracing/rtla/src/timerlat_hist.c | 3 -- tools/tracing/rtla/src/timerlat_top.c | 7 ---- tools/tracing/rtla/src/timerlat_u.c | 3 +- tools/tracing/rtla/src/timerlat_u.h | 1 + tools/tracing/rtla/src/utils.c | 10 +---- tools/tracing/rtla/tests/unit/unit_tests.c | 44 ++++++++++------------ 12 files changed, 31 insertions(+), 62 deletions(-) diff --git a/tools/tracing/rtla/src/common.c b/tools/tracing/rtla/src/commo= n.c index f310b0d59ad3..a31fbaea5da6 100644 --- a/tools/tracing/rtla/src/common.c +++ b/tools/tracing/rtla/src/common.c @@ -5,12 +5,14 @@ #include #include #include -#include #include +#include + #include "common.h" =20 struct trace_instance *trace_inst; volatile int stop_tracing; +int nr_cpus; =20 static void stop_trace(int sig) { @@ -165,7 +167,7 @@ common_apply_config(struct osnoise_tool *tool, struct c= ommon_params *params) } =20 if (!params->cpus) { - for (i =3D 0; i < sysconf(_SC_NPROCESSORS_CONF); i++) + for (i =3D 0; i < nr_cpus; i++) CPU_SET(i, ¶ms->monitored_cpus); } =20 @@ -213,6 +215,7 @@ int run_tool(struct tool_ops *ops, int argc, char *argv= []) bool stopped; int retval; =20 + nr_cpus =3D get_nprocs_conf(); params =3D ops->parse_args(argc, argv); if (!params) exit(1); diff --git a/tools/tracing/rtla/src/common.h b/tools/tracing/rtla/src/commo= n.h index d4b3715700be..90a3c0d1dbf3 100644 --- a/tools/tracing/rtla/src/common.h +++ b/tools/tracing/rtla/src/common.h @@ -108,6 +108,8 @@ struct common_params { struct timerlat_u_params user; }; =20 +extern int nr_cpus; + #define for_each_monitored_cpu(cpu, nr_cpus, common) \ for (cpu =3D 0; cpu < nr_cpus; cpu++) \ if (!(common)->cpus || CPU_ISSET(cpu, &(common)->monitored_cpus)) diff --git a/tools/tracing/rtla/src/osnoise_hist.c b/tools/tracing/rtla/src= /osnoise_hist.c index 5c863e7aad28..00b8c95cbf85 100644 --- a/tools/tracing/rtla/src/osnoise_hist.c +++ b/tools/tracing/rtla/src/osnoise_hist.c @@ -646,9 +646,6 @@ static struct osnoise_tool *osnoise_init_hist(struct common_params *params) { struct osnoise_tool *tool; - int nr_cpus; - - nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); =20 tool =3D osnoise_init_tool("osnoise_hist"); if (!tool) diff --git a/tools/tracing/rtla/src/osnoise_top.c b/tools/tracing/rtla/src/= osnoise_top.c index b7aed40fd216..9a6cd9a2470a 100644 --- a/tools/tracing/rtla/src/osnoise_top.c +++ b/tools/tracing/rtla/src/osnoise_top.c @@ -232,12 +232,8 @@ osnoise_print_stats(struct osnoise_tool *top) { struct osnoise_params *params =3D to_osnoise_params(top->params); struct trace_instance *trace =3D &top->trace; - static int nr_cpus =3D -1; int i; =20 - if (nr_cpus =3D=3D -1) - nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); - if (!params->common.quiet) clear_terminal(trace->seq); =20 @@ -494,9 +490,6 @@ osnoise_top_apply_config(struct osnoise_tool *tool) struct osnoise_tool *osnoise_init_top(struct common_params *params) { struct osnoise_tool *tool; - int nr_cpus; - - nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); =20 tool =3D osnoise_init_tool("osnoise_top"); if (!tool) diff --git a/tools/tracing/rtla/src/timerlat.c b/tools/tracing/rtla/src/tim= erlat.c index 9e4daed0aafc..31c921efa7c1 100644 --- a/tools/tracing/rtla/src/timerlat.c +++ b/tools/tracing/rtla/src/timerlat.c @@ -99,7 +99,7 @@ timerlat_apply_config(struct osnoise_tool *tool, struct t= imerlat_params *params) int timerlat_enable(struct osnoise_tool *tool) { struct timerlat_params *params =3D to_timerlat_params(tool->params); - int retval, nr_cpus, i; + int retval, i; =20 if (params->dma_latency >=3D 0) { dma_latency_fd =3D set_cpu_dma_latency(params->dma_latency); @@ -115,8 +115,6 @@ int timerlat_enable(struct osnoise_tool *tool) return -1; } =20 - nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); - for_each_monitored_cpu(i, nr_cpus, ¶ms->common) { if (save_cpu_idle_disable_state(i) < 0) { err_msg("Could not save cpu idle state.\n"); @@ -214,7 +212,6 @@ void timerlat_analyze(struct osnoise_tool *tool, bool s= topped) void timerlat_free(struct osnoise_tool *tool) { struct timerlat_params *params =3D to_timerlat_params(tool->params); - int nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); int i; =20 timerlat_aa_destroy(); diff --git a/tools/tracing/rtla/src/timerlat_aa.c b/tools/tracing/rtla/src/= timerlat_aa.c index 178de60dcef9..095483375823 100644 --- a/tools/tracing/rtla/src/timerlat_aa.c +++ b/tools/tracing/rtla/src/timerlat_aa.c @@ -1043,7 +1043,6 @@ void timerlat_aa_destroy(void) */ int timerlat_aa_init(struct osnoise_tool *tool, int dump_tasks, enum stack= _format stack_format) { - int nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); struct timerlat_aa_context *taa_ctx; int retval; =20 diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/sr= c/timerlat_hist.c index 88211e54bc9d..3ebe41eed9f6 100644 --- a/tools/tracing/rtla/src/timerlat_hist.c +++ b/tools/tracing/rtla/src/timerlat_hist.c @@ -1040,9 +1040,6 @@ static struct osnoise_tool *timerlat_init_hist(struct common_params *params) { struct osnoise_tool *tool; - int nr_cpus; - - nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); =20 tool =3D osnoise_init_tool("timerlat_hist"); if (!tool) diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src= /timerlat_top.c index 7a00f3844f56..4105638f45c4 100644 --- a/tools/tracing/rtla/src/timerlat_top.c +++ b/tools/tracing/rtla/src/timerlat_top.c @@ -442,15 +442,11 @@ timerlat_print_stats(struct osnoise_tool *top) struct timerlat_params *params =3D to_timerlat_params(top->params); struct trace_instance *trace =3D &top->trace; struct timerlat_top_cpu summary; - static int nr_cpus =3D -1; int i; =20 if (params->common.aa_only) return; =20 - if (nr_cpus =3D=3D -1) - nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); - if (!params->common.quiet) clear_terminal(trace->seq); =20 @@ -790,9 +786,6 @@ static struct osnoise_tool *timerlat_init_top(struct common_params *params) { struct osnoise_tool *top; - int nr_cpus; - - nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); =20 top =3D osnoise_init_tool("timerlat_top"); if (!top) diff --git a/tools/tracing/rtla/src/timerlat_u.c b/tools/tracing/rtla/src/t= imerlat_u.c index ce68e39d25fd..a569fe7f93aa 100644 --- a/tools/tracing/rtla/src/timerlat_u.c +++ b/tools/tracing/rtla/src/timerlat_u.c @@ -16,7 +16,7 @@ #include #include =20 -#include "utils.h" +#include "common.h" #include "timerlat_u.h" =20 /* @@ -131,7 +131,6 @@ static int timerlat_u_send_kill(pid_t *procs, int nr_cp= us) */ void *timerlat_u_dispatcher(void *data) { - int nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); struct timerlat_u_params *params =3D data; char proc_name[128]; int procs_count =3D 0; diff --git a/tools/tracing/rtla/src/timerlat_u.h b/tools/tracing/rtla/src/t= imerlat_u.h index 661511908957..a692331bd1c7 100644 --- a/tools/tracing/rtla/src/timerlat_u.h +++ b/tools/tracing/rtla/src/timerlat_u.h @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#pragma once /* * Copyright (C) 2023 Red Hat Inc, Daniel Bristot de Oliveira */ diff --git a/tools/tracing/rtla/src/utils.c b/tools/tracing/rtla/src/utils.c index d979159f6b70..77593718766a 100644 --- a/tools/tracing/rtla/src/utils.c +++ b/tools/tracing/rtla/src/utils.c @@ -19,7 +19,7 @@ #include #include =20 -#include "utils.h" +#include "common.h" =20 #define MAX_MSG_LENGTH 1024 int config_debug; @@ -119,14 +119,11 @@ int parse_cpu_set(char *cpu_list, cpu_set_t *set) { const char *p; int end_cpu; - int nr_cpus; int cpu; int i; =20 CPU_ZERO(set); =20 - nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); - for (p =3D cpu_list; *p; ) { cpu =3D atoi(p); if (cpu < 0 || (!cpu && *p !=3D '0') || cpu >=3D nr_cpus) @@ -577,7 +574,6 @@ int save_cpu_idle_disable_state(unsigned int cpu) unsigned int nr_states; unsigned int state; int disabled; - int nr_cpus; =20 nr_states =3D cpuidle_state_count(cpu); =20 @@ -585,7 +581,6 @@ int save_cpu_idle_disable_state(unsigned int cpu) return 0; =20 if (saved_cpu_idle_disable_state =3D=3D NULL) { - nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); saved_cpu_idle_disable_state =3D calloc(nr_cpus, sizeof(unsigned int *)); if (!saved_cpu_idle_disable_state) return -1; @@ -662,13 +657,10 @@ int restore_cpu_idle_disable_state(unsigned int cpu) void free_cpu_idle_disable_states(void) { int cpu; - int nr_cpus; =20 if (!saved_cpu_idle_disable_state) return; =20 - nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); - for (cpu =3D 0; cpu < nr_cpus; cpu++) { free(saved_cpu_idle_disable_state[cpu]); saved_cpu_idle_disable_state[cpu] =3D NULL; diff --git a/tools/tracing/rtla/tests/unit/unit_tests.c b/tools/tracing/rtl= a/tests/unit/unit_tests.c index aa53f8605e36..f3c6d89e3300 100644 --- a/tools/tracing/rtla/tests/unit/unit_tests.c +++ b/tools/tracing/rtla/tests/unit/unit_tests.c @@ -7,8 +7,10 @@ #include #include #include +#include =20 #include "../../src/utils.h" +int nr_cpus; =20 START_TEST(test_strtoi) { @@ -34,35 +36,29 @@ END_TEST START_TEST(test_parse_cpu_set) { cpu_set_t set; - int nr_cpus =3D sysconf(_SC_NPROCESSORS_CONF); =20 + nr_cpus =3D 8; ck_assert_int_eq(parse_cpu_set("0", &set), 0); ck_assert(CPU_ISSET(0, &set)); ck_assert(!CPU_ISSET(1, &set)); =20 - if (nr_cpus > 2) { - ck_assert_int_eq(parse_cpu_set("0,2", &set), 0); - ck_assert(CPU_ISSET(0, &set)); - ck_assert(CPU_ISSET(2, &set)); - } - - if (nr_cpus > 3) { - ck_assert_int_eq(parse_cpu_set("0-3", &set), 0); - ck_assert(CPU_ISSET(0, &set)); - ck_assert(CPU_ISSET(1, &set)); - ck_assert(CPU_ISSET(2, &set)); - ck_assert(CPU_ISSET(3, &set)); - } - - if (nr_cpus > 5) { - ck_assert_int_eq(parse_cpu_set("1-3,5", &set), 0); - ck_assert(!CPU_ISSET(0, &set)); - ck_assert(CPU_ISSET(1, &set)); - ck_assert(CPU_ISSET(2, &set)); - ck_assert(CPU_ISSET(3, &set)); - ck_assert(!CPU_ISSET(4, &set)); - ck_assert(CPU_ISSET(5, &set)); - } + ck_assert_int_eq(parse_cpu_set("0,2", &set), 0); + ck_assert(CPU_ISSET(0, &set)); + ck_assert(CPU_ISSET(2, &set)); + + ck_assert_int_eq(parse_cpu_set("0-3", &set), 0); + ck_assert(CPU_ISSET(0, &set)); + ck_assert(CPU_ISSET(1, &set)); + ck_assert(CPU_ISSET(2, &set)); + ck_assert(CPU_ISSET(3, &set)); + + ck_assert_int_eq(parse_cpu_set("1-3,5", &set), 0); + ck_assert(!CPU_ISSET(0, &set)); + ck_assert(CPU_ISSET(1, &set)); + ck_assert(CPU_ISSET(2, &set)); + ck_assert(CPU_ISSET(3, &set)); + ck_assert(!CPU_ISSET(4, &set)); + ck_assert(CPU_ISSET(5, &set)); =20 ck_assert_int_eq(parse_cpu_set("-1", &set), 1); ck_assert_int_eq(parse_cpu_set("abc", &set), 1); --=20 2.53.0