Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp279099pxb; Sat, 21 Aug 2021 02:23:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZnkTJQVR27GvwFGdgPINZ5FKIObKUlKm8Zv6dOMh+aosbhRDC42NaYNCZAutwLCnJemyM X-Received: by 2002:a05:6e02:1c08:: with SMTP id l8mr16604492ilh.134.1629537799132; Sat, 21 Aug 2021 02:23:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629537799; cv=none; d=google.com; s=arc-20160816; b=RKyXyXlsHbunTJGTssC/LUYZ0ErD/P9guoR8fzoKlRipPIJmStAJSWr7yKpEwLKzZy BJ8fOwDvonfa6fyzXEhaQPDvM2jFh0kTNwNTFYuWpWZ/tWqCwErZlJv5jsuvB6vu3Ff1 Ldzab/ty1EpOvnLHUUOtVbtgBZY2VoWbUqiUBr4jsT9Pv3OLrhj4ehTalJKprwTlE7Ay EwG0igdueAqld2fD2PwoN1km4Dac36YRmeiOZTDq7ort8XlrtGLhju1zP+gpF4bAa5Rp iUArC/yTaftrepwN9apgadyZj80VECjO2rwjEtyI2D93bU22JsgAyKXArzcMCdej/KWO RJ9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/cXCUrZyJrSXhlY2buOOLYVNdgfOW9khyRbxBZB9LKU=; b=O4oobV5JCEwouNyedXIfCrjHO7pKX9ltEGCMC0MssGSjHXVWnd9SY5jqekNs+ZmjAD RVdU6f0B23p/XOHl/ACIzpefEwKpOzsmRaZG4eA/iOtbv9uul2s8cnvVfYT/YqDN/M4L 8KFv7BoeA3Ncus47x2fbG8dexxW8JdV1fSWdlj0vLGQjMdpC1scORNzp5Ej7DLi69C4a CeYr3XrCzAIzGh9BgmVRczADaDlheJ6rVoAHHdlmb0V2rjPweSVwGSmbh1XfJtV/UvDn 3MeXn9Io15m+iaHQqIAQ3CxbodTJ2zTIBI9hOMOQdyv2IATj7Npa0aEW57eQG4rpNfek ZHrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NKl0D4hS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si10220645jat.10.2021.08.21.02.23.07; Sat, 21 Aug 2021 02:23:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NKl0D4hS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235023AbhHUJVz (ORCPT + 99 others); Sat, 21 Aug 2021 05:21:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234431AbhHUJVS (ORCPT ); Sat, 21 Aug 2021 05:21:18 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36482C06179A; Sat, 21 Aug 2021 02:20:12 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id s25so4933431edw.0; Sat, 21 Aug 2021 02:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/cXCUrZyJrSXhlY2buOOLYVNdgfOW9khyRbxBZB9LKU=; b=NKl0D4hS5TgUd757ZzzuL6NG8v3TvbZa1fdRJuOXQsnhL8YWP+PBmfc7Pa3/umlC8n ZFozMkcSYSTW05ngDMNqMASPmiQWXMwAUVrC0F42r9qCCs5V1nPikMsnDkT0/9Hvq7cK h+D63O9VduzhNF3uY5Tf/SBEefx06Wc6SFV2smWwtHBDG+wtyqid7QUOhFyAf5J3mt0P yWsn/ZKuEiaQ2a9yG/bKlyq9fmaK+qmmzwnw7f2n8HB5hxysJrXHbQYP9HEpSiuwY/9K fpJm2Bsk3sWwkTYef8YGMCJGdWlXQprwJ68v5xylCX1c9JMWTnXFrswS38Mg1kkUgk0y DOWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/cXCUrZyJrSXhlY2buOOLYVNdgfOW9khyRbxBZB9LKU=; b=o5HPEGFvBDWltriq3lYy8sdYgxGfczkCJo6IJ2TD5mPSe8OiqjYU8gZ9PvEfS7/QQR WmVN6sbTuLjb6HQzSfoLSVYIMH924LsZerv1zRCeCggKzC2zBQV0Fopw/W2Y/Zjz7n2G k+Xvc1bmbKdmx1fmaVv1IJR7kJ0Xb7W8SxbXLB4oAz/3w+Rnk+Qr5wazlfkHde8XWU58 e6pKWpMspj+YuIgG8QOppAtGuqP3HeJbDYBSrVxJAmSIs8FFTrVMwCkGp3HZ+JtVbAE7 YjndRH/NJQDrSAHrWKRpyYVZcFiKj85nvCVbRAhiwTjS8xk9zw1EKTOYzsq/qiVuG+of 7wjQ== X-Gm-Message-State: AOAM533fWkbr0JxsuhzcdNUiBlrhMET5ITmaLa/ysye0fs2ns9LqnlID 9PIPakKf55OkrdUZQTID0jc= X-Received: by 2002:a50:cc0b:: with SMTP id m11mr26358893edi.96.1629537610818; Sat, 21 Aug 2021 02:20:10 -0700 (PDT) Received: from honeypot.. (mob-176-243-254-204.net.vodafone.it. [176.243.254.204]) by smtp.googlemail.com with ESMTPSA id a25sm4003878ejv.91.2021.08.21.02.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Aug 2021 02:20:10 -0700 (PDT) From: Riccardo Mancini To: Arnaldo Carvalho de Melo Cc: Ian Rogers , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Riccardo Mancini Subject: [RFC PATCH v1 18/37] perf evsel: add evsel__prepare_open function Date: Sat, 21 Aug 2021 11:19:24 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This function will prepare the evsel and disable the missing features. It will be used in one of the following patches. Signed-off-by: Riccardo Mancini --- tools/perf/util/evsel.c | 14 ++++++++++++++ tools/perf/util/evsel.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index f0bc89f743915800..4e9a3e62075305f1 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1827,6 +1827,20 @@ static void evsel__disable_missing_features(struct evsel *evsel) evsel->core.attr.sample_id_all = 0; } +int evsel__prepare_open(struct evsel *evsel, struct perf_cpu_map *cpus, + struct perf_thread_map *threads) +{ + int err; + + err = __evsel__prepare_open(evsel, cpus, threads); + if (err) + return err; + + evsel__disable_missing_features(evsel); + + return err; +} + static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, struct perf_thread_map *threads, int start_cpu, int end_cpu) diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 1c0057e80d080f2f..58aa998e1814ac9e 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -286,6 +286,8 @@ int evsel__open_per_thread(struct evsel *evsel, struct perf_thread_map *threads) int evsel__open(struct evsel *evsel, struct perf_cpu_map *cpus, struct perf_thread_map *threads); void evsel__close(struct evsel *evsel); +int evsel__prepare_open(struct evsel *evsel, struct perf_cpu_map *cpus, + struct perf_thread_map *threads); struct perf_sample; -- 2.31.1