Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2812897pxb; Sat, 30 Jan 2021 15:59:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqhIOXOkm6HmVQBg6YW2o+GtMQocx7nRv1KrGervNoiEooB6PV+T6TwdZ99Vuka0A6Yfcv X-Received: by 2002:a17:906:7798:: with SMTP id s24mr11047658ejm.19.1612051167859; Sat, 30 Jan 2021 15:59:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612051167; cv=none; d=google.com; s=arc-20160816; b=yk9eJVncz3+vfkj/1Um3Drpmi0AtB2TSwqvlg7HuiC6HwtUzOY6Q5XbIR51h7Cuu2N IHi6wm0s9T83LBrhBr6Hb5kWm60TG7Ulm9xk2ka/pKskf+YxQivwbLEfVhetnXraw3rf yVej6Z+5dx31kDLXjiIZfBDCosBL0b3ZXy7hAxK+nxCNI+sLR3xfl0k2uvVzYUlhb9lw D9ANM7R+qFtUcuVpP8GPA5Sk9GQJETAAP0okRne5Fp2oYQ/4e4vPA9aXs3yZ2MiVOsAq bAWigFxwqAzNe2N/FQ3UYh12hkHYUsoM9MBtauPAebgXm3tXEHfOQJTpKGTc1QDKmb7k kgug== 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=ttAs23eK9WWshPI9dgw0AuBA8N37siScIza7OZHcCrY=; b=Z+/1IHqZ9XUDsjcXVO89oLBLnxsBkaozrn8b2gdUTLDuZhhDFSrrbuggORvvDpkBZy cmBuDAiwuceAT9nkIqbeEsbKwnI+ZHM/WENaBOoOVsjsZ6RaQ+NOLiaZsmLjbBgiwT4e uGLRrl/iH6GYUA8xJtE4AGGVx9OIQpkxvXs3Mo70gsXaPc2ZVHB3KXaAWGSb4RfAWtd/ ouNzqX9gbHpNgG9NTq/b+PDohhhziPThgHULHUP8CTBJPuQ8MGVpbmwxFZyg7pABpRLL ecgBrdRlOzgpc/pLZ5sSwdMgBcObikxcwLaH+IY4cHd5zjxQtyHCEVKdbFM/XLBx+Y8o S2Eg== 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 z5si8330378edp.368.2021.01.30.15.59.03; Sat, 30 Jan 2021 15:59:27 -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 S232748AbhA3Xys convert rfc822-to-8bit (ORCPT + 99 others); Sat, 30 Jan 2021 18:54:48 -0500 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:60666 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232547AbhA3XvD (ORCPT ); Sat, 30 Jan 2021 18:51:03 -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-522-_gdllPZ7MoKqnCSWntYZnQ-1; Sat, 30 Jan 2021 18:50:08 -0500 X-MC-Unique: _gdllPZ7MoKqnCSWntYZnQ-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 BFD39107ACE3; Sat, 30 Jan 2021 23:50:06 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.192.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A0226F974; Sat, 30 Jan 2021 23:50:02 +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 21/24] perf tests: Add daemon stop command test Date: Sun, 31 Jan 2021 00:48:53 +0100 Message-Id: <20210130234856.271282-22-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 test for perf daemon stop command. The test stops the daemon and verifies all the configured sessions are properly terminated. Signed-off-by: Jiri Olsa --- tools/perf/tests/shell/daemon.sh | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tools/perf/tests/shell/daemon.sh b/tools/perf/tests/shell/daemon.sh index 90a6e8caddfb..3b6b5aa5587c 100755 --- a/tools/perf/tests/shell/daemon.sh +++ b/tools/perf/tests/shell/daemon.sh @@ -295,9 +295,63 @@ EOF rm -f ${config_new} rm -f ${config_empty} } + +test_stop() +{ + echo "test daemon stop" + + local config=$(mktemp /tmp/perf.daemon.config.XXX) + local base=$(mktemp -d /tmp/perf.daemon.base.XXX) + + # prepare config + cat < ${config} +[daemon] +base=BASE + +[session-size] +run = -e cpu-clock + +[session-time] +run = -e task-clock +EOF + + sed -i -e "s|BASE|${base}|" ${config} + + # start daemon + daemon_start ${config} size + + local pid_size=`perf daemon --config ${config} -x: | head -2 | tail -1 | awk 'BEGIN { FS = ":" } ; { print $1 }'` + local pid_time=`perf daemon --config ${config} -x: | head -3 | tail -1 | awk 'BEGIN { FS = ":" } ; { print $1 }'` + + # check that sessions are running + if [ ! -d "/proc/${pid_size}" ]; then + echo "FAILED: session size not up" + fi + + if [ ! -d "/proc/${pid_time}" ]; then + echo "FAILED: session time not up" + fi + + # stop daemon + daemon_exit ${base} ${config} + + # check that sessions are gone + if [ -d "/proc/${pid_size}" ]; then + echo "FAILED: session size still up" + fi + + if [ -d "/proc/${pid_time}" ]; then + echo "FAILED: session time still up" + fi + + rm -rf ${base} + rm -f ${config} +} + error=0 test_list test_reconfig +test_stop exit ${error} -- 2.29.2