Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1379459ybt; Sat, 27 Jun 2020 06:37:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgymM2vGGObZe3/rWWdFQ9cpeUctwkLqstMgD8TyG6loeR07zpCn/N31qNhCprq5Y4GaBb X-Received: by 2002:a17:906:c285:: with SMTP id r5mr6520357ejz.153.1593265067249; Sat, 27 Jun 2020 06:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593265067; cv=none; d=google.com; s=arc-20160816; b=W75y+pJVa/UFXAd1G4vJWscu6ZcVB4lLQ6Jaz0MCeLTuDsA0VptluNYN8v8+6aLtqA CVd3OjzHQMM+VrYNCK1qGowc5Gd9RUlBD7oly0ir0hMDA4HCa03rrZsL1rcaoaDD4lAI R6HHSnyZFtZvHfOBEl8yhgC4y5qSI3do+M2Dz1G2075T4jiyCMr3ayVsEdiLJ1CGaXEN P580a9fUo5M+W3HJvVfuVIS0NdS+JwqjQHWw1ZQrU6+ziYW+rpWu8UCTCjjnMQr+yqOx Azw5YowbvQJpW03dSEEBcBbA482utxhYufKY5ErDCg0w/dKcLm0NfgaSjxLiYWUOxE64 7rVQ== 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=RMfTKMXJJ+uG9witg1g7+yEtNI0nSxRLJvkxgOHd2N8=; b=D2jfmko13iUVszUcisbifL1JsNLpi/jYj9wgkfSEnqOmhxmuqFbgSe8bziW0vnWSTG WLxIoaUtnXQ0dTRGfsrKWm7irgfvEwvnm5HjdXUS8ePF+Uvd7XiHx+RXV+Mlirmkq1El PTUDcYbIpXEG9JcyM12LIlaQC0fwkFi9zBqOaf812KUvaijxj56BCTEuFrblbzeEqqi6 /3K/1ZQErwFRD/pib4YoThDo3TsBxVrcwcJeI6rJD5LUrzMHUfhxRGGry4L223rylvCT mnCh6ZVDWeXEgCtjhFXk9VwUv7G4urf7C6l9dxdlNYuN6ZRVf8vUuUQCwbX7dTA0FBKG 8rPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y24TpYp7; 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 n23si10483068ejx.656.2020.06.27.06.37.22; Sat, 27 Jun 2020 06:37:47 -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=Y24TpYp7; 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 S1726410AbgF0NhN (ORCPT + 99 others); Sat, 27 Jun 2020 09:37:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725850AbgF0NhM (ORCPT ); Sat, 27 Jun 2020 09:37:12 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54404C061794 for ; Sat, 27 Jun 2020 06:37:12 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id b16so5880992pfi.13 for ; Sat, 27 Jun 2020 06:37:12 -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=RMfTKMXJJ+uG9witg1g7+yEtNI0nSxRLJvkxgOHd2N8=; b=Y24TpYp7GiL+DBFNE/iAVtB7IJCFgb48A0ppWBEN2UDkgT3NEvo/UGugkKipvjWPdi sXw8ZfjaVKIPJJNcvQclefC6y5nHqxqy4iqoov7luIxh74d9G8PnWcwzdmmfFcjjBtlq vTLLnyw7cNi0Nkt8hny9KSlfKtlEcx0j56U1wRiJ2isQcnzzWHD61SBDdAnyGm7Hmwgf Bu5EVDUeZEel7v4ofraf7jiNTxINvijrrE+T6TgJ6q+Z7aZ+oId0Ex+Jm/XgdIMje8tP qSb4UZCoZ1ptB4vmoQDUjaIGq0CzwnyJL3VbJQhyJkP5/tT0SkzNhwzhHp2XQyoF15TA oKZg== 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=RMfTKMXJJ+uG9witg1g7+yEtNI0nSxRLJvkxgOHd2N8=; b=TrwQFFmrl3yy/CIgVfhBKTDNaf7Ry082SBJL/Zt9ILXSzkThyXWlPeUd941htSmXXw Fl6716/GIPoSw0k+p1awmlU3+vgvkgvOpilbGRvuXyX3D1FmDAtM2iS+0x97MqMDj6A2 K2N+n56f0MN9PDjpXLajxhNMpQaA5g9c87UgtuhdkTynze4z/4kNJrUtjP6ABXL1yB5V GZ2mq/kYYsyS41M9i53i4EsgI+kmoSm+AmGLfw5oOyt4CETmQDUtVReTN2BqILHwGN9C q2/R4c3mgcZuZt3F2b/uouEqUyhzY4Aod0FxHV/U1Swh14QgMWaZBbltn/HYyIfUoiYR FFtQ== X-Gm-Message-State: AOAM531+br8dQkjLbVoPbjLyKftwe1qDmuKfXfoBHbgnZCuWK+Mk5ziG IQklncJZQuJ8WR/9Jp/cm/4= X-Received: by 2002:a62:1d8e:: with SMTP id d136mr7030612pfd.323.1593265031590; Sat, 27 Jun 2020 06:37:11 -0700 (PDT) Received: from vultr.guest ([149.248.10.52]) by smtp.gmail.com with ESMTPSA id x8sm15060086pje.31.2020.06.27.06.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jun 2020 06:37:10 -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 v2 00/15] perf: ftrace enhancement Date: Sat, 27 Jun 2020 21:36:39 +0800 Message-Id: <20200627133654.64863-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 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: $ sudo perf ftrace -h Usage: perf ftrace [] [] or: perf ftrace [] -- [] -a, --all-cpus system-wide collection from all CPUs -C, --cpu list of cpus to monitor -d, --delay ms to wait before starting tracing after program start -D, --graph-depth Max depth for function graph tracer -F, --funcs Show available functions to filter -G, --graph-funcs trace given functions using function_graph tracer -g, --nograph-funcs Set nograph filter on given functions -m, --buffer-size size of per cpu buffer in kb -N, --notrace-funcs do not trace given functions -p, --pid trace on existing process id -t, --tid trace on existing thread id (exclusive to --pid) -T, --trace-funcs trace given functions using function tracer -t, --tracer tracer to use: function or function_graph (This option is deprecated) -v, --verbose be more verbose --func-call-graph show kernel stack trace for function tracer --func-irq-info display irq info for function tracer --graph-noirqs ignore functions that happen inside interrupt for function_graph tracer --graph-nosleep-time measure on-CPU time only for function_graph tracer --graph-thresh only show functions of which the duration is greater than µs --graph-verbose show process names, PIDs, timestamps for function_graph tracer --inherit trace children processes v2: o patches for option '-u/--userstacktrace' and '--no-pager' are dropped. o update all related perf documentation. o rename some options. Now all funcgraph tracer options are prefixed with '--graph-', while all function tracer options are prefixed with '--func-'. o mark old options deprecated instead of removing them. Changbin Du (15): perf ftrace: select function/function_graph tracer automatically perf ftrace: add option '-F/--funcs' to list available functions perf ftrace: add option -t/--tid to filter by thread id perf ftrace: add option -d/--delay to delay tracing perf ftrace: factor out function write_tracing_file_int() perf ftrace: add option '-m/--buffer-size' to set per-cpu buffer size perf ftrace: show trace column header perf ftrace: add option '--inherit' to trace children processes perf ftrace: add support for tracing option 'func_stack_trace' perf ftrace: add support for trace option sleep-time perf ftrace: add support for trace option funcgraph-irqs perf ftrace: add support for tracing option 'irq-info' perf ftrace: add option '--graph-verbose' to show more info for graph tracer perf ftrace: add support for trace option tracing_thresh perf ftrace: add change log tools/perf/Documentation/perf-config.txt | 5 - tools/perf/Documentation/perf-ftrace.txt | 39 ++- tools/perf/builtin-ftrace.c | 295 +++++++++++++++++++++-- 3 files changed, 319 insertions(+), 20 deletions(-) -- 2.25.1