Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1165831ybk; Sun, 10 May 2020 08:08:38 -0700 (PDT) X-Google-Smtp-Source: APiQypJY50SJSS9Ukdx5l2S2a5qiJenOxWl3wITHt8qj3Wlv3JLfB/TF/yRCkf1keIZfDqAiPFnl X-Received: by 2002:a05:6402:1a46:: with SMTP id bf6mr9687140edb.44.1589123318489; Sun, 10 May 2020 08:08:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589123318; cv=none; d=google.com; s=arc-20160816; b=KiOrc2KyxUh4AFfxW17nnvNe268RuofdJE+oKFUXk8nh8o6ueaJFDuiK0wqLlLesMM aRkzvzuvrLOTp9jJ221h7KavBQiNpa/MCb7xQ2n+dTHgJTBH2ZROzDqijCIAbDw+oqpj pFSlAGTb3GPkFXmiHkXhXNjemcsDMD6u7i0e9nr8MjEL1azDHrTdad9VsK/cK3mGVVkx M0BMXG7Hi8Y6pWGj2VR+adzVIXwRmxDCR9nMDbuzC0nBhufQon9TYV7H310Lc1rtGNUL BA98kypZrGCdkwf0IfCICIB3JfxDIP04BugmtdZB0k/riRO2juMgXQeiP/bpmPZFm6jI z1Bw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=0Cxj8lcHsS/+kBeZtbBYJ1GBSZzCTGYQX2ru9hFa8G8=; b=N9HZZok8PtQ8qiLHvoUetcA6juGc0NhZJdBTNNGU3aPPFxNeGz4qtxnQ0o2i/0G4sb /WTtgqaw/z8577mFOXo62mAupXbT73uZZ1RT1ktMEZHHYKZPqyjV6bBLOtDpV7msWBk/ NWD7uhBnbuAInTFeDq4WSoeTrdN54TiFFVm+xY/mMio2u7nH+E1kpm1W9r9OaSOwDyxb wh411Xf893zQVn5sytbdeKoB4LOEwBxQg758t2WQSEb0tkUgR6L/5rSfyBa4uwW8QJB3 RaUzpg0Upr/zdZkNCxYuJi/9pgw//B3Xccf629WXvlb/V6OBBJkek8pMWBfnh8QBYIJ1 IRcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RyLeqJdT; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k2si4603132edl.579.2020.05.10.08.08.15; Sun, 10 May 2020 08:08:38 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RyLeqJdT; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729060AbgEJPGu (ORCPT + 99 others); Sun, 10 May 2020 11:06:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726104AbgEJPGt (ORCPT ); Sun, 10 May 2020 11:06:49 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73685C061A0C for ; Sun, 10 May 2020 08:06:49 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id mq3so6522015pjb.1 for ; Sun, 10 May 2020 08:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0Cxj8lcHsS/+kBeZtbBYJ1GBSZzCTGYQX2ru9hFa8G8=; b=RyLeqJdTsX8gRi0JgXj67zKVvEAH7xedIMgAmhLBrUL81MfTPIw7kAPAbHLHkA0otC 2+Gr68lC+WvaKTlKXjDgiX2BNE9qcX7NPw7+5MhyECXkD5DO8OkiovyFPwuw3faQQHHK esF/wZqfL60yZeYKVRjrgbTsVtoQQGQtxo7352sNsAlqULLoxHs7Hfndj/tFlKevV2wU sJFFNEhI8QXzWcAt/h5brJ56euXBA5PoxAA4GenEux4ev/3Kbvqg4T7ZiWJlo9EMshiN 0GzFdUojv0uwYGvDPx2yb7YnW/WfwtHZFHZcJOLOHEdTj2+gVilMBRb5gQ79DUcWZvr+ eYwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0Cxj8lcHsS/+kBeZtbBYJ1GBSZzCTGYQX2ru9hFa8G8=; b=YOl8G6RCBQbBJLYkrmlWG7lpC1npNws9F/ELOuMglMR8sC7ZaDX7BoasmII+Kn24ZU yg/+PKjlFCWNx9xie8rf0AOstDLl+aYcq+jMBta8+ixDIQP5sC+oJ1nm3ra8gZql55sf zBSwauwlAmVFrFXECUMU5B4PSLpnTBr1/Oqbn6/YI9EVpddtuYGa4Ricctes6Lt7J+J6 ujI9oVimnx29oozSkyvqJxEDgTCzbC3ehmrEX6evnC/KOmJYCqvKiOGoy+YyyyPAWwi/ lLkJQR5MniHeQFxEYg/xZs9wN1qAqheOmJzgBsWOQ4BjHKbHwG70AvYJuBe7f9e1BQpm mSew== X-Gm-Message-State: AGi0PuYfoy0SEiqKyA+ylHmRsUDDYg4KIOlh/A+DEUrwO6OTBbr2A0sL NKIfgCPjxmzKGY3RL4T6mlw= X-Received: by 2002:a17:902:207:: with SMTP id 7mr10868604plc.331.1589123208775; Sun, 10 May 2020 08:06:48 -0700 (PDT) Received: from vultr.guest ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id v7sm6870909pfm.146.2020.05.10.08.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 May 2020 08:06:47 -0700 (PDT) From: Changbin Du To: Jiri Olsa , Arnaldo Carvalho de Melo Cc: Peter Zijlstra , Ingo Molnar , Namhyung Kim , Steven Rostedt , linux-kernel@vger.kernel.org, Changbin Du Subject: [PATCH 00/19] perf: ftrace enhancement Date: Sun, 10 May 2020 23:06:09 +0800 Message-Id: <20200510150628.16610-1-changbin.du@gmail.com> X-Mailer: git-send-email 2.25.1 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 The perf has basic kernel ftrace support but lack support of most tracing options. This serias is target to enhance the perf ftrace functionality so that we can make full use of kernel ftrace with only perf. In general, this serias be cataloged into two main changes: 1) Improve usability of existing functions. For example, we don't need to type extra option to select the tracer. 2) Add new options to support all other ftrace functions. Here is a glance of all ftrace functions with this serias: * - improved existing options. + - new added options. $ sudo perf ftrace -h Usage: perf ftrace [] [] or: perf ftrace [] -- [] * -a, --all-cpus system-wide collection from all CPUs + -b, --buffer-size size of per cpu buffer in kb -C, --cpu list of cpus to monitor + -d, --delay Wait ms before tracing -D, --graph-depth Max depth for function graph tracer * -G, --graph-funcs Set graph filter on given functions (imply to use function_graph tracer) -g, --nograph-funcs Set nograph filter on given functions (imply to use function_graph tracer) + -L, --list-functions List available functions to filter + -l, --long-info Show process names, PIDs, timestamps, irq-info if available -N, --notrace-funcs do not trace given functions + -P, --no-pager Do not use pager -p, --pid trace on existing process id + -s, --func-stack-trace Show kernel stack trace for function tracer + -t, --tid trace on existing thread id (exclusive to --pid) -T, --trace-funcs trace given functions only + -u, --userstacktrace Show stacktrace of the current user space thread -v, --verbose be more verbose + --funcgraph-tail Show function tails comment (function_graph only) + --latency-format displays additional information about the latency (function_graph only) + --nofuncgraph-irqs Ignore functions that happen inside interrupt (function_graph only) + --nosleep-time Measure on-CPU time only (function_graph only) + --trace-children Trace children processes + --tracing-thresh Only show functions of which the duration is greater than µs Changbin Du (19): perf ftrace: trace system wide if no target is given perf ftrace: detect workload failure perf ftrace: select function/function_graph tracer automatically perf ftrace: add support for tracing option 'func_stack_trace' perf ftrace: add option '-l/--list-functions' to list available functions perf ftrace: add support for trace option sleep-time perf ftrace: add support for trace option funcgraph-irqs perf ftrace: add option -l/--long-info to show more info perf ftrace: add support for trace option tracing_thresh perf ftrace: add support for trace option funcgraph-tail perf ftrace: add option '-u/--userstacktrace' to show userspace stacktrace perf ftrace: add support for tracing children processes perf ftrace: add option '-b/--buffer-size' to set per-cpu buffer size perf ftrace: add option -P/--no-pager to disable pager perf ftrace: show trace column header perf ftrace: add option -t/--tid to filter by thread id perf ftrace: add option -d/--delay to delay tracing perf ftrace: add option --latency-format to display more info about delay perf ftrace: add change log tools/perf/Documentation/perf-config.txt | 5 - tools/perf/builtin-ftrace.c | 388 ++++++++++++++++++++--- 2 files changed, 345 insertions(+), 48 deletions(-) -- 2.25.1