Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5881490ybi; Sun, 21 Jul 2019 04:35:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBGXBuCUOelGXEO8yLoZMHjZ85AnyN3QE7I6iaHqIxvzc4TAts1+0JmVuS8XsqVCSIvAHZ X-Received: by 2002:a17:902:9f8e:: with SMTP id g14mr23476829plq.67.1563708925014; Sun, 21 Jul 2019 04:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563708925; cv=none; d=google.com; s=arc-20160816; b=M4SALyymdJ1RfqhfqoBGoXYa8xrg5boTYZDxAOxz5YEX7Izs8dFy4KqHUhg8IFCLyx 34UX0k7GvSqTI+KWLXGYtK8ZKPrtIoYrDdw0fen8WPdqRvtndYb9TfnhlpvOZS6ALH0W JmMKYCZNTMFX4P5LFEJBOh4rPt2Jx2gXZ3W9LXk3ycdDh9KuFlfXNh+WWi5hCku2zQNB PfMiqZcMr3MJUSWkEq4WT8f69ohiCB4H7HBlVxuHaWENdJ1F3IhbaxviiqR9y0rDHaiL Czc/uvZrg6IAU3kNybg44uNm2eonQjO9Khe+em8gaIorhbhxRNbJPBRyqxdhoNTc6xBy CE2Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=B3mzewipHR6r4nC5upmocTt9NYu+hiXVj+dvMSn5Ojg=; b=dOeKOsF2gLRfG5bTqQKQYF7wtAy/mm+825LYmi17miFFaIGZOPdA0FcKrbLVzLRXP+ vtB7Vmcu2s920m6No0G3LoMA5OEgQB3vStY5nu4cQBfeaGOd9ZzBO3nNXjgmSQ/qTNTK h/hoSaWERoDqcxIBTKJPB73wlpgxwDRJVq2ugaO6KwwIEZZ2GdMw8fyNtQ2PpB2po7EQ kZADgxo5NEIrDr+yI8w5ySgL4zVKlls3wH82z9Ioia0zar4TKvw5n8zgla8UX+9nFzfj 36EoUdIts3PbZUSlKBIDtQ+tUfDe2x89iBepvOCjoJ/dgQDtVOoFa9N5cJx/UhwcsYEB F/uQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i185si7186895pge.505.2019.07.21.04.35.09; Sun, 21 Jul 2019 04:35:24 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727520AbfGULcv (ORCPT + 99 others); Sun, 21 Jul 2019 07:32:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53702 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726390AbfGULcu (ORCPT ); Sun, 21 Jul 2019 07:32:50 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C44E3C919; Sun, 21 Jul 2019 11:32:50 +0000 (UTC) Received: from krava.redhat.com (ovpn-204-23.brq.redhat.com [10.40.204.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5CBF25D9D3; Sun, 21 Jul 2019 11:32:46 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Andi Kleen , Alexey Budankov , Michael Petlan Subject: [PATCH 74/79] libperf: Add perf_thread_map test Date: Sun, 21 Jul 2019 13:25:01 +0200 Message-Id: <20190721112506.12306-75-jolsa@kernel.org> In-Reply-To: <20190721112506.12306-1-jolsa@kernel.org> References: <20190721112506.12306-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sun, 21 Jul 2019 11:32:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add simple perf_thread_map tests. Link: http://lkml.kernel.org/n/tip-ls4qrx9w9h446wnr8ftmy17z@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/lib/tests/Makefile | 2 +- tools/perf/lib/tests/test-threadmap.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tools/perf/lib/tests/test-threadmap.c diff --git a/tools/perf/lib/tests/Makefile b/tools/perf/lib/tests/Makefile index b72c8c47df61..5dc84003e3a7 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 = test-cpumap +TESTS = test-cpumap test-threadmap TESTS_SO := $(addsuffix -so,$(TESTS)) TESTS_A := $(addsuffix -a,$(TESTS)) diff --git a/tools/perf/lib/tests/test-threadmap.c b/tools/perf/lib/tests/test-threadmap.c new file mode 100644 index 000000000000..10a4f4cbbdd5 --- /dev/null +++ b/tools/perf/lib/tests/test-threadmap.c @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0 +#include +#include + +int main(int argc, char **argv) +{ + struct perf_thread_map *threads; + + __T_START; + + threads = perf_thread_map__new_dummy(); + if (!threads) + return -1; + + perf_thread_map__get(threads); + perf_thread_map__put(threads); + perf_thread_map__put(threads); + + __T_OK; + return 0; +} -- 2.21.0