Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ] mpris-proxy: Line-buffer stdout
@ 2026-09-29  0:34 Seonggon Cho
  2026-09-29  2:12 ` [BlueZ] " bluez.test.bot
  2026-09-29  2:45 ` [PATCH BlueZ v2] " Seonggon Cho
  0 siblings, 2 replies; 5+ messages in thread
From: Seonggon Cho @ 2026-09-29  0:34 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Seonggon Cho

mpris-proxy reports adapter and player changes with printf() but never
flushes stdout. When it runs as a service (tools/mpris-proxy.service)
stdout is a pipe to the journal, so glibc fully buffers it and nothing
is written until 4 KiB have accumulated or the process exits.

On a system whose Bluetooth adapter went away and came back every two
minutes, the "Bluetooth Adapter /org/bluez/hci0 removed" and "... found"
messages reached the journal in bursts of exactly 100 lines (about
4096 bytes), all carrying the timestamp of the flush rather than of the
event, i.e. up to about 80 minutes late.

Set stdout to line buffered at startup, as bt_shell_init() already does,
so every message reaches the journal with an accurate timestamp.

Assisted-by: Claude:claude-fable-5-1
---
 tools/mpris-proxy.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/mpris-proxy.c b/tools/mpris-proxy.c
index 1d7a421e9..4a8dd71e2 100644
--- a/tools/mpris-proxy.c
+++ b/tools/mpris-proxy.c
@@ -2954,6 +2954,10 @@ int main(int argc, char *argv[])
 	guint owner_watch, properties_watch, signal_watch;
 	struct sigaction sa;
 
+	/* stdout is a pipe to the journal when running as a service, so make
+	 * it line buffered to get the messages out as they happen. */
+	setlinebuf(stdout);
+
 	context = g_option_context_new(NULL);
 	g_option_context_add_main_entries(context, options, NULL);
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [BlueZ] mpris-proxy: Line-buffer stdout
  2026-09-29  0:34 [PATCH BlueZ] mpris-proxy: Line-buffer stdout Seonggon Cho
@ 2026-09-29  2:12 ` bluez.test.bot
  2026-09-29  2:45 ` [PATCH BlueZ v2] " Seonggon Cho
  1 sibling, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2026-09-29  2:12 UTC (permalink / raw)
  To: linux-bluetooth, jmsmg1

[-- Attachment #1: Type: text/plain, Size: 1816 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1175670/

---Test result---

Test Summary:
CheckPatch                    FAIL      0.31 seconds
GitLint                       PASS      0.22 seconds
BuildEll                      PASS      19.24 seconds
BluezMake                     PASS      372.59 seconds
CheckSmatch                   PASS      290.15 seconds
bluezmakeextell               PASS      92.76 seconds
TestFunctional                PASS      1105.85 seconds
IncrementalBuild              PASS      383.28 seconds
ScanBuild                     PASS      1119.69 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ] mpris-proxy: Line-buffer stdout
WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line
#108: FILE: tools/mpris-proxy.c:2958:
+	 * it line buffered to get the messages out as they happen. */

/home/runner/work/bluez/bluez/src/patch/14853746.patch total: 0 errors, 1 warnings, 10 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

/home/runner/work/bluez/bluez/src/patch/14853746.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.




https://github.com/bluez/bluez/pull/2603

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH BlueZ v2] mpris-proxy: Line-buffer stdout
  2026-09-29  0:34 [PATCH BlueZ] mpris-proxy: Line-buffer stdout Seonggon Cho
  2026-09-29  2:12 ` [BlueZ] " bluez.test.bot
@ 2026-09-29  2:45 ` Seonggon Cho
  2026-09-29  7:56   ` [BlueZ,v2] " bluez.test.bot
  2026-09-30 15:40   ` [PATCH BlueZ v2] " patchwork-bot+bluetooth
  1 sibling, 2 replies; 5+ messages in thread
From: Seonggon Cho @ 2026-09-29  2:45 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Seonggon Cho

mpris-proxy reports adapter and player changes with printf() but never
flushes stdout. When it runs as a service (tools/mpris-proxy.service)
stdout is a pipe to the journal, so glibc fully buffers it and nothing
is written until 4 KiB have accumulated or the process exits.

On a system whose Bluetooth adapter went away and came back every two
minutes, the "Bluetooth Adapter /org/bluez/hci0 removed" and "... found"
messages reached the journal in bursts of exactly 100 lines (about
4096 bytes), all carrying the timestamp of the flush rather than of the
event, i.e. up to about 80 minutes late.

Set stdout to line buffered at startup, as bt_shell_init() already does,
so every message reaches the journal with an accurate timestamp.

Assisted-by: Claude:claude-fable-5-1
---
v2: use the block comment style from doc/coding-style.rst (M2), fixes
    the checkpatch BLOCK_COMMENT_STYLE warning reported by the CI bot

 tools/mpris-proxy.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/mpris-proxy.c b/tools/mpris-proxy.c
index 1d7a421e9..e06b9ea3e 100644
--- a/tools/mpris-proxy.c
+++ b/tools/mpris-proxy.c
@@ -2954,6 +2954,12 @@ int main(int argc, char *argv[])
 	guint owner_watch, properties_watch, signal_watch;
 	struct sigaction sa;
 
+	/*
+	 * stdout is a pipe to the journal when running as a service, so make
+	 * it line buffered to get the messages out as they happen.
+	 */
+	setlinebuf(stdout);
+
 	context = g_option_context_new(NULL);
 	g_option_context_add_main_entries(context, options, NULL);
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [BlueZ,v2] mpris-proxy: Line-buffer stdout
  2026-09-29  2:45 ` [PATCH BlueZ v2] " Seonggon Cho
@ 2026-09-29  7:56   ` bluez.test.bot
  2026-09-30 15:40   ` [PATCH BlueZ v2] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2026-09-29  7:56 UTC (permalink / raw)
  To: linux-bluetooth, jmsmg1

[-- Attachment #1: Type: text/plain, Size: 858 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1175715/

---Test result---

Test Summary:
CheckPatch                    PASS      0.38 seconds
GitLint                       PASS      0.23 seconds
BuildEll                      PASS      19.21 seconds
BluezMake                     PASS      377.82 seconds
CheckSmatch                   PASS      289.05 seconds
bluezmakeextell               PASS      92.60 seconds
TestFunctional                PASS      1109.11 seconds
IncrementalBuild              PASS      399.36 seconds
ScanBuild                     PASS      1105.02 seconds



https://github.com/bluez/bluez/pull/2604

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH BlueZ v2] mpris-proxy: Line-buffer stdout
  2026-09-29  2:45 ` [PATCH BlueZ v2] " Seonggon Cho
  2026-09-29  7:56   ` [BlueZ,v2] " bluez.test.bot
@ 2026-09-30 15:40   ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2026-09-30 15:40 UTC (permalink / raw)
  To: Seonggon Cho; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue, 29 Sep 2026 02:45:30 +0000 you wrote:
> mpris-proxy reports adapter and player changes with printf() but never
> flushes stdout. When it runs as a service (tools/mpris-proxy.service)
> stdout is a pipe to the journal, so glibc fully buffers it and nothing
> is written until 4 KiB have accumulated or the process exits.
> 
> On a system whose Bluetooth adapter went away and came back every two
> minutes, the "Bluetooth Adapter /org/bluez/hci0 removed" and "... found"
> messages reached the journal in bursts of exactly 100 lines (about
> 4096 bytes), all carrying the timestamp of the flush rather than of the
> event, i.e. up to about 80 minutes late.
> 
> [...]

Here is the summary with links:
  - [BlueZ,v2] mpris-proxy: Line-buffer stdout
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=a086d234e503

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-30 15:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-29  0:34 [PATCH BlueZ] mpris-proxy: Line-buffer stdout Seonggon Cho
2026-09-29  2:12 ` [BlueZ] " bluez.test.bot
2026-09-29  2:45 ` [PATCH BlueZ v2] " Seonggon Cho
2026-09-29  7:56   ` [BlueZ,v2] " bluez.test.bot
2026-09-30 15:40   ` [PATCH BlueZ v2] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox