[Gluster-devel] Tips and Tricks for Gluster Developer
Richard Wareing
rwareing at fb.com
Mon Jan 25 02:42:53 UTC 2016
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)
- 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=
More information about the Gluster-devel
mailing list