Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2369832pxt; Sun, 8 Aug 2021 21:35:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+qi0YEd6FDJLXNRWGAPFU7kcpJAkOH08oVp+xpdYApiDzFwCo3Vj+WiMLJOdyBAFAMJXM X-Received: by 2002:a05:6402:386:: with SMTP id o6mr27537506edv.294.1628483712962; Sun, 08 Aug 2021 21:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628483712; cv=none; d=google.com; s=arc-20160816; b=czzcdcAKrt7MXNRSe4TQJpOU/SkJ5Jh0bsbJ/h1PanpJnXQRFmk252PCcAaXkLYpPC uCtLHNl/3rqCVj2cOPTvAMpO6uDB05g2ENzjcCnAVW5VLBAM+JZ/647RbN10MFJJ493X zUpSByYRKyDIyPFV8gj1wHC+DR4iYhs0ejLOWml8jL5DKqNK3GdRBgg/k9EsCfjuMTCg 0U4KsP/Y8hjeDQRCTit4YEcfdS3jNJIuIOp4Y3OCSqLdlmhx0GtuSGkx1oJFxfNP3GXQ zhKahAN91ss4lR2vU3qBwsfhXCgFwpICDVXRKeoXPVDgZR5M2mMgQIawxeUDVdT3X4ZL EcLg== 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=D52DT8U7r4pPPo1vVa0/udE9CtzYd1BeXmMtDrw9Rt0=; b=rBYT0eUQXQ0qPg6W+FBXTZFiKZ7JOMS8f5kY4zk/vjC3t0b7xqaoTHe52ZAsnqjDiO kefXlYEnIJJLuHqeOGTjAZ4tNnGabrsbe4fGHCf8Mn58zZLlLBVjr+Q6OPD7f8JUuXOC 1u1pyzS32DLFwgUijD9INYr2lRNv4vCxQnxeYHqAlxfzYB5P0YQnGUwibYmob1wxehbo huOBkP3YOLasUnlV8gDxhJSyV6hjB2+1xfUW6EEiLOXxLTrRckA7fU0NzrYVOvYugm3G YNv2WHD86NW1yEIv1JFDIWYB2P0/fxgScVRpVICPZebmOUfN8p4kuYXQrXEe2Q43cKTU ZmjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r11si2054723edd.67.2021.08.08.21.34.50; Sun, 08 Aug 2021 21:35:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232952AbhHIEdm (ORCPT + 99 others); Mon, 9 Aug 2021 00:33:42 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:60830 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232898AbhHIEdh (ORCPT ); Mon, 9 Aug 2021 00:33:37 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 15BDB1FD84; Mon, 9 Aug 2021 04:33:17 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4E2D713398; Mon, 9 Aug 2021 04:33:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +O30BguwEGEfDQAAMHmgww (envelope-from ); Mon, 09 Aug 2021 04:33:15 +0000 From: Davidlohr Bueso To: acme@kernel.org Cc: mingo@redhat.com, peterz@infradead.org, tglx@linutronix.de, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, dave@stgolabs.net, Davidlohr Bueso Subject: [PATCH 3/7] perf/bench-futex: Factor out futex_flag Date: Sun, 8 Aug 2021 21:32:57 -0700 Message-Id: <20210809043301.66002-4-dave@stgolabs.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210809043301.66002-1-dave@stgolabs.net> References: <20210809043301.66002-1-dave@stgolabs.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is common across all tests, move it into futex.h. Signed-off-by: Davidlohr Bueso --- tools/perf/bench/futex-hash.c | 1 - tools/perf/bench/futex-lock-pi.c | 1 - tools/perf/bench/futex-requeue.c | 1 - tools/perf/bench/futex-wake-parallel.c | 1 - tools/perf/bench/futex-wake.c | 1 - tools/perf/bench/futex.h | 3 +++ 6 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c index ddca7558e559..b71a34204b79 100644 --- a/tools/perf/bench/futex-hash.c +++ b/tools/perf/bench/futex-hash.c @@ -30,7 +30,6 @@ #include static bool done = false; -static int futex_flag = 0; struct timeval bench__start, bench__end, bench__runtime; static pthread_mutex_t thread_lock; diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c index ce980df23bb0..bc208edf3de3 100644 --- a/tools/perf/bench/futex-lock-pi.c +++ b/tools/perf/bench/futex-lock-pi.c @@ -32,7 +32,6 @@ struct worker { static u_int32_t global_futex = 0; static struct worker *worker; static bool done = false; -static int futex_flag = 0; static pthread_mutex_t thread_lock; static unsigned int threads_starting; static struct stats throughput_stats; diff --git a/tools/perf/bench/futex-requeue.c b/tools/perf/bench/futex-requeue.c index 66747bfe22cf..4001312122be 100644 --- a/tools/perf/bench/futex-requeue.c +++ b/tools/perf/bench/futex-requeue.c @@ -36,7 +36,6 @@ static pthread_mutex_t thread_lock; static pthread_cond_t thread_parent, thread_worker; static struct stats requeuetime_stats, requeued_stats; static unsigned int threads_starting; -static int futex_flag = 0; static struct bench_futex_parameters params = { /* diff --git a/tools/perf/bench/futex-wake-parallel.c b/tools/perf/bench/futex-wake-parallel.c index 958372ad159c..ea4fdea6e2f3 100644 --- a/tools/perf/bench/futex-wake-parallel.c +++ b/tools/perf/bench/futex-wake-parallel.c @@ -53,7 +53,6 @@ static pthread_cond_t thread_parent, thread_worker; static pthread_barrier_t barrier; static struct stats waketime_stats, wakeup_stats; static unsigned int threads_starting; -static int futex_flag = 0; static struct bench_futex_parameters params; diff --git a/tools/perf/bench/futex-wake.c b/tools/perf/bench/futex-wake.c index 9ed4d65416f3..1cf651c8ee5c 100644 --- a/tools/perf/bench/futex-wake.c +++ b/tools/perf/bench/futex-wake.c @@ -37,7 +37,6 @@ static pthread_mutex_t thread_lock; static pthread_cond_t thread_parent, thread_worker; static struct stats waketime_stats, wakeup_stats; static unsigned int threads_starting; -static int futex_flag = 0; static struct bench_futex_parameters params = { /* diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h index 6f8b85b67348..f7cd22bbd677 100644 --- a/tools/perf/bench/futex.h +++ b/tools/perf/bench/futex.h @@ -13,6 +13,9 @@ #include #include +/* FUTEX_PRIVATE_FLAG or zero */ +static int futex_flag = 0; + struct bench_futex_parameters { bool silent; bool fshared; -- 2.26.2