Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

printf output from librfxcodec is block-buffered #46

Open
rowlap opened this issue Nov 10, 2021 · 0 comments
Open

printf output from librfxcodec is block-buffered #46

rowlap opened this issue Nov 10, 2021 · 0 comments

Comments

@rowlap
Copy link

rowlap commented Nov 10, 2021

I'm interested in seeing output like rfxcodec_encode_create: got sse4.1 in
https://github.com/neutrinolabs/librfxcodec/blob/devel/src/rfxencode.c

however printf is an unusual choice of logging API.

Specifically, when we connect in a way which calls rfxcodec_encode_create_ex, the printf calls to stdout are block-buffered, the default behaviour for output to a non-terminal.

As such, we see this output going to systemd's journal, but only at the end of the session.

Nov 08 13:56:40 desktop xrdp[20339]: rfxcodec_encode_create: got sse2
Nov 08 13:56:40 desktop xrdp[20339]: rfxcodec_encode_create: got sse3
Nov 08 13:56:40 desktop xrdp[20339]: rfxcodec_encode_create: got sse4.1
Nov 08 13:56:40 desktop xrdp[20339]: rfxcodec_encode_create: got sse4.2
Nov 08 13:56:40 desktop xrdp[20339]: rfxcodec_encode_create: got popcnt
Nov 08 13:56:40 desktop xrdp[20339]: rfxcodec_encode_create: got lzcnt
Nov 08 13:56:40 desktop xrdp[20339]: rfxcodec_encode_create: rfx_encode set to rfx_encode_component_rlgr3_amd64_sse41

I tried changing the service ExecStart config to prefix
stdbuf --output=L ...
which then printed the output on connection, not disconnection.

Throughout the codebase under src/ there are 30 calls to LLOGLN (which is #define'd to printf), and 23 calls to printf directly.

It would be helpful if the [Logging] config from xrdp.ini were reflected in librfxcodec, but at a minimum can we avoid buffered output with printf?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant