From nobody Thu Dec 18 05:30:59 2025 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A8F87581A for ; Thu, 18 Jul 2024 01:01:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721264480; cv=none; b=i8KpKHGpkRF3P1jhqD1sgOJiXC8inJhXbodvaeP46GQ9Tvzx5vPVsyVQC31vMmVFAuh5rp4SVFfFw6YS6TApc9SIYWe4BfT58WBglLxf8VSDC+zZ6IdqD2eEADP4kBopuKUxricqvQsGn/oxZ0oELNNrBUMZO000NiKRS3mnzmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721264480; c=relaxed/simple; bh=6n88zCXwG9bSPE66xVrogeJqWiH/mhJHqZDV/21qFRs=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=k8YISckYJsSDAU+sHa0oCXMo9kOphbNqva+dmZXsZRA/oRlkoVuDjqIL4TtAPNq0Vd78yAWavZXSrpT6Zmhl0ADPVKxmjb1Xx7ePi/IceQGlyctqwoZgBpF2wPr+m2ngCdnWsiRPBFpehj+NeWorX3iw3OrD24+z1Mjw4PR+OhU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=WWZK5MFG; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="WWZK5MFG" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-65fdbfb8fe9so6128117b3.1 for ; Wed, 17 Jul 2024 18:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1721264474; x=1721869274; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=AE1o9GzylDTNU/tj+neWnduRfzORtFIhqRzpNenF16s=; b=WWZK5MFGOscimF/pHy7HO3SHDrp65DK2CYqUmZybdyIHSQRdUmNTKo7e1QcI35wveu 3d95JicckjFaUAZzcJd2O8zhFW0Ql+HTMEYrvsuN3VfuXmwxUKYwnj0xOTqKR1Z3X+wb jlQAbS8gDD8IVecWbSoQi/MrYwNLx43i69Ni8FA2YV7FGhtw21zVCMwjPEtNf/ZDZlNI 2FtZg8tbnDHRyfPidxqKuheIZsS010VDneP4HiUKOI6z4iNxFmk34Jjuljb3GIjCrUyJ YYnENLXzb7hBQzdswvLs+dmLktH2j51WS0CcCASrDoNY9DdVXn1RPWloG00MdLKpUMh5 3+3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721264474; x=1721869274; 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=AE1o9GzylDTNU/tj+neWnduRfzORtFIhqRzpNenF16s=; b=gCIkU0HWVe1GjWtNvHdx3dIQYrc6y5iTp4j+SytSfNiDMDZebrFbodVuILBTsqoCsq frTZ74QDaXojynCWWKXKmlYLuQvPcUvI5Athd4hgB7vPc1z4aVBmzhe4ox7S62+s7BrE /DVCFOTvL0/yZH52EMlJugtDZsBcqYcQnpRyRoEsb8u6Xk/jh1oKOjUghm/SN7dNrUAN MEHAl+l6PukapLNQqMQTkQZnuSh/bKOLeKZynYiEGCH/X1+KCqjP1LMXNkHg4XexYf/B bS4lslx3RTqjq3yrYysp8DTDXcozzLVbLIn3qFyCm5cE5Kvj2PdM0Kph/NBeyGIBazuh J1Ag== X-Forwarded-Encrypted: i=1; AJvYcCVrDmMLR1Vs2tpvfhHKgk7AJL7YXhsgwNK+98hClvdgPGKkqyxExp3vpYYXEmq+4uh+qkJV7eNRrr3/Lw8lQueu4OlqBHmDuuGozBFb X-Gm-Message-State: AOJu0Yw8HAY05qPG9BK0ywecwL0G6uSrk0NcTMuPAthiQQAoVCQGJqMR GHnxHkg1w6bPsXrdx0lJqZxiiulBMvGZffvnF8Fp2wyi9wTbpDXvqXWVHk40J+4/0jbpKqjOWvW ZfjNvEw== X-Google-Smtp-Source: AGHT+IGgBhJ/vZuBVSyFSptR6UrX0xinXo4sb/hBXkBYSLP3hMqMO6tKzBxK9aNEcm7jyYNyXiyoQrcO72E7 X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:940b:9044:fa83:4060]) (user=irogers job=sendgmr) by 2002:a05:6902:1245:b0:e03:a0dd:43c1 with SMTP id 3f1490d57ef6-e05fe74c656mr10367276.0.1721264473975; Wed, 17 Jul 2024 18:01:13 -0700 (PDT) Date: Wed, 17 Jul 2024 18:00:12 -0700 In-Reply-To: <20240718010023.1495687-1-irogers@google.com> Message-Id: <20240718010023.1495687-17-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240718010023.1495687-1-irogers@google.com> X-Mailer: git-send-email 2.45.2.1089.g2a221341d9-goog Subject: [PATCH v6 16/27] perf stat: 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Adrian Hunter --- tools/perf/builtin-stat.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index d460c46f15fd..a3d77a55d17f 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -2271,15 +2271,6 @@ static const char * const stat_report_usage[] =3D { }; =20 static struct perf_stat perf_stat =3D { - .tool =3D { - .attr =3D perf_event__process_attr, - .event_update =3D perf_event__process_event_update, - .thread_map =3D process_thread_map_event, - .cpu_map =3D process_cpu_map_event, - .stat_config =3D process_stat_config_event, - .stat =3D perf_event__process_stat_event, - .stat_round =3D process_stat_round_event, - }, .aggr_mode =3D AGGR_UNSET, .aggr_level =3D 0, }; @@ -2322,6 +2313,15 @@ static int __cmd_report(int argc, const char **argv) perf_stat.data.path =3D input_name; perf_stat.data.mode =3D PERF_DATA_MODE_READ; =20 + perf_tool__init(&perf_stat.tool, /*ordered_events=3D*/false); + perf_stat.tool.attr =3D perf_event__process_attr; + perf_stat.tool.event_update =3D perf_event__process_event_update; + perf_stat.tool.thread_map =3D process_thread_map_event; + perf_stat.tool.cpu_map =3D process_cpu_map_event; + perf_stat.tool.stat_config =3D process_stat_config_event; + perf_stat.tool.stat =3D perf_event__process_stat_event; + perf_stat.tool.stat_round =3D process_stat_round_event; + session =3D perf_session__new(&perf_stat.data, &perf_stat.tool); if (IS_ERR(session)) return PTR_ERR(session); --=20 2.45.2.1089.g2a221341d9-goog