lkml.org 
[lkml]   [2015]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tracing: add trace event for memory-failure
On 2015/3/14 3:32, Steven Rostedt wrote:
> On Fri, 13 Mar 2015 09:37:34 -0700
> Tony Luck <tony.luck@gmail.com> wrote:
>
>
>>> int sysctl_memory_failure_early_kill __read_mostly = 0;
>>>
>>> @@ -837,6 +838,8 @@ static struct page_state {
>>> */
>>> static void action_result(unsigned long pfn, char *msg, int result)
>>> {
>>> + trace_memory_failure_event(pfn, msg, action_name[result]);
>>> +
>>> pr_err("MCE %#lx: %s page recovery: %s\n",
>>> pfn, msg, action_name[result]);
>>> }
>>> --
>>> 1.7.1
>>>
>>> --
>>
>> Concept looks good to me. Adding Steven Rostedt as we've historically had
>> challenges adding new trace points in the cleanest way.
>
> Hehe, thank you :-) I actually do have a recommendation. How about just
> passing in "result" and doing:
>
>
> TP_printk("pfn %#lx: %s page recovery: %s",
> __entry->pfn,
> __get_str(action),
> __print_symbolic(result, 0, "Ignored",
> 1, "Failed",
> 2, "Delayed",
> 3, "Recovered"))
>
>
> Now it is hard coded here because trace-cmd and perf do not have a way
> to process enums (yet, I need to fix that).

Hi Steve,

Thanks for you comments.

I'm not clearly why we need a hard coded here. As the strings or "result" have
defined in mm/memory-failure.c, so passing "action_name[result]" would be more
clean and more flexible here?

Thanks,
Xie XiuQi

>
> I also need a way to just submit print strings on module load and boot
> up such that you only need to pass in the address of the action field
> instead of the string. That is also a todo of mine that I may soon
> change.
>
> -- Steve
>
>
>
> .
>




\
 
 \ /
  Last update: 2015-03-17 12:01    [W:0.072 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site