All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xie XiuQi <xiexiuqi@huawei.com>
To: Steven Rostedt <rostedt@goodmis.org>, Tony Luck <tony.luck@gmail.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
	Chen Gong <gong.chen@linux.intel.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"Borislav Petkov" <bp@suse.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	<jingle.chen@huawei.com>
Subject: Re: [PATCH] tracing: add trace event for memory-failure
Date: Tue, 17 Mar 2015 18:47:40 +0800	[thread overview]
Message-ID: <5508064C.7090707@huawei.com> (raw)
In-Reply-To: <20150313153210.14f1bd88@gandalf.local.home>

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
> 
> 
> 
> .
> 



WARNING: multiple messages have this Message-ID (diff)
From: Xie XiuQi <xiexiuqi@huawei.com>
To: Steven Rostedt <rostedt@goodmis.org>, Tony Luck <tony.luck@gmail.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
	Chen Gong <gong.chen@linux.intel.com>,
	Bjorn Helgaas <bhelgaas@google.com>, Borislav Petkov <bp@suse.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	jingle.chen@huawei.com
Subject: Re: [PATCH] tracing: add trace event for memory-failure
Date: Tue, 17 Mar 2015 18:47:40 +0800	[thread overview]
Message-ID: <5508064C.7090707@huawei.com> (raw)
In-Reply-To: <20150313153210.14f1bd88@gandalf.local.home>

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
> 
> 
> 
> .
> 


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-03-17 10:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 10:10 [PATCH] tracing: add trace event for memory-failure Xie XiuQi
2015-03-13 10:10 ` Xie XiuQi
2015-03-13 16:37 ` Tony Luck
2015-03-13 16:37   ` Tony Luck
2015-03-13 19:32   ` Steven Rostedt
2015-03-13 19:32     ` Steven Rostedt
2015-03-17 10:47     ` Xie XiuQi [this message]
2015-03-17 10:47       ` Xie XiuQi
2015-03-18  0:55       ` Steven Rostedt
2015-03-18  0:55         ` Steven Rostedt
2015-03-16  9:27 ` Naoya Horiguchi
2015-03-16  9:27   ` Naoya Horiguchi
2015-03-16 13:04   ` Xie XiuQi
2015-03-16 13:04     ` Xie XiuQi
2015-03-19  3:04 Xie XiuQi
2015-03-19  3:04 ` Xie XiuQi
2015-03-19  3:22 ` Steven Rostedt
2015-03-19  3:22   ` Steven Rostedt
2015-03-19 10:39 ` Borislav Petkov
2015-03-19 10:39   ` Borislav Petkov
2015-03-20  4:15   ` Xie XiuQi
2015-03-20  4:15     ` Xie XiuQi
2015-03-20 17:24     ` Luck, Tony
2015-03-20 17:24       ` Luck, Tony
2015-03-21  5:44       ` Xie XiuQi
2015-03-21  5:44         ` Xie XiuQi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5508064C.7090707@huawei.com \
    --to=xiexiuqi@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=bp@suse.de \
    --cc=gong.chen@linux.intel.com \
    --cc=jingle.chen@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=rostedt@goodmis.org \
    --cc=tony.luck@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.