lttng-dev.lists.lttng.org archive mirror
 help / color / mirror / Atom feed
* [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?
@ 2024-05-30  5:53 Wu, Yannan via lttng-dev
  2024-05-30 19:12 ` Kienan Stewart via lttng-dev
  0 siblings, 1 reply; 7+ messages in thread
From: Wu, Yannan via lttng-dev @ 2024-05-30  5:53 UTC (permalink / raw)
  To: lttng-dev@lists.lttng.org


[-- Attachment #1.1: Type: text/plain, Size: 1105 bytes --]

Hihi, there,

I am currently working on enabling lttng live mode over android usb adb. Here is the situation, during debugging some network related issues, we dont want the trace data to be streamed via network to cause extra load to the system being profiled. Then we select to connect lttng-relayd with adb via port forwarding so that the data is "forward" to the host.

Here is the set up and the problem:

for the device:  adb reverse tcp:5342 tcp:5342; adb reverse tcp:5343 tcp:5343; adb reverse tcp:5344 tcp:5344
Then starting up lttng with --live enabled.

What is expected:
lttng start streaming to the localhost.
What is seen:
the lttng-relayd failed to start. For unable binding to the socket.

The cause of this issue:

both adb reverse and lttng relayd need binding to the socket which is conflict with each other.


So what I wanna ask is, for embedded system use cases, do we have successful use cases among team that could stream the trace data in live mode to the host with usb based adb? If not, any idea or suggestion to me on how to process forward?

Amanda




[-- Attachment #1.2: Type: text/html, Size: 1696 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

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

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

* Re: [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?
  2024-05-30  5:53 [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb? 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-03  3:01   ` Wu, Yannan via lttng-dev
  0 siblings, 2 replies; 7+ messages in thread
From: Kienan Stewart via lttng-dev @ 2024-05-30 19:12 UTC (permalink / raw)
  To: Wu, Yannan, lttng-dev@lists.lttng.org

Hi Amanda,

I'd like to confirm my understanding the situation.

Android device
   - Running lttng-sessiond with one or more configured sessions

Development device
   - Connected to the android device over usb using adb

You want want the data captured on the android device to be streamed via 
the usb connection rather than the other networks on the android device.

Could you expand on the commands you used to set up the tracing sessions 
and relay, and where each of those commands were run?

It sounds to me like you might want to be doing something like the 
following:

(Development device) Start lttng-relayd:
   - tcp://0.0.0.0:5342 and :5343 will be bound on the development device
   - tcp://127.0.0.1:5344 will be available for the live reader

(Development device) Create the reverses for the following ports: 5342 
and 5343
   - At this point :5342 and :5343 should be available on the android 
device and reach the relayd running on the development device

(Android device) Start lttng-sessiond
(Android device) Create session(s): `lttng create -U tcp://localhost/
   - Using `-U/--set-url`, no relayd will be spawned on the android device
(Android device) Start session(s)

This setup should have the relayd running on the development and writing 
the traces there and/or viewing them with a live viewer. On the android 
device, the UST applications (if any) will connect to the local sessiond 
and consumers, which will shuttle the information over :5342 and :5343 
to the developer device via the reverse sockets.

Please note that I didn't have time to test this, so there might be some 
mistakes. As I requested above, clear details of the exact commands you 
use for the tracing setup would be very helpful to have the clearest 
understanding of what you're doing.

hope this helps,
kienan

On 5/30/24 1:53 AM, Wu, Yannan via lttng-dev wrote:
> Hihi, there,
> 
> I am currently working on enabling lttng live mode over android usb adb. 
> Here is the situation, during debugging some network related issues, we 
> dont want the trace data to be streamed via network to cause extra load 
> to the system being profiled. Then we select to connect lttng-relayd 
> with adb via port forwarding so that the data is "forward" to the host.
> 
> *Here is the set up and the problem:*
> 
> for the device:  adb reverse tcp:5342 tcp:5342; adb reverse tcp:5343 
> tcp:5343; adb reverse tcp:5344 tcp:5344
> Then starting up lttng with --live enabled.
> 
> *What is expected:*
> lttng start streaming to the localhost.
> *What is seen: *
> the lttng-relayd failed to start. For unable binding to the socket.
> 
> *The cause of this issue: *
> 
> both adb reverse and lttng relayd need binding to the socket which is 
> conflict with each other.
> 
> 
> So what I wanna ask is, for embedded system use cases, do we have 
> successful use cases among team that could stream the trace data in live 
> mode to the host with usb based adb? If not, any idea or suggestion to 
> me on how to process forward?
> 
> Amanda
> 
> 
> 
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

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

* Re: [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?
  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-03  3:01   ` Wu, Yannan via lttng-dev
  1 sibling, 1 reply; 7+ messages in thread
From: Wu, Yannan via lttng-dev @ 2024-06-03  2:55 UTC (permalink / raw)
  To: Kienan Stewart, lttng-dev@lists.lttng.org


[-- Attachment #1.1: Type: text/plain, Size: 4440 bytes --]

Yes. My test command is like below:

  1.  lttng-sessiond --d --no-kernel
  2.

yannanwu@ue91e96f2951b5c:~/trees/lttng_test_run$ lttng create my-user-space-live-session --live
Live session my-user-space-live-session created.
Traces will be output to tcp4://127.0.0.1:5342/ [data: 5343]
Live timer interval set to 1000000 us

  3.  After this, I could "ps -Ax|grep lttng" and see lttng-relayd started. But once I start adb reverse, it will failed for failed binding to socket.
  4.  In the other order, if I start adb reverse first and lttng-create later, lttng-create will not fail but lttng-relayd is not started. By manually start lttng-relayd it will also failed for unable binding to socket.

Amanda

________________________________
From: Kienan Stewart <kstewart@efficios.com>
Sent: Friday, May 31, 2024 3:12:16 AM
To: Wu, Yannan; lttng-dev@lists.lttng.org
Subject: RE: [EXTERNAL] [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.



Hi Amanda,

I'd like to confirm my understanding the situation.

Android device
   - Running lttng-sessiond with one or more configured sessions

Development device
   - Connected to the android device over usb using adb

You want want the data captured on the android device to be streamed via
the usb connection rather than the other networks on the android device.

Could you expand on the commands you used to set up the tracing sessions
and relay, and where each of those commands were run?

It sounds to me like you might want to be doing something like the
following:

(Development device) Start lttng-relayd:
   - tcp://0.0.0.0:5342 and :5343 will be bound on the development device
   - tcp://127.0.0.1:5344 will be available for the live reader

(Development device) Create the reverses for the following ports: 5342
and 5343
   - At this point :5342 and :5343 should be available on the android
device and reach the relayd running on the development device

(Android device) Start lttng-sessiond
(Android device) Create session(s): `lttng create -U tcp://localhost/
   - Using `-U/--set-url`, no relayd will be spawned on the android device
(Android device) Start session(s)

This setup should have the relayd running on the development and writing
the traces there and/or viewing them with a live viewer. On the android
device, the UST applications (if any) will connect to the local sessiond
and consumers, which will shuttle the information over :5342 and :5343
to the developer device via the reverse sockets.

Please note that I didn't have time to test this, so there might be some
mistakes. As I requested above, clear details of the exact commands you
use for the tracing setup would be very helpful to have the clearest
understanding of what you're doing.

hope this helps,
kienan

On 5/30/24 1:53 AM, Wu, Yannan via lttng-dev wrote:
> Hihi, there,
>
> I am currently working on enabling lttng live mode over android usb adb.
> Here is the situation, during debugging some network related issues, we
> dont want the trace data to be streamed via network to cause extra load
> to the system being profiled. Then we select to connect lttng-relayd
> with adb via port forwarding so that the data is "forward" to the host.
>
> *Here is the set up and the problem:*
>
> for the device:  adb reverse tcp:5342 tcp:5342; adb reverse tcp:5343
> tcp:5343; adb reverse tcp:5344 tcp:5344
> Then starting up lttng with --live enabled.
>
> *What is expected:*
> lttng start streaming to the localhost.
> *What is seen: *
> the lttng-relayd failed to start. For unable binding to the socket.
>
> *The cause of this issue: *
>
> both adb reverse and lttng relayd need binding to the socket which is
> conflict with each other.
>
>
> So what I wanna ask is, for embedded system use cases, do we have
> successful use cases among team that could stream the trace data in live
> mode to the host with usb based adb? If not, any idea or suggestion to
> me on how to process forward?
>
> Amanda
>
>
>
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

[-- Attachment #1.2: Type: text/html, Size: 6116 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

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

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

* Re: [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?
  2024-05-30 19:12 ` Kienan Stewart via lttng-dev
  2024-06-03  2:55   ` Wu, Yannan via lttng-dev
@ 2024-06-03  3:01   ` Wu, Yannan via lttng-dev
  1 sibling, 0 replies; 7+ messages in thread
From: Wu, Yannan via lttng-dev @ 2024-06-03  3:01 UTC (permalink / raw)
  To: Kienan Stewart, lttng-dev@lists.lttng.org


[-- Attachment #1.1: Type: text/plain, Size: 3946 bytes --]

I checked lttng-relayd source code, we do need to bind to the exact socket for further process. As adb reverse bind to the socket as well there is a conflict in-between. Do we have any other way to workaround it?

Amanda

________________________________
From: Kienan Stewart <kstewart@efficios.com>
Sent: Friday, May 31, 2024 3:12:16 AM
To: Wu, Yannan; lttng-dev@lists.lttng.org
Subject: RE: [EXTERNAL] [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.



Hi Amanda,

I'd like to confirm my understanding the situation.

Android device
   - Running lttng-sessiond with one or more configured sessions

Development device
   - Connected to the android device over usb using adb

You want want the data captured on the android device to be streamed via
the usb connection rather than the other networks on the android device.

Could you expand on the commands you used to set up the tracing sessions
and relay, and where each of those commands were run?

It sounds to me like you might want to be doing something like the
following:

(Development device) Start lttng-relayd:
   - tcp://0.0.0.0:5342 and :5343 will be bound on the development device
   - tcp://127.0.0.1:5344 will be available for the live reader

(Development device) Create the reverses for the following ports: 5342
and 5343
   - At this point :5342 and :5343 should be available on the android
device and reach the relayd running on the development device

(Android device) Start lttng-sessiond
(Android device) Create session(s): `lttng create -U tcp://localhost/
   - Using `-U/--set-url`, no relayd will be spawned on the android device
(Android device) Start session(s)

This setup should have the relayd running on the development and writing
the traces there and/or viewing them with a live viewer. On the android
device, the UST applications (if any) will connect to the local sessiond
and consumers, which will shuttle the information over :5342 and :5343
to the developer device via the reverse sockets.

Please note that I didn't have time to test this, so there might be some
mistakes. As I requested above, clear details of the exact commands you
use for the tracing setup would be very helpful to have the clearest
understanding of what you're doing.

hope this helps,
kienan

On 5/30/24 1:53 AM, Wu, Yannan via lttng-dev wrote:
> Hihi, there,
>
> I am currently working on enabling lttng live mode over android usb adb.
> Here is the situation, during debugging some network related issues, we
> dont want the trace data to be streamed via network to cause extra load
> to the system being profiled. Then we select to connect lttng-relayd
> with adb via port forwarding so that the data is "forward" to the host.
>
> *Here is the set up and the problem:*
>
> for the device:  adb reverse tcp:5342 tcp:5342; adb reverse tcp:5343
> tcp:5343; adb reverse tcp:5344 tcp:5344
> Then starting up lttng with --live enabled.
>
> *What is expected:*
> lttng start streaming to the localhost.
> *What is seen: *
> the lttng-relayd failed to start. For unable binding to the socket.
>
> *The cause of this issue: *
>
> both adb reverse and lttng relayd need binding to the socket which is
> conflict with each other.
>
>
> So what I wanna ask is, for embedded system use cases, do we have
> successful use cases among team that could stream the trace data in live
> mode to the host with usb based adb? If not, any idea or suggestion to
> me on how to process forward?
>
> Amanda
>
>
>
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

[-- Attachment #1.2: Type: text/html, Size: 5521 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

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

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

* Re: [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Mathieu Desnoyers via lttng-dev @ 2024-06-04 15:09 UTC (permalink / raw)
  To: Wu, Yannan, Kienan Stewart, lttng-dev@lists.lttng.org

Hi Amanda,

For each of the 4 commands described below, please clarify on
which device they are executed, whether on the Android device
or on the Development device.

Please make sure to follow to the letter the commands proposed
by Kienan: in the correct order, and on the appropriate device.

Thanks,

Mathieu


On 2024-06-02 22:55, Wu, Yannan via lttng-dev wrote:
> Yes. My test command is like below:
> 
>  1. lttng-sessiond --d --no-kernel
>  2.
> 
>     yannanwu@ue91e96f2951b5c:~/trees/lttng_test_run$ lttng create my-user-space-live-session --live
>     Live session my-user-space-live-session created.
>     Traces will be output to tcp4://127.0.0.1:5342/ [data: 5343]
>     Live timer interval set to 1000000 us
> 
>  3. After this, I could "ps -Ax|grep lttng" and see lttng-relayd
>     started. But once I start adb reverse, it will failed for failed
>     binding to socket.
>  4. In the other order, if I start adb reverse first and lttng-create
>     later, lttng-create will not fail but lttng-relayd is not started.
>     By manually start lttng-relayd it will also failed for unable
>     binding to socket.
> 
> Amanda
> 
> ------------------------------------------------------------------------
> *From:* Kienan Stewart <kstewart@efficios.com>
> *Sent:* Friday, May 31, 2024 3:12:16 AM
> *To:* Wu, Yannan; lttng-dev@lists.lttng.org
> *Subject:* RE: [EXTERNAL] [lttng-dev] [lttng-relayd] is there existing 
> cases for relayd to stream over Android usb based adb?
> CAUTION: This email originated from outside of the organization. Do not 
> click links or open attachments unless you can confirm the sender and 
> know the content is safe.
> 
> 
> 
> Hi Amanda,
> 
> I'd like to confirm my understanding the situation.
> 
> Android device
>     - Running lttng-sessiond with one or more configured sessions
> 
> Development device
>     - Connected to the android device over usb using adb
> 
> You want want the data captured on the android device to be streamed via
> the usb connection rather than the other networks on the android device.
> 
> Could you expand on the commands you used to set up the tracing sessions
> and relay, and where each of those commands were run?
> 
> It sounds to me like you might want to be doing something like the
> following:
> 
> (Development device) Start lttng-relayd:
>     - tcp://0.0.0.0:5342 and :5343 will be bound on the development device
>     - tcp://127.0.0.1:5344 will be available for the live reader
> 
> (Development device) Create the reverses for the following ports: 5342
> and 5343
>     - At this point :5342 and :5343 should be available on the android
> device and reach the relayd running on the development device
> 
> (Android device) Start lttng-sessiond
> (Android device) Create session(s): `lttng create -U tcp://localhost/
>     - Using `-U/--set-url`, no relayd will be spawned on the android device
> (Android device) Start session(s)
> 
> This setup should have the relayd running on the development and writing
> the traces there and/or viewing them with a live viewer. On the android
> device, the UST applications (if any) will connect to the local sessiond
> and consumers, which will shuttle the information over :5342 and :5343
> to the developer device via the reverse sockets.
> 
> Please note that I didn't have time to test this, so there might be some
> mistakes. As I requested above, clear details of the exact commands you
> use for the tracing setup would be very helpful to have the clearest
> understanding of what you're doing.
> 
> hope this helps,
> kienan
> 
> On 5/30/24 1:53 AM, Wu, Yannan via lttng-dev wrote:
>> Hihi, there,
>>
>> I am currently working on enabling lttng live mode over android usb adb.
>> Here is the situation, during debugging some network related issues, we
>> dont want the trace data to be streamed via network to cause extra load
>> to the system being profiled. Then we select to connect lttng-relayd
>> with adb via port forwarding so that the data is "forward" to the host.
>>
>> *Here is the set up and the problem:*
>>
>> for the device:  adb reverse tcp:5342 tcp:5342; adb reverse tcp:5343
>> tcp:5343; adb reverse tcp:5344 tcp:5344
>> Then starting up lttng with --live enabled.
>>
>> *What is expected:*
>> lttng start streaming to the localhost.
>> *What is seen: *
>> the lttng-relayd failed to start. For unable binding to the socket.
>>
>> *The cause of this issue: *
>>
>> both adb reverse and lttng relayd need binding to the socket which is
>> conflict with each other.
>>
>>
>> So what I wanna ask is, for embedded system use cases, do we have
>> successful use cases among team that could stream the trace data in live
>> mode to the host with usb based adb? If not, any idea or suggestion to
>> me on how to process forward?
>>
>> Amanda
>>
>>
>>
>>
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev 
> <https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev>
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
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

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

* Re: [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Wu, Yannan via lttng-dev @ 2024-06-04 15:25 UTC (permalink / raw)
  To: Mathieu Desnoyers, Kienan Stewart, lttng-dev@lists.lttng.org


[-- Attachment #1.1: Type: text/plain, Size: 6735 bytes --]

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:

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




________________________________
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sent: Tuesday, June 4, 2024 11:09:40 PM
To: Wu, Yannan; Kienan Stewart; lttng-dev@lists.lttng.org
Subject: RE: [EXTERNAL] [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.



Hi Amanda,

For each of the 4 commands described below, please clarify on
which device they are executed, whether on the Android device
or on the Development device.

Please make sure to follow to the letter the commands proposed
by Kienan: in the correct order, and on the appropriate device.

Thanks,

Mathieu


On 2024-06-02 22:55, Wu, Yannan via lttng-dev wrote:
> Yes. My test command is like below:
>
>  1. lttng-sessiond --d --no-kernel
>  2.
>
>     yannanwu@ue91e96f2951b5c:~/trees/lttng_test_run$ lttng create my-user-space-live-session --live
>     Live session my-user-space-live-session created.
>     Traces will be output to tcp4://127.0.0.1:5342/ [data: 5343]
>     Live timer interval set to 1000000 us
>
>  3. After this, I could "ps -Ax|grep lttng" and see lttng-relayd
>     started. But once I start adb reverse, it will failed for failed
>     binding to socket.
>  4. In the other order, if I start adb reverse first and lttng-create
>     later, lttng-create will not fail but lttng-relayd is not started.
>     By manually start lttng-relayd it will also failed for unable
>     binding to socket.
>
> Amanda
>
> ------------------------------------------------------------------------
> *From:* Kienan Stewart <kstewart@efficios.com>
> *Sent:* Friday, May 31, 2024 3:12:16 AM
> *To:* Wu, Yannan; lttng-dev@lists.lttng.org
> *Subject:* RE: [EXTERNAL] [lttng-dev] [lttng-relayd] is there existing
> cases for relayd to stream over Android usb based adb?
> CAUTION: This email originated from outside of the organization. Do not
> click links or open attachments unless you can confirm the sender and
> know the content is safe.
>
>
>
> Hi Amanda,
>
> I'd like to confirm my understanding the situation.
>
> Android device
>     - Running lttng-sessiond with one or more configured sessions
>
> Development device
>     - Connected to the android device over usb using adb
>
> You want want the data captured on the android device to be streamed via
> the usb connection rather than the other networks on the android device.
>
> Could you expand on the commands you used to set up the tracing sessions
> and relay, and where each of those commands were run?
>
> It sounds to me like you might want to be doing something like the
> following:
>
> (Development device) Start lttng-relayd:
>     - tcp://0.0.0.0:5342 and :5343 will be bound on the development device
>     - tcp://127.0.0.1:5344 will be available for the live reader
>
> (Development device) Create the reverses for the following ports: 5342
> and 5343
>     - At this point :5342 and :5343 should be available on the android
> device and reach the relayd running on the development device
>
> (Android device) Start lttng-sessiond
> (Android device) Create session(s): `lttng create -U tcp://localhost/
>     - Using `-U/--set-url`, no relayd will be spawned on the android device
> (Android device) Start session(s)
>
> This setup should have the relayd running on the development and writing
> the traces there and/or viewing them with a live viewer. On the android
> device, the UST applications (if any) will connect to the local sessiond
> and consumers, which will shuttle the information over :5342 and :5343
> to the developer device via the reverse sockets.
>
> Please note that I didn't have time to test this, so there might be some
> mistakes. As I requested above, clear details of the exact commands you
> use for the tracing setup would be very helpful to have the clearest
> understanding of what you're doing.
>
> hope this helps,
> kienan
>
> On 5/30/24 1:53 AM, Wu, Yannan via lttng-dev wrote:
>> Hihi, there,
>>
>> I am currently working on enabling lttng live mode over android usb adb.
>> Here is the situation, during debugging some network related issues, we
>> dont want the trace data to be streamed via network to cause extra load
>> to the system being profiled. Then we select to connect lttng-relayd
>> with adb via port forwarding so that the data is "forward" to the host.
>>
>> *Here is the set up and the problem:*
>>
>> for the device:  adb reverse tcp:5342 tcp:5342; adb reverse tcp:5343
>> tcp:5343; adb reverse tcp:5344 tcp:5344
>> Then starting up lttng with --live enabled.
>>
>> *What is expected:*
>> lttng start streaming to the localhost.
>> *What is seen: *
>> the lttng-relayd failed to start. For unable binding to the socket.
>>
>> *The cause of this issue: *
>>
>> both adb reverse and lttng relayd need binding to the socket which is
>> conflict with each other.
>>
>>
>> So what I wanna ask is, for embedded system use cases, do we have
>> successful use cases among team that could stream the trace data in live
>> mode to the host with usb based adb? If not, any idea or suggestion to
>> me on how to process forward?
>>
>> Amanda
>>
>>
>>
>>
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> <https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

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


[-- Attachment #1.2: Type: text/html, Size: 9652 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

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

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

* Re: [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?
  2024-06-04 15:25       ` Wu, Yannan via lttng-dev
@ 2024-06-04 15:56         ` Mathieu Desnoyers via lttng-dev
  0 siblings, 0 replies; 7+ messages in thread
From: Mathieu Desnoyers via lttng-dev @ 2024-06-04 15:56 UTC (permalink / raw)
  To: Wu, Yannan, Kienan Stewart, lttng-dev@lists.lttng.org

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

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

end of thread, other threads:[~2024-06-04 15:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-30  5:53 [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb? 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
2024-06-03  3:01   ` Wu, Yannan via lttng-dev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).