linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] tracing/boot: Add new options for tracing specific period
@ 2020-08-31 12:45 Masami Hiramatsu
  2020-08-31 12:45 ` [PATCH 1/6] kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot Masami Hiramatsu
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2020-08-31 12:45 UTC (permalink / raw)
  To: Steven Rostedt, Jonathan Corbet; +Cc: mhiramat, linux-kernel, linux-doc

Hi,

Here is a series of patches to improve the boot-time tracing to support
kretprobe and tracing_on option. The combination of these options allows
us to trace events while a specific function call period.

This also includes a bugfix about boot-time kprobe event as [1/6].

For example, this bootconfig will make a function callgraph in the
pci_proc_init() function at boot time.

ftrace {
	tracing_on = 0  # off at start
	tracer = function_graph
	event.kprobes {
		start_event {
			probes = "pci_proc_init"
			actions = "traceon"
		}
		end_event {
			probes = "pci_proc_init%return"
			actions = "traceoff"
		}
	}
}

Here is the example output;

# tracer: function_graph
#
# CPU  DURATION                  FUNCTION CALLS
# |     |   |                     |   |   |   |
 0)               |  pci_proc_init() {
 0)               |    proc_mkdir() {
 0)               |      proc_mkdir_data() {
 0)               |        __proc_create() {
 0)               |          _raw_read_lock() {
 0)   0.179 us    |            preempt_count_add();
 0)   0.203 us    |            do_raw_read_lock();
 0)   1.210 us    |          }
 0)               |          __xlate_proc_name() {
 0)   0.449 us    |            pde_subdir_find();
 0)   0.913 us    |          }
 0)               |          _raw_read_unlock() {
 0)   0.169 us    |            do_raw_read_unlock();
 0)   0.175 us    |            preempt_count_sub();
 0)   0.841 us    |          }
 0)               |          kmem_cache_alloc() {
 0)               |            fs_reclaim_acquire() {
 0)   0.154 us    |              __need_fs_reclaim();
 0)   0.240 us    |              fs_reclaim_acquire.part.0();
 0)   0.889 us    |            }
 0)               |            fs_reclaim_release() {
 0)   0.174 us    |              __need_fs_reclaim();
 0)   0.516 us    |            }
 0)   0.157 us    |            should_failslab();
 0)               |            rcu_read_lock_sched_held() {
 0)               |              rcu_read_lock_held_common() {
 0)   0.156 us    |                rcu_is_watching();
 0)   0.158 us    |                rcu_lockdep_current_cpu_online();
 0)   0.735 us    |              }
 0)   1.054 us    |            }
 0)   3.407 us    |          }
 0)   0.168 us    |          __raw_spin_lock_init();
 0)   7.575 us    |        }
 0)               |        proc_register() {
 0)               |          _raw_spin_lock_irqsave() {
 0)   0.187 us    |            preempt_count_add();
...


Thank you,

---

Masami Hiramatsu (6):
      kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot
      tracing/boot: Add per-instance tracing_on option support
      Documentation: tracing: Add tracing_on option to boot-time tracer
      tracing/kprobes: Support perf-style return probe
      Documentation: tracing: Add %return suffix description
      Documentation: tracing: boot: Add an example of tracing function-calls


 Documentation/trace/boottime-trace.rst |   24 ++++++++++++++++++++++++
 Documentation/trace/kprobetrace.rst    |    2 ++
 include/linux/kprobes.h                |    5 +++++
 init/main.c                            |    2 ++
 kernel/kprobes.c                       |   22 ++++++++++++++++++++++
 kernel/trace/trace_boot.c              |   10 ++++++++++
 kernel/trace/trace_kprobe.c            |   21 ++++++++++++++++++++-
 7 files changed, 85 insertions(+), 1 deletion(-)

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/6] kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot
  2020-08-31 12:45 [PATCH 0/6] tracing/boot: Add new options for tracing specific period Masami Hiramatsu
@ 2020-08-31 12:45 ` Masami Hiramatsu
  2020-08-31 16:25   ` kernel test robot
  2020-08-31 12:45 ` [PATCH 2/6] tracing/boot: Add per-instance tracing_on option support Masami Hiramatsu
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Masami Hiramatsu @ 2020-08-31 12:45 UTC (permalink / raw)
  To: Steven Rostedt, Jonathan Corbet; +Cc: mhiramat, linux-kernel, linux-doc

Since kprobe_event= cmdline option allows user to put kprobes on the
functions in initmem, kprobe has to make such probes gone after boot.
Currently the probes on the init functions in modules will be handled
by module callback, but the kernel init text isn't handled.
Without this, kprobes may access non-exist text area to disable or
remove it.

Fixes: 970988e19eb0 ("tracing/kprobe: Add kprobe_event= boot parameter")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 include/linux/kprobes.h |    5 +++++
 init/main.c             |    2 ++
 kernel/kprobes.c        |   22 ++++++++++++++++++++++
 3 files changed, 29 insertions(+)

diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 9be1bff4f586..8aab327b5539 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -373,6 +373,8 @@ void unregister_kretprobes(struct kretprobe **rps, int num);
 void kprobe_flush_task(struct task_struct *tk);
 void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
 
+void kprobe_free_init_mem(void);
+
 int disable_kprobe(struct kprobe *kp);
 int enable_kprobe(struct kprobe *kp);
 
@@ -435,6 +437,9 @@ static inline void unregister_kretprobes(struct kretprobe **rps, int num)
 static inline void kprobe_flush_task(struct task_struct *tk)
 {
 }
+static inline void kprobe_free_init_mem(void)
+{
+}
 static inline int disable_kprobe(struct kprobe *kp)
 {
 	return -ENOSYS;
diff --git a/init/main.c b/init/main.c
index ae78fb68d231..038128b2a755 100644
--- a/init/main.c
+++ b/init/main.c
@@ -33,6 +33,7 @@
 #include <linux/nmi.h>
 #include <linux/percpu.h>
 #include <linux/kmod.h>
+#include <linux/kprobes.h>
 #include <linux/vmalloc.h>
 #include <linux/kernel_stat.h>
 #include <linux/start_kernel.h>
@@ -1402,6 +1403,7 @@ static int __ref kernel_init(void *unused)
 	kernel_init_freeable();
 	/* need to finish all async __init code before freeing the memory */
 	async_synchronize_full();
+	kprobe_free_init_mem();
 	ftrace_free_init_mem();
 	free_initmem();
 	mark_readonly();
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 287b263c9cb9..48747bd60295 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -2726,6 +2726,28 @@ static int disarm_all_kprobes(void)
 	return ret;
 }
 
+void kprobe_free_init_mem(void)
+{
+	void *start = (void *)(&__init_begin);
+	void *end = (void *)(&__init_end);
+	struct hlist_head *head;
+	struct kprobe *p;
+	int i;
+
+	mutex_lock(&kprobe_mutex);
+
+	/* Kill all kprobes on initmem */
+	for (i = 0; i < KPROBE_TABLE_SIZE; i++) {
+		head = &kprobe_table[i];
+		hlist_for_each_entry(p, head, hlist) {
+			if (start <= (void *)p->addr && (void *)p->addr < end)
+				kill_kprobe(p);
+		}
+	}
+
+	mutex_unlock(&kprobe_mutex);
+}
+
 /*
  * XXX: The debugfs bool file interface doesn't allow for callbacks
  * when the bool state is switched. We can reuse that facility when


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/6] tracing/boot: Add per-instance tracing_on option support
  2020-08-31 12:45 [PATCH 0/6] tracing/boot: Add new options for tracing specific period Masami Hiramatsu
  2020-08-31 12:45 ` [PATCH 1/6] kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot Masami Hiramatsu
@ 2020-08-31 12:45 ` Masami Hiramatsu
  2020-08-31 12:45 ` [PATCH 3/6] Documentation: tracing: Add tracing_on option to boot-time tracer Masami Hiramatsu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2020-08-31 12:45 UTC (permalink / raw)
  To: Steven Rostedt, Jonathan Corbet; +Cc: mhiramat, linux-kernel, linux-doc

Add per-instance tracing_on option, which will be useful with
traceon/traceoff event trigger actions. For example, if we
disable tracing_on by default and set traceon and traceoff on
a pair of events, we can trace functions between the pair of
events.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 kernel/trace/trace_boot.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/kernel/trace/trace_boot.c b/kernel/trace/trace_boot.c
index fa0fc08c6ef8..d52d441a17e8 100644
--- a/kernel/trace/trace_boot.c
+++ b/kernel/trace/trace_boot.c
@@ -40,6 +40,16 @@ trace_boot_set_instance_options(struct trace_array *tr, struct xbc_node *node)
 			pr_err("Failed to set option: %s\n", buf);
 	}
 
+	p = xbc_node_find_value(node, "tracing_on", NULL);
+	if (p && *p != '\0') {
+		if (kstrtoul(p, 10, &v))
+			pr_err("Failed to set tracing on: %s\n", p);
+		if (v)
+			tracer_tracing_on(tr);
+		else
+			tracer_tracing_off(tr);
+	}
+
 	p = xbc_node_find_value(node, "trace_clock", NULL);
 	if (p && *p != '\0') {
 		if (tracing_set_clock(tr, p) < 0)


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/6] Documentation: tracing: Add tracing_on option to boot-time tracer
  2020-08-31 12:45 [PATCH 0/6] tracing/boot: Add new options for tracing specific period Masami Hiramatsu
  2020-08-31 12:45 ` [PATCH 1/6] kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot Masami Hiramatsu
  2020-08-31 12:45 ` [PATCH 2/6] tracing/boot: Add per-instance tracing_on option support Masami Hiramatsu
@ 2020-08-31 12:45 ` Masami Hiramatsu
  2020-08-31 12:46 ` [PATCH 4/6] tracing/kprobes: Support perf-style return probe Masami Hiramatsu
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2020-08-31 12:45 UTC (permalink / raw)
  To: Steven Rostedt, Jonathan Corbet; +Cc: mhiramat, linux-kernel, linux-doc

Add tracing_on option description to the boot-time tracer.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 Documentation/trace/boottime-trace.rst |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/trace/boottime-trace.rst b/Documentation/trace/boottime-trace.rst
index dcb390075ca1..1341b449acaa 100644
--- a/Documentation/trace/boottime-trace.rst
+++ b/Documentation/trace/boottime-trace.rst
@@ -61,6 +61,10 @@ These options can be used for each instance including global ftrace node.
 ftrace.[instance.INSTANCE.]options = OPT1[, OPT2[...]]
    Enable given ftrace options.
 
+ftrace.[instance.INSTANCE.]tracing_on = 0|1
+   Enable/Disable tracing on this instance when boot.
+   (you can enable it by the "traceon" event trigger action)
+
 ftrace.[instance.INSTANCE.]trace_clock = CLOCK
    Set given CLOCK to ftrace's trace_clock.
 


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/6] tracing/kprobes: Support perf-style return probe
  2020-08-31 12:45 [PATCH 0/6] tracing/boot: Add new options for tracing specific period Masami Hiramatsu
                   ` (2 preceding siblings ...)
  2020-08-31 12:45 ` [PATCH 3/6] Documentation: tracing: Add tracing_on option to boot-time tracer Masami Hiramatsu
@ 2020-08-31 12:46 ` Masami Hiramatsu
  2020-08-31 12:46 ` [PATCH 5/6] Documentation: tracing: Add %return suffix description Masami Hiramatsu
  2020-08-31 12:46 ` [PATCH 6/6] Documentation: tracing: boot: Add an example of tracing function-calls Masami Hiramatsu
  5 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2020-08-31 12:46 UTC (permalink / raw)
  To: Steven Rostedt, Jonathan Corbet; +Cc: mhiramat, linux-kernel, linux-doc

Support perf-style return probe ("SYMBOL%return") in kprobe events.
This will allow boot-time tracing user to define a return probe event.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 kernel/trace/trace_kprobe.c |   21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index aefb6065b508..391361b67c8f 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -709,6 +709,18 @@ static inline void sanitize_event_name(char *name)
 			*name = '_';
 }
 
+static inline bool split_return_suffix(char *symbol)
+{
+	char *p = strchr(symbol, '%');
+
+	if (p && !strcmp(p, "%return")) {
+		*p = '\0';
+		return true;
+	}
+
+	return false;
+}
+
 static int trace_kprobe_create(int argc, const char *argv[])
 {
 	/*
@@ -717,6 +729,9 @@ static int trace_kprobe_create(int argc, const char *argv[])
 	 *      p[:[GRP/]EVENT] [MOD:]KSYM[+OFFS]|KADDR [FETCHARGS]
 	 *  - Add kretprobe:
 	 *      r[MAXACTIVE][:[GRP/]EVENT] [MOD:]KSYM[+0] [FETCHARGS]
+	 *    Or
+	 *      p:[GRP/]EVENT] [MOD:]KSYM[+0]%return [FETCHARGS]
+	 *
 	 * Fetch args:
 	 *  $retval	: fetch return value
 	 *  $stack	: fetch stack address
@@ -746,7 +761,6 @@ static int trace_kprobe_create(int argc, const char *argv[])
 	switch (argv[0][0]) {
 	case 'r':
 		is_return = true;
-		flags |= TPARG_FL_RETURN;
 		break;
 	case 'p':
 		break;
@@ -804,12 +818,17 @@ static int trace_kprobe_create(int argc, const char *argv[])
 		symbol = kstrdup(argv[1], GFP_KERNEL);
 		if (!symbol)
 			return -ENOMEM;
+
+		is_return = split_return_suffix(symbol) || is_return;
+
 		/* TODO: support .init module functions */
 		ret = traceprobe_split_symbol_offset(symbol, &offset);
 		if (ret || offset < 0 || offset > UINT_MAX) {
 			trace_probe_log_err(0, BAD_PROBE_ADDR);
 			goto parse_error;
 		}
+		if (is_return)
+			flags |= TPARG_FL_RETURN;
 		if (kprobe_on_func_entry(NULL, symbol, offset))
 			flags |= TPARG_FL_FENTRY;
 		if (offset && is_return && !(flags & TPARG_FL_FENTRY)) {


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/6] Documentation: tracing: Add %return suffix description
  2020-08-31 12:45 [PATCH 0/6] tracing/boot: Add new options for tracing specific period Masami Hiramatsu
                   ` (3 preceding siblings ...)
  2020-08-31 12:46 ` [PATCH 4/6] tracing/kprobes: Support perf-style return probe Masami Hiramatsu
@ 2020-08-31 12:46 ` Masami Hiramatsu
  2020-08-31 18:50   ` Randy Dunlap
  2020-08-31 12:46 ` [PATCH 6/6] Documentation: tracing: boot: Add an example of tracing function-calls Masami Hiramatsu
  5 siblings, 1 reply; 12+ messages in thread
From: Masami Hiramatsu @ 2020-08-31 12:46 UTC (permalink / raw)
  To: Steven Rostedt, Jonathan Corbet; +Cc: mhiramat, linux-kernel, linux-doc

Add a description of the %return suffix option for kprobe tracer.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 Documentation/trace/kprobetrace.rst |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/trace/kprobetrace.rst b/Documentation/trace/kprobetrace.rst
index c1709165c553..d29d1f9e6721 100644
--- a/Documentation/trace/kprobetrace.rst
+++ b/Documentation/trace/kprobetrace.rst
@@ -30,6 +30,7 @@ Synopsis of kprobe_events
 
   p[:[GRP/]EVENT] [MOD:]SYM[+offs]|MEMADDR [FETCHARGS]	: Set a probe
   r[MAXACTIVE][:[GRP/]EVENT] [MOD:]SYM[+0] [FETCHARGS]	: Set a return probe
+  p:[GRP/]EVENT] [MOD:]SYM[+0]%return [FETCHARGS]	: Set a return probe
   -:[GRP/]EVENT						: Clear a probe
 
  GRP		: Group name. If omitted, use "kprobes" for it.
@@ -37,6 +38,7 @@ Synopsis of kprobe_events
 		  based on SYM+offs or MEMADDR.
  MOD		: Module name which has given SYM.
  SYM[+offs]	: Symbol+offset where the probe is inserted.
+ SYM%return     : Return address of the symbol
  MEMADDR	: Address where the probe is inserted.
  MAXACTIVE	: Maximum number of instances of the specified function that
 		  can be probed simultaneously, or 0 for the default value


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/6] Documentation: tracing: boot: Add an example of tracing function-calls
  2020-08-31 12:45 [PATCH 0/6] tracing/boot: Add new options for tracing specific period Masami Hiramatsu
                   ` (4 preceding siblings ...)
  2020-08-31 12:46 ` [PATCH 5/6] Documentation: tracing: Add %return suffix description Masami Hiramatsu
@ 2020-08-31 12:46 ` Masami Hiramatsu
  5 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2020-08-31 12:46 UTC (permalink / raw)
  To: Steven Rostedt, Jonathan Corbet; +Cc: mhiramat, linux-kernel, linux-doc

Add an example of tracing function calls on a specific function.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 Documentation/trace/boottime-trace.rst |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/Documentation/trace/boottime-trace.rst b/Documentation/trace/boottime-trace.rst
index 1341b449acaa..c216f5695ae2 100644
--- a/Documentation/trace/boottime-trace.rst
+++ b/Documentation/trace/boottime-trace.rst
@@ -168,6 +168,26 @@ is for tracing functions starting with "user\_", and others tracing
 The instance node also accepts event nodes so that each instance
 can customize its event tracing.
 
+With the trigger action and kprobes, you can trace function-graph while
+a function is called. For example, this will trace all function calls in
+the pci_proc_init()::
+
+  ftrace {
+        tracing_on = 0
+        tracer = function_graph
+        event.kprobes {
+                start_event {
+                        probes = "pci_proc_init"
+                        actions = "traceon"
+                }
+                end_event {
+                        probes = "pci_proc_init%return"
+                        actions = "traceoff"
+                }
+        }
+  }
+
+
 This boot-time tracing also supports ftrace kernel parameters via boot
 config.
 For example, following kernel parameters::


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/6] kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot
  2020-08-31 12:45 ` [PATCH 1/6] kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot Masami Hiramatsu
@ 2020-08-31 16:25   ` kernel test robot
  2020-09-01  6:27     ` Masami Hiramatsu
  0 siblings, 1 reply; 12+ messages in thread
From: kernel test robot @ 2020-08-31 16:25 UTC (permalink / raw)
  To: Masami Hiramatsu, Steven Rostedt, Jonathan Corbet
  Cc: kbuild-all, mhiramat, linux-kernel, linux-doc

[-- Attachment #1: Type: text/plain, Size: 1493 bytes --]

Hi Masami,

I love your patch! Yet something to improve:

[auto build test ERROR on tip/perf/core]
[also build test ERROR on trace/for-next lwn/docs-next linus/master v5.9-rc3 next-20200828]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Masami-Hiramatsu/tracing-boot-Add-new-options-for-tracing-specific-period/20200831-204738
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 2cb5383b30d47c446ec7d884cd80f93ffcc31817
config: arc-defconfig (attached as .config)
compiler: arc-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arc-elf-ld: init/main.o: in function `kernel_init':
>> main.c:(.ref.text+0xa6): undefined reference to `kprobe_free_init_mem'
>> arc-elf-ld: main.c:(.ref.text+0xa6): undefined reference to `kprobe_free_init_mem'

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 9385 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/6] Documentation: tracing: Add %return suffix description
  2020-08-31 12:46 ` [PATCH 5/6] Documentation: tracing: Add %return suffix description Masami Hiramatsu
@ 2020-08-31 18:50   ` Randy Dunlap
  2020-08-31 22:27     ` Masami Hiramatsu
  0 siblings, 1 reply; 12+ messages in thread
From: Randy Dunlap @ 2020-08-31 18:50 UTC (permalink / raw)
  To: Masami Hiramatsu, Steven Rostedt, Jonathan Corbet; +Cc: linux-kernel, linux-doc

On 8/31/20 5:46 AM, Masami Hiramatsu wrote:
> Add a description of the %return suffix option for kprobe tracer.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
>  Documentation/trace/kprobetrace.rst |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Documentation/trace/kprobetrace.rst b/Documentation/trace/kprobetrace.rst
> index c1709165c553..d29d1f9e6721 100644
> --- a/Documentation/trace/kprobetrace.rst
> +++ b/Documentation/trace/kprobetrace.rst

Check spacing:

> @@ -37,6 +38,7 @@ Synopsis of kprobe_events
>  		  based on SYM+offs or MEMADDR.
>   MOD		: Module name which has given SYM.
>   SYM[+offs]	: Symbol+offset where the probe is inserted.
> + SYM%return     : Return address of the symbol
>   MEMADDR	: Address where the probe is inserted.
>   MAXACTIVE	: Maximum number of instances of the specified function that
>  		  can be probed simultaneously, or 0 for the default value

If I remove the '+', the ':' lines up but the SYM does not line up.
Am I missing something?

@@ -37,6 +38,7 @@ Synopsis of kprobe_events
 		  based on SYM+offs or MEMADDR.
  MOD		: Module name which has given SYM.
  SYM[+offs]	: Symbol+offset where the probe is inserted.
 SYM%return     : Return address of the symbol
  MEMADDR	: Address where the probe is inserted.
  MAXACTIVE	: Maximum number of instances of the specified function that
 		  can be probed simultaneously, or 0 for the default value


thanks.
-- 
~Randy


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/6] Documentation: tracing: Add %return suffix description
  2020-08-31 18:50   ` Randy Dunlap
@ 2020-08-31 22:27     ` Masami Hiramatsu
  2020-09-01  5:46       ` Masami Hiramatsu
  0 siblings, 1 reply; 12+ messages in thread
From: Masami Hiramatsu @ 2020-08-31 22:27 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Steven Rostedt, Jonathan Corbet, linux-kernel, linux-doc

On Mon, 31 Aug 2020 11:50:20 -0700
Randy Dunlap <rdunlap@infradead.org> wrote:

> On 8/31/20 5:46 AM, Masami Hiramatsu wrote:
> > Add a description of the %return suffix option for kprobe tracer.
> > 
> > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> > ---
> >  Documentation/trace/kprobetrace.rst |    2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/Documentation/trace/kprobetrace.rst b/Documentation/trace/kprobetrace.rst
> > index c1709165c553..d29d1f9e6721 100644
> > --- a/Documentation/trace/kprobetrace.rst
> > +++ b/Documentation/trace/kprobetrace.rst
> 
> Check spacing:
> 
> > @@ -37,6 +38,7 @@ Synopsis of kprobe_events
> >  		  based on SYM+offs or MEMADDR.
> >   MOD		: Module name which has given SYM.
> >   SYM[+offs]	: Symbol+offset where the probe is inserted.
> > + SYM%return     : Return address of the symbol
> >   MEMADDR	: Address where the probe is inserted.
> >   MAXACTIVE	: Maximum number of instances of the specified function that
> >  		  can be probed simultaneously, or 0 for the default value
> 
> If I remove the '+', the ':' lines up but the SYM does not line up.
> Am I missing something?
> 
> @@ -37,6 +38,7 @@ Synopsis of kprobe_events
>  		  based on SYM+offs or MEMADDR.
>   MOD		: Module name which has given SYM.
>   SYM[+offs]	: Symbol+offset where the probe is inserted.
>  SYM%return     : Return address of the symbol
>   MEMADDR	: Address where the probe is inserted.
>   MAXACTIVE	: Maximum number of instances of the specified function that
>  		  can be probed simultaneously, or 0 for the default value
> 

Oops, that's my typo.

Thank you!

-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/6] Documentation: tracing: Add %return suffix description
  2020-08-31 22:27     ` Masami Hiramatsu
@ 2020-09-01  5:46       ` Masami Hiramatsu
  0 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2020-09-01  5:46 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Randy Dunlap, Steven Rostedt, Jonathan Corbet, linux-kernel, linux-doc

On Tue, 1 Sep 2020 07:27:45 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> On Mon, 31 Aug 2020 11:50:20 -0700
> Randy Dunlap <rdunlap@infradead.org> wrote:
> 
> > On 8/31/20 5:46 AM, Masami Hiramatsu wrote:
> > > Add a description of the %return suffix option for kprobe tracer.
> > > 
> > > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> > > ---
> > >  Documentation/trace/kprobetrace.rst |    2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/Documentation/trace/kprobetrace.rst b/Documentation/trace/kprobetrace.rst
> > > index c1709165c553..d29d1f9e6721 100644
> > > --- a/Documentation/trace/kprobetrace.rst
> > > +++ b/Documentation/trace/kprobetrace.rst
> > 
> > Check spacing:
> > 
> > > @@ -37,6 +38,7 @@ Synopsis of kprobe_events
> > >  		  based on SYM+offs or MEMADDR.
> > >   MOD		: Module name which has given SYM.
> > >   SYM[+offs]	: Symbol+offset where the probe is inserted.
> > > + SYM%return     : Return address of the symbol
> > >   MEMADDR	: Address where the probe is inserted.
> > >   MAXACTIVE	: Maximum number of instances of the specified function that
> > >  		  can be probed simultaneously, or 0 for the default value
> > 
> > If I remove the '+', the ':' lines up but the SYM does not line up.
> > Am I missing something?
> > 
> > @@ -37,6 +38,7 @@ Synopsis of kprobe_events
> >  		  based on SYM+offs or MEMADDR.
> >   MOD		: Module name which has given SYM.
> >   SYM[+offs]	: Symbol+offset where the probe is inserted.
> >  SYM%return     : Return address of the symbol
> >   MEMADDR	: Address where the probe is inserted.
> >   MAXACTIVE	: Maximum number of instances of the specified function that
> >  		  can be probed simultaneously, or 0 for the default value
> > 
> 

Shouldn't we use the horizontal tab in .rst ? It seems other lines
use a tab to indent, but this line doesn't (VIM converted the tab to spaces.)

Thank you,

-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/6] kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot
  2020-08-31 16:25   ` kernel test robot
@ 2020-09-01  6:27     ` Masami Hiramatsu
  0 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2020-09-01  6:27 UTC (permalink / raw)
  To: kernel test robot
  Cc: Steven Rostedt, Jonathan Corbet, kbuild-all, linux-kernel, linux-doc

On Tue, 1 Sep 2020 00:25:58 +0800
kernel test robot <lkp@intel.com> wrote:

> Hi Masami,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on tip/perf/core]
> [also build test ERROR on trace/for-next lwn/docs-next linus/master v5.9-rc3 next-20200828]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
> 
> url:    https://github.com/0day-ci/linux/commits/Masami-Hiramatsu/tracing-boot-Add-new-options-for-tracing-specific-period/20200831-204738
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 2cb5383b30d47c446ec7d884cd80f93ffcc31817
> config: arc-defconfig (attached as .config)
> compiler: arc-elf-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    arc-elf-ld: init/main.o: in function `kernel_init':
> >> main.c:(.ref.text+0xa6): undefined reference to `kprobe_free_init_mem'
> >> arc-elf-ld: main.c:(.ref.text+0xa6): undefined reference to `kprobe_free_init_mem'

OK, I missed to put the kprobe_free_init_mem() in the code
depends on CONFIG_DEBUG_FS. I'll move this out.

Thank you,


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-09-01  6:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-31 12:45 [PATCH 0/6] tracing/boot: Add new options for tracing specific period Masami Hiramatsu
2020-08-31 12:45 ` [PATCH 1/6] kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot Masami Hiramatsu
2020-08-31 16:25   ` kernel test robot
2020-09-01  6:27     ` Masami Hiramatsu
2020-08-31 12:45 ` [PATCH 2/6] tracing/boot: Add per-instance tracing_on option support Masami Hiramatsu
2020-08-31 12:45 ` [PATCH 3/6] Documentation: tracing: Add tracing_on option to boot-time tracer Masami Hiramatsu
2020-08-31 12:46 ` [PATCH 4/6] tracing/kprobes: Support perf-style return probe Masami Hiramatsu
2020-08-31 12:46 ` [PATCH 5/6] Documentation: tracing: Add %return suffix description Masami Hiramatsu
2020-08-31 18:50   ` Randy Dunlap
2020-08-31 22:27     ` Masami Hiramatsu
2020-09-01  5:46       ` Masami Hiramatsu
2020-08-31 12:46 ` [PATCH 6/6] Documentation: tracing: boot: Add an example of tracing function-calls Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).