Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1842982rwb; Fri, 5 Aug 2022 08:40:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR4WBzatobluO3UKapXbRQJtpSUPZj1q4HlGS3F+wBk65HOSLTW8FvxUdWhqgYTm7upSvi1h X-Received: by 2002:a17:90a:9409:b0:1f0:e171:f2bd with SMTP id r9-20020a17090a940900b001f0e171f2bdmr7864649pjo.245.1659714022659; Fri, 05 Aug 2022 08:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659714022; cv=none; d=google.com; s=arc-20160816; b=kxa8LyacUchFtQ5IZJJ5bhY0R9uuDHiMTzhm95z7TAOv1UcPFuqA/yL2CUSqHM4oTc tHw/24QSayzykYHkyciiFQBlOQ/saR74xQkLBohkrelJCp45uYM8uTBC5NMMSsgo+Ouv u8CkI8JrGe6HyF5u+gDmd7WhTl+PIgcJLPqvDji+uUvAQo9GSPPtOtTKh9hi7sR15/0Z xo36ooa3MW6q1tdqDioOsqcME62JMCRuJslaUGqH+jzAO5E6F5JvhWwiukFCr+4zIRGx nj9DTZK3QYcLIlAJvZ/xMsqj2tPt2XFablizMdPMARZRV6kKKAet8TbcBFZDleKcuo60 LNkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=XjbnjBL/ADKzFB8rfvXVhX2+bkUDehnhHvrJA+1j8kg=; b=UJ60edpszjjXE5sQJNrt1V49Q+wulqFSAN0zXHW3FSQTFmyM3CRkFKqJTms8z+Z/qz X0WlcKyck2S8jb3JvgeCV84IGKcMXE5Z5/FWNwL0j0CCWVGuicLgWb3c+7WursubRjyI E11uuSwIgZKSM+ydSgylP1JsR5/hUd/7QtOx89cp8SQEqc1+Rz8S3veAOpYvjz2zGpWs IfIF2qhIQTvFP4SgX4jZULGlEevfnfWGPQULSnidw6vLnpaIO5GiOohj2Xl6jItssetk 96kBfjbjxK1wsnjhBwvZunvPCiw6szGXJUozJE/Lf4h7qAM0OZ4orCq57aNhl+tdgh4D LNiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g10-20020a056a001a0a00b005255ca78d68si1306535pfv.310.2022.08.05.08.40.07; Fri, 05 Aug 2022 08:40:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240985AbiHEPOy (ORCPT + 99 others); Fri, 5 Aug 2022 11:14:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231845AbiHEPOw (ORCPT ); Fri, 5 Aug 2022 11:14:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5DF015A17 for ; Fri, 5 Aug 2022 08:14:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 11817B82952 for ; Fri, 5 Aug 2022 15:14:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA91EC433C1; Fri, 5 Aug 2022 15:14:45 +0000 (UTC) Date: Fri, 5 Aug 2022 11:14:44 -0400 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Ingo Molnar , Andrew Morton , Daniel Bristot de Oliveira , Douglas Anderson , Li kunyu , Li zeming , Linyu Yuan , "Masami Hiramatsu (Google)" , Slark Xiao , Tiezhu Yang , Xiang wangx , Zheng Yejian , Zhiqiang Liu , sunliming , Dan Carpenter Subject: [GIT PULL v2.5] tracing: Updates for 5.20 / 6.0 Message-ID: <20220805111444.6c1fefb1@gandalf.local.home> In-Reply-To: <20220803112014.7ffed04e@gandalf.local.home> References: <20220803112014.7ffed04e@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ This time trimming the diff from the email ] Linus, Tracing updates for 5.20 / 6.0 - Runtime verification infrastructure This is the biggest change for this pull request. It introduces the runtime verification that is necessary for running Linux on safety critical systems. It allows for deterministic automata models to be inserted into the kernel that will attach to tracepoints, where the information on these tracepoints will move the model from state to state. If a state is encountered that does not belong to the model, it will then activate a given reactor, that could just inform the user or even panic the kernel (for which safety critical systems will detect and can recover from). - Two monitor models are also added: Wakeup In Preemptive (WIP - not to be confused with "work in progress"), and Wakeup While Not Running (WWNR). - Added __vstring() helper to the TRACE_EVENT() macro to replace several vsnprintf() usages that were all doing it wrong. - eprobes now can have their event autogenerated when the event name is left off. - The rest is various cleanups and fixes. Please pull the latest trace-v6.0 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git trace-v6.0 Tag SHA1: b5e67427372a18ccdde74202fcc3628027fec0de Head SHA1: f1a15b977ff864513133ecb611eb28603d32c1b4 Dan Carpenter (1): rv: Unlock on error path in rv_unregister_reactor() Daniel Bristot de Oliveira (16): rv: Add Runtime Verification (RV) interface rv: Add runtime reactors interface rv/include: Add helper functions for deterministic automata rv/include: Add deterministic automata monitor definition via C macros rv/include: Add instrumentation helper functions Documentation/rv: Add a basic documentation tools/rv: Add dot2c Documentation/rv: Add deterministic automaton documentation tools/rv: Add dot2k Documentation/rv: Add deterministic automata monitor synthesis documentation Documentation/rv: Add deterministic automata instrumentation documentation rv/monitor: Add the wip monitor skeleton created by dot2k rv/monitor: Add the wip monitor rv/monitor: Add the wwnr monitor rv/reactor: Add the printk reactor rv/reactor: Add the panic reactor Douglas Anderson (1): tracing: Fix sleeping while atomic in kdb ftdump Li kunyu (1): blk-iocost: tracing: atomic64_read(&ioc->vtime_rate) is assigned an extra semicolon Li zeming (1): tracepoints: It is CONFIG_TRACEPOINTS not CONFIG_TRACEPOINT Linyu Yuan (4): tracing: eprobe: Add missing log index tracing: eprobe: Remove duplicate is_good_name() operation tracing: Auto generate event name when creating a group of events selftests/ftrace: Add test case for GRP/ only input Masami Hiramatsu (Google) (2): selftests/kprobe: Update test for no event name syntax error tracing/eprobe: Show syntax error logs in error_log file Slark Xiao (1): scripts/tracing: Fix typo 'the the' in comment Steven Rostedt (Google) (23): ftrace: Be more specific about arch impact when function tracer is enabled tracing: devlink: Use static array for string in devlink_trap_report event tracing/ipv4/ipv6: Use static array for name field in fib*_lookup_table event neighbor: tracing: Have neigh_create event use __string() tracing/events: Add __vstring() and __assign_vstr() helper macros tracing/IB/hfi1: Use the new __vstring() helper tracing/ath: Use the new __vstring() helper tracing/brcm: Use the new __vstring() helper tracing/iwlwifi: Use the new __vstring() helper usb: chipidea: tracing: Use the new __vstring() helper xhci: tracing: Use the new __vstring() helper usb: musb: tracing: Use the new __vstring() helper scsi: iscsi: tracing: Use the new __vstring() helper scsi: qla2xxx: tracing: Use the new __vstring() helper mac80211: tracing: Use the new __vstring() helper selftests/kprobe: Do not test for GRP/ without event failures tracing: Add example and documentation for new __vstring() macro USB: mtu3: tracing: Use the new __vstring() helper batman-adv: tracing: Use the new __vstring() helper tracing: Use a copy of the va_list for __assign_vstr() ftrace/x86: Add back ftrace_expected assignment tracing: Use a struct alignof to determine trace event field alignment tracing: Use alignof__(struct {type b;}) instead of offsetof() Tiezhu Yang (1): samples: Use KSYM_NAME_LEN for kprobes Xiang wangx (1): tracing/user_events: Fix syntax errors in comments Zheng Yejian (2): tracing/histograms: Fix memory leak problem tracing/histograms: Simplify create_hist_fields() Zhiqiang Liu (1): tracing: Use free_trace_buffer() in allocate_trace_buffers() sunliming (1): fprobe/samples: Make sample_probe static ---- Documentation/trace/index.rst | 1 + Documentation/trace/kprobetrace.rst | 8 +- .../trace/rv/da_monitor_instrumentation.rst | 171 +++++ Documentation/trace/rv/da_monitor_synthesis.rst | 147 ++++ Documentation/trace/rv/deterministic_automata.rst | 184 +++++ Documentation/trace/rv/index.rst | 14 + Documentation/trace/rv/monitor_wip.rst | 55 ++ Documentation/trace/rv/monitor_wwnr.rst | 45 ++ Documentation/trace/rv/runtime-verification.rst | 231 ++++++ Documentation/trace/uprobetracer.rst | 8 +- arch/x86/kernel/ftrace.c | 1 + drivers/infiniband/hw/hfi1/trace_dbg.h | 8 +- drivers/net/wireless/ath/ath10k/trace.h | 14 +- drivers/net/wireless/ath/ath11k/trace.h | 7 +- drivers/net/wireless/ath/ath6kl/trace.h | 14 +- drivers/net/wireless/ath/trace.h | 7 +- drivers/net/wireless/ath/wil6210/trace.h | 7 +- .../broadcom/brcm80211/brcmfmac/tracepoint.h | 12 +- .../brcm80211/brcmsmac/brcms_trace_brcmsmac_msg.h | 12 +- .../net/wireless/intel/iwlwifi/iwl-devtrace-msg.h | 12 +- drivers/usb/chipidea/trace.h | 4 +- drivers/usb/host/xhci-trace.h | 4 +- drivers/usb/mtu3/mtu3_trace.h | 6 +- drivers/usb/musb/musb_trace.h | 4 +- include/linux/rv.h | 70 ++ include/linux/sched.h | 11 + include/linux/trace_events.h | 18 + include/linux/tracepoint.h | 2 +- include/rv/automata.h | 75 ++ include/rv/da_monitor.h | 544 ++++++++++++++ include/rv/instrumentation.h | 29 + include/trace/events/devlink.h | 7 +- include/trace/events/fib.h | 6 +- include/trace/events/fib6.h | 8 +- include/trace/events/iocost.h | 2 +- include/trace/events/iscsi.h | 4 +- include/trace/events/neigh.h | 2 +- include/trace/events/qla.h | 4 +- include/trace/events/rv.h | 142 ++++ include/trace/stages/stage1_struct_define.h | 3 + include/trace/stages/stage2_data_offsets.h | 3 + include/trace/stages/stage4_event_fields.h | 11 +- include/trace/stages/stage5_get_offsets.h | 4 + include/trace/stages/stage6_event_callback.h | 12 + kernel/fork.c | 14 + kernel/trace/Kconfig | 5 +- kernel/trace/Makefile | 1 + kernel/trace/rv/Kconfig | 78 ++ kernel/trace/rv/Makefile | 8 + kernel/trace/rv/monitors/wip/wip.c | 88 +++ kernel/trace/rv/monitors/wip/wip.h | 46 ++ kernel/trace/rv/monitors/wwnr/wwnr.c | 87 +++ kernel/trace/rv/monitors/wwnr/wwnr.h | 46 ++ kernel/trace/rv/reactor_panic.c | 43 ++ kernel/trace/rv/reactor_printk.c | 42 ++ kernel/trace/rv/rv.c | 799 +++++++++++++++++++++ kernel/trace/rv/rv.h | 68 ++ kernel/trace/rv/rv_reactors.c | 510 +++++++++++++ kernel/trace/trace.c | 46 +- kernel/trace/trace.h | 9 + kernel/trace/trace_dynevent.c | 2 +- kernel/trace/trace_eprobe.c | 37 +- kernel/trace/trace_events_hist.c | 7 +- kernel/trace/trace_events_user.c | 2 +- kernel/trace/trace_kprobe.c | 16 +- kernel/trace/trace_probe.c | 4 + kernel/trace/trace_probe.h | 5 +- kernel/trace/trace_uprobe.c | 12 +- net/batman-adv/trace.h | 9 +- net/mac80211/trace_msg.h | 6 +- samples/fprobe/fprobe_example.c | 2 +- samples/kprobes/kprobe_example.c | 5 +- samples/kprobes/kretprobe_example.c | 5 +- samples/trace_events/trace-events-sample.c | 14 +- samples/trace_events/trace-events-sample.h | 32 +- scripts/tracing/draw_functrace.py | 2 +- .../ftrace/test.d/dynevent/add_remove_eprobe.tc | 9 +- .../ftrace/test.d/dynevent/add_remove_kprobe.tc | 7 + .../ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 2 +- tools/verification/dot2/Makefile | 26 + tools/verification/dot2/automata.py | 174 +++++ tools/verification/dot2/dot2c | 26 + tools/verification/dot2/dot2c.py | 254 +++++++ tools/verification/dot2/dot2k | 47 ++ tools/verification/dot2/dot2k.py | 177 +++++ .../dot2/dot2k_templates/main_global.c | 91 +++ .../dot2/dot2k_templates/main_per_cpu.c | 91 +++ .../dot2/dot2k_templates/main_per_task.c | 91 +++ tools/verification/models/wip.dot | 16 + tools/verification/models/wwnr.dot | 16 + 90 files changed, 4824 insertions(+), 186 deletions(-) create mode 100644 Documentation/trace/rv/da_monitor_instrumentation.rst create mode 100644 Documentation/trace/rv/da_monitor_synthesis.rst create mode 100644 Documentation/trace/rv/deterministic_automata.rst create mode 100644 Documentation/trace/rv/index.rst create mode 100644 Documentation/trace/rv/monitor_wip.rst create mode 100644 Documentation/trace/rv/monitor_wwnr.rst create mode 100644 Documentation/trace/rv/runtime-verification.rst create mode 100644 include/linux/rv.h create mode 100644 include/rv/automata.h create mode 100644 include/rv/da_monitor.h create mode 100644 include/rv/instrumentation.h create mode 100644 include/trace/events/rv.h create mode 100644 kernel/trace/rv/Kconfig create mode 100644 kernel/trace/rv/Makefile create mode 100644 kernel/trace/rv/monitors/wip/wip.c create mode 100644 kernel/trace/rv/monitors/wip/wip.h create mode 100644 kernel/trace/rv/monitors/wwnr/wwnr.c create mode 100644 kernel/trace/rv/monitors/wwnr/wwnr.h create mode 100644 kernel/trace/rv/reactor_panic.c create mode 100644 kernel/trace/rv/reactor_printk.c create mode 100644 kernel/trace/rv/rv.c create mode 100644 kernel/trace/rv/rv.h create mode 100644 kernel/trace/rv/rv_reactors.c create mode 100644 tools/verification/dot2/Makefile create mode 100644 tools/verification/dot2/automata.py create mode 100644 tools/verification/dot2/dot2c create mode 100644 tools/verification/dot2/dot2c.py create mode 100644 tools/verification/dot2/dot2k create mode 100644 tools/verification/dot2/dot2k.py create mode 100644 tools/verification/dot2/dot2k_templates/main_global.c create mode 100644 tools/verification/dot2/dot2k_templates/main_per_cpu.c create mode 100644 tools/verification/dot2/dot2k_templates/main_per_task.c create mode 100644 tools/verification/models/wip.dot create mode 100644 tools/verification/models/wwnr.dot ---------------------------