* Test some kernel feature without recompile
@ 2009-03-22 10:43 Dragoslav Zaric
2009-03-22 11:04 ` Jaswinder Singh Rajput
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Dragoslav Zaric @ 2009-03-22 10:43 UTC (permalink / raw)
To: LKML
Hi,
I know when you work on some kernel module, you can change code and load
module again and test it, but what if you change some built in kernel
.c file, why
would I need to recompile whole kernel just to see what happens if I change one
.c file ??
Why can I just compile one changed .c file and copy it where compiled version of
that file reside inside kernel tree? Or maybe there is some image info embedded
inside compiled files, so that file must belong to specific image from
which it is
installed ?
Thanks,
Dragoslav Zaric
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Test some kernel feature without recompile
2009-03-22 10:43 Test some kernel feature without recompile Dragoslav Zaric
@ 2009-03-22 11:04 ` Jaswinder Singh Rajput
2009-03-22 11:42 ` Willy Tarreau
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Jaswinder Singh Rajput @ 2009-03-22 11:04 UTC (permalink / raw)
To: Dragoslav Zaric; +Cc: LKML
On Sun, 2009-03-22 at 11:43 +0100, Dragoslav Zaric wrote:
> Hi,
>
> I know when you work on some kernel module, you can change code and load
> module again and test it, but what if you change some built in kernel
> .c file, why
> would I need to recompile whole kernel just to see what happens if I change one
> .c file ??
>
> Why can I just compile one changed .c file and copy it where compiled version of
> that file reside inside kernel tree? Or maybe there is some image info embedded
> inside compiled files, so that file must belong to specific image from
> which it is
> installed ?
>
hmm, everything is possible. If you want this feature then place an
order ;-)
Just curious do you want to reboot your system or you also want to see
the effect of that file in running kernel.
--
JSR
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Test some kernel feature without recompile
2009-03-22 10:43 Test some kernel feature without recompile Dragoslav Zaric
2009-03-22 11:04 ` Jaswinder Singh Rajput
@ 2009-03-22 11:42 ` Willy Tarreau
2009-03-22 20:29 ` Jesper Juhl
2009-03-23 3:21 ` Bryan Donlan
3 siblings, 0 replies; 7+ messages in thread
From: Willy Tarreau @ 2009-03-22 11:42 UTC (permalink / raw)
To: Dragoslav Zaric; +Cc: LKML
On Sun, Mar 22, 2009 at 11:43:28AM +0100, Dragoslav Zaric wrote:
> Hi,
>
> I know when you work on some kernel module, you can change code and load
> module again and test it, but what if you change some built in kernel
> .c file, why
> would I need to recompile whole kernel just to see what happens if I change one
> .c file ??
>
> Why can I just compile one changed .c file and copy it where compiled version of
> that file reside inside kernel tree? Or maybe there is some image info embedded
> inside compiled files, so that file must belong to specific image from
> which it is
> installed ?
Well, in some cases you can do that. For very minor changes (constants,
disabling 'if' statements, breaking out of loops, or returning from
functions), tampering the memory with an hex editor is often more
convenient than rebooting. /proc/ksyms is your friend here. It also
sometimes help you see the effect of your changes. But you must always
be ready to reboot anyway because mistakes are quite common and generally
don't leave you with a second chance.
Willy
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Test some kernel feature without recompile
2009-03-22 10:43 Test some kernel feature without recompile Dragoslav Zaric
2009-03-22 11:04 ` Jaswinder Singh Rajput
2009-03-22 11:42 ` Willy Tarreau
@ 2009-03-22 20:29 ` Jesper Juhl
2009-03-23 8:51 ` Dragoslav Zaric
2009-03-23 3:21 ` Bryan Donlan
3 siblings, 1 reply; 7+ messages in thread
From: Jesper Juhl @ 2009-03-22 20:29 UTC (permalink / raw)
To: Dragoslav Zaric; +Cc: LKML
On Sun, 22 Mar 2009, Dragoslav Zaric wrote:
> Hi,
>
> I know when you work on some kernel module, you can change code and load
> module again and test it, but what if you change some built in kernel
> .c file, why
> would I need to recompile whole kernel just to see what happens if I change one
> .c file ??
>
Depends on the nature of the change. Some changes will ripple through the
whole kernel.
If, for example, you made a change to kmalloc() so that it takes an extra
argument, then obviously all call sites would need changing and since
kmalloc is used almose everywhere, then almost all files would need to be
recompiled.
But if your change is entirely contained to a single file, then 'make'
will already ensure that only that file is rebuilt when you run 'make'
(you'll still have to re-link the kernel or module though and a reboot
will still be needed).
> Why can I just compile one changed .c file and copy it where compiled version of
> that file reside inside kernel tree?
'make' should already handle that for you. In what way does it not?
--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Plain text mails only, please http://www.expita.com/nomime.html
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Test some kernel feature without recompile
2009-03-22 10:43 Test some kernel feature without recompile Dragoslav Zaric
` (2 preceding siblings ...)
2009-03-22 20:29 ` Jesper Juhl
@ 2009-03-23 3:21 ` Bryan Donlan
3 siblings, 0 replies; 7+ messages in thread
From: Bryan Donlan @ 2009-03-23 3:21 UTC (permalink / raw)
To: Dragoslav Zaric; +Cc: LKML
On Sun, Mar 22, 2009 at 6:43 AM, Dragoslav Zaric
<dragoslav.zaric.kd@gmail.com> wrote:
> Hi,
>
> I know when you work on some kernel module, you can change code and load
> module again and test it, but what if you change some built in kernel
> .c file, why
> would I need to recompile whole kernel just to see what happens if I change one
> .c file ??
>
> Why can I just compile one changed .c file and copy it where compiled version of
> that file reside inside kernel tree? Or maybe there is some image info embedded
> inside compiled files, so that file must belong to specific image from
> which it is
> installed ?
ksplice can do this in some limited cases: http://www.ksplice.com/example-update
Obviously, changes which affect the structure of kernel datastructures
are more difficult to accomplish...
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Test some kernel feature without recompile
2009-03-22 20:29 ` Jesper Juhl
@ 2009-03-23 8:51 ` Dragoslav Zaric
2009-03-23 8:52 ` Dragoslav Zaric
0 siblings, 1 reply; 7+ messages in thread
From: Dragoslav Zaric @ 2009-03-23 8:51 UTC (permalink / raw)
To: LKML
On Sun, Mar 22, 2009 at 9:29 PM, Jesper Juhl <jj@chaosbits.net> wrote:
> On Sun, 22 Mar 2009, Dragoslav Zaric wrote:
>
>> Hi,
>>
>> I know when you work on some kernel module, you can change code and load
>> module again and test it, but what if you change some built in kernel
>> .c file, why
>> would I need to recompile whole kernel just to see what happens if I change one
>> .c file ??
>>
> Depends on the nature of the change. Some changes will ripple through the
> whole kernel.
> If, for example, you made a change to kmalloc() so that it takes an extra
> argument, then obviously all call sites would need changing and since
> kmalloc is used almose everywhere, then almost all files would need to be
> recompiled.
> But if your change is entirely contained to a single file, then 'make'
> will already ensure that only that file is rebuilt when you run 'make'
> (you'll still have to re-link the kernel or module though and a reboot
> will still be needed).
>
>> Why can I just compile one changed .c file and copy it where compiled version of
>> that file reside inside kernel tree?
>
> 'make' should already handle that for you. In what way does it not?
>
> --
> Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
> Plain text mails only, please http://www.expita.com/nomime.html
> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Test some kernel feature without recompile
2009-03-23 8:51 ` Dragoslav Zaric
@ 2009-03-23 8:52 ` Dragoslav Zaric
0 siblings, 0 replies; 7+ messages in thread
From: Dragoslav Zaric @ 2009-03-23 8:52 UTC (permalink / raw)
To: LKML
Well it looks like I didn't read about "make" command a lot :)
This is what I found :
--------------------------------------------------------------------------------------------------------------------------------------------------------
| Once a suitable Makefile exists, each time you change some source
files, this simple shell command:
|
| make
|
| suffices to perform all necessary recompilations. The make program
uses the makefile data base and
| the last-modification times of the files to decide which of the
files need to be updated. For each of those
| files, it issues the commands recorded in the data base.
--------------------------------------------------------------------------------------------------------------------------------------------------------
So this is what I would (will) do if I want to debug, change or add
some kernel feature and don't want to wait a
lot of time every time :) :
Build version of kernel that has minimum modules (and other stuff) to
run your machine (unchecked things in
.config file will decrease time) and when work on some feature, then
add just stuff you wanna debug or
change and then run
make
thanks,
dragoslav
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-03-23 8:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-22 10:43 Test some kernel feature without recompile Dragoslav Zaric
2009-03-22 11:04 ` Jaswinder Singh Rajput
2009-03-22 11:42 ` Willy Tarreau
2009-03-22 20:29 ` Jesper Juhl
2009-03-23 8:51 ` Dragoslav Zaric
2009-03-23 8:52 ` Dragoslav Zaric
2009-03-23 3:21 ` Bryan Donlan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®