How to find closest tag when using git-bisect?

2016-09-08 Thread Louie Lu
Hi everyone,

I'm trying to git-bisect for debugging, but how can I find the tag I need?

for example, I'm find the file change at maybe commit
fc2bd799c7c79c84a59da6f9221370bc6f38c503, how to find the closest tag
for this commit?

and a anther question is, is every bisect need to recopmile all kernel
code by `make`? or just need to build the thing I need?


thanks.

Louie.

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


Re: [help] How to test kernel code that I wrote?

2016-08-25 Thread Louie Lu
> You may want to look at this free course on kernel programming:
> http://crashcourse.ca/introduction-linux-kernel-programming/introduction-linux-kernel-programming
> I believe that the entire course is free now (even though it mentions costing 
> $39).
>
> It has a section on creating proc filesystem entries.

Thanks for this tutorial, that's great.

I'm now writing some procfs code and testing on my laptop.

Is that I'll need to use VM to test the code,
or just test it on my laptop?

I found that if sometimes I broke my code (e.g. can't remove modules,
modules panic ...etc)
I need to reboot my laptop to recover from this situation.

Is that how a true kernel developer does?
or they will open a VM to test it, then test on real hardware PC.


Thanks!

2016-08-25 7:27 GMT+08:00 Dave Hylands <dhyla...@gmail.com>:
> You may want to look at this free course on kernel programming:
> http://crashcourse.ca/introduction-linux-kernel-programming/introduction-linux-kernel-programming
> I believe that the entire course is free now (even though it mentions
> costing $39).
>
> It has a section on creating proc filesystem entries.
>
> On Wed, Aug 24, 2016 at 4:39 AM, Louie Lu <louie...@hopebaytech.com> wrote:
>>
>> 2016-08-24 18:23 GMT+08:00 Nikolay Borisov <n.borisov.l...@gmail.com>:
>> >
>> >
>> > On 08/24/2016 01:18 PM, Louie Lu wrote:
>> >> Hi everyone,
>> >>
>> >> I'm now reading *Unreliable Guide To Locking* which came from
>> >> kernelnewbies.org (https://kernelnewbies.org/Documents/Kernel-Docbooks)
>> >>
>> >> What I want to do is trying run the code that in this doc from 7.1 All
>> >> In User Context.
>> >>
>> >> In my knowing for kernel programming,
>> >> I'll need to compile the code to something like
>> >> `main.ko` then insert into kernel space using `insmod`.
>> >>
>> >> Here is the GitHub that I'm doing PoC code:
>> >> https://github.com/grapherd/unreliable_guide_to_locking
>> >>
>> >> My question is,
>> >> Is my knowing right?
>> >> and, how can I use the function in main.ko (e.g. cache_add).
>> >> I'm using these function by test.ko, is that a normal way to use it?
>> >>
>> >> in this doc have mention, there have hardirq, softirq.
>> >> How can I test it from these irq method?
>> >>
>> >
>> > You have to create some sort of an interface which utilizes those kernel
>> > function. That might be IOCTL or procfiles or debugfs or any other
>> > number of UM<=>KM interfaces.
>> >
>>
>> Thanks for reply, I'm now looking for procfs example,
>>
>> like this: http://www.tldp.org/LDP/lkmpg/2.6/html/x710.html
>> or this:
>> https://kernelnewbies.org/Documents/Kernel-Docbooks?action=AttachFile=get=procfs-guide_2.6.29.pdf
>>
>> But it seems that all this tutorial were deprecate,
>> since 3.10 change for proc_create_entry()
>>
>> Are there any resource for procfs to leran?
>>
>> thanks!.
>>
>> Louie Lu.
>>
>> >
>> >>
>> >> Thanks!
>> >> Louie Lu.
>> >>
>> >> ___
>> >> Kernelnewbies mailing list
>> >> Kernelnewbies@kernelnewbies.org
>> >> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>> >>
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
>
>
> --
> Dave Hylands
> Shuswap, BC, Canada
> http://www.davehylands.com

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


Re: [help] How to test kernel code that I wrote?

2016-08-24 Thread Louie Lu
2016-08-24 18:23 GMT+08:00 Nikolay Borisov <n.borisov.l...@gmail.com>:
>
>
> On 08/24/2016 01:18 PM, Louie Lu wrote:
>> Hi everyone,
>>
>> I'm now reading *Unreliable Guide To Locking* which came from
>> kernelnewbies.org (https://kernelnewbies.org/Documents/Kernel-Docbooks)
>>
>> What I want to do is trying run the code that in this doc from 7.1 All
>> In User Context.
>>
>> In my knowing for kernel programming,
>> I'll need to compile the code to something like
>> `main.ko` then insert into kernel space using `insmod`.
>>
>> Here is the GitHub that I'm doing PoC code:
>> https://github.com/grapherd/unreliable_guide_to_locking
>>
>> My question is,
>> Is my knowing right?
>> and, how can I use the function in main.ko (e.g. cache_add).
>> I'm using these function by test.ko, is that a normal way to use it?
>>
>> in this doc have mention, there have hardirq, softirq.
>> How can I test it from these irq method?
>>
>
> You have to create some sort of an interface which utilizes those kernel
> function. That might be IOCTL or procfiles or debugfs or any other
> number of UM<=>KM interfaces.
>

Thanks for reply, I'm now looking for procfs example,

like this: http://www.tldp.org/LDP/lkmpg/2.6/html/x710.html
or this: 
https://kernelnewbies.org/Documents/Kernel-Docbooks?action=AttachFile=get=procfs-guide_2.6.29.pdf

But it seems that all this tutorial were deprecate,
since 3.10 change for proc_create_entry()

Are there any resource for procfs to leran?

thanks!.

Louie Lu.

>
>>
>> Thanks!
>> Louie Lu.
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>

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


[help] How to test kernel code that I wrote?

2016-08-24 Thread Louie Lu
Hi everyone,

I'm now reading *Unreliable Guide To Locking* which came from
kernelnewbies.org (https://kernelnewbies.org/Documents/Kernel-Docbooks)

What I want to do is trying run the code that in this doc from 7.1 All
In User Context.

In my knowing for kernel programming,
I'll need to compile the code to something like
`main.ko` then insert into kernel space using `insmod`.

Here is the GitHub that I'm doing PoC code:
https://github.com/grapherd/unreliable_guide_to_locking

My question is,
Is my knowing right?
and, how can I use the function in main.ko (e.g. cache_add).
I'm using these function by test.ko, is that a normal way to use it?

in this doc have mention, there have hardirq, softirq.
How can I test it from these irq method?


Thanks!
Louie Lu.

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