[SCM] Samba Shared Repository - branch master updated
Stefan Metzmacher
metze at samba.org
Wed Jun 20 06:57:09 MDT 2012
The branch, master has been updated
via ab96359 script/autobuild: delay start of small projects by 60 to 600 seconds
via c30e6b5 script/autobuild: don't use 'make -j 4' for bin/smbtorture4
via fba51c8 script/autobuild: don't use make -j for small projects
via cd26039 s3:smbd: fix the build with the --with-profiling-data option
via 0d1f3c1 s3:include: add START/END_PROFILE_STAMP()
via b70164b wafsamba/irixcc: next try to inject '-c99' the the build
via a94bed3 Revert "wafsamba/irixcc: add '-c99' option to cc"
from db9180c idmap-hash: Attempt to fix Coverity ID 709116 Overflowed array index write
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit ab96359bfefa08eddfb688137ca07c1efcbb494f
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 20 11:03:48 2012 +0200
script/autobuild: delay start of small projects by 60 to 600 seconds
This should reduce the startup load.
metze
Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Wed Jun 20 14:56:51 CEST 2012 on sn-devel-104
commit c30e6b5973b78c04b9131a2adf1eb5dda2222c2f
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 20 11:14:04 2012 +0200
script/autobuild: don't use 'make -j 4' for bin/smbtorture4
The '4' has no effect there, which results in NUM_JOBS == NUM_CORES.
metze
commit fba51c82f35dae1a406d291614a0920cecef6e8c
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 20 10:36:23 2012 +0200
script/autobuild: don't use make -j for small projects
The top level and source3 builds take much longer than the standalone
projects, so there's no need to use 'make -j'.
metze
commit cd260391fae7888de0e6e1be64eebb50f399525b
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 20 08:53:10 2012 +0200
s3:smbd: fix the build with the --with-profiling-data option
metze
commit 0d1f3c13630610447e629c9fbe86c6545b063cff
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 20 08:44:30 2012 +0200
s3:include: add START/END_PROFILE_STAMP()
This is needed when the profiling spans multiple functions.
metze
commit b70164bc31854990a97c8010526a1a07e72a11d7
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 20 08:45:42 2012 +0200
wafsamba/irixcc: next try to inject '-c99' the the build
metze
commit a94bed317881395b68cb06a8c637095ca6c98cd3
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 20 00:14:58 2012 +0200
Revert "wafsamba/irixcc: add '-c99' option to cc"
This reverts commit 59daf91f397c2ebef283ab9e6ecaabbe9dc58fc5.
Doesn't seem to work :-(
metze
-----------------------------------------------------------------------
Summary of changes:
buildtools/wafsamba/irixcc.py | 8 +++---
script/autobuild.py | 56 ++++++++++++++++++++++++++--------------
script/random-sleep.sh | 21 +++++++++++++++
source3/include/smbprofile.h | 30 +++++++++++++++++-----
source3/smbd/globals.h | 2 +
source3/smbd/process.c | 10 +++++--
6 files changed, 93 insertions(+), 34 deletions(-)
create mode 100755 script/random-sleep.sh
Changeset truncated at 500 lines:
diff --git a/buildtools/wafsamba/irixcc.py b/buildtools/wafsamba/irixcc.py
index f29f9a0..f3cb451 100644
--- a/buildtools/wafsamba/irixcc.py
+++ b/buildtools/wafsamba/irixcc.py
@@ -17,18 +17,18 @@ def find_irixcc(conf):
cc = None
if v['CC']: cc = v['CC']
elif 'CC' in conf.environ: cc = conf.environ['CC']
- if not cc:
- cc = conf.find_program('cc', var='CC')
- cc += ' -c99'
+ if not cc: cc = conf.find_program('cc', var='CC')
if not cc: conf.fatal('irixcc was not found')
cc = conf.cmd_to_list(cc)
try:
- if Utils.cmd_output(cc + ['-version']) != '':
+ if Utils.cmd_output(cc + ['-c99'] + ['-version']) != '':
conf.fatal('irixcc %r was not found' % cc)
except ValueError:
conf.fatal('irixcc -v could not be executed')
+ conf.env.append_unique('CCFLAGS', '-c99')
+
v['CC'] = cc
v['CC_NAME'] = 'irix'
diff --git a/script/autobuild.py b/script/autobuild.py
index fcdfdb7..8bdb281 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -40,7 +40,7 @@ tasks = {
# we split 'make -j 4', 'make bin/smbtorture4' and 'make -j 4 everything'
# because it makes it much easier to find errors.
("make", "make -j 4", "text/plain"), # don't use too many processes
- ("make bin/smbtorture4", "make -j 4 bin/smbtorture4", "text/plain"),
+ ("make bin/smbtorture4", "make bin/smbtorture4", "text/plain"),
("make everything", "make -j 4 everything", "text/plain"),
("install", "make install", "text/plain"),
("test", "TDB_NO_FSYNC=1 make test FAIL_IMMEDIATELY=1", "text/plain"),
@@ -55,28 +55,32 @@ tasks = {
("check-clean-tree", "script/clean-source-tree.sh", "text/plain"),
("clean", "make clean", "text/plain") ],
- "samba4-libs" : [ ("talloc-configure", "cd lib/talloc && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
- ("talloc-make", "cd lib/talloc && make -j", "text/plain"),
+ "samba4-libs" : [
+ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+ ("talloc-configure", "cd lib/talloc && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
+ ("talloc-make", "cd lib/talloc && make", "text/plain"),
("talloc-install", "cd lib/talloc && make install", "text/plain"),
("tdb-configure", "cd lib/tdb && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
- ("tdb-make", "cd lib/tdb && make -j", "text/plain"),
+ ("tdb-make", "cd lib/tdb && make", "text/plain"),
("tdb-install", "cd lib/tdb && make install", "text/plain"),
("tevent-configure", "cd lib/tevent && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
- ("tevent-make", "cd lib/tevent && make -j", "text/plain"),
+ ("tevent-make", "cd lib/tevent && make", "text/plain"),
("tevent-install", "cd lib/tevent && make install", "text/plain"),
("ldb-configure", "cd lib/ldb && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
- ("ldb-make", "cd lib/ldb && make -j", "text/plain"),
+ ("ldb-make", "cd lib/ldb && make", "text/plain"),
("ldb-install", "cd lib/ldb && make install", "text/plain"),
("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=!talloc,!tdb,!pytdb,!ldb,!pyldb,!tevent,!pytevent --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
- ("make", "make -j", "text/plain"),
+ ("make", "make", "text/plain"),
("install", "make install", "text/plain")],
- "ldb" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
- ("make", "make -j", "text/plain"),
+ "ldb" : [
+ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
+ ("make", "make", "text/plain"),
("install", "make install", "text/plain"),
("test", "TDB_NO_FSYNC=1 make test", "text/plain"),
("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
@@ -84,47 +88,59 @@ tasks = {
("clean", "make clean", "text/plain") ],
# We don't use TDB_NO_FSYNC=1 here, because we want to test the transaction code
- "tdb" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
- ("make", "make -j", "text/plain"),
+ "tdb" : [
+ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
+ ("make", "make", "text/plain"),
("install", "make install", "text/plain"),
("test", "make test", "text/plain"),
("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
("distcheck", "make distcheck", "text/plain"),
("clean", "make clean", "text/plain") ],
- "ntdb" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
- ("make", "make -j", "text/plain"),
+ "ntdb" : [
+ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
+ ("make", "make", "text/plain"),
("install", "make install", "text/plain"),
("test", "make test", "text/plain"),
("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
("distcheck", "make distcheck", "text/plain"),
("clean", "make clean", "text/plain") ],
- "talloc" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
- ("make", "make -j", "text/plain"),
+ "talloc" : [
+ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
+ ("make", "make", "text/plain"),
("install", "make install", "text/plain"),
("test", "make test", "text/plain"),
("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
("distcheck", "make distcheck", "text/plain"),
("clean", "make clean", "text/plain") ],
- "replace" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
- ("make", "make -j", "text/plain"),
+ "replace" : [
+ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
+ ("make", "make", "text/plain"),
("install", "make install", "text/plain"),
("test", "make test", "text/plain"),
("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
("distcheck", "make distcheck", "text/plain"),
("clean", "make clean", "text/plain") ],
- "tevent" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
- ("make", "make -j", "text/plain"),
+ "tevent" : [
+ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
+ ("make", "make", "text/plain"),
("install", "make install", "text/plain"),
("test", "make test", "text/plain"),
("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
("distcheck", "make distcheck", "text/plain"),
("clean", "make clean", "text/plain") ],
- "pidl" : [ ("configure", "perl Makefile.PL PREFIX=${PREFIX_DIR}", "text/plain"),
+ "pidl" : [
+ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
+ ("configure", "perl Makefile.PL PREFIX=${PREFIX_DIR}", "text/plain"),
("touch", "touch *.yp", "text/plain"),
("make", "make", "text/plain"),
("test", "make test", "text/plain"),
diff --git a/script/random-sleep.sh b/script/random-sleep.sh
new file mode 100755
index 0000000..70b0c03
--- /dev/null
+++ b/script/random-sleep.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+
+if [ $# -lt 2 ]; then
+ echo "$0: <low> <high>"
+ exit 1;
+fi
+
+l=$1
+h=$2
+
+s=$(expr $h - $l)
+
+r=$(head --bytes=2 /dev/urandom | od -l | head -n 1 | sed -e 's/^[^ ]* *//')
+
+v=$(expr $r % $s)
+d=$(expr $l + $v)
+
+echo "$0: sleep $d ... start"
+#sleep $d
+echo "$0: sleep $d ... end"
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h
index 4f5b600..6e136a0 100644
--- a/source3/include/smbprofile.h
+++ b/source3/include/smbprofile.h
@@ -935,12 +935,19 @@ static inline uint64_t profile_timestamp(void)
ADD_PROFILE_COUNT(x,n); \
}
+#define START_PROFILE_RAW(x, _stamp, _count) \
+ _stamp = 0; \
+ if (do_profile_flag) { \
+ _stamp = do_profile_times ? profile_timestamp() : 0;\
+ INC_PROFILE_COUNT(_count); \
+ }
+
+#define START_PROFILE_STAMP(x, _stamp) \
+ START_PROFILE_RAW(x, _stamp, x##_count)
+
#define START_PROFILE(x) \
uint64_t __profstamp_##x = 0; \
- if (do_profile_flag) { \
- __profstamp_##x = do_profile_times ? profile_timestamp() : 0;\
- INC_PROFILE_COUNT(x##_count); \
- }
+ START_PROFILE_RAW(x, __profstamp_##x, x##_count)
#define START_PROFILE_BYTES(x,n) \
uint64_t __profstamp_##x = 0; \
@@ -950,19 +957,28 @@ static inline uint64_t profile_timestamp(void)
ADD_PROFILE_COUNT(x##_bytes, n); \
}
-#define END_PROFILE(x) \
+#define END_PROFILE_RAW(x, _stamp, _time) \
if (do_profile_times) { \
- ADD_PROFILE_COUNT(x##_time, \
- profile_timestamp() - __profstamp_##x); \
+ ADD_PROFILE_COUNT(_time, \
+ profile_timestamp() - _stamp); \
}
+
+#define END_PROFILE_STAMP(x, _stamp) \
+ END_PROFILE_RAW(x, _stamp, x##_time)
+
+#define END_PROFILE(x) \
+ END_PROFILE_RAW(x, __profstamp_##x, x##_time)
+
#else /* WITH_PROFILE */
#define DO_PROFILE_INC(x)
#define DO_PROFILE_DEC(x)
#define DO_PROFILE_DEC_INC(x,y)
#define DO_PROFILE_ADD(x,n)
+#define START_PROFILE_STAMP(x, _stamp)
#define START_PROFILE(x)
#define START_PROFILE_BYTES(x,n)
+#define END_PROFILE_STAMP(x, _stamp)
#define END_PROFILE(x)
#endif /* WITH_PROFILE */
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 8113b8e..0164cb6 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -352,6 +352,8 @@ struct smbXsrv_connection {
} smb2;
struct msg_state *msg_state;
+
+ uint64_t smbd_idle_profstamp;
};
NTSTATUS smbXsrv_connection_init_tables(struct smbXsrv_connection *conn,
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 9e1abb2..465f429 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -3166,12 +3166,16 @@ NTSTATUS smbXsrv_connection_init_tables(struct smbXsrv_connection *conn,
static void smbd_tevent_trace_callback(enum tevent_trace_point point,
void *private_data)
{
+ struct smbXsrv_connection *conn =
+ talloc_get_type_abort(private_data,
+ struct smbXsrv_connection);
+
switch (point) {
case TEVENT_TRACE_BEFORE_WAIT:
- START_PROFILE(smbd_idle);
+ START_PROFILE_STAMP(smbd_idle, conn->smbd_idle_profstamp);
break;
case TEVENT_TRACE_AFTER_WAIT:
- END_PROFILE(smbd_idle);
+ END_PROFILE_STAMP(smbd_idle, conn->smbd_idle_profstamp);
break;
}
}
@@ -3513,7 +3517,7 @@ void smbd_process(struct tevent_context *ev_ctx,
TALLOC_FREE(frame);
- tevent_set_trace_callback(ev_ctx, smbd_tevent_trace_callback, NULL);
+ tevent_set_trace_callback(ev_ctx, smbd_tevent_trace_callback, conn);
while (True) {
frame = talloc_stackframe_pool(8192);
--
Samba Shared Repository
More information about the samba-cvs
mailing list