Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: Mathieu Desnoyers via lttng-dev <lttng-dev@lists.lttng.org>
To: "Wu, Yannan" <yannanwu@amazon.com>,
	Kienan Stewart <kstewart@efficios.com>,
	"lttng-dev@lists.lttng.org" <lttng-dev@lists.lttng.org>
Subject: Re: [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?
Date: Tue, 4 Jun 2024 11:56:25 -0400	[thread overview]
Message-ID: <24624b2e-3da0-4cfe-94c6-dd451d9818df@efficios.com> (raw)
In-Reply-To: <9c0522c7090b4523aac4166a232ca50a@amazon.com>

On 2024-06-04 11:25, Wu, Yannan wrote:
> The device is a rooted android device
> 
> *On the device:*
> 
> lttng-sessiond -d --no-kernel
> 
> lttng create my-live-session --live
> 
> lttng enable-event -u <mu customized event>
> 
> lttng start
> 
> 
> *On the host:*
> 
> adb reverse tcp:5343 tcp:5343
> 
> The adb reverse will fail for "/adb.exe: error: cannot bind to socket/"
> 
> 
> In the reversed order, if set up adb reverse from the host first and 
> create the live session after, lttng-relayd on device cannot be started.
> Here is the error message:

The "reverse order" you describe is the order you need. What you are
missing is to run lttng-relayd on the host and to forward both ports
5342 *and* 5343. You will also need to either override the target URLs
for the live control and data ports to prevent sessiond from auto-spawning
a relayd, or forward the live viewer port as well through adb (5344).

Overall:

* First on the Host:

lttng-relayd
adb reverse tcp:5342 tcp:5342  # control port
adb reverse tcp:5343 tcp:5343  # data port
adb reverse tcp:5344 tcp:5344  # live viewer port

* Then on the Android Device:

lttng-sessiond -d --no-kernel
lttng create my-live-session --live --ctrl-url=tcp://localhost:5342 --data-url=tcp://localhost:5343
lttng enable-event -u <my customized event>
lttng start

The reason why the relayd auto-spawn needs to be prevented is because
the "lttng create" command line attempts to connect to the localhost relayd
as a viewer (default port tcp 5344). So if you don't forward this
port as well through adb, the sessiond will always try to auto-spawn
a relayd which conflicts with your forwarded ports on the Android
device.

Technically either forwarding port 5344 or specifying control/data
URL override is sufficient to prevent the relayd auto-spawn, but
I'd recommend doing both if it is possible.

Thanks,

Mathieu

> 
> /PERROR - 15:23:30.915938387 [9813/9829]: Failed to bind socket: Address 
> already in use (in relay_socket_create() at 
> /src/VodkaLttngTool/build/private/source/src/bin/lttng-relayd/main.c:1036)/
> /Error: Health error occurred in relay_thread_listener/
> /Error: A file descriptor leak has been detected: 1 tracked file 
> descriptors are still being tracked/

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

  reply	other threads:[~2024-06-04 15:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-30  5:53 Wu, Yannan via lttng-dev
2024-05-30 19:12 ` Kienan Stewart via lttng-dev
2024-06-03  2:55   ` Wu, Yannan via lttng-dev
2024-06-04 15:09     ` Mathieu Desnoyers via lttng-dev
2024-06-04 15:25       ` Wu, Yannan via lttng-dev
2024-06-04 15:56         ` Mathieu Desnoyers via lttng-dev [this message]
2024-06-03  3:01   ` Wu, Yannan via lttng-dev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24624b2e-3da0-4cfe-94c6-dd451d9818df@efficios.com \
    --to=lttng-dev@lists.lttng.org \
    --cc=kstewart@efficios.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=yannanwu@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox