From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756791AbbCMTcO (ORCPT ); Fri, 13 Mar 2015 15:32:14 -0400 Received: from smtprelay0102.hostedemail.com ([216.40.44.102]:59552 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754234AbbCMTcN (ORCPT ); Fri, 13 Mar 2015 15:32:13 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4043:4605:5007:6119:6261:7514:7875:10004:10400:10848:10967:11026:11232:11658:11914:12043:12296:12438:12517:12519:12740:13069:13138:13231:13311:13357:13618:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: night83_131ad94666212 X-Filterd-Recvd-Size: 2489 Date: Fri, 13 Mar 2015 15:32:10 -0400 From: Steven Rostedt To: Tony Luck Cc: Xie XiuQi , Naoya Horiguchi , Chen Gong , Bjorn Helgaas , Borislav Petkov , Linux Kernel Mailing List , "linux-mm@kvack.org" , jingle.chen@huawei.com Subject: Re: [PATCH] tracing: add trace event for memory-failure Message-ID: <20150313153210.14f1bd88@gandalf.local.home> In-Reply-To: References: <1426241451-25729-1-git-send-email-xiexiuqi@huawei.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Mar 2015 09:37:34 -0700 Tony Luck 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). 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