From nobody Sun Nov 24 14:46:02 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 9BCCB216212 for ; Tue, 5 Nov 2024 21:27:04 +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=1730842026; cv=none; b=B6A4KVNYAK/mQekQTSeUd3pTMJuUB+HD5S9ukrhQvqznH3Rgf3dMfPhbM/3EFPZ8ctQFmZ3S9IZNoo2sN5n34/HVU4ZY6++BbX8HWi35Aw4JJlB4Jp01dzoOwd1wZw3mQnJto9lZgJgJSSgfFs1jvejcZb4a6gN/WewdFYMxJIo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730842026; c=relaxed/simple; bh=jqtfqcDozTYMQzjOGe7gtUqSxh4PDuu/Rn5JE1kCsYM=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=WdrG/gnNkwMHuRc3s5RIsmjLetJ7vJ07OI7iH3/qi70da0oMhJI+Ngemy+WSbu/MT1Q/Tr2idpAf8xbARiT/z9z01Lvr4wMSaa1h7ah8PmlE/NiNVlyvL85UfcTVg0/fle064096XxacD0QSHbhwca3S1LKGvGuSGKxwQ1AYmcc= 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=A4kx+TGc; 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="A4kx+TGc" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6e5bdb9244eso96402617b3.2 for ; Tue, 05 Nov 2024 13:27:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730842024; x=1731446824; 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=A4kx+TGcsaI8q4DMua4oVZ1QbZYlqjaHViLDCiXntx07NShMSO6A80fyD6yBxgiqiu yA8vTuveODpme9alhCvMbyhkLrYShTDc0td9a6RTMCooDW73t4uPBJKOfi05YpQQrjAi ZCBI0kM9LLNWBLlRC4rOEgqDa0GM1jeUPftweeAW9ECjy3CizO1ZgPPMLZxwm/LfAMmO WQyy3a24zrx1MsfWaf1tAbz5H2u5zCTWtgxv7vAhjAmbtXmJOpzI24QYqBf5w13w/3sF ihJwwYMj30jgxNmgVZ8/M1ngXKoS/qmZrnch9imVl1VaJV4q+ggpHBR8ag5gehYk3C+0 e9pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730842024; x=1731446824; 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=hos9seyE+f2J1TDFxAne/y9HtwjIAkRQ8/7/9g20/YX5CtbgedcA1xvkggv6grRUgR qAF0LXv7IkBVPBrgtO8uP5jrPfd9fV2V7zGNyzH0/BzV7MbU4VYCm/uVHHghT3HajYhm fQvot42Cci0l27KJnVgNmxMC8/AtrDQMgFNCvZ6idEAcONs9LzS84Rh+yifFoiGM0nRn MEjlD79vPBpcyPuRzh+d4NqqTDWrxuFAidZNGImd1MjyWA3vOvwh1tkML7Y7hG2llb4b Awocjhr8e4n6VUDg/bxWX55kNrEJL5V+4NWah9uHP2sw+dKxA/zY58OXRVC/zkBGXg9Z ql/Q== X-Forwarded-Encrypted: i=1; AJvYcCXgHwXwn1zT/SgE5LnkNANoJgvh8Pncp6lENa4aJO0FZStbp92cCHaFFVku3fkVAGspEFpJMF8OQVAqGos=@vger.kernel.org X-Gm-Message-State: AOJu0YyPRbbsf96NdcL+15noJX+/HmhZvg002ALjXZp/pcHH35FY+yoJ UrfEXZUzHR6ketOngd/sFck0TdbzJCLtmZQBYrBG9uV5GwK2u/8lEfrjFjwTuMGOEbaS9vJoKRk 6h6EPkQ== X-Google-Smtp-Source: AGHT+IEROMSZbX3H3SqE2W1/i5uYPxQiYSylSWGjEsgYWi04FdojKOXP5FLW4BaITLNn/wZr0DKGH+cV4qpf X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:ff9e:ab12:75ac:c1a0]) (user=irogers job=sendgmr) by 2002:a05:690c:23c8:b0:6e6:38:8567 with SMTP id 00721157ae682-6e9d8b296demr2527807b3.8.1730842023763; Tue, 05 Nov 2024 13:27:03 -0800 (PST) Date: Tue, 5 Nov 2024 13:26:48 -0800 In-Reply-To: <20241105212652.401943-1-irogers@google.com> Message-Id: <20241105212652.401943-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: <20241105212652.401943-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.199.ga7371fff76-goog Subject: [PATCH v3 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 --- 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