From nobody Sun Nov 24 21:57:08 2024 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 C432D1AAE0B for ; Sat, 2 Nov 2024 16:54:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730566456; cv=none; b=kMxvZh3ZBOl9cEAgsDzMbxvlupS7eAMfeDI347YOKEqEvLPt0tNbqbs9mtlD/IvyGGvKMmcUbDyAMXmPxLFy8lbBUM/ecoIPAcQ9AIHMKlVW/n9VrowkAEF+Jzp1XI03QSVp3NCjZzmeO6aLmcPpbbja5jx57uAEgig0/o/KRFo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730566456; c=relaxed/simple; bh=jqtfqcDozTYMQzjOGe7gtUqSxh4PDuu/Rn5JE1kCsYM=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=mZCUQBbNLeCzq+2iKT6h2+3/lkGbeeJT8pnmdSVd4jyWTrnY5IQHnTDSCWiDYHTeLLN0VNBhlTcjWAREIluUijyE+9ov4sEAC/vzIqhqbUBvD6QvcNqnIcEklXXViF3Ot0xKV/d7AeAKz89W6g9plr3GxPDOqYMpsrN0FH08XwU= 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=QXglA3+L; arc=none smtp.client-ip=209.85.128.201 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="QXglA3+L" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6ea527764c3so65217677b3.0 for ; Sat, 02 Nov 2024 09:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730566454; x=1731171254; 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=kmeR/ooJwGRf7dfAO7pFQRGOg67G8nX2zbSdm6KkuuA=; b=QXglA3+LQdT8Q5Kjr7m/cxW9naHt8SY2dhi4+CxBJSiTtxa7OIWppFNN+xI0QubqC4 oLio/rDTRDaReCw/2ODvlvclJENjFvJHuHvC8xZpfzzTCsf5we5I2oNhG9W0KEUcO2DN dbFus9nFrZJKymzLvMzontD7vb/qKmQi4KAgmKPBYKkpv9+ow36JUCgMK7Y5PESfKfQT eAkbLUAjwvSF+F2zQ6VGmawptyMCi1eGB+Zx93Gk6UL67DSvAizWgavyMAOX0KZIxfa4 vQyRySBKDYosFgoDjY+98IIYD8fFVDbEfqkGQCoGWgcOrh2t8s7ZtAfWkqUozI3j4JOK J0CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730566454; x=1731171254; 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=kmeR/ooJwGRf7dfAO7pFQRGOg67G8nX2zbSdm6KkuuA=; b=NUlHEee7fc12cShkU5Qy1uDhbGrXEzBGnebsxrfRj2lRoFJtNWi8LvJSp8EuBt7GV4 J/1k0aAh1iiAOXoy3pBPzql6NRsTiaecsMGl4nKsSCUMadoF7yd0D0G54cKx7tlrHKPl gPQZb94yhNZyVyZJPX5jV7HGkChYOxXwQirIGr1xn1S8/L7E7qLTBAVFUnRH2xnuRZN9 EMgY7MAcsT6Vxltjd0N274czhXgdf0Y/mW7QhLDq1ab3FHWZ4e4JpBk+5VCw6kqzI78r EVRV8Uf5CMkg61TW4fW+tzqu6vwEa5d2pK54Uw9mrCIQMx0uMzXdrKpz2cxYsEXZlcEn VPmg== X-Forwarded-Encrypted: i=1; AJvYcCX/yTN0UWC9Pdoja7zalqn+lh6y45aBevsikoruBsHvX9nUpDSNWvkdASYJguEk5I5r6cJXTh0WwxBF/cw=@vger.kernel.org X-Gm-Message-State: AOJu0Yzx98rQAeBs6zst+5/4TMPDOAcpgDZDCI/yq9hunFa6YcS/a3fG QYKxYlmhamfIxYHE0C3pFVk5Bl14y2ZPqY43PAjWxXRiGvFL5tRzwY6ZgBj9aE8UgHBmQ34Dchu /OcncbA== X-Google-Smtp-Source: AGHT+IFq/57/M1dR4TI5sTZFRkJ+7pfYTpS18HTUCeIYozNVMDf4uGtf39Rs8KrRHBzucavqtbOBsbu5v5wx X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:26a5:cdb5:356c:64a4]) (user=irogers job=sendgmr) by 2002:a05:690c:45c5:b0:6e3:b93:3ae2 with SMTP id 00721157ae682-6ea3b88e882mr2411427b3.1.1730566453754; Sat, 02 Nov 2024 09:54:13 -0700 (PDT) Date: Sat, 2 Nov 2024 09:53:56 -0700 In-Reply-To: <20241102165400.75785-1-irogers@google.com> Message-Id: <20241102165400.75785-3-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241102165400.75785-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.199.ga7371fff76-goog Subject: [PATCH v2 2/6] perf trace-event: Constify print arguments 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 , Athira Jajeev , James Clark , Dominique Martinet , Yang Li , Colin Ian King , Yang Jihong , "Steinar H. Gunderson" , Oliver Upton , Ilkka Koskinen , Ze Gao , Weilin Wang , Ben Gainey , zhaimingbing , Zixian Cai , Andi Kleen , Paran Lee , Thomas Falcon , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, "Steven Rostedt (Google)" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Capture that these functions don't mutate their input. Signed-off-by: Ian Rogers Acked-by: Arnaldo Carvalho de Melo --- tools/perf/util/trace-event-parse.c | 4 ++-- tools/perf/util/trace-event.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-ev= ent-parse.c index f0332bd3a501..6f11ca5513e3 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c @@ -99,7 +99,7 @@ unsigned long long read_size(struct tep_event *event, voi= d *ptr, int size) return tep_read_number(event->tep, ptr, size); } =20 -void event_format__fprintf(struct tep_event *event, +void event_format__fprintf(const struct tep_event *event, int cpu, void *data, int size, FILE *fp) { struct tep_record record; @@ -116,7 +116,7 @@ void event_format__fprintf(struct tep_event *event, trace_seq_destroy(&s); } =20 -void event_format__print(struct tep_event *event, +void event_format__print(const struct tep_event *event, int cpu, void *data, int size) { return event_format__fprintf(event, cpu, data, size, stdout); diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h index bbf8b26bc8da..084068fb36a1 100644 --- a/tools/perf/util/trace-event.h +++ b/tools/perf/util/trace-event.h @@ -39,10 +39,10 @@ trace_event__tp_format(const char *sys, const char *nam= e); =20 struct tep_event *trace_event__tp_format_id(int id); =20 -void event_format__fprintf(struct tep_event *event, +void event_format__fprintf(const struct tep_event *event, int cpu, void *data, int size, FILE *fp); =20 -void event_format__print(struct tep_event *event, +void event_format__print(const struct tep_event *event, int cpu, void *data, int size); =20 int parse_ftrace_file(struct tep_handle *pevent, char *buf, unsigned long = size); --=20 2.47.0.199.ga7371fff76-goog