From patchwork Fri Jul 12 18:10:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Rogers X-Patchwork-Id: 13732144 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 252FDC2BD09 for ; Fri, 12 Jul 2024 18:15:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:To:From:Subject :References:Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=h8vxN+BliJztZySzkr/g5CS+2PgB0g7RSTmLzIMrgEM=; b=fw9BJdZINVNo35GpmeRUXT53Wd bEsktmURny/xbQ/vlBVNu5Tw77TKfFoeKy3DI80QGdwSBL2usxYyaF5TCOsacgyAyOsIsiT+FRHy/ /X/jdq89s6eTUeh5HRkbLCN0PMgQVUtPBYqIN6i6nQLQLvfA4GwBZpa3y8zO7yBpfV0IHhyzJ6B7U MEAY7qZKZNXxuWQkpiQ3WZbzZFVu+qjecq4dEOB2Fo9b0BiycxcdgHXrcUtXpNjtndkrtoeNmK7XS zjhvyXxkneHhDiO8lRhd8nmOWpPNwXKpXgNhtpqhYbmHu2abwYnon4EV5FEb9WR01b84KzQZ/H0Bo vPjBX16g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSKnV-00000000wVE-1LaL; Fri, 12 Jul 2024 18:15:09 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSKkz-00000000vKl-48KS for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 18:12:35 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-e02b5792baaso4277298276.2 for ; Fri, 12 Jul 2024 11:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1720807953; x=1721412753; darn=lists.infradead.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=h8vxN+BliJztZySzkr/g5CS+2PgB0g7RSTmLzIMrgEM=; b=W24kOFsT68Wc6QkJiTfnPXkIszEUh+iZCsS90E6uxoq66AgdnlEwN3oTnZWUYMmIOm 8idtU03jaDiMbzM+g9d4fA5R14e80EDphPXpb4alvKsd+cbaz764rXfF5ZyQ2JCfkNmI qGB+ro++ndvnBVjyEQH0jAwiwNioJGv2CMTYwWmC0+LUnvofxpOruF5IQHHHNHEcKrjZ JLvsyuWBtTU61PlB7MZEDF/lUgJgTWzDRno3spD+0mX0vxpH2Jt6qnVZiqmY/nVS30bs s0P9cW6FUWu56bTe/EDLnJ7gr66HK96NTp7g6sc4qNeE3tM0cS+3rsXtM+knukaaAMkE G2ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720807953; x=1721412753; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=h8vxN+BliJztZySzkr/g5CS+2PgB0g7RSTmLzIMrgEM=; b=XhDiHpIPPA99BnZB3GWERrs+02Jhpiv1GljL7jce+N+X/P6Q3tNAPoFVSMrPB9TtLF CPETISGlY7Z8MYIkArodphQsEc4dQjRVmSyrp5kgAeFLZfoIIlVr0SnJJ0hpqppCLXHO cswtHcRMBZrb5/NdoIc5CDMquHkqKX3DbE8nYLBumGoy6aFcaz2De+8waHWrOi4CK4dw dWNdoST5+HIcXm4FpSGhZawURixTDcIaWPSRnqUFlKO62MNzcdY4MrVLLVGGHs3RU7c1 JciImnqaxmOr18sDNLwDk0Ocdvv+FveEZayfGcbVo2JUCyeoWDVMFMEsZfIgnyGZ/S0O U2vQ== X-Forwarded-Encrypted: i=1; AJvYcCVJmSA9manJJyOTp9Jd9GolPDV/WZtrFkSZiRTiwev8H1y99w2Zd5mkINzMBq9xKdB3pbKTS+3KUgpmbT9rLCAyNCGJ3ZFu0TSOPllz5I64phxK9+8= X-Gm-Message-State: AOJu0YwUS5IdCbWSBP08r4hfHKZnhQuDHCGWK25jUn1Z7Ci0MxJKiClC 28DUbn4QH2yH1sjvBCE3abnsGZ54iqEGpdV5uAczuCaDvhS0+ijMH/vmF63TNbE/1BBBRaZ1Kfo 7vtTv6Q== X-Google-Smtp-Source: AGHT+IFvEFbuuviGSmLFXUVSDoQ/Q3jbvrU0W1ZoOeFfj2ue4Hk0CIvrQDw/sTMW/RbAltKLHza9t11YT2eW X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:2e7d:d47a:a0c6:e3b1]) (user=irogers job=sendgmr) by 2002:a05:6902:260d:b0:df7:9ac4:f1b2 with SMTP id 3f1490d57ef6-e041b04f0a6mr910569276.5.1720807952786; Fri, 12 Jul 2024 11:12:32 -0700 (PDT) Date: Fri, 12 Jul 2024 11:10:51 -0700 In-Reply-To: <20240712181108.475336-1-irogers@google.com> Message-Id: <20240712181108.475336-11-irogers@google.com> Mime-Version: 1.0 References: <20240712181108.475336-1-irogers@google.com> X-Mailer: git-send-email 2.45.2.993.g49e7a77208-goog Subject: [PATCH v5 10/27] perf evlist: Use perf_tool__init From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Suzuki K Poulose , Yicong Yang , Jonathan Cameron , Nick Terrell , Nick Desaulniers , Oliver Upton , Anshuman Khandual , Song Liu , Ilkka Koskinen , Athira Rajeev , Huacai Chen , Yanteng Si , Sun Haiyong , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240712_111234_030451_E70BD056 X-CRM114-Status: GOOD ( 15.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use perf_tool__init so that more uses of struct perf_tool can be const and not relying on perf_tool__fill_defaults. Signed-off-by: Ian Rogers --- tools/perf/builtin-evlist.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-evlist.c b/tools/perf/builtin-evlist.c index 7117656939e7..818ab21c3f73 100644 --- a/tools/perf/builtin-evlist.c +++ b/tools/perf/builtin-evlist.c @@ -35,13 +35,13 @@ static int __cmd_evlist(const char *file_name, struct perf_attr_details *details .mode = PERF_DATA_MODE_READ, .force = details->force, }; - struct perf_tool tool = { - /* only needed for pipe mode */ - .attr = perf_event__process_attr, - .feature = process_header_feature, - }; + struct perf_tool tool; bool has_tracepoint = false; + perf_tool__init(&tool, /*ordered_events=*/false); + /* only needed for pipe mode */ + tool.attr = perf_event__process_attr; + tool.feature = process_header_feature; session = perf_session__new(&data, &tool); if (IS_ERR(session)) return PTR_ERR(session);