Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp621166pxb; Wed, 3 Feb 2021 13:21:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzy6Wv/hIMrOPULysddiJxClg5he+6dENc74WA30CM/ZbkY51S5bgqx6mxKNAiJn9Y/8X6X X-Received: by 2002:aa7:d452:: with SMTP id q18mr5175979edr.350.1612387271717; Wed, 03 Feb 2021 13:21:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612387271; cv=none; d=google.com; s=arc-20160816; b=PExWzY8NtyagZvoDc7q7XRj7y1/jHjB2t2PxJaXyv4CGM6VodSSKR5QZvruEgCWP7w 4gvMJiQA3NlPGP74JjsnwKGhI5gBbWWZyfvDUnqqNu4ivRQJKio7e/yMMsawGnefprZS T+KIbmUjV+Vc85LZHyeMm9mjEhIfY5/mkNmaqI83MEF0Sh6Ghgn3xQqiE1c7SKA7CE6M 3GdB/3XbmDPxOPgGK8QQYsAqKSXqhysI/79MVvcNjeSAV/lUGdoY+0oBtQlu+B5ZVWt/ NraiP6u56XN5pqgK3nkRjlqEuO5C41/cEEWGEaAYq2tUsM/iEU6Hysaq+tN9+kA0YgPA hIpg== 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=FAqpxobsMANVqI6bm0eJHLjDKOnbNTGoNO2JdBLOT2I=; b=snVoRqvtu3cCHBw8ECXcNSir+tcz0drtFJN+d1PgSS5mdCbGpgR/2BgDEzFabtfWPQ F8kpUv0/xyUuKVHyz1Z7kE0/7EpXNLOnfdPGUeDb4zqYhKUqO2Qo0R2iTGi9hHKpaKts Hkf4FxNbJEZEqec2SZt41kROtetYnFMd/++o5WOxgblblHDuMycxAAQV7AOWty752JnO lgwt3O1Uregb2GGW0RtSAbmsPUiWI048lKjDGv2CAnKYrvNJnCMv4hZSbRhk1iTWKs8B 64kn3CJcil7QzCrnkiZRP1223pjknm21UClMYCXXyk1yV69k8sIFU2rqj8TPWojC4hnI 7XYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XgTZDscX; 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 c4si2219704edq.320.2021.02.03.13.20.46; Wed, 03 Feb 2021 13:21:11 -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=XgTZDscX; 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 S232372AbhBCVSC (ORCPT + 99 others); Wed, 3 Feb 2021 16:18:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:37218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231134AbhBCVR7 (ORCPT ); Wed, 3 Feb 2021 16:17:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2DE7564F5F; Wed, 3 Feb 2021 21:17:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612387038; bh=Fnofn/VQSR+gZaBuO49KNNHYjAjducLJujSaPb2u89Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XgTZDscXMDOz41v4tb4JslICYc5KGi66zkzsh21bpCyfuwa5EpjeQpcw3PrCoYDAQ qOLIT1JupYPqG7lUy75zLYm8MYwB4UOOZiLvLtoUNL3PpNxYOE7y7kwy2EDOexPcHb vn6fQCdLHVm7Aq2O1MCL/1Nulw25Y6QZ3gNC5ABUzbWGWfCxxRSg+lufRVrPTLXp4Z 2Azl2H4FaHZR8rKcuv76P224FzRZfkuzLZJxiPUIiPSw49wtq5jgT5EOGiU8oUucBH HkozZmIplF36TZkkPzbPeDDOGHakpjB6xXJg2vvT8oSQ2i6sLfbMURYq0tJQYICd6J +WnPaNSetKX+A== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 08E1740513; Wed, 3 Feb 2021 18:17:15 -0300 (-03) Date: Wed, 3 Feb 2021 18:17:15 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Ian Rogers , Stephane Eranian , Alexei Budankov Subject: Re: [PATCH 18/24] perf daemon: Add man page for perf-daemon Message-ID: <20210203211715.GV854763@kernel.org> References: <20210129134855.195810-1-jolsa@redhat.com> <20210130234856.271282-1-jolsa@kernel.org> <20210130234856.271282-19-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210130234856.271282-19-jolsa@kernel.org> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sun, Jan 31, 2021 at 12:48:50AM +0100, Jiri Olsa escreveu: > Adding man page for perf-daemon usage. I see you decided to add it at the end, but for consistency, please consider adding the bare minimum when adding tools/perf/builtin-daemon.c, then go on adding the options and examples as the features are being added. - Arnaldo > Signed-off-by: Jiri Olsa > --- > tools/perf/Documentation/perf-config.txt | 14 ++ > tools/perf/Documentation/perf-daemon.txt | 187 +++++++++++++++++++++++ > 2 files changed, 201 insertions(+) > > diff --git a/tools/perf/Documentation/perf-config.txt b/tools/perf/Documentation/perf-config.txt > index c3ce48f1b379..153bde14bbe0 100644 > --- a/tools/perf/Documentation/perf-config.txt > +++ b/tools/perf/Documentation/perf-config.txt > @@ -703,6 +703,20 @@ auxtrace.*:: > If the directory does not exist or has the wrong file type, > the current directory is used. > > +daemon.*:: > + > + daemon.base:: > + Base path for daemon data. All sessions data are stored under > + this path. > + > +session-.*:: > + > + session-.run:: > + > + Defines new record session for daemon. The value is record's > + command line without the 'record' keyword. > + > + > SEE ALSO > -------- > linkperf:perf[1] > diff --git a/tools/perf/Documentation/perf-daemon.txt b/tools/perf/Documentation/perf-daemon.txt > index e69de29bb2d1..b0e1015476c2 100644 > --- a/tools/perf/Documentation/perf-daemon.txt > +++ b/tools/perf/Documentation/perf-daemon.txt > @@ -0,0 +1,187 @@ > +perf-daemon(1) > +============== > + > +NAME > +---- > +perf-daemon - Run record sessions on background > + > +SYNOPSIS > +-------- > +[verse] > +'perf daemon' > +'perf daemon' [] > +'perf daemon start' [] > +'perf daemon stop' [] > +'perf daemon signal' [] > +'perf daemon ping' [] > + > + > +DESCRIPTION > +----------- > +This command allows to run simple daemon process that starts and > +monitors configured record sessions. > + > +Each session represents one perf record process started with > +control setup (with perf record --control.. options). > + > +These sessions are configured through config file, see CONFIG FILE > +section with EXAMPLES. > + > + > +OPTIONS > +------- > +--config=:: > + Config file path, if not perf will check system and default > + locations (/etc/perfconfig, $HOME/.perfconfig). > + > +-v:: > +--verbose:: > + Be more verbose. > + > + > +All generic options are available also under commands. > + > + > +START COMMAND > +------------- > +The start command creates the daemon process. > + > +-f:: > +--foreground:: > + Do not put the process in background. > + > + > +STOP COMMAND > +------------ > +The stop command stops all the session and the daemon process. > + > + > +SIGNAL COMMAND > +-------------- > +The signal command sends signal to configured sessions. > + > +--session:: > + Send signal to specific session. > + > + > +PING COMMAND > +------------ > +The ping command sends control ping to configured sessions. > + > +--session:: > + Send ping to specific session. > + > + > +CONFIG FILE > +----------- > +The daemon is configured within standard perf config file by > +following new variables: > + > +daemon.base: > + Base path for daemon data. All sessions data are > + stored under this path. > + > +session-.run: > + Defines new record session. The value is record's command > + line without the 'record' keyword. > + > +Each perf record session is run in daemon.base/ directory. > + > + > +EXAMPLES > +-------- > +Example with 2 record sessions: > + > + # cat ~/.perfconfig > + [daemon] > + base=/opt/perfdata > + > + [session-cycles] > + run = -m 10M -e cycles --overwrite --switch-output -a > + > + [session-sched] > + run = -m 20M -e sched:* --overwrite --switch-output -a > + > + > +Starting the daemon: > + > + # perf daemon start > + > + > +Check sessions: > + > + # perf daemon > + [603349:daemon] base: /opt/perfdata > + [603350:cycles] perf record -m 10M -e cycles --overwrite --switch-output -a > + [603351:sched] perf record -m 20M -e sched:* --overwrite --switch-output -a > + > +First line is daemon process info with configured daemon base. > + > + > +Check sessions with more info: > + > + # perf daemon -v > + [603349:daemon] base: /opt/perfdata > + output: /opt/perfdata/output > + lock: /opt/perfdata/lock > + up: 1 minutes > + [603350:cycles] perf record -m 10M -e cycles --overwrite --switch-output -a > + base: /opt/perfdata/session-cycles > + output: /opt/perfdata/session-cycles/output > + control: /opt/perfdata/session-cycles/control > + ack: /opt/perfdata/session-cycles/ack > + up: 1 minutes > + [603351:sched] perf record -m 20M -e sched:* --overwrite --switch-output -a > + base: /opt/perfdata/session-sched > + output: /opt/perfdata/session-sched/output > + control: /opt/perfdata/session-sched/control > + ack: /opt/perfdata/session-sched/ack > + up: 1 minutes > + > +The 'base' path is daemon/session base. > +The 'lock' file is daemon's lock file guarding that no other > +daemon is running on top of the base. > +The 'output' file is perf record output for specific session. > +The 'control' and 'ack' files are perf control files. > +The 'up' number shows minutes daemon/session is running. > + > + > +Make sure control session is online: > + > + # perf daemon ping > + OK cycles > + OK sched > + > + > +Send USR2 signal to session 'cycles' to generate perf.data file: > + > + # perf daemon signal --session cycles > + signal 12 sent to session 'cycles [603452]' > + > + # tail -2 /opt/perfdata/session-cycles/output > + [ perf record: dump data: Woken up 1 times ] > + [ perf record: Dump perf.data.2020123017013149 ] > + > + > +Send USR2 signal to all sessions: > + > + # perf daemon signal > + signal 12 sent to session 'cycles [603452]' > + signal 12 sent to session 'sched [603453]' > + > + # tail -2 /opt/perfdata/session-cycles/output > + [ perf record: dump data: Woken up 1 times ] > + [ perf record: Dump perf.data.2020123017024689 ] > + # tail -2 /opt/perfdata/session-sched/output > + [ perf record: dump data: Woken up 1 times ] > + [ perf record: Dump perf.data.2020123017024713 ] > + > + > +Stop daemon: > + > + # perf daemon stop > + > + > +SEE ALSO > +-------- > +linkperf:perf-record[1], linkperf:perf-config[1] > -- > 2.29.2 > -- - Arnaldo