Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp372488pxb; Wed, 27 Oct 2021 04:41:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCwFpp3h2PJpTdC71G+p9GNn5oswzcC7Cb8gIkuaBZBvYB5vdEsocmPBRRw8NnbkJRz2zN X-Received: by 2002:a62:e816:0:b0:47b:d98e:f934 with SMTP id c22-20020a62e816000000b0047bd98ef934mr27854587pfi.83.1635334910799; Wed, 27 Oct 2021 04:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635334910; cv=none; d=google.com; s=arc-20160816; b=F5uEqXVA7KXJLbo79U5NCeEFQwmq2az+uOkusnk5dGVUZyZJ1BIqIluTVkUFumrCOC WVx3oPFRBGvKI7XjHs/KWbqOBH2ZLViT0Vito55YD2OErjEx5t3vdSzQ81/OAaKisJOW J6z3uFV0PDpyTsDgFvhJt9fOvpwRe6G65CdeAVoHDwQDb8i45lqCf2XrfeZ+FUj/sKw3 QjOEtAh+MWKINxEH1zlOvmE3AaGkN2ga9s6vEYGEI+sNBGN8PKZiD4BEDTzKB6QNZxgp 9QJ+jiBvtSvuxXpue/15uuauBS7AVqklpagtJ/EAY5LUGeUwLSoa0rtCZzdFeL+vmLnT 9GKQ== 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:date:subject:cc:to:from; bh=03xT8HV9YXcPjNK7KEV0ESZuj3iStyG0oysonZzdLrs=; b=m2X1eDcEPo/i6s2xYAUrS7NGRCZIcn8/eF6xdEN0Srg2SyTnB2NImG/Mth1rUoVEXC fW4++6yekF18knc0H8sSn8WqLczVs0nDzdmptADAZA3uz7GvTtAOQXYxlTt+rm11ZA6N Nh+5v23jKHSne8QUSCIBBLNAtWUL30fm+i9YIINLkJMhaR0gfe+8Pf3xlbonidfFkXBZ lIDDsDFtVmgbFVC/e9cpCPgeWgufFs0ZTw1AQ6f+/SagV15HPCAuxbbiVFbhR8JYliix TxRL4y7L1BS4Cb/fKPDgz+jD/h7cp14DeUkoXApZXkYfsPjFbTeNtRYazXwY+HJmBhJR ekQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id m128si4044086pfd.255.2021.10.27.04.41.34; Wed, 27 Oct 2021 04:41:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231599AbhJZWJ1 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 26 Oct 2021 18:09:27 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:28337 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235182AbhJZWJ0 (ORCPT ); Tue, 26 Oct 2021 18:09:26 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-260-vVKQmPcCNRCisL0QGoi1Nw-1; Tue, 26 Oct 2021 18:06:55 -0400 X-MC-Unique: vVKQmPcCNRCisL0QGoi1Nw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F4183100C611; Tue, 26 Oct 2021 22:06:53 +0000 (UTC) Received: from x1.com (unknown [10.22.32.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 675FA60BF1; Tue, 26 Oct 2021 22:06:40 +0000 (UTC) From: Daniel Bristot de Oliveira To: Steven Rostedt Cc: Tao Zhou , Daniel Bristot de Oliveira , Ingo Molnar , Tom Zanussi , Masami Hiramatsu , Juri Lelli , Clark Williams , John Kacur , Peter Zijlstra , Thomas Gleixner , Sebastian Andrzej Siewior , linux-rt-users@vger.kernel.org, linux-trace-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V6 00/20] RTLA: An interface for osnoise/timerlat tracers Date: Wed, 27 Oct 2021 00:06:11 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=bristot@kernel.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=WINDOWS-1252 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The rtla(1) is a meta-tool that includes a set of commands that aims to analyze the real-time properties of Linux. But instead of testing Linux as a black box, rtla leverages kernel tracing capabilities to provide precise information about the properties and root causes of unexpected results. To start, it presents an interface to the osnoise and timerlat tracers. In the future, it will also serve as home to the rtsl [1] and other latency/noise tracers. The first five patches are a re-send of [2] that enable multiple instances for osnoise/timerlat tracers. They are required to run the -T option - to save a trace with osnoise: events for debugging. The next seven patches are rtla, rtla osnoise, and rtla timerlat. The following patches are the man pages for the tools. To compile rtla on fedora you need: $ git clone git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git $ cd libtraceevent/ $ make $ sudo make install $ cd .. $ git clone git://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git $ cd libtracefs/ $ make $ sudo make install $ cd .. $ sudo dnf install python3-docutils procps-devel $ cd $linux/tools/tracing/rtla/ $ make $ sudo make install This tool was be discussed at the RT-MC during LPC2021. [1] rtsl: https://github.com/bristot/rtsl/ [2] https://lore.kernel.org/lkml/cover.1628775552.git.bristot@kernel.org/ [3] https://youtu.be/cZUzc0U1jJ4 Changes from v5: - Fix read() check in save_trace_to_file() (Tao Zhou) - Fix goto logic in save_trace_to_file() (Tao Zhou) - Removed unused save_trace_pipe_to_file() function - Correctly handle an error on osnoise_set_* functions during "apply config" for all tools (Tao Zhou) - Fix a comment about the format for set priority Changes from v4: - Fix comment on start_per_cpu_kthreads() (Steven) - Fix msg log on patch 1 - Add comments about the barrier need for trace_nmi_enter/exit - Fix RCU usage in osnoise_unregister_instance() (Steven/Paul) - Add lockdep checks in osnoise_unregister/unregister_instance() (Steven/Paul) - Improve the explanation about the multi instances support (Steven) Changes from v3: - Add cross-compile support (Ahmed S. Darwish) - Move documentation to Documentation/tools/rtla (Jonathan Corbet) - Use .rst format for documentation (Jonathan Corbet) - Use include option from .rst to group common parts of the documentation - Makefile (main and doc) cleanups Changes from v2: - Fix the miss conception of the "size" for kernel histograms (Steven/Tom) - Change the --skip-zeros to --with-zeros option as the former is better for humans (and the latter for computers to plot charts). - A lot of checkpatch fixes for the user-space part. Changes from v1: - Fixes -t options on osnoise tracers (-t means --trace for all tools now) - Fixes --bucket-size references (not --bucket_size) Daniel Bristot de Oliveira (20): trace/osnoise: Do not follow tracing_cpumask trace/osnoise: Improve comments about barrier need for NMI callbacks trace/osnoise: Split workload start from the tracer start trace/osnoise: Use start/stop_per_cpu_kthreads() on osnoise_cpus_write() trace/osnoise: Support a list of trace_array *tr trace/osnoise: Allow multiple instances of the same tracer rtla: Real-Time Linux Analysis tool rtla: Helper functions for rtla rtla: Add osnoise tool rtla/osnoise: Add osnoise top mode rtla/osnoise: Add the hist mode rtla: Add timerlat tool and timelart top mode rtla/timerlat: Add timerlat hist mode rtla: Add Documentation rtla: Add rtla osnoise man page rtla: Add rtla osnoise top documentation rtla: Add rtla osnoise hist documentation rtla: Add rtla timerlat documentation rtla: Add rtla timerlat top documentation rtla: Add rtla timerlat hist documentation Documentation/tools/rtla/Makefile | 41 + Documentation/tools/rtla/common_appendix.rst | 12 + .../tools/rtla/common_hist_options.rst | 23 + Documentation/tools/rtla/common_options.rst | 24 + .../tools/rtla/common_osnoise_description.rst | 8 + .../tools/rtla/common_osnoise_options.rst | 17 + .../rtla/common_timerlat_description.rst | 10 + .../tools/rtla/common_timerlat_options.rst | 16 + .../tools/rtla/common_top_options.rst | 3 + .../tools/rtla/rtla-osnoise-hist.rst | 66 ++ Documentation/tools/rtla/rtla-osnoise-top.rst | 61 ++ Documentation/tools/rtla/rtla-osnoise.rst | 59 ++ .../tools/rtla/rtla-timerlat-hist.rst | 106 +++ .../tools/rtla/rtla-timerlat-top.rst | 145 +++ Documentation/tools/rtla/rtla-timerlat.rst | 57 ++ Documentation/tools/rtla/rtla.rst | 48 + kernel/trace/trace_osnoise.c | 426 ++++++--- tools/tracing/rtla/Makefile | 102 +++ tools/tracing/rtla/src/osnoise.c | 837 ++++++++++++++++++ tools/tracing/rtla/src/osnoise.h | 87 ++ tools/tracing/rtla/src/osnoise_hist.c | 793 +++++++++++++++++ tools/tracing/rtla/src/osnoise_top.c | 577 ++++++++++++ tools/tracing/rtla/src/rtla.c | 87 ++ tools/tracing/rtla/src/timerlat.c | 72 ++ tools/tracing/rtla/src/timerlat.h | 4 + tools/tracing/rtla/src/timerlat_hist.c | 800 +++++++++++++++++ tools/tracing/rtla/src/timerlat_top.c | 603 +++++++++++++ tools/tracing/rtla/src/trace.c | 192 ++++ tools/tracing/rtla/src/trace.h | 27 + tools/tracing/rtla/src/utils.c | 433 +++++++++ tools/tracing/rtla/src/utils.h | 56 ++ 31 files changed, 5670 insertions(+), 122 deletions(-) create mode 100644 Documentation/tools/rtla/Makefile create mode 100644 Documentation/tools/rtla/common_appendix.rst create mode 100644 Documentation/tools/rtla/common_hist_options.rst create mode 100644 Documentation/tools/rtla/common_options.rst create mode 100644 Documentation/tools/rtla/common_osnoise_description.rst create mode 100644 Documentation/tools/rtla/common_osnoise_options.rst create mode 100644 Documentation/tools/rtla/common_timerlat_description.rst create mode 100644 Documentation/tools/rtla/common_timerlat_options.rst create mode 100644 Documentation/tools/rtla/common_top_options.rst create mode 100644 Documentation/tools/rtla/rtla-osnoise-hist.rst create mode 100644 Documentation/tools/rtla/rtla-osnoise-top.rst create mode 100644 Documentation/tools/rtla/rtla-osnoise.rst create mode 100644 Documentation/tools/rtla/rtla-timerlat-hist.rst create mode 100644 Documentation/tools/rtla/rtla-timerlat-top.rst create mode 100644 Documentation/tools/rtla/rtla-timerlat.rst create mode 100644 Documentation/tools/rtla/rtla.rst create mode 100644 tools/tracing/rtla/Makefile create mode 100644 tools/tracing/rtla/src/osnoise.c create mode 100644 tools/tracing/rtla/src/osnoise.h create mode 100644 tools/tracing/rtla/src/osnoise_hist.c create mode 100644 tools/tracing/rtla/src/osnoise_top.c create mode 100644 tools/tracing/rtla/src/rtla.c create mode 100644 tools/tracing/rtla/src/timerlat.c create mode 100644 tools/tracing/rtla/src/timerlat.h create mode 100644 tools/tracing/rtla/src/timerlat_hist.c create mode 100644 tools/tracing/rtla/src/timerlat_top.c create mode 100644 tools/tracing/rtla/src/trace.c create mode 100644 tools/tracing/rtla/src/trace.h create mode 100644 tools/tracing/rtla/src/utils.c create mode 100644 tools/tracing/rtla/src/utils.h -- 2.31.1