Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5185864ybi; Tue, 30 Jul 2019 15:41:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyK+1MMdKk4QsLe0GRD68om63fOOsL4Eez8LPQCyBwaEVMzW2VfADEORi3Q0aTJLko/CTHX X-Received: by 2002:a65:584f:: with SMTP id s15mr94110265pgr.175.1564526493938; Tue, 30 Jul 2019 15:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564526493; cv=none; d=google.com; s=arc-20160816; b=IbWXZE7ainpOW2RT5htrUxkyvIA71ItGCkYktMOpEwgJ3kTCFh2g9DMYACaaKQPRor 2Stxitv//1IWbUqxM1O+DZ0hzoGNeeTJ4I4ABP1cJtQI+kUzqbYr3TiDFQFxa5T7mnuS AB/dhuUIlHJH+z1q3eA7qUwGkMaefyNGhCIjs4zkDW/c5VgQpjWp9SEhzd8uyL2EntDz An6/RCQEPjxiIYHk3+EwpmYQaYx1I16g/gcCSkzcTJJNhnyMixHCuDSQlmwMekKj24kZ 5WBEgzeGKfEUTMY9Pb3d66HYP2u7hCJ+7gC9WdfKNvwEhGecnn7sgOqgTSpfWCtxzkIb O08A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=HvpK5cgus/BdB/lvMfbu1aMhlLhmMOeuVbCe+VqWMps=; b=iFcu/agjS5mLe+mNeFLcFu1R1X8rMJ50dA8/N9xjEzAT01QFxJDZtFDTuT83W6C8sT zjiSlQSXzckx9qnmGVe0eB8JvEk8t/6TuqZysDjmZCeiUS9c4Um0NhwrYOsfoFvA+u74 gcPPeXpaIAvY4KJMNYGudN+f3CpXfeoFOrIrBTCnN43VXzXVL/aXkd7IO46yOHC14Gny gBGe87eS+N9NjFFTGlgC8gaRw0o5+8K2ePg+uUGu/FShqRIGf9elLRlb9/neKyrkFD4m TAao1t5oEF1M1G6Ksc/at5B9UQ0DmR072sQeA0A/jUxdwMezQQFxfaSXEDuaTzMHSNKv oZ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019071901 header.b=cEaorFrW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si33647531pfp.159.2019.07.30.15.41.19; Tue, 30 Jul 2019 15:41:33 -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=@zytor.com header.s=2019071901 header.b=cEaorFrW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388534AbfG3TCf (ORCPT + 99 others); Tue, 30 Jul 2019 15:02:35 -0400 Received: from terminus.zytor.com ([198.137.202.136]:47993 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387996AbfG3TCf (ORCPT ); Tue, 30 Jul 2019 15:02:35 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x6UJ2NGn3337754 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 30 Jul 2019 12:02:23 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x6UJ2NGn3337754 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019071901; t=1564513343; bh=HvpK5cgus/BdB/lvMfbu1aMhlLhmMOeuVbCe+VqWMps=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=cEaorFrW7y1AkuilQYs+9dOA3IOWUoV2CtKXklTFGbMhCMV0Qm4qX4LZ8/BlZ/V3l e6c2qhVTuh/hOAQTojkC418a2BocSrpfrGrvIKGHsQ6fsE68ik/WBR43+ULQNFGGZn t5YQ4K5tK7ynOdg158OCUPzra13BJycplPiKkWiDKWP63psvNkQClf6kC4V0iSemwv aRj3K9tOKJdPIDJoCmERKQns569kNDoyEEYDfsjzDyYE1PdWQRfoNGajc2bMCMifvc KNKkopacEWzQu4CaEHZIkgpXUaRaCvXgaApaK8XwwJg8QfiGT34J0rkydBkW4u64bj h4njCEwVtkWkg== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x6UJ2Lw73337745; Tue, 30 Jul 2019 12:02:21 -0700 Date: Tue, 30 Jul 2019 12:02:21 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Jiri Olsa Message-ID: Cc: linux-kernel@vger.kernel.org, jolsa@kernel.org, alexander.shishkin@linux.intel.com, tglx@linutronix.de, mpetlan@redhat.com, peterz@infradead.org, alexey.budankov@linux.intel.com, mingo@kernel.org, namhyung@kernel.org, acme@redhat.com, ak@linux.intel.com, hpa@zytor.com Reply-To: alexander.shishkin@linux.intel.com, acme@redhat.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org, ak@linux.intel.com, tglx@linutronix.de, mpetlan@redhat.com, mingo@kernel.org, alexey.budankov@linux.intel.com, namhyung@kernel.org, hpa@zytor.com In-Reply-To: <20190721112506.12306-74-jolsa@kernel.org> References: <20190721112506.12306-74-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] libperf: Add perf_cpu_map test Git-Commit-ID: c0e730456ae8a864701f5ca4f6c2e23010e4b04a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: c0e730456ae8a864701f5ca4f6c2e23010e4b04a Gitweb: https://git.kernel.org/tip/c0e730456ae8a864701f5ca4f6c2e23010e4b04a Author: Jiri Olsa AuthorDate: Sun, 21 Jul 2019 13:25:00 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 29 Jul 2019 18:34:46 -0300 libperf: Add perf_cpu_map test Add simple perf_cpu_map tests. Committer testing: One has to build it in the source tree, a limitation that should be fixed in followup patches: $ make O=/tmp/build/perf -C tools/perf/lib make: Entering directory '/home/acme/git/perf/tools/perf/lib' LINK /tmp/build/perf/libperf.so.0.0.1 GEN /tmp/build/perf/libperf.pc make: Leaving directory '/home/acme/git/perf/tools/perf/lib' $ make O=/tmp/build/perf -C tools/perf/lib tests make: Entering directory '/home/acme/git/perf/tools/perf/lib' LINK test-cpumap-a gcc: error: ../libperf.a: No such file or directory make[1]: *** [Makefile:22: test-cpumap-a] Error 1 make: *** [Makefile:115: tests] Error 2 make: Leaving directory '/home/acme/git/perf/tools/perf/lib' [acme@quaco perf]$ make -C tools/perf/lib make: Entering directory '/home/acme/git/perf/tools/perf/lib' HOSTCC fixdep.o HOSTLD fixdep-in.o LINK fixdep CC core.o CC cpumap.o CC threadmap.o CC evsel.o CC evlist.o CC zalloc.o CC xyarray.o CC lib.o LD libperf-in.o AR libperf.a LINK libperf.so.0.0.1 GEN libperf.pc make: Leaving directory '/home/acme/git/perf/tools/perf/lib' $ make O=/tmp/build/perf -C tools/perf/lib tests make: Entering directory '/home/acme/git/perf/tools/perf/lib' LINK test-cpumap-a LINK test-cpumap-so running static: - running test-cpumap.c...OK running dynamic: - running test-cpumap.c...OK make: Leaving directory '/home/acme/git/perf/tools/perf/lib' $ Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Andi Kleen Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20190721112506.12306-74-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/lib/tests/Makefile | 2 +- tools/perf/lib/tests/test-cpumap.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tools/perf/lib/tests/Makefile b/tools/perf/lib/tests/Makefile index de951ae38dea..b72c8c47df61 100644 --- a/tools/perf/lib/tests/Makefile +++ b/tools/perf/lib/tests/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) -TESTS = +TESTS = test-cpumap TESTS_SO := $(addsuffix -so,$(TESTS)) TESTS_A := $(addsuffix -a,$(TESTS)) diff --git a/tools/perf/lib/tests/test-cpumap.c b/tools/perf/lib/tests/test-cpumap.c new file mode 100644 index 000000000000..76a43cfb83a1 --- /dev/null +++ b/tools/perf/lib/tests/test-cpumap.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0 +#include +#include + +int main(int argc, char **argv) +{ + struct perf_cpu_map *cpus; + + __T_START; + + cpus = perf_cpu_map__dummy_new(); + if (!cpus) + return -1; + + perf_cpu_map__get(cpus); + perf_cpu_map__put(cpus); + perf_cpu_map__put(cpus); + + __T_OK; + return 0; +}