Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3785866ybi; Sun, 14 Jul 2019 22:15:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBfoDdiNQ2oyydMaHKea3KbU7M1giiqfPh0x3MTrY3DaNBDRu0l7ITexwzrIx4b48ZIIpV X-Received: by 2002:a17:90a:2ec1:: with SMTP id h1mr27395375pjs.119.1563167710115; Sun, 14 Jul 2019 22:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563167710; cv=none; d=google.com; s=arc-20160816; b=hU0jIecDxFKVZk0V+yKpe1hjYSw8CsuFODtoH9Rpx8fzazPyk6Tn3FE2WqbRbLi3Ut SOeXM116aphK6I8kZhFUF8T8hR530DX+2xxVzjwoIgvGc6o5obv7voO2rL+MpoKOFtwv dtsbk4Eimn1KwyWRcH9KoESE236q+RA4Ps14IDgHDW51zhhLlhZkUOt3mxIlzQ0Kt9b6 gef9z7r4Tvo2wkTLm2GKIeqy0FagHsSTfjhG+5uCnoo7+xVjkjmEy/+tuPl8pmEQTVrB RT+0LbrZscQv9VWxzduWX/igh8W2jf4Cy1C1nGVWfBWY8ZNa3HhHZlYx2/z7jH7JnC/K lC6w== 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=UDFhs0kY43U2sTkx4iPOOou+WdtjgiMTUuG0az0aC+s=; b=Nn/VyeVZh6MaM4WPJ6qzEoTT99NhQqDGhoT5JsjrTwd6TI1nGniutmd/RV7BE9eRRF s+crQCg4PGbfTcdFGxU9q4h99M65lVBssnXwgrgpc2pQbLBzyVeSe1OCuPpTgQGhK7ry IqzR0TcslS3wQeEVbTthum2Vi/2sgIY2WnzoR49MCYoDL/RukwNl8k0ERLgsPK+xd6AL WSm6rOrjv4PVw6Ahs3T0JL79csnCSQHbS1CJm9pyEdrF6+EUs+t4iQXrsBs/TZY+TpP1 kP41UhNxeQB+Wv9CxP0hP73symh40XF7P8DMQHoz7kYthQYbP9Jyr+jrvP3BaKlUVu41 NX6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N3AVQefr; 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 n13si15477995pff.46.2019.07.14.22.14.51; Sun, 14 Jul 2019 22:15:10 -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=N3AVQefr; 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 S1729205AbfGOFM3 (ORCPT + 99 others); Mon, 15 Jul 2019 01:12:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:47014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729193AbfGOFM3 (ORCPT ); Mon, 15 Jul 2019 01:12:29 -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 C637720868; Mon, 15 Jul 2019 05:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563167548; bh=jJBhKIKLkwCH7q0/0LBoUFl+KhulQCu8kHsCCe29wII=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N3AVQefrGVzexpwvhcblkUE6f4SQ16LLduoY4G0PpmizosdnPGwlCnc9V0KbXPH02 pfxPwNGty7tHmNm/Sya3gQGBbCSucy0jckLMEJvH9qTKNed8ch9waphJIpAiEZ6I3F 2HiWQWy2FAExPXb1J8BHYJeUGMQ5VunCII8zr4hk= From: Masami Hiramatsu To: Steven Rostedt , Rob Herring , Frank Rowand , Tim Bird Cc: Ingo Molnar , Namhyung Kim , Jiri Olsa , Arnaldo Carvalho de Melo , Tom Zanussi , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [RFC PATCH v2 07/15] dt-bindings: tracing: Add ftrace binding document Date: Mon, 15 Jul 2019 14:12:23 +0900 Message-Id: <156316754322.23477.15176287275000782502.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <156316746861.23477.5815110570539190650.stgit@devnote2> References: <156316746861.23477.5815110570539190650.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 --- Changes in v2: - Add cpumask, ftrace-filters, ftrace-notraces, fgraph-filters, fgraph-notraces, fgraph-max-depth and instance node. - Remove compatible and move file to bindings/chosen/linux,ftrace.yaml --- .../devicetree/bindings/chosen/linux,ftrace.yaml | 306 ++++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 Documentation/devicetree/bindings/chosen/linux,ftrace.yaml diff --git a/Documentation/devicetree/bindings/chosen/linux,ftrace.yaml b/Documentation/devicetree/bindings/chosen/linux,ftrace.yaml new file mode 100644 index 000000000000..a5c60ac2f66d --- /dev/null +++ b/Documentation/devicetree/bindings/chosen/linux,ftrace.yaml @@ -0,0 +1,306 @@ +# 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. This node must be placed at + /chosen/linux,ftrace. + +properties: + 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. + + 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. + + 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. + + cpumask: + $ref: /schemas/types.yaml#/definitions/string + description: | + A hexadecimal number of the cpu-mask value which is given as a string. + This is because the number of cores can be bigger than 64. + + ftrace-filters: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: | + A string array of the functions traced by the function tracer at boot + up. The function can be given with wildcards. This list can be + specified in each instance. + + ftrace-notraces: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: | + A string array of the functions NOT traced by the function tracer at + boot up. The function can be given with wildcards. This list can be + specified in each instance. + + fgraph-filters: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: | + A string array of the top level callers functions traced by the + function graph tracer at boot up. The function can be given with + wildcards. This list is not available in instance node. + + fgraph-notraces: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: | + A string array of the top level callers functions NOT traced by the + function graph tracer at boot up. The function can be given with + wildcards. This list is not available in instance node. + + fgraph-max-depth: + default: 0 + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + This is the max depth, the function graph tracer will trace into + a function. 0 means no limit for the trace depth. + +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 + + "instance[0-9a-fA-F]+$": + type: object + + description: | + instance* properties are child nodes for per-instance settings. + It is also able to have event nodes as linux,ftrace node does. + + properties: + instance: + $ref: /schemas/types.yaml#/definitions/string + description: The name of new instance. + + 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. + + 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. + + cpumask: + $ref: /schemas/types.yaml#/definitions/string + description: | + A hexadecimal number of the cpu-mask value which is given as a string. + This is because the number of cores can be bigger than 64. + + ftrace-filters: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: | + A string array of the functions traced by the function tracer at boot + up. The function can be given with wildcards. This list can be + specified in each instance. + + ftrace-notraces: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: | + A string array of the functions NOT traced by the function tracer at + boot up. The function can be given with wildcards. This list can be + specified in each instance. + + fgraph-filters: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: | + A string array of the top level callers functions traced by the + function graph tracer at boot up. The function can be given with + wildcards. This list is not available in instance node. + + fgraph-notraces: + minItems: 1 + $ref: /schemas/types.yaml#/definitions/string-array + description: | + A string array of the top level callers functions NOT traced by the + function graph tracer at boot up. The function can be given with + wildcards. This list is not available in instance node. + + fgraph-max-depth: + default: 0 + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + This is the max depth, the function graph tracer will trace into + a function. 0 means no limit for the trace depth. + + required: + - instance + +examples: + - | + ftrace { + events = "initcall:*"; + tp-printk; + buffer-size-kb = <0x400>; + 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)"; + }; + instance0 { + buffer-size-kb = <0x100>; + event5 { + event = "task:task_newtask"; + filter = "pid < 128"; + enable; + }; + }; + + };