Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp279025pxb; Sat, 21 Aug 2021 02:23:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxti1tpVK0dbd5RtUXIXpsX1cxudD4z1wwVuF9x+8OjXrJBRj6AOqh71nGVberxc8msGRyZ X-Received: by 2002:a92:d582:: with SMTP id a2mr17914250iln.261.1629537791233; Sat, 21 Aug 2021 02:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629537791; cv=none; d=google.com; s=arc-20160816; b=Kb73S/C5kizfn44ZsKkQdL30NCcDj2imow+NPimi5IXwCjCOt2xMpPR5sM/vxiON8b rbZgs8VVZnFt4JQeXb8DoUVCO/fbI25rUeMK6xdLd2c93MOTQpWVJIroaU416chT9iSW 1FT2u7eHsLH45HZ4vHNEL8Q7E5tbUY3DclPxQ+7eUH+SPmEcTP8/GlDkw0lLwMIYmpDC Qq19mmAJ1NFRhlUrM9z5BgKtk3mjikTX/xoB+J4qqTB6z2Su4XBcim4OYoWdS0g6JnP7 JtaGf7GiLcKxxydknOnGvXMVB7NIOLk9BxO/NtOSPFudztAiKZ4V//2QlhHlHI8UgAON 13+A== 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=9QtVrbhUZ3Hz139HgNIy3r2BPh97ZYhKrBaN0u3auT0=; b=m7az98w5a2D7qFaYzZ1pZM6/M6KMioVtHutR6h6K96r9wMc/9KYS5C/9l7CCBj/UPX 6HtB70zQdQzPvZAOJ2QQQxTkmMV0/Ml+5IH8ZZHejw3gZG7B9WlkInHDUWGEYJKj9rqp IK+Hg02Z+XtXABq0A7MzXSua6np6KpBygd5Y3TyssNajau5I4gdkeQ4gJgI3OYQNFi5Q LAn4DdkhVvHbHpIQm1YX+olN/r6WZ8ZTs1lIKXD2fBE6x0W4c9WY2fAstbNzeIGTdIx3 sXiLRj+6X7lelrkv6dVXuPKnESg780p0Na5loYEAsSjEyHtCuVjFiGyTFMukDRhUrGeg 7R6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DGc30yDb; 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 y12si9326605jai.84.2021.08.21.02.23.00; Sat, 21 Aug 2021 02:23:11 -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=DGc30yDb; 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 S236985AbhHUJWv (ORCPT + 99 others); Sat, 21 Aug 2021 05:22:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234663AbhHUJWM (ORCPT ); Sat, 21 Aug 2021 05:22:12 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA7E6C061147; Sat, 21 Aug 2021 02:20:23 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id dj8so17663773edb.2; Sat, 21 Aug 2021 02:20:23 -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=9QtVrbhUZ3Hz139HgNIy3r2BPh97ZYhKrBaN0u3auT0=; b=DGc30yDbq10hT70Gm0uu0F0HMpNHf5J1ZCabb5/ql6pQ3LOwTIwaH9Ae86bdHHu8bm rlJTeCXr3NfO84mQ3Bb4iWo34tFO1MuV7V1TPqaK1Fh3j7IZt2Lx48xhzTo0wPesdiTO f//2AOdzNPmlGdSTIWcY3p9UuaeEsYSRaHWB+MHT0XOwsU97KnrBBdyfks/ob7Xlt1D8 NO5E5wZpnzZEoRc/TRww20DlATvS8eGa5ccYibAK+YGWrlaAICTU1aT2FZMhW36/oAq7 rr8MQiCGbWSaD69wb/uVHP0OcMZnUbU5vMf4xnkoT/vhKHxzPGHcwSBnY7EqQnTnwucf W7hA== 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=9QtVrbhUZ3Hz139HgNIy3r2BPh97ZYhKrBaN0u3auT0=; b=D3GOg+AItVYPLi3y/i7GEj5OzEU27WkK2u3Ql+uX2g1q2u4o8gDOP5OSY1LKQGQCWi 8gI5FwAsC0Pr0acOhffPyfeMllOM/HZ0tH54BV7zwAFBUwx40QeN4mjTIelYKPvNVW5p PwctdrJhmx1rcQECQWgoYQCeXe2MBUQDBO9rTMomLW8xhoOxTOw88sIVi4f4MXE2k8ka 3m6OYDr+YVTfktaXT1Dk7ZcHy54SiGq9EvllwNZscCjFWfuRXX5IMbj4GuCv8mF5atEY nAiK2Apj6N4xPl4GUPMHrisB1QLKRv46jA45u1Ubrv9GvuKPgKKpgf4fSnRY7h1ACkgg Ut2Q== X-Gm-Message-State: AOAM5339Ml33353ZR7iEAdvHeEgfkyJQ0MWe65S5M984bOQN1uw7XYvx NvaBqP8aWcARRumqQwjH4pY= X-Received: by 2002:a50:998f:: with SMTP id m15mr26362842edb.193.1629537622314; Sat, 21 Aug 2021 02:20:22 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Aug 2021 02:20:22 -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 27/37] perf evlist: add evlist__for_each_entry_from macro Date: Sat, 21 Aug 2021 11:19:33 +0200 Message-Id: <2386505f8b598adf0dbcd04ec21804c6bcf00826.1629490974.git.rickyman7@gmail.com> 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 patch adds a new iteration macro for evlist that resumes iteration from a given evsel in the evlist. This macro will be used in the next patch Signed-off-by: Riccardo Mancini --- tools/perf/util/evlist.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index 5f24a45d4e3cf30a..b0c2da0f9755b2d1 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h @@ -275,6 +275,22 @@ void evlist__to_front(struct evlist *evlist, struct evsel *move_evsel); #define evlist__for_each_entry_continue(evlist, evsel) \ __evlist__for_each_entry_continue(&(evlist)->core.entries, evsel) +/** + * __evlist__for_each_entry_from - continue iteration from @evsel (included) + * @list: list_head instance to iterate + * @evsel: struct evsel iterator + */ +#define __evlist__for_each_entry_from(list, evsel) \ + list_for_each_entry_from(evsel, list, core.node) + +/** + * evlist__for_each_entry_from - continue iteration from @evsel (included) + * @evlist: evlist instance to iterate + * @evsel: struct evsel iterator + */ +#define evlist__for_each_entry_from(evlist, evsel) \ + __evlist__for_each_entry_from(&(evlist)->core.entries, evsel) + /** * __evlist__for_each_entry_reverse - iterate thru all the evsels in reverse order * @list: list_head instance to iterate -- 2.31.1