Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3185555pxb; Mon, 18 Oct 2021 09:50:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwq4yINSTkY1QPyLe2OXJEEMwseE+noyeGlKZa5ytUziEY6ovsV48SDy/30h9GrbU7D+TM X-Received: by 2002:a62:30c7:0:b0:44c:1ec3:bc31 with SMTP id w190-20020a6230c7000000b0044c1ec3bc31mr30133179pfw.21.1634575833449; Mon, 18 Oct 2021 09:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634575833; cv=none; d=google.com; s=arc-20160816; b=IUvwQds+jtZwdd7VpAWCP2Hez0olYUDl5DNl77l3cc9dN3jv9lvK3Cwqb0raMN7z4D BTvRj+hRNcXbgrzhIeFJqEHuaFhydkiF4VBr0p9S7zrm2/epjg6QaTML7FDwQuicNdC6 WrgSG9BJmX2sQ/DwafopCFSTkbsqt/iFiHDXeSRWD9r38ci5qCUqqljqZzeqawFVJ6Gy facFcvgaGqGk1jOmD7OnUNYcXWE2HTdth9qIlnlJNV3rnvJ/Fh1lm94hibTO5etPS9+1 /auHN2ShhDbrGZCFKMua6ut7odxLVFA9fOVsCYWepXzaoCGL3lWUnnhJ+VDu+0rVJaVe qcGA== 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=qFFX+JZ8ZKTqnuJ1g4g3vKJ2Kmi74PT8g19a6fVpElE=; b=iSFAdn9XohkqgenwLPSvlk5H4cVV9szCFQ4b3bTK00T3E7FfNeJL/46MKYLWlgtZxQ jVoHj+V3QmIwr99bpWtXzBYf5klV78E3WWa7lVvc7sfyvIxucNmt30YtjBT1jafntRCz hpXZ2rKZWSp5wo82R68VJICSc+W9MQlghTJCKvXBAV2vp4NX3fSZ9kdk2zhfoEgaJNhp 2YKJKpuCBFk6YzLCpZCSd4jNXV6rCzH63Nmp33771e2W/Rbo4RYF5ims7+scIvGMsUxi HvKt70UDXbafIuZxE06be5xTtujyFGvIxzDEMXcKXHX5JxCuR0PoiT9VetwoNRszeYnR X5Ww== 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 s11si8114769plg.279.2021.10.18.09.50.20; Mon, 18 Oct 2021 09:50:33 -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 S233800AbhJRQvU convert rfc822-to-8bit (ORCPT + 99 others); Mon, 18 Oct 2021 12:51:20 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:57221 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233777AbhJRQvN (ORCPT ); Mon, 18 Oct 2021 12:51:13 -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-316-UU5z9B0iM1GK1ePJvz38qQ-1; Mon, 18 Oct 2021 12:48:58 -0400 X-MC-Unique: UU5z9B0iM1GK1ePJvz38qQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57EAC18125C5; Mon, 18 Oct 2021 16:48:57 +0000 (UTC) Received: from x1.com (unknown [10.22.18.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49DB210016F4; Mon, 18 Oct 2021 16:48:54 +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 V3 03/19] trace/osnoise: Use start/stop_per_cpu_kthreads() on osnoise_cpus_write() Date: Mon, 18 Oct 2021 18:48:16 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 0a04a9a4c85a..9b9e6bc889e9 100644 --- a/kernel/trace/trace_osnoise.c +++ b/kernel/trace/trace_osnoise.c @@ -1678,9 +1678,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 @@ -1725,7 +1722,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); /* @@ -1739,7 +1736,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