Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1088808pxb; Thu, 4 Feb 2021 05:01:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwk99R55VrhRAIiC/0AL8bLWF3dZPgB6EmMgnQ0zdfNFf8QVsZr/MenNpgKQT7vMai/APA X-Received: by 2002:a05:6402:1bc7:: with SMTP id ch7mr8019406edb.124.1612443674962; Thu, 04 Feb 2021 05:01:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612443674; cv=none; d=google.com; s=arc-20160816; b=dPL8gQGiFnG1bbi3kOgfQxiZHX6YcmHg6Ngs+CKSXpqXAxpGiRwbD37j0KsZODC5Nt R0Rlh60P1V/4zmEAzhKQJwx78y5ncIvyVa1utLHKJylBDohIHOzEyEnU0Vwjby2I940N Jr7Bv+iaSN58Tm7g9eZVyOZpLAzyTbhMcU+t3Wbyz1Otso2dQ9qgyKpii4EHS6Z+GXeh hbcLsPm4Ih0ws4UHQrir3K2HtiPRrDuiMkvypBzg2R/Z0OWAWh3CEbQqjUZayYXG/zCj RwGHmw3NZIaSQ0vo0Lut/A00j0MxTZbEWw/4YE/7QkFdZHvhsLHckUyDDQVmFVBN1XS8 bbFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fnaOnFlJJoi070MtLnQMAkpFT/NGDEwA+QrU8zXXsnI=; b=aw1kEIzW16bIgv+IXeF6t6Kv/kONfG03w6B69QKCufJdDo5uDJjRfq6Iod94gQSn2f 2P0eQbM9cN1ebm59g92IvhTNdF72we36Kn3YrsUqf9LzlOkHvg5CadTB2ho9ahfWbzsr TPqgiqD9MxEu9dJmYarjQB5CMELDPHiesmwmbVTOIuzS7PFCohOnDejQ/rr0Ngmantb9 PIndNXa86jCVh0+8mcjIzJQiyPP1wIrnla4ixiIGxPZHWGSNCzypSWjFYMO7K7vn0cjx 9j7cj7E89ea5LdkJgVi/O0wLt3CfadA2kQyG8B7C9TavqBq6KJFEKfNq4cSWoYO2qY4P GsKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YVyqCoyb; 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 c1si3330545edt.150.2021.02.04.05.00.48; Thu, 04 Feb 2021 05:01:14 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YVyqCoyb; 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 S236203AbhBDM7F (ORCPT + 99 others); Thu, 4 Feb 2021 07:59:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:59512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236199AbhBDM7D (ORCPT ); Thu, 4 Feb 2021 07:59:03 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A656364E34; Thu, 4 Feb 2021 12:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612443502; bh=5owyyqCeecObLZ9wP00L9AytPREc090DMKKlghFC8JM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YVyqCoybEIZlYacBScQQHbQoffv2WMOHey0NKsjgIwuVSUu+OQ89QPWZQNVVhdE3M OJcklxaLlNwNMf+79sjJlNa9dJjiz0d4YqXiq0TZMVNWe9ITAFPqlAvkCh0P4wX/TK MP8q9cx6r04SGNOUhys4+Wkuz8x4+P2i1rrizlR8gvJjqJvfOun4kvQs/G6H6c81fu OrTwL8GoB1wO4ZNLsu6Vgj53tn3tM1fnQD2QwyG8iN0DQFV4bRyV/UqMgxcziSpHRS 9id/EB6qywvEKPx1uPAhTA7D3ExAGDEvl01SRcdjbX/O2dG5vWarEeoie8m37jXBwP U6sdPxd+liIAQ== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 5450140513; Thu, 4 Feb 2021 09:58:19 -0300 (-03) Date: Thu, 4 Feb 2021 09:58:19 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Jiri Olsa , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Michael Petlan , Ian Rogers , Stephane Eranian , Alexei Budankov Subject: Re: [PATCH 06/24] perf daemon: Add config file support Message-ID: <20210204125819.GA910119@kernel.org> References: <20210129134855.195810-1-jolsa@redhat.com> <20210130234856.271282-1-jolsa@kernel.org> <20210130234856.271282-7-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Feb 04, 2021 at 09:42:35PM +0900, Namhyung Kim escreveu: > Hi Jiri, > > On Sun, Jan 31, 2021 at 8:49 AM Jiri Olsa wrote: > [SNIP] > > +#define SESSION_OUTPUT "output" > > + > > +/* > > + * Session states: > > + * > > + * OK - session is up and running > > + * RECONFIG - session is pending for reconfiguration, > > + * new values are already loaded in session object > > + * KILL - session is pending to be killed > > + * > > + * Session object life and its state is maintained by > > + * following functions: > > + * > > + * setup_server_config > > + * - reads config file and setup session objects > > + * with following states: > > + * > > + * OK - no change needed > > + * RECONFIG - session needs to be changed > > + * (run variable changed) > > + * KILL - session needs to be killed > > + * (session is no longer in config file) > > + * > > + * daemon__reconfig > > + * - scans session objects and does following actions > > + * for states: > > + * > > + * OK - skip > > + * RECONFIG - session is killed and re-run with new config > > + * KILL - session is killed > > + * > > + * - all sessions have OK state on the function exit > > + */ > > +enum session_state { > > + SESSION_STATE__OK, > > + SESSION_STATE__RECONFIG, > > + SESSION_STATE__KILL, > > +}; > > + > > +struct session { > > + char *base; > > + char *name; > > + char *run; > > + int pid; > > + struct list_head list; > > + enum session_state state; > > +}; > > Although I think calling it 'session' is intuitive, it's also confusing > as we already have struct perf_session... Maybe 'struct server_session' ? If this ends up in tools/lib/perf, then it gets renamed to 'struct perf_server_session', just like we have 'struct perf_evsel' in libperf and 'struct evsel' in tools/perf/, right? - Arnaldo