Re: profiling functions called in interrupt context

2011-09-19 Thread Amit Nagal
On Tue, Sep 20, 2011 at 10:25 AM, rohan puri  wrote:
>
>
> On Tue, Sep 20, 2011 at 10:13 AM, Amit Nagal  wrote:
>>
>> On Tue, Sep 20, 2011 at 10:05 AM, rohan puri 
>> wrote:
>> >
>> >
>> > On Tue, Sep 20, 2011 at 9:44 AM, Amit Nagal 
>> > wrote:
>> >>
>> >> Hi ,
>> >>
>> >> i want to measure time spend in a callback function called from
>> >> interrupt context .
>> >> since the time spend will be in us / ns , what kernel apis can i use
>> >> to measure it ?
>> >>
>> >> also since i want to use it in interrupt context  , kernel time
>> >> measurement apis should not sleep .
>> >> i am using embedded arm target , and tools like OProfile  are not
>> >> available .
>> >>
>> >> can i be guided which  kernel time measurement apis shall i use to
>> >> measure time in a interrupt callback ?
>> >>
>> >> Regards
>> >> Amit Nagal
>> >
>> > For this you can make use of ftrace.
>> >
>> > Refer link http://www.mjmwired.net/kernel/Documentation/trace/ftrace.txt
>> >
>> > Regards,
>> > Rohan
>> >
>>
>> Tools like ftrace are not available to me in my embedded arm target .
>> So i want to use kernel apis to deal with time measurement in
>> interrupt context .
>>
>> Regards
>> Amit Nagal
>
> Hi Amit,
>
> I think ftrace can be enabled and used on arm arch.
> Please Refer http://www.omappedia.org/wiki/Installing_and_Using_Ftrace
>
> Regards,
> Rohan
>

Ok ,  thanks for the link . i will try the same .

Regards
Amit Nagal

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: regarding disable of CONFIG_DEBUG_FS

2011-09-19 Thread Amit Nagal
On Tue, Sep 20, 2011 at 10:21 AM, rohan puri  wrote:
>
>
> On Tue, Sep 20, 2011 at 10:09 AM, Amit Nagal  wrote:
>>
>> Hi ,
>>
>> i already tried manual editing .
>> but when i call make to build image after manual edit ,
>> CONFIG_DEBUG_FS is turned on again .
>>
>> i tried manual editing in linux - x86 PC   also .
>> i manually edited arch/x86/configs/i386_defconfig file to disable
>> CONFIG_DEBUG_FS ,
>> but when i call make to build image , CONFIG_DEBUG_FS is turned on again .
>> >
>
> Ok. You can try commenting the CONFIG_DEBUG_FS from the Makefile of the
> relevant kernel source which your module is interacting with.
>

Well  i am doing the same for time being for my testing . but its not
the right way to do and can't be adopted .

Regards
Amit Nagal

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: profiling functions called in interrupt context

2011-09-19 Thread rohan puri
On Tue, Sep 20, 2011 at 10:13 AM, Amit Nagal  wrote:

> On Tue, Sep 20, 2011 at 10:05 AM, rohan puri 
> wrote:
> >
> >
> > On Tue, Sep 20, 2011 at 9:44 AM, Amit Nagal 
> wrote:
> >>
> >> Hi ,
> >>
> >> i want to measure time spend in a callback function called from
> >> interrupt context .
> >> since the time spend will be in us / ns , what kernel apis can i use
> >> to measure it ?
> >>
> >> also since i want to use it in interrupt context  , kernel time
> >> measurement apis should not sleep .
> >> i am using embedded arm target , and tools like OProfile  are not
> >> available .
> >>
> >> can i be guided which  kernel time measurement apis shall i use to
> >> measure time in a interrupt callback ?
> >>
> >> Regards
> >> Amit Nagal
> >
> > For this you can make use of ftrace.
> >
> > Refer link http://www.mjmwired.net/kernel/Documentation/trace/ftrace.txt
> >
> > Regards,
> > Rohan
> >
>
> Tools like ftrace are not available to me in my embedded arm target .
> So i want to use kernel apis to deal with time measurement in
> interrupt context .
>
> Regards
> Amit Nagal
>
Hi Amit,

I think ftrace can be enabled and used on arm arch.
Please Refer http://www.omappedia.org/wiki/Installing_and_Using_Ftrace

Regards,
Rohan
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: regarding disable of CONFIG_DEBUG_FS

2011-09-19 Thread rohan puri
On Tue, Sep 20, 2011 at 10:09 AM, Amit Nagal  wrote:

> Hi ,
>
> i already tried manual editing .
> but when i call make to build image after manual edit ,
> CONFIG_DEBUG_FS is turned on again .
>
> i tried manual editing in linux - x86 PC   also .
> i manually edited arch/x86/configs/i386_defconfig file to disable
> CONFIG_DEBUG_FS ,
> but when i call make to build image , CONFIG_DEBUG_FS is turned on again .
>
> Regards
> Amit Nagal
>
>
>
>
>
>
> On Tue, Sep 20, 2011 at 9:58 AM, rohan puri 
> wrote:
> >
> > On Tue, Sep 20, 2011 at 9:31 AM, Amit Nagal 
> wrote:
> >>
> >> Hi ,
> >>
> >> i want to disable CONFIG_DEBUG_FS in my kernel configuration .
> >> i am using 2.6.35 kernel on a embedded arm target .
> >> i am using usb hid driver to fetch thumbnail data on usb hid interface .
> >>
> >> the reason why i want to disable CONFIG_DEBUG_FS is that
> >> in interrupt callback , i dont want to spend time in debugging
> >> functions which are enabled with CONFIG_DEBUG_FS .
> >>
> >> can i be guided how to do that ? its not possible to do using make
> >> menuconfig though .
> >>
> >> Regards
> >>
> >> Amit Nagal
> >>
> >> ___
> >> Kernelnewbies mailing list
> >> Kernelnewbies@kernelnewbies.org
> >> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
> >
> > Hi Amit,
> >
> > You can manually edit the .config file in the kernel source dir to
> disable
> > CONFIG_DEBUG_FS.
> >
> > Regards,
> > Rohan.
> >
>
Ok. You can try commenting the CONFIG_DEBUG_FS from the Makefile of the
relevant kernel source which your module is interacting with.

Regards,
Rohan
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: profiling functions called in interrupt context

2011-09-19 Thread Amit Nagal
On Tue, Sep 20, 2011 at 10:05 AM, rohan puri  wrote:
>
>
> On Tue, Sep 20, 2011 at 9:44 AM, Amit Nagal  wrote:
>>
>> Hi ,
>>
>> i want to measure time spend in a callback function called from
>> interrupt context .
>> since the time spend will be in us / ns , what kernel apis can i use
>> to measure it ?
>>
>> also since i want to use it in interrupt context  , kernel time
>> measurement apis should not sleep .
>> i am using embedded arm target , and tools like OProfile  are not
>> available .
>>
>> can i be guided which  kernel time measurement apis shall i use to
>> measure time in a interrupt callback ?
>>
>> Regards
>> Amit Nagal
>
> For this you can make use of ftrace.
>
> Refer link http://www.mjmwired.net/kernel/Documentation/trace/ftrace.txt
>
> Regards,
> Rohan
>

Tools like ftrace are not available to me in my embedded arm target .
So i want to use kernel apis to deal with time measurement in
interrupt context .

Regards
Amit Nagal

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: regarding disable of CONFIG_DEBUG_FS

2011-09-19 Thread Amit Nagal
Hi ,

i already tried manual editing .
but when i call make to build image after manual edit ,
CONFIG_DEBUG_FS is turned on again .

i tried manual editing in linux - x86 PC   also .
i manually edited arch/x86/configs/i386_defconfig file to disable
CONFIG_DEBUG_FS ,
but when i call make to build image , CONFIG_DEBUG_FS is turned on again .

Regards
Amit Nagal






On Tue, Sep 20, 2011 at 9:58 AM, rohan puri  wrote:
>
> On Tue, Sep 20, 2011 at 9:31 AM, Amit Nagal  wrote:
>>
>> Hi ,
>>
>> i want to disable CONFIG_DEBUG_FS in my kernel configuration .
>> i am using 2.6.35 kernel on a embedded arm target .
>> i am using usb hid driver to fetch thumbnail data on usb hid interface .
>>
>> the reason why i want to disable CONFIG_DEBUG_FS is that
>> in interrupt callback , i dont want to spend time in debugging
>> functions which are enabled with CONFIG_DEBUG_FS .
>>
>> can i be guided how to do that ? its not possible to do using make
>> menuconfig though .
>>
>> Regards
>>
>> Amit Nagal
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
> Hi Amit,
>
> You can manually edit the .config file in the kernel source dir to disable
> CONFIG_DEBUG_FS.
>
> Regards,
> Rohan.
>

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: profiling functions called in interrupt context

2011-09-19 Thread rohan puri
On Tue, Sep 20, 2011 at 9:44 AM, Amit Nagal  wrote:

> Hi ,
>
> i want to measure time spend in a callback function called from
> interrupt context .
> since the time spend will be in us / ns , what kernel apis can i use
> to measure it ?
>
> also since i want to use it in interrupt context  , kernel time
> measurement apis should not sleep .
> i am using embedded arm target , and tools like OProfile  are not available
> .
>
> can i be guided which  kernel time measurement apis shall i use to
> measure time in a interrupt callback ?
>
> Regards
> Amit Nagal
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

Hi Amit,

For this you can make use of ftrace.

Refer link http://www.mjmwired.net/kernel/Documentation/trace/ftrace.txt

Regards,
Rohan
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: regarding disable of CONFIG_DEBUG_FS

2011-09-19 Thread rohan puri
On Tue, Sep 20, 2011 at 9:31 AM, Amit Nagal  wrote:

> Hi ,
>
> i want to disable CONFIG_DEBUG_FS in my kernel configuration .
> i am using 2.6.35 kernel on a embedded arm target .
> i am using usb hid driver to fetch thumbnail data on usb hid interface .
>
> the reason why i want to disable CONFIG_DEBUG_FS is that
> in interrupt callback , i dont want to spend time in debugging
> functions which are enabled with CONFIG_DEBUG_FS .
>
> can i be guided how to do that ? its not possible to do using make
> menuconfig though .
>
> Regards
>
> Amit Nagal
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>


Hi Amit,

You can manually edit the .config file in the kernel source dir to disable
CONFIG_DEBUG_FS.

Regards,
Rohan.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


profiling functions called in interrupt context

2011-09-19 Thread Amit Nagal
Hi ,

i want to measure time spend in a callback function called from
interrupt context .
since the time spend will be in us / ns , what kernel apis can i use
to measure it ?

also since i want to use it in interrupt context  , kernel time
measurement apis should not sleep .
i am using embedded arm target , and tools like OProfile  are not available .

can i be guided which  kernel time measurement apis shall i use to
measure time in a interrupt callback ?

Regards
Amit Nagal

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


regarding disable of CONFIG_DEBUG_FS

2011-09-19 Thread Amit Nagal
Hi ,

i want to disable CONFIG_DEBUG_FS in my kernel configuration .
i am using 2.6.35 kernel on a embedded arm target .
i am using usb hid driver to fetch thumbnail data on usb hid interface .

the reason why i want to disable CONFIG_DEBUG_FS is that
in interrupt callback , i dont want to spend time in debugging
functions which are enabled with CONFIG_DEBUG_FS .

can i be guided how to do that ? its not possible to do using make
menuconfig though .

Regards

Amit Nagal

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Cannot read using USB Skeleton Driver

2011-09-19 Thread Felix Varghese
> You might be right and the code might be wrong, care to send a patch for
> it correcting the issue?

Would be glad to do that, if I am able to resolve the issue.
Meanwhile, any insights from anybody on this would be welcome!

Regards,
Felix.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Why do the CFS chase fairness?

2011-09-19 Thread Mulyadi Santosa
Hi .

I am reaching my virtual limit here, so beg me pardon :)

On Mon, Sep 19, 2011 at 23:26, Parmenides
> Hmm..., does that mean timeslice weighting introduce unfainess? If we
> think fairness relies on each task not fetching more timeslice than
> other tasks, the eaiest way to achieve fairness is to give every task
> the same timeslice.

At the extreme theoritical side, yes, but again that is if all are
CPU bound the complication comes since in reality most processes
are mixture of CPU and I/O bound...or sometimes I/O bound only.

> Can I understand like this: each task advance its progress tinier than
> traditional timeslice, which makes C has more chances to be selected
> to preempt A or B owing to its higher priority? Higer priority makes
> C's virtual time smaller than A and B.
>

in non preemptive kernel i.e cooperative scheduling, your above
suggested idea is the right way to achieve fairness in such situation.
However, since user space (and now kernel space too) implements
preemptive, adjusting time slice is not really necessary to make C
kicks back into run queue.

What the scheduler needs perhaps at this point is good priority
recalculation is C could run ASAP. If not, even though C is in run
queue, it still can beat the other processes in the competition of CPU
time.


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: kernel crash dump analysis using crash utility

2011-09-19 Thread Mulyadi Santosa
On Mon, Sep 19, 2011 at 13:56, amit mehta  wrote:
> ...
>
> ---  ---
> #19 [81a01da8] ret_from_intr at 8100bad3
>    [exception RIP: acpi_check_resource_conflict+207] <  --- 

could you post the complete log somewhere?

BTW, looking at
http://lxr.linux.no/#linux+v2.6.32.46/drivers/acpi/osl.c#L1177, looks
like it is a procedure to find out potential conflict in ACPI..and
maybe, in your case, it hits hard.


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Why do the CFS chase fairness?

2011-09-19 Thread Parmenides
Hi,

> 2011/9/19 Mulyadi Santosa :
> Hi :)
>
> Seriously, what I consider "more fair" is Con Kolivas BFS scheduler
> these days. No excessive "time slice weighting", just priority
> stepping and very strict deadline.
>

Hmm..., does that mean timeslice weighting introduce unfainess? If we
think fairness relies on each task not fetching more timeslice than
other tasks, the eaiest way to achieve fairness is to give every task
the same timeslice. But this way seemingly can not be considered as
fair. So, an exact definition of fairness will be appreciated.


> I took this chance to add: to maximize throughput too...
>
> well, if you have processess let's say A, B, C. A and B are CPU bound,
> C sleeps most of the times (let's say it's vim process running)
>
> If a scheduler implement very fair scheduling, then whenever user
> press a key in vim window, C should be kicked in ASAP and then run.
> However, as C yields its time slice, A or B should back ASAP too.
>
> If the scheduler is not really fair, then C should wait longer to be
> back running. But C should not be given too much time so A and B have
> more time to complete their number crunching works
>

Can I understand like this: each task advance its progress tinier than
traditional timeslice, which makes C has more chances to be selected
to preempt A or B owing to its higher priority? Higer priority makes
C's virtual time smaller than A and B.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Why do the CFS chase fairness?

2011-09-19 Thread Mulyadi Santosa
Hi :)

On Mon, Sep 19, 2011 at 21:22, Parmenides  wrote:
>   Well, even with the CFS scheduler, tasks still can have different
> processor shares according to their priorities.

Correct and agree :)

> Conceptually, for
> examp, suppose that there are three tasks with priorities 1, 2, 3,
> respectively. For some fixed schedule period (targeted latency), which
> determined by the number of tasks in run queue, the three tasks obtain
> their CPU shares: 1/6, 2/6, 3/6 of the schedule period. Of course, in
> reality, CPU share of each tasks also needs its weight (determined by
> task's priority) be taken into account.

correct again. This "weighting" mechanism is the core of making
"fairness" happen...or at least approaching such situation.

>   So, I can not see the differences between traditional schedulers,
> which are based on timeslice, and the CFS scheduler, which divide some
> schedule period into shares in proportion to tasks' priorities. It
> seems that both take the same effect.

Neither do I :)

Seriously, what I consider "more fair" is Con Kolivas BFS scheduler
these days. No excessive "time slice weighting", just priority
stepping and very strict deadline.

>>>   2. Why do processes need fairness?
>>>
>> To achieve highest response time IMHO.
>
>   How does fairness give tasks more higher response time?
>
I took this chance to add: to maximize throughput too...

well, if you have processess let's say A, B, C. A and B are CPU bound,
C sleeps most of the times (let's say it's vim process running)

If a scheduler implement very fair scheduling, then whenever user
press a key in vim window, C should be kicked in ASAP and then run.
However, as C yields its time slice, A or B should back ASAP too.

If the scheduler is not really fair, then C should wait longer to be
back running. But C should not be given too much time so A and B have
more time to complete their number crunching works

Between A and B themselves should be balance somewhat, but not too
short. Too short and they would spend more time switching to each
other, too long and we would see they starve each other.

Above are my interpretation, so pls CMIIW...


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Why do the CFS chase fairness?

2011-09-19 Thread Parmenides
2011/9/18 Mulyadi Santosa :
> Hi...
>
> This would take us back to the days of comp science bachelor seat :)
>
>>
>>   1. How to understand unfairness?
>
> IMHO, the easiest meaning is that:
> one task gets proportionally more time slice than the other.

   Well, even with the CFS scheduler, tasks still can have different
processor shares according to their priorities. Conceptually, for
examp, suppose that there are three tasks with priorities 1, 2, 3,
respectively. For some fixed schedule period (targeted latency), which
determined by the number of tasks in run queue, the three tasks obtain
their CPU shares: 1/6, 2/6, 3/6 of the schedule period. Of course, in
reality, CPU share of each tasks also needs its weight (determined by
task's priority) be taken into account.

   However, it is said that we can consider this manner of allocating
CPU time is still fair because the scheduler approaches (at least
approximately) user's intension, that is: tasks with different
priorities get relevant CPU shares in terms of the their priorities.
If so,  IMHO it is also not hard for traditional schedulers to achieve
fairness. For the above three tasks, the scheduler may allocate 5ms,
10ms, 15ms timeslice for each. That way, each task would receive the
intended CPU shares as the CFS scheduler does.

   So, I can not see the differences between traditional schedulers,
which are based on timeslice, and the CFS scheduler, which divide some
schedule period into shares in proportion to tasks' priorities. It
seems that both take the same effect.

   I think the clear idea of what fairness is may help us understand unfairness.

>
>>   2. Why do processes need fairness?
>>
> To achieve highest response time IMHO.

   How does fairness give tasks more higher response time?

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Cannot read using USB Skeleton Driver

2011-09-19 Thread Greg KH
On Mon, Sep 19, 2011 at 06:51:18PM +0530, Felix Varghese wrote:
> Oh I don't think I have customized it to the point of breaking it. I
> just modified the VID and PID to those of my device. And later, when I
> noticed where it was getting stuck, I changed the wait_for_completion
> to wait_for_completion_interruptible (in the code snippet quoted
> previously) so that I could recover with Ctrl-C instead of a reboot.
> And my hardware works fine with the usbserial driver you suggested (I
> can read/write to it from a simple terminal program). But, to develop
> a full-fledged driver, the skeleton driver seemed like a better
> starting point, which is I am still trying to get it working.
> 
> The condition which causes the code to wait for eternity (from the
> line I quoted in one of my previous mails) seems to be: if
> (!dev->processed_urb)
> But I notice that this variable is not true even for the first read.
> So the code seems to wait for the completion of something that has not
> yet started. Also, I do not see this variable being explicitly set to
> false either, anywhere within the driver. I may be on the wrong track,
> but isn't this variable one that is used only within our driver? If
> so, what exactly is it used for, considering that it is only set to 1
> (never to 0) and is 0 initially?

You might be right and the code might be wrong, care to send a patch for
it correcting the issue?

thanks,

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Cannot read using USB Skeleton Driver

2011-09-19 Thread Felix Varghese
Oh I don't think I have customized it to the point of breaking it. I
just modified the VID and PID to those of my device. And later, when I
noticed where it was getting stuck, I changed the wait_for_completion
to wait_for_completion_interruptible (in the code snippet quoted
previously) so that I could recover with Ctrl-C instead of a reboot.
And my hardware works fine with the usbserial driver you suggested (I
can read/write to it from a simple terminal program). But, to develop
a full-fledged driver, the skeleton driver seemed like a better
starting point, which is I am still trying to get it working.

The condition which causes the code to wait for eternity (from the
line I quoted in one of my previous mails) seems to be: if
(!dev->processed_urb)
But I notice that this variable is not true even for the first read.
So the code seems to wait for the completion of something that has not
yet started. Also, I do not see this variable being explicitly set to
false either, anywhere within the driver. I may be on the wrong track,
but isn't this variable one that is used only within our driver? If
so, what exactly is it used for, considering that it is only set to 1
(never to 0) and is 0 initially?

Regards,
Felix.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: kernel crash dump analysis using crash utility

2011-09-19 Thread amit mehta
On Mon, Sep 19, 2011 at 12:26 PM, amit mehta  wrote:
> My Linux box just crashed while performing some network related tests.
> I'm trying to analyze the kernel crash dump using "Crash" utility.
> Need your help in analyzing it.
>
> <<>>
> # crash /usr/lib/debug/lib/modules/2.6.32-131.0.15.el6.x86_64/vmlinux vmcore
> .versioning information here...
> .etc etc..
>      KERNEL: /usr/lib/debug/lib/modules/2.6.32-131.0.15.el6.x86_64/vmlinux
>    DUMPFILE: vmcore  [PARTIAL DUMP]
>        CPUS: 32
>        DATE: Mon Sep 19 09:44:45 2011   < ---
>      UPTIME: 2 days, 22:55:44
> LOAD AVERAGE: 0.00, 0.02, 0.00
>       TASKS: 409
>    NODENAME: RHEL61ga
>     RELEASE: 2.6.32-131.0.15.el6.x86_64
>     VERSION: #1 SMP Tue May 10 15:42:40 EDT 2011
>     MACHINE: x86_64  (2660 Mhz)
>      MEMORY: 12 GB
>       PANIC: "Oops:  [#1] SMP " (check log for details)
>         PID: 0
>     COMMAND: "swapper"
>        TASK: 81a2d020  (1 of 8)  [THREAD_INFO: 81a0]
>         CPU: 0
>       STATE: TASK_RUNNING (ACTIVE)
>     WARNING: panic task not found
>
>  stack trace frame 0 - frame 18
> here.
> ...
>
> ---  ---
> #19 [81a01da8] ret_from_intr at 8100bad3
>    [exception RIP: acpi_check_resource_conflict+207] <  --- 
>    RIP: 812bb86e  RSP: 81a01e58  RFLAGS: 0206
>    RAX:   RBX: 81a01ec8  RCX: 
>    RDX: 0006  RSI:   RDI: 18f6
>    RBP: 8100bace   R8:    R9: 0ca3
>    R10: 88019aa061c2  R11: 88019aa06201  R12: 81b7c0b8
>    R13: 0001  R14: 810ece03  R15: 81a01dd8
>    ORIG_RAX: ffb5  CS: 0010  SS: 0018
> #20 [81a01e50] acpi_check_resource_conflict at 812bb851
> #21 [81a01ed0] show_current_driver at 813eccb7
> #22 [81a01ef0] cpu_idle at 81009e96
>
> <<>>
This same utility(crash) has an option of dumping system message buffer
by invoking "log". For some reason, kernel message buffer did not got flushed
on the disk and hence there were no relevant information on disk file. i.e.
/var/log/messages.
Using this same feature(log) i could find the perpetrator :)

-Amit

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Cannot read using USB Skeleton Driver

2011-09-19 Thread Greg KH
On Mon, Sep 19, 2011 at 11:13:33AM +0530, Felix Varghese wrote:
> > Just do:
> >        modprobe usb_serial vendor=0x product=0x
> > with the proper vendor and product ids for your device, then plug it in.
> >
> > No kernel changes needed at all, just have a pair of bulk in/out
> > endpoints and all will work automatically for you.
> 
> Thanks Greg, I had thought that the usbserial driver would only work
> with proper CDC class virtual COM devices.
> I compiled it and tried it on my device and it worked fine! I was able
> to do bidirectional communication. So at least now I can be sure that
> one end is working. But the same device with the same firmware still
> doesn't work with the (customized) usb-skeleton. What could be wrong?

As I don't know what you customized exactly, nor how your hardware
exactly works, I could not say, sorry.

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: how to use hashmap in kernel module?

2011-09-19 Thread Daniel Baluta
On Mon, Sep 19, 2011 at 9:23 AM, Jon Zhou  wrote:
> Hi
>
> I want to hashmap to store datat in kernel module, how can I do this? Any 
> existed code?
Hello,

There are a lot of places where hashes are used. Just grep for 'hash'
 through the kernel sources.

For example have a look at futex_queues [1].

thanks,
Daniel.

[1] http://lxr.linux.no/linux+v3.0.4/kernel/futex.c#L150

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


kernel crash dump analysis using crash utility

2011-09-19 Thread amit mehta
My Linux box just crashed while performing some network related tests.
I'm trying to analyze the kernel crash dump using "Crash" utility.
Need your help in analyzing it.

<<>>
# crash /usr/lib/debug/lib/modules/2.6.32-131.0.15.el6.x86_64/vmlinux vmcore
.versioning information here...
.etc etc..
  KERNEL: /usr/lib/debug/lib/modules/2.6.32-131.0.15.el6.x86_64/vmlinux
DUMPFILE: vmcore  [PARTIAL DUMP]
CPUS: 32
DATE: Mon Sep 19 09:44:45 2011   < ---
  UPTIME: 2 days, 22:55:44
LOAD AVERAGE: 0.00, 0.02, 0.00
   TASKS: 409
NODENAME: RHEL61ga
 RELEASE: 2.6.32-131.0.15.el6.x86_64
 VERSION: #1 SMP Tue May 10 15:42:40 EDT 2011
 MACHINE: x86_64  (2660 Mhz)
  MEMORY: 12 GB
   PANIC: "Oops:  [#1] SMP " (check log for details)
 PID: 0
 COMMAND: "swapper"
TASK: 81a2d020  (1 of 8)  [THREAD_INFO: 81a0]
 CPU: 0
   STATE: TASK_RUNNING (ACTIVE)
 WARNING: panic task not found

 stack trace frame 0 - frame 18
here.
...

---  ---
#19 [81a01da8] ret_from_intr at 8100bad3
[exception RIP: acpi_check_resource_conflict+207] <  --- 
RIP: 812bb86e  RSP: 81a01e58  RFLAGS: 0206
RAX:   RBX: 81a01ec8  RCX: 
RDX: 0006  RSI:   RDI: 18f6
RBP: 8100bace   R8:    R9: 0ca3
R10: 88019aa061c2  R11: 88019aa06201  R12: 81b7c0b8
R13: 0001  R14: 810ece03  R15: 81a01dd8
ORIG_RAX: ffb5  CS: 0010  SS: 0018
#20 [81a01e50] acpi_check_resource_conflict at 812bb851
#21 [81a01ed0] show_current_driver at 813eccb7
#22 [81a01ef0] cpu_idle at 81009e96

<<>>

Observation:
i) The panic hit at Sep 19 09:44:45 2011, and a peek inside /var/log/messages
reveals that the machine was down for about 4-5 minutes around this timestamp.
But there are no other relevant information available in the log file, so as
printed in the panic string above:
"Oops:  [#1] SMP " (check log for details)",
where else should i look for logs ?

ii) Does frame 19:: [exception RIP: acpi_check_resource_conflict+207] and the
immediated dump of the registers of my machine(Mine is x86_64) is an indication
of where the Oops occured ?

iii) Disassembly of "acpi_check_resource_conflict" at an offset:207
shows a 'test'
instruction being carried out on CPU 0:

0x812bb86e :  test
%ebx,0xc4c3e8(%rip) # 0x81f07c5c

iv) I belive that on 64 bit x86 machines, RIP represents EIP and
similarly RBX represents EBX register.
hence at the time of panic, the contents fo these registers were as follows:

RBX = 81a01ec8
RIP = 812bb86e

I don't know much of assembly, just did little bit of search on web, and my
understanding is that the instruction "test   %ebx,0xc4c3e8(%rip)" tells the
processor to do the bitwise "and" of contents of ebx register with the value
at the offset:0xc4c3e8 from the base address pointed by rip.
i.e. 812bb86e+c4c3e8 = 81F07C56 ? Please correct me if
I'm wrong.

-Amit

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies