<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>The device is a rooted android device</p>
<p><b>On the device:</b></p>
<p><span style="font-size:12pt">lttng-sessiond -d --no-kernel</span></p>
<p>lttng create my-live-session --live</p>
<p>lttng enable-event -u <mu customized event></p>
<p>lttng start</p>
<p><br>
</p>
<p><b>On the host:</b></p>
<p>adb reverse tcp:5343 tcp:5343</p>
<p>The adb reverse will fail for "<span><i>adb.exe: error: cannot bind to socket</i></span>"</p>
<p><br>
</p>
<p>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. <br>
Here is the error message:</p>
<p></p>
<div><i>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)</i></div>
<div><i>Error: Health error occurred in relay_thread_listener</i></div>
<div><i>Error: A file descriptor leak has been detected: 1 tracked file descriptors are still being tracked</i></div>
<br>
<p></p>
<p><br>
</p>
<p><br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Mathieu Desnoyers <mathieu.desnoyers@efficios.com><br>
<b>Sent:</b> Tuesday, June 4, 2024 11:09:40 PM<br>
<b>To:</b> Wu, Yannan; Kienan Stewart; lttng-dev@lists.lttng.org<br>
<b>Subject:</b> RE: [EXTERNAL] [lttng-dev] [lttng-relayd] is there existing cases for relayd to stream over Android usb based adb?</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">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.<br>
<br>
<br>
<br>
Hi Amanda,<br>
<br>
For each of the 4 commands described below, please clarify on<br>
which device they are executed, whether on the Android device<br>
or on the Development device.<br>
<br>
Please make sure to follow to the letter the commands proposed<br>
by Kienan: in the correct order, and on the appropriate device.<br>
<br>
Thanks,<br>
<br>
Mathieu<br>
<br>
<br>
On 2024-06-02 22:55, Wu, Yannan via lttng-dev wrote:<br>
> Yes. My test command is like below:<br>
><br>
>  1. lttng-sessiond --d --no-kernel<br>
>  2.<br>
><br>
>     yannanwu@ue91e96f2951b5c:~/trees/lttng_test_run$ lttng create my-user-space-live-session --live<br>
>     Live session my-user-space-live-session created.<br>
>     Traces will be output to tcp4://127.0.0.1:5342/ [data: 5343]<br>
>     Live timer interval set to 1000000 us<br>
><br>
>  3. After this, I could "ps -Ax|grep lttng" and see lttng-relayd<br>
>     started. But once I start adb reverse, it will failed for failed<br>
>     binding to socket.<br>
>  4. In the other order, if I start adb reverse first and lttng-create<br>
>     later, lttng-create will not fail but lttng-relayd is not started.<br>
>     By manually start lttng-relayd it will also failed for unable<br>
>     binding to socket.<br>
><br>
> Amanda<br>
><br>
> ------------------------------------------------------------------------<br>
> *From:* Kienan Stewart <kstewart@efficios.com><br>
> *Sent:* Friday, May 31, 2024 3:12:16 AM<br>
> *To:* Wu, Yannan; lttng-dev@lists.lttng.org<br>
> *Subject:* RE: [EXTERNAL] [lttng-dev] [lttng-relayd] is there existing<br>
> cases for relayd to stream over Android usb based adb?<br>
> CAUTION: This email originated from outside of the organization. Do not<br>
> click links or open attachments unless you can confirm the sender and<br>
> know the content is safe.<br>
><br>
><br>
><br>
> Hi Amanda,<br>
><br>
> I'd like to confirm my understanding the situation.<br>
><br>
> Android device<br>
>     - Running lttng-sessiond with one or more configured sessions<br>
><br>
> Development device<br>
>     - Connected to the android device over usb using adb<br>
><br>
> You want want the data captured on the android device to be streamed via<br>
> the usb connection rather than the other networks on the android device.<br>
><br>
> Could you expand on the commands you used to set up the tracing sessions<br>
> and relay, and where each of those commands were run?<br>
><br>
> It sounds to me like you might want to be doing something like the<br>
> following:<br>
><br>
> (Development device) Start lttng-relayd:<br>
>     - tcp://0.0.0.0:5342 and :5343 will be bound on the development device<br>
>     - tcp://127.0.0.1:5344 will be available for the live reader<br>
><br>
> (Development device) Create the reverses for the following ports: 5342<br>
> and 5343<br>
>     - At this point :5342 and :5343 should be available on the android<br>
> device and reach the relayd running on the development device<br>
><br>
> (Android device) Start lttng-sessiond<br>
> (Android device) Create session(s): `lttng create -U tcp://localhost/<br>
>     - Using `-U/--set-url`, no relayd will be spawned on the android device<br>
> (Android device) Start session(s)<br>
><br>
> This setup should have the relayd running on the development and writing<br>
> the traces there and/or viewing them with a live viewer. On the android<br>
> device, the UST applications (if any) will connect to the local sessiond<br>
> and consumers, which will shuttle the information over :5342 and :5343<br>
> to the developer device via the reverse sockets.<br>
><br>
> Please note that I didn't have time to test this, so there might be some<br>
> mistakes. As I requested above, clear details of the exact commands you<br>
> use for the tracing setup would be very helpful to have the clearest<br>
> understanding of what you're doing.<br>
><br>
> hope this helps,<br>
> kienan<br>
><br>
> On 5/30/24 1:53 AM, Wu, Yannan via lttng-dev wrote:<br>
>> Hihi, there,<br>
>><br>
>> I am currently working on enabling lttng live mode over android usb adb.<br>
>> Here is the situation, during debugging some network related issues, we<br>
>> dont want the trace data to be streamed via network to cause extra load<br>
>> to the system being profiled. Then we select to connect lttng-relayd<br>
>> with adb via port forwarding so that the data is "forward" to the host.<br>
>><br>
>> *Here is the set up and the problem:*<br>
>><br>
>> for the device:  adb reverse tcp:5342 tcp:5342; adb reverse tcp:5343<br>
>> tcp:5343; adb reverse tcp:5344 tcp:5344<br>
>> Then starting up lttng with --live enabled.<br>
>><br>
>> *What is expected:*<br>
>> lttng start streaming to the localhost.<br>
>> *What is seen: *<br>
>> the lttng-relayd failed to start. For unable binding to the socket.<br>
>><br>
>> *The cause of this issue: *<br>
>><br>
>> both adb reverse and lttng relayd need binding to the socket which is<br>
>> conflict with each other.<br>
>><br>
>><br>
>> So what I wanna ask is, for embedded system use cases, do we have<br>
>> successful use cases among team that could stream the trace data in live<br>
>> mode to the host with usb based adb? If not, any idea or suggestion to<br>
>> me on how to process forward?<br>
>><br>
>> Amanda<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> lttng-dev mailing list<br>
>> lttng-dev@lists.lttng.org<br>
>> <a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
> <<a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a>><br>
><br>
> _______________________________________________<br>
> lttng-dev mailing list<br>
> lttng-dev@lists.lttng.org<br>
> <a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
<br>
--<br>
Mathieu Desnoyers<br>
EfficiOS Inc.<br>
<a href="https://www.efficios.com">https://www.efficios.com</a><br>
<br>
</div>
</span></font>
</body>
</html>