Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp906501ybe; Fri, 13 Sep 2019 08:08:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6+jPOcCyxkrqQvUARUZqlZpemX3A7vsaslYyHyFqPOlszYjMBpqc1fJS+NdtpEZSFXUjX X-Received: by 2002:a17:906:4ac1:: with SMTP id u1mr39299761ejt.293.1568387320616; Fri, 13 Sep 2019 08:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568387320; cv=none; d=google.com; s=arc-20160816; b=h5Fa+bRxi7v6MQJgDe8NoGVkLgK96OooKS1QG1lL/Jhr2sS83WIn5tQt8dITI2utgU dTg3OPcAGrarVluT29b4r9Gm17kQQBbsYNJHb1gVrubzojfmYwAIu08QKFCBuYpkbrtB Dp3nUoMY0t2g5y9LDSfLf3anGAtaeCJtxT3iTlo0B8ezHHuqJ4FJYjxpuOP0kLBJhMp2 MHq8U9sJooaGvzDTHE5/96/Kew7Z+ipotgIubRtA7y1Gsq6u6iIct55Ry1EB3BihGa2F Qlk4Xa9X6Qw8MvQT7XY2VbRUQDiBbL3NwXOYYyvupWgWK5CiVc03E2p1lEI4q2ViP8pD 4VZg== 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=JD2tvhZkMUKI6yHwIykgmIUjVN+OFAw6CRoJsvvDH18=; b=KxJgGeZxWdLiqqKlMu28i/+UTVwBBPMjjDlFR+YbMphWfj1txGvT8oaDpCa40IZHLm i1U0W/jxhBoNGcO30OetwgwAoK0WV5qJTi/OA9w8Zgfs9oktCMebmdtSSG9HVX0IrLvD 6piy+fLzar8CUaLW9V1UB+n1ij9bNZvKY/ULyX2tEHf4PJioJA5bwkPIRkeXi4Q8ADOZ oyCShj/eoskZir006xRBDDd36Q6gAtD+WJa5JlsQ08UwWCSBZfArp8B8ieMlM45H+DVL vFDFHKxIBYDniQi1HzncpWAS1BVIQcrHTaZnYwElqYOki7ui5ljoymERm7hOSfw8q1q3 3HsQ== 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 c6si16758698edc.291.2019.09.13.08.08.14; Fri, 13 Sep 2019 08:08:40 -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 S2390961AbfIMNZP (ORCPT + 99 others); Fri, 13 Sep 2019 09:25:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37342 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391311AbfIMNZN (ORCPT ); Fri, 13 Sep 2019 09:25:13 -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 A4AE911A27; Fri, 13 Sep 2019 13:25:12 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BDEB5C219; Fri, 13 Sep 2019 13:25:10 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH 29/73] libperf: Add perf_evlist__read_format function Date: Fri, 13 Sep 2019 15:23:11 +0200 Message-Id: <20190913132355.21634-30-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.28]); Fri, 13 Sep 2019 13:25:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adding perf_evlist__read_format function to libperf as internal function. Link: http://lkml.kernel.org/n/tip-2gky29czqxqtl37cj5q349t7@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/lib/evlist.c | 7 +++++++ tools/perf/lib/include/internal/evlist.h | 2 ++ tools/perf/util/evlist.c | 8 +------- tools/perf/util/evlist.h | 1 - 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/perf/lib/evlist.c b/tools/perf/lib/evlist.c index 2bdd9d2c79d9..ae861bf38976 100644 --- a/tools/perf/lib/evlist.c +++ b/tools/perf/lib/evlist.c @@ -161,3 +161,10 @@ void perf_evlist__disable(struct perf_evlist *evlist) perf_evlist__for_each_entry(evlist, evsel) perf_evsel__disable(evsel); } + +u64 perf_evlist__read_format(struct perf_evlist *evlist) +{ + struct perf_evsel *first = perf_evlist__first(evlist); + + return first->attr.read_format; +} diff --git a/tools/perf/lib/include/internal/evlist.h b/tools/perf/lib/include/internal/evlist.h index 16ae6d6cfb39..63516fe14f4c 100644 --- a/tools/perf/lib/include/internal/evlist.h +++ b/tools/perf/lib/include/internal/evlist.h @@ -66,4 +66,6 @@ static inline struct perf_evsel *perf_evlist__last(struct perf_evlist *evlist) return list_entry(evlist->entries.prev, struct perf_evsel, node); } +u64 perf_evlist__read_format(struct perf_evlist *evlist); + #endif /* __LIBPERF_INTERNAL_EVLIST_H */ diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index a57e2f9c6e6d..de1dc73d1fe4 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -502,7 +502,7 @@ int perf_evlist__id_add_fd(struct evlist *evlist, * This way does not work with group format read, so bail * out in that case. */ - if (perf_evlist__read_format(evlist) & PERF_FORMAT_GROUP) + if (perf_evlist__read_format(&evlist->core) & PERF_FORMAT_GROUP) return -1; if (!(evsel->core.attr.read_format & PERF_FORMAT_ID) || @@ -1239,12 +1239,6 @@ bool perf_evlist__valid_read_format(struct evlist *evlist) return true; } -u64 perf_evlist__read_format(struct evlist *evlist) -{ - struct evsel *first = evlist__first(evlist); - return first->core.attr.read_format; -} - u16 perf_evlist__id_hdr_size(struct evlist *evlist) { struct evsel *first = evlist__first(evlist); diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index 88890e6a3ac7..f0212738bed6 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -189,7 +189,6 @@ int perf_evlist__apply_filters(struct evlist *evlist, struct evsel **err_evsel); void __perf_evlist__set_leader(struct list_head *list); void perf_evlist__set_leader(struct evlist *evlist); -u64 perf_evlist__read_format(struct evlist *evlist); u64 __perf_evlist__combined_sample_type(struct evlist *evlist); u64 perf_evlist__combined_sample_type(struct evlist *evlist); u64 perf_evlist__combined_branch_type(struct evlist *evlist); -- 2.21.0