[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Newbie Kernel Programmer looking for first project.
Hah! I didn't actually post the url to the pr. Okay here it is now.
On 7/4/08, Michael Litchard <michael%schmong.org@localhost> wrote:
> Here's my first submission. It gives the url to the actual patches.
> Feedback most welcome.
> Michael Litchard
> On 7/3/08, Tim Rightnour <root%garbled.net@localhost> wrote:
> > On 03-Jul-2008 Michael Litchard wrote:
> > > When I see a pattern like this:
> > >
> > >#idef DEBUG
> > > printf("foo"...);
> > >#endif
> > >
> > > I replace those three line with
> > > aprint_debug("foo...");
> > >
> > > the reasoning being that aprint_debug uses AB_DEBUG to govern behavior,
> > > and a new convention is replacing the old.
> > >
> > > But I'm starting to question this. I see more complex preprocessor
> > > and now I wonder if I should just leave them alone. Could you give me
> > > feedback?
> > These are a tough case. One thing you see alot is something where we do a
> > ifdef DEBUG printf, but the arguments to the printf aren't defined unless
> > is defined. So you would run into some compile issues there.
> > Additionally, some of the DEBUG stuff is pretty heavyweight, and is there
> > true debugging, not casual use through dmesg.
> > I'm inclined to say leave most of them working the way they currently do.
> > in the case above, change it to:
> > #idef DEBUG
> > aprint_normal("foo"...);
> > #endif
> > aprint_debug is more or less for cases where it doesn't require any
> > processing to just print out some additional data that we already happen
> > have.
> > src/sys/arch/ofppc/ofppc/mainbus.c is a relatively good example of
> > uses, though not a perfect example. In init_openpic() you can see how we
> > verbose to note the enabling of interrupts on an SMP machine, and then
> > to note the address where the openpic was found. (however, I see one is
> > normal, oops). Finally, down in init_ofppc_interrupt() you see where we
> > debug. (I say relatively good example, because there are a few bad uses,
> > it looks like 1-2 printfs are still in there. Bad Tim.)
> > Alot of these are judgement calls. You kinda have to do your best. I
> > convert 1 or 2 files, and then mail the diffs to tech-kern for review.
> With a
> > little feedback from some of us, you will get the hang of it quickly.
> > ---
> > Tim Rightnour <root%garbled.net@localhost>
> > NetBSD: Free multi-architecture OS http://www.netbsd.org/
> > Genecys: Open Source 3D MMORPG: http://www.genecys.org/
Main Index |
Thread Index |