Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-16 Thread Vlastimil Babka
On 17.11.2015 4:58, yalin wang wrote: > >> On Nov 17, 2015, at 10:43, Steven Rostedt wrote: >> >> On Tue, 17 Nov 2015 10:21:47 +0800 >> yalin wang wrote: >> >> >> >> Because the print_fmt has nothing to do with the fields. You can have >> as your print_fmt as: >> >> TP_printk("Message = %s"

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-16 Thread yalin wang
> On Nov 17, 2015, at 10:43, Steven Rostedt wrote: > > On Tue, 17 Nov 2015 10:21:47 +0800 > yalin wang wrote: > > >> i have not tried , >> just a question, >> if you print a %s , but don’t call trace_define_field() do define this >> string in >> __entry , how does user space perf tool to ge

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-16 Thread Steven Rostedt
On Tue, 17 Nov 2015 10:21:47 +0800 yalin wang wrote: > i have not tried , > just a question, > if you print a %s , but don’t call trace_define_field() do define this string > in > __entry , how does user space perf tool to get this string info and print it > ? > i am curious .. > i can try

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-16 Thread yalin wang
> On Nov 16, 2015, at 22:25, Steven Rostedt wrote: > > On Mon, 16 Nov 2015 11:16:22 +0100 > Vlastimil Babka wrote: >> -- Steve >>> it is not easy to print for perf tools in userspace , >>> if you use this format , >>> for user space perf tool, it print the entry by look up the member in

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-16 Thread Steven Rostedt
On Mon, 16 Nov 2015 11:16:22 +0100 Vlastimil Babka wrote: > > >> -- Steve > > it is not easy to print for perf tools in userspace , > > if you use this format , > > for user space perf tool, it print the entry by look up the member in entry > > struct by offset , > > you print a dynamic string

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-16 Thread Steven Rostedt
On Mon, 16 Nov 2015 09:35:53 +0800 yalin wang wrote: > > On Nov 13, 2015, at 22:01, Steven Rostedt wrote: > > > > On Fri, 13 Nov 2015 19:54:11 +0800 > > yalin wang wrote: > > > > TP_fast_assign( > > __entry->mm = mm; > > - __entry->pfn = pfn

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-16 Thread Vlastimil Babka
On 11/16/2015 02:35 AM, yalin wang wrote: On Nov 13, 2015, at 22:01, Steven Rostedt wrote: On Fri, 13 Nov 2015 19:54:11 +0800 yalin wang wrote: TP_fast_assign( __entry->mm = mm; - __entry->pfn = pfn; + __entry->pfn = page_to_pfn(page);

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-15 Thread yalin wang
> On Nov 13, 2015, at 22:01, Steven Rostedt wrote: > > On Fri, 13 Nov 2015 19:54:11 +0800 > yalin wang wrote: > > TP_fast_assign( > __entry->mm = mm; > - __entry->pfn = pfn; > + __entry->pfn = page_to_pfn(page); Instead of the condition,

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-13 Thread Steven Rostedt
On Fri, 13 Nov 2015 19:54:11 +0800 yalin wang wrote: > >>> TP_fast_assign( > >>> __entry->mm = mm; > >>> - __entry->pfn = pfn; > >>> + __entry->pfn = page_to_pfn(page); > >> > >> Instead of the condition, we could have: > >> > >>__entry->pfn = page ? page_to_pf

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-13 Thread yalin wang
> On Nov 13, 2015, at 18:47, Vlastimil Babka wrote: > > On 11/12/2015 03:29 PM, Steven Rostedt wrote: >> On Thu, 12 Nov 2015 16:21:02 +0800 >> yalin wang wrote: >> >>> This crash is caused by NULL pointer deference, in page_to_pfn() marco, >>> when page == NULL : >>> >>> [ 182.639154 ] Unabl

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-13 Thread Vlastimil Babka
On 11/12/2015 03:29 PM, Steven Rostedt wrote: On Thu, 12 Nov 2015 16:21:02 +0800 yalin wang wrote: This crash is caused by NULL pointer deference, in page_to_pfn() marco, when page == NULL : [ 182.639154 ] Unable to handle kernel NULL pointer dereference at virtual address add

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-13 Thread yalin wang
> On Nov 13, 2015, at 16:41, Hillf Danton wrote: > >> >> Instead of the condition, we could have: >> >> __entry->pfn = page ? page_to_pfn(page) : -1; >> >> >> But if there's no reason to do the tracepoint if page is NULL, then >> this patch is fine. I'm just throwing out this idea. >>

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-13 Thread Hillf Danton
> > Instead of the condition, we could have: > > __entry->pfn = page ? page_to_pfn(page) : -1; > > > But if there's no reason to do the tracepoint if page is NULL, then > this patch is fine. I'm just throwing out this idea. > we trace only if page is valid --- linux-next/mm/huge_memory.

Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-12 Thread Steven Rostedt
On Thu, 12 Nov 2015 16:21:02 +0800 yalin wang wrote: > This crash is caused by NULL pointer deference, in page_to_pfn() marco, > when page == NULL : > > [ 182.639154 ] Unable to handle kernel NULL pointer dereference at virtual > address > add the trace point with TP_CONDITION(page)

[PATCH V4] mm: fix kernel crash in khugepaged thread

2015-11-12 Thread yalin wang
This crash is caused by NULL pointer deference, in page_to_pfn() marco, when page == NULL : [ 182.639154 ] Unable to handle kernel NULL pointer dereference at virtual address [ 182.639491 ] pgd = ffc00077a000 [ 182.639761 ] [] *pgd=b9422003, *pud=b9422003,