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

Remove unnecessary arguments for log(...) #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

qpmr
Copy link

@qpmr qpmr commented Apr 24, 2024

We don't need to specify PID in the public log(...) function because logd obtains it from the credentials ([0]), which we don't fill explicitly (no stable api in Rust for that now). However, in our case (logdw socket has enabled passcred option) the kernel does it automatically ([1]).
We also shouldn't pass TID (in public log(...)) because we always use our thread id for that purpose.

[0] https://chromium.googlesource.com/aosp/platform/system/logging/+/refs/heads/factory-ambassador-14265.B/logd/LogListener.cpp#119
[1] https://elixir.bootlin.com/linux/v6.5/source/net/unix/af_unix.c#L1857

We don't need to specify PID in the public log(...) function
because logd obtains it from the credentials ([0]), which
we don't fill explicitly (no stable api in Rust for that now).
However, in our case (logdw socket has enabled passcred option)
the kernel does it automatically ([1]).
We also shouldn't pass TID (in public log(...)) because
we always use our thread id for that purpose.

 [0] https://chromium.googlesource.com/aosp/platform/system/logging/+/refs/heads/factory-ambassador-14265.B/logd/LogListener.cpp#119
 [1] https://elixir.bootlin.com/linux/v6.5/source/net/unix/af_unix.c#L1857
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

Successfully merging this pull request may close these issues.

None yet

1 participant