summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'daemon')
-rw-r--r--daemon/Makefile.am1
-rw-r--r--daemon/daemon.h3
-rw-r--r--daemon/proto.c6
3 files changed, 8 insertions, 2 deletions
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 8b909c50..141dfadd 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -48,6 +48,7 @@ guestfsd_SOURCES = \
lvm.c \
mknod.c \
mount.c \
+ names.c \
ntfs.c \
pingdaemon.c \
proto.c \
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 553973d9..5f22a4f8 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -55,6 +55,9 @@ extern void udev_settle (void);
extern int verbose;
+/*-- in names.c (auto-generated) --*/
+extern const char *function_names[];
+
/*-- in proto.c --*/
extern int proc_nr;
extern int serial;
diff --git a/daemon/proto.c b/daemon/proto.c
index 39cee5ab..3ca4316a 100644
--- a/daemon/proto.c
+++ b/daemon/proto.c
@@ -146,8 +146,10 @@ main_loop (int _sock)
start_us = (int64_t) start_t.tv_sec * 1000000 + start_t.tv_usec;
end_us = (int64_t) end_t.tv_sec * 1000000 + end_t.tv_usec;
elapsed_us = end_us - start_us;
- fprintf (stderr, "proc %d serial %d took %d.%02d seconds\n",
- proc_nr, serial,
+ fprintf (stderr, "proc %d (%s) took %d.%02d seconds\n",
+ proc_nr,
+ proc_nr >= 0 && proc_nr < GUESTFS_PROC_NR_PROCS
+ ? function_names[proc_nr] : "UNKNOWN PROCEDURE",
(int) (elapsed_us / 1000000),
(int) ((elapsed_us / 10000) % 100));
}