summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2014-03-22 09:41:29 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2014-03-22 09:41:29 +0000
commit6c13da0e4ed0dcdff429bc14c23727132dc3ebe9 (patch)
tree4da6d4ccec9ec520887d0b8a12c5b3aa1fbc53b8
parent238681f57e37294767110a292091f37bd51a1eb8 (diff)
disable the imsg buffers profiling code unless requested, this will prevent
all processes from waking up every second
-rw-r--r--usr.sbin/smtpd/config.c7
-rw-r--r--usr.sbin/smtpd/smtpd.c4
-rw-r--r--usr.sbin/smtpd/smtpd.h3
3 files changed, 11 insertions, 3 deletions
diff --git a/usr.sbin/smtpd/config.c b/usr.sbin/smtpd/config.c
index daed0bd7c40..dfebab2f4b1 100644
--- a/usr.sbin/smtpd/config.c
+++ b/usr.sbin/smtpd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.24 2014/02/04 13:44:41 eric Exp $ */
+/* $OpenBSD: config.c,v 1.25 2014/03/22 09:41:28 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -35,6 +35,8 @@
#include "log.h"
#include "ssl.h"
+extern int profiling;
+
static int pipes[PROC_COUNT][PROC_COUNT];
void
@@ -172,6 +174,9 @@ config_done(void)
if (smtpd_process == PROC_CONTROL)
return;
+ if (!(profiling & PROFILE_BUFFERS))
+ return;
+
evtimer_set(&ev, process_stat_event, &ev);
tv.tv_sec = 0;
tv.tv_usec = 0;
diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c
index d3ad8be811a..9442445a4ad 100644
--- a/usr.sbin/smtpd/smtpd.c
+++ b/usr.sbin/smtpd/smtpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.c,v 1.213 2014/02/17 13:33:56 eric Exp $ */
+/* $OpenBSD: smtpd.c,v 1.214 2014/03/22 09:41:28 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -564,6 +564,8 @@ main(int argc, char *argv[])
profiling |= PROFILE_IMSG;
else if (!strcmp(optarg, "profile-queue"))
profiling |= PROFILE_QUEUE;
+ else if (!strcmp(optarg, "profile-buffers"))
+ profiling |= PROFILE_BUFFERS;
else
log_warnx("warn: unknown trace flag \"%s\"",
optarg);
diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h
index b8b87fcbc5f..7b501ee986b 100644
--- a/usr.sbin/smtpd/smtpd.h
+++ b/usr.sbin/smtpd/smtpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtpd.h,v 1.450 2014/02/17 13:33:56 eric Exp $ */
+/* $OpenBSD: smtpd.h,v 1.451 2014/03/22 09:41:28 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -592,6 +592,7 @@ struct smtpd {
#define PROFILE_TOSTAT 0x0001
#define PROFILE_IMSG 0x0002
#define PROFILE_QUEUE 0x0004
+#define PROFILE_BUFFERS 0x0008
struct forward_req {
uint64_t id;