Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp12851848pxu; Sat, 2 Jan 2021 14:09:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxV5rxhS+JH6tSMekZeFshtVP+ocJJmvBs8z0cujwotsG8x0SQhP3Fp2YPDl1jzDGkj/KJb X-Received: by 2002:a17:907:2071:: with SMTP id qp17mr62031632ejb.110.1609625350777; Sat, 02 Jan 2021 14:09:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609625350; cv=none; d=google.com; s=arc-20160816; b=IEYzo8ulEyAucSollKM6cHk1EYwEVQ4njcJqhRUH2qEDbOplDoW9Go1mmYj5GY7ZlZ 6j7iGRcM46QCKmJ/hEFN+GnhDHqEIgbpDlSEvBib3e+tYJw/3kg2qpKMzqiTJxtzjCMW eytpuC7USyp6u5a9oucy1LWnddxbNS032SuT18Jz9lXnHdm/ZOfWTBtBUiGi+7mPPjV8 WDFAyt9alBqCxDVE920dOaEtr84dPz06WJIuLumf+o9PHomG90Z/2BSVXGUfyJuCr2Ho 1mR2SqTrNoxgNy+21TE5mYpXgJBx2RPAzibOUdzO6jfKZ4ETlpVAQ40oqfpnC3TWGUC1 2puQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=S2SPbz9s8Mkav/SQ+1TPLv+mc0UUMfb/VzJq2j8D6J0=; b=RsuKH0Be8Br3JWmPSr/h8KI+OWL1t6AhphEvwcAKcAnK26UHj80GgYf3WbkaT1bcNf hpM7E4nfj25RVNmD/KgonheGLM0gjdTzGhFiftHsKATJUYk5DVvWEMjjL+zWKBEJrsE0 D8+RbcarrjXnUOIQUdI1Ds+9oXCE9DDjlcEmQudPzN32RXstrMtA62OhEabjq2hiF/+T YM1zWj3DT/t6nSHZg0EUBuNnW/WuIGhukqZD+1uymM+AaOGae93SP3MrN2lVoVn56LOV ++Kragzt22NgbWTWvHRIl5yOol+Wd050DwKV/Fs1ue2yWYpVGX5E9gi53ujRJpRJ/hnx dzqw== 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 l23si28731311edr.325.2021.01.02.14.08.47; Sat, 02 Jan 2021 14:09:10 -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 S1727449AbhABWGn convert rfc822-to-8bit (ORCPT + 99 others); Sat, 2 Jan 2021 17:06:43 -0500 Received: from us-smtp-delivery-44.mimecast.com ([207.211.30.44]:22024 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726737AbhABWGl (ORCPT ); Sat, 2 Jan 2021 17:06:41 -0500 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-253-jT8CpJ9pOQ2WES955Ac6Vg-1; Sat, 02 Jan 2021 17:05:43 -0500 X-MC-Unique: jT8CpJ9pOQ2WES955Ac6Vg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0E697C287; Sat, 2 Jan 2021 22:05:42 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7296919727; Sat, 2 Jan 2021 22:05:39 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Peter Zijlstra , Ingo Molnar , Mark Rutland , Namhyung Kim , Alexander Shishkin , Michael Petlan , Ian Rogers , Stephane Eranian , Alexei Budankov Subject: [PATCH 17/22] perf daemon: Add man page for perf-daemon Date: Sat, 2 Jan 2021 23:04:36 +0100 Message-Id: <20210102220441.794923-18-jolsa@kernel.org> In-Reply-To: <20210102220441.794923-1-jolsa@kernel.org> References: <20210102220441.794923-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jolsa@kernel.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=WINDOWS-1252 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding man page for perf-daemon usage. 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.26.2