Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3095600pxb; Tue, 19 Jan 2021 13:44:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdGXbCluWuSYw4qQyCJXoNfzNTnTb5n6+thUkX7gdODHUlcRk9IStD9JoDd6rAWzB6Cmtu X-Received: by 2002:a50:fc04:: with SMTP id i4mr4998350edr.137.1611092695646; Tue, 19 Jan 2021 13:44:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611092695; cv=none; d=google.com; s=arc-20160816; b=oGZKNq87WKnkIoYHYiGkpgGOMiicJNFXhrqN1NbcEgvLU9dYdtvjDqU8FC4Ti4nXot W8Q6wBs/tDEFB6KZNzzb4nwWC1WxDHm9JPMyJoedU46Wg3r0LHSyKmWcdBtoRledfvYM b4lSUFHeHmPe9+oCkgpbpLh10K0wwMGhQarhdgkfC+xDFGOpSaxdn3UumhAAk2/5q8PF vCjnsd6pCupmRn3X0UW1mT55HcZ3itpu8d2Mnx3UBljrMwwBiW96CTZ87gXtLsIzuP2H FPMjQvuwnYJ8+9OI8E9Eh8vdfyYE4YaJyebM7Z9rFGtYlEmtevFlIPqBMEO9l9REHtCw m36w== 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=JI/5+9NPGytFKuzzS9MP1tan843R2RhG0K/QAOMhq74=; b=aQwPWFTG/R7m3OTFxXRcixQYvPcbFKMKS4GRYjrAqQHzG6OqLSjV9wOtiSjtbbvvtY kMrFDBBvR5QurxhQsAGbi5ieWJZBgo0Wsb8oKhRo9ka5e4mkioixySoadZ+jEiZQAaMZ /I0xqt8TWcS2zciv+mZZsGUB9X4eIi+LzRLFd6iGAHkoDrV+wpH4Tca6MhyVqsfki7y3 OTwhXs+yV1fb0lZqSljb8/fQQbYiQFUJ9zIlPRYoD8NzfirhmLSTkhEWY5y7/CViIZCc e21zzopBSgCUrEa5nk91lRTqlrhk1We21yyBleec0kCarIJBr20EaX9CUb0h9OnI00HK MHmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=POULt0OY; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si51657edv.277.2021.01.19.13.44.21; Tue, 19 Jan 2021 13:44:55 -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=@redhat.com header.s=mimecast20190719 header.b=POULt0OY; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729645AbhASVlb (ORCPT + 99 others); Tue, 19 Jan 2021 16:41:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:55343 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731299AbhASRu6 (ORCPT ); Tue, 19 Jan 2021 12:50:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611078551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JI/5+9NPGytFKuzzS9MP1tan843R2RhG0K/QAOMhq74=; b=POULt0OYyIf3MbqVjB0up+VpxopgpGs56T3AF5lRhfD9fufKkXvGMJmt+LD+A0Bc+Gk4LV F8i2tLtRePah0z6BhTDdMxb/LkcTiyDSg+EvWL4fbKiXzoFkE9+zScqznS8BwuHh4RUdQS +fHvNLw7PmHbJD69ZVY+UlKbydqU3yQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-442-Hxh7nJvQPEGrXl-5CmObsA-1; Tue, 19 Jan 2021 12:49:07 -0500 X-MC-Unique: Hxh7nJvQPEGrXl-5CmObsA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A42E107B457; Tue, 19 Jan 2021 17:49:05 +0000 (UTC) Received: from krava (unknown [10.40.195.212]) by smtp.corp.redhat.com (Postfix) with SMTP id 92A5510023B9; Tue, 19 Jan 2021 17:49:02 +0000 (UTC) Date: Tue, 19 Jan 2021 18:49:01 +0100 From: Jiri Olsa To: Namhyung Kim Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Michael Petlan , Ian Rogers , Stephane Eranian , Alexei Budankov Subject: Re: [PATCH 08/22] perf daemon: Add config file change check Message-ID: <20210119174901.GD1717058@krava> References: <20210102220441.794923-1-jolsa@kernel.org> <20210102220441.794923-9-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 19, 2021 at 02:31:55PM +0900, Namhyung Kim wrote: > On Sun, Jan 3, 2021 at 7:05 AM Jiri Olsa wrote: > > > > Adding support to detect daemon's config file changes > > and re-read the configuration when that happens. > > Hmm.. maybe some of the code in the previous commit can be moved here. do you mean the config file support? I think this patch is quite small and straightforward - adds the inotify processing for checking config change perhaps we can separate some of the code from previous commit, and make it simpler, I'll check thanks, jirka > > Thanks, > Namhyung > > > > > Using inotify file descriptor pluged into the main > > fdarray object for polling. > > > > Example: > > > > # cat ~/.perfconfig > > [daemon] > > base=/opt/perfdata > > > > [session-cycles] > > run = -m 10M -e cycles --overwrite --switch-output -a > > > > Starting the daemon: > > > > # perf daemon start > > > > Check sessions: > > > > # perf daemon > > [772262:daemon] base: /opt/perfdata > > [772263:cycles] perf record -m 10M -e cycles --overwrite --switch-output -a > > > > Change '-m 10M' to '-m 20M', and check daemon log: > > > > # tail -f /opt/perfdata/output > > [2021-01-02 20:31:41.234045] daemon started (pid 772262) > > [2021-01-02 20:31:41.235072] reconfig: ruining session [cycles:772263]: -m 10M -e cycles --overwrite --switch-output -a > > [2021-01-02 20:32:08.310137] reconfig: session 'cycles' killed > > [2021-01-02 20:32:08.310847] reconfig: ruining session [cycles:772338]: -m 20M -e cycles --overwrite --switch-output -a > > > > And the session list: > > > > # perf daemon > > [772262:daemon] base: /opt/perfdata > > [772338:cycles] perf record -m 20M -e cycles --overwrite --switch-output -a > > > > Note the changed '-m 20M' option is in place. > > > > Signed-off-by: Jiri Olsa > > --- >