test,tools: capture boost::program_options in a try

When something fails boost::program_options throws an exception that
needs to be caught.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
test: catch boost::program_options errors

And display it before returning on error.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
tools: display boost::program_options errors

Instead of silently discarding them. Do not display the usage on error
as it will probably hide the error message that shows before it.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
tools: move po::collect_unrecognized in the try block

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
tools: allow_unregistered() options

So that --debug-mon etc. can be parsed afterwards.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
test,tools: indentation, whitespace only

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
perfglue: profiler stats need more than 1024 bytes

With a 1024 bytes buffer to display the stats, the end is truncated.
Use an array on the stack instead of leaking the buffer.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
mon,mds: call ceph_heap_profiler_init() at boot time

So that the CEPH_HEAP_PROFILER_INIT environment variable can be used to
start profiling.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
doc: update memory-profiling with examples

* Update the ceph tell from ceph daemon tell id to the new
  ceph tell deamon.id form

* Add usages examples for easier copy / paste

* Add MON to the list of daemons that can be profiled

* Document CEPH_HEAP_PROFILER_INIT=true

* Remove trailing empty lines

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Merge pull request #2629 from dachary/wip-heap-profiler

perfglue: minors heap profiler updates and documentation

Reviewed-by: Jianpeng Ma <majianpeng@gmail.com>
Merge pull request #2511 from dachary/wip-catch-options-errors

test,tools: catch option parsing exceptions

Reviewed-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@redhat.com>
client: print out mode, uid, gid if they are changed

These values can be printed by MClientRequest message output, but if
they're flushed out via cap updates we don't even get that. These
are important values that generally don't change often; so print
them out in debug logging.

Signed-off-by: Greg Farnum <greg@inktank.com>
mds: MDSAuthCaps: init "read" param in default constructor

CID 1244228:  Uninitialized scalar field  (UNINIT_CTOR)
/mds/MDSAuthCaps.h: 29 in MDSCapSpec::MDSCapSpec()()

Signed-off-by: Greg Farnum <greg@inktank.com>
mds: MDirUpdate: initialize discover count to 0 if we're not discovering

Otherwise it's left uninitialized and could do who-knows-what!

CID 1244229:  Uninitialized scalar field  (UNINIT_CTOR)
/messages/MDirUpdate.h: 55 in MDirUpdate::MDirUpdate(mds_rank_t, dirfrag_t,
int, std::set<int, std::less<int>, std::allocator<int>> &, filepath &, bool)()

Signed-off-by: Greg Farnum <greg@inktank.com>
Merge pull request #2677 from ceph/wip-mds-coverity

Wip mds coverity
Merge pull request #2676 from ceph/wip-print-mode

client: print out mode, uid, gid if they are changed