Re: [PATCH v4 3/3] tracing: add trace event for memory-failure

From: Xie XiuQi
Date: Thu May 07 2015 - 02:04:58 EST


On 2015/5/7 10:25, Steven Rostedt wrote:
> On Mon, 20 Apr 2015 16:44:40 +0800
> Xie XiuQi <xiexiuqi@xxxxxxxxxx> wrote:
>

...

>> + *
>> + * unsigned long pfn - Page Frame Number of the corrupted page
>> + * int type - Page types of the corrupted page
>> + * int result - Result of recovery action
>> + */
>> +
>> +#ifdef CONFIG_MEMORY_FAILURE
>> +#define MF_ACTION_RESULT \
>> + EM ( MF_IGNORED, "Ignord" ) \
>
> "Ignored" ?

My fault, I'll correct it, thanks.

>
>> + EM ( MF_FAILED, "Failed" ) \
>> + EM ( MF_DELAYED, "Delayed" ) \
>> + EMe ( MF_RECOVERED, "Recovered" )
>> +
>> +#define MF_PAGE_TYPE \
>> + EM ( MF_MSG_KERNEL, "reserved kernel page" ) \
>> + EM ( MF_MSG_KERNEL_HIGH_ORDER, "high-order kernel page" ) \
...
>> + ),
>> +
>> + TP_fast_assign(
>> + __entry->pfn = pfn;
>> + __entry->type = type;
>> + __entry->result = result;
>> + ),
>> +
>> + TP_printk("pfn %#lx: recovery action for %s: %s",
>
> Hmm, "%#" is new to me. I'm not sure libtraceevent handles that.
>
> Not your problem, I need to make sure that it does, and if it does not,
> I need to fix it.
>
> I'm not even sure what %# does.
>
> Other than the typo,
>
> Acked-by: Steven Rostedt <rostedt@xxxxxxxxxxx>

Thanks,
Xie XiuQi

>
> -- Steve
>
>
>> + __entry->pfn,
>> + __print_symbolic(__entry->type, MF_PAGE_TYPE),
>> + __print_symbolic(__entry->result, MF_ACTION_RESULT)
>> + )
>> +);
>> +#endif /* CONFIG_MEMORY_FAILURE */
>> #endif /* _TRACE_HW_EVENT_MC_H */
>>
>> /* This part must be outside protection */
>> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
>> index f074f8e..42c5981 100644
>> --- a/mm/memory-failure.c
>> +++ b/mm/memory-failure.c
>> @@ -56,6 +56,7 @@
>> #include <linux/mm_inline.h>
>> #include <linux/kfifo.h>
>> #include "internal.h"
>> +#include "ras/ras_event.h"
>>
>> int sysctl_memory_failure_early_kill __read_mostly = 0;
>>
>> @@ -850,6 +851,8 @@ static struct page_state {
>> static void action_result(unsigned long pfn, enum mf_action_page_type type,
>> enum mf_result result)
>> {
>> + trace_memory_failure_event(pfn, type, result);
>> +
>> pr_err("MCE %#lx: recovery action for %s: %s\n",
>> pfn, action_page_types[type], action_name[result]);
>> }
>
>
> .
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/