Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1539313pxb; Thu, 4 Feb 2021 16:08:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBvQdZyafZNg5qAkvBk80l0VJBJ3tEYiIoIb8fkFOlxr3aa5BKsv4H77tPHMXuLjaCDAUi X-Received: by 2002:a17:906:4c90:: with SMTP id q16mr1535015eju.49.1612483734231; Thu, 04 Feb 2021 16:08:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612483734; cv=none; d=google.com; s=arc-20160816; b=y0l1TIRmYNc0LKVRdzo0KRq+xph28YCIwGgVm/abtyxnHpqd4BJJjVnXjHfZl3Ihar 6xxoMSCzuXLSAcqopQckzHuDS0E7zj2fvEojYwvJArTuteEQgX9EPea3e8G0kgYKlkqz iOHBHs479ZrzC+UhsE/TgJlMyKDqE5JymhLdemaO91DYns5OKEOQOO5XaWlhDaY6RJYJ B8x2yvff95wcvVkv0nUvrpUBzyE6oIDxpg/hUL9aDLr8sCCS9DYT2edtkPFVxGrQGQ8n aCvWm7SHCoroqK3ND2amAY57SEZIM14SyoTctH4tJf6ZTKfzkzYsKIsFuOabMmA+s/Hu 96Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=sODDqAnRPzoRbI6urxCuqdKcXMisa+IJ5crknCSi0mE=; b=csLQWfZBCcKzDKY4OVQ5ra0FPO0u7VadKnt5v6jpUN8/hoK/uzohGOcytE0DNLLbwX n3J+RRnCwnboE1xx8LlxyIipZm69I2Bl2SrNtKkhte3P1VTwAMm8MCyhy931awl9h4qm H6/oeR3haQ2/QdPjVKvl2UCRHJDlLb2Y4YEh+Rnwq5Ee4srji2sra05XnAOv58FToG19 mqmjs7kvJJhXYiJ0SCtx6btTgCI9eYPMdW3Ro4T8lYkq+ruEEvgiANKGNAafxQfQ1UWM xvSGruFTtUfIH5TPKoVPZKf3AD46qlim3Vs4k8qLxToEJ0OuExFnLD4ALRTCr+hERDRO 6ROg== 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 l14si4435637edb.407.2021.02.04.16.08.30; Thu, 04 Feb 2021 16:08:54 -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; 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 S235965AbhBDMna (ORCPT + 99 others); Thu, 4 Feb 2021 07:43:30 -0500 Received: from mail-lf1-f45.google.com ([209.85.167.45]:45794 "EHLO mail-lf1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235605AbhBDMn3 (ORCPT ); Thu, 4 Feb 2021 07:43:29 -0500 Received: by mail-lf1-f45.google.com with SMTP id q12so4228995lfo.12 for ; Thu, 04 Feb 2021 04:43:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sODDqAnRPzoRbI6urxCuqdKcXMisa+IJ5crknCSi0mE=; b=W/rmKlOwAeDt2u9B/UwWK2j9+NkLPZMFDHR6NpwUZ4+Se3Ic+TLrUxZN5JqXrCfXQj 6UkA37sq1dCRCVU4+138d/KotmqOe2V7Nv5tRzamB3bnwze05mLWXNBqN4bN7TlxoIpa 67ewh2I3c3dWjg/1sQboGTSAVb5L4rNA/jMa1GKSvam0ke9KConJKO+Mqp4qWNN/mi8f 3JV0cYjvcv6/WNH4xBf3zvWqc4nlq08mKcq7oyLKjohiOqBr9Roq5kSaw3Z1KU47C7Se K03/8UZcj3QmYTzTL4a8m9s7jN0vWJXjooDqK8ulr1kXwTZS7RYOjuPJdpITGD3xVYWo Dzdw== X-Gm-Message-State: AOAM5316dMUtyJVk4xDh317bqHkADmXUug9aDQ2xYrxXxqjqSbCLZnpk xRyl+nbG0Dwbfgafa6wFaVDPCIZoFMzPFj8Hx5s= X-Received: by 2002:a19:5c6:: with SMTP id 189mr4443766lff.300.1612442567024; Thu, 04 Feb 2021 04:42:47 -0800 (PST) MIME-Version: 1.0 References: <20210129134855.195810-1-jolsa@redhat.com> <20210130234856.271282-1-jolsa@kernel.org> <20210130234856.271282-7-jolsa@kernel.org> In-Reply-To: <20210130234856.271282-7-jolsa@kernel.org> From: Namhyung Kim Date: Thu, 4 Feb 2021 21:42:35 +0900 Message-ID: Subject: Re: [PATCH 06/24] perf daemon: Add config file support To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Michael Petlan , Ian Rogers , Stephane Eranian , Alexei Budankov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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... Thanks, Namhyung