kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* debugging enabled? (was Re: KGDB command line options not working for kernel 2.6.32)
@ 2011-06-27 14:51 Mulyadi Santosa
  2011-06-27 18:40 ` Spiro Trikaliotis
  0 siblings, 1 reply; 6+ messages in thread
From: Mulyadi Santosa @ 2011-06-27 14:51 UTC (permalink / raw)
  To: kernelnewbies

>I have one question in this context. Should we disable optimization when >building the kernel when we wish to enable kgdb or should we leave it intact.

Whenever possible, yes...disable optimization.... -O option and -g in
gcc don't play nicely together according to my experience. The DWARF
info will be somewhat fuzzed or even "corrupted"....so it might point
to wrong source line etc

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* debugging enabled? (was Re: KGDB command line options not working for kernel 2.6.32)
  2011-06-27 14:51 debugging enabled? (was Re: KGDB command line options not working for kernel 2.6.32) Mulyadi Santosa
@ 2011-06-27 18:40 ` Spiro Trikaliotis
  2011-06-28  1:51   ` Mulyadi Santosa
  0 siblings, 1 reply; 6+ messages in thread
From: Spiro Trikaliotis @ 2011-06-27 18:40 UTC (permalink / raw)
  To: kernelnewbies

Hello,

* On Mon, Jun 27, 2011 at 09:51:53PM +0700 Mulyadi Santosa wrote:
> >I have one question in this context. Should we disable optimization when
> >building the kernel when we wish to enable kgdb or should we leave it intact.
> 
> Whenever possible, yes...disable optimization.... -O option and -g in
> gcc don't play nicely together according to my experience. The DWARF
> info will be somewhat fuzzed or even "corrupted"....so it might point
> to wrong source line etc

On the one hand, you are right. With optimisations on, following the
code lines does not give much fun. Some locals are not visible as they
are optimised out, and so on.

On the other hand: With optimisations disabled, the kernel behaves
differently than it would with optimisations. That's why many people
prefer to keep them switched on, and only disable them partially if
really, really needed.

Anyway, the opinions vary a lot here. I think one should try both and
find out what fits most to ones way of doing it.

Best regards
Spiro.

-- 
Spiro R. Trikaliotis                              http://opencbm.sf.net/
http://www.trikaliotis.net/                     http://www.viceteam.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* debugging enabled? (was Re: KGDB command line options not working for kernel 2.6.32)
  2011-06-27 18:40 ` Spiro Trikaliotis
@ 2011-06-28  1:51   ` Mulyadi Santosa
  2011-06-28  6:25     ` Prabhu nath
  0 siblings, 1 reply; 6+ messages in thread
From: Mulyadi Santosa @ 2011-06-28  1:51 UTC (permalink / raw)
  To: kernelnewbies

Hi Spiro

On Tue, Jun 28, 2011 at 01:40, Spiro Trikaliotis
<ml-kernelnewbies@spiro.trikaliotis.net> wrote:
>
> On the other hand: With optimisations disabled, the kernel behaves
> differently than it would with optimisations. That's why many people
> prefer to keep them switched on, and only disable them partially if
> really, really needed.

I agree...even I still have mixed conclusion whether to go or no go
with -O when dealing with -O and debugging. I guess one of the biggest
offenders are: inlining, dead code (and symbols) elimination,
substitution with specific machine specific opcode (not really sure,
is -march has relationship with -O)...

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* debugging enabled? (was Re: KGDB command line options not working for kernel 2.6.32)
  2011-06-28  1:51   ` Mulyadi Santosa
@ 2011-06-28  6:25     ` Prabhu nath
  2011-06-28 10:11       ` Mulyadi Santosa
  2011-06-28 17:41       ` Dave Hylands
  0 siblings, 2 replies; 6+ messages in thread
From: Prabhu nath @ 2011-06-28  6:25 UTC (permalink / raw)
  To: kernelnewbies

Hi Mulyadi/Spiro,

           Can you please help me in partially enabling/disabling
optimizations, because I was consistently hitting at the below problem when
building the kernel after disabling the optimization

ERROR: "intel_gmbus_is_forced_bit" [drivers/gpu/drm/i915/i915.ko] undefined!
ERROR: "__udivdi3" [drivers/gpu/drm/i915/i915.ko] undefined!
make[2]: *** [__modpost] Error 1
make[1]: *** [modules] Error 2
make: *** [sub-make] Error 2

Can I enable optimization for this i915 driver, so that I can contine with
my kernel building ?

Thanks,
Prabhu


On Tue, Jun 28, 2011 at 7:21 AM, Mulyadi Santosa
<mulyadi.santosa@gmail.com>wrote:

> Hi Spiro
>
> On Tue, Jun 28, 2011 at 01:40, Spiro Trikaliotis
> <ml-kernelnewbies@spiro.trikaliotis.net> wrote:
> >
> > On the other hand: With optimisations disabled, the kernel behaves
> > differently than it would with optimisations. That's why many people
> > prefer to keep them switched on, and only disable them partially if
> > really, really needed.
>
> I agree...even I still have mixed conclusion whether to go or no go
> with -O when dealing with -O and debugging. I guess one of the biggest
> offenders are: inlining, dead code (and symbols) elimination,
> substitution with specific machine specific opcode (not really sure,
> is -march has relationship with -O)...
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110628/28ef85d4/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* debugging enabled? (was Re: KGDB command line options not working for kernel 2.6.32)
  2011-06-28  6:25     ` Prabhu nath
@ 2011-06-28 10:11       ` Mulyadi Santosa
  2011-06-28 17:41       ` Dave Hylands
  1 sibling, 0 replies; 6+ messages in thread
From: Mulyadi Santosa @ 2011-06-28 10:11 UTC (permalink / raw)
  To: kernelnewbies

Hi...

On Tue, Jun 28, 2011 at 13:25, Prabhu nath <gprabhunath@gmail.com> wrote:
> Hi Mulyadi/Spiro,
>
> ?????????? Can you please help me in partially enabling/disabling
> optimizations, because I was consistently hitting at the below problem when
> building the kernel after disabling the optimization
>
> ERROR: "intel_gmbus_is_forced_bit" [drivers/gpu/drm/i915/i915.ko] undefined!
> ERROR: "__udivdi3" [drivers/gpu/drm/i915/i915.ko] undefined!
> make[2]: *** [__modpost] Error 1
> make[1]: *** [modules] Error 2
> make: *** [sub-make] Error 2
>
> Can I enable optimization for this i915 driver, so that I can contine with
> my kernel building ?

Please don't top post.... btw, I remember that someone posted the same
problem about a week or two ago...kindly dig the archieve and see what
the solution is there. Sorry if I can't help much.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* debugging enabled? (was Re: KGDB command line options not working for kernel 2.6.32)
  2011-06-28  6:25     ` Prabhu nath
  2011-06-28 10:11       ` Mulyadi Santosa
@ 2011-06-28 17:41       ` Dave Hylands
  1 sibling, 0 replies; 6+ messages in thread
From: Dave Hylands @ 2011-06-28 17:41 UTC (permalink / raw)
  To: kernelnewbies

Hi Prabhu,

On Mon, Jun 27, 2011 at 11:25 PM, Prabhu nath <gprabhunath@gmail.com> wrote:
> Hi Mulyadi/Spiro,
>
> ?????????? Can you please help me in partially enabling/disabling
> optimizations, because I was consistently hitting at the below problem when
> building the kernel after disabling the optimization
>
> ERROR: "intel_gmbus_is_forced_bit" [drivers/gpu/drm/i915/i915.ko] undefined!
> ERROR: "__udivdi3" [drivers/gpu/drm/i915/i915.ko] undefined!
> make[2]: *** [__modpost] Error 1
> make[1]: *** [modules] Error 2
> make: *** [sub-make] Error 2

This is happening because some code is trying to do 64-bit division
which isn't supported in the kernel. The code needs to be modified to
use do_div macro (which is available in either asm/div64.h).

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-06-28 17:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-27 14:51 debugging enabled? (was Re: KGDB command line options not working for kernel 2.6.32) Mulyadi Santosa
2011-06-27 18:40 ` Spiro Trikaliotis
2011-06-28  1:51   ` Mulyadi Santosa
2011-06-28  6:25     ` Prabhu nath
2011-06-28 10:11       ` Mulyadi Santosa
2011-06-28 17:41       ` Dave Hylands

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).