Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp405966imn; Wed, 3 Aug 2022 08:52:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR5uVzl4IR+kKGlmY46madO8e/AtIz6umNTcRPE5gLu/vZ5yO92IqWuNDIg/ag1AYaKMeTRE X-Received: by 2002:a17:90b:1e4a:b0:1f5:4f69:d6b4 with SMTP id pi10-20020a17090b1e4a00b001f54f69d6b4mr2430908pjb.164.1659541931680; Wed, 03 Aug 2022 08:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659541931; cv=none; d=google.com; s=arc-20160816; b=zPLgv71bkr8tMR0vkvF83EPieBvQ9Zok+l4h6NaJERjknR8VJJRhQgAYnKMce/ljrg cZAkz4oAII13cklUcgywfcWcxPihvpOUynWzYQKbo6OvQW69P0UNnf/xqAjlubTvjObL kal/SXrzi1lolmn0HTlfrEEI32bJb09mESJ4wpK7st4flsFyaAATSK4iSvHuC/+yCm0j sYydY+yT3libIUoujjAAwnx/kW575urRYssBj4n8aVsJSsFErH3isbLr+wyzwLmIUep+ QVzAhXPOlyTc32imsONfjvmtSZY73CxTxgg0ROm5MyT+2iBxslXD46CSK2eXY0CTQFmS 8U1A== 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 :message-id:subject:cc:to:from:date; bh=cRgqJBoUJWs97XvwgXuGi2g0jeHMAg5N8Tc1ziEWc+Q=; b=j456gmfVKEZ22pwJOIW3POo2HNhUXE+ehJgpNrQD2rmreH0yLl5y4QoO6iP7BI3T0p rQwsJTmPb1KTW7FNRAvd28Zspa6GDuKS1T54VAS78emY3oXfHHs0uBZO+TA2rlwpUva9 8n5kFj80Wf6TPoOmKY0usnbu8rTVsEZ5a0V+zAQ2McqoQB9/AWwRz5KwR+ioDmte3AWA Q3Mt6jMKGrSvNNPNoS1JjhMm6ctDxMMnaRmM6UsW8eOJt2LhhMAMkVu+/yQB8BQAd9Zp iCMuVINLqW+Wx399eb5Yg5DgZkXRsSKZvydU3hW6yHbbzm/gl1rFUeS7bcyPIDT0KPTU OqQg== 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 r8-20020a63ce48000000b00415b6092468si18011684pgi.586.2022.08.03.08.51.56; Wed, 03 Aug 2022 08:52:11 -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 S237977AbiHCPUY (ORCPT + 99 others); Wed, 3 Aug 2022 11:20:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236253AbiHCPUX (ORCPT ); Wed, 3 Aug 2022 11:20:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D050CE01 for ; Wed, 3 Aug 2022 08:20:21 -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 D4B08B822B6 for ; Wed, 3 Aug 2022 15:20:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91B08C433D6; Wed, 3 Aug 2022 15:20:16 +0000 (UTC) Date: Wed, 3 Aug 2022 11:20:14 -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 Subject: [GIT PULL] tracing: Updates for 5.20 / 6.0 Message-ID: <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 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 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 vstring() 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-v5.20 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git trace-v5.20 Tag SHA1: 2e24f04e0370495112b3ec2b37152272322b434c Head SHA1: 09794a5a6c348f629b35fc1687071a1622ef4265 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 | 508 +++++++++++++ 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, 4822 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 ---------------------------