2019-08-28 05:27:21

by Jakub Kicinski

[permalink] [raw]
Subject: [PATCH 0/3] tracing: fix minor build warnings

Hi!

trace.o gets rebuild on every make run when tracing is enabled,
which makes all warnings particularly noisy. This patchset fixes
some low-hanging fruit on W=1 C=1 builds.

Jakub Kicinski (3):
tracing: correct kdoc formats
tracing: remove exported but unused trace_array_destroy()
tracing: make trace_array_create() static

kernel/trace/trace.c | 47 ++++++++++++++------------------------------
1 file changed, 15 insertions(+), 32 deletions(-)

--
2.21.0


2019-08-28 05:27:26

by Jakub Kicinski

[permalink] [raw]
Subject: [PATCH 1/3] tracing: correct kdoc formats

Fix the following kdoc warnings:

kernel/trace/trace.c:1579: warning: Function parameter or member 'tr' not described in 'update_max_tr_single'
kernel/trace/trace.c:1579: warning: Function parameter or member 'tsk' not described in 'update_max_tr_single'
kernel/trace/trace.c:1579: warning: Function parameter or member 'cpu' not described in 'update_max_tr_single'
kernel/trace/trace.c:1776: warning: Function parameter or member 'type' not described in 'register_tracer'
kernel/trace/trace.c:2239: warning: Function parameter or member 'task' not described in 'tracing_record_taskinfo'
kernel/trace/trace.c:2239: warning: Function parameter or member 'flags' not described in 'tracing_record_taskinfo'
kernel/trace/trace.c:2269: warning: Function parameter or member 'prev' not described in 'tracing_record_taskinfo_sched_switch'
kernel/trace/trace.c:2269: warning: Function parameter or member 'next' not described in 'tracing_record_taskinfo_sched_switch'
kernel/trace/trace.c:2269: warning: Function parameter or member 'flags' not described in 'tracing_record_taskinfo_sched_switch'
kernel/trace/trace.c:3078: warning: Function parameter or member 'ip' not described in 'trace_vbprintk'
kernel/trace/trace.c:3078: warning: Function parameter or member 'fmt' not described in 'trace_vbprintk'
kernel/trace/trace.c:3078: warning: Function parameter or member 'args' not described in 'trace_vbprintk'

Signed-off-by: Jakub Kicinski <[email protected]>
---
kernel/trace/trace.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 642474b26ba7..947ba433865f 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1567,9 +1567,9 @@ update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu,

/**
* update_max_tr_single - only copy one trace over, and reset the rest
- * @tr - tracer
- * @tsk - task with the latency
- * @cpu - the cpu of the buffer to copy.
+ * @tr: tracer
+ * @tsk: task with the latency
+ * @cpu: the cpu of the buffer to copy.
*
* Flip the trace of a single CPU buffer between the @tr and the max_tr.
*/
@@ -1767,7 +1767,7 @@ static void __init apply_trace_boot_options(void);

/**
* register_tracer - register a tracer with the ftrace system.
- * @type - the plugin for the tracer
+ * @type: the plugin for the tracer
*
* Register a new plugin tracer.
*/
@@ -2230,9 +2230,9 @@ static bool tracing_record_taskinfo_skip(int flags)
/**
* tracing_record_taskinfo - record the task info of a task
*
- * @task - task to record
- * @flags - TRACE_RECORD_CMDLINE for recording comm
- * - TRACE_RECORD_TGID for recording tgid
+ * @task: task to record
+ * @flags: TRACE_RECORD_CMDLINE for recording comm
+ * TRACE_RECORD_TGID for recording tgid
*/
void tracing_record_taskinfo(struct task_struct *task, int flags)
{
@@ -2258,10 +2258,10 @@ void tracing_record_taskinfo(struct task_struct *task, int flags)
/**
* tracing_record_taskinfo_sched_switch - record task info for sched_switch
*
- * @prev - previous task during sched_switch
- * @next - next task during sched_switch
- * @flags - TRACE_RECORD_CMDLINE for recording comm
- * TRACE_RECORD_TGID for recording tgid
+ * @prev: previous task during sched_switch
+ * @next: next task during sched_switch
+ * @flags: TRACE_RECORD_CMDLINE for recording comm
+ * TRACE_RECORD_TGID for recording tgid
*/
void tracing_record_taskinfo_sched_switch(struct task_struct *prev,
struct task_struct *next, int flags)
@@ -3072,7 +3072,9 @@ static void trace_printk_start_stop_comm(int enabled)

/**
* trace_vbprintk - write binary msg to tracing buffer
- *
+ * @ip: The address of the caller
+ * @fmt: The string format to write to the buffer
+ * @args: Arguments for @fmt
*/
int trace_vbprintk(unsigned long ip, const char *fmt, va_list args)
{
--
2.21.0

2019-08-28 05:27:36

by Jakub Kicinski

[permalink] [raw]
Subject: [PATCH 3/3] tracing: make trace_array_create() static

Fix the W=1 missing prototype warning:

kernel/trace/trace.c:8319:21: warning: no previous prototype for ‘trace_array_create’ [-Wmissing-prototypes]

Signed-off-by: Jakub Kicinski <[email protected]>
---
kernel/trace/trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 4cd9855dcd88..c7491d9b0ac7 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -8316,7 +8316,7 @@ static void update_tracer_options(struct trace_array *tr)
mutex_unlock(&trace_types_lock);
}

-struct trace_array *trace_array_create(const char *name)
+static struct trace_array *trace_array_create(const char *name)
{
struct trace_array *tr;
int ret;
--
2.21.0

2019-08-28 05:28:31

by Jakub Kicinski

[permalink] [raw]
Subject: [PATCH 2/3] tracing: remove exported but unused trace_array_destroy()

trace_array_destroy() is an exported symbol, but not only
are there no in-tree callers, it doesn't actually have
a declaration in any header.

This fixes the "no previous prototype for" warning.

Signed-off-by: Jakub Kicinski <[email protected]>
---
kernel/trace/trace.c | 19 -------------------
1 file changed, 19 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 947ba433865f..4cd9855dcd88 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -8438,25 +8438,6 @@ static int __remove_instance(struct trace_array *tr)
return 0;
}

-int trace_array_destroy(struct trace_array *tr)
-{
- int ret;
-
- if (!tr)
- return -EINVAL;
-
- mutex_lock(&event_mutex);
- mutex_lock(&trace_types_lock);
-
- ret = __remove_instance(tr);
-
- mutex_unlock(&trace_types_lock);
- mutex_unlock(&event_mutex);
-
- return ret;
-}
-EXPORT_SYMBOL_GPL(trace_array_destroy);
-
static int instance_rmdir(const char *name)
{
struct trace_array *tr;
--
2.21.0

2019-08-30 22:03:02

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 0/3] tracing: fix minor build warnings

On Tue, 27 Aug 2019 22:25:46 -0700
Jakub Kicinski <[email protected]> wrote:

> Hi!
>
> trace.o gets rebuild on every make run when tracing is enabled,
> which makes all warnings particularly noisy. This patchset fixes
> some low-hanging fruit on W=1 C=1 builds.
>
> Jakub Kicinski (3):
> tracing: correct kdoc formats

I took the first one, but the two below, I wont take. Those changes
were added in preparation of the kernel access to tracing code.

See:

http://lkml.kernel.org/r/[email protected]

-- Steve


> tracing: remove exported but unused trace_array_destroy()
> tracing: make trace_array_create() static
>
> kernel/trace/trace.c | 47 ++++++++++++++------------------------------
> 1 file changed, 15 insertions(+), 32 deletions(-)
>

2019-08-30 22:40:26

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH 0/3] tracing: fix minor build warnings

On Fri, 30 Aug 2019 18:01:50 -0400, Steven Rostedt wrote:
> On Tue, 27 Aug 2019 22:25:46 -0700
> Jakub Kicinski <[email protected]> wrote:
>
> > Hi!
> >
> > trace.o gets rebuild on every make run when tracing is enabled,
> > which makes all warnings particularly noisy. This patchset fixes
> > some low-hanging fruit on W=1 C=1 builds.
> >
> > Jakub Kicinski (3):
> > tracing: correct kdoc formats
>
> I took the first one, but the two below, I wont take. Those changes
> were added in preparation of the kernel access to tracing code.
>
> See:
>
> http://lkml.kernel.org/r/[email protected]

Sounds good, thanks!