[sheepdog] [PATCH] sheep: zip some unnecessary eprintf

Liu Yuan namei.unix at gmail.com
Wed Jun 26 07:56:59 CEST 2013


These information isn't useful to users who started sheep with default log level

Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 lib/logger.c              |    8 ++++----
 sheep/group.c             |    4 ++--
 sheep/object_list_cache.c |    2 +-
 sheep/plain_store.c       |    2 +-
 sheep/sheep.c             |    4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/logger.c b/lib/logger.c
index 3db2614..e957706 100644
--- a/lib/logger.c
+++ b/lib/logger.c
@@ -691,7 +691,7 @@ notrace int __sd_dump_variable(const char *var, const void *base_sp)
 	FILE *f = NULL;
 
 	if (!check_gdb()) {
-		sd_eprintf("cannot find gdb");
+		sd_dprintf("cannot find gdb");
 		return -1;
 	}
 
@@ -741,7 +741,7 @@ static notrace int __dump_stack_frames(const void *base_sp)
 	int i, stack_no = 0;
 
 	if (!check_gdb()) {
-		sd_eprintf("cannot find gdb");
+		sd_dprintf("cannot find gdb");
 		return -1;
 	}
 
@@ -784,8 +784,8 @@ static notrace int __dump_stack_frames(const void *base_sp)
 		}
 
 		if (!found) {
-			sd_eprintf("Cannot get info from GDB");
-			sd_eprintf("Set /proc/sys/kernel/yama/ptrace_scope to"
+			sd_iprintf("Cannot get info from GDB");
+			sd_iprintf("Set /proc/sys/kernel/yama/ptrace_scope to"
 				   " zero if you are using Ubuntu.");
 			pclose(f);
 			return -1;
diff --git a/sheep/group.c b/sheep/group.c
index 76e9d2b..2d4a25c 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -867,7 +867,7 @@ static void update_cluster_info(const struct join_message *msg,
 {
 	struct vnode_info *old_vnode_info;
 
-	sd_eprintf("status = %d, epoch = %d, finished: %d",
+	sd_dprintf("status = %d, epoch = %d, finished: %d",
 		   msg->cluster_status, msg->epoch, sys->join_finished);
 
 	if (!sys->join_finished)
@@ -1049,7 +1049,7 @@ enum cluster_join_result sd_check_join_cb(const struct sd_node *joining,
 		panic("invalid system status: 0x%x", sys->status);
 	}
 
-	sd_eprintf("%s: ret = 0x%x, cluster_status = 0x%x",
+	sd_dprintf("%s: ret = 0x%x, cluster_status = 0x%x",
 		   addr_to_str(str, sizeof(str), joining->nid.addr,
 			       joining->nid.port),
 		   ret, jm->cluster_status);
diff --git a/sheep/object_list_cache.c b/sheep/object_list_cache.c
index 554b60a..7147191 100644
--- a/sheep/object_list_cache.c
+++ b/sheep/object_list_cache.c
@@ -182,7 +182,7 @@ static void objlist_deletion_work(struct work *work)
 	 * again, in which case we should not reclaim the cached entry.
 	 */
 	if (vdi_exist(vid)) {
-		sd_eprintf("VDI (%" PRIx32 ") is still in use, can not be"
+		sd_dprintf("VDI (%" PRIx32 ") is still in use, can not be"
 			" deleted", vid);
 		return;
 	}
diff --git a/sheep/plain_store.c b/sheep/plain_store.c
index 65f84b7..65c82d8 100644
--- a/sheep/plain_store.c
+++ b/sheep/plain_store.c
@@ -381,7 +381,7 @@ int default_link(uint64_t oid, uint32_t tgt_epoch)
 		if (errno == EEXIST)
 			goto out;
 
-		sd_eprintf("failed to link from %s to %s, %m", stale_path,
+		sd_dprintf("failed to link from %s to %s, %m", stale_path,
 			   path);
 		return err_to_sderr(path, oid, errno);
 	}
diff --git a/sheep/sheep.c b/sheep/sheep.c
index bb3dd87..6893a66 100644
--- a/sheep/sheep.c
+++ b/sheep/sheep.c
@@ -399,9 +399,9 @@ static void check_host_env(void)
 			   SD_RLIM_NOFILE);
 
 	if (getrlimit(RLIMIT_CORE, &r) < 0)
-		sd_eprintf("failed to get core %m");
+		sd_dprintf("failed to get core %m");
 	else if (r.rlim_cur < RLIM_INFINITY)
-		sd_iprintf("Allowed core file size %lu, suggested unlimited",
+		sd_dprintf("Allowed core file size %lu, suggested unlimited",
 			   r.rlim_cur);
 
 	/*
-- 
1.7.9.5




More information about the sheepdog mailing list