Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp12852869pxu; Sat, 2 Jan 2021 14:11:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJysuv/bBpYOaA3RHsp40LG2eeTse2hiFi6J9at85bZcpncWdJxqlR+NKIiYZv4n/eqGmiKA X-Received: by 2002:aa7:d2d3:: with SMTP id k19mr49902037edr.28.1609625494529; Sat, 02 Jan 2021 14:11:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609625494; cv=none; d=google.com; s=arc-20160816; b=RdqZ1BUliNUUMumG2Qk1RP5HbdfXXEq7DwwTiYX+K1WO2JQm1iBt/J/qdIo6rCWRbi CJUcy/fgIN+fdwvvgopFAeRgP0mzGD5i6y57wANEbNWV0Iq8akjpHuWRxxikq6qFthJ7 j7lkSAi7LMSdnq1wAR+krE51ha3OVHRv9uCz6y82P2UVg65L845L6UrSi+1Kuan3iHXU ZNXkMAPkU9f8+F5xxI+YYVkkSluK/HiqfM9htV4yBba1Ohgg2QgxDStUeXuOytwrVkzQ vS3/dS/HQUCLnVp/8mrQ8NwOE6ySSKz3erhnZR5odVqNLEwQ+EPgb5HuEWcdFIgWuSXs e65g== 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=0QVxmkw8IT5T7mDer840UvE/kUJBst70kEt2cKcJP/M=; b=aXJDIw96SwE0cBj7FEVwR2a5xcZq1W0CfTDmoJqRsMYVQjSC7fODxjAi6V7rbVBI0d yaqn7KGnDNfudQKEJl1VObXPVkZ39fzjs5tO1RorjwFtZ/FMFluq87ilCNBjwu//PpJn qxKenwiOivguOS+TVO3OuB65k0xwXfIIISgI6/5k9cqDx5AqJFh83SUSYp8zFBE5P+5O CAzFOH4sF+rs/S+Mzi7KqqqpPKKOtFcys18/hAY58xUkfvlTr9RvhzG07OPz9DpJbmMz TbiA3M9jyn8oA15MIVRcEhvbgkaxMbIB3DH4IzH87vNl9GDcuPcVtMZIlmyZJvl2Ez2h lRkQ== 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 jo25si27245861ejb.575.2021.01.02.14.11.11; Sat, 02 Jan 2021 14:11:34 -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 S1727483AbhABWGu convert rfc822-to-8bit (ORCPT + 99 others); Sat, 2 Jan 2021 17:06:50 -0500 Received: from us-smtp-delivery-44.mimecast.com ([207.211.30.44]:40869 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727451AbhABWGt (ORCPT ); Sat, 2 Jan 2021 17:06:49 -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-323-I7GSC-TiP5uOCyb_2_zM-Q-1; Sat, 02 Jan 2021 17:05:53 -0500 X-MC-Unique: I7GSC-TiP5uOCyb_2_zM-Q-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 C18B58015A5; Sat, 2 Jan 2021 22:05:51 +0000 (UTC) Received: from krava.redhat.com (unknown [10.40.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAFB41A353; Sat, 2 Jan 2021 22:05:48 +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 20/22] perf test: Add daemon stop command test Date: Sat, 2 Jan 2021 23:04:39 +0100 Message-Id: <20210102220441.794923-21-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 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 8360f61973e2..d86239c21f5b 100755 --- a/tools/perf/tests/shell/daemon.sh +++ b/tools/perf/tests/shell/daemon.sh @@ -246,9 +246,63 @@ EOF rm -rf ${base} rm -f ${config} } + +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.26.2