<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/source3/profile, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git/'/>
<entry>
<title>s3:smbprofile: profile the system and user space cpu time</title>
<updated>2015-03-06T11:31:10+00:00</updated>
<author>
<name>Stefan Metzmacher</name>
<email>metze@samba.org</email>
</author>
<published>2014-11-14T11:52:33+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git/commit/?id=b9f9869d1bec7cff6682d3cda774dcbb2464223b'/>
<id>b9f9869d1bec7cff6682d3cda774dcbb2464223b</id>
<content type='text'>
Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>s3:smbprofile: Replace sysv shmem with tdb</title>
<updated>2015-03-06T11:31:10+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2014-09-29T16:08:17+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git/commit/?id=74a16a1094278d2c5c8ac800a4f7ed4553d7ac85'/>
<id>74a16a1094278d2c5c8ac800a4f7ed4553d7ac85</id>
<content type='text'>
What?

This patch gets rid of the central shared memory segment referenced by
"profile_p". Instead, every smbd gets a static profile_area where it collects
profiling data. Once a second, every smbd writes this profiling data into a
record of its own in a "smbprofile.tdb". smbstatus -P does a tdb_traverse on this
database and sums up what it finds.

Why?

At least in my perception sysv IPC has not the best reputation on earth. The
code before this patch uses shmat(). Samba ages ago has developed a good
abstraction of shared memory: It's called tdb.

The main reason why I started this is that I have a request to become
more flexible with profiling data. Samba should be able to collect data
per share or per user, something which is almost impossible to do with
a fixed structure. My idea is to for example install a profile area per
share and every second marshall this into one tdb record indexed by share
name. smbstatus -P would then also collect the data and either aggregate
them or put them into individual per-share statistics. This flexibility
in the data model is not really possible with one fixed structure.

But isn't it slow?

Well, I don't think so. I can't really prove it, but I do believe that on large
boxes atomically incrementing a shared memory value for every SMB does show up
due to NUMA effects. With this patch the hot code path is completely
process-local. Once a second every smbd writes into a central tdb, this of
course does atomic operations. But it's once a second, not on every SMB2 read.

There's two places where I would like to improve things: With the current code
all smbds wake up once a second. With 10,000 potentially idle smbds this will
become noticable. That's why the current only starts the timer when something has
changed.

The second place is the tdb traverse: Right now traverse is blocking in the
sense that when it has to switch hash chains it will block. With mutexes, this
means a syscall. I have a traverse light in mind that works as follows: It
assumes a locked hash chain and then walks the complete chain in one run
without unlocking in between. This way the caller can do nonblocking locks in
the first round and only do blocking locks in a second round. Also, a lot of
syscall overhead will vanish. This way smbstatus -P will have almost zero
impact on normal operations.

Pair-Programmed-With: Stefan Metzmacher &lt;metze@samba.org&gt;

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
What?

This patch gets rid of the central shared memory segment referenced by
"profile_p". Instead, every smbd gets a static profile_area where it collects
profiling data. Once a second, every smbd writes this profiling data into a
record of its own in a "smbprofile.tdb". smbstatus -P does a tdb_traverse on this
database and sums up what it finds.

Why?

At least in my perception sysv IPC has not the best reputation on earth. The
code before this patch uses shmat(). Samba ages ago has developed a good
abstraction of shared memory: It's called tdb.

The main reason why I started this is that I have a request to become
more flexible with profiling data. Samba should be able to collect data
per share or per user, something which is almost impossible to do with
a fixed structure. My idea is to for example install a profile area per
share and every second marshall this into one tdb record indexed by share
name. smbstatus -P would then also collect the data and either aggregate
them or put them into individual per-share statistics. This flexibility
in the data model is not really possible with one fixed structure.

But isn't it slow?

Well, I don't think so. I can't really prove it, but I do believe that on large
boxes atomically incrementing a shared memory value for every SMB does show up
due to NUMA effects. With this patch the hot code path is completely
process-local. Once a second every smbd writes into a central tdb, this of
course does atomic operations. But it's once a second, not on every SMB2 read.

There's two places where I would like to improve things: With the current code
all smbds wake up once a second. With 10,000 potentially idle smbds this will
become noticable. That's why the current only starts the timer when something has
changed.

The second place is the tdb traverse: Right now traverse is blocking in the
sense that when it has to switch hash chains it will block. With mutexes, this
means a syscall. I have a traverse light in mind that works as follows: It
assumes a locked hash chain and then walks the complete chain in one run
without unlocking in between. This way the caller can do nonblocking locks in
the first round and only do blocking locks in a second round. Also, a lot of
syscall overhead will vanish. This way smbstatus -P will have almost zero
impact on normal operations.

Pair-Programmed-With: Stefan Metzmacher &lt;metze@samba.org&gt;

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>s3:smbprofile: rewrite the internal macros</title>
<updated>2014-11-19T19:51:37+00:00</updated>
<author>
<name>Stefan Metzmacher</name>
<email>metze@samba.org</email>
</author>
<published>2014-10-23T16:06:15+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git/commit/?id=cee1b4b0532d6271c2fc90fc2f82e9693a43d8ad'/>
<id>cee1b4b0532d6271c2fc90fc2f82e9693a43d8ad</id>
<content type='text'>
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-&gt;profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_IDLE(mystate-&gt;profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_BUSY(mystate-&gt;profile_state);

   ...

   SMBPROFILE_BASIC_ASYNC_END(mystate-&gt;profile_state);

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

Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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-&gt;profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_IDLE(mystate-&gt;profile_state);

   ...

   SMBPROFILE_BYTES_ASYNC_SET_BUSY(mystate-&gt;profile_state);

   ...

   SMBPROFILE_BASIC_ASYNC_END(mystate-&gt;profile_state);

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

Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>s3:smbprofile: remove unused nmbd related counters</title>
<updated>2014-11-19T19:51:36+00:00</updated>
<author>
<name>Stefan Metzmacher</name>
<email>metze@samba.org</email>
</author>
<published>2014-11-05T12:13:35+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git/commit/?id=255ff0a9721207c119924a8730e9d00dc468a058'/>
<id>255ff0a9721207c119924a8730e9d00dc468a058</id>
<content type='text'>
Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Stefan Metzmacher &lt;metze@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>smbd: Fix nonempty line endings</title>
<updated>2014-10-07T12:44:04+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2014-09-11T14:46:39+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git/commit/?id=0fa16895f12050987c086a9ee27d6cf1b5be7251'/>
<id>0fa16895f12050987c086a9ee27d6cf1b5be7251</id>
<content type='text'>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: David Disseldorp &lt;ddiss@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: David Disseldorp &lt;ddiss@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>profiling: Only compile profile/profile.c if profiling is enabled</title>
<updated>2014-10-03T17:55:09+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2014-09-30T15:08:20+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git/commit/?id=c7c300f9710f1f207b9fa0274648ba2dc11c1ffd'/>
<id>c7c300f9710f1f207b9fa0274648ba2dc11c1ffd</id>
<content type='text'>
This conditional compile avoids some #ifdef WITH_PROFILE, which makes the code
more readable

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This conditional compile avoids some #ifdef WITH_PROFILE, which makes the code
more readable

Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>profiling: Move some #defines to profile.c</title>
<updated>2014-10-03T17:55:09+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2014-10-02T12:52:05+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git/commit/?id=0e1b60e8c3325a1e5ea77f420326b254d5404389'/>
<id>0e1b60e8c3325a1e5ea77f420326b254d5404389</id>
<content type='text'>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>profiling: Make "struct profile_header" static</title>
<updated>2014-10-03T17:55:09+00:00</updated>
<author>
<name>Volker Lendecke</name>
<email>vl@samba.org</email>
</author>
<published>2014-09-29T15:06:37+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git/commit/?id=7c1f6c7f61f27ec8e115cdce1e2ac15addd8fb84'/>
<id>7c1f6c7f61f27ec8e115cdce1e2ac15addd8fb84</id>
<content type='text'>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Volker Lendecke &lt;vl@samba.org&gt;
Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>s3: remove some dead code (for setdir command)</title>
<updated>2013-03-12T00:03:37+00:00</updated>
<author>
<name>Christian Ambach</name>
<email>ambi@samba.org</email>
</author>
<published>2013-03-11T21:23:27+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git/commit/?id=fb924d02ec05f7106beeeb409becbc39e00ddac9'/>
<id>fb924d02ec05f7106beeeb409becbc39e00ddac9</id>
<content type='text'>
set dir seems to have been a special SMB command used by Pathworks clients
the supporting code for it was already removed in 2007, so just remove all
remnants related to it (smb.conf parameter, documentation, ...)

Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Tue Mar 12 01:03:37 CET 2013 on sn-devel-104
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
set dir seems to have been a special SMB command used by Pathworks clients
the supporting code for it was already removed in 2007, so just remove all
remnants related to it (smb.conf parameter, documentation, ...)

Reviewed-by: Jeremy Allison &lt;jra@samba.org&gt;

Autobuild-User(master): Jeremy Allison &lt;jra@samba.org&gt;
Autobuild-Date(master): Tue Mar 12 01:03:37 CET 2013 on sn-devel-104
</pre>
</div>
</content>
</entry>
<entry>
<title>s3-build: fix the --with-profiling-data build on mac os x.</title>
<updated>2011-04-15T11:33:42+00:00</updated>
<author>
<name>Günther Deschner</name>
<email>gd@samba.org</email>
</author>
<published>2011-04-15T10:39:15+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pviktori/public_git/samba.git/commit/?id=0e18a59ed0aa48a8a9dee856faf05c1ad624e264'/>
<id>0e18a59ed0aa48a8a9dee856faf05c1ad624e264</id>
<content type='text'>
Guenther

Autobuild-User: Günther Deschner &lt;gd@samba.org&gt;
Autobuild-Date: Fri Apr 15 13:33:43 CEST 2011 on sn-devel-104
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Guenther

Autobuild-User: Günther Deschner &lt;gd@samba.org&gt;
Autobuild-Date: Fri Apr 15 13:33:43 CEST 2011 on sn-devel-104
</pre>
</div>
</content>
</entry>
</feed>
