Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp859933ybi; Fri, 21 Jun 2019 09:20:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfsYx0bYgROago2IFJCZitVGKsNvf8I1WHvyXcQkVRzrill1Y2JXtwfw1JnrFh1nNOmYDJ X-Received: by 2002:a63:1343:: with SMTP id 3mr19887076pgt.426.1561134008032; Fri, 21 Jun 2019 09:20:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561134008; cv=none; d=google.com; s=arc-20160816; b=DjLTr3Qi5tdfb08sSnO7DCOnBReWzhsfZle+Pj6HyVCx/lllNwY6jqs6cBqc8MM33x WHZq9pp+D2+7ouz9rE0zfbVUA2FULo0+0gc8xPiGVMzRIkdLMytu0yXo3pXUrae/A5eR SBF1OY8YqNjC05ApOhEPqmPEWFfxzVFqcoGs1zX9TeuJclGlvmVXRWtq3wNEQPaNQf7S 91x8Y5bdB5xK7wsw+Q4a2JPjOMz/1FgoCWBOZLNQK0hx2WUoQK4sa3c2VOYhFEQoknHS 8lb9oxzFgYyQRtfzViqruDGYNDnqwTAakVUwU2bA4o7PbUIUb89x/lwYUwJExWJp+M+L 8kZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pHZ6dAQ7l+D+sfrdbdLptQSl78W6EelAR+XToiyRC9I=; b=pCitFnHQapK5x4ZC+RO0xZ+BfWOW1spjjMP2uCJsjKLOtkTqItJdy82E5wuOmN6BX3 Mri32VXHwqVZGfftZlxql2pzTjIDAB/QKZUagNUZkSmCKGyaMbgUZNo1WBiW0pLvBoVJ CYM3aAWGjRXNriohCVzuLM8WanqkQjorLioY/Nv9ip/Akw+FAb0ptB9O7ldamPt/g7Ve 95JuWn2U/XQFW5WAqC4DtuTu9qmgetJIb4gioLZQ7Z7BbpLK24tuDDVW7Xecxn9VXl9y NOHMZ4dYS5iqHsdXhoVKMiOAhllxX7i/r6X6HNbJLdkMXOavOEMUmnoUptx6HEX0sHc1 9XDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DElU5oT7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z13si3171197pjr.76.2019.06.21.09.19.52; Fri, 21 Jun 2019 09:20:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DElU5oT7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726469AbfFUQTP (ORCPT + 99 others); Fri, 21 Jun 2019 12:19:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:51922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbfFUQTO (ORCPT ); Fri, 21 Jun 2019 12:19:14 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 80D4E208C3; Fri, 21 Jun 2019 16:19:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561133953; bh=dR+sQyPZpvOsY7vM6jG36NBwA1jf68h3ITQR18BAeSo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DElU5oT7/BaMJxyrFQKHbYizVL7T9PLL5w5A0AmhPdUb8ByEAJos0+bDUaen4+665 UN9XCXOO+QRslaYf5WOdajzhdeaYtx+t/bAQE0gGZqeaXqzGPaDlX3Kc9iGZ759EGv wH55BampWIIaaApPkTV60XRLapUvMLE03OmXoW6s= From: Masami Hiramatsu To: Steven Rostedt , Rob Herring , Frank Rowand , Tom Zanussi Cc: Ingo Molnar , Namhyung Kim , Jiri Olsa , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [RFC PATCH 07/11] dt-bindings: tracing: Add ftrace binding document Date: Sat, 22 Jun 2019 01:19:09 +0900 Message-Id: <156113394914.28344.8750555167313878580.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <156113387975.28344.16009584175308192243.stgit@devnote2> References: <156113387975.28344.16009584175308192243.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a devicetree binding document for ftrace node. Signed-off-by: Masami Hiramatsu --- .../devicetree/bindings/tracing/ftrace.yaml | 170 ++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 Documentation/devicetree/bindings/tracing/ftrace.yaml diff --git a/Documentation/devicetree/bindings/tracing/ftrace.yaml b/Documentation/devicetree/bindings/tracing/ftrace.yaml new file mode 100644 index 000000000000..cbd7af986c38 --- /dev/null +++ b/Documentation/devicetree/bindings/tracing/ftrace.yaml @@ -0,0 +1,170 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2019 Linaro Ltd. +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/tracing/ftrace.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Ftrace setting devicetree binding + +maintainers: + - Masami Hiramatsu + +description: | + Boot-time ftrace tracing setting via devicetree. Users can use devicetree node + for programming ftrace boot-time tracing. + +properties: + compatible: + items: + - const: linux,ftrace + + trace-clock: + allOf: + - $ref: /schemas/types.yaml#/definitions/string + - enum: [ global, local, counter, uptime, perf, mono, mono_raw, boot, ppc-tb, x86-tsc ] + description: Specify which clock method is used for trace-clock. + + dump-on-oops: + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - enum: [0, 1, 2] + description: | + A neumerical flag to enable ftrace dump on Kernel Oops. 0 means no dump, + 1 means dump on the origin cpu of the oops, and means dump on all cpus. + + traceoff-on-warning: + $ref: /schemas/types.yaml#/definitions/flag + description: A flag to stop tracing on warning. + + tp-printk: + $ref: /schemas/types.yaml#/definitions/flag + description: A flag to send tracing output to printk buffer too. + + alloc-snapshot: + $ref: /schemas/types.yaml#/definitions/flag + description: | + A flag to allocate snapshot buffer at boot. This will be required if you + use "snapshot" action on some events. + + buffer-size-kb: + allOf: + - $ref: /schemas/types.yaml#/definitions/uint32 + - minimum: 1 + description: | + The size of per-cpu tracing buffer in KByte. Note that the size must be + larger than page size, and total size of buffers depends on the number + of CPUs. + + events: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: | + A string array of enabling events (including wildcard patterns). + See Documentation/trace/events.rst for detail. + + options: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: | + A string array of trace options for ftrace to control what gets printed + in the trace output or manipulate the tracers. + See Documentation/trace/ftrace.rst#trace_options for detail. + + tracer: + default: nop + $ref: /schemas/types.yaml#/definitions/string + description: A string of the tracer to start up. + +patternProperties: + "event[0-9a-fA-F]+$": + type: object + + description: | + event-* properties are child nodes for per-event settings. It is also + able to define new kprobe events and synthetic events. Note that you + can not define both "probes" and "fields" properties on same event. + + properties: + event: + $ref: /schemas/types.yaml#/definitions/string + description: | + Event name string formatted as "GROUP:EVENT". For synthetic event, + you must use "synthetic" for group name. For kprobe and synthetic + event, you can ommit the group name. + + probes: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: | + A string array of kprobe event definitions, including location + (symbol+offset) and event arguments. + See Documentation/trace/kprobetrace.rst for detail. + + fields: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: | + A string of synthetic event's fields definition. Note that you + don't need to repeat event name. + + filter: + $ref: /schemas/types.yaml#/definitions/string + description: A string of event filter rule + + actions: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: A string array of event trigger actions. + + enable: + type: boolean + description: | + A flag to enable event. Note that the event is not enabled by + default. (But actions will set the event soft-disabled) + + oneOf: + - required: + - event + - required: + - event + - probes + - required: + - event + - fields + +required: + - compatible + +examples: + - | + ftrace { + compatible = "linux,ftrace"; + events = "initcall:*"; + tp-printk; + buffer-size-kb = <0x400>; + event0 { + event = "task:task_newtask"; + filter = "pid < 128"; + enable; + }; + event1 { + event = "kprobes:vfs_read"; + probes = "vfs_read $arg1 $arg2"; + filter = "common_pid < 200"; + }; + event2 { + event = "initcall_latency"; + fields = "unsigned long func", "u64 lat"; + actions = "hist:keys=func.sym,lat:vals=lat:sort=lat"; + }; + event3 { + event = "initcall:initcall_start"; + actions = "hist:keys=func:ts0=common_timestamp.usecs"; + }; + event4 { + event = "initcall:initcall_finish"; + actions = "hist:keys=func:lat=common_timestamp.usecs-$ts0:onmatch(initcall.initcall_start).initcall_latency(func,$lat)"; + }; + + };