Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2811864pxb; Sat, 30 Jan 2021 15:56:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyp3oyZs3c6fF0xD+NAn4sI5eS/N6zgiZxkwmJfQOi3yOi8nddFzMGo2tpXWuq1yQtUuAfm X-Received: by 2002:a17:907:a06f:: with SMTP id ia15mr11026512ejc.328.1612050968034; Sat, 30 Jan 2021 15:56:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612050968; cv=none; d=google.com; s=arc-20160816; b=RAEPEMpxdPEm3U/IqaMqUVZtYCFcPILHlZoyn1yeJF7mlai/q1ju26xha3ekAs4UI8 S+4B1xsfURk2DDabMMFDNpUIca/tpuKdgRumyY/40Km4qkiG6SPiGpti3bpw7szoiMD/ o1sgy1oc5gUyIQ2m0tGIW407FbhZo0iSaVcBXiO+lxgaSZMm4Lt/Dt5jUiwx+RP6Ty6Q UF0BCOZ8U4maRijXjI/1TAL7Qlw2hWstHOGC92DzUulwIlQHbFqikn/J4/Q6sQbhBUwL 8Kk+9wITg7aJBTbRyr3d/SFNVHjjmVYmvrbrks81irnWhNrKKAEgmqP/BqcJbP/5h4hs NJDQ== 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=+MaoWrPX3nTGH9fGJipUGhsSLG9w9zEF8xDPlvm6KXQ=; b=b1vUxAKKsIovdr0LWEOZ4aFidUrrUeKhUlKUBqvoQ17pJYlK9Qjh5gUCP11sOlFIrW tzvCawy4bOB+19LT1fMBOnYPdgf+edKTW6FYgAL9NOYVDJ5DmiPhfj+trusVRBlCnLhj Yk3lkkT6HOl5LRd2eQiJBzuYn6GSvxFDB3nQzMDHgR0W+tqSt2rSHpUnJyqT1OoUR+5m eFlxjr3jJ8GCLP83AzdKuZzNkz802A2W6KswoEvloqlUAlW+GTOZydbXR/CSgMKZSixR 861DuK/qmYwncznF3voaTfvOGX/tHeKqaSWST1TVBzOvzRJIOTcx2CVwIiWhztzLvoDm 9HzQ== 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 gt18si5840629ejc.143.2021.01.30.15.55.43; Sat, 30 Jan 2021 15:56:08 -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 S232618AbhA3XwY convert rfc822-to-8bit (ORCPT + 99 others); Sat, 30 Jan 2021 18:52:24 -0500 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:20783 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232592AbhA3Xuz (ORCPT ); Sat, 30 Jan 2021 18:50:55 -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-530-tHtlBYl-OaeYPxHNKaez6Q-1; Sat, 30 Jan 2021 18:49:58 -0500 X-MC-Unique: tHtlBYl-OaeYPxHNKaez6Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 66AFC107ACE3; Sat, 30 Jan 2021 23:49:56 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.192.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 020D960DA0; Sat, 30 Jan 2021 23:49:53 +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 18/24] perf daemon: Add man page for perf-daemon Date: Sun, 31 Jan 2021 00:48:50 +0100 Message-Id: <20210130234856.271282-19-jolsa@kernel.org> In-Reply-To: <20210130234856.271282-1-jolsa@kernel.org> References: <20210129134855.195810-1-jolsa@redhat.com> <20210130234856.271282-1-jolsa@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.29.2