Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1897572pxb; Fri, 5 Feb 2021 04:22:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvRwyz1siMh1bx8Tp4S4DLHJQG2xljZzmHJYecQrwjfXgZKQNI6rSUAxLEEDiEhv5GCn3V X-Received: by 2002:a17:907:10c1:: with SMTP id rv1mr4038140ejb.74.1612527743455; Fri, 05 Feb 2021 04:22:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612527743; cv=none; d=google.com; s=arc-20160816; b=lrTBeRAUPxoXJNICKvTJUBpjywuwiWG1ipYUm0JJuznE2roZP1BulkAoqvX+vHZqJ1 msIjIiA7tmvLuz9tyac8VEZh//qMGvfpUEnFOE/c6XHXaWrmxlFPf8XRL1J1+rwhmebp qQFF7x//1qZXiTuYU5vqiDg6zJdB948MIb7O0fA+YEswrWCDyxFlpHXVt68r8j6ODvLJ rLuXNpkS9xJNmlNYqPIz21ORiQBlrhzsY+oMjb2w3VTrPN9cZPLImxdkII9hbA2bjWen 0SmQGnSoH6zUn1ArvTmopVabF70wSiGXvC8g2Z1UerUxVA4AVXgQi+/+b/BorBTRWhjE cY6g== 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=+T/2TzNDJp9mCCmvRN+tN8OL/xtsN61Bf4IuGe4ecvE=; b=GhXPxtAp04csH/wigMa/RrpDOpyBoeom4xStlyUIvpIlsTnzVp72lZohNlp6sv572f upKPYC7areDoZGKhq74WGnwSBkEXAdRZBvu4w/OzCUfBsCYOaXIQQsg7DIK5iu02DwKN e12TkyJVoAAY7B33tEdLcNKm0ih3AW4lcez6VzjP9amiVahkDdnFnoXwZhfgWwiQM+Qc fFog/lHBN21O2xt76pwsy+0q53Uz+n4yXEsGiXdarVxB2yvpeLwX6pyPQbauk76A7kn+ 6+4RYVOKNGt6R8Q88jkmXA35h4v0jB/Jd7IKnr2sAhhO49lgkg4OATwgdysfQO40awxN fY7A== 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 m30si6167099edj.75.2021.02.05.04.21.57; Fri, 05 Feb 2021 04:22:23 -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 S230256AbhBEMSq (ORCPT + 99 others); Fri, 5 Feb 2021 07:18:46 -0500 Received: from mail-lj1-f182.google.com ([209.85.208.182]:42764 "EHLO mail-lj1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231367AbhBEMPv (ORCPT ); Fri, 5 Feb 2021 07:15:51 -0500 Received: by mail-lj1-f182.google.com with SMTP id c18so7453471ljd.9 for ; Fri, 05 Feb 2021 04:15: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=+T/2TzNDJp9mCCmvRN+tN8OL/xtsN61Bf4IuGe4ecvE=; b=Srog2K5A6EkRcOEubsOspKttavaJwBHwm6Dvu8J6KORB4oFKAVJ0BElfO2lEZjGige 87C5/hay9IYNAHHiFLuXnGdgjGXZ2TzI5e3BW04jkSzl+APrzxhPU63bXd99jxIgNoH0 YDZhVmnUJmpVoCM6AJ4ul2rV7xBbazS3gcvjOmRHE+qax/Vw8bGoU2j7Wyqi7YXfRZqR f7PPxZgkepqSwZD7ZpLf8w9TMzEVidngYPAwz1NPxNKkLusVjCR4+mYUjzQNQTy/n8EW LYrJPu7xWWetcVmOsYM1Dyh3w2NWn9RAYOPjDokVoCq2jUg/iQeHokQXweDtAI/q9hnm tsDg== X-Gm-Message-State: AOAM531bfmiHmXi/13Idw570CCjJ1jISJIXzUfhLqco8vQPEM/TQI8oU +MAwM8dZ9/8KFR+7qQv2iDi1WWDXzagOIX05jHw= X-Received: by 2002:a2e:5016:: with SMTP id e22mr2540921ljb.166.1612527305985; Fri, 05 Feb 2021 04:15: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> In-Reply-To: <20210130234856.271282-7-jolsa@kernel.org> From: Namhyung Kim Date: Fri, 5 Feb 2021 21:14:54 +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 On Sun, Jan 31, 2021 at 8:49 AM Jiri Olsa wrote: [SNIP] > @@ -263,9 +605,16 @@ static int __cmd_start(struct daemon *daemon, struct option parent_options[], > signal(SIGTERM, sig_handler); > > while (!done && !err) { > - if (fdarray__poll(&fda, -1)) { > + err = daemon__reconfig(daemon); I think it's confusing since you put the reconfig function here. What not split normal and reconfig passes? I mean something like below __cmd_start() { setup_server_config(); daemon__run(); while (!done && !err) { ... if (reconfig) { daemon__kill(); setup_server_config(); daemon__reconfig(); } } Thanks, Namhyung > + > + if (!err && fdarray__poll(&fda, -1)) { > + bool reconfig = false; > + > if (fda.entries[sock_pos].revents & POLLIN) > err = handle_server_socket(daemon, sock_fd); > + > + if (reconfig) > + err = setup_server_config(daemon); > } > } > > -- > 2.29.2 >