s3:smbprofile: rewrite the internal macros
authorStefan Metzmacher <metze@samba.org>
Thu, 23 Oct 2014 16:06:15 +0000 (18:06 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 19 Nov 2014 19:51:37 +0000 (20:51 +0100)
commitcee1b4b0532d6271c2fc90fc2f82e9693a43d8ad
tree58e0eabc9a3ee346d80d67e5497129d43afc633c
parent9813f56178870b9081c7521ca2e3137473950497
s3:smbprofile: rewrite the internal macros

We now autogenerate a lot of code using
SMBPROFILE_STATS_ALL_SECTIONS macro which expands to
different SMBPROFILE_STATS_{COUNT,BASIC,BYTES,IOBYTES} macros.

This also allows async profiling using:

   struct mystate {
       ...

       SMBPROFILE_BASIC_ASYNC_STATE(profile_state);
       ...
   };

   ...

   SMBPROFILE_BASIC_ASYNC_START(SMB2_negotiate, profile_p, mystate->profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_IDLE(mystate->profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_BUSY(mystate->profile_state);

   ...

   SMBPROFILE_BASIC_ASYNC_END(mystate->profile_state);

The current START_PROFILE*()/END_PROFILE*() are implemented as legacy wrappers.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/include/smbprofile.h
source3/profile/profile.c
source3/utils/status_profile.c