Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9985949ybi; Wed, 24 Jul 2019 13:34:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCOQBau2mG0ykwIRbPEOBAyFbEpi+np8/tLxfng+JiPgDUdPGe/aonUJ5y6pLlJan07qg7 X-Received: by 2002:a17:902:7781:: with SMTP id o1mr87643908pll.205.1564000493701; Wed, 24 Jul 2019 13:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000493; cv=none; d=google.com; s=arc-20160816; b=FW9BNXSJseG74Zdo4MfNNevL39fAPtRd4dncz1a9iBTKA3jxKcddkl6NtqtyNIzkcp In21XW6ycXD/NTKOWXoXcMcdU384e4knPV+Vb/JrqaoF7oXpLZFLbWpHVabZzXsySrlE vl0ok/dK3xi0g77Z+dqSjlgIgfRqE22BmlQLGTWlKjttXxh1WHRnk9J5368Hm3VT2JCF 2flGYIRzJraU6XRQRqeOSeXKdhn6yHChaF93DXR62Fl0yRYOVZ8R1IHOG1ebPZkNGz+7 dssp5XreHNrbgUzCdpr+xXC/Tr1tA/fPwXMDXslLxR/TMTmU3IBa8pTwieMAV9/9RxJi yAxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UMj/pVQf8g0Mdt2s3rvfdWnXRZKJYnzpzwIbKHzesrA=; b=dAFxMqkk/T/Wf63+PTUgfN4EDG6fJSq5KpHHJc3xzLDnHOohmxkpm0n8HlBqJOqp0P yEccblmByULeiLGVjv2RTr2frYS7X2w52zk6jEhvCtP2lxuOuA6UxH5AiodLW000EUSH XNpAOXdgPr27vboN7U8ddPPYGv0S6mUlvH9n/PpbnQh1QPkiu+QSEsnNKPw7l507BTdo /u8Lr1XdnKu+7Ysd80yYcYDtnIpqqDZBgsVpD592HKcrxGp2hZFw7RW9/P6QF9sOh+jk OEcbY2Zuta07BIfj6PeQoI53N1IxFop/OQiSPPxEAurJDCG7tO/BEwr36Z8oTJMTNt08 40kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T20nrUaD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si14260431pli.144.2019.07.24.13.34.39; Wed, 24 Jul 2019 13:34:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T20nrUaD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388231AbfGXT2a (ORCPT + 99 others); Wed, 24 Jul 2019 15:28:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:46792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726945AbfGXT22 (ORCPT ); Wed, 24 Jul 2019 15:28:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C4E00218EA; Wed, 24 Jul 2019 19:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996508; bh=FAp8BHi41ahHVD5BxDfomx6u7dX+39EQJwlU0Df/+OQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T20nrUaDEI/KrSaUU7LFaD0OcsCi3h56oSgoK/BTOGOVoL/BfghG/rrLA4ekwVLNS fWcs8+b+xmQk+qtYfKsfW2wHjbqZDUYBG83F6weGrXkwjv+iKzJGxCLgbIVjYY9nVt Ich9gKCLvL/ZOsLER/argo5u9juX4FTFbLRJ5Lxo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Richter , Christian Borntraeger , Heiko Carstens , Hendrik Brueckner , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.2 080/413] perf test 6: Fix missing kvm module load for s390 Date: Wed, 24 Jul 2019 21:16:11 +0200 Message-Id: <20190724191740.836121591@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 53fe307dfd309e425b171f6272d64296a54f4dff ] Command # perf test -Fv 6 fails with error running test 100 'kvm-s390:kvm_s390_create_vm' failed to parse event 'kvm-s390:kvm_s390_create_vm', err -1, str 'unknown tracepoint' event syntax error: 'kvm-s390:kvm_s390_create_vm' \___ unknown tracepoint when the kvm module is not loaded or not built in. Fix this by adding a valid function which tests if the module is loaded. Loaded modules (or builtin KVM support) have a directory named /sys/kernel/debug/tracing/events/kvm-s390 for this tracepoint. Check for existence of this directory. Signed-off-by: Thomas Richter Reviewed-by: Christian Borntraeger Cc: Heiko Carstens Cc: Hendrik Brueckner Link: http://lkml.kernel.org/r/20190604053504.43073-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/tests/parse-events.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 4a69c07f4101..8f3c80e13584 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -18,6 +18,32 @@ #define PERF_TP_SAMPLE_TYPE (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME | \ PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD) +#if defined(__s390x__) +/* Return true if kvm module is available and loaded. Test this + * and retun success when trace point kvm_s390_create_vm + * exists. Otherwise this test always fails. + */ +static bool kvm_s390_create_vm_valid(void) +{ + char *eventfile; + bool rc = false; + + eventfile = get_events_file("kvm-s390"); + + if (eventfile) { + DIR *mydir = opendir(eventfile); + + if (mydir) { + rc = true; + closedir(mydir); + } + put_events_file(eventfile); + } + + return rc; +} +#endif + static int test__checkevent_tracepoint(struct perf_evlist *evlist) { struct perf_evsel *evsel = perf_evlist__first(evlist); @@ -1642,6 +1668,7 @@ static struct evlist_test test__events[] = { { .name = "kvm-s390:kvm_s390_create_vm", .check = test__checkevent_tracepoint, + .valid = kvm_s390_create_vm_valid, .id = 100, }, #endif -- 2.20.1