Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp792615ybe; Fri, 13 Sep 2019 06:28:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHaDe0w2MT9AB0XNOY2ZOa+e3gZdkWP+3KXTWj/n4LaKJnlx1RliWYi2UWKwx43xJjLNxX X-Received: by 2002:a17:906:6dc1:: with SMTP id j1mr39411097ejt.85.1568381315105; Fri, 13 Sep 2019 06:28:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568381315; cv=none; d=google.com; s=arc-20160816; b=WZwzCQGTs+HdYlZOUtlG83ZnaPRPnMfUbNAhtEOcCrnkg+boURs0EGWZykcNuohJHO zAOvd7AfpLVVL6z9/ROENwuTK/pwyZlG/l1OFkl9SjLv4JOpV36PGBhJXqCpe/hQth01 y64vMDBxMX5Xqd8fqJRR5BJiOEyrdtzxoSvqSIgs+fEiPKBbiW6YHHZBJIjZcA04Sbkb yuVSXd2aXEQAOQKlO6EMKVrqWWpCAyDz6RvoGV9uLIPrO7gQmrEtyG3gmKcEnHBB8V+D 5JtmEo7VfOugTfmpRpVOo3k/NZcCLbFcN8q9YEiRcwgzRLYl/xXaxFRfcPFchS1nQIO6 c2LQ== 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=3iOFS5CaLK8rNDT9UfI2xcvGyxy223PCkEHz8SDHw2Q=; b=YfNARYVyBp405IKF+0QcdIgbNNH0xJRAeDc5Id3i7TiV08JHVAXuVeaMAghONI25Ed MgC2nqvF9vX9WnPeNZiFAFC702j5sb7SstZfYxqprtz10s/XR4IoIQClf8Phvjsgj7nU iXCB8Lc7LX79LpKTd541wT5c9VGGxDnoigTddiRurdFr/TOvI2XbzigJ14EonfRVTVWY NIVp6ynKFFBP5aoPkzQICmHD9dcfcs4xuTyXFVAqX/qcntU2gW7MdpO0Rmm3lFrdc3WY 7zz57GVGHFi6C44tCx0P1lI7tOOB6dx4D9swiai93n3Cf4ECqkzH+VJCgyd4GJFp4KGG N0Ug== 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 i2si690137ejj.114.2019.09.13.06.28.11; Fri, 13 Sep 2019 06:28:35 -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 S2391366AbfIMNZ2 (ORCPT + 99 others); Fri, 13 Sep 2019 09:25:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45394 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391356AbfIMNZ1 (ORCPT ); Fri, 13 Sep 2019 09:25:27 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1493308A9E2; Fri, 13 Sep 2019 13:25:26 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id BCD615C1D4; Fri, 13 Sep 2019 13:25:24 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH 34/73] libperf: Add libperf_init call to tests Date: Fri, 13 Sep 2019 15:23:16 +0200 Message-Id: <20190913132355.21634-35-jolsa@kernel.org> In-Reply-To: <20190913132355.21634-1-jolsa@kernel.org> References: <20190913132355.21634-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 13 Sep 2019 13:25:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding libperf_init call to automated tests. Link: http://lkml.kernel.org/n/tip-xxpguwr7u2jryhsn7wjybexz@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/lib/tests/test-cpumap.c | 8 ++++++++ tools/perf/lib/tests/test-evlist.c | 10 ++++++++++ tools/perf/lib/tests/test-evsel.c | 8 ++++++++ tools/perf/lib/tests/test-threadmap.c | 8 ++++++++ 4 files changed, 34 insertions(+) diff --git a/tools/perf/lib/tests/test-cpumap.c b/tools/perf/lib/tests/test-cpumap.c index 76a43cfb83a1..4224d6f213f8 100644 --- a/tools/perf/lib/tests/test-cpumap.c +++ b/tools/perf/lib/tests/test-cpumap.c @@ -2,12 +2,20 @@ #include #include +static int libperf_print(enum libperf_print_level level, + const char *fmt, va_list ap) +{ + return vfprintf(stderr, fmt, ap); +} + int main(int argc, char **argv) { struct perf_cpu_map *cpus; __T_START; + libperf_init(libperf_print); + cpus = perf_cpu_map__dummy_new(); if (!cpus) return -1; diff --git a/tools/perf/lib/tests/test-evlist.c b/tools/perf/lib/tests/test-evlist.c index 4e1407f20ffd..e6b2ab2e2bde 100644 --- a/tools/perf/lib/tests/test-evlist.c +++ b/tools/perf/lib/tests/test-evlist.c @@ -1,4 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 +#include +#include #include #include #include @@ -6,6 +8,12 @@ #include #include +static int libperf_print(enum libperf_print_level level, + const char *fmt, va_list ap) +{ + return vfprintf(stderr, fmt, ap); +} + static int test_stat_cpu(void) { struct perf_cpu_map *cpus; @@ -177,6 +185,8 @@ int main(int argc, char **argv) { __T_START; + libperf_init(libperf_print); + test_stat_cpu(); test_stat_thread(); test_stat_thread_enable(); diff --git a/tools/perf/lib/tests/test-evsel.c b/tools/perf/lib/tests/test-evsel.c index 2c648fe5617e..64d2257a93cb 100644 --- a/tools/perf/lib/tests/test-evsel.c +++ b/tools/perf/lib/tests/test-evsel.c @@ -5,6 +5,12 @@ #include #include +static int libperf_print(enum libperf_print_level level, + const char *fmt, va_list ap) +{ + return vfprintf(stderr, fmt, ap); +} + static int test_stat_cpu(void) { struct perf_cpu_map *cpus; @@ -116,6 +122,8 @@ int main(int argc, char **argv) { __T_START; + libperf_init(libperf_print); + test_stat_cpu(); test_stat_thread(); test_stat_thread_enable(); diff --git a/tools/perf/lib/tests/test-threadmap.c b/tools/perf/lib/tests/test-threadmap.c index 10a4f4cbbdd5..9b72c43c8c59 100644 --- a/tools/perf/lib/tests/test-threadmap.c +++ b/tools/perf/lib/tests/test-threadmap.c @@ -2,12 +2,20 @@ #include #include +static int libperf_print(enum libperf_print_level level, + const char *fmt, va_list ap) +{ + return vfprintf(stderr, fmt, ap); +} + int main(int argc, char **argv) { struct perf_thread_map *threads; __T_START; + libperf_init(libperf_print); + threads = perf_thread_map__new_dummy(); if (!threads) return -1; -- 2.21.0