Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2556674pxb; Sat, 6 Feb 2021 00:11:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPRh7w8GuTPtIt75Sypu3n8po50TdaJF/Z3vchFR9b7f62SMpKxuNP5nWFUXVVoRO5zKXd X-Received: by 2002:a50:bc15:: with SMTP id j21mr7348930edh.187.1612599079774; Sat, 06 Feb 2021 00:11:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612599079; cv=none; d=google.com; s=arc-20160816; b=sfoWG//r9mQAb80IZfw5643foXZtfLeahRocbdvsQFglpekkBNAxbdnSdIdgKmAwm8 6NAH78AEh83Pt3YWk2onvGqWewYY3kwLrUBVRzQ+gmmqvCIvxCUZnS5gEp0vMQ6TEL/Z g++GIuQlSj43jFtiS7DMxqsoXGWGcGvrAflAU8VGZfKFfXzbh8ToSZ4e5MY8bHHZdXdG guKkyjYpVaX6WsIxfxQfAN3v50VbtphOSaIVaDxU3AxUgZljoV22suXg4Hr/osdnEcxH S6onmYyxq9fdySzJoi19ZZMbzQMbHQXs41dQxgH4vcx4+f668q2jOhdJmfX8Ty/tjCMf 0qeA== 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=A9yOc7rfBWs1DmuQ0L3Wb5z5dxZA/cnES2iTyyBl0jU=; b=ic5vwvvtuLqzQId+RQF8tcmuKJTDdOgMZV7WBfu80CrxW488IEuyJE3ESjNGyn02ie Ae1y3Zx4K4FOH2eLciFqNF5j/rO10xRGiQJP6DlczjLux/TTJAAK7vehrQV2XDf/JJ6m chY1fyUWpKxIxGIOMt1i1xmgLq4ffC4L/47W/NIaU97sWISeAzOy03+uypQzntEYgSmJ fSghgcLzq6PgGpyoX6mFbkChpZtPfdF97mnBtzTpj9+tmVA7Dfb0EVLHMFv6fIneUV3e 9BSBzMy/Cd35/GV2FyEosRgRjGOfkaUswie1x7z3DmuyjqOsMm4REDe8wT8+MhfzlMi8 i3vw== 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 hr22si6988109ejc.388.2021.02.06.00.10.53; Sat, 06 Feb 2021 00:11:19 -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 S229548AbhBFIHv (ORCPT + 99 others); Sat, 6 Feb 2021 03:07:51 -0500 Received: from mail-lf1-f41.google.com ([209.85.167.41]:37776 "EHLO mail-lf1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbhBFIHr (ORCPT ); Sat, 6 Feb 2021 03:07:47 -0500 Received: by mail-lf1-f41.google.com with SMTP id w36so262148lfu.4 for ; Sat, 06 Feb 2021 00:07:31 -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=A9yOc7rfBWs1DmuQ0L3Wb5z5dxZA/cnES2iTyyBl0jU=; b=JLLLiNVrZS805FREyG5movqdhulzseXnZf2P8rx9YXkYwO34NfVqBgx09UguO9ij/g xXt7HSPJCXnrcjsZvrlSz4ZXjfuCkY18+RNGtvb8I59VzypAev9m/PubSc68S0XNqsgK aS/aaooumyfKMx8ejk+Omto3O1pDeIZznMEdNHI/Ab7r34pOexzjqNyV6Iy7nShR5b4o u8Wrph3mnoixpkBnf9XwzizBdxWs2drO4OzrbPw5lMiG181wELflQrUQnrC7GJroGIQe +4kk0UAOhO7HYYePWSHmfbNFfjlYIpcv5gaCqqAJy5O5p55zh7hOFNyMisjHi1LV8kSH nFPw== X-Gm-Message-State: AOAM532fhyfky1nw0keHF2+I7TU1d4vwaEobFdCHyqgR0CseeBUryPym nHbuVLG7dYPLsPSxozkY5UDmBkGKSFZ8hb2UJXo= X-Received: by 2002:a05:6512:2342:: with SMTP id p2mr4664069lfu.509.1612598825457; Sat, 06 Feb 2021 00:07:05 -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> <20210204125819.GA910119@kernel.org> In-Reply-To: From: Namhyung Kim Date: Sat, 6 Feb 2021 17:06:54 +0900 Message-ID: Subject: Re: [PATCH 06/24] perf daemon: Add config file support To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Jiri Olsa , 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 On Fri, Feb 5, 2021 at 12:10 AM Jiri Olsa wrote: > > On Thu, Feb 04, 2021 at 09:58:19AM -0300, Arnaldo Carvalho de Melo wrote: > > 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... > > ok, how about daemon_session then? I'm ok with it. > > > > > 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? > > let's have our grand-grand-grandkids worry about that ;-) :) Thanks, Namhyung