1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
From 011cbfbcceab7673ccf33a17b1751b4afd6792f7 Mon Sep 17 00:00:00 2001
From: Justus Winter <justus@gnupg.org>
Date: Sun, 17 Apr 2016 19:09:52 +0200
Subject: [PATCH hurd 4/4] libdiskfs: xxx log periodic syncs
---
libdiskfs/init-main.c | 3 +++
libdiskfs/sync-interval.c | 8 ++++++++
2 files changed, 11 insertions(+)
diff --git a/libdiskfs/init-main.c b/libdiskfs/init-main.c
index 3e03ae4..72cf62a 100644
--- a/libdiskfs/init-main.c
+++ b/libdiskfs/init-main.c
@@ -22,6 +22,7 @@
#include <assert.h>
#include <error.h>
#include <hurd/store.h>
+#include <syslog.h>
struct store *
diskfs_init_main (struct argp *startup_argp,
@@ -44,6 +45,8 @@ diskfs_init_main (struct argp *startup_argp,
if (err)
error (2, err, "store_parsed_name");
+ openlog (diskfs_disk_name, LOG_CONS, LOG_DAEMON);
+
/* This must come after the args have been parsed, as this is where the
host priv ports are set for booting. */
diskfs_console_stdio ();
diff --git a/libdiskfs/sync-interval.c b/libdiskfs/sync-interval.c
index ea6e758..a090ecd 100644
--- a/libdiskfs/sync-interval.c
+++ b/libdiskfs/sync-interval.c
@@ -20,6 +20,7 @@
#include <errno.h>
#include <pthread.h>
#include <unistd.h>
+#include <syslog.h>
#include <hurd/fsys.h>
@@ -120,8 +121,15 @@ periodic_sync (void * arg)
will have held the lock while it did its work. */
if (_diskfs_diskdirty)
{
+ time_t start, stop;
+ time (&start);
diskfs_sync_everything (1);
diskfs_set_hypermetadata (1, 0);
+ time (&stop);
+
+ if (stop - start > 1)
+ syslog (LOG_NOTICE, "Periodic global sync took %ds.",
+ stop - start);
}
pthread_rwlock_unlock (&diskfs_fsys_lock);
}
--
2.1.4
|