Received: by 10.223.185.116 with SMTP id b49csp1481961wrg; Fri, 16 Feb 2018 21:54:29 -0800 (PST) X-Google-Smtp-Source: AH8x225CpjPiuaLDWlUSc5SmRRmRwnWB7FSzM69mBF526ytPC2LWBQfUeUaoQhI+bfg6uaaO70xS X-Received: by 2002:a17:902:51e9:: with SMTP id y96-v6mr7995082plh.344.1518846869306; Fri, 16 Feb 2018 21:54:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518846869; cv=none; d=google.com; s=arc-20160816; b=cuo40W2nxGNn0jYHy6m+GmKOIZAhNbnNc5VifeqyEGBRWeKCsmz5HInR7AwPlJn+Wq zl7WmnXojEL8RsJT2gRL/fQDBmFbNAeB+oP2SAih7Ke5/nzfc0dkpxH6ggeBrKyO209v Krfo/cH2K2Ik6CurvnowM/hyHDcMcFroMzz3WbnUdzOgpMojYdN3MlTUOaZmAFuPVvGW MhmWfVKf4J8hKV5IUiYwkMcag2NQDwP/M94lTQibYZIhc1nkhfeboMS6z0ydKlvfWYXh hCw6P9rjWq6Hp5trYA7YIMm3MgJd4ZiD7xNVGex6rIGX7JJt8j8TZfw3w0jzU8KMcva7 JTrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=07+Bk2t9lHyJXQ5TKB7BxJQe58m2TnCL4cfMNm5IroI=; b=pYZEmVthmKm9lSJmb1fmXAZ8Gwe+zX1kFEsnNQdSxVPQl0YfS/lGsfWQf5jwuZdy51 badOqAi5zPY5siqlX95ymgnatYO+IRD8E6JMNP/KhIk/sqwIn1rYLKnm7SVc9hNqwxHe x/nXDUvkchZRy/C0tDB/FVMfI7+CcvpNYBGRxdPAtIgkRT+ULwDzSPINMwtsaRVZQafu 2qhrgddZjMvhiBiYGeazbnWB+ZIi2/NO7zgvb5SCSMNcpAP7hjNhFDPEEHInWHBj68mP cTwNcM3pE5P+9PeZlX1aIQUM04R5aitKOLT2U1Q8/HBPtqJxD9OgS6NSfrYeH8xseOSD umTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si2405809pgr.12.2018.02.16.21.54.15; Fri, 16 Feb 2018 21:54:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751315AbeBQFws (ORCPT + 99 others); Sat, 17 Feb 2018 00:52:48 -0500 Received: from mga18.intel.com ([134.134.136.126]:1052 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077AbeBQFtD (ORCPT ); Sat, 17 Feb 2018 00:49:03 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Feb 2018 21:49:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,523,1511856000"; d="scan'208";a="20863333" Received: from gvt-dell.bj.intel.com (HELO gvt-dell-host.bj.intel.com) ([10.238.154.59]) by fmsmga002.fm.intel.com with ESMTP; 16 Feb 2018 21:49:01 -0800 From: changbin.du@intel.com To: corbet@lwn.net, rostedt@goodmis.org Cc: mingo@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Changbin Du Subject: [PATCH 03/17] trace doc: add ftrace-uses.rst to doc tree Date: Sat, 17 Feb 2018 13:39:36 +0800 Message-Id: <1518845990-20733-4-git-send-email-changbin.du@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518845990-20733-1-git-send-email-changbin.du@intel.com> References: <1518845990-20733-1-git-send-email-changbin.du@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Changbin Du Add ftrace-uses.rst into Sphinx TOC tree. Few format issues are fixed. Cc: Steven Rostedt Signed-off-by: Changbin Du --- Documentation/trace/ftrace-uses.rst | 23 ++++++++++++----------- Documentation/trace/index.rst | 1 + 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Documentation/trace/ftrace-uses.rst b/Documentation/trace/ftrace-uses.rst index 3aed560..998a60a 100644 --- a/Documentation/trace/ftrace-uses.rst +++ b/Documentation/trace/ftrace-uses.rst @@ -21,13 +21,14 @@ how to use ftrace to implement your own function callbacks. The ftrace context ================== +.. warning:: -WARNING: The ability to add a callback to almost any function within the -kernel comes with risks. A callback can be called from any context -(normal, softirq, irq, and NMI). Callbacks can also be called just before -going to idle, during CPU bring up and takedown, or going to user space. -This requires extra care to what can be done inside a callback. A callback -can be called outside the protective scope of RCU. + The ability to add a callback to almost any function within the + kernel comes with risks. A callback can be called from any context + (normal, softirq, irq, and NMI). Callbacks can also be called just before + going to idle, during CPU bring up and takedown, or going to user space. + This requires extra care to what can be done inside a callback. A callback + can be called outside the protective scope of RCU. The ftrace infrastructure has some protections agains recursions and RCU but one must still be very careful how they use the callbacks. @@ -54,15 +55,15 @@ an ftrace_ops with ftrace: Both .flags and .private are optional. Only .func is required. -To enable tracing call:: +To enable tracing call: .. c:function:: register_ftrace_function(&ops); -To disable tracing call:: +To disable tracing call: .. c:function:: unregister_ftrace_function(&ops); -The above is defined by including the header:: +The above is defined by including the header: .. c:function:: #include @@ -200,7 +201,7 @@ match a specific pattern. See Filter Commands in :file:`Documentation/trace/ftrace.txt`. -To just trace the schedule function:: +To just trace the schedule function: .. code-block:: c @@ -210,7 +211,7 @@ To add more functions, call the ftrace_set_filter() more than once with the @reset parameter set to zero. To remove the current filter set and replace it with new functions defined by @buf, have @reset be non-zero. -To remove all the filtered functions and trace all functions:: +To remove all the filtered functions and trace all functions: .. code-block:: c diff --git a/Documentation/trace/index.rst b/Documentation/trace/index.rst index c8000ba..aa2baad 100644 --- a/Documentation/trace/index.rst +++ b/Documentation/trace/index.rst @@ -6,3 +6,4 @@ Linux Tracing Technologies :maxdepth: 2 ftrace-design + ftrace-uses -- 2.7.4