[Gluster-devel] Tips and Tricks for Gluster Developer

Niels de Vos ndevos at redhat.com
Mon Jan 25 13:00:53 UTC 2016


On Mon, Jan 25, 2016 at 06:41:50AM -0500, Rajesh Joseph wrote:
> 
> 
> ----- Original Message -----
> > From: "Richard Wareing" <rwareing at fb.com>
> > To: "Raghavendra Talur" <rtalur at redhat.com>
> > Cc: "Gluster Devel" <gluster-devel at gluster.org>
> > Sent: Monday, January 25, 2016 8:12:53 AM
> > Subject: Re: [Gluster-devel] Tips and Tricks for Gluster Developer
> > 
> > Here's my tips:
> > 
> > 1. General C tricks
> > - learn to use vim or emacs & read their manuals; customize to suite your
> > style
> > - use vim w/ pathogen plugins for auto formatting (don't use tabs!) & syntax
> > - use ctags to jump around functions
> > - Use ASAN & valgrind to check for memory leaks and heap corruption
> > - learn to use "git bisect" to quickly find where regressions were introduced
> > & revert them
> > - Use a window manager like tmux or screen
> > 
> > 2. Gluster specific tricks
> > - Alias "ggrep" to grep through all Gluster source files for some string and
> > show you the line numbers
> > - Alias "gvim" or "gemacs" to open any source file without full path, eg.
> > "gvim afr.c"
> > - GFS specific gdb macros to dump out pretty formatting of various structs
> > (Jeff Darcy has some of these IIRC)
> 
> I also use few macros for printing dictionary and walking through the list structures.
> I think it would be good to collect these macros, scripts and tool in a common place
> so that people can use them. Can we include them in "extras/dev" directory
> under Gluster source tree?

Yes, but please call it "extras/devel-tools" or something descriptive
like that. "extras/dev" sounds like some device under /dev :)

Thanks,
Niels


> 
> > - Write prove tests...for everything you write, and any bug you fix.  Make
> > them deterministic (timing/races shouldn't matter).
> > - Bugs/races and/or crashes which are hard or impossible to repro often
> > require the creation of a developer specific feature to simulate the failure
> > and efficiently code/test a fix.  Example: "monkey-unlocking" in the lock
> > revocation patch I just posted.
> > - That edge case you are ignoring because you think it's impossible/unlikely?
> > We will find/hit it in 48hrs at large scale (seriously we will) ....handle
> > it correctly or at a minimum write a (kernel style) "OOPS" log type message.
> > 
> > That's all I have off the top of my head.  I'll give example aliases in
> > another reply.
> > 
> > Richard
> > 
> > Sent from my iPhone
> > 
> > > On Jan 22, 2016, at 6:14 AM, Raghavendra Talur <rtalur at redhat.com> wrote:
> > > 
> > > HI All,
> > > 
> > > I am sure there are many tricks hidden under sleeves of many Gluster
> > > developers.
> > > I realized this when speaking to new developers. It would be good have a
> > > searchable thread of such tricks.
> > > 
> > > Just reply back on this thread with the tricks that you have and I promise
> > > I will collate them and add them to developer guide.
> > > 
> > > 
> > > Looking forward to be amazed!
> > > 
> > > Thanks,
> > > Raghavendra Talur
> > > 
> > > _______________________________________________
> > > Gluster-devel mailing list
> > > Gluster-devel at gluster.org
> > > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.gluster.org_mailman_listinfo_gluster-2Ddevel&d=CwICAg&c=5VD0RTtNlTh3ycd41b3MUw&r=qJ8Lp7ySfpQklq3QZr44Iw&m=wVrGhYdkvCanDEZF0xOyVbFg0am_GxaoXR26Cvp7H2U&s=JOrY0up51BoZOq2sKaNJQHPzqKiUS3Bwgn7fr5VPXjw&e=
> > _______________________________________________
> > Gluster-devel mailing list
> > Gluster-devel at gluster.org
> > http://www.gluster.org/mailman/listinfo/gluster-devel
> > 
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at gluster.org
> http://www.gluster.org/mailman/listinfo/gluster-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://www.gluster.org/pipermail/gluster-devel/attachments/20160125/69ec895f/attachment.sig>


More information about the Gluster-devel mailing list