[lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue Jun 4 11:09:40 EDT 2024


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 at 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 at efficios.com>
> *Sent:* Friday, May 31, 2024 3:12:16 AM
> *To:* Wu, Yannan; lttng-dev at 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 at 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 at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

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



More information about the lttng-dev mailing list