Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp372505pxb; Wed, 27 Oct 2021 04:41:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWBhNv1ogJfGpkVSNr0YlH/DWCeApGDXoKyA5Uq/bsq0HkQqRCH1lcVpvh32pp9lxpajXk X-Received: by 2002:a05:6a00:180e:b0:47c:21fa:536 with SMTP id y14-20020a056a00180e00b0047c21fa0536mr5486347pfa.6.1635334912187; Wed, 27 Oct 2021 04:41:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635334912; cv=none; d=google.com; s=arc-20160816; b=PJDNi2w+kqwWJ0UN+fDm7w74p0QPI6oMXvfU/wV+uiRC9cPMF4sjk1Xvsi1aTlZERd 1V/pzMgJNO3bYjghGkTna/nZdP+CzW7NVXz4MNYctZDO89a8QIoBeZgPcgYEhvNh8c0W I2B1sfFie4ahwHpsNAHFEjirhgotqfjOX40LBUQ9WQMwAwFbRu4wXO/OIQL5xNBGAWIP DiCF64uICPPCtCLZcG0a0Ile7FdzTZmMnrf1S6/kC03IT3118r80IVfk02KQP6wCA8xG U5gvHrB1oMhXRGXk0k8yGrOv+9Qlb7vlvmC9sgV9uXaCqr7saEOzPAjkFvoHKNNKsFNm 1dgg== 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=bM3IZjnMuznqNf9FoqZWYBkVXzO+U72szY0IC6CkSksV6wuoVBqXbenCMpFpy11JDu I1yug4D+Y/j5ExUVJHkKWDyz5cn0qjRlGVKv68fAPZFMwolgcUdd6L2TdoLFvJ46MtW2 sY5yElxP3zByPZ4ZDcO6kmkVRPoPG1/lWD2jROlvAHnk0ku7QSc3nvx/NI6uvRM9cBv5 YXTtPb2xTb2DdXH/Ig+uyBmypYXKm3sFdFxwtiXqIMsSfR+7K/wfH0YmAbki6C1nFqsc Opsn0Xu7up5WWbZkW/zBK47hplRlhfFhySDBav+1LN5aGRBjyO0LgTxQbj5abMKNIX1X Td1w== 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 e8si3048492plh.120.2021.10.27.04.41.35; Wed, 27 Oct 2021 04:41:52 -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 S239740AbhJZWKb convert rfc822-to-8bit (ORCPT + 99 others); Tue, 26 Oct 2021 18:10:31 -0400 Received: from us-smtp-delivery-44.mimecast.com ([207.211.30.44]:42674 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237407AbhJZWK2 (ORCPT ); Tue, 26 Oct 2021 18:10:28 -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-97-R0QxaRbkM3KzzXqAIRtX7A-1; Tue, 26 Oct 2021 18:08:02 -0400 X-MC-Unique: R0QxaRbkM3KzzXqAIRtX7A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EC7CB8030A0; Tue, 26 Oct 2021 22:08:00 +0000 (UTC) Received: from x1.com (unknown [10.22.32.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id BCFE95FCCE; Tue, 26 Oct 2021 22:07:56 +0000 (UTC) From: Daniel Bristot de Oliveira To: Steven Rostedt Cc: Tao Zhou , 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 V6 04/20] trace/osnoise: Use start/stop_per_cpu_kthreads() on osnoise_cpus_write() Date: Wed, 27 Oct 2021 00:06:15 +0200 Message-Id: <2b4ea45b1802844cffd98b6a208b22bc4664c795.1635284863.git.bristot@kernel.org> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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