Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1474241pxb; Tue, 26 Oct 2021 09:38:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVw4q9kNIkVu1R5xSjvkohtzW2pW9cSo1t+WaTg/WUsLASJBBb6dQsvW/l66DC0ZH1U452 X-Received: by 2002:a17:907:96a3:: with SMTP id hd35mr31962862ejc.222.1635266301615; Tue, 26 Oct 2021 09:38:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635266301; cv=none; d=google.com; s=arc-20160816; b=NSuBr8ekmZEKuqmJWcMUwjRHQGxJ5oN+EsM2AxWd0nz9gsMEJnVdLAe5mCcg5/n2oU b6X5rza/4XVJWbghn6jqqVKmSfkQWJz7NZAedP8b1LMdJ8f+zVBxWoyprrxTBDTV+3qR VcN0tz0bmoTcHVF0XSjsUGUQ/wzlyMRTx8R8OwLMD2O+U4AX/OfqAxYxjvupZeHS2Xbs avOiMoNGKTkMUT0PJwKXaKtDBFAcYdJY0Xd0DmK1DXtlIVE2i1pwZbTd2rT0CQj+OBQ6 4Md5nhzH4VIYf2Ki13C0HO1eY/vjfj5cwKhDKiufsYpeQbObyFz3ZKGqkqz8boRWbOTw bRjg== 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:subject:cc:to:from:date; bh=r7tNlwJhqkZqslEJ45Mb3e5NT1iNGoDtLHpdOagTANE=; b=mhlmn6zn2ZafVQEiDB3z1qtGUdrYtYiKqDly4m5fm4NXQU5nUA0V1jK3ARUMOlUKMd dybkydgSfFm9bqNh0/7VPlM3UXhqGDgiOFOZb2jpg9Vvw7nrT8hX+0wzPrZgqSbkjLWV mUW8shJWUe2JoqDz0yMr9DpjmYRnJXY7h2U7Ibj+eSxkI3qXblNGVrj5hE1tIhGoba2W 70ldxjAjk9UMloTZTu6oaKXaoTddM7dB4JBhc3V6iiKo+GYuJn0XfvVt11vEd71gpf8f RZ2X0LPLo18R7KwgNZ13RYXA8+z1hcZTyW1kfCC2nf7G/XCpsO+hYRG4neGxX133uLHc XAEw== 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 y17si6228569eda.575.2021.10.26.09.37.54; Tue, 26 Oct 2021 09:38:21 -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 S236114AbhJZNFH (ORCPT + 99 others); Tue, 26 Oct 2021 09:05:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:55098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230324AbhJZNFH (ORCPT ); Tue, 26 Oct 2021 09:05:07 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1100860E74; Tue, 26 Oct 2021 13:02:41 +0000 (UTC) Date: Tue, 26 Oct 2021 09:02:39 -0400 From: Steven Rostedt To: Daniel Bristot de Oliveira Cc: 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: Re: [PATCH V5 06/20] trace/osnoise: Allow multiple instances of the same tracer Message-ID: <20211026090239.5ca7d350@gandalf.local.home> In-Reply-To: References: <69cbbd98cce2515c84127c8827d733dc87b04823.1635181938.git.bristot@kernel.org> <20211025220856.7fef7581@rorschach.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 26 Oct 2021 10:38:27 +0200 Daniel Bristot de Oliveira wrote: > >> * osnoise_register_instance - register a new trace instance > >> * > >> @@ -2048,6 +2066,16 @@ static int osnoise_workload_start(void) > >> { > >> int retval; > >> > >> + /* > >> + * Instances need to be registered after calling workload > >> + * start. Hence, if there is already an instance, the > >> + * workload was already registered. Otherwise, this > >> + * code is on the way to register the first instance, > >> + * and the workload will start. > >> + */ > >> + if (osnoise_has_registered_instances()) > >> + return 0; > > > > Looking at how this is checked before being called, it really should > > return -1, as it is an error if this is called with instances active. > > Hum.... maybe my explanation is not good enough. It is not a problem if it is > called with active instances. It would be an error if the same instance was > already registered at this point, but that was checked before. Here it is > checking for other instances that should have enabled the workload. > > Does updating the comment with the one below helps? No need. > >> @@ -2096,7 +2131,11 @@ static void osnoise_tracer_start(struct trace_array *tr) > >> { > >> int retval; > >> > >> - if (osnoise_has_registered_instances()) > >> + /* > >> + * If the instance is already registered, there is no need to > >> + * register it again. > >> + */ > >> + if (osnoise_instance_registered(tr)) My eyes missed that you removed the osnoise_has_registered_instances() for the osnoise_instance_registered(tr), and thought you were doing the same test twice. My mistake. I need to not review patches at the end of the day when I'm ready to go to sleep. -- Steve