<div dir="ltr">Well, I cannot get my hands on a R7 NDK this very moment, but I'm surprised there are no grep hits in the ./platforms/android-XX/arch-arm directory; can you verify that the NDK you have does include an ARM architecture sysroot? That's the the one you should be compiling with, and I believe you'll find the asm/unistd.h header there (as there is no 32/64 bit difference on Android+ARM yet).</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 21, 2013 at 11:29 AM, Ionut D. <span dir="ltr"><<a href="mailto:ionut5001@gmail.com" target="_blank">ionut5001@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im HOEnZb"><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">The problem is that I am trying to build it on ICS with NDK r7 and I tried to build it in the both ways with the ndk and also by creating Android.mk files and it looks like is not working. I searched with grep firstly through NDK and second through bionic and these are the results:</span><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">NDK:</div><div style="font-family:arial,sans-serif;font-size:13px"><div>#grep -r __NR_splice .</div><div>./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define __NR_splice 313</div>
<div>./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define __NR_splice 313</div><div><br></div><div>bionic:</div><div><div>grep -r __NR_splice bionic </div><div>bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice 313</div>
<div>bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice 341</div><div>bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice 313</div><div><br></div><div>Looking through results I see that '__NR_splice' it not in unistd.h and I know this is important.</div>
<div><br></div><div>Ionut</div></div></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles <span dir="ltr"><<a href="mailto:pierre-luc.st-charles@polymtl.ca" target="_blank">pierre-luc.st-charles@polymtl.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>The first error refers to __NR_splice, which should be declared once asm/unistd.h is included; in this case, it is included right above the problematic line (src/common/compat/fcntl.h @ L35). Could you verify that __NR_splice is defined somewhere in that file? If not, it might be a little more problematic.<br>
</div><div><br></div><div>As for the second error, I believe it is also caused by a missing symbol that should be included in asm/signal.h, which is in turn usually included via signal.h itself.</div><div><br>
</div><div>Compiling with the NDK (v8, platform 14) is successful here, and I can find all these missing symbols in the default system includes there. Are you sure you specified the target sysroot when compiling?</div>
<div><br></div><div>-PL</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 21, 2013 at 6:26 AM, Ionut D. <span dir="ltr"><<a href="mailto:ionut5001@gmail.com" target="_blank">ionut5001@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I tried to compile lttng-tools and at compile time exits with the bellow error. I looked in the sources and it looks like for arm this is not implemented. Do you have any idea about how could this be fixed?</div>
<div><br></div><div><br></div><div>In file included from external/lttng-tools/src/common/compat/compat-fcntl.c:19:</div><div>external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: In function 'splice':</div>
<div>external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: error: '__NR_splice' undeclared (first use in this function)</div><div>external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: error: (Each undeclared identifier is reported only once</div>
<div>external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: error: for each function it appears in.)</div><div>In file included from external/lttng-tools/src/common/compat/compat-fcntl.c:19:</div><div>
external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: warning: "POSIX_FADV_DONTNEED" redefined</div><div>In file included from external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47,</div>
<div> from external/lttng-tools/src/common/compat/compat-fcntl.c:19:</div><div>bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is the location of the previous definition</div><div>In file included from bionic/libc/include/sys/select.h:34,</div>
<div> from bionic/libc/include/unistd.h:34,</div><div> from external/lttng-tools/src/common/compat/compat-fcntl.c:20:</div><div>external/lttng-tools/src/common/compat/signal.h: At top level:</div>
<div>external/lttng-tools/src/common/compat/signal.h:27: error: expected ';', ',' or ')' before '*' token</div><div>external/lttng-tools/src/common/compat/signal.h:28: error: expected ';', ',' or ')' before '*' token</div>
<div>external/lttng-tools/src/common/compat/signal.h:29: error: expected ';', ',' or ')' before '*' token</div><div>In file included from bionic/libc/include/unistd.h:34,</div><div> from external/lttng-tools/src/common/compat/compat-fcntl.c:20:</div>
<div>bionic/libc/include/sys/select.h:42: error: expected ';', ',' or ')' before '*' token</div><div><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Sat, May 18, 2013 at 10:21 AM, Ionut D. <span dir="ltr"><<a href="mailto:ionut5001@gmail.com" target="_blank">ionut5001@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Great informations! I will post back the results.</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles <span dir="ltr"><<a href="mailto:pierre-luc.st-charles@polymtl.ca" target="_blank">pierre-luc.st-charles@polymtl.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p dir="ltr">Alright, small update for all following a quick (non-mailing-list) exchange:</p>
<p dir="ltr">We did successfully complete a kernel-tracing port of LTTng for Android (somewhat old news), but we are still working on bringing our patches back up to date with the current version of the different projects (soon-ish still applies here, we're talking days). So far, we dwelled a little bit in LTTng-UST, but haven't done much changes, so userspace tracing is still not functional. Device that ran kernel traces successfully so far were the Nexus S and the Nexus 7 (example Nexus S trace available <a href="https://drive.google.com/folderview?id=0B55Ba7lWTLh4U0hGeTQ4bmRYRjQ&usp=sharing" target="_blank">here</a>; still not perfect).</p>
<p dir="ltr">Basically, we cross-compiled everything via the Android NDK (no Android makefiles involved here), and pushed all required bins to a device without having to flash it (unless the default kernel config didn't allow tracing -- then we'd have to flash). This approach is not compatible with the official Android build system (meaning we wouldn't be able to add it to Android like this), but we might eventually get working on the damned Android makefiles (they're extremely painful to write, especially since LTTng uses Autotools).</p>
<p dir="ltr">The librairies required by LTTng that are not already included in a regular Android build (uuid/popt) can actually be found/compiled from the official repo, in its 'external' directory (see oprofile and e2fsprog -- from memory). That might not be the easiest way to get them (full repo download is BIG), but compatibility is assured, and you can skip a full build by simply making those two individually for your device (if that's all you need).</p>
<p dir="ltr">You'll also need your device to be rooted to use LTTng at all; then, most initializations are done via scripts (we'll also provide those with our patches). We still had some trouble automating everything via daemons, so we always ran the sessiond locally (with success).</p>
<p>Major problems we encountered so far were missing posix functions, and sysv shared memory. Basically, Android relies on Bionic for its system calls and other low-level functions, and since Bionic is pretty 'lightweight', they trimmed most of the fat out for performance. We had to make some more-or-less sketchy replacements here and there, but everything seems to be working decently now.</p>
<p>So, simple 'how do I put LTTng on Android' workflow would be this:</p><p> - Compile modules (using NDK) against device's kernel, making sure its config is appropriate, ship them over via ADB</p>
<p> - Compile required external libraries (using repo build system) for the device, ship them over via ADB</p><p> - Patch up LTTng-* (soon-ish! I could send you the outdated patches right now if you're interested though, they might be a month behind or so on the current trunks)</p>
<p> - Cross-compile LTTng-* for the device (using NDK), ship binaries over via ADB</p><p>Then, on the device, start up the sessiond manually & start tracing.</p><p><br></p><p>I think I went over everything, but if there's a part that's still cloudy, don't hesitate.</p>
<p><br></p><p>-PL</p><p> </p>
<div class="gmail_quote">On May 17, 2013 1:32 AM, "Ionut D." <<a href="mailto:ionut5001@gmail.com" target="_blank">ionut5001@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div>Hello all,</div><div><br></div><div>Recently I started to integrate LTTNG in Android ICS by compiling each package, each dependency, by using the Android build system. It is a lot of work because I met different problems and to be sincere, I do not know if at the end will work and I do not know how much I will need to modify the sources in order to work.<br>
</div><br>My questions are about this integration. I mention that I read a lot of discussions about this on Internet, on this mailing list, but the things are still not very clear for me.<br><br>It is ok? what I am trying to do ? to integrate and build by using the Android build system.<br>
Could you give me some guidelines, indications about how I should proceed, maybe a tutorial or maybe some android make files/patches that would help me to see how the job must be done and if I am doing it right ?<br><br>
Until now I managed to build lttng-modules, liburcu, libuuid from util-linux and configure lttng-ust by using the android toolchain for arm. I got a lot of errors but until now I managed to configure/make these packages.<br>
<br>I mention that I am trying to build lttng 2.x on ICS 4.0.3.<br><br><div>Would be great if you will give me a tutorial about how to do it.</div><div><br></div><div>Ionut</div></div>
<br>_______________________________________________<br>
lttng-dev mailing list<br>
<a href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a><br>
<a href="http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
<br></blockquote></div>
</div>
</blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>