Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp415002pxb; Mon, 25 Oct 2021 10:44:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEAndf3WRN9gkGrSSmZ3ctuhwUDFYeAm9YtIBLjKke9vUmRO2eJY+yO7gltJDYWo9OIsbA X-Received: by 2002:a50:8710:: with SMTP id i16mr19858953edb.36.1635183854607; Mon, 25 Oct 2021 10:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635183854; cv=none; d=google.com; s=arc-20160816; b=nxZWIad5lKsQ4Ks1d4JtDi0VcRbBCNQLomyhl6yHzm54imH4IFF4PRdLTSg9D0fO98 MNOrBgaFYo0v3/762oW+ZqK4a8aPcUkhBgjpo5QJUBhMtfOBXzHBMLop4UeCeqwwqzHq ndmEYYyZiWn315sPhGAO1TRliQ7+5EGmgJWFE23PnCKHnU6UfNtIijasWd8UmTRdWJLO 5fHNWBzlN6jjDxtc4VhAHwwtjvFH8e8LozxuUDaEMtgIGff01jPeKMKxy0xPFI5q1i1A Vfv09KzdAbRlJwj6mc8ps6ULLw5hMTXT7ju7GF2ItgVESOCRfuK4fH9w8JUZEn/RQ4a+ VaIA== 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=FjvvGecGP5Pjm8QBnuvTOFX/Z/yK+DJwBzo1Qg3JIjo=; b=aPYOdg8ElOsU4i+RdRgEoN0m4B5wayGQUqmVW7H9MwwUwfNN6EVgCwthm/NFbwk92S XFkJhG4yzuR2iKQV5OOAgdeRpveXUSiLUmBLTM88UNsCpmfNaDgjsR7e7vuVPJcOx+50 RyNhivaZL1YvJvmKdfNvMhszLtNc62z5GBgteFWseUT+YGTMRJEJRrMN0jwZ1l31eR4+ ZNn+XnWLdITB00A98ISKNMmvQJ71n54Mi1PbQUbOw2YUxODlkLoK02mFCgc9p967fcJo QBQ5MCPCb3bes1PAFhBiM/tGE4NT/JdeYOC0GNDXo2qrBtEiHtTzQeSRFxhXS3CH7Ngb mIUA== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o2si23140995ejd.219.2021.10.25.10.43.41; Mon, 25 Oct 2021 10:44:14 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234102AbhJYRno convert rfc822-to-8bit (ORCPT + 99 others); Mon, 25 Oct 2021 13:43:44 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:53521 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234101AbhJYRnk (ORCPT ); Mon, 25 Oct 2021 13:43:40 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-594-RaSjjN-gMOuXjorm32phLg-1; Mon, 25 Oct 2021 13:41:14 -0400 X-MC-Unique: RaSjjN-gMOuXjorm32phLg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5333A802682; Mon, 25 Oct 2021 17:41:13 +0000 (UTC) Received: from x1.com (unknown [10.22.9.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 573F75C1A1; Mon, 25 Oct 2021 17:41:04 +0000 (UTC) From: Daniel Bristot de Oliveira To: Steven Rostedt Cc: Daniel Bristot de Oliveira , Ingo Molnar , Tom Zanussi , Masami Hiramatsu , Juri Lelli , Clark Williams , John Kacur , Peter Zijlstra , Thomas Gleixner , Sebastian Andrzej Siewior , linux-rt-users@vger.kernel.org, linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V5 04/20] trace/osnoise: Use start/stop_per_cpu_kthreads() on osnoise_cpus_write() Date: Mon, 25 Oct 2021 19:40:29 +0200 Message-Id: <2b4ea45b1802844cffd98b6a208b22bc4664c795.1635181938.git.bristot@kernel.org> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=bristot@kernel.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=WINDOWS-1252 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When writing a new CPU mask via osnoise/cpus, if the tracer is running, the workload is restarted to follow the new cpumask. The restart is currently done using osnoise_workload_start/stop(), which disables the workload *and* the instrumentation. However, disabling the instrumentation is not necessary. Calling start/stop_per_cpu_kthreads() is enough to apply the new osnoise/cpus config. No functional change. Cc: Steven Rostedt Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira --- kernel/trace/trace_osnoise.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c index 4381a06af916..7453b96c548b 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -1677,9 +1677,6 @@ osnoise_cpus_read(struct file *filp, char __user *ubuf, size_t count, return count; } -static int osnoise_workload_start(void); -static void osnoise_workload_stop(void); - /* * osnoise_cpus_write - Write function for "cpus" entry * @filp: The active open file structure @@ -1724,7 +1721,7 @@ osnoise_cpus_write(struct file *filp, const char __user *ubuf, size_t count, mutex_lock(&trace_types_lock); running = osnoise_busy; if (running) - osnoise_workload_stop(); + stop_per_cpu_kthreads(); mutex_lock(&interface_lock); /* @@ -1738,7 +1735,7 @@ osnoise_cpus_write(struct file *filp, const char __user *ubuf, size_t count, mutex_unlock(&interface_lock); if (running) - osnoise_workload_start(); + start_per_cpu_kthreads(); mutex_unlock(&trace_types_lock); free_cpumask_var(osnoise_cpumask_new); -- 2.31.1