summaryrefslogtreecommitdiffstats
path: root/source/include
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1999-04-01 05:22:58 +0000
committerAndrew Tridgell <tridge@samba.org>1999-04-01 05:22:58 +0000
commitef3d61a80ad0b87c196a63ef2bd4fe8fc3863bd0 (patch)
tree498b412b5423f0585e9977fd1935f4d7c1d0a0fb /source/include
parentdfcfeb743a7667c9dedf3d2b04587c497af12893 (diff)
downloadsamba-ef3d61a80ad0b87c196a63ef2bd4fe8fc3863bd0.tar.gz
samba-ef3d61a80ad0b87c196a63ef2bd4fe8fc3863bd0.tar.xz
samba-ef3d61a80ad0b87c196a63ef2bd4fe8fc3863bd0.zip
Ken McDonell from SGI was interested in adding some profiling
capabilities to Samba so that Samba could talk to the SGI PCP (Performance Co-Pilot) apps. This change adds a profiling shared memory area and uses it to count two fairly trivial things, the number of uid switches and the number of SMB packets processes. To add more just edit include/profile.h and then increment it at the right place. I've also added a -P switch to smbstatus to dump the profile area.
Diffstat (limited to 'source/include')
-rw-r--r--source/include/config.h.in7
-rw-r--r--source/include/includes.h24
-rw-r--r--source/include/proto.h4
3 files changed, 24 insertions, 11 deletions
diff --git a/source/include/config.h.in b/source/include/config.h.in
index f2dcdd7765c..6c4dd746dad 100644
--- a/source/include/config.h.in
+++ b/source/include/config.h.in
@@ -109,6 +109,7 @@
#undef HAVE_SET_AUTH_PARAMETERS
#undef WITH_MMAP
#undef WITH_SYSLOG
+#undef WITH_PROFILE
#undef WITH_SSL
#undef WITH_LDAP
#undef WITH_NISPLUS
@@ -636,6 +637,9 @@
/* Define if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define if you have the <mysql.h> header file. */
+#undef HAVE_MYSQL_H
+
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
@@ -786,9 +790,6 @@
/* Define if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
-/* Define if you have the <mysql.h> header file. */
-#undef HAVE_MYSQL_H
-
/* Define if you have the dl library (-ldl). */
#undef HAVE_LIBDL
diff --git a/source/include/includes.h b/source/include/includes.h
index 0d2561f6bcb..b8806896006 100644
--- a/source/include/includes.h
+++ b/source/include/includes.h
@@ -46,16 +46,12 @@
#endif
-/* if we have both SYSV IPC and shared mmap then we need to choose. For most
- systems it is much faster to use SYSV IPC, but under Linux it is
- about 5 times faster to use fcntl, so for Linux systems we force
- fcntl based locking */
+/* if we have both SYSV IPC and shared mmap then we need to
+ choose. For most systems it is much faster to use SYSV IPC. We used
+ to make an exception for Linux, but now Linux 2.2 has made it
+ better to use sysv if possible */
#if (defined(HAVE_SYSV_IPC) && defined(HAVE_SHARED_MMAP))
-# ifdef LINUX
-# undef HAVE_SYSV_IPC
-# else
# undef HAVE_SHARED_MMAP
-# endif
#endif
@@ -572,6 +568,10 @@ extern int errno;
#include "nterr.h"
+#ifdef WITH_PROFILE
+#include "profile.h"
+#endif
+
#ifndef MAXCODEPAGELINES
#define MAXCODEPAGELINES 256
#endif
@@ -705,6 +705,14 @@ union semun {
#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
#endif
+#ifndef SHM_R
+#define SHM_R (0400)
+#endif
+
+#ifndef SHM_W
+#define SHM_W (0200)
+#endif
+
#if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID)
#define ULTRIX_AUTH 1
#endif
diff --git a/source/include/proto.h b/source/include/proto.h
index ff992fe0864..8ce1e95bbf4 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -1583,6 +1583,10 @@ void printjob_decode(int jobid, int *snum, int *job);
void status_printqueue(connection_struct *conn,int snum,int status);
void load_printers(void);
+/*The following definitions come from profile/profile.c */
+
+BOOL profile_setup(BOOL rdonly);
+
/*The following definitions come from rpc_client/cli_login.c */
BOOL cli_nt_setup_creds(struct cli_state *cli, uint16 fnum,