Re: [PATCH v2 0/9] Extended H/W error log driver

From: Chen Gong
Date: Thu Oct 17 2013 - 10:48:46 EST


On Wed, Oct 16, 2013 at 08:11:17PM +0200, Borislav Petkov wrote:
> Date: Wed, 16 Oct 2013 20:11:17 +0200
> From: Borislav Petkov <bp@xxxxxxxxx>
> To: Steven Rostedt <rostedt@xxxxxxxxxxx>, "Chen, Gong"
> <gong.chen@xxxxxxxxxxxxxxx>
> Cc: tony.luck@xxxxxxxxx, joe@xxxxxxxxxxx, naveen.n.rao@xxxxxxxxxxxxxxxxxx,
> arozansk@xxxxxxxxxx, linux-acpi@xxxxxxxxxxxxxxx,
> linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v2 0/9] Extended H/W error log driver
> User-Agent: Mutt/1.5.21 (2010-09-15)
>
> On Wed, Oct 16, 2013 at 08:00:38PM +0200, Borislav Petkov wrote:
> > Right, the only difference I can see is that include/ras/ras_event.h
> > doesn't have those below:
> >
> > #undef TRACE_INCLUDE_PATH
> > #undef TRACE_INCLUDE_FILE
> > #define TRACE_INCLUDE_PATH .
> >
> > Perhaps that is the problem?
> >
> > Gong, what is exactly the issue you're observing?
>
> Ok, I think I know what the issue is:
>
> Gong has
>
> diff --git a/drivers/acpi/extlog_trace.c b/drivers/acpi/extlog_trace.c
> new file mode 100644
> index 000000000000..28640807fb09
> --- /dev/null
> +++ b/drivers/acpi/extlog_trace.c
> @@ -0,0 +1,107 @@
> +#include <linux/export.h>
> +#include <linux/dmi.h>
> +#include "extlog_trace.h"
> +
> +#define CREATE_TRACE_POINTS
> +#define TRACE_INCLUDE_PATH ../../include/ras
> +#include <ras/ras_event.h>
>
> for the ras tracepoint although this is done already in
> drivers/edac/edac_mc.c
>

Sorry I don't express clearly enough. The patch [v2 9/9] in this patch
seris can work well. The bogus one is in myself reply for patch [v2 0/9].
In this patch series I keep trace interface always builtin, so it can
work for module & builtin, whether CREATE_TRACE_POINTS is defined
multi-times or not.

The weird thing for bogus patch is if it is compiled as a module, I can
find the trace_xxx function is called definitely and paramerters are
expected but nothing output via trace interface, just like below:

# tracer: nop
#
# entries-in-buffer/entries-written: 0/0 #P:120
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |


I highly suspect my trace_xxx function is compiled as an empty function
if following my bogus patch.

> Gong, can you try moving the CREATE_TRACE_POINTS line to a new file -
> arch/x86/ras/ras.c and define it there and not anywhere else, i.e. move
> it away from edac_mc.c. Does that help?

In current kernel we haven't arch/x86/ras/ras.c. You mean I create
a new one there and just add some trace macro definition?

>
> Also, see Documentation/trace/tracepoints.txt for more info.
>
> HTH.
>
> --
> Regards/Gruss,
> Boris.
>
> Sent from a fat crate under my desk. Formatting is fine.
> --

Attachment: signature.asc
Description: Digital signature