Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1020971rdb; Fri, 22 Dec 2023 11:56:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfwijxnl6HOyeZsEQJbBRBKO7PPbMfPCGtyrwq6fqAxIZQFuSH/Y7EyI/42Z0hXaIFizXf X-Received: by 2002:ad4:4d85:0:b0:67f:a104:bbbd with SMTP id cv5-20020ad44d85000000b0067fa104bbbdmr926009qvb.71.1703274959940; Fri, 22 Dec 2023 11:55:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703274959; cv=none; d=google.com; s=arc-20160816; b=eaIFlTdNS+/6NQWz3a6A1XA856499YNJGGJ5kog8Y6+Ff8Pz/Vr/kgAXbS72Tw6k+n tAVuRaYMOVnO3B9oG6q2/ZEuksRTl8Ow8+oWrDvUS93hEN2qEPcgN5V+Z7ul26mr4XTY g7j2Gf4+R4c1g454VefJ5l/rQLNKyuTzQ94H8mhP1Ze3WJyuwQWsTAB+Cs0hQrTmqWej qYjidphKHU9xn2MQtGOwTS3OvBFfEHVk5kezIjU+O7Rf8lhfPStGJTh4kOtQ0cBj/2H0 77olbN4v7zlKo+hY3f3pL9phVNGnnJR4Eu4YSrK7LNJA8Esl5Qh2Rx9OzIiZMOA7aQsF U7ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=a+3i4loybtPdN0BnSihZonArbdMyz7IERtq4xLgkTQM=; fh=xprWcyUKTLi4rhte7gFCvduD673j12awuFkCPnYDQVY=; b=BhA3FpDPlGBjHiHaeNkospAZnCvxdKidJUd9RD28UY274qI4hbBkbYBpDdfW5KxAc2 PJGVKKiJh3d89Yy/DrIDg+zV/F7oi2rFO/HhKXa5kNDRf8yKRptiGjNG2aqEH/SWdBOt 8zeQlAEntSTh2NG5m1C7Ef9s2XsWxyb58fa4B2MrmObgdDM0uwawwdhe3K8TsqsnlT0e VTGyNrfKYl4S0zxiVht0crKVcUhVdZLfGGLv2LEiS1QTc4Eu8cnUSSGtB/IrNf5nMUzD 9KJIzM8mhAwVKwQaQsXTV5xTaxZKgaZcqLevApGklftssl3rOxTBgEHixw68KcnrkEPJ C4yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=UnmFO7dg; spf=pass (google.com: domain of linux-kernel+bounces-10044-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10044-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w9-20020a0cdf89000000b0067f9c419238si1346235qvl.34.2023.12.22.11.55.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 11:55:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10044-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=UnmFO7dg; spf=pass (google.com: domain of linux-kernel+bounces-10044-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10044-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9FD3C1C22D49 for ; Fri, 22 Dec 2023 19:55:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B47DC2FC5C; Fri, 22 Dec 2023 19:53:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="UnmFO7dg" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-fw-52002.amazon.com (smtp-fw-52002.amazon.com [52.119.213.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 119E53309E; Fri, 22 Dec 2023 19:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1703274836; x=1734810836; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=a+3i4loybtPdN0BnSihZonArbdMyz7IERtq4xLgkTQM=; b=UnmFO7dgnpQoIvHDXRPrXy5s8+CTuS4fPU/9ATOSqq6mp73kNjrpWCz8 CESTzsIfNwxpXTW15n1Q+pzr2YSdobCEDEZCLmDepUHXcnw3HsB3+E4a4 P+PBBh/icwJlUjldS+vV69tpyCTs7cMc8n2FSvcdSnDmDQSDDYZ7hLARW U=; X-IronPort-AV: E=Sophos;i="6.04,297,1695686400"; d="scan'208";a="602627379" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-pdx-2b-m6i4x-f323d91c.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-52002.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2023 19:53:53 +0000 Received: from smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev (pdx2-ws-svc-p26-lb5-vlan2.pdx.amazon.com [10.39.38.66]) by email-inbound-relay-pdx-2b-m6i4x-f323d91c.us-west-2.amazon.com (Postfix) with ESMTPS id 69E8040DFE; Fri, 22 Dec 2023 19:53:38 +0000 (UTC) Received: from EX19MTAUWA001.ant.amazon.com [10.0.7.35:18182] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.15.218:2525] with esmtp (Farcaster) id bf3bafa8-c33b-453a-b6f8-9e29248b4425; Fri, 22 Dec 2023 19:53:38 +0000 (UTC) X-Farcaster-Flow-ID: bf3bafa8-c33b-453a-b6f8-9e29248b4425 Received: from EX19D020UWC004.ant.amazon.com (10.13.138.149) by EX19MTAUWA001.ant.amazon.com (10.250.64.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 22 Dec 2023 19:53:37 +0000 Received: from dev-dsk-graf-1a-5ce218e4.eu-west-1.amazon.com (10.253.83.51) by EX19D020UWC004.ant.amazon.com (10.13.138.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 22 Dec 2023 19:53:33 +0000 From: Alexander Graf To: CC: , , , , , , , Eric Biederman , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , "Rob Herring" , Steven Rostedt , "Andrew Morton" , Mark Rutland , "Tom Lendacky" , Ashish Kalra , James Gowans , Stanislav Kinsburskii , , , , Anthony Yznaga , Usama Arif , David Woodhouse , Benjamin Herrenschmidt Subject: [PATCH v2 17/17] devicetree: Add bindings for ftrace KHO Date: Fri, 22 Dec 2023 19:51:44 +0000 Message-ID: <20231222195144.24532-12-graf@amazon.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231222195144.24532-1-graf@amazon.com> References: <20231222193607.15474-1-graf@amazon.com> <20231222195144.24532-1-graf@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: EX19D035UWB003.ant.amazon.com (10.13.138.85) To EX19D020UWC004.ant.amazon.com (10.13.138.149) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit With ftrace in KHO, we are creating an ABI between old kernel and new kernel about the state that they transfer. To ensure that we document that state and catch any breaking change, let's add its schema to the common devicetree bindings. This way, we can quickly reason about the state that gets passed. Signed-off-by: Alexander Graf --- .../bindings/kho/ftrace/ftrace-array.yaml | 46 +++++++++++++++ .../bindings/kho/ftrace/ftrace-cpu.yaml | 56 +++++++++++++++++++ .../bindings/kho/ftrace/ftrace.yaml | 48 ++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 Documentation/devicetree/bindings/kho/ftrace/ftrace-array.yaml create mode 100644 Documentation/devicetree/bindings/kho/ftrace/ftrace-cpu.yaml create mode 100644 Documentation/devicetree/bindings/kho/ftrace/ftrace.yaml diff --git a/Documentation/devicetree/bindings/kho/ftrace/ftrace-array.yaml b/Documentation/devicetree/bindings/kho/ftrace/ftrace-array.yaml new file mode 100644 index 000000000000..9960fefc292d --- /dev/null +++ b/Documentation/devicetree/bindings/kho/ftrace/ftrace-array.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/kho/ftrace/ftrace-array.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ftrace trace array + +maintainers: + - Alexander Graf + +properties: + compatible: + enum: + - ftrace,array-v1 + + trace_flags: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Bitmap of all the trace flags that were enabled in the trace array at the + point of serialization. + +# Subnodes will be of type "ftrace,cpu-v1", one each per CPU +additionalProperties: true + +required: + - compatible + - trace_flags + +examples: + - | + ftrace { + compatible = "ftrace-v1"; + events = <1 1 2 2 3 3>; + + global_trace { + compatible = "ftrace,array-v1"; + trace_flags = < 0x3354601 >; + + cpu0 { + compatible = "ftrace,cpu-v1"; + cpu = < 0x00 >; + mem = < 0x101000000ULL 0x38ULL 0x101000100ULL 0x1000ULL 0x101000038ULL 0x38ULL 0x101002000ULL 0x1000ULL>; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/kho/ftrace/ftrace-cpu.yaml b/Documentation/devicetree/bindings/kho/ftrace/ftrace-cpu.yaml new file mode 100644 index 000000000000..58c715e93f37 --- /dev/null +++ b/Documentation/devicetree/bindings/kho/ftrace/ftrace-cpu.yaml @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/kho/ftrace/ftrace-cpu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ftrace per-CPU ring buffer contents + +maintainers: + - Alexander Graf + +properties: + compatible: + enum: + - ftrace,cpu-v1 + + cpu: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + CPU number of the CPU that this ring buffer belonged to when it was + serialized. + + mem: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: + Array of { u64 phys_addr, u64 len } elements that describe a list of ring + buffer pages. Each page consists of two elements. The first element + describes the location of the struct buffer_page that contains metadata + for a given ring buffer page, such as the ring's head indicator. The + second element points to the ring buffer data page which contains the raw + trace data. + +additionalProperties: false + +required: + - compatible + - cpu + - mem + +examples: + - | + ftrace { + compatible = "ftrace-v1"; + events = <1 1 2 2 3 3>; + + global_trace { + compatible = "ftrace,array-v1"; + trace_flags = < 0x3354601 >; + + cpu0 { + compatible = "ftrace,cpu-v1"; + cpu = < 0x00 >; + mem = < 0x101000000ULL 0x38ULL 0x101000100ULL 0x1000ULL 0x101000038ULL 0x38ULL 0x101002000ULL 0x1000ULL>; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/kho/ftrace/ftrace.yaml b/Documentation/devicetree/bindings/kho/ftrace/ftrace.yaml new file mode 100644 index 000000000000..b87a64843af3 --- /dev/null +++ b/Documentation/devicetree/bindings/kho/ftrace/ftrace.yaml @@ -0,0 +1,48 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/kho/ftrace/ftrace.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ftrace core data + +maintainers: + - Alexander Graf + +properties: + compatible: + enum: + - ftrace-v1 + + events: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: + Array of { u32 crc, u32 type } elements. Each element contains a unique + identifier for an event, followed by the identifier that this event had + in the previous kernel's trace buffers. + +# Other child nodes will be of type "ftrace,array-v1". Each of which describe +# a trace buffer +additionalProperties: true + +required: + - compatible + - events + +examples: + - | + ftrace { + compatible = "ftrace-v1"; + events = <1 1 2 2 3 3>; + + global_trace { + compatible = "ftrace,array-v1"; + trace_flags = < 0x3354601 >; + + cpu0 { + compatible = "ftrace,cpu-v1"; + cpu = < 0x00 >; + mem = < 0x101000000ULL 0x38ULL 0x101000100ULL 0x1000ULL 0x101000038ULL 0x38ULL 0x101002000ULL 0x1000ULL>; + }; + }; + }; -- 2.40.1 Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879