Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1270224 > unrolled thread

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

Started bySteven Rostedt <rostedt@goodmis.org>
First post2015-11-16 15:30 +0100
Last post2015-11-17 08:50 +0100
Articles 5 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH V4] mm: fix kernel crash in khugepaged thread Steven Rostedt <rostedt@goodmis.org> - 2015-11-16 15:30 +0100
    Re: [PATCH V4] mm: fix kernel crash in khugepaged thread yalin wang <yalin.wang2010@gmail.com> - 2015-11-17 03:30 +0100
      Re: [PATCH V4] mm: fix kernel crash in khugepaged thread Steven Rostedt <rostedt@goodmis.org> - 2015-11-17 03:50 +0100
        Re: [PATCH V4] mm: fix kernel crash in khugepaged thread yalin wang <yalin.wang2010@gmail.com> - 2015-11-17 05:00 +0100
          Re: [PATCH V4] mm: fix kernel crash in khugepaged thread Vlastimil Babka <vbabka@suse.cz> - 2015-11-17 08:50 +0100

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

FromSteven Rostedt <rostedt@goodmis.org>
Date2015-11-16 15:30 +0100
SubjectRe: [PATCH V4] mm: fix kernel crash in khugepaged thread
Message-ID<qvsX8-8rn-21@gated-at.bofh.it>
On Mon, 16 Nov 2015 11:16:22 +0100
Vlastimil Babka <vbabka@suse.cz> 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 which user space perf tool don’t know how to print this string .  
> 
> Does it work through trace-cmd?

The two use the same code. If it works in one, it will work in the
other.

-- Steve

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

[toc] | [next] | [standalone]


#1270770

Fromyalin wang <yalin.wang2010@gmail.com>
Date2015-11-17 03:30 +0100
Message-ID<qvEbT-7dm-5@gated-at.bofh.it>
In reply to#1270224
> On Nov 16, 2015, at 22:25, Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> On Mon, 16 Nov 2015 11:16:22 +0100
> Vlastimil Babka <vbabka@suse.cz> 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 which user space perf tool don’t know how to print this string .  
>> 
>> Does it work through trace-cmd?
> 
> The two use the same code. If it works in one, it will work in the
> other.
> 
> -- Steve
> 
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 this when i have time.  and report to you .

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

[toc] | [prev] | [next] | [standalone]


#1270777

FromSteven Rostedt <rostedt@goodmis.org>
Date2015-11-17 03:50 +0100
Message-ID<qvEvf-7jH-11@gated-at.bofh.it>
In reply to#1270770
On Tue, 17 Nov 2015 10:21:47 +0800
yalin wang <yalin.wang2010@gmail.com> 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 this when i have time.  and report to you .

Because the print_fmt has nothing to do with the fields. You can have
as your print_fmt as:

	TP_printk("Message = %s", "hello dolly!")

And both userspace and the kernel with process that correctly (if I got
string processing working in userspace, which I believe I do). The
string is processed, it's not dependent on TP_STRUCT__entry() unless it
references a field there. Which can also be used too:

	TP_printk("Message = %s", __entry->musical ? "Hello dolly!" :
			"Death Trap!")

userspace will see in the entry:

 print_fmt: "Message = %s", REC->musical ? "Hello dolly!" : "Death Trap!"

as long as the field "musical" exists, all is well.

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

[toc] | [prev] | [next] | [standalone]


#1270839

Fromyalin wang <yalin.wang2010@gmail.com>
Date2015-11-17 05:00 +0100
Message-ID<qvFB0-86h-7@gated-at.bofh.it>
In reply to#1270777
> On Nov 17, 2015, at 10:43, Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> On Tue, 17 Nov 2015 10:21:47 +0800
> yalin wang <yalin.wang2010@gmail.com> 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 this when i have time.  and report to you .
> 
> Because the print_fmt has nothing to do with the fields. You can have
> as your print_fmt as:
> 
> 	TP_printk("Message = %s", "hello dolly!")
> 
> And both userspace and the kernel with process that correctly (if I got
> string processing working in userspace, which I believe I do). The
> string is processed, it's not dependent on TP_STRUCT__entry() unless it
> references a field there. Which can also be used too:
> 
> 	TP_printk("Message = %s", __entry->musical ? "Hello dolly!" :
> 			"Death Trap!")
> 
> userspace will see in the entry:
> 
> print_fmt: "Message = %s", REC->musical ? "Hello dolly!" : "Death Trap!"
> 
> as long as the field "musical" exists, all is well.
> 
> -- Steve
Aha,  i see.
Thanks very much for your explanation.
Better print fat is :   
TP_printk("mm=%p, scan_pfn=%s, writable=%d, referenced=%d, none_or_zero=%d, status=%s, unmapped=%d",
               __entry->mm,
		__entry->pfn == (-1UL) ? "(null)" :  itoa(buff,  __entry->pin, 10), …..)

is this possible ?

Thanks








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

[toc] | [prev] | [next] | [standalone]


#1270935

FromVlastimil Babka <vbabka@suse.cz>
Date2015-11-17 08:50 +0100
Message-ID<qvJbA-235-11@gated-at.bofh.it>
In reply to#1270839
On 17.11.2015 4:58, yalin wang wrote:
> 
>> On Nov 17, 2015, at 10:43, Steven Rostedt <rostedt@goodmis.org> wrote:
>>
>> On Tue, 17 Nov 2015 10:21:47 +0800
>> yalin wang <yalin.wang2010@gmail.com> wrote:
>>
>>
>>
>> Because the print_fmt has nothing to do with the fields. You can have
>> as your print_fmt as:
>>
>> 	TP_printk("Message = %s", "hello dolly!")
>>
>> And both userspace and the kernel with process that correctly (if I got
>> string processing working in userspace, which I believe I do). The
>> string is processed, it's not dependent on TP_STRUCT__entry() unless it
>> references a field there. Which can also be used too:
>>
>> 	TP_printk("Message = %s", __entry->musical ? "Hello dolly!" :
>> 			"Death Trap!")
>>
>> userspace will see in the entry:
>>
>> print_fmt: "Message = %s", REC->musical ? "Hello dolly!" : "Death Trap!"
>>
>> as long as the field "musical" exists, all is well.
>>
>> -- Steve
> Aha,  i see.
> Thanks very much for your explanation.
> Better print fat is :   
> TP_printk("mm=%p, scan_pfn=%s, writable=%d, referenced=%d, none_or_zero=%d, status=%s, unmapped=%d",
>                __entry->mm,
> 		__entry->pfn == (-1UL) ? "(null)" :  itoa(buff,  __entry->pin, 10), …..)
> 
> is this possible ?

I doubt so.

Why don't we just do (with %lx):
 __entry->pfn != -1UL ? __entry->pfn : 0,

Status already tells us that it's not a real pfn 0 (which I doubt would be
userspace-mapped and thus reachable by khugepaged anyway?).
Also it's what some other tracepoints do, see e.g. mm_page class in
include/trace/events/kmem.h.

> Thanks
> 
> 
> 
> 
> 
> 
> 
> 

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web