Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants

2019-08-25 Thread Uwe Kleine-König
Hello Andrew, On Sat, Aug 24, 2019 at 04:58:29PM -0700, Andrew Morton wrote: > (cc printk maintainers). Ah, I wasn't aware there is something like them. Thanks > On Sun, 25 Aug 2019 01:37:23 +0200 Uwe Kleine-König > wrote: > > > pr_info("probing failed (%dE)\n", ret); > > > > expands to

[PATCH 00/11] ftrace: add support for recording function parameters and return value

2019-08-25 Thread Changbin Du
This series introduces a new ftrace feature CONFIG_FTRACE_FUNC_PROTOTYPE to record function parameters and return value. It can be enabled/disabled at runtime by a new trace option "record-funcproto". To achieve this, we need the function prototype infomation and the location of parameters. A new

[PATCH 01/11] ftrace: move recordmcount tools to scripts/ftrace

2019-08-25 Thread Changbin Du
Move ftrace tools to its own directory. We will add another tool later. Cc: John F. Reiser Signed-off-by: Changbin Du --- scripts/.gitignore | 1 - scripts/Makefile | 2 +- scripts/Makefile.build | 10 +- scripts/ftrace/.gitignore

[PATCH 02/11] ftrace: introduce new building tool funcprototype

2019-08-25 Thread Changbin Du
This is a new ftrace tool to implement CONFIG_FTRACE_FUNC_PROTOTYPE feature which allow ftrace record function parameters and return value (see later patches). Essentially funcprototype extracts only necessary information from the DWARF debug sections in the ELF object file, including function ret

[PATCH 05/11] ftrace: create memcache for hash entries

2019-08-25 Thread Changbin Du
When CONFIG_FTRACE_FUNC_PROTOTYPE is enabled, thousands of ftrace_func_entry instances are created. So create a dedicated memcache to enhance performance. Signed-off-by: Changbin Du --- kernel/trace/ftrace.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ke

[PATCH 04/11] ftrace/hash: add private data field

2019-08-25 Thread Changbin Du
We will reuse ftrace_hash to lookup function prototype information. So we need an additional field to bind ftrace_func_entry to prototype information. Signed-off-by: Changbin Du --- kernel/trace/ftrace.c | 17 +++-- kernel/trace/trace.h | 6 ++ 2 files changed, 13 insertions(+)

[PATCH 03/11] asm-generic: add generic dwarf definition

2019-08-25 Thread Changbin Du
Add generic DWARF constant definitions. We will use it later. Signed-off-by: Changbin Du --- include/asm-generic/dwarf.h | 199 1 file changed, 199 insertions(+) create mode 100644 include/asm-generic/dwarf.h diff --git a/include/asm-generic/dwarf.h b/inclu

[PATCH 06/11] ftrace: process function prototype data in vmlinux and modules

2019-08-25 Thread Changbin Du
Walk through the '__funcproto' section in vmlinux and kernel modules. For each item we add it to a new ftrace hash table ftrace_prototype_hash. When unloading a module, its items are removed from hash table. Signed-off-by: Changbin Du --- include/asm-generic/vmlinux.lds.h | 18 include/

[PATCH 09/11] x86_64: add function prototype recording support

2019-08-25 Thread Changbin Du
This patch implements the arch_fgraph_record_params() function for x86_64 platform and deliver the return value of function to ftrace core part. Signed-off-by: Changbin Du --- arch/x86/Kconfig| 1 + arch/x86/kernel/ftrace.c| 84 +++-- arch/x86/ker

[PATCH 08/11] ftrace: introduce core part of function prototype recording

2019-08-25 Thread Changbin Du
This patch introduces the core part of our new CONFIG_FTRACE_FUNC_PROTOTYPE feature. For arch which supports this feature must implement a new arch-specific interface arch_fgraph_record_params(). In this patch, we add a new trace option "record-funcproto", and by now only function graph tracer is

[PATCH 10/11] ftrace: add doc for new option record-funcproto

2019-08-25 Thread Changbin Du
Just add the doc for our new feature. Signed-off-by: Changbin Du --- Documentation/trace/ftrace.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst index f60079259669..c68fbbedb8bd 100644 --- a/Documentation/trace/ftrace.r

[PATCH 07/11] ftrace: prepare arch specific interfaces for function prototype feature

2019-08-25 Thread Changbin Du
To record function parameter and return value, we need the arch specific code to pass the saved register context. It is only valid if the CONFIG_FTRACE_FUNC_PROTOTYPE feature is enabled. This patch only changes the interfaces, real implementation will be added later. Signed-off-by: Changbin Du --

[PATCH 11/11] MAINTAINERS: make scripts/ftrace/ maintained

2019-08-25 Thread Changbin Du
Make scripts/ftrace/ maintained and I would like to help with reviewing related patches. Signed-off-by: Changbin Du --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9cbcf167bdd0..ca012ea260d7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1629

Re: [PATCH v2] Ext4 documentation fixes.

2019-08-25 Thread Jonathan Corbet
On Sat, 24 Aug 2019 19:09:30 -0400 "Theodore Y. Ts'o" wrote: > If you haven't pushed out your doc tree, can you please drop it? I've > already applied an (improved) version of this patch to the ext4 tree, > and I actually have some plans to do further fixups of ext4 on-disk > format documentatio

[RFC PATCH v3 02/19] skc: Add /proc/sup_cmdline to show SKC key-value list

2019-08-25 Thread Masami Hiramatsu
Add /proc/sup_cmdline which shows the list of key-value pairs in SKC data. Since after boot, all SKC data and tree are removed, this interface just keep a copy of key-value pairs in text. Signed-off-by: Masami Hiramatsu --- MAINTAINERS |1 fs/proc/Makefile |1 fs/proc/su

[RFC PATCH v3 01/19] skc: Add supplemental kernel cmdline support

2019-08-25 Thread Masami Hiramatsu
Supplemental kernel command line (SKC) allows admin to pass a tree-structured supplemental kernel commandline file (SKC file) when boot up kernel. This expands the kernel command line in efficient way. SKC file will contain some key-value commands, e.g. key.word = value1; another.key.word = value

[RFC PATCH v3 04/19] Documentation: skc: Add a doc for supplemental kernel cmdline

2019-08-25 Thread Masami Hiramatsu
Add a documentation for supplemental kernel cmdline under admin-guide, since it is including the syntax of SKC file. Signed-off-by: Masami Hiramatsu --- Documentation/admin-guide/index.rst |1 Documentation/admin-guide/kernel-parameters.txt |1 Documentation/admin-guide/skc

[RFC PATCH v3 03/19] skc: Add a boot setup routine from cmdline

2019-08-25 Thread Masami Hiramatsu
Add a boot setup routine from cmdline option "skc=ADDR,SIZE". Bootloader has to setup this cmdline option when it loads the skc file on memory. The ADDR must be a physical address. Signed-off-by: Masami Hiramatsu --- Documentation/admin-guide/kernel-parameters.txt |5 ++ init/main.c

[RFC PATCH v3 00/19] tracing: skc: Boot-time tracing and Supplemental Kernel Cmdline

2019-08-25 Thread Masami Hiramatsu
Hello, This is the 3rd version of RFC series for the boot-time tracing. Previous thread is here. https://lkml.kernel.org/r/156316746861.23477.5815110570539190650.stgit@devnote2 On that thread and offline talk with Frank Rowand at OSS Japan2019 last month, we agreed that the devicetree is only f

[RFC PATCH v3 05/19] tracing: Apply soft-disabled and filter to tracepoints printk

2019-08-25 Thread Masami Hiramatsu
Apply soft-disabled and the filter rule of the trace events to the printk output of tracepoints (a.k.a. tp_printk kernel parameter) as same as trace buffer output. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/kernel/trace/

[RFC PATCH v3 06/19] tracing: kprobes: Output kprobe event to printk buffer

2019-08-25 Thread Masami Hiramatsu
Since kprobe-events use event_trigger_unlock_commit_regs() directly, that events doesn't show up in printk buffer if "tp_printk" is set. Use trace_event_buffer_commit() in kprobe events so that it can invoke output_printk() as same as other trace events. Signed-off-by: Masami Hiramatsu --- incl

[RFC PATCH v3 07/19] tracing: Expose EXPORT_SYMBOL_GPL symbol

2019-08-25 Thread Masami Hiramatsu
Since ftrace_set_clr_event is already exported by EXPORT_SYMBOL_GPL, it should not be static. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_events.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 22c

[RFC PATCH v3 08/19] tracing: kprobes: Register to dynevent earlier stage

2019-08-25 Thread Masami Hiramatsu
Register kprobe event to dynevent in subsys_initcall level. This will allow kernel to register new kprobe events in fs_initcall level via trace_run_command. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_kprobe.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-

[RFC PATCH v3 09/19] tracing: Accept different type for synthetic event fields

2019-08-25 Thread Masami Hiramatsu
Make the synthetic event accepts a different type field to record. However, the size and signed flag must be same. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_events_hist.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b

[RFC PATCH v3 10/19] tracing: Add NULL trace-array check in print_synth_event()

2019-08-25 Thread Masami Hiramatsu
Add NULL trace-array check in print_synth_event(), because if we enable tp_printk option, iter->tr can be NULL. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_events_hist.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/tr

[RFC PATCH v3 11/19] tracing/boot: Add boot-time tracing by supplemental kernel cmdline

2019-08-25 Thread Masami Hiramatsu
Setup tracing options by supplemental kernel cmdline (skc) in addition to kernel parameters. In this patch, add following commands support - ftrace.options = OPT1[,OPT2...]; Enable given ftrace options. - ftrace.trace_clock = CLOCK; Set given CLOCK to ftrace's trace_clock. - ftrace.dump

[RFC PATCH v3 13/19] tracing/boot Add kprobe event support

2019-08-25 Thread Masami Hiramatsu
Add kprobe event support on event node. If the group name of event is "kprobes", boottime trace defines new probe event according to "probes" values. - ftrace.event.kprobes.EVENT.probes = PROBE[, PROBE2...]; Defines new kprobe event based on PROBEs. It is able to define multiple probes on o

[RFC PATCH v3 14/19] tracing/boot: Add synthetic event support

2019-08-25 Thread Masami Hiramatsu
Add synthetic event node support. The synthetic event is a kind of event node, but the group name is "synthetic". - ftrace.event.synthetic.EVENT.fields = FIELD[, FIELD2...]; Defines new synthetic event with FIELDs. Each field should be "type varname". The synthetic node requires "fields" s

[RFC PATCH v3 12/19] tracing/boot: Add per-event settings

2019-08-25 Thread Masami Hiramatsu
Add per-event settings for boottime tracing. User can set filter, actions and enable on each event on boot. The event entries are under ftrace.event.GROUP.EVENT node (note that the option key includes event's group name and event name.) This supports below commands. - ftrace.event.GROUP.EVENT.ena

[RFC PATCH v3 15/19] tracing/boot: Add instance node support

2019-08-25 Thread Masami Hiramatsu
Add instance node support to boottime tracing. User can set some options and event nodes under instance node. - ftrace.instance.INSTANCE[...]; Add new INSTANCE instance. Some options and event nodes are acceptable for instance node. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_

[RFC PATCH v3 16/19] tracing/boot: Add cpu_mask option support

2019-08-25 Thread Masami Hiramatsu
Add ftrace.cpumask option support for setting trace cpumask. - ftrace.[instance.INSTANCE.]cpumask = CPUMASK; Set the trace cpumask. Note that the CPUMASK should be a string which /tracing_cpumask can accepts. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace.c | 41 ++

[RFC PATCH v3 17/19] tracing/boot: Add function tracer filter options

2019-08-25 Thread Masami Hiramatsu
Add below function-tracer filter options to boottime tracer. - ftrace.[instance.INSTANCE.]ftrace.filters This will take an array of tracing function filter rules - ftrace.[instance.INSTANCE.]ftrace.notraces This will take an array of NON-tracing function filter rules Signed-off-by: Masam

[RFC PATCH v3 19/19] Documentation: tracing: Add boot-time tracing document

2019-08-25 Thread Masami Hiramatsu
Add a documentation about boot-time tracing options for SKC file. Signed-off-by: Masami Hiramatsu --- Documentation/trace/boottime-trace.rst | 185 1 file changed, 185 insertions(+) create mode 100644 Documentation/trace/boottime-trace.rst diff --git a/Documen

[RFC PATCH v3 18/19] tracing/boot: Add function-graph tracer options

2019-08-25 Thread Masami Hiramatsu
Add following function-graph tracer related options - ftrace.fgraph.filters = FILTER[, FILTER2...]; Add fgraph tracing function filters. - ftrace.fgraph.notraces = FILTER[, FILTER2...]; Add fgraph non tracing function filters. - ftrace.fgraph.max_depth = MAX_DEPTH; Set MAX_DEPTH to m

Re: [PATCH v1 1/2] vsprintf: introduce %dE for error constants

2019-08-25 Thread Sergey Senozhatsky
On (08/24/19 16:58), Andrew Morton wrote: > On Sun, 25 Aug 2019 01:37:23 +0200 Uwe Kleine-König > wrote: > > > pr_info("probing failed (%dE)\n", ret); > > > > expands to > > > > probing failed (EIO) > > > > if ret holds -EIO (or EIO). This introduces an array of error codes. If > > th