summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2015-02-16 13:54:39 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2015-02-16 15:12:06 +0100
commit450c7067de1f1856b189c0bab59da4fcdbafbba3 (patch)
tree56d7f13d4513e56f6860f7d412d3294f8e213dcd
parent1e2395f25de2f52181734e1d9f3ca5d164dedc36 (diff)
downloaddbus-450c7067de1f1856b189c0bab59da4fcdbafbba3.tar.gz
dbus-monitor: Combine sec and usec columns into one timestamp column and unify platform related format string.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89165 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r--tools/dbus-monitor.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/tools/dbus-monitor.c b/tools/dbus-monitor.c
index 33414c99..4be91e88 100644
--- a/tools/dbus-monitor.c
+++ b/tools/dbus-monitor.c
@@ -107,14 +107,6 @@ monitor_filter_func (DBusConnection *connection,
return DBUS_HANDLER_RESULT_HANDLED;
}
-#ifdef __APPLE__
-#define PROFILE_TIMED_FORMAT "%s\t%lu\t%d"
-#elif defined(__NetBSD__)
-#include <inttypes.h>
-#define PROFILE_TIMED_FORMAT "%s\t%" PRId64 "\t%d"
-#else
-#define PROFILE_TIMED_FORMAT "%s\t%lu\t%lu"
-#endif
#define TRAP_NULL_STRING(str) ((str) ? (str) : "<none>")
typedef enum
@@ -132,15 +124,15 @@ typedef enum
static void
profile_print_headers (void)
{
- printf ("#type\tsec\tusec\tserial\tsender\tdestination\tpath\tinterface\tmember\n");
- printf ("#\t\t\t\t\t\t\tin_reply_to\n");
+ printf ("#type\ttimestamp\tserial\tsender\tdestination\tpath\tinterface\tmember\n");
+ printf ("#\t\t\t\t\t\tin_reply_to\n");
}
static void
profile_print_with_attrs (const char *type, DBusMessage *message,
struct timeval *t, ProfileAttributeFlags attrs)
{
- printf (PROFILE_TIMED_FORMAT, type, t->tv_sec, t->tv_usec);
+ printf ("%s\t%lu.%06lu", type, (unsigned long) t->tv_sec, (unsigned long) t->tv_usec);
if (attrs & PROFILE_ATTRIBUTE_FLAG_SERIAL)
printf ("\t%u", dbus_message_get_serial (message));
@@ -224,7 +216,7 @@ print_message_profile (DBusMessage *message)
PROFILE_ATTRIBUTE_FLAG_MEMBER);
break;
default:
- printf (PROFILE_TIMED_FORMAT "\n", "tun", t.tv_sec, t.tv_usec);
+ printf ("%s\t%lu.%06lu", "tun", (unsigned long) t.tv_sec, (unsigned long) t.tv_usec);
break;
}
}