SystemTap and DTrace integration

Change-Id: I307dac7b2985d2dce83c8c90b4928623c71f9c2a
Reviewed-on: http://review.couchbase.org/22828
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Add probes into the distribution tarball

Change-Id: Ib0bae24f906872aae4d5447b31931c542975b0f7
Reviewed-on: http://review.couchbase.org/22885
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Fix possible SEGFAULT

Change-Id: Ib4af592550fcc98ad761b732dada12508a6b9815
Reviewed-on: http://review.couchbase.org/22890
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
CCBC-131: Compensate for cluster nodes lacking couchApiBase

Change-Id: I2d95738ea0377d70af6b2a6f332fb6b55b303453
Reviewed-on: http://review.couchbase.org/22918
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Don't check for EINVAL when missing POST/PUT body

This behavior was changed previously

Change-Id: I620a37d536b1e6d3963f41c0ca25e38b23fd162b
Reviewed-on: http://review.couchbase.org/22920
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Skip mock tests on real cluster

Some tests require special mock commands and should not be run against a
real cluster

Change-Id: I3bb09f920a24b2e69e5a80f0145be23de9997d87
Reviewed-on: http://review.couchbase.org/22921
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
CCBC-130: Fix memory leak on http headers

Change-Id: I40cf0fc340974ee9f90b4436219b7055e5fc9104
Reviewed-on: http://review.couchbase.org/22922
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
src/probes.h is generated file, so it should be in dist

Change-Id: I5dab5ec3715350ef84da03349cf2a043f05eaa28
Reviewed-on: http://review.couchbase.org/22949
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Add manpages for all of cbc-* commands

Change-Id: I0837255e3760f334058231444887a39d46bdecdc
Reviewed-on: http://review.couchbase.org/22967
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
CCBC-132, CCBC-133: Let HTTP function in stormy weather

This changeset encompasses several files (and possibly several unfiled)
issues which occur with HTTP requests during network errors and
configuration changes.

Specifically some duplicate code paths were removed, and the process for
delivering an HTTP response back to the user is more streamlined.

Change-Id: Idb6f6c5b89de8107ebdd9fd86a56716353de8475
Reviewed-on: http://review.couchbase.org/23001
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Make it C89 friendly again

Change-Id: I65dbf1f4d19d6f5aa6bd388f8e9754ec0679942f
Reviewed-on: http://review.couchbase.org/23013
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Make lcb_logger work again

We were still defining LIBCOUCHBASE_DEBUG_NOCTX, when it should now be
LCB_DEBUG_NOCTX

Change-Id: I3eea2659bb6f0cd9e7695eae263653d32857b87c
Reviewed-on: http://review.couchbase.org/22999
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Mordechai Nunberg <mnunberg@haskalah.org>
Do not use req->server in macros

This member is only available when LCB_HTTP_TYPE_VIEW is used and also
`url' member should always contain host.

Change-Id: I9cf2da84c6cbc0209ea5c4856d74ebbadf96ab51
Reviewed-on: http://review.couchbase.org/23015
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Cleanup HTTP traces: probe http_end only once

also fixes warinings like this:

src/http.c: In function 'request_do_fill_input_buffer':
src/http.c:217: error: missing initializer [-Wmissing-field-initializers]
src/http.c:217: error: (near initialization for 'resp.v') [-Wmissing-field-initializers]
src/http.c:217: error: unused variable 'resp' [-Wunused-variable]

Change-Id: I1ca075d87059fdeacb6e857478a05079f7b344c8
Reviewed-on: http://review.couchbase.org/23018
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Do not call finish twice on connect error

Change-Id: Ib0a7e80d5dac2b96bcfcbccb0735618c82debd6b
Reviewed-on: http://review.couchbase.org/23037
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
CCBC-136: do not abort when purging SASL commands

Change-Id: Iaf222a359080855e393a55b1fd4f12293b432d14
Reviewed-on: http://review.couchbase.org/23100
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Mordechai Nunberg <mnunberg@haskalah.org>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Clarify the ttp/ttr fields for observe

Change-Id: I6f349b80b991e353b2f4515e4934e45b075f0da6
Reviewed-on: http://review.couchbase.org/23102
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Fixup compiler invocation for minimal.c

Change-Id: I66946fdfad2572a4754e509931c758a08b6e53f6
Reviewed-on: http://review.couchbase.org/23160
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Use defined coding style for examples

Change-Id: I464261556bc28780580615ce0ae268c4cb7bbf04
Reviewed-on: http://review.couchbase.org/23161
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Delay all timers while loop isn't active

It will fix following scenario:

1. connect the instance
2. sleep for time greater than default timeout (e.g. 3 seconds)
3. schedule and execute a command

Without this patch libev backend will immediately return LCB_ETIMEDOUT

Change-Id: I71ad9b39fa7315d62d69c8314b0d15ba63491bf3
Reviewed-on: http://review.couchbase.org/23170
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>