summaryrefslogtreecommitdiff
path: root/tools/dbus-monitor.c
AgeCommit message (Collapse)AuthorFilesLines
2013-10-09dbus-monitor: keep backwards compatibilityChengwei Yang1-6/+25
eavesdropping as a match rule key introduced in DBus 1.5.6, and the privous implementation doesn't keep backwards compatibility with older dbus-daemon. And the reference dbus-daemon implementation just fail if unknwon key found in match rule, this is undefined hehavior in DBus Sepcification. Also there is a feature request for change this hehavior to "ignore unknown key in match rule", See https://bugs.freedesktop.org/show_bug.cgi?id=66114 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66107 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-10-08dbus-monitor: remove redundant match rulesChengwei Yang1-16/+1
Currently, DBus Specification only consists of four message types, so to monitor all the types of message, no need to match all of them but just left it empty is OK. Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66107 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-10-08Fix build on NetBSD 6.1.1 with gcc 4.5.3Chengwei Yang1-0/+3
There are two build failure on NetBSD 6.1.1 with gcc 4.5.3, the first one is char to int, warning treated as error. The second one is a mismatch between format string and arguments. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69842 [adjusted commit message -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-16Fix an incorrect sizeof.Sviatoslav Chagaev1-1/+1
Fix an incorrect sizeof which leads to allocation of more memory than actually needed. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69329 [elide redundant "* sizeof (char)" which is 1 by definition -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-09-16Revert "Fix an incorrect sizeof." to fix attributionSimon McVittie1-1/+1
This reverts commit 3c1938180bdca8fc658907f6f692186be2b81b77.
2013-09-16Fix an incorrect sizeof.Simon McVittie1-1/+1
Fix an incorrect sizeof which leads to allocation of more memory than actually needed. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69329 [elide redundant "* sizeof (char)" which is 1 by definition -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-08-05dbus-monitor: remove unused SIGINT handlerSimon McVittie1-8/+0
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
2011-07-12Fix dbus-monitor using eavesdrop=true when no filters are passedCosimo Alfarano1-4/+4
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-07-11Add "eavesdrop=true" as constant match rule for dbus-monitorCosimo Alfarano1-5/+24
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37890 Bug-NB: NB#269748 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-04-29minotaur: bail if asked to monitor >1 busWill Thompson1-11/+35
A coworker was just tripped up by `dbus-monitor --session --system` only monitoring the system bus. This patch would have saved him reproducing a tricky bug several times! Bug: https://bugs.freedesktop.org/show_bug.cgi?id=26548 Reviewed-by: Colin Walters <walters@verbum.org> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2010-12-04Fix PROFILE_TIMED_FORMAT printf warning on OSX.Mike McQuaid1-0/+4
2010-05-12Fix _IOLBF for Windows CE and also define _IONBF if needed.Marcus Brinkmann1-1/+4
2010-05-10Fixed assert raised with msvc 2008 on windows.Ralf Habacker1-0/+5
2010-04-13Port dbus tools to Windows CE.Marcus Brinkmann1-0/+15
2009-07-31dbus-monitor: use unbuffered stdout instead of handling SIGINTLennart Poettering1-6/+8
The current SIGINT handling of dbus-monitor ain't making too many people happy since it defers the exit to the next msg received -- which might be quite some time away often enough. This patch replaces the SIGINT handling by simply enabling line-buffered IO for STDOUT so that even if you redirect dbus-monitor into a file no lines get accidently lost and the effect of C-c is still immediate. halfline came up with the great idea to use setvbuf here instead of fflush()ing after each printf(). (Oh and the old signal handler was broken anyway, the flag should have been of type sigatomic_t and be marked volatile) Signed-off-by: Colin Walters <walters@verbum.org>
2009-07-14Bug 2432 - Support --address option for dbus-monitorDaniel Reed1-5/+49
Signed-off-by: Colin Walters <walters@verbum.org> (cherry picked from commit e4b271e2425a36884b5e3e70e6a32d440b41d145)
2009-07-14Bug 21161 - Update the FSF addressTobias Mueller1-1/+1
No comment. Signed-off-by: Colin Walters <walters@verbum.org> (cherry picked from commit 5baf2f856a9c6625993234855b07680da1c8916f)
2009-05-06Bug 19502 - Sparse warning cleanupsKjartan Maraas1-1/+1
This patch makes various things that should be static static, corrects some "return FALSE" where it should be NULL, etc. Signed-off-by: Colin Walters <walters@verbum.org>
2008-04-16take out trailing comma inside an enum so non gcc compilers don't error outJohn (J5) Palmieri1-1/+1
* tools/dbus-monitor.c: take out the trailing comma in the ProfileAttributeFlags enum as it isn't in our style guides and causes some compilers to error out
2007-07-142007-07-13 Havoc Pennington <hp@redhat.com>Havoc Pennington1-1/+1
* Add indent-tabs-mode: nil to all file headers.
2006-12-31* tools/dbus-monitor.c: gettimeofday() is not availableRalf Habacker1-0/+29
on windows so we have to provide our own. It's taken from lgpl'd kdewin32 package. - Patches from Christian Ehrlicher
2006-12-31win32 compile fixRalf Habacker1-0/+1
2006-11-08* tools/dbus-monitor.c: Handle sigint so we flush stdoutJohn (J5) Palmieri1-1/+15
(Patch from Olli Salli <olli dot salli at collabora dot co dot uk>)
2006-11-08* tools/dbus-monitor.c: add profiling tools to dbus-monitorJohn (J5) Palmieri1-4/+122
(Patch from Olli Salli <olli dot salli at collabora dot co dot uk>)
2006-06-142006-06-14 Ross Burton <ross@openedhand.com>Ross Burton1-10/+3
* tools/Makefile.am: * tools/dbus-monitor.c: Don't use the GLib bindings in dbus-monitor (patch from Ralf Habacker).
2005-10-292005-10-29 Robert McQueen <robot101@debian.org>Robert McQueen1-27/+50
* glib/Makefile.am, glib/examples/Makefile.am, glib/examples/statemachine/Makefile.am: Merge patch from Ubuntu by Daniel Stone to replace explicit calls to libtool with $(LIBTOOL). * test/python/.cvsignore: Add run-with-tmp-session-bus.conf. * tools/dbus-monitor.1, tools/dbus-monitor.c: Merge dbus-monitor patch from Ubuntu by Daniel Silverstone to allow specifying match rules on the command line.
2005-07-062005-07-06 Colin Walters <walters@verbum.org>Colin Walters1-1/+1
* dbus/dbus-glib.h (DBusGPendingCall, DBusGPendingCallNotify) (DBUS_TYPE_G_PENDING_CALL, dbus_g_pending_call_get_g_type) (dbus_g_pending_call_ref, dbus_g_pending_call_unref): Delete. (dbus_g_pending_call_set_notify, dbus_g_pending_call_cancel): Delete in favor of dbus_g_proxy_begin_call and dbus_g_proxy_cancel_call. (DBusGProxyCall, DBusGProxyCallNotify): New. (dbus_g_proxy_begin_call): Change prototype to take callback, user data, and destroy function. This replaces dbus_g_pending_call_set_notify. (dbus_g_proxy_cancel_call): Prototype. (DBusGAsyncData): Delete, shouldn't be needed anymore. * glib/dbus-gproxy.c (struct _DBusGProxy): Add call_id_counter and pending_calls map. (struct _DBusGProxyManager): Add bus_proxy member, which is an internal proxy for calls to the bus. Remove pending_nameowner_calls, now the internal proxy keeps track. (dbus_g_proxy_manager_unref): Unref bus proxy, remove reference to pending_nameowner_calls. (got_name_owner_cb): Update prototype, and use dbus_g_proxy_end_call. (got_name_owner_cb): Remove reference to pending_nameowner_calls. (dbus_g_proxy_manager_register): Delete directly libdbus code in favor of using internal proxy. (dbus_g_proxy_manager_unregister): Update to use dbus_g_proxy_cancel_call for any pending GetNameOwner call. (dbus_g_proxy_init): Initialize pending calls map. (dbus_g_proxy_constructor): New. (dbus_g_proxy_class_init): Add get/set property functions, constructor, and add NAME, PATH, and INTERFACE properties. (cancel_pending_call): New function. (dbus_g_proxy_dispose): Iterate over any outstanding calls and cancel them. (dbus_g_proxy_set_property, dbus_g_proxy_get_property): New. (GPendingNotifyClosure): New structure. (d_pending_call_notify, d_pending_call_free): Moved here from dbus-glib.c. (DBUS_G_VALUE_ARRAY_COLLECT_ALL): Moved around to satisfy function ordering. (manager_begin_bus_call): New internal function for talking to internal bus proxy. (dbus_g_proxy_new): Construct object using GObjet properties. (dbus_g_proxy_begin_call_internal): Update to take user data, etc. Create closure of same, and insert call into map of pending calls. (dbus_g_proxy_end_call_internal): Take call id instead of pending call. Look up pending call in current set. Remove it when we've completed. (dbus_g_pending_call_end, dbus_g_proxy_end_call_internal): Delete. (dbus_g_proxy_begin_call): Change API to take callback, user data, and destroy function directly. (dbus_g_proxy_end_call): Update to take DBusGProxyCall. (dbus_g_proxy_call): Invoke with NULL callback. (dbus_g_proxy_cancel_call): New function, replaces dbus_g_pending_call_cancel. * glib/dbus-gparser.c (validate_signature): Fix call to dbus_set_g_error. * glib/dbus-gobject.c (dbus_g_object_type_dbus_metadata_quark): New quark for attaching metadata to GType. (info_hash): Delete. (lookup_object_info): Look up using quark. (dbus_g_object_type_install_info): Check that a type is classed, not that it's an object. Also just install type data using quark instead of using global hash. * glib/dbus-glib.c (dbus_g_pending_call_ref) (dbus_g_pending_call_unref, dbus_pending_call_get_g_type) (GPendingNotifyClosure): Delete. (d_pending_call_notify, d_pending_call_free): Move to dbus-gproxy.c. (dbus_g_pending_call_set_notify, dbus_g_pending_call_cancel): Delete. * glib/dbus-binding-tool-glib.c (generate_client_glue): Disable async client method generation until we can fix it... * tools/dbus-viewer.c (load_child_nodes): Use dbus_g_proxy_call. (load_from_service_thread_func): Ditto. * tools/dbus-names-model.c (struct NamesModel): Hold DBusGProxyCall. (have_names_notify): Update prototype, use dbus_g_proxy_cancel_call. (names_model_reload): Update for new dbus_g_proxy_begin_call API. * tools/dbus-monitor.c (filter_func): Update for print_message API change. * test/glib/test-dbus-glib.c: Add more tests for async invocations. Update many begin_call/end_call pairs to just use dbus_g_proxy_call. * tools/dbus-send.c (main): Add --print-reply=literal mode. This allows us to dump print-introspect.c. * tools/dbus-print-message.h (print_message): Add literal argument to print_message which is intended to allow printing arguments without metadata like "string=". * tools/dbus-print-message.c (print_iter): Add literal argument. (print_message): Allow printing string messages literally.
2005-02-172005-02-17 Colin Walters <walters@verbum.org>Colin Walters1-1/+1
* dbus/dbus-protocol.h (DBUS_SERVICE_ORG_FREEDESKTOP_DBUS): Rename to DBUS_SERVICE_DBUS. (DBUS_PATH_ORG_FREEDESKTOP_DBUS): Rename to DBUS_PATH_DBUS. (DBUS_PATH_ORG_FREEDESKTOP_LOCAL): Rename to DBUS_PATH_LOCAL. (DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS): Rename to DBUS_INTERFACE_DBUS. (DBUS_INTERFACE_ORG_FREEDESKTOP_INTROSPECTABLE): Rename to DBUS_INTERFACE_INTROSPECTABLE. (DBUS_INTERFACE_ORG_FREEDESKTOP_PROPERTIES): Rename to DBUS_INTERFACE_PROPERTIES. (DBUS_INTERFACE_ORG_FREEDESKTOP_PEER): Rename to DBUS_INTERFACE_PEER. (DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL): DBUS_INTERFACE_LOCAL. All other users of those constants have been changed. * bus/driver.c (bus_driver_handle_introspect): Use constants. * glib/dbus-gobject.c (handle_introspect): Use constants. * doc/dbus-faq.xml, doc/dbus-specification.xml: Update for rename.
2004-10-29Add comment about workaround.Colin Walters1-0/+4
2004-10-292004-10-29 Colin Walters <walters@redhat.com>Colin Walters1-1/+1
* tools/dbus-monitor.c (filter_func): Return DBUS_HANDLER_RESULT_HANDLED in filter function for now. See: http://freedesktop.org/pipermail/dbus/2004-August/001433.html
2004-06-202004-06-20 Havoc Pennington <hp@redhat.com>Havoc Pennington1-3/+1
* dbus/dbus-glib-error-enum.h: autogenerate the GError enum codes from the dbus error names * glib/dbus-glib.h: move to subdir dbus/ since it's included as dbus/dbus-glib.h and that breakage is now visible due to including dbus/dbus-glib.h in dbus-glib-lowlevel.h * glib/dbus-glib.h: s/gproxy/g_proxy/ * dbus/dbus-shared.h: new header to hold stuff shared with binding APIs * dbus/dbus-protocol.h (DBUS_ERROR_*): move errors here rather than dbus-errors.h * glib/dbus-glib.h (dbus_set_g_error): move to dbus-glib-lowlevel.h * glib/dbus-glib.h: remove dbus/dbus.h from here; change a bunch of stuff to enable this * dbus/dbus-glib-lowlevel.h: put dbus/dbus.h here * a bunch of other changes with the same basic "separate glib bindings from dbus.h" theme
2004-05-25monitor all types of messagesColin Walters1-1/+27
2003-08-312003-08-30 Havoc Pennington <hp@pobox.com>Havoc Pennington1-7/+4
* dbus/dbus-connection.c: purge DBusMessageHandler * dbus/dbus-message-handler.c: remove DBusMessageHandler, just use callbacks everywhere
2003-08-182003-08-18 Havoc Pennington <hp@redhat.com>Havoc Pennington1-1/+3
* dbus/dbus-hash.c (_dbus_hash_table_insert_two_strings): fix * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix dumb bug created earlier (wrong order of args to decode_header_data()) * tools/dbus-send.c: port * tools/dbus-print-message.c (print_message): port * test/data/*messages: port all messages over * dbus/dbus-message-builder.c: support including message type * bus/driver.c: port over * bus/dispatch.c: port over to new stuff * dbus/dbus-connection.c (_dbus_connection_new_for_transport): rename disconnect signal to "Disconnected"
2003-08-122003-08-11 Havoc Pennington <hp@pobox.com>Havoc Pennington1-1/+1
* bus/test.c (client_disconnect_handler): change to return HANDLED (would have been REMOVE_MESSAGE) * dbus/dbus-object.h (enum DBusHandlerResult): rename to HANDLED/NOT_YET_HANDLED instead of REMOVE_MESSAGE/ALLOW_MORE_HANDLERS to make it clearer how it should be used.
2003-06-192003-06-19 Philip Blundell <philb@gnu.org>Anders Carlsson1-1/+3
* tools/dbus-print-message.c (print_message): Handle BOOLEAN. * tools/dbus-send.c: Accept both --system and --session. * tools/dbus-monitor.c: Same here.
2003-05-282003-05-28 Colin Walters <walters@verbum.org>Colin Walters1-1/+1
* tools/dbus-monitor.c (main): Fix silly typo (s/--session/--system/).
2003-05-182003-05-17 Colin Walters <walters@gnu.org>Colin Walters1-3/+3
* tools/dbus-send.c: Don't exit with an error code if --help was passed. Default to using the session bus instead of the system one. * tools/dbus-launch.c: Ditto. * tools/dbus-monitor.c: Ditto. * tools/dbus-send.1: Update with new arguments. * tools/dbus-launch.c: Emit code to export variables. New arguments -s and -c to specify shell syntax, and a bit of code to autodetect syntax. Also, allow specifying a program to run. * tools/dbus-launch.1: Update with new arguments. * tools/dbus-send.1: Ditto. * tools/dbus-monitor.1: Ditto.
2003-05-162003-05-16 Havoc Pennington <hp@redhat.com>Havoc Pennington1-52/+6
* dbus/dbus-connection.c: disable verbose lock spew * tools/dbus-send.c: add --print-reply command line option * tools/dbus-print-message.h (print_message): new util function shared by dbus-send and dbus-monitor * tools/dbus-monitor.c (handler_func): exit on disconnect * dbus/dbus-transport-unix.c (do_reading): if the transport is disconnected, don't try to use the read_watch * dbus/dbus-watch.c (dbus_watch_get_enabled): assert watch != NULL so we can find this bug more easily
2003-05-162003-05-16 Colin Walters <walters@verbum.org>Colin Walters1-0/+25
* tools/dbus-monitor.c: Add --session argument and usage() function. * tools/dbus-monitor.1: Update with new --session arg. * bus/Makefile.am (install-data-hook): Create $(libdir)/dbus-1.0/services so that the session bus is happy.
2003-04-242003-04-23 James Willcox <jwillcox@gnome.org>James Willcox1-1/+1
* glib/dbus-glib.h: * glib/dbus-gmain.c: (add_timeout), (wakeup_main), (create_source), (dbus_connection_setup_with_g_main), (dbus_server_setup_with_g_main): * glib/test-dbus-glib.c: (main): * glib/test-thread-client.c: (main): * glib/test-thread-server.c: (new_connection_callback), (main): * tools/dbus-monitor.c: (main): Added a GMainContext argument to dbus_connection_setup_with_g_main() and dbus_server_setup_with_g_main().
2003-04-142003-04-13 Havoc Pennington <hp@pobox.com>Havoc Pennington1-0/+122
* tools/dbus-send.c, tools/dbus-monitor.c: two utility programs from Philip Blundell to send messages and monitor them.