From andreb at stud.fh-dortmund.de Wed May 1 04:58:01 2013 From: andreb at stud.fh-dortmund.de (Andre Bette) Date: Wed, 01 May 2013 10:58:01 +0200 Subject: [lttng-dev] Using the additional Eclipse Kernel Trace Plugin Views (Control flow, Resources) In-Reply-To: <51800F67.9040407@voxpopuli.im> References: <517F8D02.4090202@stud.fh-dortmund.de> <518004F6.5040202@ericsson.com> <51800F67.9040407@voxpopuli.im> Message-ID: <5180D919.1020208@stud.fh-dortmund.de> Hi Alexandre and Matthew, Thank you both very much for the detailed answer. If I have more questions about some Javacode I will ask later . Best Regards, Andre PS: Sorry for the doublepost Am 30.04.2013 20:37, schrieb Alexandre Montplaisir: > On 13-04-30 01:52 PM, Matthew Khouzam wrote: >> Hi Andre, >> This question seems familiar, I will paste an answer from earlier. >> On 13-04-30 05:21 AM, Andre Bette wrote: >>> Hi to everyone, >>> in my project I am tracing a embedded system with a non linux OS. >>> Output format is CTF. I really like the two extra views in the Eclipse >>> Kernel Trace Visualization (Control flow, Resources). >>> >>> Is there a simple way to use this two views with an non linux trace ? >>> Is there any documentation about the Linux kernel trace format( the >>> extra info added into the CTF format) or how the >>> data(e.g. prozesses) is processed in the Eclipse Kernel Trace Plugin >>> (The idea is to use a "fake" linux trace to use the two extra views )? >>> >> I will give a short answer that I am sure Alexandre Montplaisir has expanded on earlier is YES! > Yeah my first reply bounced, but you can read it here: > http://lists.lttng.org/pipermail/lttng-dev/2013-April/020165.html > > Cheers, > Alex > >> You need to make a state system with a "state system input" that will emulate the directory structure of the kernel state system. >> >> It's not EXTREMELY hard, but I think it will get significantly easier in a couple of months. >> Great to hear you like the eclipse viewer, fan mail is always appreciated, especially in duplicate! >> >> Matthew >> >>> Best Regards, >>> Andre >>> >>> _______________________________________________ >>> lttng-dev mailing list >>> lttng-dev at lists.lttng.org >>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From AMITM at il.ibm.com Wed May 1 09:11:05 2013 From: AMITM at il.ibm.com (Amit Margalit) Date: Wed, 1 May 2013 16:11:05 +0300 Subject: [lttng-dev] Is there a way to make LTTng use the same subbuffers for multiple processes? In-Reply-To: <20130429162752.GB17859@Krystal> References: <1871619348.1882721367199149384.JavaMail.root@srv11.zimbra.polymtl.ca> <20130429162752.GB17859@Krystal> Message-ID: This (current) behavior you describe is very suitable for our needs. Is there an intention to insert a hook into setuid() in the future? If yes - will the existing behavior remain as a default and the hook be used only if I choose to use it? Thanks, Amit Margalit IBM XIV - Storage Reinvented XIV-NAS Development Team Tel. 03-689-7774 Fax. 03-689-7230 From: Mathieu Desnoyers To: Amit Margalit/Israel/IBM at IBMIL Cc: Michel Dagenais , lttng-dev at lists.lttng.org Date: 04/29/2013 07:27 PM Subject: Re: [lttng-dev] Is there a way to make LTTng use the same subbuffers for multiple processes? * Amit Margalit (AMITM at il.ibm.com) wrote: > Another 2.2 question - > > What if I have a single process, that forks, and each child process then > changes its own UID. Will the tracing continue on the parent UID buffers? Yes, we indeed currently keep the user ID that was effective at process creation or last exec() encountered, because we don't have hooks in libc's setuid() at the moment. Thanks, Mathieu > > Thanks, > > Amit Margalit > IBM XIV - Storage Reinvented > XIV-NAS Development Team > Tel. 03-689-7774 > Fax. 03-689-7230 > > > > From: Michel Dagenais > To: Amit Margalit/Israel/IBM at IBMIL > Cc: lttng-dev at lists.lttng.org > Date: 04/29/2013 04:32 AM > Subject: Re: [lttng-dev] Is there a way to make LTTng use the same > subbuffers for multiple processes? > > > > > > Our system is a 12-core x86 (6-core + HT). If I take 4 subbuffers of > 1MB, this means 4MB per > > process. As the number of processes rises, this becomes prohibitive. > > For example, we may need to support > 500 sub-processes ==> 500 * 4MB = > 2GB - > > which is a bit too much. Is there a way to tell LTTng to share the > sub-buffers with forked processes? > > This is the number one feature listed in the changelog for lttng-tools and > UST for version 2.2. The first release candidate is out so you can try the > feature, and the final 2.2 version should not be too far away. > > http://lttng.org/lttng-tools-220-rc1 > - Add UST per UID buffers support > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From liljegren.mats2 at gmail.com Thu May 2 03:40:17 2013 From: liljegren.mats2 at gmail.com (Mats Liljegren) Date: Thu, 2 May 2013 09:40:17 +0200 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: <20130430144323.GB31980@Krystal> References: <20130426132639.GA1468@Krystal> <20130426151444.GA2260@Krystal> <20130426153819.GA3026@Krystal> <20130426161439.GA5547@Krystal> <20130430144323.GB31980@Krystal> Message-ID: >> --buffers-global Use shared buffer for the whole system (-k only) > > This option would be clearer as "--buffers-per-cpu" maybe ? This makes me even more confused... The name "buffers-global" is very clear to me. Opposites would be buffers private for a CPU, for a UID, and so on. Is the option "--buffers-global" meant to be an opposite of "--buffers-uid" and "--buffers-pid"? This would seems strange since those two are only for user space tracing while "--buffers-global" is for kernel tracing. By the way, isn't "--buffers-per-cpu" default? Oh well... But the real confusion lies in the fact that I cannot see the option being used for anything. It sets the file local variable opt_buffers_global, and is used for a sanity check. But I can't see it being used for anything else. Have I missed something here? > >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> -C, --tracefile-size SIZE >> Maximum size of of each tracefile within a >> stream (in bytes). >> -W, --tracefile-count COUNT >> Used in conjunction with -C option, this >> will limit the number >> of files created to the specified count. >> >> I look in src/bin/lttng/commands/enable_channels.c, the long option >> array will point to opt_buffer_global. The only use for this file >> private variable is for a single sanity check. I cannot see any other >> use of it. Have I missed something here? >> >> But in this file, function enable_channel(), I see: >> >> dom.buf_type = LTTNG_BUFFER_GLOBAL; >> >> This is executed for the kernel case. But my buffers are still >> allocated per-cpu. What is going on? Where did this configuration go? >> What does it do? >> >> If I take this from the other end, I'd like to use the line: >> .alloc = RING_BUFFER_ALLOC_GLOBAL >> found in >> lttng-ring-buffer-metadata-client.h >> How do I make this happen? > > lttng-sessiond never creates buffers shared between CPUs for now (except > for metadata). The "--buffers-global" option is misleading and should > possibly be renamed. So it is lttng-sessiond that dictates the allocation type? I'll take a closer look at it. /Mats From jp_ikaheimonen at mentor.com Thu May 2 07:46:08 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:46:08 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 00/28] Add support for MinGW32 Message-ID: <009B25148989C6458484484699278506E537E826@EU-MBX-01.mgc.mentorg.com> The following set of patches make it possible to compile babeltrace with MinGW32. The babeltrace source has been reorganized. There is now a new compat source directory, along with a include/babeltrace/compat header directory. These now isolate the system-specific pieces of code. The first three patches (01 - 03) deal with the new compat directories, moving current code around. No new functionality is added in these patches. Patches 06 - 12, 14 - 22, and 25-27 add MinGW implementations of library functions that are missing in MinGW. Patches 04 and 24 make sure correct libraries and header files are used. Patch 05 updates .gitignore with Windows *.exe files. Patch 23 overcomes several problems in MinGW. With MinGW, openat() does not work at all, and there is no easy implementation available. So instead of openat(), in MinGW, we open the file using the full qualified path name. This patch also deals with problems with directory handles. Patch 28 adds a binary flag for the fdopen() command as is required for Windows. Thank you, JP Ikaheimonen | SW Development Engineer http://go.mentor.com/sourceryanalyzer Mentor Embedded(tm) | Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jp_ikaheimonen at mentor.com Thu May 2 07:46:35 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:46:35 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 01/28] Move uuid.h to compat directory Message-ID: <009B25148989C6458484484699278506E537E82D@EU-MBX-01.mgc.mentorg.com> Move build-specific files to a compat directory. UUID header file uuid.h is now moved from babeltrace/uuid to babeltrace/compat/uuid.h . --- converter/babeltrace-log.c | 2 +- formats/ctf/ctf.c | 2 +- .../ctf/metadata/ctf-visitor-generate-io-struct.c | 2 +- include/Makefile.am | 2 +- include/babeltrace/compat/uuid.h | 129 +++++++++++++++++++++ include/babeltrace/ctf-ir/metadata.h | 2 +- include/babeltrace/uuid.h | 129 --------------------- 7 files changed, 134 insertions(+), 134 deletions(-) create mode 100644 include/babeltrace/compat/uuid.h delete mode 100644 include/babeltrace/uuid.h diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c index 563a90f..52a2fe1 100644 --- a/converter/babeltrace-log.c +++ b/converter/babeltrace-log.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include #define USEC_PER_SEC 1000000UL diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 58f937d..c424e36 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c index 0002fe4..23c4f2f 100644 --- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c +++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include "ctf-scanner.h" diff --git a/include/Makefile.am b/include/Makefile.am index 6a65b5c..4617ee2 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -31,6 +31,6 @@ noinst_HEADERS = \ babeltrace/ctf/types.h \ babeltrace/ctf/callbacks-internal.h \ babeltrace/trace-handle-internal.h \ - babeltrace/uuid.h \ + babeltrace/compat/uuid.h \ babeltrace/endian.h \ babeltrace/mmap-align.h diff --git a/include/babeltrace/compat/uuid.h b/include/babeltrace/compat/uuid.h new file mode 100644 index 0000000..2ce7467 --- /dev/null +++ b/include/babeltrace/compat/uuid.h @@ -0,0 +1,129 @@ +#ifndef _BABELTRACE_UUID_H +#define _BABELTRACE_UUID_H + +/* + * babeltrace/uuid.h + * + * Copyright (C) 2011 Mathieu Desnoyers + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include + +/* Includes final \0. */ +#define BABELTRACE_UUID_STR_LEN 37 +#define BABELTRACE_UUID_LEN 16 + +#ifdef BABELTRACE_HAVE_LIBUUID +#include + +static inline +int babeltrace_uuid_generate(unsigned char *uuid_out) +{ + uuid_generate(uuid_out); + return 0; +} + +static inline +int babeltrace_uuid_unparse(const unsigned char *uuid_in, char *str_out) +{ + uuid_unparse(uuid_in, str_out); + return 0; +} + +static inline +int babeltrace_uuid_parse(const char *str_in, unsigned char *uuid_out) +{ + return uuid_parse(str_in, uuid_out); +} + +static inline +int babeltrace_uuid_compare(const unsigned char *uuid_a, + const unsigned char *uuid_b) +{ + return uuid_compare(uuid_a, uuid_b); +} + +#elif defined(BABELTRACE_HAVE_LIBC_UUID) +#include +#include +#include +#include + +static inline +int babeltrace_uuid_generate(unsigned char *uuid_out) +{ + uint32_t status; + + uuid_create((uuid_t *) uuid_out, &status); + if (status == uuid_s_ok) + return 0; + else + return -1; +} + +static inline +int babeltrace_uuid_unparse(const unsigned char *uuid_in, char *str_out) +{ + uint32_t status; + char *alloc_str; + int ret; + + uuid_to_string((uuid_t *) uuid_in, &alloc_str, &status); + if (status == uuid_s_ok) { + strcpy(str_out, alloc_str); + ret = 0; + } else { + ret = -1; + } + free(alloc_str); + return ret; +} + +static inline +int babeltrace_uuid_parse(const char *str_in, unsigned char *uuid_out) +{ + uint32_t status; + + uuid_from_string(str_in, (uuid_t *) uuid_out, &status); + if (status == uuid_s_ok) + return 0; + else + return -1; +} + +static inline +int babeltrace_uuid_compare(const unsigned char *uuid_a, + const unsigned char *uuid_b) +{ + uint32_t status; + + uuid_compare((uuid_t *) uuid_a, (uuid_t *) uuid_b, &status); + if (status == uuid_s_ok) + return 0; + else + return -1; +} + +#else +#error "Babeltrace needs to have a UUID generator configured." +#endif + +#endif /* _BABELTRACE_UUID_H */ diff --git a/include/babeltrace/ctf-ir/metadata.h b/include/babeltrace/ctf-ir/metadata.h index 3d684fb..5e92984 100644 --- a/include/babeltrace/ctf-ir/metadata.h +++ b/include/babeltrace/ctf-ir/metadata.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/include/babeltrace/uuid.h b/include/babeltrace/uuid.h deleted file mode 100644 index 2ce7467..0000000 --- a/include/babeltrace/uuid.h +++ /dev/null @@ -1,129 +0,0 @@ -#ifndef _BABELTRACE_UUID_H -#define _BABELTRACE_UUID_H - -/* - * babeltrace/uuid.h - * - * Copyright (C) 2011 Mathieu Desnoyers - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include - -/* Includes final \0. */ -#define BABELTRACE_UUID_STR_LEN 37 -#define BABELTRACE_UUID_LEN 16 - -#ifdef BABELTRACE_HAVE_LIBUUID -#include - -static inline -int babeltrace_uuid_generate(unsigned char *uuid_out) -{ - uuid_generate(uuid_out); - return 0; -} - -static inline -int babeltrace_uuid_unparse(const unsigned char *uuid_in, char *str_out) -{ - uuid_unparse(uuid_in, str_out); - return 0; -} - -static inline -int babeltrace_uuid_parse(const char *str_in, unsigned char *uuid_out) -{ - return uuid_parse(str_in, uuid_out); -} - -static inline -int babeltrace_uuid_compare(const unsigned char *uuid_a, - const unsigned char *uuid_b) -{ - return uuid_compare(uuid_a, uuid_b); -} - -#elif defined(BABELTRACE_HAVE_LIBC_UUID) -#include -#include -#include -#include - -static inline -int babeltrace_uuid_generate(unsigned char *uuid_out) -{ - uint32_t status; - - uuid_create((uuid_t *) uuid_out, &status); - if (status == uuid_s_ok) - return 0; - else - return -1; -} - -static inline -int babeltrace_uuid_unparse(const unsigned char *uuid_in, char *str_out) -{ - uint32_t status; - char *alloc_str; - int ret; - - uuid_to_string((uuid_t *) uuid_in, &alloc_str, &status); - if (status == uuid_s_ok) { - strcpy(str_out, alloc_str); - ret = 0; - } else { - ret = -1; - } - free(alloc_str); - return ret; -} - -static inline -int babeltrace_uuid_parse(const char *str_in, unsigned char *uuid_out) -{ - uint32_t status; - - uuid_from_string(str_in, (uuid_t *) uuid_out, &status); - if (status == uuid_s_ok) - return 0; - else - return -1; -} - -static inline -int babeltrace_uuid_compare(const unsigned char *uuid_a, - const unsigned char *uuid_b) -{ - uint32_t status; - - uuid_compare((uuid_t *) uuid_a, (uuid_t *) uuid_b, &status); - if (status == uuid_s_ok) - return 0; - else - return -1; -} - -#else -#error "Babeltrace needs to have a UUID generator configured." -#endif - -#endif /* _BABELTRACE_UUID_H */ -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:46:42 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:46:42 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 02/28] Move memstream.h to compat directory Message-ID: <009B25148989C6458484484699278506E537E83D@EU-MBX-01.mgc.mentorg.com> Move build-specific files to a compat directory. Memstream header file is moved to babeltrace/compat/memstream.h . --- formats/ctf/Makefile.am | 3 +- formats/ctf/ctf.c | 2 +- formats/ctf/memstream.h | 236 ---------------------------------- include/Makefile.am | 1 + include/babeltrace/compat/memstream.h | 236 ++++++++++++++++++++++++++++++++++ 5 files changed, 239 insertions(+), 239 deletions(-) delete mode 100644 formats/ctf/memstream.h create mode 100644 include/babeltrace/compat/memstream.h diff --git a/formats/ctf/Makefile.am b/formats/ctf/Makefile.am index d803b69..6dcc1bb 100644 --- a/formats/ctf/Makefile.am +++ b/formats/ctf/Makefile.am @@ -9,8 +9,7 @@ libbabeltrace_ctf_la_SOURCES = \ events.c \ iterator.c \ callbacks.c \ - events-private.h \ - memstream.h + events-private.h # Request that the linker keeps all static libraries objects. libbabeltrace_ctf_la_LDFLAGS = \ diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index c424e36..d77c93a 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -51,7 +51,7 @@ #include "metadata/ctf-parser.h" #include "metadata/ctf-ast.h" #include "events-private.h" -#include "memstream.h" +#include "babeltrace/compat/memstream.h" #define LOG2_CHAR_BIT 3 diff --git a/formats/ctf/memstream.h b/formats/ctf/memstream.h deleted file mode 100644 index d2a96cb..0000000 --- a/formats/ctf/memstream.h +++ /dev/null @@ -1,236 +0,0 @@ -#ifndef _BABELTRACE_FORMAT_CTF_MEMSTREAM_H -#define _BABELTRACE_FORMAT_CTF_MEMSTREAM_H - -/* - * format/ctf/memstream.h - * - * Copyright 2012 (c) - Mathieu Desnoyers - * - * memstream compatibility layer. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#define _GNU_SOURCE -#include - -#ifdef BABELTRACE_HAVE_FMEMOPEN -#include - -static inline -FILE *babeltrace_fmemopen(void *buf, size_t size, const char *mode) -{ - return fmemopen(buf, size, mode); -} - -#else /* BABELTRACE_HAVE_FMEMOPEN */ - -#include -#include - -/* - * Fallback for systems which don't have fmemopen. Copy buffer to a - * temporary file, and use that file as FILE * input. - */ -static inline -FILE *babeltrace_fmemopen(void *buf, size_t size, const char *mode) -{ - char tmpname[PATH_MAX]; - size_t len; - FILE *fp; - int ret; - - /* - * Support reading only. - */ - if (strcmp(mode, "rb") != 0) { - return NULL; - } - strncpy(tmpname, "/tmp/babeltrace-tmp-XXXXXX", PATH_MAX); - ret = mkstemp(tmpname); - if (ret < 0) { - return NULL; - } - /* - * We need to write to the file. - */ - fp = fdopen(ret, "w+"); - if (!fp) { - goto error_unlink; - } - /* Copy the entire buffer to the file */ - len = fwrite(buf, sizeof(char), size, fp); - if (len != size) { - goto error_close; - } - ret = fseek(fp, 0L, SEEK_SET); - if (ret < 0) { - perror("fseek"); - goto error_close; - } - /* We keep the handle open, but can unlink the file on the VFS. */ - ret = unlink(tmpname); - if (ret < 0) { - perror("unlink"); - } - return fp; - -error_close: - ret = fclose(fp); - if (ret < 0) { - perror("close"); - } -error_unlink: - ret = unlink(tmpname); - if (ret < 0) { - perror("unlink"); - } - return NULL; -} - -#endif /* BABELTRACE_HAVE_FMEMOPEN */ - -#ifdef BABELTRACE_HAVE_OPEN_MEMSTREAM - -#include - -static inline -FILE *babeltrace_open_memstream(char **ptr, size_t *sizeloc) -{ - return open_memstream(ptr, sizeloc); -} - -static inline -int babeltrace_close_memstream(char **buf, size_t *size, FILE *fp) -{ - return fclose(fp); -} - -#else /* BABELTRACE_HAVE_OPEN_MEMSTREAM */ - -#include -#include - -/* - * Fallback for systems which don't have open_memstream. Create FILE * - * with babeltrace_open_memstream, but require call to - * babeltrace_close_memstream to flush all data written to the FILE * - * into the buffer (which we allocate). - */ -static inline -FILE *babeltrace_open_memstream(char **ptr, size_t *sizeloc) -{ - char tmpname[PATH_MAX]; - int ret; - FILE *fp; - - strncpy(tmpname, "/tmp/babeltrace-tmp-XXXXXX", PATH_MAX); - ret = mkstemp(tmpname); - if (ret < 0) { - return NULL; - } - fp = fdopen(ret, "w+"); - if (!fp) { - goto error_unlink; - } - /* - * babeltrace_flush_memstream will update the buffer content - * with read from fp. No need to keep the file around, just the - * handle. - */ - ret = unlink(tmpname); - if (ret < 0) { - perror("unlink"); - } - return fp; - -error_unlink: - ret = unlink(tmpname); - if (ret < 0) { - perror("unlink"); - } - return NULL; -} - -/* Get file size, allocate buffer, copy. */ -static inline -int babeltrace_close_memstream(char **buf, size_t *size, FILE *fp) -{ - size_t len, n; - long pos; - int ret; - - ret = fflush(fp); - if (ret < 0) { - perror("fflush"); - return ret; - } - ret = fseek(fp, 0L, SEEK_END); - if (ret < 0) { - perror("fseek"); - return ret; - } - pos = ftell(fp); - if (ret < 0) { - perror("ftell"); - return ret; - } - *size = pos; - /* add final \0 */ - *buf = calloc(pos + 1, sizeof(char)); - if (!*buf) { - return -ENOMEM; - } - ret = fseek(fp, 0L, SEEK_SET); - if (ret < 0) { - perror("fseek"); - goto error_free; - } - /* Copy the entire file into the buffer */ - n = 0; - clearerr(fp); - while (!feof(fp) && !ferror(fp) && (*size - n > 0)) { - len = fread(*buf, sizeof(char), *size - n, fp); - n += len; - } - if (n != *size) { - ret = -1; - goto error_close; - } - ret = fclose(fp); - if (ret < 0) { - perror("fclose"); - return ret; - } - return 0; - -error_close: - ret = fclose(fp); - if (ret < 0) { - perror("fclose"); - } -error_free: - free(*buf); - *buf = NULL; - return ret; -} - -#endif /* BABELTRACE_HAVE_OPEN_MEMSTREAM */ - -#endif /* _BABELTRACE_FORMAT_CTF_MEMSTREAM_H */ diff --git a/include/Makefile.am b/include/Makefile.am index 4617ee2..eee2ac1 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -32,5 +32,6 @@ noinst_HEADERS = \ babeltrace/ctf/callbacks-internal.h \ babeltrace/trace-handle-internal.h \ babeltrace/compat/uuid.h \ + babeltrace/compat/memstream.h \ babeltrace/endian.h \ babeltrace/mmap-align.h diff --git a/include/babeltrace/compat/memstream.h b/include/babeltrace/compat/memstream.h new file mode 100644 index 0000000..d2a96cb --- /dev/null +++ b/include/babeltrace/compat/memstream.h @@ -0,0 +1,236 @@ +#ifndef _BABELTRACE_FORMAT_CTF_MEMSTREAM_H +#define _BABELTRACE_FORMAT_CTF_MEMSTREAM_H + +/* + * format/ctf/memstream.h + * + * Copyright 2012 (c) - Mathieu Desnoyers + * + * memstream compatibility layer. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#define _GNU_SOURCE +#include + +#ifdef BABELTRACE_HAVE_FMEMOPEN +#include + +static inline +FILE *babeltrace_fmemopen(void *buf, size_t size, const char *mode) +{ + return fmemopen(buf, size, mode); +} + +#else /* BABELTRACE_HAVE_FMEMOPEN */ + +#include +#include + +/* + * Fallback for systems which don't have fmemopen. Copy buffer to a + * temporary file, and use that file as FILE * input. + */ +static inline +FILE *babeltrace_fmemopen(void *buf, size_t size, const char *mode) +{ + char tmpname[PATH_MAX]; + size_t len; + FILE *fp; + int ret; + + /* + * Support reading only. + */ + if (strcmp(mode, "rb") != 0) { + return NULL; + } + strncpy(tmpname, "/tmp/babeltrace-tmp-XXXXXX", PATH_MAX); + ret = mkstemp(tmpname); + if (ret < 0) { + return NULL; + } + /* + * We need to write to the file. + */ + fp = fdopen(ret, "w+"); + if (!fp) { + goto error_unlink; + } + /* Copy the entire buffer to the file */ + len = fwrite(buf, sizeof(char), size, fp); + if (len != size) { + goto error_close; + } + ret = fseek(fp, 0L, SEEK_SET); + if (ret < 0) { + perror("fseek"); + goto error_close; + } + /* We keep the handle open, but can unlink the file on the VFS. */ + ret = unlink(tmpname); + if (ret < 0) { + perror("unlink"); + } + return fp; + +error_close: + ret = fclose(fp); + if (ret < 0) { + perror("close"); + } +error_unlink: + ret = unlink(tmpname); + if (ret < 0) { + perror("unlink"); + } + return NULL; +} + +#endif /* BABELTRACE_HAVE_FMEMOPEN */ + +#ifdef BABELTRACE_HAVE_OPEN_MEMSTREAM + +#include + +static inline +FILE *babeltrace_open_memstream(char **ptr, size_t *sizeloc) +{ + return open_memstream(ptr, sizeloc); +} + +static inline +int babeltrace_close_memstream(char **buf, size_t *size, FILE *fp) +{ + return fclose(fp); +} + +#else /* BABELTRACE_HAVE_OPEN_MEMSTREAM */ + +#include +#include + +/* + * Fallback for systems which don't have open_memstream. Create FILE * + * with babeltrace_open_memstream, but require call to + * babeltrace_close_memstream to flush all data written to the FILE * + * into the buffer (which we allocate). + */ +static inline +FILE *babeltrace_open_memstream(char **ptr, size_t *sizeloc) +{ + char tmpname[PATH_MAX]; + int ret; + FILE *fp; + + strncpy(tmpname, "/tmp/babeltrace-tmp-XXXXXX", PATH_MAX); + ret = mkstemp(tmpname); + if (ret < 0) { + return NULL; + } + fp = fdopen(ret, "w+"); + if (!fp) { + goto error_unlink; + } + /* + * babeltrace_flush_memstream will update the buffer content + * with read from fp. No need to keep the file around, just the + * handle. + */ + ret = unlink(tmpname); + if (ret < 0) { + perror("unlink"); + } + return fp; + +error_unlink: + ret = unlink(tmpname); + if (ret < 0) { + perror("unlink"); + } + return NULL; +} + +/* Get file size, allocate buffer, copy. */ +static inline +int babeltrace_close_memstream(char **buf, size_t *size, FILE *fp) +{ + size_t len, n; + long pos; + int ret; + + ret = fflush(fp); + if (ret < 0) { + perror("fflush"); + return ret; + } + ret = fseek(fp, 0L, SEEK_END); + if (ret < 0) { + perror("fseek"); + return ret; + } + pos = ftell(fp); + if (ret < 0) { + perror("ftell"); + return ret; + } + *size = pos; + /* add final \0 */ + *buf = calloc(pos + 1, sizeof(char)); + if (!*buf) { + return -ENOMEM; + } + ret = fseek(fp, 0L, SEEK_SET); + if (ret < 0) { + perror("fseek"); + goto error_free; + } + /* Copy the entire file into the buffer */ + n = 0; + clearerr(fp); + while (!feof(fp) && !ferror(fp) && (*size - n > 0)) { + len = fread(*buf, sizeof(char), *size - n, fp); + n += len; + } + if (n != *size) { + ret = -1; + goto error_close; + } + ret = fclose(fp); + if (ret < 0) { + perror("fclose"); + return ret; + } + return 0; + +error_close: + ret = fclose(fp); + if (ret < 0) { + perror("fclose"); + } +error_free: + free(*buf); + *buf = NULL; + return ret; +} + +#endif /* BABELTRACE_HAVE_OPEN_MEMSTREAM */ + +#endif /* _BABELTRACE_FORMAT_CTF_MEMSTREAM_H */ -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:46:49 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:46:49 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 03/28] Move build-specific strerror_r to compat directory Message-ID: <009B25148989C6458484484699278506E537E844@EU-MBX-01.mgc.mentorg.com> Add a new source directory 'compat'. In that directory, add a new file 'strlib.c'. In that file, add a new function compat_strerror_r that encapsulates the build-specific differences of strerror_r. Where strerror_r is used, now use compat_strerror_r. --- Makefile.am | 2 +- compat/Makefile.am | 10 ++++++++++ compat/compat_strlib.c | 17 +++++++++++++++++ configure.ac | 1 + include/babeltrace/babeltrace-internal.h | 32 +++----------------------------- include/babeltrace/compat/string.h | 9 +++++++++ lib/Makefile.am | 3 ++- 7 files changed, 43 insertions(+), 31 deletions(-) create mode 100644 compat/Makefile.am create mode 100644 compat/compat_strlib.c create mode 100644 include/babeltrace/compat/string.h diff --git a/Makefile.am b/Makefile.am index b25b58f..cdfad5a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = include types lib formats converter tests doc extras +SUBDIRS = include types compat lib formats converter tests doc extras dist_doc_DATA = ChangeLog LICENSE mit-license.txt gpl-2.0.txt \ std-ext-lib.txt diff --git a/compat/Makefile.am b/compat/Makefile.am new file mode 100644 index 0000000..d756aa7 --- /dev/null +++ b/compat/Makefile.am @@ -0,0 +1,10 @@ +AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include + +lib_LTLIBRARIES = libcompat.la + +libcompat_la_SOURCES = \ + compat_strlib.c + +libcompat_la_LDFLAGS = \ + -Wl,--no-as-needed + diff --git a/compat/compat_strlib.c b/compat/compat_strlib.c new file mode 100644 index 0000000..9aabb07 --- /dev/null +++ b/compat/compat_strlib.c @@ -0,0 +1,17 @@ +#include + +int compat_strerror_r(int errnum, char *buf, size_t buflen) +{ +#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) +/* XSI-compliant strerror_r */ + return strerror_r(errnum, buf, buflen); +#else +/* GNU-compliant strerror_r */ + char * retbuf; + retbuf = strerror_r(errnum, buf, buflen); + if (retbuf != buf) + strcpy(buf, retbuf); + return 0; +#endif +} + diff --git a/configure.ac b/configure.ac index 83822d6..29366da 100644 --- a/configure.ac +++ b/configure.ac @@ -93,6 +93,7 @@ AC_SUBST(babeltracectfincludedir) AC_CONFIG_FILES([ Makefile types/Makefile + compat/Makefile formats/Makefile formats/ctf/Makefile formats/ctf/types/Makefile diff --git a/include/babeltrace/babeltrace-internal.h b/include/babeltrace/babeltrace-internal.h index 22866bc..35382de 100644 --- a/include/babeltrace/babeltrace-internal.h +++ b/include/babeltrace/babeltrace-internal.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #define PERROR_BUFLEN 200 @@ -81,46 +81,20 @@ extern int babeltrace_verbose, babeltrace_debug; perrorstr, \ ## args) -#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) - #define _bt_printf_perror(fp, fmt, args...) \ ({ \ char buf[PERROR_BUFLEN] = "Error in strerror_r()"; \ - strerror_r(errno, buf, sizeof(buf)); \ + compat_strerror_r(errno, buf, sizeof(buf)); \ _bt_printfe(fp, "error", buf, fmt, ## args); \ }) #define _bt_printfl_perror(fp, lineno, fmt, args...) \ ({ \ char buf[PERROR_BUFLEN] = "Error in strerror_r()"; \ - strerror_r(errno, buf, sizeof(buf)); \ + compat_strerror_r(errno, buf, sizeof(buf)); \ _bt_printfle(fp, "error", lineno, buf, fmt, ## args); \ }) -#else - -/* - * Version using GNU strerror_r, for linux with appropriate defines. - */ - -#define _bt_printf_perror(fp, fmt, args...) \ - ({ \ - char *buf; \ - char tmp[PERROR_BUFLEN] = "Error in strerror_r()"; \ - buf = strerror_r(errno, tmp, sizeof(tmp)); \ - _bt_printfe(fp, "error", buf, fmt, ## args); \ - }) - -#define _bt_printfl_perror(fp, lineno, fmt, args...) \ - ({ \ - char *buf; \ - char tmp[PERROR_BUFLEN] = "Error in strerror_r()"; \ - buf = strerror_r(errno, tmp, sizeof(tmp)); \ - _bt_printfle(fp, "error", lineno, buf, fmt, ## args); \ - }) - -#endif - /* printf without lineno information */ #define printf_fatal(fmt, args...) \ _bt_printf(stderr, "fatal", fmt, ## args) diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h new file mode 100644 index 0000000..8591b7e --- /dev/null +++ b/include/babeltrace/compat/string.h @@ -0,0 +1,9 @@ +#ifndef _BABELTRACE_COMPAT_STRING_H +#define BABELTRACE_COMPAT_STRING_H + +#include + +int compat_strerror_r(int errnum, char *buf, size_t buflen); + +#endif + diff --git a/lib/Makefile.am b/lib/Makefile.am index 7ffb164..fa470c0 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -14,4 +14,5 @@ libbabeltrace_la_SOURCES = babeltrace.c \ libbabeltrace_la_LDFLAGS = \ -Wl,--no-as-needed \ prio_heap/libprio_heap.la \ - $(top_builddir)/types/libbabeltrace_types.la + $(top_builddir)/types/libbabeltrace_types.la \ + $(top_builddir)/compat/libcompat.la -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:46:53 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:46:53 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 04/28] Add MinGW32 libraries to executable Message-ID: <009B25148989C6458484484699278506E537E84C@EU-MBX-01.mgc.mentorg.com> Add MinGW32 specific libraries to all link commands. --- configure.ac | 9 +++++++++ converter/Makefile.am | 5 +++++ formats/ctf/metadata/Makefile.am | 3 +++ 3 files changed, 17 insertions(+) diff --git a/configure.ac b/configure.ac index 29366da..65e867c 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,15 @@ AC_FUNC_MALLOC AC_FUNC_MMAP AC_CHECK_FUNCS([bzero gettimeofday munmap strtoul]) +# Check for MinGW32. +MINGW32=no +case $host in + *-*-mingw*) + MINGW32=yes;; +esac + +AM_CONDITIONAL([BABELTRACE_BUILD_WITH_MINGW], [test "x$MINGW32" = "xyes"]) + # Check for libuuid AC_CHECK_LIB([uuid], [uuid_generate], [ diff --git a/converter/Makefile.am b/converter/Makefile.am index de70313..2bde9c3 100644 --- a/converter/Makefile.am +++ b/converter/Makefile.am @@ -29,3 +29,8 @@ endif if BABELTRACE_BUILD_WITH_LIBC_UUID babeltrace_log_LDADD += -lc endif + +if BABELTRACE_BUILD_WITH_MINGW +babeltrace_log_LDADD += -lrpcrt4 -lintl -liconv -lole32 -lpopt -lpthread +babeltrace_LDADD += -lrpcrt4 -lintl -liconv -lole32 -lpopt -lpthread +endif \ No newline at end of file diff --git a/formats/ctf/metadata/Makefile.am b/formats/ctf/metadata/Makefile.am index b33ce55..69f7127 100644 --- a/formats/ctf/metadata/Makefile.am +++ b/formats/ctf/metadata/Makefile.am @@ -27,6 +27,9 @@ endif if BABELTRACE_BUILD_WITH_LIBC_UUID libctf_ast_la_LIBADD += -lc endif +if BABELTRACE_BUILD_WITH_MINGW +libctf_ast_la_LIBADD += -lrpcrt4 -lintl -liconv -lole32 -lpopt +endif noinst_PROGRAMS = ctf-parser-test ctf_parser_test_SOURCES = ctf-parser-test.c -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:47:02 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:47:02 +0000 Subject: [lttng-dev] [babeltrace RFC PATCH 05/28] Add *.exe files to .gitignore Message-ID: <009B25148989C6458484484699278506E537E85A@EU-MBX-01.mgc.mentorg.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 752308e..dab17d3 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ core formats/ctf/metadata/ctf-parser.output stamp-h1 babeltrace.pc +*.exe -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:47:13 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:47:13 +0000 Subject: [lttng-dev] [babeltrace RFC PATCH 06/28] Add MinGW implementation of UUID Message-ID: <009B25148989C6458484484699278506E537E866@EU-MBX-01.mgc.mentorg.com> Implementation of UUID functions for MinGW32, using Windows API. --- compat/Makefile.am | 3 ++ compat/compat_uuid.c | 75 ++++++++++++++++++++++++++++++++++++++++ configure.ac | 5 ++- include/babeltrace/compat/uuid.h | 32 ++++++++++++++++- 4 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 compat/compat_uuid.c diff --git a/compat/Makefile.am b/compat/Makefile.am index d756aa7..e624a79 100644 --- a/compat/Makefile.am +++ b/compat/Makefile.am @@ -8,3 +8,6 @@ libcompat_la_SOURCES = \ libcompat_la_LDFLAGS = \ -Wl,--no-as-needed +if BABELTRACE_BUILD_WITH_MINGW +libcompat_la_SOURCES += compat_uuid.c +endif \ No newline at end of file diff --git a/compat/compat_uuid.c b/compat/compat_uuid.c new file mode 100644 index 0000000..0e67f73 --- /dev/null +++ b/compat/compat_uuid.c @@ -0,0 +1,75 @@ +/* This file is only built under MINGW32 */ + +#include +#include +#include + +static void fix_uuid_endian(struct UUID * uuid) +{ + unsigned char * ptr; + unsigned char tmp; + #define SWAP(p, i, j) tmp=*(p+i);*(p+i)=*(p+j);*(p+j)=tmp; + ptr = (unsigned char *)uuid; + SWAP(ptr, 0, 3) + SWAP(ptr, 1, 2) + SWAP(ptr, 4, 5) + SWAP(ptr, 6, 7) + +} + +int compat_uuid_generate(unsigned char *uuid_out) +{ + RPC_STATUS status; + status = UuidCreate((struct UUID *)uuid_out); + if (status == RPC_S_OK) + return 0; + else + return -1; +} + +int compat_uuid_unparse(const unsigned char *uuid_in, char *str_out) +{ + RPC_STATUS status; + unsigned char *alloc_str; + int ret; + fix_uuid_endian(uuid_in); + status = UuidToString((struct UUID *)uuid_in, &alloc_str); + fix_uuid_endian(uuid_in); + if (status == RPC_S_OK) { + strcpy(str_out, alloc_str); + ret = 0; + } else { + ret = -1; + } + RpcStringFree(alloc_str); + return ret; +} + +int compat_uuid_parse(const char *str_in, unsigned char *uuid_out) +{ + RPC_STATUS status; + + status = UuidFromString(str_in, (struct UUID *)uuid_out); + fix_uuid_endian(uuid_out); + + if (status == RPC_S_OK) + return 0; + else + return -1; +} + +int compat_uuid_compare(const unsigned char *uuid_a, + const unsigned char *uuid_b) +{ + RPC_STATUS status; + int ret; + + if (UuidCompare((struct UUID *)uuid_a, (struct UUID *)uuid_b, &status) == 0) + ret = 0; + else + { + ret = -1; + } + return ret; + +} diff --git a/configure.ac b/configure.ac index 65e867c..5f9e38d 100644 --- a/configure.ac +++ b/configure.ac @@ -60,7 +60,10 @@ AC_CHECK_LIB([uuid], [uuid_generate], have_libc_uuid=yes ], [ - AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.]) + # for MinGW32 we have our own internal implemenation of uuid using Windows functions. + if test "x$MINGW32" = xno; then + AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.]) + fi ]) ] ) diff --git a/include/babeltrace/compat/uuid.h b/include/babeltrace/compat/uuid.h index 2ce7467..a916a49 100644 --- a/include/babeltrace/compat/uuid.h +++ b/include/babeltrace/compat/uuid.h @@ -122,8 +122,38 @@ int babeltrace_uuid_compare(const unsigned char *uuid_a, return -1; } +#elif defined(__MINGW32__) +static inline +int babeltrace_uuid_generate(unsigned char *uuid_out) +{ + extern int compat_uuid_generate(unsigned char *uuid_out); + return compat_uuid_generate(uuid_out); +} + +static inline +int babeltrace_uuid_unparse(const unsigned char *uuid_in, char *str_out) +{ + extern int compat_uuid_unparse(const unsigned char *uuid_in, char *str_out); + return compat_uuid_unparse(uuid_in, str_out); +} + +static inline +int babeltrace_uuid_parse(const char *str_in, unsigned char *uuid_out) +{ + extern int compat_uuid_parse(const char *str_in, unsigned char *uuid_out); + return compat_uuid_parse(str_in, uuid_out); +} + +static inline +int babeltrace_uuid_compare(const unsigned char *uuid_a, + const unsigned char *uuid_b) +{ + extern int compat_uuid_compare(const unsigned char *uuid_a, + const unsigned char *uuid_b); + return compat_uuid_compare(uuid_a, uuid_b); +} #else #error "Babeltrace needs to have a UUID generator configured." #endif -#endif /* _BABELTRACE_UUID_H */ +#endif /* _BABELTRACE_INCLUDE_COMPAT_UUID_H */ -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:48:09 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:48:09 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 07/28] Add MinGW specific definitions to endian.h Message-ID: <009B25148989C6458484484699278506E537E894@EU-MBX-01.mgc.mentorg.com> --- include/babeltrace/endian.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/babeltrace/endian.h b/include/babeltrace/endian.h index 9eee0c1..f15a44f 100644 --- a/include/babeltrace/endian.h +++ b/include/babeltrace/endian.h @@ -29,6 +29,22 @@ #ifdef __FreeBSD__ #include +#elif defined(__MINGW32__) +#ifndef __BIG_ENDIAN +#define __BIG_ENDIAN 4321 +#endif +#ifndef __LITTLE_ENDIAN +#define __LITTLE_ENDIAN 1234 +#endif + +#ifndef __BYTE_ORDER +#define __BYTE_ORDER __LITTLE_ENDIAN +#endif + +#define LITTLE_ENDIAN __LITTLE_ENDIAN +#define BIG_ENDIAN __BIG_ENDIAN +#define PDP_ENDIAN __PDP_ENDIAN +#define BYTE_ORDER __BYTE_ORDER #else #include #endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:49:25 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:49:25 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 08/28] Add MinGW implementation of mmap and munmap Message-ID: <009B25148989C6458484484699278506E537E8A5@EU-MBX-01.mgc.mentorg.com> Implementations of mmap and munmap using Windows API. The header file sys/mman.h is now indirectly included by include/babeltrace/compat/mman.h . For MinGW, PAGE_SIZE is defined as a constant instead of using a sysconf() setting. --- compat/Makefile.am | 4 +- compat/compat_mman.c | 128 ++++++++++++++++++++++++++++++++++++ converter/babeltrace-log.c | 2 +- formats/bt-dummy/bt-dummy.c | 2 +- formats/ctf-metadata/ctf-metadata.c | 2 +- formats/ctf-text/ctf-text.c | 2 +- formats/ctf/ctf.c | 2 +- include/babeltrace/align.h | 5 ++ include/babeltrace/compat/mman.h | 24 +++++++ include/babeltrace/ctf-text/types.h | 2 +- include/babeltrace/mmap-align.h | 2 +- 11 files changed, 166 insertions(+), 9 deletions(-) create mode 100644 compat/compat_mman.c create mode 100644 include/babeltrace/compat/mman.h diff --git a/compat/Makefile.am b/compat/Makefile.am index e624a79..e573854 100644 --- a/compat/Makefile.am +++ b/compat/Makefile.am @@ -9,5 +9,5 @@ libcompat_la_LDFLAGS = \ -Wl,--no-as-needed if BABELTRACE_BUILD_WITH_MINGW -libcompat_la_SOURCES += compat_uuid.c -endif \ No newline at end of file +libcompat_la_SOURCES += compat_mman.c compat_uuid.c +endif diff --git a/compat/compat_mman.c b/compat/compat_mman.c new file mode 100644 index 0000000..0e45260 --- /dev/null +++ b/compat/compat_mman.c @@ -0,0 +1,128 @@ +/* This file is only built under MINGW32 */ + +#include +#include +#include + +#define HAS_FLAG( BITSET, FLAG ) ( ( BITSET & FLAG ) == FLAG ) + +typedef struct +{ + HANDLE hFile; + HANDLE hFileMappingObject; + unsigned char *start_addr; + long offset; +} mmap_data; + +mmap_data *arr_mmap_data = NULL; +size_t arr_mmap_data_size = 0; +DWORD allocationGranularity = 0; + +void mmap_data_add( mmap_data data ) +{ + arr_mmap_data = (mmap_data *) realloc( arr_mmap_data, ( arr_mmap_data_size + 1 ) * sizeof( mmap_data ) ); + arr_mmap_data[ arr_mmap_data_size ] = data; + arr_mmap_data_size += 1; +} + +mmap_data *mmap_data_find_addr( unsigned char *start_addr ) +{ + size_t i; + for( i = 0; i < arr_mmap_data_size; ++i ) + if( arr_mmap_data[i].start_addr + arr_mmap_data[i].offset == start_addr ) + return arr_mmap_data + i; + + return NULL; +} + +/* mmap for mingw32 */ +void *mmap( void *ptr, long size, long prot, long type, long handle, long arg ) +{ + //__builtin_printf( "mmap: %p, %d, %d, %d, %d, %d\n", ptr, size, prot, type, handle, arg ); + mmap_data data_entry; + long offset; + + if (allocationGranularity == 0) + { + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + allocationGranularity = sysinfo.dwAllocationGranularity; + } + + if( prot == PROT_NONE || HAS_FLAG( prot, PROT_EXEC ) ) + return MAP_FAILED; /* not supported - fail safe */ + + data_entry.hFile = (HANDLE) _get_osfhandle( handle ); + if( data_entry.hFile != INVALID_HANDLE_VALUE ) + { + + /* There is no 1:1 mapping, best effort strategy */ + DWORD flProtect = PAGE_READONLY; + DWORD dwDesiredAccess = FILE_MAP_READ; + + if( HAS_FLAG( prot, PROT_WRITE ) ) + { + flProtect = PAGE_READWRITE; + if( HAS_FLAG( prot, PROT_READ ) ) + dwDesiredAccess = FILE_MAP_ALL_ACCESS; + else + dwDesiredAccess = FILE_MAP_WRITE; + } + + if( HAS_FLAG( type, MAP_PRIVATE ) ) + { + flProtect = PAGE_WRITECOPY; + dwDesiredAccess = FILE_MAP_COPY; + } + + data_entry.hFileMappingObject = CreateFileMapping( data_entry.hFile, NULL, flProtect, 0, 0, NULL ); + if( data_entry.hFileMappingObject != NULL ) + { + DWORD filesizelow; + DWORD filesizehigh; + filesizelow = GetFileSize(data_entry.hFile, &filesizehigh); + offset = 0; + while (arg > allocationGranularity) + { + if (filesizelow < allocationGranularity) + { + filesizehigh--; + } + filesizelow -= allocationGranularity; + + arg -= allocationGranularity; + offset += allocationGranularity; + } + data_entry.offset = arg; + size = size + arg; + if ((size > filesizelow) && (filesizehigh == 0)) + { + size = filesizelow; + } + data_entry.start_addr = MapViewOfFile( data_entry.hFileMappingObject, dwDesiredAccess, 0, offset, size); + if( data_entry.start_addr != NULL ) + { + mmap_data_add( data_entry ); + return (void *)(data_entry.start_addr + arg); + } + } + + } + + return MAP_FAILED; +} + + +/* munmap for mingw32 */ +long munmap( void *ptr, long size ) +{ + mmap_data *data_entry = mmap_data_find_addr( ptr ); + if( data_entry != NULL && UnmapViewOfFile( data_entry->start_addr ) != 0 ) + { + CloseHandle( data_entry->hFileMappingObject ); + data_entry->start_addr = NULL; + return 0; + } + + return -1; +} diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c index 52a2fe1..b11eb99 100644 --- a/converter/babeltrace-log.c +++ b/converter/babeltrace-log.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/formats/bt-dummy/bt-dummy.c b/formats/bt-dummy/bt-dummy.c index 6192e88..4be9741 100644 --- a/formats/bt-dummy/bt-dummy.c +++ b/formats/bt-dummy/bt-dummy.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/formats/ctf-metadata/ctf-metadata.c b/formats/ctf-metadata/ctf-metadata.c index a5a74c3..7ac36e1 100644 --- a/formats/ctf-metadata/ctf-metadata.c +++ b/formats/ctf-metadata/ctf-metadata.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index 48ce31b..bc5c2a7 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index d77c93a..0cfad44 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/babeltrace/align.h b/include/babeltrace/align.h index f6a1966..e7d715e 100644 --- a/include/babeltrace/align.h +++ b/include/babeltrace/align.h @@ -30,8 +30,13 @@ #include #ifndef PAGE_SIZE /* Cygwin limits.h defines its own PAGE_SIZE */ +#ifdef __MINGW32__ +#define PAGE_SIZE 4096 +#else #define PAGE_SIZE sysconf(_SC_PAGE_SIZE) #endif +#endif + #define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1) #define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask)) diff --git a/include/babeltrace/compat/mman.h b/include/babeltrace/compat/mman.h new file mode 100644 index 0000000..a004b1e --- /dev/null +++ b/include/babeltrace/compat/mman.h @@ -0,0 +1,24 @@ +#ifndef _BABELTRACE_INCLUDE_COMPAT_MMAN_H +#define _BABELTRACE_INCLUDE_COMPAT_MMAN_H + +#ifdef __MINGW32__ + +#define PROT_READ 0x1 +#define PROT_WRITE 0x2 +#define PROT_EXEC 0x4 +#define PROT_NONE 0x0 + +#define MAP_SHARED 0x01 +#define MAP_PRIVATE 0x02 +#define MAP_FAILED ((void *) -1) + +/* mmap for mingw32 */ +void *mmap (void *ptr, long size, long prot, long type, long handle, long arg); +/* munmap for mingw32 */ +long munmap (void *ptr, long size); + +#else +#include +#endif + +#endif /* _BABELTRACE_INCLUDE_COMPAT_MMAN_H */ diff --git a/include/babeltrace/ctf-text/types.h b/include/babeltrace/ctf-text/types.h index 7b4b717..c528355 100644 --- a/include/babeltrace/ctf-text/types.h +++ b/include/babeltrace/ctf-text/types.h @@ -27,7 +27,7 @@ * SOFTWARE. */ -#include +#include #include #include #include diff --git a/include/babeltrace/mmap-align.h b/include/babeltrace/mmap-align.h index f7c18fa..3d90c85 100644 --- a/include/babeltrace/mmap-align.h +++ b/include/babeltrace/mmap-align.h @@ -27,7 +27,7 @@ #include #include -#include +#include /* * This header implements a wrapper over mmap (mmap_align) that memory -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:50:35 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:50:35 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 09/28] Add MinGW implementation of strerror_r Message-ID: <009B25148989C6458484484699278506E537E8B6@EU-MBX-01.mgc.mentorg.com> --- compat/compat_strlib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/compat/compat_strlib.c b/compat/compat_strlib.c index 9aabb07..7413e74 100644 --- a/compat/compat_strlib.c +++ b/compat/compat_strlib.c @@ -1,5 +1,17 @@ #include +#ifdef __MINGW32__ +int strerror_r(int errnum, char *buf, size_t buflen) +{ + /* non-recursive implementation of strerror_r */ + char * retbuf; + retbuf = strerror(errnum); + strncpy(buf, retbuf, buflen); + buf[buflen - 1] = '\0'; + return 0; +} +#endif + int compat_strerror_r(int errnum, char *buf, size_t buflen) { #if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:51:56 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:51:56 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 10/28] Memstream functions for MinGW32 Message-ID: <009B25148989C6458484484699278506E537E8C7@EU-MBX-01.mgc.mentorg.com> In Windows, you cannot unlink a file while it is still in use, so we won't even try. Add a Windows-specific implementation of mkstemp, which provides a temporary file in the correct Windows directory. The temporary file is opened with such flags that it will be deleted once it's closed. --- compat/Makefile.am | 2 +- compat/compat_stdlib.c | 22 ++++++++++++++++++++++ include/babeltrace/compat/memstream.h | 18 ++++++++++++++---- include/babeltrace/compat/stdlib.h | 11 +++++++++++ 4 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 compat/compat_stdlib.c create mode 100644 include/babeltrace/compat/stdlib.h diff --git a/compat/Makefile.am b/compat/Makefile.am index e573854..e5a41d9 100644 --- a/compat/Makefile.am +++ b/compat/Makefile.am @@ -9,5 +9,5 @@ libcompat_la_LDFLAGS = \ -Wl,--no-as-needed if BABELTRACE_BUILD_WITH_MINGW -libcompat_la_SOURCES += compat_mman.c compat_uuid.c +libcompat_la_SOURCES += compat_mman.c compat_uuid.c compat_stdlib.c endif diff --git a/compat/compat_stdlib.c b/compat/compat_stdlib.c new file mode 100644 index 0000000..51a032c --- /dev/null +++ b/compat/compat_stdlib.c @@ -0,0 +1,22 @@ +/* This file is only built under MINGW32 */ + +#include +#include + +int mkstemp(char *template) +{ + char tempPath[MAX_PATH]; + char tmpname[MAX_PATH]; + HANDLE file; + + extern int _open_osfhandle(int *, int); + + /* Ignore the template. Use Windows calls to create a temporary file whose name begins with BBT */ + GetTempPath(MAX_PATH, tempPath); + GetTempFileName(tempPath, "BBT", 0, tmpname); + + file = CreateFile(tmpname, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, NULL); + + return _open_osfhandle((int *)file, 0); +} diff --git a/include/babeltrace/compat/memstream.h b/include/babeltrace/compat/memstream.h index d2a96cb..44bc30c 100644 --- a/include/babeltrace/compat/memstream.h +++ b/include/babeltrace/compat/memstream.h @@ -1,5 +1,5 @@ -#ifndef _BABELTRACE_FORMAT_CTF_MEMSTREAM_H -#define _BABELTRACE_FORMAT_CTF_MEMSTREAM_H +#ifndef _BABELTRACE_COMPAT_MEMSTREAM_H +#define _BABELTRACE_COMPAT_MEMSTREAM_H /* * format/ctf/memstream.h @@ -41,7 +41,7 @@ FILE *babeltrace_fmemopen(void *buf, size_t size, const char *mode) #else /* BABELTRACE_HAVE_FMEMOPEN */ -#include +#include #include /* @@ -85,10 +85,14 @@ FILE *babeltrace_fmemopen(void *buf, size_t size, const char *mode) goto error_close; } /* We keep the handle open, but can unlink the file on the VFS. */ + /* Unlinking under MINGW only gives an error, so let's not even try. */ +#ifndef __MINGW32__ ret = unlink(tmpname); if (ret < 0) { perror("unlink"); } +#endif + return fp; error_close: @@ -97,10 +101,12 @@ error_close: perror("close"); } error_unlink: +#ifndef __MINGW32__ ret = unlink(tmpname); if (ret < 0) { perror("unlink"); } +#endif return NULL; } @@ -154,17 +160,21 @@ FILE *babeltrace_open_memstream(char **ptr, size_t *sizeloc) * with read from fp. No need to keep the file around, just the * handle. */ +#ifndef __MINGW32__ ret = unlink(tmpname); if (ret < 0) { perror("unlink"); } +#endif return fp; error_unlink: +#ifndef __MINGW32__ ret = unlink(tmpname); if (ret < 0) { perror("unlink"); } +#endif return NULL; } @@ -233,4 +243,4 @@ error_free: #endif /* BABELTRACE_HAVE_OPEN_MEMSTREAM */ -#endif /* _BABELTRACE_FORMAT_CTF_MEMSTREAM_H */ +#endif /* _BABELTRACE_COMPAT_MEMSTREAM_H */ diff --git a/include/babeltrace/compat/stdlib.h b/include/babeltrace/compat/stdlib.h new file mode 100644 index 0000000..385fff1 --- /dev/null +++ b/include/babeltrace/compat/stdlib.h @@ -0,0 +1,11 @@ +#ifndef _BABELTRACE_COMPAT_STDLIB_H +#define BABELTRACE_COMPAT_STDLIB_H + +#include + +#ifdef __MINGW32__ +int mkstemp(char *template); +#endif + +#endif + -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:52:51 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:52:51 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 11/28] Add MinGW implementation of gmtime_r Message-ID: <009B25148989C6458484484699278506E537E8D8@EU-MBX-01.mgc.mentorg.com> Add a (non-recursive) implementation of gmtime_r as it is missing in the MinGW standard library. Implementation is written in file include/babeltrace/compat/time.h which must be included in the source files that call gmtime_r. --- formats/ctf/ctf.c | 1 + include/babeltrace/compat/time.h | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 include/babeltrace/compat/time.h diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 0cfad44..255a492 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -52,6 +52,7 @@ #include "metadata/ctf-ast.h" #include "events-private.h" #include "babeltrace/compat/memstream.h" +#include #define LOG2_CHAR_BIT 3 diff --git a/include/babeltrace/compat/time.h b/include/babeltrace/compat/time.h new file mode 100644 index 0000000..ccfc860 --- /dev/null +++ b/include/babeltrace/compat/time.h @@ -0,0 +1,19 @@ +#ifndef _BABELTRACE_INCLUDE_COMPAT_TIME_H +#define _BABELTRACE_INCLUDE_COMPAT_TIME_H + +#include +#include + +#ifdef __MINGW32__ + +static inline +struct tm *gmtime_r(const time_t *timep, struct tm *result) +{ + struct tm * r; + r = gmtime(timep); + memcpy(result, r, sizeof (struct tm)); + return result; +} + +#endif +#endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:53:39 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:53:39 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 12/28] Add MinGW implementation of localtime_r Message-ID: <009B25148989C6458484484699278506E537E8E9@EU-MBX-01.mgc.mentorg.com> --- include/babeltrace/compat/time.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/babeltrace/compat/time.h b/include/babeltrace/compat/time.h index ccfc860..d5cb7fd 100644 --- a/include/babeltrace/compat/time.h +++ b/include/babeltrace/compat/time.h @@ -15,5 +15,13 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result) return result; } +static inline +struct tm *localtime_r(const time_t *timep, struct tm *result) +{ + struct tm * r; + r = localtime(timep); + memcpy(result, r, sizeof (struct tm)); + return result; +} #endif #endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:54:37 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:54:37 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 13/28] Add compat library to executables Message-ID: <009B25148989C6458484484699278506E537E8FA@EU-MBX-01.mgc.mentorg.com> --- converter/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/converter/Makefile.am b/converter/Makefile.am index 2bde9c3..ca03927 100644 --- a/converter/Makefile.am +++ b/converter/Makefile.am @@ -13,6 +13,7 @@ babeltrace_LDFLAGS = -Wl,--no-as-needed babeltrace_LDADD = \ $(top_builddir)/lib/libbabeltrace.la \ $(top_builddir)/formats/ctf/libbabeltrace-ctf.la \ + $(top_builddir)/compat/libcompat.la \ $(top_builddir)/formats/ctf-text/libbabeltrace-ctf-text.la \ $(top_builddir)/formats/ctf-metadata/libbabeltrace-ctf-metadata.la \ $(top_builddir)/formats/bt-dummy/libbabeltrace-dummy.la @@ -21,7 +22,8 @@ babeltrace_log_SOURCES = babeltrace-log.c babeltrace_log_LDADD = \ $(top_builddir)/lib/libbabeltrace.la \ - $(top_builddir)/formats/ctf/libbabeltrace-ctf.la + $(top_builddir)/formats/ctf/libbabeltrace-ctf.la \ + $(top_builddir)/compat/libcompat.la if BABELTRACE_BUILD_WITH_LIBUUID babeltrace_log_LDADD += -luuid -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:55:32 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:55:32 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 14/28] Add MinGW implementation of fpathconf Message-ID: <009B25148989C6458484484699278506E537E90D@EU-MBX-01.mgc.mentorg.com> The MinGW implementation of fpathconf will always return MAX_PATH. --- formats/ctf/ctf.c | 2 +- include/babeltrace/compat/unistd.h | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 include/babeltrace/compat/unistd.h diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 255a492..c29fcd7 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include "metadata/ctf-scanner.h" diff --git a/include/babeltrace/compat/unistd.h b/include/babeltrace/compat/unistd.h new file mode 100644 index 0000000..f275b22 --- /dev/null +++ b/include/babeltrace/compat/unistd.h @@ -0,0 +1,21 @@ +#ifndef _BABELTRACE_INCLUDE_COMPAT_UNISTD_H +#define _BABELTRACE_INCLUDE_COMPAT_UNISTD_H + +#include + +#ifndef _PC_NAME_MAX +#define _PC_NAME_MAX 0 +#endif + +#ifdef __MINGW32__ + +static inline +int fpathconf (int fd, int name) +{ + /* dummy function that always returns MAX_PATH */ + return MAX_PATH; +} + +#endif + +#endif \ No newline at end of file -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:56:37 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:56:37 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 15/28] Add MinGW implementation of nftw() Message-ID: <009B25148989C6458484484699278506E537E91E@EU-MBX-01.mgc.mentorg.com> Add MinGW implementation of nftw(). This implementation works only with plain directories containing plain files. --- converter/babeltrace.c | 2 +- include/babeltrace/compat/ftw.h | 73 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 include/babeltrace/compat/ftw.h diff --git a/converter/babeltrace.c b/converter/babeltrace.c index a34af17..7b3db49 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include /* for clocks */ diff --git a/include/babeltrace/compat/ftw.h b/include/babeltrace/compat/ftw.h new file mode 100644 index 0000000..f1e7bfd --- /dev/null +++ b/include/babeltrace/compat/ftw.h @@ -0,0 +1,73 @@ +#ifndef _BABELTRACE_INCLUDE_COMPAT_FTW_H +#define _BABELTRACE_INCLUDE_COMPAT_FTW_H + +#ifndef __MINGW32__ +#include +#else + +#include + +struct FTW { + int base; + int level; +}; + + +#define FTW_F 0 +#define FTW_D 1 +#define FTW_DNR 2 +#define FTW_NS 3 +#define FTW_SL 4 + +static inline +int nftw(const char *dirpath, + int (*fn) (const char *fpath, const struct stat *sb, + int typeflag, struct FTW *ftwbuf), + int nopenfd, int flags) +{ + CHAR szSearch[MAX_PATH] = {0}; + CHAR szDirectory[MAX_PATH] = {0}; + HANDLE hFind = NULL; + WIN32_FIND_DATAA FindFileData; + + sprintf(szSearch, "%s%s", dirpath, "\\*"); + hFind = FindFirstFileA(szSearch, &FindFileData); + if(hFind == INVALID_HANDLE_VALUE) + { + /* print error */ + return -1; + } + do { + + if((FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) + { + /* this is a directory */ + /* skip '..' */ + if (strcmp(FindFileData.cFileName, "..") == 0) + continue; + + /* return '.' but do not recurse into it */ + if (strcmp(FindFileData.cFileName, ".") == 0) + { + (*fn)(dirpath, 0, FTW_D, 0); + continue; + } + + /* for others, recurse into them */ + sprintf(szDirectory, "%s/%s", dirpath, FindFileData.cFileName); + nftw(szDirectory, fn, nopenfd, flags); + + } + else + { + /* for files, report but do not recurse */ + sprintf(szDirectory, "%s/%s", dirpath, FindFileData.cFileName); + (*fn)(szDirectory, 0, FTW_F, 0); + } + } while(FindNextFileA(hFind, &FindFileData)); + + FindClose(hFind); + return 0; +} +#endif +#endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:57:27 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:57:27 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 16/28] Add MinGW implementation of strtok_r Message-ID: <009B25148989C6458484484699278506E537E92F@EU-MBX-01.mgc.mentorg.com> --- compat/compat_strlib.c | 40 ++++++++++++++++++++++++++++++++++++++ converter/babeltrace.c | 2 +- include/babeltrace/compat/string.h | 4 ++++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/compat/compat_strlib.c b/compat/compat_strlib.c index 7413e74..3cbd455 100644 --- a/compat/compat_strlib.c +++ b/compat/compat_strlib.c @@ -1,6 +1,46 @@ #include #ifdef __MINGW32__ + +char* strtok_r( + char *str, + const char *delim, + char **nextp) +{ + char *ret; + + /* if str is NULL, continue from nextp */ + if (str == NULL) { + str = *nextp; + } + /* skip the leading delimiter characters */ + str += strspn(str, delim); + + /* return NULL if all are delimiters */ + if (*str == '\0') { + return NULL; + } + /* return the pointer to the first character that is not delimiter */ + ret = str; + + /* scan to the next delimiter */ + str += strcspn(str, delim); + + /* if we found a delimiter instead of a NUL */ + if (*str) { + /* replace the delimiter with the NUL */ + *str = '\0'; + /* next time, scan from the character after NUL */ + *nextp = str + 1; + } + else { + /* end of string: next time, scan at the end (NUL) again */ + *nextp = str; + } + + return ret; +} + int strerror_r(int errnum, char *buf, size_t buflen) { /* non-recursive implementation of strerror_r */ diff --git a/converter/babeltrace.c b/converter/babeltrace.c index 7b3db49..f4a9217 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include /* for clocks */ diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h index 8591b7e..501d003 100644 --- a/include/babeltrace/compat/string.h +++ b/include/babeltrace/compat/string.h @@ -3,6 +3,10 @@ #include +#ifdef __MINGW32__ +char *strtok_r(char *str, const char *delim, char **nextp); +#endif + int compat_strerror_r(int errnum, char *buf, size_t buflen); #endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 07:58:44 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 11:58:44 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 17/28] Add MinGW implementation of sleep Message-ID: <009B25148989C6458484484699278506E537E940@EU-MBX-01.mgc.mentorg.com> --- include/babeltrace/compat/unistd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/babeltrace/compat/unistd.h b/include/babeltrace/compat/unistd.h index f275b22..448e047 100644 --- a/include/babeltrace/compat/unistd.h +++ b/include/babeltrace/compat/unistd.h @@ -16,6 +16,8 @@ int fpathconf (int fd, int name) return MAX_PATH; } +#define sleep(x) Sleep(1000 * (x)) + #endif #endif \ No newline at end of file -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 08:00:08 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 12:00:08 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 18/28] Add MinGW implementation of strnlen Message-ID: <009B25148989C6458484484699278506E537E951@EU-MBX-01.mgc.mentorg.com> --- compat/compat_strlib.c | 23 +++++++++++++++++++++++ formats/ctf/types/string.c | 2 +- include/babeltrace/compat/string.h | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/compat/compat_strlib.c b/compat/compat_strlib.c index 3cbd455..980a8f5 100644 --- a/compat/compat_strlib.c +++ b/compat/compat_strlib.c @@ -50,6 +50,29 @@ int strerror_r(int errnum, char *buf, size_t buflen) buf[buflen - 1] = '\0'; return 0; } + +size_t strnlen(const char *str, size_t maxlen) +{ + char * ptr; + size_t len; + ptr = (char *)str; + len = 0; + + /* while there still are characters in the string */ + while(*ptr != '\0') { + /* increment counter */ + len++; + /* check that we do not exceed the given maximum */ + if (len == maxlen) { + return len; + } + /* next character */ + ptr++; + + } + return len; +} + #endif int compat_strerror_r(int errnum, char *buf, size_t buflen) diff --git a/formats/ctf/types/string.c b/formats/ctf/types/string.c index a2433bf..a2f513d 100644 --- a/formats/ctf/types/string.c +++ b/formats/ctf/types/string.c @@ -29,7 +29,7 @@ #include #include #include /* C99 limits */ -#include +#include int ctf_string_read(struct bt_stream_pos *ppos, struct bt_definition *definition) { diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h index 501d003..82f411e 100644 --- a/include/babeltrace/compat/string.h +++ b/include/babeltrace/compat/string.h @@ -5,6 +5,7 @@ #ifdef __MINGW32__ char *strtok_r(char *str, const char *delim, char **nextp); +size_t strnlen(const char *str, size_t maxlen); #endif int compat_strerror_r(int errnum, char *buf, size_t buflen); -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 08:00:59 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 12:00:59 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 19/28] Add MinGW implementation of posix_fallocate Message-ID: <009B25148989C6458484484699278506E537E962@EU-MBX-01.mgc.mentorg.com> Add dummy MinGW implementation of posix_fallocate. The implementation does not do anything, and always returns zero. --- formats/ctf/ctf.c | 2 +- include/babeltrace/compat/fcntl.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 include/babeltrace/compat/fcntl.h diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index c29fcd7..431b2d4 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/babeltrace/compat/fcntl.h b/include/babeltrace/compat/fcntl.h new file mode 100644 index 0000000..0707c28 --- /dev/null +++ b/include/babeltrace/compat/fcntl.h @@ -0,0 +1,13 @@ +#ifndef _BABELTRACE_INCLUDE_COMPAT_FCNTL_H +#define _BABELTRACE_INCLUDE_COMPAT_FCNTL_H + +#include +#ifdef __MINGW32__ +static inline +int posix_fallocate(int fd, off_t offset, off_t len) +{ + return 0; +} +#endif + +#endif \ No newline at end of file -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 08:01:45 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 12:01:45 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 20/28] Add MinGW implementation of readdir_r Message-ID: <009B25148989C6458484484699278506E537E973@EU-MBX-01.mgc.mentorg.com> --- formats/ctf/ctf.c | 2 +- include/babeltrace/compat/dirent.h | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 include/babeltrace/compat/dirent.h diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 431b2d4..c6043bc 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/babeltrace/compat/dirent.h b/include/babeltrace/compat/dirent.h new file mode 100644 index 0000000..281f40b --- /dev/null +++ b/include/babeltrace/compat/dirent.h @@ -0,0 +1,20 @@ +#ifndef _BABELTRACE_INCLUDE_COMPAT_DIRENT_H +#define _BABELTRACE_INCLUDE_COMPAT_DIRENT_H + +#include + +#ifdef __MINGW32__ +static inline +int readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result) +{ + errno = 0; + entry = readdir (dirp); + *result = entry; + if (entry == NULL && errno != 0) { + return -1; + } + return 0; +} +#endif + +#endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 08:02:38 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 12:02:38 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 21/28] Add MinGW implementation of flockfile Message-ID: <009B25148989C6458484484699278506E537E983@EU-MBX-01.mgc.mentorg.com> Add a dummy MinGW implementation of flockfile. The function does not do anything. --- include/babeltrace/compat/stdio.h | 14 ++++++++++++++ tests/lib/tap.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 include/babeltrace/compat/stdio.h diff --git a/include/babeltrace/compat/stdio.h b/include/babeltrace/compat/stdio.h new file mode 100644 index 0000000..62ecf97 --- /dev/null +++ b/include/babeltrace/compat/stdio.h @@ -0,0 +1,14 @@ +#ifndef _BABELTRACE_COMPAT_STDIO_H +#define _BABELTRACE_COMPAT_STDIO_H + +#include + +#ifdef __MINGW32__ +static inline void flockfile (FILE * filehandle) +{ + return; +} + +#endif + +#endif diff --git a/tests/lib/tap.c b/tests/lib/tap.c index a430951..8bcdf36 100644 --- a/tests/lib/tap.c +++ b/tests/lib/tap.c @@ -27,7 +27,7 @@ #define _GNU_SOURCE #include #include -#include +#include #include #include "tap.h" -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 08:03:16 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 12:03:16 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 22/28] Add MinGW implementation of funlockfile. Message-ID: <009B25148989C6458484484699278506E537E991@EU-MBX-01.mgc.mentorg.com> Add dummy MinGW implementation of funlockfile. This function does not do anything. --- include/babeltrace/compat/stdio.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/babeltrace/compat/stdio.h b/include/babeltrace/compat/stdio.h index 62ecf97..be64e60 100644 --- a/include/babeltrace/compat/stdio.h +++ b/include/babeltrace/compat/stdio.h @@ -8,6 +8,10 @@ static inline void flockfile (FILE * filehandle) { return; } +static inline void funlockfile(FILE * filehandle) +{ + return; +} #endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 08:04:16 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 12:04:16 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 23/28] Add a MinGW substitute for openat() and related functions Message-ID: <009B25148989C6458484484699278506E537E9A6@EU-MBX-01.mgc.mentorg.com> Check if the build system has openat() support. If it does not, we have to open files based on the directory name instead of the directory handle. Substitute openat() with compat_openat() that also takes the directory path name as a parameter. If we don't have openat(), replace the function dirfd() with a dummy. Also, if we don't have openat(), open() and close() will not work for directories. Replace those with compat_opendirfd and compat_closedirfd() with dummy equivalents, as the function compat_openat() takes care of opening the file. --- configure.ac | 7 +++++ converter/babeltrace-log.c | 10 +++---- converter/babeltrace.c | 10 +++---- formats/ctf/ctf.c | 8 +++--- include/babeltrace/compat/dirent.h | 11 ++++++++ include/babeltrace/compat/fcntl.h | 58 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 90 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 5f9e38d..168fb91 100644 --- a/configure.ac +++ b/configure.ac @@ -84,6 +84,13 @@ AC_CHECK_LIB([c], [open_memstream], ] ) +# Check for openat +AC_CHECK_LIB([c], [openat], +[ + AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_OPENAT], 1, [Has openat support.]) +] +) + AC_CHECK_LIB([popt], [poptGetContext], [], [AC_MSG_ERROR([Cannot find popt.])] ) diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c index b11eb99..ac3bb3f 100644 --- a/converter/babeltrace-log.c +++ b/converter/babeltrace-log.c @@ -32,9 +32,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -343,20 +343,20 @@ int main(int argc, char **argv) perror("opendir"); goto error_rmdir; } - dir_fd = dirfd(dir); + dir_fd = compat_dirfd(dir); if (dir_fd < 0) { perror("dirfd"); goto error_closedir; } - fd = openat(dir_fd, "datastream", O_RDWR|O_CREAT, + fd = compat_openat(s_outputname, dir_fd, "datastream", O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); if (fd < 0) { perror("openat"); goto error_closedirfd; } - metadata_fd = openat(dir_fd, "metadata", O_RDWR|O_CREAT, + metadata_fd = compat_openat(s_outputname, dir_fd, "metadata", O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); if (fd < 0) { perror("openat"); diff --git a/converter/babeltrace.c b/converter/babeltrace.c index f4a9217..d449ea7 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include @@ -409,15 +409,15 @@ static int traverse_trace_dir(const char *fpath, const struct stat *sb, if (tflag != FTW_D) return 0; - dirfd = open(fpath, 0); + dirfd = compat_opendirfd(fpath, 0); if (dirfd < 0) { fprintf(stderr, "[error] [Context] Unable to open trace " "directory file descriptor.\n"); return 0; /* partial error */ } - metafd = openat(dirfd, "metadata", O_RDONLY); + metafd = compat_openat(fpath, dirfd, "metadata", O_RDONLY); if (metafd < 0) { - closeret = close(dirfd); + closeret = compat_closedirfd(dirfd); if (closeret < 0) { perror("close"); return -1; @@ -430,7 +430,7 @@ static int traverse_trace_dir(const char *fpath, const struct stat *sb, perror("close"); return -1; /* failure */ } - closeret = close(dirfd); + closeret = compat_closedirfd(dirfd); if (closeret < 0) { perror("close"); return -1; /* failure */ diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index c6043bc..7878555 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1078,7 +1078,7 @@ int ctf_open_trace_metadata_read(struct ctf_trace *td, metadata_stream->pos.fd = -1; } else { td->metadata = &metadata_stream->parent; - metadata_stream->pos.fd = openat(td->dirfd, "metadata", O_RDONLY); + metadata_stream->pos.fd = compat_openat(td->parent.path, td->dirfd, "metadata", O_RDONLY); if (metadata_stream->pos.fd < 0) { fprintf(stderr, "Unable to open metadata.\n"); ret = -1; @@ -1624,7 +1624,7 @@ int ctf_open_file_stream_read(struct ctf_trace *td, const char *path, int flags, struct ctf_file_stream *file_stream; struct stat statbuf; - fd = openat(td->dirfd, path, flags); + fd = compat_openat(td->parent.path, td->dirfd, path, flags); if (fd < 0) { perror("File stream openat()"); ret = fd; @@ -1717,7 +1717,7 @@ int ctf_open_trace_read(struct ctf_trace *td, goto error; } - td->dirfd = open(path, 0); + td->dirfd = compat_opendirfd(path, 0); if (td->dirfd < 0) { fprintf(stderr, "[error] Unable to open trace directory file descriptor for path \"%s\".\n", path); perror("Trace directory open"); @@ -1775,7 +1775,7 @@ int ctf_open_trace_read(struct ctf_trace *td, readdir_error: free(dirent); error_metadata: - closeret = close(td->dirfd); + closeret = compat_closedirfd(td->dirfd); if (closeret) { perror("Error on fd close"); } diff --git a/include/babeltrace/compat/dirent.h b/include/babeltrace/compat/dirent.h index 281f40b..a7d6227 100644 --- a/include/babeltrace/compat/dirent.h +++ b/include/babeltrace/compat/dirent.h @@ -17,4 +17,15 @@ int readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result) } #endif +static inline +int compat_dirfd(DIR * dirp) +{ +#ifdef BABELTRACE_HAVE_OPENAT + return dirfd(dirp); +#else + /* ignore dirfd - see compat_openat() */ + return 0; +#endif +} + #endif diff --git a/include/babeltrace/compat/fcntl.h b/include/babeltrace/compat/fcntl.h index 0707c28..f58a1bf 100644 --- a/include/babeltrace/compat/fcntl.h +++ b/include/babeltrace/compat/fcntl.h @@ -2,6 +2,10 @@ #define _BABELTRACE_INCLUDE_COMPAT_FCNTL_H #include +#include +#include +#include + #ifdef __MINGW32__ static inline int posix_fallocate(int fd, off_t offset, off_t len) @@ -10,4 +14,58 @@ int posix_fallocate(int fd, off_t offset, off_t len) } #endif +/* + If we have BABELTRACE_HAVE_OPENAT, then + openat() and dirfd() work, and open() and close() can + work on directories. + + If we don't have BABELTRACE_HAVE_OPENAT, + then we have to open files based on the directory name, + not the directory handle. The functions + compat_[opendirfd | closedirfd | dirfd] all are dummied + to return zero, and compat_openat() takes care of the + opening of the file. +*/ + +static inline +int compat_openat(const char * dirname, int dirfd, const char *pathname, int flags, ...) +{ + +#ifdef BABELTRACE_HAVE_OPENAT + mode_t mode = 0; + va_list args; + va_start (args, flags); + mode = (mode_t)va_arg(args, int); + va_end(args); + return openat(dirfd, pathname, flags, mode); +#else + char szSearch[MAX_PATH] = {0}; + sprintf(szSearch, "%s/%s", dirname, pathname); +#ifdef __MINGW32__ + flags = flags | O_BINARY; +#endif + return open(szSearch, flags); +#endif +} + +static inline +int compat_opendirfd(const char *fpath, int flags) +{ +#ifdef BABELTRACE_HAVE_OPENAT + return open(fpath, flags); +#else + return 0; +#endif +} + +static inline +int compat_closedirfd(int dirfd) +{ +#ifdef BABELTRACE_HAVE_OPENAT + return close(dirfd); +#else + return 0; +#endif +} + #endif \ No newline at end of file -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 08:05:07 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 12:05:07 +0000 Subject: [lttng-dev] [PATCH 24/28] Use babeltrace/compat/unistd instead of unistd Message-ID: <009B25148989C6458484484699278506E537E9B9@EU-MBX-01.mgc.mentorg.com> --- converter/babeltrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index d449ea7..b3b7d08 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 08:05:55 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 12:05:55 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 25/28] Replace mkdir with compat_mkdir Message-ID: <009B25148989C6458484484699278506E537E9CA@EU-MBX-01.mgc.mentorg.com> The MinGW implementation of mkdir only accepts one parameter. Replace mkdir with compat_mkdir that in MinGW will ignore the parameters after the first one. --- converter/babeltrace-log.c | 2 +- include/babeltrace/compat/fcntl.h | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c index ac3bb3f..f997aad 100644 --- a/converter/babeltrace-log.c +++ b/converter/babeltrace-log.c @@ -332,7 +332,7 @@ int main(int argc, char **argv) exit(EXIT_SUCCESS); } - ret = mkdir(s_outputname, S_IRWXU|S_IRWXG); + ret = compat_mkdir(s_outputname, S_IRWXU|S_IRWXG); if (ret) { perror("mkdir"); goto error; diff --git a/include/babeltrace/compat/fcntl.h b/include/babeltrace/compat/fcntl.h index f58a1bf..167353c 100644 --- a/include/babeltrace/compat/fcntl.h +++ b/include/babeltrace/compat/fcntl.h @@ -6,6 +6,18 @@ #include #include +#ifndef S_IRGRP +#define S_IRGRP 0 +#endif + +#ifndef S_IWGRP +#define S_IWGRP 0 +#endif + +#ifndef S_IRWXG +#define S_IRWXG 0 +#endif + #ifdef __MINGW32__ static inline int posix_fallocate(int fd, off_t offset, off_t len) @@ -68,4 +80,19 @@ int compat_closedirfd(int dirfd) #endif } +static inline +int compat_mkdir(const char *pathname, ...) +{ +#ifdef __MINGW32__ + return mkdir(pathname); +#else + mode_t mode = 0; + va_list args; + va_start (args, pathname); + mode = (mode_t)va_arg(args, int); + va_end(args); + return mkdir(pathname, mode); +#endif +} + #endif \ No newline at end of file -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 08:06:51 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 12:06:51 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 26/28] Add MinGW implementation of getline Message-ID: <009B25148989C6458484484699278506E537E9DB@EU-MBX-01.mgc.mentorg.com> --- compat/compat_strlib.c | 40 ++++++++++++++++++++++++++++++++++++++ include/babeltrace/compat/string.h | 2 ++ 2 files changed, 42 insertions(+) diff --git a/compat/compat_strlib.c b/compat/compat_strlib.c index 980a8f5..181cf66 100644 --- a/compat/compat_strlib.c +++ b/compat/compat_strlib.c @@ -2,6 +2,10 @@ #ifdef __MINGW32__ +#include +#include +#include + char* strtok_r( char *str, const char *delim, @@ -73,6 +77,42 @@ size_t strnlen(const char *str, size_t maxlen) return len; } +ssize_t getline(char **buf, size_t *len, FILE *stream) +{ + int c = EOF; + ssize_t count = (ssize_t)0; + + if( feof( stream ) || ferror( stream ) ) + return -1; + + for(;;) { + /* read character from stream */ + c = fgetc(stream); + if (c == EOF) { + break; + } + if (c == '\n') { + break; + } + + /* store to *buf */ + /* check if it fits - space for character and NUL */ + if (count > *len - 2) { + /* have to allocate more space */ + *len = *len + 100; + *buf = realloc(*buf, *len); + if (*buf == NULL) { + errno = ENOMEM; + return (ssize_t)-1; + } + } + (*buf)[count] = c; + count++; + } + (*buf)[count] = '\0'; + return (count == (ssize_t)0) ? (ssize_t)-1 : (ssize_t)0; +} + #endif int compat_strerror_r(int errnum, char *buf, size_t buflen) diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h index 82f411e..50f6ba1 100644 --- a/include/babeltrace/compat/string.h +++ b/include/babeltrace/compat/string.h @@ -2,10 +2,12 @@ #define BABELTRACE_COMPAT_STRING_H #include +#include #ifdef __MINGW32__ char *strtok_r(char *str, const char *delim, char **nextp); size_t strnlen(const char *str, size_t maxlen); +ssize_t getline(char **buf, size_t *len, FILE *stream); #endif int compat_strerror_r(int errnum, char *buf, size_t buflen); -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 08:07:50 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 12:07:50 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 27/28] MinGW implementation of [v]asprintf Message-ID: <009B25148989C6458484484699278506E537E9E8@EU-MBX-01.mgc.mentorg.com> --- include/babeltrace/compat/stdio.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/include/babeltrace/compat/stdio.h b/include/babeltrace/compat/stdio.h index be64e60..ce5bab2 100644 --- a/include/babeltrace/compat/stdio.h +++ b/include/babeltrace/compat/stdio.h @@ -4,6 +4,10 @@ #include #ifdef __MINGW32__ + +#include +#include + static inline void flockfile (FILE * filehandle) { return; @@ -13,6 +17,40 @@ static inline void funlockfile(FILE * filehandle) return; } +static inline +int vasprintf(char ** strp, const char * fmt, va_list argv) +{ + int ret; + + /* allocate even bigger chunks of memory until the string fits */ + char * buf; + size_t size = 100; + for(;;) { + buf = malloc(size); + if (buf == (char *)0) { + ret = -1; + break; + } + ret = vsnprintf(buf, size, fmt, argv); + if (ret < size) + break; + size = size + 100; + free(buf); + } + return ret; +} + +static inline +int asprintf(char ** strp, const char *fmt, ...) +{ + int ret; + va_list argv; + va_start(argv, fmt); + ret = vasprintf(strp, fmt, argv); + va_end(argv); + return ret; +} + #endif #endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Thu May 2 08:09:06 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 2 May 2013 12:09:06 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 28/28] Open files as binary under Windows Message-ID: <009B25148989C6458484484699278506E537E9FD@EU-MBX-01.mgc.mentorg.com> --- formats/ctf/ctf.c | 2 +- include/babeltrace/compat/memstream.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 7878555..c6c18a2 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1085,7 +1085,7 @@ int ctf_open_trace_metadata_read(struct ctf_trace *td, goto end_free; } - fp = fdopen(metadata_stream->pos.fd, "r"); + fp = fdopen(metadata_stream->pos.fd, "rb"); if (!fp) { fprintf(stderr, "[error] Unable to open metadata stream.\n"); perror("Metadata stream open"); diff --git a/include/babeltrace/compat/memstream.h b/include/babeltrace/compat/memstream.h index 44bc30c..be6d1a6 100644 --- a/include/babeltrace/compat/memstream.h +++ b/include/babeltrace/compat/memstream.h @@ -70,7 +70,7 @@ FILE *babeltrace_fmemopen(void *buf, size_t size, const char *mode) /* * We need to write to the file. */ - fp = fdopen(ret, "w+"); + fp = fdopen(ret, "w+b"); if (!fp) { goto error_unlink; } @@ -151,7 +151,7 @@ FILE *babeltrace_open_memstream(char **ptr, size_t *sizeloc) if (ret < 0) { return NULL; } - fp = fdopen(ret, "w+"); + fp = fdopen(ret, "w+b"); if (!fp) { goto error_unlink; } -- 1.8.1.msysgit.1 From mathieu.desnoyers at efficios.com Thu May 2 09:29:46 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 09:29:46 -0400 Subject: [lttng-dev] LTTng-UST memory requirements In-Reply-To: <20998D40D9A2B7499CA5A3A2666CB1EB23FCE56C@ZURMSG1.QUANTUM.com> References: <20998D40D9A2B7499CA5A3A2666CB1EB23FCE56C@ZURMSG1.QUANTUM.com> Message-ID: <20130502132946.GD7035@Krystal> * David OShea (David.OShea at quantum.com) wrote: > Hi all, > > Are any details available of the memory requirements for LTTng? I guess you'll have to measure this. One important point to consider is the memory requirements for trace buffers, which are user-configurable. Thanks, Mathieu > I'm > particularly interested in UST, and not only the case where tracing is > being performed, but also when no session is started. For example.: > > - Session daemon memory requirements: I assume this would be a > function of the number of tracepoints, trace providers, attached > processes, sessions, etc. > > - Consumer daemon memory requirements: how many of these would there be, how much memory does each use > > - In-application memory requirements: I assume this would also be a function of the number of trace providers, trace points, etc. > > Thanks in advance, > David > > ---------------------------------------------------------------------- > The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt. > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 09:31:00 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 09:31:00 -0400 Subject: [lttng-dev] Poor handling of spaces in field names In-Reply-To: <20998D40D9A2B7499CA5A3A2666CB1EB19F8A09C@ZURMSG1.QUANTUM.com> References: <20998D40D9A2B7499CA5A3A2666CB1EB19F8A09C@ZURMSG1.QUANTUM.com> Message-ID: <20130502133100.GE7035@Krystal> * David OShea (David.OShea at quantum.com) wrote: > Hi all, > > I never expected to be able to put spaces in field names, but I accidentally did so and had quite a bit of trouble debugging the problem, as 'babeltrace -v ' just gave me: > > """ > error syntax error > [error] Error creating AST > [warning] Unable to open trace metadata for path "[...]". > [warning] [Context] Cannot open_trace of the format [...] . > > [warning] [Context] cannot open trace "[...]" from [...] for reading. > """ > > I had to set BABELTRACE_DEBUG=1 to see the metadata scanner and parser debug output to figure out what I'd done wrong :) > > Would it be possible and practical to have the macros generate some > dummy code using the field names in order to detect them not being > valid identifiers at compile time? Better error messages from the > metadata parser would also be nice, but I imagine that's probably not > so easy. babeltrace now has much more verbose error messages (see master branch). If it is still an issue with you, please open a feature request against babeltrace on bugs.lttng.org. Thanks, Mathieu > > Thanks in advance, > David > > ---------------------------------------------------------------------- > The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt. > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 09:40:10 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 09:40:10 -0400 Subject: [lttng-dev] How to disable an event that's been enabled by a wildcard selection or -a? In-Reply-To: <5121EA9A.8080905@mentor.com> References: <009B25148989C6458484484699278506985C0CFA@EU-MBX-01.mgc.mentorg.com> <20998D40D9A2B7499CA5A3A2666CB1EB19F968AF@ZURMSG1.QUANTUM.com> <5121EA9A.8080905@mentor.com> Message-ID: <20130502134010.GF7035@Krystal> * Woegerer, Paul (Paul_Woegerer at mentor.com) wrote: > Hi David, > > On 02/14/2013 05:52 AM, David OShea wrote: > > Hi, > > > > My understanding (hopefully someone will correct me if I'm wrong) is that each time you invoke 'lttng enable-event', your specification for the events you want enabled is stored and applied, and/or potentially applied later if a new application connects to the session daemon. All 'lttng disable-event' does is remove one of the specifications you previously provided to 'lttng enable-event', so you can't say 'enable-event *' and then 'disable-event foo:*' to get all events except 'foo:*'. > > > > If you could constrain the application to use a particular trace provider name for all of its tracepoints, say "app", then you could just do 'lttng enable-event app:*'. If you can't do that, then I think you need to fall back on getting a list of all the available tracepoints using 'lttng list -u', parsing this to find all of the available tracepoints, extracting the trace provider name from them, then using 'lttng enable-event :*' for each provider other than the provider from your uninteresting library. I think there are APIs that can be used instead of issuing the 'lttng' commands. > > > > I would certainly also like a way to be able to, say, enable all events other than foo:* and bar:* using one command. > > I submitted a patch that does exactly this a while ago: > http://lists.lttng.org/pipermail/lttng-dev/2012-June/018179.html > > Although it's not upstream it works well for us. Hi Paul, I would be interested to see this feature upstream. Previously was not a good timing to pull it in, because we were adding the concept of event "enablers" within lttng-ust. One thing I'm curious about is how you present the logical combination with exlusion match are present. For instance, if we only have inclusion, we get: lttng enable-event 'a' lttng enable-event 'c' lttng enable-event 'zc*' it turns into : (a || c || zc*) I expect that negation would look like: lttng enable-event 'a' lttng enable-event '!abc*' lttng enable-event 'c' lttng enable-event '!cxx' lttng enable-event 'zc*' -> !(abc* || cxx) || (a || c || zc*) Am I correct ? If yes, we should expand lttng-tools lttng(1) manpage and cmd help with this info. Can you make sure it works well with lttng-ust master branch ? Thanks, Mathieu > > Thanks, > Paul > > > > > > Regards, > > David > > > >> -----Original Message----- > >> From: Ikaheimonen, JP [mailto:jp_ikaheimonen at mentor.com] > >> Sent: Friday, 8 February 2013 7:56 PM > >> To: lttng-dev at lists.lttng.org > >> Subject: [lttng-dev] How to disable an event that's been enabled by a > >> wildcard selection or -a? > >> > >> Consider the following scenario. > >> I want to write a script that traces all UST tracepoints of a given > >> application. I have no idea what the names of these tracepoints are. > >> Also, I know that the application uses a library that contains some > >> tracepoints I am not interested about. Now I want to trace all UST > >> tracepoints except the ones I already know about. Is this possible with > >> the lttng commands? > >> > >> If I enable all tracepoints with "lttng enable-event -u -a" I get all > >> events, even those I do not want. I've tried using "lttng disable- > >> event", and "lttng enable-event" with a filter, but I cannot seem to be > >> able to get rid of the specific events. > >> > >> Thank you, > >> > >> JP Ikaheimonen > >> Mentor Graphics Embedded Systems Division > >> Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS > >> > >> Android is a trademark of Google Inc. Use of this trademark is subject > >> to Google Permissions. > >> Linux is the registered trademark of Linus Torvalds in the U.S. and > >> other countries. > >> > >> _______________________________________________ > >> lttng-dev mailing list > >> lttng-dev at lists.lttng.org > >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > ---------------------------------------------------------------------- > > The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt. > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > > -- > Paul Woegerer | SW Development Engineer > http://go.mentor.com/sourceryanalyzer > > Mentor Embedded(tm) | Prinz Eugen Stra?e 72/2/4, Vienna, 1040 Austria > Nucleus? | Linux? | Android(tm) | Services | UI | Multi-OS > > Android is a trademark of Google Inc. Use of this trademark is subject > to Google Permissions. > Linux is the registered trademark of Linus Torvalds in the U.S. and > other countries. > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 09:47:49 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 09:47:49 -0400 Subject: [lttng-dev] Application freeze at startup with LTTng-UST and Perl dlopen() - TRACEPOINT_PROBE_DYNAMIC_LINKAGE? In-Reply-To: <20998D40D9A2B7499CA5A3A2666CB1EB19F97108@ZURMSG1.QUANTUM.com> References: <20998D40D9A2B7499CA5A3A2666CB1EB19F97108@ZURMSG1.QUANTUM.com> Message-ID: <20130502134748.GG7035@Krystal> Hi David, Sorry for late reply, * David OShea (David.OShea at quantum.com) wrote: > Hi all, > > I'm getting freezes at application startup with LTTng-UST which I > assume are due to my lack of understanding of > TRACEPOINT_PROBE_DYNAMIC_LINKAGE. > > I'm running: > - lttng-tools-2.0.4 > - lttng-ust-2.0.5 patched with 009745db "Cache the procname per-thread > rather than per-process to take into account that prctl() can be used > to set thread names." and e699eda "don't spawn per-user thread if HOME > is not set". please try to reproduce against lttng-ust/lttng-tools master branch. > - liburcu0-0.7.4-0 > > This is being run on CentOS 5.4. > > The lttng-ust man page says: > > """ > BUILDING/LINKING THE TRACEPOINT PROVIDER > [...] > 1.1) Compile the Tracepoint provider with the application, either > directly or through a static library (.a): > [...] > 2) Compile the Tracepoint Provider separately from the application, > using dynamic linking: > - Into exactly one object of your application: define > "TRACEPOINT_DEFINE" _and_ also define > "TRACEPOINT_PROBE_DYNAMIC_LINKAGE", then include the tracepoint > provider header. > [...] > """ > > I have a dynamic library that includes code with tracepoint() calls, > plus the relevant tracepoint definitions and trace providers - it is > sort of "self-contained". My Perl script dlopen()s this dynamic > library. Am I correct in thinking that this falls into option 2) > above, because whilst the trace provider is statically linked with the > code that uses the tracepoints, the trace provider is being > dynamically linked into the application, and that is the part that > matters to LTTng? yes. > > When I build this dynamic library without > TRACEPOINT_PROBE_DYNAMIC_LINKAGE #defined in the tracepoint > definitions, Well, this is not the right approach for option 2). > I get a freeze that looks like > https://bugs.lttng.org/issues/142 from the strace output: > > """ > open("/usr/lib64/liburcu-common.so.1", O_RDONLY) = 4 > read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\7`\0310\0\0\0"..., 832) = 832 > fstat(4, {st_mode=S_IFREG|0755, st_size=9464, ...}) = 0 > mmap(0x3019600000, 2102552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x3019600000 > mprotect(0x3019602000, 2093056, PROT_NONE) = 0 > mmap(0x3019801000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x1000) = 0x3019801000 > close(4) = 0 > mprotect(0x3fd3607000, 4096, PROT_READ) = 0 > munmap(0x2ae2a2766000, 49028) = 0 > open("/dev/urandom", O_RDONLY) = 4 > fcntl(4, F_GETFD) = 0 > fcntl(4, F_SETFD, FD_CLOEXEC) = 0 > getuid() = 0 > getppid() = 8809 > read(4, "\266\310we\347u\31\336\33\266 \262C\3267\32", 16) = 16 > gettid() = 8810 > clock_gettime(CLOCK_REALTIME, {1361753274, 392351000}) = 0 > getuid() = 0 > geteuid() = 0 > rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0 > mmap(NULL, 10489856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_32BIT, -1, 0) = 0x4023d000 > mprotect(0x4023d000, 4096, PROT_NONE) = 0 > clone(child_stack=0x40c3d250, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x40c3d9d0, tls=0x40c3d940, child_tidptr=0x40c3d9d0) = 8811 > mmap(NULL, 10489856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_32BIT, -1, 0) = 0x41e43000 > mprotect(0x41e43000, 4096, PROT_NONE) = 0 > clone(child_stack=0x42843250, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x428439d0, tls=0x42843940, child_tidptr=0x428439d0) = 8812 > rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 > futex(0x2ae2a29a5a80, FUTEX_WAIT_PRIVATE, 0, {2, 999506000}) = -1 ETIMEDOUT (Connection timed out) > gettid() = 8810 > write(2, "libust[8810/8810]: Error: Timed "..., 107libust[8810/8810]: Error: Timed out waiting for ltt-sessiond (in lttng_ust_init() at lttng-ust-comm.c:952) > ) = 107 > futex(0x2ae2a29a5b00, FUTEX_WAIT_PRIVATE, 2, NULL > """ > (freeze at this point) > > I realise that bug 142 is fixed in the version of the code I'm running. > > I also found that, even though the Perl script does not fork() (unless > I'm very much mistaken), I would not be surprised at all that perl would indeed use fork(). > if I 'export > LD_PRELOAD=/usr/lib64/liblttng-ust-fork.so.0' and then run a shell > script that invokes 'perl ...' to start the script, the problem goes > away. That would seem to confirm that perl itself indeed uses fork(). > Is this because, when the shell fork()s to start Perl, > liblttng-ust-fork.so.0 will cause LTTng to be initialised in the new > process much earlier than is the case with just the dlopen()? it rather looks like perl is using fork() or clone(). > > I played around with another script and dynamic library combination > and found a similar problem occurred on CentOS 5.4, but when I used > the same LTTng-UST and related libraries on Fedora 16, I didn't get > the freeze. > trying with newer lttng-ust/lttng-tools version would be useful here. > Finally, I noticed that commit ID > b834deadbfa8a78ae1d00440fd91c41dfd351eba changed README to remove a > note suggesting that dlopen() not be used. It looks like the same > change should be made to doc/man/lttng-ust.3, which still suggests > that you not use dlopen(). Looking at lttng-ust master branch, it seems to be fixed now. Thanks, Mathieu > > Thanks in advance, > David > > ---------------------------------------------------------------------- > The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt. > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 10:00:04 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 10:00:04 -0400 Subject: [lttng-dev] How to disable an event that's been enabled by a wildcard selection or -a? In-Reply-To: <20130502134010.GF7035@Krystal> References: <009B25148989C6458484484699278506985C0CFA@EU-MBX-01.mgc.mentorg.com> <20998D40D9A2B7499CA5A3A2666CB1EB19F968AF@ZURMSG1.QUANTUM.com> <5121EA9A.8080905@mentor.com> <20130502134010.GF7035@Krystal> Message-ID: <20130502140004.GA7584@Krystal> * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: > * Woegerer, Paul (Paul_Woegerer at mentor.com) wrote: > > Hi David, > > > > On 02/14/2013 05:52 AM, David OShea wrote: > > > Hi, > > > > > > My understanding (hopefully someone will correct me if I'm wrong) is that each time you invoke 'lttng enable-event', your specification for the events you want enabled is stored and applied, and/or potentially applied later if a new application connects to the session daemon. All 'lttng disable-event' does is remove one of the specifications you previously provided to 'lttng enable-event', so you can't say 'enable-event *' and then 'disable-event foo:*' to get all events except 'foo:*'. > > > > > > If you could constrain the application to use a particular trace provider name for all of its tracepoints, say "app", then you could just do 'lttng enable-event app:*'. If you can't do that, then I think you need to fall back on getting a list of all the available tracepoints using 'lttng list -u', parsing this to find all of the available tracepoints, extracting the trace provider name from them, then using 'lttng enable-event :*' for each provider other than the provider from your uninteresting library. I think there are APIs that can be used instead of issuing the 'lttng' commands. > > > > > > I would certainly also like a way to be able to, say, enable all events other than foo:* and bar:* using one command. > > > > I submitted a patch that does exactly this a while ago: > > http://lists.lttng.org/pipermail/lttng-dev/2012-June/018179.html > > > > Although it's not upstream it works well for us. > > Hi Paul, > > I would be interested to see this feature upstream. Previously was not a > good timing to pull it in, because we were adding the concept of event > "enablers" within lttng-ust. > > One thing I'm curious about is how you present the logical combination > with exlusion match are present. For instance, if we only have > inclusion, we get: > > lttng enable-event 'a' > lttng enable-event 'c' > lttng enable-event 'zc*' > > it turns into : (a || c || zc*) > > I expect that negation would look like: > > lttng enable-event 'a' > lttng enable-event '!abc*' > lttng enable-event 'c' > lttng enable-event '!cxx' > lttng enable-event 'zc*' > > -> !(abc* || cxx) || (a || c || zc*) I actually meant: !(abc* || cxx) && (a || c || zc*) Thanks, Mathieu > > Am I correct ? If yes, we should expand lttng-tools lttng(1) manpage and > cmd help with this info. > > Can you make sure it works well with lttng-ust master branch ? > > Thanks, > > Mathieu > > > > > Thanks, > > Paul > > > > > > > > > > Regards, > > > David > > > > > >> -----Original Message----- > > >> From: Ikaheimonen, JP [mailto:jp_ikaheimonen at mentor.com] > > >> Sent: Friday, 8 February 2013 7:56 PM > > >> To: lttng-dev at lists.lttng.org > > >> Subject: [lttng-dev] How to disable an event that's been enabled by a > > >> wildcard selection or -a? > > >> > > >> Consider the following scenario. > > >> I want to write a script that traces all UST tracepoints of a given > > >> application. I have no idea what the names of these tracepoints are. > > >> Also, I know that the application uses a library that contains some > > >> tracepoints I am not interested about. Now I want to trace all UST > > >> tracepoints except the ones I already know about. Is this possible with > > >> the lttng commands? > > >> > > >> If I enable all tracepoints with "lttng enable-event -u -a" I get all > > >> events, even those I do not want. I've tried using "lttng disable- > > >> event", and "lttng enable-event" with a filter, but I cannot seem to be > > >> able to get rid of the specific events. > > >> > > >> Thank you, > > >> > > >> JP Ikaheimonen > > >> Mentor Graphics Embedded Systems Division > > >> Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS > > >> > > >> Android is a trademark of Google Inc. Use of this trademark is subject > > >> to Google Permissions. > > >> Linux is the registered trademark of Linus Torvalds in the U.S. and > > >> other countries. > > >> > > >> _______________________________________________ > > >> lttng-dev mailing list > > >> lttng-dev at lists.lttng.org > > >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > > > ---------------------------------------------------------------------- > > > The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt. > > > > > > _______________________________________________ > > > lttng-dev mailing list > > > lttng-dev at lists.lttng.org > > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > > > > > > -- > > Paul Woegerer | SW Development Engineer > > http://go.mentor.com/sourceryanalyzer > > > > Mentor Embedded(tm) | Prinz Eugen Stra?e 72/2/4, Vienna, 1040 Austria > > Nucleus? | Linux? | Android(tm) | Services | UI | Multi-OS > > > > Android is a trademark of Google Inc. Use of this trademark is subject > > to Google Permissions. > > Linux is the registered trademark of Linus Torvalds in the U.S. and > > other countries. > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 10:21:00 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 10:21:00 -0400 Subject: [lttng-dev] [Babeltrace PATCH] Add new option --clock-offset-ns In-Reply-To: <009B25148989C6458484484699278506E5371E30@EU-MBX-03.mgc.mentorg.com> References: <009B25148989C6458484484699278506E5371E30@EU-MBX-03.mgc.mentorg.com> Message-ID: <20130502142100.GA7353@Krystal> merged, thanks! Mathieu * Ikaheimonen, JP (jp_ikaheimonen at mentor.com) wrote: > > Add a new option --clock-offset-ns. It requires a parameter > that specifies a clock offset (in nanoseconds) that is added > to each timestamp. > > This works exactly as the option --clock-offset, except that > the value is given in nanoseconds instead of full seconds. > > The two options --clock-offset and --clock-offset-ns are > compatible with each other, and it's possible to give both. > For example, having the options > > --clock-offset 2 --clock-offset-ns 1000000 > > means that 2.001 seconds is added to each timestamp. > --- > converter/babeltrace.c | 26 ++++++++++++++++++++++++++ > formats/ctf/ctf.c | 4 ++++ > include/babeltrace/babeltrace-internal.h | 1 + > 3 files changed, 31 insertions(+) > > diff --git a/converter/babeltrace.c b/converter/babeltrace.c > index 83f300c..bfdfc47 100644 > --- a/converter/babeltrace.c > +++ b/converter/babeltrace.c > @@ -92,6 +92,7 @@ enum { > OPT_FIELDS, > OPT_NO_DELTA, > OPT_CLOCK_OFFSET, > + OPT_CLOCK_OFFSET_NS, > OPT_CLOCK_CYCLES, > OPT_CLOCK_SECONDS, > OPT_CLOCK_DATE, > @@ -120,6 +121,7 @@ static struct poptOption long_options[] = { > { "fields", 'f', POPT_ARG_STRING, NULL, OPT_FIELDS, NULL, NULL }, > { "no-delta", 0, POPT_ARG_NONE, NULL, OPT_NO_DELTA, NULL, NULL }, > { "clock-offset", 0, POPT_ARG_STRING, NULL, OPT_CLOCK_OFFSET, NULL, NULL }, > + { "clock-offset-ns", 0, POPT_ARG_STRING, NULL, OPT_CLOCK_OFFSET_NS, NULL, NULL }, > { "clock-cycles", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_CYCLES, NULL, NULL }, > { "clock-seconds", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_SECONDS, NULL, NULL }, > { "clock-date", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_DATE, NULL, NULL }, > @@ -163,6 +165,7 @@ static void usage(FILE *fp) > fprintf(fp, " (default: trace:hostname,trace:procname,trace:vpid)\n"); > fprintf(fp, " --clock-cycles Timestamp in cycles\n"); > fprintf(fp, " --clock-offset seconds Clock offset in seconds\n"); > + fprintf(fp, " --clock-offset-ns ns Clock offset in nanoseconds\n"); > fprintf(fp, " --clock-seconds Print the timestamps as [sec.ns]\n"); > fprintf(fp, " (default is: [hh:mm:ss.ns])\n"); > fprintf(fp, " --clock-date Print clock date\n"); > @@ -356,6 +359,29 @@ static int parse_options(int argc, char **argv) > case OPT_CLOCK_SECONDS: > opt_clock_seconds = 1; > break; > + case OPT_CLOCK_OFFSET_NS: > + { > + char *str; > + char *endptr; > + > + str = (char *) poptGetOptArg(pc); > + if (!str) { > + fprintf(stderr, "[error] Missing --clock-offset-ns argument\n"); > + ret = -EINVAL; > + goto end; > + } > + errno = 0; > + opt_clock_offset_ns = strtoull(str, &endptr, 0); > + if (*endptr != '\0' || str == endptr || errno != 0) { > + fprintf(stderr, "[error] Incorrect --clock-offset-ns argument: %s\n", str); > + ret = -EINVAL; > + free(str); > + goto end; > + } > + free(str); > + break; > + } > + > case OPT_CLOCK_DATE: > opt_clock_date = 1; > break; > diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c > index 5a51495..4f320a6 100644 > --- a/formats/ctf/ctf.c > +++ b/formats/ctf/ctf.c > @@ -72,6 +72,7 @@ int opt_clock_cycles, > opt_clock_gmt; > > uint64_t opt_clock_offset; > +uint64_t opt_clock_offset_ns; > > extern int yydebug; > > @@ -316,6 +317,9 @@ void ctf_print_timestamp_real(FILE *fp, > > ts_nsec = timestamp; > > + /* Add command-line offset in ns*/ > + ts_nsec += opt_clock_offset_ns; > + > /* Add command-line offset */ > ts_sec += opt_clock_offset; > > diff --git a/include/babeltrace/babeltrace-internal.h b/include/babeltrace/babeltrace-internal.h > index 6219b3a..81ea9b9 100644 > --- a/include/babeltrace/babeltrace-internal.h > +++ b/include/babeltrace/babeltrace-internal.h > @@ -85,5 +85,6 @@ extern int opt_all_field_names, > opt_clock_force_correlate; > > extern uint64_t opt_clock_offset; > +extern uint64_t opt_clock_offset_ns; > > #endif > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 10:47:32 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 10:47:32 -0400 Subject: [lttng-dev] [PATCH v5 lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <1365801312-6401-1-git-send-email-simon.marchi@polymtl.ca> References: <1365801312-6401-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: <20130502144732.GA8719@Krystal> Acked-by: Mathieu Desnoyers David, can you merge it ? Thanks, Mathieu * Simon Marchi (simon.marchi at polymtl.ca) wrote: > --subbuf-size accepts sizes such as: > > - 123 -> 123 > - 123k -> 123 * 1024 > - 123M -> 123 * 1024^2 > - 123G -> 123 * 1024^3 > > It uses the new parse_size_suffix function, which could probably be used > at other places, such as tracefile size. > > Unit tests are included. > > Signed-off-by: Simon Marchi > --- > New in v5: > - parse_size_suffix -> utils_parse_size_suffix > - Use base 0 with strtoull, which means we can also pass sizes in octal > and hexadecimal > - New tests case for octal and hex > - Minor rework in valid test cases structure > - Formatting/coding style > > src/bin/lttng/commands/enable_channels.c | 21 ++++- > src/common/utils.c | 128 +++++++++++++++++++++++++++++ > src/common/utils.h | 9 ++ > tests/unit/Makefile.am | 15 +++- > tests/unit/test_utils_parse_size_suffix.c | 87 +++++++++++++++++++ > 5 files changed, 254 insertions(+), 6 deletions(-) > create mode 100644 tests/unit/test_utils_parse_size_suffix.c > > diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c > index d026af4..093954f 100644 > --- a/src/bin/lttng/commands/enable_channels.c > +++ b/src/bin/lttng/commands/enable_channels.c > @@ -66,7 +66,7 @@ static struct poptOption long_options[] = { > {"userspace", 'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0}, > {"discard", 0, POPT_ARG_NONE, 0, OPT_DISCARD, 0, 0}, > {"overwrite", 0, POPT_ARG_NONE, 0, OPT_OVERWRITE, 0, 0}, > - {"subbuf-size", 0, POPT_ARG_DOUBLE, 0, OPT_SUBBUF_SIZE, 0, 0}, > + {"subbuf-size", 0, POPT_ARG_STRING, 0, OPT_SUBBUF_SIZE, 0, 0}, > {"num-subbuf", 0, POPT_ARG_INT, 0, OPT_NUM_SUBBUF, 0, 0}, > {"switch-timer", 0, POPT_ARG_INT, 0, OPT_SWITCH_TIMER, 0, 0}, > {"read-timer", 0, POPT_ARG_INT, 0, OPT_READ_TIMER, 0, 0}, > @@ -289,6 +289,7 @@ int cmd_enable_channels(int argc, const char **argv) > int opt, ret = CMD_SUCCESS; > static poptContext pc; > char *session_name = NULL; > + char *opt_arg = NULL; > > init_channel_config(); > > @@ -309,8 +310,22 @@ int cmd_enable_channels(int argc, const char **argv) > DBG("Channel set to overwrite"); > break; > case OPT_SUBBUF_SIZE: > - /* TODO Replace atol with strtol and check for errors */ > - chan.attr.subbuf_size = atol(poptGetOptArg(pc)); > + /* Parse the size */ > + opt_arg = poptGetOptArg(pc); > + if (utils_parse_size_suffix(opt_arg, &chan.attr.subbuf_size) < 0) { > + ERR("Wrong value the --subbuf-size parameter: %s", opt_arg); > + ret = CMD_ERROR; > + goto end; > + } > + > + /* Check if power of 2 */ > + if ((chan.attr.subbuf_size - 1) & chan.attr.subbuf_size) { > + ERR("The subbuf size is not a power of 2: %" PRIu64 " (%s)", > + chan.attr.subbuf_size, opt_arg); > + ret = CMD_ERROR; > + goto end; > + } > + > DBG("Channel subbuf size set to %" PRIu64, chan.attr.subbuf_size); > break; > case OPT_NUM_SUBBUF: > diff --git a/src/common/utils.c b/src/common/utils.c > index b16cdc9..a7cec6b 100644 > --- a/src/common/utils.c > +++ b/src/common/utils.c > @@ -26,6 +26,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -386,3 +387,130 @@ int utils_rotate_stream_file(char *path_name, char *file_name, uint64_t size, > error: > return ret; > } > + > +/** > + * Prints the error message corresponding to a regex error code. > + * > + * @param errcode The error code. > + * @param regex The regex object that produced the error code. > + */ > +static void regex_print_error(int errcode, regex_t *regex) > +{ > + /* Get length of error message and allocate accordingly */ > + size_t length; > + char *buffer; > + > + assert(regex != NULL); > + > + length = regerror(errcode, regex, NULL, 0); > + if (length == 0) { > + ERR("regerror returned a length of 0"); > + return; > + } > + > + buffer = zmalloc(length); > + if (!buffer) { > + ERR("regex_print_error: zmalloc failed"); > + return; > + } > + > + /* Get and print error message */ > + regerror(errcode, regex, buffer, length); > + ERR("regex error: %s\n", buffer); > + free(buffer); > + > +} > + > +/** > + * Parse a string that represents a size in human readable format. It > + * supports decimal integers suffixed by 'k', 'M' or 'G'. > + * > + * The suffix multiply the integer by: > + * 'k': 1024 > + * 'M': 1024^2 > + * 'G': 1024^3 > + * > + * @param str The string to parse. > + * @param size Pointer to a size_t that will be filled with the > + * resulting size. > + * > + * @return 0 on success, -1 on failure. > + */ > +int utils_parse_size_suffix(char *str, uint64_t *size) > +{ > + regex_t regex; > + int ret; > + const int nmatch = 3; > + regmatch_t suffix_match, matches[nmatch]; > + unsigned long long base_size; > + long shift = 0; > + > + if (!str) { > + return 0; > + } > + > + /* Compile regex */ > + ret = regcomp(®ex, "^\\(0x\\)\\{0,1\\}[0-9][0-9]*\\([kKMG]\\{0,1\\}\\)$", 0); > + > + /* Check for regex error */ > + if (ret != 0) { > + regex_print_error(ret, ®ex); > + ret = -1; > + goto end; > + } > + > + /* Match regex */ > + ret = regexec(®ex, str, nmatch, matches, 0); > + if (ret != 0) { > + /* There is no match (or error) */ > + ret = -1; > + goto free; > + } > + > + /* There is a match ! */ > + errno = 0; > + base_size = strtoull(str, NULL, 0); > + /* Check result of conversion */ > + if (errno != 0) { > + PERROR("strtoull"); > + ret = -1; > + goto free; > + } > + > + /* Check if there is a suffix */ > + suffix_match = matches[2]; > + if (suffix_match.rm_eo - suffix_match.rm_so == 1) { > + switch (*(str + suffix_match.rm_so)) { > + case 'K': > + case 'k': > + shift = KIBI_LOG2; > + break; > + case 'M': > + shift = MEBI_LOG2; > + break; > + case 'G': > + shift = GIBI_LOG2; > + break; > + default: > + ERR("parse_human_size: invalid suffix"); > + ret = -1; > + goto free; > + } > + } > + > + *size = base_size << shift; > + > + /* Check for overflow */ > + if ((*size >> shift) != base_size) { > + ERR("parse_size_suffix: oops, overflow detected."); > + ret = -1; > + goto free; > + } > + > + ret = 0; > + > +free: > + regfree(®ex); > +end: > + return ret; > +} > diff --git a/src/common/utils.h b/src/common/utils.h > index 2d39cef..d8a5321 100644 > --- a/src/common/utils.h > +++ b/src/common/utils.h > @@ -18,6 +18,14 @@ > #ifndef _COMMON_UTILS_H > #define _COMMON_UTILS_H > > +#include > +#include > +#include > + > +#define KIBI_LOG2 10 > +#define MEBI_LOG2 20 > +#define GIBI_LOG2 30 > + > char *utils_expand_path(const char *path); > int utils_create_pipe(int *dst); > int utils_create_pipe_cloexec(int *dst); > @@ -30,5 +38,6 @@ int utils_create_stream_file(char *path_name, char *file_name, uint64_t size, > uint64_t count, int uid, int gid); > int utils_rotate_stream_file(char *path_name, char *file_name, uint64_t size, > uint64_t count, int uid, int gid, int out_fd, uint64_t *new_count); > +int utils_parse_size_suffix(char *str, uint64_t *size); > > #endif /* _COMMON_UTILS_H */ > diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am > index 67e7fe4..e8a6429 100644 > --- a/tests/unit/Makefile.am > +++ b/tests/unit/Makefile.am > @@ -14,10 +14,11 @@ LIBCOMMON=$(top_builddir)/src/common/libcommon.la > LIBSESSIOND_COMM=$(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la > LIBHASHTABLE=$(top_builddir)/src/common/hashtable/libhashtable.la > > +# Define test programs > +noinst_PROGRAMS = test_uri test_session test_kernel_data test_utils_parse_size_suffix > + > if HAVE_LIBLTTNG_UST_CTL > -noinst_PROGRAMS = test_uri test_session test_ust_data test_kernel_data > -else > -noinst_PROGRAMS = test_uri test_session test_kernel_data > +noinst_PROGRAMS += test_ust_data > endif > > # URI unit tests > @@ -69,3 +70,11 @@ test_kernel_data_SOURCES = test_kernel_data.c > test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ > -lrt > test_kernel_data_LDADD += $(KERN_DATA_TRACE) > + > +# parse_size_suffix unit test > +UTILS_PARSE_SIZE_SUFFIX=$(top_srcdir)/src/common/utils.o \ > + $(top_srcdir)/src/common/runas.o > + > +test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c > +test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) > +test_utils_parse_size_suffix_LDADD += $(UTILS_PARSE_SIZE_SUFFIX) > diff --git a/tests/unit/test_utils_parse_size_suffix.c b/tests/unit/test_utils_parse_size_suffix.c > new file mode 100644 > index 0000000..3b9c68c > --- /dev/null > +++ b/tests/unit/test_utils_parse_size_suffix.c > @@ -0,0 +1,87 @@ > +/* > + * Copyright (C) - 2013 Simon Marchi > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License as published by as > + * published by the Free Software Foundation; only version 2 of the License. > + * > + * This program is distributed in the hope that it will be useful, but WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > + * more details. > + * > + * You should have received a copy of the GNU General Public License along with > + * this program; if not, write to the Free Software Foundation, Inc., 51 > + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +#include > +#include > +#include > + > +#include > + > +#include > + > +/* For lttngerr.h */ > +int lttng_opt_quiet = 1; > +int lttng_opt_verbose = 3; > + > +struct valid_test_input { > + char *input; > + uint64_t expected_result; > +}; > + > +/* Valid test cases */ > +static struct valid_test_input valid_tests_inputs[] = { > + { "0", 0 }, > + { "1234", 1234 }, > + { "0x400", 1024 }, > + { "0300", 192 }, > + { "16k", 16384 }, > + { "128K", 131072 }, > + { "0x1234k", 4771840 }, > + { "32M", 33554432 }, > + { "1024G", 1099511627776 }, > +}; > +static const int num_valid_tests = sizeof(valid_tests_inputs) / sizeof(valid_tests_inputs[0]); > + > +/* Invalid test cases */ > +static char *invalid_tests_inputs[] = { "", "-1", "k", "4611686018427387904G" }; > +static const int num_invalid_tests = sizeof(invalid_tests_inputs) / sizeof(invalid_tests_inputs[0]); > + > +static void test_utils_parse_size_suffix(void) > +{ > + uint64_t result; > + int ret; > + int i; > + > + /* Test valid cases */ > + for (i = 0; i < num_valid_tests; i++) { > + char name[100]; > + sprintf(name, "valid test case: %s", valid_tests_inputs[i].input); > + > + ret = utils_parse_size_suffix(valid_tests_inputs[i].input, &result); > + ok(ret == 0 && result == valid_tests_inputs[i].expected_result, name); > + } > + > + /* Test invalid cases */ > + for (i = 0; i < num_invalid_tests; i++) { > + char name[100]; > + sprintf(name, "invalid test case: %s", invalid_tests_inputs[i]); > + > + ret = utils_parse_size_suffix(invalid_tests_inputs[i], &result); > + ok(ret != 0, name); > + } > +} > + > +int main(int argc, char **argv) > +{ > + plan_tests(num_valid_tests + num_invalid_tests); > + > + diag("utils_parse_size_suffix tests"); > + > + test_utils_parse_size_suffix(); > + > + return exit_status(); > +} > -- > 1.7.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From christian.babeux at efficios.com Thu May 2 10:52:59 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 2 May 2013 10:52:59 -0400 Subject: [lttng-dev] [PATCH v5 lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <20130502144732.GA8719@Krystal> References: <1365801312-6401-1-git-send-email-simon.marchi@polymtl.ca> <20130502144732.GA8719@Krystal> Message-ID: Just a heads up, this patch depends on another one posted by Simon earlier: [RFC PATCH lttng-tools] Unit tests: don't rebuild units under test Reviewed-by: Christian Babeux On Thu, May 2, 2013 at 10:47 AM, Mathieu Desnoyers wrote: > Acked-by: Mathieu Desnoyers > > David, can you merge it ? > > Thanks, > > Mathieu > > * Simon Marchi (simon.marchi at polymtl.ca) wrote: >> --subbuf-size accepts sizes such as: >> >> - 123 -> 123 >> - 123k -> 123 * 1024 >> - 123M -> 123 * 1024^2 >> - 123G -> 123 * 1024^3 >> >> It uses the new parse_size_suffix function, which could probably be used >> at other places, such as tracefile size. >> >> Unit tests are included. >> >> Signed-off-by: Simon Marchi >> --- >> New in v5: >> - parse_size_suffix -> utils_parse_size_suffix >> - Use base 0 with strtoull, which means we can also pass sizes in octal >> and hexadecimal >> - New tests case for octal and hex >> - Minor rework in valid test cases structure >> - Formatting/coding style >> >> src/bin/lttng/commands/enable_channels.c | 21 ++++- >> src/common/utils.c | 128 +++++++++++++++++++++++++++++ >> src/common/utils.h | 9 ++ >> tests/unit/Makefile.am | 15 +++- >> tests/unit/test_utils_parse_size_suffix.c | 87 +++++++++++++++++++ >> 5 files changed, 254 insertions(+), 6 deletions(-) >> create mode 100644 tests/unit/test_utils_parse_size_suffix.c >> >> diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c >> index d026af4..093954f 100644 >> --- a/src/bin/lttng/commands/enable_channels.c >> +++ b/src/bin/lttng/commands/enable_channels.c >> @@ -66,7 +66,7 @@ static struct poptOption long_options[] = { >> {"userspace", 'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0}, >> {"discard", 0, POPT_ARG_NONE, 0, OPT_DISCARD, 0, 0}, >> {"overwrite", 0, POPT_ARG_NONE, 0, OPT_OVERWRITE, 0, 0}, >> - {"subbuf-size", 0, POPT_ARG_DOUBLE, 0, OPT_SUBBUF_SIZE, 0, 0}, >> + {"subbuf-size", 0, POPT_ARG_STRING, 0, OPT_SUBBUF_SIZE, 0, 0}, >> {"num-subbuf", 0, POPT_ARG_INT, 0, OPT_NUM_SUBBUF, 0, 0}, >> {"switch-timer", 0, POPT_ARG_INT, 0, OPT_SWITCH_TIMER, 0, 0}, >> {"read-timer", 0, POPT_ARG_INT, 0, OPT_READ_TIMER, 0, 0}, >> @@ -289,6 +289,7 @@ int cmd_enable_channels(int argc, const char **argv) >> int opt, ret = CMD_SUCCESS; >> static poptContext pc; >> char *session_name = NULL; >> + char *opt_arg = NULL; >> >> init_channel_config(); >> >> @@ -309,8 +310,22 @@ int cmd_enable_channels(int argc, const char **argv) >> DBG("Channel set to overwrite"); >> break; >> case OPT_SUBBUF_SIZE: >> - /* TODO Replace atol with strtol and check for errors */ >> - chan.attr.subbuf_size = atol(poptGetOptArg(pc)); >> + /* Parse the size */ >> + opt_arg = poptGetOptArg(pc); >> + if (utils_parse_size_suffix(opt_arg, &chan.attr.subbuf_size) < 0) { >> + ERR("Wrong value the --subbuf-size parameter: %s", opt_arg); >> + ret = CMD_ERROR; >> + goto end; >> + } >> + >> + /* Check if power of 2 */ >> + if ((chan.attr.subbuf_size - 1) & chan.attr.subbuf_size) { >> + ERR("The subbuf size is not a power of 2: %" PRIu64 " (%s)", >> + chan.attr.subbuf_size, opt_arg); >> + ret = CMD_ERROR; >> + goto end; >> + } >> + >> DBG("Channel subbuf size set to %" PRIu64, chan.attr.subbuf_size); >> break; >> case OPT_NUM_SUBBUF: >> diff --git a/src/common/utils.c b/src/common/utils.c >> index b16cdc9..a7cec6b 100644 >> --- a/src/common/utils.c >> +++ b/src/common/utils.c >> @@ -26,6 +26,7 @@ >> #include >> #include >> #include >> +#include >> >> #include >> #include >> @@ -386,3 +387,130 @@ int utils_rotate_stream_file(char *path_name, char *file_name, uint64_t size, >> error: >> return ret; >> } >> + >> +/** >> + * Prints the error message corresponding to a regex error code. >> + * >> + * @param errcode The error code. >> + * @param regex The regex object that produced the error code. >> + */ >> +static void regex_print_error(int errcode, regex_t *regex) >> +{ >> + /* Get length of error message and allocate accordingly */ >> + size_t length; >> + char *buffer; >> + >> + assert(regex != NULL); >> + >> + length = regerror(errcode, regex, NULL, 0); >> + if (length == 0) { >> + ERR("regerror returned a length of 0"); >> + return; >> + } >> + >> + buffer = zmalloc(length); >> + if (!buffer) { >> + ERR("regex_print_error: zmalloc failed"); >> + return; >> + } >> + >> + /* Get and print error message */ >> + regerror(errcode, regex, buffer, length); >> + ERR("regex error: %s\n", buffer); >> + free(buffer); >> + >> +} >> + >> +/** >> + * Parse a string that represents a size in human readable format. It >> + * supports decimal integers suffixed by 'k', 'M' or 'G'. >> + * >> + * The suffix multiply the integer by: >> + * 'k': 1024 >> + * 'M': 1024^2 >> + * 'G': 1024^3 >> + * >> + * @param str The string to parse. >> + * @param size Pointer to a size_t that will be filled with the >> + * resulting size. >> + * >> + * @return 0 on success, -1 on failure. >> + */ >> +int utils_parse_size_suffix(char *str, uint64_t *size) >> +{ >> + regex_t regex; >> + int ret; >> + const int nmatch = 3; >> + regmatch_t suffix_match, matches[nmatch]; >> + unsigned long long base_size; >> + long shift = 0; >> + >> + if (!str) { >> + return 0; >> + } >> + >> + /* Compile regex */ >> + ret = regcomp(®ex, "^\\(0x\\)\\{0,1\\}[0-9][0-9]*\\([kKMG]\\{0,1\\}\\)$", 0); >> + >> + /* Check for regex error */ >> + if (ret != 0) { >> + regex_print_error(ret, ®ex); >> + ret = -1; >> + goto end; >> + } >> + >> + /* Match regex */ >> + ret = regexec(®ex, str, nmatch, matches, 0); >> + if (ret != 0) { >> + /* There is no match (or error) */ >> + ret = -1; >> + goto free; >> + } >> + >> + /* There is a match ! */ >> + errno = 0; >> + base_size = strtoull(str, NULL, 0); >> + /* Check result of conversion */ >> + if (errno != 0) { >> + PERROR("strtoull"); >> + ret = -1; >> + goto free; >> + } >> + >> + /* Check if there is a suffix */ >> + suffix_match = matches[2]; >> + if (suffix_match.rm_eo - suffix_match.rm_so == 1) { >> + switch (*(str + suffix_match.rm_so)) { >> + case 'K': >> + case 'k': >> + shift = KIBI_LOG2; >> + break; >> + case 'M': >> + shift = MEBI_LOG2; >> + break; >> + case 'G': >> + shift = GIBI_LOG2; >> + break; >> + default: >> + ERR("parse_human_size: invalid suffix"); >> + ret = -1; >> + goto free; >> + } >> + } >> + >> + *size = base_size << shift; >> + >> + /* Check for overflow */ >> + if ((*size >> shift) != base_size) { >> + ERR("parse_size_suffix: oops, overflow detected."); >> + ret = -1; >> + goto free; >> + } >> + >> + ret = 0; >> + >> +free: >> + regfree(®ex); >> +end: >> + return ret; >> +} >> diff --git a/src/common/utils.h b/src/common/utils.h >> index 2d39cef..d8a5321 100644 >> --- a/src/common/utils.h >> +++ b/src/common/utils.h >> @@ -18,6 +18,14 @@ >> #ifndef _COMMON_UTILS_H >> #define _COMMON_UTILS_H >> >> +#include >> +#include >> +#include >> + >> +#define KIBI_LOG2 10 >> +#define MEBI_LOG2 20 >> +#define GIBI_LOG2 30 >> + >> char *utils_expand_path(const char *path); >> int utils_create_pipe(int *dst); >> int utils_create_pipe_cloexec(int *dst); >> @@ -30,5 +38,6 @@ int utils_create_stream_file(char *path_name, char *file_name, uint64_t size, >> uint64_t count, int uid, int gid); >> int utils_rotate_stream_file(char *path_name, char *file_name, uint64_t size, >> uint64_t count, int uid, int gid, int out_fd, uint64_t *new_count); >> +int utils_parse_size_suffix(char *str, uint64_t *size); >> >> #endif /* _COMMON_UTILS_H */ >> diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am >> index 67e7fe4..e8a6429 100644 >> --- a/tests/unit/Makefile.am >> +++ b/tests/unit/Makefile.am >> @@ -14,10 +14,11 @@ LIBCOMMON=$(top_builddir)/src/common/libcommon.la >> LIBSESSIOND_COMM=$(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la >> LIBHASHTABLE=$(top_builddir)/src/common/hashtable/libhashtable.la >> >> +# Define test programs >> +noinst_PROGRAMS = test_uri test_session test_kernel_data test_utils_parse_size_suffix >> + >> if HAVE_LIBLTTNG_UST_CTL >> -noinst_PROGRAMS = test_uri test_session test_ust_data test_kernel_data >> -else >> -noinst_PROGRAMS = test_uri test_session test_kernel_data >> +noinst_PROGRAMS += test_ust_data >> endif >> >> # URI unit tests >> @@ -69,3 +70,11 @@ test_kernel_data_SOURCES = test_kernel_data.c >> test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ >> -lrt >> test_kernel_data_LDADD += $(KERN_DATA_TRACE) >> + >> +# parse_size_suffix unit test >> +UTILS_PARSE_SIZE_SUFFIX=$(top_srcdir)/src/common/utils.o \ >> + $(top_srcdir)/src/common/runas.o >> + >> +test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c >> +test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) >> +test_utils_parse_size_suffix_LDADD += $(UTILS_PARSE_SIZE_SUFFIX) >> diff --git a/tests/unit/test_utils_parse_size_suffix.c b/tests/unit/test_utils_parse_size_suffix.c >> new file mode 100644 >> index 0000000..3b9c68c >> --- /dev/null >> +++ b/tests/unit/test_utils_parse_size_suffix.c >> @@ -0,0 +1,87 @@ >> +/* >> + * Copyright (C) - 2013 Simon Marchi >> + * >> + * This program is free software; you can redistribute it and/or modify it >> + * under the terms of the GNU General Public License as published by as >> + * published by the Free Software Foundation; only version 2 of the License. >> + * >> + * This program is distributed in the hope that it will be useful, but WITHOUT >> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or >> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for >> + * more details. >> + * >> + * You should have received a copy of the GNU General Public License along with >> + * this program; if not, write to the Free Software Foundation, Inc., 51 >> + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >> + */ >> + >> +#include >> +#include >> +#include >> + >> +#include >> + >> +#include >> + >> +/* For lttngerr.h */ >> +int lttng_opt_quiet = 1; >> +int lttng_opt_verbose = 3; >> + >> +struct valid_test_input { >> + char *input; >> + uint64_t expected_result; >> +}; >> + >> +/* Valid test cases */ >> +static struct valid_test_input valid_tests_inputs[] = { >> + { "0", 0 }, >> + { "1234", 1234 }, >> + { "0x400", 1024 }, >> + { "0300", 192 }, >> + { "16k", 16384 }, >> + { "128K", 131072 }, >> + { "0x1234k", 4771840 }, >> + { "32M", 33554432 }, >> + { "1024G", 1099511627776 }, >> +}; >> +static const int num_valid_tests = sizeof(valid_tests_inputs) / sizeof(valid_tests_inputs[0]); >> + >> +/* Invalid test cases */ >> +static char *invalid_tests_inputs[] = { "", "-1", "k", "4611686018427387904G" }; >> +static const int num_invalid_tests = sizeof(invalid_tests_inputs) / sizeof(invalid_tests_inputs[0]); >> + >> +static void test_utils_parse_size_suffix(void) >> +{ >> + uint64_t result; >> + int ret; >> + int i; >> + >> + /* Test valid cases */ >> + for (i = 0; i < num_valid_tests; i++) { >> + char name[100]; >> + sprintf(name, "valid test case: %s", valid_tests_inputs[i].input); >> + >> + ret = utils_parse_size_suffix(valid_tests_inputs[i].input, &result); >> + ok(ret == 0 && result == valid_tests_inputs[i].expected_result, name); >> + } >> + >> + /* Test invalid cases */ >> + for (i = 0; i < num_invalid_tests; i++) { >> + char name[100]; >> + sprintf(name, "invalid test case: %s", invalid_tests_inputs[i]); >> + >> + ret = utils_parse_size_suffix(invalid_tests_inputs[i], &result); >> + ok(ret != 0, name); >> + } >> +} >> + >> +int main(int argc, char **argv) >> +{ >> + plan_tests(num_valid_tests + num_invalid_tests); >> + >> + diag("utils_parse_size_suffix tests"); >> + >> + test_utils_parse_size_suffix(); >> + >> + return exit_status(); >> +} >> -- >> 1.7.1 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From yannick.brosseau at gmail.com Thu May 2 10:53:34 2013 From: yannick.brosseau at gmail.com (Yannick Brosseau) Date: Thu, 02 May 2013 10:53:34 -0400 Subject: [lttng-dev] LTTV for LTTng 2.x available in git master branch Message-ID: <51827DEE.7010101@gmail.com> Hi All, Earlier this week, I've pushed to git master the port of LTTV for the CTF traces of LTTng 2.x. Get it here: https://git.lttng.org/?p=lttv.git;a=summary The controlflow view and event view are now working correctly. I'm still working on code cleanup, on the resource view and on some performance improvement. Once that is done, I'll do a first release of that work. Yannick From jeremie.galarneau at efficios.com Thu May 2 10:56:22 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Thu, 2 May 2013 10:56:22 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 23/28] Add a MinGW substitute for openat() and related functions In-Reply-To: <009B25148989C6458484484699278506E537E9A6@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E9A6@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 8:04 AM, Ikaheimonen, JP wrote: > Check if the build system has openat() support. > If it does not, we have to open files based on the directory name > instead of the directory handle. Substitute openat() with > compat_openat() that also takes the directory path name as a > parameter. > If we don't have openat(), replace the function dirfd() with a dummy. > Also, if we don't have openat(), open() and close() will not > work for directories. Replace those with compat_opendirfd and > compat_closedirfd() with dummy equivalents, as the function > compat_openat() takes care of opening the file. > --- > configure.ac | 7 +++++ > converter/babeltrace-log.c | 10 +++---- > converter/babeltrace.c | 10 +++---- > formats/ctf/ctf.c | 8 +++--- > include/babeltrace/compat/dirent.h | 11 ++++++++ > include/babeltrace/compat/fcntl.h | 58 ++++++++++++++++++++++++++++++++++++++ > 6 files changed, 90 insertions(+), 14 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 5f9e38d..168fb91 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -84,6 +84,13 @@ AC_CHECK_LIB([c], [open_memstream], > ] > ) > > +# Check for openat > +AC_CHECK_LIB([c], [openat], > +[ > + AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_OPENAT], 1, [Has openat support.]) > +] > +) > + > AC_CHECK_LIB([popt], [poptGetContext], [], > [AC_MSG_ERROR([Cannot find popt.])] > ) > diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c > index b11eb99..ac3bb3f 100644 > --- a/converter/babeltrace-log.c > +++ b/converter/babeltrace-log.c > @@ -32,9 +32,9 @@ > #include > #include > #include > -#include > +#include > #include > -#include > +#include > #include > #include > #include > @@ -343,20 +343,20 @@ int main(int argc, char **argv) > perror("opendir"); > goto error_rmdir; > } > - dir_fd = dirfd(dir); > + dir_fd = compat_dirfd(dir); > if (dir_fd < 0) { > perror("dirfd"); > goto error_closedir; > } > > - fd = openat(dir_fd, "datastream", O_RDWR|O_CREAT, > + fd = compat_openat(s_outputname, dir_fd, "datastream", O_RDWR|O_CREAT, > S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); > if (fd < 0) { > perror("openat"); > goto error_closedirfd; > } > > - metadata_fd = openat(dir_fd, "metadata", O_RDWR|O_CREAT, > + metadata_fd = compat_openat(s_outputname, dir_fd, "metadata", O_RDWR|O_CREAT, > S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); > if (fd < 0) { > perror("openat"); > diff --git a/converter/babeltrace.c b/converter/babeltrace.c > index f4a9217..d449ea7 100644 > --- a/converter/babeltrace.c > +++ b/converter/babeltrace.c > @@ -45,7 +45,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > @@ -409,15 +409,15 @@ static int traverse_trace_dir(const char *fpath, const struct stat *sb, > if (tflag != FTW_D) > return 0; > > - dirfd = open(fpath, 0); > + dirfd = compat_opendirfd(fpath, 0); > if (dirfd < 0) { > fprintf(stderr, "[error] [Context] Unable to open trace " > "directory file descriptor.\n"); > return 0; /* partial error */ > } > - metafd = openat(dirfd, "metadata", O_RDONLY); > + metafd = compat_openat(fpath, dirfd, "metadata", O_RDONLY); > if (metafd < 0) { > - closeret = close(dirfd); > + closeret = compat_closedirfd(dirfd); > if (closeret < 0) { > perror("close"); > return -1; > @@ -430,7 +430,7 @@ static int traverse_trace_dir(const char *fpath, const struct stat *sb, > perror("close"); > return -1; /* failure */ > } > - closeret = close(dirfd); > + closeret = compat_closedirfd(dirfd); > if (closeret < 0) { > perror("close"); > return -1; /* failure */ > diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c > index c6043bc..7878555 100644 > --- a/formats/ctf/ctf.c > +++ b/formats/ctf/ctf.c > @@ -1078,7 +1078,7 @@ int ctf_open_trace_metadata_read(struct ctf_trace *td, > metadata_stream->pos.fd = -1; > } else { > td->metadata = &metadata_stream->parent; > - metadata_stream->pos.fd = openat(td->dirfd, "metadata", O_RDONLY); > + metadata_stream->pos.fd = compat_openat(td->parent.path, td->dirfd, "metadata", O_RDONLY); > if (metadata_stream->pos.fd < 0) { > fprintf(stderr, "Unable to open metadata.\n"); > ret = -1; > @@ -1624,7 +1624,7 @@ int ctf_open_file_stream_read(struct ctf_trace *td, const char *path, int flags, > struct ctf_file_stream *file_stream; > struct stat statbuf; > > - fd = openat(td->dirfd, path, flags); > + fd = compat_openat(td->parent.path, td->dirfd, path, flags); > if (fd < 0) { > perror("File stream openat()"); > ret = fd; > @@ -1717,7 +1717,7 @@ int ctf_open_trace_read(struct ctf_trace *td, > goto error; > } > > - td->dirfd = open(path, 0); > + td->dirfd = compat_opendirfd(path, 0); > if (td->dirfd < 0) { > fprintf(stderr, "[error] Unable to open trace directory file descriptor for path \"%s\".\n", path); > perror("Trace directory open"); > @@ -1775,7 +1775,7 @@ int ctf_open_trace_read(struct ctf_trace *td, > readdir_error: > free(dirent); > error_metadata: > - closeret = close(td->dirfd); > + closeret = compat_closedirfd(td->dirfd); > if (closeret) { > perror("Error on fd close"); > } > diff --git a/include/babeltrace/compat/dirent.h b/include/babeltrace/compat/dirent.h > index 281f40b..a7d6227 100644 > --- a/include/babeltrace/compat/dirent.h > +++ b/include/babeltrace/compat/dirent.h > @@ -17,4 +17,15 @@ int readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result) > } > #endif > > +static inline > +int compat_dirfd(DIR * dirp) > +{ > +#ifdef BABELTRACE_HAVE_OPENAT > + return dirfd(dirp); > +#else > + /* ignore dirfd - see compat_openat() */ > + return 0; > +#endif > +} > + > #endif > diff --git a/include/babeltrace/compat/fcntl.h b/include/babeltrace/compat/fcntl.h > index 0707c28..f58a1bf 100644 > --- a/include/babeltrace/compat/fcntl.h > +++ b/include/babeltrace/compat/fcntl.h > @@ -2,6 +2,10 @@ > #define _BABELTRACE_INCLUDE_COMPAT_FCNTL_H > > #include > +#include > +#include > +#include > + > #ifdef __MINGW32__ > static inline > int posix_fallocate(int fd, off_t offset, off_t len) > @@ -10,4 +14,58 @@ int posix_fallocate(int fd, off_t offset, off_t len) > } > #endif > > +/* > + If we have BABELTRACE_HAVE_OPENAT, then > + openat() and dirfd() work, and open() and close() can > + work on directories. > + > + If we don't have BABELTRACE_HAVE_OPENAT, > + then we have to open files based on the directory name, > + not the directory handle. The functions > + compat_[opendirfd | closedirfd | dirfd] all are dummied > + to return zero, and compat_openat() takes care of the > + opening of the file. > +*/ > + > +static inline > +int compat_openat(const char * dirname, int dirfd, const char *pathname, int flags, ...) > +{ > + > +#ifdef BABELTRACE_HAVE_OPENAT > + mode_t mode = 0; > + va_list args; > + va_start (args, flags); > + mode = (mode_t)va_arg(args, int); > + va_end(args); > + return openat(dirfd, pathname, flags, mode); > +#else > + char szSearch[MAX_PATH] = {0}; > + sprintf(szSearch, "%s/%s", dirname, pathname); > +#ifdef __MINGW32__ > + flags = flags | O_BINARY; > +#endif > + return open(szSearch, flags); > +#endif > +} > + > +static inline > +int compat_opendirfd(const char *fpath, int flags) > +{ > +#ifdef BABELTRACE_HAVE_OPENAT > + return open(fpath, flags); Clang issues a warning here: ../include/babeltrace/compat/fcntl.h:77:9: warning: implicit declaration of function 'close' is invalid in C99 [-Wimplicit-function-declaration] I think you are missing an include file (unistd.h). Regards, J?r?mie > +#else > + return 0; > +#endif > +} > + > +static inline > +int compat_closedirfd(int dirfd) > +{ > +#ifdef BABELTRACE_HAVE_OPENAT > + return close(dirfd); > +#else > + return 0; > +#endif > +} > + > #endif > \ No newline at end of file > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 10:58:27 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 10:58:27 -0400 Subject: [lttng-dev] lttng enable-channel option for blocking In-Reply-To: <4FA114B3.1040108@mentor.com> References: <4F992213.2090103@mentor.com> <20120426211627.GB1646@Krystal> <4F9A4A91.7090102@mentor.com> <20120427113321.GA6987@Krystal> <4F9A87F3.5090504@mentor.com> <20120427124344.GB21048@Krystal> <4F9AC627.2090203@mentor.com> <20120430142026.GA31622@Krystal> <4FA114B3.1040108@mentor.com> Message-ID: <20130502145827.GA8853@Krystal> * Woegerer, Paul (Paul_Woegerer at mentor.com) wrote: > On 04/30/2012 04:20 PM, Mathieu Desnoyers wrote: >> * Woegerer, Paul (Paul_Woegerer at mentor.com) wrote: >>> On 04/27/2012 02:43 PM, Mathieu Desnoyers wrote: >>>> * Woegerer, Paul (Paul_Woegerer at mentor.com) wrote: >>>>> On 04/27/2012 01:33 PM, Mathieu Desnoyers wrote: >>>>>> A core difference between ulimit and user-space tracing is that ulimit >>>>>> can only be set within the environment (and access right) of the user >>>>>> running the application. System-wide tracing sessions can be initiated >>>>>> by users member of the "tracing" group -- giving them the ability to >>>>>> potentially DoS an application does not appear to me to be a good >>>>>> security practice. Thoughts ? >>>>> Hmm, how would that look in practice ? Lets assume there is the web >>>>> server which was started by an init-script in runlevel 3. How does a >>>>> user that belongs to group tracing hava a chance to DoS the already >>>>> running running web server. As far as I understand the trace session >>>>> concept every tracing user can only see (and affect) the tracing session >>>>> that he initiated. Even if the web server itself runs in a tracing >>>>> session (of user wwwrun) other tracing users wouldn't see it when they >>>>> do a "lttng list", right ? >>>> Let me clarify the concept of tracing session in lttng 2.0. >>>> >>>> We support launching per-user sessiond, which only interact with the >>>> user's applications. That's all fine with security. >>>> >>>> Now, we also support a root system-wide sessiond, which allows kernel >>>> and user-space tracing. The "tracing" group has every right to create a >>>> tracing session and trace the kernel and _all_ applications that were >>>> already or will be running on the system. >>> Ah, I see. I was not aware of the "... and _all_ applications that were >>> already or will be running on the system" aspect of the concept. In that >>> case I would rather invert the semantic in the API and instead of having >>> a tracepoint() function that potentially blocks I would declare >>> tracepoint() to never ever block and additionally provide tracepointb() >>> that does potentially block. >> So keeping this in mind, one way to allow this kind of "blocking" mode >> might be to add a special option to the lttng-sessiond, e.g. a >> "--developer" mode, which could enable this feature, and possibly other >> features that are not "safe" to deploy on production machines. > > Sounds good. Our need for blocking channels is only during development > phase. > > In case of blocking it would be useful to emit a meta-event to indicate > that blocking happened. This allows to (optionally) factor out blocking > periods from event data visualizations. We already have start-end timestamps in packet headers. We can already compute blocking time by looking at the delta between consecutive packet's end time and start time. > > Thanks, > Paul > > PS: A more general question: In the light of the upcoming event > streaming support for LTTng, is it intended to use lttng for "regular" > event based real-time communication (non-tracing/debugging related) as > well. From that perspective, support for blocking (reliably emitted > events) would become mandatory (there might be events of kind > cooling_system_deactivated, containment_leakage_detected, ...). Well, currently lttng-tools is designed so that even if the consumerd is killed, the application traced with UST will continue running without any issue. Adding the option to "block" the application would require us to enhance the lttng-tools design in ways that would allow applications to continue behaving correctly in case of a sessiond/consumerd failure. That's the tricky part. Thanks, Mathieu > >> >> Thoughts ? >> >> Thanks, >> >> Mathieu >> > > > -- > Paul Woegerer | SW Development Engineer > Mentor Embedded(tm) | Prinz Eugen Stra?e 72/2/4, Vienna, 1040 Austria > P 43.1.535991320 > Nucleus? | Linux? | Android(tm) | Services | UI | Multi-OS > > Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. > Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Thu May 2 11:25:05 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 02 May 2013 11:25:05 -0400 Subject: [lttng-dev] [PATCH v5 lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <1365801312-6401-1-git-send-email-simon.marchi@polymtl.ca> References: <1365801312-6401-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: <51828551.80804@efficios.com> Merged. I've added some minor fixes like a missing include and documentation about +k,+M,+G in the help and man page. Thanks! Simon Marchi: > --subbuf-size accepts sizes such as: > > - 123 -> 123 > - 123k -> 123 * 1024 > - 123M -> 123 * 1024^2 > - 123G -> 123 * 1024^3 > > It uses the new parse_size_suffix function, which could probably be used > at other places, such as tracefile size. > > Unit tests are included. > > Signed-off-by: Simon Marchi > --- > New in v5: > - parse_size_suffix -> utils_parse_size_suffix > - Use base 0 with strtoull, which means we can also pass sizes in octal > and hexadecimal > - New tests case for octal and hex > - Minor rework in valid test cases structure > - Formatting/coding style > > src/bin/lttng/commands/enable_channels.c | 21 ++++- > src/common/utils.c | 128 +++++++++++++++++++++++++++++ > src/common/utils.h | 9 ++ > tests/unit/Makefile.am | 15 +++- > tests/unit/test_utils_parse_size_suffix.c | 87 +++++++++++++++++++ > 5 files changed, 254 insertions(+), 6 deletions(-) > create mode 100644 tests/unit/test_utils_parse_size_suffix.c > > diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c > index d026af4..093954f 100644 > --- a/src/bin/lttng/commands/enable_channels.c > +++ b/src/bin/lttng/commands/enable_channels.c > @@ -66,7 +66,7 @@ static struct poptOption long_options[] = { > {"userspace", 'u', POPT_ARG_NONE, 0, OPT_USERSPACE, 0, 0}, > {"discard", 0, POPT_ARG_NONE, 0, OPT_DISCARD, 0, 0}, > {"overwrite", 0, POPT_ARG_NONE, 0, OPT_OVERWRITE, 0, 0}, > - {"subbuf-size", 0, POPT_ARG_DOUBLE, 0, OPT_SUBBUF_SIZE, 0, 0}, > + {"subbuf-size", 0, POPT_ARG_STRING, 0, OPT_SUBBUF_SIZE, 0, 0}, > {"num-subbuf", 0, POPT_ARG_INT, 0, OPT_NUM_SUBBUF, 0, 0}, > {"switch-timer", 0, POPT_ARG_INT, 0, OPT_SWITCH_TIMER, 0, 0}, > {"read-timer", 0, POPT_ARG_INT, 0, OPT_READ_TIMER, 0, 0}, > @@ -289,6 +289,7 @@ int cmd_enable_channels(int argc, const char **argv) > int opt, ret = CMD_SUCCESS; > static poptContext pc; > char *session_name = NULL; > + char *opt_arg = NULL; > > init_channel_config(); > > @@ -309,8 +310,22 @@ int cmd_enable_channels(int argc, const char **argv) > DBG("Channel set to overwrite"); > break; > case OPT_SUBBUF_SIZE: > - /* TODO Replace atol with strtol and check for errors */ > - chan.attr.subbuf_size = atol(poptGetOptArg(pc)); > + /* Parse the size */ > + opt_arg = poptGetOptArg(pc); > + if (utils_parse_size_suffix(opt_arg, &chan.attr.subbuf_size) < 0) { > + ERR("Wrong value the --subbuf-size parameter: %s", opt_arg); > + ret = CMD_ERROR; > + goto end; > + } > + > + /* Check if power of 2 */ > + if ((chan.attr.subbuf_size - 1) & chan.attr.subbuf_size) { > + ERR("The subbuf size is not a power of 2: %" PRIu64 " (%s)", > + chan.attr.subbuf_size, opt_arg); > + ret = CMD_ERROR; > + goto end; > + } > + > DBG("Channel subbuf size set to %" PRIu64, chan.attr.subbuf_size); > break; > case OPT_NUM_SUBBUF: > diff --git a/src/common/utils.c b/src/common/utils.c > index b16cdc9..a7cec6b 100644 > --- a/src/common/utils.c > +++ b/src/common/utils.c > @@ -26,6 +26,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -386,3 +387,130 @@ int utils_rotate_stream_file(char *path_name, char *file_name, uint64_t size, > error: > return ret; > } > + > +/** > + * Prints the error message corresponding to a regex error code. > + * > + * @param errcode The error code. > + * @param regex The regex object that produced the error code. > + */ > +static void regex_print_error(int errcode, regex_t *regex) > +{ > + /* Get length of error message and allocate accordingly */ > + size_t length; > + char *buffer; > + > + assert(regex != NULL); > + > + length = regerror(errcode, regex, NULL, 0); > + if (length == 0) { > + ERR("regerror returned a length of 0"); > + return; > + } > + > + buffer = zmalloc(length); > + if (!buffer) { > + ERR("regex_print_error: zmalloc failed"); > + return; > + } > + > + /* Get and print error message */ > + regerror(errcode, regex, buffer, length); > + ERR("regex error: %s\n", buffer); > + free(buffer); > + > +} > + > +/** > + * Parse a string that represents a size in human readable format. It > + * supports decimal integers suffixed by 'k', 'M' or 'G'. > + * > + * The suffix multiply the integer by: > + * 'k': 1024 > + * 'M': 1024^2 > + * 'G': 1024^3 > + * > + * @param str The string to parse. > + * @param size Pointer to a size_t that will be filled with the > + * resulting size. > + * > + * @return 0 on success, -1 on failure. > + */ > +int utils_parse_size_suffix(char *str, uint64_t *size) > +{ > + regex_t regex; > + int ret; > + const int nmatch = 3; > + regmatch_t suffix_match, matches[nmatch]; > + unsigned long long base_size; > + long shift = 0; > + > + if (!str) { > + return 0; > + } > + > + /* Compile regex */ > + ret = regcomp(®ex, "^\\(0x\\)\\{0,1\\}[0-9][0-9]*\\([kKMG]\\{0,1\\}\\)$", 0); > + > + /* Check for regex error */ > + if (ret != 0) { > + regex_print_error(ret, ®ex); > + ret = -1; > + goto end; > + } > + > + /* Match regex */ > + ret = regexec(®ex, str, nmatch, matches, 0); > + if (ret != 0) { > + /* There is no match (or error) */ > + ret = -1; > + goto free; > + } > + > + /* There is a match ! */ > + errno = 0; > + base_size = strtoull(str, NULL, 0); > + /* Check result of conversion */ > + if (errno != 0) { > + PERROR("strtoull"); > + ret = -1; > + goto free; > + } > + > + /* Check if there is a suffix */ > + suffix_match = matches[2]; > + if (suffix_match.rm_eo - suffix_match.rm_so == 1) { > + switch (*(str + suffix_match.rm_so)) { > + case 'K': > + case 'k': > + shift = KIBI_LOG2; > + break; > + case 'M': > + shift = MEBI_LOG2; > + break; > + case 'G': > + shift = GIBI_LOG2; > + break; > + default: > + ERR("parse_human_size: invalid suffix"); > + ret = -1; > + goto free; > + } > + } > + > + *size = base_size << shift; > + > + /* Check for overflow */ > + if ((*size >> shift) != base_size) { > + ERR("parse_size_suffix: oops, overflow detected."); > + ret = -1; > + goto free; > + } > + > + ret = 0; > + > +free: > + regfree(®ex); > +end: > + return ret; > +} > diff --git a/src/common/utils.h b/src/common/utils.h > index 2d39cef..d8a5321 100644 > --- a/src/common/utils.h > +++ b/src/common/utils.h > @@ -18,6 +18,14 @@ > #ifndef _COMMON_UTILS_H > #define _COMMON_UTILS_H > > +#include > +#include > +#include > + > +#define KIBI_LOG2 10 > +#define MEBI_LOG2 20 > +#define GIBI_LOG2 30 > + > char *utils_expand_path(const char *path); > int utils_create_pipe(int *dst); > int utils_create_pipe_cloexec(int *dst); > @@ -30,5 +38,6 @@ int utils_create_stream_file(char *path_name, char *file_name, uint64_t size, > uint64_t count, int uid, int gid); > int utils_rotate_stream_file(char *path_name, char *file_name, uint64_t size, > uint64_t count, int uid, int gid, int out_fd, uint64_t *new_count); > +int utils_parse_size_suffix(char *str, uint64_t *size); > > #endif /* _COMMON_UTILS_H */ > diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am > index 67e7fe4..e8a6429 100644 > --- a/tests/unit/Makefile.am > +++ b/tests/unit/Makefile.am > @@ -14,10 +14,11 @@ LIBCOMMON=$(top_builddir)/src/common/libcommon.la > LIBSESSIOND_COMM=$(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la > LIBHASHTABLE=$(top_builddir)/src/common/hashtable/libhashtable.la > > +# Define test programs > +noinst_PROGRAMS = test_uri test_session test_kernel_data test_utils_parse_size_suffix > + > if HAVE_LIBLTTNG_UST_CTL > -noinst_PROGRAMS = test_uri test_session test_ust_data test_kernel_data > -else > -noinst_PROGRAMS = test_uri test_session test_kernel_data > +noinst_PROGRAMS += test_ust_data > endif > > # URI unit tests > @@ -69,3 +70,11 @@ test_kernel_data_SOURCES = test_kernel_data.c > test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ > -lrt > test_kernel_data_LDADD += $(KERN_DATA_TRACE) > + > +# parse_size_suffix unit test > +UTILS_PARSE_SIZE_SUFFIX=$(top_srcdir)/src/common/utils.o \ > + $(top_srcdir)/src/common/runas.o > + > +test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c > +test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) > +test_utils_parse_size_suffix_LDADD += $(UTILS_PARSE_SIZE_SUFFIX) > diff --git a/tests/unit/test_utils_parse_size_suffix.c b/tests/unit/test_utils_parse_size_suffix.c > new file mode 100644 > index 0000000..3b9c68c > --- /dev/null > +++ b/tests/unit/test_utils_parse_size_suffix.c > @@ -0,0 +1,87 @@ > +/* > + * Copyright (C) - 2013 Simon Marchi > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License as published by as > + * published by the Free Software Foundation; only version 2 of the License. > + * > + * This program is distributed in the hope that it will be useful, but WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > + * more details. > + * > + * You should have received a copy of the GNU General Public License along with > + * this program; if not, write to the Free Software Foundation, Inc., 51 > + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +#include > +#include > +#include > + > +#include > + > +#include > + > +/* For lttngerr.h */ > +int lttng_opt_quiet = 1; > +int lttng_opt_verbose = 3; > + > +struct valid_test_input { > + char *input; > + uint64_t expected_result; > +}; > + > +/* Valid test cases */ > +static struct valid_test_input valid_tests_inputs[] = { > + { "0", 0 }, > + { "1234", 1234 }, > + { "0x400", 1024 }, > + { "0300", 192 }, > + { "16k", 16384 }, > + { "128K", 131072 }, > + { "0x1234k", 4771840 }, > + { "32M", 33554432 }, > + { "1024G", 1099511627776 }, > +}; > +static const int num_valid_tests = sizeof(valid_tests_inputs) / sizeof(valid_tests_inputs[0]); > + > +/* Invalid test cases */ > +static char *invalid_tests_inputs[] = { "", "-1", "k", "4611686018427387904G" }; > +static const int num_invalid_tests = sizeof(invalid_tests_inputs) / sizeof(invalid_tests_inputs[0]); > + > +static void test_utils_parse_size_suffix(void) > +{ > + uint64_t result; > + int ret; > + int i; > + > + /* Test valid cases */ > + for (i = 0; i < num_valid_tests; i++) { > + char name[100]; > + sprintf(name, "valid test case: %s", valid_tests_inputs[i].input); > + > + ret = utils_parse_size_suffix(valid_tests_inputs[i].input, &result); > + ok(ret == 0 && result == valid_tests_inputs[i].expected_result, name); > + } > + > + /* Test invalid cases */ > + for (i = 0; i < num_invalid_tests; i++) { > + char name[100]; > + sprintf(name, "invalid test case: %s", invalid_tests_inputs[i]); > + > + ret = utils_parse_size_suffix(invalid_tests_inputs[i], &result); > + ok(ret != 0, name); > + } > +} > + > +int main(int argc, char **argv) > +{ > + plan_tests(num_valid_tests + num_invalid_tests); > + > + diag("utils_parse_size_suffix tests"); > + > + test_utils_parse_size_suffix(); > + > + return exit_status(); > +} From dgoulet at efficios.com Thu May 2 11:25:08 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 02 May 2013 11:25:08 -0400 Subject: [lttng-dev] [RFC PATCH lttng-tools] Unit tests: don't rebuild units under test In-Reply-To: <1365434404-11002-1-git-send-email-simon.marchi@polymtl.ca> References: <1365434404-11002-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: <51828554.1080001@efficios.com> Merged! Thanks! Simon Marchi: > Only the tests themselves are built in the unit test folder. They reuse > the object files that are already built during the main compilation > pass. This would fix the conflicts between object names. > > Signed-off-by: Simon Marchi > --- > tests/unit/Makefile.am | 55 +++++++++++++++++++++++++----------------------- > 1 file changed, 29 insertions(+), 26 deletions(-) > > diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am > index c9e1bfc..67e7fe4 100644 > --- a/tests/unit/Makefile.am > +++ b/tests/unit/Makefile.am > @@ -25,44 +25,47 @@ test_uri_SOURCES = test_uri.c > test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE) > > # Session unit test > -SESSIONS=$(top_srcdir)/src/bin/lttng-sessiond/session.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/consumer.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/health.c \ > - $(top_srcdir)/src/common/uri.c \ > - $(top_srcdir)/src/common/utils.c \ > - $(top_srcdir)/src/common/error.c > +SESSIONS=$(top_srcdir)/src/bin/lttng-sessiond/session.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/consumer.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/health.o \ > + $(top_srcdir)/src/common/uri.o \ > + $(top_srcdir)/src/common/utils.o \ > + $(top_srcdir)/src/common/error.o > > -test_session_SOURCES = test_session.c $(SESSIONS) > +test_session_SOURCES = test_session.c > test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ > -lrt > +test_session_LDADD += $(SESSIONS) > > # UST data structures unit test > if HAVE_LIBLTTNG_UST_CTL > -UST_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-ust.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/consumer.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/buffer-registry.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/ust-registry.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/ust-metadata.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/ust-app.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/ust-consumer.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/fd-limit.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/health.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/session.c \ > - $(top_srcdir)/src/common/uri.c \ > - $(top_srcdir)/src/common/utils.c > +UST_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-ust.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/consumer.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/buffer-registry.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/ust-registry.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/ust-metadata.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/ust-app.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/ust-consumer.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/fd-limit.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/health.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/session.o \ > + $(top_srcdir)/src/common/uri.o \ > + $(top_srcdir)/src/common/utils.o > > -test_ust_data_SOURCES = test_ust_data.c $(UST_DATA_TRACE) > +test_ust_data_SOURCES = test_ust_data.c > test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ > -lrt -llttng-ust-ctl > +test_ust_data_LDADD += $(UST_DATA_TRACE) > endif > > # Kernel data structures unit test > -KERN_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-kernel.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/consumer.c \ > - $(top_srcdir)/src/bin/lttng-sessiond/health.c \ > - $(top_srcdir)/src/common/uri.c \ > - $(top_srcdir)/src/common/utils.c > +KERN_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-kernel.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/consumer.o \ > + $(top_srcdir)/src/bin/lttng-sessiond/health.o \ > + $(top_srcdir)/src/common/uri.o \ > + $(top_srcdir)/src/common/utils.o > > -test_kernel_data_SOURCES = test_kernel_data.c $(KERN_DATA_TRACE) > +test_kernel_data_SOURCES = test_kernel_data.c > test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ > -lrt > +test_kernel_data_LDADD += $(KERN_DATA_TRACE) From mathieu.desnoyers at efficios.com Thu May 2 15:54:31 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 15:54:31 -0400 Subject: [lttng-dev] using --function/--probe In-Reply-To: <19046.1338994097@cloud.rain.com> References: <20120605154950.GA21955@Krystal> <19046.1338994097@cloud.rain.com> Message-ID: <20130502195431.GA15675@Krystal> * Bill Trost (trost at cloud.rain.com) wrote: > Mathieu wrote: > * Bill Trost (trost at cloud.rain.com) wrote: > > and how does it differ from "--probe"? How do I determine > > what symbols are valid for each of these options? > > It entirely depends on which functions are blacklisted in the kernel > (this is an attribute added to the functions specifically for kprobes). > The keyword is "__kprobes". > > Is that the only basis? For example, I can add a dynamic tracepoint (of > either flawor) for queue_work_on(), but not work __queue_work(), yet > neither of those functions have any apparent annotation. Or does > EXPORT_SYMBOL_GPL imply a probe point? No, it doesn't. > > > ...how do I trace what work is being > > enqueued and run by the kworker threads? > > For this level of details, I think kprobes/kretprobes will not > currently allow you to fetch it. The two options we have are: > > - use static tracepoints. Is there a tracepoint that targets the > information you are looking for ? Try "lttng list -k". > > No, I've been capturing all kernel events and haven't seen > anything resembling the kworker tracepoints of lttng 0.x. LTTng 2.2-rc has a new workqueue instrumentation. Maybe this can fit your use-case ? > > - or extend the dynamic probing to allow fetching variables from > debug information, > > Hmm. Well, I did a bit more poking and got a bit closer -- at least now > I know what dynamic points to use. (eg, "queue_work_on" and friends to > see what is being queued). I take it that LTT can't capture function call > arguments as a form of additional context? That would be an ideal > bit of information in this case. Currently it can't. (sorry for late reply) Thanks, Mathieu > > Thanks again, > Bill -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 16:21:41 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 16:21:41 -0400 Subject: [lttng-dev] [PATCH] Expose kernel tracer to user-space (version 6) In-Reply-To: <4FF3006C.5000308@gmail.com> References: <1341266778-13735-1-git-send-email-francis.giraldeau@gmail.com> <20120702222340.GA1702@Krystal> <4FF28F07.6000901@gmail.com> <20120703113947.GA24563@Krystal> <4FF2F4DF.9030904@gmail.com> <20120703134031.GB32190@Krystal> <4FF3006C.5000308@gmail.com> Message-ID: <20130502202141.GC15675@Krystal> Just a bit of follow-up: has this been merged ? If not, is there a latest version available somewhere ? Thanks, Mathieu * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: > Le 2012-07-03 15:40, Mathieu Desnoyers a ?crit : > >> It's not possible to remove the module while an active tracing session > >> references the event lttng_uevent. I tested insertion/removal of the > >> module while tracing with the previous version that was using RCU and it > >> was working well. > > > > But you don't need to have an active tracing session to perform the test > > I point to above. Could you run it on this latest version ? > > Ok. I updated the test to run in a loop rmmod/modprobe, while writing > with 20 threads into /proc/lttng_uevent. The result is that the module > can be unloaded properly, the test shows no race that prevent the module > to be unloaded or other problems. > > If somebody wants to test it for themselves, I added the code for this > test under workload-kit/tests. > > * test-uevent : runs 4 times 20 threads each producing 64k events > * module-reload-forever.sh : rmmod/modprobe of lttng_uevent > * test-uevent.sh : quick wrapper for testing functionnality > > Thanks! > > Francis > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 16:24:09 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 16:24:09 -0400 Subject: [lttng-dev] [LTTng UST - Bug #292] (Confirmed) Generated header files should not conflict with ust or standard ones. In-Reply-To: References: Message-ID: <20130502202409.GD15675@Krystal> Hi Yannick, This bug has been opened in July 2012. Any ETA for resolution ? Thanks, Mathieu * bugs at lttng.org (bugs at lttng.org) wrote: > > Issue #292 has been updated by Yannick Brosseau. > > Subject changed from Lttng-gen-tp need additional error messages to Generated header files should not conflict with ust or standard ones. > Status changed from Needs feedback to Confirmed > > > ---------------------------------------- > Bug #292: Generated header files should not conflict with ust or standard ones. > https://bugs.lttng.org/issues/292#change-592 > > Author: Matthew Khouzam > Status: Confirmed > Priority: Normal > Assignee: Yannick Brosseau > Category: > Target version: > > > In Lttng-UST 2.0 if a given tracepoint file (foo.tp) has tracepint_events with domains that are not "foo" the tracepoint will not compile. This would be good to have a warning/error for, since if you don't it will just cause errors in the compilation phase which are _very_ difficult to understand. > > > -- > You have received this notification because you have either subscribed to it, or are involved in it. > To change your notification preferences, please click here: http://bugs.lttng.org/my/account -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 16:27:58 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 16:27:58 -0400 Subject: [lttng-dev] Questions about CTF format In-Reply-To: References: <20120705142052.GA23162@Krystal> Message-ID: <20130502202758.GE15675@Krystal> * Diego Dompe (ddompe at gmail.com) wrote: > Hi Mathieu, > > Thanks for the help. Here is my list of details: > > - Clocks: the spec doesn't explain properly that timestamps are an offset > from the base time of the clock they refer to. Since I was using 64bit > timestamps I somehow assumed that I was using absolute timestamps from the > epoch (although the spec doesn't says it either). Not sure if it was there when you wrote your comment, but the CTF spec currently has: "The "offset_s" and "offset" fields indicate the offset from POSIX.1 Epoch, 1970-01-01 00:00:00 +0000 (UTC), to the zero of value of the clock." > - I saw that the lttng-generated traces for metadata are always a multiple > of 4k in size (at least the ones I generate for either kernel or user > space). I can't find where in the spec it mentions requirements regarding > metadata packet padding. I was generating metadata packets that ended up > right after my TSDL and eclipse wasn't happy about it (although I didn't > try babeltrace). Also I found that the lttng-generated traces have a > "empty" metadata packet after the metadata containing the TSDL, I didn't > find either any documentation regarding this. Babeltrace had a limitation on not accepting packets smaller than 4kB (page size actually), but it is now fixed. Thanks, Mathieu > > Regards, > > Diego > > On Thu, Jul 5, 2012 at 8:20 AM, Mathieu Desnoyers < > mathieu.desnoyers at efficios.com> wrote: > > > * Diego Dompe (ddompe at gmail.com) wrote: > > > Hi, > > > > > > I'm developing a custom tracer for an embedded product that will generate > > > CTF format. I was able to generate generic traces that can be interpreted > > > properly with babeltrace (but not with eclipse, I already file a bug for > > > that), but I found the CTF specification lacking in some aspects (I had > > to > > > peek into lttng-generated CTF traces to figure out some details). I was > > > wondering what is the proper mailing list to clear my questions and > > provide > > > feedback on the CTF specification for improvement in the areas where the > > > documentation is not detailed yet. I don't see any CTF-specific mailing > > > list, it's OK to discuss it here? Or maybe directly with a developer(s)? > > > > Hi Diego, > > > > Yes, this mailing list would be the proper place, along maybe with > > adding the MCA tiwg mailing list in CC, which I'm doing here. > > > > Thanks, > > > > Mathieu > > > > -- > > Mathieu Desnoyers > > Operating System Efficiency R&D Consultant > > EfficiOS Inc. > > http://www.efficios.com > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 16:30:19 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 16:30:19 -0400 Subject: [lttng-dev] [PATCH] Expose kernel tracer to user-space (version 7) In-Reply-To: <20120704093821.35384043@skate> References: <1341322152-4380-1-git-send-email-francis.giraldeau@gmail.com> <20120704093821.35384043@skate> Message-ID: <20130502203019.GF15675@Krystal> * Thomas Petazzoni (thomas.petazzoni at free-electrons.com) wrote: > Hello, > > Le Tue, 3 Jul 2012 15:29:12 +0200, > Francis Giraldeau a ?crit : > > > By writing to the file /proc/lttng_uevent, a user-space application creates a > > kernel event. The event's payload is by default UTF-8 text, but any data can be > > written. The maximum size of the data is at most the size of a packet defined > > for the trace session. Null-character is optional and is not enforced. The > > event uses sequence for space efficiency and to store any data as payload. > > Shouldn't this be in the debugfs filesystem rather than the proc > filesystem? The debugfs filesystem already has entries for various > tracing facilities of the Linux kernel, and adding entries in /proc > that are not process-related is frowned upon these days. yes, I think this infrastructure should belong in debugfs. Thanks, Mathieu > > Best regards, > > Thomas > -- > Thomas Petazzoni, Free Electrons > Kernel, drivers, real-time and embedded Linux > development, consulting, training and support. > http://free-electrons.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 16:36:07 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 16:36:07 -0400 Subject: [lttng-dev] LTTng-UST 2.0 mutex usage In-Reply-To: <524C960C5DFC794E82BE548D825F05CF2834A6E5@EU-MBX-01.mgc.mentorg.com> References: <524C960C5DFC794E82BE548D825F05CF2834A6E5@EU-MBX-01.mgc.mentorg.com> Message-ID: <20130502203606.GG15675@Krystal> * Oestman, Fredrik (Fredrik_Oestman at mentor.com) wrote: > Hi, > > > We're experimenting with tracing calls to the pthreads library using a > LD_PRELOAD-ed interposer library, which is instrumented with UST > tracepoints. In the startup phase, before the application has been > called, probes are being registered, and one by one the tracepoints > start emitting events. So some of the pthreads mutex motions of UST > itself are being traced along. > > What would be a good way of avoiding emitting events before the > application itself has started, specifically events related to UST > mutexes? one way would be to implement mutexes within lttng-ust, so we would stop using the pthread mutexes. > The ust-ctl library appears to have a function ustctl_register_done(), > is that useful? No. This function is called by the session daemon when it has completed sending all commands to the application so its internal lttng-ust state matches that of the active tracing sessions. We need to be aware that a lttng-ust library can interact with up to 2 session daemons: one for the user, one for root. > (Is there an API documentation?) Or would it be better > to find out which mutexes belong to UST and filter them out? custom implementation of mutexes within lttng-ust sounds like the best approach. Thanks, Mathieu > By controlling our interposer library from within the application we > can avoid the problem, but we'd rather do without recompiling the > application, since it sort of would defeat the reason for using > LD_PRELOAD in the first place. > > > Cheers, > > Fredrik ?stman > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 16:43:49 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 16:43:49 -0400 Subject: [lttng-dev] WG: Reading CTF trace using Babeltrace API In-Reply-To: References: Message-ID: <20130502204349.GH15675@Krystal> J?r?mie, can you have a look at these questions ? Thanks, Mathieu * Salman Rafiq (salman.rafiq at esk.fraunhofer.de) wrote: > Hello All, > > In continuation to my previous questions related to reading CTF traces from particular timestamp, I can now further summarize few problems/questions I have: > > > 1. Is it possible to seek CTF file_stream using 'begin' and 'end' iterator position i.e. BT_SEEK_TIME? > > > > a. We cannot use babel trace API for CTF iterator creation using defined start and end position based on time. Seems this is in progress? > > b. The other possible solution I am using, is to create the iterator using defaults, and then later use API to 'create iterator time position based on Raw Timestamp (only takes raw time)' and then 'set iterator position to that timed position'. > > > > 2. But, since the area of interest for me was only the time when user application which I am tracing using Lttng-kernel tracer, started recording events (application use external trace recording format). > > User application contains a definition file which tells me the epoch time (us resolution) when it started and stopped tracing. I wanted to use this information to set iterator positions. > > > > a. Question is Can I convert this time to raw time which babeltrace API takes as an argument? > > b. Or Is there any way to read Clock struct from CTF metadata file (is there any scope defined for this), so that I can extract offset variable value to convert epoch time from other trace to raw time? > > > It will be really great if I can get few suggestions/help related to these issues. > Thanking in anticipation! > > > Best Regards, > > Salman Rafiq > Research Engineer > Industrial Communication > Fraunhofer-Einrichtung f?r Systeme der Kommunikationstechnik ESK > > Hansastra?e 32 | 80686 M?nchen > Telefon, Fax: +49 89 547088-356 | +49 89 547088-66-356 > E-Mail: salman.rafiq at esk.fraunhofer.de > > Internet: > http://www.esk.fraunhofer.de > http://www.facebook.com/FraunhoferESK > http://www.twitter.com/FraunhoferESK > > Von: Salman Rafiq [mailto:salman.rafiq at esk.fraunhofer.de] > Gesendet: Mittwoch, 18. Juli 2012 15:28 > An: lttng-dev at lists.lttng.org > Betreff: [lttng-dev] Reading CTF trace from time T > > Hello All, > > I am tracing a user application using lttng kernel tracer, i.e., > > Start lttng kernel trace > ./application > Stop lttng kernel trace > > Before I was reading kernel CTF trace using babeltrace API's from beginning of trace, e.g., > struct bt_iter_pos begin_pos > struct bt_ctf_iter *iterator > > begin_pos.type = BT_SEEK_BEGIN > iterator = create_iterator(context, &begin_pos, NULL) > .. and then read events start from that iterator postion. > > Recently, I have been trying to seek trace using timestamp from when the application started to application end. > I would like to know if I am doing it right. Would the method below enough to achieve this? Or I am missing something here :-S > > begin_pos.type = BT_SEEK_TIME > end_pos.type = BT_SEEK_TIME > > begin_pos.u.seek_time = timestamp1 (for now manually taken from CTF kernel trace when application started) > end_pos.u.seek_time = timestamp2 (for now manually taken from CTF kernel trace when application ended) > > iterator = create_iterator(context, &begin_pos, &end_pos); > and then with reading events at iterator position until end_pos. > > > I am using babeltrace package version "1.0.0-pre4". > Any help related to achieving this functionality will be highly appreciated. > > Best Regards, > Salman > > > -- > Salman Rafiq > Industrial Communication > Fraunhofer-Einrichtung f?r Systeme der Kommunikationstechnik ESK > > Hansastra?e 32 | 80686 M?nchen > Telefon, Fax: +49 89 547088-356 | +49 89 547088-66-356 > E-Mail: salman.rafiq at esk.fraunhofer.de > > Internet: > http://www.esk.fraunhofer.de > http://www.facebook.com/FraunhoferESK > http://www.twitter.com/FraunhoferESK > Content-Description: ATT00001.txt > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 16:51:41 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 16:51:41 -0400 Subject: [lttng-dev] urcu rfc: privatize urcu/futex.h In-Reply-To: <5021C1A5.5090404@cn.fujitsu.com> References: <5020DBFF.3020702@cn.fujitsu.com> <20120807140616.GA29280@Krystal> <5021BAF5.4080507@cn.fujitsu.com> <5021C1A5.5090404@cn.fujitsu.com> Message-ID: <20130502205141.GA16536@Krystal> * Lai Jiangshan (laijs at cn.fujitsu.com) wrote: > (Added a CC email address) > > On 08/08/2012 09:03 AM, Lai Jiangshan wrote: > > On 08/07/2012 10:06 PM, Mathieu Desnoyers wrote: > >> Hi Lai, > >> > >> * Lai Jiangshan (laijs at cn.fujitsu.com) wrote: > >>> futex.h is in urcu/, it means it can be used by users out of the library. > >>> > >>> But > >>> > >>> If the user's system has futex, he should use #include . > >>> If the user's system don't have futex, it is not good that if the user > >>> use this compat_futex. > >>> > >>> Because the compat_futex_async()'s behavior is different from the > >>> futex in linux. If the caller don't change the value of @uaddr, the > >>> futex(FUTEX_WAKE) in linux can also wake a thread, but > >>> compat_futex_async() don't. (I guess no one use this behavior, but if > >>> there are someone, we give them a wrong thing) > >> > >> Hrm, passing a NULL uaddr parameter is really not the targeted use-case. > >> We could probably just document that uaddr should not be NULL when using > >> compat_futex ? > > > > Sorry, I wanted to show you such un-normal behavior: > > > > /* keep the value of *uaddr unchanged, wake up a thread to do something */ > > futex(FUTEX_WAKE, uaddr, ...). > > > > This can't not wake up any thread for current compat_futex_async() implement. > > But the sys_futex() can. > > > > > > It is hard to implement compat_futex_async() to make its behavior compatible > with sys_futex().(I don't like the two alternatives too, I just wrote > what I have thought) so I sent rfc email to suggest to privatize > urcu/futex.h. I don't think this issue has been taken care of, am I correct ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 16:57:21 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 16:57:21 -0400 Subject: [lttng-dev] Can I use function to retrieve socket information in the SC_TRACE_EVENT macro? In-Reply-To: References: Message-ID: <20130502205721.GC16536@Krystal> * Rui Han (r.han at umiami.edu) wrote: > Dear all, > > I am working on retrieving socket information for socket related syscalls > by the kernel trace, such as sys_connect() and sys_bind(). What I did is in > the .h file > "instrumentation/syscalls/headers/x86-64-syscalls-3.0.4_pointers.h", I > modify the sys_connect SC_TRACE_EVENT. I add _field(size_t, port) and > tp_assign(port, getport() ) to the TP_STRUCT_entry() and TP_fast_assign(), > respectively. The getport() function is a function I wrote to retrieve the > port number and ip address by the function getpeername(). The lttng module > got installed correctly after the modification, (with some #ifndef > manipulations), However, when I reboot the machine and try to do the kernel > trace. It gives me error messages: > > Spawning a session daemon > FATAL: Error inserting lttng_tracer > (/lib/modules/3.2.0-29-generic/extra/lttng-tracer.ko): Unknown symbol in > module, or unknown parameter (see dmesg) > Error: Unable to load module lttng-tracer > Warning: No kernel tracer available > Warning: No tracing group detected > Session rui-session created. > Traces will be written in /root/lttng-traces/rui-session-20120813-133953 > FATAL: Error inserting lttng_tracer > (/lib/modules/3.2.0-29-generic/extra/lttng-tracer.ko): Unknown symbol in > module, or unknown parameter (see dmesg) > Error: Unable to load module lttng-tracer > Warning: No kernel tracer available > > and in the syslog file: I got the following error: > [ 82.001603] lttng_tracer: Unknown symbol getport (err 0) > [ 82.377213] lttng_tracer: Unknown symbol getport (err 0) > > I am new to the kernel module programming. My question is: should I do some > kinds of symbol register before define a function in the kernel space? Any > suggestion for solving the problem? I think your tracepoint probe cannot find the getport() symbol you created. Sounds like an issue with the way you declared/defined getport() within lttng-modules. Sorry for the late reply, Thanks, Mathieu > > Thanks, > Rui -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 2 16:59:59 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 2 May 2013 16:59:59 -0400 Subject: [lttng-dev] LTTng on Android In-Reply-To: References: Message-ID: <20130502205959.GD16536@Krystal> * Santhosh Samarthyam (srsamarthyam at gmail.com) wrote: > Dear All, > > I have been closely following the status of LTTng on Android based on > the discussions in this mailing list. > I would be great if someone could validate the following > > - No need for LTTng kernel patch if kernel version > 2.6.38 true. > - No dependency on glibc after version 2.0 of lttng. false. There has been interesting progress done on the Android side this winter by Polytechnique. We should see the patches soon(ish). The project will likely be continued in a Google Summer of Code project this summer, especially for UST tracing. Sorry for the late reply, Thanks, Mathieu > > So can I build LTTng on Android (Version details below) > > Android version: Icecream sandwich (4.0.1) > Kernel version: 3.0.1 > > Can we build the following on an ARM based board running android? > (After creating the android make files) > LTTng-tools 2.0.4 > LTTng-modules 2.0.4 > LTTng-UST 2.0.4 > liburcu 0.7.3 > > I am more interested in getting the LTTng-UST to work. > Any pointers on how to achieve this would be really helpful. > > -- > Cheers, > Santos > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From Paul_Woegerer at mentor.com Fri May 3 06:40:53 2013 From: Paul_Woegerer at mentor.com (Woegerer, Paul) Date: Fri, 3 May 2013 12:40:53 +0200 Subject: [lttng-dev] How to disable an event that's been enabled by a wildcard selection or -a? In-Reply-To: <20130502134010.GF7035@Krystal> References: <009B25148989C6458484484699278506985C0CFA@EU-MBX-01.mgc.mentorg.com> <20998D40D9A2B7499CA5A3A2666CB1EB19F968AF@ZURMSG1.QUANTUM.com> <5121EA9A.8080905@mentor.com> <20130502134010.GF7035@Krystal> Message-ID: <51839435.8010607@mentor.com> On 05/02/2013 03:40 PM, Mathieu Desnoyers wrote: > Hi Paul, > > I would be interested to see this feature upstream. Previously was not a > good timing to pull it in, because we were adding the concept of event > "enablers" within lttng-ust. Sounds great. I will port our patch to master. > > One thing I'm curious about is how you present the logical combination > with exlusion match are present. For instance, if we only have > inclusion, we get: > > lttng enable-event 'a' > lttng enable-event 'c' > lttng enable-event 'zc*' > > it turns into : (a || c || zc*) > > I expect that negation would look like: > > lttng enable-event 'a' > lttng enable-event '!abc*' > lttng enable-event 'c' > lttng enable-event '!cxx' Our current solution does not handle '!cxx' correctly. I will fix that. > lttng enable-event 'zc*' > > -> !(abc* || cxx) || (a || c || zc*) Exactly. The "!something" wildcards are always first and will prevent further matching with non-! wildcards. > > Am I correct ? If yes, we should expand lttng-tools lttng(1) manpage and > cmd help with this info. I will take care of documentation updates as well. > > Can you make sure it works well with lttng-ust master branch ? Once I have a working, tested patch against master I will send it to you. Thanks, Paul -- Paul Woegerer | SW Development Engineer http://go.mentor.com/sourceryanalyzer Mentor Embedded(tm) | Prinz Eugen Stra?e 72/2/4, Vienna, 1040 Austria Nucleus? | Linux? | Android(tm) | Services | UI | Multi-OS Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. From mathieu.desnoyers at efficios.com Fri May 3 08:29:19 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 3 May 2013 08:29:19 -0400 Subject: [lttng-dev] Managing trace sizes In-Reply-To: <13959c7e325.1340654510569746171.-9152529687053830431@gmail.com> References: <13959c7e325.1340654510569746171.-9152529687053830431@gmail.com> Message-ID: <20130503122919.GA30913@Krystal> Hi Jon, Sorry for the late reply, * jsilver.pmc at gmail.com (jsilver.pmc at gmail.com) wrote: > Are there any ways currently, or planned, or other suggestions, to > address these within LTTng? > - compression of trace data There is room for that in the CTF specification, but LTTng does not implement trace compression yet. > - rolling or rotating trace files > - limiting the amount of disk space LTTng will use These are available as new features in LTTng 2.2 (--tracefile-size and --tracefile-count). Thanks, Mathieu > > Thanks, > Jon > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 3 08:33:22 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 3 May 2013 08:33:22 -0400 Subject: [lttng-dev] LTTng run issues In-Reply-To: <18BECF85FEE8A1469B4AD1584AE2FF200AE61D8EC7@INBLRK77M2MSX.in002.siemens.net> References: <18BECF85FEE8A1469B4AD1584AE2FF200AE61D8EC7@INBLRK77M2MSX.in002.siemens.net> Message-ID: <20130503123322.GB30913@Krystal> * Arulraj, Dhiliphen IN BLR STS (Dhiliphen.Arulraj at siemens.com) wrote: > Hello , > > I am new to LTTng usage. When trying to run lttng 2.0.4 for tracing my kernel I get the following issue - > > root at am335x-evm:/media/mmcblk0p1/lttng_bin/bin# ./arm-arago-linux-gnueabi-lttng start > [ 1775.934997] LTTng: Failure to write metadata to buffers (timeout) > Error: Starting kernel trace failed it looks like the consumer daemon has not been able to extract your trace data. is it still an issue ? Sorry for the late reply, Thanks, Mathieu > > I checked the session daemon for startup issues and got the following - > > ./arm-arago-linux-gnueabi-lttng- > sessiond -vvv --consumerd32-path /media/mmcblk0p1/lttng_bin/lib/lttng/libexec > > root at am335x-evm:/media/mmcblk0p1/lttng_bin/bin# ./arm-arago-linux-gnueabi-lttng- > sessiond -vvv --consumerd32-path /media/mmcblk0p1/lttng_bin/lib/lttng/libexec > DEBUG3: Creating LTTng run directory: /var/run/lttng [in create_lttng_rundir() a > t main.c:4317] > DEBUG2: Kernel consumer err path: /var/run/lttng/kconsumerd/error [in main() at > main.c:4560] > DEBUG2: Kernel consumer cmd path: /var/run/lttng/kconsumerd/command [in main() a > t main.c:4562] > DEBUG1: Client socket path /var/run/lttng/client-lttng-sessiond [in main() at ma > in.c:4609] > DEBUG1: Application socket path /var/run/lttng/apps-lttng-sessiond [in main() at > main.c:4610] > DEBUG1: LTTng run directory path: /var/run/lttng [in main() at main.c:4611] > DEBUG2: UST consumer 32 bits err path: /var/run/lttng/ustconsumerd32/error [in m > ain() at main.c:4620] > DEBUG2: UST consumer 32 bits cmd path: /var/run/lttng/ustconsumerd32/command [in > main() at main.c:4622] > DEBUG2: UST consumer 64 bits err path: /var/run/lttng/ustconsumerd64/error [in m > ain() at main.c:4631] > DEBUG2: UST consumer 64 bits cmd path: /var/run/lttng/ustconsumerd64/command [in > main() at main.c:4633] > DEBUG2: Creating consumer directory: /var/run/lttng/kconsumerd [in set_consumer_ > sockets() at main.c:4359] > DEBUG1: Modprobe successfully lttng-tracer [in modprobe_lttng_control() at modpr > obe.c:163] > DEBUG2: Kernel tracer version validated (major version 2) [in kernel_validate_ve > rsion() at kernel.c:675] > DEBUG1: Modprobe successfully lttng-ftrace [in modprobe_lttng_data() at modprobe > .c:199] > DEBUG1: Modprobe successfully lttng-kprobes [in modprobe_lttng_data() at modprob > e.c:199] > DEBUG1: Modprobe successfully lttng-kretprobes [in modprobe_lttng_data() at modp > robe.c:199] > DEBUG1: Modprobe successfully lttng-lib-ring-buffer [in modprobe_lttng_data() at > modprobe.c:199] > DEBUG1: Modprobe successfully lttng-ring-buffer-client-discard [in modprobe_lttn > g_data() at modprobe.c:199] > DEBUG1: Modprobe successfully lttng-ring-buffer-client-overwrite [in modprobe_lt > tng_data() at modprobe.c:199] > DEBUG1: Modprobe successfully lttng-ring-buffer-metadata-client [in modprobe_ltt > ng_data() at modprobe.c:199] > DEBUG1: Modprobe successfully lttng-ring-buffer-client-mmap-discard [in modprobe > _lttng_data() at modprobe.c:199] > DEBUG1: Modprobe successfully lttng-ring-buffer-client-mmap-overwrite [in modpro > be_lttng_data() at modprobe.c:199] > DEBUG1: Modprobe successfully lttng-ring-buffer-metadata-mmap-client [in modprob > e_lttng_data() at modprobe.c:199] > DEBUG1: Modprobe successfully lttng-probe-lttng [in modprobe_lttng_data() at mod > probe.c:199] > DEBUG1: Modprobe successfully lttng-types [in modprobe_lttng_data() at modprobe. > c:199] > DEBUG1: Modprobe successfully lttng-probe-block [in modprobe_lttng_data() at mod > probe.c:199] > DEBUG1: Modprobe successfully lttng-probe-irq [in modprobe_lttng_data() at modpr > obe.c:199] > DEBUG1: Modprobe successfully lttng-probe-kvm [in modprobe_lttng_data() at modpr > obe.c:199] > DEBUG1: Modprobe successfully lttng-probe-sched [in modprobe_lttng_data() at mod > probe.c:199] > DEBUG1: Modprobe successfully lttng-probe-signal [in modprobe_lttng_data() at mo > dprobe.c:199] > DEBUG1: Modprobe successfully lttng-probe-statedump [in modprobe_lttng_data() at > modprobe.c:199] > DEBUG1: Modprobe successfully lttng-probe-timer [in modprobe_lttng_data() at mod > probe.c:199] > DEBUG1: Kernel tracer fd 6 [in init_kernel_tracer() at main.c:1887] > DEBUG2: Creating consumer directory: /var/run/lttng/ustconsumerd64 [in set_consu > mer_sockets() at main.c:4359] > DEBUG2: Creating consumer directory: /var/run/lttng/ustconsumerd32 [in set_consu > mer_sockets() at main.c:4359] > DEBUG1: Signal handler set for SIGTERM, SIGPIPE and SIGINT [in set_signal_handle > r() at main.c:4451] > Warning: No tracing group detected > DEBUG1: epoll set max size is 95800 [in compat_epoll_set_max_size() at compat-ep > oll.c:224] > DEBUG1: Thread manage kernel started [in thread_manage_kernel() at main.c:876] > DEBUG1: Updating kernel poll set [in update_kernel_poll() at main.c:748] > DEBUG1: Thread kernel polling on 2 fds [in thread_manage_kernel() at main.c:905] > DEBUG1: [thread] Manage application started [in thread_manage_apps() at main.c:1 > 179] > DEBUG1: Apps thread polling on 2 fds [in thread_manage_apps() at main.c:1200] > DEBUG1: [thread] Manage application registration started [in thread_registration > _apps() at main.c:1392] > DEBUG1: Notifying applications of session daemon state: 1 [in notify_ust_apps() > at main.c:687] > DEBUG1: Got the wait shm fd 18 [in get_wait_shm() at shm.c:117] > DEBUG1: Futex wait update active 1 [in futex_wait_update() at futex.c:62] > DEBUG1: Accepting application registration [in thread_registration_apps() at mai > n.c:1423] > DEBUG1: [thread] Dispatch UST command started [in thread_dispatch_ust_registrati > on() at main.c:1324] > DEBUG1: Futex n to 1 prepare done [in futex_nto1_prepare() at futex.c:73] > DEBUG1: Woken up but nothing in the UST command queue [in thread_dispatch_ust_re > gistration() at main.c:1334] > DEBUG1: [thread] Manage client started [in thread_manage_clients() at main.c:379 > 4] > DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3826] > > From the above it seems I don't have any problems. Yes I get that failure when running lttng. > > I'm running this on a TI AM335x EVM with the lttng modules compiled against the arago 05.04 linux kernel(Version 3.2) and everything compiled using the arago toolchain. > > Thanks in advance > Dhiliphen > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 3 09:15:39 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 3 May 2013 09:15:39 -0400 Subject: [lttng-dev] babeltrace assertion "`pos->offset <= pos->content_size' failed" In-Reply-To: <50461F57.5010401@mentor.com> References: <50461F57.5010401@mentor.com> Message-ID: <20130503131538.GA31382@Krystal> Are you still experiencing this issue ? Thanks, Mathieu * Wade Farnsworth (wade_farnsworth at mentor.com) wrote: > Hi, > > I'm occasionally seeing the following error when I pass a trace through > babeltrace: > > babeltrace: ../../include/babeltrace/ctf/types.h:203: ctf_pos_get_event: > Assertion `pos->offset <= pos->content_size' failed. > Aborted > > Here are my platform details: > > Board: ARM Pandaboard > Kernel: v3.1.0 from > git://dev.omapzoom.org/pub/scm/integration/kernel-ubuntu.git > lttng-modules: v2.0.5 > lttng-tools: v2.0.3 > babeltrace: 1.0.0-rc5 > > Now, I'm not very familiar with the internal workings of, but it seems > like this situation should be prevented by the call to v_cmpxchg in > lib_ring_buffer_check_deliver() which claims to have exclusive subbuffer > access when the content_size field is written. Is this understanding > correct? > > Does anyone have any suggestions on where the problem might be? Any > help you might be able to give me would be appreciated. > > Thanks, > > Wade Farnsworth > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From wade_farnsworth at mentor.com Fri May 3 09:53:26 2013 From: wade_farnsworth at mentor.com (Wade Farnsworth) Date: Fri, 3 May 2013 06:53:26 -0700 Subject: [lttng-dev] babeltrace assertion "`pos->offset <= pos->content_size' failed" In-Reply-To: <20130503131538.GA31382@Krystal> References: <50461F57.5010401@mentor.com> <20130503131538.GA31382@Krystal> Message-ID: <5183C156.70102@mentor.com> Hi Mathieu, Commit 4ef415a92af77f9324026b62e023e15824330dcd fixed the problem for me. Sorry for not being more explicit about this. Regards, Wade Mathieu Desnoyers wrote: > Are you still experiencing this issue ? > > Thanks, > > Mathieu > > * Wade Farnsworth (wade_farnsworth at mentor.com) wrote: >> Hi, >> >> I'm occasionally seeing the following error when I pass a trace through >> babeltrace: >> >> babeltrace: ../../include/babeltrace/ctf/types.h:203: ctf_pos_get_event: >> Assertion `pos->offset <= pos->content_size' failed. >> Aborted >> >> Here are my platform details: >> >> Board: ARM Pandaboard >> Kernel: v3.1.0 from >> git://dev.omapzoom.org/pub/scm/integration/kernel-ubuntu.git >> lttng-modules: v2.0.5 >> lttng-tools: v2.0.3 >> babeltrace: 1.0.0-rc5 >> >> Now, I'm not very familiar with the internal workings of, but it seems >> like this situation should be prevented by the call to v_cmpxchg in >> lib_ring_buffer_check_deliver() which claims to have exclusive subbuffer >> access when the content_size field is written. Is this understanding >> correct? >> >> Does anyone have any suggestions on where the problem might be? Any >> help you might be able to give me would be appreciated. >> >> Thanks, >> >> Wade Farnsworth >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > -- Wade Farnsworth | Sr. Embedded Linux Dev. Engr. Mentor Embedded? Nucleus? | Linux? | Android? | Services | UI | Multi-OS Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries From mathieu.desnoyers at efficios.com Fri May 3 10:42:22 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 3 May 2013 10:42:22 -0400 Subject: [lttng-dev] lttng In-Reply-To: <829CD00A1996CE4982B5200EDCE9428BFC39C2@HSPMS-EXCHG01.hspg.de> References: <829CD00A1996CE4982B5200EDCE9428BFC398E@HSPMS-EXCHG01.hspg.de> <508018F1.4000602@efficios.com> <20121018162317.GA17795@Krystal> <829CD00A1996CE4982B5200EDCE9428BFC39AC@HSPMS-EXCHG01.hspg.de> <20121019121144.GA30479@Krystal> <829CD00A1996CE4982B5200EDCE9428BFC39C2@HSPMS-EXCHG01.hspg.de> Message-ID: <20130503144221.GA32267@Krystal> Hi Kubitz, Sorry for the late reply, CCing lttng-dev, since this explanation about robustness against crash can be useful to others, * Kubitz J?rg (joerg.kubitz at hspg.de) wrote: > You use per-cpu-datastructures only to prevent cache-line-bouncing and > not for exclusive access? For kernel tracing, we can disable preemption (and thus migration) around accesses to per-cpu data structures. Therefore, it prevents both cache line bouncing and ensures that only a single CPU accesses the per-cpu data (although an IRQ/softirq could access the same per-cpu data concurrently). For user-space tracing, given that we cannot cheaply disable preemption, we only use per-cpu data to prevent cache-line bouncing. > Then you would need to atomically write the > whole message. This is correct. In both cases. We need to protect against interrupts in the kernel, and against signals and other threads in user-space. > That cannot be done if the message is bigger than the > bus. It's the space reservation that needs to be performed atomically, not writing the message. Please see: https://lttng.org/publications M. Desnoyers, Low-Impact Operating System Tracing Ph.D. dissertation, ?cole Polytechnique de Montr?al, 2009. See the chapter describing the ring buffer. > Or if you only reserve space atomically and the thread dies > before it uses the reserved space the reader that waits for the insert > is in deadlock. This issue is not so relevant for kernel tracing, because we disable preemption around use of the buffer, so only a kernel crash would cause a thread to die between reserve and commit. But at that point, we have bigger problems in the system than tracing. For user-space tracing, this question is relevant, because we have to deal with the fact that a user-space application can be killed at any point. There are now two tracing modes implemented in lttng-ust (user-space tracer), each with their own advantages (+)/disadvantages(-): 1) per-pid buffer tracing, - each process in the system has its own per-cpu buffers, increased memory consumption, increased overhead for buffer allocation in workloads consisting of short-lived processes, + when a process dies, its associated wakeup pipe write-side is closed by the kernel, so the consumer knows it needs to read the last buffer. It can read it up to the last contiguous point in the last subbuffer where data was written (commit seq counter). 2) per-uid (shared) buffer tracing, (buffers shared across applications with same user ID) + less memory overhead, less runtime overhead for short-lived processes, - if a process dies between reserve and commit, it creates a whole in the subbuffer. This whole will be detected only when the producer will fill up the buffer and find the unbalanced reserved/commit counter the next time it reaches this sub-buffer. Until the buffer the unbalanced reserve/commit count is observed by a producer, the consumer is unable to read the buffer futher than the packet containing the "whole". When the producer rebalances this packet's reserve/commit count, it will be counted as a "discarded" packet, and we lose all data within the packet that contains the whole. > So lttng is not robust? It's actually a question of trade-offs: robustness (1) vs speed (2). We provide configurations for both. Thanks, Mathieu > > Thanks for your explanaition. > > J?rg Kubitz -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From trost at cloud.rain.com Fri May 3 10:46:30 2013 From: trost at cloud.rain.com (Bill Trost) Date: Fri, 03 May 2013 07:46:30 -0700 Subject: [lttng-dev] using --function/--probe In-Reply-To: Your message of Thu, 02 May 2013 15:54:31 EDT. <20130502195431.GA15675@Krystal> References: <20130502195431.GA15675@Krystal><20120605154950.GA21955@Krystal> <19046.1338994097@cloud.rain.com> Message-ID: <32266.1367592390@cloud.rain.com> Mathieu wrote: * Bill Trost (trost at cloud.rain.com) wrote: > Mathieu wrote: > * Bill Trost (trost at cloud.rain.com) wrote: > > ...how do I trace what work is being > > enqueued and run by the kworker threads? > > For this level of details, I think kprobes/kretprobes will not > currently allow you to fetch it. The two options we have are: > > - use static tracepoints. Is there a tracepoint that targets the > information you are looking for ? Try "lttng list -k". > > No, I've been capturing all kernel events and haven't seen > anything resembling the kworker tracepoints of lttng 0.x. LTTng 2.2-rc has a new workqueue instrumentation. Maybe this can fit your use-case ? Hi, Mathieu, I'd forgotten all about this. We eventually discovered, as part of investigating the kworkers, that we had a misconfigured sysctl. When we fixed that, the offending kwork then disappeared completely -- problem solved. Thanks for the "blast from the past", Bill From mathieu.desnoyers at efficios.com Fri May 3 11:19:07 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 3 May 2013 11:19:07 -0400 Subject: [lttng-dev] registering user-defined properties on tracepoints In-Reply-To: <7F632A9222059A42AF70FCB7965774AA2086527B@ALA-MBB.corp.ad.wrs.com> References: <7F632A9222059A42AF70FCB7965774AA2086527B@ALA-MBB.corp.ad.wrs.com> Message-ID: <20130503151907.GA1513@Krystal> * McDermott, Andrew (Andrew.McDermott at windriver.com) wrote: > > Is it possible to add /other/ user-defined attributes to an event > definition. What I'm trying to do is associate other related > properties/attributes to the event itself and on each field in the > event. > > In this example I'm choosing to encode my attributes using a JSON-like > syntax, but the point is that this is really user-defined. > > TRACEPOINT_EVENT(foo, some_event, > TP_ARGS(int, value), > TP_ATTRIBUTES("{ icon:some_event.png, helpIndex:docs/help/0001.html ... }") > TP_FIELDS(ctf_integer(int, foo, foo, "{java_formatter:com.windriver.SomeEventFormatter, leftAdjust:1, mask:64, ... }")) > ) > > I could create an associated event: > > TRACEPOINT_EVENT(foo, some_event_metadata, > TP_ARGS(char *, str), > TP_FIELDS(ctf_string(char *, str)) > ) > > and have some rules based on the event names to bind the two together > but it seems "nicer" to keep them together. My motivation is keeping > this kind of auxiliary information available with the trace itself as > opposed to some side-files which have the tendency to get out of sync. > > Or perhaps this is another way of achieving this. Any hints gratefully > received... I would advise adding this info similarly to what we do for EMF modeling info, and loglevels, in UST tracepoints: adding a separate TRACEPOINT_ATTRIBUTES(provider, name, ....), outside of TRACEPOINT_EVENT. It's a much easier way to add new stuff without breaking backward compatibility. Thanks, Mathieu > > Thanks, > Andy. > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 3 11:21:18 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 3 May 2013 11:21:18 -0400 Subject: [lttng-dev] getting a notification from 'lttng start|stop' In-Reply-To: <7F632A9222059A42AF70FCB7965774AA208660DB@ALA-MBB.corp.ad.wrs.com> References: <7F632A9222059A42AF70FCB7965774AA208660DB@ALA-MBB.corp.ad.wrs.com> Message-ID: <20130503152118.GB1513@Krystal> * McDermott, Andrew (Andrew.McDermott at windriver.com) wrote: > > Is it possible to see when tracing has actually started (i.e., when > `lttng start' is invoked)? > > I can observe that the tracepoint is enabled/disabled by looking at the > 'state' field in a 'struct tracepoint'. Is there an equivalent variable > to monitor for `lttng start|stop'? I was trying to dump some additional > process state (via calls to tracepoint) whenever an external > start/stop/start/stop/start sequence occurs. statedump for UST. This is a feature we don't have at this point. It would need to be designed within UST. I don't this a simple "hack" would do. > > Also, when I run 'lttng enable-event -u -a' I see that the 'state' value > changes from '0' to '1', but if I run 'lttng disable-event -u -a' it > stays at '1'. Is this expected? If I subsequently run 'lttng destroy' > then it does go to '0'. Shouldn't the disable set it to '0' too? I think it's been fixed, but if you still experience this issue, please file a bug report on bugs.lttng.org. Thanks, Mathieu > > -- > andy > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 3 11:33:28 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 3 May 2013 11:33:28 -0400 Subject: [lttng-dev] tracepoint provider: static versus dynamic linking (TRACEPOINT_PROBE_DYNAMIC_LINKAGE) In-Reply-To: <509B22FA.2030800@quantum.com> References: <509B22FA.2030800@quantum.com> Message-ID: <20130503153328.GD1513@Krystal> Hi David, Sorry for the late reply, * David Bryant (david.bryant at quantum.com) wrote: > Hello, > > What are the pros and cons of static versus dynamic linking of the > tracepoint provider? I can't find much information looking around. static linking: no need to use LD_PRELOAD. dynamic linking: can ship tracepoint provider as separate .so, packaging separately from the instrumented application. > Are their any licensing related issues? For example, is closed-source > software not allowed to use static linking? The headers used to build the tracepoint providers are MIT-licensed, so there is absolutely no licensing issue here with static linking of tracepoint providers with closed-source apps. However, liblttng-ust per se is _always_ dynamically linked. Thanks, Mathieu > > Is it just an optimisation - allowing the program to run without probes > connected? > > Thanks, > Dave > > > Notes from my digging of how it works: > > Looking at the preprocessor output of sample.c without/with > TRACEPOINT_PROBE_DYNAMIC_LINKAGE defined I see: > > $ diff -u sample.i.static sample.i.dynamic > --- sample.i.static 2012-11-08 13:29:04.049059515 +1030 > +++ sample.i.dynamic 2012-11-08 13:29:04.169062438 +1030 > @@ -746,7 +746,7 @@ > struct tracepoint __tracepoint_sample_component___message > __attribute__((section("__tracepoints"))) = { > __tp_strtab_sample_component___message, > 0, > ((void *)0), > - &__tracepoint_provider_sample_component, > + ((void *)0), > "char *, text", > }; > > (line breaks added by me). > > So the "int * tracepoint::tracepoint_provider_ref" member is set to > ((void *)0) in struct tracepoint: > > struct tracepoint { > const char *name; > int state; > struct tracepoint_probe *probes; > int *tracepoint_provider_ref; /* XXX */ > const char *signature; > char padding[16]; > }; > > So the static version is not dependent on the symbol > "__tracepoint_provider_sample_component". Running > LD_PRELOAD=libprovider.so ./sample (somehow?) reinstates that symbol. > (Can't quite see how that works). > > ---------------------------------------------------------------------- > The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt. > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From francis.giraldeau at gmail.com Fri May 3 13:43:24 2013 From: francis.giraldeau at gmail.com (Francis Giraldeau) Date: Fri, 03 May 2013 13:43:24 -0400 Subject: [lttng-dev] GSoC 2013 Multi-layer event context backtrace Message-ID: <5183F73C.5010408@gmail.com> About the student: Francis Giraldeau francis.giraldeau at gmail.com ?cole Polytechnique de Montr?al Kernel tracing fgiraldeau on oftc.net GMT -5 Github: github.com/giraldeau Twitter: N/A Blog: multivax.blogspot.com Personal web page: http://step.polymtl.ca/~fgiraldeau I'm involved in Open Source development since 2003. I deployed large scale IT systems for 5 years with Open Source software exclusively. For my master, I decided to contribute to Augeas a new feature to manage context-free configuration files in a typesafe, bidirectional manner, specifically for httpd configuration. I decided to return to school to get more insight about the runtime behavior of programs. In find the Linux kernel tracing capabilities absolutely amazing, and I want to extend them. GSoC information This is my first participation to GSoC, but I do have a large track record of previous contributions to numerous OpenSource projects. All my code is on the provided github link. I do not apply for another project. Realistically, I do have about 30 hours a week, because I have to share my time with other research tasks. Project Information I want to bridge the gap between the kernel trace and the executing code in userspace. It is possible to trace system calls with LTTng today, but the developer has no clue where those calls are made from it's code. One way to do solve this problem is to record the backtrace of the program, for example in system call entry. It would then be possible to locate the code that triggered some system call. LTTng has the concept of per-event context, such that one could enable backtrace recording on any event, not only limited to system calls. In addition, we could record the backtrace either for the kernel side, or in userspace or both. I already have a prototype that I used to locate all code that triggered wake-up in processes, and is part of the lttng-modules addons. https://github.com/giraldeau/lttng-modules/blob/wakeup2/addons/lttng-wakeup.c I want to create a new per-event context in LTTng, that will support this feature on any event recorded. This requires changes in many components of LTTng: kernel module must support the feature and lttng-tools must accepts the new context. We expect to be able to enable to record the backtrace either of kerne and userspace process (C code) on any events in a kernel trace. We want to resolve the symbols when it's possible. In particular, it should be able to support kernel address randomization, that may change the base address randomly for security reasons. If time is left, we can add support for other languages in userspace, like JavaScript. I follow and participate actively to the project when I have something original to contribute. I want to be involved to support this feature when the project is over. Thanks! Francis -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4489 bytes Desc: Signature cryptographique S/MIME URL: From mathieu.desnoyers at efficios.com Fri May 3 14:35:01 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 3 May 2013 14:35:01 -0400 Subject: [lttng-dev] Emitting events from shared object constructors is (currently) not possible In-Reply-To: <50AF2EB6.8090706@mentor.com> References: <50AE31E8.4040507@mentor.com> <20121122153901.GA14685@Krystal> <50AE4CEF.9050809@mentor.com> <20121122164512.GA16119@Krystal> <50AF2EB6.8090706@mentor.com> Message-ID: <20130503183500.GB7288@Krystal> * Woegerer, Paul (Paul_Woegerer at mentor.com) wrote: > On 11/22/2012 05:45 PM, Mathieu Desnoyers wrote: > > * Woegerer, Paul (Paul_Woegerer at mentor.com) wrote: > >> In case the probes would be defined in different shared object from the > >> one where they are used we wouldn't have a problem at all because the > >> dynamic linker would invoke all the constructor functions for the probe > >> shared object before the constructor functions of the shared object that > >> has a dependency to the probe shared object, right ? > > > > The instrumented code does not have dependency on the probe shared > > object, so we can ship applications separately from their probe .so. So > > unfortunately, the linker is not doing this for us. > > But still, to come back to my original request, whenever the tracepoint > provider is statically linked to the tracepoint user (which is a valid > lttng-ust use case, right ?) yes, > it is not possible to emit tracepoints in > object constructors as long as object constructors defined in > lttng/tracepoint.h and lttng/ust-tracepoint-event.h are simply using > __attribute__((constructor)) instead of e.g. __attribute__((constructor > (1000))). Those can be emitted, but indeed they might not be traced. > Without this change the user simply cannot make sure its own > constructor gets invoked after the trace provider constructors. If we try to support tracing constructors, I'm concerned that with this change (using priority): 1 - we lose in terms of portability (not all gcc versions support the priority argument, 2 - there can be corner-cases that won't honor the priority. We should thoroughly test and document the effect of priority in cases of: - multiple .o linked into an executable, - multiple .o linked into a .a, statically linked (does not honor constructors at all), - multiple .o linked into a .so, many .so linked, And figure out if the ordering of constructor is OK with each of those cases. > > >> And even if this is not the case I could explicitly dlopen the probe > >> shared object from within my constructor function and thus make sure > >> that the constructor function of the probe shared object gets called > >> before I emit an event from my constructor function. > > > > The idea would be to provide a nice API to facilitate this use-case, and > > document it in the instrumentation guide-lines (lttng-ust(3)). > > Therefore we would need to reliably deduce the tracepoint provider > shared library name from the header file that defines it. Since C/C++ > has no package concept and gives you the freedom to name your shared > library whatever you like it seems to be hard to get there. indeed, > > One way to deal with it would be to extend the lttng-gen-tp tool > directly build the tracepoint provider shared library instead of just > outputting the generated .c .h files. But then we'd _require_ that people use .so for providers. They might want to just pull the probe provider into their executable. > This way the shared library name > would be controlled by lttng-gen-tp tool and an autogenerated macro > (e.g. ensure_tracepoints_init()) in the generated .h file could provide > the dlopen code to explicitly load the tracepoint provider shared > library if needed. Would this work fine with your constructor instrumentation use-case ? Is the order of constructors across .so files guaranteed in any way ? Thanks, Mathieu > > Thanks, > Paul > > > -- > Paul Woegerer | SW Development Engineer > http://go.mentor.com/sourceryanalyzer > > Mentor Embedded(tm) | Prinz Eugen Stra?e 72/2/4, Vienna, 1040 Austria > Nucleus? | Linux? | Android(tm) | Services | UI | Multi-OS > > Android is a trademark of Google Inc. Use of this trademark is subject > to Google Permissions. > Linux is the registered trademark of Linus Torvalds in the U.S. and > other countries. -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Mon May 6 08:34:57 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 08:34:57 -0400 Subject: [lttng-dev] [PATCH] urcu: make the code of urcu-qsbr as normal urcu In-Reply-To: <50C19DE4.1070007@cn.fujitsu.com> References: <50C19DE4.1070007@cn.fujitsu.com> Message-ID: <20130506123457.GA12699@Krystal> * Lai Jiangshan (laijs at cn.fujitsu.com) wrote: > urcu-qsbr's read site's quiescence is much longer than normal urcu ==> > synchronize_rcu() is much slower ==> > rcu_gp_ctr is updated much less ==> > the whole urcu-qsbr will not be slowed down by false sharing of rcu_gp_ctr. Hi Lai, Sorry for the late reply, I must have been very busy when you sent this patch. It's indeed a very good idea to make qsbr more similar to other URCU flavors. I'm merging it right away. Thanks! Mathieu > > But this patch makes sense to keep the code of urcu-qsbr like normal urcu, > better readability and maintenance. > > Test: (4*6 CPUs) > Before patch: > [root at localhost userspace-rcu]# ./tests/test_urcu_qsbr 20 1 20 > SUMMARY ./tests/test_urcu_qsbr testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 65498297587 nr_writes 2000665 nr_ops 65500298252 > [root at localhost userspace-rcu]# ./tests/test_urcu_qsbr 20 1 20 > SUMMARY ./tests/test_urcu_qsbr testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 67218079467 nr_writes 1981593 nr_ops 67220061060 > > After patch > ./tests/test_urcu_qsbr 20 1 20 > SUMMARY ./tests/test_urcu_qsbr testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 67473798999 nr_writes 1999151 nr_ops 67475798150 > [root at localhost userspace-rcu]# ./tests/test_urcu_qsbr 20 1 20 > SUMMARY ./tests/test_urcu_qsbr testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 67065521397 nr_writes 1993956 nr_ops 67067515353 > > > Signed-off-by: Lai Jiangshan > -- > diff --git a/urcu-qsbr.c b/urcu-qsbr.c > index 3c2c65d..995c564 100644 > --- a/urcu-qsbr.c > +++ b/urcu-qsbr.c > @@ -53,13 +53,7 @@ > void __attribute__((destructor)) rcu_exit(void); > > static pthread_mutex_t rcu_gp_lock = PTHREAD_MUTEX_INITIALIZER; > - > -int32_t rcu_gp_futex; > - > -/* > - * Global grace period counter. > - */ > -unsigned long rcu_gp_ctr = RCU_GP_ONLINE; > +struct urcu_gp rcu_gp = { .ctr = RCU_GP_ONLINE }; > > /* > * Active attempts to check for reader Q.S. before calling futex(). > @@ -118,8 +112,8 @@ static void wait_gp(void) > { > /* Read reader_gp before read futex */ > cmm_smp_rmb(); > - if (uatomic_read(&rcu_gp_futex) == -1) > - futex_noasync(&rcu_gp_futex, FUTEX_WAIT, -1, > + if (uatomic_read(&rcu_gp.futex) == -1) > + futex_noasync(&rcu_gp.futex, FUTEX_WAIT, -1, > NULL, NULL, 0); > } > > @@ -133,12 +127,12 @@ static void wait_for_readers(struct cds_list_head *input_readers, > /* > * Wait for each thread URCU_TLS(rcu_reader).ctr to either > * indicate quiescence (offline), or for them to observe the > - * current rcu_gp_ctr value. > + * current rcu_gp.ctr value. > */ > for (;;) { > wait_loops++; > if (wait_loops >= RCU_QS_ACTIVE_ATTEMPTS) { > - uatomic_set(&rcu_gp_futex, -1); > + uatomic_set(&rcu_gp.futex, -1); > /* > * Write futex before write waiting (the other side > * reads them in the opposite order). > @@ -177,7 +171,7 @@ static void wait_for_readers(struct cds_list_head *input_readers, > if (wait_loops >= RCU_QS_ACTIVE_ATTEMPTS) { > /* Read reader_gp before write futex */ > cmm_smp_mb(); > - uatomic_set(&rcu_gp_futex, 0); > + uatomic_set(&rcu_gp.futex, 0); > } > break; > } else { > @@ -253,11 +247,11 @@ void synchronize_rcu(void) > > /* > * Must finish waiting for quiescent state for original parity > - * before committing next rcu_gp_ctr update to memory. Failure > + * before committing next rcu_gp.ctr update to memory. Failure > * to do so could result in the writer waiting forever while new > * readers are always accessing data (no progress). Enforce > * compiler-order of load URCU_TLS(rcu_reader).ctr before store > - * to rcu_gp_ctr. > + * to rcu_gp.ctr. > */ > cmm_barrier(); > > @@ -269,13 +263,13 @@ void synchronize_rcu(void) > cmm_smp_mb(); > > /* Switch parity: 0 -> 1, 1 -> 0 */ > - CMM_STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr ^ RCU_GP_CTR); > + CMM_STORE_SHARED(rcu_gp.ctr, rcu_gp.ctr ^ RCU_GP_CTR); > > /* > - * Must commit rcu_gp_ctr update to memory before waiting for > + * Must commit rcu_gp.ctr update to memory before waiting for > * quiescent state. Failure to do so could result in the writer > * waiting forever while new readers are always accessing data > - * (no progress). Enforce compiler-order of store to rcu_gp_ctr > + * (no progress). Enforce compiler-order of store to rcu_gp.ctr > * before load URCU_TLS(rcu_reader).ctr. > */ > cmm_barrier(); > @@ -353,13 +347,13 @@ void synchronize_rcu(void) > goto out; > > /* Increment current G.P. */ > - CMM_STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr + RCU_GP_CTR); > + CMM_STORE_SHARED(rcu_gp.ctr, rcu_gp.ctr + RCU_GP_CTR); > > /* > - * Must commit rcu_gp_ctr update to memory before waiting for > + * Must commit rcu_gp.ctr update to memory before waiting for > * quiescent state. Failure to do so could result in the writer > * waiting forever while new readers are always accessing data > - * (no progress). Enforce compiler-order of store to rcu_gp_ctr > + * (no progress). Enforce compiler-order of store to rcu_gp.ctr > * before load URCU_TLS(rcu_reader).ctr. > */ > cmm_barrier(); > diff --git a/urcu/static/urcu-qsbr.h b/urcu/static/urcu-qsbr.h > index f6e5580..2b9bece 100644 > --- a/urcu/static/urcu-qsbr.h > +++ b/urcu/static/urcu-qsbr.h > @@ -119,12 +119,18 @@ static inline void rcu_debug_yield_init(void) > #define RCU_GP_ONLINE (1UL << 0) > #define RCU_GP_CTR (1UL << 1) > > -/* > - * Global quiescent period counter with low-order bits unused. > - * Using a int rather than a char to eliminate false register dependencies > - * causing stalls on some architectures. > - */ > -extern unsigned long rcu_gp_ctr; > +struct urcu_gp { > + /* > + * Global quiescent period counter with low-order bits unused. > + * Using a int rather than a char to eliminate false register > + * dependencies causing stalls on some architectures. > + */ > + unsigned long ctr; > + > + int32_t futex; > +} __attribute__((aligned(CAA_CACHE_LINE_SIZE))); > + > +extern struct urcu_gp rcu_gp; > > struct rcu_reader { > /* Data used by both reader and synchronize_rcu() */ > @@ -137,8 +143,6 @@ struct rcu_reader { > > extern DECLARE_URCU_TLS(struct rcu_reader, rcu_reader); > > -extern int32_t rcu_gp_futex; > - > /* > * Wake-up waiting synchronize_rcu(). Called from many concurrent threads. > */ > @@ -147,10 +151,10 @@ static inline void wake_up_gp(void) > if (caa_unlikely(_CMM_LOAD_SHARED(URCU_TLS(rcu_reader).waiting))) { > _CMM_STORE_SHARED(URCU_TLS(rcu_reader).waiting, 0); > cmm_smp_mb(); > - if (uatomic_read(&rcu_gp_futex) != -1) > + if (uatomic_read(&rcu_gp.futex) != -1) > return; > - uatomic_set(&rcu_gp_futex, 0); > - futex_noasync(&rcu_gp_futex, FUTEX_WAKE, 1, > + uatomic_set(&rcu_gp.futex, 0); > + futex_noasync(&rcu_gp.futex, FUTEX_WAKE, 1, > NULL, NULL, 0); > } > } > @@ -162,7 +166,7 @@ static inline enum rcu_state rcu_reader_state(unsigned long *ctr) > v = CMM_LOAD_SHARED(*ctr); > if (!v) > return RCU_READER_INACTIVE; > - if (v == rcu_gp_ctr) > + if (v == rcu_gp.ctr) > return RCU_READER_ACTIVE_CURRENT; > return RCU_READER_ACTIVE_OLD; > } > @@ -216,7 +220,7 @@ static inline void _rcu_quiescent_state_update_and_wakeup(unsigned long gp_ctr) > * to be invoked directly from non-LGPL code. > * > * We skip the memory barriers and gp store if our local ctr already > - * matches the global rcu_gp_ctr value: this is OK because a prior > + * matches the global rcu_gp.ctr value: this is OK because a prior > * _rcu_quiescent_state() or _rcu_thread_online() already updated it > * within our thread, so we have no quiescent state to report. > */ > @@ -224,7 +228,7 @@ static inline void _rcu_quiescent_state(void) > { > unsigned long gp_ctr; > > - if ((gp_ctr = CMM_LOAD_SHARED(rcu_gp_ctr)) == URCU_TLS(rcu_reader).ctr) > + if ((gp_ctr = CMM_LOAD_SHARED(rcu_gp.ctr)) == URCU_TLS(rcu_reader).ctr) > return; > _rcu_quiescent_state_update_and_wakeup(gp_ctr); > } > @@ -257,7 +261,7 @@ static inline void _rcu_thread_offline(void) > static inline void _rcu_thread_online(void) > { > cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */ > - _CMM_STORE_SHARED(URCU_TLS(rcu_reader).ctr, CMM_LOAD_SHARED(rcu_gp_ctr)); > + _CMM_STORE_SHARED(URCU_TLS(rcu_reader).ctr, CMM_LOAD_SHARED(rcu_gp.ctr)); > cmm_smp_mb(); > } > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From Daniel.Thibault at drdc-rddc.gc.ca Mon May 6 08:41:28 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Mon, 6 May 2013 12:41:28 +0000 Subject: [lttng-dev] lttng Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D11268@VAL-E-02.valcartier.drdc-rddc.gc.ca> > Message: 1 > Date: Fri, 3 May 2013 10:42:22 -0400 > > There are now two tracing modes implemented in lttng-ust (user-space tracer), each with their own advantages (+)/disadvantages(-): > > 1) per-pid buffer tracing, > [...] > 2) per-uid (shared) buffer tracing, (buffers shared across applications > with same user ID) > + less memory overhead, less runtime overhead for short-lived > processes, > - if a process dies between reserve and commit, it creates a whole in > the subbuffer. This whole will be detected only when the producer > will fill up the buffer and find the unbalanced reserved/commit > counter the next time it reaches this sub-buffer. Until the buffer > the unbalanced reserve/commit count is observed by a producer, > the consumer is unable to read the buffer futher than the packet > containing the "whole". When the producer rebalances this packet's > reserve/commit count, it will be counted as a "discarded" packet, > and we lose all data within the packet that contains the whole. whole ? hole This changes the meaning completely. :-) Daniel U. Thibault Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure Qu?bec QC G3J 1X5 CANADA Vox : (418) 844-4000 x4245 Fax : (418) 844-4538 NAC : 918V QSDJ Gouvernement du Canada | Government of Canada From mathieu.desnoyers at efficios.com Mon May 6 08:44:33 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 08:44:33 -0400 Subject: [lttng-dev] [PATCH] urcu: avoid false sharing for rcu_gp_ctr In-Reply-To: <50C19575.2070802@cn.fujitsu.com> References: <50C19575.2070802@cn.fujitsu.com> Message-ID: <20130506124433.GB12699@Krystal> Since we are bumping the urcu soname version number to 2.0.0 for the upcoming urcu 0.8 anyway, it's time to merge this patch. Thanks! Mathieu * Lai Jiangshan (laijs at cn.fujitsu.com) wrote: > @rcu_gp_ctr and @registry share the same cache line, it causes > false sharing and slowdown both of the read site and update site. > > Fix: Use different cache line for them. > > Although rcu_gp_futex is updated less than rcu_gp_ctr, but > they always be accessed at almost the same time, so we also move rcu_gp_futex > to the cacheline of rcu_gp_ctr to reduce the cacheline-usage or cache-missing > of read site. > > > test: (4X6=24 CPUs) > > Before patch: > > [root at localhost userspace-rcu]# ./tests/test_urcu_mb 20 1 20 > SUMMARY ./tests/test_urcu_mb testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 2100285330 nr_writes 3390219 nr_ops 2103675549 > [root at localhost userspace-rcu]# ./tests/test_urcu_mb 20 1 20 > SUMMARY ./tests/test_urcu_mb testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 1619868562 nr_writes 3529478 nr_ops 1623398040 > [root at localhost userspace-rcu]# ./tests/test_urcu_mb 20 1 20 > SUMMARY ./tests/test_urcu_mb testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 1949067038 nr_writes 3469334 nr_ops 1952536372 > > > after patch: > > [root at localhost userspace-rcu]# ./tests/test_urcu_mb 20 1 20 > SUMMARY ./tests/test_urcu_mb testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 3380191848 nr_writes 4903248 nr_ops 3385095096 > [root at localhost userspace-rcu]# ./tests/test_urcu_mb 20 1 20 > SUMMARY ./tests/test_urcu_mb testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 3397637486 nr_writes 4129809 nr_ops 3401767295 > > Singed-by: Lai Jiangshan > --- > diff --git a/urcu.c b/urcu.c > index 15def09..436d71c 100644 > --- a/urcu.c > +++ b/urcu.c > @@ -83,16 +83,7 @@ void __attribute__((destructor)) rcu_exit(void); > #endif > > static pthread_mutex_t rcu_gp_lock = PTHREAD_MUTEX_INITIALIZER; > - > -int32_t rcu_gp_futex; > - > -/* > - * Global grace period counter. > - * Contains the current RCU_GP_CTR_PHASE. > - * Also has a RCU_GP_COUNT of 1, to accelerate the reader fast path. > - * Written to only by writer with mutex taken. Read by both writer and readers. > - */ > -unsigned long rcu_gp_ctr = RCU_GP_COUNT; > +struct urcu_gp rcu_gp = { .ctr = RCU_GP_COUNT }; > > /* > * Written to only by each individual reader. Read by both the reader and the > @@ -217,8 +208,8 @@ static void wait_gp(void) > { > /* Read reader_gp before read futex */ > smp_mb_master(RCU_MB_GROUP); > - if (uatomic_read(&rcu_gp_futex) == -1) > - futex_async(&rcu_gp_futex, FUTEX_WAIT, -1, > + if (uatomic_read(&rcu_gp.futex) == -1) > + futex_async(&rcu_gp.futex, FUTEX_WAIT, -1, > NULL, NULL, 0); > } > > @@ -232,12 +223,12 @@ static void wait_for_readers(struct cds_list_head *input_readers, > /* > * Wait for each thread URCU_TLS(rcu_reader).ctr to either > * indicate quiescence (not nested), or observe the current > - * rcu_gp_ctr value. > + * rcu_gp.ctr value. > */ > for (;;) { > wait_loops++; > if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) { > - uatomic_dec(&rcu_gp_futex); > + uatomic_dec(&rcu_gp.futex); > /* Write futex before read reader_gp */ > smp_mb_master(RCU_MB_GROUP); > } > @@ -270,7 +261,7 @@ static void wait_for_readers(struct cds_list_head *input_readers, > if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) { > /* Read reader_gp before write futex */ > smp_mb_master(RCU_MB_GROUP); > - uatomic_set(&rcu_gp_futex, 0); > + uatomic_set(&rcu_gp.futex, 0); > } > break; > } else { > @@ -289,7 +280,7 @@ static void wait_for_readers(struct cds_list_head *input_readers, > if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) { > /* Read reader_gp before write futex */ > smp_mb_master(RCU_MB_GROUP); > - uatomic_set(&rcu_gp_futex, 0); > + uatomic_set(&rcu_gp.futex, 0); > } > break; > } else { > @@ -357,10 +348,10 @@ void synchronize_rcu(void) > > /* > * Must finish waiting for quiescent state for original parity before > - * committing next rcu_gp_ctr update to memory. Failure to do so could > + * committing next rcu_gp.ctr update to memory. Failure to do so could > * result in the writer waiting forever while new readers are always > * accessing data (no progress). Enforce compiler-order of load > - * URCU_TLS(rcu_reader).ctr before store to rcu_gp_ctr. > + * URCU_TLS(rcu_reader).ctr before store to rcu_gp.ctr. > */ > cmm_barrier(); > > @@ -372,13 +363,13 @@ void synchronize_rcu(void) > cmm_smp_mb(); > > /* Switch parity: 0 -> 1, 1 -> 0 */ > - CMM_STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr ^ RCU_GP_CTR_PHASE); > + CMM_STORE_SHARED(rcu_gp.ctr, rcu_gp.ctr ^ RCU_GP_CTR_PHASE); > > /* > - * Must commit rcu_gp_ctr update to memory before waiting for quiescent > + * Must commit rcu_gp.ctr update to memory before waiting for quiescent > * state. Failure to do so could result in the writer waiting forever > * while new readers are always accessing data (no progress). Enforce > - * compiler-order of store to rcu_gp_ctr before load rcu_reader ctr. > + * compiler-order of store to rcu_gp.ctr before load rcu_reader ctr. > */ > cmm_barrier(); > > diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h > index 973826a..0dd733e 100644 > --- a/urcu/static/urcu.h > +++ b/urcu/static/urcu.h > @@ -213,12 +213,20 @@ static inline void smp_mb_slave(int group) > #define RCU_GP_CTR_PHASE (1UL << (sizeof(unsigned long) << 2)) > #define RCU_GP_CTR_NEST_MASK (RCU_GP_CTR_PHASE - 1) > > -/* > - * Global quiescent period counter with low-order bits unused. > - * Using a int rather than a char to eliminate false register dependencies > - * causing stalls on some architectures. > - */ > -extern unsigned long rcu_gp_ctr; > +struct urcu_gp { > + /* > + * Global grace period counter. > + * Contains the current RCU_GP_CTR_PHASE. > + * Also has a RCU_GP_COUNT of 1, to accelerate the reader fast path. > + * Written to only by writer with mutex taken. > + * Read by both writer and readers. > + */ > + unsigned long ctr; > + > + int32_t futex; > +} __attribute__((aligned(CAA_CACHE_LINE_SIZE))); > + > +extern struct urcu_gp rcu_gp; > > struct rcu_reader { > /* Data used by both reader and synchronize_rcu() */ > @@ -231,16 +239,14 @@ struct rcu_reader { > > extern DECLARE_URCU_TLS(struct rcu_reader, rcu_reader); > > -extern int32_t rcu_gp_futex; > - > /* > * Wake-up waiting synchronize_rcu(). Called from many concurrent threads. > */ > static inline void wake_up_gp(void) > { > - if (caa_unlikely(uatomic_read(&rcu_gp_futex) == -1)) { > - uatomic_set(&rcu_gp_futex, 0); > - futex_async(&rcu_gp_futex, FUTEX_WAKE, 1, > + if (caa_unlikely(uatomic_read(&rcu_gp.futex) == -1)) { > + uatomic_set(&rcu_gp.futex, 0); > + futex_async(&rcu_gp.futex, FUTEX_WAKE, 1, > NULL, NULL, 0); > } > } > @@ -256,13 +262,13 @@ static inline enum rcu_state rcu_reader_state(unsigned long *ctr) > v = CMM_LOAD_SHARED(*ctr); > if (!(v & RCU_GP_CTR_NEST_MASK)) > return RCU_READER_INACTIVE; > - if (!((v ^ rcu_gp_ctr) & RCU_GP_CTR_PHASE)) > + if (!((v ^ rcu_gp.ctr) & RCU_GP_CTR_PHASE)) > return RCU_READER_ACTIVE_CURRENT; > return RCU_READER_ACTIVE_OLD; > } > > /* > - * Helper for _rcu_read_lock(). The format of rcu_gp_ctr (as well as > + * Helper for _rcu_read_lock(). The format of rcu_gp.ctr (as well as > * the per-thread rcu_reader.ctr) has the upper bits containing a count of > * _rcu_read_lock() nesting, and a lower-order bit that contains either zero > * or RCU_GP_CTR_PHASE. The smp_mb_slave() ensures that the accesses in > @@ -271,7 +277,7 @@ static inline enum rcu_state rcu_reader_state(unsigned long *ctr) > static inline void _rcu_read_lock_update(unsigned long tmp) > { > if (caa_likely(!(tmp & RCU_GP_CTR_NEST_MASK))) { > - _CMM_STORE_SHARED(URCU_TLS(rcu_reader).ctr, _CMM_LOAD_SHARED(rcu_gp_ctr)); > + _CMM_STORE_SHARED(URCU_TLS(rcu_reader).ctr, _CMM_LOAD_SHARED(rcu_gp.ctr)); > smp_mb_slave(RCU_MB_GROUP); > } else > _CMM_STORE_SHARED(URCU_TLS(rcu_reader).ctr, tmp + RCU_GP_COUNT); -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From Paul_Woegerer at mentor.com Mon May 6 08:45:32 2013 From: Paul_Woegerer at mentor.com (Woegerer, Paul) Date: Mon, 6 May 2013 14:45:32 +0200 Subject: [lttng-dev] Emitting events from shared object constructors is (currently) not possible In-Reply-To: <20130503183500.GB7288@Krystal> References: <50AE31E8.4040507@mentor.com> <20121122153901.GA14685@Krystal> <50AE4CEF.9050809@mentor.com> <20121122164512.GA16119@Krystal> <50AF2EB6.8090706@mentor.com> <20130503183500.GB7288@Krystal> Message-ID: <5187A5EC.1000807@mentor.com> On 05/03/2013 08:35 PM, Mathieu Desnoyers wrote: > * Woegerer, Paul (Paul_Woegerer at mentor.com) wrote: >> Without this change the user simply cannot make sure its own >> constructor gets invoked after the trace provider constructors. > > If we try to support tracing constructors, I'm concerned that with this > change (using priority): > 1 - we lose in terms of portability (not all gcc versions support the > priority argument, > 2 - there can be corner-cases that won't honor the priority. > > We should thoroughly test and document the effect of priority in cases > of: > > - multiple .o linked into an executable, > - multiple .o linked into a .a, statically linked (does not honor > constructors at all), > - multiple .o linked into a .so, many .so linked, > > And figure out if the ordering of constructor is OK with each of those > cases. You are right. Using the priority construct might cause more problems than it solves. A pragmatic solution to the above problem would be to provide a special documented function (as part of man:lttng-ust) that allows the user to ensure that the static constructors (withing the same "dynamic linker unit" (.so or exe)) used by lttng-ust have been executed successfully. Something like: void ensure_lttng_ust_init_completed(); If the trace provider constructors have been invoked already the function simply returns otherwise it invokes them explicitly and makes sure that a later invocation by the dynamic linker will not have any effect. > >> >>>> And even if this is not the case I could explicitly dlopen the probe >>>> shared object from within my constructor function and thus make sure >>>> that the constructor function of the probe shared object gets called >>>> before I emit an event from my constructor function. >>> >>> The idea would be to provide a nice API to facilitate this use-case, and >>> document it in the instrumentation guide-lines (lttng-ust(3)). >> >> Therefore we would need to reliably deduce the tracepoint provider >> shared library name from the header file that defines it. Since C/C++ >> has no package concept and gives you the freedom to name your shared >> library whatever you like it seems to be hard to get there. > > indeed, > >> >> One way to deal with it would be to extend the lttng-gen-tp tool >> directly build the tracepoint provider shared library instead of just >> outputting the generated .c .h files. > > But then we'd _require_ that people use .so for providers. They might > want to just pull the probe provider into their executable. > >> This way the shared library name >> would be controlled by lttng-gen-tp tool and an autogenerated macro >> (e.g. ensure_tracepoints_init()) in the generated .h file could provide >> the dlopen code to explicitly load the tracepoint provider shared >> library if needed. > > Would this work fine with your constructor instrumentation use-case ? > Is the order of constructors across .so files guaranteed in any way ? Only if we use dlopen *exclusively* and do not rely on any linker induced shared object loading (-lfoo -lbar) anymore we would have full control over the order of execution. --Paul > > Thanks, > > Mathieu > >> >> Thanks, >> Paul >> >> >> -- >> Paul Woegerer | SW Development Engineer >> http://go.mentor.com/sourceryanalyzer >> >> Mentor Embedded(tm) | Prinz Eugen Stra?e 72/2/4, Vienna, 1040 Austria >> Nucleus? | Linux? | Android(tm) | Services | UI | Multi-OS >> >> Android is a trademark of Google Inc. Use of this trademark is subject >> to Google Permissions. >> Linux is the registered trademark of Linus Torvalds in the U.S. and >> other countries. > -- Paul Woegerer | SW Development Engineer http://go.mentor.com/sourceryanalyzer Mentor Embedded(tm) | Prinz Eugen Stra?e 72/2/4, Vienna, 1040 Austria Nucleus? | Linux? | Android(tm) | Services | UI | Multi-OS Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. From mathieu.desnoyers at efficios.com Mon May 6 08:56:59 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 08:56:59 -0400 Subject: [lttng-dev] Add architecture specific tracepoints In-Reply-To: <1358526136.50f976b837ad0@www.imp.polymtl.ca> References: <1358526136.50f976b837ad0@www.imp.polymtl.ca> Message-ID: <20130506125659.GE12699@Krystal> * Mohamad Gebai (mohamad.gebai at polymtl.ca) wrote: > Hi, > I would like to add some of kvm's tracepoints to lttng as only few of them are > already included. The problem is that those tracepoints are architecture > specific (in the kernel source: arch/x86/kvm/trace.h). The readme file in > lttng-modules/instrumentation/events/lttng-module doesn't explain the procedure > to do this for arch specific folders. Should I add an arch folder in > lttng-modules/instrumentation/events/mainline and /lttng-module? I'd go for: lttng-modules/instrumentation/events/mainline/arch/${ARCH} lttng-modules/instrumentation/events/lttng-module/arch/${ARCH} Sorry for the late reply, Thanks, Mathieu > > Thanks. > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Mon May 6 09:09:51 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 09:09:51 -0400 Subject: [lttng-dev] [PATCH lttng-modules v2] Add system calls definitions for the tilegx architecture In-Reply-To: <1360178075-17364-1-git-send-email-simon.marchi@polymtl.ca> References: <1360178075-17364-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: <20130506130951.GF12699@Krystal> Hi Simon, Sorry for the late reply, * Simon Marchi (simon.marchi at polymtl.ca) wrote: > The definitions were extracted using the lttng-syscalls-extractor > module. The overrides were added for the system calls that appeared as > sys_unknown in the trace (they don't appear in the generated list). > > New in v2: > * Fixed override defines (I understood there is one for the event > definition and one for the table entry). > * Added ifdefs for __tilegx__. Comments below, > > Signed-off-by: Simon Marchi > --- > .../syscalls/headers/syscalls_integers.h | 6 + > .../syscalls/headers/syscalls_pointers.h | 6 + > ...-syscalls-2.6.40.38-MDE-4.1.2.149467_integers.h | 971 ++++++++++ > ...-2.6.40.38-MDE-4.1.2.149467_integers_override.h | 52 + > ...-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers.h | 1872 ++++++++++++++++++++ > ...-2.6.40.38-MDE-4.1.2.149467_pointers_override.h | 14 + > 6 files changed, 2921 insertions(+), 0 deletions(-) > create mode 100644 instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers.h > create mode 100644 instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers_override.h > create mode 100644 instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers.h > create mode 100644 instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers_override.h > > diff --git a/instrumentation/syscalls/headers/syscalls_integers.h b/instrumentation/syscalls/headers/syscalls_integers.h > index 002130a..c14da57 100644 > --- a/instrumentation/syscalls/headers/syscalls_integers.h > +++ b/instrumentation/syscalls/headers/syscalls_integers.h > @@ -9,3 +9,9 @@ > #ifdef CONFIG_ARM > #include "arm-32-syscalls-2.6.38_integers.h" > #endif > + > +#ifdef CONFIG_TILE > +#ifdef __tilegx__ #if defined(CONFIG_TILE) && defined(__tilegx__) (for each) Please resubmit this patch after 2.2.0 final is out, else I may forget about this patch (and I cannot merge new features into master at this point of the release cycle). Thanks, Mathieu > +#include "tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers.h" > +#endif > +#endif > diff --git a/instrumentation/syscalls/headers/syscalls_pointers.h b/instrumentation/syscalls/headers/syscalls_pointers.h > index 11b4979..a93bd0d 100644 > --- a/instrumentation/syscalls/headers/syscalls_pointers.h > +++ b/instrumentation/syscalls/headers/syscalls_pointers.h > @@ -9,3 +9,9 @@ > #ifdef CONFIG_ARM > #include "arm-32-syscalls-2.6.38_pointers.h" > #endif > + > +#ifdef CONFIG_TILE > +#ifdef __tilegx__ > +#include "tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers.h" > +#endif > +#endif > diff --git a/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers.h b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers.h > new file mode 100644 > index 0000000..8703471 > --- /dev/null > +++ b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers.h > @@ -0,0 +1,971 @@ > +/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */ > +#ifndef CREATE_SYSCALL_TABLE > + > +#if !defined(_TRACE_SYSCALLS_INTEGERS_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_SYSCALLS_INTEGERS_H > + > +#include > +#include > +#include "tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers_override.h" > +#include "syscalls_integers_override.h" > + > +SC_DECLARE_EVENT_CLASS_NOARGS(syscalls_noargs, > + TP_STRUCT__entry(), > + TP_fast_assign(), > + TP_printk() > +) > +#ifndef OVERRIDE_64_sys_vhangup > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_vhangup) > +#endif > +#ifndef OVERRIDE_64_sys_sync > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sync) > +#endif > +#ifndef OVERRIDE_64_sys_sched_yield > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sched_yield) > +#endif > +#ifndef OVERRIDE_64_sys_restart_syscall > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_restart_syscall) > +#endif > +#ifndef OVERRIDE_64_sys_setsid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_setsid) > +#endif > +#ifndef OVERRIDE_64_sys_getpid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getpid) > +#endif > +#ifndef OVERRIDE_64_sys_getppid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getppid) > +#endif > +#ifndef OVERRIDE_64_sys_getuid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getuid) > +#endif > +#ifndef OVERRIDE_64_sys_geteuid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_geteuid) > +#endif > +#ifndef OVERRIDE_64_sys_getgid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getgid) > +#endif > +#ifndef OVERRIDE_64_sys_getegid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getegid) > +#endif > +#ifndef OVERRIDE_64_sys_gettid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_gettid) > +#endif > +#ifndef OVERRIDE_64_sys_munlockall > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_munlockall) > +#endif > +#ifndef OVERRIDE_64_sys_io_destroy > +SC_TRACE_EVENT(sys_io_destroy, > + TP_PROTO(aio_context_t ctx), > + TP_ARGS(ctx), > + TP_STRUCT__entry(__field(aio_context_t, ctx)), > + TP_fast_assign(tp_assign(ctx, ctx)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_epoll_create1 > +SC_TRACE_EVENT(sys_epoll_create1, > + TP_PROTO(int flags), > + TP_ARGS(flags), > + TP_STRUCT__entry(__field(int, flags)), > + TP_fast_assign(tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_dup > +SC_TRACE_EVENT(sys_dup, > + TP_PROTO(unsigned int fildes), > + TP_ARGS(fildes), > + TP_STRUCT__entry(__field(unsigned int, fildes)), > + TP_fast_assign(tp_assign(fildes, fildes)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_inotify_init1 > +SC_TRACE_EVENT(sys_inotify_init1, > + TP_PROTO(int flags), > + TP_ARGS(flags), > + TP_STRUCT__entry(__field(int, flags)), > + TP_fast_assign(tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_fchdir > +SC_TRACE_EVENT(sys_fchdir, > + TP_PROTO(unsigned int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(unsigned int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_close > +SC_TRACE_EVENT(sys_close, > + TP_PROTO(unsigned int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(unsigned int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_fsync > +SC_TRACE_EVENT(sys_fsync, > + TP_PROTO(unsigned int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(unsigned int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_fdatasync > +SC_TRACE_EVENT(sys_fdatasync, > + TP_PROTO(unsigned int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(unsigned int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_personality > +SC_TRACE_EVENT(sys_personality, > + TP_PROTO(unsigned int personality), > + TP_ARGS(personality), > + TP_STRUCT__entry(__field(unsigned int, personality)), > + TP_fast_assign(tp_assign(personality, personality)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_exit > +SC_TRACE_EVENT(sys_exit, > + TP_PROTO(int error_code), > + TP_ARGS(error_code), > + TP_STRUCT__entry(__field(int, error_code)), > + TP_fast_assign(tp_assign(error_code, error_code)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_exit_group > +SC_TRACE_EVENT(sys_exit_group, > + TP_PROTO(int error_code), > + TP_ARGS(error_code), > + TP_STRUCT__entry(__field(int, error_code)), > + TP_fast_assign(tp_assign(error_code, error_code)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_unshare > +SC_TRACE_EVENT(sys_unshare, > + TP_PROTO(unsigned long unshare_flags), > + TP_ARGS(unshare_flags), > + TP_STRUCT__entry(__field(unsigned long, unshare_flags)), > + TP_fast_assign(tp_assign(unshare_flags, unshare_flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_timer_getoverrun > +SC_TRACE_EVENT(sys_timer_getoverrun, > + TP_PROTO(timer_t timer_id), > + TP_ARGS(timer_id), > + TP_STRUCT__entry(__field(timer_t, timer_id)), > + TP_fast_assign(tp_assign(timer_id, timer_id)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_timer_delete > +SC_TRACE_EVENT(sys_timer_delete, > + TP_PROTO(timer_t timer_id), > + TP_ARGS(timer_id), > + TP_STRUCT__entry(__field(timer_t, timer_id)), > + TP_fast_assign(tp_assign(timer_id, timer_id)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sched_getscheduler > +SC_TRACE_EVENT(sys_sched_getscheduler, > + TP_PROTO(pid_t pid), > + TP_ARGS(pid), > + TP_STRUCT__entry(__field(pid_t, pid)), > + TP_fast_assign(tp_assign(pid, pid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sched_get_priority_max > +SC_TRACE_EVENT(sys_sched_get_priority_max, > + TP_PROTO(int policy), > + TP_ARGS(policy), > + TP_STRUCT__entry(__field(int, policy)), > + TP_fast_assign(tp_assign(policy, policy)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sched_get_priority_min > +SC_TRACE_EVENT(sys_sched_get_priority_min, > + TP_PROTO(int policy), > + TP_ARGS(policy), > + TP_STRUCT__entry(__field(int, policy)), > + TP_fast_assign(tp_assign(policy, policy)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setgid > +SC_TRACE_EVENT(sys_setgid, > + TP_PROTO(gid_t gid), > + TP_ARGS(gid), > + TP_STRUCT__entry(__field(gid_t, gid)), > + TP_fast_assign(tp_assign(gid, gid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setuid > +SC_TRACE_EVENT(sys_setuid, > + TP_PROTO(uid_t uid), > + TP_ARGS(uid), > + TP_STRUCT__entry(__field(uid_t, uid)), > + TP_fast_assign(tp_assign(uid, uid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setfsuid > +SC_TRACE_EVENT(sys_setfsuid, > + TP_PROTO(uid_t uid), > + TP_ARGS(uid), > + TP_STRUCT__entry(__field(uid_t, uid)), > + TP_fast_assign(tp_assign(uid, uid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setfsgid > +SC_TRACE_EVENT(sys_setfsgid, > + TP_PROTO(gid_t gid), > + TP_ARGS(gid), > + TP_STRUCT__entry(__field(gid_t, gid)), > + TP_fast_assign(tp_assign(gid, gid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getpgid > +SC_TRACE_EVENT(sys_getpgid, > + TP_PROTO(pid_t pid), > + TP_ARGS(pid), > + TP_STRUCT__entry(__field(pid_t, pid)), > + TP_fast_assign(tp_assign(pid, pid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getsid > +SC_TRACE_EVENT(sys_getsid, > + TP_PROTO(pid_t pid), > + TP_ARGS(pid), > + TP_STRUCT__entry(__field(pid_t, pid)), > + TP_fast_assign(tp_assign(pid, pid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_umask > +SC_TRACE_EVENT(sys_umask, > + TP_PROTO(int mask), > + TP_ARGS(mask), > + TP_STRUCT__entry(__field(int, mask)), > + TP_fast_assign(tp_assign(mask, mask)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_brk > +SC_TRACE_EVENT(sys_brk, > + TP_PROTO(unsigned long brk), > + TP_ARGS(brk), > + TP_STRUCT__entry(__field(unsigned long, brk)), > + TP_fast_assign(tp_assign(brk, brk)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mlockall > +SC_TRACE_EVENT(sys_mlockall, > + TP_PROTO(int flags), > + TP_ARGS(flags), > + TP_STRUCT__entry(__field(int, flags)), > + TP_fast_assign(tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_set_dataplane > +SC_TRACE_EVENT(sys_set_dataplane, > + TP_PROTO(int flags), > + TP_ARGS(flags), > + TP_STRUCT__entry(__field(int, flags)), > + TP_fast_assign(tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_syncfs > +SC_TRACE_EVENT(sys_syncfs, > + TP_PROTO(int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_eventfd2 > +SC_TRACE_EVENT(sys_eventfd2, > + TP_PROTO(unsigned int count, int flags), > + TP_ARGS(count, flags), > + TP_STRUCT__entry(__field(unsigned int, count) __field(int, flags)), > + TP_fast_assign(tp_assign(count, count) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_inotify_rm_watch > +SC_TRACE_EVENT(sys_inotify_rm_watch, > + TP_PROTO(int fd, __s32 wd), > + TP_ARGS(fd, wd), > + TP_STRUCT__entry(__field(int, fd) __field(__s32, wd)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(wd, wd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_ioprio_get > +SC_TRACE_EVENT(sys_ioprio_get, > + TP_PROTO(int which, int who), > + TP_ARGS(which, who), > + TP_STRUCT__entry(__field(int, which) __field(int, who)), > + TP_fast_assign(tp_assign(which, which) tp_assign(who, who)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_flock > +SC_TRACE_EVENT(sys_flock, > + TP_PROTO(unsigned int fd, unsigned int cmd), > + TP_ARGS(fd, cmd), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_ftruncate > +SC_TRACE_EVENT(sys_ftruncate, > + TP_PROTO(unsigned int fd, unsigned long length), > + TP_ARGS(fd, length), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned long, length)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(length, length)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_fchmod > +SC_TRACE_EVENT(sys_fchmod, > + TP_PROTO(unsigned int fd, mode_t mode), > + TP_ARGS(fd, mode), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(mode_t, mode)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_timerfd_create > +SC_TRACE_EVENT(sys_timerfd_create, > + TP_PROTO(int clockid, int flags), > + TP_ARGS(clockid, flags), > + TP_STRUCT__entry(__field(int, clockid) __field(int, flags)), > + TP_fast_assign(tp_assign(clockid, clockid) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_kill > +SC_TRACE_EVENT(sys_kill, > + TP_PROTO(pid_t pid, int sig), > + TP_ARGS(pid, sig), > + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_tkill > +SC_TRACE_EVENT(sys_tkill, > + TP_PROTO(pid_t pid, int sig), > + TP_ARGS(pid, sig), > + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getpriority > +SC_TRACE_EVENT(sys_getpriority, > + TP_PROTO(int which, int who), > + TP_ARGS(which, who), > + TP_STRUCT__entry(__field(int, which) __field(int, who)), > + TP_fast_assign(tp_assign(which, which) tp_assign(who, who)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setregid > +SC_TRACE_EVENT(sys_setregid, > + TP_PROTO(gid_t rgid, gid_t egid), > + TP_ARGS(rgid, egid), > + TP_STRUCT__entry(__field(gid_t, rgid) __field(gid_t, egid)), > + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setreuid > +SC_TRACE_EVENT(sys_setreuid, > + TP_PROTO(uid_t ruid, uid_t euid), > + TP_ARGS(ruid, euid), > + TP_STRUCT__entry(__field(uid_t, ruid) __field(uid_t, euid)), > + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setpgid > +SC_TRACE_EVENT(sys_setpgid, > + TP_PROTO(pid_t pid, pid_t pgid), > + TP_ARGS(pid, pgid), > + TP_STRUCT__entry(__field(pid_t, pid) __field(pid_t, pgid)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(pgid, pgid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_msgget > +SC_TRACE_EVENT(sys_msgget, > + TP_PROTO(key_t key, int msgflg), > + TP_ARGS(key, msgflg), > + TP_STRUCT__entry(__field(key_t, key) __field(int, msgflg)), > + TP_fast_assign(tp_assign(key, key) tp_assign(msgflg, msgflg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_listen > +SC_TRACE_EVENT(sys_listen, > + TP_PROTO(int fd, int backlog), > + TP_ARGS(fd, backlog), > + TP_STRUCT__entry(__field(int, fd) __field(int, backlog)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(backlog, backlog)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_shutdown > +SC_TRACE_EVENT(sys_shutdown, > + TP_PROTO(int fd, int how), > + TP_ARGS(fd, how), > + TP_STRUCT__entry(__field(int, fd) __field(int, how)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(how, how)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_munmap > +SC_TRACE_EVENT(sys_munmap, > + TP_PROTO(unsigned long addr, size_t len), > + TP_ARGS(addr, len), > + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(size_t, len)), > + TP_fast_assign(tp_assign(addr, addr) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mlock > +SC_TRACE_EVENT(sys_mlock, > + TP_PROTO(unsigned long start, size_t len), > + TP_ARGS(start, len), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_munlock > +SC_TRACE_EVENT(sys_munlock, > + TP_PROTO(unsigned long start, size_t len), > + TP_ARGS(start, len), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setns > +SC_TRACE_EVENT(sys_setns, > + TP_PROTO(int fd, int nstype), > + TP_ARGS(fd, nstype), > + TP_STRUCT__entry(__field(int, fd) __field(int, nstype)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(nstype, nstype)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_dup3 > +SC_TRACE_EVENT(sys_dup3, > + TP_PROTO(unsigned int oldfd, unsigned int newfd, int flags), > + TP_ARGS(oldfd, newfd, flags), > + TP_STRUCT__entry(__field(unsigned int, oldfd) __field(unsigned int, newfd) __field(int, flags)), > + TP_fast_assign(tp_assign(oldfd, oldfd) tp_assign(newfd, newfd) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_fcntl > +SC_TRACE_EVENT(sys_fcntl, > + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), > + TP_ARGS(fd, cmd, arg), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_ioctl > +SC_TRACE_EVENT(sys_ioctl, > + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), > + TP_ARGS(fd, cmd, arg), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_ioprio_set > +SC_TRACE_EVENT(sys_ioprio_set, > + TP_PROTO(int which, int who, int ioprio), > + TP_ARGS(which, who, ioprio), > + TP_STRUCT__entry(__field(int, which) __field(int, who) __field(int, ioprio)), > + TP_fast_assign(tp_assign(which, which) tp_assign(who, who) tp_assign(ioprio, ioprio)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_fchown > +SC_TRACE_EVENT(sys_fchown, > + TP_PROTO(unsigned int fd, uid_t user, gid_t group), > + TP_ARGS(fd, user, group), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(uid_t, user) __field(gid_t, group)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(user, user) tp_assign(group, group)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_lseek > +SC_TRACE_EVENT(sys_lseek, > + TP_PROTO(unsigned int fd, off_t offset, unsigned int origin), > + TP_ARGS(fd, offset, origin), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(off_t, offset) __field(unsigned int, origin)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(offset, offset) tp_assign(origin, origin)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_tgkill > +SC_TRACE_EVENT(sys_tgkill, > + TP_PROTO(pid_t tgid, pid_t pid, int sig), > + TP_ARGS(tgid, pid, sig), > + TP_STRUCT__entry(__field(pid_t, tgid) __field(pid_t, pid) __field(int, sig)), > + TP_fast_assign(tp_assign(tgid, tgid) tp_assign(pid, pid) tp_assign(sig, sig)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setpriority > +SC_TRACE_EVENT(sys_setpriority, > + TP_PROTO(int which, int who, int niceval), > + TP_ARGS(which, who, niceval), > + TP_STRUCT__entry(__field(int, which) __field(int, who) __field(int, niceval)), > + TP_fast_assign(tp_assign(which, which) tp_assign(who, who) tp_assign(niceval, niceval)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setresuid > +SC_TRACE_EVENT(sys_setresuid, > + TP_PROTO(uid_t ruid, uid_t euid, uid_t suid), > + TP_ARGS(ruid, euid, suid), > + TP_STRUCT__entry(__field(uid_t, ruid) __field(uid_t, euid) __field(uid_t, suid)), > + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setresgid > +SC_TRACE_EVENT(sys_setresgid, > + TP_PROTO(gid_t rgid, gid_t egid, gid_t sgid), > + TP_ARGS(rgid, egid, sgid), > + TP_STRUCT__entry(__field(gid_t, rgid) __field(gid_t, egid) __field(gid_t, sgid)), > + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_semget > +SC_TRACE_EVENT(sys_semget, > + TP_PROTO(key_t key, int nsems, int semflg), > + TP_ARGS(key, nsems, semflg), > + TP_STRUCT__entry(__field(key_t, key) __field(int, nsems) __field(int, semflg)), > + TP_fast_assign(tp_assign(key, key) tp_assign(nsems, nsems) tp_assign(semflg, semflg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_shmget > +SC_TRACE_EVENT(sys_shmget, > + TP_PROTO(key_t key, size_t size, int shmflg), > + TP_ARGS(key, size, shmflg), > + TP_STRUCT__entry(__field(key_t, key) __field(size_t, size) __field(int, shmflg)), > + TP_fast_assign(tp_assign(key, key) tp_assign(size, size) tp_assign(shmflg, shmflg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_socket > +SC_TRACE_EVENT(sys_socket, > + TP_PROTO(int family, int type, int protocol), > + TP_ARGS(family, type, protocol), > + TP_STRUCT__entry(__field(int, family) __field(int, type) __field(int, protocol)), > + TP_fast_assign(tp_assign(family, family) tp_assign(type, type) tp_assign(protocol, protocol)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mprotect > +SC_TRACE_EVENT(sys_mprotect, > + TP_PROTO(unsigned long start, size_t len, unsigned long prot), > + TP_ARGS(start, len, prot), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field(unsigned long, prot)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(prot, prot)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_msync > +SC_TRACE_EVENT(sys_msync, > + TP_PROTO(unsigned long start, size_t len, int flags), > + TP_ARGS(start, len, flags), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field(int, flags)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_madvise > +SC_TRACE_EVENT(sys_madvise, > + TP_PROTO(unsigned long start, size_t len_in, int behavior), > + TP_ARGS(start, len_in, behavior), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len_in) __field(int, behavior)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len_in, len_in) tp_assign(behavior, behavior)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_cacheflush > +SC_TRACE_EVENT(sys_cacheflush, > + TP_PROTO(unsigned long addr, unsigned long len, unsigned long flags), > + TP_ARGS(addr, len, flags), > + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(unsigned long, len) __field(unsigned long, flags)), > + TP_fast_assign(tp_assign(addr, addr) tp_assign(len, len) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_tee > +SC_TRACE_EVENT(sys_tee, > + TP_PROTO(int fdin, int fdout, size_t len, unsigned int flags), > + TP_ARGS(fdin, fdout, len, flags), > + TP_STRUCT__entry(__field(int, fdin) __field(int, fdout) __field(size_t, len) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fdin, fdin) tp_assign(fdout, fdout) tp_assign(len, len) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_ptrace > +SC_TRACE_EVENT(sys_ptrace, > + TP_PROTO(long request, long pid, unsigned long addr, unsigned long data), > + TP_ARGS(request, pid, addr, data), > + TP_STRUCT__entry(__field(long, request) __field(long, pid) __field_hex(unsigned long, addr) __field(unsigned long, data)), > + TP_fast_assign(tp_assign(request, request) tp_assign(pid, pid) tp_assign(addr, addr) tp_assign(data, data)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_prctl > +SC_TRACE_EVENT(sys_prctl, > + TP_PROTO(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5), > + TP_ARGS(option, arg2, arg3, arg4, arg5), > + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg2) __field(unsigned long, arg3) __field(unsigned long, arg4) __field(unsigned long, arg5)), > + TP_fast_assign(tp_assign(option, option) tp_assign(arg2, arg2) tp_assign(arg3, arg3) tp_assign(arg4, arg4) tp_assign(arg5, arg5)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mremap > +SC_TRACE_EVENT(sys_mremap, > + TP_PROTO(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr), > + TP_ARGS(addr, old_len, new_len, flags, new_addr), > + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(unsigned long, old_len) __field(unsigned long, new_len) __field(unsigned long, flags) __field_hex(unsigned long, new_addr)), > + TP_fast_assign(tp_assign(addr, addr) tp_assign(old_len, old_len) tp_assign(new_len, new_len) tp_assign(flags, flags) tp_assign(new_addr, new_addr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_keyctl > +SC_TRACE_EVENT(sys_keyctl, > + TP_PROTO(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5), > + TP_ARGS(option, arg2, arg3, arg4, arg5), > + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg2) __field(unsigned long, arg3) __field(unsigned long, arg4) __field(unsigned long, arg5)), > + TP_fast_assign(tp_assign(option, option) tp_assign(arg2, arg2) tp_assign(arg3, arg3) tp_assign(arg4, arg4) tp_assign(arg5, arg5)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_remap_file_pages > +SC_TRACE_EVENT(sys_remap_file_pages, > + TP_PROTO(unsigned long start, unsigned long size, unsigned long prot, unsigned long pgoff, unsigned long flags), > + TP_ARGS(start, size, prot, pgoff, flags), > + TP_STRUCT__entry(__field(unsigned long, start) __field(unsigned long, size) __field(unsigned long, prot) __field(unsigned long, pgoff) __field(unsigned long, flags)), > + TP_fast_assign(tp_assign(start, start) tp_assign(size, size) tp_assign(prot, prot) tp_assign(pgoff, pgoff) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mmap > +SC_TRACE_EVENT(sys_mmap, > + TP_PROTO(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, off_t offset), > + TP_ARGS(addr, len, prot, flags, fd, offset), > + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(unsigned long, len) __field(unsigned long, prot) __field(unsigned long, flags) __field(unsigned long, fd) __field(off_t, offset)), > + TP_fast_assign(tp_assign(addr, addr) tp_assign(len, len) tp_assign(prot, prot) tp_assign(flags, flags) tp_assign(fd, fd) tp_assign(offset, offset)), > + TP_printk() > +) > +#endif > + > +#endif /* _TRACE_SYSCALLS_INTEGERS_H */ > + > +/* This part must be outside protection */ > +#include "../../../probes/define_trace.h" > + > +#else /* CREATE_SYSCALL_TABLE */ > + > +#include "tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers_override.h" > +#include "syscalls_integers_override.h" > + > +#ifndef OVERRIDE_TABLE_64_sys_vhangup > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_vhangup, 58, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sync > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sync, 81, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sched_yield > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sched_yield, 124, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_restart_syscall > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_restart_syscall, 128, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setsid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_setsid, 157, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getpid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getpid, 172, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getppid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getppid, 173, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getuid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getuid, 174, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_geteuid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_geteuid, 175, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getgid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getgid, 176, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getegid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getegid, 177, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_gettid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_gettid, 178, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_munlockall > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_munlockall, 231, 0) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_io_destroy > +TRACE_SYSCALL_TABLE(sys_io_destroy, sys_io_destroy, 1, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_eventfd2 > +TRACE_SYSCALL_TABLE(sys_eventfd2, sys_eventfd2, 19, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_epoll_create1 > +TRACE_SYSCALL_TABLE(sys_epoll_create1, sys_epoll_create1, 20, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_dup > +TRACE_SYSCALL_TABLE(sys_dup, sys_dup, 23, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_dup3 > +TRACE_SYSCALL_TABLE(sys_dup3, sys_dup3, 24, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_fcntl > +TRACE_SYSCALL_TABLE(sys_fcntl, sys_fcntl, 25, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_inotify_init1 > +TRACE_SYSCALL_TABLE(sys_inotify_init1, sys_inotify_init1, 26, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_inotify_rm_watch > +TRACE_SYSCALL_TABLE(sys_inotify_rm_watch, sys_inotify_rm_watch, 28, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_ioctl > +TRACE_SYSCALL_TABLE(sys_ioctl, sys_ioctl, 29, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_ioprio_set > +TRACE_SYSCALL_TABLE(sys_ioprio_set, sys_ioprio_set, 30, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_ioprio_get > +TRACE_SYSCALL_TABLE(sys_ioprio_get, sys_ioprio_get, 31, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_flock > +TRACE_SYSCALL_TABLE(sys_flock, sys_flock, 32, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_ftruncate > +TRACE_SYSCALL_TABLE(sys_ftruncate, sys_ftruncate, 46, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_fchdir > +TRACE_SYSCALL_TABLE(sys_fchdir, sys_fchdir, 50, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_fchmod > +TRACE_SYSCALL_TABLE(sys_fchmod, sys_fchmod, 52, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_fchown > +TRACE_SYSCALL_TABLE(sys_fchown, sys_fchown, 55, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_close > +TRACE_SYSCALL_TABLE(sys_close, sys_close, 57, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_lseek > +TRACE_SYSCALL_TABLE(sys_lseek, sys_lseek, 62, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_tee > +TRACE_SYSCALL_TABLE(sys_tee, sys_tee, 77, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_fsync > +TRACE_SYSCALL_TABLE(sys_fsync, sys_fsync, 82, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_fdatasync > +TRACE_SYSCALL_TABLE(sys_fdatasync, sys_fdatasync, 83, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_timerfd_create > +TRACE_SYSCALL_TABLE(sys_timerfd_create, sys_timerfd_create, 85, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_personality > +TRACE_SYSCALL_TABLE(sys_personality, sys_personality, 92, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_exit > +TRACE_SYSCALL_TABLE(sys_exit, sys_exit, 93, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_exit_group > +TRACE_SYSCALL_TABLE(sys_exit_group, sys_exit_group, 94, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_unshare > +TRACE_SYSCALL_TABLE(sys_unshare, sys_unshare, 97, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_timer_getoverrun > +TRACE_SYSCALL_TABLE(sys_timer_getoverrun, sys_timer_getoverrun, 109, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_timer_delete > +TRACE_SYSCALL_TABLE(sys_timer_delete, sys_timer_delete, 111, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_ptrace > +TRACE_SYSCALL_TABLE(sys_ptrace, sys_ptrace, 117, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sched_getscheduler > +TRACE_SYSCALL_TABLE(sys_sched_getscheduler, sys_sched_getscheduler, 120, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sched_get_priority_max > +TRACE_SYSCALL_TABLE(sys_sched_get_priority_max, sys_sched_get_priority_max, 125, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sched_get_priority_min > +TRACE_SYSCALL_TABLE(sys_sched_get_priority_min, sys_sched_get_priority_min, 126, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_kill > +TRACE_SYSCALL_TABLE(sys_kill, sys_kill, 129, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_tkill > +TRACE_SYSCALL_TABLE(sys_tkill, sys_tkill, 130, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_tgkill > +TRACE_SYSCALL_TABLE(sys_tgkill, sys_tgkill, 131, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setpriority > +TRACE_SYSCALL_TABLE(sys_setpriority, sys_setpriority, 140, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getpriority > +TRACE_SYSCALL_TABLE(sys_getpriority, sys_getpriority, 141, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setregid > +TRACE_SYSCALL_TABLE(sys_setregid, sys_setregid, 143, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setgid > +TRACE_SYSCALL_TABLE(sys_setgid, sys_setgid, 144, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setreuid > +TRACE_SYSCALL_TABLE(sys_setreuid, sys_setreuid, 145, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setuid > +TRACE_SYSCALL_TABLE(sys_setuid, sys_setuid, 146, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setresuid > +TRACE_SYSCALL_TABLE(sys_setresuid, sys_setresuid, 147, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setresgid > +TRACE_SYSCALL_TABLE(sys_setresgid, sys_setresgid, 149, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setfsuid > +TRACE_SYSCALL_TABLE(sys_setfsuid, sys_setfsuid, 151, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setfsgid > +TRACE_SYSCALL_TABLE(sys_setfsgid, sys_setfsgid, 152, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setpgid > +TRACE_SYSCALL_TABLE(sys_setpgid, sys_setpgid, 154, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getpgid > +TRACE_SYSCALL_TABLE(sys_getpgid, sys_getpgid, 155, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getsid > +TRACE_SYSCALL_TABLE(sys_getsid, sys_getsid, 156, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_umask > +TRACE_SYSCALL_TABLE(sys_umask, sys_umask, 166, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_prctl > +TRACE_SYSCALL_TABLE(sys_prctl, sys_prctl, 167, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_msgget > +TRACE_SYSCALL_TABLE(sys_msgget, sys_msgget, 186, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_semget > +TRACE_SYSCALL_TABLE(sys_semget, sys_semget, 190, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_shmget > +TRACE_SYSCALL_TABLE(sys_shmget, sys_shmget, 194, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_socket > +TRACE_SYSCALL_TABLE(sys_socket, sys_socket, 198, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_listen > +TRACE_SYSCALL_TABLE(sys_listen, sys_listen, 201, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_shutdown > +TRACE_SYSCALL_TABLE(sys_shutdown, sys_shutdown, 210, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_brk > +TRACE_SYSCALL_TABLE(sys_brk, sys_brk, 214, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_munmap > +TRACE_SYSCALL_TABLE(sys_munmap, sys_munmap, 215, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mremap > +TRACE_SYSCALL_TABLE(sys_mremap, sys_mremap, 216, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_keyctl > +TRACE_SYSCALL_TABLE(sys_keyctl, sys_keyctl, 219, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mmap > +TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 222, 6) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mprotect > +TRACE_SYSCALL_TABLE(sys_mprotect, sys_mprotect, 226, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_msync > +TRACE_SYSCALL_TABLE(sys_msync, sys_msync, 227, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mlock > +TRACE_SYSCALL_TABLE(sys_mlock, sys_mlock, 228, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_munlock > +TRACE_SYSCALL_TABLE(sys_munlock, sys_munlock, 229, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mlockall > +TRACE_SYSCALL_TABLE(sys_mlockall, sys_mlockall, 230, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_madvise > +TRACE_SYSCALL_TABLE(sys_madvise, sys_madvise, 233, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_remap_file_pages > +TRACE_SYSCALL_TABLE(sys_remap_file_pages, sys_remap_file_pages, 234, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_cacheflush > +TRACE_SYSCALL_TABLE(sys_cacheflush, sys_cacheflush, 245, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_set_dataplane > +TRACE_SYSCALL_TABLE(sys_set_dataplane, sys_set_dataplane, 246, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_syncfs > +TRACE_SYSCALL_TABLE(sys_syncfs, sys_syncfs, 267, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setns > +TRACE_SYSCALL_TABLE(sys_setns, sys_setns, 268, 2) > +#endif > + > +#endif /* CREATE_SYSCALL_TABLE */ > diff --git a/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers_override.h b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers_override.h > new file mode 100644 > index 0000000..013be72 > --- /dev/null > +++ b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_integers_override.h > @@ -0,0 +1,52 @@ > +#ifndef CREATE_SYSCALL_TABLE > + > +#define OVERRIDE_64_sys_sync_file_range > +SC_TRACE_EVENT(sys_sync_file_range, > + TP_PROTO(int fd, loff_t offset, loff_t nbytes, unsigned int flags), > + TP_ARGS(fd, offset, nbytes, flags), > + TP_STRUCT__entry( > + __field(int, fd) > + __field(loff_t, offset) > + __field(loff_t, nbytes) > + __field_hex(unsigned int, flags)), > + TP_fast_assign( > + tp_assign(fd, fd) > + tp_assign(offset, offset) > + tp_assign(nbytes, nbytes) > + tp_assign(flags, flags)), > + TP_printk() > +) > + > +#define OVERRIDE_64_sys_fadvise64_64 > +SC_TRACE_EVENT(sys_fadvise64_64, > + TP_PROTO(int fd, loff_t offset, loff_t len, int advice), > + TP_ARGS(fd, offset, len, advice), > + TP_STRUCT__entry( > + __field(int, fd) > + __field(loff_t, offset) > + __field(loff_t, len) > + __field_hex(int, advice)), > + TP_fast_assign( > + tp_assign(fd, fd) > + tp_assign(offset, offset) > + tp_assign(len, len) > + tp_assign(advice, advice)), > + TP_printk() > +) > + > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_rt_sigreturn) > + > +#else /* CREATE_SYSCALL_TABLE */ > + > +#define OVERRIDE_TABLE_64_sys_sync_file_range > +TRACE_SYSCALL_TABLE(sys_sync_file_range, sys_sync_file_range, 84, 4) > + > +#define OVERRIDE_TABLE_64_sys_fadvise64_64 > +TRACE_SYSCALL_TABLE(sys_fadvise64_64, sys_fadvise64_64, 223, 4) > + > +#define OVERRIDE_TABLE_64_sys_rt_sigreturn > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_rt_sigreturn, 139, 0) > + > +#endif /* CREATE_SYSCALL_TABLE */ > + > + > diff --git a/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers.h b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers.h > new file mode 100644 > index 0000000..89d8b60 > --- /dev/null > +++ b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers.h > @@ -0,0 +1,1872 @@ > +/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */ > +#ifndef CREATE_SYSCALL_TABLE > + > +#if !defined(_TRACE_SYSCALLS_POINTERS_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_SYSCALLS_POINTERS_H > + > +#include > +#include > +#include "tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers_override.h" > +#include "syscalls_pointers_override.h" > + > +#ifndef OVERRIDE_64_sys_chdir > +SC_TRACE_EVENT(sys_chdir, > + TP_PROTO(const char * filename), > + TP_ARGS(filename), > + TP_STRUCT__entry(__string_from_user(filename, filename)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_chroot > +SC_TRACE_EVENT(sys_chroot, > + TP_PROTO(const char * filename), > + TP_ARGS(filename), > + TP_STRUCT__entry(__string_from_user(filename, filename)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_acct > +SC_TRACE_EVENT(sys_acct, > + TP_PROTO(const char * name), > + TP_ARGS(name), > + TP_STRUCT__entry(__string_from_user(name, name)), > + TP_fast_assign(tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_set_tid_address > +SC_TRACE_EVENT(sys_set_tid_address, > + TP_PROTO(int * tidptr), > + TP_ARGS(tidptr), > + TP_STRUCT__entry(__field_hex(int *, tidptr)), > + TP_fast_assign(tp_assign(tidptr, tidptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_times > +SC_TRACE_EVENT(sys_times, > + TP_PROTO(struct tms * tbuf), > + TP_ARGS(tbuf), > + TP_STRUCT__entry(__field_hex(struct tms *, tbuf)), > + TP_fast_assign(tp_assign(tbuf, tbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_newuname > +SC_TRACE_EVENT(sys_newuname, > + TP_PROTO(struct new_utsname * name), > + TP_ARGS(name), > + TP_STRUCT__entry(__field_hex(struct new_utsname *, name)), > + TP_fast_assign(tp_assign(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_adjtimex > +SC_TRACE_EVENT(sys_adjtimex, > + TP_PROTO(struct timex * txc_p), > + TP_ARGS(txc_p), > + TP_STRUCT__entry(__field_hex(struct timex *, txc_p)), > + TP_fast_assign(tp_assign(txc_p, txc_p)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sysinfo > +SC_TRACE_EVENT(sys_sysinfo, > + TP_PROTO(struct sysinfo * info), > + TP_ARGS(info), > + TP_STRUCT__entry(__field_hex(struct sysinfo *, info)), > + TP_fast_assign(tp_assign(info, info)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mq_unlink > +SC_TRACE_EVENT(sys_mq_unlink, > + TP_PROTO(const char * u_name), > + TP_ARGS(u_name), > + TP_STRUCT__entry(__string_from_user(u_name, u_name)), > + TP_fast_assign(tp_copy_string_from_user(u_name, u_name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_shmdt > +SC_TRACE_EVENT(sys_shmdt, > + TP_PROTO(char * shmaddr), > + TP_ARGS(shmaddr), > + TP_STRUCT__entry(__field_hex(char *, shmaddr)), > + TP_fast_assign(tp_assign(shmaddr, shmaddr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_swapoff > +SC_TRACE_EVENT(sys_swapoff, > + TP_PROTO(const char * specialfile), > + TP_ARGS(specialfile), > + TP_STRUCT__entry(__string_from_user(specialfile, specialfile)), > + TP_fast_assign(tp_copy_string_from_user(specialfile, specialfile)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_io_setup > +SC_TRACE_EVENT(sys_io_setup, > + TP_PROTO(unsigned nr_events, aio_context_t * ctxp), > + TP_ARGS(nr_events, ctxp), > + TP_STRUCT__entry(__field(unsigned, nr_events) __field_hex(aio_context_t *, ctxp)), > + TP_fast_assign(tp_assign(nr_events, nr_events) tp_assign(ctxp, ctxp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_removexattr > +SC_TRACE_EVENT(sys_removexattr, > + TP_PROTO(const char * pathname, const char * name), > + TP_ARGS(pathname, name), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_lremovexattr > +SC_TRACE_EVENT(sys_lremovexattr, > + TP_PROTO(const char * pathname, const char * name), > + TP_ARGS(pathname, name), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_fremovexattr > +SC_TRACE_EVENT(sys_fremovexattr, > + TP_PROTO(int fd, const char * name), > + TP_ARGS(fd, name), > + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name)), > + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getcwd > +SC_TRACE_EVENT(sys_getcwd, > + TP_PROTO(char * buf, unsigned long size), > + TP_ARGS(buf, size), > + TP_STRUCT__entry(__field_hex(char *, buf) __field(unsigned long, size)), > + TP_fast_assign(tp_assign(buf, buf) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_umount > +SC_TRACE_EVENT(sys_umount, > + TP_PROTO(char * name, int flags), > + TP_ARGS(name, flags), > + TP_STRUCT__entry(__string_from_user(name, name) __field(int, flags)), > + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_pivot_root > +SC_TRACE_EVENT(sys_pivot_root, > + TP_PROTO(const char * new_root, const char * put_old), > + TP_ARGS(new_root, put_old), > + TP_STRUCT__entry(__string_from_user(new_root, new_root) __string_from_user(put_old, put_old)), > + TP_fast_assign(tp_copy_string_from_user(new_root, new_root) tp_copy_string_from_user(put_old, put_old)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_statfs > +SC_TRACE_EVENT(sys_statfs, > + TP_PROTO(const char * pathname, struct statfs * buf), > + TP_ARGS(pathname, buf), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(struct statfs *, buf)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_fstatfs > +SC_TRACE_EVENT(sys_fstatfs, > + TP_PROTO(unsigned int fd, struct statfs * buf), > + TP_ARGS(fd, buf), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct statfs *, buf)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_truncate > +SC_TRACE_EVENT(sys_truncate, > + TP_PROTO(const char * path, long length), > + TP_ARGS(path, length), > + TP_STRUCT__entry(__string_from_user(path, path) __field(long, length)), > + TP_fast_assign(tp_copy_string_from_user(path, path) tp_assign(length, length)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_pipe2 > +SC_TRACE_EVENT(sys_pipe2, > + TP_PROTO(int * fildes, int flags), > + TP_ARGS(fildes, flags), > + TP_STRUCT__entry(__field_hex(int *, fildes) __field(int, flags)), > + TP_fast_assign(tp_assign(fildes, fildes) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_newfstat > +SC_TRACE_EVENT(sys_newfstat, > + TP_PROTO(unsigned int fd, struct stat * statbuf), > + TP_ARGS(fd, statbuf), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct stat *, statbuf)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_timerfd_gettime > +SC_TRACE_EVENT(sys_timerfd_gettime, > + TP_PROTO(int ufd, struct itimerspec * otmr), > + TP_ARGS(ufd, otmr), > + TP_STRUCT__entry(__field(int, ufd) __field_hex(struct itimerspec *, otmr)), > + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(otmr, otmr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_set_robust_list > +SC_TRACE_EVENT(sys_set_robust_list, > + TP_PROTO(struct robust_list_head * head, size_t len), > + TP_ARGS(head, len), > + TP_STRUCT__entry(__field_hex(struct robust_list_head *, head) __field(size_t, len)), > + TP_fast_assign(tp_assign(head, head) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_nanosleep > +SC_TRACE_EVENT(sys_nanosleep, > + TP_PROTO(struct timespec * rqtp, struct timespec * rmtp), > + TP_ARGS(rqtp, rmtp), > + TP_STRUCT__entry(__field_hex(struct timespec *, rqtp) __field_hex(struct timespec *, rmtp)), > + TP_fast_assign(tp_assign(rqtp, rqtp) tp_assign(rmtp, rmtp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getitimer > +SC_TRACE_EVENT(sys_getitimer, > + TP_PROTO(int which, struct itimerval * value), > + TP_ARGS(which, value), > + TP_STRUCT__entry(__field(int, which) __field_hex(struct itimerval *, value)), > + TP_fast_assign(tp_assign(which, which) tp_assign(value, value)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_delete_module > +SC_TRACE_EVENT(sys_delete_module, > + TP_PROTO(const char * name_user, unsigned int flags), > + TP_ARGS(name_user, flags), > + TP_STRUCT__entry(__string_from_user(name_user, name_user) __field(unsigned int, flags)), > + TP_fast_assign(tp_copy_string_from_user(name_user, name_user) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_timer_gettime > +SC_TRACE_EVENT(sys_timer_gettime, > + TP_PROTO(timer_t timer_id, struct itimerspec * setting), > + TP_ARGS(timer_id, setting), > + TP_STRUCT__entry(__field(timer_t, timer_id) __field_hex(struct itimerspec *, setting)), > + TP_fast_assign(tp_assign(timer_id, timer_id) tp_assign(setting, setting)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_clock_settime > +SC_TRACE_EVENT(sys_clock_settime, > + TP_PROTO(const clockid_t which_clock, const struct timespec * tp), > + TP_ARGS(which_clock, tp), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(const struct timespec *, tp)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_clock_gettime > +SC_TRACE_EVENT(sys_clock_gettime, > + TP_PROTO(const clockid_t which_clock, struct timespec * tp), > + TP_ARGS(which_clock, tp), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timespec *, tp)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_clock_getres > +SC_TRACE_EVENT(sys_clock_getres, > + TP_PROTO(const clockid_t which_clock, struct timespec * tp), > + TP_ARGS(which_clock, tp), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timespec *, tp)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sched_setparam > +SC_TRACE_EVENT(sys_sched_setparam, > + TP_PROTO(pid_t pid, struct sched_param * param), > + TP_ARGS(pid, param), > + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct sched_param *, param)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(param, param)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sched_getparam > +SC_TRACE_EVENT(sys_sched_getparam, > + TP_PROTO(pid_t pid, struct sched_param * param), > + TP_ARGS(pid, param), > + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct sched_param *, param)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(param, param)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sched_rr_get_interval > +SC_TRACE_EVENT(sys_sched_rr_get_interval, > + TP_PROTO(pid_t pid, struct timespec * interval), > + TP_ARGS(pid, interval), > + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct timespec *, interval)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(interval, interval)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_rt_sigsuspend > +SC_TRACE_EVENT(sys_rt_sigsuspend, > + TP_PROTO(sigset_t * unewset, size_t sigsetsize), > + TP_ARGS(unewset, sigsetsize), > + TP_STRUCT__entry(__field_hex(sigset_t *, unewset) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(unewset, unewset) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_rt_sigpending > +SC_TRACE_EVENT(sys_rt_sigpending, > + TP_PROTO(sigset_t * set, size_t sigsetsize), > + TP_ARGS(set, sigsetsize), > + TP_STRUCT__entry(__field_hex(sigset_t *, set) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(set, set) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getgroups > +SC_TRACE_EVENT(sys_getgroups, > + TP_PROTO(int gidsetsize, gid_t * grouplist), > + TP_ARGS(gidsetsize, grouplist), > + TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(gid_t *, grouplist)), > + TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setgroups > +SC_TRACE_EVENT(sys_setgroups, > + TP_PROTO(int gidsetsize, gid_t * grouplist), > + TP_ARGS(gidsetsize, grouplist), > + TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(gid_t *, grouplist)), > + TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sethostname > +SC_TRACE_EVENT(sys_sethostname, > + TP_PROTO(char * name, int len), > + TP_ARGS(name, len), > + TP_STRUCT__entry(__string_from_user(name, name) __field(int, len)), > + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setdomainname > +SC_TRACE_EVENT(sys_setdomainname, > + TP_PROTO(char * name, int len), > + TP_ARGS(name, len), > + TP_STRUCT__entry(__string_from_user(name, name) __field(int, len)), > + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getrlimit > +SC_TRACE_EVENT(sys_getrlimit, > + TP_PROTO(unsigned int resource, struct rlimit * rlim), > + TP_ARGS(resource, rlim), > + TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), > + TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setrlimit > +SC_TRACE_EVENT(sys_setrlimit, > + TP_PROTO(unsigned int resource, struct rlimit * rlim), > + TP_ARGS(resource, rlim), > + TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), > + TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getrusage > +SC_TRACE_EVENT(sys_getrusage, > + TP_PROTO(int who, struct rusage * ru), > + TP_ARGS(who, ru), > + TP_STRUCT__entry(__field(int, who) __field_hex(struct rusage *, ru)), > + TP_fast_assign(tp_assign(who, who) tp_assign(ru, ru)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_gettimeofday > +SC_TRACE_EVENT(sys_gettimeofday, > + TP_PROTO(struct timeval * tv, struct timezone * tz), > + TP_ARGS(tv, tz), > + TP_STRUCT__entry(__field_hex(struct timeval *, tv) __field_hex(struct timezone *, tz)), > + TP_fast_assign(tp_assign(tv, tv) tp_assign(tz, tz)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_settimeofday > +SC_TRACE_EVENT(sys_settimeofday, > + TP_PROTO(struct timeval * tv, struct timezone * tz), > + TP_ARGS(tv, tz), > + TP_STRUCT__entry(__field_hex(struct timeval *, tv) __field_hex(struct timezone *, tz)), > + TP_fast_assign(tp_assign(tv, tv) tp_assign(tz, tz)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mq_notify > +SC_TRACE_EVENT(sys_mq_notify, > + TP_PROTO(mqd_t mqdes, const struct sigevent * u_notification), > + TP_ARGS(mqdes, u_notification), > + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const struct sigevent *, u_notification)), > + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_notification, u_notification)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_swapon > +SC_TRACE_EVENT(sys_swapon, > + TP_PROTO(const char * specialfile, int swap_flags), > + TP_ARGS(specialfile, swap_flags), > + TP_STRUCT__entry(__string_from_user(specialfile, specialfile) __field(int, swap_flags)), > + TP_fast_assign(tp_copy_string_from_user(specialfile, specialfile) tp_assign(swap_flags, swap_flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_clock_adjtime > +SC_TRACE_EVENT(sys_clock_adjtime, > + TP_PROTO(const clockid_t which_clock, struct timex * utx), > + TP_ARGS(which_clock, utx), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timex *, utx)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(utx, utx)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_io_submit > +SC_TRACE_EVENT(sys_io_submit, > + TP_PROTO(aio_context_t ctx_id, long nr, struct iocb * * iocbpp), > + TP_ARGS(ctx_id, nr, iocbpp), > + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field(long, nr) __field_hex(struct iocb * *, iocbpp)), > + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(nr, nr) tp_assign(iocbpp, iocbpp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_io_cancel > +SC_TRACE_EVENT(sys_io_cancel, > + TP_PROTO(aio_context_t ctx_id, struct iocb * iocb, struct io_event * result), > + TP_ARGS(ctx_id, iocb, result), > + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field_hex(struct iocb *, iocb) __field_hex(struct io_event *, result)), > + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(iocb, iocb) tp_assign(result, result)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_listxattr > +SC_TRACE_EVENT(sys_listxattr, > + TP_PROTO(const char * pathname, char * list, size_t size), > + TP_ARGS(pathname, list, size), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(char *, list) __field(size_t, size)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(list, list) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_llistxattr > +SC_TRACE_EVENT(sys_llistxattr, > + TP_PROTO(const char * pathname, char * list, size_t size), > + TP_ARGS(pathname, list, size), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(char *, list) __field(size_t, size)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(list, list) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_flistxattr > +SC_TRACE_EVENT(sys_flistxattr, > + TP_PROTO(int fd, char * list, size_t size), > + TP_ARGS(fd, list, size), > + TP_STRUCT__entry(__field(int, fd) __field_hex(char *, list) __field(size_t, size)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(list, list) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_inotify_add_watch > +SC_TRACE_EVENT(sys_inotify_add_watch, > + TP_PROTO(int fd, const char * pathname, u32 mask), > + TP_ARGS(fd, pathname, mask), > + TP_STRUCT__entry(__field(int, fd) __string_from_user(pathname, pathname) __field(u32, mask)), > + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(pathname, pathname) tp_assign(mask, mask)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mkdirat > +SC_TRACE_EVENT(sys_mkdirat, > + TP_PROTO(int dfd, const char * pathname, int mode), > + TP_ARGS(dfd, pathname, mode), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field(int, mode)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_unlinkat > +SC_TRACE_EVENT(sys_unlinkat, > + TP_PROTO(int dfd, const char * pathname, int flag), > + TP_ARGS(dfd, pathname, flag), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field(int, flag)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(flag, flag)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_symlinkat > +SC_TRACE_EVENT(sys_symlinkat, > + TP_PROTO(const char * oldname, int newdfd, const char * newname), > + TP_ARGS(oldname, newdfd, newname), > + TP_STRUCT__entry(__string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname)), > + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_nfsservctl > +SC_TRACE_EVENT(sys_nfsservctl, > + TP_PROTO(int cmd, struct nfsctl_arg * arg, void * res), > + TP_ARGS(cmd, arg, res), > + TP_STRUCT__entry(__field(int, cmd) __field_hex(struct nfsctl_arg *, arg) __field_hex(void *, res)), > + TP_fast_assign(tp_assign(cmd, cmd) tp_assign(arg, arg) tp_assign(res, res)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_faccessat > +SC_TRACE_EVENT(sys_faccessat, > + TP_PROTO(int dfd, const char * filename, int mode), > + TP_ARGS(dfd, filename, mode), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, mode)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_fchmodat > +SC_TRACE_EVENT(sys_fchmodat, > + TP_PROTO(int dfd, const char * filename, mode_t mode), > + TP_ARGS(dfd, filename, mode), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(mode_t, mode)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getdents64 > +SC_TRACE_EVENT(sys_getdents64, > + TP_PROTO(unsigned int fd, struct linux_dirent64 * dirent, unsigned int count), > + TP_ARGS(fd, dirent, count), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct linux_dirent64 *, dirent) __field(unsigned int, count)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(dirent, dirent) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_read > +SC_TRACE_EVENT(sys_read, > + TP_PROTO(unsigned int fd, char * buf, size_t count), > + TP_ARGS(fd, buf, count), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(char *, buf) __field(size_t, count)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_write > +SC_TRACE_EVENT(sys_write, > + TP_PROTO(unsigned int fd, const char * buf, size_t count), > + TP_ARGS(fd, buf, count), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_readv > +SC_TRACE_EVENT(sys_readv, > + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen), > + TP_ARGS(fd, vec, vlen), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_writev > +SC_TRACE_EVENT(sys_writev, > + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen), > + TP_ARGS(fd, vec, vlen), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_get_robust_list > +SC_TRACE_EVENT(sys_get_robust_list, > + TP_PROTO(int pid, struct robust_list_head * * head_ptr, size_t * len_ptr), > + TP_ARGS(pid, head_ptr, len_ptr), > + TP_STRUCT__entry(__field(int, pid) __field_hex(struct robust_list_head * *, head_ptr) __field_hex(size_t *, len_ptr)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(head_ptr, head_ptr) tp_assign(len_ptr, len_ptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setitimer > +SC_TRACE_EVENT(sys_setitimer, > + TP_PROTO(int which, struct itimerval * value, struct itimerval * ovalue), > + TP_ARGS(which, value, ovalue), > + TP_STRUCT__entry(__field(int, which) __field_hex(struct itimerval *, value) __field_hex(struct itimerval *, ovalue)), > + TP_fast_assign(tp_assign(which, which) tp_assign(value, value) tp_assign(ovalue, ovalue)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_init_module > +SC_TRACE_EVENT(sys_init_module, > + TP_PROTO(void * umod, unsigned long len, const char * uargs), > + TP_ARGS(umod, len, uargs), > + TP_STRUCT__entry(__field_hex(void *, umod) __field(unsigned long, len) __field_hex(const char *, uargs)), > + TP_fast_assign(tp_assign(umod, umod) tp_assign(len, len) tp_assign(uargs, uargs)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_timer_create > +SC_TRACE_EVENT(sys_timer_create, > + TP_PROTO(const clockid_t which_clock, struct sigevent * timer_event_spec, timer_t * created_timer_id), > + TP_ARGS(which_clock, timer_event_spec, created_timer_id), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct sigevent *, timer_event_spec) __field_hex(timer_t *, created_timer_id)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(timer_event_spec, timer_event_spec) tp_assign(created_timer_id, created_timer_id)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_syslog > +SC_TRACE_EVENT(sys_syslog, > + TP_PROTO(int type, char * buf, int len), > + TP_ARGS(type, buf, len), > + TP_STRUCT__entry(__field(int, type) __field_hex(char *, buf) __field(int, len)), > + TP_fast_assign(tp_assign(type, type) tp_assign(buf, buf) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sched_setscheduler > +SC_TRACE_EVENT(sys_sched_setscheduler, > + TP_PROTO(pid_t pid, int policy, struct sched_param * param), > + TP_ARGS(pid, policy, param), > + TP_STRUCT__entry(__field(pid_t, pid) __field(int, policy) __field_hex(struct sched_param *, param)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(policy, policy) tp_assign(param, param)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sched_setaffinity > +SC_TRACE_EVENT(sys_sched_setaffinity, > + TP_PROTO(pid_t pid, unsigned int len, unsigned long * user_mask_ptr), > + TP_ARGS(pid, len, user_mask_ptr), > + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, len) __field_hex(unsigned long *, user_mask_ptr)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(len, len) tp_assign(user_mask_ptr, user_mask_ptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sched_getaffinity > +SC_TRACE_EVENT(sys_sched_getaffinity, > + TP_PROTO(pid_t pid, unsigned int len, unsigned long * user_mask_ptr), > + TP_ARGS(pid, len, user_mask_ptr), > + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, len) __field_hex(unsigned long *, user_mask_ptr)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(len, len) tp_assign(user_mask_ptr, user_mask_ptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_rt_sigqueueinfo > +SC_TRACE_EVENT(sys_rt_sigqueueinfo, > + TP_PROTO(pid_t pid, int sig, siginfo_t * uinfo), > + TP_ARGS(pid, sig, uinfo), > + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig) __field_hex(siginfo_t *, uinfo)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig) tp_assign(uinfo, uinfo)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getresuid > +SC_TRACE_EVENT(sys_getresuid, > + TP_PROTO(uid_t * ruid, uid_t * euid, uid_t * suid), > + TP_ARGS(ruid, euid, suid), > + TP_STRUCT__entry(__field_hex(uid_t *, ruid) __field_hex(uid_t *, euid) __field_hex(uid_t *, suid)), > + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getresgid > +SC_TRACE_EVENT(sys_getresgid, > + TP_PROTO(gid_t * rgid, gid_t * egid, gid_t * sgid), > + TP_ARGS(rgid, egid, sgid), > + TP_STRUCT__entry(__field_hex(gid_t *, rgid) __field_hex(gid_t *, egid) __field_hex(gid_t *, sgid)), > + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getcpu > +SC_TRACE_EVENT(sys_getcpu, > + TP_PROTO(unsigned * cpup, unsigned * nodep, struct getcpu_cache * unused), > + TP_ARGS(cpup, nodep, unused), > + TP_STRUCT__entry(__field_hex(unsigned *, cpup) __field_hex(unsigned *, nodep) __field_hex(struct getcpu_cache *, unused)), > + TP_fast_assign(tp_assign(cpup, cpup) tp_assign(nodep, nodep) tp_assign(unused, unused)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mq_getsetattr > +SC_TRACE_EVENT(sys_mq_getsetattr, > + TP_PROTO(mqd_t mqdes, const struct mq_attr * u_mqstat, struct mq_attr * u_omqstat), > + TP_ARGS(mqdes, u_mqstat, u_omqstat), > + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const struct mq_attr *, u_mqstat) __field_hex(struct mq_attr *, u_omqstat)), > + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_mqstat, u_mqstat) tp_assign(u_omqstat, u_omqstat)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_msgctl > +SC_TRACE_EVENT(sys_msgctl, > + TP_PROTO(int msqid, int cmd, struct msqid_ds * buf), > + TP_ARGS(msqid, cmd, buf), > + TP_STRUCT__entry(__field(int, msqid) __field(int, cmd) __field_hex(struct msqid_ds *, buf)), > + TP_fast_assign(tp_assign(msqid, msqid) tp_assign(cmd, cmd) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_semop > +SC_TRACE_EVENT(sys_semop, > + TP_PROTO(int semid, struct sembuf * tsops, unsigned nsops), > + TP_ARGS(semid, tsops, nsops), > + TP_STRUCT__entry(__field(int, semid) __field_hex(struct sembuf *, tsops) __field(unsigned, nsops)), > + TP_fast_assign(tp_assign(semid, semid) tp_assign(tsops, tsops) tp_assign(nsops, nsops)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_shmctl > +SC_TRACE_EVENT(sys_shmctl, > + TP_PROTO(int shmid, int cmd, struct shmid_ds * buf), > + TP_ARGS(shmid, cmd, buf), > + TP_STRUCT__entry(__field(int, shmid) __field(int, cmd) __field_hex(struct shmid_ds *, buf)), > + TP_fast_assign(tp_assign(shmid, shmid) tp_assign(cmd, cmd) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_shmat > +SC_TRACE_EVENT(sys_shmat, > + TP_PROTO(int shmid, char * shmaddr, int shmflg), > + TP_ARGS(shmid, shmaddr, shmflg), > + TP_STRUCT__entry(__field(int, shmid) __field_hex(char *, shmaddr) __field(int, shmflg)), > + TP_fast_assign(tp_assign(shmid, shmid) tp_assign(shmaddr, shmaddr) tp_assign(shmflg, shmflg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_bind > +SC_TRACE_EVENT(sys_bind, > + TP_PROTO(int fd, struct sockaddr * umyaddr, int addrlen), > + TP_ARGS(fd, umyaddr, addrlen), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, umyaddr) __field_hex(int, addrlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(umyaddr, umyaddr) tp_assign(addrlen, addrlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_accept > +SC_TRACE_EVENT(sys_accept, > + TP_PROTO(int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen), > + TP_ARGS(fd, upeer_sockaddr, upeer_addrlen), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, upeer_sockaddr) __field_hex(int *, upeer_addrlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(upeer_sockaddr, upeer_sockaddr) tp_assign(upeer_addrlen, upeer_addrlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_connect > +SC_TRACE_EVENT(sys_connect, > + TP_PROTO(int fd, struct sockaddr * uservaddr, int addrlen), > + TP_ARGS(fd, uservaddr, addrlen), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, uservaddr) __field_hex(int, addrlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(uservaddr, uservaddr) tp_assign(addrlen, addrlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getsockname > +SC_TRACE_EVENT(sys_getsockname, > + TP_PROTO(int fd, struct sockaddr * usockaddr, int * usockaddr_len), > + TP_ARGS(fd, usockaddr, usockaddr_len), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, usockaddr) __field_hex(int *, usockaddr_len)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(usockaddr, usockaddr) tp_assign(usockaddr_len, usockaddr_len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getpeername > +SC_TRACE_EVENT(sys_getpeername, > + TP_PROTO(int fd, struct sockaddr * usockaddr, int * usockaddr_len), > + TP_ARGS(fd, usockaddr, usockaddr_len), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, usockaddr) __field_hex(int *, usockaddr_len)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(usockaddr, usockaddr) tp_assign(usockaddr_len, usockaddr_len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sendmsg > +SC_TRACE_EVENT(sys_sendmsg, > + TP_PROTO(int fd, struct msghdr * msg, unsigned flags), > + TP_ARGS(fd, msg, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct msghdr *, msg) __field(unsigned, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(msg, msg) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_recvmsg > +SC_TRACE_EVENT(sys_recvmsg, > + TP_PROTO(int fd, struct msghdr * msg, unsigned int flags), > + TP_ARGS(fd, msg, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct msghdr *, msg) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(msg, msg) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mincore > +SC_TRACE_EVENT(sys_mincore, > + TP_PROTO(unsigned long start, size_t len, unsigned char * vec), > + TP_ARGS(start, len, vec), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field_hex(unsigned char *, vec)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(vec, vec)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_set_mempolicy > +SC_TRACE_EVENT(sys_set_mempolicy, > + TP_PROTO(int mode, unsigned long * nmask, unsigned long maxnode), > + TP_ARGS(mode, nmask, maxnode), > + TP_STRUCT__entry(__field(int, mode) __field_hex(unsigned long *, nmask) __field(unsigned long, maxnode)), > + TP_fast_assign(tp_assign(mode, mode) tp_assign(nmask, nmask) tp_assign(maxnode, maxnode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_open_by_handle_at > +SC_TRACE_EVENT(sys_open_by_handle_at, > + TP_PROTO(int mountdirfd, struct file_handle * handle, int flags), > + TP_ARGS(mountdirfd, handle, flags), > + TP_STRUCT__entry(__field(int, mountdirfd) __field_hex(struct file_handle *, handle) __field(int, flags)), > + TP_fast_assign(tp_assign(mountdirfd, mountdirfd) tp_assign(handle, handle) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getxattr > +SC_TRACE_EVENT(sys_getxattr, > + TP_PROTO(const char * pathname, const char * name, void * value, size_t size), > + TP_ARGS(pathname, name, value, size), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_lgetxattr > +SC_TRACE_EVENT(sys_lgetxattr, > + TP_PROTO(const char * pathname, const char * name, void * value, size_t size), > + TP_ARGS(pathname, name, value, size), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_fgetxattr > +SC_TRACE_EVENT(sys_fgetxattr, > + TP_PROTO(int fd, const char * name, void * value, size_t size), > + TP_ARGS(fd, name, value, size), > + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), > + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_epoll_ctl > +SC_TRACE_EVENT(sys_epoll_ctl, > + TP_PROTO(int epfd, int op, int fd, struct epoll_event * event), > + TP_ARGS(epfd, op, fd, event), > + TP_STRUCT__entry(__field(int, epfd) __field(int, op) __field(int, fd) __field_hex(struct epoll_event *, event)), > + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(op, op) tp_assign(fd, fd) tp_assign(event, event)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mknodat > +SC_TRACE_EVENT(sys_mknodat, > + TP_PROTO(int dfd, const char * filename, int mode, unsigned dev), > + TP_ARGS(dfd, filename, mode, dev), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, mode) __field(unsigned, dev)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode) tp_assign(dev, dev)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_renameat > +SC_TRACE_EVENT(sys_renameat, > + TP_PROTO(int olddfd, const char * oldname, int newdfd, const char * newname), > + TP_ARGS(olddfd, oldname, newdfd, newname), > + TP_STRUCT__entry(__field(int, olddfd) __string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname)), > + TP_fast_assign(tp_assign(olddfd, olddfd) tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_openat > +SC_TRACE_EVENT(sys_openat, > + TP_PROTO(int dfd, const char * filename, int flags, int mode), > + TP_ARGS(dfd, filename, flags, mode), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, flags) __field(int, mode)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(flags, flags) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_quotactl > +SC_TRACE_EVENT(sys_quotactl, > + TP_PROTO(unsigned int cmd, const char * special, qid_t id, void * addr), > + TP_ARGS(cmd, special, id, addr), > + TP_STRUCT__entry(__field(unsigned int, cmd) __field_hex(const char *, special) __field(qid_t, id) __field_hex(void *, addr)), > + TP_fast_assign(tp_assign(cmd, cmd) tp_assign(special, special) tp_assign(id, id) tp_assign(addr, addr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sendfile64 > +SC_TRACE_EVENT(sys_sendfile64, > + TP_PROTO(int out_fd, int in_fd, loff_t * offset, size_t count), > + TP_ARGS(out_fd, in_fd, offset, count), > + TP_STRUCT__entry(__field(int, out_fd) __field(int, in_fd) __field_hex(loff_t *, offset) __field(size_t, count)), > + TP_fast_assign(tp_assign(out_fd, out_fd) tp_assign(in_fd, in_fd) tp_assign(offset, offset) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_signalfd4 > +SC_TRACE_EVENT(sys_signalfd4, > + TP_PROTO(int ufd, sigset_t * user_mask, size_t sizemask, int flags), > + TP_ARGS(ufd, user_mask, sizemask, flags), > + TP_STRUCT__entry(__field(int, ufd) __field_hex(sigset_t *, user_mask) __field(size_t, sizemask) __field(int, flags)), > + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(user_mask, user_mask) tp_assign(sizemask, sizemask) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_vmsplice > +SC_TRACE_EVENT(sys_vmsplice, > + TP_PROTO(int fd, const struct iovec * iov, unsigned long nr_segs, unsigned int flags), > + TP_ARGS(fd, iov, nr_segs, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(const struct iovec *, iov) __field(unsigned long, nr_segs) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(iov, iov) tp_assign(nr_segs, nr_segs) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_readlinkat > +SC_TRACE_EVENT(sys_readlinkat, > + TP_PROTO(int dfd, const char * pathname, char * buf, int bufsiz), > + TP_ARGS(dfd, pathname, buf, bufsiz), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field_hex(char *, buf) __field(int, bufsiz)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(buf, buf) tp_assign(bufsiz, bufsiz)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_newfstatat > +SC_TRACE_EVENT(sys_newfstatat, > + TP_PROTO(int dfd, const char * filename, struct stat * statbuf, int flag), > + TP_ARGS(dfd, filename, statbuf, flag), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct stat *, statbuf) __field(int, flag)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf) tp_assign(flag, flag)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_timerfd_settime > +SC_TRACE_EVENT(sys_timerfd_settime, > + TP_PROTO(int ufd, int flags, const struct itimerspec * utmr, struct itimerspec * otmr), > + TP_ARGS(ufd, flags, utmr, otmr), > + TP_STRUCT__entry(__field(int, ufd) __field(int, flags) __field_hex(const struct itimerspec *, utmr) __field_hex(struct itimerspec *, otmr)), > + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(flags, flags) tp_assign(utmr, utmr) tp_assign(otmr, otmr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_utimensat > +SC_TRACE_EVENT(sys_utimensat, > + TP_PROTO(int dfd, const char * filename, struct timespec * utimes, int flags), > + TP_ARGS(dfd, filename, utimes, flags), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct timespec *, utimes) __field(int, flags)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_timer_settime > +SC_TRACE_EVENT(sys_timer_settime, > + TP_PROTO(timer_t timer_id, int flags, const struct itimerspec * new_setting, struct itimerspec * old_setting), > + TP_ARGS(timer_id, flags, new_setting, old_setting), > + TP_STRUCT__entry(__field(timer_t, timer_id) __field(int, flags) __field_hex(const struct itimerspec *, new_setting) __field_hex(struct itimerspec *, old_setting)), > + TP_fast_assign(tp_assign(timer_id, timer_id) tp_assign(flags, flags) tp_assign(new_setting, new_setting) tp_assign(old_setting, old_setting)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_clock_nanosleep > +SC_TRACE_EVENT(sys_clock_nanosleep, > + TP_PROTO(const clockid_t which_clock, int flags, const struct timespec * rqtp, struct timespec * rmtp), > + TP_ARGS(which_clock, flags, rqtp, rmtp), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field(int, flags) __field_hex(const struct timespec *, rqtp) __field_hex(struct timespec *, rmtp)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(flags, flags) tp_assign(rqtp, rqtp) tp_assign(rmtp, rmtp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_rt_sigaction > +SC_TRACE_EVENT(sys_rt_sigaction, > + TP_PROTO(int sig, const struct sigaction * act, struct sigaction * oact, size_t sigsetsize), > + TP_ARGS(sig, act, oact, sigsetsize), > + TP_STRUCT__entry(__field(int, sig) __field_hex(const struct sigaction *, act) __field_hex(struct sigaction *, oact) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(sig, sig) tp_assign(act, act) tp_assign(oact, oact) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_rt_sigprocmask > +SC_TRACE_EVENT(sys_rt_sigprocmask, > + TP_PROTO(int how, sigset_t * nset, sigset_t * oset, size_t sigsetsize), > + TP_ARGS(how, nset, oset, sigsetsize), > + TP_STRUCT__entry(__field(int, how) __field_hex(sigset_t *, nset) __field_hex(sigset_t *, oset) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(how, how) tp_assign(nset, nset) tp_assign(oset, oset) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_rt_sigtimedwait > +SC_TRACE_EVENT(sys_rt_sigtimedwait, > + TP_PROTO(const sigset_t * uthese, siginfo_t * uinfo, const struct timespec * uts, size_t sigsetsize), > + TP_ARGS(uthese, uinfo, uts, sigsetsize), > + TP_STRUCT__entry(__field_hex(const sigset_t *, uthese) __field_hex(siginfo_t *, uinfo) __field_hex(const struct timespec *, uts) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(uthese, uthese) tp_assign(uinfo, uinfo) tp_assign(uts, uts) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_reboot > +SC_TRACE_EVENT(sys_reboot, > + TP_PROTO(int magic1, int magic2, unsigned int cmd, void * arg), > + TP_ARGS(magic1, magic2, cmd, arg), > + TP_STRUCT__entry(__field(int, magic1) __field(int, magic2) __field(unsigned int, cmd) __field_hex(void *, arg)), > + TP_fast_assign(tp_assign(magic1, magic1) tp_assign(magic2, magic2) tp_assign(cmd, cmd) tp_assign(arg, arg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mq_open > +SC_TRACE_EVENT(sys_mq_open, > + TP_PROTO(const char * u_name, int oflag, mode_t mode, struct mq_attr * u_attr), > + TP_ARGS(u_name, oflag, mode, u_attr), > + TP_STRUCT__entry(__string_from_user(u_name, u_name) __field(int, oflag) __field(mode_t, mode) __field_hex(struct mq_attr *, u_attr)), > + TP_fast_assign(tp_copy_string_from_user(u_name, u_name) tp_assign(oflag, oflag) tp_assign(mode, mode) tp_assign(u_attr, u_attr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_msgsnd > +SC_TRACE_EVENT(sys_msgsnd, > + TP_PROTO(int msqid, struct msgbuf * msgp, size_t msgsz, int msgflg), > + TP_ARGS(msqid, msgp, msgsz, msgflg), > + TP_STRUCT__entry(__field(int, msqid) __field_hex(struct msgbuf *, msgp) __field(size_t, msgsz) __field(int, msgflg)), > + TP_fast_assign(tp_assign(msqid, msqid) tp_assign(msgp, msgp) tp_assign(msgsz, msgsz) tp_assign(msgflg, msgflg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_semtimedop > +SC_TRACE_EVENT(sys_semtimedop, > + TP_PROTO(int semid, struct sembuf * tsops, unsigned nsops, const struct timespec * timeout), > + TP_ARGS(semid, tsops, nsops, timeout), > + TP_STRUCT__entry(__field(int, semid) __field_hex(struct sembuf *, tsops) __field(unsigned, nsops) __field_hex(const struct timespec *, timeout)), > + TP_fast_assign(tp_assign(semid, semid) tp_assign(tsops, tsops) tp_assign(nsops, nsops) tp_assign(timeout, timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_socketpair > +SC_TRACE_EVENT(sys_socketpair, > + TP_PROTO(int family, int type, int protocol, int * usockvec), > + TP_ARGS(family, type, protocol, usockvec), > + TP_STRUCT__entry(__field(int, family) __field(int, type) __field(int, protocol) __field_hex(int *, usockvec)), > + TP_fast_assign(tp_assign(family, family) tp_assign(type, type) tp_assign(protocol, protocol) tp_assign(usockvec, usockvec)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_request_key > +SC_TRACE_EVENT(sys_request_key, > + TP_PROTO(const char * _type, const char * _description, const char * _callout_info, key_serial_t destringid), > + TP_ARGS(_type, _description, _callout_info, destringid), > + TP_STRUCT__entry(__string_from_user(_type, _type) __field_hex(const char *, _description) __field_hex(const char *, _callout_info) __field(key_serial_t, destringid)), > + TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_callout_info, _callout_info) tp_assign(destringid, destringid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_migrate_pages > +SC_TRACE_EVENT(sys_migrate_pages, > + TP_PROTO(pid_t pid, unsigned long maxnode, const unsigned long * old_nodes, const unsigned long * new_nodes), > + TP_ARGS(pid, maxnode, old_nodes, new_nodes), > + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned long, maxnode) __field_hex(const unsigned long *, old_nodes) __field_hex(const unsigned long *, new_nodes)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(maxnode, maxnode) tp_assign(old_nodes, old_nodes) tp_assign(new_nodes, new_nodes)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_rt_tgsigqueueinfo > +SC_TRACE_EVENT(sys_rt_tgsigqueueinfo, > + TP_PROTO(pid_t tgid, pid_t pid, int sig, siginfo_t * uinfo), > + TP_ARGS(tgid, pid, sig, uinfo), > + TP_STRUCT__entry(__field(pid_t, tgid) __field(pid_t, pid) __field(int, sig) __field_hex(siginfo_t *, uinfo)), > + TP_fast_assign(tp_assign(tgid, tgid) tp_assign(pid, pid) tp_assign(sig, sig) tp_assign(uinfo, uinfo)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_accept4 > +SC_TRACE_EVENT(sys_accept4, > + TP_PROTO(int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen, int flags), > + TP_ARGS(fd, upeer_sockaddr, upeer_addrlen, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, upeer_sockaddr) __field_hex(int *, upeer_addrlen) __field(int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(upeer_sockaddr, upeer_sockaddr) tp_assign(upeer_addrlen, upeer_addrlen) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_wait4 > +SC_TRACE_EVENT(sys_wait4, > + TP_PROTO(pid_t upid, int * stat_addr, int options, struct rusage * ru), > + TP_ARGS(upid, stat_addr, options, ru), > + TP_STRUCT__entry(__field(pid_t, upid) __field_hex(int *, stat_addr) __field(int, options) __field_hex(struct rusage *, ru)), > + TP_fast_assign(tp_assign(upid, upid) tp_assign(stat_addr, stat_addr) tp_assign(options, options) tp_assign(ru, ru)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_prlimit64 > +SC_TRACE_EVENT(sys_prlimit64, > + TP_PROTO(pid_t pid, unsigned int resource, const struct rlimit64 * new_rlim, struct rlimit64 * old_rlim), > + TP_ARGS(pid, resource, new_rlim, old_rlim), > + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, resource) __field_hex(const struct rlimit64 *, new_rlim) __field_hex(struct rlimit64 *, old_rlim)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(resource, resource) tp_assign(new_rlim, new_rlim) tp_assign(old_rlim, old_rlim)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sendmmsg > +SC_TRACE_EVENT(sys_sendmmsg, > + TP_PROTO(int fd, struct mmsghdr * mmsg, unsigned int vlen, unsigned int flags), > + TP_ARGS(fd, mmsg, vlen, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct mmsghdr *, mmsg) __field(unsigned int, vlen) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(mmsg, mmsg) tp_assign(vlen, vlen) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_io_getevents > +SC_TRACE_EVENT(sys_io_getevents, > + TP_PROTO(aio_context_t ctx_id, long min_nr, long nr, struct io_event * events, struct timespec * timeout), > + TP_ARGS(ctx_id, min_nr, nr, events, timeout), > + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field(long, min_nr) __field(long, nr) __field_hex(struct io_event *, events) __field_hex(struct timespec *, timeout)), > + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(min_nr, min_nr) tp_assign(nr, nr) tp_assign(events, events) tp_assign(timeout, timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setxattr > +SC_TRACE_EVENT(sys_setxattr, > + TP_PROTO(const char * pathname, const char * name, const void * value, size_t size, int flags), > + TP_ARGS(pathname, name, value, size, flags), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_lsetxattr > +SC_TRACE_EVENT(sys_lsetxattr, > + TP_PROTO(const char * pathname, const char * name, const void * value, size_t size, int flags), > + TP_ARGS(pathname, name, value, size, flags), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_fsetxattr > +SC_TRACE_EVENT(sys_fsetxattr, > + TP_PROTO(int fd, const char * name, const void * value, size_t size, int flags), > + TP_ARGS(fd, name, value, size, flags), > + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_linkat > +SC_TRACE_EVENT(sys_linkat, > + TP_PROTO(int olddfd, const char * oldname, int newdfd, const char * newname, int flags), > + TP_ARGS(olddfd, oldname, newdfd, newname, flags), > + TP_STRUCT__entry(__field(int, olddfd) __string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname) __field(int, flags)), > + TP_fast_assign(tp_assign(olddfd, olddfd) tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mount > +SC_TRACE_EVENT(sys_mount, > + TP_PROTO(char * dev_name, char * dir_name, char * type, unsigned long flags, void * data), > + TP_ARGS(dev_name, dir_name, type, flags, data), > + TP_STRUCT__entry(__string_from_user(dev_name, dev_name) __string_from_user(dir_name, dir_name) __string_from_user(type, type) __field(unsigned long, flags) __field_hex(void *, data)), > + TP_fast_assign(tp_copy_string_from_user(dev_name, dev_name) tp_copy_string_from_user(dir_name, dir_name) tp_copy_string_from_user(type, type) tp_assign(flags, flags) tp_assign(data, data)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_fchownat > +SC_TRACE_EVENT(sys_fchownat, > + TP_PROTO(int dfd, const char * filename, uid_t user, gid_t group, int flag), > + TP_ARGS(dfd, filename, user, group, flag), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group) __field(int, flag)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group) tp_assign(flag, flag)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_preadv > +SC_TRACE_EVENT(sys_preadv, > + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h), > + TP_ARGS(fd, vec, vlen, pos_l, pos_h), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen) __field(unsigned long, pos_l) __field(unsigned long, pos_h)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen) tp_assign(pos_l, pos_l) tp_assign(pos_h, pos_h)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_pwritev > +SC_TRACE_EVENT(sys_pwritev, > + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h), > + TP_ARGS(fd, vec, vlen, pos_l, pos_h), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen) __field(unsigned long, pos_l) __field(unsigned long, pos_h)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen) tp_assign(pos_l, pos_l) tp_assign(pos_h, pos_h)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_ppoll > +SC_TRACE_EVENT(sys_ppoll, > + TP_PROTO(struct pollfd * ufds, unsigned int nfds, struct timespec * tsp, const sigset_t * sigmask, size_t sigsetsize), > + TP_ARGS(ufds, nfds, tsp, sigmask, sigsetsize), > + TP_STRUCT__entry(__field_hex(struct pollfd *, ufds) __field(unsigned int, nfds) __field_hex(struct timespec *, tsp) __field_hex(const sigset_t *, sigmask) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(ufds, ufds) tp_assign(nfds, nfds) tp_assign(tsp, tsp) tp_assign(sigmask, sigmask) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_waitid > +SC_TRACE_EVENT(sys_waitid, > + TP_PROTO(int which, pid_t upid, struct siginfo * infop, int options, struct rusage * ru), > + TP_ARGS(which, upid, infop, options, ru), > + TP_STRUCT__entry(__field(int, which) __field(pid_t, upid) __field_hex(struct siginfo *, infop) __field(int, options) __field_hex(struct rusage *, ru)), > + TP_fast_assign(tp_assign(which, which) tp_assign(upid, upid) tp_assign(infop, infop) tp_assign(options, options) tp_assign(ru, ru)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mq_timedsend > +SC_TRACE_EVENT(sys_mq_timedsend, > + TP_PROTO(mqd_t mqdes, const char * u_msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec * u_abs_timeout), > + TP_ARGS(mqdes, u_msg_ptr, msg_len, msg_prio, u_abs_timeout), > + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const char *, u_msg_ptr) __field(size_t, msg_len) __field(unsigned int, msg_prio) __field_hex(const struct timespec *, u_abs_timeout)), > + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_msg_ptr, u_msg_ptr) tp_assign(msg_len, msg_len) tp_assign(msg_prio, msg_prio) tp_assign(u_abs_timeout, u_abs_timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mq_timedreceive > +SC_TRACE_EVENT(sys_mq_timedreceive, > + TP_PROTO(mqd_t mqdes, char * u_msg_ptr, size_t msg_len, unsigned int * u_msg_prio, const struct timespec * u_abs_timeout), > + TP_ARGS(mqdes, u_msg_ptr, msg_len, u_msg_prio, u_abs_timeout), > + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(char *, u_msg_ptr) __field(size_t, msg_len) __field_hex(unsigned int *, u_msg_prio) __field_hex(const struct timespec *, u_abs_timeout)), > + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_msg_ptr, u_msg_ptr) tp_assign(msg_len, msg_len) tp_assign(u_msg_prio, u_msg_prio) tp_assign(u_abs_timeout, u_abs_timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_msgrcv > +SC_TRACE_EVENT(sys_msgrcv, > + TP_PROTO(int msqid, struct msgbuf * msgp, size_t msgsz, long msgtyp, int msgflg), > + TP_ARGS(msqid, msgp, msgsz, msgtyp, msgflg), > + TP_STRUCT__entry(__field(int, msqid) __field_hex(struct msgbuf *, msgp) __field(size_t, msgsz) __field(long, msgtyp) __field(int, msgflg)), > + TP_fast_assign(tp_assign(msqid, msqid) tp_assign(msgp, msgp) tp_assign(msgsz, msgsz) tp_assign(msgtyp, msgtyp) tp_assign(msgflg, msgflg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_setsockopt > +SC_TRACE_EVENT(sys_setsockopt, > + TP_PROTO(int fd, int level, int optname, char * optval, int optlen), > + TP_ARGS(fd, level, optname, optval, optlen), > + TP_STRUCT__entry(__field(int, fd) __field(int, level) __field(int, optname) __field_hex(char *, optval) __field(int, optlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(level, level) tp_assign(optname, optname) tp_assign(optval, optval) tp_assign(optlen, optlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_getsockopt > +SC_TRACE_EVENT(sys_getsockopt, > + TP_PROTO(int fd, int level, int optname, char * optval, int * optlen), > + TP_ARGS(fd, level, optname, optval, optlen), > + TP_STRUCT__entry(__field(int, fd) __field(int, level) __field(int, optname) __field_hex(char *, optval) __field_hex(int *, optlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(level, level) tp_assign(optname, optname) tp_assign(optval, optval) tp_assign(optlen, optlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_add_key > +SC_TRACE_EVENT(sys_add_key, > + TP_PROTO(const char * _type, const char * _description, const void * _payload, size_t plen, key_serial_t ringid), > + TP_ARGS(_type, _description, _payload, plen, ringid), > + TP_STRUCT__entry(__string_from_user(_type, _type) __field_hex(const char *, _description) __field_hex(const void *, _payload) __field(size_t, plen) __field(key_serial_t, ringid)), > + TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_payload, _payload) tp_assign(plen, plen) tp_assign(ringid, ringid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_get_mempolicy > +SC_TRACE_EVENT(sys_get_mempolicy, > + TP_PROTO(int * policy, unsigned long * nmask, unsigned long maxnode, unsigned long addr, unsigned long flags), > + TP_ARGS(policy, nmask, maxnode, addr, flags), > + TP_STRUCT__entry(__field_hex(int *, policy) __field_hex(unsigned long *, nmask) __field(unsigned long, maxnode) __field_hex(unsigned long, addr) __field(unsigned long, flags)), > + TP_fast_assign(tp_assign(policy, policy) tp_assign(nmask, nmask) tp_assign(maxnode, maxnode) tp_assign(addr, addr) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_perf_event_open > +SC_TRACE_EVENT(sys_perf_event_open, > + TP_PROTO(struct perf_event_attr * attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags), > + TP_ARGS(attr_uptr, pid, cpu, group_fd, flags), > + TP_STRUCT__entry(__field_hex(struct perf_event_attr *, attr_uptr) __field(pid_t, pid) __field(int, cpu) __field(int, group_fd) __field(unsigned long, flags)), > + TP_fast_assign(tp_assign(attr_uptr, attr_uptr) tp_assign(pid, pid) tp_assign(cpu, cpu) tp_assign(group_fd, group_fd) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_recvmmsg > +SC_TRACE_EVENT(sys_recvmmsg, > + TP_PROTO(int fd, struct mmsghdr * mmsg, unsigned int vlen, unsigned int flags, struct timespec * timeout), > + TP_ARGS(fd, mmsg, vlen, flags, timeout), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct mmsghdr *, mmsg) __field(unsigned int, vlen) __field(unsigned int, flags) __field_hex(struct timespec *, timeout)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(mmsg, mmsg) tp_assign(vlen, vlen) tp_assign(flags, flags) tp_assign(timeout, timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_name_to_handle_at > +SC_TRACE_EVENT(sys_name_to_handle_at, > + TP_PROTO(int dfd, const char * name, struct file_handle * handle, int * mnt_id, int flag), > + TP_ARGS(dfd, name, handle, mnt_id, flag), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(name, name) __field_hex(struct file_handle *, handle) __field_hex(int *, mnt_id) __field(int, flag)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(name, name) tp_assign(handle, handle) tp_assign(mnt_id, mnt_id) tp_assign(flag, flag)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_epoll_pwait > +SC_TRACE_EVENT(sys_epoll_pwait, > + TP_PROTO(int epfd, struct epoll_event * events, int maxevents, int timeout, const sigset_t * sigmask, size_t sigsetsize), > + TP_ARGS(epfd, events, maxevents, timeout, sigmask, sigsetsize), > + TP_STRUCT__entry(__field(int, epfd) __field_hex(struct epoll_event *, events) __field(int, maxevents) __field(int, timeout) __field_hex(const sigset_t *, sigmask) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(events, events) tp_assign(maxevents, maxevents) tp_assign(timeout, timeout) tp_assign(sigmask, sigmask) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_pselect6 > +SC_TRACE_EVENT(sys_pselect6, > + TP_PROTO(int n, fd_set * inp, fd_set * outp, fd_set * exp, struct timespec * tsp, void * sig), > + TP_ARGS(n, inp, outp, exp, tsp, sig), > + TP_STRUCT__entry(__field(int, n) __field_hex(fd_set *, inp) __field_hex(fd_set *, outp) __field_hex(fd_set *, exp) __field_hex(struct timespec *, tsp) __field_hex(void *, sig)), > + TP_fast_assign(tp_assign(n, n) tp_assign(inp, inp) tp_assign(outp, outp) tp_assign(exp, exp) tp_assign(tsp, tsp) tp_assign(sig, sig)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_splice > +SC_TRACE_EVENT(sys_splice, > + TP_PROTO(int fd_in, loff_t * off_in, int fd_out, loff_t * off_out, size_t len, unsigned int flags), > + TP_ARGS(fd_in, off_in, fd_out, off_out, len, flags), > + TP_STRUCT__entry(__field(int, fd_in) __field_hex(loff_t *, off_in) __field(int, fd_out) __field_hex(loff_t *, off_out) __field(size_t, len) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fd_in, fd_in) tp_assign(off_in, off_in) tp_assign(fd_out, fd_out) tp_assign(off_out, off_out) tp_assign(len, len) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_futex > +SC_TRACE_EVENT(sys_futex, > + TP_PROTO(u32 * uaddr, int op, u32 val, struct timespec * utime, u32 * uaddr2, u32 val3), > + TP_ARGS(uaddr, op, val, utime, uaddr2, val3), > + TP_STRUCT__entry(__field_hex(u32 *, uaddr) __field(int, op) __field(u32, val) __field_hex(struct timespec *, utime) __field_hex(u32 *, uaddr2) __field(u32, val3)), > + TP_fast_assign(tp_assign(uaddr, uaddr) tp_assign(op, op) tp_assign(val, val) tp_assign(utime, utime) tp_assign(uaddr2, uaddr2) tp_assign(val3, val3)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_sendto > +SC_TRACE_EVENT(sys_sendto, > + TP_PROTO(int fd, void * buff, size_t len, unsigned flags, struct sockaddr * addr, int addr_len), > + TP_ARGS(fd, buff, len, flags, addr, addr_len), > + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, buff) __field(size_t, len) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int, addr_len)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buff, buff) tp_assign(len, len) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_recvfrom > +SC_TRACE_EVENT(sys_recvfrom, > + TP_PROTO(int fd, void * ubuf, size_t size, unsigned flags, struct sockaddr * addr, int * addr_len), > + TP_ARGS(fd, ubuf, size, flags, addr, addr_len), > + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, ubuf) __field(size_t, size) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int *, addr_len)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(ubuf, ubuf) tp_assign(size, size) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_mbind > +SC_TRACE_EVENT(sys_mbind, > + TP_PROTO(unsigned long start, unsigned long len, unsigned long mode, unsigned long * nmask, unsigned long maxnode, unsigned flags), > + TP_ARGS(start, len, mode, nmask, maxnode, flags), > + TP_STRUCT__entry(__field(unsigned long, start) __field(unsigned long, len) __field(unsigned long, mode) __field_hex(unsigned long *, nmask) __field(unsigned long, maxnode) __field(unsigned, flags)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(mode, mode) tp_assign(nmask, nmask) tp_assign(maxnode, maxnode) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_64_sys_move_pages > +SC_TRACE_EVENT(sys_move_pages, > + TP_PROTO(pid_t pid, unsigned long nr_pages, const void * * pages, const int * nodes, int * status, int flags), > + TP_ARGS(pid, nr_pages, pages, nodes, status, flags), > + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned long, nr_pages) __field_hex(const void * *, pages) __field_hex(const int *, nodes) __field_hex(int *, status) __field(int, flags)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(nr_pages, nr_pages) tp_assign(pages, pages) tp_assign(nodes, nodes) tp_assign(status, status) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > + > +#endif /* _TRACE_SYSCALLS_POINTERS_H */ > + > +/* This part must be outside protection */ > +#include "../../../probes/define_trace.h" > + > +#else /* CREATE_SYSCALL_TABLE */ > + > +#include "tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers_override.h" > +#include "syscalls_pointers_override.h" > + > +#ifndef OVERRIDE_TABLE_64_sys_io_setup > +TRACE_SYSCALL_TABLE(sys_io_setup, sys_io_setup, 0, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_io_submit > +TRACE_SYSCALL_TABLE(sys_io_submit, sys_io_submit, 2, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_io_cancel > +TRACE_SYSCALL_TABLE(sys_io_cancel, sys_io_cancel, 3, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_io_getevents > +TRACE_SYSCALL_TABLE(sys_io_getevents, sys_io_getevents, 4, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setxattr > +TRACE_SYSCALL_TABLE(sys_setxattr, sys_setxattr, 5, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_lsetxattr > +TRACE_SYSCALL_TABLE(sys_lsetxattr, sys_lsetxattr, 6, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_fsetxattr > +TRACE_SYSCALL_TABLE(sys_fsetxattr, sys_fsetxattr, 7, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getxattr > +TRACE_SYSCALL_TABLE(sys_getxattr, sys_getxattr, 8, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_lgetxattr > +TRACE_SYSCALL_TABLE(sys_lgetxattr, sys_lgetxattr, 9, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_fgetxattr > +TRACE_SYSCALL_TABLE(sys_fgetxattr, sys_fgetxattr, 10, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_listxattr > +TRACE_SYSCALL_TABLE(sys_listxattr, sys_listxattr, 11, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_llistxattr > +TRACE_SYSCALL_TABLE(sys_llistxattr, sys_llistxattr, 12, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_flistxattr > +TRACE_SYSCALL_TABLE(sys_flistxattr, sys_flistxattr, 13, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_removexattr > +TRACE_SYSCALL_TABLE(sys_removexattr, sys_removexattr, 14, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_lremovexattr > +TRACE_SYSCALL_TABLE(sys_lremovexattr, sys_lremovexattr, 15, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_fremovexattr > +TRACE_SYSCALL_TABLE(sys_fremovexattr, sys_fremovexattr, 16, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getcwd > +TRACE_SYSCALL_TABLE(sys_getcwd, sys_getcwd, 17, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_epoll_ctl > +TRACE_SYSCALL_TABLE(sys_epoll_ctl, sys_epoll_ctl, 21, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_epoll_pwait > +TRACE_SYSCALL_TABLE(sys_epoll_pwait, sys_epoll_pwait, 22, 6) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_inotify_add_watch > +TRACE_SYSCALL_TABLE(sys_inotify_add_watch, sys_inotify_add_watch, 27, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mknodat > +TRACE_SYSCALL_TABLE(sys_mknodat, sys_mknodat, 33, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mkdirat > +TRACE_SYSCALL_TABLE(sys_mkdirat, sys_mkdirat, 34, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_unlinkat > +TRACE_SYSCALL_TABLE(sys_unlinkat, sys_unlinkat, 35, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_symlinkat > +TRACE_SYSCALL_TABLE(sys_symlinkat, sys_symlinkat, 36, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_linkat > +TRACE_SYSCALL_TABLE(sys_linkat, sys_linkat, 37, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_renameat > +TRACE_SYSCALL_TABLE(sys_renameat, sys_renameat, 38, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_umount > +TRACE_SYSCALL_TABLE(sys_umount, sys_umount, 39, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mount > +TRACE_SYSCALL_TABLE(sys_mount, sys_mount, 40, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_pivot_root > +TRACE_SYSCALL_TABLE(sys_pivot_root, sys_pivot_root, 41, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_nfsservctl > +TRACE_SYSCALL_TABLE(sys_nfsservctl, sys_nfsservctl, 42, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_statfs > +TRACE_SYSCALL_TABLE(sys_statfs, sys_statfs, 43, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_fstatfs > +TRACE_SYSCALL_TABLE(sys_fstatfs, sys_fstatfs, 44, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_truncate > +TRACE_SYSCALL_TABLE(sys_truncate, sys_truncate, 45, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_faccessat > +TRACE_SYSCALL_TABLE(sys_faccessat, sys_faccessat, 48, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_chdir > +TRACE_SYSCALL_TABLE(sys_chdir, sys_chdir, 49, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_chroot > +TRACE_SYSCALL_TABLE(sys_chroot, sys_chroot, 51, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_fchmodat > +TRACE_SYSCALL_TABLE(sys_fchmodat, sys_fchmodat, 53, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_fchownat > +TRACE_SYSCALL_TABLE(sys_fchownat, sys_fchownat, 54, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_openat > +TRACE_SYSCALL_TABLE(sys_openat, sys_openat, 56, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_pipe2 > +TRACE_SYSCALL_TABLE(sys_pipe2, sys_pipe2, 59, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_quotactl > +TRACE_SYSCALL_TABLE(sys_quotactl, sys_quotactl, 60, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getdents64 > +TRACE_SYSCALL_TABLE(sys_getdents64, sys_getdents64, 61, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_read > +TRACE_SYSCALL_TABLE(sys_read, sys_read, 63, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_write > +TRACE_SYSCALL_TABLE(sys_write, sys_write, 64, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_readv > +TRACE_SYSCALL_TABLE(sys_readv, sys_readv, 65, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_writev > +TRACE_SYSCALL_TABLE(sys_writev, sys_writev, 66, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_preadv > +TRACE_SYSCALL_TABLE(sys_preadv, sys_preadv, 69, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_pwritev > +TRACE_SYSCALL_TABLE(sys_pwritev, sys_pwritev, 70, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sendfile64 > +TRACE_SYSCALL_TABLE(sys_sendfile64, sys_sendfile64, 71, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_pselect6 > +TRACE_SYSCALL_TABLE(sys_pselect6, sys_pselect6, 72, 6) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_ppoll > +TRACE_SYSCALL_TABLE(sys_ppoll, sys_ppoll, 73, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_signalfd4 > +TRACE_SYSCALL_TABLE(sys_signalfd4, sys_signalfd4, 74, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_vmsplice > +TRACE_SYSCALL_TABLE(sys_vmsplice, sys_vmsplice, 75, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_splice > +TRACE_SYSCALL_TABLE(sys_splice, sys_splice, 76, 6) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_readlinkat > +TRACE_SYSCALL_TABLE(sys_readlinkat, sys_readlinkat, 78, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_newfstatat > +TRACE_SYSCALL_TABLE(sys_newfstatat, sys_newfstatat, 79, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_newfstat > +TRACE_SYSCALL_TABLE(sys_newfstat, sys_newfstat, 80, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_timerfd_settime > +TRACE_SYSCALL_TABLE(sys_timerfd_settime, sys_timerfd_settime, 86, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_timerfd_gettime > +TRACE_SYSCALL_TABLE(sys_timerfd_gettime, sys_timerfd_gettime, 87, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_utimensat > +TRACE_SYSCALL_TABLE(sys_utimensat, sys_utimensat, 88, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_acct > +TRACE_SYSCALL_TABLE(sys_acct, sys_acct, 89, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_waitid > +TRACE_SYSCALL_TABLE(sys_waitid, sys_waitid, 95, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_set_tid_address > +TRACE_SYSCALL_TABLE(sys_set_tid_address, sys_set_tid_address, 96, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_futex > +TRACE_SYSCALL_TABLE(sys_futex, sys_futex, 98, 6) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_set_robust_list > +TRACE_SYSCALL_TABLE(sys_set_robust_list, sys_set_robust_list, 99, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_get_robust_list > +TRACE_SYSCALL_TABLE(sys_get_robust_list, sys_get_robust_list, 100, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_nanosleep > +TRACE_SYSCALL_TABLE(sys_nanosleep, sys_nanosleep, 101, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getitimer > +TRACE_SYSCALL_TABLE(sys_getitimer, sys_getitimer, 102, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setitimer > +TRACE_SYSCALL_TABLE(sys_setitimer, sys_setitimer, 103, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_init_module > +TRACE_SYSCALL_TABLE(sys_init_module, sys_init_module, 105, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_delete_module > +TRACE_SYSCALL_TABLE(sys_delete_module, sys_delete_module, 106, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_timer_create > +TRACE_SYSCALL_TABLE(sys_timer_create, sys_timer_create, 107, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_timer_gettime > +TRACE_SYSCALL_TABLE(sys_timer_gettime, sys_timer_gettime, 108, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_timer_settime > +TRACE_SYSCALL_TABLE(sys_timer_settime, sys_timer_settime, 110, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_clock_settime > +TRACE_SYSCALL_TABLE(sys_clock_settime, sys_clock_settime, 112, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_clock_gettime > +TRACE_SYSCALL_TABLE(sys_clock_gettime, sys_clock_gettime, 113, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_clock_getres > +TRACE_SYSCALL_TABLE(sys_clock_getres, sys_clock_getres, 114, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_clock_nanosleep > +TRACE_SYSCALL_TABLE(sys_clock_nanosleep, sys_clock_nanosleep, 115, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_syslog > +TRACE_SYSCALL_TABLE(sys_syslog, sys_syslog, 116, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sched_setparam > +TRACE_SYSCALL_TABLE(sys_sched_setparam, sys_sched_setparam, 118, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sched_setscheduler > +TRACE_SYSCALL_TABLE(sys_sched_setscheduler, sys_sched_setscheduler, 119, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sched_getparam > +TRACE_SYSCALL_TABLE(sys_sched_getparam, sys_sched_getparam, 121, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sched_setaffinity > +TRACE_SYSCALL_TABLE(sys_sched_setaffinity, sys_sched_setaffinity, 122, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sched_getaffinity > +TRACE_SYSCALL_TABLE(sys_sched_getaffinity, sys_sched_getaffinity, 123, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sched_rr_get_interval > +TRACE_SYSCALL_TABLE(sys_sched_rr_get_interval, sys_sched_rr_get_interval, 127, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_rt_sigsuspend > +TRACE_SYSCALL_TABLE(sys_rt_sigsuspend, sys_rt_sigsuspend, 133, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_rt_sigaction > +TRACE_SYSCALL_TABLE(sys_rt_sigaction, sys_rt_sigaction, 134, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_rt_sigprocmask > +TRACE_SYSCALL_TABLE(sys_rt_sigprocmask, sys_rt_sigprocmask, 135, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_rt_sigpending > +TRACE_SYSCALL_TABLE(sys_rt_sigpending, sys_rt_sigpending, 136, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_rt_sigtimedwait > +TRACE_SYSCALL_TABLE(sys_rt_sigtimedwait, sys_rt_sigtimedwait, 137, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_rt_sigqueueinfo > +TRACE_SYSCALL_TABLE(sys_rt_sigqueueinfo, sys_rt_sigqueueinfo, 138, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_reboot > +TRACE_SYSCALL_TABLE(sys_reboot, sys_reboot, 142, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getresuid > +TRACE_SYSCALL_TABLE(sys_getresuid, sys_getresuid, 148, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getresgid > +TRACE_SYSCALL_TABLE(sys_getresgid, sys_getresgid, 150, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_times > +TRACE_SYSCALL_TABLE(sys_times, sys_times, 153, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getgroups > +TRACE_SYSCALL_TABLE(sys_getgroups, sys_getgroups, 158, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setgroups > +TRACE_SYSCALL_TABLE(sys_setgroups, sys_setgroups, 159, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_newuname > +TRACE_SYSCALL_TABLE(sys_newuname, sys_newuname, 160, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sethostname > +TRACE_SYSCALL_TABLE(sys_sethostname, sys_sethostname, 161, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setdomainname > +TRACE_SYSCALL_TABLE(sys_setdomainname, sys_setdomainname, 162, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getrlimit > +TRACE_SYSCALL_TABLE(sys_getrlimit, sys_getrlimit, 163, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setrlimit > +TRACE_SYSCALL_TABLE(sys_setrlimit, sys_setrlimit, 164, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getrusage > +TRACE_SYSCALL_TABLE(sys_getrusage, sys_getrusage, 165, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getcpu > +TRACE_SYSCALL_TABLE(sys_getcpu, sys_getcpu, 168, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_gettimeofday > +TRACE_SYSCALL_TABLE(sys_gettimeofday, sys_gettimeofday, 169, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_settimeofday > +TRACE_SYSCALL_TABLE(sys_settimeofday, sys_settimeofday, 170, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_adjtimex > +TRACE_SYSCALL_TABLE(sys_adjtimex, sys_adjtimex, 171, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sysinfo > +TRACE_SYSCALL_TABLE(sys_sysinfo, sys_sysinfo, 179, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mq_open > +TRACE_SYSCALL_TABLE(sys_mq_open, sys_mq_open, 180, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mq_unlink > +TRACE_SYSCALL_TABLE(sys_mq_unlink, sys_mq_unlink, 181, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mq_timedsend > +TRACE_SYSCALL_TABLE(sys_mq_timedsend, sys_mq_timedsend, 182, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mq_timedreceive > +TRACE_SYSCALL_TABLE(sys_mq_timedreceive, sys_mq_timedreceive, 183, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mq_notify > +TRACE_SYSCALL_TABLE(sys_mq_notify, sys_mq_notify, 184, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mq_getsetattr > +TRACE_SYSCALL_TABLE(sys_mq_getsetattr, sys_mq_getsetattr, 185, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_msgctl > +TRACE_SYSCALL_TABLE(sys_msgctl, sys_msgctl, 187, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_msgrcv > +TRACE_SYSCALL_TABLE(sys_msgrcv, sys_msgrcv, 188, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_msgsnd > +TRACE_SYSCALL_TABLE(sys_msgsnd, sys_msgsnd, 189, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_semtimedop > +TRACE_SYSCALL_TABLE(sys_semtimedop, sys_semtimedop, 192, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_semop > +TRACE_SYSCALL_TABLE(sys_semop, sys_semop, 193, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_shmctl > +TRACE_SYSCALL_TABLE(sys_shmctl, sys_shmctl, 195, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_shmat > +TRACE_SYSCALL_TABLE(sys_shmat, sys_shmat, 196, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_shmdt > +TRACE_SYSCALL_TABLE(sys_shmdt, sys_shmdt, 197, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_socketpair > +TRACE_SYSCALL_TABLE(sys_socketpair, sys_socketpair, 199, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_bind > +TRACE_SYSCALL_TABLE(sys_bind, sys_bind, 200, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_accept > +TRACE_SYSCALL_TABLE(sys_accept, sys_accept, 202, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_connect > +TRACE_SYSCALL_TABLE(sys_connect, sys_connect, 203, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getsockname > +TRACE_SYSCALL_TABLE(sys_getsockname, sys_getsockname, 204, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getpeername > +TRACE_SYSCALL_TABLE(sys_getpeername, sys_getpeername, 205, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sendto > +TRACE_SYSCALL_TABLE(sys_sendto, sys_sendto, 206, 6) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_recvfrom > +TRACE_SYSCALL_TABLE(sys_recvfrom, sys_recvfrom, 207, 6) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_setsockopt > +TRACE_SYSCALL_TABLE(sys_setsockopt, sys_setsockopt, 208, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_getsockopt > +TRACE_SYSCALL_TABLE(sys_getsockopt, sys_getsockopt, 209, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sendmsg > +TRACE_SYSCALL_TABLE(sys_sendmsg, sys_sendmsg, 211, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_recvmsg > +TRACE_SYSCALL_TABLE(sys_recvmsg, sys_recvmsg, 212, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_add_key > +TRACE_SYSCALL_TABLE(sys_add_key, sys_add_key, 217, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_request_key > +TRACE_SYSCALL_TABLE(sys_request_key, sys_request_key, 218, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_swapon > +TRACE_SYSCALL_TABLE(sys_swapon, sys_swapon, 224, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_swapoff > +TRACE_SYSCALL_TABLE(sys_swapoff, sys_swapoff, 225, 1) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mincore > +TRACE_SYSCALL_TABLE(sys_mincore, sys_mincore, 232, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_mbind > +TRACE_SYSCALL_TABLE(sys_mbind, sys_mbind, 235, 6) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_get_mempolicy > +TRACE_SYSCALL_TABLE(sys_get_mempolicy, sys_get_mempolicy, 236, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_set_mempolicy > +TRACE_SYSCALL_TABLE(sys_set_mempolicy, sys_set_mempolicy, 237, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_migrate_pages > +TRACE_SYSCALL_TABLE(sys_migrate_pages, sys_migrate_pages, 238, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_move_pages > +TRACE_SYSCALL_TABLE(sys_move_pages, sys_move_pages, 239, 6) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_rt_tgsigqueueinfo > +TRACE_SYSCALL_TABLE(sys_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, 240, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_perf_event_open > +TRACE_SYSCALL_TABLE(sys_perf_event_open, sys_perf_event_open, 241, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_accept4 > +TRACE_SYSCALL_TABLE(sys_accept4, sys_accept4, 242, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_recvmmsg > +TRACE_SYSCALL_TABLE(sys_recvmmsg, sys_recvmmsg, 243, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_wait4 > +TRACE_SYSCALL_TABLE(sys_wait4, sys_wait4, 260, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_prlimit64 > +TRACE_SYSCALL_TABLE(sys_prlimit64, sys_prlimit64, 261, 4) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_name_to_handle_at > +TRACE_SYSCALL_TABLE(sys_name_to_handle_at, sys_name_to_handle_at, 264, 5) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_open_by_handle_at > +TRACE_SYSCALL_TABLE(sys_open_by_handle_at, sys_open_by_handle_at, 265, 3) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_clock_adjtime > +TRACE_SYSCALL_TABLE(sys_clock_adjtime, sys_clock_adjtime, 266, 2) > +#endif > +#ifndef OVERRIDE_TABLE_64_sys_sendmmsg > +TRACE_SYSCALL_TABLE(sys_sendmmsg, sys_sendmmsg, 269, 4) > +#endif > + > +#endif /* CREATE_SYSCALL_TABLE */ > diff --git a/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers_override.h b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers_override.h > new file mode 100644 > index 0000000..e5f402c > --- /dev/null > +++ b/instrumentation/syscalls/headers/tile-64-syscalls-2.6.40.38-MDE-4.1.2.149467_pointers_override.h > @@ -0,0 +1,14 @@ > +#define OVERRIDE_TABLE_64_sys_execve > +#define OVERRIDE_TABLE_64_sys_clone > + > +#ifndef CREATE_SYSCALL_TABLE > + > +#else /* CREATE_SYSCALL_TABLE */ > + > +#define OVERRIDE_TABLE_64_sys_execve > +TRACE_SYSCALL_TABLE(sys_execve, sys_execve, 221, 3) > + > +#define OVERRIDE_TABLE_64_sys_clone > +TRACE_SYSCALL_TABLE(sys_clone, sys_clone, 220, 4) > + > +#endif /* CREATE_SYSCALL_TABLE */ > -- > 1.7.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Mon May 6 09:11:01 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 09:11:01 -0400 Subject: [lttng-dev] [BABELTRACE] view logs while tracing started In-Reply-To: References: Message-ID: <20130506131101.GG12699@Krystal> * yin sun (sunyin51 at gmail.com) wrote: > Hi, > > I am new here. The example always need to stop tracing then view the log. > Is it possible to view it while tracing is on. I try to do that it always fail. > How to make it work. This will be a new feature planned around July 2013. Stay tuned, Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From Erik.Ostermueller at fisglobal.com Mon May 6 10:33:57 2013 From: Erik.Ostermueller at fisglobal.com (Ostermueller, Erik) Date: Mon, 6 May 2013 14:33:57 +0000 Subject: [lttng-dev] Java code for CTF trace writing? In-Reply-To: <1218416875.7614701.1366750233878.JavaMail.root@vmware.com> References: <5176AAFA.8060905@ericsson.com> <1962635283.7490228.1366741297558.JavaMail.root@vmware.com> <5176D556.8040801@ericsson.com> <1218416875.7614701.1366750233878.JavaMail.root@vmware.com> Message-ID: Hello all, I've got a question about the Java code that writes CTF traces. Would this design provide a single trace with Java events and OS events in the same trace? Here is an example: Consider an all-Java program that sends an XML requests request over HTTP. Would like the trace detail to show Java method activity as well as OS activity that opens/closes the socket. This could be very helpful for unveiling the details of how Java code consumes hardware resources. Thanks, --Erik -----Original Message----- From: Aaron Spear [mailto:aspear at vmware.com] Sent: Tuesday, April 23, 2013 3:51 PM To: Matthew Khouzam Cc: Philippe Proulx; Dominique Toupin; lttng-dev at lists.lttng.org; Linux Tools developer discussions Subject: Re: [lttng-dev] Java code for CTF trace writing? > When would you be available to work on this feature, I would love to > sync up our efforts for this. The way things look right now, I will have bandwidth for it in another month, so middle to end of May. Perhaps sooner if all the stars align. Aaron _______________________________________________ lttng-dev mailing list lttng-dev at lists.lttng.org http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev _____________ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. From philippe.proulx at polymtl.ca Mon May 6 11:26:12 2013 From: philippe.proulx at polymtl.ca (Philippe Proulx) Date: Mon, 6 May 2013 11:26:12 -0400 Subject: [lttng-dev] Java code for CTF trace writing? In-Reply-To: References: <5176AAFA.8060905@ericsson.com> <1962635283.7490228.1366741297558.JavaMail.root@vmware.com> <5176D556.8040801@ericsson.com> <1218416875.7614701.1366750233878.JavaMail.root@vmware.com> Message-ID: I don't think so, but usually you would have a trace for your Java events and another one for OS events that are recorded simultaneously. Then you simply open both with Babeltrace or your favorite trace viewer and you should see interleaving events. You might have problems with events timing synchronization though if you plan to produce your own CTF trace. Philippe Proulx On Mon, May 6, 2013 at 10:33 AM, Ostermueller, Erik < Erik.Ostermueller at fisglobal.com> wrote: > Hello all, > > I've got a question about the Java code that writes CTF traces. > Would this design provide a single trace with Java events and OS events in > the same trace? > Here is an example: > > Consider an all-Java program that sends an XML requests request over HTTP. > Would like the trace detail to show Java method activity as well as OS > activity that opens/closes the socket. > > This could be very helpful for unveiling the details of how Java code > consumes hardware resources. > > Thanks, > --Erik > > -----Original Message----- > From: Aaron Spear [mailto:aspear at vmware.com] > Sent: Tuesday, April 23, 2013 3:51 PM > To: Matthew Khouzam > Cc: Philippe Proulx; Dominique Toupin; lttng-dev at lists.lttng.org; Linux > Tools developer discussions > Subject: Re: [lttng-dev] Java code for CTF trace writing? > > > When would you be available to work on this feature, I would love to > > sync up our efforts for this. > > The way things look right now, I will have bandwidth for it in another > month, so middle to end of May. Perhaps sooner if all the stars align. > > Aaron > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > _____________ > The information contained in this message is proprietary and/or > confidential. If you are not the intended recipient, please: (i) delete the > message and all copies; (ii) do not disclose, distribute or use the message > in any manner; and (iii) notify the sender immediately. In addition, please > be aware that any message addressed to our domain is subject to archiving > and review by persons other than the intended recipient. Thank you. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.babeux at efficios.com Mon May 6 11:32:07 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Mon, 6 May 2013 11:32:07 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Tests: Add missing test_utils_parse_size_suffix to unit tests Message-ID: <1367854327-17078-1-git-send-email-christian.babeux@efficios.com> Signed-off-by: Christian Babeux --- tests/unit_tests | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit_tests b/tests/unit_tests index d7c68b6..6bf33cc 100644 --- a/tests/unit_tests +++ b/tests/unit_tests @@ -2,3 +2,4 @@ unit/test_kernel_data unit/test_session unit/test_uri unit/test_ust_data +unit/test_utils_parse_size_suffix -- 1.8.2.2 From Daniel.Thibault at drdc-rddc.gc.ca Mon May 6 11:31:46 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Mon, 6 May 2013 15:31:46 +0000 Subject: [lttng-dev] lttng-tools and userspace-rcu Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D11354@VAL-E-02.valcartier.drdc-rddc.gc.ca> Let's assume I want to do a kernel-only LTTng installation. After putting lttng-modules in place, I get lttng-tools and, at its configure step, I do: ./configure --disable-lttng-ust However, this fails with: checking whether cds_list_add is declared... no configure: error: liburcu >= 0.7.2 or newer is needed Is this normal? If so, why is userspace-rcu (liburcu) needed for a kernel-only tracing solution? (I'm using a fairly recent set of lttng 2.2.0-rc1 git tarballs) Daniel U. Thibault Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure Qu?bec QC G3J 1X5 CANADA Vox : (418) 844-4000 x4245 Fax : (418) 844-4538 NAC : 918V QSDJ Gouvernement du Canada | Government of Canada -------------- next part -------------- An HTML attachment was scrubbed... URL: From dgoulet at efficios.com Mon May 6 11:35:30 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 06 May 2013 11:35:30 -0400 Subject: [lttng-dev] lttng-tools and userspace-rcu In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD12D11354@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD12D11354@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: <5187CDC2.3090600@efficios.com> Yes it is. URCU is used extensively in lttng-tools regardless of UST tracing or not. David Thibault, Daniel: > Let?s assume I want to do a kernel-only LTTng installation. After > putting lttng-modules in place, I get lttng-tools and, at its configure > step, I do: > > > > ./configure --disable-lttng-ust > > > > However, this fails with: > > > > checking whether cds_list_add is declared... no > > configure: error: liburcu >= 0.7.2 or newer is needed > > > > Is this normal? If so, why is userspace-rcu (liburcu) needed for a > kernel-only tracing solution? (I?m using a fairly recent set of lttng > 2.2.0-rc1 git tarballs) > > > > Daniel U. Thibault > Protection des syst?mes et contremesures (PSC) | Systems Protection & > Countermeasures (SPC) > Cyber s?curit? pour les missions essentielles (CME) | Mission Critical > Cyber Security (MCCS) > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence > R&D Canada - Valcartier (DRDC Valcartier) > 2459 route de la Bravoure > Qu?bec QC G3J 1X5 > CANADA > Vox : (418) 844-4000 x4245 > Fax : (418) 844-4538 > NAC : 918V QSDJ > <_http://www.travelgis.com/map.asp?addr=918V%20QSDJ_> > Gouvernement du Canada | Government of Canada > > From dgoulet at efficios.com Mon May 6 11:36:47 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 06 May 2013 11:36:47 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Tests: Add missing test_utils_parse_size_suffix to unit tests In-Reply-To: <1367854327-17078-1-git-send-email-christian.babeux@efficios.com> References: <1367854327-17078-1-git-send-email-christian.babeux@efficios.com> Message-ID: <5187CE0F.3020202@efficios.com> Merged Christian Babeux: > Signed-off-by: Christian Babeux > --- > tests/unit_tests | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tests/unit_tests b/tests/unit_tests > index d7c68b6..6bf33cc 100644 > --- a/tests/unit_tests > +++ b/tests/unit_tests > @@ -2,3 +2,4 @@ unit/test_kernel_data > unit/test_session > unit/test_uri > unit/test_ust_data > +unit/test_utils_parse_size_suffix From aspear at vmware.com Mon May 6 13:53:27 2013 From: aspear at vmware.com (Aaron Spear) Date: Mon, 6 May 2013 10:53:27 -0700 (PDT) Subject: [lttng-dev] Java code for CTF trace writing? In-Reply-To: References: <5176AAFA.8060905@ericsson.com> <1962635283.7490228.1366741297558.JavaMail.root@vmware.com> <5176D556.8040801@ericsson.com> <1218416875.7614701.1366750233878.JavaMail.root@vmware.com> Message-ID: <1670315418.908522.1367862807840.JavaMail.root@vmware.com> Hi Erik, The answer at this moment is no, you can't see that. That said, that is certainly the vision of what I want to create. I am working on extending a view so that I can see Java methods in one trace alongside state changes that come from another trace. The idea is to have a single view that knows how to present state vs. time and then providers for that state for different kinds of tracing. I have in fact done exactly what you want (java app trace + linux kernel trace), but it is clunky right now because you cannot see the Linux kernel trace and the Java trace at the same time. The issue here is simply one of implementation choices related to how traces are viewed. At this moment the views in the LTTng viewer are singletons setup to only allow one trace to be viewed at a time (mostly. the "Time Chart" view is an exception to this). What is needed is one of two things (I think both): 1) support for being able to open as many instances of views as you wish, and then "pin" them to a particular trace. If you could do this then you could open an LTTng linux kernel view and a java trace and whatever else you wanted at the same time. In addition to the pin support the views would need some mechanism for time sync between them (like the current control flow view syncs based on the selection in Histogram view) 2) Change the "state flow view" that I created (borrowing code from the control flow view) so it supports multiple traces (e.g. LTTng kernel trace). I am working on this right now for data driven traces. One thought is that this view infrastructure could be changed so that a single view could show all of these different types of traces. A bunch of refactoring would be required to do this though. The current ControlFlowView has things very specific to kernel traces that don't make sense generically (e.g. process related details as columns in the trace) I can't comment as to the official direction of the project (since I am not a committer...) but Perhaps Alexandre or others could comment on thoughts on what could be done to address this and when. regards, Aaron Spear ----- Original Message ----- > Hello all, > > I've got a question about the Java code that writes CTF traces. > Would this design provide a single trace with Java events and OS events in > the same trace? > Here is an example: > > Consider an all-Java program that sends an XML requests request over HTTP. > Would like the trace detail to show Java method activity as well as OS > activity that opens/closes the socket. > > This could be very helpful for unveiling the details of how Java code > consumes hardware resources. > > Thanks, > --Erik > > -----Original Message----- > From: Aaron Spear [mailto:aspear at vmware.com] > Sent: Tuesday, April 23, 2013 3:51 PM > To: Matthew Khouzam > Cc: Philippe Proulx; Dominique Toupin; lttng-dev at lists.lttng.org; Linux Tools > developer discussions > Subject: Re: [lttng-dev] Java code for CTF trace writing? > > > When would you be available to work on this feature, I would love to > > sync up our efforts for this. > > The way things look right now, I will have bandwidth for it in another month, > so middle to end of May. Perhaps sooner if all the stars align. > > Aaron > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > _____________ > The information contained in this message is proprietary and/or confidential. > If you are not the intended recipient, please: (i) delete the message and > all copies; (ii) do not disclose, distribute or use the message in any > manner; and (iii) notify the sender immediately. In addition, please be > aware that any message addressed to our domain is subject to archiving and > review by persons other than the intended recipient. Thank you > From charlesbriere.flatzo at gmail.com Mon May 6 14:10:51 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:10:51 +0000 Subject: [lttng-dev] [PATCH lttng-tools 01/14] Adding some checks for Android specific libraries to the configure step Message-ID: <1367863864-14680-1-git-send-email-charlesbriere.flatzo@gmail.com> Signed-off-by: Charles Briere --- configure.ac | 34 ++++++++++++++++++++++++++++++---- src/bin/lttng-consumerd/Makefile.am | 6 +++++- src/bin/lttng-relayd/Makefile.am | 9 ++++++++- src/bin/lttng-sessiond/Makefile.am | 6 +++++- tests/unit/Makefile.am | 18 +++++++++++++----- 5 files changed, 61 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 4f85fc1..eee025a 100644 --- a/configure.ac +++ b/configure.ac @@ -41,6 +41,12 @@ AS_IF([test "x$libtool_fixup" = "xyes"], AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno]) +AM_CONDITIONAL([TARGET_HOST_ANDROID], [false]) +case "${host}" in + *-*-linux-androideabi) AM_CONDITIONAL([TARGET_HOST_ANDROID], [true]) + ;; +esac + AC_CHECK_HEADERS([ \ sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \ signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \ @@ -108,12 +114,24 @@ AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sess # Check for pthread AC_CHECK_LIB([pthread], [pthread_create], [], - [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])] +[ + # Check for pthread in a bionic libc... + AC_CHECK_LIB([c], [pthread_create], [], + [ + AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.]) + ]) +] ) # Check libpopt AC_CHECK_LIB([popt], [poptGetContext], [], - [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])] +[ + # Check for libpopt in oprofile for Android + AC_CHECK_LIB([oprofile_popt], [poptGetContext], [], + [ + AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.]) + ]) +] ) # Check for libuuid @@ -130,7 +148,15 @@ AC_CHECK_LIB([uuid], [uuid_generate], have_libc_uuid=yes ], [ - AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.]) + # uuid_create not found in libc, check for bionic's impl in e2fsprog. + AC_CHECK_LIB([ext2_uuid], [uuid_generate], + [ + AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBEXT2_UUID], 1, [Has libext2_uuid uuid support.]) + have_libext2_uuid=yes + ], + [ + AC_MSG_ERROR([Cannot find libuuid uuid_generate, libc uuid_create nor libext2_uuid uuid_generate. Use [LDFLAGS]=-Ldir to specify their location.]) + ]) ]) ] ) @@ -175,7 +201,7 @@ AS_IF([test "x$lttng_ust_support" = "xyes"], [ lttng_ust_ctl_found=yes ], [AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])], - [-lurcu-common -lurcu-bp -lurcu-cds -lrt] + [-lurcu-common -lurcu-bp -lurcu-cds -lc -lrt] ) ]) AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes]) diff --git a/src/bin/lttng-consumerd/Makefile.am b/src/bin/lttng-consumerd/Makefile.am index a418eb4..c38590e 100644 --- a/src/bin/lttng-consumerd/Makefile.am +++ b/src/bin/lttng-consumerd/Makefile.am @@ -4,7 +4,7 @@ lttnglibexec_PROGRAMS = lttng-consumerd lttng_consumerd_SOURCES = lttng-consumerd.c lttng-consumerd.h -lttng_consumerd_LDADD = -lrt \ +lttng_consumerd_LDADD = \ $(top_builddir)/src/common/libconsumer.la \ $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ $(top_builddir)/src/common/libcommon.la @@ -12,3 +12,7 @@ lttng_consumerd_LDADD = -lrt \ if HAVE_LIBLTTNG_UST_CTL lttng_consumerd_LDADD += -llttng-ust-ctl endif + +if !TARGET_HOST_ANDROID +lttng_consumerd_LDADD += -lrt +endif diff --git a/src/bin/lttng-relayd/Makefile.am b/src/bin/lttng-relayd/Makefile.am index ed82144..cb9076a 100644 --- a/src/bin/lttng-relayd/Makefile.am +++ b/src/bin/lttng-relayd/Makefile.am @@ -11,10 +11,17 @@ lttng_relayd_SOURCES = main.c lttng-relayd.h utils.h utils.c cmd.h \ cmd-2-1.c cmd-2-1.h \ cmd-2-2.c cmd-2-2.h +if !TARGET_HOST_ANDROID +lttng_relayd_LDADD = -lrt +else +lttng_relayd_LDADD = +endif + # link on liblttngctl for check if relayd is already alive. -lttng_relayd_LDADD = -lrt -lurcu-common -lurcu \ +lttng_relayd_LDADD += -lurcu-common -lurcu \ $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ $(top_builddir)/src/common/hashtable/libhashtable.la \ $(top_builddir)/src/common/libcommon.la \ $(top_builddir)/src/common/compat/libcompat.la + diff --git a/src/bin/lttng-sessiond/Makefile.am b/src/bin/lttng-sessiond/Makefile.am index 244bc70..63e9555 100644 --- a/src/bin/lttng-sessiond/Makefile.am +++ b/src/bin/lttng-sessiond/Makefile.am @@ -37,7 +37,7 @@ endif lttng_sessiond_SOURCES += lttng-sessiond.h main.c # link on liblttngctl for check if sessiond is already alive. -lttng_sessiond_LDADD = -lrt -lurcu-common -lurcu \ +lttng_sessiond_LDADD = -lurcu-common -lurcu \ $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \ @@ -49,4 +49,8 @@ lttng_sessiond_LDADD = -lrt -lurcu-common -lurcu \ if HAVE_LIBLTTNG_UST_CTL lttng_sessiond_LDADD += -llttng-ust-ctl +endif + +if !TARGET_HOST_ANDROID +lttng_sessiond_LDADD += -lrt endif diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index c9e1bfc..3a59a7c 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -33,8 +33,7 @@ SESSIONS=$(top_srcdir)/src/bin/lttng-sessiond/session.c \ $(top_srcdir)/src/common/error.c test_session_SOURCES = test_session.c $(SESSIONS) -test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ - -lrt +test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) # UST data structures unit test if HAVE_LIBLTTNG_UST_CTL @@ -53,7 +52,11 @@ UST_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-ust.c \ test_ust_data_SOURCES = test_ust_data.c $(UST_DATA_TRACE) test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ - -lrt -llttng-ust-ctl + -llttng-ust-ctl +if !TARGET_HOST_ANDROID +test_ust_data_LDADD += -lrt +endif + endif # Kernel data structures unit test @@ -64,5 +67,10 @@ KERN_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-kernel.c \ $(top_srcdir)/src/common/utils.c test_kernel_data_SOURCES = test_kernel_data.c $(KERN_DATA_TRACE) -test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ - -lrt +test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) + +if !TARGET_HOST_ANDROID +test_session_LDADD += -lrt +test_kernel_data_LDADD += -lrt +endif + -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:10:52 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:10:52 +0000 Subject: [lttng-dev] [PATCH lttng-tools 02/14] Added a low-level endian conversion function check in configure.ac to add support for systems where only BSD-like 'betoh*(...)' functions are available (such as Android when compiling with Bionic). In-Reply-To: <1367863864-14680-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367863864-14680-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367863864-14680-2-git-send-email-charlesbriere.flatzo@gmail.com> From: Pierre-Luc St-Charles Signed-off-by: Pierre-Luc St-Charles --- configure.ac | 10 ++++++++++ src/bin/lttng-relayd/cmd-2-2.c | 1 + src/bin/lttng-relayd/main.c | 1 + src/common/compat/endian.h | 6 +++++- src/common/relayd/relayd.c | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index eee025a..618d203 100644 --- a/configure.ac +++ b/configure.ac @@ -123,6 +123,16 @@ AC_CHECK_LIB([pthread], [pthread_create], [], ] ) +# Check low-level endian compat functions +AC_CHECK_DECL(be64toh, [], +[ + AC_CHECK_DECL(betoh64, [AC_DEFINE_UNQUOTED([LTTNG_HAVE_BETOH64], 1, [Has BSD-style endian conversion operations.])], + [ + AC_MSG_ERROR([Cannot find be64toh, betoh64 or any similar functions.]) + ]) +] +) + # Check libpopt AC_CHECK_LIB([popt], [poptGetContext], [], [ diff --git a/src/bin/lttng-relayd/cmd-2-2.c b/src/bin/lttng-relayd/cmd-2-2.c index 0450fbf..09ff7f5 100644 --- a/src/bin/lttng-relayd/cmd-2-2.c +++ b/src/bin/lttng-relayd/cmd-2-2.c @@ -22,6 +22,7 @@ #include #include +#include #include "cmd-generic.h" #include "cmd-2-1.h" diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 9a2b3bd..0bf3ead 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/src/common/compat/endian.h b/src/common/compat/endian.h index 2850866..b7f66cc 100644 --- a/src/common/compat/endian.h +++ b/src/common/compat/endian.h @@ -15,11 +15,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifdef _COMPAT_ENDIAN_H +#ifndef _COMPAT_ENDIAN_H #define _COMPAT_ENDIAN_H #ifdef __linux__ #include +#ifdef LTTNG_HAVE_BETOH64 +#define be64toh(x) betoh64(x) +#define be32toh(x) betoh32(x) +#endif // LTTNG_HAVE_BETOH64 #elif defined(__FreeBSD__) #include #else diff --git a/src/common/relayd/relayd.c b/src/common/relayd/relayd.c index 82bcf5f..ba7bd13 100644 --- a/src/common/relayd/relayd.c +++ b/src/common/relayd/relayd.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "relayd.h" -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:38 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:38 +0000 Subject: [lttng-dev] [PATCH lttng-tools 01/14] Adding some checks for Android specific libraries to the configure step Message-ID: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Signed-off-by: Charles Briere --- configure.ac | 34 ++++++++++++++++++++++++++++++---- src/bin/lttng-consumerd/Makefile.am | 6 +++++- src/bin/lttng-relayd/Makefile.am | 9 ++++++++- src/bin/lttng-sessiond/Makefile.am | 6 +++++- tests/unit/Makefile.am | 18 +++++++++++++----- 5 files changed, 61 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 4f85fc1..eee025a 100644 --- a/configure.ac +++ b/configure.ac @@ -41,6 +41,12 @@ AS_IF([test "x$libtool_fixup" = "xyes"], AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno]) +AM_CONDITIONAL([TARGET_HOST_ANDROID], [false]) +case "${host}" in + *-*-linux-androideabi) AM_CONDITIONAL([TARGET_HOST_ANDROID], [true]) + ;; +esac + AC_CHECK_HEADERS([ \ sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \ signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \ @@ -108,12 +114,24 @@ AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sess # Check for pthread AC_CHECK_LIB([pthread], [pthread_create], [], - [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])] +[ + # Check for pthread in a bionic libc... + AC_CHECK_LIB([c], [pthread_create], [], + [ + AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.]) + ]) +] ) # Check libpopt AC_CHECK_LIB([popt], [poptGetContext], [], - [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])] +[ + # Check for libpopt in oprofile for Android + AC_CHECK_LIB([oprofile_popt], [poptGetContext], [], + [ + AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.]) + ]) +] ) # Check for libuuid @@ -130,7 +148,15 @@ AC_CHECK_LIB([uuid], [uuid_generate], have_libc_uuid=yes ], [ - AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.]) + # uuid_create not found in libc, check for bionic's impl in e2fsprog. + AC_CHECK_LIB([ext2_uuid], [uuid_generate], + [ + AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBEXT2_UUID], 1, [Has libext2_uuid uuid support.]) + have_libext2_uuid=yes + ], + [ + AC_MSG_ERROR([Cannot find libuuid uuid_generate, libc uuid_create nor libext2_uuid uuid_generate. Use [LDFLAGS]=-Ldir to specify their location.]) + ]) ]) ] ) @@ -175,7 +201,7 @@ AS_IF([test "x$lttng_ust_support" = "xyes"], [ lttng_ust_ctl_found=yes ], [AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])], - [-lurcu-common -lurcu-bp -lurcu-cds -lrt] + [-lurcu-common -lurcu-bp -lurcu-cds -lc -lrt] ) ]) AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes]) diff --git a/src/bin/lttng-consumerd/Makefile.am b/src/bin/lttng-consumerd/Makefile.am index a418eb4..c38590e 100644 --- a/src/bin/lttng-consumerd/Makefile.am +++ b/src/bin/lttng-consumerd/Makefile.am @@ -4,7 +4,7 @@ lttnglibexec_PROGRAMS = lttng-consumerd lttng_consumerd_SOURCES = lttng-consumerd.c lttng-consumerd.h -lttng_consumerd_LDADD = -lrt \ +lttng_consumerd_LDADD = \ $(top_builddir)/src/common/libconsumer.la \ $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ $(top_builddir)/src/common/libcommon.la @@ -12,3 +12,7 @@ lttng_consumerd_LDADD = -lrt \ if HAVE_LIBLTTNG_UST_CTL lttng_consumerd_LDADD += -llttng-ust-ctl endif + +if !TARGET_HOST_ANDROID +lttng_consumerd_LDADD += -lrt +endif diff --git a/src/bin/lttng-relayd/Makefile.am b/src/bin/lttng-relayd/Makefile.am index ed82144..cb9076a 100644 --- a/src/bin/lttng-relayd/Makefile.am +++ b/src/bin/lttng-relayd/Makefile.am @@ -11,10 +11,17 @@ lttng_relayd_SOURCES = main.c lttng-relayd.h utils.h utils.c cmd.h \ cmd-2-1.c cmd-2-1.h \ cmd-2-2.c cmd-2-2.h +if !TARGET_HOST_ANDROID +lttng_relayd_LDADD = -lrt +else +lttng_relayd_LDADD = +endif + # link on liblttngctl for check if relayd is already alive. -lttng_relayd_LDADD = -lrt -lurcu-common -lurcu \ +lttng_relayd_LDADD += -lurcu-common -lurcu \ $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ $(top_builddir)/src/common/hashtable/libhashtable.la \ $(top_builddir)/src/common/libcommon.la \ $(top_builddir)/src/common/compat/libcompat.la + diff --git a/src/bin/lttng-sessiond/Makefile.am b/src/bin/lttng-sessiond/Makefile.am index 244bc70..63e9555 100644 --- a/src/bin/lttng-sessiond/Makefile.am +++ b/src/bin/lttng-sessiond/Makefile.am @@ -37,7 +37,7 @@ endif lttng_sessiond_SOURCES += lttng-sessiond.h main.c # link on liblttngctl for check if sessiond is already alive. -lttng_sessiond_LDADD = -lrt -lurcu-common -lurcu \ +lttng_sessiond_LDADD = -lurcu-common -lurcu \ $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \ @@ -49,4 +49,8 @@ lttng_sessiond_LDADD = -lrt -lurcu-common -lurcu \ if HAVE_LIBLTTNG_UST_CTL lttng_sessiond_LDADD += -llttng-ust-ctl +endif + +if !TARGET_HOST_ANDROID +lttng_sessiond_LDADD += -lrt endif diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index c9e1bfc..3a59a7c 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -33,8 +33,7 @@ SESSIONS=$(top_srcdir)/src/bin/lttng-sessiond/session.c \ $(top_srcdir)/src/common/error.c test_session_SOURCES = test_session.c $(SESSIONS) -test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ - -lrt +test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) # UST data structures unit test if HAVE_LIBLTTNG_UST_CTL @@ -53,7 +52,11 @@ UST_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-ust.c \ test_ust_data_SOURCES = test_ust_data.c $(UST_DATA_TRACE) test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ - -lrt -llttng-ust-ctl + -llttng-ust-ctl +if !TARGET_HOST_ANDROID +test_ust_data_LDADD += -lrt +endif + endif # Kernel data structures unit test @@ -64,5 +67,10 @@ KERN_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-kernel.c \ $(top_srcdir)/src/common/utils.c test_kernel_data_SOURCES = test_kernel_data.c $(KERN_DATA_TRACE) -test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ - -lrt +test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) + +if !TARGET_HOST_ANDROID +test_session_LDADD += -lrt +test_kernel_data_LDADD += -lrt +endif + -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:39 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:39 +0000 Subject: [lttng-dev] [PATCH lttng-tools 02/14] Added a low-level endian conversion function check in configure.ac to add support for systems where only BSD-like 'betoh*(...)' functions are available (such as Android when compiling with Bionic). In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-2-git-send-email-charlesbriere.flatzo@gmail.com> From: Pierre-Luc St-Charles Signed-off-by: Pierre-Luc St-Charles --- configure.ac | 10 ++++++++++ src/bin/lttng-relayd/cmd-2-2.c | 1 + src/bin/lttng-relayd/main.c | 1 + src/common/compat/endian.h | 6 +++++- src/common/relayd/relayd.c | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index eee025a..618d203 100644 --- a/configure.ac +++ b/configure.ac @@ -123,6 +123,16 @@ AC_CHECK_LIB([pthread], [pthread_create], [], ] ) +# Check low-level endian compat functions +AC_CHECK_DECL(be64toh, [], +[ + AC_CHECK_DECL(betoh64, [AC_DEFINE_UNQUOTED([LTTNG_HAVE_BETOH64], 1, [Has BSD-style endian conversion operations.])], + [ + AC_MSG_ERROR([Cannot find be64toh, betoh64 or any similar functions.]) + ]) +] +) + # Check libpopt AC_CHECK_LIB([popt], [poptGetContext], [], [ diff --git a/src/bin/lttng-relayd/cmd-2-2.c b/src/bin/lttng-relayd/cmd-2-2.c index 0450fbf..09ff7f5 100644 --- a/src/bin/lttng-relayd/cmd-2-2.c +++ b/src/bin/lttng-relayd/cmd-2-2.c @@ -22,6 +22,7 @@ #include #include +#include #include "cmd-generic.h" #include "cmd-2-1.h" diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 9a2b3bd..0bf3ead 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include diff --git a/src/common/compat/endian.h b/src/common/compat/endian.h index 2850866..b7f66cc 100644 --- a/src/common/compat/endian.h +++ b/src/common/compat/endian.h @@ -15,11 +15,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifdef _COMPAT_ENDIAN_H +#ifndef _COMPAT_ENDIAN_H #define _COMPAT_ENDIAN_H #ifdef __linux__ #include +#ifdef LTTNG_HAVE_BETOH64 +#define be64toh(x) betoh64(x) +#define be32toh(x) betoh32(x) +#endif // LTTNG_HAVE_BETOH64 #elif defined(__FreeBSD__) #include #else diff --git a/src/common/relayd/relayd.c b/src/common/relayd/relayd.c index 82bcf5f..ba7bd13 100644 --- a/src/common/relayd/relayd.c +++ b/src/common/relayd/relayd.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "relayd.h" -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:40 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:40 +0000 Subject: [lttng-dev] [PATCH lttng-tools 03/14] Adding libext2_uuid support In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-3-git-send-email-charlesbriere.flatzo@gmail.com> Signed-off-by: Charles Briere --- configure.ac | 1 + src/common/Makefile.am | 5 +++++ src/common/compat/uuid.h | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 618d203..b78cc94 100644 --- a/configure.ac +++ b/configure.ac @@ -172,6 +172,7 @@ AC_CHECK_LIB([uuid], [uuid_generate], ) AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"]) AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"]) +AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBEXT2_UUID], [test "x$have_libext2_uuid" = "xyes"]) # URCU library version needed or newer liburcu_version=">= 0.7.2" diff --git a/src/common/Makefile.am b/src/common/Makefile.am index f2ea40a..6aa6c4a 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -14,7 +14,12 @@ noinst_LTLIBRARIES = libcommon.la libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \ common.h futex.c futex.h uri.c uri.h defaults.c + +if LTTNG_BUILD_WITH_LIBEXT2_UUID +libcommon_la_LIBADD = -lext2_uuid +else libcommon_la_LIBADD = -luuid +endif # Consumer library noinst_LTLIBRARIES += libconsumer.la diff --git a/src/common/compat/uuid.h b/src/common/compat/uuid.h index 35faf53..448d6bd 100644 --- a/src/common/compat/uuid.h +++ b/src/common/compat/uuid.h @@ -30,7 +30,7 @@ #define UUID_STR_LEN 37 #define UUID_LEN 16 -#ifdef LTTNG_HAVE_LIBUUID +#if defined(LTTNG_HAVE_LIBUUID) || defined(LTTNG_HAVE_LIBEXT2_UUID) #include /* -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:41 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:41 +0000 Subject: [lttng-dev] [PATCH lttng-tools 04/14] Adding epoll compat for Android and gettid check for presence on any arch In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-4-git-send-email-charlesbriere.flatzo@gmail.com> From: Pierre-Luc St-Charles Signed-off-by: Pierre-Luc St-Charles --- configure.ac | 6 ++++++ src/common/compat/poll.h | 13 +++++++++++++ src/common/compat/tid.h | 6 ++++++ src/common/uri.h | 6 ++++++ 4 files changed, 31 insertions(+) diff --git a/configure.ac b/configure.ac index b78cc94..eb79fc4 100644 --- a/configure.ac +++ b/configure.ac @@ -133,6 +133,12 @@ AC_CHECK_DECL(be64toh, [], ] ) +# Check if gettid() is already defined +AC_CHECK_DECL(gettid, +[ + AC_DEFINE_UNQUOTED([LTTNG_HAVE_GETTID], 1, [Has already gettid defined]) +]) + # Check libpopt AC_CHECK_LIB([popt], [poptGetContext], [], [ diff --git a/src/common/compat/poll.h b/src/common/compat/poll.h index 9e88976..3687c5d 100644 --- a/src/common/compat/poll.h +++ b/src/common/compat/poll.h @@ -52,6 +52,19 @@ static inline void __lttng_poll_free(void *events) #ifdef HAVE_EPOLL #include #include +#ifdef __ANDROID__ +#include +#ifndef EPOLLRDHUP +#define EPOLLRDHUP 0x2000 +#endif +#ifndef EPOLL_CLOEXEC +#define EPOLL_CLOEXEC 02000000 +#endif +static inline int epoll_create1(int flags) +{ + return syscall(__NR_epoll_create1,flags); +} +#endif /* __ANDROID__ */ /* See man epoll(7) for this define path */ #define COMPAT_EPOLL_PROC_PATH "/proc/sys/fs/epoll/max_user_watches" diff --git a/src/common/compat/tid.h b/src/common/compat/tid.h index 40f562f..81afa2b 100644 --- a/src/common/compat/tid.h +++ b/src/common/compat/tid.h @@ -26,17 +26,23 @@ #define LTTNG_TID_H #ifdef __linux__ +#ifdef __ANDROID__ +#include +#else #include +#endif // __ANDROID__ #endif #if defined(_syscall0) _syscall0(pid_t, gettid) #elif defined(__NR_gettid) #include +#ifndef LTTNG_HAVE_GETTID static inline pid_t gettid(void) { return syscall(__NR_gettid); } +#endif // LTTNG_HAVE_GETTID #else #include #include diff --git a/src/common/uri.h b/src/common/uri.h index 347b639..88a5e01 100644 --- a/src/common/uri.h +++ b/src/common/uri.h @@ -21,6 +21,12 @@ #include #include +#ifdef __ANDROID__ +#ifndef in_port_t +typedef uint16_t in_port_t; +#endif // in_port_t +#endif // __ANDROID__ + /* Destination type of lttng URI */ enum lttng_dst_type { LTTNG_DST_IPV4 = 1, -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:42 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:42 +0000 Subject: [lttng-dev] [PATCH lttng-tools 05/14] sys/un.h is already included in compat/socket.h and throws error if included before sock.h on Android. In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-5-git-send-email-charlesbriere.flatzo@gmail.com> Signed-off-by: Charles Briere --- src/common/sessiond-comm/unix.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/common/sessiond-comm/unix.h b/src/common/sessiond-comm/unix.h index 34f156f..0252f4f 100644 --- a/src/common/sessiond-comm/unix.h +++ b/src/common/sessiond-comm/unix.h @@ -20,7 +20,6 @@ #define _GNU_SOURCE #include -#include #include -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:43 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:43 +0000 Subject: [lttng-dev] [PATCH lttng-tools 06/14] Adding signal compat in order to implement missing functions on Android In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-6-git-send-email-charlesbriere.flatzo@gmail.com> Signed-off-by: Charles Briere --- src/common/compat/Makefile.am | 3 ++- src/common/compat/compat-signal.c | 14 ++++++++++++++ src/common/compat/signal.h | 14 ++++++++++++++ src/common/consumer-timer.c | 2 +- src/common/runas.c | 2 +- 5 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 src/common/compat/compat-signal.c create mode 100644 src/common/compat/signal.h diff --git a/src/common/compat/Makefile.am b/src/common/compat/Makefile.am index 537375b..124ef08 100644 --- a/src/common/compat/Makefile.am +++ b/src/common/compat/Makefile.am @@ -9,4 +9,5 @@ COMPAT=compat-poll.c endif libcompat_la_SOURCES = poll.h fcntl.h endian.h mman.h clone.h \ - socket.h compat-fcntl.c uuid.h tid.h $(COMPAT) + socket.h compat-fcntl.c uuid.h tid.h \ + compat-signal.c $(COMPAT) diff --git a/src/common/compat/compat-signal.c b/src/common/compat/compat-signal.c new file mode 100644 index 0000000..aba30db --- /dev/null +++ b/src/common/compat/compat-signal.c @@ -0,0 +1,14 @@ +#include "signal.h" +#ifdef __ANDROID__ +int __rt_sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *ts, long nr) { + return syscall(__NR_rt_sigtimedwait, set, info, ts, nr); +} + +int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *ts) { + return __rt_sigtimedwait(set,info,ts,_NSIG/8); +} + +int sigwaitinfo(const sigset_t *set, siginfo_t *info) { + return sigtimedwait(set, info, NULL); +} +#endif diff --git a/src/common/compat/signal.h b/src/common/compat/signal.h new file mode 100644 index 0000000..f7251d3 --- /dev/null +++ b/src/common/compat/signal.h @@ -0,0 +1,14 @@ +#ifndef LTTNG_COMPAT_SIGNAL_H +#define LTTNG_COMPAT_SIGNAL_H + +#include +#ifdef __ANDROID__ +#include +#include +#include +int __rt_sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *ts, long nr); +int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *ts); +int sigwaitinfo(const sigset_t *set, siginfo_t *info); +#endif // __ANDROID__ + +#endif //LTTNG_COMPAT_SIGNAL_H diff --git a/src/common/consumer-timer.c b/src/common/consumer-timer.c index ef056d1..0ae369f 100644 --- a/src/common/consumer-timer.c +++ b/src/common/consumer-timer.c @@ -19,8 +19,8 @@ #define _GNU_SOURCE #include #include -#include +#include #include #include "consumer-timer.h" diff --git a/src/common/runas.c b/src/common/runas.c index bd51cd4..0317cba 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -28,12 +28,12 @@ #include #include #include -#include #include #include #include #include +#include #include "runas.h" -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:44 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:44 +0000 Subject: [lttng-dev] [PATCH lttng-tools 07/14] Adding missing SPLICE syscall wrappers for Android In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-7-git-send-email-charlesbriere.flatzo@gmail.com> Signed-off-by: Charles Briere --- src/common/compat/fcntl.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/common/compat/fcntl.h b/src/common/compat/fcntl.h index 04fe03a..80a6899 100644 --- a/src/common/compat/fcntl.h +++ b/src/common/compat/fcntl.h @@ -31,6 +31,27 @@ typedef off64_t loff_t; #endif #ifdef __linux__ +#ifdef __ANDROID__ +#include +#include +#define SPLICE_F_MOVE (0x01) +#define SPLICE_F_NONBLOCK (0x02) +#define SPLICE_F_MORE (0x04) +#define SPLICE_F_GIFT (0x08) +static inline ssize_t splice(int fd_in, loff_t *off_in, int fd_out, + loff_t *off_out, size_t len, unsigned int flags) +{ + return syscall(__NR_splice,fd_in,off_in,fd_out,off_out,len,flags); +} +#include +#include +#define POSIX_FADV_DONTNEED 0 +static inline int posix_fadvise(int fd, off_t offset, off_t len, int advice) +{ + return -ENOSYS; +} +#endif /* __ANDROID__ */ + extern int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags); #define lttng_sync_file_range(fd, offset, nbytes, flags) \ -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:45 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:45 +0000 Subject: [lttng-dev] [PATCH lttng-tools 08/14] Added configure option for specifying lttng run directory [LTTNG_RUNDIR] Set different default run directory for Android In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-8-git-send-email-charlesbriere.flatzo@gmail.com> Signed-off-by: Charles Briere --- configure.ac | 23 +++++++++++++++++++++-- src/common/defaults.h | 2 -- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index eb79fc4..b3738d2 100644 --- a/configure.ac +++ b/configure.ac @@ -43,8 +43,10 @@ AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno]) AM_CONDITIONAL([TARGET_HOST_ANDROID], [false]) case "${host}" in - *-*-linux-androideabi) AM_CONDITIONAL([TARGET_HOST_ANDROID], [true]) - ;; + *-*-linux-androideabi) + AM_CONDITIONAL([TARGET_HOST_ANDROID], [true]) + target_host_android="yes" + ;; esac AC_CHECK_HEADERS([ \ @@ -256,6 +258,23 @@ AC_CHECK_LIB([c], [open_memstream], ] ) +AC_ARG_VAR([LTTNG_RUNDIR], [Path to run directory, default to /var/run]) + +AS_IF([test -n "$LTTNG_RUNDIR"], +[ + lttng_rundir=$LTTNG_RUNDIR +], +[ + AS_IF([test "x$target_host_android" = "xyes"], + [ + lttng_rundir="/data/lttng/var/run" + ], + [ + lttng_rundir="/var/run/lttng" + ]) +]) +AC_DEFINE_UNQUOTED([DEFAULT_LTTNG_RUNDIR], ["$lttng_rundir"], [Location of the run directory]) + # For Python # SWIG version needed or newer: swig_version=2.0.0 diff --git a/src/common/defaults.h b/src/common/defaults.h index fb6a975..74400d7 100644 --- a/src/common/defaults.h +++ b/src/common/defaults.h @@ -76,8 +76,6 @@ #define DEFAULT_USTCONSUMERD32_CMD_SOCK_PATH DEFAULT_USTCONSUMERD32_PATH "/command" #define DEFAULT_USTCONSUMERD32_ERR_SOCK_PATH DEFAULT_USTCONSUMERD32_PATH "/error" -/* Default lttng run directory */ -#define DEFAULT_LTTNG_RUNDIR "/var/run/lttng" #define DEFAULT_LTTNG_HOME_RUNDIR "%s/.lttng" #define DEFAULT_LTTNG_SESSIOND_PIDFILE "lttng-sessiond.pid" -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:46 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:46 +0000 Subject: [lttng-dev] [PATCH lttng-tools 09/14] Added ashmem framework support for ust apps and sessiond In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-9-git-send-email-charlesbriere.flatzo@gmail.com> From: Pierre-Luc St-Charles Signed-off-by: Pierre-Luc St-Charles --- src/bin/lttng-consumerd/lttng-consumerd.c | 6 +++ src/bin/lttng-sessiond/shm.c | 75 +++++++++++++++++++++++++++++++ src/bin/lttng-sessiond/shm.h | 16 +++++++ 3 files changed, 97 insertions(+) diff --git a/src/bin/lttng-consumerd/lttng-consumerd.c b/src/bin/lttng-consumerd/lttng-consumerd.c index edf1f15..cbd610c 100644 --- a/src/bin/lttng-consumerd/lttng-consumerd.c +++ b/src/bin/lttng-consumerd/lttng-consumerd.c @@ -28,7 +28,11 @@ #include #include #include +#ifdef __ANDROID__ +#include +#else #include +#endif #include #include #include @@ -39,7 +43,9 @@ #include #include #include +#ifndef __ANDROID__ #include +#endif #include #include diff --git a/src/bin/lttng-sessiond/shm.c b/src/bin/lttng-sessiond/shm.c index b94f4eb..80c7b6f 100644 --- a/src/bin/lttng-sessiond/shm.c +++ b/src/bin/lttng-sessiond/shm.c @@ -41,6 +41,8 @@ static int get_wait_shm(char *shm_path, size_t mmap_size, int global) { int wait_shm_fd, ret; + +#ifndef __ANDROID__ mode_t mode; assert(shm_path); @@ -114,6 +116,23 @@ static int get_wait_shm(char *shm_path, size_t mmap_size, int global) } #else #warning "FreeBSD does not support setting file mode on shm FD. Remember that for secure use, lttng-sessiond should be started before applications linked on lttng-ust." +#endif // !__ANDROID__ +#else + /* + * For ashmem, we must directly specify the ammount of mem we will need; + * also, once the memory region is opened, nobody can directly reopen or + * refer to it via its path (only via its fd). + */ + wait_shm_fd = ashmem_create_region(shm_path, mmap_size); + if (wait_shm_fd < 0) { + PERROR("shm_open wait shm [ashmem_create_region]"); + goto error; + } + ret = ashmem_set_prot_region(wait_shm_fd, PROT_READ | PROT_WRITE); + if (ret < 0) { + PERROR("shm_open wait shm [ashmem_create_region, ASHMEM_SET_NAME]"); + goto error; + } #endif DBG("Got the wait shm fd %d", wait_shm_fd); @@ -166,3 +185,59 @@ char *shm_ust_get_mmap(char *shm_path, int global) error: return NULL; } + +#ifdef __ANDROID__ +#ifdef _CUTILS_ASHMEM_NO_NDK_H +#include +#define ASHMEM_DEVICE "/dev/ashmem" +int ashmem_create_region(const char *name, size_t size) +{ + int fd, ret; + + fd = open(ASHMEM_DEVICE, O_RDWR); + if (fd < 0) + return fd; + + if (name) { + char buf[ASHMEM_NAME_LEN]; + + strlcpy(buf, name, sizeof(buf)); + ret = ioctl(fd, ASHMEM_SET_NAME, buf); + if (ret < 0) + goto error; + } + + ret = ioctl(fd, ASHMEM_SET_SIZE, size); + if (ret < 0) + goto error; + + return fd; + +error: + close(fd); + return ret; +} + +int ashmem_set_prot_region(int fd, int prot) +{ + return ioctl(fd, ASHMEM_SET_PROT_MASK, prot); +} + +int ashmem_pin_region(int fd, size_t offset, size_t len) +{ + struct ashmem_pin pin = { offset, len }; + return ioctl(fd, ASHMEM_PIN, &pin); +} + +int ashmem_unpin_region(int fd, size_t offset, size_t len) +{ + struct ashmem_pin pin = { offset, len }; + return ioctl(fd, ASHMEM_UNPIN, &pin); +} + +int ashmem_get_size_region(int fd) +{ + return ioctl(fd, ASHMEM_GET_SIZE, NULL); +} +#endif //_CUTILS_ASHMEM_NO_NDK_H +#endif //__ANDROID__ diff --git a/src/bin/lttng-sessiond/shm.h b/src/bin/lttng-sessiond/shm.h index bcce28b..abe965e 100644 --- a/src/bin/lttng-sessiond/shm.h +++ b/src/bin/lttng-sessiond/shm.h @@ -21,4 +21,20 @@ char *shm_ust_get_mmap(char *shm_path, int global); +#ifdef __ANDROID__ +/* + * Temporary fix for missing ashmem references when compiling with the NDK + * (instead of trying to port via Android makefiles) + */ +#ifndef _CUTILS_ASHMEM_H +#define _CUTILS_ASHMEM_H +#define _CUTILS_ASHMEM_NO_NDK_H +int ashmem_create_region(const char *name, size_t size); +int ashmem_set_prot_region(int fd, int prot); +int ashmem_pin_region(int fd, size_t offset, size_t len); +int ashmem_unpin_region(int fd, size_t offset, size_t len); +int ashmem_get_size_region(int fd); +#endif //_CUTILS_ASHMEM_H +#endif //__ANDROID__ + #endif /* _LTT_SHM_H */ -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:47 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:47 +0000 Subject: [lttng-dev] [PATCH lttng-tools 10/14] Added HOST_NAME_MAX definition to compat/socket.h if not already defined (which is the case for android) In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-10-git-send-email-charlesbriere.flatzo@gmail.com> From: Pierre-Luc St-Charles Signed-off-by: Pierre-Luc St-Charles --- src/bin/lttng-sessiond/consumer.c | 1 + src/bin/lttng-sessiond/ust-metadata.c | 1 + src/common/compat/socket.h | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index e3d1be0..98d79e4 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/src/bin/lttng-sessiond/ust-metadata.c b/src/bin/lttng-sessiond/ust-metadata.c index b0f83d2..28f4d1a 100644 --- a/src/bin/lttng-sessiond/ust-metadata.c +++ b/src/bin/lttng-sessiond/ust-metadata.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "ust-registry.h" #include "ust-clock.h" diff --git a/src/common/compat/socket.h b/src/common/compat/socket.h index 4d2925f..46aa9c5 100644 --- a/src/common/compat/socket.h +++ b/src/common/compat/socket.h @@ -23,6 +23,15 @@ #include +#ifndef HOST_NAME_MAX +/* + * On some platforms (such as Android), this define might not be + * exposed in any kernel headers; the most commonly assigned value + * is 64. This can be verified using getconf HOST_MAX_NAME. + */ +#define HOST_NAME_MAX 64 +#endif + #ifdef __linux__ #define LTTNG_SOCK_CREDS SCM_CREDENTIALS -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:48 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:48 +0000 Subject: [lttng-dev] [PATCH lttng-tools 11/14] Added configure.ac check for pthread_cond_timedwait_monotonic support (which is a non-standard pthread function) & usage handling in sessiond's main.c. In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-11-git-send-email-charlesbriere.flatzo@gmail.com> From: Michael Poupart Signed-off-by: Michael Poupart --- configure.ac | 17 +++++++++++++++++ src/bin/lttng-sessiond/main.c | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/configure.ac b/configure.ac index b3738d2..c405020 100644 --- a/configure.ac +++ b/configure.ac @@ -182,6 +182,23 @@ AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"]) AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"]) AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBEXT2_UUID], [test "x$have_libext2_uuid" = "xyes"]) +# Check for the non-standard pthread_cond_timedwait_monotonic function in lpthread/libc +AC_CHECK_LIB([pthread], [pthread_cond_timedwait_monotonic], +[ + have_pthread_cndtmwt_mono=yes +], +[ + AC_CHECK_LIB([c], [pthread_cond_timedwait_monotonic], + [ + have_pthread_cndtmwt_mono=yes + ]) +]) +AS_IF([test "x$have_pthread_cndtmwt_mono" = "xyes"], +[ + AC_DEFINE_UNQUOTED([LTTNG_HAVE_PTHREAD_CNDTMWT_MONO], 1, [Has non-standard pthread_cond_timedwait_monotonic support.]) +]) + + # URCU library version needed or newer liburcu_version=">= 0.7.2" diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index f6a051a..d8ff4c2 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -1732,6 +1732,7 @@ static int spawn_consumer_thread(struct consumer_data *consumer_data) goto error; } +#ifndef LTTNG_HAVE_PTHREAD_CNDTMWT_MONO /* * Set the monotonic clock in order to make sure we DO NOT jump in time * between the clock_gettime() call and the timedwait call. See bug #324 @@ -1743,6 +1744,7 @@ static int spawn_consumer_thread(struct consumer_data *consumer_data) PERROR("pthread_condattr_setclock consumer data"); goto error; } +#endif ret = pthread_cond_init(&consumer_data->cond, &consumer_data->condattr); if (ret != 0) { @@ -1792,8 +1794,13 @@ static int spawn_consumer_thread(struct consumer_data *consumer_data) ret = pthread_cond_wait(&consumer_data->cond, &consumer_data->cond_mutex); } else { +#ifdef LTTNG_HAVE_PTHREAD_CNDTMWT_MONO + ret = pthread_cond_timedwait_monotonic(&consumer_data->cond, + &consumer_data->cond_mutex, &timeout); +#else ret = pthread_cond_timedwait(&consumer_data->cond, &consumer_data->cond_mutex, &timeout); +#endif } } -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:49 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:49 +0000 Subject: [lttng-dev] [PATCH lttng-tools 12/14] Using pthread_kill instead of pthread_cancel (not a good idea but requried for now) In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-12-git-send-email-charlesbriere.flatzo@gmail.com> From: Pierre-Luc St-Charles Signed-off-by: Pierre-Luc St-Charles --- configure.ac | 18 ++++++++++++++++++ src/bin/lttng-sessiond/main.c | 8 ++++++++ 2 files changed, 26 insertions(+) diff --git a/configure.ac b/configure.ac index c405020..154b0a7 100644 --- a/configure.ac +++ b/configure.ac @@ -198,6 +198,24 @@ AS_IF([test "x$have_pthread_cndtmwt_mono" = "xyes"], AC_DEFINE_UNQUOTED([LTTNG_HAVE_PTHREAD_CNDTMWT_MONO], 1, [Has non-standard pthread_cond_timedwait_monotonic support.]) ]) +# Check for pthread_cancel support (which might not be present in lightweight versions of lpthread) +AC_CHECK_LIB([pthread], [pthread_cancel], +[ + have_pthread_cancel=yes +], +[ + AC_CHECK_LIB([c], [pthread_cancel], + [ + have_pthread_cancel=yes + ]) +]) +AS_IF([test "x$have_pthread_cancel" = "xyes"], +[ + AC_DEFINE_UNQUOTED([LTTNG_HAVE_PTHREAD_CANCEL], 1, [Has standard pthread_cancel support.]) +], +[ + AC_MSG_WARN([The targeted platform does not support pthread_cancel; defaulting to pthread_kill, but it might not be 100% safe.]) +]) # URCU library version needed or newer liburcu_version=">= 0.7.2" diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index d8ff4c2..73bdc0a 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -1816,10 +1816,18 @@ static int spawn_consumer_thread(struct consumer_data *consumer_data) */ ERR("Condition timed out. The consumer thread was never ready." " Killing it"); +#ifdef LTTNG_HAVE_PTHREAD_CANCEL ret = pthread_cancel(consumer_data->thread); if (ret < 0) { PERROR("pthread_cancel consumer thread"); } +#else + WARN("Using pthread_kill instead of pthread_cancel..."); + ret = pthread_kill(consumer_data->thread,SIGTERM); + if (ret < 0) { + PERROR("pthread_kill consumer thread"); + } +#endif } else { PERROR("pthread_cond_wait failed consumer thread"); } -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:50 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:50 +0000 Subject: [lttng-dev] [PATCH lttng-tools 13/14] Remove malloc in fscanf since it is not supported on all platforms. In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-13-git-send-email-charlesbriere.flatzo@gmail.com> From: Pierre-Luc St-Charles Signed-off-by: Pierre-Luc St-Charles --- src/bin/lttng-sessiond/kernel.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index 856d423..ed9e221 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -591,7 +591,7 @@ error: ssize_t kernel_list_events(int tracer_fd, struct lttng_event **events) { int fd, pos, ret; - char *event; + char event[LTTNG_SYMBOL_NAME_LEN]; size_t nbmem, count = 0; FILE *fp; struct lttng_event *elist; @@ -622,7 +622,7 @@ ssize_t kernel_list_events(int tracer_fd, struct lttng_event **events) goto end; } - while (fscanf(fp, "event { name = %m[^;]; };%n\n", &event, &pos) == 1) { + while (fscanf(fp, "event { name = %[^;]; };%n\n", &event, &pos) == 1) { if (count >= nbmem) { struct lttng_event *new_elist; @@ -633,7 +633,6 @@ ssize_t kernel_list_events(int tracer_fd, struct lttng_event **events) new_elist = realloc(elist, nbmem * sizeof(struct lttng_event)); if (new_elist == NULL) { PERROR("realloc list events"); - free(event); free(elist); count = -ENOMEM; goto end; @@ -644,7 +643,6 @@ ssize_t kernel_list_events(int tracer_fd, struct lttng_event **events) elist[count].name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0'; elist[count].enabled = -1; count++; - free(event); } *events = elist; -- 1.8.1.msysgit.1 From charlesbriere.flatzo at gmail.com Mon May 6 14:18:51 2013 From: charlesbriere.flatzo at gmail.com (Charles Briere) Date: Mon, 6 May 2013 18:18:51 +0000 Subject: [lttng-dev] [PATCH lttng-tools 14/14] Cleaned up configure.ac: Replaced space indents by tabs, regrouped AC_ARG_WITH's, generalized the coding style, fixed a bad AS_HELP_STRING. In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <1367864331-15212-14-git-send-email-charlesbriere.flatzo@gmail.com> From: Pierre-Luc St-Charles Signed-off-by: Pierre-Luc St-Charles --- configure.ac | 315 ++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 171 insertions(+), 144 deletions(-) diff --git a/configure.ac b/configure.ac index 154b0a7..e4d2c6f 100644 --- a/configure.ac +++ b/configure.ac @@ -17,27 +17,32 @@ AC_CONFIG_HEADERS([include/config.h]) AC_PROG_GREP # libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321. AC_ARG_ENABLE(libtool-linkdep-fixup, - AS_HELP_STRING([--disable-libtool-linkdep-fixup], - [disable the libtool fixup for linking all dependent libraries (link_all_deplibs)]), - libtool_fixup=$enableval, - libtool_fixup=yes) +[ + AS_HELP_STRING([--disable-libtool-linkdep-fixup],[disable the libtool fixup for linking all dependent libraries (link_all_deplibs)]) +], +[ + libtool_fixup=$enableval +], +[ + libtool_fixup=yes +]) AS_IF([test "x$libtool_fixup" = "xyes"], - [ - libtool_m4="$srcdir/config/libtool.m4" - libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)" - AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in $libtool_m4]) - libtool_flag_pattern_count=$(grep -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4) - AS_IF([test $libtool_flag_pattern_count -ne 0], - [ - AC_MSG_RESULT([$libtool_flag_pattern_count]) - AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown]) - sed -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4 - ], - [ - AC_MSG_RESULT([none]) - ]) - ]) +[ + libtool_m4="$srcdir/config/libtool.m4" + libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)" + AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in $libtool_m4]) + libtool_flag_pattern_count=$(grep -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4) + AS_IF([test $libtool_flag_pattern_count -ne 0], + [ + AC_MSG_RESULT([$libtool_flag_pattern_count]) + AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown]) + sed -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4 + ], + [ + AC_MSG_RESULT([none]) + ]) +]) AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno]) @@ -57,55 +62,55 @@ AC_CHECK_HEADERS([ \ # Babeltrace viewer check AC_ARG_WITH([babeltrace-bin], - AS_HELP_STRING([--with-babeltrace-bin], - [Location of the babeltrace viewer executable (including the filename)]), + AS_HELP_STRING([--with-babeltrace-bin], [Location of the babeltrace viewer executable (including the filename)]), [BABELTRACE_BIN="$withval"], [BABELTRACE_BIN='']) AC_SUBST([BABELTRACE_BIN]) # lttv-gui AC_ARG_WITH([lttv-gui-bin], - AS_HELP_STRING([--with-lttv-gui-bin], - [Location of the lttv GUI viewer executable (including the filename)]), - [LTTV_GUI_BIN="$withval"], - [LTTV_GUI_BIN='']) + AS_HELP_STRING([--with-lttv-gui-bin], [Location of the lttv GUI viewer executable (including the filename)]), + [LTTV_GUI_BIN="$withval"], + [LTTV_GUI_BIN='']) AC_SUBST([LTTV_GUI_BIN]) AC_ARG_WITH([consumerd32-bin], - AS_HELP_STRING([--with-consumerd32-bin], - [Location of the 32-bit consumerd executable (including the filename)]), + AS_HELP_STRING([--with-consumerd32-bin], [Location of the 32-bit consumerd executable (including the filename)]), [CONSUMERD32_BIN="$withval"], [CONSUMERD32_BIN='']) AC_SUBST([CONSUMERD32_BIN]) AC_ARG_WITH([consumerd64-bin], - AS_HELP_STRING([--with-consumerd64-bin], - [Location of the 64-bit consumerd executable (including the filename)]), + AS_HELP_STRING([--with-consumerd64-bin], [Location of the 64-bit consumerd executable (including the filename)]), [CONSUMERD64_BIN="$withval"], [CONSUMERD64_BIN='']) AC_SUBST([CONSUMERD64_BIN]) AC_ARG_WITH([consumerd32-libdir], - AS_HELP_STRING([--with-consumerd32-libdir], - [Directory containing the 32-bit consumerd libraries]), + AS_HELP_STRING([--with-consumerd32-libdir], [Directory containing the 32-bit consumerd libraries]), [CONSUMERD32_LIBDIR="$withval"], [CONSUMERD32_LIBDIR='']) AC_SUBST([CONSUMERD32_LIBDIR]) AC_ARG_WITH([consumerd64-libdir], - AS_HELP_STRING([--with-consumerd64-libdir], - [Directory containing the 64-bit consumerd libraries]), + AS_HELP_STRING([--with-consumerd64-libdir], [Directory containing the 64-bit consumerd libraries]), [CONSUMERD64_LIBDIR="$withval"], [CONSUMERD64_LIBDIR='']) AC_SUBST([CONSUMERD64_LIBDIR]) AC_ARG_WITH([sessiond-bin], - AS_HELP_STRING([--with-sessiond-bin], - [Location of the sessiond executable (including the filename)]), + AS_HELP_STRING([--with-sessiond-bin], [Location of the sessiond executable (including the filename)]), [SESSIOND_BIN="$withval"], [SESSIOND_BIN='']) AC_SUBST([SESSIOND_BIN]) +# Option to only build the consumer daemon and its libraries +AC_ARG_WITH([consumerd-only], + AS_HELP_STRING([--with-consumerd-only], [Only build the consumer daemon [default=no]]), + [consumerd_only=$withval], + [consumerd_only=no]) +AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"]) + AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.]) AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable]) AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.]) @@ -117,23 +122,24 @@ AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sess # Check for pthread AC_CHECK_LIB([pthread], [pthread_create], [], [ - # Check for pthread in a bionic libc... + # Check for pthread in a bionic libc... AC_CHECK_LIB([c], [pthread_create], [], [ - AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.]) + AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.]) ]) -] -) +]) # Check low-level endian compat functions AC_CHECK_DECL(be64toh, [], [ - AC_CHECK_DECL(betoh64, [AC_DEFINE_UNQUOTED([LTTNG_HAVE_BETOH64], 1, [Has BSD-style endian conversion operations.])], + AC_CHECK_DECL(betoh64, + [ + AC_DEFINE_UNQUOTED([LTTNG_HAVE_BETOH64], 1, [Has BSD-style endian conversion operations.]) + ], [ AC_MSG_ERROR([Cannot find be64toh, betoh64 or any similar functions.]) ]) -] -) +]) # Check if gettid() is already defined AC_CHECK_DECL(gettid, @@ -146,11 +152,10 @@ AC_CHECK_LIB([popt], [poptGetContext], [], [ # Check for libpopt in oprofile for Android AC_CHECK_LIB([oprofile_popt], [poptGetContext], [], - [ - AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.]) - ]) -] -) + [ + AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.]) + ]) +]) # Check for libuuid AC_CHECK_LIB([uuid], [uuid_generate], @@ -176,8 +181,7 @@ AC_CHECK_LIB([uuid], [uuid_generate], AC_MSG_ERROR([Cannot find libuuid uuid_generate, libc uuid_create nor libext2_uuid uuid_generate. Use [LDFLAGS]=-Ldir to specify their location.]) ]) ]) -] -) +]) AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"]) AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"]) AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBEXT2_UUID], [test "x$have_libext2_uuid" = "xyes"]) @@ -222,41 +226,59 @@ liburcu_version=">= 0.7.2" # Check liburcu needed function calls AC_CHECK_DECL([cds_list_add], [], - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] -) +[ + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] +]) AC_CHECK_DECL([cds_wfq_init], [], - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] -) +[ + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] +]) AC_CHECK_DECL([cds_wfq_dequeue_blocking], [], - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] -) +[ + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] +]) AC_CHECK_DECL([futex_async], [], - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] -) +[ + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] +]) AC_CHECK_DECL([rcu_thread_offline], [], - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] -) +[ + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] +]) AC_CHECK_DECL([rcu_thread_online], [], - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] -) +[ + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] +]) AC_CHECK_DECL([caa_likely], [], - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] -) +[ + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] +]) # Check liblttng-ust-ctl library AC_ARG_ENABLE(lttng-ust, - AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]), - lttng_ust_support=$enableval, lttng_ust_support=yes) +[ + AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]) +], +[ + lttng_ust_support=$enableval +], +[ + lttng_ust_support=yes +]) -AS_IF([test "x$lttng_ust_support" = "xyes"], [ +AS_IF([test "x$lttng_ust_support" = "xyes"], +[ AC_CHECK_LIB([lttng-ust-ctl], [ustctl_set_filter], - [ - AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support]) - lttng_ust_ctl_found=yes - ], - [AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])], - [-lurcu-common -lurcu-bp -lurcu-cds -lc -lrt] - ) + [ + AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support]) + lttng_ust_ctl_found=yes + ], + [ + AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.]) + ], + [ + -lurcu-common -lurcu-bp -lurcu-cds -lc -lrt + ]) ]) AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes]) AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range]) @@ -283,18 +305,15 @@ AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes" AC_CHECK_LIB([c], [fmemopen], [ AC_DEFINE_UNQUOTED([LTTNG_HAVE_FMEMOPEN], 1, [Has fmemopen support.]) -] -) +]) # Check for open_memstream AC_CHECK_LIB([c], [open_memstream], [ AC_DEFINE_UNQUOTED([LTTNG_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.]) -] -) +]) AC_ARG_VAR([LTTNG_RUNDIR], [Path to run directory, default to /var/run]) - AS_IF([test -n "$LTTNG_RUNDIR"], [ lttng_rundir=$LTTNG_RUNDIR @@ -315,54 +334,49 @@ AC_DEFINE_UNQUOTED([DEFAULT_LTTNG_RUNDIR], ["$lttng_rundir"], [Location of the r swig_version=2.0.0 AC_ARG_ENABLE([python-bindings], - [AC_HELP_STRING([--enable-python-bindings], - [compile Python bindings])], - [enable_python=yes], [enable_python=no]) +[ + AS_HELP_STRING([--enable-python-bindings], [compile Python bindings]) +], +[ + enable_python=yes +], +[ + enable_python=no +]) AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python:-yes}" = xyes]) if test "x${enable_python:-yes}" = xyes; then - AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ]) - AM_PATH_PYTHON - - AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config]) - AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) - AS_IF([test -z "$PYTHON_INCLUDE"], [ - AS_IF([test -z "$PYTHON_CONFIG"], [ - AC_PATH_PROGS([PYTHON_CONFIG], - [python$PYTHON_VERSION-config python-config], - [no], - [`dirname $PYTHON`]) - AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])]) - ]) - AC_MSG_CHECKING([python include flags]) - PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` - AC_MSG_RESULT([$PYTHON_INCLUDE]) - ]) - + AX_PKG_SWIG($swig_version, [], + [ + AC_MSG_ERROR([SWIG $swig_version or newer is needed]) + ]) + AM_PATH_PYTHON + AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config]) + AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) + AS_IF([test -z "$PYTHON_INCLUDE"], + [ + AS_IF([test -z "$PYTHON_CONFIG"], + [ + AC_PATH_PROGS([PYTHON_CONFIG], [python$PYTHON_VERSION-config python-config], [no], [`dirname $PYTHON`]) + AS_IF([test "$PYTHON_CONFIG" = no], + [ + AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?]) + ]) + ]) + AC_MSG_CHECKING([python include flags]) + PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` + AC_MSG_RESULT([$PYTHON_INCLUDE]) + ]) else - AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl -[if you want Python bindings.]) - + AC_MSG_NOTICE([You may configure with --enable-python-bindings if you want Python bindings.]) fi -# Option to only build the consumer daemon and its libraries -AC_ARG_WITH([consumerd-only], - AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]), - [consumerd_only=$withval], - [consumerd_only=no]) -AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"]) - # Epoll check. If not present, the build will fallback on poll() API -AX_HAVE_EPOLL( - [AX_CONFIG_FEATURE_ENABLE(epoll)], - [AX_CONFIG_FEATURE_DISABLE(epoll)] -) -AX_CONFIG_FEATURE( - [epoll], [This platform supports epoll(7)], - [HAVE_EPOLL], [This platform supports epoll(7).], - [enable_epoll="yes"], [enable_epoll="no"] -) +AX_HAVE_EPOLL([AX_CONFIG_FEATURE_ENABLE(epoll)],[AX_CONFIG_FEATURE_DISABLE(epoll)]) +AX_CONFIG_FEATURE([epoll], [This platform supports epoll(7)], + [HAVE_EPOLL], [This platform supports epoll(7).], + [enable_epoll="yes"], [enable_epoll="no"]) AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ]) AC_SYS_LARGEFILE @@ -455,37 +469,43 @@ AS_ECHO() # Target architecture we're building for target_arch=$host_cpu [ -for f in $CFLAGS; do - if test $f = "-m32"; then + for f in $CFLAGS; do + if test $f = "-m32"; then target_arch="32-bit" - elif test $f = "-m64"; then + elif test $f = "-m64"; then target_arch="64-bit" - fi -done + fi + done ] AS_ECHO_N("Target architecture: ") AS_ECHO($target_arch) # LTTng-UST enabled/disabled AS_ECHO_N("Lttng-UST support: ") -AS_IF([test "x$lttng_ust_support" = "xyes"],[ +AS_IF([test "x$lttng_ust_support" = "xyes"], +[ AS_ECHO("Enabled") -],[ +], +[ AS_ECHO("Disabled") ]) #Python binding enabled/disabled AS_ECHO_N("Python binding: ") -AS_IF([test "x${enable_python:-yes}" = xyes], [ +AS_IF([test "x${enable_python:-yes}" = xyes], +[ AS_ECHO("Enabled") -],[ +], +[ AS_ECHO("Disabled") ]) # Do we build only the consumerd, or everything -AS_IF([test "x$consumerd_only" = "xyes"],[ +AS_IF([test "x$consumerd_only" = "xyes"], +[ AS_ECHO("Only the consumerd daemon will be built.") -],[ +], +[ AS_ECHO("All binaries will be built.") ]) @@ -497,45 +517,52 @@ AS_ECHO_N("Libraries will be installed in: ") AS_ECHO("`eval eval echo $libdir`") # If we build the sessiond, print the paths it will use -AS_IF([test "x$consumerd_only" = "xno"],[ +AS_IF([test "x$consumerd_only" = "xno"], +[ AS_ECHO() AS_ECHO_N("The lttng command will look for the lttng-sessiond executable at: ") - AS_IF([test "$SESSIOND_BIN" = ""],[ + AS_IF([test "$SESSIOND_BIN" = ""], + [ AS_ECHO_N("`eval eval echo $bindir`") AS_ECHO("/lttng-sessiond") - ],[ + ], + [ AS_ECHO("$SESSIOND_BIN") ]) - AS_ECHO() AS_ECHO("The sessiond daemon will look in the following directories: ") AS_ECHO_N("32-bit consumerd executable at: ") - AS_IF([test "$CONSUMERD32_BIN" = ""],[ + AS_IF([test "$CONSUMERD32_BIN" = ""], + [ AS_ECHO_N("`eval eval echo $lttnglibexecdir`") AS_ECHO("/lttng-consumerd") - ],[ + ], + [ AS_ECHO("$CONSUMERD32_BIN") ]) - AS_ECHO_N("32-bit consumer libraries in: ") - AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[ + AS_IF([test "$CONSUMERD32_LIBDIR" = ""], + [ AS_ECHO("`eval eval echo $libdir`") - ],[ + ], + [ AS_ECHO("$CONSUMERD32_LIBDIR") ]) - AS_ECHO_N("64-bit consumerd executable at: ") - AS_IF([test "$CONSUMERD64_BIN" = ""],[ + AS_IF([test "$CONSUMERD64_BIN" = ""], + [ AS_ECHO_N("`eval eval echo $lttnglibexecdir`") AS_ECHO("/lttng-consumerd") - ],[ + ], + [ AS_ECHO("$CONSUMERD64_BIN") ]) - AS_ECHO_N("64-bit consumer libraries in: ") - AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[ + AS_IF([test "$CONSUMERD64_LIBDIR" = ""], + [ AS_ECHO("`eval eval echo $libdir`") - ],[ + ], + [ AS_ECHO("$CONSUMERD64_LIBDIR") ]) ]) -- 1.8.1.msysgit.1 From dgoulet at efficios.com Mon May 6 15:04:40 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 06 May 2013 15:04:40 -0400 Subject: [lttng-dev] [PATCH lttng-tools 02/14] Added a low-level endian conversion function check in configure.ac to add support for systems where only BSD-like 'betoh*(...)' functions are available (such as Android when compiling with Bionic). In-Reply-To: <1367864331-15212-2-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> <1367864331-15212-2-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <5187FEC8.4030707@efficios.com> Charles Briere: > From: Pierre-Luc St-Charles > > Signed-off-by: Pierre-Luc St-Charles > --- > configure.ac | 10 ++++++++++ > src/bin/lttng-relayd/cmd-2-2.c | 1 + > src/bin/lttng-relayd/main.c | 1 + > src/common/compat/endian.h | 6 +++++- > src/common/relayd/relayd.c | 1 + > 5 files changed, 18 insertions(+), 1 deletion(-) > > diff --git a/configure.ac b/configure.ac > index eee025a..618d203 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -123,6 +123,16 @@ AC_CHECK_LIB([pthread], [pthread_create], [], > ] > ) > > +# Check low-level endian compat functions > +AC_CHECK_DECL(be64toh, [], > +[ > + AC_CHECK_DECL(betoh64, [AC_DEFINE_UNQUOTED([LTTNG_HAVE_BETOH64], 1, [Has BSD-style endian conversion operations.])], > + [ > + AC_MSG_ERROR([Cannot find be64toh, betoh64 or any similar functions.]) > + ]) > +] > +) > + > # Check libpopt > AC_CHECK_LIB([popt], [poptGetContext], [], > [ > diff --git a/src/bin/lttng-relayd/cmd-2-2.c b/src/bin/lttng-relayd/cmd-2-2.c > index 0450fbf..09ff7f5 100644 > --- a/src/bin/lttng-relayd/cmd-2-2.c > +++ b/src/bin/lttng-relayd/cmd-2-2.c > @@ -22,6 +22,7 @@ > > #include > #include > +#include > > #include "cmd-generic.h" > #include "cmd-2-1.h" > diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c > index 9a2b3bd..0bf3ead 100644 > --- a/src/bin/lttng-relayd/main.c > +++ b/src/bin/lttng-relayd/main.c > @@ -43,6 +43,7 @@ > #include > #include > #include > +#include > #include > #include > #include > diff --git a/src/common/compat/endian.h b/src/common/compat/endian.h > index 2850866..b7f66cc 100644 > --- a/src/common/compat/endian.h > +++ b/src/common/compat/endian.h > @@ -15,11 +15,15 @@ > * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > */ > > -#ifdef _COMPAT_ENDIAN_H > +#ifndef _COMPAT_ENDIAN_H > #define _COMPAT_ENDIAN_H > > #ifdef __linux__ > #include > +#ifdef LTTNG_HAVE_BETOH64 > +#define be64toh(x) betoh64(x) > +#define be32toh(x) betoh32(x) > +#endif // LTTNG_HAVE_BETOH64 Please don't use "//" for comments and instead use /* */. It's used in some other patches so I'll only flag it once. Thanks! > #elif defined(__FreeBSD__) > #include > #else > diff --git a/src/common/relayd/relayd.c b/src/common/relayd/relayd.c > index 82bcf5f..ba7bd13 100644 > --- a/src/common/relayd/relayd.c > +++ b/src/common/relayd/relayd.c > @@ -26,6 +26,7 @@ > #include > #include > #include > +#include > > #include "relayd.h" > From dgoulet at efficios.com Mon May 6 15:08:46 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 06 May 2013 15:08:46 -0400 Subject: [lttng-dev] [PATCH lttng-tools 06/14] Adding signal compat in order to implement missing functions on Android In-Reply-To: <1367864331-15212-6-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> <1367864331-15212-6-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <5187FFBE.2000305@efficios.com> Charles Briere: > Signed-off-by: Charles Briere > --- > src/common/compat/Makefile.am | 3 ++- > src/common/compat/compat-signal.c | 14 ++++++++++++++ > src/common/compat/signal.h | 14 ++++++++++++++ > src/common/consumer-timer.c | 2 +- > src/common/runas.c | 2 +- > 5 files changed, 32 insertions(+), 3 deletions(-) > create mode 100644 src/common/compat/compat-signal.c > create mode 100644 src/common/compat/signal.h > > diff --git a/src/common/compat/Makefile.am b/src/common/compat/Makefile.am > index 537375b..124ef08 100644 > --- a/src/common/compat/Makefile.am > +++ b/src/common/compat/Makefile.am > @@ -9,4 +9,5 @@ COMPAT=compat-poll.c > endif > > libcompat_la_SOURCES = poll.h fcntl.h endian.h mman.h clone.h \ > - socket.h compat-fcntl.c uuid.h tid.h $(COMPAT) > + socket.h compat-fcntl.c uuid.h tid.h \ > + compat-signal.c $(COMPAT) > diff --git a/src/common/compat/compat-signal.c b/src/common/compat/compat-signal.c > new file mode 100644 > index 0000000..aba30db > --- /dev/null > +++ b/src/common/compat/compat-signal.c It does not seems that there is any license at the beginning of the file (same for the header). Please check other files in compat/ and simply copy the header and add your copyright. > @@ -0,0 +1,14 @@ > +#include "signal.h" > +#ifdef __ANDROID__ > +int __rt_sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *ts, long nr) { > + return syscall(__NR_rt_sigtimedwait, set, info, ts, nr); This seems like a "two spaces" rather than a tab. The whole code base uses tabs. Thanks! David > +} > + > +int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *ts) { > + return __rt_sigtimedwait(set,info,ts,_NSIG/8); > +} > + > +int sigwaitinfo(const sigset_t *set, siginfo_t *info) { > + return sigtimedwait(set, info, NULL); > +} > +#endif > diff --git a/src/common/compat/signal.h b/src/common/compat/signal.h > new file mode 100644 > index 0000000..f7251d3 > --- /dev/null > +++ b/src/common/compat/signal.h > @@ -0,0 +1,14 @@ > +#ifndef LTTNG_COMPAT_SIGNAL_H > +#define LTTNG_COMPAT_SIGNAL_H > + > +#include > +#ifdef __ANDROID__ > +#include > +#include > +#include > +int __rt_sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *ts, long nr); > +int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *ts); > +int sigwaitinfo(const sigset_t *set, siginfo_t *info); > +#endif // __ANDROID__ > + > +#endif //LTTNG_COMPAT_SIGNAL_H > diff --git a/src/common/consumer-timer.c b/src/common/consumer-timer.c > index ef056d1..0ae369f 100644 > --- a/src/common/consumer-timer.c > +++ b/src/common/consumer-timer.c > @@ -19,8 +19,8 @@ > #define _GNU_SOURCE > #include > #include > -#include > > +#include > #include > > #include "consumer-timer.h" > diff --git a/src/common/runas.c b/src/common/runas.c > index bd51cd4..0317cba 100644 > --- a/src/common/runas.c > +++ b/src/common/runas.c > @@ -28,12 +28,12 @@ > #include > #include > #include > -#include > > #include > #include > #include > #include > +#include > > #include "runas.h" > From dgoulet at efficios.com Mon May 6 15:21:59 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 06 May 2013 15:21:59 -0400 Subject: [lttng-dev] [PATCH lttng-tools 09/14] Added ashmem framework support for ust apps and sessiond In-Reply-To: <1367864331-15212-9-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> <1367864331-15212-9-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <518802D7.4080803@efficios.com> I'm wondering here if it's possible to make a compat layer for SHM. We *really* try to avoid #ifdef/#endif inside functions. This is basically what the compat layer was made for. Here maybe you could create a lttng_shm_open() (and other calls) wrapper that uses a compat call based on the OS. Charles Briere: > From: Pierre-Luc St-Charles > > Signed-off-by: Pierre-Luc St-Charles > --- > src/bin/lttng-consumerd/lttng-consumerd.c | 6 +++ > src/bin/lttng-sessiond/shm.c | 75 +++++++++++++++++++++++++++++++ > src/bin/lttng-sessiond/shm.h | 16 +++++++ > 3 files changed, 97 insertions(+) > > diff --git a/src/bin/lttng-consumerd/lttng-consumerd.c b/src/bin/lttng-consumerd/lttng-consumerd.c > index edf1f15..cbd610c 100644 > --- a/src/bin/lttng-consumerd/lttng-consumerd.c > +++ b/src/bin/lttng-consumerd/lttng-consumerd.c > @@ -28,7 +28,11 @@ > #include > #include > #include > +#ifdef __ANDROID__ > +#include > +#else > #include > +#endif > #include > #include > #include > @@ -39,7 +43,9 @@ > #include > #include > #include > +#ifndef __ANDROID__ > #include > +#endif > > #include > #include > diff --git a/src/bin/lttng-sessiond/shm.c b/src/bin/lttng-sessiond/shm.c > index b94f4eb..80c7b6f 100644 > --- a/src/bin/lttng-sessiond/shm.c > +++ b/src/bin/lttng-sessiond/shm.c > @@ -41,6 +41,8 @@ > static int get_wait_shm(char *shm_path, size_t mmap_size, int global) > { > int wait_shm_fd, ret; > + > +#ifndef __ANDROID__ > mode_t mode; > > assert(shm_path); > @@ -114,6 +116,23 @@ static int get_wait_shm(char *shm_path, size_t mmap_size, int global) > } > #else > #warning "FreeBSD does not support setting file mode on shm FD. Remember that for secure use, lttng-sessiond should be started before applications linked on lttng-ust." > +#endif // !__ANDROID__ > +#else > + /* > + * For ashmem, we must directly specify the ammount of mem we will need; > + * also, once the memory region is opened, nobody can directly reopen or > + * refer to it via its path (only via its fd). > + */ > + wait_shm_fd = ashmem_create_region(shm_path, mmap_size); > + if (wait_shm_fd < 0) { > + PERROR("shm_open wait shm [ashmem_create_region]"); > + goto error; > + } > + ret = ashmem_set_prot_region(wait_shm_fd, PROT_READ | PROT_WRITE); > + if (ret < 0) { > + PERROR("shm_open wait shm [ashmem_create_region, ASHMEM_SET_NAME]"); > + goto error; > + } > #endif > > DBG("Got the wait shm fd %d", wait_shm_fd); > @@ -166,3 +185,59 @@ char *shm_ust_get_mmap(char *shm_path, int global) > error: > return NULL; > } > + > +#ifdef __ANDROID__ > +#ifdef _CUTILS_ASHMEM_NO_NDK_H > +#include > +#define ASHMEM_DEVICE "/dev/ashmem" Document this function with at least the possible returned values. > +int ashmem_create_region(const char *name, size_t size) > +{ > + int fd, ret; > + > + fd = open(ASHMEM_DEVICE, O_RDWR); > + if (fd < 0) > + return fd; Add {} for the if statement and you should make a goto error_open that goes just after the close(fd) and return ret = -1. If you use gotos in your function, it's important to use them for all error path and not having both return and goto making the code more difficult to follow and prone to errors in the long term if this code changes for instance. (mem leaks, fd leaks, etc...). > + > + if (name) { > + char buf[ASHMEM_NAME_LEN]; > + > + strlcpy(buf, name, sizeof(buf)); > + ret = ioctl(fd, ASHMEM_SET_NAME, buf); > + if (ret < 0) > + goto error; Add {} and add a PERROR() here so we can track why this fails in verbose mode. > + } > + > + ret = ioctl(fd, ASHMEM_SET_SIZE, size); > + if (ret < 0) > + goto error; Same. > + > + return fd; > + > +error: > + close(fd); > + return ret; > +} > + > +int ashmem_set_prot_region(int fd, int prot) > +{ > + return ioctl(fd, ASHMEM_SET_PROT_MASK, prot); > +} > + > +int ashmem_pin_region(int fd, size_t offset, size_t len) > +{ > + struct ashmem_pin pin = { offset, len }; > + return ioctl(fd, ASHMEM_PIN, &pin); > +} > + > +int ashmem_unpin_region(int fd, size_t offset, size_t len) > +{ > + struct ashmem_pin pin = { offset, len }; > + return ioctl(fd, ASHMEM_UNPIN, &pin); > +} > + > +int ashmem_get_size_region(int fd) > +{ > + return ioctl(fd, ASHMEM_GET_SIZE, NULL); > +} > +#endif //_CUTILS_ASHMEM_NO_NDK_H > +#endif //__ANDROID__ > diff --git a/src/bin/lttng-sessiond/shm.h b/src/bin/lttng-sessiond/shm.h > index bcce28b..abe965e 100644 > --- a/src/bin/lttng-sessiond/shm.h > +++ b/src/bin/lttng-sessiond/shm.h > @@ -21,4 +21,20 @@ > > char *shm_ust_get_mmap(char *shm_path, int global); > > +#ifdef __ANDROID__ > +/* > + * Temporary fix for missing ashmem references when compiling with the NDK > + * (instead of trying to port via Android makefiles) > + */ > +#ifndef _CUTILS_ASHMEM_H > +#define _CUTILS_ASHMEM_H > +#define _CUTILS_ASHMEM_NO_NDK_H > +int ashmem_create_region(const char *name, size_t size); > +int ashmem_set_prot_region(int fd, int prot); > +int ashmem_pin_region(int fd, size_t offset, size_t len); > +int ashmem_unpin_region(int fd, size_t offset, size_t len); > +int ashmem_get_size_region(int fd); > +#endif //_CUTILS_ASHMEM_H > +#endif //__ANDROID__ > + > #endif /* _LTT_SHM_H */ From dgoulet at efficios.com Mon May 6 15:22:45 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 06 May 2013 15:22:45 -0400 Subject: [lttng-dev] [PATCH lttng-tools 11/14] Added configure.ac check for pthread_cond_timedwait_monotonic support (which is a non-standard pthread function) & usage handling in sessiond's main.c. In-Reply-To: <1367864331-15212-11-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> <1367864331-15212-11-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <51880305.3010308@efficios.com> A compat layer should be used here for pthread. Charles Briere: > From: Michael Poupart > > Signed-off-by: Michael Poupart > --- > configure.ac | 17 +++++++++++++++++ > src/bin/lttng-sessiond/main.c | 7 +++++++ > 2 files changed, 24 insertions(+) > > diff --git a/configure.ac b/configure.ac > index b3738d2..c405020 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -182,6 +182,23 @@ AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"]) > AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"]) > AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBEXT2_UUID], [test "x$have_libext2_uuid" = "xyes"]) > > +# Check for the non-standard pthread_cond_timedwait_monotonic function in lpthread/libc > +AC_CHECK_LIB([pthread], [pthread_cond_timedwait_monotonic], > +[ > + have_pthread_cndtmwt_mono=yes > +], > +[ > + AC_CHECK_LIB([c], [pthread_cond_timedwait_monotonic], > + [ > + have_pthread_cndtmwt_mono=yes > + ]) > +]) > +AS_IF([test "x$have_pthread_cndtmwt_mono" = "xyes"], > +[ > + AC_DEFINE_UNQUOTED([LTTNG_HAVE_PTHREAD_CNDTMWT_MONO], 1, [Has non-standard pthread_cond_timedwait_monotonic support.]) > +]) > + > + > # URCU library version needed or newer > liburcu_version=">= 0.7.2" > > diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c > index f6a051a..d8ff4c2 100644 > --- a/src/bin/lttng-sessiond/main.c > +++ b/src/bin/lttng-sessiond/main.c > @@ -1732,6 +1732,7 @@ static int spawn_consumer_thread(struct consumer_data *consumer_data) > goto error; > } > > +#ifndef LTTNG_HAVE_PTHREAD_CNDTMWT_MONO > /* > * Set the monotonic clock in order to make sure we DO NOT jump in time > * between the clock_gettime() call and the timedwait call. See bug #324 > @@ -1743,6 +1744,7 @@ static int spawn_consumer_thread(struct consumer_data *consumer_data) > PERROR("pthread_condattr_setclock consumer data"); > goto error; > } > +#endif > > ret = pthread_cond_init(&consumer_data->cond, &consumer_data->condattr); > if (ret != 0) { > @@ -1792,8 +1794,13 @@ static int spawn_consumer_thread(struct consumer_data *consumer_data) > ret = pthread_cond_wait(&consumer_data->cond, > &consumer_data->cond_mutex); > } else { > +#ifdef LTTNG_HAVE_PTHREAD_CNDTMWT_MONO > + ret = pthread_cond_timedwait_monotonic(&consumer_data->cond, > + &consumer_data->cond_mutex, &timeout); > +#else > ret = pthread_cond_timedwait(&consumer_data->cond, > &consumer_data->cond_mutex, &timeout); > +#endif > } > } > From dgoulet at efficios.com Mon May 6 15:22:58 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 06 May 2013 15:22:58 -0400 Subject: [lttng-dev] [PATCH lttng-tools 12/14] Using pthread_kill instead of pthread_cancel (not a good idea but requried for now) In-Reply-To: <1367864331-15212-12-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> <1367864331-15212-12-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <51880312.1050609@efficios.com> Same, should be put in a compat layer. Charles Briere: > From: Pierre-Luc St-Charles > > Signed-off-by: Pierre-Luc St-Charles > --- > configure.ac | 18 ++++++++++++++++++ > src/bin/lttng-sessiond/main.c | 8 ++++++++ > 2 files changed, 26 insertions(+) > > diff --git a/configure.ac b/configure.ac > index c405020..154b0a7 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -198,6 +198,24 @@ AS_IF([test "x$have_pthread_cndtmwt_mono" = "xyes"], > AC_DEFINE_UNQUOTED([LTTNG_HAVE_PTHREAD_CNDTMWT_MONO], 1, [Has non-standard pthread_cond_timedwait_monotonic support.]) > ]) > > +# Check for pthread_cancel support (which might not be present in lightweight versions of lpthread) > +AC_CHECK_LIB([pthread], [pthread_cancel], > +[ > + have_pthread_cancel=yes > +], > +[ > + AC_CHECK_LIB([c], [pthread_cancel], > + [ > + have_pthread_cancel=yes > + ]) > +]) > +AS_IF([test "x$have_pthread_cancel" = "xyes"], > +[ > + AC_DEFINE_UNQUOTED([LTTNG_HAVE_PTHREAD_CANCEL], 1, [Has standard pthread_cancel support.]) > +], > +[ > + AC_MSG_WARN([The targeted platform does not support pthread_cancel; defaulting to pthread_kill, but it might not be 100% safe.]) > +]) > > # URCU library version needed or newer > liburcu_version=">= 0.7.2" > diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c > index d8ff4c2..73bdc0a 100644 > --- a/src/bin/lttng-sessiond/main.c > +++ b/src/bin/lttng-sessiond/main.c > @@ -1816,10 +1816,18 @@ static int spawn_consumer_thread(struct consumer_data *consumer_data) > */ > ERR("Condition timed out. The consumer thread was never ready." > " Killing it"); > +#ifdef LTTNG_HAVE_PTHREAD_CANCEL > ret = pthread_cancel(consumer_data->thread); > if (ret < 0) { > PERROR("pthread_cancel consumer thread"); > } > +#else > + WARN("Using pthread_kill instead of pthread_cancel..."); > + ret = pthread_kill(consumer_data->thread,SIGTERM); > + if (ret < 0) { > + PERROR("pthread_kill consumer thread"); > + } > +#endif > } else { > PERROR("pthread_cond_wait failed consumer thread"); > } From dgoulet at efficios.com Mon May 6 15:24:06 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 06 May 2013 15:24:06 -0400 Subject: [lttng-dev] [PATCH lttng-tools 14/14] Cleaned up configure.ac: Replaced space indents by tabs, regrouped AC_ARG_WITH's, generalized the coding style, fixed a bad AS_HELP_STRING. In-Reply-To: <1367864331-15212-14-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> <1367864331-15212-14-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <51880356.4050009@efficios.com> Why? Thanks! David Charles Briere: > From: Pierre-Luc St-Charles > > Signed-off-by: Pierre-Luc St-Charles > --- > configure.ac | 315 ++++++++++++++++++++++++++++++++--------------------------- > 1 file changed, 171 insertions(+), 144 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 154b0a7..e4d2c6f 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -17,27 +17,32 @@ AC_CONFIG_HEADERS([include/config.h]) > AC_PROG_GREP > # libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321. > AC_ARG_ENABLE(libtool-linkdep-fixup, > - AS_HELP_STRING([--disable-libtool-linkdep-fixup], > - [disable the libtool fixup for linking all dependent libraries (link_all_deplibs)]), > - libtool_fixup=$enableval, > - libtool_fixup=yes) > +[ > + AS_HELP_STRING([--disable-libtool-linkdep-fixup],[disable the libtool fixup for linking all dependent libraries (link_all_deplibs)]) > +], > +[ > + libtool_fixup=$enableval > +], > +[ > + libtool_fixup=yes > +]) > > AS_IF([test "x$libtool_fixup" = "xyes"], > - [ > - libtool_m4="$srcdir/config/libtool.m4" > - libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)" > - AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in $libtool_m4]) > - libtool_flag_pattern_count=$(grep -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4) > - AS_IF([test $libtool_flag_pattern_count -ne 0], > - [ > - AC_MSG_RESULT([$libtool_flag_pattern_count]) > - AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown]) > - sed -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4 > - ], > - [ > - AC_MSG_RESULT([none]) > - ]) > - ]) > +[ > + libtool_m4="$srcdir/config/libtool.m4" > + libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)" > + AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in $libtool_m4]) > + libtool_flag_pattern_count=$(grep -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4) > + AS_IF([test $libtool_flag_pattern_count -ne 0], > + [ > + AC_MSG_RESULT([$libtool_flag_pattern_count]) > + AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown]) > + sed -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4 > + ], > + [ > + AC_MSG_RESULT([none]) > + ]) > +]) > > AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno]) > > @@ -57,55 +62,55 @@ AC_CHECK_HEADERS([ \ > > # Babeltrace viewer check > AC_ARG_WITH([babeltrace-bin], > - AS_HELP_STRING([--with-babeltrace-bin], > - [Location of the babeltrace viewer executable (including the filename)]), > + AS_HELP_STRING([--with-babeltrace-bin], [Location of the babeltrace viewer executable (including the filename)]), > [BABELTRACE_BIN="$withval"], > [BABELTRACE_BIN='']) > AC_SUBST([BABELTRACE_BIN]) > > # lttv-gui > AC_ARG_WITH([lttv-gui-bin], > - AS_HELP_STRING([--with-lttv-gui-bin], > - [Location of the lttv GUI viewer executable (including the filename)]), > - [LTTV_GUI_BIN="$withval"], > - [LTTV_GUI_BIN='']) > + AS_HELP_STRING([--with-lttv-gui-bin], [Location of the lttv GUI viewer executable (including the filename)]), > + [LTTV_GUI_BIN="$withval"], > + [LTTV_GUI_BIN='']) > AC_SUBST([LTTV_GUI_BIN]) > > AC_ARG_WITH([consumerd32-bin], > - AS_HELP_STRING([--with-consumerd32-bin], > - [Location of the 32-bit consumerd executable (including the filename)]), > + AS_HELP_STRING([--with-consumerd32-bin], [Location of the 32-bit consumerd executable (including the filename)]), > [CONSUMERD32_BIN="$withval"], > [CONSUMERD32_BIN='']) > AC_SUBST([CONSUMERD32_BIN]) > > AC_ARG_WITH([consumerd64-bin], > - AS_HELP_STRING([--with-consumerd64-bin], > - [Location of the 64-bit consumerd executable (including the filename)]), > + AS_HELP_STRING([--with-consumerd64-bin], [Location of the 64-bit consumerd executable (including the filename)]), > [CONSUMERD64_BIN="$withval"], > [CONSUMERD64_BIN='']) > AC_SUBST([CONSUMERD64_BIN]) > > AC_ARG_WITH([consumerd32-libdir], > - AS_HELP_STRING([--with-consumerd32-libdir], > - [Directory containing the 32-bit consumerd libraries]), > + AS_HELP_STRING([--with-consumerd32-libdir], [Directory containing the 32-bit consumerd libraries]), > [CONSUMERD32_LIBDIR="$withval"], > [CONSUMERD32_LIBDIR='']) > AC_SUBST([CONSUMERD32_LIBDIR]) > > AC_ARG_WITH([consumerd64-libdir], > - AS_HELP_STRING([--with-consumerd64-libdir], > - [Directory containing the 64-bit consumerd libraries]), > + AS_HELP_STRING([--with-consumerd64-libdir], [Directory containing the 64-bit consumerd libraries]), > [CONSUMERD64_LIBDIR="$withval"], > [CONSUMERD64_LIBDIR='']) > AC_SUBST([CONSUMERD64_LIBDIR]) > > AC_ARG_WITH([sessiond-bin], > - AS_HELP_STRING([--with-sessiond-bin], > - [Location of the sessiond executable (including the filename)]), > + AS_HELP_STRING([--with-sessiond-bin], [Location of the sessiond executable (including the filename)]), > [SESSIOND_BIN="$withval"], > [SESSIOND_BIN='']) > AC_SUBST([SESSIOND_BIN]) > > +# Option to only build the consumer daemon and its libraries > +AC_ARG_WITH([consumerd-only], > + AS_HELP_STRING([--with-consumerd-only], [Only build the consumer daemon [default=no]]), > + [consumerd_only=$withval], > + [consumerd_only=no]) > +AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"]) > + > AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.]) > AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable]) > AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.]) > @@ -117,23 +122,24 @@ AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sess > # Check for pthread > AC_CHECK_LIB([pthread], [pthread_create], [], > [ > - # Check for pthread in a bionic libc... > + # Check for pthread in a bionic libc... > AC_CHECK_LIB([c], [pthread_create], [], > [ > - AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.]) > + AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.]) > ]) > -] > -) > +]) > > # Check low-level endian compat functions > AC_CHECK_DECL(be64toh, [], > [ > - AC_CHECK_DECL(betoh64, [AC_DEFINE_UNQUOTED([LTTNG_HAVE_BETOH64], 1, [Has BSD-style endian conversion operations.])], > + AC_CHECK_DECL(betoh64, > + [ > + AC_DEFINE_UNQUOTED([LTTNG_HAVE_BETOH64], 1, [Has BSD-style endian conversion operations.]) > + ], > [ > AC_MSG_ERROR([Cannot find be64toh, betoh64 or any similar functions.]) > ]) > -] > -) > +]) > > # Check if gettid() is already defined > AC_CHECK_DECL(gettid, > @@ -146,11 +152,10 @@ AC_CHECK_LIB([popt], [poptGetContext], [], > [ > # Check for libpopt in oprofile for Android > AC_CHECK_LIB([oprofile_popt], [poptGetContext], [], > - [ > - AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.]) > - ]) > -] > -) > + [ > + AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.]) > + ]) > +]) > > # Check for libuuid > AC_CHECK_LIB([uuid], [uuid_generate], > @@ -176,8 +181,7 @@ AC_CHECK_LIB([uuid], [uuid_generate], > AC_MSG_ERROR([Cannot find libuuid uuid_generate, libc uuid_create nor libext2_uuid uuid_generate. Use [LDFLAGS]=-Ldir to specify their location.]) > ]) > ]) > -] > -) > +]) > AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"]) > AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"]) > AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBEXT2_UUID], [test "x$have_libext2_uuid" = "xyes"]) > @@ -222,41 +226,59 @@ liburcu_version=">= 0.7.2" > > # Check liburcu needed function calls > AC_CHECK_DECL([cds_list_add], [], > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > -) > +[ > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > +]) > AC_CHECK_DECL([cds_wfq_init], [], > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > -) > +[ > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > +]) > AC_CHECK_DECL([cds_wfq_dequeue_blocking], [], > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > -) > +[ > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > +]) > AC_CHECK_DECL([futex_async], [], > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > -) > +[ > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > +]) > AC_CHECK_DECL([rcu_thread_offline], [], > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > -) > +[ > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > +]) > AC_CHECK_DECL([rcu_thread_online], [], > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > -) > +[ > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > +]) > AC_CHECK_DECL([caa_likely], [], > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > -) > +[ > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > +]) > > # Check liblttng-ust-ctl library > AC_ARG_ENABLE(lttng-ust, > - AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]), > - lttng_ust_support=$enableval, lttng_ust_support=yes) > +[ > + AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]) > +], > +[ > + lttng_ust_support=$enableval > +], > +[ > + lttng_ust_support=yes > +]) > > -AS_IF([test "x$lttng_ust_support" = "xyes"], [ > +AS_IF([test "x$lttng_ust_support" = "xyes"], > +[ > AC_CHECK_LIB([lttng-ust-ctl], [ustctl_set_filter], > - [ > - AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support]) > - lttng_ust_ctl_found=yes > - ], > - [AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])], > - [-lurcu-common -lurcu-bp -lurcu-cds -lc -lrt] > - ) > + [ > + AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support]) > + lttng_ust_ctl_found=yes > + ], > + [ > + AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.]) > + ], > + [ > + -lurcu-common -lurcu-bp -lurcu-cds -lc -lrt > + ]) > ]) > AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes]) > AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range]) > @@ -283,18 +305,15 @@ AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes" > AC_CHECK_LIB([c], [fmemopen], > [ > AC_DEFINE_UNQUOTED([LTTNG_HAVE_FMEMOPEN], 1, [Has fmemopen support.]) > -] > -) > +]) > > # Check for open_memstream > AC_CHECK_LIB([c], [open_memstream], > [ > AC_DEFINE_UNQUOTED([LTTNG_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.]) > -] > -) > +]) > > AC_ARG_VAR([LTTNG_RUNDIR], [Path to run directory, default to /var/run]) > - > AS_IF([test -n "$LTTNG_RUNDIR"], > [ > lttng_rundir=$LTTNG_RUNDIR > @@ -315,54 +334,49 @@ AC_DEFINE_UNQUOTED([DEFAULT_LTTNG_RUNDIR], ["$lttng_rundir"], [Location of the r > swig_version=2.0.0 > > AC_ARG_ENABLE([python-bindings], > - [AC_HELP_STRING([--enable-python-bindings], > - [compile Python bindings])], > - [enable_python=yes], [enable_python=no]) > +[ > + AS_HELP_STRING([--enable-python-bindings], [compile Python bindings]) > +], > +[ > + enable_python=yes > +], > +[ > + enable_python=no > +]) > > AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python:-yes}" = xyes]) > > if test "x${enable_python:-yes}" = xyes; then > - AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ]) > - AM_PATH_PYTHON > - > - AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config]) > - AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) > - AS_IF([test -z "$PYTHON_INCLUDE"], [ > - AS_IF([test -z "$PYTHON_CONFIG"], [ > - AC_PATH_PROGS([PYTHON_CONFIG], > - [python$PYTHON_VERSION-config python-config], > - [no], > - [`dirname $PYTHON`]) > - AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])]) > - ]) > - AC_MSG_CHECKING([python include flags]) > - PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` > - AC_MSG_RESULT([$PYTHON_INCLUDE]) > - ]) > - > + AX_PKG_SWIG($swig_version, [], > + [ > + AC_MSG_ERROR([SWIG $swig_version or newer is needed]) > + ]) > + AM_PATH_PYTHON > + AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config]) > + AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) > + AS_IF([test -z "$PYTHON_INCLUDE"], > + [ > + AS_IF([test -z "$PYTHON_CONFIG"], > + [ > + AC_PATH_PROGS([PYTHON_CONFIG], [python$PYTHON_VERSION-config python-config], [no], [`dirname $PYTHON`]) > + AS_IF([test "$PYTHON_CONFIG" = no], > + [ > + AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?]) > + ]) > + ]) > + AC_MSG_CHECKING([python include flags]) > + PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` > + AC_MSG_RESULT([$PYTHON_INCLUDE]) > + ]) > else > - AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl > -[if you want Python bindings.]) > - > + AC_MSG_NOTICE([You may configure with --enable-python-bindings if you want Python bindings.]) > fi > > -# Option to only build the consumer daemon and its libraries > -AC_ARG_WITH([consumerd-only], > - AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]), > - [consumerd_only=$withval], > - [consumerd_only=no]) > -AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"]) > - > # Epoll check. If not present, the build will fallback on poll() API > -AX_HAVE_EPOLL( > - [AX_CONFIG_FEATURE_ENABLE(epoll)], > - [AX_CONFIG_FEATURE_DISABLE(epoll)] > -) > -AX_CONFIG_FEATURE( > - [epoll], [This platform supports epoll(7)], > - [HAVE_EPOLL], [This platform supports epoll(7).], > - [enable_epoll="yes"], [enable_epoll="no"] > -) > +AX_HAVE_EPOLL([AX_CONFIG_FEATURE_ENABLE(epoll)],[AX_CONFIG_FEATURE_DISABLE(epoll)]) > +AX_CONFIG_FEATURE([epoll], [This platform supports epoll(7)], > + [HAVE_EPOLL], [This platform supports epoll(7).], > + [enable_epoll="yes"], [enable_epoll="no"]) > AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ]) > > AC_SYS_LARGEFILE > @@ -455,37 +469,43 @@ AS_ECHO() > # Target architecture we're building for > target_arch=$host_cpu > [ > -for f in $CFLAGS; do > - if test $f = "-m32"; then > + for f in $CFLAGS; do > + if test $f = "-m32"; then > target_arch="32-bit" > - elif test $f = "-m64"; then > + elif test $f = "-m64"; then > target_arch="64-bit" > - fi > -done > + fi > + done > ] > AS_ECHO_N("Target architecture: ") > AS_ECHO($target_arch) > > # LTTng-UST enabled/disabled > AS_ECHO_N("Lttng-UST support: ") > -AS_IF([test "x$lttng_ust_support" = "xyes"],[ > +AS_IF([test "x$lttng_ust_support" = "xyes"], > +[ > AS_ECHO("Enabled") > -],[ > +], > +[ > AS_ECHO("Disabled") > ]) > > #Python binding enabled/disabled > AS_ECHO_N("Python binding: ") > -AS_IF([test "x${enable_python:-yes}" = xyes], [ > +AS_IF([test "x${enable_python:-yes}" = xyes], > +[ > AS_ECHO("Enabled") > -],[ > +], > +[ > AS_ECHO("Disabled") > ]) > > # Do we build only the consumerd, or everything > -AS_IF([test "x$consumerd_only" = "xyes"],[ > +AS_IF([test "x$consumerd_only" = "xyes"], > +[ > AS_ECHO("Only the consumerd daemon will be built.") > -],[ > +], > +[ > AS_ECHO("All binaries will be built.") > ]) > > @@ -497,45 +517,52 @@ AS_ECHO_N("Libraries will be installed in: ") > AS_ECHO("`eval eval echo $libdir`") > > # If we build the sessiond, print the paths it will use > -AS_IF([test "x$consumerd_only" = "xno"],[ > +AS_IF([test "x$consumerd_only" = "xno"], > +[ > AS_ECHO() > AS_ECHO_N("The lttng command will look for the lttng-sessiond executable at: ") > - AS_IF([test "$SESSIOND_BIN" = ""],[ > + AS_IF([test "$SESSIOND_BIN" = ""], > + [ > AS_ECHO_N("`eval eval echo $bindir`") > AS_ECHO("/lttng-sessiond") > - ],[ > + ], > + [ > AS_ECHO("$SESSIOND_BIN") > ]) > - > AS_ECHO() > AS_ECHO("The sessiond daemon will look in the following directories: ") > AS_ECHO_N("32-bit consumerd executable at: ") > - AS_IF([test "$CONSUMERD32_BIN" = ""],[ > + AS_IF([test "$CONSUMERD32_BIN" = ""], > + [ > AS_ECHO_N("`eval eval echo $lttnglibexecdir`") > AS_ECHO("/lttng-consumerd") > - ],[ > + ], > + [ > AS_ECHO("$CONSUMERD32_BIN") > ]) > - > AS_ECHO_N("32-bit consumer libraries in: ") > - AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[ > + AS_IF([test "$CONSUMERD32_LIBDIR" = ""], > + [ > AS_ECHO("`eval eval echo $libdir`") > - ],[ > + ], > + [ > AS_ECHO("$CONSUMERD32_LIBDIR") > ]) > - > AS_ECHO_N("64-bit consumerd executable at: ") > - AS_IF([test "$CONSUMERD64_BIN" = ""],[ > + AS_IF([test "$CONSUMERD64_BIN" = ""], > + [ > AS_ECHO_N("`eval eval echo $lttnglibexecdir`") > AS_ECHO("/lttng-consumerd") > - ],[ > + ], > + [ > AS_ECHO("$CONSUMERD64_BIN") > ]) > - > AS_ECHO_N("64-bit consumer libraries in: ") > - AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[ > + AS_IF([test "$CONSUMERD64_LIBDIR" = ""], > + [ > AS_ECHO("`eval eval echo $libdir`") > - ],[ > + ], > + [ > AS_ECHO("$CONSUMERD64_LIBDIR") > ]) > ]) From dgoulet at efficios.com Mon May 6 15:24:09 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 06 May 2013 15:24:09 -0400 Subject: [lttng-dev] [PATCH lttng-tools 01/14] Adding some checks for Android specific libraries to the configure step In-Reply-To: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> Message-ID: <51880359.7020200@efficios.com> Hi Charles, These patches does not apply on git HEAD master... Can you rebase and send me back the patches? I also just sent some comments on most of them. Since master is moving quite a bit these days, once rebased, send the commit id you've been applying these on. Thanks! David Charles Briere: > Signed-off-by: Charles Briere > --- > configure.ac | 34 ++++++++++++++++++++++++++++++---- > src/bin/lttng-consumerd/Makefile.am | 6 +++++- > src/bin/lttng-relayd/Makefile.am | 9 ++++++++- > src/bin/lttng-sessiond/Makefile.am | 6 +++++- > tests/unit/Makefile.am | 18 +++++++++++++----- > 5 files changed, 61 insertions(+), 12 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 4f85fc1..eee025a 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -41,6 +41,12 @@ AS_IF([test "x$libtool_fixup" = "xyes"], > > AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno]) > > +AM_CONDITIONAL([TARGET_HOST_ANDROID], [false]) > +case "${host}" in > + *-*-linux-androideabi) AM_CONDITIONAL([TARGET_HOST_ANDROID], [true]) > + ;; > +esac > + > AC_CHECK_HEADERS([ \ > sys/types.h unistd.h fcntl.h string.h pthread.h limits.h \ > signal.h stdlib.h sys/un.h sys/socket.h stdlib.h stdio.h \ > @@ -108,12 +114,24 @@ AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sess > > # Check for pthread > AC_CHECK_LIB([pthread], [pthread_create], [], > - [AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.])] > +[ > + # Check for pthread in a bionic libc... > + AC_CHECK_LIB([c], [pthread_create], [], > + [ > + AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.]) > + ]) > +] > ) > > # Check libpopt > AC_CHECK_LIB([popt], [poptGetContext], [], > - [AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.])] > +[ > + # Check for libpopt in oprofile for Android > + AC_CHECK_LIB([oprofile_popt], [poptGetContext], [], > + [ > + AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.]) > + ]) > +] > ) > > # Check for libuuid > @@ -130,7 +148,15 @@ AC_CHECK_LIB([uuid], [uuid_generate], > have_libc_uuid=yes > ], > [ > - AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.]) > + # uuid_create not found in libc, check for bionic's impl in e2fsprog. > + AC_CHECK_LIB([ext2_uuid], [uuid_generate], > + [ > + AC_DEFINE_UNQUOTED([LTTNG_HAVE_LIBEXT2_UUID], 1, [Has libext2_uuid uuid support.]) > + have_libext2_uuid=yes > + ], > + [ > + AC_MSG_ERROR([Cannot find libuuid uuid_generate, libc uuid_create nor libext2_uuid uuid_generate. Use [LDFLAGS]=-Ldir to specify their location.]) > + ]) > ]) > ] > ) > @@ -175,7 +201,7 @@ AS_IF([test "x$lttng_ust_support" = "xyes"], [ > lttng_ust_ctl_found=yes > ], > [AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])], > - [-lurcu-common -lurcu-bp -lurcu-cds -lrt] > + [-lurcu-common -lurcu-bp -lurcu-cds -lc -lrt] > ) > ]) > AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes]) > diff --git a/src/bin/lttng-consumerd/Makefile.am b/src/bin/lttng-consumerd/Makefile.am > index a418eb4..c38590e 100644 > --- a/src/bin/lttng-consumerd/Makefile.am > +++ b/src/bin/lttng-consumerd/Makefile.am > @@ -4,7 +4,7 @@ lttnglibexec_PROGRAMS = lttng-consumerd > > lttng_consumerd_SOURCES = lttng-consumerd.c lttng-consumerd.h > > -lttng_consumerd_LDADD = -lrt \ > +lttng_consumerd_LDADD = \ > $(top_builddir)/src/common/libconsumer.la \ > $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ > $(top_builddir)/src/common/libcommon.la > @@ -12,3 +12,7 @@ lttng_consumerd_LDADD = -lrt \ > if HAVE_LIBLTTNG_UST_CTL > lttng_consumerd_LDADD += -llttng-ust-ctl > endif > + > +if !TARGET_HOST_ANDROID > +lttng_consumerd_LDADD += -lrt > +endif > diff --git a/src/bin/lttng-relayd/Makefile.am b/src/bin/lttng-relayd/Makefile.am > index ed82144..cb9076a 100644 > --- a/src/bin/lttng-relayd/Makefile.am > +++ b/src/bin/lttng-relayd/Makefile.am > @@ -11,10 +11,17 @@ lttng_relayd_SOURCES = main.c lttng-relayd.h utils.h utils.c cmd.h \ > cmd-2-1.c cmd-2-1.h \ > cmd-2-2.c cmd-2-2.h > > +if !TARGET_HOST_ANDROID > +lttng_relayd_LDADD = -lrt > +else > +lttng_relayd_LDADD = > +endif > + > # link on liblttngctl for check if relayd is already alive. > -lttng_relayd_LDADD = -lrt -lurcu-common -lurcu \ > +lttng_relayd_LDADD += -lurcu-common -lurcu \ > $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ > $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ > $(top_builddir)/src/common/hashtable/libhashtable.la \ > $(top_builddir)/src/common/libcommon.la \ > $(top_builddir)/src/common/compat/libcompat.la > + > diff --git a/src/bin/lttng-sessiond/Makefile.am b/src/bin/lttng-sessiond/Makefile.am > index 244bc70..63e9555 100644 > --- a/src/bin/lttng-sessiond/Makefile.am > +++ b/src/bin/lttng-sessiond/Makefile.am > @@ -37,7 +37,7 @@ endif > lttng_sessiond_SOURCES += lttng-sessiond.h main.c > > # link on liblttngctl for check if sessiond is already alive. > -lttng_sessiond_LDADD = -lrt -lurcu-common -lurcu \ > +lttng_sessiond_LDADD = -lurcu-common -lurcu \ > $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ > $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ > $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \ > @@ -49,4 +49,8 @@ lttng_sessiond_LDADD = -lrt -lurcu-common -lurcu \ > > if HAVE_LIBLTTNG_UST_CTL > lttng_sessiond_LDADD += -llttng-ust-ctl > +endif > + > +if !TARGET_HOST_ANDROID > +lttng_sessiond_LDADD += -lrt > endif > diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am > index c9e1bfc..3a59a7c 100644 > --- a/tests/unit/Makefile.am > +++ b/tests/unit/Makefile.am > @@ -33,8 +33,7 @@ SESSIONS=$(top_srcdir)/src/bin/lttng-sessiond/session.c \ > $(top_srcdir)/src/common/error.c > > test_session_SOURCES = test_session.c $(SESSIONS) > -test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ > - -lrt > +test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) > > # UST data structures unit test > if HAVE_LIBLTTNG_UST_CTL > @@ -53,7 +52,11 @@ UST_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-ust.c \ > > test_ust_data_SOURCES = test_ust_data.c $(UST_DATA_TRACE) > test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ > - -lrt -llttng-ust-ctl > + -llttng-ust-ctl > +if !TARGET_HOST_ANDROID > +test_ust_data_LDADD += -lrt > +endif > + > endif > > # Kernel data structures unit test > @@ -64,5 +67,10 @@ KERN_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-kernel.c \ > $(top_srcdir)/src/common/utils.c > > test_kernel_data_SOURCES = test_kernel_data.c $(KERN_DATA_TRACE) > -test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) \ > - -lrt > +test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSESSIOND_COMM) $(LIBHASHTABLE) > + > +if !TARGET_HOST_ANDROID > +test_session_LDADD += -lrt > +test_kernel_data_LDADD += -lrt > +endif > + From mathieu.desnoyers at efficios.com Mon May 6 15:28:38 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 15:28:38 -0400 Subject: [lttng-dev] [PATCH lttng-tools 14/14] Cleaned up configure.ac: Replaced space indents by tabs, regrouped AC_ARG_WITH's, generalized the coding style, fixed a bad AS_HELP_STRING. In-Reply-To: <51880356.4050009@efficios.com> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> <1367864331-15212-14-git-send-email-charlesbriere.flatzo@gmail.com> <51880356.4050009@efficios.com> Message-ID: <20130506192838.GA21679@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > Why? cleaning up the configure.ac is a good thing. However, this patch should probably be split into 3 patches. 1) Cleanup: configure.ac: replace space indents by tabs 2) Cleanup: configure.ac: regroup AC_ARG_WITH 3) Error message fix: configure.ac: fix bad AS_HELP_STRING Not sure about "generalized coding style" though. It might require more explanation. Thanks, Mathieu > > Thanks! > David > > Charles Briere: > > From: Pierre-Luc St-Charles > > > > Signed-off-by: Pierre-Luc St-Charles > > --- > > configure.ac | 315 ++++++++++++++++++++++++++++++++--------------------------- > > 1 file changed, 171 insertions(+), 144 deletions(-) > > > > diff --git a/configure.ac b/configure.ac > > index 154b0a7..e4d2c6f 100644 > > --- a/configure.ac > > +++ b/configure.ac > > @@ -17,27 +17,32 @@ AC_CONFIG_HEADERS([include/config.h]) > > AC_PROG_GREP > > # libtool link_all_deplibs fixup. See http://bugs.lttng.org/issues/321. > > AC_ARG_ENABLE(libtool-linkdep-fixup, > > - AS_HELP_STRING([--disable-libtool-linkdep-fixup], > > - [disable the libtool fixup for linking all dependent libraries (link_all_deplibs)]), > > - libtool_fixup=$enableval, > > - libtool_fixup=yes) > > +[ > > + AS_HELP_STRING([--disable-libtool-linkdep-fixup],[disable the libtool fixup for linking all dependent libraries (link_all_deplibs)]) > > +], > > +[ > > + libtool_fixup=$enableval > > +], > > +[ > > + libtool_fixup=yes > > +]) > > > > AS_IF([test "x$libtool_fixup" = "xyes"], > > - [ > > - libtool_m4="$srcdir/config/libtool.m4" > > - libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)" > > - AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in $libtool_m4]) > > - libtool_flag_pattern_count=$(grep -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4) > > - AS_IF([test $libtool_flag_pattern_count -ne 0], > > - [ > > - AC_MSG_RESULT([$libtool_flag_pattern_count]) > > - AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown]) > > - sed -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4 > > - ], > > - [ > > - AC_MSG_RESULT([none]) > > - ]) > > - ]) > > +[ > > + libtool_m4="$srcdir/config/libtool.m4" > > + libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)" > > + AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in $libtool_m4]) > > + libtool_flag_pattern_count=$(grep -c "$libtool_flag_pattern\s*=\s*no" $libtool_m4) > > + AS_IF([test $libtool_flag_pattern_count -ne 0], > > + [ > > + AC_MSG_RESULT([$libtool_flag_pattern_count]) > > + AC_MSG_WARN([the detected libtool will not link all dependencies, forcing link_all_deplibs = unknown]) > > + sed -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4 > > + ], > > + [ > > + AC_MSG_RESULT([none]) > > + ]) > > +]) > > > > AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno]) > > > > @@ -57,55 +62,55 @@ AC_CHECK_HEADERS([ \ > > > > # Babeltrace viewer check > > AC_ARG_WITH([babeltrace-bin], > > - AS_HELP_STRING([--with-babeltrace-bin], > > - [Location of the babeltrace viewer executable (including the filename)]), > > + AS_HELP_STRING([--with-babeltrace-bin], [Location of the babeltrace viewer executable (including the filename)]), > > [BABELTRACE_BIN="$withval"], > > [BABELTRACE_BIN='']) > > AC_SUBST([BABELTRACE_BIN]) > > > > # lttv-gui > > AC_ARG_WITH([lttv-gui-bin], > > - AS_HELP_STRING([--with-lttv-gui-bin], > > - [Location of the lttv GUI viewer executable (including the filename)]), > > - [LTTV_GUI_BIN="$withval"], > > - [LTTV_GUI_BIN='']) > > + AS_HELP_STRING([--with-lttv-gui-bin], [Location of the lttv GUI viewer executable (including the filename)]), > > + [LTTV_GUI_BIN="$withval"], > > + [LTTV_GUI_BIN='']) > > AC_SUBST([LTTV_GUI_BIN]) > > > > AC_ARG_WITH([consumerd32-bin], > > - AS_HELP_STRING([--with-consumerd32-bin], > > - [Location of the 32-bit consumerd executable (including the filename)]), > > + AS_HELP_STRING([--with-consumerd32-bin], [Location of the 32-bit consumerd executable (including the filename)]), > > [CONSUMERD32_BIN="$withval"], > > [CONSUMERD32_BIN='']) > > AC_SUBST([CONSUMERD32_BIN]) > > > > AC_ARG_WITH([consumerd64-bin], > > - AS_HELP_STRING([--with-consumerd64-bin], > > - [Location of the 64-bit consumerd executable (including the filename)]), > > + AS_HELP_STRING([--with-consumerd64-bin], [Location of the 64-bit consumerd executable (including the filename)]), > > [CONSUMERD64_BIN="$withval"], > > [CONSUMERD64_BIN='']) > > AC_SUBST([CONSUMERD64_BIN]) > > > > AC_ARG_WITH([consumerd32-libdir], > > - AS_HELP_STRING([--with-consumerd32-libdir], > > - [Directory containing the 32-bit consumerd libraries]), > > + AS_HELP_STRING([--with-consumerd32-libdir], [Directory containing the 32-bit consumerd libraries]), > > [CONSUMERD32_LIBDIR="$withval"], > > [CONSUMERD32_LIBDIR='']) > > AC_SUBST([CONSUMERD32_LIBDIR]) > > > > AC_ARG_WITH([consumerd64-libdir], > > - AS_HELP_STRING([--with-consumerd64-libdir], > > - [Directory containing the 64-bit consumerd libraries]), > > + AS_HELP_STRING([--with-consumerd64-libdir], [Directory containing the 64-bit consumerd libraries]), > > [CONSUMERD64_LIBDIR="$withval"], > > [CONSUMERD64_LIBDIR='']) > > AC_SUBST([CONSUMERD64_LIBDIR]) > > > > AC_ARG_WITH([sessiond-bin], > > - AS_HELP_STRING([--with-sessiond-bin], > > - [Location of the sessiond executable (including the filename)]), > > + AS_HELP_STRING([--with-sessiond-bin], [Location of the sessiond executable (including the filename)]), > > [SESSIOND_BIN="$withval"], > > [SESSIOND_BIN='']) > > AC_SUBST([SESSIOND_BIN]) > > > > +# Option to only build the consumer daemon and its libraries > > +AC_ARG_WITH([consumerd-only], > > + AS_HELP_STRING([--with-consumerd-only], [Only build the consumer daemon [default=no]]), > > + [consumerd_only=$withval], > > + [consumerd_only=no]) > > +AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"]) > > + > > AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", [Location of the 32-bit consumerd executable.]) > > AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", [Location of the 64-bit consumerd executable]) > > AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this location.]) > > @@ -117,23 +122,24 @@ AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], "$SESSIOND_BIN", [Location of the sess > > # Check for pthread > > AC_CHECK_LIB([pthread], [pthread_create], [], > > [ > > - # Check for pthread in a bionic libc... > > + # Check for pthread in a bionic libc... > > AC_CHECK_LIB([c], [pthread_create], [], > > [ > > - AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.]) > > + AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to specify its location.]) > > ]) > > -] > > -) > > +]) > > > > # Check low-level endian compat functions > > AC_CHECK_DECL(be64toh, [], > > [ > > - AC_CHECK_DECL(betoh64, [AC_DEFINE_UNQUOTED([LTTNG_HAVE_BETOH64], 1, [Has BSD-style endian conversion operations.])], > > + AC_CHECK_DECL(betoh64, > > + [ > > + AC_DEFINE_UNQUOTED([LTTNG_HAVE_BETOH64], 1, [Has BSD-style endian conversion operations.]) > > + ], > > [ > > AC_MSG_ERROR([Cannot find be64toh, betoh64 or any similar functions.]) > > ]) > > -] > > -) > > +]) > > > > # Check if gettid() is already defined > > AC_CHECK_DECL(gettid, > > @@ -146,11 +152,10 @@ AC_CHECK_LIB([popt], [poptGetContext], [], > > [ > > # Check for libpopt in oprofile for Android > > AC_CHECK_LIB([oprofile_popt], [poptGetContext], [], > > - [ > > - AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.]) > > - ]) > > -] > > -) > > + [ > > + AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to specify its location.]) > > + ]) > > +]) > > > > # Check for libuuid > > AC_CHECK_LIB([uuid], [uuid_generate], > > @@ -176,8 +181,7 @@ AC_CHECK_LIB([uuid], [uuid_generate], > > AC_MSG_ERROR([Cannot find libuuid uuid_generate, libc uuid_create nor libext2_uuid uuid_generate. Use [LDFLAGS]=-Ldir to specify their location.]) > > ]) > > ]) > > -] > > -) > > +]) > > AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"]) > > AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"]) > > AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBEXT2_UUID], [test "x$have_libext2_uuid" = "xyes"]) > > @@ -222,41 +226,59 @@ liburcu_version=">= 0.7.2" > > > > # Check liburcu needed function calls > > AC_CHECK_DECL([cds_list_add], [], > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > > -) > > +[ > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > > +]) > > AC_CHECK_DECL([cds_wfq_init], [], > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > > -) > > +[ > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > > +]) > > AC_CHECK_DECL([cds_wfq_dequeue_blocking], [], > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > > -) > > +[ > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > > +]) > > AC_CHECK_DECL([futex_async], [], > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > > -) > > +[ > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > > +]) > > AC_CHECK_DECL([rcu_thread_offline], [], > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > > -) > > +[ > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > > +]) > > AC_CHECK_DECL([rcu_thread_online], [], > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > > -) > > +[ > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > > +]) > > AC_CHECK_DECL([caa_likely], [], > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ]] > > -) > > +[ > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include ] > > +]) > > > > # Check liblttng-ust-ctl library > > AC_ARG_ENABLE(lttng-ust, > > - AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]), > > - lttng_ust_support=$enableval, lttng_ust_support=yes) > > +[ > > + AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST (Userspace Tracing) support]) > > +], > > +[ > > + lttng_ust_support=$enableval > > +], > > +[ > > + lttng_ust_support=yes > > +]) > > > > -AS_IF([test "x$lttng_ust_support" = "xyes"], [ > > +AS_IF([test "x$lttng_ust_support" = "xyes"], > > +[ > > AC_CHECK_LIB([lttng-ust-ctl], [ustctl_set_filter], > > - [ > > - AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support]) > > - lttng_ust_ctl_found=yes > > - ], > > - [AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.])], > > - [-lurcu-common -lurcu-bp -lurcu-cds -lc -lrt] > > - ) > > + [ > > + AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST control support]) > > + lttng_ust_ctl_found=yes > > + ], > > + [ > > + AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to build lttng-tools without LTTng-UST support.]) > > + ], > > + [ > > + -lurcu-common -lurcu-bp -lurcu-cds -lc -lrt > > + ]) > > ]) > > AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" = xyes]) > > AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range]) > > @@ -283,18 +305,15 @@ AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], [test "x$have_libc_dl" = "xyes" > > AC_CHECK_LIB([c], [fmemopen], > > [ > > AC_DEFINE_UNQUOTED([LTTNG_HAVE_FMEMOPEN], 1, [Has fmemopen support.]) > > -] > > -) > > +]) > > > > # Check for open_memstream > > AC_CHECK_LIB([c], [open_memstream], > > [ > > AC_DEFINE_UNQUOTED([LTTNG_HAVE_OPEN_MEMSTREAM], 1, [Has open_memstream support.]) > > -] > > -) > > +]) > > > > AC_ARG_VAR([LTTNG_RUNDIR], [Path to run directory, default to /var/run]) > > - > > AS_IF([test -n "$LTTNG_RUNDIR"], > > [ > > lttng_rundir=$LTTNG_RUNDIR > > @@ -315,54 +334,49 @@ AC_DEFINE_UNQUOTED([DEFAULT_LTTNG_RUNDIR], ["$lttng_rundir"], [Location of the r > > swig_version=2.0.0 > > > > AC_ARG_ENABLE([python-bindings], > > - [AC_HELP_STRING([--enable-python-bindings], > > - [compile Python bindings])], > > - [enable_python=yes], [enable_python=no]) > > +[ > > + AS_HELP_STRING([--enable-python-bindings], [compile Python bindings]) > > +], > > +[ > > + enable_python=yes > > +], > > +[ > > + enable_python=no > > +]) > > > > AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python:-yes}" = xyes]) > > > > if test "x${enable_python:-yes}" = xyes; then > > - AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version or newer is needed]) ]) > > - AM_PATH_PYTHON > > - > > - AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config]) > > - AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) > > - AS_IF([test -z "$PYTHON_INCLUDE"], [ > > - AS_IF([test -z "$PYTHON_CONFIG"], [ > > - AC_PATH_PROGS([PYTHON_CONFIG], > > - [python$PYTHON_VERSION-config python-config], > > - [no], > > - [`dirname $PYTHON`]) > > - AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?])]) > > - ]) > > - AC_MSG_CHECKING([python include flags]) > > - PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` > > - AC_MSG_RESULT([$PYTHON_INCLUDE]) > > - ]) > > - > > + AX_PKG_SWIG($swig_version, [], > > + [ > > + AC_MSG_ERROR([SWIG $swig_version or newer is needed]) > > + ]) > > + AM_PATH_PYTHON > > + AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config]) > > + AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) > > + AS_IF([test -z "$PYTHON_INCLUDE"], > > + [ > > + AS_IF([test -z "$PYTHON_CONFIG"], > > + [ > > + AC_PATH_PROGS([PYTHON_CONFIG], [python$PYTHON_VERSION-config python-config], [no], [`dirname $PYTHON`]) > > + AS_IF([test "$PYTHON_CONFIG" = no], > > + [ > > + AC_MSG_ERROR([cannot find python-config for $PYTHON. Do you have python-dev installed?]) > > + ]) > > + ]) > > + AC_MSG_CHECKING([python include flags]) > > + PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` > > + AC_MSG_RESULT([$PYTHON_INCLUDE]) > > + ]) > > else > > - AC_MSG_NOTICE([You may configure with --enable-python-bindings ]dnl > > -[if you want Python bindings.]) > > - > > + AC_MSG_NOTICE([You may configure with --enable-python-bindings if you want Python bindings.]) > > fi > > > > -# Option to only build the consumer daemon and its libraries > > -AC_ARG_WITH([consumerd-only], > > - AS_HELP_STRING([--with-consumerd-only],[Only build the consumer daemon [default=no]]), > > - [consumerd_only=$withval], > > - [consumerd_only=no]) > > -AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = "xyes"]) > > - > > # Epoll check. If not present, the build will fallback on poll() API > > -AX_HAVE_EPOLL( > > - [AX_CONFIG_FEATURE_ENABLE(epoll)], > > - [AX_CONFIG_FEATURE_DISABLE(epoll)] > > -) > > -AX_CONFIG_FEATURE( > > - [epoll], [This platform supports epoll(7)], > > - [HAVE_EPOLL], [This platform supports epoll(7).], > > - [enable_epoll="yes"], [enable_epoll="no"] > > -) > > +AX_HAVE_EPOLL([AX_CONFIG_FEATURE_ENABLE(epoll)],[AX_CONFIG_FEATURE_DISABLE(epoll)]) > > +AX_CONFIG_FEATURE([epoll], [This platform supports epoll(7)], > > + [HAVE_EPOLL], [This platform supports epoll(7).], > > + [enable_epoll="yes"], [enable_epoll="no"]) > > AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ]) > > > > AC_SYS_LARGEFILE > > @@ -455,37 +469,43 @@ AS_ECHO() > > # Target architecture we're building for > > target_arch=$host_cpu > > [ > > -for f in $CFLAGS; do > > - if test $f = "-m32"; then > > + for f in $CFLAGS; do > > + if test $f = "-m32"; then > > target_arch="32-bit" > > - elif test $f = "-m64"; then > > + elif test $f = "-m64"; then > > target_arch="64-bit" > > - fi > > -done > > + fi > > + done > > ] > > AS_ECHO_N("Target architecture: ") > > AS_ECHO($target_arch) > > > > # LTTng-UST enabled/disabled > > AS_ECHO_N("Lttng-UST support: ") > > -AS_IF([test "x$lttng_ust_support" = "xyes"],[ > > +AS_IF([test "x$lttng_ust_support" = "xyes"], > > +[ > > AS_ECHO("Enabled") > > -],[ > > +], > > +[ > > AS_ECHO("Disabled") > > ]) > > > > #Python binding enabled/disabled > > AS_ECHO_N("Python binding: ") > > -AS_IF([test "x${enable_python:-yes}" = xyes], [ > > +AS_IF([test "x${enable_python:-yes}" = xyes], > > +[ > > AS_ECHO("Enabled") > > -],[ > > +], > > +[ > > AS_ECHO("Disabled") > > ]) > > > > # Do we build only the consumerd, or everything > > -AS_IF([test "x$consumerd_only" = "xyes"],[ > > +AS_IF([test "x$consumerd_only" = "xyes"], > > +[ > > AS_ECHO("Only the consumerd daemon will be built.") > > -],[ > > +], > > +[ > > AS_ECHO("All binaries will be built.") > > ]) > > > > @@ -497,45 +517,52 @@ AS_ECHO_N("Libraries will be installed in: ") > > AS_ECHO("`eval eval echo $libdir`") > > > > # If we build the sessiond, print the paths it will use > > -AS_IF([test "x$consumerd_only" = "xno"],[ > > +AS_IF([test "x$consumerd_only" = "xno"], > > +[ > > AS_ECHO() > > AS_ECHO_N("The lttng command will look for the lttng-sessiond executable at: ") > > - AS_IF([test "$SESSIOND_BIN" = ""],[ > > + AS_IF([test "$SESSIOND_BIN" = ""], > > + [ > > AS_ECHO_N("`eval eval echo $bindir`") > > AS_ECHO("/lttng-sessiond") > > - ],[ > > + ], > > + [ > > AS_ECHO("$SESSIOND_BIN") > > ]) > > - > > AS_ECHO() > > AS_ECHO("The sessiond daemon will look in the following directories: ") > > AS_ECHO_N("32-bit consumerd executable at: ") > > - AS_IF([test "$CONSUMERD32_BIN" = ""],[ > > + AS_IF([test "$CONSUMERD32_BIN" = ""], > > + [ > > AS_ECHO_N("`eval eval echo $lttnglibexecdir`") > > AS_ECHO("/lttng-consumerd") > > - ],[ > > + ], > > + [ > > AS_ECHO("$CONSUMERD32_BIN") > > ]) > > - > > AS_ECHO_N("32-bit consumer libraries in: ") > > - AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[ > > + AS_IF([test "$CONSUMERD32_LIBDIR" = ""], > > + [ > > AS_ECHO("`eval eval echo $libdir`") > > - ],[ > > + ], > > + [ > > AS_ECHO("$CONSUMERD32_LIBDIR") > > ]) > > - > > AS_ECHO_N("64-bit consumerd executable at: ") > > - AS_IF([test "$CONSUMERD64_BIN" = ""],[ > > + AS_IF([test "$CONSUMERD64_BIN" = ""], > > + [ > > AS_ECHO_N("`eval eval echo $lttnglibexecdir`") > > AS_ECHO("/lttng-consumerd") > > - ],[ > > + ], > > + [ > > AS_ECHO("$CONSUMERD64_BIN") > > ]) > > - > > AS_ECHO_N("64-bit consumer libraries in: ") > > - AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[ > > + AS_IF([test "$CONSUMERD64_LIBDIR" = ""], > > + [ > > AS_ECHO("`eval eval echo $libdir`") > > - ],[ > > + ], > > + [ > > AS_ECHO("$CONSUMERD64_LIBDIR") > > ]) > > ]) > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From pierre-luc.st-charles at polymtl.ca Mon May 6 15:43:13 2013 From: pierre-luc.st-charles at polymtl.ca (Pierre-Luc St-Charles) Date: Mon, 6 May 2013 15:43:13 -0400 Subject: [lttng-dev] [PATCH lttng-tools 14/14] Cleaned up configure.ac: Replaced space indents by tabs, regrouped AC_ARG_WITH's, generalized the coding style, fixed a bad AS_HELP_STRING. In-Reply-To: <20130506192838.GA21679@Krystal> References: <1367864331-15212-1-git-send-email-charlesbriere.flatzo@gmail.com> <1367864331-15212-14-git-send-email-charlesbriere.flatzo@gmail.com> <51880356.4050009@efficios.com> <20130506192838.GA21679@Krystal> Message-ID: Hmm, I agree the 3+ patch split might be a better idea; as for the 'generalized coding style', it was more of a parenthesis usage & positionning cleanup to make sure the same style was applied everywhere (I tried to pick whatever style was the most present at the time). There were a lot of floating brackets here and there, and some function arguments were not properly tabbed. These changes fixed most (?) of these issues while keeping readability in mind. We'll get working on all these fixes in the next few days, but for now, thanks for the comments! On Mon, May 6, 2013 at 3:28 PM, Mathieu Desnoyers < mathieu.desnoyers at efficios.com> wrote: > * David Goulet (dgoulet at efficios.com) wrote: > > Why? > > cleaning up the configure.ac is a good thing. However, this patch should > probably be split into 3 patches. > > 1) Cleanup: configure.ac: replace space indents by tabs > 2) Cleanup: configure.ac: regroup AC_ARG_WITH > 3) Error message fix: configure.ac: fix bad AS_HELP_STRING > > Not sure about "generalized coding style" though. It might require more > explanation. > > Thanks, > > Mathieu > > > > > Thanks! > > David > > > > Charles Briere: > > > From: Pierre-Luc St-Charles > > > > > > Signed-off-by: Pierre-Luc St-Charles > > > > --- > > > configure.ac | 315 > ++++++++++++++++++++++++++++++++--------------------------- > > > 1 file changed, 171 insertions(+), 144 deletions(-) > > > > > > diff --git a/configure.ac b/configure.ac > > > index 154b0a7..e4d2c6f 100644 > > > --- a/configure.ac > > > +++ b/configure.ac > > > @@ -17,27 +17,32 @@ AC_CONFIG_HEADERS([include/config.h]) > > > AC_PROG_GREP > > > # libtool link_all_deplibs fixup. See > http://bugs.lttng.org/issues/321. > > > AC_ARG_ENABLE(libtool-linkdep-fixup, > > > - AS_HELP_STRING([--disable-libtool-linkdep-fixup], > > > - [disable the libtool fixup for linking all > dependent libraries (link_all_deplibs)]), > > > - libtool_fixup=$enableval, > > > - libtool_fixup=yes) > > > +[ > > > + AS_HELP_STRING([--disable-libtool-linkdep-fixup],[disable the > libtool fixup for linking all dependent libraries (link_all_deplibs)]) > > > +], > > > +[ > > > + libtool_fixup=$enableval > > > +], > > > +[ > > > + libtool_fixup=yes > > > +]) > > > > > > AS_IF([test "x$libtool_fixup" = "xyes"], > > > - [ > > > - libtool_m4="$srcdir/config/libtool.m4" > > > - libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)" > > > - AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in > $libtool_m4]) > > > - libtool_flag_pattern_count=$(grep -c > "$libtool_flag_pattern\s*=\s*no" $libtool_m4) > > > - AS_IF([test $libtool_flag_pattern_count -ne 0], > > > - [ > > > - AC_MSG_RESULT([$libtool_flag_pattern_count]) > > > - AC_MSG_WARN([the detected libtool will not link all > dependencies, forcing link_all_deplibs = unknown]) > > > - sed -i > "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" $libtool_m4 > > > - ], > > > - [ > > > - AC_MSG_RESULT([none]) > > > - ]) > > > - ]) > > > +[ > > > + libtool_m4="$srcdir/config/libtool.m4" > > > + libtool_flag_pattern=".*link_all_deplibs\s*,\s*\$1\s*)" > > > + AC_MSG_CHECKING([for occurence(s) of link_all_deplibs = no in > $libtool_m4]) > > > + libtool_flag_pattern_count=$(grep -c > "$libtool_flag_pattern\s*=\s*no" $libtool_m4) > > > + AS_IF([test $libtool_flag_pattern_count -ne 0], > > > + [ > > > + AC_MSG_RESULT([$libtool_flag_pattern_count]) > > > + AC_MSG_WARN([the detected libtool will not link all > dependencies, forcing link_all_deplibs = unknown]) > > > + sed -i "s/\($libtool_flag_pattern\)\s*=\s*no/\1=unknown/g" > $libtool_m4 > > > + ], > > > + [ > > > + AC_MSG_RESULT([none]) > > > + ]) > > > +]) > > > > > > AM_CONDITIONAL([NO_SHARED], [test x$enable_shared = xno]) > > > > > > @@ -57,55 +62,55 @@ AC_CHECK_HEADERS([ \ > > > > > > # Babeltrace viewer check > > > AC_ARG_WITH([babeltrace-bin], > > > - AS_HELP_STRING([--with-babeltrace-bin], > > > - [Location of the babeltrace viewer executable (including the > filename)]), > > > + AS_HELP_STRING([--with-babeltrace-bin], [Location of the > babeltrace viewer executable (including the filename)]), > > > [BABELTRACE_BIN="$withval"], > > > [BABELTRACE_BIN='']) > > > AC_SUBST([BABELTRACE_BIN]) > > > > > > # lttv-gui > > > AC_ARG_WITH([lttv-gui-bin], > > > - AS_HELP_STRING([--with-lttv-gui-bin], > > > - [Location of the lttv GUI viewer executable (including the > filename)]), > > > - [LTTV_GUI_BIN="$withval"], > > > - [LTTV_GUI_BIN='']) > > > + AS_HELP_STRING([--with-lttv-gui-bin], [Location of the lttv GUI > viewer executable (including the filename)]), > > > + [LTTV_GUI_BIN="$withval"], > > > + [LTTV_GUI_BIN='']) > > > AC_SUBST([LTTV_GUI_BIN]) > > > > > > AC_ARG_WITH([consumerd32-bin], > > > - AS_HELP_STRING([--with-consumerd32-bin], > > > - [Location of the 32-bit consumerd executable (including the > filename)]), > > > + AS_HELP_STRING([--with-consumerd32-bin], [Location of the 32-bit > consumerd executable (including the filename)]), > > > [CONSUMERD32_BIN="$withval"], > > > [CONSUMERD32_BIN='']) > > > AC_SUBST([CONSUMERD32_BIN]) > > > > > > AC_ARG_WITH([consumerd64-bin], > > > - AS_HELP_STRING([--with-consumerd64-bin], > > > - [Location of the 64-bit consumerd executable (including the > filename)]), > > > + AS_HELP_STRING([--with-consumerd64-bin], [Location of the 64-bit > consumerd executable (including the filename)]), > > > [CONSUMERD64_BIN="$withval"], > > > [CONSUMERD64_BIN='']) > > > AC_SUBST([CONSUMERD64_BIN]) > > > > > > AC_ARG_WITH([consumerd32-libdir], > > > - AS_HELP_STRING([--with-consumerd32-libdir], > > > - [Directory containing the 32-bit consumerd libraries]), > > > + AS_HELP_STRING([--with-consumerd32-libdir], [Directory containing > the 32-bit consumerd libraries]), > > > [CONSUMERD32_LIBDIR="$withval"], > > > [CONSUMERD32_LIBDIR='']) > > > AC_SUBST([CONSUMERD32_LIBDIR]) > > > > > > AC_ARG_WITH([consumerd64-libdir], > > > - AS_HELP_STRING([--with-consumerd64-libdir], > > > - [Directory containing the 64-bit consumerd libraries]), > > > + AS_HELP_STRING([--with-consumerd64-libdir], [Directory containing > the 64-bit consumerd libraries]), > > > [CONSUMERD64_LIBDIR="$withval"], > > > [CONSUMERD64_LIBDIR='']) > > > AC_SUBST([CONSUMERD64_LIBDIR]) > > > > > > AC_ARG_WITH([sessiond-bin], > > > - AS_HELP_STRING([--with-sessiond-bin], > > > - [Location of the sessiond executable (including the filename)]), > > > + AS_HELP_STRING([--with-sessiond-bin], [Location of the sessiond > executable (including the filename)]), > > > [SESSIOND_BIN="$withval"], > > > [SESSIOND_BIN='']) > > > AC_SUBST([SESSIOND_BIN]) > > > > > > +# Option to only build the consumer daemon and its libraries > > > +AC_ARG_WITH([consumerd-only], > > > + AS_HELP_STRING([--with-consumerd-only], [Only build the consumer > daemon [default=no]]), > > > + [consumerd_only=$withval], > > > + [consumerd_only=no]) > > > +AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = > "xyes"]) > > > + > > > AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_BIN], "$CONSUMERD32_BIN", > [Location of the 32-bit consumerd executable.]) > > > AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD64_BIN], "$CONSUMERD64_BIN", > [Location of the 64-bit consumerd executable]) > > > AC_DEFINE_UNQUOTED([CONFIG_CONSUMERD32_LIBDIR], > "$CONSUMERD32_LIBDIR", [Search for consumerd 32-bit libraries in this > location.]) > > > @@ -117,23 +122,24 @@ AC_DEFINE_UNQUOTED([CONFIG_SESSIOND_BIN], > "$SESSIOND_BIN", [Location of the sess > > > # Check for pthread > > > AC_CHECK_LIB([pthread], [pthread_create], [], > > > [ > > > - # Check for pthread in a bionic libc... > > > + # Check for pthread in a bionic libc... > > > AC_CHECK_LIB([c], [pthread_create], [], > > > [ > > > - AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir to > specify its location.]) > > > + AC_MSG_ERROR([Cannot find libpthread. Use [LDFLAGS]=-Ldir > to specify its location.]) > > > ]) > > > -] > > > -) > > > +]) > > > > > > # Check low-level endian compat functions > > > AC_CHECK_DECL(be64toh, [], > > > [ > > > - AC_CHECK_DECL(betoh64, [AC_DEFINE_UNQUOTED([LTTNG_HAVE_BETOH64], > 1, [Has BSD-style endian conversion operations.])], > > > + AC_CHECK_DECL(betoh64, > > > + [ > > > + AC_DEFINE_UNQUOTED([LTTNG_HAVE_BETOH64], 1, [Has BSD-style > endian conversion operations.]) > > > + ], > > > [ > > > AC_MSG_ERROR([Cannot find be64toh, betoh64 or any similar > functions.]) > > > ]) > > > -] > > > -) > > > +]) > > > > > > # Check if gettid() is already defined > > > AC_CHECK_DECL(gettid, > > > @@ -146,11 +152,10 @@ AC_CHECK_LIB([popt], [poptGetContext], [], > > > [ > > > # Check for libpopt in oprofile for Android > > > AC_CHECK_LIB([oprofile_popt], [poptGetContext], [], > > > - [ > > > - AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to > specify its location.]) > > > - ]) > > > -] > > > -) > > > + [ > > > + AC_MSG_ERROR([Cannot find libpopt. Use [LDFLAGS]=-Ldir to > specify its location.]) > > > + ]) > > > +]) > > > > > > # Check for libuuid > > > AC_CHECK_LIB([uuid], [uuid_generate], > > > @@ -176,8 +181,7 @@ AC_CHECK_LIB([uuid], [uuid_generate], > > > AC_MSG_ERROR([Cannot find libuuid uuid_generate, > libc uuid_create nor libext2_uuid uuid_generate. Use [LDFLAGS]=-Ldir to > specify their location.]) > > > ]) > > > ]) > > > -] > > > -) > > > +]) > > > AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = > "xyes"]) > > > AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" > = "xyes"]) > > > AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBEXT2_UUID], [test > "x$have_libext2_uuid" = "xyes"]) > > > @@ -222,41 +226,59 @@ liburcu_version=">= 0.7.2" > > > > > > # Check liburcu needed function calls > > > AC_CHECK_DECL([cds_list_add], [], > > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ]] > > > -) > > > +[ > > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ] > > > +]) > > > AC_CHECK_DECL([cds_wfq_init], [], > > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ]] > > > -) > > > +[ > > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ] > > > +]) > > > AC_CHECK_DECL([cds_wfq_dequeue_blocking], [], > > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ]] > > > -) > > > +[ > > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ] > > > +]) > > > AC_CHECK_DECL([futex_async], [], > > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ]] > > > -) > > > +[ > > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ] > > > +]) > > > AC_CHECK_DECL([rcu_thread_offline], [], > > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ]] > > > -) > > > +[ > > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ] > > > +]) > > > AC_CHECK_DECL([rcu_thread_online], [], > > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ]] > > > -) > > > +[ > > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ] > > > +]) > > > AC_CHECK_DECL([caa_likely], [], > > > - [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ]] > > > -) > > > +[ > > > + AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ] > > > +]) > > > > > > # Check liblttng-ust-ctl library > > > AC_ARG_ENABLE(lttng-ust, > > > - AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST > (Userspace Tracing) support]), > > > - lttng_ust_support=$enableval, lttng_ust_support=yes) > > > +[ > > > + AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST > (Userspace Tracing) support]) > > > +], > > > +[ > > > + lttng_ust_support=$enableval > > > +], > > > +[ > > > + lttng_ust_support=yes > > > +]) > > > > > > -AS_IF([test "x$lttng_ust_support" = "xyes"], [ > > > +AS_IF([test "x$lttng_ust_support" = "xyes"], > > > +[ > > > AC_CHECK_LIB([lttng-ust-ctl], [ustctl_set_filter], > > > - [ > > > - AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has > LTTng-UST control support]) > > > - lttng_ust_ctl_found=yes > > > - ], > > > - [AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use > [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to > build lttng-tools without LTTng-UST support.])], > > > - [-lurcu-common -lurcu-bp -lurcu-cds -lc -lrt] > > > - ) > > > + [ > > > + AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST > control support]) > > > + lttng_ust_ctl_found=yes > > > + ], > > > + [ > > > + AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use > [LDFLAGS]=-Ldir to specify its location, or specify --disable-lttng-ust to > build lttng-tools without LTTng-UST support.]) > > > + ], > > > + [ > > > + -lurcu-common -lurcu-bp -lurcu-cds -lc -lrt > > > + ]) > > > ]) > > > AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$lttng_ust_ctl_found" > = xyes]) > > > AC_CHECK_FUNCS([sched_getcpu sysconf sync_file_range]) > > > @@ -283,18 +305,15 @@ AM_CONDITIONAL([LTTNG_TOOLS_BUILD_WITH_LIBC_DL], > [test "x$have_libc_dl" = "xyes" > > > AC_CHECK_LIB([c], [fmemopen], > > > [ > > > AC_DEFINE_UNQUOTED([LTTNG_HAVE_FMEMOPEN], 1, [Has fmemopen > support.]) > > > -] > > > -) > > > +]) > > > > > > # Check for open_memstream > > > AC_CHECK_LIB([c], [open_memstream], > > > [ > > > AC_DEFINE_UNQUOTED([LTTNG_HAVE_OPEN_MEMSTREAM], 1, [Has > open_memstream support.]) > > > -] > > > -) > > > +]) > > > > > > AC_ARG_VAR([LTTNG_RUNDIR], [Path to run directory, default to > /var/run]) > > > - > > > AS_IF([test -n "$LTTNG_RUNDIR"], > > > [ > > > lttng_rundir=$LTTNG_RUNDIR > > > @@ -315,54 +334,49 @@ AC_DEFINE_UNQUOTED([DEFAULT_LTTNG_RUNDIR], > ["$lttng_rundir"], [Location of the r > > > swig_version=2.0.0 > > > > > > AC_ARG_ENABLE([python-bindings], > > > - [AC_HELP_STRING([--enable-python-bindings], > > > - [compile Python bindings])], > > > - [enable_python=yes], [enable_python=no]) > > > +[ > > > + AS_HELP_STRING([--enable-python-bindings], [compile Python > bindings]) > > > +], > > > +[ > > > + enable_python=yes > > > +], > > > +[ > > > + enable_python=no > > > +]) > > > > > > AM_CONDITIONAL([USE_PYTHON], [test "x${enable_python:-yes}" = xyes]) > > > > > > if test "x${enable_python:-yes}" = xyes; then > > > - AX_PKG_SWIG($swig_version, [], [ AC_MSG_ERROR([SWIG $swig_version > or newer is needed]) ]) > > > - AM_PATH_PYTHON > > > - > > > - AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing > python-config]) > > > - AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) > > > - AS_IF([test -z "$PYTHON_INCLUDE"], [ > > > - AS_IF([test -z "$PYTHON_CONFIG"], [ > > > - AC_PATH_PROGS([PYTHON_CONFIG], > > > - [python$PYTHON_VERSION-config python-config], > > > - [no], > > > - [`dirname $PYTHON`]) > > > - AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find > python-config for $PYTHON. Do you have python-dev installed?])]) > > > - ]) > > > - AC_MSG_CHECKING([python include flags]) > > > - PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` > > > - AC_MSG_RESULT([$PYTHON_INCLUDE]) > > > - ]) > > > - > > > + AX_PKG_SWIG($swig_version, [], > > > + [ > > > + AC_MSG_ERROR([SWIG $swig_version or newer is needed]) > > > + ]) > > > + AM_PATH_PYTHON > > > + AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing > python-config]) > > > + AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config]) > > > + AS_IF([test -z "$PYTHON_INCLUDE"], > > > + [ > > > + AS_IF([test -z "$PYTHON_CONFIG"], > > > + [ > > > + AC_PATH_PROGS([PYTHON_CONFIG], > [python$PYTHON_VERSION-config python-config], [no], [`dirname $PYTHON`]) > > > + AS_IF([test "$PYTHON_CONFIG" = no], > > > + [ > > > + AC_MSG_ERROR([cannot find python-config > for $PYTHON. Do you have python-dev installed?]) > > > + ]) > > > + ]) > > > + AC_MSG_CHECKING([python include flags]) > > > + PYTHON_INCLUDE=`$PYTHON_CONFIG --includes` > > > + AC_MSG_RESULT([$PYTHON_INCLUDE]) > > > + ]) > > > else > > > - AC_MSG_NOTICE([You may configure with --enable-python-bindings > ]dnl > > > -[if you want Python bindings.]) > > > - > > > + AC_MSG_NOTICE([You may configure with --enable-python-bindings if > you want Python bindings.]) > > > fi > > > > > > -# Option to only build the consumer daemon and its libraries > > > -AC_ARG_WITH([consumerd-only], > > > - AS_HELP_STRING([--with-consumerd-only],[Only build the consumer > daemon [default=no]]), > > > - [consumerd_only=$withval], > > > - [consumerd_only=no]) > > > -AM_CONDITIONAL([BUILD_CONSUMERD_ONLY], [test "x$consumerd_only" = > "xyes"]) > > > - > > > # Epoll check. If not present, the build will fallback on poll() API > > > -AX_HAVE_EPOLL( > > > - [AX_CONFIG_FEATURE_ENABLE(epoll)], > > > - [AX_CONFIG_FEATURE_DISABLE(epoll)] > > > -) > > > -AX_CONFIG_FEATURE( > > > - [epoll], [This platform supports epoll(7)], > > > - [HAVE_EPOLL], [This platform supports epoll(7).], > > > - [enable_epoll="yes"], [enable_epoll="no"] > > > -) > > > > +AX_HAVE_EPOLL([AX_CONFIG_FEATURE_ENABLE(epoll)],[AX_CONFIG_FEATURE_DISABLE(epoll)]) > > > +AX_CONFIG_FEATURE([epoll], [This platform supports epoll(7)], > > > + [HAVE_EPOLL], [This platform supports epoll(7).], > > > + [enable_epoll="yes"], [enable_epoll="no"]) > > > AM_CONDITIONAL([COMPAT_EPOLL], [ test "$enable_epoll" = "yes" ]) > > > > > > AC_SYS_LARGEFILE > > > @@ -455,37 +469,43 @@ AS_ECHO() > > > # Target architecture we're building for > > > target_arch=$host_cpu > > > [ > > > -for f in $CFLAGS; do > > > - if test $f = "-m32"; then > > > + for f in $CFLAGS; do > > > + if test $f = "-m32"; then > > > target_arch="32-bit" > > > - elif test $f = "-m64"; then > > > + elif test $f = "-m64"; then > > > target_arch="64-bit" > > > - fi > > > -done > > > + fi > > > + done > > > ] > > > AS_ECHO_N("Target architecture: ") > > > AS_ECHO($target_arch) > > > > > > # LTTng-UST enabled/disabled > > > AS_ECHO_N("Lttng-UST support: ") > > > -AS_IF([test "x$lttng_ust_support" = "xyes"],[ > > > +AS_IF([test "x$lttng_ust_support" = "xyes"], > > > +[ > > > AS_ECHO("Enabled") > > > -],[ > > > +], > > > +[ > > > AS_ECHO("Disabled") > > > ]) > > > > > > #Python binding enabled/disabled > > > AS_ECHO_N("Python binding: ") > > > -AS_IF([test "x${enable_python:-yes}" = xyes], [ > > > +AS_IF([test "x${enable_python:-yes}" = xyes], > > > +[ > > > AS_ECHO("Enabled") > > > -],[ > > > +], > > > +[ > > > AS_ECHO("Disabled") > > > ]) > > > > > > # Do we build only the consumerd, or everything > > > -AS_IF([test "x$consumerd_only" = "xyes"],[ > > > +AS_IF([test "x$consumerd_only" = "xyes"], > > > +[ > > > AS_ECHO("Only the consumerd daemon will be built.") > > > -],[ > > > +], > > > +[ > > > AS_ECHO("All binaries will be built.") > > > ]) > > > > > > @@ -497,45 +517,52 @@ AS_ECHO_N("Libraries will be installed in: ") > > > AS_ECHO("`eval eval echo $libdir`") > > > > > > # If we build the sessiond, print the paths it will use > > > -AS_IF([test "x$consumerd_only" = "xno"],[ > > > +AS_IF([test "x$consumerd_only" = "xno"], > > > +[ > > > AS_ECHO() > > > AS_ECHO_N("The lttng command will look for the lttng-sessiond > executable at: ") > > > - AS_IF([test "$SESSIOND_BIN" = ""],[ > > > + AS_IF([test "$SESSIOND_BIN" = ""], > > > + [ > > > AS_ECHO_N("`eval eval echo $bindir`") > > > AS_ECHO("/lttng-sessiond") > > > - ],[ > > > + ], > > > + [ > > > AS_ECHO("$SESSIOND_BIN") > > > ]) > > > - > > > AS_ECHO() > > > AS_ECHO("The sessiond daemon will look in the following > directories: ") > > > AS_ECHO_N("32-bit consumerd executable at: ") > > > - AS_IF([test "$CONSUMERD32_BIN" = ""],[ > > > + AS_IF([test "$CONSUMERD32_BIN" = ""], > > > + [ > > > AS_ECHO_N("`eval eval echo $lttnglibexecdir`") > > > AS_ECHO("/lttng-consumerd") > > > - ],[ > > > + ], > > > + [ > > > AS_ECHO("$CONSUMERD32_BIN") > > > ]) > > > - > > > AS_ECHO_N("32-bit consumer libraries in: ") > > > - AS_IF([test "$CONSUMERD32_LIBDIR" = ""],[ > > > + AS_IF([test "$CONSUMERD32_LIBDIR" = ""], > > > + [ > > > AS_ECHO("`eval eval echo $libdir`") > > > - ],[ > > > + ], > > > + [ > > > AS_ECHO("$CONSUMERD32_LIBDIR") > > > ]) > > > - > > > AS_ECHO_N("64-bit consumerd executable at: ") > > > - AS_IF([test "$CONSUMERD64_BIN" = ""],[ > > > + AS_IF([test "$CONSUMERD64_BIN" = ""], > > > + [ > > > AS_ECHO_N("`eval eval echo $lttnglibexecdir`") > > > AS_ECHO("/lttng-consumerd") > > > - ],[ > > > + ], > > > + [ > > > AS_ECHO("$CONSUMERD64_BIN") > > > ]) > > > - > > > AS_ECHO_N("64-bit consumer libraries in: ") > > > - AS_IF([test "$CONSUMERD64_LIBDIR" = ""],[ > > > + AS_IF([test "$CONSUMERD64_LIBDIR" = ""], > > > + [ > > > AS_ECHO("`eval eval echo $libdir`") > > > - ],[ > > > + ], > > > + [ > > > AS_ECHO("$CONSUMERD64_LIBDIR") > > > ]) > > > ]) > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeremie.galarneau at efficios.com Mon May 6 16:17:09 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 6 May 2013 16:17:09 -0400 Subject: [lttng-dev] WG: Reading CTF trace using Babeltrace API In-Reply-To: <20130502204349.GH15675@Krystal> References: <20130502204349.GH15675@Krystal> Message-ID: On Thu, May 2, 2013 at 4:43 PM, Mathieu Desnoyers wrote: > J?r?mie, can you have a look at these questions ? > > Thanks, > > Mathieu > > * Salman Rafiq (salman.rafiq at esk.fraunhofer.de) wrote: >> Hello All, >> >> In continuation to my previous questions related to reading CTF traces from particular timestamp, I can now further summarize few problems/questions I have: >> >> >> 1. Is it possible to seek CTF file_stream using 'begin' and 'end' iterator position i.e. BT_SEEK_TIME? >> I'm not sure I understand your question. The iterator API provides a seeking mechanism that accepts time-based positions expressed in nanoseconds (with bt_iter_pos.type == BT_SEEK_TIME) and BT_SEEK_BEGIN/BT_SEEK_LAST. See bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos) (include/babeltrace/iterator.h:114) >> >> >> a. We cannot use babel trace API for CTF iterator creation using defined start and end position based on time. Seems this is in progress? It is supported via the position parameters of bt_ctf_iter_create (include/babeltrace/ctf/iterator.h:62). Are you getting an error? >> >> b. The other possible solution I am using, is to create the iterator using defaults, and then later use API to 'create iterator time position based on Raw Timestamp (only takes raw time)' and then 'set iterator position to that timed position'. >> This should work too. >> >> >> 2. But, since the area of interest for me was only the time when user application which I am tracing using Lttng-kernel tracer, started recording events (application use external trace recording format). >> >> User application contains a definition file which tells me the epoch time (us resolution) when it started and stopped tracing. I wanted to use this information to set iterator positions. >> >> >> >> a. Question is Can I convert this time to raw time which babeltrace API takes as an argument? >> >> b. Or Is there any way to read Clock struct from CTF metadata file (is there any scope defined for this), so that I can extract offset variable value to convert epoch time from other trace to raw time? >> Yes. I suggest you have a look at what the ctf-text plugin does in ctf_text_write_event[1] and perhaps ctf_get_real_timestamp[2] to understand these time conversions. Regards, J?r?mie [1] formats/ctf-text/ctf-text.c:272 [2] formats/ctf/events-private.h:38 >> >> It will be really great if I can get few suggestions/help related to these issues. >> Thanking in anticipation! >> >> >> Best Regards, >> >> Salman Rafiq >> Research Engineer >> Industrial Communication >> Fraunhofer-Einrichtung f?r Systeme der Kommunikationstechnik ESK >> >> Hansastra?e 32 | 80686 M?nchen >> Telefon, Fax: +49 89 547088-356 | +49 89 547088-66-356 >> E-Mail: salman.rafiq at esk.fraunhofer.de >> >> Internet: >> http://www.esk.fraunhofer.de >> http://www.facebook.com/FraunhoferESK >> http://www.twitter.com/FraunhoferESK >> >> Von: Salman Rafiq [mailto:salman.rafiq at esk.fraunhofer.de] >> Gesendet: Mittwoch, 18. Juli 2012 15:28 >> An: lttng-dev at lists.lttng.org >> Betreff: [lttng-dev] Reading CTF trace from time T >> >> Hello All, >> >> I am tracing a user application using lttng kernel tracer, i.e., >> >> Start lttng kernel trace >> ./application >> Stop lttng kernel trace >> >> Before I was reading kernel CTF trace using babeltrace API's from beginning of trace, e.g., >> struct bt_iter_pos begin_pos >> struct bt_ctf_iter *iterator >> >> begin_pos.type = BT_SEEK_BEGIN >> iterator = create_iterator(context, &begin_pos, NULL) >> .. and then read events start from that iterator postion. >> >> Recently, I have been trying to seek trace using timestamp from when the application started to application end. >> I would like to know if I am doing it right. Would the method below enough to achieve this? Or I am missing something here :-S >> >> begin_pos.type = BT_SEEK_TIME >> end_pos.type = BT_SEEK_TIME >> >> begin_pos.u.seek_time = timestamp1 (for now manually taken from CTF kernel trace when application started) >> end_pos.u.seek_time = timestamp2 (for now manually taken from CTF kernel trace when application ended) >> >> iterator = create_iterator(context, &begin_pos, &end_pos); >> and then with reading events at iterator position until end_pos. >> >> >> I am using babeltrace package version "1.0.0-pre4". >> Any help related to achieving this functionality will be highly appreciated. >> >> Best Regards, >> Salman >> >> >> -- >> Salman Rafiq >> Industrial Communication >> Fraunhofer-Einrichtung f?r Systeme der Kommunikationstechnik ESK >> >> Hansastra?e 32 | 80686 M?nchen >> Telefon, Fax: +49 89 547088-356 | +49 89 547088-66-356 >> E-Mail: salman.rafiq at esk.fraunhofer.de >> >> Internet: >> http://www.esk.fraunhofer.de >> http://www.facebook.com/FraunhoferESK >> http://www.twitter.com/FraunhoferESK >> > > Content-Description: ATT00001.txt >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Mon May 6 22:55:07 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 22:55:07 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix: Conditionally disable overlap app test requiring shared libs support In-Reply-To: <1360295224-5970-1-git-send-email-christian.babeux@efficios.com> References: <1360295224-5970-1-git-send-email-christian.babeux@efficios.com> Message-ID: <20130507025507.GB24603@Krystal> For the records, this patch was merged into lttng-tools a while ago as: commit ccf7af6c78ba7a206baa9d0b9578468a1af734e1 Author: Christian Babeux Date: Thu Feb 7 22:47:04 2013 -0500 Fix: Conditionally disable test requiring shared libs When building lttng-tools with shared library support explicitly disabled (e.g.: ./configure --disable-shared), libtool fail with a fatal error: Making all in demo CC tp.lo CC tp2.lo CC tp3.lo CC demo.o CCLD demo CCLD liblttng-ust-provider-ust-tests-demo.la CCLD liblttng-ust-provider-ust-tests-demo3.la libtool: link: can not build a shared library libtool: link: See the libtool documentation for more information. libtool: link: Fatal configuration error. The build should not fail because some tests require explicit shared library support, instead they should be skipped. This can be accomplished by detecting builds with no shared libs support with the NO_SHARED Automake variable. Signed-off-by: Christian Babeux Signed-off-by: David Goulet * Christian Babeux (christian.babeux at efficios.com) wrote: > When building lttng-tools with shared library support explicitly > disabled (e.g.: ./configure --disable-shared), libtool fail with > a fatal error: > > Making all in demo > CC tp.lo > CC tp2.lo > CC tp3.lo > CC demo.o > CCLD demo > CCLD liblttng-ust-provider-ust-tests-demo.la > CCLD liblttng-ust-provider-ust-tests-demo3.la > libtool: link: can not build a shared library > libtool: link: See the libtool documentation for more information. > libtool: link: Fatal configuration error. > > The build should not fail because some tests require explicit shared > library support, instead they should be skipped. This can be accomplished > by detecting builds with no shared libs support with the NO_SHARED > Automake variable. > > Signed-off-by: Christian Babeux > --- > tests/ust/overlap/demo/Makefile.am | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/tests/ust/overlap/demo/Makefile.am b/tests/ust/overlap/demo/Makefile.am > index e354636..68b6e08 100644 > --- a/tests/ust/overlap/demo/Makefile.am > +++ b/tests/ust/overlap/demo/Makefile.am > @@ -1,5 +1,10 @@ > AM_CFLAGS=-I$(srcdir) > - > +if NO_SHARED > +# Do not build this test if shared libraries support was > +# explicitly disabled. > +else > +# Force the shared flag on the noinst libraries since they are > +# only built static by default > FORCE_SHARED_LIB_OPTIONS = -module -shared -avoid-version \ > -rpath $(abs_builddir) > > @@ -30,3 +35,4 @@ endif > > noinst_SCRIPTS = demo-trace > EXTRA_DIST = demo-trace > +endif > -- > 1.8.1.2 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Mon May 6 22:59:08 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 22:59:08 -0400 Subject: [lttng-dev] calibrate ? In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD016445@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD016445@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: <20130507025908.GC24603@Krystal> The calibrate function is just a rough sketch really. It could use some more work, but it's very low priority for now. If you feel like it, please open a feature request for this against lttng-tools. Thanks, Mathieu * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > I took note of http://lwn.net/Articles/492296/ (Mathieu Desnoyers, Julien Desfossez, David Goulet; LTTng 2.0: Tracing for power users and developers - part 2, April 18, 2012) and ran this (using the Ubuntu lttng packages this time; babeltrace is 1.0.0~rc1-0ubuntu1 and lttng is 2.0.1-0ubuntu1 [liblttng-ctl0, lttng-tools] and 2.0.2-0ubuntu1 [liblttng-ust0, lttng-modules-dkms]): > > $ sudo -H lttng create calibrate-session > Session calibrate-session created. > Traces will be written in /root/lttng-traces/calibrate-session-20130213-143220 > $ sudo -H lttng enable-event calibrate-event -k --function lttng_calibrate_kretprobe > kernel event calibrate-event created in channel channel0 > $ sudo -H lttng add-context -k -t perf:LLC-load-misses -t perf:LLC-store-misses -t perf:LLC-prefetch-misses > Error: perf:LLC-prefetch-misses: Add kernel context failed > kernel context perf:LLC-store-misses added to all channels > kernel context perf:LLC-load-misses added to all channels > Warning: Some command(s) went wrong > $ sudo -H lttng start > Tracing started for session calibrate-session > $ for a in $(seq 1 10); do \ > > sudo -H lttng calibrate -k --function; \ > > done > Kernel calibration done > Kernel calibration done > Kernel calibration done > Kernel calibration done > Kernel calibration done > Kernel calibration done > Kernel calibration done > Kernel calibration done > Kernel calibration done > Kernel calibration done > $ sudo -H lttng destroy > Session calibrate-session destroyed at /root > $ sudo -H babeltrace /root/lttng-traces/calibrate-session-20130213-143220 > error syntax error > [error] Error creating AST > [warning] Unable to open trace metadata for path "/root/lttng-traces/calibrate-session-20130213-143220/kernel". > [warning] [Context] Cannot open_trace of the format /root/lttng-traces/calibrate-session-20130213-143220/kernel . > > [warning] [Context] opening trace "/root/lttng-traces/calibrate-session-20130213-143220/kernel" from /root/lttng-traces/calibrate-session-20130213-143220 for reading. > > ########## > Now, the "Error: perf:LLC-prefetch-misses: Add kernel context failed" is probably because 'dmesg | grep "generic r"' reports just two generic registers, although it seems odd the error would occur on the first context attempt and not the last. > > My real problem is with the trace thus generated and babeltrace's handling of it. It consists of five files: metadata and channel0_0 through channel0_3. There is no kernel file. > > I moved the trace to another machine and tried a more up-to-date babeltrace (babeltrace-1.0.3+-217b52c), with little difference: > > error syntax error > [error] Error creating AST > [warning] Unable to open trace metadata for path "/home/daniel/lttng-traces/calibrate-session-20130213-143220/kernel". > [warning] [Context] Cannot open_trace of format ctf at path /home/daniel/lttng-traces/calibrate-session-20130213-143220/kernel. > > [warning] [Context] cannot open trace "/home/daniel/lttng-traces/calibrate-session-20130213-143220/kernel" from /home/daniel/lttng-traces/calibrate-session-20130213-143220 for reading. > [error] Cannot open any trace for reading. > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC? G3J 1X5 > CANADA > Vox?: (418) 844-4000 x4245 > Fax?: (418) 844-4538 > NAC?: 918V QSDJ > Gouvernement du Canada?/ Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Mon May 6 23:01:44 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 23:01:44 -0400 Subject: [lttng-dev] babeltrace converting text <=> ctf In-Reply-To: <20130214115404.GA13194@linutronix.de> References: <20130214115404.GA13194@linutronix.de> Message-ID: <20130507030144.GD24603@Krystal> * Sebastian Andrzej Siewior (bigeasy at linutronix.de) wrote: > I started lltng to dump a few kernel events, nothing special. Once I had > the binary CTF I converted it to text output via > > |babeltrace -w trace.txt kernel/ > > | [10:40:10.357768920] (+?.?????????) squsb kmalloc: { cpu_id = 3 }, { call_site = ? > | [10:40:10.357785010] (+0.000016090) squsb kfree: { cpu_id = 3 }, { call_site = ? > | [10:40:10.357800700] (+0.000015690) squsb kmalloc: { cpu_id = 3 }, { call_site = ? > > and now back to CTF. Since babeltrace does not support text as input or > CTF as output (and the error message was not giving a hint) I tried it > with babeltrace-log: > > |babeltrace-log < trace.txt ctf_v1 > > and now back to text: > > |babeltrace -w ctv_v1.txt ctf_v1 > > and I got: > > | 0 string: { }, { str = "[10:40:10.357768920] (+?.?????????) squsb kmalloc: { cpu_id = 3 }, { call_site = ? > | 0 string: { }, { str = "[10:40:10.357785010] (+0.000016090) squsb kfree: { cpu_id = 3 }, { call_site = ? > | 0 string: { }, { str = "[10:40:10.357800700] (+0.000015690) squsb kmalloc: { cpu_id = 3 }, { call_site = ? > > What I don't like here, is that the timestamp information is lost. > Looking at babeltrace-log I noticed a timestamp option. So I tried this: babeltrace-log is made to go from a dmesg output to CTF. > > |babeltrace-log -t < trace.txt ctf_v2 > |babeltrace -w ctv_v2.txt ctf_v2 > |[error] Invalid magic number 0x0 at packet 26 (file offset 851968). > |[error] Open file stream error. > > buh. After looking at babeltrace-log I noticed that the sscanf() does > not match anything because the timestamp value is different. So I tried > to change the input so the sscanf() will match: > > |babeltrace -w trace_seconds.txt --clock-seconds kernel/ > |babeltrace-log -t < trace_seconds.txt ctf_v3 > |babeltrace -w ctf_v3.txt ctf_v3/ > |[error] Invalid magic number 0x1F72CF7C at packet 81 (file offset 2654208). > |[error] Open file stream error. > > Little different but still doesn't work. > Could this be an user error or an easy to spot CTF libary bug? babeltrace-log is not meant to convert from CTF pretty-printing output, but rather from dmesg logs. What you seem to be looking for is a CTF pretty-printed log format to CTF converter, which does not exist today. Sorry for the late reply, Thanks, Mathieu > > Sebastian > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Mon May 6 23:15:05 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 23:15:05 -0400 Subject: [lttng-dev] Scope of event names? In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD016655@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD016655@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: <20130507031505.GE24603@Krystal> Hi Daniel, Yep, it seems to be a discrepancy in the semantic of event name scope uniqueness checks. Not sure if it comes from lttng-modules or lttng-tools. For now, please file a bug report against lttng-tools on the bug tracker. Thanks, Mathieu * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > I'm operating under the assumption that an event's "fully qualified" identifier is something like session:domain:channel:name. Tracepoints and syscalls have system-defined names, and of course the domain can only be 'kernel' or 'userspace', but everything else is pretty much arbitrary. My hypothesis is thus that, as long as they're in different channels (or domains or possibly sessions), two events may bear the same name even though they represent completely different occurrences. So here's what I did (lttng list output has been abridged), with comments interspersed: > > $ sudo -H lttng create asession > Session asession created. > Traces will be written in /root/lttng-traces/asession-20130214-145626 > $ sudo -H lttng enable-event sched_switch -k --tracepoint > kernel event sched_switch created in channel channel0 > $ sudo -H lttng enable-event sched_switch -k --function lttng_calibrate_kretprobe --channel channel1 > Error: Event sched_switch: Enable kernel event failed (channel channel1, session asession) > Warning: Some command(s) went wrong > /* > Okay, so maybe event names have session:domain scope. Let's test this. > */ > $ sudo -H lttng enable-event fevent -k --function lttng_calibrate_kretprobe --channel channel1 > kernel event fevent created in channel channel1 > $ sudo -H lttng enable-event fevent -k --function lttng_calibrate_kretprobe --channel channel2 > kernel event fevent created in channel channel2 > /* > Apparently not. > */ > $ sudo -H lttng list asession > Tracing session asession: [inactive] > === Domain: Kernel === > - channel2: [enabled] > Events: > fevent (type: probe) [enabled] > offset: 0x0 > symbol: lttng_calibrate_kretprobe > - channel1: [enabled] > Events: > fevent (type: probe) [enabled] > offset: 0x0 > symbol: lttng_calibrate_kretprobe > - channel0: [enabled] > Events: > sched_switch (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled] > /* > Instead of tracepoint then function, let's try function then tracepoint > */ > $ sudo -H lttng enable-event sched_process_fork -k --function lttng_calibrate_kretprobe --channel channel3 > kernel event sched_process_fork created in channel channel3 > $ sudo -H lttng enable-event sched_process_fork -k > kernel event sched_process_fork created in channel channel0 > $ sudo -H lttng enable-event sched_process_fork -k --function lttng_calibrate_kretprobe --channel channel4 > Error: Event sched_process_fork: Enable kernel event failed (channel channel4, session asession) > Warning: Some command(s) went wrong > /* > Fascinating. > */ > $ sudo -H lttng list asession > Tracing session asession: [inactive] > - channel3: [enabled] > Events: > sched_process_fork (type: probe) [enabled] > offset: 0x0 > symbol: lttng_calibrate_kretprobe > - channel2: [enabled] > Events: > fevent (type: probe) [enabled] > offset: 0x0 > symbol: lttng_calibrate_kretprobe > - channel1: [enabled] > Events: > fevent (type: probe) [enabled] > offset: 0x0 > symbol: lttng_calibrate_kretprobe > - channel0: [enabled] > Events: > sched_process_fork (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled] > sched_switch (loglevel: TRACE_EMERG (0)) (type: tracepoint) [enabled] > > At this point it looks like defining a kernel tracepoint prevents that tracepoint's name from being used in other channels to define other events (or even the same event). But nothing apparently prevents these other events from being set up *before* the tracepoint. (Not shown here is the case where a tracepoint is defined in one channel, and then in another: the second tracepoint event definition fails as well) > > Can anyone shed light on this? (Note that I haven't even tried yet to see what happens between simultaneous sessions...) > > The control flow of the error-causing commands is something like: > > event.c's event_kernel_enable_tracepoint returns LTTNG_ERR_KERN_ENABLE_FAIL because > kernel.c's kernel_create_event gets something else than ENOSYS or EEXIST from > kernel-ctl.c's kernctl_create_event > > Beyond kernctl_create_event is debugfs, inside of which occurs...whatever. > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC? G3J 1X5 > CANADA > Vox?: (418) 844-4000 x4245 > Fax?: (418) 844-4538 > NAC?: 918V QSDJ > Gouvernement du Canada?/ Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Mon May 6 23:18:18 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 23:18:18 -0400 Subject: [lttng-dev] Issue faced in logging the traces In-Reply-To: References: <511E463F.2080605@efficios.com> Message-ID: <20130507031817.GF24603@Krystal> Hi Vivek, When reporting an issue, please provide: - lttng-sessiond verbose logs, debug logs, - detailed command line usage, in text-only format. Sorry, we're kind of busy, so don't expect us to dig this information from attachments. The best way to do this is to file a bug on bugs.lttng.org, so we can track the issue. Thanks, Mathieu * Vivek Kumar (vivekkumar.p at gmail.com) wrote: > Hi David, > > Any update? > > Please let me know if more info is required. > > Regards, Vivek > > On Mon, Feb 18, 2013 at 4:26 PM, Vivek Kumar wrote: > > > Hi David, > > > > Thanks for the response. LTTng-ust is also ported. > > Please find attached the PPT where I have taken the snaps and described > > the issue faced. > > At present I am trying to port and instrument LTTng for userspace only. > > > > My SoC is ARM-Cortex A9 from Mindspeed and the os is openWRT Linux. > > > > LTTng doesn't report any issue when I run it to instrument in userspace > > but CTF is not logged in the Home directory, please take a look to the > > powerpoint slides for descriptions and commands that I give. > > > > Regards, Vivek > > > > > > > > On Fri, Feb 15, 2013 at 7:59 PM, David Goulet wrote: > > > >> Hi Vivek, > >> > >> In order to collect a trace you need to instrument your application with > >> LTTng-UST tracepoints. > >> > >> If you like to gather the syscalls for instance, you need to install the > >> LTTng modules and start your session daemon as root. > >> > >> If you are still experiencing problem, please provide the commands you > >> use and setup. > >> > >> Thanks! > >> David > >> > >> Vivek Kumar: > >> > Hi, > >> > > >> > I am trying to port LTTng to my arm based board. > >> > For userspace tracing, I have been able to successfully port followings: > >> > LTTng-tools, > >> > LTT-ust Library > >> > Userspace-rcu > >> > libpopt > >> > > >> > Now I can see that lttng-sessiond is running, and am able to create > >> > sessions, enable-event and start and stop tracing. > >> > But, I don't see traces be logged in the home directory (indeed nothing > >> > happens, i.e, not even the creation of the base directory -> > >> lttng-traces). > >> > Am I missing anything because of that LTTng is failing to log traces? > >> > Please help. > >> > > >> > Regards, Vivek > >> > > >> > > >> > -- > >> > Best, Vivek > >> > > >> > > >> > This body part will be downloaded on demand. > >> > > > > > > > > -- > > Best, Vivek > > > > > -- > Best, Vivek > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Mon May 6 23:21:23 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 23:21:23 -0400 Subject: [lttng-dev] cases that kernel module uses lttng to trace its own code In-Reply-To: References: Message-ID: <20130507032123.GG24603@Krystal> * yin sun (sunyin51 at gmail.com) wrote: > Hello, > > Is there any example that a loadable kernel module utilize lttng > tracepoint to trace its own code. Not those ready made probes. > > In this case, what minimal lttng modules do I have to load? I guess you'll want to go by trial and error, and also the lsmod dependency information can help out. Good luck! Mathieu > > Thanks, > /Yin > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Mon May 6 23:24:26 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 6 May 2013 23:24:26 -0400 Subject: [lttng-dev] Core dump with LTTng Tools v2.1.1 In-Reply-To: <5127746E.7080200@ericsson.com> References: <5127746E.7080200@ericsson.com> Message-ID: <20130507032426.GH24603@Krystal> Hi Bernd, Is this still an issue with stable-2.1 branch and/or 2.2-rc releases ? Thanks, Mathieu * Bernd Hufmann (Bernd.Hufmann at ericsson.com) wrote: > Hello > > When executing the command "lttng list -k" and I get a core dump with > the output below. This happens not all the time, but when it happens I > have to kill the lttng-sessiond and restart the lttng-sessiond. I > attached the core dump. Could someone of the LTTng team look into this? > > My computer has Ubuntu 12.04 with kernel 3.2.0-29. I've installed LTTng > modules v2.1.1, LTTng-UST v2.1.1 and userspace-rcu v0.7.6. > > Thanks > Bernd > > lttng list -k > Kernel events: > ------------- > mm_vmscan_kswapd_sleep (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > mm_vmscan_kswapd_wake (loglevel: TRACE_EMERG (0)) (type: tracepoint) > mm_vmscan_wakeup_kswapd (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > mm_vmscan_direct_reclaim_begin (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > mm_vmscan_memcg_reclaim_begin (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > mm_vmscan_memcg_softlimit_reclaim_begin (loglevel: TRACE_EMERG > (0)) (type: tracepoint) > mm_vmscan_direct_reclaim_end (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > mm_vmscan_memcg_reclaim_end (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > mm_vmscan_memcg_softlimit_reclaim_end (loglevel: TRACE_EMERG (0)) > (type: tracepoint) > mm_shrink_slab_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) > mm_shrink_slab_end (loglevel: TRACE_EMERG (0)) (type: tracepoint) > mm_vmscan_lru_isolate (loglevel: TRACE_EMERG (0)) (type: tracepoint) > mm_vmscan_memcg_isolate (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > mm_vmscan_writepage (loglevel: TRACE_EMERG (0)) (type: tracepoint) > mm_vmscan_lru_shrink_inactive (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > replace_swap_token (loglevel: TRACE_EMERG (0)) (type: tracepoint) > put_swap_token (loglevel: TRACE_EMERG (0)) (type: tracepoint) > disable_swap_token (loglevel: TRACE_EMERG (0)) (type: tracepoint) > update_swap_token_priority (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > udp_fail_queue_rcv_skb (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > timer_init (loglevel: TRACE_EMERG (0)) (type: tracepoint) > timer_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) > timer_expire_entry (loglevel: TRACE_EMERG (0)) (type: tracepoint) > timer_expire_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) > timer_cancel (loglevel: TRACE_EMERG (0)) (type: tracepoint) > hrtimer_init (loglevel: TRACE_EMERG (0)) (type: tracepoint) > hrtimer_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) > hrtimer_expire_entry (loglevel: TRACE_EMERG (0)) (type: tracepoint) > hrtimer_expire_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) > hrtimer_cancel (loglevel: TRACE_EMERG (0)) (type: tracepoint) > itimer_state (loglevel: TRACE_EMERG (0)) (type: tracepoint) > itimer_expire (loglevel: TRACE_EMERG (0)) (type: tracepoint) > lttng_statedump_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) > lttng_statedump_end (loglevel: TRACE_EMERG (0)) (type: tracepoint) > lttng_statedump_process_state (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > lttng_statedump_file_descriptor (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > lttng_statedump_vm_map (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > lttng_statedump_network_interface (loglevel: TRACE_EMERG (0)) > (type: tracepoint) > lttng_statedump_interrupt (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > sock_rcvqueue_full (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sock_exceed_buf_limit (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kfree_skb (loglevel: TRACE_EMERG (0)) (type: tracepoint) > consume_skb (loglevel: TRACE_EMERG (0)) (type: tracepoint) > skb_copy_datagram_iovec (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > signal_generate (loglevel: TRACE_EMERG (0)) (type: tracepoint) > signal_deliver (loglevel: TRACE_EMERG (0)) (type: tracepoint) > signal_overflow_fail (loglevel: TRACE_EMERG (0)) (type: tracepoint) > signal_lose_info (loglevel: TRACE_EMERG (0)) (type: tracepoint) > scsi_dispatch_cmd_start (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > scsi_dispatch_cmd_error (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > scsi_dispatch_cmd_done (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > scsi_dispatch_cmd_timeout (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > scsi_eh_wakeup (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > sched_wakeup (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_switch (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_migrate_task (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_process_free (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_process_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_wait_task (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_process_wait (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_process_fork (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_stat_wait (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_stat_sleep (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_stat_iowait (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_stat_runtime (loglevel: TRACE_EMERG (0)) (type: tracepoint) > sched_pi_setprio (loglevel: TRACE_EMERG (0)) (type: tracepoint) > regulator_enable (loglevel: TRACE_EMERG (0)) (type: tracepoint) > regulator_enable_delay (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > regulator_enable_complete (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > regulator_disable (loglevel: TRACE_EMERG (0)) (type: tracepoint) > regulator_disable_complete (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > regulator_set_voltage (loglevel: TRACE_EMERG (0)) (type: tracepoint) > regulator_set_voltage_complete (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > (type: noop) > cpu_frequency (loglevel: TRACE_EMERG (0)) (type: tracepoint) > machine_suspend (loglevel: TRACE_EMERG (0)) (type: tracepoint) > power_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) > power_frequency (loglevel: TRACE_EMERG (0)) (type: tracepoint) > power_end (loglevel: TRACE_EMERG (0)) (type: tracepoint) > clock_enable (loglevel: TRACE_EMERG (0)) (type: tracepoint) > clock_disable (loglevel: TRACE_EMERG (0)) (type: tracepoint) > clock_set_rate (loglevel: TRACE_EMERG (0)) (type: tracepoint) > power_domain_target (loglevel: TRACE_EMERG (0)) (type: tracepoint) > net_dev_xmit (loglevel: TRACE_EMERG (0)) (type: tracepoint) > net_dev_queue (loglevel: TRACE_EMERG (0)) (type: tracepoint) > netif_receive_skb (loglevel: TRACE_EMERG (0)) (type: tracepoint) > netif_rx (loglevel: TRACE_EMERG (0)) (type: tracepoint) > napi_poll (loglevel: TRACE_EMERG (0)) (type: tracepoint) > module_load (loglevel: TRACE_EMERG (0)) (type: tracepoint) > module_free (loglevel: TRACE_EMERG (0)) (type: tracepoint) > module_get (loglevel: TRACE_EMERG (0)) (type: tracepoint) > module_put (loglevel: TRACE_EMERG (0)) (type: tracepoint) > module_request (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kvm_userspace_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kvm_set_irq (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kvm_msi_set_irq (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kvm_ack_irq (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kvm_mmio (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kvm_fpu (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kvm_age_page (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kvm_try_async_get_page (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > kvm_async_pf_doublefault (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > kvm_async_pf_not_present (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > kvm_async_pf_ready (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kvm_async_pf_completed (loglevel: TRACE_EMERG (0)) (type: > tracepoint) > kmalloc (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kmem_cache_alloc (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kmalloc_node (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kmem_cache_alloc_node (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kfree (loglevel: TRACE_EMERG (0)) (type: tracepoint) > kmem_cache_free (loglevel: TRACE_EMERG (0)) (type: tracepoint) > mm_page_free_direct (loglevel: TRACE_EMERG (0)) (type: tracepoint) > lttng: commands/list.c:253: print_events: Assertion `0' failed. > Aborted (core dumped) > -- > This Communication is Confidential. We only send and receive email on > the basis of the terms set out at www.ericsson.com/email_disclaimer > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 7 07:59:14 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 07:59:14 -0400 Subject: [lttng-dev] Quick questions about liburcu and RCU in general In-Reply-To: <20130507094636.GA6151@mail.sceen.net> References: <20130507094636.GA6151@mail.sceen.net> Message-ID: <20130507115914.GB3875@Krystal> Hi Richard, * Richard Braun (rbraun at sceen.net) wrote: > Hello, > > I'm currently studying RCU/URCU, and I have a few questions that I wasn't > sure where to ask. > > 1/ Why use poll instead of sched_yield in e.g. force_mb_all_readers ? > (I guess it's about portability and the effect is expected to be the same, > but is there another reason ?) poll() allow us to do a millisecond-level wait (timer-based). sched_yield() is pretty much a scheduler hack that just says "be nice to other scheduled processes here". Quoting sched_yield(2): If the calling thread is the only thread in the highest priority list at that time, it will continue to run after a call to sched_yield(). This is a kind of behavior we don't want. > 2/ What was the conclusion of the discussion regarding sys_membarrier ? > (I couldn't find it in the main mail thread, and it looks quite interesting, > even though I expect most carefully written applications not to exceed > one thread per processor too much) The conclusion so far was that: - the implementation was fine, - we had to show there were enough users of this new ABI to justify its inclusion and maintenance cost. Currently, it's pretty much just liburcu that uses it. As the number of liburcu users grows, this helps, but what would help even more would be to have other libraries and applications using sys_membarrier() (other people interested and weighting in). > > 3/ Do you know if IBM allows the use of patented RCU techniques in GPLv3+ > code as well ? ("GPL" is mentioned in the Linux documentation, and > apparently liburcu is covered by LGPLv2+ so I expect that to be the case, > just looking for a confirmation) AFAIK, LGPLv2+ code can migrate into GPLv3+, it's the other way around that is not permitted. Therefore, I would expect it is allowed, but I will let Paul answer to this one on behalf of IBM. Thanks, Mathieu > > Thanks for your answers. > > -- > Richard Braun -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From rbraun at sceen.net Tue May 7 05:46:36 2013 From: rbraun at sceen.net (Richard Braun) Date: Tue, 7 May 2013 11:46:36 +0200 Subject: [lttng-dev] Quick questions about liburcu and RCU in general Message-ID: <20130507094636.GA6151@mail.sceen.net> Hello, I'm currently studying RCU/URCU, and I have a few questions that I wasn't sure where to ask. 1/ Why use poll instead of sched_yield in e.g. force_mb_all_readers ? (I guess it's about portability and the effect is expected to be the same, but is there another reason ?) 2/ What was the conclusion of the discussion regarding sys_membarrier ? (I couldn't find it in the main mail thread, and it looks quite interesting, even though I expect most carefully written applications not to exceed one thread per processor too much) 3/ Do you know if IBM allows the use of patented RCU techniques in GPLv3+ code as well ? ("GPL" is mentioned in the Linux documentation, and apparently liburcu is covered by LGPLv2+ so I expect that to be the case, just looking for a confirmation) Thanks for your answers. -- Richard Braun From mathieu.desnoyers at efficios.com Tue May 7 08:33:39 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 08:33:39 -0400 Subject: [lttng-dev] babeltrace local time? In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD01D433@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD01D433@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <20130507123339.GB4186@Krystal> * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > When babeltrace prints out timestamps in "local time" (the > default), is that the trace's local time (i.e. the local time of > the system that was traced) or is it the local time of the system > running babeltrace? I suspect the former but I want to be sure. local time of the system running babeltrace. if you want gmt time, use babeltrace --clock-gmt Thanks, Mathieu > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC? G3J 1X5 > CANADA > Vox?: (418) 844-4000 x4245 > Fax?: (418) 844-4538 > NAC?: 918V QSDJ > Gouvernement du Canada?/ Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 7 09:07:41 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 09:07:41 -0400 Subject: [lttng-dev] [PATCH 3/5] Read CTF by the ctf target In-Reply-To: References: <1361931459-3953-1-git-send-email-yao@codesourcery.com> <1361931459-3953-4-git-send-email-yao@codesourcery.com> <512F9182.3080104@redhat.com> Message-ID: <20130507130741.GE4186@Krystal> * Hui Zhu (teawater at gmail.com) wrote: > On Fri, Mar 1, 2013 at 1:18 AM, Pedro Alves wrote: > > (not a complete review) > > > > On 02/27/2013 02:17 AM, Yao Qi wrote: > > > >> +if test "x$with_babeltrace" != "xno"; then > >> + saved_CFLAGS="$CFLAGS" > >> + CFLAGS="$CFLAGS $btinc" > >> + AC_MSG_CHECKING([for babeltrace]) > >> + AC_TRY_COMPILE([ > >> +#include > >> +#include > >> +#include > > > > We know from previous patches that the latest released > > babeltrace breaks gdb, due to the lookup_enum function. Does > > this catch that? I see namespacing fixes going into > > babeltrace as recently as last 15th. Do we know if > > babeltrace's API is more or less done and close to a release? > > Hi Mathieu, > > Could you help us with this question? We did the 1.1.0 release specifically for namespace fixes on March 23rd. commit c99b1910bea848e8f0ae5641bb63b8f4f84f3ec0 Author: Mathieu Desnoyers Date: Sat Mar 23 13:34:22 2013 -0400 Version 1.1.0 Signed-off-by: Mathieu Desnoyers Thanks, Mathieu > > Thanks, > Hui > > > > >> + ],[], > >> + [AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_LIBBABELTRACE, 1, [Define if libbabeltrace is available])], > >> + [AC_MSG_RESULT([no]); btlibs= ; btinc= ]) > >> + CFLAGS="$saved_CFLAGS" > >> +fi > >> + > >> +# Flags needed for UST > > > > babeltrace > > > >> +AC_SUBST(btlibs) > >> +AC_SUBST(btinc) > >> + > > > > -- > > Pedro Alves > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 7 09:10:53 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 09:10:53 -0400 Subject: [lttng-dev] babeltrace output format In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD022E1A@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD022E1A@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <20130507131053.GF4186@Krystal> * Thibault, Daniel (dthibault at drdc-rddc.gc.ca) wrote: > Is anyone else bothered by the slight irregularity of babeltrace's output? > > Here is the same trace record printed using various babeltrace settings. In all cases I used '-f trace:hostname --no-delta', varying only the '-n' part: > > -n scope > [11:02:08.064705355] edge-vb-u12 exit_syscall: stream.packet.context = { 0 }, stream.event.context = { 1, 943, "whoopsie", 943, 109 }, event.fields = 8 > -n payload > [11:02:08.064705355] edge-vb-u12 exit_syscall: { 0 }, { 1, 943, "whoopsie", 943, 109 }, { ret = 8 } > -n none > [11:02:08.064705355] edge-vb-u12 exit_syscall: { 0 }, { 1, 943, "whoopsie", 943, 109 }, 8 > -n all > timestamp = 11:02:08.064705355, trace:hostname = edge-vb-u12, name = exit_syscall, stream.packet.context = { cpu_id = 0 }, stream.event.context = { ppid = 1, tid = 943, procname = "whoopsie", pid = 943, perf_major_faults = 109 }, event.fields = { ret = 8 } > > Now compare just the payload part: > > -n scope > event.fields = 8 > -n payload > { ret = 8 } > -n none > 8 > -n all > event.fields = { ret = 8 } > > It turns out the payload is bracketed by {} except when it has size zero or one and its contents are unlabelled. Indeed, with an empty payload I can get a trailing "{ }" or "" (that is to say, the record ends with a comma) depending on the labelling. However, notice that for the stream.packet.context this does not happen, maybe because the underlying structure has actually six fields instead of the lone one normally shown (you can get all six printed using --verbose): > > -n scope > stream.packet.context = { 0 }, > -n payload > { 0 }, > -n none > { 0 }, > -n all > stream.packet.context = { cpu_id = 0 }, > -v > { timestamp_begin = 4196192044293, timestamp_end = 4196224429641, content_size = 2096768, packet_size = 2097152, events_discarded = 0, cpu_id = 0 }, > > This variability could make babeltrace's text output more difficult to parse than necessary, since one would have to handle the occasionally-disappearing curly brackets. > > Is this worth filing a bug over? Yes, thanks, Mathieu > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC? G3J 1X5 > CANADA > Vox?: (418) 844-4000 x4245 > Fax?: (418) 844-4538 > NAC?: 918V QSDJ > Gouvernement du Canada?/ Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 7 09:22:10 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 09:22:10 -0400 Subject: [lttng-dev] make lttng-ust In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD025F4E@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD025F4E@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <20130507132210.GG4186@Krystal> * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > The last few times I rebuilt the lttng-ust package, make's log contains some ominous complaints, although it seems to nevertheless complete normally. Here's an excerpt: > > ########## Begin ########## > CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac/config/missing --run aclocal-1.11 -I config > cd . && /bin/bash /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac/config/missing --run automake-1.11 --foreign > CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac/config/missing --run autoconf > /bin/bash ./config.status --recheck > running CONFIG_SHELL=/bin/bash /bin/bash ./configure --with-java-jdk=/usr/lib/jvm/java-1.7.0-openjdk-amd64 --with-jni-interface LDFLAGS=-L/usr/local/lib --no-create --no-recursion > checking build system type... x86_64-unknown-linux-gnu > [...] > checking for jni.h... yes > configure: creating ./config.status > > Version name: Basse Messe > Light coloured German ale whose style was named after the city Cologne (Koln) where it was first brewed. It is a rather simple beer with lightly fruity aromas and a delicate hoppy fragrance. The beer has a pronounced malty taste with a subtle bitter aftertaste > > LTTng-UST will be built with the following options: > > Java support (JNI): Enabled > sdt.h integration: Disabled > > Type 'make' to compile. > /bin/bash ./config.status > config.status: creating Makefile > [...] > config.status: executing libtool commands > (CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac/config/missing --run autoheader) > rm -f stamp-h1 > touch config.h.in > cd . && /bin/bash ./config.status config.h > config.status: creating config.h > config.status: config.h is unchanged > make all-recursive > make[1]: entrant dans le r?pertoire ? /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac ? > Making all in . > [...] > Making all in libringbuffer > make[2]: entrant dans le r?pertoire ? /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac/libringbuffer ? > CC libringbuffer_la-smp.lo > CC libringbuffer_la-shm.lo > shm.c: In function '_shm_object_table_alloc_shm': > shm.c:148:9: warning: ignoring return value of 'mktemp', declared with attribute warn_unused_result [-Wunused-result] Fixed by: commit af21f7816739b0f9db8b4006ef4378ddc2de0157 Author: Mathieu Desnoyers Date: Tue May 7 09:16:39 2013 -0400 Cleanup: ignore mktemp return value Signed-off-by: Mathieu Desnoyers > CC libringbuffer_la-ring_buffer_backend.lo > CC libringbuffer_la-ring_buffer_frontend.lo > CCLD libringbuffer.la > make[2]: quittant le r?pertoire ? /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac/libringbuffer ? > [...] > Making all in hello > make[3]: entrant dans le r?pertoire ? /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac/tests/hello ? > CC hello-hello.o > In file included from /usr/include/x86_64-linux-gnu/sys/socket.h:40:0, > from /usr/include/netinet/in.h:25, > from /usr/include/arpa/inet.h:23, > from hello.c:29: > /usr/include/x86_64-linux-gnu/bits/socket.h:433:23: attention : 'struct mmsghdr' declared inside parameter list [enabled by default] > /usr/include/x86_64-linux-gnu/bits/socket.h:433:23: attention : visible uniquement depuis cette d?finition ou d?claration, ce qui n'est probablement pas ce que vous d?sirez [enabled by default] > /usr/include/x86_64-linux-gnu/bits/socket.h:440:8: attention : 'struct mmsghdr' declared inside parameter list [enabled by default] These are caused by missing "struct mmsghdr" declarations in system headers. The reason why we see those is because we need to use -Wsystem-headers when compiling tracepoint probe providers. Thanks, Mathieu > CC hello-tp.o > CCLD hello > make[3]: quittant le r?pertoire ? /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac/tests/hello ? > Making all in hello-static-lib > make[3]: entrant dans le r?pertoire ? /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac/tests/hello-static-lib ? > CC tp.lo > CCLD liblttng-ust-provider-ust-test-hello.la > CC hello.o > In file included from /usr/include/x86_64-linux-gnu/sys/socket.h:40:0, > from /usr/include/netinet/in.h:25, > from /usr/include/arpa/inet.h:23, > from hello.c:29: > /usr/include/x86_64-linux-gnu/bits/socket.h:433:23: attention : 'struct mmsghdr' declared inside parameter list [enabled by default] > /usr/include/x86_64-linux-gnu/bits/socket.h:433:23: attention : visible uniquement depuis cette d?finition ou d?claration, ce qui n'est probablement pas ce que vous d?sirez [enabled by default] > /usr/include/x86_64-linux-gnu/bits/socket.h:440:8: attention : 'struct mmsghdr' declared inside parameter list [enabled by default] > CCLD hello > make[3]: quittant le r?pertoire ? /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac/tests/hello-static-lib ? > [...] > Making all in demo > make[3]: entrant dans le r?pertoire ? /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac/tests/demo ? > CC tp.lo > CC tp2.lo > CCLD liblttng-ust-provider-ust-tests-demo.la > CC tp3.lo > CCLD liblttng-ust-provider-ust-tests-demo3.la > CC demo.o > In file included from /usr/include/x86_64-linux-gnu/sys/socket.h:40:0, > from /usr/include/netinet/in.h:25, > from /usr/include/arpa/inet.h:23, > from demo.c:29: > /usr/include/x86_64-linux-gnu/bits/socket.h:433:23: attention : 'struct mmsghdr' declared inside parameter list [enabled by default] > /usr/include/x86_64-linux-gnu/bits/socket.h:433:23: attention : visible uniquement depuis cette d?finition ou d?claration, ce qui n'est probablement pas ce que vous d?sirez [enabled by default] > /usr/include/x86_64-linux-gnu/bits/socket.h:440:8: attention : 'struct mmsghdr' declared inside parameter list [enabled by default] > CCLD demo > make[3]: quittant le r?pertoire ? /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac/tests/demo ? > [...] > make[1]: quittant le r?pertoire ? /home/daniel/git.lttng.org/lttng-ust-2.1.1+-ac6b4ac ? > ########## End ########## > > Is all this normal? I used the following script: > > $ ./bootstrap &> bootstrap.log > $ LDFLAGS=-L/usr/local/lib ./configure --with-java-jdk=/usr/lib/jvm/java-1.7.0-openjdk-amd64 --with-jni-interface &> configure.log > $ make &> make.log > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC? G3J 1X5 > CANADA > Vox?: (418) 844-4000 x4245 > Fax?: (418) 844-4538 > NAC?: 918V QSDJ > Gouvernement du Canada?/ Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From yao at codesourcery.com Tue May 7 09:24:34 2013 From: yao at codesourcery.com (Yao Qi) Date: Tue, 7 May 2013 21:24:34 +0800 Subject: [lttng-dev] [PATCH 3/5] Read CTF by the ctf target In-Reply-To: <20130507130741.GE4186@Krystal> References: <1361931459-3953-1-git-send-email-yao@codesourcery.com> <1361931459-3953-4-git-send-email-yao@codesourcery.com> <512F9182.3080104@redhat.com> <20130507130741.GE4186@Krystal> Message-ID: <51890092.7020903@codesourcery.com> On 05/07/2013 09:07 PM, Mathieu Desnoyers wrote: > We did the 1.1.0 release specifically for namespace fixes on March 23rd. > > commit c99b1910bea848e8f0ae5641bb63b8f4f84f3ec0 > Author: Mathieu Desnoyers > Date: Sat Mar 23 13:34:22 2013 -0400 > > Version 1.1.0 > > Signed-off-by: Mathieu Desnoyers Mathieu, We noticed this timely release and start to use babeltrace 1.1.0 in GDB. GDB is able read ctf via babeltrace now, just fyi... and thanks for your help on some ctf explanations. -- Yao (??) From mathieu.desnoyers at efficios.com Tue May 7 09:28:53 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 09:28:53 -0400 Subject: [lttng-dev] [PATCH 3/5] Read CTF by the ctf target In-Reply-To: <51890092.7020903@codesourcery.com> References: <1361931459-3953-1-git-send-email-yao@codesourcery.com> <1361931459-3953-4-git-send-email-yao@codesourcery.com> <512F9182.3080104@redhat.com> <20130507130741.GE4186@Krystal> <51890092.7020903@codesourcery.com> Message-ID: <20130507132853.GH4186@Krystal> * Yao Qi (yao at codesourcery.com) wrote: > On 05/07/2013 09:07 PM, Mathieu Desnoyers wrote: >> We did the 1.1.0 release specifically for namespace fixes on March 23rd. >> >> commit c99b1910bea848e8f0ae5641bb63b8f4f84f3ec0 >> Author: Mathieu Desnoyers >> Date: Sat Mar 23 13:34:22 2013 -0400 >> >> Version 1.1.0 >> >> Signed-off-by: Mathieu Desnoyers > > Mathieu, > We noticed this timely release and start to use babeltrace 1.1.0 in GDB. > GDB is able read ctf via babeltrace now, just fyi... and thanks for > your help on some ctf explanations. That's great ! Thank you, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 7 09:43:16 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 09:43:16 -0400 Subject: [lttng-dev] babeltrace -i ? In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD01CF4B@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD01CF4B@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <20130507134316.GA5118@Krystal> Yep, a clearer error message could help. please file a bug on bugs.lttng.org. * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > What is the babeltrace -i, --input-format option meant for? At first I thought one could round-trip a CTF trace to text and back using babeltrace, but if I try this: > > $ babeltrace /path_to_the/ctf_trace_directory -w /path_to_the/text_trace_file > $ babeltrace /path_to_the/text_trace_file -i text -o ctf -w /path_to_the/reconstituted_ctf_trace_directory > > The second command gives me: > > [error] Cannot open any trace for reading. > [error] opening trace "/path_to_the/text_trace_file" for reading. > [error] none of the specified trace paths could be opened. > > If '-i ctf' is the only currently-implemented option, then we should get a more appropriate error message when using another: something along the lines of "babeltrace input format not supported ". > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC? G3J 1X5 > CANADA > Vox?: (418) 844-4000 x4245 > Fax?: (418) 844-4538 > NAC?: 918V QSDJ > Gouvernement du Canada?/ Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 7 10:08:02 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 10:08:02 -0400 Subject: [lttng-dev] Userspace events not seen by kernel daemon? In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD0261A7@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD0261A7@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <20130507140801.GC5118@Krystal> * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > I'm running an up-to-date LTTng suite (except for lttng-ust, where I'm using the 5 Mar 2013 20:17:22 commit). I've compiled the lttng-ust/doc/examples/easy-ust/sample application. While I run it (as a user *not* belonging to the tracing group), I notice something unexpected: > > * The local session daemon lists the sample user-space event ('lttng list -u') > * The kernel session daemon does not see the sample user-space event at all ('sudo lttng list -u ') I guess you mean "per-user" rather than "local", and "system-wide" rather than "kernel" here. I will let Jeremie look into your question, Thanks, Mathieu > > It was my understanding that the kernel daemon should see all kernel and user-space events (for as many user-spaces as there might be). > > To test this further, I set up two traces using separate consoles. The first is a user session: > > $ lttng create usersession > $ lttng enable-event -u --all > > The other is a kernel session: > > $ sudo -H lttng create kernelsession > $ sudo -H lttng enable-event -u --all > $ sudo -H lttng enable-event -k sched_switch > > I start each session (respectively '$ lttng start' and '$ sudo -H lttng start') and the sample application (from a third console, '$ ./sample'). I wait until sample concludes, then shut down both sessions (respectively '$ lttng destroy' and '$ sudo -H lttng destroy'). Use of 'sudo -H' avoids current trace name collisions (contention over the .lttngrc file), as reported earlier on this list (but not filed as a bug...maybe I should do that too). > > The kernel trace contains no UST events, as can readily be discerned by the absence of a /ust branch in its folder structure. This is confirmed by babeltrace, which sees some 245 000 kernel events and nothing else. There are no missing events (babeltrace does not complain about skipped events, which it did with some other traces generated about the same time). The System Monitor shows two lttng-sessiond daemons (one for me, another for root) and three lttng-consumerd daemons (one for me, two for root) as expected. > > What did I do wrong? > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC? G3J 1X5 > CANADA > Vox?: (418) 844-4000 x4245 > Fax?: (418) 844-4538 > NAC?: 918V QSDJ > Gouvernement du Canada?/ Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 7 10:15:58 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 10:15:58 -0400 Subject: [lttng-dev] How to disable an event that's been enabled by a wildcard selection or -a? In-Reply-To: <51839435.8010607@mentor.com> References: <009B25148989C6458484484699278506985C0CFA@EU-MBX-01.mgc.mentorg.com> <20998D40D9A2B7499CA5A3A2666CB1EB19F968AF@ZURMSG1.QUANTUM.com> <5121EA9A.8080905@mentor.com> <20130502134010.GF7035@Krystal> <51839435.8010607@mentor.com> Message-ID: <20130507141558.GD5118@Krystal> * Woegerer, Paul (Paul_Woegerer at mentor.com) wrote: > On 05/02/2013 03:40 PM, Mathieu Desnoyers wrote: > > Hi Paul, > > > > I would be interested to see this feature upstream. Previously was not a > > good timing to pull it in, because we were adding the concept of event > > "enablers" within lttng-ust. > > Sounds great. I will port our patch to master. > > > > > One thing I'm curious about is how you present the logical combination > > with exlusion match are present. For instance, if we only have > > inclusion, we get: > > > > lttng enable-event 'a' > > lttng enable-event 'c' > > lttng enable-event 'zc*' > > > > it turns into : (a || c || zc*) > > > > I expect that negation would look like: > > > > lttng enable-event 'a' > > lttng enable-event '!abc*' > > lttng enable-event 'c' > > lttng enable-event '!cxx' > > Our current solution does not handle '!cxx' correctly. > I will fix that. > > > lttng enable-event 'zc*' > > > > -> !(abc* || cxx) || (a || c || zc*) > > Exactly. The "!something" wildcards are always first and will prevent further matching with non-! wildcards. > > > > > Am I correct ? If yes, we should expand lttng-tools lttng(1) manpage and > > cmd help with this info. > > I will take care of documentation updates as well. > > > > > Can you make sure it works well with lttng-ust master branch ? > > Once I have a working, tested patch against master I will send it to you. One thing I just remembered: Please make sure that the order of evaluation of filter expressions stays the same, because we plan to add "actions" associated with the filter expressions in the future. Therefore, if we have: lttng enable-event 'a' --filter 'fielname==1' (1) lttng enable-event '!abc*' --filter 'somename>2' (2) lttng enable-event 'c' --filter 'othername==3' (3) lttng enable-event '!cxx' --filter 'thisname="abc"' (4) We want to interpret the filter expressions in this order: (1), then (2), then (3), then (4) within lttng-ust. We also have to assign a clear semantic to those exclusions when a filter is applied. Same for loglevels. This is one of the reasons why I waited to pull your modification: I was implementing the filter, and "enablers", back then. So now there everything is in place, it should become clearer what needs to be done. Thanks, Mathieu > > Thanks, > Paul > > -- > Paul Woegerer | SW Development Engineer > http://go.mentor.com/sourceryanalyzer > > Mentor Embedded(tm) | Prinz Eugen Stra?e 72/2/4, Vienna, 1040 Austria > Nucleus? | Linux? | Android(tm) | Services | UI | Multi-OS > > Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. > Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From paulmck at linux.vnet.ibm.com Tue May 7 10:23:52 2013 From: paulmck at linux.vnet.ibm.com (Paul E. McKenney) Date: Tue, 7 May 2013 07:23:52 -0700 Subject: [lttng-dev] Quick questions about liburcu and RCU in general In-Reply-To: <20130507115914.GB3875@Krystal> References: <20130507094636.GA6151@mail.sceen.net> <20130507115914.GB3875@Krystal> Message-ID: <20130507142352.GA3648@linux.vnet.ibm.com> On Tue, May 07, 2013 at 07:59:14AM -0400, Mathieu Desnoyers wrote: > Hi Richard, > > * Richard Braun (rbraun at sceen.net) wrote: > > Hello, > > > > I'm currently studying RCU/URCU, and I have a few questions that I wasn't > > sure where to ask. > > > > 1/ Why use poll instead of sched_yield in e.g. force_mb_all_readers ? > > (I guess it's about portability and the effect is expected to be the same, > > but is there another reason ?) > > poll() allow us to do a millisecond-level wait (timer-based). > sched_yield() is pretty much a scheduler hack that just says "be nice to > other scheduled processes here". Quoting sched_yield(2): > > If the calling thread is the only thread in the highest priority list > at that time, it will continue to run after a call to sched_yield(). > > This is a kind of behavior we don't want. > > > 2/ What was the conclusion of the discussion regarding sys_membarrier ? > > (I couldn't find it in the main mail thread, and it looks quite interesting, > > even though I expect most carefully written applications not to exceed > > one thread per processor too much) > > The conclusion so far was that: > > - the implementation was fine, > - we had to show there were enough users of this new ABI to justify its > inclusion and maintenance cost. Currently, it's pretty much just > liburcu that uses it. As the number of liburcu users grows, this > helps, but what would help even more would be to have other libraries > and applications using sys_membarrier() (other people interested and > weighting in). > > > > > 3/ Do you know if IBM allows the use of patented RCU techniques in GPLv3+ > > code as well ? ("GPL" is mentioned in the Linux documentation, and > > apparently liburcu is covered by LGPLv2+ so I expect that to be the case, > > just looking for a confirmation) > > AFAIK, LGPLv2+ code can migrate into GPLv3+, it's the other way around > that is not permitted. Therefore, I would expect it is allowed, but I > will let Paul answer to this one on behalf of IBM. Yes, LGPLv2+ allows you to migrate to LGPLv3+, which is compatible with GPLv3+. So as long as you derive the code from lttng's userspace-rcu library, you are set. That said, you could also just link userspace-rcu into your GPLv3+ application. Thanx, Paul > Thanks, > > Mathieu > > > > > > Thanks for your answers. > > > > -- > > Richard Braun > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > From jeremie.galarneau at efficios.com Tue May 7 10:43:21 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Tue, 7 May 2013 10:43:21 -0400 Subject: [lttng-dev] babeltrace -i ? In-Reply-To: <20130507134316.GA5118@Krystal> References: <48CF5AC71E61DB46B70D0F388054EFFD01CF4B@VAL-E-01.valcartier.drdc-rddc.gc.ca> <20130507134316.GA5118@Krystal> Message-ID: Fixed by: commit 05cab52530332c97aca9d8c78a8cae2f82f00896 Author: J?r?mie Galarneau Date: Thu Feb 28 21:27:45 2013 -0500 Fix: Ensure the specified input format is CTF Add a check to make sure the input trace format argument passed to the babeltrace converter is "ctf" as it is currently the only one supported. Add a note to this effect in the man page. Fixes #462 Signed-off-by: J?r?mie Galarneau Signed-off-by: Mathieu Desnoyers On Tue, May 7, 2013 at 9:43 AM, Mathieu Desnoyers wrote: > Yep, a clearer error message could help. please file a bug on > bugs.lttng.org. > > * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: >> What is the babeltrace -i, --input-format option meant for? At first I thought one could round-trip a CTF trace to text and back using babeltrace, but if I try this: >> >> $ babeltrace /path_to_the/ctf_trace_directory -w /path_to_the/text_trace_file >> $ babeltrace /path_to_the/text_trace_file -i text -o ctf -w /path_to_the/reconstituted_ctf_trace_directory >> >> The second command gives me: >> >> [error] Cannot open any trace for reading. >> [error] opening trace "/path_to_the/text_trace_file" for reading. >> [error] none of the specified trace paths could be opened. >> >> If '-i ctf' is the only currently-implemented option, then we should get a more appropriate error message when using another: something along the lines of "babeltrace input format not supported ". >> >> Daniel U. Thibault >> R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) >> Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) >> Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) >> 2459 route de la Bravoure >> Qu?bec, QC G3J 1X5 >> CANADA >> Vox : (418) 844-4000 x4245 >> Fax : (418) 844-4538 >> NAC : 918V QSDJ >> Gouvernement du Canada / Government of Canada >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From rbraun at sceen.net Tue May 7 10:51:12 2013 From: rbraun at sceen.net (Richard Braun) Date: Tue, 7 May 2013 16:51:12 +0200 Subject: [lttng-dev] Quick questions about liburcu and RCU in general In-Reply-To: <20130507142352.GA3648@linux.vnet.ibm.com> References: <20130507094636.GA6151@mail.sceen.net> <20130507115914.GB3875@Krystal> <20130507142352.GA3648@linux.vnet.ibm.com> Message-ID: <20130507145112.GA29086@mail.sceen.net> On Tue, May 07, 2013 at 07:23:52AM -0700, Paul E. McKenney wrote: > Yes, LGPLv2+ allows you to migrate to LGPLv3+, which is compatible with > GPLv3+. So as long as you derive the code from lttng's userspace-rcu > library, you are set. > > That said, you could also just link userspace-rcu into your GPLv3+ > application. My question is rather about the techniques than the existing implementations. Is it safe to implement RCU in an unrelated project under GPLv3+, considering it's patented ? -- Richard Braun From dgoulet at efficios.com Tue May 7 10:56:13 2013 From: dgoulet at efficios.com (David Goulet) Date: Tue, 07 May 2013 10:56:13 -0400 Subject: [lttng-dev] [RFC] default channel should not be created when a channel has been explicitly created Message-ID: <5189160D.6080906@efficios.com> Hi everyone, I would like to bring your attention on this issue and have everyone's opinion. https://bugs.lttng.org/issues/522 LTTng 2.2 is right now in release candidate and the question is if this should go in right now as a fix or hold on for 2.3? Also, should it be back ported to 2.1 also? Thanks! David From rbraun at sceen.net Tue May 7 10:59:58 2013 From: rbraun at sceen.net (Richard Braun) Date: Tue, 7 May 2013 16:59:58 +0200 Subject: [lttng-dev] Quick questions about liburcu and RCU in general In-Reply-To: <20130507115914.GB3875@Krystal> References: <20130507094636.GA6151@mail.sceen.net> <20130507115914.GB3875@Krystal> Message-ID: <20130507145958.GA29958@mail.sceen.net> On Tue, May 07, 2013 at 07:59:14AM -0400, Mathieu Desnoyers wrote: > > 1/ Why use poll instead of sched_yield in e.g. force_mb_all_readers ? > > (I guess it's about portability and the effect is expected to be the same, > > but is there another reason ?) > > poll() allow us to do a millisecond-level wait (timer-based). > sched_yield() is pretty much a scheduler hack that just says "be nice to > other scheduled processes here". Quoting sched_yield(2): > > If the calling thread is the only thread in the highest priority list > at that time, it will continue to run after a call to sched_yield(). > > This is a kind of behavior we don't want. Right, I see. But then, poll enforces a minimum delay whatever happens (which may be increased up to the scheduler time slice depending on the kernel). I guess this isn't something we want either. On the other hand, AIUI, poll is called only after all signals were already sent, and if a receiving thread didn't update its need_mb yet, so I expect it's a rare worst case that doesn't require more care. -- Richard Braun From mathieu.desnoyers at efficios.com Tue May 7 11:07:28 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 11:07:28 -0400 Subject: [lttng-dev] Quick questions about liburcu and RCU in general In-Reply-To: <20130507145958.GA29958@mail.sceen.net> References: <20130507094636.GA6151@mail.sceen.net> <20130507115914.GB3875@Krystal> <20130507145958.GA29958@mail.sceen.net> Message-ID: <20130507150728.GA6332@Krystal> * Richard Braun (rbraun at sceen.net) wrote: > On Tue, May 07, 2013 at 07:59:14AM -0400, Mathieu Desnoyers wrote: > > > 1/ Why use poll instead of sched_yield in e.g. force_mb_all_readers ? > > > (I guess it's about portability and the effect is expected to be the same, > > > but is there another reason ?) > > > > poll() allow us to do a millisecond-level wait (timer-based). > > sched_yield() is pretty much a scheduler hack that just says "be nice to > > other scheduled processes here". Quoting sched_yield(2): > > > > If the calling thread is the only thread in the highest priority list > > at that time, it will continue to run after a call to sched_yield(). > > > > This is a kind of behavior we don't want. > > Right, I see. But then, poll enforces a minimum delay whatever happens > (which may be increased up to the scheduler time slice depending on the > kernel). I guess this isn't something we want either. > > On the other hand, AIUI, poll is called only after all signals were > already sent, and if a receiving thread didn't update its need_mb yet, > so I expect it's a rare worst case that doesn't require more care. Indeed, that would be a rare worst case. Moreover, if we really care about this code path execution time, we might want to consider using the wait/wakeup scheme based on sys_futex used elsewhere in the urcu implementation. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From andreb at stud.fh-dortmund.de Tue May 7 11:13:04 2013 From: andreb at stud.fh-dortmund.de (Andre Bette) Date: Tue, 07 May 2013 17:13:04 +0200 Subject: [lttng-dev] Creating a CTF-File Message-ID: <51891A00.8040408@stud.fh-dortmund.de> Hi everyone, I have a question about the concept of the CTF data types implementation. I want to write the packet header and context. Example: BinaryCTFWriter writer = new BinaryCTFWriter("F:/kernel"); // Class from the Javeltrace Project writer.openStream(0); PacketInfo packet = new PacketInfo(0,?,?) ; //PacketInfo(int steamID,StructDefinition header, StructDefinition context) writer.openPacket(packet); ... How do I create the data(Timestamp begin , Timestamp end etc.) for the header and context? I dont understand the concept of StructDefinition/StructDeclaration. Do I need a metadata file for this ? Or can I write it later ? Best Regards, Andre From paulmck at linux.vnet.ibm.com Tue May 7 11:24:37 2013 From: paulmck at linux.vnet.ibm.com (Paul E. McKenney) Date: Tue, 7 May 2013 08:24:37 -0700 Subject: [lttng-dev] Quick questions about liburcu and RCU in general In-Reply-To: <20130507145112.GA29086@mail.sceen.net> References: <20130507094636.GA6151@mail.sceen.net> <20130507115914.GB3875@Krystal> <20130507142352.GA3648@linux.vnet.ibm.com> <20130507145112.GA29086@mail.sceen.net> Message-ID: <20130507152437.GE3648@linux.vnet.ibm.com> On Tue, May 07, 2013 at 04:51:12PM +0200, Richard Braun wrote: > On Tue, May 07, 2013 at 07:23:52AM -0700, Paul E. McKenney wrote: > > Yes, LGPLv2+ allows you to migrate to LGPLv3+, which is compatible with > > GPLv3+. So as long as you derive the code from lttng's userspace-rcu > > library, you are set. > > > > That said, you could also just link userspace-rcu into your GPLv3+ > > application. > > My question is rather about the techniques than the existing > implementations. Is it safe to implement RCU in an unrelated project under > GPLv3+, considering it's patented ? I am not a lawyer, but my understanding is that the GPL patent protection applies to derived works. So if you start with userspace-rcu, adapt it to your application, and relicense to GPLv3+, you should be OK. I do not believe this works if you do a cleanroom implementation, but again, I am not a lawyer. Thanx, Paul From mathieu.desnoyers at efficios.com Tue May 7 11:26:51 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 11:26:51 -0400 Subject: [lttng-dev] [RFC] New LTTng domain attributes (buffer/include/exclude) In-Reply-To: <51385B87.5010500@mentor.com> References: <20130306180313.GA9899@Krystal> <51385B87.5010500@mentor.com> Message-ID: <20130507152651.GA6601@Krystal> * Woegerer, Paul (Paul_Woegerer at mentor.com) wrote: > On 03/06/2013 07:03 PM, Mathieu Desnoyers wrote: > > Other future attributes we plan on adding are inclusion/exclusion lists, > > followed by a comma-separated list: > > > > --include-pid 22,33,44 > > --include-uid 0,5 > > --exclude-pid 12,55 > > --exclude-uid 22 > > How about child processes of the given pids ? Would it be the default to > also collect their events into the buffer ? No, I'm thinking of a --follow-child (-f), similarly to strace. Thoughts ? Thanks, Mathieu > > -- > Paul Woegerer | SW Development Engineer > http://go.mentor.com/sourceryanalyzer > > Mentor Embedded(tm) | Prinz Eugen Stra?e 72/2/4, Vienna, 1040 Austria > Nucleus? | Linux? | Android(tm) | Services | UI | Multi-OS > > Android is a trademark of Google Inc. Use of this trademark is subject > to Google Permissions. > Linux is the registered trademark of Linus Torvalds in the U.S. and > other countries. > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 7 11:29:31 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 11:29:31 -0400 Subject: [lttng-dev] babeltrace and strictly sorting events In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD026371@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD026371@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <20130507152931.GB6601@Krystal> * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > Babeltrace sorts the events submitted to it from a variety of > source files (multiple traces, each potentially with multiple > domains, each potentially with multiple sources (for UST anyway), > each potentially with multiple channels, each potentially with > multiple CPU IDs) based on timestamps (babeltrace/lib/iterator.c's > stream_compare). This works fine, but what about the case where > two events have strictly the same timestamp? Within a single host, > this can only happen if they have different CPU IDs. It can also > happen when merging traces from different hosts. As it currently > stands, stream_compare looks at the timestamps only, so the > ordering in the aforementioned cases is undefined (left to the luck > of the heap sort). makes sense. > > I think stream_compare needs to also check for > (s_a->parent.real_timestamp == s_b->parent.real_timestamp) and, in > that case only, compare hosts (alphabetical ordering is as good as > any), then CPU IDs (numerical ordering). Obviously, this is a > potentially expensive change since this function is called awfully > often when babeltracing or lttngtopping large traces, so maybe the > extra tests could be controlled by a command option (called > --strict-ordering, say). These extra checks would only be needed with timestamps are equal (which is rare). So no perceivable performance impact should be measurable. > > Or is this so rare it's not worth bothering with? In which case a > small cautionary note in babeltrace's man pages would be enough > (those man pages really ought to state that babeltrace's output is > time-ordered; right now they don't mention this at all). It's kind of rare, but could be worthwhile to add. Please open a feature request on the bug tracker against babeltrace. Thanks, Mathieu > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC? G3J 1X5 > CANADA > Vox?: (418) 844-4000 x4245 > Fax?: (418) 844-4538 > NAC?: 918V QSDJ > Gouvernement du Canada?/ Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 7 11:42:26 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 11:42:26 -0400 Subject: [lttng-dev] [LTTNG-TOOLS PATCH] On-disk multiple tracefiles circular buffer In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD026695@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD026695@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <20130507154226.GC6601@Krystal> * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > -----Message d'origine----- > From: Mathieu Desnoyers > > > I having similar questions as Daniel about tracefile-size and tracefile-count. > > > > For each stream, do we have max size used on disk = size * count or size used = size ? > > My understanding is that the maximum size on disk of a stream (channel) would be size*count*CPUs*processes, where processes is the number of user-space processes emitting events on that channel (this number can theoretically be quite large); for the kernel this number is 1. Yes. For per-UID UST buffers the number is also close to 1 (1 per UID per ABI). > > > If there is a doubt about the semantic, maybe using clearer terms that don't need to be explained might help. I guess the confusion here is: > > what is a tracefile exactly ? The notion of "stream" is much clearer than "tracefile" in the CTF spec, so we might want to consider: > > > >--stream-chunks-num NUM: each stream, on disk, is divided in at most > > NUM chunks (one file per chunk). When the maximum number of chunks is > > reached, oldest chunks are deleted for this stream, thus creating > > a flight recorder on disk. > > > >--stream-chunks-size SIZE: chunk size. Must be a multiple of > > subbuf-size. Default value: subbuffer size. > > According to the CTF spec ("Event Stream: An ordered sequence of > events, containing a subset of the trace event types."), an event > stream is an LTTng channel. Wrong. LTTng channel contains several streams (think of it like a class of streams). > This is clearly not the same thing as > an on-disk file (and its corresponding file stream). This would > mean: > > --stream-chunks-num NUM: each file stream (a channel, CPU ID, originating process ID triplet), > on disk, is divided in at most NUM chunks (one file per chunk). When the maximum > number of chunks is reached, the oldest chunks are overwritten by this stream, thus > creating a circular flight recorder on disk. > > > Actually, you might want to consider that the stream-chunk-size need to be a multiple of the subbuffer size. The check needs to be more strict. > > Good idea. Not necessarily a power of two, though. The UI has been fixed already, skipping the part above, > > ########## > > On a somewhat related topic, I find the CTF (1.8.2) spec confusing in sections 5 and 6: > > > 5. Event Packet Header > > > > The event packet header consists of two parts: the "event packet header" > > is the same for all streams of a trace. The second part, the "event > > packet context", is described on a per-stream basis. Both are described > > in the TSDL meta-data. The packets are aligned on architecture-page-sized > > addresses. > [...] > > 5.1 Event Packet Header Description > [...] > > 5.2 Event Packet Context Description > [...] > > 6. Event Structure > > > > The overall structure of an event is: > > > > 1 - Stream Packet Context (as specified by the stream meta-data) > > 2 - Event Header (as specified by the stream meta-data) > > 3 - Stream Event Context (as specified by the stream meta-data) > > 4 - Event Context (as specified by the event meta-data) > > 5 - Event Payload (as specified by the event meta-data) > [...] > > 6.1 Event Header > [...] > > 6.1.1 Type 1 - Few event IDs > [...] > > 6.1.2 Type 2 - Many event IDs > [...] > > 6.2 Event Context > > > > The event context contains information relative to the current event. > > The choice and meaning of this information is specified by the TSDL > > stream and event meta-data descriptions. The stream context is applied > > to all events within the stream. The stream context structure follows > > the event header. The event context is applied to specific events. Its > > structure follows the stream context structure. > [...] > > 6.3 Event Payload > > > > An event payload contains fields specific to a given event type. The fields > > belonging to an event type are described in the event-specific meta-data > > within a structure type. > > The babeltrace output labels the following structured fields in > each event record: > > stream.packet.context > stream.event.header > stream.event.context > event.context > event.fields > > They match section 6: > > > 1 - Stream Packet Context (as specified by the stream meta-data) > > 2 - Event Header (as specified by the stream meta-data) > > 3 - Stream Event Context (as specified by the stream meta-data) > > 4 - Event Context (as specified by the event meta-data) > > 5 - Event Payload (as specified by the event meta-data) > > But where does section 5 fit in? There is no "Event Packet Header" > or "Event Packet Context" in the above. Section 3 mentions that > "The event stream header will therefore be referred to as the > 'event packet header' throughout the rest of this document." > Judging by the C structs described, the lack of a Stream Packet > Context struct in section 6, and the babeltrace output, I'm pretty > sure that the "stream packet context" is the "event packet context" > and that it also subsumes the "event packet header" (a.k.a. "event > stream header"). But it would be nice if this were actually stated > in the CTF spec. Will reply to this part in a separate email. > > I would also like to know if LTTng can populate the "Event Context" > (6.4) of a trace, or if this is something only other CTF producers > may do. I haven't yet been able to produce any traces that have > that field in them, and don't see how to do so. Currently lttng does not produce event context. Thanks, Mathieu > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC G3J 1X5 > CANADA > Vox : (418) 844-4000 x4245 > Fax : (418) 844-4538 > NAC : 918V QSDJ > Gouvernement du Canada / Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 7 12:02:02 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 12:02:02 -0400 Subject: [lttng-dev] [LTTNG-TOOLS PATCH] On-disk multiple tracefiles circular buffer In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD026695@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD026695@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <20130507160202.GD6601@Krystal> * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: [...] > On a somewhat related topic, I find the CTF (1.8.2) spec confusing > in sections 5 and 6: > > > 5. Event Packet Header > > > > The event packet header consists of two parts: the "event packet header" > > is the same for all streams of a trace. The second part, the "event > > packet context", is described on a per-stream basis. Both are described > > in the TSDL meta-data. The packets are aligned on architecture-page-sized > > addresses. > [...] > > 5.1 Event Packet Header Description > [...] > > 5.2 Event Packet Context Description > [...] > > 6. Event Structure > > > > The overall structure of an event is: > > > > 1 - Stream Packet Context (as specified by the stream meta-data) > > 2 - Event Header (as specified by the stream meta-data) > > 3 - Stream Event Context (as specified by the stream meta-data) > > 4 - Event Context (as specified by the event meta-data) > > 5 - Event Payload (as specified by the event meta-data) > [...] > > 6.1 Event Header > [...] > > 6.1.1 Type 1 - Few event IDs > [...] > > 6.1.2 Type 2 - Many event IDs > [...] > > 6.2 Event Context > > > > The event context contains information relative to the current event. > > The choice and meaning of this information is specified by the TSDL > > stream and event meta-data descriptions. The stream context is applied > > to all events within the stream. The stream context structure follows > > the event header. The event context is applied to specific events. Its > > structure follows the stream context structure. > [...] > > 6.3 Event Payload > > > > An event payload contains fields specific to a given event type. The fields > > belonging to an event type are described in the event-specific meta-data > > within a structure type. > > The babeltrace output labels the following structured fields in > each event record: > > stream.packet.context > stream.event.header > stream.event.context > event.context > event.fields > > They match section 6: > > > 1 - Stream Packet Context (as specified by the stream meta-data) > > 2 - Event Header (as specified by the stream meta-data) > > 3 - Stream Event Context (as specified by the stream meta-data) > > 4 - Event Context (as specified by the event meta-data) > > 5 - Event Payload (as specified by the event meta-data) > > But where does section 5 fit in? There is no "Event Packet Header" > or "Event Packet Context" in the above. Section 3 mentions that > "The event stream header will therefore be referred to as the > 'event packet header' throughout the rest of this document." > Judging by the C structs described, the lack of a Stream Packet > Context struct in section 6, and the babeltrace output, I'm pretty > sure that the "stream packet context" is the "event packet context" > and that it also subsumes the "event packet header" (a.k.a. "event > stream header"). But it would be nice if this were actually stated > in the CTF spec. I should not have put info about the packet headers/context within the "6. Event Structure" section. I'm clarifying the title of section 6.2 too. Here is the fix: commit 0b174d87e0f022a098caaeba1789c99a759bca30 Author: Mathieu Desnoyers Date: Tue May 7 12:00:51 2013 -0400 Clarify event layout Signed-off-by: Mathieu Desnoyers Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Tue May 7 12:04:52 2013 From: dgoulet at efficios.com (David Goulet) Date: Tue, 7 May 2013 12:04:52 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix: change default UST per UID subbuffer size Message-ID: <1367942692-10203-1-git-send-email-dgoulet@efficios.com> The default per UID subbuffer size are changed from 4096 bytes to 131072 bytes (128k). Fixes #524 Signed-off-by: David Goulet --- src/bin/lttng-sessiond/channel.c | 40 +++++++++++++++++++++++++------------- src/bin/lttng-sessiond/channel.h | 3 ++- src/bin/lttng-sessiond/cmd.c | 14 ++++++++----- src/common/defaults.c | 9 ++++++--- src/common/defaults.h | 25 ++++++++++++++++++------ src/lib/lttng-ctl/lttng-ctl.c | 6 +++++- 6 files changed, 67 insertions(+), 30 deletions(-) diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index ff2db69..e402d35 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -33,7 +33,8 @@ /* * Return allocated channel attributes. */ -struct lttng_channel *channel_new_default_attr(int dom) +struct lttng_channel *channel_new_default_attr(int dom, + enum lttng_buffer_type type) { struct lttng_channel *chan; @@ -53,6 +54,7 @@ struct lttng_channel *channel_new_default_attr(int dom) switch (dom) { case LTTNG_DOMAIN_KERNEL: + assert(type == LTTNG_BUFFER_GLOBAL); chan->attr.subbuf_size = default_get_kernel_channel_subbuf_size(); chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; @@ -61,12 +63,15 @@ struct lttng_channel *channel_new_default_attr(int dom) chan->attr.read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; break; case LTTNG_DOMAIN_UST: -#if 0 - case LTTNG_DOMAIN_UST_PID: - case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: - case LTTNG_DOMAIN_UST_EXEC_NAME: -#endif - chan->attr.subbuf_size = default_get_ust_channel_subbuf_size(); + switch (type) { + case LTTNG_BUFFER_PER_UID: + chan->attr.subbuf_size = default_get_ust_uid_channel_subbuf_size(); + break; + case LTTNG_BUFFER_PER_PID: + default: + chan->attr.subbuf_size = default_get_ust_pid_channel_subbuf_size(); + break; + } chan->attr.num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; chan->attr.output = DEFAULT_UST_CHANNEL_OUTPUT; chan->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; @@ -158,7 +163,8 @@ int channel_kernel_create(struct ltt_kernel_session *ksession, /* Creating channel attributes if needed */ if (attr == NULL) { - defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); + defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, + LTTNG_BUFFER_GLOBAL); if (defattr == NULL) { ret = LTTNG_ERR_FATAL; goto error; @@ -237,7 +243,7 @@ int channel_ust_create(struct ltt_ust_session *usess, /* Creating channel attributes if needed */ if (attr == NULL) { - defattr = channel_new_default_attr(LTTNG_DOMAIN_UST); + defattr = channel_new_default_attr(LTTNG_DOMAIN_UST, type); if (defattr == NULL) { ret = LTTNG_ERR_FATAL; goto error; @@ -245,11 +251,6 @@ int channel_ust_create(struct ltt_ust_session *usess, attr = defattr; } - if (attr->attr.subbuf_size < DEFAULT_UST_CHANNEL_SUBBUF_SIZE) { - ret = LTTNG_ERR_INVALID; - goto error; - } - /* * Validate UST buffer size and number of buffers: must both be power of 2 * and nonzero. We validate right here for UST, because applications will @@ -285,7 +286,18 @@ int channel_ust_create(struct ltt_ust_session *usess, /* Validate buffer type. */ switch (type) { case LTTNG_BUFFER_PER_PID: + if (attr->attr.subbuf_size < + default_get_ust_pid_channel_subbuf_size()) { + ret = LTTNG_ERR_INVALID; + goto error; + } + break; case LTTNG_BUFFER_PER_UID: + if (attr->attr.subbuf_size < + default_get_ust_uid_channel_subbuf_size()) { + ret = LTTNG_ERR_INVALID; + goto error; + } break; default: ret = LTTNG_ERR_BUFFER_NOT_SUPPORTED; diff --git a/src/bin/lttng-sessiond/channel.h b/src/bin/lttng-sessiond/channel.h index 7fbbb4c..15cabea 100644 --- a/src/bin/lttng-sessiond/channel.h +++ b/src/bin/lttng-sessiond/channel.h @@ -30,7 +30,8 @@ int channel_kernel_enable(struct ltt_kernel_session *ksession, int channel_kernel_create(struct ltt_kernel_session *ksession, struct lttng_channel *chan, int kernel_pipe); -struct lttng_channel *channel_new_default_attr(int domain); +struct lttng_channel *channel_new_default_attr(int domain, + enum lttng_buffer_type type); int channel_ust_create(struct ltt_ust_session *usess, struct lttng_channel *attr, enum lttng_buffer_type type); diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 5d2cba1..528665a 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1106,7 +1106,7 @@ int cmd_add_context(struct ltt_session *session, int domain, if (chan_count == 0) { struct lttng_channel *attr; /* Create default channel */ - attr = channel_new_default_attr(domain); + attr = channel_new_default_attr(domain, usess->buffer_type); if (attr == NULL) { ret = LTTNG_ERR_FATAL; goto error; @@ -1166,7 +1166,8 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, kchan = trace_kernel_get_channel_by_name(channel_name, session->kernel_session); if (kchan == NULL) { - attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); + attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, + LTTNG_BUFFER_GLOBAL); if (attr == NULL) { ret = LTTNG_ERR_FATAL; goto error; @@ -1216,7 +1217,8 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, channel_name); if (uchan == NULL) { /* Create default channel */ - attr = channel_new_default_attr(LTTNG_DOMAIN_UST); + attr = channel_new_default_attr(LTTNG_DOMAIN_UST, + usess->buffer_type); if (attr == NULL) { ret = LTTNG_ERR_FATAL; goto error; @@ -1286,7 +1288,8 @@ int cmd_enable_event_all(struct ltt_session *session, session->kernel_session); if (kchan == NULL) { /* Create default channel */ - attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); + attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, + LTTNG_BUFFER_GLOBAL); if (attr == NULL) { ret = LTTNG_ERR_FATAL; goto error; @@ -1350,7 +1353,8 @@ int cmd_enable_event_all(struct ltt_session *session, channel_name); if (uchan == NULL) { /* Create default channel */ - attr = channel_new_default_attr(LTTNG_DOMAIN_UST); + attr = channel_new_default_attr(LTTNG_DOMAIN_UST, + usess->buffer_type); if (attr == NULL) { ret = LTTNG_ERR_FATAL; goto error; diff --git a/src/common/defaults.c b/src/common/defaults.c index ccdbaf4..39afda2 100644 --- a/src/common/defaults.c +++ b/src/common/defaults.c @@ -24,7 +24,8 @@ size_t default_channel_subbuf_size; size_t default_metadata_subbuf_size; size_t default_kernel_channel_subbuf_size; -size_t default_ust_channel_subbuf_size; +size_t default_ust_pid_channel_subbuf_size; +size_t default_ust_uid_channel_subbuf_size; static void __attribute__((constructor)) init_defaults(void) { @@ -44,6 +45,8 @@ static void __attribute__((constructor)) init_defaults(void) max(DEFAULT_METADATA_SUBBUF_SIZE, page_size); default_kernel_channel_subbuf_size = max(DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE, page_size); - default_ust_channel_subbuf_size = - max(DEFAULT_UST_CHANNEL_SUBBUF_SIZE, page_size); + default_ust_pid_channel_subbuf_size = + max(DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE, page_size); + default_ust_uid_channel_subbuf_size = + max(DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE, page_size); } diff --git a/src/common/defaults.h b/src/common/defaults.h index fb6a975..4606976 100644 --- a/src/common/defaults.h +++ b/src/common/defaults.h @@ -148,7 +148,8 @@ /* User space defaults */ /* Must be a power of 2 */ -#define DEFAULT_UST_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ +#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ +#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072 /* bytes */ /* Must be a power of 2. Update help manuall if override. */ #define DEFAULT_UST_CHANNEL_SUBBUF_NUM DEFAULT_CHANNEL_SUBBUF_NUM /* See lttng-ust.h enum lttng_ust_output */ @@ -202,10 +203,10 @@ extern size_t default_channel_subbuf_size; extern size_t default_metadata_subbuf_size; -extern size_t default_ust_channel_subbuf_size; +extern size_t default_ust_pid_channel_subbuf_size; +extern size_t default_ust_uid_channel_subbuf_size; extern size_t default_kernel_channel_subbuf_size; - /* * Returns the default subbuf size. * @@ -243,15 +244,27 @@ size_t default_get_kernel_channel_subbuf_size(void) } /* - * Returns the default subbuf size for the UST domain. + * Returns the default subbuf size for the UST domain per PID. + * + * This function depends on a value that is set at constructor time, so it is + * unsafe to call it from another constructor. + */ +static inline +size_t default_get_ust_pid_channel_subbuf_size(void) +{ + return default_ust_pid_channel_subbuf_size; +} + +/* + * Returns the default subbuf size for the UST domain per UID. * * This function depends on a value that is set at constructor time, so it is * unsafe to call it from another constructor. */ static inline -size_t default_get_ust_channel_subbuf_size(void) +size_t default_get_ust_uid_channel_subbuf_size(void) { - return default_ust_channel_subbuf_size; + return default_ust_uid_channel_subbuf_size; } #endif /* _DEFAULTS_H */ diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 3787e29..96c3ccd 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -1403,7 +1403,11 @@ void lttng_channel_set_default_attr(struct lttng_domain *domain, attr->switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; attr->read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; - attr->subbuf_size = default_get_ust_channel_subbuf_size(); + if (domain->buf_type == LTTNG_BUFFER_PER_UID) { + attr->subbuf_size = default_get_ust_uid_channel_subbuf_size(); + } else { + attr->subbuf_size = default_get_ust_pid_channel_subbuf_size(); + } attr->num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; attr->output = DEFAULT_UST_CHANNEL_OUTPUT; attr->tracefile_size = DEFAULT_UST_CHANNEL_TRACEFILE_SIZE; -- 1.7.10.4 From mathieu.desnoyers at efficios.com Tue May 7 12:19:05 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 12:19:05 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix: change default UST per UID subbuffer size In-Reply-To: <1367942692-10203-1-git-send-email-dgoulet@efficios.com> References: <1367942692-10203-1-git-send-email-dgoulet@efficios.com> Message-ID: <20130507161904.GE6601@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > The default per UID subbuffer size are changed from 4096 bytes to 131072 > bytes (128k). > > Fixes #524 > > Signed-off-by: David Goulet > --- > src/bin/lttng-sessiond/channel.c | 40 +++++++++++++++++++++++++------------- > src/bin/lttng-sessiond/channel.h | 3 ++- > src/bin/lttng-sessiond/cmd.c | 14 ++++++++----- > src/common/defaults.c | 9 ++++++--- > src/common/defaults.h | 25 ++++++++++++++++++------ > src/lib/lttng-ctl/lttng-ctl.c | 6 +++++- > 6 files changed, 67 insertions(+), 30 deletions(-) [...] > diff --git a/src/common/defaults.h b/src/common/defaults.h > index fb6a975..4606976 100644 > --- a/src/common/defaults.h > +++ b/src/common/defaults.h > @@ -148,7 +148,8 @@ > /* User space defaults */ > > /* Must be a power of 2 */ > -#define DEFAULT_UST_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ > +#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ > +#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072 /* bytes */ Since we introduce DEFAULT_UST_{PID,UID}_* for SUBBUF_SIZE, I think it would make sense to introduce PID and UID defaults for SUBBUF_NUM and OUTPUT. They can simply map to their respective DEFAULT_UST_CHANNEL defaults. I recommend we rename DEFAULT_UST_CHANNEL_* defaults to _DEFAULT_UST_CHANNEL_* (leading underscore) so we ensure we don't forget any site that uses the old macro. The code that uses those should always use the UID/PID macros from now on. Having this in place will make it much easier to make default value changes in the future if need be without the risk of forgetting to changes some instances in the code (see commit 9f778c9a8f1d65f5bfdde7cfd7294492d6fdd34c as an example of a case we had to fix an issue that arised from inconsistency). Moreover, I think you forgot to update the documentation (manpage + enable-channel --help). Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Tue May 7 12:48:11 2013 From: dgoulet at efficios.com (David Goulet) Date: Tue, 07 May 2013 12:48:11 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix: change default UST per UID subbuffer size In-Reply-To: <20130507161904.GE6601@Krystal> References: <1367942692-10203-1-git-send-email-dgoulet@efficios.com> <20130507161904.GE6601@Krystal> Message-ID: <5189304B.3050108@efficios.com> Mathieu Desnoyers: > * David Goulet (dgoulet at efficios.com) wrote: >> The default per UID subbuffer size are changed from 4096 bytes to 131072 >> bytes (128k). >> >> Fixes #524 >> >> Signed-off-by: David Goulet >> --- >> src/bin/lttng-sessiond/channel.c | 40 +++++++++++++++++++++++++------------- >> src/bin/lttng-sessiond/channel.h | 3 ++- >> src/bin/lttng-sessiond/cmd.c | 14 ++++++++----- >> src/common/defaults.c | 9 ++++++--- >> src/common/defaults.h | 25 ++++++++++++++++++------ >> src/lib/lttng-ctl/lttng-ctl.c | 6 +++++- >> 6 files changed, 67 insertions(+), 30 deletions(-) > [...] > >> diff --git a/src/common/defaults.h b/src/common/defaults.h >> index fb6a975..4606976 100644 >> --- a/src/common/defaults.h >> +++ b/src/common/defaults.h >> @@ -148,7 +148,8 @@ >> /* User space defaults */ >> >> /* Must be a power of 2 */ >> -#define DEFAULT_UST_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ >> +#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ >> +#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072 /* bytes */ > > Since we introduce DEFAULT_UST_{PID,UID}_* for SUBBUF_SIZE, I think it > would make sense to introduce PID and UID defaults for SUBBUF_NUM and > OUTPUT. They can simply map to their respective DEFAULT_UST_CHANNEL > defaults. I recommend we rename DEFAULT_UST_CHANNEL_* defaults to > _DEFAULT_UST_CHANNEL_* (leading underscore) so we ensure we don't forget > any site that uses the old macro. The code that uses those should always > use the UID/PID macros from now on. Having this in place will make it > much easier to make default value changes in the future if need be > without the risk of forgetting to changes some instances in the code > (see commit 9f778c9a8f1d65f5bfdde7cfd7294492d6fdd34c as an example of a > case we had to fix an issue that arised from inconsistency). Not sure I understand here. Don't you mean rename DEFAULT_CHANNEL_* with an underscore in order to make sure only domain specific values are used in the code base? or every UST macros that are not used outside the scope of default.h ? Actually, subbuffer size are accessed through a getter in default.c returning the max() value between our defaults and a page size. That said, this means their should be *no* call site that uses the subbuffer size macro. > > Moreover, I think you forgot to update the documentation (manpage + > enable-channel --help). Right. Cheers! David > > Thanks, > > Mathieu > From mathieu.desnoyers at efficios.com Tue May 7 14:30:37 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 14:30:37 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix: change default UST per UID subbuffer size In-Reply-To: <5189304B.3050108@efficios.com> References: <1367942692-10203-1-git-send-email-dgoulet@efficios.com> <20130507161904.GE6601@Krystal> <5189304B.3050108@efficios.com> Message-ID: <20130507183037.GA7681@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > > > Mathieu Desnoyers: > > * David Goulet (dgoulet at efficios.com) wrote: > >> The default per UID subbuffer size are changed from 4096 bytes to 131072 > >> bytes (128k). > >> > >> Fixes #524 > >> > >> Signed-off-by: David Goulet > >> --- > >> src/bin/lttng-sessiond/channel.c | 40 +++++++++++++++++++++++++------------- > >> src/bin/lttng-sessiond/channel.h | 3 ++- > >> src/bin/lttng-sessiond/cmd.c | 14 ++++++++----- > >> src/common/defaults.c | 9 ++++++--- > >> src/common/defaults.h | 25 ++++++++++++++++++------ > >> src/lib/lttng-ctl/lttng-ctl.c | 6 +++++- > >> 6 files changed, 67 insertions(+), 30 deletions(-) > > [...] > > > >> diff --git a/src/common/defaults.h b/src/common/defaults.h > >> index fb6a975..4606976 100644 > >> --- a/src/common/defaults.h > >> +++ b/src/common/defaults.h > >> @@ -148,7 +148,8 @@ > >> /* User space defaults */ > >> > >> /* Must be a power of 2 */ > >> -#define DEFAULT_UST_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ > >> +#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ > >> +#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072 /* bytes */ > > > > Since we introduce DEFAULT_UST_{PID,UID}_* for SUBBUF_SIZE, I think it > > would make sense to introduce PID and UID defaults for SUBBUF_NUM and > > OUTPUT. They can simply map to their respective DEFAULT_UST_CHANNEL > > defaults. I recommend we rename DEFAULT_UST_CHANNEL_* defaults to > > _DEFAULT_UST_CHANNEL_* (leading underscore) so we ensure we don't forget > > any site that uses the old macro. The code that uses those should always > > use the UID/PID macros from now on. Having this in place will make it > > much easier to make default value changes in the future if need be > > without the risk of forgetting to changes some instances in the code > > (see commit 9f778c9a8f1d65f5bfdde7cfd7294492d6fdd34c as an example of a > > case we had to fix an issue that arised from inconsistency). > > Not sure I understand here. Don't you mean rename DEFAULT_CHANNEL_* with > an underscore in order to make sure only domain specific values are used > in the code base? or every UST macros that are not used outside the > scope of default.h ? Resolved by phone discussion. I look forward to the updated patch. Thanks, Mathieu > > Actually, subbuffer size are accessed through a getter in default.c > returning the max() value between our defaults and a page size. That > said, this means their should be *no* call site that uses the subbuffer > size macro. > > > > > Moreover, I think you forgot to update the documentation (manpage + > > enable-channel --help). > > Right. > > Cheers! > David > > > > > Thanks, > > > > Mathieu > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From aspear at vmware.com Tue May 7 14:49:50 2013 From: aspear at vmware.com (Aaron Spear) Date: Tue, 7 May 2013 11:49:50 -0700 (PDT) Subject: [lttng-dev] Using the additional Eclipse Kernel Trace Plugin Views (Control flow, Resources) In-Reply-To: <5180D919.1020208@stud.fh-dortmund.de> References: <517F8D02.4090202@stud.fh-dortmund.de> <518004F6.5040202@ericsson.com> <51800F67.9040407@voxpopuli.im> <5180D919.1020208@stud.fh-dortmund.de> Message-ID: <652778195.2091532.1367952590522.JavaMail.root@vmware.com> Hi Andre, You will probably also want to search the recent traffic on the linuxtools-dev email list as well. (That is probably the more appropriate forum for questions related to the linuxtools LTTng plugins/Java code) I recently posted a github link to some work in progress where I did went through the process that Alexandre described to create a completely data driven view to show state over time (though I didn't have the advantage of his explanation!). I am using it to trace various things such as Java applications as well as state of virtual machines and such over time. It is not perfect or complete, but it is headed in the right direction. Here is a link to the list archive: http://dev.eclipse.org/mhonarc/lists/linuxtools-dev/, and a direct link to my post: http://dev.eclipse.org/mhonarc/lists/linuxtools-dev/msg02574.html Somewhere in that thread are some screenshots and such of what I did with it. regards, Aaron Spear ----- Original Message ----- > Hi Alexandre and Matthew, > > Thank you both very much for the detailed answer. If I have more > questions about some Javacode I will ask later . > > > Best Regards, > Andre > > PS: Sorry for the doublepost > > > > > Am 30.04.2013 20:37, schrieb Alexandre Montplaisir: > > On 13-04-30 01:52 PM, Matthew Khouzam wrote: > >> Hi Andre, > >> This question seems familiar, I will paste an answer from earlier. > >> On 13-04-30 05:21 AM, Andre Bette wrote: > >>> Hi to everyone, > >>> in my project I am tracing a embedded system with a non linux OS. > >>> Output format is CTF. I really like the two extra views in the Eclipse > >>> Kernel Trace Visualization (Control flow, Resources). > >>> > >>> Is there a simple way to use this two views with an non linux trace ? > >>> Is there any documentation about the Linux kernel trace format( the > >>> extra info added into the CTF format) or how the > >>> data(e.g. prozesses) is processed in the Eclipse Kernel Trace Plugin > >>> (The idea is to use a "fake" linux trace to use the two extra views )? > >>> > >> I will give a short answer that I am sure Alexandre Montplaisir has > >> expanded on earlier is YES! > > Yeah my first reply bounced, but you can read it here: > > http://lists.lttng.org/pipermail/lttng-dev/2013-April/020165.html > > > > Cheers, > > Alex > > > >> You need to make a state system with a "state system input" that will > >> emulate the directory structure of the kernel state system. > >> > >> It's not EXTREMELY hard, but I think it will get significantly easier in a > >> couple of months. > >> Great to hear you like the eclipse viewer, fan mail is always appreciated, > >> especially in duplicate! > >> > >> Matthew > >> > >>> Best Regards, > >>> Andre > >>> > >>> _______________________________________________ > >>> lttng-dev mailing list > >>> lttng-dev at lists.lttng.org > >>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > >> _______________________________________________ > >> lttng-dev mailing list > >> lttng-dev at lists.lttng.org > >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From dgoulet at efficios.com Tue May 7 15:09:10 2013 From: dgoulet at efficios.com (David Goulet) Date: Tue, 7 May 2013 15:09:10 -0400 Subject: [lttng-dev] =?utf-8?q?=5BPATCH_lttng-tools=5D_Fix=3A_split_UST_pe?= =?utf-8?q?r_UID/PID_default_values?= Message-ID: <1367953750-7731-1-git-send-email-dgoulet@efficios.com> The default per UID subbuffer size are changed from 4096 bytes to 131072 bytes (128k). The rest have the same values as before. Some DEFAULT_CHANNEL_* macros are prefixed with an underscore making sure they are not used elsewhere in the code base and only domain specific values are used. Fixes #524 Signed-off-by: David Goulet --- doc/man/lttng.1 | 15 ++++-- src/bin/lttng-sessiond/channel.c | 59 ++++++++++++++------- src/bin/lttng-sessiond/channel.h | 3 +- src/bin/lttng-sessiond/cmd.c | 14 +++-- src/bin/lttng-sessiond/trace-ust.c | 4 +- src/bin/lttng-sessiond/ust-app.c | 4 +- src/bin/lttng/commands/enable_channels.c | 32 ++++++++---- src/common/defaults.c | 11 ++-- src/common/defaults.h | 84 +++++++++++++++++------------- src/lib/lttng-ctl/lttng-ctl.c | 36 ++++++++----- tests/unit/test_ust_data.c | 4 +- 11 files changed, 168 insertions(+), 98 deletions(-) diff --git a/doc/man/lttng.1 b/doc/man/lttng.1 index 37c2063..aa98990 100644 --- a/doc/man/lttng.1 +++ b/doc/man/lttng.1 @@ -327,17 +327,21 @@ same type. \-\-overwrite Flight recorder mode : overwrites events when subbuffers are full \-\-subbuf-size SIZE - Subbuffer size in bytes {+k,+M,+G} (default: 4096, kernel default: 262144) + Subbuffer size in bytes {+k,+M,+G} + (default UST uid: 131072, UST pid: 4096, kernel: 262144) Rounded up to the next power of 2. \-\-num-subbuf NUM - Number of subbuffers (default: 4) + Number of subbuffers. (default UST uid: 4, UST pid: 4, kernel: 4) Rounded up to the next power of 2. \-\-switch-timer USEC - Switch subbuffer timer interval in ?sec (default: 0) + Switch subbuffer timer interval in ?sec. + (default UST uid: 0, UST pid: 0, kernel: 0) \-\-read-timer USEC - Read timer interval in ?sec (UST default: 0, kernel default: 200000) + Read timer interval in ?sec. + (default UST uid: 0, UST pid: 0, kernel: 200000) \-\-output TYPE Channel output type. Possible values: mmap, splice + (default UST uid: mmap, UST pid: mmap, kernel: splice) \-\-buffers-uid Use per UID buffer (\-u only). Buffers are shared between applications that have the same UID. @@ -347,9 +351,10 @@ same type. Use shared buffer for the whole system (\-k only) \-C, \-\-tracefile-size SIZE Maximum size of each tracefile within a stream (in bytes). + 0 means unlimited. (default: 0) \-W, \-\-tracefile-count COUNT Used in conjunction with \-C option, this will limit the number - of files created to the specified count. + of files created to the specified count. 0 means unlimited. (default: 0) .B EXAMPLES: diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index ff2db69..8f835fd 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -33,7 +33,8 @@ /* * Return allocated channel attributes. */ -struct lttng_channel *channel_new_default_attr(int dom) +struct lttng_channel *channel_new_default_attr(int dom, + enum lttng_buffer_type type) { struct lttng_channel *chan; @@ -49,10 +50,14 @@ struct lttng_channel *channel_new_default_attr(int dom) goto error; } + /* Same for all domains. */ chan->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; + chan->attr.tracefile_size = DEFAULT_CHANNEL_TRACEFILE_SIZE; + chan->attr.tracefile_count = DEFAULT_CHANNEL_TRACEFILE_COUNT; switch (dom) { case LTTNG_DOMAIN_KERNEL: + assert(type == LTTNG_BUFFER_GLOBAL); chan->attr.subbuf_size = default_get_kernel_channel_subbuf_size(); chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; @@ -61,16 +66,27 @@ struct lttng_channel *channel_new_default_attr(int dom) chan->attr.read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; break; case LTTNG_DOMAIN_UST: -#if 0 - case LTTNG_DOMAIN_UST_PID: - case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: - case LTTNG_DOMAIN_UST_EXEC_NAME: -#endif - chan->attr.subbuf_size = default_get_ust_channel_subbuf_size(); - chan->attr.num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; - chan->attr.output = DEFAULT_UST_CHANNEL_OUTPUT; - chan->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; - chan->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; + switch (type) { + case LTTNG_BUFFER_PER_UID: + chan->attr.subbuf_size = default_get_ust_uid_channel_subbuf_size(); + chan->attr.num_subbuf = DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM; + chan->attr.output = DEFAULT_UST_UID_CHANNEL_OUTPUT; + chan->attr.switch_timer_interval = + DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER; + chan->attr.read_timer_interval = + DEFAULT_UST_UID_CHANNEL_READ_TIMER; + break; + case LTTNG_BUFFER_PER_PID: + default: + chan->attr.subbuf_size = default_get_ust_pid_channel_subbuf_size(); + chan->attr.num_subbuf = DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM; + chan->attr.output = DEFAULT_UST_PID_CHANNEL_OUTPUT; + chan->attr.switch_timer_interval = + DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER; + chan->attr.read_timer_interval = + DEFAULT_UST_PID_CHANNEL_READ_TIMER; + break; + } break; default: goto error; /* Not implemented */ @@ -158,7 +174,8 @@ int channel_kernel_create(struct ltt_kernel_session *ksession, /* Creating channel attributes if needed */ if (attr == NULL) { - defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); + defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, + LTTNG_BUFFER_GLOBAL); if (defattr == NULL) { ret = LTTNG_ERR_FATAL; goto error; @@ -237,7 +254,7 @@ int channel_ust_create(struct ltt_ust_session *usess, /* Creating channel attributes if needed */ if (attr == NULL) { - defattr = channel_new_default_attr(LTTNG_DOMAIN_UST); + defattr = channel_new_default_attr(LTTNG_DOMAIN_UST, type); if (defattr == NULL) { ret = LTTNG_ERR_FATAL; goto error; @@ -245,11 +262,6 @@ int channel_ust_create(struct ltt_ust_session *usess, attr = defattr; } - if (attr->attr.subbuf_size < DEFAULT_UST_CHANNEL_SUBBUF_SIZE) { - ret = LTTNG_ERR_INVALID; - goto error; - } - /* * Validate UST buffer size and number of buffers: must both be power of 2 * and nonzero. We validate right here for UST, because applications will @@ -285,7 +297,18 @@ int channel_ust_create(struct ltt_ust_session *usess, /* Validate buffer type. */ switch (type) { case LTTNG_BUFFER_PER_PID: + if (attr->attr.subbuf_size < + default_get_ust_pid_channel_subbuf_size()) { + ret = LTTNG_ERR_INVALID; + goto error; + } + break; case LTTNG_BUFFER_PER_UID: + if (attr->attr.subbuf_size < + default_get_ust_uid_channel_subbuf_size()) { + ret = LTTNG_ERR_INVALID; + goto error; + } break; default: ret = LTTNG_ERR_BUFFER_NOT_SUPPORTED; diff --git a/src/bin/lttng-sessiond/channel.h b/src/bin/lttng-sessiond/channel.h index 7fbbb4c..15cabea 100644 --- a/src/bin/lttng-sessiond/channel.h +++ b/src/bin/lttng-sessiond/channel.h @@ -30,7 +30,8 @@ int channel_kernel_enable(struct ltt_kernel_session *ksession, int channel_kernel_create(struct ltt_kernel_session *ksession, struct lttng_channel *chan, int kernel_pipe); -struct lttng_channel *channel_new_default_attr(int domain); +struct lttng_channel *channel_new_default_attr(int domain, + enum lttng_buffer_type type); int channel_ust_create(struct ltt_ust_session *usess, struct lttng_channel *attr, enum lttng_buffer_type type); diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 5d2cba1..528665a 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1106,7 +1106,7 @@ int cmd_add_context(struct ltt_session *session, int domain, if (chan_count == 0) { struct lttng_channel *attr; /* Create default channel */ - attr = channel_new_default_attr(domain); + attr = channel_new_default_attr(domain, usess->buffer_type); if (attr == NULL) { ret = LTTNG_ERR_FATAL; goto error; @@ -1166,7 +1166,8 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, kchan = trace_kernel_get_channel_by_name(channel_name, session->kernel_session); if (kchan == NULL) { - attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); + attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, + LTTNG_BUFFER_GLOBAL); if (attr == NULL) { ret = LTTNG_ERR_FATAL; goto error; @@ -1216,7 +1217,8 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, channel_name); if (uchan == NULL) { /* Create default channel */ - attr = channel_new_default_attr(LTTNG_DOMAIN_UST); + attr = channel_new_default_attr(LTTNG_DOMAIN_UST, + usess->buffer_type); if (attr == NULL) { ret = LTTNG_ERR_FATAL; goto error; @@ -1286,7 +1288,8 @@ int cmd_enable_event_all(struct ltt_session *session, session->kernel_session); if (kchan == NULL) { /* Create default channel */ - attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); + attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, + LTTNG_BUFFER_GLOBAL); if (attr == NULL) { ret = LTTNG_ERR_FATAL; goto error; @@ -1350,7 +1353,8 @@ int cmd_enable_event_all(struct ltt_session *session, channel_name); if (uchan == NULL) { /* Create default channel */ - attr = channel_new_default_attr(LTTNG_DOMAIN_UST); + attr = channel_new_default_attr(LTTNG_DOMAIN_UST, + usess->buffer_type); if (attr == NULL) { ret = LTTNG_ERR_FATAL; goto error; diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 7592d77..8fb685c 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -384,8 +384,8 @@ struct ltt_ust_metadata *trace_ust_create_metadata(char *path) lum->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; lum->attr.subbuf_size = default_get_metadata_subbuf_size(); lum->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; - lum->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; - lum->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; + lum->attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER; + lum->attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER; lum->attr.output = LTTNG_UST_MMAP; lum->handle = -1; diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index e362381..5710226 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -2527,8 +2527,8 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, metadata->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; metadata->attr.subbuf_size = default_get_metadata_subbuf_size(); metadata->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; - metadata->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; - metadata->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; + metadata->attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER; + metadata->attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER; metadata->attr.output = LTTNG_UST_MMAP; metadata->attr.type = LTTNG_UST_CHAN_METADATA; } else { diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index 4816d62..c7bbca1 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -104,28 +104,40 @@ static void usage(FILE *ofp) fprintf(ofp, " --overwrite Flight recorder mode%s\n", DEFAULT_CHANNEL_OVERWRITE ? " (default)" : ""); fprintf(ofp, " --subbuf-size SIZE Subbuffer size in bytes {+k,+M,+G}\n"); - fprintf(ofp, " (default: %zu, kernel default: %zu)\n", - default_get_channel_subbuf_size(), + fprintf(ofp, " (default UST uid: %zu, UST pid: %zu, kernel: %zu)\n", + default_get_ust_uid_channel_subbuf_size(), + default_get_ust_pid_channel_subbuf_size(), default_get_kernel_channel_subbuf_size()); fprintf(ofp, " Rounded up to the next power of 2.\n"); fprintf(ofp, " --num-subbuf NUM Number of subbufers\n"); - fprintf(ofp, " (default: %u)\n", - DEFAULT_CHANNEL_SUBBUF_NUM); + fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u)\n", + DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM, DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM, + DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM); fprintf(ofp, " Rounded up to the next power of 2.\n"); - fprintf(ofp, " --switch-timer USEC Switch timer interval in usec (default: %u)\n", - DEFAULT_CHANNEL_SWITCH_TIMER); - fprintf(ofp, " --read-timer USEC Read timer interval in usec (UST default: %u, kernel default: %u)\n", - DEFAULT_UST_CHANNEL_READ_TIMER, DEFAULT_KERNEL_CHANNEL_READ_TIMER); + fprintf(ofp, " --switch-timer USEC Switch timer interval in usec\n"); + fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u)\n", + DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER, DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER, + DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER); + fprintf(ofp, " --read-timer USEC Read timer interval in usec.\n"); + fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u)\n", + DEFAULT_UST_UID_CHANNEL_READ_TIMER, DEFAULT_UST_UID_CHANNEL_READ_TIMER, + DEFAULT_KERNEL_CHANNEL_READ_TIMER); fprintf(ofp, " --output TYPE Channel output type (Values: %s, %s)\n", output_mmap, output_splice); + fprintf(ofp, " (default UST uid: %s, UST pid: %s, kernel: %s)\n", + DEFAULT_UST_UID_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice, + DEFAULT_UST_PID_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice, + DEFAULT_KERNEL_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice); fprintf(ofp, " --buffers-uid Use per UID buffer (-u only)\n"); fprintf(ofp, " --buffers-pid Use per PID buffer (-u only)\n"); fprintf(ofp, " --buffers-global Use shared buffer for the whole system (-k only)\n"); fprintf(ofp, " -C, --tracefile-size SIZE\n"); - fprintf(ofp, " Maximum size of each tracefile within a stream (in bytes).\n"); + fprintf(ofp, " Maximum size of each tracefile within a stream (in bytes). 0 means unlimited.\n"); + fprintf(ofp, " (default: %u)\n", DEFAULT_CHANNEL_TRACEFILE_SIZE); fprintf(ofp, " -W, --tracefile-count COUNT\n"); fprintf(ofp, " Used in conjunction with -C option, this will limit the number\n"); - fprintf(ofp, " of files created to the specified count.\n"); + fprintf(ofp, " of files created to the specified count. 0 means unlimited.\n"); + fprintf(ofp, " (default: %u)\n", DEFAULT_CHANNEL_TRACEFILE_COUNT); fprintf(ofp, "\n"); } diff --git a/src/common/defaults.c b/src/common/defaults.c index ccdbaf4..d74a42b 100644 --- a/src/common/defaults.c +++ b/src/common/defaults.c @@ -24,7 +24,8 @@ size_t default_channel_subbuf_size; size_t default_metadata_subbuf_size; size_t default_kernel_channel_subbuf_size; -size_t default_ust_channel_subbuf_size; +size_t default_ust_pid_channel_subbuf_size; +size_t default_ust_uid_channel_subbuf_size; static void __attribute__((constructor)) init_defaults(void) { @@ -39,11 +40,13 @@ static void __attribute__((constructor)) init_defaults(void) } default_channel_subbuf_size = - max(DEFAULT_CHANNEL_SUBBUF_SIZE, page_size); + max(_DEFAULT_CHANNEL_SUBBUF_SIZE, page_size); default_metadata_subbuf_size = max(DEFAULT_METADATA_SUBBUF_SIZE, page_size); default_kernel_channel_subbuf_size = max(DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE, page_size); - default_ust_channel_subbuf_size = - max(DEFAULT_UST_CHANNEL_SUBBUF_SIZE, page_size); + default_ust_pid_channel_subbuf_size = + max(DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE, page_size); + default_ust_uid_channel_subbuf_size = + max(DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE, page_size); } diff --git a/src/common/defaults.h b/src/common/defaults.h index fb6a975..2c73277 100644 --- a/src/common/defaults.h +++ b/src/common/defaults.h @@ -112,55 +112,57 @@ /* Default channel attributes */ #define DEFAULT_CHANNEL_NAME "channel0" -#define DEFAULT_CHANNEL_OVERWRITE 0 /* usec */ -/* DEFAULT_CHANNEL_SUBBUF_SIZE must always be a power of 2 */ -#define DEFAULT_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ -/* DEFAULT_CHANNEL_SUBBUF_NUM must always be a power of 2 */ -#define DEFAULT_CHANNEL_SUBBUF_NUM 4 -#define DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */ -#define DEFAULT_CHANNEL_READ_TIMER 200000 /* usec */ -#define DEFAULT_CHANNEL_OUTPUT LTTNG_EVENT_MMAP - +#define DEFAULT_CHANNEL_OVERWRITE 0 +#define DEFAULT_CHANNEL_TRACEFILE_SIZE 0 +#define DEFAULT_CHANNEL_TRACEFILE_COUNT 0 + +/* Must always be a power of 2 */ +#define _DEFAULT_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ +/* Must always be a power of 2 */ +#define _DEFAULT_CHANNEL_SUBBUF_NUM 4 +#define _DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */ +#define _DEFAULT_CHANNEL_READ_TIMER 200000 /* usec */ +#define _DEFAULT_CHANNEL_OUTPUT LTTNG_EVENT_MMAP + +/* Metadata channel defaults. */ #define DEFAULT_METADATA_SUBBUF_SIZE 4096 #define DEFAULT_METADATA_SUBBUF_NUM 2 #define DEFAULT_METADATA_CACHE_SIZE 4096 +#define DEFAULT_METADATA_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER +#define DEFAULT_METADATA_READ_TIMER _DEFAULT_CHANNEL_READ_TIMER +#define DEFAULT_METADATA_OUTPUT _DEFAULT_CHANNEL_OUTPUT /* Kernel has different defaults */ /* DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE must always be a power of 2 */ -#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE 262144 /* bytes */ +#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE 262144 /* bytes */ /* * DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM must always be a power of 2. * Update help manually if override. */ -#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM DEFAULT_CHANNEL_SUBBUF_NUM +#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM /* See lttng-kernel.h enum lttng_kernel_output for channel output */ -#define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_EVENT_SPLICE -/* By default, unlimited tracefile size */ -#define DEFAULT_KERNEL_CHANNEL_TRACEFILE_SIZE 0 -/* By default, unlimited tracefile count */ -#define DEFAULT_KERNEL_CHANNEL_TRACEFILE_COUNT 0 - -#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER \ - DEFAULT_CHANNEL_SWITCH_TIMER -#define DEFAULT_KERNEL_CHANNEL_READ_TIMER 200000 /* usec */ +#define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_EVENT_SPLICE +#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER +#define DEFAULT_KERNEL_CHANNEL_READ_TIMER _DEFAULT_CHANNEL_READ_TIMER /* User space defaults */ /* Must be a power of 2 */ -#define DEFAULT_UST_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ +#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE _DEFAULT_CHANNEL_SUBBUF_SIZE +#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072 /* bytes */ /* Must be a power of 2. Update help manuall if override. */ -#define DEFAULT_UST_CHANNEL_SUBBUF_NUM DEFAULT_CHANNEL_SUBBUF_NUM +#define DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM +#define DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM /* See lttng-ust.h enum lttng_ust_output */ -#define DEFAULT_UST_CHANNEL_OUTPUT LTTNG_EVENT_MMAP -/* By default, unlimited tracefile size */ -#define DEFAULT_UST_CHANNEL_TRACEFILE_SIZE 0 -/* By default, unlimited tracefile count */ -#define DEFAULT_UST_CHANNEL_TRACEFILE_COUNT 0 +#define DEFAULT_UST_PID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT +#define DEFAULT_UST_UID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT +/* Timers in usec. */ +#define DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER +#define DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER -#define DEFAULT_UST_CHANNEL_SWITCH_TIMER \ - DEFAULT_CHANNEL_SWITCH_TIMER -#define DEFAULT_UST_CHANNEL_READ_TIMER 0 /* usec */ +#define DEFAULT_UST_PID_CHANNEL_READ_TIMER 0 /* usec */ +#define DEFAULT_UST_UID_CHANNEL_READ_TIMER 0 /* usec */ /* * Default timeout value for the sem_timedwait() call. Blocking forever is not @@ -202,10 +204,10 @@ extern size_t default_channel_subbuf_size; extern size_t default_metadata_subbuf_size; -extern size_t default_ust_channel_subbuf_size; +extern size_t default_ust_pid_channel_subbuf_size; +extern size_t default_ust_uid_channel_subbuf_size; extern size_t default_kernel_channel_subbuf_size; - /* * Returns the default subbuf size. * @@ -243,15 +245,27 @@ size_t default_get_kernel_channel_subbuf_size(void) } /* - * Returns the default subbuf size for the UST domain. + * Returns the default subbuf size for the UST domain per PID. + * + * This function depends on a value that is set at constructor time, so it is + * unsafe to call it from another constructor. + */ +static inline +size_t default_get_ust_pid_channel_subbuf_size(void) +{ + return default_ust_pid_channel_subbuf_size; +} + +/* + * Returns the default subbuf size for the UST domain per UID. * * This function depends on a value that is set at constructor time, so it is * unsafe to call it from another constructor. */ static inline -size_t default_get_ust_channel_subbuf_size(void) +size_t default_get_ust_uid_channel_subbuf_size(void) { - return default_ust_channel_subbuf_size; + return default_ust_uid_channel_subbuf_size; } #endif /* _DEFAULTS_H */ diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 3787e29..a7328eb 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -1386,29 +1386,37 @@ void lttng_channel_set_default_attr(struct lttng_domain *domain, memset(attr, 0, sizeof(struct lttng_channel_attr)); + /* Same for all domains. */ + attr->overwrite = DEFAULT_CHANNEL_OVERWRITE; + attr->tracefile_size = DEFAULT_CHANNEL_TRACEFILE_SIZE; + attr->tracefile_count = DEFAULT_CHANNEL_TRACEFILE_COUNT; + switch (domain->type) { case LTTNG_DOMAIN_KERNEL: - attr->overwrite = DEFAULT_CHANNEL_OVERWRITE; attr->switch_timer_interval = DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER; attr->read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; - attr->subbuf_size = default_get_kernel_channel_subbuf_size(); attr->num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; attr->output = DEFAULT_KERNEL_CHANNEL_OUTPUT; - attr->tracefile_size = DEFAULT_KERNEL_CHANNEL_TRACEFILE_SIZE; - attr->tracefile_count = DEFAULT_KERNEL_CHANNEL_TRACEFILE_COUNT; break; case LTTNG_DOMAIN_UST: - attr->overwrite = DEFAULT_CHANNEL_OVERWRITE; - attr->switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; - attr->read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; - - attr->subbuf_size = default_get_ust_channel_subbuf_size(); - attr->num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; - attr->output = DEFAULT_UST_CHANNEL_OUTPUT; - attr->tracefile_size = DEFAULT_UST_CHANNEL_TRACEFILE_SIZE; - attr->tracefile_count = DEFAULT_UST_CHANNEL_TRACEFILE_COUNT; - break; + switch (domain->buf_type) { + case LTTNG_BUFFER_PER_UID: + attr->subbuf_size = default_get_ust_uid_channel_subbuf_size(); + attr->num_subbuf = DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM; + attr->output = DEFAULT_UST_UID_CHANNEL_OUTPUT; + attr->switch_timer_interval = DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER; + attr->read_timer_interval = DEFAULT_UST_UID_CHANNEL_READ_TIMER; + break; + case LTTNG_BUFFER_PER_PID: + default: + attr->subbuf_size = default_get_ust_pid_channel_subbuf_size(); + attr->num_subbuf = DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM; + attr->output = DEFAULT_UST_PID_CHANNEL_OUTPUT; + attr->switch_timer_interval = DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER; + attr->read_timer_interval = DEFAULT_UST_PID_CHANNEL_READ_TIMER; + break; + } default: /* Default behavior: leave set to 0. */ break; diff --git a/tests/unit/test_ust_data.c b/tests/unit/test_ust_data.c index a79e2eb..c79dbf6 100644 --- a/tests/unit/test_ust_data.c +++ b/tests/unit/test_ust_data.c @@ -111,9 +111,9 @@ static void test_create_ust_metadata(void) metadata->attr.num_subbuf == DEFAULT_METADATA_SUBBUF_NUM && metadata->attr.switch_timer_interval - == DEFAULT_UST_CHANNEL_SWITCH_TIMER && + == DEFAULT_METADATA_SWITCH_TIMER && metadata->attr.read_timer_interval - == DEFAULT_UST_CHANNEL_READ_TIMER && + == DEFAULT_METADATA_READ_TIMER && metadata->attr.output == LTTNG_UST_MMAP, "Validate UST session metadata"); -- 1.7.10.4 From mathieu.desnoyers at efficios.com Tue May 7 15:24:55 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 15:24:55 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix: split UST per UID/PID default values In-Reply-To: <1367953750-7731-1-git-send-email-dgoulet@efficios.com> References: <1367953750-7731-1-git-send-email-dgoulet@efficios.com> Message-ID: <20130507192455.GA8394@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > The default per UID subbuffer size are changed from 4096 bytes to 131072 > bytes (128k). The rest have the same values as before. > > Some DEFAULT_CHANNEL_* macros are prefixed with an underscore making > sure they are not used elsewhere in the code base and only domain > specific values are used. Looks good, except for one small question: the metadata defaults (e.g. DEFAULT_METADATA_SWITCH_TIMER) don't seem to appear anywhere in the help/manpage. Any idea on how we could fix that ? Thanks, Mathieu > > Fixes #524 > > Signed-off-by: David Goulet > --- > doc/man/lttng.1 | 15 ++++-- > src/bin/lttng-sessiond/channel.c | 59 ++++++++++++++------- > src/bin/lttng-sessiond/channel.h | 3 +- > src/bin/lttng-sessiond/cmd.c | 14 +++-- > src/bin/lttng-sessiond/trace-ust.c | 4 +- > src/bin/lttng-sessiond/ust-app.c | 4 +- > src/bin/lttng/commands/enable_channels.c | 32 ++++++++---- > src/common/defaults.c | 11 ++-- > src/common/defaults.h | 84 +++++++++++++++++------------- > src/lib/lttng-ctl/lttng-ctl.c | 36 ++++++++----- > tests/unit/test_ust_data.c | 4 +- > 11 files changed, 168 insertions(+), 98 deletions(-) > > diff --git a/doc/man/lttng.1 b/doc/man/lttng.1 > index 37c2063..aa98990 100644 > --- a/doc/man/lttng.1 > +++ b/doc/man/lttng.1 > @@ -327,17 +327,21 @@ same type. > \-\-overwrite > Flight recorder mode : overwrites events when subbuffers are full > \-\-subbuf-size SIZE > - Subbuffer size in bytes {+k,+M,+G} (default: 4096, kernel default: 262144) > + Subbuffer size in bytes {+k,+M,+G} > + (default UST uid: 131072, UST pid: 4096, kernel: 262144) > Rounded up to the next power of 2. > \-\-num-subbuf NUM > - Number of subbuffers (default: 4) > + Number of subbuffers. (default UST uid: 4, UST pid: 4, kernel: 4) > Rounded up to the next power of 2. > \-\-switch-timer USEC > - Switch subbuffer timer interval in ?sec (default: 0) > + Switch subbuffer timer interval in ?sec. > + (default UST uid: 0, UST pid: 0, kernel: 0) > \-\-read-timer USEC > - Read timer interval in ?sec (UST default: 0, kernel default: 200000) > + Read timer interval in ?sec. > + (default UST uid: 0, UST pid: 0, kernel: 200000) > \-\-output TYPE > Channel output type. Possible values: mmap, splice > + (default UST uid: mmap, UST pid: mmap, kernel: splice) > \-\-buffers-uid > Use per UID buffer (\-u only). Buffers are shared between applications > that have the same UID. > @@ -347,9 +351,10 @@ same type. > Use shared buffer for the whole system (\-k only) > \-C, \-\-tracefile-size SIZE > Maximum size of each tracefile within a stream (in bytes). > + 0 means unlimited. (default: 0) > \-W, \-\-tracefile-count COUNT > Used in conjunction with \-C option, this will limit the number > - of files created to the specified count. > + of files created to the specified count. 0 means unlimited. (default: 0) > > .B EXAMPLES: > > diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c > index ff2db69..8f835fd 100644 > --- a/src/bin/lttng-sessiond/channel.c > +++ b/src/bin/lttng-sessiond/channel.c > @@ -33,7 +33,8 @@ > /* > * Return allocated channel attributes. > */ > -struct lttng_channel *channel_new_default_attr(int dom) > +struct lttng_channel *channel_new_default_attr(int dom, > + enum lttng_buffer_type type) > { > struct lttng_channel *chan; > > @@ -49,10 +50,14 @@ struct lttng_channel *channel_new_default_attr(int dom) > goto error; > } > > + /* Same for all domains. */ > chan->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; > + chan->attr.tracefile_size = DEFAULT_CHANNEL_TRACEFILE_SIZE; > + chan->attr.tracefile_count = DEFAULT_CHANNEL_TRACEFILE_COUNT; > > switch (dom) { > case LTTNG_DOMAIN_KERNEL: > + assert(type == LTTNG_BUFFER_GLOBAL); > chan->attr.subbuf_size = > default_get_kernel_channel_subbuf_size(); > chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; > @@ -61,16 +66,27 @@ struct lttng_channel *channel_new_default_attr(int dom) > chan->attr.read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; > break; > case LTTNG_DOMAIN_UST: > -#if 0 > - case LTTNG_DOMAIN_UST_PID: > - case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: > - case LTTNG_DOMAIN_UST_EXEC_NAME: > -#endif > - chan->attr.subbuf_size = default_get_ust_channel_subbuf_size(); > - chan->attr.num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; > - chan->attr.output = DEFAULT_UST_CHANNEL_OUTPUT; > - chan->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; > - chan->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; > + switch (type) { > + case LTTNG_BUFFER_PER_UID: > + chan->attr.subbuf_size = default_get_ust_uid_channel_subbuf_size(); > + chan->attr.num_subbuf = DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM; > + chan->attr.output = DEFAULT_UST_UID_CHANNEL_OUTPUT; > + chan->attr.switch_timer_interval = > + DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER; > + chan->attr.read_timer_interval = > + DEFAULT_UST_UID_CHANNEL_READ_TIMER; > + break; > + case LTTNG_BUFFER_PER_PID: > + default: > + chan->attr.subbuf_size = default_get_ust_pid_channel_subbuf_size(); > + chan->attr.num_subbuf = DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM; > + chan->attr.output = DEFAULT_UST_PID_CHANNEL_OUTPUT; > + chan->attr.switch_timer_interval = > + DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER; > + chan->attr.read_timer_interval = > + DEFAULT_UST_PID_CHANNEL_READ_TIMER; > + break; > + } > break; > default: > goto error; /* Not implemented */ > @@ -158,7 +174,8 @@ int channel_kernel_create(struct ltt_kernel_session *ksession, > > /* Creating channel attributes if needed */ > if (attr == NULL) { > - defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); > + defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, > + LTTNG_BUFFER_GLOBAL); > if (defattr == NULL) { > ret = LTTNG_ERR_FATAL; > goto error; > @@ -237,7 +254,7 @@ int channel_ust_create(struct ltt_ust_session *usess, > > /* Creating channel attributes if needed */ > if (attr == NULL) { > - defattr = channel_new_default_attr(LTTNG_DOMAIN_UST); > + defattr = channel_new_default_attr(LTTNG_DOMAIN_UST, type); > if (defattr == NULL) { > ret = LTTNG_ERR_FATAL; > goto error; > @@ -245,11 +262,6 @@ int channel_ust_create(struct ltt_ust_session *usess, > attr = defattr; > } > > - if (attr->attr.subbuf_size < DEFAULT_UST_CHANNEL_SUBBUF_SIZE) { > - ret = LTTNG_ERR_INVALID; > - goto error; > - } > - > /* > * Validate UST buffer size and number of buffers: must both be power of 2 > * and nonzero. We validate right here for UST, because applications will > @@ -285,7 +297,18 @@ int channel_ust_create(struct ltt_ust_session *usess, > /* Validate buffer type. */ > switch (type) { > case LTTNG_BUFFER_PER_PID: > + if (attr->attr.subbuf_size < > + default_get_ust_pid_channel_subbuf_size()) { > + ret = LTTNG_ERR_INVALID; > + goto error; > + } > + break; > case LTTNG_BUFFER_PER_UID: > + if (attr->attr.subbuf_size < > + default_get_ust_uid_channel_subbuf_size()) { > + ret = LTTNG_ERR_INVALID; > + goto error; > + } > break; > default: > ret = LTTNG_ERR_BUFFER_NOT_SUPPORTED; > diff --git a/src/bin/lttng-sessiond/channel.h b/src/bin/lttng-sessiond/channel.h > index 7fbbb4c..15cabea 100644 > --- a/src/bin/lttng-sessiond/channel.h > +++ b/src/bin/lttng-sessiond/channel.h > @@ -30,7 +30,8 @@ int channel_kernel_enable(struct ltt_kernel_session *ksession, > int channel_kernel_create(struct ltt_kernel_session *ksession, > struct lttng_channel *chan, int kernel_pipe); > > -struct lttng_channel *channel_new_default_attr(int domain); > +struct lttng_channel *channel_new_default_attr(int domain, > + enum lttng_buffer_type type); > > int channel_ust_create(struct ltt_ust_session *usess, > struct lttng_channel *attr, enum lttng_buffer_type type); > diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c > index 5d2cba1..528665a 100644 > --- a/src/bin/lttng-sessiond/cmd.c > +++ b/src/bin/lttng-sessiond/cmd.c > @@ -1106,7 +1106,7 @@ int cmd_add_context(struct ltt_session *session, int domain, > if (chan_count == 0) { > struct lttng_channel *attr; > /* Create default channel */ > - attr = channel_new_default_attr(domain); > + attr = channel_new_default_attr(domain, usess->buffer_type); > if (attr == NULL) { > ret = LTTNG_ERR_FATAL; > goto error; > @@ -1166,7 +1166,8 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, > kchan = trace_kernel_get_channel_by_name(channel_name, > session->kernel_session); > if (kchan == NULL) { > - attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); > + attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, > + LTTNG_BUFFER_GLOBAL); > if (attr == NULL) { > ret = LTTNG_ERR_FATAL; > goto error; > @@ -1216,7 +1217,8 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, > channel_name); > if (uchan == NULL) { > /* Create default channel */ > - attr = channel_new_default_attr(LTTNG_DOMAIN_UST); > + attr = channel_new_default_attr(LTTNG_DOMAIN_UST, > + usess->buffer_type); > if (attr == NULL) { > ret = LTTNG_ERR_FATAL; > goto error; > @@ -1286,7 +1288,8 @@ int cmd_enable_event_all(struct ltt_session *session, > session->kernel_session); > if (kchan == NULL) { > /* Create default channel */ > - attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); > + attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, > + LTTNG_BUFFER_GLOBAL); > if (attr == NULL) { > ret = LTTNG_ERR_FATAL; > goto error; > @@ -1350,7 +1353,8 @@ int cmd_enable_event_all(struct ltt_session *session, > channel_name); > if (uchan == NULL) { > /* Create default channel */ > - attr = channel_new_default_attr(LTTNG_DOMAIN_UST); > + attr = channel_new_default_attr(LTTNG_DOMAIN_UST, > + usess->buffer_type); > if (attr == NULL) { > ret = LTTNG_ERR_FATAL; > goto error; > diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c > index 7592d77..8fb685c 100644 > --- a/src/bin/lttng-sessiond/trace-ust.c > +++ b/src/bin/lttng-sessiond/trace-ust.c > @@ -384,8 +384,8 @@ struct ltt_ust_metadata *trace_ust_create_metadata(char *path) > lum->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; > lum->attr.subbuf_size = default_get_metadata_subbuf_size(); > lum->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; > - lum->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; > - lum->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; > + lum->attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER; > + lum->attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER; > lum->attr.output = LTTNG_UST_MMAP; > > lum->handle = -1; > diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c > index e362381..5710226 100644 > --- a/src/bin/lttng-sessiond/ust-app.c > +++ b/src/bin/lttng-sessiond/ust-app.c > @@ -2527,8 +2527,8 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, > metadata->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; > metadata->attr.subbuf_size = default_get_metadata_subbuf_size(); > metadata->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; > - metadata->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; > - metadata->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; > + metadata->attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER; > + metadata->attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER; > metadata->attr.output = LTTNG_UST_MMAP; > metadata->attr.type = LTTNG_UST_CHAN_METADATA; > } else { > diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c > index 4816d62..c7bbca1 100644 > --- a/src/bin/lttng/commands/enable_channels.c > +++ b/src/bin/lttng/commands/enable_channels.c > @@ -104,28 +104,40 @@ static void usage(FILE *ofp) > fprintf(ofp, " --overwrite Flight recorder mode%s\n", > DEFAULT_CHANNEL_OVERWRITE ? " (default)" : ""); > fprintf(ofp, " --subbuf-size SIZE Subbuffer size in bytes {+k,+M,+G}\n"); > - fprintf(ofp, " (default: %zu, kernel default: %zu)\n", > - default_get_channel_subbuf_size(), > + fprintf(ofp, " (default UST uid: %zu, UST pid: %zu, kernel: %zu)\n", > + default_get_ust_uid_channel_subbuf_size(), > + default_get_ust_pid_channel_subbuf_size(), > default_get_kernel_channel_subbuf_size()); > fprintf(ofp, " Rounded up to the next power of 2.\n"); > fprintf(ofp, " --num-subbuf NUM Number of subbufers\n"); > - fprintf(ofp, " (default: %u)\n", > - DEFAULT_CHANNEL_SUBBUF_NUM); > + fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u)\n", > + DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM, DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM, > + DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM); > fprintf(ofp, " Rounded up to the next power of 2.\n"); > - fprintf(ofp, " --switch-timer USEC Switch timer interval in usec (default: %u)\n", > - DEFAULT_CHANNEL_SWITCH_TIMER); > - fprintf(ofp, " --read-timer USEC Read timer interval in usec (UST default: %u, kernel default: %u)\n", > - DEFAULT_UST_CHANNEL_READ_TIMER, DEFAULT_KERNEL_CHANNEL_READ_TIMER); > + fprintf(ofp, " --switch-timer USEC Switch timer interval in usec\n"); > + fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u)\n", > + DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER, DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER, > + DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER); > + fprintf(ofp, " --read-timer USEC Read timer interval in usec.\n"); > + fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u)\n", > + DEFAULT_UST_UID_CHANNEL_READ_TIMER, DEFAULT_UST_UID_CHANNEL_READ_TIMER, > + DEFAULT_KERNEL_CHANNEL_READ_TIMER); > fprintf(ofp, " --output TYPE Channel output type (Values: %s, %s)\n", > output_mmap, output_splice); > + fprintf(ofp, " (default UST uid: %s, UST pid: %s, kernel: %s)\n", > + DEFAULT_UST_UID_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice, > + DEFAULT_UST_PID_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice, > + DEFAULT_KERNEL_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice); > fprintf(ofp, " --buffers-uid Use per UID buffer (-u only)\n"); > fprintf(ofp, " --buffers-pid Use per PID buffer (-u only)\n"); > fprintf(ofp, " --buffers-global Use shared buffer for the whole system (-k only)\n"); > fprintf(ofp, " -C, --tracefile-size SIZE\n"); > - fprintf(ofp, " Maximum size of each tracefile within a stream (in bytes).\n"); > + fprintf(ofp, " Maximum size of each tracefile within a stream (in bytes). 0 means unlimited.\n"); > + fprintf(ofp, " (default: %u)\n", DEFAULT_CHANNEL_TRACEFILE_SIZE); > fprintf(ofp, " -W, --tracefile-count COUNT\n"); > fprintf(ofp, " Used in conjunction with -C option, this will limit the number\n"); > - fprintf(ofp, " of files created to the specified count.\n"); > + fprintf(ofp, " of files created to the specified count. 0 means unlimited.\n"); > + fprintf(ofp, " (default: %u)\n", DEFAULT_CHANNEL_TRACEFILE_COUNT); > fprintf(ofp, "\n"); > } > > diff --git a/src/common/defaults.c b/src/common/defaults.c > index ccdbaf4..d74a42b 100644 > --- a/src/common/defaults.c > +++ b/src/common/defaults.c > @@ -24,7 +24,8 @@ > size_t default_channel_subbuf_size; > size_t default_metadata_subbuf_size; > size_t default_kernel_channel_subbuf_size; > -size_t default_ust_channel_subbuf_size; > +size_t default_ust_pid_channel_subbuf_size; > +size_t default_ust_uid_channel_subbuf_size; > > static void __attribute__((constructor)) init_defaults(void) > { > @@ -39,11 +40,13 @@ static void __attribute__((constructor)) init_defaults(void) > } > > default_channel_subbuf_size = > - max(DEFAULT_CHANNEL_SUBBUF_SIZE, page_size); > + max(_DEFAULT_CHANNEL_SUBBUF_SIZE, page_size); > default_metadata_subbuf_size = > max(DEFAULT_METADATA_SUBBUF_SIZE, page_size); > default_kernel_channel_subbuf_size = > max(DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE, page_size); > - default_ust_channel_subbuf_size = > - max(DEFAULT_UST_CHANNEL_SUBBUF_SIZE, page_size); > + default_ust_pid_channel_subbuf_size = > + max(DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE, page_size); > + default_ust_uid_channel_subbuf_size = > + max(DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE, page_size); > } > diff --git a/src/common/defaults.h b/src/common/defaults.h > index fb6a975..2c73277 100644 > --- a/src/common/defaults.h > +++ b/src/common/defaults.h > @@ -112,55 +112,57 @@ > > /* Default channel attributes */ > #define DEFAULT_CHANNEL_NAME "channel0" > -#define DEFAULT_CHANNEL_OVERWRITE 0 /* usec */ > -/* DEFAULT_CHANNEL_SUBBUF_SIZE must always be a power of 2 */ > -#define DEFAULT_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ > -/* DEFAULT_CHANNEL_SUBBUF_NUM must always be a power of 2 */ > -#define DEFAULT_CHANNEL_SUBBUF_NUM 4 > -#define DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */ > -#define DEFAULT_CHANNEL_READ_TIMER 200000 /* usec */ > -#define DEFAULT_CHANNEL_OUTPUT LTTNG_EVENT_MMAP > - > +#define DEFAULT_CHANNEL_OVERWRITE 0 > +#define DEFAULT_CHANNEL_TRACEFILE_SIZE 0 > +#define DEFAULT_CHANNEL_TRACEFILE_COUNT 0 > + > +/* Must always be a power of 2 */ > +#define _DEFAULT_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ > +/* Must always be a power of 2 */ > +#define _DEFAULT_CHANNEL_SUBBUF_NUM 4 > +#define _DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */ > +#define _DEFAULT_CHANNEL_READ_TIMER 200000 /* usec */ > +#define _DEFAULT_CHANNEL_OUTPUT LTTNG_EVENT_MMAP > + > +/* Metadata channel defaults. */ > #define DEFAULT_METADATA_SUBBUF_SIZE 4096 > #define DEFAULT_METADATA_SUBBUF_NUM 2 > #define DEFAULT_METADATA_CACHE_SIZE 4096 > +#define DEFAULT_METADATA_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER > +#define DEFAULT_METADATA_READ_TIMER _DEFAULT_CHANNEL_READ_TIMER > +#define DEFAULT_METADATA_OUTPUT _DEFAULT_CHANNEL_OUTPUT > > /* Kernel has different defaults */ > > /* DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE must always be a power of 2 */ > -#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE 262144 /* bytes */ > +#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE 262144 /* bytes */ > /* > * DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM must always be a power of 2. > * Update help manually if override. > */ > -#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM DEFAULT_CHANNEL_SUBBUF_NUM > +#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM > /* See lttng-kernel.h enum lttng_kernel_output for channel output */ > -#define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_EVENT_SPLICE > -/* By default, unlimited tracefile size */ > -#define DEFAULT_KERNEL_CHANNEL_TRACEFILE_SIZE 0 > -/* By default, unlimited tracefile count */ > -#define DEFAULT_KERNEL_CHANNEL_TRACEFILE_COUNT 0 > - > -#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER \ > - DEFAULT_CHANNEL_SWITCH_TIMER > -#define DEFAULT_KERNEL_CHANNEL_READ_TIMER 200000 /* usec */ > +#define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_EVENT_SPLICE > +#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER > +#define DEFAULT_KERNEL_CHANNEL_READ_TIMER _DEFAULT_CHANNEL_READ_TIMER > > /* User space defaults */ > > /* Must be a power of 2 */ > -#define DEFAULT_UST_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ > +#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE _DEFAULT_CHANNEL_SUBBUF_SIZE > +#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072 /* bytes */ > /* Must be a power of 2. Update help manuall if override. */ > -#define DEFAULT_UST_CHANNEL_SUBBUF_NUM DEFAULT_CHANNEL_SUBBUF_NUM > +#define DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM > +#define DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM > /* See lttng-ust.h enum lttng_ust_output */ > -#define DEFAULT_UST_CHANNEL_OUTPUT LTTNG_EVENT_MMAP > -/* By default, unlimited tracefile size */ > -#define DEFAULT_UST_CHANNEL_TRACEFILE_SIZE 0 > -/* By default, unlimited tracefile count */ > -#define DEFAULT_UST_CHANNEL_TRACEFILE_COUNT 0 > +#define DEFAULT_UST_PID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT > +#define DEFAULT_UST_UID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT > +/* Timers in usec. */ > +#define DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER > +#define DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER > > -#define DEFAULT_UST_CHANNEL_SWITCH_TIMER \ > - DEFAULT_CHANNEL_SWITCH_TIMER > -#define DEFAULT_UST_CHANNEL_READ_TIMER 0 /* usec */ > +#define DEFAULT_UST_PID_CHANNEL_READ_TIMER 0 /* usec */ > +#define DEFAULT_UST_UID_CHANNEL_READ_TIMER 0 /* usec */ > > /* > * Default timeout value for the sem_timedwait() call. Blocking forever is not > @@ -202,10 +204,10 @@ > > extern size_t default_channel_subbuf_size; > extern size_t default_metadata_subbuf_size; > -extern size_t default_ust_channel_subbuf_size; > +extern size_t default_ust_pid_channel_subbuf_size; > +extern size_t default_ust_uid_channel_subbuf_size; > extern size_t default_kernel_channel_subbuf_size; > > - > /* > * Returns the default subbuf size. > * > @@ -243,15 +245,27 @@ size_t default_get_kernel_channel_subbuf_size(void) > } > > /* > - * Returns the default subbuf size for the UST domain. > + * Returns the default subbuf size for the UST domain per PID. > + * > + * This function depends on a value that is set at constructor time, so it is > + * unsafe to call it from another constructor. > + */ > +static inline > +size_t default_get_ust_pid_channel_subbuf_size(void) > +{ > + return default_ust_pid_channel_subbuf_size; > +} > + > +/* > + * Returns the default subbuf size for the UST domain per UID. > * > * This function depends on a value that is set at constructor time, so it is > * unsafe to call it from another constructor. > */ > static inline > -size_t default_get_ust_channel_subbuf_size(void) > +size_t default_get_ust_uid_channel_subbuf_size(void) > { > - return default_ust_channel_subbuf_size; > + return default_ust_uid_channel_subbuf_size; > } > > #endif /* _DEFAULTS_H */ > diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c > index 3787e29..a7328eb 100644 > --- a/src/lib/lttng-ctl/lttng-ctl.c > +++ b/src/lib/lttng-ctl/lttng-ctl.c > @@ -1386,29 +1386,37 @@ void lttng_channel_set_default_attr(struct lttng_domain *domain, > > memset(attr, 0, sizeof(struct lttng_channel_attr)); > > + /* Same for all domains. */ > + attr->overwrite = DEFAULT_CHANNEL_OVERWRITE; > + attr->tracefile_size = DEFAULT_CHANNEL_TRACEFILE_SIZE; > + attr->tracefile_count = DEFAULT_CHANNEL_TRACEFILE_COUNT; > + > switch (domain->type) { > case LTTNG_DOMAIN_KERNEL: > - attr->overwrite = DEFAULT_CHANNEL_OVERWRITE; > attr->switch_timer_interval = DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER; > attr->read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; > - > attr->subbuf_size = default_get_kernel_channel_subbuf_size(); > attr->num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; > attr->output = DEFAULT_KERNEL_CHANNEL_OUTPUT; > - attr->tracefile_size = DEFAULT_KERNEL_CHANNEL_TRACEFILE_SIZE; > - attr->tracefile_count = DEFAULT_KERNEL_CHANNEL_TRACEFILE_COUNT; > break; > case LTTNG_DOMAIN_UST: > - attr->overwrite = DEFAULT_CHANNEL_OVERWRITE; > - attr->switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; > - attr->read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; > - > - attr->subbuf_size = default_get_ust_channel_subbuf_size(); > - attr->num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; > - attr->output = DEFAULT_UST_CHANNEL_OUTPUT; > - attr->tracefile_size = DEFAULT_UST_CHANNEL_TRACEFILE_SIZE; > - attr->tracefile_count = DEFAULT_UST_CHANNEL_TRACEFILE_COUNT; > - break; > + switch (domain->buf_type) { > + case LTTNG_BUFFER_PER_UID: > + attr->subbuf_size = default_get_ust_uid_channel_subbuf_size(); > + attr->num_subbuf = DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM; > + attr->output = DEFAULT_UST_UID_CHANNEL_OUTPUT; > + attr->switch_timer_interval = DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER; > + attr->read_timer_interval = DEFAULT_UST_UID_CHANNEL_READ_TIMER; > + break; > + case LTTNG_BUFFER_PER_PID: > + default: > + attr->subbuf_size = default_get_ust_pid_channel_subbuf_size(); > + attr->num_subbuf = DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM; > + attr->output = DEFAULT_UST_PID_CHANNEL_OUTPUT; > + attr->switch_timer_interval = DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER; > + attr->read_timer_interval = DEFAULT_UST_PID_CHANNEL_READ_TIMER; > + break; > + } > default: > /* Default behavior: leave set to 0. */ > break; > diff --git a/tests/unit/test_ust_data.c b/tests/unit/test_ust_data.c > index a79e2eb..c79dbf6 100644 > --- a/tests/unit/test_ust_data.c > +++ b/tests/unit/test_ust_data.c > @@ -111,9 +111,9 @@ static void test_create_ust_metadata(void) > metadata->attr.num_subbuf > == DEFAULT_METADATA_SUBBUF_NUM && > metadata->attr.switch_timer_interval > - == DEFAULT_UST_CHANNEL_SWITCH_TIMER && > + == DEFAULT_METADATA_SWITCH_TIMER && > metadata->attr.read_timer_interval > - == DEFAULT_UST_CHANNEL_READ_TIMER && > + == DEFAULT_METADATA_READ_TIMER && > metadata->attr.output == LTTNG_UST_MMAP, > "Validate UST session metadata"); > > -- > 1.7.10.4 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Tue May 7 15:31:14 2013 From: dgoulet at efficios.com (David Goulet) Date: Tue, 07 May 2013 15:31:14 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix: split UST per UID/PID default values In-Reply-To: <20130507192455.GA8394@Krystal> References: <1367953750-7731-1-git-send-email-dgoulet@efficios.com> <20130507192455.GA8394@Krystal> Message-ID: <51895682.6010800@efficios.com> Mathieu Desnoyers: > * David Goulet (dgoulet at efficios.com) wrote: >> The default per UID subbuffer size are changed from 4096 bytes to 131072 >> bytes (128k). The rest have the same values as before. >> >> Some DEFAULT_CHANNEL_* macros are prefixed with an underscore making >> sure they are not used elsewhere in the code base and only domain >> specific values are used. > > Looks good, except for one small question: the metadata defaults (e.g. > DEFAULT_METADATA_SWITCH_TIMER) don't seem to appear anywhere in the > help/manpage. Any idea on how we could fix that ? Right, I guess just adding a "metadata: " everywhere would be the way to do it ? David > > Thanks, > > Mathieu > > >> >> Fixes #524 >> >> Signed-off-by: David Goulet >> --- >> doc/man/lttng.1 | 15 ++++-- >> src/bin/lttng-sessiond/channel.c | 59 ++++++++++++++------- >> src/bin/lttng-sessiond/channel.h | 3 +- >> src/bin/lttng-sessiond/cmd.c | 14 +++-- >> src/bin/lttng-sessiond/trace-ust.c | 4 +- >> src/bin/lttng-sessiond/ust-app.c | 4 +- >> src/bin/lttng/commands/enable_channels.c | 32 ++++++++---- >> src/common/defaults.c | 11 ++-- >> src/common/defaults.h | 84 +++++++++++++++++------------- >> src/lib/lttng-ctl/lttng-ctl.c | 36 ++++++++----- >> tests/unit/test_ust_data.c | 4 +- >> 11 files changed, 168 insertions(+), 98 deletions(-) >> >> diff --git a/doc/man/lttng.1 b/doc/man/lttng.1 >> index 37c2063..aa98990 100644 >> --- a/doc/man/lttng.1 >> +++ b/doc/man/lttng.1 >> @@ -327,17 +327,21 @@ same type. >> \-\-overwrite >> Flight recorder mode : overwrites events when subbuffers are full >> \-\-subbuf-size SIZE >> - Subbuffer size in bytes {+k,+M,+G} (default: 4096, kernel default: 262144) >> + Subbuffer size in bytes {+k,+M,+G} >> + (default UST uid: 131072, UST pid: 4096, kernel: 262144) >> Rounded up to the next power of 2. >> \-\-num-subbuf NUM >> - Number of subbuffers (default: 4) >> + Number of subbuffers. (default UST uid: 4, UST pid: 4, kernel: 4) >> Rounded up to the next power of 2. >> \-\-switch-timer USEC >> - Switch subbuffer timer interval in ?sec (default: 0) >> + Switch subbuffer timer interval in ?sec. >> + (default UST uid: 0, UST pid: 0, kernel: 0) >> \-\-read-timer USEC >> - Read timer interval in ?sec (UST default: 0, kernel default: 200000) >> + Read timer interval in ?sec. >> + (default UST uid: 0, UST pid: 0, kernel: 200000) >> \-\-output TYPE >> Channel output type. Possible values: mmap, splice >> + (default UST uid: mmap, UST pid: mmap, kernel: splice) >> \-\-buffers-uid >> Use per UID buffer (\-u only). Buffers are shared between applications >> that have the same UID. >> @@ -347,9 +351,10 @@ same type. >> Use shared buffer for the whole system (\-k only) >> \-C, \-\-tracefile-size SIZE >> Maximum size of each tracefile within a stream (in bytes). >> + 0 means unlimited. (default: 0) >> \-W, \-\-tracefile-count COUNT >> Used in conjunction with \-C option, this will limit the number >> - of files created to the specified count. >> + of files created to the specified count. 0 means unlimited. (default: 0) >> >> .B EXAMPLES: >> >> diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c >> index ff2db69..8f835fd 100644 >> --- a/src/bin/lttng-sessiond/channel.c >> +++ b/src/bin/lttng-sessiond/channel.c >> @@ -33,7 +33,8 @@ >> /* >> * Return allocated channel attributes. >> */ >> -struct lttng_channel *channel_new_default_attr(int dom) >> +struct lttng_channel *channel_new_default_attr(int dom, >> + enum lttng_buffer_type type) >> { >> struct lttng_channel *chan; >> >> @@ -49,10 +50,14 @@ struct lttng_channel *channel_new_default_attr(int dom) >> goto error; >> } >> >> + /* Same for all domains. */ >> chan->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; >> + chan->attr.tracefile_size = DEFAULT_CHANNEL_TRACEFILE_SIZE; >> + chan->attr.tracefile_count = DEFAULT_CHANNEL_TRACEFILE_COUNT; >> >> switch (dom) { >> case LTTNG_DOMAIN_KERNEL: >> + assert(type == LTTNG_BUFFER_GLOBAL); >> chan->attr.subbuf_size = >> default_get_kernel_channel_subbuf_size(); >> chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; >> @@ -61,16 +66,27 @@ struct lttng_channel *channel_new_default_attr(int dom) >> chan->attr.read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; >> break; >> case LTTNG_DOMAIN_UST: >> -#if 0 >> - case LTTNG_DOMAIN_UST_PID: >> - case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: >> - case LTTNG_DOMAIN_UST_EXEC_NAME: >> -#endif >> - chan->attr.subbuf_size = default_get_ust_channel_subbuf_size(); >> - chan->attr.num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; >> - chan->attr.output = DEFAULT_UST_CHANNEL_OUTPUT; >> - chan->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; >> - chan->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; >> + switch (type) { >> + case LTTNG_BUFFER_PER_UID: >> + chan->attr.subbuf_size = default_get_ust_uid_channel_subbuf_size(); >> + chan->attr.num_subbuf = DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM; >> + chan->attr.output = DEFAULT_UST_UID_CHANNEL_OUTPUT; >> + chan->attr.switch_timer_interval = >> + DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER; >> + chan->attr.read_timer_interval = >> + DEFAULT_UST_UID_CHANNEL_READ_TIMER; >> + break; >> + case LTTNG_BUFFER_PER_PID: >> + default: >> + chan->attr.subbuf_size = default_get_ust_pid_channel_subbuf_size(); >> + chan->attr.num_subbuf = DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM; >> + chan->attr.output = DEFAULT_UST_PID_CHANNEL_OUTPUT; >> + chan->attr.switch_timer_interval = >> + DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER; >> + chan->attr.read_timer_interval = >> + DEFAULT_UST_PID_CHANNEL_READ_TIMER; >> + break; >> + } >> break; >> default: >> goto error; /* Not implemented */ >> @@ -158,7 +174,8 @@ int channel_kernel_create(struct ltt_kernel_session *ksession, >> >> /* Creating channel attributes if needed */ >> if (attr == NULL) { >> - defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); >> + defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, >> + LTTNG_BUFFER_GLOBAL); >> if (defattr == NULL) { >> ret = LTTNG_ERR_FATAL; >> goto error; >> @@ -237,7 +254,7 @@ int channel_ust_create(struct ltt_ust_session *usess, >> >> /* Creating channel attributes if needed */ >> if (attr == NULL) { >> - defattr = channel_new_default_attr(LTTNG_DOMAIN_UST); >> + defattr = channel_new_default_attr(LTTNG_DOMAIN_UST, type); >> if (defattr == NULL) { >> ret = LTTNG_ERR_FATAL; >> goto error; >> @@ -245,11 +262,6 @@ int channel_ust_create(struct ltt_ust_session *usess, >> attr = defattr; >> } >> >> - if (attr->attr.subbuf_size < DEFAULT_UST_CHANNEL_SUBBUF_SIZE) { >> - ret = LTTNG_ERR_INVALID; >> - goto error; >> - } >> - >> /* >> * Validate UST buffer size and number of buffers: must both be power of 2 >> * and nonzero. We validate right here for UST, because applications will >> @@ -285,7 +297,18 @@ int channel_ust_create(struct ltt_ust_session *usess, >> /* Validate buffer type. */ >> switch (type) { >> case LTTNG_BUFFER_PER_PID: >> + if (attr->attr.subbuf_size < >> + default_get_ust_pid_channel_subbuf_size()) { >> + ret = LTTNG_ERR_INVALID; >> + goto error; >> + } >> + break; >> case LTTNG_BUFFER_PER_UID: >> + if (attr->attr.subbuf_size < >> + default_get_ust_uid_channel_subbuf_size()) { >> + ret = LTTNG_ERR_INVALID; >> + goto error; >> + } >> break; >> default: >> ret = LTTNG_ERR_BUFFER_NOT_SUPPORTED; >> diff --git a/src/bin/lttng-sessiond/channel.h b/src/bin/lttng-sessiond/channel.h >> index 7fbbb4c..15cabea 100644 >> --- a/src/bin/lttng-sessiond/channel.h >> +++ b/src/bin/lttng-sessiond/channel.h >> @@ -30,7 +30,8 @@ int channel_kernel_enable(struct ltt_kernel_session *ksession, >> int channel_kernel_create(struct ltt_kernel_session *ksession, >> struct lttng_channel *chan, int kernel_pipe); >> >> -struct lttng_channel *channel_new_default_attr(int domain); >> +struct lttng_channel *channel_new_default_attr(int domain, >> + enum lttng_buffer_type type); >> >> int channel_ust_create(struct ltt_ust_session *usess, >> struct lttng_channel *attr, enum lttng_buffer_type type); >> diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c >> index 5d2cba1..528665a 100644 >> --- a/src/bin/lttng-sessiond/cmd.c >> +++ b/src/bin/lttng-sessiond/cmd.c >> @@ -1106,7 +1106,7 @@ int cmd_add_context(struct ltt_session *session, int domain, >> if (chan_count == 0) { >> struct lttng_channel *attr; >> /* Create default channel */ >> - attr = channel_new_default_attr(domain); >> + attr = channel_new_default_attr(domain, usess->buffer_type); >> if (attr == NULL) { >> ret = LTTNG_ERR_FATAL; >> goto error; >> @@ -1166,7 +1166,8 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, >> kchan = trace_kernel_get_channel_by_name(channel_name, >> session->kernel_session); >> if (kchan == NULL) { >> - attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); >> + attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, >> + LTTNG_BUFFER_GLOBAL); >> if (attr == NULL) { >> ret = LTTNG_ERR_FATAL; >> goto error; >> @@ -1216,7 +1217,8 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, >> channel_name); >> if (uchan == NULL) { >> /* Create default channel */ >> - attr = channel_new_default_attr(LTTNG_DOMAIN_UST); >> + attr = channel_new_default_attr(LTTNG_DOMAIN_UST, >> + usess->buffer_type); >> if (attr == NULL) { >> ret = LTTNG_ERR_FATAL; >> goto error; >> @@ -1286,7 +1288,8 @@ int cmd_enable_event_all(struct ltt_session *session, >> session->kernel_session); >> if (kchan == NULL) { >> /* Create default channel */ >> - attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); >> + attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, >> + LTTNG_BUFFER_GLOBAL); >> if (attr == NULL) { >> ret = LTTNG_ERR_FATAL; >> goto error; >> @@ -1350,7 +1353,8 @@ int cmd_enable_event_all(struct ltt_session *session, >> channel_name); >> if (uchan == NULL) { >> /* Create default channel */ >> - attr = channel_new_default_attr(LTTNG_DOMAIN_UST); >> + attr = channel_new_default_attr(LTTNG_DOMAIN_UST, >> + usess->buffer_type); >> if (attr == NULL) { >> ret = LTTNG_ERR_FATAL; >> goto error; >> diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c >> index 7592d77..8fb685c 100644 >> --- a/src/bin/lttng-sessiond/trace-ust.c >> +++ b/src/bin/lttng-sessiond/trace-ust.c >> @@ -384,8 +384,8 @@ struct ltt_ust_metadata *trace_ust_create_metadata(char *path) >> lum->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; >> lum->attr.subbuf_size = default_get_metadata_subbuf_size(); >> lum->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; >> - lum->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; >> - lum->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; >> + lum->attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER; >> + lum->attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER; >> lum->attr.output = LTTNG_UST_MMAP; >> >> lum->handle = -1; >> diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c >> index e362381..5710226 100644 >> --- a/src/bin/lttng-sessiond/ust-app.c >> +++ b/src/bin/lttng-sessiond/ust-app.c >> @@ -2527,8 +2527,8 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, >> metadata->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; >> metadata->attr.subbuf_size = default_get_metadata_subbuf_size(); >> metadata->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; >> - metadata->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; >> - metadata->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; >> + metadata->attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER; >> + metadata->attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER; >> metadata->attr.output = LTTNG_UST_MMAP; >> metadata->attr.type = LTTNG_UST_CHAN_METADATA; >> } else { >> diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c >> index 4816d62..c7bbca1 100644 >> --- a/src/bin/lttng/commands/enable_channels.c >> +++ b/src/bin/lttng/commands/enable_channels.c >> @@ -104,28 +104,40 @@ static void usage(FILE *ofp) >> fprintf(ofp, " --overwrite Flight recorder mode%s\n", >> DEFAULT_CHANNEL_OVERWRITE ? " (default)" : ""); >> fprintf(ofp, " --subbuf-size SIZE Subbuffer size in bytes {+k,+M,+G}\n"); >> - fprintf(ofp, " (default: %zu, kernel default: %zu)\n", >> - default_get_channel_subbuf_size(), >> + fprintf(ofp, " (default UST uid: %zu, UST pid: %zu, kernel: %zu)\n", >> + default_get_ust_uid_channel_subbuf_size(), >> + default_get_ust_pid_channel_subbuf_size(), >> default_get_kernel_channel_subbuf_size()); >> fprintf(ofp, " Rounded up to the next power of 2.\n"); >> fprintf(ofp, " --num-subbuf NUM Number of subbufers\n"); >> - fprintf(ofp, " (default: %u)\n", >> - DEFAULT_CHANNEL_SUBBUF_NUM); >> + fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u)\n", >> + DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM, DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM, >> + DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM); >> fprintf(ofp, " Rounded up to the next power of 2.\n"); >> - fprintf(ofp, " --switch-timer USEC Switch timer interval in usec (default: %u)\n", >> - DEFAULT_CHANNEL_SWITCH_TIMER); >> - fprintf(ofp, " --read-timer USEC Read timer interval in usec (UST default: %u, kernel default: %u)\n", >> - DEFAULT_UST_CHANNEL_READ_TIMER, DEFAULT_KERNEL_CHANNEL_READ_TIMER); >> + fprintf(ofp, " --switch-timer USEC Switch timer interval in usec\n"); >> + fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u)\n", >> + DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER, DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER, >> + DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER); >> + fprintf(ofp, " --read-timer USEC Read timer interval in usec.\n"); >> + fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u)\n", >> + DEFAULT_UST_UID_CHANNEL_READ_TIMER, DEFAULT_UST_UID_CHANNEL_READ_TIMER, >> + DEFAULT_KERNEL_CHANNEL_READ_TIMER); >> fprintf(ofp, " --output TYPE Channel output type (Values: %s, %s)\n", >> output_mmap, output_splice); >> + fprintf(ofp, " (default UST uid: %s, UST pid: %s, kernel: %s)\n", >> + DEFAULT_UST_UID_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice, >> + DEFAULT_UST_PID_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice, >> + DEFAULT_KERNEL_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice); >> fprintf(ofp, " --buffers-uid Use per UID buffer (-u only)\n"); >> fprintf(ofp, " --buffers-pid Use per PID buffer (-u only)\n"); >> fprintf(ofp, " --buffers-global Use shared buffer for the whole system (-k only)\n"); >> fprintf(ofp, " -C, --tracefile-size SIZE\n"); >> - fprintf(ofp, " Maximum size of each tracefile within a stream (in bytes).\n"); >> + fprintf(ofp, " Maximum size of each tracefile within a stream (in bytes). 0 means unlimited.\n"); >> + fprintf(ofp, " (default: %u)\n", DEFAULT_CHANNEL_TRACEFILE_SIZE); >> fprintf(ofp, " -W, --tracefile-count COUNT\n"); >> fprintf(ofp, " Used in conjunction with -C option, this will limit the number\n"); >> - fprintf(ofp, " of files created to the specified count.\n"); >> + fprintf(ofp, " of files created to the specified count. 0 means unlimited.\n"); >> + fprintf(ofp, " (default: %u)\n", DEFAULT_CHANNEL_TRACEFILE_COUNT); >> fprintf(ofp, "\n"); >> } >> >> diff --git a/src/common/defaults.c b/src/common/defaults.c >> index ccdbaf4..d74a42b 100644 >> --- a/src/common/defaults.c >> +++ b/src/common/defaults.c >> @@ -24,7 +24,8 @@ >> size_t default_channel_subbuf_size; >> size_t default_metadata_subbuf_size; >> size_t default_kernel_channel_subbuf_size; >> -size_t default_ust_channel_subbuf_size; >> +size_t default_ust_pid_channel_subbuf_size; >> +size_t default_ust_uid_channel_subbuf_size; >> >> static void __attribute__((constructor)) init_defaults(void) >> { >> @@ -39,11 +40,13 @@ static void __attribute__((constructor)) init_defaults(void) >> } >> >> default_channel_subbuf_size = >> - max(DEFAULT_CHANNEL_SUBBUF_SIZE, page_size); >> + max(_DEFAULT_CHANNEL_SUBBUF_SIZE, page_size); >> default_metadata_subbuf_size = >> max(DEFAULT_METADATA_SUBBUF_SIZE, page_size); >> default_kernel_channel_subbuf_size = >> max(DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE, page_size); >> - default_ust_channel_subbuf_size = >> - max(DEFAULT_UST_CHANNEL_SUBBUF_SIZE, page_size); >> + default_ust_pid_channel_subbuf_size = >> + max(DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE, page_size); >> + default_ust_uid_channel_subbuf_size = >> + max(DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE, page_size); >> } >> diff --git a/src/common/defaults.h b/src/common/defaults.h >> index fb6a975..2c73277 100644 >> --- a/src/common/defaults.h >> +++ b/src/common/defaults.h >> @@ -112,55 +112,57 @@ >> >> /* Default channel attributes */ >> #define DEFAULT_CHANNEL_NAME "channel0" >> -#define DEFAULT_CHANNEL_OVERWRITE 0 /* usec */ >> -/* DEFAULT_CHANNEL_SUBBUF_SIZE must always be a power of 2 */ >> -#define DEFAULT_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ >> -/* DEFAULT_CHANNEL_SUBBUF_NUM must always be a power of 2 */ >> -#define DEFAULT_CHANNEL_SUBBUF_NUM 4 >> -#define DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */ >> -#define DEFAULT_CHANNEL_READ_TIMER 200000 /* usec */ >> -#define DEFAULT_CHANNEL_OUTPUT LTTNG_EVENT_MMAP >> - >> +#define DEFAULT_CHANNEL_OVERWRITE 0 >> +#define DEFAULT_CHANNEL_TRACEFILE_SIZE 0 >> +#define DEFAULT_CHANNEL_TRACEFILE_COUNT 0 >> + >> +/* Must always be a power of 2 */ >> +#define _DEFAULT_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ >> +/* Must always be a power of 2 */ >> +#define _DEFAULT_CHANNEL_SUBBUF_NUM 4 >> +#define _DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */ >> +#define _DEFAULT_CHANNEL_READ_TIMER 200000 /* usec */ >> +#define _DEFAULT_CHANNEL_OUTPUT LTTNG_EVENT_MMAP >> + >> +/* Metadata channel defaults. */ >> #define DEFAULT_METADATA_SUBBUF_SIZE 4096 >> #define DEFAULT_METADATA_SUBBUF_NUM 2 >> #define DEFAULT_METADATA_CACHE_SIZE 4096 >> +#define DEFAULT_METADATA_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER >> +#define DEFAULT_METADATA_READ_TIMER _DEFAULT_CHANNEL_READ_TIMER >> +#define DEFAULT_METADATA_OUTPUT _DEFAULT_CHANNEL_OUTPUT >> >> /* Kernel has different defaults */ >> >> /* DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE must always be a power of 2 */ >> -#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE 262144 /* bytes */ >> +#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE 262144 /* bytes */ >> /* >> * DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM must always be a power of 2. >> * Update help manually if override. >> */ >> -#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM DEFAULT_CHANNEL_SUBBUF_NUM >> +#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM >> /* See lttng-kernel.h enum lttng_kernel_output for channel output */ >> -#define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_EVENT_SPLICE >> -/* By default, unlimited tracefile size */ >> -#define DEFAULT_KERNEL_CHANNEL_TRACEFILE_SIZE 0 >> -/* By default, unlimited tracefile count */ >> -#define DEFAULT_KERNEL_CHANNEL_TRACEFILE_COUNT 0 >> - >> -#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER \ >> - DEFAULT_CHANNEL_SWITCH_TIMER >> -#define DEFAULT_KERNEL_CHANNEL_READ_TIMER 200000 /* usec */ >> +#define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_EVENT_SPLICE >> +#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER >> +#define DEFAULT_KERNEL_CHANNEL_READ_TIMER _DEFAULT_CHANNEL_READ_TIMER >> >> /* User space defaults */ >> >> /* Must be a power of 2 */ >> -#define DEFAULT_UST_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ >> +#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE _DEFAULT_CHANNEL_SUBBUF_SIZE >> +#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072 /* bytes */ >> /* Must be a power of 2. Update help manuall if override. */ >> -#define DEFAULT_UST_CHANNEL_SUBBUF_NUM DEFAULT_CHANNEL_SUBBUF_NUM >> +#define DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM >> +#define DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM >> /* See lttng-ust.h enum lttng_ust_output */ >> -#define DEFAULT_UST_CHANNEL_OUTPUT LTTNG_EVENT_MMAP >> -/* By default, unlimited tracefile size */ >> -#define DEFAULT_UST_CHANNEL_TRACEFILE_SIZE 0 >> -/* By default, unlimited tracefile count */ >> -#define DEFAULT_UST_CHANNEL_TRACEFILE_COUNT 0 >> +#define DEFAULT_UST_PID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT >> +#define DEFAULT_UST_UID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT >> +/* Timers in usec. */ >> +#define DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER >> +#define DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER >> >> -#define DEFAULT_UST_CHANNEL_SWITCH_TIMER \ >> - DEFAULT_CHANNEL_SWITCH_TIMER >> -#define DEFAULT_UST_CHANNEL_READ_TIMER 0 /* usec */ >> +#define DEFAULT_UST_PID_CHANNEL_READ_TIMER 0 /* usec */ >> +#define DEFAULT_UST_UID_CHANNEL_READ_TIMER 0 /* usec */ >> >> /* >> * Default timeout value for the sem_timedwait() call. Blocking forever is not >> @@ -202,10 +204,10 @@ >> >> extern size_t default_channel_subbuf_size; >> extern size_t default_metadata_subbuf_size; >> -extern size_t default_ust_channel_subbuf_size; >> +extern size_t default_ust_pid_channel_subbuf_size; >> +extern size_t default_ust_uid_channel_subbuf_size; >> extern size_t default_kernel_channel_subbuf_size; >> >> - >> /* >> * Returns the default subbuf size. >> * >> @@ -243,15 +245,27 @@ size_t default_get_kernel_channel_subbuf_size(void) >> } >> >> /* >> - * Returns the default subbuf size for the UST domain. >> + * Returns the default subbuf size for the UST domain per PID. >> + * >> + * This function depends on a value that is set at constructor time, so it is >> + * unsafe to call it from another constructor. >> + */ >> +static inline >> +size_t default_get_ust_pid_channel_subbuf_size(void) >> +{ >> + return default_ust_pid_channel_subbuf_size; >> +} >> + >> +/* >> + * Returns the default subbuf size for the UST domain per UID. >> * >> * This function depends on a value that is set at constructor time, so it is >> * unsafe to call it from another constructor. >> */ >> static inline >> -size_t default_get_ust_channel_subbuf_size(void) >> +size_t default_get_ust_uid_channel_subbuf_size(void) >> { >> - return default_ust_channel_subbuf_size; >> + return default_ust_uid_channel_subbuf_size; >> } >> >> #endif /* _DEFAULTS_H */ >> diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c >> index 3787e29..a7328eb 100644 >> --- a/src/lib/lttng-ctl/lttng-ctl.c >> +++ b/src/lib/lttng-ctl/lttng-ctl.c >> @@ -1386,29 +1386,37 @@ void lttng_channel_set_default_attr(struct lttng_domain *domain, >> >> memset(attr, 0, sizeof(struct lttng_channel_attr)); >> >> + /* Same for all domains. */ >> + attr->overwrite = DEFAULT_CHANNEL_OVERWRITE; >> + attr->tracefile_size = DEFAULT_CHANNEL_TRACEFILE_SIZE; >> + attr->tracefile_count = DEFAULT_CHANNEL_TRACEFILE_COUNT; >> + >> switch (domain->type) { >> case LTTNG_DOMAIN_KERNEL: >> - attr->overwrite = DEFAULT_CHANNEL_OVERWRITE; >> attr->switch_timer_interval = DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER; >> attr->read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; >> - >> attr->subbuf_size = default_get_kernel_channel_subbuf_size(); >> attr->num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; >> attr->output = DEFAULT_KERNEL_CHANNEL_OUTPUT; >> - attr->tracefile_size = DEFAULT_KERNEL_CHANNEL_TRACEFILE_SIZE; >> - attr->tracefile_count = DEFAULT_KERNEL_CHANNEL_TRACEFILE_COUNT; >> break; >> case LTTNG_DOMAIN_UST: >> - attr->overwrite = DEFAULT_CHANNEL_OVERWRITE; >> - attr->switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; >> - attr->read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; >> - >> - attr->subbuf_size = default_get_ust_channel_subbuf_size(); >> - attr->num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; >> - attr->output = DEFAULT_UST_CHANNEL_OUTPUT; >> - attr->tracefile_size = DEFAULT_UST_CHANNEL_TRACEFILE_SIZE; >> - attr->tracefile_count = DEFAULT_UST_CHANNEL_TRACEFILE_COUNT; >> - break; >> + switch (domain->buf_type) { >> + case LTTNG_BUFFER_PER_UID: >> + attr->subbuf_size = default_get_ust_uid_channel_subbuf_size(); >> + attr->num_subbuf = DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM; >> + attr->output = DEFAULT_UST_UID_CHANNEL_OUTPUT; >> + attr->switch_timer_interval = DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER; >> + attr->read_timer_interval = DEFAULT_UST_UID_CHANNEL_READ_TIMER; >> + break; >> + case LTTNG_BUFFER_PER_PID: >> + default: >> + attr->subbuf_size = default_get_ust_pid_channel_subbuf_size(); >> + attr->num_subbuf = DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM; >> + attr->output = DEFAULT_UST_PID_CHANNEL_OUTPUT; >> + attr->switch_timer_interval = DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER; >> + attr->read_timer_interval = DEFAULT_UST_PID_CHANNEL_READ_TIMER; >> + break; >> + } >> default: >> /* Default behavior: leave set to 0. */ >> break; >> diff --git a/tests/unit/test_ust_data.c b/tests/unit/test_ust_data.c >> index a79e2eb..c79dbf6 100644 >> --- a/tests/unit/test_ust_data.c >> +++ b/tests/unit/test_ust_data.c >> @@ -111,9 +111,9 @@ static void test_create_ust_metadata(void) >> metadata->attr.num_subbuf >> == DEFAULT_METADATA_SUBBUF_NUM && >> metadata->attr.switch_timer_interval >> - == DEFAULT_UST_CHANNEL_SWITCH_TIMER && >> + == DEFAULT_METADATA_SWITCH_TIMER && >> metadata->attr.read_timer_interval >> - == DEFAULT_UST_CHANNEL_READ_TIMER && >> + == DEFAULT_METADATA_READ_TIMER && >> metadata->attr.output == LTTNG_UST_MMAP, >> "Validate UST session metadata"); >> >> -- >> 1.7.10.4 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From mathieu.desnoyers at efficios.com Tue May 7 15:33:15 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 15:33:15 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix: split UST per UID/PID default values In-Reply-To: <51895682.6010800@efficios.com> References: <1367953750-7731-1-git-send-email-dgoulet@efficios.com> <20130507192455.GA8394@Krystal> <51895682.6010800@efficios.com> Message-ID: <20130507193315.GA8587@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > > > Mathieu Desnoyers: > > * David Goulet (dgoulet at efficios.com) wrote: > >> The default per UID subbuffer size are changed from 4096 bytes to 131072 > >> bytes (128k). The rest have the same values as before. > >> > >> Some DEFAULT_CHANNEL_* macros are prefixed with an underscore making > >> sure they are not used elsewhere in the code base and only domain > >> specific values are used. > > > > Looks good, except for one small question: the metadata defaults (e.g. > > DEFAULT_METADATA_SWITCH_TIMER) don't seem to appear anywhere in the > > help/manpage. Any idea on how we could fix that ? > > Right, I guess just adding a "metadata: " everywhere would be the way to > do it ? Yep. Thanks, Mathieu > > David > > > > > Thanks, > > > > Mathieu > > > > > >> > >> Fixes #524 > >> > >> Signed-off-by: David Goulet > >> --- > >> doc/man/lttng.1 | 15 ++++-- > >> src/bin/lttng-sessiond/channel.c | 59 ++++++++++++++------- > >> src/bin/lttng-sessiond/channel.h | 3 +- > >> src/bin/lttng-sessiond/cmd.c | 14 +++-- > >> src/bin/lttng-sessiond/trace-ust.c | 4 +- > >> src/bin/lttng-sessiond/ust-app.c | 4 +- > >> src/bin/lttng/commands/enable_channels.c | 32 ++++++++---- > >> src/common/defaults.c | 11 ++-- > >> src/common/defaults.h | 84 +++++++++++++++++------------- > >> src/lib/lttng-ctl/lttng-ctl.c | 36 ++++++++----- > >> tests/unit/test_ust_data.c | 4 +- > >> 11 files changed, 168 insertions(+), 98 deletions(-) > >> > >> diff --git a/doc/man/lttng.1 b/doc/man/lttng.1 > >> index 37c2063..aa98990 100644 > >> --- a/doc/man/lttng.1 > >> +++ b/doc/man/lttng.1 > >> @@ -327,17 +327,21 @@ same type. > >> \-\-overwrite > >> Flight recorder mode : overwrites events when subbuffers are full > >> \-\-subbuf-size SIZE > >> - Subbuffer size in bytes {+k,+M,+G} (default: 4096, kernel default: 262144) > >> + Subbuffer size in bytes {+k,+M,+G} > >> + (default UST uid: 131072, UST pid: 4096, kernel: 262144) > >> Rounded up to the next power of 2. > >> \-\-num-subbuf NUM > >> - Number of subbuffers (default: 4) > >> + Number of subbuffers. (default UST uid: 4, UST pid: 4, kernel: 4) > >> Rounded up to the next power of 2. > >> \-\-switch-timer USEC > >> - Switch subbuffer timer interval in ?sec (default: 0) > >> + Switch subbuffer timer interval in ?sec. > >> + (default UST uid: 0, UST pid: 0, kernel: 0) > >> \-\-read-timer USEC > >> - Read timer interval in ?sec (UST default: 0, kernel default: 200000) > >> + Read timer interval in ?sec. > >> + (default UST uid: 0, UST pid: 0, kernel: 200000) > >> \-\-output TYPE > >> Channel output type. Possible values: mmap, splice > >> + (default UST uid: mmap, UST pid: mmap, kernel: splice) > >> \-\-buffers-uid > >> Use per UID buffer (\-u only). Buffers are shared between applications > >> that have the same UID. > >> @@ -347,9 +351,10 @@ same type. > >> Use shared buffer for the whole system (\-k only) > >> \-C, \-\-tracefile-size SIZE > >> Maximum size of each tracefile within a stream (in bytes). > >> + 0 means unlimited. (default: 0) > >> \-W, \-\-tracefile-count COUNT > >> Used in conjunction with \-C option, this will limit the number > >> - of files created to the specified count. > >> + of files created to the specified count. 0 means unlimited. (default: 0) > >> > >> .B EXAMPLES: > >> > >> diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c > >> index ff2db69..8f835fd 100644 > >> --- a/src/bin/lttng-sessiond/channel.c > >> +++ b/src/bin/lttng-sessiond/channel.c > >> @@ -33,7 +33,8 @@ > >> /* > >> * Return allocated channel attributes. > >> */ > >> -struct lttng_channel *channel_new_default_attr(int dom) > >> +struct lttng_channel *channel_new_default_attr(int dom, > >> + enum lttng_buffer_type type) > >> { > >> struct lttng_channel *chan; > >> > >> @@ -49,10 +50,14 @@ struct lttng_channel *channel_new_default_attr(int dom) > >> goto error; > >> } > >> > >> + /* Same for all domains. */ > >> chan->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; > >> + chan->attr.tracefile_size = DEFAULT_CHANNEL_TRACEFILE_SIZE; > >> + chan->attr.tracefile_count = DEFAULT_CHANNEL_TRACEFILE_COUNT; > >> > >> switch (dom) { > >> case LTTNG_DOMAIN_KERNEL: > >> + assert(type == LTTNG_BUFFER_GLOBAL); > >> chan->attr.subbuf_size = > >> default_get_kernel_channel_subbuf_size(); > >> chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; > >> @@ -61,16 +66,27 @@ struct lttng_channel *channel_new_default_attr(int dom) > >> chan->attr.read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; > >> break; > >> case LTTNG_DOMAIN_UST: > >> -#if 0 > >> - case LTTNG_DOMAIN_UST_PID: > >> - case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: > >> - case LTTNG_DOMAIN_UST_EXEC_NAME: > >> -#endif > >> - chan->attr.subbuf_size = default_get_ust_channel_subbuf_size(); > >> - chan->attr.num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; > >> - chan->attr.output = DEFAULT_UST_CHANNEL_OUTPUT; > >> - chan->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; > >> - chan->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; > >> + switch (type) { > >> + case LTTNG_BUFFER_PER_UID: > >> + chan->attr.subbuf_size = default_get_ust_uid_channel_subbuf_size(); > >> + chan->attr.num_subbuf = DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM; > >> + chan->attr.output = DEFAULT_UST_UID_CHANNEL_OUTPUT; > >> + chan->attr.switch_timer_interval = > >> + DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER; > >> + chan->attr.read_timer_interval = > >> + DEFAULT_UST_UID_CHANNEL_READ_TIMER; > >> + break; > >> + case LTTNG_BUFFER_PER_PID: > >> + default: > >> + chan->attr.subbuf_size = default_get_ust_pid_channel_subbuf_size(); > >> + chan->attr.num_subbuf = DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM; > >> + chan->attr.output = DEFAULT_UST_PID_CHANNEL_OUTPUT; > >> + chan->attr.switch_timer_interval = > >> + DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER; > >> + chan->attr.read_timer_interval = > >> + DEFAULT_UST_PID_CHANNEL_READ_TIMER; > >> + break; > >> + } > >> break; > >> default: > >> goto error; /* Not implemented */ > >> @@ -158,7 +174,8 @@ int channel_kernel_create(struct ltt_kernel_session *ksession, > >> > >> /* Creating channel attributes if needed */ > >> if (attr == NULL) { > >> - defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); > >> + defattr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, > >> + LTTNG_BUFFER_GLOBAL); > >> if (defattr == NULL) { > >> ret = LTTNG_ERR_FATAL; > >> goto error; > >> @@ -237,7 +254,7 @@ int channel_ust_create(struct ltt_ust_session *usess, > >> > >> /* Creating channel attributes if needed */ > >> if (attr == NULL) { > >> - defattr = channel_new_default_attr(LTTNG_DOMAIN_UST); > >> + defattr = channel_new_default_attr(LTTNG_DOMAIN_UST, type); > >> if (defattr == NULL) { > >> ret = LTTNG_ERR_FATAL; > >> goto error; > >> @@ -245,11 +262,6 @@ int channel_ust_create(struct ltt_ust_session *usess, > >> attr = defattr; > >> } > >> > >> - if (attr->attr.subbuf_size < DEFAULT_UST_CHANNEL_SUBBUF_SIZE) { > >> - ret = LTTNG_ERR_INVALID; > >> - goto error; > >> - } > >> - > >> /* > >> * Validate UST buffer size and number of buffers: must both be power of 2 > >> * and nonzero. We validate right here for UST, because applications will > >> @@ -285,7 +297,18 @@ int channel_ust_create(struct ltt_ust_session *usess, > >> /* Validate buffer type. */ > >> switch (type) { > >> case LTTNG_BUFFER_PER_PID: > >> + if (attr->attr.subbuf_size < > >> + default_get_ust_pid_channel_subbuf_size()) { > >> + ret = LTTNG_ERR_INVALID; > >> + goto error; > >> + } > >> + break; > >> case LTTNG_BUFFER_PER_UID: > >> + if (attr->attr.subbuf_size < > >> + default_get_ust_uid_channel_subbuf_size()) { > >> + ret = LTTNG_ERR_INVALID; > >> + goto error; > >> + } > >> break; > >> default: > >> ret = LTTNG_ERR_BUFFER_NOT_SUPPORTED; > >> diff --git a/src/bin/lttng-sessiond/channel.h b/src/bin/lttng-sessiond/channel.h > >> index 7fbbb4c..15cabea 100644 > >> --- a/src/bin/lttng-sessiond/channel.h > >> +++ b/src/bin/lttng-sessiond/channel.h > >> @@ -30,7 +30,8 @@ int channel_kernel_enable(struct ltt_kernel_session *ksession, > >> int channel_kernel_create(struct ltt_kernel_session *ksession, > >> struct lttng_channel *chan, int kernel_pipe); > >> > >> -struct lttng_channel *channel_new_default_attr(int domain); > >> +struct lttng_channel *channel_new_default_attr(int domain, > >> + enum lttng_buffer_type type); > >> > >> int channel_ust_create(struct ltt_ust_session *usess, > >> struct lttng_channel *attr, enum lttng_buffer_type type); > >> diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c > >> index 5d2cba1..528665a 100644 > >> --- a/src/bin/lttng-sessiond/cmd.c > >> +++ b/src/bin/lttng-sessiond/cmd.c > >> @@ -1106,7 +1106,7 @@ int cmd_add_context(struct ltt_session *session, int domain, > >> if (chan_count == 0) { > >> struct lttng_channel *attr; > >> /* Create default channel */ > >> - attr = channel_new_default_attr(domain); > >> + attr = channel_new_default_attr(domain, usess->buffer_type); > >> if (attr == NULL) { > >> ret = LTTNG_ERR_FATAL; > >> goto error; > >> @@ -1166,7 +1166,8 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, > >> kchan = trace_kernel_get_channel_by_name(channel_name, > >> session->kernel_session); > >> if (kchan == NULL) { > >> - attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); > >> + attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, > >> + LTTNG_BUFFER_GLOBAL); > >> if (attr == NULL) { > >> ret = LTTNG_ERR_FATAL; > >> goto error; > >> @@ -1216,7 +1217,8 @@ int cmd_enable_event(struct ltt_session *session, struct lttng_domain *domain, > >> channel_name); > >> if (uchan == NULL) { > >> /* Create default channel */ > >> - attr = channel_new_default_attr(LTTNG_DOMAIN_UST); > >> + attr = channel_new_default_attr(LTTNG_DOMAIN_UST, > >> + usess->buffer_type); > >> if (attr == NULL) { > >> ret = LTTNG_ERR_FATAL; > >> goto error; > >> @@ -1286,7 +1288,8 @@ int cmd_enable_event_all(struct ltt_session *session, > >> session->kernel_session); > >> if (kchan == NULL) { > >> /* Create default channel */ > >> - attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL); > >> + attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL, > >> + LTTNG_BUFFER_GLOBAL); > >> if (attr == NULL) { > >> ret = LTTNG_ERR_FATAL; > >> goto error; > >> @@ -1350,7 +1353,8 @@ int cmd_enable_event_all(struct ltt_session *session, > >> channel_name); > >> if (uchan == NULL) { > >> /* Create default channel */ > >> - attr = channel_new_default_attr(LTTNG_DOMAIN_UST); > >> + attr = channel_new_default_attr(LTTNG_DOMAIN_UST, > >> + usess->buffer_type); > >> if (attr == NULL) { > >> ret = LTTNG_ERR_FATAL; > >> goto error; > >> diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c > >> index 7592d77..8fb685c 100644 > >> --- a/src/bin/lttng-sessiond/trace-ust.c > >> +++ b/src/bin/lttng-sessiond/trace-ust.c > >> @@ -384,8 +384,8 @@ struct ltt_ust_metadata *trace_ust_create_metadata(char *path) > >> lum->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; > >> lum->attr.subbuf_size = default_get_metadata_subbuf_size(); > >> lum->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; > >> - lum->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; > >> - lum->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; > >> + lum->attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER; > >> + lum->attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER; > >> lum->attr.output = LTTNG_UST_MMAP; > >> > >> lum->handle = -1; > >> diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c > >> index e362381..5710226 100644 > >> --- a/src/bin/lttng-sessiond/ust-app.c > >> +++ b/src/bin/lttng-sessiond/ust-app.c > >> @@ -2527,8 +2527,8 @@ static int create_ust_app_metadata(struct ust_app_session *ua_sess, > >> metadata->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; > >> metadata->attr.subbuf_size = default_get_metadata_subbuf_size(); > >> metadata->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; > >> - metadata->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; > >> - metadata->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; > >> + metadata->attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER; > >> + metadata->attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER; > >> metadata->attr.output = LTTNG_UST_MMAP; > >> metadata->attr.type = LTTNG_UST_CHAN_METADATA; > >> } else { > >> diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c > >> index 4816d62..c7bbca1 100644 > >> --- a/src/bin/lttng/commands/enable_channels.c > >> +++ b/src/bin/lttng/commands/enable_channels.c > >> @@ -104,28 +104,40 @@ static void usage(FILE *ofp) > >> fprintf(ofp, " --overwrite Flight recorder mode%s\n", > >> DEFAULT_CHANNEL_OVERWRITE ? " (default)" : ""); > >> fprintf(ofp, " --subbuf-size SIZE Subbuffer size in bytes {+k,+M,+G}\n"); > >> - fprintf(ofp, " (default: %zu, kernel default: %zu)\n", > >> - default_get_channel_subbuf_size(), > >> + fprintf(ofp, " (default UST uid: %zu, UST pid: %zu, kernel: %zu)\n", > >> + default_get_ust_uid_channel_subbuf_size(), > >> + default_get_ust_pid_channel_subbuf_size(), > >> default_get_kernel_channel_subbuf_size()); > >> fprintf(ofp, " Rounded up to the next power of 2.\n"); > >> fprintf(ofp, " --num-subbuf NUM Number of subbufers\n"); > >> - fprintf(ofp, " (default: %u)\n", > >> - DEFAULT_CHANNEL_SUBBUF_NUM); > >> + fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u)\n", > >> + DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM, DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM, > >> + DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM); > >> fprintf(ofp, " Rounded up to the next power of 2.\n"); > >> - fprintf(ofp, " --switch-timer USEC Switch timer interval in usec (default: %u)\n", > >> - DEFAULT_CHANNEL_SWITCH_TIMER); > >> - fprintf(ofp, " --read-timer USEC Read timer interval in usec (UST default: %u, kernel default: %u)\n", > >> - DEFAULT_UST_CHANNEL_READ_TIMER, DEFAULT_KERNEL_CHANNEL_READ_TIMER); > >> + fprintf(ofp, " --switch-timer USEC Switch timer interval in usec\n"); > >> + fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u)\n", > >> + DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER, DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER, > >> + DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER); > >> + fprintf(ofp, " --read-timer USEC Read timer interval in usec.\n"); > >> + fprintf(ofp, " (default UST uid: %u, UST pid: %u, kernel: %u)\n", > >> + DEFAULT_UST_UID_CHANNEL_READ_TIMER, DEFAULT_UST_UID_CHANNEL_READ_TIMER, > >> + DEFAULT_KERNEL_CHANNEL_READ_TIMER); > >> fprintf(ofp, " --output TYPE Channel output type (Values: %s, %s)\n", > >> output_mmap, output_splice); > >> + fprintf(ofp, " (default UST uid: %s, UST pid: %s, kernel: %s)\n", > >> + DEFAULT_UST_UID_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice, > >> + DEFAULT_UST_PID_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice, > >> + DEFAULT_KERNEL_CHANNEL_OUTPUT == LTTNG_EVENT_MMAP ? output_mmap : output_splice); > >> fprintf(ofp, " --buffers-uid Use per UID buffer (-u only)\n"); > >> fprintf(ofp, " --buffers-pid Use per PID buffer (-u only)\n"); > >> fprintf(ofp, " --buffers-global Use shared buffer for the whole system (-k only)\n"); > >> fprintf(ofp, " -C, --tracefile-size SIZE\n"); > >> - fprintf(ofp, " Maximum size of each tracefile within a stream (in bytes).\n"); > >> + fprintf(ofp, " Maximum size of each tracefile within a stream (in bytes). 0 means unlimited.\n"); > >> + fprintf(ofp, " (default: %u)\n", DEFAULT_CHANNEL_TRACEFILE_SIZE); > >> fprintf(ofp, " -W, --tracefile-count COUNT\n"); > >> fprintf(ofp, " Used in conjunction with -C option, this will limit the number\n"); > >> - fprintf(ofp, " of files created to the specified count.\n"); > >> + fprintf(ofp, " of files created to the specified count. 0 means unlimited.\n"); > >> + fprintf(ofp, " (default: %u)\n", DEFAULT_CHANNEL_TRACEFILE_COUNT); > >> fprintf(ofp, "\n"); > >> } > >> > >> diff --git a/src/common/defaults.c b/src/common/defaults.c > >> index ccdbaf4..d74a42b 100644 > >> --- a/src/common/defaults.c > >> +++ b/src/common/defaults.c > >> @@ -24,7 +24,8 @@ > >> size_t default_channel_subbuf_size; > >> size_t default_metadata_subbuf_size; > >> size_t default_kernel_channel_subbuf_size; > >> -size_t default_ust_channel_subbuf_size; > >> +size_t default_ust_pid_channel_subbuf_size; > >> +size_t default_ust_uid_channel_subbuf_size; > >> > >> static void __attribute__((constructor)) init_defaults(void) > >> { > >> @@ -39,11 +40,13 @@ static void __attribute__((constructor)) init_defaults(void) > >> } > >> > >> default_channel_subbuf_size = > >> - max(DEFAULT_CHANNEL_SUBBUF_SIZE, page_size); > >> + max(_DEFAULT_CHANNEL_SUBBUF_SIZE, page_size); > >> default_metadata_subbuf_size = > >> max(DEFAULT_METADATA_SUBBUF_SIZE, page_size); > >> default_kernel_channel_subbuf_size = > >> max(DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE, page_size); > >> - default_ust_channel_subbuf_size = > >> - max(DEFAULT_UST_CHANNEL_SUBBUF_SIZE, page_size); > >> + default_ust_pid_channel_subbuf_size = > >> + max(DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE, page_size); > >> + default_ust_uid_channel_subbuf_size = > >> + max(DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE, page_size); > >> } > >> diff --git a/src/common/defaults.h b/src/common/defaults.h > >> index fb6a975..2c73277 100644 > >> --- a/src/common/defaults.h > >> +++ b/src/common/defaults.h > >> @@ -112,55 +112,57 @@ > >> > >> /* Default channel attributes */ > >> #define DEFAULT_CHANNEL_NAME "channel0" > >> -#define DEFAULT_CHANNEL_OVERWRITE 0 /* usec */ > >> -/* DEFAULT_CHANNEL_SUBBUF_SIZE must always be a power of 2 */ > >> -#define DEFAULT_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ > >> -/* DEFAULT_CHANNEL_SUBBUF_NUM must always be a power of 2 */ > >> -#define DEFAULT_CHANNEL_SUBBUF_NUM 4 > >> -#define DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */ > >> -#define DEFAULT_CHANNEL_READ_TIMER 200000 /* usec */ > >> -#define DEFAULT_CHANNEL_OUTPUT LTTNG_EVENT_MMAP > >> - > >> +#define DEFAULT_CHANNEL_OVERWRITE 0 > >> +#define DEFAULT_CHANNEL_TRACEFILE_SIZE 0 > >> +#define DEFAULT_CHANNEL_TRACEFILE_COUNT 0 > >> + > >> +/* Must always be a power of 2 */ > >> +#define _DEFAULT_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ > >> +/* Must always be a power of 2 */ > >> +#define _DEFAULT_CHANNEL_SUBBUF_NUM 4 > >> +#define _DEFAULT_CHANNEL_SWITCH_TIMER 0 /* usec */ > >> +#define _DEFAULT_CHANNEL_READ_TIMER 200000 /* usec */ > >> +#define _DEFAULT_CHANNEL_OUTPUT LTTNG_EVENT_MMAP > >> + > >> +/* Metadata channel defaults. */ > >> #define DEFAULT_METADATA_SUBBUF_SIZE 4096 > >> #define DEFAULT_METADATA_SUBBUF_NUM 2 > >> #define DEFAULT_METADATA_CACHE_SIZE 4096 > >> +#define DEFAULT_METADATA_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER > >> +#define DEFAULT_METADATA_READ_TIMER _DEFAULT_CHANNEL_READ_TIMER > >> +#define DEFAULT_METADATA_OUTPUT _DEFAULT_CHANNEL_OUTPUT > >> > >> /* Kernel has different defaults */ > >> > >> /* DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE must always be a power of 2 */ > >> -#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE 262144 /* bytes */ > >> +#define DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE 262144 /* bytes */ > >> /* > >> * DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM must always be a power of 2. > >> * Update help manually if override. > >> */ > >> -#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM DEFAULT_CHANNEL_SUBBUF_NUM > >> +#define DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM > >> /* See lttng-kernel.h enum lttng_kernel_output for channel output */ > >> -#define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_EVENT_SPLICE > >> -/* By default, unlimited tracefile size */ > >> -#define DEFAULT_KERNEL_CHANNEL_TRACEFILE_SIZE 0 > >> -/* By default, unlimited tracefile count */ > >> -#define DEFAULT_KERNEL_CHANNEL_TRACEFILE_COUNT 0 > >> - > >> -#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER \ > >> - DEFAULT_CHANNEL_SWITCH_TIMER > >> -#define DEFAULT_KERNEL_CHANNEL_READ_TIMER 200000 /* usec */ > >> +#define DEFAULT_KERNEL_CHANNEL_OUTPUT LTTNG_EVENT_SPLICE > >> +#define DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER > >> +#define DEFAULT_KERNEL_CHANNEL_READ_TIMER _DEFAULT_CHANNEL_READ_TIMER > >> > >> /* User space defaults */ > >> > >> /* Must be a power of 2 */ > >> -#define DEFAULT_UST_CHANNEL_SUBBUF_SIZE 4096 /* bytes */ > >> +#define DEFAULT_UST_PID_CHANNEL_SUBBUF_SIZE _DEFAULT_CHANNEL_SUBBUF_SIZE > >> +#define DEFAULT_UST_UID_CHANNEL_SUBBUF_SIZE 131072 /* bytes */ > >> /* Must be a power of 2. Update help manuall if override. */ > >> -#define DEFAULT_UST_CHANNEL_SUBBUF_NUM DEFAULT_CHANNEL_SUBBUF_NUM > >> +#define DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM > >> +#define DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM _DEFAULT_CHANNEL_SUBBUF_NUM > >> /* See lttng-ust.h enum lttng_ust_output */ > >> -#define DEFAULT_UST_CHANNEL_OUTPUT LTTNG_EVENT_MMAP > >> -/* By default, unlimited tracefile size */ > >> -#define DEFAULT_UST_CHANNEL_TRACEFILE_SIZE 0 > >> -/* By default, unlimited tracefile count */ > >> -#define DEFAULT_UST_CHANNEL_TRACEFILE_COUNT 0 > >> +#define DEFAULT_UST_PID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT > >> +#define DEFAULT_UST_UID_CHANNEL_OUTPUT _DEFAULT_CHANNEL_OUTPUT > >> +/* Timers in usec. */ > >> +#define DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER > >> +#define DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER _DEFAULT_CHANNEL_SWITCH_TIMER > >> > >> -#define DEFAULT_UST_CHANNEL_SWITCH_TIMER \ > >> - DEFAULT_CHANNEL_SWITCH_TIMER > >> -#define DEFAULT_UST_CHANNEL_READ_TIMER 0 /* usec */ > >> +#define DEFAULT_UST_PID_CHANNEL_READ_TIMER 0 /* usec */ > >> +#define DEFAULT_UST_UID_CHANNEL_READ_TIMER 0 /* usec */ > >> > >> /* > >> * Default timeout value for the sem_timedwait() call. Blocking forever is not > >> @@ -202,10 +204,10 @@ > >> > >> extern size_t default_channel_subbuf_size; > >> extern size_t default_metadata_subbuf_size; > >> -extern size_t default_ust_channel_subbuf_size; > >> +extern size_t default_ust_pid_channel_subbuf_size; > >> +extern size_t default_ust_uid_channel_subbuf_size; > >> extern size_t default_kernel_channel_subbuf_size; > >> > >> - > >> /* > >> * Returns the default subbuf size. > >> * > >> @@ -243,15 +245,27 @@ size_t default_get_kernel_channel_subbuf_size(void) > >> } > >> > >> /* > >> - * Returns the default subbuf size for the UST domain. > >> + * Returns the default subbuf size for the UST domain per PID. > >> + * > >> + * This function depends on a value that is set at constructor time, so it is > >> + * unsafe to call it from another constructor. > >> + */ > >> +static inline > >> +size_t default_get_ust_pid_channel_subbuf_size(void) > >> +{ > >> + return default_ust_pid_channel_subbuf_size; > >> +} > >> + > >> +/* > >> + * Returns the default subbuf size for the UST domain per UID. > >> * > >> * This function depends on a value that is set at constructor time, so it is > >> * unsafe to call it from another constructor. > >> */ > >> static inline > >> -size_t default_get_ust_channel_subbuf_size(void) > >> +size_t default_get_ust_uid_channel_subbuf_size(void) > >> { > >> - return default_ust_channel_subbuf_size; > >> + return default_ust_uid_channel_subbuf_size; > >> } > >> > >> #endif /* _DEFAULTS_H */ > >> diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c > >> index 3787e29..a7328eb 100644 > >> --- a/src/lib/lttng-ctl/lttng-ctl.c > >> +++ b/src/lib/lttng-ctl/lttng-ctl.c > >> @@ -1386,29 +1386,37 @@ void lttng_channel_set_default_attr(struct lttng_domain *domain, > >> > >> memset(attr, 0, sizeof(struct lttng_channel_attr)); > >> > >> + /* Same for all domains. */ > >> + attr->overwrite = DEFAULT_CHANNEL_OVERWRITE; > >> + attr->tracefile_size = DEFAULT_CHANNEL_TRACEFILE_SIZE; > >> + attr->tracefile_count = DEFAULT_CHANNEL_TRACEFILE_COUNT; > >> + > >> switch (domain->type) { > >> case LTTNG_DOMAIN_KERNEL: > >> - attr->overwrite = DEFAULT_CHANNEL_OVERWRITE; > >> attr->switch_timer_interval = DEFAULT_KERNEL_CHANNEL_SWITCH_TIMER; > >> attr->read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; > >> - > >> attr->subbuf_size = default_get_kernel_channel_subbuf_size(); > >> attr->num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; > >> attr->output = DEFAULT_KERNEL_CHANNEL_OUTPUT; > >> - attr->tracefile_size = DEFAULT_KERNEL_CHANNEL_TRACEFILE_SIZE; > >> - attr->tracefile_count = DEFAULT_KERNEL_CHANNEL_TRACEFILE_COUNT; > >> break; > >> case LTTNG_DOMAIN_UST: > >> - attr->overwrite = DEFAULT_CHANNEL_OVERWRITE; > >> - attr->switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; > >> - attr->read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; > >> - > >> - attr->subbuf_size = default_get_ust_channel_subbuf_size(); > >> - attr->num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; > >> - attr->output = DEFAULT_UST_CHANNEL_OUTPUT; > >> - attr->tracefile_size = DEFAULT_UST_CHANNEL_TRACEFILE_SIZE; > >> - attr->tracefile_count = DEFAULT_UST_CHANNEL_TRACEFILE_COUNT; > >> - break; > >> + switch (domain->buf_type) { > >> + case LTTNG_BUFFER_PER_UID: > >> + attr->subbuf_size = default_get_ust_uid_channel_subbuf_size(); > >> + attr->num_subbuf = DEFAULT_UST_UID_CHANNEL_SUBBUF_NUM; > >> + attr->output = DEFAULT_UST_UID_CHANNEL_OUTPUT; > >> + attr->switch_timer_interval = DEFAULT_UST_UID_CHANNEL_SWITCH_TIMER; > >> + attr->read_timer_interval = DEFAULT_UST_UID_CHANNEL_READ_TIMER; > >> + break; > >> + case LTTNG_BUFFER_PER_PID: > >> + default: > >> + attr->subbuf_size = default_get_ust_pid_channel_subbuf_size(); > >> + attr->num_subbuf = DEFAULT_UST_PID_CHANNEL_SUBBUF_NUM; > >> + attr->output = DEFAULT_UST_PID_CHANNEL_OUTPUT; > >> + attr->switch_timer_interval = DEFAULT_UST_PID_CHANNEL_SWITCH_TIMER; > >> + attr->read_timer_interval = DEFAULT_UST_PID_CHANNEL_READ_TIMER; > >> + break; > >> + } > >> default: > >> /* Default behavior: leave set to 0. */ > >> break; > >> diff --git a/tests/unit/test_ust_data.c b/tests/unit/test_ust_data.c > >> index a79e2eb..c79dbf6 100644 > >> --- a/tests/unit/test_ust_data.c > >> +++ b/tests/unit/test_ust_data.c > >> @@ -111,9 +111,9 @@ static void test_create_ust_metadata(void) > >> metadata->attr.num_subbuf > >> == DEFAULT_METADATA_SUBBUF_NUM && > >> metadata->attr.switch_timer_interval > >> - == DEFAULT_UST_CHANNEL_SWITCH_TIMER && > >> + == DEFAULT_METADATA_SWITCH_TIMER && > >> metadata->attr.read_timer_interval > >> - == DEFAULT_UST_CHANNEL_READ_TIMER && > >> + == DEFAULT_METADATA_READ_TIMER && > >> metadata->attr.output == LTTNG_UST_MMAP, > >> "Validate UST session metadata"); > >> > >> -- > >> 1.7.10.4 > >> > >> > >> _______________________________________________ > >> lttng-dev mailing list > >> lttng-dev at lists.lttng.org > >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Tue May 7 15:51:39 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Tue, 7 May 2013 15:51:39 -0400 Subject: [lttng-dev] Userspace events not seen by kernel daemon? In-Reply-To: <20130507140801.GC5118@Krystal> References: <48CF5AC71E61DB46B70D0F388054EFFD0261A7@VAL-E-01.valcartier.drdc-rddc.gc.ca> <20130507140801.GC5118@Krystal> Message-ID: Hi Daniel, This is the expected behaviour. Only users that belong to the "tracing" group can interact with the root session daemon as pointed out in the lttng-tools manpage: "LTTng provides the use of a tracing group (default: tracing). Whomever is in that group can interact with the root session daemon and thus trace the kernel. Session daemons can co-exist meaning that you can have a session daemon running as Alice that can be used to trace her applications along side with a root daemon or even a Bob daemon." Since your user-space application is running as a non-tracing user, it can only interact with a session daemon running as that same user. There is currently no way (that I know of) to create an omniscient session that would pickup events from the kernel and from every user without forcing them to be part of the tracing group. Regards, J?r?mie On Tue, May 7, 2013 at 10:08 AM, Mathieu Desnoyers wrote: > * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: >> I'm running an up-to-date LTTng suite (except for lttng-ust, where I'm using the 5 Mar 2013 20:17:22 commit). I've compiled the lttng-ust/doc/examples/easy-ust/sample application. While I run it (as a user *not* belonging to the tracing group), I notice something unexpected: >> >> * The local session daemon lists the sample user-space event ('lttng list -u') >> * The kernel session daemon does not see the sample user-space event at all ('sudo lttng list -u ') > > I guess you mean "per-user" rather than "local", and "system-wide" > rather than "kernel" here. > > I will let Jeremie look into your question, > > Thanks, > > Mathieu > >> >> It was my understanding that the kernel daemon should see all kernel and user-space events (for as many user-spaces as there might be). >> >> To test this further, I set up two traces using separate consoles. The first is a user session: >> >> $ lttng create usersession >> $ lttng enable-event -u --all >> >> The other is a kernel session: >> >> $ sudo -H lttng create kernelsession >> $ sudo -H lttng enable-event -u --all >> $ sudo -H lttng enable-event -k sched_switch >> >> I start each session (respectively '$ lttng start' and '$ sudo -H lttng start') and the sample application (from a third console, '$ ./sample'). I wait until sample concludes, then shut down both sessions (respectively '$ lttng destroy' and '$ sudo -H lttng destroy'). Use of 'sudo -H' avoids current trace name collisions (contention over the .lttngrc file), as reported earlier on this list (but not filed as a bug...maybe I should do that too). >> >> The kernel trace contains no UST events, as can readily be discerned by the absence of a /ust branch in its folder structure. This is confirmed by babeltrace, which sees some 245 000 kernel events and nothing else. There are no missing events (babeltrace does not complain about skipped events, which it did with some other traces generated about the same time). The System Monitor shows two lttng-sessiond daemons (one for me, another for root) and three lttng-consumerd daemons (one for me, two for root) as expected. >> >> What did I do wrong? >> >> Daniel U. Thibault >> R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) >> Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) >> Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) >> 2459 route de la Bravoure >> Qu?bec, QC G3J 1X5 >> CANADA >> Vox : (418) 844-4000 x4245 >> Fax : (418) 844-4538 >> NAC : 918V QSDJ >> Gouvernement du Canada / Government of Canada >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 7 15:55:27 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 15:55:27 -0400 Subject: [lttng-dev] [PATCH babeltrace] Move memstream.h and uuid.h to include/babeltrace/compat directory In-Reply-To: <009B25148989C6458484484699278506985C2118@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506985C2118@EU-MBX-01.mgc.mentorg.com> Message-ID: <20130507195527.GA8879@Krystal> I see that this patch has been splitted into the windows support patchset, so I'll merge the version in the patchset. Thanks, Mathieu * Ikaheimonen, JP (jp_ikaheimonen at mentor.com) wrote: > As preparation for a new compatibility layer, the files memstream.h > and uuid.h are moved to include/babeltrace/compat. > --- > converter/babeltrace-log.c | 2 +- > formats/ctf/Makefile.am | 3 +-- > formats/ctf/ctf.c | 4 ++-- > formats/ctf/metadata/ctf-visitor-generate-io-struct.c | 2 +- > include/Makefile.am | 3 ++- > {formats/ctf => include/babeltrace/compat}/memstream.h | 0 > include/babeltrace/{ => compat}/uuid.h | 0 > include/babeltrace/ctf-ir/metadata.h | 2 +- > 8 files changed, 8 insertions(+), 8 deletions(-) > rename {formats/ctf => include/babeltrace/compat}/memstream.h (100%) > rename include/babeltrace/{ => compat}/uuid.h (100%) > > diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c > index 2148711..0214e9a 100644 > --- a/converter/babeltrace-log.c > +++ b/converter/babeltrace-log.c > @@ -45,7 +45,7 @@ > > #include > #include > -#include > +#include > #include > > #define USEC_PER_SEC 1000000UL > diff --git a/formats/ctf/Makefile.am b/formats/ctf/Makefile.am > index d803b69..6dcc1bb 100644 > --- a/formats/ctf/Makefile.am > +++ b/formats/ctf/Makefile.am > @@ -9,8 +9,7 @@ libbabeltrace_ctf_la_SOURCES = \ > events.c \ > iterator.c \ > callbacks.c \ > - events-private.h \ > - memstream.h > + events-private.h > > # Request that the linker keeps all static libraries objects. > libbabeltrace_ctf_la_LDFLAGS = \ > diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c > index 5a51495..bb3ba83 100644 > --- a/formats/ctf/ctf.c > +++ b/formats/ctf/ctf.c > @@ -33,7 +33,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > @@ -51,7 +51,7 @@ > #include "metadata/ctf-parser.h" > #include "metadata/ctf-ast.h" > #include "events-private.h" > -#include "memstream.h" > +#include " > > /* > * We currently simply map a page to read the packet header and packet > diff --git a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > index 9bcc170..3be054d 100644 > --- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > +++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > @@ -36,7 +36,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include "ctf-scanner.h" > diff --git a/include/Makefile.am b/include/Makefile.am > index 824be61..0ade99b 100644 > --- a/include/Makefile.am > +++ b/include/Makefile.am > @@ -30,6 +30,7 @@ noinst_HEADERS = \ > babeltrace/ctf/types.h \ > babeltrace/ctf/callbacks-internal.h \ > babeltrace/trace-handle-internal.h \ > - babeltrace/uuid.h \ > + babeltrace/compat/uuid.h \ > + babeltrace/compat/memstream.h \ > babeltrace/endian.h \ > babeltrace/mmap-align.h > diff --git a/formats/ctf/memstream.h b/include/babeltrace/compat/memstream.h > similarity index 100% > rename from formats/ctf/memstream.h > rename to include/babeltrace/compat/memstream.h > diff --git a/include/babeltrace/uuid.h b/include/babeltrace/compat/uuid.h > similarity index 100% > rename from include/babeltrace/uuid.h > rename to include/babeltrace/compat/uuid.h > diff --git a/include/babeltrace/ctf-ir/metadata.h b/include/babeltrace/ctf-ir/metadata.h > index 04e8945..fdb671a 100644 > --- a/include/babeltrace/ctf-ir/metadata.h > +++ b/include/babeltrace/ctf-ir/metadata.h > @@ -32,7 +32,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > > -- > 1.7.10.4 > > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From rbraun at sceen.net Tue May 7 16:07:12 2013 From: rbraun at sceen.net (Richard Braun) Date: Tue, 7 May 2013 22:07:12 +0200 Subject: [lttng-dev] Quick questions about liburcu and RCU in general In-Reply-To: <20130507152437.GE3648@linux.vnet.ibm.com> References: <20130507094636.GA6151@mail.sceen.net> <20130507115914.GB3875@Krystal> <20130507142352.GA3648@linux.vnet.ibm.com> <20130507145112.GA29086@mail.sceen.net> <20130507152437.GE3648@linux.vnet.ibm.com> Message-ID: <20130507200711.GA23006@mail.sceen.net> On Tue, May 07, 2013 at 08:24:37AM -0700, Paul E. McKenney wrote: > > My question is rather about the techniques than the existing > > implementations. Is it safe to implement RCU in an unrelated project under > > GPLv3+, considering it's patented ? > > I am not a lawyer, but my understanding is that the GPL patent protection > applies to derived works. So if you start with userspace-rcu, adapt it > to your application, and relicense to GPLv3+, you should be OK. I do > not believe this works if you do a cleanroom implementation, but again, > I am not a lawyer. Noted. Thank you both for your answers. -- Richard Braun From mathieu.desnoyers at efficios.com Tue May 7 16:12:50 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 7 May 2013 16:12:50 -0400 Subject: [lttng-dev] Extracting LTTng ring buffers from a vmcore? In-Reply-To: <20130318195810.Horde.Fv0FZZir309RR6oS2LPiI2A@imap.linux.ibm.com> References: <20130318195810.Horde.Fv0FZZir309RR6oS2LPiI2A@imap.linux.ibm.com> Message-ID: <20130507201250.GD8879@Krystal> * nathanm2 at linux.vnet.ibm.com (nathanm2 at linux.vnet.ibm.com) wrote: > While reading through the lib_ring_buffer_commit function I came across > the following comment: > > /* > * Update used size at each commit. It's needed only for extracting > * ring_buffer buffers from vmcore, after crash. > */ > > I need something exactly like this, but didn't see anything while > looking through the lttng tools. Did I miss something? It's there in the ring buffer, but not implemented yet in lttng-modules nor lttng-tools. Thanks, Mathieu > > Thanks > Nate > > > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From laijs at cn.fujitsu.com Wed May 8 05:01:01 2013 From: laijs at cn.fujitsu.com (Lai Jiangshan) Date: Wed, 08 May 2013 17:01:01 +0800 Subject: [lttng-dev] [PATCH] urcu: avoid false sharing for rcu_gp_ctr In-Reply-To: <20130506124433.GB12699@Krystal> References: <50C19575.2070802@cn.fujitsu.com> <20130506124433.GB12699@Krystal> Message-ID: <518A144D.7090805@cn.fujitsu.com> Hi, Mathieu, There is a big compatible problem in URCU which should be fix in next round. LB: liburcu built on the system which has sys_membarrier(). LU: liburcu built on the system which does NOT have sys_membarrier(). LBM: liburcu-mb .... LUM: liburcu-mb ... AB: application(-lliburcu) built on the system which has sys_membarrier(). AU: application(-lliburcu) built on the system which does NOT have sys_membarrier(). ABM application(-lliburcu-mb) ... AUM application(-lliburcu-mb) ... AB/AU + LB/LU: 4 combinations ABM/AUM + LBM/LUM: 4 combinations I remember some of the 8 combinations can't works due to symbols are miss match. only LU+AB and LB+AU ? could you check it? How to fix it: In LU and AU, keep all the symbol name/ABI as LA and AB, but only the behaviors falls back to URCU_MB. Thanks, Lai On 05/06/2013 08:44 PM, Mathieu Desnoyers wrote: > Since we are bumping the urcu soname version number to 2.0.0 for the > upcoming urcu 0.8 anyway, it's time to merge this patch. > > Thanks! > > Mathieu > > * Lai Jiangshan (laijs at cn.fujitsu.com) wrote: >> @rcu_gp_ctr and @registry share the same cache line, it causes >> false sharing and slowdown both of the read site and update site. >> >> Fix: Use different cache line for them. >> >> Although rcu_gp_futex is updated less than rcu_gp_ctr, but >> they always be accessed at almost the same time, so we also move rcu_gp_futex >> to the cacheline of rcu_gp_ctr to reduce the cacheline-usage or cache-missing >> of read site. >> >> >> test: (4X6=24 CPUs) >> >> Before patch: >> >> [root at localhost userspace-rcu]# ./tests/test_urcu_mb 20 1 20 >> SUMMARY ./tests/test_urcu_mb testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 2100285330 nr_writes 3390219 nr_ops 2103675549 >> [root at localhost userspace-rcu]# ./tests/test_urcu_mb 20 1 20 >> SUMMARY ./tests/test_urcu_mb testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 1619868562 nr_writes 3529478 nr_ops 1623398040 >> [root at localhost userspace-rcu]# ./tests/test_urcu_mb 20 1 20 >> SUMMARY ./tests/test_urcu_mb testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 1949067038 nr_writes 3469334 nr_ops 1952536372 >> >> >> after patch: >> >> [root at localhost userspace-rcu]# ./tests/test_urcu_mb 20 1 20 >> SUMMARY ./tests/test_urcu_mb testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 3380191848 nr_writes 4903248 nr_ops 3385095096 >> [root at localhost userspace-rcu]# ./tests/test_urcu_mb 20 1 20 >> SUMMARY ./tests/test_urcu_mb testdur 20 nr_readers 20 rdur 0 wdur 0 nr_writers 1 wdelay 0 nr_reads 3397637486 nr_writes 4129809 nr_ops 3401767295 >> >> Singed-by: Lai Jiangshan >> --- >> diff --git a/urcu.c b/urcu.c >> index 15def09..436d71c 100644 >> --- a/urcu.c >> +++ b/urcu.c >> @@ -83,16 +83,7 @@ void __attribute__((destructor)) rcu_exit(void); >> #endif >> >> static pthread_mutex_t rcu_gp_lock = PTHREAD_MUTEX_INITIALIZER; >> - >> -int32_t rcu_gp_futex; >> - >> -/* >> - * Global grace period counter. >> - * Contains the current RCU_GP_CTR_PHASE. >> - * Also has a RCU_GP_COUNT of 1, to accelerate the reader fast path. >> - * Written to only by writer with mutex taken. Read by both writer and readers. >> - */ >> -unsigned long rcu_gp_ctr = RCU_GP_COUNT; >> +struct urcu_gp rcu_gp = { .ctr = RCU_GP_COUNT }; >> >> /* >> * Written to only by each individual reader. Read by both the reader and the >> @@ -217,8 +208,8 @@ static void wait_gp(void) >> { >> /* Read reader_gp before read futex */ >> smp_mb_master(RCU_MB_GROUP); >> - if (uatomic_read(&rcu_gp_futex) == -1) >> - futex_async(&rcu_gp_futex, FUTEX_WAIT, -1, >> + if (uatomic_read(&rcu_gp.futex) == -1) >> + futex_async(&rcu_gp.futex, FUTEX_WAIT, -1, >> NULL, NULL, 0); >> } >> >> @@ -232,12 +223,12 @@ static void wait_for_readers(struct cds_list_head *input_readers, >> /* >> * Wait for each thread URCU_TLS(rcu_reader).ctr to either >> * indicate quiescence (not nested), or observe the current >> - * rcu_gp_ctr value. >> + * rcu_gp.ctr value. >> */ >> for (;;) { >> wait_loops++; >> if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) { >> - uatomic_dec(&rcu_gp_futex); >> + uatomic_dec(&rcu_gp.futex); >> /* Write futex before read reader_gp */ >> smp_mb_master(RCU_MB_GROUP); >> } >> @@ -270,7 +261,7 @@ static void wait_for_readers(struct cds_list_head *input_readers, >> if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) { >> /* Read reader_gp before write futex */ >> smp_mb_master(RCU_MB_GROUP); >> - uatomic_set(&rcu_gp_futex, 0); >> + uatomic_set(&rcu_gp.futex, 0); >> } >> break; >> } else { >> @@ -289,7 +280,7 @@ static void wait_for_readers(struct cds_list_head *input_readers, >> if (wait_loops == RCU_QS_ACTIVE_ATTEMPTS) { >> /* Read reader_gp before write futex */ >> smp_mb_master(RCU_MB_GROUP); >> - uatomic_set(&rcu_gp_futex, 0); >> + uatomic_set(&rcu_gp.futex, 0); >> } >> break; >> } else { >> @@ -357,10 +348,10 @@ void synchronize_rcu(void) >> >> /* >> * Must finish waiting for quiescent state for original parity before >> - * committing next rcu_gp_ctr update to memory. Failure to do so could >> + * committing next rcu_gp.ctr update to memory. Failure to do so could >> * result in the writer waiting forever while new readers are always >> * accessing data (no progress). Enforce compiler-order of load >> - * URCU_TLS(rcu_reader).ctr before store to rcu_gp_ctr. >> + * URCU_TLS(rcu_reader).ctr before store to rcu_gp.ctr. >> */ >> cmm_barrier(); >> >> @@ -372,13 +363,13 @@ void synchronize_rcu(void) >> cmm_smp_mb(); >> >> /* Switch parity: 0 -> 1, 1 -> 0 */ >> - CMM_STORE_SHARED(rcu_gp_ctr, rcu_gp_ctr ^ RCU_GP_CTR_PHASE); >> + CMM_STORE_SHARED(rcu_gp.ctr, rcu_gp.ctr ^ RCU_GP_CTR_PHASE); >> >> /* >> - * Must commit rcu_gp_ctr update to memory before waiting for quiescent >> + * Must commit rcu_gp.ctr update to memory before waiting for quiescent >> * state. Failure to do so could result in the writer waiting forever >> * while new readers are always accessing data (no progress). Enforce >> - * compiler-order of store to rcu_gp_ctr before load rcu_reader ctr. >> + * compiler-order of store to rcu_gp.ctr before load rcu_reader ctr. >> */ >> cmm_barrier(); >> >> diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h >> index 973826a..0dd733e 100644 >> --- a/urcu/static/urcu.h >> +++ b/urcu/static/urcu.h >> @@ -213,12 +213,20 @@ static inline void smp_mb_slave(int group) >> #define RCU_GP_CTR_PHASE (1UL << (sizeof(unsigned long) << 2)) >> #define RCU_GP_CTR_NEST_MASK (RCU_GP_CTR_PHASE - 1) >> >> -/* >> - * Global quiescent period counter with low-order bits unused. >> - * Using a int rather than a char to eliminate false register dependencies >> - * causing stalls on some architectures. >> - */ >> -extern unsigned long rcu_gp_ctr; >> +struct urcu_gp { >> + /* >> + * Global grace period counter. >> + * Contains the current RCU_GP_CTR_PHASE. >> + * Also has a RCU_GP_COUNT of 1, to accelerate the reader fast path. >> + * Written to only by writer with mutex taken. >> + * Read by both writer and readers. >> + */ >> + unsigned long ctr; >> + >> + int32_t futex; >> +} __attribute__((aligned(CAA_CACHE_LINE_SIZE))); >> + >> +extern struct urcu_gp rcu_gp; >> >> struct rcu_reader { >> /* Data used by both reader and synchronize_rcu() */ >> @@ -231,16 +239,14 @@ struct rcu_reader { >> >> extern DECLARE_URCU_TLS(struct rcu_reader, rcu_reader); >> >> -extern int32_t rcu_gp_futex; >> - >> /* >> * Wake-up waiting synchronize_rcu(). Called from many concurrent threads. >> */ >> static inline void wake_up_gp(void) >> { >> - if (caa_unlikely(uatomic_read(&rcu_gp_futex) == -1)) { >> - uatomic_set(&rcu_gp_futex, 0); >> - futex_async(&rcu_gp_futex, FUTEX_WAKE, 1, >> + if (caa_unlikely(uatomic_read(&rcu_gp.futex) == -1)) { >> + uatomic_set(&rcu_gp.futex, 0); >> + futex_async(&rcu_gp.futex, FUTEX_WAKE, 1, >> NULL, NULL, 0); >> } >> } >> @@ -256,13 +262,13 @@ static inline enum rcu_state rcu_reader_state(unsigned long *ctr) >> v = CMM_LOAD_SHARED(*ctr); >> if (!(v & RCU_GP_CTR_NEST_MASK)) >> return RCU_READER_INACTIVE; >> - if (!((v ^ rcu_gp_ctr) & RCU_GP_CTR_PHASE)) >> + if (!((v ^ rcu_gp.ctr) & RCU_GP_CTR_PHASE)) >> return RCU_READER_ACTIVE_CURRENT; >> return RCU_READER_ACTIVE_OLD; >> } >> >> /* >> - * Helper for _rcu_read_lock(). The format of rcu_gp_ctr (as well as >> + * Helper for _rcu_read_lock(). The format of rcu_gp.ctr (as well as >> * the per-thread rcu_reader.ctr) has the upper bits containing a count of >> * _rcu_read_lock() nesting, and a lower-order bit that contains either zero >> * or RCU_GP_CTR_PHASE. The smp_mb_slave() ensures that the accesses in >> @@ -271,7 +277,7 @@ static inline enum rcu_state rcu_reader_state(unsigned long *ctr) >> static inline void _rcu_read_lock_update(unsigned long tmp) >> { >> if (caa_likely(!(tmp & RCU_GP_CTR_NEST_MASK))) { >> - _CMM_STORE_SHARED(URCU_TLS(rcu_reader).ctr, _CMM_LOAD_SHARED(rcu_gp_ctr)); >> + _CMM_STORE_SHARED(URCU_TLS(rcu_reader).ctr, _CMM_LOAD_SHARED(rcu_gp.ctr)); >> smp_mb_slave(RCU_MB_GROUP); >> } else >> _CMM_STORE_SHARED(URCU_TLS(rcu_reader).ctr, tmp + RCU_GP_COUNT); > From bernd.hufmann at ericsson.com Wed May 8 07:38:02 2013 From: bernd.hufmann at ericsson.com (Bernd Hufmann) Date: Wed, 8 May 2013 11:38:02 +0000 Subject: [lttng-dev] Java code for CTF trace writing? In-Reply-To: <1670315418.908522.1367862807840.JavaMail.root@vmware.com> References: <5176AAFA.8060905@ericsson.com> <1962635283.7490228.1366741297558.JavaMail.root@vmware.com> <5176D556.8040801@ericsson.com> <1218416875.7614701.1366750233878.JavaMail.root@vmware.com> , <1670315418.908522.1367862807840.JavaMail.root@vmware.com> Message-ID: <1EE6FD30D622B345AF385887190055E3085C45@eusaamb107.ericsson.se> Hi Aaron I'd like to comment on the pinning of views (the rest of the discussion is already covered by Alexandre). > 1) support for being able to open as many instances of views as you wish, and then "pin" them to a particular trace. If you could do this then you could open an LTTng linux kernel view and a java trace and > whatever else you wanted at the same time. In addition to the pin support the views would need some mechanism for time sync between them (like the current control flow view syncs based on the selection in > Histogram view) Since Eclipse supports to have multiple instances of the same view it should be straight forward to support multiple instances of the Tracing views. To do that we need to provide an unique instance ID to distinguish the different views. The data handled in the view has to be specific to the instance of the view. For our purpose, the data to be displayed will be related to the trace implementation (ITmfTrace). We have to make sure that the data and view are separated properly (data encapsulation). The next question is how to open a new instance of a tracing view (e.g. ControlFlowView). We could implement it similarly to the Eclipse Properties view. This means we have pin button and command to pin the view to the current active trace. To not change content when changing the trace, the pinned view has to ignore all relevant signals sent between views (e.g. TmfTraceSelectedSignal, TmfTraceOpenedSignal). Additionally, the views need a "Clone" or "New Instance" command (e.g. in the view menu) that creates a new instance of the view. The new view will be filled with the current active trace information (or stays empty initially) and when changing the trace the cloned view will change the content with the new trace information. For the time synchronisation between views, we could have multiple instances of the Histogram View, each one synchronises with the corresponding tracing view instances from above. Or maybe the TimeChartView is sufficient to handle the time synchronisation. Would it be beneficial to have a global action that would allow the user to clone multiple tracing views at the time? This action could allow the user to select the views to be cloned. This could be handy if there are multiple views that need to be cloned at the same time. By the way, the base view class TmfView has already an action to pin a view that extends TmfView. Once created it will add a pin button (toggle) to the view's toolbar. This action toggles a flag in the base class and all sub-class can query this information and act accordingly. Initially this pin action was intended to be used to pin a view for the current selected time and time range. It hasn't been used by any of the Open Souce Tracing views. Even if it was meant for pinning to the current time, it's free for use and could be also be used for pinning to the current trace. Best Regards Bernd ________________________________________ From: Aaron Spear [aspear at vmware.com] Sent: May 6, 2013 1:53 PM To: Erik Ostermueller Cc: Philippe Proulx; Dominique Toupin; Linux Tools developer discussions; lttng-dev at lists.lttng.org Subject: Re: [lttng-dev] Java code for CTF trace writing? Hi Erik, The answer at this moment is no, you can't see that. That said, that is certainly the vision of what I want to create. I am working on extending a view so that I can see Java methods in one trace alongside state changes that come from another trace. The idea is to have a single view that knows how to present state vs. time and then providers for that state for different kinds of tracing. I have in fact done exactly what you want (java app trace + linux kernel trace), but it is clunky right now because you cannot see the Linux kernel trace and the Java trace at the same time. The issue here is simply one of implementation choices related to how traces are viewed. At this moment the views in the LTTng viewer are singletons setup to only allow one trace to be viewed at a time (mostly. the "Time Chart" view is an exception to this). What is needed is one of two things (I think both): 1) support for being able to open as many instances of views as you wish, and then "pin" them to a particular trace. If you could do this then you could open an LTTng linux kernel view and a java trace and whatever else you wanted at the same time. In addition to the pin support the views would need some mechanism for time sync between them (like the current control flow view syncs based on the selection in Histogram view) 2) Change the "state flow view" that I created (borrowing code from the control flow view) so it supports multiple traces (e.g. LTTng kernel trace). I am working on this right now for data driven traces. One thought is that this view infrastructure could be changed so that a single view could show all of these different types of traces. A bunch of refactoring would be required to do this though. The current ControlFlowView has things very specific to kernel traces that don't make sense generically (e.g. process related details as columns in the trace) I can't comment as to the official direction of the project (since I am not a committer...) but Perhaps Alexandre or others could comment on thoughts on what could be done to address this and when. regards, Aaron Spear ----- Original Message ----- > Hello all, > > I've got a question about the Java code that writes CTF traces. > Would this design provide a single trace with Java events and OS events in > the same trace? > Here is an example: > > Consider an all-Java program that sends an XML requests request over HTTP. > Would like the trace detail to show Java method activity as well as OS > activity that opens/closes the socket. > > This could be very helpful for unveiling the details of how Java code > consumes hardware resources. > > Thanks, > --Erik > > -----Original Message----- > From: Aaron Spear [mailto:aspear at vmware.com] > Sent: Tuesday, April 23, 2013 3:51 PM > To: Matthew Khouzam > Cc: Philippe Proulx; Dominique Toupin; lttng-dev at lists.lttng.org; Linux Tools > developer discussions > Subject: Re: [lttng-dev] Java code for CTF trace writing? > > > When would you be available to work on this feature, I would love to > > sync up our efforts for this. > > The way things look right now, I will have bandwidth for it in another month, > so middle to end of May. Perhaps sooner if all the stars align. > > Aaron > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > _____________ > The information contained in this message is proprietary and/or confidential. > If you are not the intended recipient, please: (i) delete the message and > all copies; (ii) do not disclose, distribute or use the message in any > manner; and (iii) notify the sender immediately. In addition, please be > aware that any message addressed to our domain is subject to archiving and > review by persons other than the intended recipient. Thank you > _______________________________________________ lttng-dev mailing list lttng-dev at lists.lttng.org http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From mathieu.desnoyers at efficios.com Wed May 8 09:53:44 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 8 May 2013 09:53:44 -0400 Subject: [lttng-dev] [PATCH] urcu: avoid false sharing for rcu_gp_ctr In-Reply-To: <518A144D.7090805@cn.fujitsu.com> References: <50C19575.2070802@cn.fujitsu.com> <20130506124433.GB12699@Krystal> <518A144D.7090805@cn.fujitsu.com> Message-ID: <20130508135343.GA8230@Krystal> * Lai Jiangshan (laijs at cn.fujitsu.com) wrote: > Hi, Mathieu, > > There is a big compatible problem in URCU which should be fix in next round. > > LB: liburcu built on the system which has sys_membarrier(). > LU: liburcu built on the system which does NOT have sys_membarrier(). > > LBM: liburcu-mb .... > LUM: liburcu-mb ... > > AB: application(-lliburcu) built on the system which has sys_membarrier(). > AU: application(-lliburcu) built on the system which does NOT have sys_membarrier(). > > ABM application(-lliburcu-mb) ... > AUM application(-lliburcu-mb) ... > > AB/AU + LB/LU: 4 combinations > ABM/AUM + LBM/LUM: 4 combinations > > I remember some of the 8 combinations can't works due to symbols are miss match. > only LU+AB and LB+AU ? > > could you check it? > > How to fix it: In LU and AU, keep all the symbol name/ABI as LA and AB, but only > the behaviors falls back to URCU_MB. Hi Lai, Good catch ! Would the following patch work for you ? It introduces RCU_MEMBARRIER_MB for implementation fallback, but keeps RCU_MEMBARRIER defined and used for the RCU flavor mapping file. Thoughts ? Thanks, Mathieu --- diff --git a/urcu.c b/urcu.c index b3f94da..352d63f 100644 --- a/urcu.c +++ b/urcu.c @@ -62,14 +62,14 @@ */ #define RCU_QS_ACTIVE_ATTEMPTS 100 -#ifdef RCU_MEMBARRIER +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) static int init_done; int rcu_has_sys_membarrier; void __attribute__((constructor)) rcu_init(void); #endif -#ifdef RCU_MB +#if defined(RCU_MB) || defined(RCU_MEMBARRIER_MB) void rcu_init(void) { } @@ -135,7 +135,7 @@ static void mutex_unlock(pthread_mutex_t *mutex) urcu_die(ret); } -#ifdef RCU_MEMBARRIER +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) static void smp_mb_master(int group) { if (caa_likely(rcu_has_sys_membarrier)) @@ -145,7 +145,7 @@ static void smp_mb_master(int group) } #endif -#ifdef RCU_MB +#if defined(RCU_MB) || defined(RCU_MEMBARRIER_MB) static void smp_mb_master(int group) { cmm_smp_mb(); @@ -444,7 +444,7 @@ void rcu_unregister_thread(void) mutex_unlock(&rcu_gp_lock); } -#ifdef RCU_MEMBARRIER +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) void rcu_init(void) { if (init_done) diff --git a/urcu/map/urcu.h b/urcu/map/urcu.h index 217bff5..77b3721 100644 --- a/urcu/map/urcu.h +++ b/urcu/map/urcu.h @@ -38,31 +38,6 @@ #define RCU_MEMBARRIER #endif -/* - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to - * RCU_MB - * otherwise. - */ -#if !defined(__linux__) && defined(RCU_MEMBARRIER) -#undef RCU_MEMBARRIER -#define RCU_MB -#endif - -#ifdef RCU_MEMBARRIER -#include - -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ -#ifdef SYS_membarrier -# define MEMBARRIER_EXPEDITED (1 << 0) -# define MEMBARRIER_DELAYED (1 << 1) -# define MEMBARRIER_QUERY (1 << 16) -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) -#else -# undef RCU_MEMBARRIER -# define RCU_MB -#endif -#endif - #ifdef RCU_MEMBARRIER #define rcu_read_lock rcu_read_lock_memb diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h index bee97ee..be3d20c 100644 --- a/urcu/static/urcu.h +++ b/urcu/static/urcu.h @@ -52,15 +52,14 @@ extern "C" { #endif /* - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to RCU_MB - * otherwise. + * RCU_MEMBARRIER is only possibly available on Linux. Fallback to + * RCU_MEMBARRIER_MB otherwise. */ #if !defined(__linux__) && defined(RCU_MEMBARRIER) -#undef RCU_MEMBARRIER -#define RCU_MB +#define RCU_MEMBARRIER_MB #endif -#ifdef RCU_MEMBARRIER +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) #include /* If the headers do not support SYS_membarrier, statically use RCU_MB */ @@ -70,8 +69,7 @@ extern "C" { # define MEMBARRIER_QUERY (1 << 16) # define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) #else -# undef RCU_MEMBARRIER -# define RCU_MB +# define RCU_MEMBARRIER_MB #endif #endif @@ -178,7 +176,7 @@ static inline void rcu_debug_yield_init(void) #define MB_GROUP_ALL 0 #define RCU_MB_GROUP MB_GROUP_ALL -#ifdef RCU_MEMBARRIER +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) extern int rcu_has_sys_membarrier; static inline void smp_mb_slave(int group) @@ -190,7 +188,7 @@ static inline void smp_mb_slave(int group) } #endif -#ifdef RCU_MB +#if defined(RCU_MB) || defined(RCU_MEMBARRIER_MB) static inline void smp_mb_slave(int group) { cmm_smp_mb(); -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From aspear at vmware.com Wed May 8 10:53:35 2013 From: aspear at vmware.com (Aaron Spear) Date: Wed, 8 May 2013 07:53:35 -0700 (PDT) Subject: [lttng-dev] Java code for CTF trace writing? In-Reply-To: <1EE6FD30D622B345AF385887190055E3085C45@eusaamb107.ericsson.se> References: <5176AAFA.8060905@ericsson.com> <1962635283.7490228.1366741297558.JavaMail.root@vmware.com> <5176D556.8040801@ericsson.com> <1218416875.7614701.1366750233878.JavaMail.root@vmware.com> <1670315418.908522.1367862807840.JavaMail.root@vmware.com> <1EE6FD30D622B345AF385887190055E3085C45@eusaamb107.ericsson.se> Message-ID: <1100886.2797960.1368024815323.JavaMail.root@vmware.com> Hi Bernd, Thanks much for the insightful comments. Some more thoughts injected below: ----- Original Message ----- > Hi Aaron > > I'd like to comment on the pinning of views (the rest of the discussion is > already covered by Alexandre). > > > 1) support for being able to open as many instances of views as you wish, > > and then "pin" them to a particular trace. If you could do this then you > > could open an LTTng linux kernel view and a java trace and > > whatever else you wanted at the same time. In addition to the pin support > > the views would need some mechanism for time sync between them (like the > > current control flow view syncs based on the selection in > > Histogram view) > > Since Eclipse supports to have multiple instances of the same view it should > be straight forward to support multiple instances of the Tracing views. To > do that we need to provide an unique instance ID to distinguish the > different views. The data handled in the view has to be specific to the > instance of the view. For our purpose, the data to be displayed will be > related to the trace implementation (ITmfTrace). We have to make sure that > the data and view are separated properly (data encapsulation). The next > question is how to open a new instance of a tracing view (e.g. > ControlFlowView). We could implement it similarly to the Eclipse Properties > view. This means we have pin button and command to pin the view to the > current active trace. To not change content when changing the trace, the > pinned view has to ignore all relevant signals sent between views (e.g. > TmfTraceSelectedSignal, TmfTraceOpenedSignal). Additionally, the views need > a "Clone" or "New Instance" command (e.g. in the view menu) that creates a > new instance of the view. The new view will be filled with the current > active trace information (or stays empty initially) and when changing the > trace the cloned view will change the content with the new trace > information. > > For the time synchronisation between views, we could have multiple instances > of the Histogram View, each one synchronises with the corresponding tracing > view instances from above. Or maybe the TimeChartView is sufficient to > handle the time synchronisation. > > Would it be beneficial to have a global action that would allow the user to > clone multiple tracing views at the time? This action could allow the user > to select the views to be cloned. This could be handy if there are multiple > views that need to be cloned at the same time. One thing that I think is important to keep in mind is that in the average users mind, they will probably not think much about the editor-view model like it is in the Eclipse sense, meaning that for them the control flow, or whatever other view they are looking primarily that shows behavior vs. time is in their mind "the trace" as opposed to the tabular editor with all the raw trace events in it. I mention it only because whatever it is that we do, it seems to me that it would be nice if the usage of it was fluid and natural. I could see wanting to a new control flow instance open every time that I open another trace (or having the same view simply add the additional trace content). So all that to say, I don't think cloning a view, switching to a different trace, and then pinning is the only way that we want to have it work. I think that it would be sensible to have a preference that created a mode whereby any time that you opened a new trace, a separate instance of the views opened, and those separate instances were setup to listen for "shared time navigation signals" which control what time range and particular time is selected globally. Also regarding the current histogram view, this view is really nice in the way that it functions and controls time in the control flow and other views, but I do think it is a screen real estate hog. I don't think that having multiple instances of this is a good idea. I have multiple 27 inch monitors, and in my current usage I struggle for space. So, I cannot help but wonder if there could be another incarnation of it that is more like a combination of the time chart view and the histogram view. In this updated time navigator, you could define synchronization groups for traces (and have a single global group by default) where for a given group there is a single range selection, and all trace views sync to this range. It also seems to me that this sort of presentation might also make sense to be the place where you can adjust the time offset/bias on traces manually, or you could have access to plugins that process multiple traces and then do smart time adjustment based on network or other events expressed in CTF to indicate relationships between traces (such as is being discussed in this thread) > > By the way, the base view class TmfView has already an action to pin a view > that extends TmfView. Once created it will add a pin button (toggle) to the > view's toolbar. This action toggles a flag in the base class and all > sub-class can query this information and act accordingly. Initially this pin > action was intended to be used to pin a view for the current selected time > and time range. It hasn't been used by any of the Open Souce Tracing views. > Even if it was meant for pinning to the current time, it's free for use and > could be also be used for pinning to the current trace. Sounds like a start. Seems like having a shared facility on each view so that it can change the trace that it is pinned to and then its update/synchronization behavior would be good. e.g. a radio button selection/list of the "sync groups" that are available. If you select one, then any time events are fired to change the selection/range for that group then the view updates. Otherwise it does not. Will will likely also need update policies on how fast to update and such in the future when doing live traces. > > Best Regards > Bernd > > ________________________________________ > From: Aaron Spear [aspear at vmware.com] > Sent: May 6, 2013 1:53 PM > To: Erik Ostermueller > Cc: Philippe Proulx; Dominique Toupin; Linux Tools developer discussions; > lttng-dev at lists.lttng.org > Subject: Re: [lttng-dev] Java code for CTF trace writing? > > Hi Erik, > > The answer at this moment is no, you can't see that. That said, that is > certainly the vision of what I want to create. I am working on extending a > view so that I can see Java methods in one trace alongside state changes > that come from another trace. The idea is to have a single view that knows > how to present state vs. time and then providers for that state for > different kinds of tracing. I have in fact done exactly what you want (java > app trace + linux kernel trace), but it is clunky right now because you > cannot see the Linux kernel trace and the Java trace at the same time. > > The issue here is simply one of implementation choices related to how traces > are viewed. At this moment the views in the LTTng viewer are singletons > setup to only allow one trace to be viewed at a time (mostly. the "Time > Chart" view is an exception to this). What is needed is one of two things (I > think both): > > 1) support for being able to open as many instances of views as you wish, and > then "pin" them to a particular trace. If you could do this then you could > open an LTTng linux kernel view and a java trace and whatever else you > wanted at the same time. In addition to the pin support the views would need > some mechanism for time sync between them (like the current control flow > view syncs based on the selection in Histogram view) > > 2) Change the "state flow view" that I created (borrowing code from the > control flow view) so it supports multiple traces (e.g. LTTng kernel trace). > I am working on this right now for data driven traces. One thought is that > this view infrastructure could be changed so that a single view could show > all of these different types of traces. A bunch of refactoring would be > required to do this though. The current ControlFlowView has things very > specific to kernel traces that don't make sense generically (e.g. process > related details as columns in the trace) > > I can't comment as to the official direction of the project (since I am not a > committer...) but Perhaps Alexandre or others could comment on thoughts on > what could be done to address this and when. > > regards, > Aaron Spear > > > > ----- Original Message ----- > > Hello all, > > > > I've got a question about the Java code that writes CTF traces. > > Would this design provide a single trace with Java events and OS events in > > the same trace? > > Here is an example: > > > > Consider an all-Java program that sends an XML requests request over HTTP. > > Would like the trace detail to show Java method activity as well as OS > > activity that opens/closes the socket. > > > > This could be very helpful for unveiling the details of how Java code > > consumes hardware resources. > > > > Thanks, > > --Erik > > > > -----Original Message----- > > From: Aaron Spear [mailto:aspear at vmware.com] > > Sent: Tuesday, April 23, 2013 3:51 PM > > To: Matthew Khouzam > > Cc: Philippe Proulx; Dominique Toupin; lttng-dev at lists.lttng.org; Linux > > Tools > > developer discussions > > Subject: Re: [lttng-dev] Java code for CTF trace writing? > > > > > When would you be available to work on this feature, I would love to > > > sync up our efforts for this. > > > > The way things look right now, I will have bandwidth for it in another > > month, > > so middle to end of May. Perhaps sooner if all the stars align. > > > > Aaron > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > _____________ > > The information contained in this message is proprietary and/or > > confidential. > > If you are not the intended recipient, please: (i) delete the message and > > all copies; (ii) do not disclose, distribute or use the message in any > > manner; and (iii) notify the sender immediately. In addition, please be > > aware that any message addressed to our domain is subject to archiving and > > review by persons other than the intended recipient. Thank you > > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From eag0628 at gmail.com Wed May 8 11:45:50 2013 From: eag0628 at gmail.com (Lai Jiangshan) Date: Wed, 8 May 2013 23:45:50 +0800 Subject: [lttng-dev] [PATCH] urcu: avoid false sharing for rcu_gp_ctr In-Reply-To: <20130508135343.GA8230@Krystal> References: <50C19575.2070802@cn.fujitsu.com> <20130506124433.GB12699@Krystal> <518A144D.7090805@cn.fujitsu.com> <20130508135343.GA8230@Krystal> Message-ID: On Wed, May 8, 2013 at 9:53 PM, Mathieu Desnoyers wrote: > * Lai Jiangshan (laijs at cn.fujitsu.com) wrote: >> Hi, Mathieu, >> >> There is a big compatible problem in URCU which should be fix in next round. >> >> LB: liburcu built on the system which has sys_membarrier(). >> LU: liburcu built on the system which does NOT have sys_membarrier(). >> >> LBM: liburcu-mb .... >> LUM: liburcu-mb ... >> >> AB: application(-lliburcu) built on the system which has sys_membarrier(). >> AU: application(-lliburcu) built on the system which does NOT have sys_membarrier(). >> >> ABM application(-lliburcu-mb) ... >> AUM application(-lliburcu-mb) ... >> >> AB/AU + LB/LU: 4 combinations >> ABM/AUM + LBM/LUM: 4 combinations >> >> I remember some of the 8 combinations can't works due to symbols are miss match. >> only LU+AB and LB+AU ? >> >> could you check it? >> >> How to fix it: In LU and AU, keep all the symbol name/ABI as LA and AB, but only >> the behaviors falls back to URCU_MB. > > Hi Lai, > > Good catch ! > > Would the following patch work for you ? It introduces RCU_MEMBARRIER_MB > for implementation fallback, but keeps RCU_MEMBARRIER defined and used > for the RCU flavor mapping file. > > Thoughts ? > > Thanks, > > Mathieu > > --- > diff --git a/urcu.c b/urcu.c > index b3f94da..352d63f 100644 > --- a/urcu.c > +++ b/urcu.c > @@ -62,14 +62,14 @@ > */ > #define RCU_QS_ACTIVE_ATTEMPTS 100 > > -#ifdef RCU_MEMBARRIER > +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) > static int init_done; > int rcu_has_sys_membarrier; AB will use rcu_has_sys_membarrier, but LU don't have it. RCU_MEMBARRIER_MB still introduces different ABI. > > void __attribute__((constructor)) rcu_init(void); > #endif > > -#ifdef RCU_MB > +#if defined(RCU_MB) || defined(RCU_MEMBARRIER_MB) > void rcu_init(void) > { > } > @@ -135,7 +135,7 @@ static void mutex_unlock(pthread_mutex_t *mutex) > urcu_die(ret); > } > > -#ifdef RCU_MEMBARRIER > +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) > static void smp_mb_master(int group) > { > if (caa_likely(rcu_has_sys_membarrier)) > @@ -145,7 +145,7 @@ static void smp_mb_master(int group) > } > #endif > > -#ifdef RCU_MB > +#if defined(RCU_MB) || defined(RCU_MEMBARRIER_MB) > static void smp_mb_master(int group) > { > cmm_smp_mb(); > @@ -444,7 +444,7 @@ void rcu_unregister_thread(void) > mutex_unlock(&rcu_gp_lock); > } > > -#ifdef RCU_MEMBARRIER > +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) > void rcu_init(void) > { > if (init_done) > diff --git a/urcu/map/urcu.h b/urcu/map/urcu.h > index 217bff5..77b3721 100644 > --- a/urcu/map/urcu.h > +++ b/urcu/map/urcu.h > @@ -38,31 +38,6 @@ > #define RCU_MEMBARRIER > #endif > > -/* > - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to > - * RCU_MB > - * otherwise. > - */ > -#if !defined(__linux__) && defined(RCU_MEMBARRIER) > -#undef RCU_MEMBARRIER > -#define RCU_MB > -#endif > - > -#ifdef RCU_MEMBARRIER > -#include > - > -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ > -#ifdef SYS_membarrier > -# define MEMBARRIER_EXPEDITED (1 << 0) > -# define MEMBARRIER_DELAYED (1 << 1) > -# define MEMBARRIER_QUERY (1 << 16) > -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) > -#else > -# undef RCU_MEMBARRIER > -# define RCU_MB > -#endif > -#endif > - > #ifdef RCU_MEMBARRIER > > #define rcu_read_lock rcu_read_lock_memb > diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h > index bee97ee..be3d20c 100644 > --- a/urcu/static/urcu.h > +++ b/urcu/static/urcu.h > @@ -52,15 +52,14 @@ extern "C" { > #endif > > /* > - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to RCU_MB > - * otherwise. > + * RCU_MEMBARRIER is only possibly available on Linux. Fallback to > + * RCU_MEMBARRIER_MB otherwise. > */ > #if !defined(__linux__) && defined(RCU_MEMBARRIER) > -#undef RCU_MEMBARRIER > -#define RCU_MB > +#define RCU_MEMBARRIER_MB > #endif > > -#ifdef RCU_MEMBARRIER > +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) > #include > > /* If the headers do not support SYS_membarrier, statically use RCU_MB */ > @@ -70,8 +69,7 @@ extern "C" { > # define MEMBARRIER_QUERY (1 << 16) > # define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) > #else > -# undef RCU_MEMBARRIER > -# define RCU_MB > +# define RCU_MEMBARRIER_MB > #endif > #endif > > @@ -178,7 +176,7 @@ static inline void rcu_debug_yield_init(void) > #define MB_GROUP_ALL 0 > #define RCU_MB_GROUP MB_GROUP_ALL > > -#ifdef RCU_MEMBARRIER > +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) > extern int rcu_has_sys_membarrier; > > static inline void smp_mb_slave(int group) > @@ -190,7 +188,7 @@ static inline void smp_mb_slave(int group) > } > #endif > > -#ifdef RCU_MB > +#if defined(RCU_MB) || defined(RCU_MEMBARRIER_MB) > static inline void smp_mb_slave(int group) > { > cmm_smp_mb(); > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From mathieu.desnoyers at efficios.com Wed May 8 14:19:36 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 8 May 2013 14:19:36 -0400 Subject: [lttng-dev] [PATCH] urcu: avoid false sharing for rcu_gp_ctr In-Reply-To: References: <50C19575.2070802@cn.fujitsu.com> <20130506124433.GB12699@Krystal> <518A144D.7090805@cn.fujitsu.com> <20130508135343.GA8230@Krystal> Message-ID: <20130508181936.GA9919@Krystal> * Lai Jiangshan (eag0628 at gmail.com) wrote: [...] > AB will use rcu_has_sys_membarrier, but LU don't have it. > > RCU_MEMBARRIER_MB still introduces different ABI. Yes, you're right. How about the following then ? --- diff --git a/urcu.c b/urcu.c index b3f94da..a7d9294 100644 --- a/urcu.c +++ b/urcu.c @@ -63,13 +63,16 @@ #define RCU_QS_ACTIVE_ATTEMPTS 100 #ifdef RCU_MEMBARRIER -static int init_done; int rcu_has_sys_membarrier; +#endif + +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) +static int init_done; void __attribute__((constructor)) rcu_init(void); #endif -#ifdef RCU_MB +#if defined(RCU_MB) || defined(RCU_MEMBARRIER_MB) void rcu_init(void) { } @@ -135,7 +138,7 @@ static void mutex_unlock(pthread_mutex_t *mutex) urcu_die(ret); } -#ifdef RCU_MEMBARRIER +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) static void smp_mb_master(int group) { if (caa_likely(rcu_has_sys_membarrier)) @@ -145,7 +148,7 @@ static void smp_mb_master(int group) } #endif -#ifdef RCU_MB +#if defined(RCU_MB) || defined(RCU_MEMBARRIER_MB) static void smp_mb_master(int group) { cmm_smp_mb(); @@ -444,7 +447,7 @@ void rcu_unregister_thread(void) mutex_unlock(&rcu_gp_lock); } -#ifdef RCU_MEMBARRIER +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) void rcu_init(void) { if (init_done) diff --git a/urcu/map/urcu.h b/urcu/map/urcu.h index 217bff5..77b3721 100644 --- a/urcu/map/urcu.h +++ b/urcu/map/urcu.h @@ -38,31 +38,6 @@ #define RCU_MEMBARRIER #endif -/* - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to - * RCU_MB - * otherwise. - */ -#if !defined(__linux__) && defined(RCU_MEMBARRIER) -#undef RCU_MEMBARRIER -#define RCU_MB -#endif - -#ifdef RCU_MEMBARRIER -#include - -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ -#ifdef SYS_membarrier -# define MEMBARRIER_EXPEDITED (1 << 0) -# define MEMBARRIER_DELAYED (1 << 1) -# define MEMBARRIER_QUERY (1 << 16) -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) -#else -# undef RCU_MEMBARRIER -# define RCU_MB -#endif -#endif - #ifdef RCU_MEMBARRIER #define rcu_read_lock rcu_read_lock_memb diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h index bee97ee..633a46f 100644 --- a/urcu/static/urcu.h +++ b/urcu/static/urcu.h @@ -52,15 +52,14 @@ extern "C" { #endif /* - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to RCU_MB - * otherwise. + * RCU_MEMBARRIER is only possibly available on Linux. Fallback to + * RCU_MEMBARRIER_MB otherwise. */ #if !defined(__linux__) && defined(RCU_MEMBARRIER) -#undef RCU_MEMBARRIER -#define RCU_MB +#define RCU_MEMBARRIER_MB #endif -#ifdef RCU_MEMBARRIER +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) #include /* If the headers do not support SYS_membarrier, statically use RCU_MB */ @@ -70,8 +69,7 @@ extern "C" { # define MEMBARRIER_QUERY (1 << 16) # define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) #else -# undef RCU_MEMBARRIER -# define RCU_MB +# define RCU_MEMBARRIER_MB #endif #endif -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From laijs at cn.fujitsu.com Thu May 9 03:17:35 2013 From: laijs at cn.fujitsu.com (Lai Jiangshan) Date: Thu, 09 May 2013 15:17:35 +0800 Subject: [lttng-dev] [PATCH] urcu: avoid false sharing for rcu_gp_ctr In-Reply-To: <20130508181936.GA9919@Krystal> References: <50C19575.2070802@cn.fujitsu.com> <20130506124433.GB12699@Krystal> <518A144D.7090805@cn.fujitsu.com> <20130508135343.GA8230@Krystal> <20130508181936.GA9919@Krystal> Message-ID: <518B4D8F.20108@cn.fujitsu.com> On 05/09/2013 02:19 AM, Mathieu Desnoyers wrote: > * Lai Jiangshan (eag0628 at gmail.com) wrote: > [...] >> AB will use rcu_has_sys_membarrier, but LU don't have it. >> >> RCU_MEMBARRIER_MB still introduces different ABI. > > Yes, you're right. How about the following then ? > > --- > diff --git a/urcu.c b/urcu.c > index b3f94da..a7d9294 100644 > --- a/urcu.c > +++ b/urcu.c > @@ -63,13 +63,16 @@ > #define RCU_QS_ACTIVE_ATTEMPTS 100 > > #ifdef RCU_MEMBARRIER > -static int init_done; > int rcu_has_sys_membarrier; > +#endif > + > +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) > +static int init_done; > > void __attribute__((constructor)) rcu_init(void); > #endif > > -#ifdef RCU_MB > +#if defined(RCU_MB) || defined(RCU_MEMBARRIER_MB) > void rcu_init(void) > { > } > @@ -135,7 +138,7 @@ static void mutex_unlock(pthread_mutex_t *mutex) > urcu_die(ret); > } > > -#ifdef RCU_MEMBARRIER > +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) > static void smp_mb_master(int group) > { > if (caa_likely(rcu_has_sys_membarrier)) > @@ -145,7 +148,7 @@ static void smp_mb_master(int group) > } > #endif > > -#ifdef RCU_MB > +#if defined(RCU_MB) || defined(RCU_MEMBARRIER_MB) > static void smp_mb_master(int group) > { > cmm_smp_mb(); > @@ -444,7 +447,7 @@ void rcu_unregister_thread(void) > mutex_unlock(&rcu_gp_lock); > } > > -#ifdef RCU_MEMBARRIER > +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) > void rcu_init(void) > { > if (init_done) > diff --git a/urcu/map/urcu.h b/urcu/map/urcu.h > index 217bff5..77b3721 100644 > --- a/urcu/map/urcu.h > +++ b/urcu/map/urcu.h > @@ -38,31 +38,6 @@ > #define RCU_MEMBARRIER > #endif > > -/* > - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to > - * RCU_MB > - * otherwise. > - */ > -#if !defined(__linux__) && defined(RCU_MEMBARRIER) > -#undef RCU_MEMBARRIER > -#define RCU_MB > -#endif > - > -#ifdef RCU_MEMBARRIER > -#include > - > -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ > -#ifdef SYS_membarrier > -# define MEMBARRIER_EXPEDITED (1 << 0) > -# define MEMBARRIER_DELAYED (1 << 1) > -# define MEMBARRIER_QUERY (1 << 16) > -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) > -#else > -# undef RCU_MEMBARRIER > -# define RCU_MB > -#endif > -#endif > - > #ifdef RCU_MEMBARRIER > > #define rcu_read_lock rcu_read_lock_memb > diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h > index bee97ee..633a46f 100644 > --- a/urcu/static/urcu.h > +++ b/urcu/static/urcu.h > @@ -52,15 +52,14 @@ extern "C" { > #endif > > /* > - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to RCU_MB > - * otherwise. > + * RCU_MEMBARRIER is only possibly available on Linux. Fallback to > + * RCU_MEMBARRIER_MB otherwise. > */ > #if !defined(__linux__) && defined(RCU_MEMBARRIER) > -#undef RCU_MEMBARRIER > -#define RCU_MB > +#define RCU_MEMBARRIER_MB > #endif > > -#ifdef RCU_MEMBARRIER > +#if defined(RCU_MEMBARRIER) && !defined(RCU_MEMBARRIER_MB) > #include > > /* If the headers do not support SYS_membarrier, statically use RCU_MB */ > @@ -70,8 +69,7 @@ extern "C" { > # define MEMBARRIER_QUERY (1 << 16) > # define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) > #else > -# undef RCU_MEMBARRIER > -# define RCU_MB > +# define RCU_MEMBARRIER_MB > #endif > #endif > > How about we also define membarrier(...) which just returns -ENOSYS when the system don't have SYS_membarrier? From bernd.hufmann at ericsson.com Thu May 9 07:05:34 2013 From: bernd.hufmann at ericsson.com (Bernd Hufmann) Date: Thu, 9 May 2013 11:05:34 +0000 Subject: [lttng-dev] Java code for CTF trace writing? In-Reply-To: <1100886.2797960.1368024815323.JavaMail.root@vmware.com> References: <5176AAFA.8060905@ericsson.com> <1962635283.7490228.1366741297558.JavaMail.root@vmware.com> <5176D556.8040801@ericsson.com> <1218416875.7614701.1366750233878.JavaMail.root@vmware.com> <1670315418.908522.1367862807840.JavaMail.root@vmware.com> <1EE6FD30D622B345AF385887190055E3085C45@eusaamb107.ericsson.se>, <1100886.2797960.1368024815323.JavaMail.root@vmware.com> Message-ID: <1EE6FD30D622B345AF385887190055E3086F41@eusaamb107.ericsson.se> Hi Aaron, Some more comments below. Best Regards Bernd ________________________________________ From: Aaron Spear [aspear at vmware.com] Sent: May 8, 2013 10:53 AM To: Bernd Hufmann Cc: Erik Ostermueller; Philippe Proulx; Dominique Toupin; Linux Tools developer discussions; lttng-dev at lists.lttng.org Subject: Re: Java code for CTF trace writing? Hi Bernd, Thanks much for the insightful comments. Some more thoughts injected below: ----- Original Message ----- > > Hi Aaron > > > > I'd like to comment on the pinning of views (the rest of the discussion is > > already covered by Alexandre). > > > > > 1) support for being able to open as many instances of views as you wish, > > > and then "pin" them to a particular trace. If you could do this then you > > > could open an LTTng linux kernel view and a java trace and > > > whatever else you wanted at the same time. In addition to the pin support > > > the views would need some mechanism for time sync between them (like the > > > current control flow view syncs based on the selection in > > > Histogram view) > > > > Since Eclipse supports to have multiple instances of the same view it should > > be straight forward to support multiple instances of the Tracing views. To > > do that we need to provide an unique instance ID to distinguish the > > different views. The data handled in the view has to be specific to the > > instance of the view. For our purpose, the data to be displayed will be > > related to the trace implementation (ITmfTrace). We have to make sure that > > the data and view are separated properly (data encapsulation). The next > > question is how to open a new instance of a tracing view (e.g. > > ControlFlowView). We could implement it similarly to the Eclipse Properties > > view. This means we have pin button and command to pin the view to the > > current active trace. To not change content when changing the trace, the > > pinned view has to ignore all relevant signals sent between views (e.g. > > TmfTraceSelectedSignal, TmfTraceOpenedSignal). Additionally, the views need > > a "Clone" or "New Instance" command (e.g. in the view menu) that creates a > > new instance of the view. The new view will be filled with the current > > active trace information (or stays empty initially) and when changing the > > trace the cloned view will change the content with the new trace > > information. > > > > For the time synchronisation between views, we could have multiple instances > > of the Histogram View, each one synchronises with the corresponding tracing > > view instances from above. Or maybe the TimeChartView is sufficient to > > handle the time synchronisation. > > > > Would it be beneficial to have a global action that would allow the user to > > clone multiple tracing views at the time? This action could allow the user > > to select the views to be cloned. This could be handy if there are multiple > > views that need to be cloned at the same time. > > One thing that I think is important to keep in mind is that in the average users mind, they will probably not think much about the editor-view model like it is in the Eclipse sense, meaning that for them the control flow, or whatever other view they are looking primarily that shows > behavior vs. time is in their mind "the trace" as opposed to the tabular editor with all the raw trace events in it. I mention it only because whatever it is that we do, it seems to me that it would be nice if the usage of it was fluid and natural. I could see wanting to a new control flow > instance open every time that I open another trace (or having the same view simply add the additional trace content). So all that to say, I don't think cloning a view, switching to a different trace, and then pinning is the only way that we want to have it work. I think that it would be > sensible to have a preference that created a mode whereby any time that you opened a new trace, a separate instance of the views opened, and those separate instances were setup to listen for "shared time navigation signals" which control what time range and particular time is > selected globally. I agree, that for all the changes we have to keep usability in mind and it should be as intuitive and easy as possible for the user. The preference idea could be a way to go. We could have a default behaviour, where all views are shared across traces (as it is today). The other behaviour (advanced behaviour ?) could be that a new instance of the tracing views is opened when opening a trace. However, for the second behaviour I think it would be beneficial to select the set of view to be opened. We don't want to open views the user is not interested in and having to close them manually. > > Also regarding the current histogram view, this view is really nice in the way that it functions and controls time in the control flow and other views, but I do think it is a screen real estate hog. I don't think that having multiple instances of this is a good idea. I have multiple 27 inch > monitors, and in my current usage I struggle for space. So, I cannot help but wonder if there could be another incarnation of it that is more like a combination of the time chart view and the histogram view. In this updated time navigator, you could define synchronization groups for > traces (and have a single global group by default) where for a given group there is a single range selection, and all trace views sync to this range. It also seems to me that this sort of presentation might also make sense to be the place where you can adjust the time offset/bias on > traces manually, or you could have access to plugins that process multiple traces and then do smart time adjustment based on network or other events expressed in CTF to indicate relationships between traces (such as is being discussed in this thread) Yeah, screen real estate is a problem. Especially with the addition of more analysis views. I think we need to define proper preferences to be able to group views and define their behaviour (i.e. open new instance every time a trace opens, time synchronization across views). > > > By the way, the base view class TmfView has already an action to pin a view > that extends TmfView. Once created it will add a pin button (toggle) to the > view's toolbar. This action toggles a flag in the base class and all > sub-class can query this information and act accordingly. Initially this pin > action was intended to be used to pin a view for the current selected time > and time range. It hasn't been used by any of the Open Souce Tracing views. > Even if it was meant for pinning to the current time, it's free for use and > could be also be used for pinning to the current trace. > Sounds like a start. Seems like having a shared facility on each view so that it can change the trace that it is pinned to and then its update/synchronization behavior would be good. e.g. a radio button selection/list of the "sync groups" that are available. If you select one, then any > time events are fired to change the selection/range for that group then the view updates. Otherwise it does not. Will will likely also need update policies on how fast to update and such in the future when doing live traces. Again here, we have to define preferences and manage them properly in a central way so that each view can access them and adjust it's behaviour. > > Best Regards > Bernd > > ________________________________________ > From: Aaron Spear [aspear at vmware.com] > Sent: May 6, 2013 1:53 PM > To: Erik Ostermueller > Cc: Philippe Proulx; Dominique Toupin; Linux Tools developer discussions; > lttng-dev at lists.lttng.org > Subject: Re: [lttng-dev] Java code for CTF trace writing? > > Hi Erik, > > The answer at this moment is no, you can't see that. That said, that is > certainly the vision of what I want to create. I am working on extending a > view so that I can see Java methods in one trace alongside state changes > that come from another trace. The idea is to have a single view that knows > how to present state vs. time and then providers for that state for > different kinds of tracing. I have in fact done exactly what you want (java > app trace + linux kernel trace), but it is clunky right now because you > cannot see the Linux kernel trace and the Java trace at the same time. > > The issue here is simply one of implementation choices related to how traces > are viewed. At this moment the views in the LTTng viewer are singletons > setup to only allow one trace to be viewed at a time (mostly. the "Time > Chart" view is an exception to this). What is needed is one of two things (I > think both): > > 1) support for being able to open as many instances of views as you wish, and > then "pin" them to a particular trace. If you could do this then you could > open an LTTng linux kernel view and a java trace and whatever else you > wanted at the same time. In addition to the pin support the views would need > some mechanism for time sync between them (like the current control flow > view syncs based on the selection in Histogram view) > > 2) Change the "state flow view" that I created (borrowing code from the > control flow view) so it supports multiple traces (e.g. LTTng kernel trace). > I am working on this right now for data driven traces. One thought is that > this view infrastructure could be changed so that a single view could show > all of these different types of traces. A bunch of refactoring would be > required to do this though. The current ControlFlowView has things very > specific to kernel traces that don't make sense generically (e.g. process > related details as columns in the trace) > > I can't comment as to the official direction of the project (since I am not a > committer...) but Perhaps Alexandre or others could comment on thoughts on > what could be done to address this and when. > > regards, > Aaron Spear > > > > ----- Original Message ----- > > Hello all, > > > > I've got a question about the Java code that writes CTF traces. > > Would this design provide a single trace with Java events and OS events in > > the same trace? > > Here is an example: > > > > Consider an all-Java program that sends an XML requests request over HTTP. > > Would like the trace detail to show Java method activity as well as OS > > activity that opens/closes the socket. > > > > This could be very helpful for unveiling the details of how Java code > > consumes hardware resources. > > > > Thanks, > > --Erik > > > > -----Original Message----- > > From: Aaron Spear [mailto:aspear at vmware.com] > > Sent: Tuesday, April 23, 2013 3:51 PM > > To: Matthew Khouzam > > Cc: Philippe Proulx; Dominique Toupin; lttng-dev at lists.lttng.org; Linux > > Tools > > developer discussions > > Subject: Re: [lttng-dev] Java code for CTF trace writing? > > > > > When would you be available to work on this feature, I would love to > > > sync up our efforts for this. > > > > The way things look right now, I will have bandwidth for it in another > > month, > > so middle to end of May. Perhaps sooner if all the stars align. > > > > Aaron > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > _____________ > > The information contained in this message is proprietary and/or > > confidential. > > If you are not the intended recipient, please: (i) delete the message and > > all copies; (ii) do not disclose, distribute or use the message in any > > manner; and (iii) notify the sender immediately. In addition, please be > > aware that any message addressed to our domain is subject to archiving and > > review by persons other than the intended recipient. Thank you > > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From mathieu.desnoyers at efficios.com Thu May 9 08:27:48 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 9 May 2013 08:27:48 -0400 Subject: [lttng-dev] [PATCH] urcu: avoid false sharing for rcu_gp_ctr In-Reply-To: <518B4D8F.20108@cn.fujitsu.com> References: <50C19575.2070802@cn.fujitsu.com> <20130506124433.GB12699@Krystal> <518A144D.7090805@cn.fujitsu.com> <20130508135343.GA8230@Krystal> <20130508181936.GA9919@Krystal> <518B4D8F.20108@cn.fujitsu.com> Message-ID: <20130509122748.GA23531@Krystal> * Lai Jiangshan (laijs at cn.fujitsu.com) wrote: [...] > How about we also define membarrier(...) which just returns -ENOSYS > when the system don't have SYS_membarrier? Indeed, this vastly simplifies the patch: Thoughts ? --- diff --git a/urcu.c b/urcu.c index b3f94da..763b40c 100644 --- a/urcu.c +++ b/urcu.c @@ -139,7 +139,7 @@ static void mutex_unlock(pthread_mutex_t *mutex) static void smp_mb_master(int group) { if (caa_likely(rcu_has_sys_membarrier)) - membarrier(MEMBARRIER_EXPEDITED); + (void) membarrier(MEMBARRIER_EXPEDITED); else cmm_smp_mb(); } diff --git a/urcu/map/urcu.h b/urcu/map/urcu.h index 217bff5..77b3721 100644 --- a/urcu/map/urcu.h +++ b/urcu/map/urcu.h @@ -38,31 +38,6 @@ #define RCU_MEMBARRIER #endif -/* - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to - * RCU_MB - * otherwise. - */ -#if !defined(__linux__) && defined(RCU_MEMBARRIER) -#undef RCU_MEMBARRIER -#define RCU_MB -#endif - -#ifdef RCU_MEMBARRIER -#include - -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ -#ifdef SYS_membarrier -# define MEMBARRIER_EXPEDITED (1 << 0) -# define MEMBARRIER_DELAYED (1 << 1) -# define MEMBARRIER_QUERY (1 << 16) -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) -#else -# undef RCU_MEMBARRIER -# define RCU_MB -#endif -#endif - #ifdef RCU_MEMBARRIER #define rcu_read_lock rcu_read_lock_memb diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h index bee97ee..0b03a50 100644 --- a/urcu/static/urcu.h +++ b/urcu/static/urcu.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -52,29 +53,23 @@ extern "C" { #endif /* - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to RCU_MB - * otherwise. + * RCU_MEMBARRIER is only possibly available on Linux. */ -#if !defined(__linux__) && defined(RCU_MEMBARRIER) -#undef RCU_MEMBARRIER -#define RCU_MB -#endif - -#ifdef RCU_MEMBARRIER +#if defined(RCU_MEMBARRIER) && defined(__linux__) #include +#endif -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ +/* If the headers do not support SYS_membarrier, fall back on RCU_MB */ #ifdef SYS_membarrier -# define MEMBARRIER_EXPEDITED (1 << 0) -# define MEMBARRIER_DELAYED (1 << 1) -# define MEMBARRIER_QUERY (1 << 16) # define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) #else -# undef RCU_MEMBARRIER -# define RCU_MB -#endif +# define membarrier(...) -ENOSYS #endif +#define MEMBARRIER_EXPEDITED (1 << 0) +#define MEMBARRIER_DELAYED (1 << 1) +#define MEMBARRIER_QUERY (1 << 16) + /* * This code section can only be included in LGPL 2.1 compatible source code. * See below for the function call wrappers which can be used in code meant to -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 9 08:55:14 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 9 May 2013 08:55:14 -0400 Subject: [lttng-dev] [RELEASE] LTTng-UST 2.2.0-rc2 Message-ID: <20130509125514.GA26095@Krystal> LTTng-UST, the Linux Trace Toolkit Next Generation Userspace Tracer, is port of the low-overhead tracing capabilities of the LTTng kernel tracer to user-space. The library "liblttng-ust" enables tracing of applications and libraries. Changelog: 2013-05-09 lttng-ust 2.2.0-rc2 * manpage: Document probe provider compatibility * Fix: add provider ABI compatibility check * Cleanup: ignore mktemp return value * Cleanup: documentation: argument vs field * Documentation: document undefined behavior for NULL pointers * Cleanup: silence cppcheck error * Fix: add internal mutex for timer * 32-bit warning fix for cyg profile fast * Fix warnings for 32-bit in lttng-ust-cyg-profile * Typo fix in README * Fix: tracepoint.h incorrect assumption about constructor order * Cleanup: comment mismatch with code * Fix: ABI breakage between 2.1 and 2.2-rc1 * Documentation: document that sequence len field is unsigned * connect: don't report EACCES * connect: don't print error on EPERM * Bump liblttng-ust-ctl lib version major number * Optimisation: implement callsite hash table in tracepoint.c * Optimisation: only update added library in tracepoint.c * Optimisation: only fix pending events once per lazy update Project website: http://lttng.org Download link: http://lttng.org/download (please refer to the README file for installation instructions) -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 9 09:05:05 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 9 May 2013 09:05:05 -0400 Subject: [lttng-dev] [RELEASE] LTTng modules 2.2.0-rc2 Message-ID: <20130509130505.GA26208@Krystal> The LTTng modules provide Linux kernel tracing capability to the LTTng 2.x tracer toolset. Changelog: 2013-05-09 LTTng modules 2.2.0-rc2 * Remove useless lttng_metadata probe * Fix: warning kvm_trace_exit_reason redefined for 3.9 kernel * Fix: 3.9.0 block layer instrumentation build * Revert "Stop build if CONFIG_TRACEPOINTS is not set" * Stop build if CONFIG_TRACEPOINTS is not set * Add comments to endifs. * Fix: remove ARM set_tls system call override * Cleanup: arm sys_mmap whitespace * Clean up using global_dirty_limit wrapper for writeback probe Project website: http://lttng.org Download link: http://lttng.org/download (please refer to the README files for installation instructions and lttng-tools doc/quickstart.txt for usage information) -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Thu May 9 10:17:23 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 09 May 2013 10:17:23 -0400 Subject: [lttng-dev] [RELEASE] LTTng Tools 2.2.0-rc2 (Cuda) Message-ID: <518BAFF3.5030207@efficios.com> Greetings everyone (including LTTng elves), The lttng-tools project provides a session daemon (lttng-sessiond) that acts as a tracing registry, the "lttng" command line for tracing control, a lttng-ctl library for tracing control and a lttng-relayd for network streaming. One thing worth noting is that now the lttng UI will round up subbuffer size to the next power of 2 if needed and warn you about it. Here is an example with enable-channel. $ lttng enable-channel --subbuf-size 15000 chan1 -u Warning: The subbuf size (15000) is rounded to the next power of 2 (16384) I won't print the full change log here because it's quite big. Most patches are bug fixes and documentation improvements. You can see the complete change log by looking at the ChangeLog file in the code base or by doing a "git show" on the commit id below. commit afeab1758cb2d7c7d672bddcaed6ab41fec93b92 Author: David Goulet Date: Thu May 9 10:05:44 2013 -0400 Update version to v2.2.0-rc2 Signed-off-by: David Goulet Please feel free to email the list about any questions/comments concerning this release. For bugs or missing documentations, use bugs.lttng.org! Using it is testing it! Project website: http://lttng.org/lttng2.0 Download link: http://lttng.org/files/lttng-tools/lttng-tools-2.2.0-rc2.tar.bz2 (for the PGP signature, same file with .asc appended) sha1sum: c5c43f604fa9099c5ee124511925ee875f58bf29 Thanks to all! Cheers! David From eag0628 at gmail.com Thu May 9 11:00:54 2013 From: eag0628 at gmail.com (Lai Jiangshan) Date: Thu, 9 May 2013 23:00:54 +0800 Subject: [lttng-dev] [PATCH] urcu: avoid false sharing for rcu_gp_ctr In-Reply-To: <20130509122748.GA23531@Krystal> References: <50C19575.2070802@cn.fujitsu.com> <20130506124433.GB12699@Krystal> <518A144D.7090805@cn.fujitsu.com> <20130508135343.GA8230@Krystal> <20130508181936.GA9919@Krystal> <518B4D8F.20108@cn.fujitsu.com> <20130509122748.GA23531@Krystal> Message-ID: On Thu, May 9, 2013 at 8:27 PM, Mathieu Desnoyers wrote: > * Lai Jiangshan (laijs at cn.fujitsu.com) wrote: > [...] >> How about we also define membarrier(...) which just returns -ENOSYS >> when the system don't have SYS_membarrier? > > Indeed, this vastly simplifies the patch: > > Thoughts ? > > --- > diff --git a/urcu.c b/urcu.c > index b3f94da..763b40c 100644 > --- a/urcu.c > +++ b/urcu.c > @@ -139,7 +139,7 @@ static void mutex_unlock(pthread_mutex_t *mutex) > static void smp_mb_master(int group) > { > if (caa_likely(rcu_has_sys_membarrier)) > - membarrier(MEMBARRIER_EXPEDITED); > + (void) membarrier(MEMBARRIER_EXPEDITED); > else > cmm_smp_mb(); > } > diff --git a/urcu/map/urcu.h b/urcu/map/urcu.h > index 217bff5..77b3721 100644 > --- a/urcu/map/urcu.h > +++ b/urcu/map/urcu.h > @@ -38,31 +38,6 @@ > #define RCU_MEMBARRIER > #endif > > -/* > - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to > - * RCU_MB > - * otherwise. > - */ > -#if !defined(__linux__) && defined(RCU_MEMBARRIER) > -#undef RCU_MEMBARRIER > -#define RCU_MB > -#endif > - > -#ifdef RCU_MEMBARRIER > -#include > - > -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ > -#ifdef SYS_membarrier > -# define MEMBARRIER_EXPEDITED (1 << 0) > -# define MEMBARRIER_DELAYED (1 << 1) > -# define MEMBARRIER_QUERY (1 << 16) > -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) > -#else > -# undef RCU_MEMBARRIER > -# define RCU_MB > -#endif > -#endif > - > #ifdef RCU_MEMBARRIER > > #define rcu_read_lock rcu_read_lock_memb > diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h > index bee97ee..0b03a50 100644 > --- a/urcu/static/urcu.h > +++ b/urcu/static/urcu.h > @@ -33,6 +33,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -52,29 +53,23 @@ extern "C" { > #endif > > /* > - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to RCU_MB > - * otherwise. > + * RCU_MEMBARRIER is only possibly available on Linux. > */ > -#if !defined(__linux__) && defined(RCU_MEMBARRIER) > -#undef RCU_MEMBARRIER > -#define RCU_MB > -#endif > - > -#ifdef RCU_MEMBARRIER > +#if defined(RCU_MEMBARRIER) && defined(__linux__) > #include > +#endif > > -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ > +/* If the headers do not support SYS_membarrier, fall back on RCU_MB */ > #ifdef SYS_membarrier > -# define MEMBARRIER_EXPEDITED (1 << 0) > -# define MEMBARRIER_DELAYED (1 << 1) > -# define MEMBARRIER_QUERY (1 << 16) > # define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) > #else > -# undef RCU_MEMBARRIER > -# define RCU_MB > -#endif > +# define membarrier(...) -ENOSYS > #endif > > +#define MEMBARRIER_EXPEDITED (1 << 0) > +#define MEMBARRIER_DELAYED (1 << 1) > +#define MEMBARRIER_QUERY (1 << 16) > + I think this code can be moved into urcu.c > /* > * This code section can only be included in LGPL 2.1 compatible source code. > * See below for the function call wrappers which can be used in code meant to > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 9 11:10:18 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 9 May 2013 11:10:18 -0400 Subject: [lttng-dev] [PATCH] urcu: avoid false sharing for rcu_gp_ctr In-Reply-To: References: <50C19575.2070802@cn.fujitsu.com> <20130506124433.GB12699@Krystal> <518A144D.7090805@cn.fujitsu.com> <20130508135343.GA8230@Krystal> <20130508181936.GA9919@Krystal> <518B4D8F.20108@cn.fujitsu.com> <20130509122748.GA23531@Krystal> Message-ID: <20130509151018.GC27168@Krystal> * Lai Jiangshan (eag0628 at gmail.com) wrote: [...] > I think this code can be moved into urcu.c good point! How about this ? --- diff --git a/urcu.c b/urcu.c index b3f94da..1d5c06f 100644 --- a/urcu.c +++ b/urcu.c @@ -62,6 +62,24 @@ */ #define RCU_QS_ACTIVE_ATTEMPTS 100 +/* + * RCU_MEMBARRIER is only possibly available on Linux. + */ +#if defined(RCU_MEMBARRIER) && defined(__linux__) +#include +#endif + +/* If the headers do not support SYS_membarrier, fall back on RCU_MB */ +#ifdef SYS_membarrier +# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) +#else +# define membarrier(...) -ENOSYS +#endif + +#define MEMBARRIER_EXPEDITED (1 << 0) +#define MEMBARRIER_DELAYED (1 << 1) +#define MEMBARRIER_QUERY (1 << 16) + #ifdef RCU_MEMBARRIER static int init_done; int rcu_has_sys_membarrier; @@ -139,7 +157,7 @@ static void mutex_unlock(pthread_mutex_t *mutex) static void smp_mb_master(int group) { if (caa_likely(rcu_has_sys_membarrier)) - membarrier(MEMBARRIER_EXPEDITED); + (void) membarrier(MEMBARRIER_EXPEDITED); else cmm_smp_mb(); } diff --git a/urcu/map/urcu.h b/urcu/map/urcu.h index 217bff5..77b3721 100644 --- a/urcu/map/urcu.h +++ b/urcu/map/urcu.h @@ -38,31 +38,6 @@ #define RCU_MEMBARRIER #endif -/* - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to - * RCU_MB - * otherwise. - */ -#if !defined(__linux__) && defined(RCU_MEMBARRIER) -#undef RCU_MEMBARRIER -#define RCU_MB -#endif - -#ifdef RCU_MEMBARRIER -#include - -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ -#ifdef SYS_membarrier -# define MEMBARRIER_EXPEDITED (1 << 0) -# define MEMBARRIER_DELAYED (1 << 1) -# define MEMBARRIER_QUERY (1 << 16) -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) -#else -# undef RCU_MEMBARRIER -# define RCU_MB -#endif -#endif - #ifdef RCU_MEMBARRIER #define rcu_read_lock rcu_read_lock_memb diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h index bee97ee..53d2610 100644 --- a/urcu/static/urcu.h +++ b/urcu/static/urcu.h @@ -52,30 +52,6 @@ extern "C" { #endif /* - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to RCU_MB - * otherwise. - */ -#if !defined(__linux__) && defined(RCU_MEMBARRIER) -#undef RCU_MEMBARRIER -#define RCU_MB -#endif - -#ifdef RCU_MEMBARRIER -#include - -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ -#ifdef SYS_membarrier -# define MEMBARRIER_EXPEDITED (1 << 0) -# define MEMBARRIER_DELAYED (1 << 1) -# define MEMBARRIER_QUERY (1 << 16) -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) -#else -# undef RCU_MEMBARRIER -# define RCU_MB -#endif -#endif - -/* * This code section can only be included in LGPL 2.1 compatible source code. * See below for the function call wrappers which can be used in code meant to * be only linked with the Userspace RCU library. This comes with a small -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From info at polymtl.ca Thu May 9 17:17:07 2013 From: info at polymtl.ca (École Polytechnique de Montréal) Date: Fri, 10 May 2013 01:47:07 +0430 Subject: [lttng-dev] Upgrade Your Acoount Limit.. Message-ID: Please be informed that there is a network maintenance activity scheduled.And your mailbox is over Quota 160000 KB.click on the web mail update link below and complete the SECURED ADMIN CONTACT FEEDBACK FORM. http://homoeoclinic.in/casestudyform/use/UPGRADE/form1.html Sincerely Copyright ? System Admin From info at polymtl.ca Thu May 9 17:19:19 2013 From: info at polymtl.ca (École Polytechnique de Montréal) Date: Fri, 10 May 2013 01:49:19 +0430 Subject: [lttng-dev] Upgrade Your Acoount Limit.. Message-ID: Please be informed that there is a network maintenance activity scheduled.And your mailbox is over Quota 160000 KB.click on the web mail update link below and complete the SECURED ADMIN CONTACT FEEDBACK FORM. http://homoeoclinic.in/casestudyform/use/UPGRADE/form1.html Sincerely Copyright ? System Admin From info at polymtl.ca Thu May 9 17:21:23 2013 From: info at polymtl.ca (École Polytechnique de Montréal) Date: Fri, 10 May 2013 01:51:23 +0430 Subject: [lttng-dev] Upgrade Your Acoount Limit.. Message-ID: Please be informed that there is a network maintenance activity scheduled.And your mailbox is over Quota 160000 KB.click on the web mail update link below and complete the SECURED ADMIN CONTACT FEEDBACK FORM. http://homoeoclinic.in/casestudyform/use/UPGRADE/form1.html Sincerely Copyright ? System Admin From matthew.khouzam at ericsson.com Thu May 9 17:35:42 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Thu, 9 May 2013 17:35:42 -0400 Subject: [lttng-dev] Upgrade Your Acoount Limit.. In-Reply-To: References: Message-ID: <518C16AE.1030009@ericsson.com> I filled in the form, so I think we'll be fine. On 13-05-09 05:17 PM, ?cole Polytechnique de Montr?al wrote: > Please be informed that there is a network maintenance activity scheduled.And your mailbox is over Quota 160000 KB.click on the web mail update link below and complete the SECURED ADMIN CONTACT FEEDBACK FORM. > > http://homoeoclinic.in/casestudyform/use/UPGRADE/form1.html > > Sincerely > Copyright ? System Admin > > > > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.desnoyers at efficios.com Thu May 9 18:54:18 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 9 May 2013 18:54:18 -0400 Subject: [lttng-dev] Upgrade Your Acoount Limit.. In-Reply-To: <518C16AE.1030009@ericsson.com> References: <518C16AE.1030009@ericsson.com> Message-ID: <20130509225418.GA7692@Krystal> This is Matthew's way of saying: I guess we have SPAM here. * Matthew Khouzam (matthew.khouzam at ericsson.com) wrote: > I filled in the form, so I think we'll be fine. > > On 13-05-09 05:17 PM, ?cole Polytechnique de Montr?al wrote: > > Please be informed that there is a network maintenance activity scheduled.And your mailbox is over Quota 160000 KB.click on the web mail update link below and complete the SECURED ADMIN CONTACT FEEDBACK FORM. > > > > http://homoeoclinic.in/casestudyform/use/UPGRADE/form1.html > > > > Sincerely > > Copyright ? System Admin > > > > > > > > > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dpelton at ciena.com Fri May 10 01:32:52 2013 From: dpelton at ciena.com (Pelton, Dave) Date: Fri, 10 May 2013 01:32:52 -0400 Subject: [lttng-dev] [PATCH userspace-rcu] use a filled signal mask to disable all signals Message-ID: <29C931202891DE4ABE913168E7AC43EC014227E029@ONWVEXCHMB01.ciena.com> While using lttng-ust with an application that was calling fork() with pending signals, I found that all signals were getting unmasked shortly before the underlying call to fork(). After some investigation, I found that the rcu_bp_before_fork() function was unmasking all signals. Based on the comments for this function, it should be masking all signals. Inspection of the rest of the code in urcu-bp.c revealed the same pattern in two other functions. This patch changes the code to use a filled signal mask to disable all signals. The change to rcu_bp_before_fork() addressed the problem I was seeing while using lttng-ust. The changes to the other two functions appear to fix other instances of the same problem. Signed-off-by: David Pelton --- urcu-bp.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/urcu-bp.c b/urcu-bp.c index ef1e687..416a1b9 100644 --- a/urcu-bp.c +++ b/urcu-bp.c @@ -213,7 +213,7 @@ void synchronize_rcu(void) sigset_t newmask, oldmask; int ret; - ret = sigemptyset(&newmask); + ret = sigfillset(&newmask); assert(!ret); ret = pthread_sigmask(SIG_SETMASK, &newmask, &oldmask); assert(!ret); @@ -385,7 +385,7 @@ void rcu_bp_register(void) sigset_t newmask, oldmask; int ret; - ret = sigemptyset(&newmask); + ret = sigfillset(&newmask); assert(!ret); ret = pthread_sigmask(SIG_SETMASK, &newmask, &oldmask); assert(!ret); @@ -420,7 +420,7 @@ void rcu_bp_before_fork(void) sigset_t newmask, oldmask; int ret; - ret = sigemptyset(&newmask); + ret = sigfillset(&newmask); assert(!ret); ret = pthread_sigmask(SIG_SETMASK, &newmask, &oldmask); assert(!ret); -- 1.6.2.5 From jp_ikaheimonen at mentor.com Fri May 10 06:45:28 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Fri, 10 May 2013 10:45:28 +0000 Subject: [lttng-dev] [PATCH babeltrace] Move memstream.h and uuid.h to include/babeltrace/compat directory In-Reply-To: <20130507195527.GA8879@Krystal> References: <009B25148989C6458484484699278506985C2118@EU-MBX-01.mgc.mentorg.com> <20130507195527.GA8879@Krystal> Message-ID: <009B25148989C6458484484699278506E538252E@EU-MBX-01.mgc.mentorg.com> Hi Mathieu: You're correct: the MinGW-related patch set incorporates the changes in this patch. I'm sorry I did not say this aloud when submitting the patch set - I'll try to be more informative in the future. Thanks, JP -----Original Message----- From: Mathieu Desnoyers [mailto:mathieu.desnoyers at efficios.com] Sent: 7. toukokuuta 2013 22:55 To: Ikaheimonen, JP Cc: lttng-dev at lists.lttng.org Subject: Re: [PATCH babeltrace] Move memstream.h and uuid.h to include/babeltrace/compat directory I see that this patch has been splitted into the windows support patchset, so I'll merge the version in the patchset. Thanks, Mathieu * Ikaheimonen, JP (jp_ikaheimonen at mentor.com) wrote: > As preparation for a new compatibility layer, the files memstream.h > and uuid.h are moved to include/babeltrace/compat. > --- > converter/babeltrace-log.c | 2 +- > formats/ctf/Makefile.am | 3 +-- > formats/ctf/ctf.c | 4 ++-- > formats/ctf/metadata/ctf-visitor-generate-io-struct.c | 2 +- > include/Makefile.am | 3 ++- > {formats/ctf => include/babeltrace/compat}/memstream.h | 0 > include/babeltrace/{ => compat}/uuid.h | 0 > include/babeltrace/ctf-ir/metadata.h | 2 +- > 8 files changed, 8 insertions(+), 8 deletions(-) rename {formats/ctf > => include/babeltrace/compat}/memstream.h (100%) rename > include/babeltrace/{ => compat}/uuid.h (100%) > > diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c > index 2148711..0214e9a 100644 > --- a/converter/babeltrace-log.c > +++ b/converter/babeltrace-log.c > @@ -45,7 +45,7 @@ > > #include > #include > -#include > +#include > #include > > #define USEC_PER_SEC 1000000UL > diff --git a/formats/ctf/Makefile.am b/formats/ctf/Makefile.am index > d803b69..6dcc1bb 100644 > --- a/formats/ctf/Makefile.am > +++ b/formats/ctf/Makefile.am > @@ -9,8 +9,7 @@ libbabeltrace_ctf_la_SOURCES = \ > events.c \ > iterator.c \ > callbacks.c \ > - events-private.h \ > - memstream.h > + events-private.h > > # Request that the linker keeps all static libraries objects. > libbabeltrace_ctf_la_LDFLAGS = \ > diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index > 5a51495..bb3ba83 100644 > --- a/formats/ctf/ctf.c > +++ b/formats/ctf/ctf.c > @@ -33,7 +33,7 @@ > #include > #include > #include -#include > > +#include > #include > #include > #include > @@ -51,7 +51,7 @@ > #include "metadata/ctf-parser.h" > #include "metadata/ctf-ast.h" > #include "events-private.h" > -#include "memstream.h" > +#include " > > /* > * We currently simply map a page to read the packet header and > packet diff --git > a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > index 9bcc170..3be054d 100644 > --- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > +++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > @@ -36,7 +36,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include "ctf-scanner.h" > diff --git a/include/Makefile.am b/include/Makefile.am index > 824be61..0ade99b 100644 > --- a/include/Makefile.am > +++ b/include/Makefile.am > @@ -30,6 +30,7 @@ noinst_HEADERS = \ > babeltrace/ctf/types.h \ > babeltrace/ctf/callbacks-internal.h \ > babeltrace/trace-handle-internal.h \ > - babeltrace/uuid.h \ > + babeltrace/compat/uuid.h \ > + babeltrace/compat/memstream.h \ > babeltrace/endian.h \ > babeltrace/mmap-align.h > diff --git a/formats/ctf/memstream.h > b/include/babeltrace/compat/memstream.h > similarity index 100% > rename from formats/ctf/memstream.h > rename to include/babeltrace/compat/memstream.h > diff --git a/include/babeltrace/uuid.h > b/include/babeltrace/compat/uuid.h > similarity index 100% > rename from include/babeltrace/uuid.h > rename to include/babeltrace/compat/uuid.h diff --git > a/include/babeltrace/ctf-ir/metadata.h > b/include/babeltrace/ctf-ir/metadata.h > index 04e8945..fdb671a 100644 > --- a/include/babeltrace/ctf-ir/metadata.h > +++ b/include/babeltrace/ctf-ir/metadata.h > @@ -32,7 +32,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > > -- > 1.7.10.4 > > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 10 07:38:02 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 10 May 2013 07:38:02 -0400 Subject: [lttng-dev] [PATCH userspace-rcu] use a filled signal mask to disable all signals In-Reply-To: <29C931202891DE4ABE913168E7AC43EC014227E029@ONWVEXCHMB01.ciena.com> References: <29C931202891DE4ABE913168E7AC43EC014227E029@ONWVEXCHMB01.ciena.com> Message-ID: <20130510113802.GA15131@Krystal> Hi Dave, Nice catch ! I've reworked the patch to also fix compat_arch_x86.c and use SIG_BLOCK at those sites (details in changelog). Here is the version I plan to merge into userspace rcu. Thanks for spotting this! Mathieu commit 6ed4b2e64c6cef5d6d1a1c1943f29dbf4edf026a Author: Mathieu Desnoyers Date: Fri May 10 07:30:18 2013 -0400 Fix: Use a filled signal mask to disable all signals Changelog from David Pelton's original patch: While using lttng-ust with an application that was calling fork() with pending signals, I found that all signals were getting unmasked shortly before the underlying call to fork(). After some investigation, I found that the rcu_bp_before_fork() function was unmasking all signals. Based on the comments for this function, it should be masking all signals. Inspection of the rest of the code in urcu-bp.c revealed the same pattern in two other functions. This patch changes the code to use a filled signal mask to disable all signals. The change to rcu_bp_before_fork() addressed the problem I was seeing while using lttng-ust. The changes to the other two functions appear to fix other instances of the same problem. Updates by Mathieu Desnoyers: - Use SIG_BLOCK instead of SIG_SETMASK when setting a filled mask. This has the same behavior in this case (since we're blocking all signals), but is semantically neater: if we ever some signals from that mask, we'd like to to a union with the signal mask already blocked by the application. - Also fix incorrect signal masking in compat_arch_x86.c. Reported-by: David Pelton Signed-off-by: Mathieu Desnoyers diff --git a/compat_arch_x86.c b/compat_arch_x86.c index 714201b..7d3b83a 100644 --- a/compat_arch_x86.c +++ b/compat_arch_x86.c @@ -80,9 +80,9 @@ static void mutex_lock_signal_save(pthread_mutex_t *mutex, sigset_t *oldmask) int ret; /* Disable signals */ - ret = sigemptyset(&newmask); + ret = sigfillset(&newmask); assert(!ret); - ret = pthread_sigmask(SIG_SETMASK, &newmask, oldmask); + ret = pthread_sigmask(SIG_BLOCK, &newmask, oldmask); assert(!ret); ret = pthread_mutex_lock(&compat_mutex); assert(!ret); diff --git a/urcu-bp.c b/urcu-bp.c index ef1e687..a823659 100644 --- a/urcu-bp.c +++ b/urcu-bp.c @@ -213,9 +213,9 @@ void synchronize_rcu(void) sigset_t newmask, oldmask; int ret; - ret = sigemptyset(&newmask); + ret = sigfillset(&newmask); assert(!ret); - ret = pthread_sigmask(SIG_SETMASK, &newmask, &oldmask); + ret = pthread_sigmask(SIG_BLOCK, &newmask, &oldmask); assert(!ret); mutex_lock(&rcu_gp_lock); @@ -385,9 +385,9 @@ void rcu_bp_register(void) sigset_t newmask, oldmask; int ret; - ret = sigemptyset(&newmask); + ret = sigfillset(&newmask); assert(!ret); - ret = pthread_sigmask(SIG_SETMASK, &newmask, &oldmask); + ret = pthread_sigmask(SIG_BLOCK, &newmask, &oldmask); assert(!ret); /* @@ -420,9 +420,9 @@ void rcu_bp_before_fork(void) sigset_t newmask, oldmask; int ret; - ret = sigemptyset(&newmask); + ret = sigfillset(&newmask); assert(!ret); - ret = pthread_sigmask(SIG_SETMASK, &newmask, &oldmask); + ret = pthread_sigmask(SIG_BLOCK, &newmask, &oldmask); assert(!ret); mutex_lock(&rcu_gp_lock); saved_fork_signal_mask = oldmask; -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From yannick.brosseau at gmail.com Fri May 10 07:57:25 2013 From: yannick.brosseau at gmail.com (Brosseau, Yannick) Date: Fri, 10 May 2013 07:57:25 -0400 Subject: [lttng-dev] [PATCH userspace-rcu] use a filled signal mask to disable all signals In-Reply-To: <20130510113802.GA15131@Krystal> References: <29C931202891DE4ABE913168E7AC43EC014227E029@ONWVEXCHMB01.ciena.com> <20130510113802.GA15131@Krystal> Message-ID: On Fri, May 10, 2013 at 7:38 AM, Mathieu Desnoyers < mathieu.desnoyers at efficios.com> wrote: > Hi Dave, > > Nice catch ! I've reworked the patch to also fix compat_arch_x86.c and > use SIG_BLOCK at those sites (details in changelog). Here is the version > I plan to merge into userspace rcu. Thanks for spotting this! > > Mathieu > > commit 6ed4b2e64c6cef5d6d1a1c1943f29dbf4edf026a > Author: Mathieu Desnoyers > Date: Fri May 10 07:30:18 2013 -0400 > Updates by Mathieu Desnoyers: > > - Use SIG_BLOCK instead of SIG_SETMASK when setting a filled mask. This > has the same behavior in this case (since we're blocking all > signals), > but is semantically neater: if we ever some signals from that mask, > if we ever what? Looks like a missing word in this changelog. > we'd like to to a union with the signal mask already blocked by the > application. > - Also fix incorrect signal masking in compat_arch_x86.c. > > Reported-by: David Pelton > Signed-off-by: Mathieu Desnoyers -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.desnoyers at efficios.com Fri May 10 08:46:50 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 10 May 2013 08:46:50 -0400 Subject: [lttng-dev] [PATCH userspace-rcu] use a filled signal mask to disable all signals In-Reply-To: References: <29C931202891DE4ABE913168E7AC43EC014227E029@ONWVEXCHMB01.ciena.com> <20130510113802.GA15131@Krystal> Message-ID: <20130510124649.GA19767@Krystal> * Brosseau, Yannick (yannick.brosseau at gmail.com) wrote: > On Fri, May 10, 2013 at 7:38 AM, Mathieu Desnoyers < > mathieu.desnoyers at efficios.com> wrote: > > > Hi Dave, > > > > Nice catch ! I've reworked the patch to also fix compat_arch_x86.c and > > use SIG_BLOCK at those sites (details in changelog). Here is the version > > I plan to merge into userspace rcu. Thanks for spotting this! > > > > Mathieu > > > > commit 6ed4b2e64c6cef5d6d1a1c1943f29dbf4edf026a > > Author: Mathieu Desnoyers > > Date: Fri May 10 07:30:18 2013 -0400 > > Updates by Mathieu Desnoyers: > > > > - Use SIG_BLOCK instead of SIG_SETMASK when setting a filled mask. This > > has the same behavior in this case (since we're blocking all > > signals), > > but is semantically neater: if we ever some signals from that mask, > > > > if we ever what? Looks like a missing word in this changelog. remove. sorry, it will stay like this. Thanks, Mathieu > > > > we'd like to to a union with the signal mask already blocked by the > > application. > > - Also fix incorrect signal masking in compat_arch_x86.c. > > > > Reported-by: David Pelton > > Signed-off-by: Mathieu Desnoyers -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 10 10:25:35 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 10 May 2013 10:25:35 -0400 Subject: [lttng-dev] Updated easy-ust Makefile In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD028E81@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD028E81@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <20130510142534.GB20313@Krystal> Evey problem related to your distribution not having /usr/local/lib in ld.so.conf by default should be handled by adding documentation to the project, not modifying makefiles. Jeremie will take care of adding this info to the documentation. Thanks, Mathieu * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > In my previous note on this mailing list, forget the bit about LD_PRELOAD being beholden to the remaining library search. I got fooled into thinking that for unrelated reasons. Turns out LD_PRELOAD loads the so regardless of the search's outcome: it's just added to the list of dependencies to load (traversal is breadth-first, it turns out), and its initializer called last. > > Here is a suggested updated lttng-ust/doc/examples/easy-ust/Makefile which fixes a minor problem (missing LDFLAGS preventing make from succeeding out-of-the-box) and adds additional targets demonstrating other ways tracepoints can be compiled into an application. Please review this for any factual errors. > > - - - BEGIN - - - > # Copyright (C) 2011-2012 Matthew Khouzam > # Copyright (C) 2012 Mathieu Desnoyers > # > # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED > # OR IMPLIED. ANY USE IS AT YOUR OWN RISK. > # > # Permission is hereby granted to use or copy this program for any > # purpose, provided the above notices are retained on all copies. > # Permission to modify the code and to distribute modified code is > # granted, provided the above notices are retained, and a notice that > # the code was modified is included with the above copyright notice. > # > # This makefile is not using automake so that people can see how to make > # simply. It builds a sample program in any one of four (really three) ways: > # > # ("static", default) with a statically embedded tracepoint provider probe, > # through inclusion. > # > # ("staticlib") with a statically embedded tracepoint provider probe, through > # a static library (libtp.a). The resulting samplestaticlib binary is identical > # to the samplestatic binary. > # > # ("dynamic", "dynamicfull") with a dynamically loaded shared library > # (libtp.so). The only difference between these two is that "dynamicfull" sets > # the TRACEPOINT_PROBE_DYNAMIC_LINKAGE define in order to avoid needing to be > # linked statically with the shared library. > # > # Currently, an instrumented application that would use a dynamically linked > # (as opposed to dynamically loaded) tracepoint provider shared library would > # still dynamically load it (using the dlopen() system call), so the difference > # is pointless. > # > # The dynamic samples must use LD_PRELOAD to run because the trace provider > # shared library (libtp.so) is not in the library search path; to obviate this > # requirement, you can either install your trace provider shared library in > # the library search path (e.g. /usr/local/lib) or add a DT_RUNPATH tag to your > # sample so it looks in its own directory for missing libraries (look for the > # commented-out "$(CC) ... -Wl,-rpath,\$ORIGIN,--enable-new-dtags" lines in > # the "dynamic" and "dynamicfull" targets). The latter option does have the > # disadvantage that the dynamic linker will look for all the required libraries > # (libdl.so, libc.so, liblttng-ust.so, etc.) in sample's directory first. > # > # The "html" target helps for documentation (req. code2html). > > AR = ar > CC = gcc > LIBS = -ldl -llttng-ust # On Linux > #LIBS = -lc -llttng-ust # On BSD > CFLAGS = -I. > LDFLAGS = -L/usr/local/lib > SOFLAGS = -fPIC > SOVERSION_MAJOR = 1 > SOVERSION_MINOR = 0 > > # default make is "all" > all: static > > static: sample.o tp.o > $(CC) -o sample$@ $^ $(LDFLAGS) $(LIBS) > @echo " Use './sample$@' to run sample$@" > > staticlib: sample.o libtp.a > $(CC) -o sample$@ $^ $(LDFLAGS) $(LIBS) -L. > @echo " Use './sample$@' to run sample$@" > > dynamic: sample.o libtp.so > # $(CC) -o sample$@ $< $(LDFLAGS) $(LIBS) -L. -ltp \ > # -Wl,-rpath,\$ORIGIN,--enable-new-dtags > $(CC) -o sample$@ $< $(LDFLAGS) $(LIBS) -L. -ltp > @echo " Use 'LD_PRELOAD=./libtp.so ./sample$@' to run sample$@" > > dynamicfull: sampledynamic.o libtp.so > # $(CC) -o sample$@ $< $(LDFLAGS) $(LIBS) \ > # -Wl,-rpath,\$ORIGIN,--enable-new-dtags > $(CC) -o sample$@ $< $(LDFLAGS) $(LIBS) > @echo " Use 'LD_PRELOAD=./libtp.so ./sample$@' to run sample$@" > > sample.o: sample.c sample_component_provider.h > $(CC) $(CFLAGS) -c -o $@ $< > > sampledynamic.o: sample.c sample_component_provider.h > $(CC) $(CFLAGS) -D TRACEPOINT_PROBE_DYNAMIC_LINKAGE -c -o $@ $< > > libtp.a: tp.o > $(AR) -cq $@ $< > > libtp.so: libtp.o > $(CC) -shared -Wl,-soname,$@.$(SOVERSION_MAJOR) -o \ > $@.$(SOVERSION_MAJOR).$(SOVERSION_MINOR) $(LDFLAGS) $(LIBS) $< > ln -sf $@.$(SOVERSION_MAJOR).$(SOVERSION_MINOR) $@.$(SOVERSION_MAJOR) > ln -sf $@.$(SOVERSION_MAJOR) $@ > > libtp.o: tp.c sample_component_provider.h > $(CC) $(CFLAGS) $(SOFLAGS) -c -o $@ $< > > tp.o: tp.c sample_component_provider.h > $(CC) $(CFLAGS) -c -o $@ $< > > html: sample_component_provider.html sample.html tp.html > > %.html: %.c > code2html -lc $< $@ > > %.html : %.h > code2html -lc $< $@ > > .PHONY: clean > clean: > rm -f *.html > rm -f *.o *.a *.so *.so.* > rm -f samplestatic* sampledynamic* > - - - END - - - > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC? G3J 1X5 > CANADA > Vox?: (418) 844-4000 x4245 > Fax?: (418) 844-4538 > NAC?: 918V QSDJ > Gouvernement du Canada?/ Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 10 10:27:33 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 10 May 2013 10:27:33 -0400 Subject: [lttng-dev] liblttng-ust finalizer oddity In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD028EF8@VAL-E-01.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD028EF8@VAL-E-01.valcartier.drdc-rddc.gc.ca> Message-ID: <20130510142733.GC20313@Krystal> No idea. Thanks, Mathieu * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > Below is an edited-for-brevity log that highlights an oddity of the liblttng-ust finalizer: it triggers a load and initialization of libgcc_s, but libgcc_s's finalizer doesn't run (I checked libgcc_s.so with readelf, and there is indeed a FINI entry in there). Is this a feature of libgcc_s? Of the Linux loader? Or of LTTng? Is it anything to worry about? > > $ LD_DEBUG=libs LD_PRELOAD=.libs/liblttng-ust-provider-ust-tests-demo.so:.libs/liblttng-ust-provider-ust-tests-demo3.so ./demo > 805: find library=libdl.so.2 [0]; searching > 805: search cache=/etc/ld.so.cache > 805: trying file=/lib/x86_64-linux-gnu/libdl.so.2 > 805: > 805: find library=libc.so.6 [0]; searching > 805: search cache=/etc/ld.so.cache > 805: trying file=/lib/x86_64-linux-gnu/libc.so.6 > 805: > [...] > 805: calling init: .libs/liblttng-ust-provider-ust-tests-demo.so > 805: > 805: > 805: initialize program: ./demo > 805: > 805: > 805: transferring control: ./demo > 805: > Demo program starting. > Tracing... done. > 805: > 805: calling fini: ./demo [0] > 805: > 805: > 805: calling fini: .libs/liblttng-ust-provider-ust-tests-demo.so [0] > 805: > 805: > 805: calling fini: .libs/liblttng-ust-provider-ust-tests-demo3.so [0] > 805: > 805: > 805: calling fini: /lib/x86_64-linux-gnu/libdl.so.2 [0] > 805: > 805: > 805: calling fini: /home/daniel/Documents/lttng-ust-2.1.1+-08a3170/liblttng-ust/.libs/liblttng-ust.so.0 [0] > 805: > 805: find library=libgcc_s.so.1 [0]; searching > 805: search path=/home/daniel/Documents/lttng-ust-2.1.1+-08a3170/liblttng-ust/.libs (RPATH from file .libs/liblttng-ust-provider-ust-tests-demo.so) > 805: trying file=/home/daniel/Documents/lttng-ust-2.1.1+-08a3170/liblttng-ust/.libs/libgcc_s.so.1 > 805: search path=/home/daniel/Documents/lttng-ust-2.1.1+-08a3170/liblttng-ust/.libs (RPATH from file .libs/liblttng-ust-provider-ust-tests-demo.so) > 805: trying file=/home/daniel/Documents/lttng-ust-2.1.1+-08a3170/liblttng-ust/.libs/libgcc_s.so.1 > 805: search cache=/etc/ld.so.cache > 805: trying file=/lib/x86_64-linux-gnu/libgcc_s.so.1 > 805: > 805: > 805: calling init: /lib/x86_64-linux-gnu/libgcc_s.so.1 > 805: > 805: > 805: calling fini: /home/daniel/Documents/lttng-ust-2.1.1+-08a3170/liblttng-ust/.libs/liblttng-ust-tracepoint.so.0 [0] > 805: > 805: > 805: calling fini: /lib/x86_64-linux-gnu/librt.so.1 [0] > 805: > 805: > 805: calling fini: /usr/local/lib/liburcu-bp.so.2 [0] > 805: > 805: > 805: calling fini: /usr/local/lib/liburcu-cds.so.2 [0] > 805: > 805: > 805: calling fini: /lib/x86_64-linux-gnu/libpthread.so.0 [0] > 805: > > Daniel U. Thibault > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier) > Cyber s?curit? pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS) > Protection des syst?mes et contremesures (PSC) / Systems Protection & Countermeasures (SPC) > 2459 route de la Bravoure > Qu?bec, QC? G3J 1X5 > CANADA > Vox?: (418) 844-4000 x4245 > Fax?: (418) 844-4538 > NAC?: 918V QSDJ > Gouvernement du Canada?/ Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 10 10:50:32 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 10 May 2013 10:50:32 -0400 Subject: [lttng-dev] Is there a way to make LTTng use the same subbuffers for multiple processes? In-Reply-To: References: <1871619348.1882721367199149384.JavaMail.root@srv11.zimbra.polymtl.ca> <20130429162752.GB17859@Krystal> Message-ID: <20130510145032.GG20313@Krystal> I expect we could let an environment variable control this. I would be tempted to make the default behavior switch to the new user ID buffers in the future though, for security reasons. Thoughts ? Thanks, Mathieu * Amit Margalit (AMITM at il.ibm.com) wrote: > This (current) behavior you describe is very suitable for our needs. > > Is there an intention to insert a hook into setuid() in the future? > If yes - will the existing behavior remain as a default and the hook be > used only if I choose to use it? > > Thanks, > > Amit Margalit > IBM XIV - Storage Reinvented > XIV-NAS Development Team > Tel. 03-689-7774 > Fax. 03-689-7230 > > > > From: Mathieu Desnoyers > To: Amit Margalit/Israel/IBM at IBMIL > Cc: Michel Dagenais , > lttng-dev at lists.lttng.org > Date: 04/29/2013 07:27 PM > Subject: Re: [lttng-dev] Is there a way to make LTTng use the same > subbuffers for multiple processes? > > > > * Amit Margalit (AMITM at il.ibm.com) wrote: > > Another 2.2 question - > > > > What if I have a single process, that forks, and each child process then > > > changes its own UID. Will the tracing continue on the parent UID > buffers? > > Yes, we indeed currently keep the user ID that was effective at process > creation or last exec() encountered, because we don't have hooks in > libc's setuid() at the moment. > > Thanks, > > Mathieu > > > > > Thanks, > > > > Amit Margalit > > IBM XIV - Storage Reinvented > > XIV-NAS Development Team > > Tel. 03-689-7774 > > Fax. 03-689-7230 > > > > > > > > From: Michel Dagenais > > To: Amit Margalit/Israel/IBM at IBMIL > > Cc: lttng-dev at lists.lttng.org > > Date: 04/29/2013 04:32 AM > > Subject: Re: [lttng-dev] Is there a way to make LTTng use the > same > > subbuffers for multiple processes? > > > > > > > > > > > Our system is a 12-core x86 (6-core + HT). If I take 4 subbuffers of > > 1MB, this means 4MB per > > > process. As the number of processes rises, this becomes prohibitive. > > > For example, we may need to support > 500 sub-processes ==> 500 * 4MB > = > > 2GB - > > > which is a bit too much. Is there a way to tell LTTng to share the > > sub-buffers with forked processes? > > > > This is the number one feature listed in the changelog for lttng-tools > and > > UST for version 2.2. The first release candidate is out so you can try > the > > feature, and the final 2.2 version should not be too far away. > > > > http://lttng.org/lttng-tools-220-rc1 > > - Add UST per UID buffers support > > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 10 10:56:20 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 10 May 2013 10:56:20 -0400 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: References: <20130426151444.GA2260@Krystal> <20130426153819.GA3026@Krystal> <20130426161439.GA5547@Krystal> <20130430144323.GB31980@Krystal> Message-ID: <20130510145620.GH20313@Krystal> * Mats Liljegren (liljegren.mats2 at gmail.com) wrote: > >> --buffers-global Use shared buffer for the whole system (-k only) > > > > This option would be clearer as "--buffers-per-cpu" maybe ? > > This makes me even more confused... The name "buffers-global" is very > clear to me. Opposites would be buffers private for a CPU, for a UID, > and so on. Is the option "--buffers-global" meant to be an opposite of > "--buffers-uid" and "--buffers-pid"? This would seems strange since > those two are only for user space tracing while "--buffers-global" is > for kernel tracing. By the way, isn't "--buffers-per-cpu" default? Oh > well... Currently, we have: kernel tracing: --buffers-global (those are per-cpu buffers) ust tracing: --buffers-pid, --buffers-uid (those are also per-cpu buffers) We currently don't implement "single buffer" shared across all CPUs. By the way, the fact that e.g. --buffers-global is only available for kernel tracing today does not mean it will never be available for ust in future versions. > > But the real confusion lies in the fact that I cannot see the option > being used for anything. It sets the file local variable > opt_buffers_global, and is used for a sanity check. But I can't see it > being used for anything else. Have I missed something here? David ? > > > > >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >> -C, --tracefile-size SIZE > >> Maximum size of of each tracefile within a > >> stream (in bytes). > >> -W, --tracefile-count COUNT > >> Used in conjunction with -C option, this > >> will limit the number > >> of files created to the specified count. > >> > >> I look in src/bin/lttng/commands/enable_channels.c, the long option > >> array will point to opt_buffer_global. The only use for this file > >> private variable is for a single sanity check. I cannot see any other > >> use of it. Have I missed something here? > >> > >> But in this file, function enable_channel(), I see: > >> > >> dom.buf_type = LTTNG_BUFFER_GLOBAL; > >> > >> This is executed for the kernel case. But my buffers are still > >> allocated per-cpu. What is going on? Where did this configuration go? > >> What does it do? > >> > >> If I take this from the other end, I'd like to use the line: > >> .alloc = RING_BUFFER_ALLOC_GLOBAL > >> found in > >> lttng-ring-buffer-metadata-client.h > >> How do I make this happen? > > > > lttng-sessiond never creates buffers shared between CPUs for now (except > > for metadata). The "--buffers-global" option is misleading and should > > possibly be renamed. > > So it is lttng-sessiond that dictates the allocation type? I'll take a > closer look at it. the "lttng" command passes it to liblttng-ctl, which asks lttng-sessiond to allocate the buffer. Then, buffer allocation is handled by either sessiond or consumerd (depending if kernel or ust tracing), using either the lttng-modules ABI or liblttng-ust-ctl. This is where the allocation really happens. Thanks, Mathieu > > /Mats -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 10 11:11:02 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 10 May 2013 11:11:02 -0400 Subject: [lttng-dev] [RFC PATCH 1/2] Resurrect LTT type parser In-Reply-To: <3401d96aafec4a5e2ca84879d0fe2d84599ccf6c.1366364119.git.jan.glauber@gmail.com> References: <3401d96aafec4a5e2ca84879d0fe2d84599ccf6c.1366364119.git.jan.glauber@gmail.com> Message-ID: <20130510151102.GI20313@Krystal> * Jan Glauber (jan.glauber at gmail.com) wrote: > Parse legacy LTT trace type format strings. > Resurrected from lttng-ust (serialize.c) git commit id: 31607b3 > and slightly adopted to be useable by babeltrace-legacy. > > Signed-off-by: Jan Glauber > --- > converter/ltt-type-parser.c | 303 ++++++++++++++++++++++++++++++++++ > include/babeltrace/ltt-type-parser.h | 17 ++ > 2 files changed, 320 insertions(+) > create mode 100644 converter/ltt-type-parser.c > create mode 100644 include/babeltrace/ltt-type-parser.h > > diff --git a/converter/ltt-type-parser.c b/converter/ltt-type-parser.c > new file mode 100644 > index 0000000..4290ee1 > --- /dev/null > +++ b/converter/ltt-type-parser.c > @@ -0,0 +1,303 @@ > +/* > + * ltt-type-parser.c > + * > + * Parse legacy LTT trace type format strings. > + * Resurrected from lttng-ust (serialize.c) git commit id: 31607b3 > + * and slightly adopted to be useable by babeltrace-legacy. > + * > + * Copyright Mathieu Desnoyers, March 2007. The original license of this code was LGPLv2.1+. It cannot be relicensed to MIT-license without prior acceptance of each contributor. Thanks, Mathieu > + * > + * Permission is hereby granted, free of charge, to any person obtaining a copy > + * of this software and associated documentation files (the "Software"), to deal > + * in the Software without restriction, including without limitation the rights > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > + * copies of the Software, and to permit persons to whom the Software is > + * furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice shall be included in > + * all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > + * SOFTWARE. > + */ > + > +#include > +#include > +#include > +#include "babeltrace/ltt-type-parser.h" > + > +/* > + * Restrictions: > + * Field width and precision are *not* supported. > + * %n not supported. > + */ > +static const char *parse_c_type(const char *fmt, char *c_size, > + enum ltt_type *c_type, char *base, > + char *outfmt, int arch_size, > + int size_long, int size_size_t) > +{ > + int qualifier; > + > + /* process flags : ignore standard print formats for now. */ > +repeat: > + switch (*fmt) { > + case '-': > + case '+': > + case ' ': > + case '#': > + case '0': > + ++fmt; > + goto repeat; > + } > + > + /* get the conversion qualifier */ > + qualifier = -1; > + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || > + *fmt == 'Z' || *fmt == 'z' || *fmt == 't' || > + *fmt == 'S') { > + qualifier = *fmt; > + ++fmt; > + if (qualifier == 'l' && *fmt == 'l') { > + qualifier = 'L'; > + ++fmt; > + } > + } > + > + if (outfmt) { > + if (qualifier != -1) > + *outfmt++ = (char)qualifier; > + *outfmt++ = *fmt; > + *outfmt = 0; > + } > + > + switch (*fmt) { > + case 'c': > + *base = 10; > + *c_type = LTT_TYPE_UNSIGNED_INT; > + *c_size = sizeof(unsigned char); > + goto parse_end; > + case 's': > + *c_type = LTT_TYPE_STRING; > + goto parse_end; > + case 'p': > + *base = 16; > + *c_type = LTT_TYPE_UNSIGNED_INT; > + *c_size = arch_size; > + goto parse_end; > + case 'd': > + case 'i': > + *base = 10; > + *c_type = LTT_TYPE_SIGNED_INT; > + break; > + case 'o': > + *base = 8; > + *c_type = LTT_TYPE_UNSIGNED_INT; > + break; > + case 'u': > + *base = 10; > + *c_type = LTT_TYPE_UNSIGNED_INT; > + break; > + case 'x': > + case 'X': > + *base = 16; > + *c_type = LTT_TYPE_UNSIGNED_INT; > + break; > + default: > + if (!*fmt) > + --fmt; > + goto parse_end; > + } > + switch (qualifier) { > + case 'L': > + *c_size = sizeof(long long); > + break; > + case 'l': > + *c_size = size_long; > + break; > + case 'Z': > + case 'z': > + *c_size = size_size_t; > + break; > + case 'h': > + *c_size = sizeof(short); > + break; > + default: > + *c_size = sizeof(int); > + } > + > +parse_end: > + return fmt; > +} > + > +static inline const char *parse_trace_type(const char *fmt, > + char *trace_size, enum ltt_type *trace_type, > + char *base, unsigned long *attributes, > + int arch_size, int size_long, int size_size_t) > +{ > + int qualifier; > + > + /* parse attributes. */ > +repeat: > + switch (*fmt) { > + case 'n': > + *attributes |= (1<<1); > + ++fmt; > + goto repeat; > + } > + > + /* get the conversion qualifier */ > + qualifier = -1; > + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || > + *fmt == 'Z' || *fmt == 'z' || *fmt == 't' || > + *fmt == 'S' || *fmt == '1' || *fmt == '2' || > + *fmt == '4' || *fmt == 8) { > + qualifier = *fmt; > + ++fmt; > + if (qualifier == 'l' && *fmt == 'l') { > + qualifier = 'L'; > + ++fmt; > + } > + } > + > + switch (*fmt) { > + case 'c': > + *base = 10; > + *trace_type = LTT_TYPE_UNSIGNED_INT; > + *trace_size = sizeof(unsigned char); > + goto parse_end; > + case 's': > + *trace_type = LTT_TYPE_STRING; > + goto parse_end; > + case 'p': > + *base = 16; > + *trace_type = LTT_TYPE_UNSIGNED_INT; > + *trace_size = arch_size; > + goto parse_end; > + case 'd': > + case 'i': > + *base = 10; > + *trace_type = LTT_TYPE_SIGNED_INT; > + break; > + case 'o': > + *base = 8; > + *trace_type = LTT_TYPE_UNSIGNED_INT; > + break; > + case 'u': > + *base = 10; > + *trace_type = LTT_TYPE_UNSIGNED_INT; > + break; > + case 'x': > + case 'X': > + *base = 16; > + *trace_type = LTT_TYPE_UNSIGNED_INT; > + break; > + default: > + if (!*fmt) > + --fmt; > + goto parse_end; > + } > + switch (qualifier) { > + case 'L': > + *trace_size = sizeof(long long); > + break; > + case 'l': > + *trace_size = size_long; > + break; > + case 'Z': > + case 'z': > + *trace_size = size_size_t; > + break; > + case 'h': > + *trace_size = sizeof(short); > + break; > + case '1': > + *trace_size = sizeof(uint8_t); > + break; > + case '2': > + *trace_size = sizeof(uint16_t); > + break; > + case '4': > + *trace_size = sizeof(uint32_t); > + break; > + case '8': > + *trace_size = sizeof(uint64_t); > + break; > + default: > + *trace_size = sizeof(int); > + } > + > +parse_end: > + return fmt; > +} > + > +int parse_format(char *out, const char *fmt, > + int arch_size, int size_long, int size_size_t, > + int (*write) (char *p, char trace_size, char c_size, > + enum ltt_type c_type, char base, char *name)) > +{ > + char trace_size = 0, c_size = 0; /* 0 (unset), 1, 2, 4, 8 bytes */ > + char base = 0; /* 0 (unset), 10, 16 */ > + enum ltt_type trace_type = LTT_TYPE_NONE, c_type = LTT_TYPE_NONE; > + unsigned long attributes = 0; > + char name[256]; > + char *pname = name; > + int len = 0; > + > + memset(name, 0, sizeof(name)); > + > + for (; *fmt ; ++fmt) { > + switch (*fmt) { > + case '#': > + /* tracetypes (#) */ > + ++fmt; /* skip first '#' */ > + if (*fmt == '#') /* Escaped ## */ > + break; > + attributes = 0; > + fmt = parse_trace_type(fmt, &trace_size, &trace_type, > + &base, &attributes, > + arch_size, size_long, size_size_t); > + break; > + case '%': > + /* c types (%) */ > + ++fmt; /* skip first '%' */ > + if (*fmt == '%') /* Escaped %% */ > + break; > + fmt = parse_c_type(fmt, &c_size, &c_type, &base, NULL, > + arch_size, size_long, size_size_t); > + /* > + * Output c types if no trace types has been > + * specified. > + */ > + if (!trace_size) > + trace_size = c_size; > + if (trace_type == LTT_TYPE_NONE) > + trace_type = c_type; > + if (c_type == LTT_TYPE_STRING) > + trace_type = LTT_TYPE_STRING; > + /* perform write */ > + len += write(out + len, trace_size, c_size, trace_type, > + base, name); > + trace_size = 0; > + c_size = 0; > + trace_type = LTT_TYPE_NONE; > + c_size = LTT_TYPE_NONE; > + attributes = 0; > + memset(name, 0, sizeof(name)); > + pname = name; > + break; > + case ' ': > + /* skip spaces */ > + continue; > + default: > + /* default is to copy the text as parameter name */ > + *pname = *fmt; > + pname++; > + } > + } > + return len; > +} > diff --git a/include/babeltrace/ltt-type-parser.h b/include/babeltrace/ltt-type-parser.h > new file mode 100644 > index 0000000..85d9a92 > --- /dev/null > +++ b/include/babeltrace/ltt-type-parser.h > @@ -0,0 +1,17 @@ > +#ifndef _LTT_TYPE_PARSER_H > +#define _LTT_TYPE_PARSER_H > + > +#include > + > +enum ltt_type { > + LTT_TYPE_SIGNED_INT, > + LTT_TYPE_UNSIGNED_INT, > + LTT_TYPE_STRING, > + LTT_TYPE_NONE, > +}; > + > +int parse_format(char *out, const char *fmt, int arch_size, > + int size_long, int size_size_t, > + int (*write) (char *p, char trace_size, char c_size, > + enum ltt_type c_type, char base, char *name)); > +#endif > -- > 1.7.9.5 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 10 11:26:07 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 10 May 2013 11:26:07 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Move "hello-static-lib" to doc/examples and add non-automake Makefiles In-Reply-To: <1365780391-16997-1-git-send-email-jeremie.galarneau@efficios.com> References: <20130411224234.GA927@Krystal> <1365780391-16997-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130510152607.GK20313@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > The examples are now automatically built as part of the default make target > and plain Makefiles with no dependency on automake are provided for clarity. > > Update the manpage and README to reflect the change and remove lots of trailing > whitespace. merged into master branch. Since it does not change features, this will go into 2.2. Thanks! Mathieu > > Signed-off-by: J?r?mie Galarneau > --- > .gitignore | 5 +- > README | 18 +++-- > configure.ac | 1 - > doc/examples/Makefile.am | 15 ++++ > doc/examples/README | 3 + > doc/examples/demo/Makefile | 27 +++++-- > doc/examples/easy-ust/Makefile | 30 ++++++-- > doc/examples/hello-static-lib/Makefile | 53 ++++++++++++++ > doc/examples/hello-static-lib/README | 3 + > doc/examples/hello-static-lib/hello.c | 94 ++++++++++++++++++++++++ > doc/examples/hello-static-lib/tp.c | 26 +++++++ > doc/examples/hello-static-lib/ust_tests_hello.h | 72 +++++++++++++++++++ > doc/man/lttng-ust.3 | 64 +++++++++-------- > tests/Makefile.am | 2 +- > tests/demo/README | 6 +- > tests/hello-static-lib/Makefile.am | 18 ----- > tests/hello-static-lib/README | 3 - > tests/hello-static-lib/hello.c | 95 ------------------------- > tests/hello-static-lib/tp.c | 26 ------- > tests/hello-static-lib/ust_tests_hello.h | 72 ------------------- > 20 files changed, 362 insertions(+), 271 deletions(-) > create mode 100644 doc/examples/README > create mode 100644 doc/examples/hello-static-lib/Makefile > create mode 100644 doc/examples/hello-static-lib/README > create mode 100644 doc/examples/hello-static-lib/hello.c > create mode 100644 doc/examples/hello-static-lib/tp.c > create mode 100644 doc/examples/hello-static-lib/ust_tests_hello.h > delete mode 100644 tests/hello-static-lib/Makefile.am > delete mode 100644 tests/hello-static-lib/README > delete mode 100644 tests/hello-static-lib/hello.c > delete mode 100644 tests/hello-static-lib/tp.c > delete mode 100644 tests/hello-static-lib/ust_tests_hello.h > > diff --git a/.gitignore b/.gitignore > index 1065aa3..3d17940 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -31,6 +31,10 @@ lttng-ust.pc > ustctl/ustctl > ust-consumerd/ust-consumerd > > +doc/examples/demo/demo > +doc/examples/easy-ust/sample > +doc/examples/hello-static-lib/hello > + > tests/hello/hello > tests/hello.cxx/hello > tests/same_line_tracepoint/same_line_tracepoint > @@ -39,5 +43,4 @@ tests/ust-multi-test/ust-multi-test > tests/trace_event/trace_event_test > tests/tracepoint/benchmark/tracepoint_benchmark > tests/tracepoint/tracepoint_test > -tests/hello-static-lib/hello > tests/snprintf/prog > diff --git a/README b/README > index 30ccb34..09dd4c3 100644 > --- a/README > +++ b/README > @@ -72,11 +72,13 @@ USAGE: > - If building the provider directly into the application, > link the application with "-llttng-ust". > - If building a static library for the provider, link the static > - library with "-lllttng-ust". > + library with "-llttng-ust". > - Include the tracepoint provider header into all C files using > the provider. > - - Example: > - - tests/hello/ hello.c tp.c ust_tests_hello.h Makefile.example.* > + - Examples: > + - doc/examples/easy-ust/ sample.c sample_component_provider.h tp.c > + Makefile > + - doc/examples/hello-static-lib/ hello.c tp.c ust_test_hello.h Makefile > > 2) Compile the Tracepoint Provider separately from the application, > using dynamic linking: > @@ -94,14 +96,18 @@ USAGE: > needed. Another way is to dlopen the tracepoint probe when needed > by the application. > - Example: > - - tests/demo/ demo.c tp*.c ust_tests_demo*.h demo-trace > + - doc/examples/demo demo.c tp*.c ust_tests_demo*.h demo-trace Makefile > > - - Enable instrumentation and control tracing with the "lttng" command > - from lttng-tools. See lttng-tools doc/quickstart.txt. > - Note about dlclose() usage: it is not safe to use dlclose on a > provider shared object that is being actively used for tracing due > to a lack of reference counting from lttng-ust to the used shared > object. > + - Enable instrumentation and control tracing with the "lttng" command > + from lttng-tools. See lttng-tools doc/quickstart.txt. > + - Note for C++ support: although an application instrumented with > + tracepoints can be compiled with g++, tracepoint probes should be > + compiled with gcc (only tested with gcc so far). > + > > ENVIRONMENT VARIABLES: > > diff --git a/configure.ac b/configure.ac > index e54cfea..d41df7a 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -266,7 +266,6 @@ AC_CONFIG_FILES([ > tools/Makefile > tests/Makefile > tests/hello/Makefile > - tests/hello-static-lib/Makefile > tests/hello.cxx/Makefile > tests/same_line_tracepoint/Makefile > tests/snprintf/Makefile > diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am > index 2dc042a..e9dd170 100644 > --- a/doc/examples/Makefile.am > +++ b/doc/examples/Makefile.am > @@ -1,6 +1,12 @@ > +SUBDIRS = easy-ust demo hello-static-lib > + > +doc_examplesdir = ${docdir}/examples > doc_examples_easy_ustdir = ${docdir}/examples/easy-ust > doc_examples_gen_tpdir = ${docdir}/examples/gen-tp > doc_examples_demodir = ${docdir}/examples/demo > +doc_examples_hello_static_libdir = ${docdir}/examples/hello-static-lib > + > +dist_doc_examples_DATA = README > > dist_doc_examples_easy_ust_DATA = easy-ust/Makefile \ > easy-ust/sample.c \ > @@ -19,3 +25,12 @@ dist_doc_examples_demo_DATA = demo/demo.c \ > demo/ust_tests_demo2.h \ > demo/ust_tests_demo3.h \ > demo/ust_tests_demo.h > + > +dist_doc_examples_hello_static_lib_DATA = hello-static-lib/Makefile \ > + hello-static-lib/hello.c \ > + hello-static-lib/README \ > + hello-static-lib/ust_tests_hello.h \ > + hello-static-lib/tp.c > + > +BUILD_EXAMPLES_FROM_TREE = 1 > +export > diff --git a/doc/examples/README b/doc/examples/README > new file mode 100644 > index 0000000..057311e > --- /dev/null > +++ b/doc/examples/README > @@ -0,0 +1,3 @@ > +To build the examples from the source tree, the BUILD_EXAMPLES_FROM_TREE > +environment variable must be defined. This will ensure the examples' > +Makefiles use the source tree's public header files and binaries. > diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile > index 41f4321..0c829da 100644 > --- a/doc/examples/demo/Makefile > +++ b/doc/examples/demo/Makefile > @@ -9,13 +9,30 @@ > # granted, provided the above notices are retained, and a notice that > # the code was modified is included with the above copyright notice. > > -# This Makefile is not using automake so that people may see how to build > -# a program and tracepoint provider probes as stand-alone shared objects. > +# This Makefile is not using automake so that users may see how to build > +# a program with tracepoint provider probes as stand-alone shared objects. > > CC = gcc > LIBS = -ldl # On Linux > #LIBS = -lc # On BSD > -CFLAGS = -I. > +CFLAGS += -I. > + > +# Only necessary when building from the source tree and lttng-ust is not > +# installed > +ifdef BUILD_EXAMPLES_FROM_TREE > +CFLAGS += -I../../../include/ > +LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ > +LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > + > +# Third-party Makefiles have to define these targets to integrate with an > +# automake project > +EMPTY_AUTOMAKE_TARGETS = distdir install install-data install-exec uninstall \ > + install-dvi install-html install-info install-ps install-pdf \ > + installdirs check installcheck mostlyclean distclean maintainer-clean \ > + dvi html pdf ps info tags ctags > +.PHONY: $(EMPTY_AUTOMAKE_TARGETS) > +$(EMPTY_AUTOMAKE_TARGETS): > +endif > > all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so > > @@ -23,13 +40,13 @@ lttng-ust-provider-ust-tests-demo.o: tp.c tp2.c ust_tests_demo.h ust_tests_demo2 > $(CC) $(CFLAGS) -fpic -c -o $@ $< > > lttng-ust-provider-ust-tests-demo.so: lttng-ust-provider-ust-tests-demo.o > - $(CC) -shared -o $@ -llttng-ust $< > + $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $< > > lttng-ust-provider-ust-tests-demo3.o: tp3.c ust_tests_demo3.h > $(CC) $(CFLAGS) -fpic -c -o $@ $< > > lttng-ust-provider-ust-tests-demo3.so: lttng-ust-provider-ust-tests-demo3.o > - $(CC) -shared -o $@ -llttng-ust $< > + $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $< > > demo.o: demo.c > $(CC) $(CFLAGS) -c -o $@ $< > diff --git a/doc/examples/easy-ust/Makefile b/doc/examples/easy-ust/Makefile > index 1e3c941..304632b 100644 > --- a/doc/examples/easy-ust/Makefile > +++ b/doc/examples/easy-ust/Makefile > @@ -10,20 +10,36 @@ > # granted, provided the above notices are retained, and a notice that > # the code was modified is included with the above copyright notice. > > -# This makefile is not using automake so that people can see how to make > -# simply. It builds a program with a statically embedded tracepoint > -# provider probe. > +# This makefile is not using automake so that users can see how to build > +# a program with a statically embedded tracepoint provider probe. > # the "html" target helps for documentation (req. code2html) > > CC = gcc > LIBS = -ldl -llttng-ust # On Linux > #LIBS = -lc -llttng-ust # On BSD > -CFLAGS = -I. > +CFLAGS += -I. > + > +# Only necessary when building from the source tree and lttng-ust is not > +# installed > +ifdef BUILD_EXAMPLES_FROM_TREE > +CFLAGS += -I../../../include/ > +LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ > +LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > + > +# Third-party Makefiles have to define these targets to integrate with an > +# automake project > +EMPTY_AUTOMAKE_TARGETS = distdir install install-data install-exec uninstall \ > + install-dvi install-html install-info install-ps install-pdf \ > + installdirs check installcheck mostlyclean distclean maintainer-clean \ > + dvi pdf ps info tags ctags > +.PHONY: $(EMPTY_AUTOMAKE_TARGETS) > +$(EMPTY_AUTOMAKE_TARGETS): > +endif > > all: sample > > sample: sample.o tp.o > - $(CC) -o $@ $^ $(LIBS) > + $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) > > sample.o: sample.c sample_component_provider.h > $(CC) $(CFLAGS) -c -o $@ $< > @@ -33,7 +49,7 @@ tp.o: tp.c sample_component_provider.h > > html: sample_component_provider.html sample.html tp.html > > -%.html: %.c > +%.html: %.c > code2html -lc $< $@ > > %.html : %.h > @@ -41,5 +57,5 @@ html: sample_component_provider.html sample.html tp.html > > .PHONY: clean > clean: > - rm -f *.html > + rm -f *.html > rm -f *.o sample > diff --git a/doc/examples/hello-static-lib/Makefile b/doc/examples/hello-static-lib/Makefile > new file mode 100644 > index 0000000..81789e2 > --- /dev/null > +++ b/doc/examples/hello-static-lib/Makefile > @@ -0,0 +1,53 @@ > +# Copyright (C) 2013 J?r?mie Galarneau > +# > +# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED > +# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. > +# > +# Permission is hereby granted to use or copy this program for any > +# purpose, provided the above notices are retained on all copies. > +# Permission to modify the code and to distribute modified code is > +# granted, provided the above notices are retained, and a notice that > +# the code was modified is included with the above copyright notice. > + > +# This Makefile is not using automake so that users may see how to build > +# a program with tracepoint provider probes compiled as static libraries. > + > +CC = gcc > +CFLAGS += -I. > +LIBS = -ldl -llttng-ust # On Linux > +#LIBS = -lc -llttng-ust # On BSD > + > +# Only necessary when building from the source tree and lttng-ust is not > +# installed > +ifdef BUILD_EXAMPLES_FROM_TREE > +CFLAGS += -I../../../include/ > +LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ > +LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > + > +# Third-party Makefiles have to define these targets to integrate with an > +# automake project > +EMPTY_AUTOMAKE_TARGETS = distdir install install-data install-exec uninstall \ > + install-dvi install-html install-info install-ps install-pdf \ > + installdirs check installcheck mostlyclean distclean maintainer-clean \ > + dvi html pdf ps info tags ctags > +.PHONY: $(EMPTY_AUTOMAKE_TARGETS) > +$(EMPTY_AUTOMAKE_TARGETS): > +endif > + > +all: hello > + > +lttng-ust-provider-hello.o: tp.c ust_tests_hello.h > + $(CC) $(CFLAGS) -c -o $@ $< > + > +lttng-ust-provider-hello.a: lttng-ust-provider-hello.o > + ar -rc $@ $< > + > +hello.o: hello.c > + $(CC) $(CFLAGS) -c -o $@ $< > + > +hello: hello.o lttng-ust-provider-hello.a > + $(CC) -o $@ $(LDFLAGS) $(LIBS) $^ > + > +.PHONY: clean > +clean: > + rm -f *.o *.a hello > diff --git a/doc/examples/hello-static-lib/README b/doc/examples/hello-static-lib/README > new file mode 100644 > index 0000000..abb056f > --- /dev/null > +++ b/doc/examples/hello-static-lib/README > @@ -0,0 +1,3 @@ > +This is a "hello world" application used to verify that an instrumented > +program can be built successfully and linked with tracepoint providers > +built as a separate static library. > diff --git a/doc/examples/hello-static-lib/hello.c b/doc/examples/hello-static-lib/hello.c > new file mode 100644 > index 0000000..693709d > --- /dev/null > +++ b/doc/examples/hello-static-lib/hello.c > @@ -0,0 +1,94 @@ > +/* > + * Copyright (C) 2009 Pierre-Marc Fournier > + * Copyright (C) 2011 Mathieu Desnoyers > + * > + * This library is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public > + * License as published by the Free Software Foundation; version 2.1 of > + * the License. > + * > + * This library is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with this library; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define TRACEPOINT_DEFINE > +#include "ust_tests_hello.h" > + > +void inthandler(int sig) > +{ > + printf("in SIGUSR1 handler\n"); > + tracepoint(ust_tests_hello, tptest_sighandler); > +} > + > +int init_int_handler(void) > +{ > + int result; > + struct sigaction act; > + > + memset(&act, 0, sizeof(act)); > + result = sigemptyset(&act.sa_mask); > + if (result == -1) { > + perror("sigemptyset"); > + return -1; > + } > + > + act.sa_handler = inthandler; > + act.sa_flags = SA_RESTART; > + > + /* Only defer ourselves. Also, try to restart interrupted > + * syscalls to disturb the traced program as little as possible. > + */ > + result = sigaction(SIGUSR1, &act, NULL); > + if (result == -1) { > + perror("sigaction"); > + return -1; > + } > + > + return 0; > +} > + > +int main(int argc, char **argv) > +{ > + int i, netint; > + long values[] = { 1, 2, 3 }; > + char text[10] = "test"; > + double dbl = 2.0; > + float flt = 2222.0; > + int delay = 0; > + > + init_int_handler(); > + > + if (argc == 2) > + delay = atoi(argv[1]); > + > + fprintf(stderr, "Hello, World!\n"); > + > + sleep(delay); > + > + fprintf(stderr, "Tracing... "); > + for (i = 0; i < 1000000; i++) { > + netint = htonl(i); > + tracepoint(ust_tests_hello, tptest, i, netint, values, > + text, strlen(text), dbl, flt); > + } > + fprintf(stderr, " done.\n"); > + return 0; > +} > diff --git a/doc/examples/hello-static-lib/tp.c b/doc/examples/hello-static-lib/tp.c > new file mode 100644 > index 0000000..4790965 > --- /dev/null > +++ b/doc/examples/hello-static-lib/tp.c > @@ -0,0 +1,26 @@ > +/* > + * tp.c > + * > + * Copyright (c) 2011 Mathieu Desnoyers > + * > + * Permission is hereby granted, free of charge, to any person obtaining a copy > + * of this software and associated documentation files (the "Software"), to deal > + * in the Software without restriction, including without limitation the rights > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > + * copies of the Software, and to permit persons to whom the Software is > + * furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice shall be included in > + * all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > + * SOFTWARE. > + */ > + > +#define TRACEPOINT_CREATE_PROBES > +#include "ust_tests_hello.h" > diff --git a/doc/examples/hello-static-lib/ust_tests_hello.h b/doc/examples/hello-static-lib/ust_tests_hello.h > new file mode 100644 > index 0000000..35ea5f5 > --- /dev/null > +++ b/doc/examples/hello-static-lib/ust_tests_hello.h > @@ -0,0 +1,72 @@ > +#undef TRACEPOINT_PROVIDER > +#define TRACEPOINT_PROVIDER ust_tests_hello > + > +#if !defined(_TRACEPOINT_UST_TESTS_HELLO_H) || defined(TRACEPOINT_HEADER_MULTI_READ) > +#define _TRACEPOINT_UST_TESTS_HELLO_H > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +/* > + * Copyright (C) 2011 Mathieu Desnoyers > + * > + * Permission is hereby granted, free of charge, to any person obtaining a copy > + * of this software and associated documentation files (the "Software"), to deal > + * in the Software without restriction, including without limitation the rights > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > + * copies of the Software, and to permit persons to whom the Software is > + * furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice shall be included in > + * all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > + * SOFTWARE. > + */ > + > +#include > + > +TRACEPOINT_EVENT(ust_tests_hello, tptest, > + TP_ARGS(int, anint, int, netint, long *, values, > + char *, text, size_t, textlen, > + double, doublearg, float, floatarg), > + TP_FIELDS( > + ctf_integer(int, intfield, anint) > + ctf_integer_hex(int, intfield2, anint) > + ctf_integer(long, longfield, anint) > + ctf_integer_network(int, netintfield, netint) > + ctf_integer_network_hex(int, netintfieldhex, netint) > + ctf_array(long, arrfield1, values, 3) > + ctf_array_text(char, arrfield2, text, 10) > + ctf_sequence(char, seqfield1, text, > + size_t, textlen) > + ctf_sequence_text(char, seqfield2, text, > + size_t, textlen) > + ctf_string(stringfield, text) > + ctf_float(float, floatfield, floatarg) > + ctf_float(double, doublefield, doublearg) > + ) > +) > + > +TRACEPOINT_EVENT(ust_tests_hello, tptest_sighandler, > + TP_ARGS(), > + TP_FIELDS() > +) > + > +#endif /* _TRACEPOINT_UST_TESTS_HELLO_H */ > + > +#undef TRACEPOINT_INCLUDE > +#define TRACEPOINT_INCLUDE "./ust_tests_hello.h" > + > +/* This part must be outside ifdef protection */ > +#include > + > +#ifdef __cplusplus > +} > +#endif > diff --git a/doc/man/lttng-ust.3 b/doc/man/lttng-ust.3 > index 5be3cfa..f4ec56f 100644 > --- a/doc/man/lttng-ust.3 > +++ b/doc/man/lttng-ust.3 > @@ -40,11 +40,11 @@ focus on the various types that can be recorded into a trace event: > TRACEPOINT_EVENT( > /* > * provider name, not a variable but a string starting with a > - * letter and containing either letters, numbers or underscores. > + * letter and containing either letters, numbers or underscores. > * Needs to be the same as TRACEPOINT_PROVIDER. Needs to > * follow the namespacing guide-lines in lttng/tracepoint.h: > - * > - * Must be included before include tracepoint provider > + * > + * Must be included before include tracepoint provider > * ex.: project_event > * ex.: project_component_event > * > @@ -59,19 +59,19 @@ TRACEPOINT_EVENT( > /* > * tracepoint name, same format as sample provider. Does not > * need to be declared before. in this case the name is > - * "message" > + * "message" > */ > message, > > /* > - * TP_ARGS macro contains the arguments passed for the tracepoint > + * TP_ARGS macro contains the arguments passed for the tracepoint > * it is in the following format > * TP_ARGS(type1, name1, type2, name2, ... type10, > name10) > - * where there can be from zero to ten elements. > - * typeN is the datatype, such as int, struct or double **. > + * where there can be from zero to ten elements. > + * typeN is the datatype, such as int, struct or double **. > * name is the variable name (in "int myInt" the name would be > - * myint) > + * myint) > * TP_ARGS() is valid to mean no arguments > * TP_ARGS(void) is valid too > */ > @@ -80,7 +80,7 @@ TRACEPOINT_EVENT( > double, doublearg, float, floatarg), > > /* > - * TP_FIELDS describes how to write the fields of the trace event. > + * TP_FIELDS describes how to write the fields of the trace event. > * You can put expressions in the "argument expression" area, > * typically using the input arguments from TP_ARGS. > */ > @@ -109,14 +109,14 @@ TRACEPOINT_EVENT( > /* > * ctf_array: a statically-sized array. > * args: (type, field name, argument expression, value) > - */ > + */ > ctf_array(long, arrfield1, values, 3) > > /* > * ctf_array_text: a statically-sized array, printed as > * a string. No need to be terminated by a null > * character. > - */ > + */ > ctf_array_text(char, arrfield2, text, 10) > > /* > @@ -127,7 +127,7 @@ TRACEPOINT_EVENT( > * unsigned type. As a reminder, "unsigned char" should > * be preferred to "char", since the signedness of > * "char" is implementation-defined. > - */ > + */ > ctf_sequence(char, seqfield1, text, > size_t, textlen) > > @@ -172,54 +172,54 @@ declared before declaring a TRACEPOINT_LOGLEVEL. > > The loglevels go from 0 to 14. Higher numbers imply the most verbosity > (higher event throughput expected. > - > + > Loglevels 0 through 6, and loglevel 14, match syslog(3) loglevels > semantic. Loglevels 7 through 13 offer more fine-grained selection of > debug information. > - > + > TRACE_EMERG 0 > system is unusable > - > + > TRACE_ALERT 1 > action must be taken immediately > - > + > TRACE_CRIT 2 > critical conditions > - > + > TRACE_ERR 3 > error conditions > - > + > TRACE_WARNING 4 > warning conditions > - > + > TRACE_NOTICE 5 > normal, but significant, condition > - > + > TRACE_INFO 6 > informational message > - > + > TRACE_DEBUG_SYSTEM 7 > debug information with system-level scope (set of programs) > - > + > TRACE_DEBUG_PROGRAM 8 > debug information with program-level scope (set of processes) > - > + > TRACE_DEBUG_PROCESS 9 > debug information with process-level scope (set of modules) > - > + > TRACE_DEBUG_MODULE 10 > debug information with module (executable/library) scope (set of > units) > - > + > TRACE_DEBUG_UNIT 11 > debug information with compilation unit scope (set of functions) > - > + > TRACE_DEBUG_FUNCTION 12 > debug information with function-level scope > - > + > TRACE_DEBUG_LINE 13 > debug information with line-level scope (TRACEPOINT_EVENT default) > - > + > TRACE_DEBUG 14 > debug-level message (trace_printf default) > > @@ -268,8 +268,10 @@ carefully: > library with "\-llttng-ust". > - Include the tracepoint provider header into all C files using > the provider. > - - Example: > - - tests/hello/ hello.c tp.c ust_tests_hello.h Makefile.example > + - Examples: > + - doc/examples/easy-ust/ sample.c sample_component_provider.h tp.c > + Makefile > + - doc/examples/hello-static-lib/ hello.c tp.c ust_test_hello.h Makefile > > 2) Compile the Tracepoint Provider separately from the application, > using dynamic linking: > @@ -287,7 +289,7 @@ carefully: > needed. Another way is to dlopen the tracepoint probe when needed > by the application. > - Example: > - - doc/examples/demo demo.c tp*.c ust_tests_demo*.h demo-trace > + - doc/examples/demo demo.c tp*.c ust_tests_demo*.h demo-trace Makefile > > - Note about dlclose() usage: it is not safe to use dlclose on a > provider shared object that is being actively used for tracing due > diff --git a/tests/Makefile.am b/tests/Makefile.am > index 425440a..317edcb 100644 > --- a/tests/Makefile.am > +++ b/tests/Makefile.am > @@ -1,4 +1,4 @@ > -SUBDIRS = . hello hello-static-lib same_line_tracepoint snprintf > +SUBDIRS = . hello same_line_tracepoint snprintf > > if CXX_WORKS > SUBDIRS += hello.cxx > diff --git a/tests/demo/README b/tests/demo/README > index 89e5889..674bd3a 100644 > --- a/tests/demo/README > +++ b/tests/demo/README > @@ -1,5 +1 @@ > -"demo" and "demo-trace" are moved to lttng-tools, under: > - > - tests/regression/ust/linking/ > - > -The "demo-trace" script was renamed to "demo_preload". > +"demo" and "demo-trace" are moved to doc/examples/demo > diff --git a/tests/hello-static-lib/Makefile.am b/tests/hello-static-lib/Makefile.am > deleted file mode 100644 > index 699845b..0000000 > --- a/tests/hello-static-lib/Makefile.am > +++ /dev/null > @@ -1,18 +0,0 @@ > -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -Wsystem-headers > - > -noinst_LTLIBRARIES = liblttng-ust-provider-ust-test-hello.la > -liblttng_ust_provider_ust_test_hello_la_SOURCES = \ > - tp.c ust_tests_hello.h > -liblttng_ust_provider_ust_test_hello_la_LIBADD = \ > - $(top_builddir)/liblttng-ust/liblttng-ust.la > - > -noinst_PROGRAMS = hello > -hello_SOURCES = hello.c > -hello_LDADD = liblttng-ust-provider-ust-test-hello.la > - > -if LTTNG_UST_BUILD_WITH_LIBDL > -hello_LDADD += -ldl > -endif > -if LTTNG_UST_BUILD_WITH_LIBC_DL > -hello_LDADD += -lc > -endif > diff --git a/tests/hello-static-lib/README b/tests/hello-static-lib/README > deleted file mode 100644 > index abb056f..0000000 > --- a/tests/hello-static-lib/README > +++ /dev/null > @@ -1,3 +0,0 @@ > -This is a "hello world" application used to verify that an instrumented > -program can be built successfully and linked with tracepoint providers > -built as a separate static library. > diff --git a/tests/hello-static-lib/hello.c b/tests/hello-static-lib/hello.c > deleted file mode 100644 > index 584d3f7..0000000 > --- a/tests/hello-static-lib/hello.c > +++ /dev/null > @@ -1,95 +0,0 @@ > -/* > - * Copyright (C) 2009 Pierre-Marc Fournier > - * Copyright (C) 2011 Mathieu Desnoyers > - * > - * This library is free software; you can redistribute it and/or > - * modify it under the terms of the GNU Lesser General Public > - * License as published by the Free Software Foundation; version 2.1 of > - * the License. > - * > - * This library is distributed in the hope that it will be useful, > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > - * Lesser General Public License for more details. > - * > - * You should have received a copy of the GNU Lesser General Public > - * License along with this library; if not, write to the Free Software > - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA > - */ > - > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > -#define TRACEPOINT_DEFINE > -#include "ust_tests_hello.h" > - > -void inthandler(int sig) > -{ > - printf("in SIGUSR1 handler\n"); > - tracepoint(ust_tests_hello, tptest_sighandler); > -} > - > -int init_int_handler(void) > -{ > - int result; > - struct sigaction act; > - > - memset(&act, 0, sizeof(act)); > - result = sigemptyset(&act.sa_mask); > - if (result == -1) { > - perror("sigemptyset"); > - return -1; > - } > - > - act.sa_handler = inthandler; > - act.sa_flags = SA_RESTART; > - > - /* Only defer ourselves. Also, try to restart interrupted > - * syscalls to disturb the traced program as little as possible. > - */ > - result = sigaction(SIGUSR1, &act, NULL); > - if (result == -1) { > - perror("sigaction"); > - return -1; > - } > - > - return 0; > -} > - > -int main(int argc, char **argv) > -{ > - int i, netint; > - long values[] = { 1, 2, 3 }; > - char text[10] = "test"; > - double dbl = 2.0; > - float flt = 2222.0; > - int delay = 0; > - > - init_int_handler(); > - > - if (argc == 2) > - delay = atoi(argv[1]); > - > - fprintf(stderr, "Hello, World!\n"); > - > - sleep(delay); > - > - fprintf(stderr, "Tracing... "); > - for (i = 0; i < 1000000; i++) { > - netint = htonl(i); > - tracepoint(ust_tests_hello, tptest, i, netint, values, > - text, strlen(text), dbl, flt); > - //usleep(100000); > - } > - fprintf(stderr, " done.\n"); > - return 0; > -} > diff --git a/tests/hello-static-lib/tp.c b/tests/hello-static-lib/tp.c > deleted file mode 100644 > index 4790965..0000000 > --- a/tests/hello-static-lib/tp.c > +++ /dev/null > @@ -1,26 +0,0 @@ > -/* > - * tp.c > - * > - * Copyright (c) 2011 Mathieu Desnoyers > - * > - * Permission is hereby granted, free of charge, to any person obtaining a copy > - * of this software and associated documentation files (the "Software"), to deal > - * in the Software without restriction, including without limitation the rights > - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > - * copies of the Software, and to permit persons to whom the Software is > - * furnished to do so, subject to the following conditions: > - * > - * The above copyright notice and this permission notice shall be included in > - * all copies or substantial portions of the Software. > - * > - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > - * SOFTWARE. > - */ > - > -#define TRACEPOINT_CREATE_PROBES > -#include "ust_tests_hello.h" > diff --git a/tests/hello-static-lib/ust_tests_hello.h b/tests/hello-static-lib/ust_tests_hello.h > deleted file mode 100644 > index 35ea5f5..0000000 > --- a/tests/hello-static-lib/ust_tests_hello.h > +++ /dev/null > @@ -1,72 +0,0 @@ > -#undef TRACEPOINT_PROVIDER > -#define TRACEPOINT_PROVIDER ust_tests_hello > - > -#if !defined(_TRACEPOINT_UST_TESTS_HELLO_H) || defined(TRACEPOINT_HEADER_MULTI_READ) > -#define _TRACEPOINT_UST_TESTS_HELLO_H > - > -#ifdef __cplusplus > -extern "C" { > -#endif > - > -/* > - * Copyright (C) 2011 Mathieu Desnoyers > - * > - * Permission is hereby granted, free of charge, to any person obtaining a copy > - * of this software and associated documentation files (the "Software"), to deal > - * in the Software without restriction, including without limitation the rights > - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > - * copies of the Software, and to permit persons to whom the Software is > - * furnished to do so, subject to the following conditions: > - * > - * The above copyright notice and this permission notice shall be included in > - * all copies or substantial portions of the Software. > - * > - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > - * SOFTWARE. > - */ > - > -#include > - > -TRACEPOINT_EVENT(ust_tests_hello, tptest, > - TP_ARGS(int, anint, int, netint, long *, values, > - char *, text, size_t, textlen, > - double, doublearg, float, floatarg), > - TP_FIELDS( > - ctf_integer(int, intfield, anint) > - ctf_integer_hex(int, intfield2, anint) > - ctf_integer(long, longfield, anint) > - ctf_integer_network(int, netintfield, netint) > - ctf_integer_network_hex(int, netintfieldhex, netint) > - ctf_array(long, arrfield1, values, 3) > - ctf_array_text(char, arrfield2, text, 10) > - ctf_sequence(char, seqfield1, text, > - size_t, textlen) > - ctf_sequence_text(char, seqfield2, text, > - size_t, textlen) > - ctf_string(stringfield, text) > - ctf_float(float, floatfield, floatarg) > - ctf_float(double, doublefield, doublearg) > - ) > -) > - > -TRACEPOINT_EVENT(ust_tests_hello, tptest_sighandler, > - TP_ARGS(), > - TP_FIELDS() > -) > - > -#endif /* _TRACEPOINT_UST_TESTS_HELLO_H */ > - > -#undef TRACEPOINT_INCLUDE > -#define TRACEPOINT_INCLUDE "./ust_tests_hello.h" > - > -/* This part must be outside ifdef protection */ > -#include > - > -#ifdef __cplusplus > -} > -#endif > -- > 1.8.2.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 10 11:45:16 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 10 May 2013 11:45:16 -0400 Subject: [lttng-dev] kprobe timestamp In-Reply-To: <201304241357471345277@gmail.com> References: <5176D588.5010307@gmail.com> <201304241357471345277@gmail.com> Message-ID: <20130510154516.GA22512@Krystal> * OSDepend (osdepend at gmail.com) wrote: > > > > On 2013-04-23 12:50, OSDepend wrote: > > > Hi guys, > > > I just try to use kprobe, and get some thing like below: > > > > > > java 15893 [015] 96380.588871: timer_cancel: timer=0xffff8804379d6698 > > > java 15721 [010] 96380.588872: timer_cancel: timer=0xffff8800be3d6698 > > > java 15893 [015] 96380.588875: timer_expire_entry: timer=0xffff8804379d6698 function=delayed_work_timer_fn now=4391194790 > > > java 15721 [010] 96380.588876: timer_expire_entry: timer=0xffff8800be3d6698 function=delayed_work_timer_fn now=4391194790 > > > I want to know exactly about the time units of the events, such as > > > 96380.588871, and 96380.588872. > > > The number befor "." is second or millisecond? and Is the number > > > after "." nanoseconds or microseconds? > > > > > >What did you use to generate this output? I don't recognize it. > > > >Yannick > > /usr/src/linux-2.6.38.6/Documentation/trace/kprobetrace.txt > I use kprobe to trace, you can get the documentation of kprobe in the text above. > Does any one recognize the time format? I guess you are using ftrace or perf rather than LTTng. You might want to ask them instead. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Fri May 10 11:54:43 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 10 May 2013 11:54:43 -0400 Subject: [lttng-dev] [PATCH lttng-modules] Update ARM (32 bit) syscall tracepoints to 3.4 In-Reply-To: <1367252939-24274-1-git-send-email-jan.glauber@gmail.com> References: <1367252939-24274-1-git-send-email-jan.glauber@gmail.com> Message-ID: <20130510155443.GB22512@Krystal> merged into master branch, will be for the 2.3 release cycle. Thanks, Mathieu * Jan Glauber (jan.glauber at gmail.com) wrote: > Update from 2.6.38 to 3.4. Added syscalls: > sys_acct > sys_swapon > sys_swapoff > sys_quotactl > sys_perf_event_open > sys_fanotify_init > sys_name_to_handle_at > sys_open_by_handle_at > sys_clock_adjtime > sys_syncfs > sys_sendmmsg > sys_setns > sys_process_vm_readv > sys_process_vm_writev > > Signed-off-by: Jan Glauber > --- > .../syscalls/2.6.38/arm-32-syscalls-2.6.38 | 285 --- > .../syscalls/3.4.25/arm-32-syscalls-3.4.25 | 299 +++ > .../headers/arm-32-syscalls-2.6.38_integers.h | 1145 ---------- > .../arm-32-syscalls-2.6.38_integers_override.h | 52 - > .../headers/arm-32-syscalls-2.6.38_pointers.h | 2184 ------------------ > .../arm-32-syscalls-2.6.38_pointers_override.h | 39 - > .../headers/arm-32-syscalls-3.4.25_integers.h | 1181 ++++++++++ > .../arm-32-syscalls-3.4.25_integers_override.h | 52 + > .../headers/arm-32-syscalls-3.4.25_pointers.h | 2316 ++++++++++++++++++++ > .../arm-32-syscalls-3.4.25_pointers_override.h | 39 + > .../syscalls/headers/syscalls_integers.h | 2 +- > .../syscalls/headers/syscalls_pointers.h | 2 +- > 12 files changed, 3889 insertions(+), 3707 deletions(-) > delete mode 100644 instrumentation/syscalls/2.6.38/arm-32-syscalls-2.6.38 > create mode 100644 instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 > delete mode 100644 instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_integers.h > delete mode 100644 instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_integers_override.h > delete mode 100644 instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_pointers.h > delete mode 100644 instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_pointers_override.h > create mode 100644 instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers.h > create mode 100644 instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.h > create mode 100644 instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers.h > create mode 100644 instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.h > > diff --git a/instrumentation/syscalls/2.6.38/arm-32-syscalls-2.6.38 b/instrumentation/syscalls/2.6.38/arm-32-syscalls-2.6.38 > deleted file mode 100644 > index 89194e2..0000000 > --- a/instrumentation/syscalls/2.6.38/arm-32-syscalls-2.6.38 > +++ /dev/null > @@ -1,285 +0,0 @@ > -syscall sys_restart_syscall nr 0 nbargs 0 types: () args: () > -syscall sys_exit nr 1 nbargs 1 types: (int) args: (error_code) > -syscall sys_read nr 3 nbargs 3 types: (unsigned int, char *, size_t) args: (fd, buf, count) > -syscall sys_write nr 4 nbargs 3 types: (unsigned int, const char *, size_t) args: (fd, buf, count) > -syscall sys_open nr 5 nbargs 3 types: (const char *, int, int) args: (filename, flags, mode) > -syscall sys_close nr 6 nbargs 1 types: (unsigned int) args: (fd) > -syscall sys_creat nr 8 nbargs 2 types: (const char *, int) args: (pathname, mode) > -syscall sys_link nr 9 nbargs 2 types: (const char *, const char *) args: (oldname, newname) > -syscall sys_unlink nr 10 nbargs 1 types: (const char *) args: (pathname) > -syscall sys_chdir nr 12 nbargs 1 types: (const char *) args: (filename) > -syscall sys_mknod nr 14 nbargs 3 types: (const char *, int, unsigned) args: (filename, mode, dev) > -syscall sys_chmod nr 15 nbargs 2 types: (const char *, mode_t) args: (filename, mode) > -syscall sys_lchown16 nr 16 nbargs 3 types: (const char *, old_uid_t, old_gid_t) args: (filename, user, group) > -syscall sys_lseek nr 19 nbargs 3 types: (unsigned int, off_t, unsigned int) args: (fd, offset, origin) > -syscall sys_getpid nr 20 nbargs 0 types: () args: () > -syscall sys_mount nr 21 nbargs 5 types: (char *, char *, char *, unsigned long, void *) args: (dev_name, dir_name, type, flags, data) > -syscall sys_setuid16 nr 23 nbargs 1 types: (old_uid_t) args: (uid) > -syscall sys_getuid16 nr 24 nbargs 0 types: () args: () > -syscall sys_ptrace nr 26 nbargs 4 types: (long, long, unsigned long, unsigned long) args: (request, pid, addr, data) > -syscall sys_pause nr 29 nbargs 0 types: () args: () > -syscall sys_access nr 33 nbargs 2 types: (const char *, int) args: (filename, mode) > -syscall sys_nice nr 34 nbargs 1 types: (int) args: (increment) > -syscall sys_sync nr 36 nbargs 0 types: () args: () > -syscall sys_kill nr 37 nbargs 2 types: (pid_t, int) args: (pid, sig) > -syscall sys_rename nr 38 nbargs 2 types: (const char *, const char *) args: (oldname, newname) > -syscall sys_mkdir nr 39 nbargs 2 types: (const char *, int) args: (pathname, mode) > -syscall sys_rmdir nr 40 nbargs 1 types: (const char *) args: (pathname) > -syscall sys_dup nr 41 nbargs 1 types: (unsigned int) args: (fildes) > -syscall sys_pipe nr 42 nbargs 1 types: (int *) args: (fildes) > -syscall sys_times nr 43 nbargs 1 types: (struct tms *) args: (tbuf) > -syscall sys_brk nr 45 nbargs 1 types: (unsigned long) args: (brk) > -syscall sys_setgid16 nr 46 nbargs 1 types: (old_gid_t) args: (gid) > -syscall sys_getgid16 nr 47 nbargs 0 types: () args: () > -syscall sys_geteuid16 nr 49 nbargs 0 types: () args: () > -syscall sys_getegid16 nr 50 nbargs 0 types: () args: () > -syscall sys_umount nr 52 nbargs 2 types: (char *, int) args: (name, flags) > -syscall sys_ioctl nr 54 nbargs 3 types: (unsigned int, unsigned int, unsigned long) args: (fd, cmd, arg) > -syscall sys_fcntl nr 55 nbargs 3 types: (unsigned int, unsigned int, unsigned long) args: (fd, cmd, arg) > -syscall sys_setpgid nr 57 nbargs 2 types: (pid_t, pid_t) args: (pid, pgid) > -syscall sys_umask nr 60 nbargs 1 types: (int) args: (mask) > -syscall sys_chroot nr 61 nbargs 1 types: (const char *) args: (filename) > -syscall sys_ustat nr 62 nbargs 2 types: (unsigned, struct ustat *) args: (dev, ubuf) > -syscall sys_dup2 nr 63 nbargs 2 types: (unsigned int, unsigned int) args: (oldfd, newfd) > -syscall sys_getppid nr 64 nbargs 0 types: () args: () > -syscall sys_getpgrp nr 65 nbargs 0 types: () args: () > -syscall sys_setsid nr 66 nbargs 0 types: () args: () > -syscall sys_setreuid16 nr 70 nbargs 2 types: (old_uid_t, old_uid_t) args: (ruid, euid) > -syscall sys_setregid16 nr 71 nbargs 2 types: (old_gid_t, old_gid_t) args: (rgid, egid) > -syscall sys_sigpending nr 73 nbargs 1 types: (old_sigset_t *) args: (set) > -syscall sys_sethostname nr 74 nbargs 2 types: (char *, int) args: (name, len) > -syscall sys_setrlimit nr 75 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) > -syscall sys_getrusage nr 77 nbargs 2 types: (int, struct rusage *) args: (who, ru) > -syscall sys_gettimeofday nr 78 nbargs 2 types: (struct timeval *, struct timezone *) args: (tv, tz) > -syscall sys_settimeofday nr 79 nbargs 2 types: (struct timeval *, struct timezone *) args: (tv, tz) > -syscall sys_getgroups16 nr 80 nbargs 2 types: (int, old_gid_t *) args: (gidsetsize, grouplist) > -syscall sys_setgroups16 nr 81 nbargs 2 types: (int, old_gid_t *) args: (gidsetsize, grouplist) > -syscall sys_symlink nr 83 nbargs 2 types: (const char *, const char *) args: (oldname, newname) > -syscall sys_readlink nr 85 nbargs 3 types: (const char *, char *, int) args: (path, buf, bufsiz) > -syscall sys_uselib nr 86 nbargs 1 types: (const char *) args: (library) > -syscall sys_reboot nr 88 nbargs 4 types: (int, int, unsigned int, void *) args: (magic1, magic2, cmd, arg) > -syscall sys_munmap nr 91 nbargs 2 types: (unsigned long, size_t) args: (addr, len) > -syscall sys_truncate nr 92 nbargs 2 types: (const char *, long) args: (path, length) > -syscall sys_ftruncate nr 93 nbargs 2 types: (unsigned int, unsigned long) args: (fd, length) > -syscall sys_fchmod nr 94 nbargs 2 types: (unsigned int, mode_t) args: (fd, mode) > -syscall sys_fchown16 nr 95 nbargs 3 types: (unsigned int, old_uid_t, old_gid_t) args: (fd, user, group) > -syscall sys_getpriority nr 96 nbargs 2 types: (int, int) args: (which, who) > -syscall sys_setpriority nr 97 nbargs 3 types: (int, int, int) args: (which, who, niceval) > -syscall sys_statfs nr 99 nbargs 2 types: (const char *, struct statfs *) args: (pathname, buf) > -syscall sys_fstatfs nr 100 nbargs 2 types: (unsigned int, struct statfs *) args: (fd, buf) > -syscall sys_syslog nr 103 nbargs 3 types: (int, char *, int) args: (type, buf, len) > -syscall sys_setitimer nr 104 nbargs 3 types: (int, struct itimerval *, struct itimerval *) args: (which, value, ovalue) > -syscall sys_getitimer nr 105 nbargs 2 types: (int, struct itimerval *) args: (which, value) > -syscall sys_newstat nr 106 nbargs 2 types: (const char *, struct stat *) args: (filename, statbuf) > -syscall sys_newlstat nr 107 nbargs 2 types: (const char *, struct stat *) args: (filename, statbuf) > -syscall sys_newfstat nr 108 nbargs 2 types: (unsigned int, struct stat *) args: (fd, statbuf) > -syscall sys_vhangup nr 111 nbargs 0 types: () args: () > -syscall sys_wait4 nr 114 nbargs 4 types: (pid_t, int *, int, struct rusage *) args: (upid, stat_addr, options, ru) > -syscall sys_sysinfo nr 116 nbargs 1 types: (struct sysinfo *) args: (info) > -syscall sys_fsync nr 118 nbargs 1 types: (unsigned int) args: (fd) > -syscall sys_setdomainname nr 121 nbargs 2 types: (char *, int) args: (name, len) > -syscall sys_newuname nr 122 nbargs 1 types: (struct new_utsname *) args: (name) > -syscall sys_adjtimex nr 124 nbargs 1 types: (struct timex *) args: (txc_p) > -syscall sys_mprotect nr 125 nbargs 3 types: (unsigned long, size_t, unsigned long) args: (start, len, prot) > -syscall sys_sigprocmask nr 126 nbargs 3 types: (int, old_sigset_t *, old_sigset_t *) args: (how, set, oset) > -syscall sys_init_module nr 128 nbargs 3 types: (void *, unsigned long, const char *) args: (umod, len, uargs) > -syscall sys_delete_module nr 129 nbargs 2 types: (const char *, unsigned int) args: (name_user, flags) > -syscall sys_getpgid nr 132 nbargs 1 types: (pid_t) args: (pid) > -syscall sys_fchdir nr 133 nbargs 1 types: (unsigned int) args: (fd) > -syscall sys_bdflush nr 134 nbargs 2 types: (int, long) args: (func, data) > -syscall sys_sysfs nr 135 nbargs 3 types: (int, unsigned long, unsigned long) args: (option, arg1, arg2) > -syscall sys_personality nr 136 nbargs 1 types: (unsigned int) args: (personality) > -syscall sys_setfsuid16 nr 138 nbargs 1 types: (old_uid_t) args: (uid) > -syscall sys_setfsgid16 nr 139 nbargs 1 types: (old_gid_t) args: (gid) > -syscall sys_llseek nr 140 nbargs 5 types: (unsigned int, unsigned long, unsigned long, loff_t *, unsigned int) args: (fd, offset_high, offset_low, result, origin) > -syscall sys_getdents nr 141 nbargs 3 types: (unsigned int, struct linux_dirent *, unsigned int) args: (fd, dirent, count) > -syscall sys_select nr 142 nbargs 5 types: (int, fd_set *, fd_set *, fd_set *, struct timeval *) args: (n, inp, outp, exp, tvp) > -syscall sys_flock nr 143 nbargs 2 types: (unsigned int, unsigned int) args: (fd, cmd) > -syscall sys_msync nr 144 nbargs 3 types: (unsigned long, size_t, int) args: (start, len, flags) > -syscall sys_readv nr 145 nbargs 3 types: (unsigned long, const struct iovec *, unsigned long) args: (fd, vec, vlen) > -syscall sys_writev nr 146 nbargs 3 types: (unsigned long, const struct iovec *, unsigned long) args: (fd, vec, vlen) > -syscall sys_getsid nr 147 nbargs 1 types: (pid_t) args: (pid) > -syscall sys_fdatasync nr 148 nbargs 1 types: (unsigned int) args: (fd) > -syscall sys_sysctl nr 149 nbargs 1 types: (struct __sysctl_args *) args: (args) > -syscall sys_mlock nr 150 nbargs 2 types: (unsigned long, size_t) args: (start, len) > -syscall sys_munlock nr 151 nbargs 2 types: (unsigned long, size_t) args: (start, len) > -syscall sys_mlockall nr 152 nbargs 1 types: (int) args: (flags) > -syscall sys_munlockall nr 153 nbargs 0 types: () args: () > -syscall sys_sched_setparam nr 154 nbargs 2 types: (pid_t, struct sched_param *) args: (pid, param) > -syscall sys_sched_getparam nr 155 nbargs 2 types: (pid_t, struct sched_param *) args: (pid, param) > -syscall sys_sched_setscheduler nr 156 nbargs 3 types: (pid_t, int, struct sched_param *) args: (pid, policy, param) > -syscall sys_sched_getscheduler nr 157 nbargs 1 types: (pid_t) args: (pid) > -syscall sys_sched_yield nr 158 nbargs 0 types: () args: () > -syscall sys_sched_get_priority_max nr 159 nbargs 1 types: (int) args: (policy) > -syscall sys_sched_get_priority_min nr 160 nbargs 1 types: (int) args: (policy) > -syscall sys_sched_rr_get_interval nr 161 nbargs 2 types: (pid_t, struct timespec *) args: (pid, interval) > -syscall sys_nanosleep nr 162 nbargs 2 types: (struct timespec *, struct timespec *) args: (rqtp, rmtp) > -syscall sys_mremap nr 163 nbargs 5 types: (unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) args: (addr, old_len, new_len, flags, new_addr) > -syscall sys_setresuid16 nr 164 nbargs 3 types: (old_uid_t, old_uid_t, old_uid_t) args: (ruid, euid, suid) > -syscall sys_getresuid16 nr 165 nbargs 3 types: (old_uid_t *, old_uid_t *, old_uid_t *) args: (ruid, euid, suid) > -syscall sys_poll nr 168 nbargs 3 types: (struct pollfd *, unsigned int, long) args: (ufds, nfds, timeout_msecs) > -syscall sys_setresgid16 nr 170 nbargs 3 types: (old_gid_t, old_gid_t, old_gid_t) args: (rgid, egid, sgid) > -syscall sys_getresgid16 nr 171 nbargs 3 types: (old_gid_t *, old_gid_t *, old_gid_t *) args: (rgid, egid, sgid) > -syscall sys_prctl nr 172 nbargs 5 types: (int, unsigned long, unsigned long, unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5) > -syscall sys_rt_sigaction nr 174 nbargs 4 types: (int, const struct sigaction *, struct sigaction *, size_t) args: (sig, act, oact, sigsetsize) > -syscall sys_rt_sigprocmask nr 175 nbargs 4 types: (int, sigset_t *, sigset_t *, size_t) args: (how, set, oset, sigsetsize) > -syscall sys_rt_sigpending nr 176 nbargs 2 types: (sigset_t *, size_t) args: (set, sigsetsize) > -syscall sys_rt_sigtimedwait nr 177 nbargs 4 types: (const sigset_t *, siginfo_t *, const struct timespec *, size_t) args: (uthese, uinfo, uts, sigsetsize) > -syscall sys_rt_sigqueueinfo nr 178 nbargs 3 types: (pid_t, int, siginfo_t *) args: (pid, sig, uinfo) > -syscall sys_rt_sigsuspend nr 179 nbargs 2 types: (sigset_t *, size_t) args: (unewset, sigsetsize) > -syscall sys_chown16 nr 182 nbargs 3 types: (const char *, old_uid_t, old_gid_t) args: (filename, user, group) > -syscall sys_getcwd nr 183 nbargs 2 types: (char *, unsigned long) args: (buf, size) > -syscall sys_capget nr 184 nbargs 2 types: (cap_user_header_t, cap_user_data_t) args: (header, dataptr) > -syscall sys_capset nr 185 nbargs 2 types: (cap_user_header_t, const cap_user_data_t) args: (header, data) > -syscall sys_sendfile nr 187 nbargs 4 types: (int, int, off_t *, size_t) args: (out_fd, in_fd, offset, count) > -syscall sys_getrlimit nr 191 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) > -syscall sys_stat64 nr 195 nbargs 2 types: (const char *, struct stat64 *) args: (filename, statbuf) > -syscall sys_lstat64 nr 196 nbargs 2 types: (const char *, struct stat64 *) args: (filename, statbuf) > -syscall sys_fstat64 nr 197 nbargs 2 types: (unsigned long, struct stat64 *) args: (fd, statbuf) > -syscall sys_lchown nr 198 nbargs 3 types: (const char *, uid_t, gid_t) args: (filename, user, group) > -syscall sys_getuid nr 199 nbargs 0 types: () args: () > -syscall sys_getgid nr 200 nbargs 0 types: () args: () > -syscall sys_geteuid nr 201 nbargs 0 types: () args: () > -syscall sys_getegid nr 202 nbargs 0 types: () args: () > -syscall sys_setreuid nr 203 nbargs 2 types: (uid_t, uid_t) args: (ruid, euid) > -syscall sys_setregid nr 204 nbargs 2 types: (gid_t, gid_t) args: (rgid, egid) > -syscall sys_getgroups nr 205 nbargs 2 types: (int, gid_t *) args: (gidsetsize, grouplist) > -syscall sys_setgroups nr 206 nbargs 2 types: (int, gid_t *) args: (gidsetsize, grouplist) > -syscall sys_fchown nr 207 nbargs 3 types: (unsigned int, uid_t, gid_t) args: (fd, user, group) > -syscall sys_setresuid nr 208 nbargs 3 types: (uid_t, uid_t, uid_t) args: (ruid, euid, suid) > -syscall sys_getresuid nr 209 nbargs 3 types: (uid_t *, uid_t *, uid_t *) args: (ruid, euid, suid) > -syscall sys_setresgid nr 210 nbargs 3 types: (gid_t, gid_t, gid_t) args: (rgid, egid, sgid) > -syscall sys_getresgid nr 211 nbargs 3 types: (gid_t *, gid_t *, gid_t *) args: (rgid, egid, sgid) > -syscall sys_chown nr 212 nbargs 3 types: (const char *, uid_t, gid_t) args: (filename, user, group) > -syscall sys_setuid nr 213 nbargs 1 types: (uid_t) args: (uid) > -syscall sys_setgid nr 214 nbargs 1 types: (gid_t) args: (gid) > -syscall sys_setfsuid nr 215 nbargs 1 types: (uid_t) args: (uid) > -syscall sys_setfsgid nr 216 nbargs 1 types: (gid_t) args: (gid) > -syscall sys_getdents64 nr 217 nbargs 3 types: (unsigned int, struct linux_dirent64 *, unsigned int) args: (fd, dirent, count) > -syscall sys_pivot_root nr 218 nbargs 2 types: (const char *, const char *) args: (new_root, put_old) > -syscall sys_mincore nr 219 nbargs 3 types: (unsigned long, size_t, unsigned char *) args: (start, len, vec) > -syscall sys_madvise nr 220 nbargs 3 types: (unsigned long, size_t, int) args: (start, len_in, behavior) > -syscall sys_fcntl64 nr 221 nbargs 3 types: (unsigned int, unsigned int, unsigned long) args: (fd, cmd, arg) > -syscall sys_gettid nr 224 nbargs 0 types: () args: () > -syscall sys_setxattr nr 226 nbargs 5 types: (const char *, const char *, const void *, size_t, int) args: (pathname, name, value, size, flags) > -syscall sys_lsetxattr nr 227 nbargs 5 types: (const char *, const char *, const void *, size_t, int) args: (pathname, name, value, size, flags) > -syscall sys_fsetxattr nr 228 nbargs 5 types: (int, const char *, const void *, size_t, int) args: (fd, name, value, size, flags) > -syscall sys_getxattr nr 229 nbargs 4 types: (const char *, const char *, void *, size_t) args: (pathname, name, value, size) > -syscall sys_lgetxattr nr 230 nbargs 4 types: (const char *, const char *, void *, size_t) args: (pathname, name, value, size) > -syscall sys_fgetxattr nr 231 nbargs 4 types: (int, const char *, void *, size_t) args: (fd, name, value, size) > -syscall sys_listxattr nr 232 nbargs 3 types: (const char *, char *, size_t) args: (pathname, list, size) > -syscall sys_llistxattr nr 233 nbargs 3 types: (const char *, char *, size_t) args: (pathname, list, size) > -syscall sys_flistxattr nr 234 nbargs 3 types: (int, char *, size_t) args: (fd, list, size) > -syscall sys_removexattr nr 235 nbargs 2 types: (const char *, const char *) args: (pathname, name) > -syscall sys_lremovexattr nr 236 nbargs 2 types: (const char *, const char *) args: (pathname, name) > -syscall sys_fremovexattr nr 237 nbargs 2 types: (int, const char *) args: (fd, name) > -syscall sys_tkill nr 238 nbargs 2 types: (pid_t, int) args: (pid, sig) > -syscall sys_sendfile64 nr 239 nbargs 4 types: (int, int, loff_t *, size_t) args: (out_fd, in_fd, offset, count) > -syscall sys_futex nr 240 nbargs 6 types: (u32 *, int, u32, struct timespec *, u32 *, u32) args: (uaddr, op, val, utime, uaddr2, val3) > -syscall sys_sched_setaffinity nr 241 nbargs 3 types: (pid_t, unsigned int, unsigned long *) args: (pid, len, user_mask_ptr) > -syscall sys_sched_getaffinity nr 242 nbargs 3 types: (pid_t, unsigned int, unsigned long *) args: (pid, len, user_mask_ptr) > -syscall sys_io_setup nr 243 nbargs 2 types: (unsigned, aio_context_t *) args: (nr_events, ctxp) > -syscall sys_io_destroy nr 244 nbargs 1 types: (aio_context_t) args: (ctx) > -syscall sys_io_getevents nr 245 nbargs 5 types: (aio_context_t, long, long, struct io_event *, struct timespec *) args: (ctx_id, min_nr, nr, events, timeout) > -syscall sys_io_submit nr 246 nbargs 3 types: (aio_context_t, long, struct iocb * *) args: (ctx_id, nr, iocbpp) > -syscall sys_io_cancel nr 247 nbargs 3 types: (aio_context_t, struct iocb *, struct io_event *) args: (ctx_id, iocb, result) > -syscall sys_exit_group nr 248 nbargs 1 types: (int) args: (error_code) > -syscall sys_epoll_create nr 250 nbargs 1 types: (int) args: (size) > -syscall sys_epoll_ctl nr 251 nbargs 4 types: (int, int, int, struct epoll_event *) args: (epfd, op, fd, event) > -syscall sys_epoll_wait nr 252 nbargs 4 types: (int, struct epoll_event *, int, int) args: (epfd, events, maxevents, timeout) > -syscall sys_remap_file_pages nr 253 nbargs 5 types: (unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) args: (start, size, prot, pgoff, flags) > -syscall sys_set_tid_address nr 256 nbargs 1 types: (int *) args: (tidptr) > -syscall sys_timer_create nr 257 nbargs 3 types: (const clockid_t, struct sigevent *, timer_t *) args: (which_clock, timer_event_spec, created_timer_id) > -syscall sys_timer_settime nr 258 nbargs 4 types: (timer_t, int, const struct itimerspec *, struct itimerspec *) args: (timer_id, flags, new_setting, old_setting) > -syscall sys_timer_gettime nr 259 nbargs 2 types: (timer_t, struct itimerspec *) args: (timer_id, setting) > -syscall sys_timer_getoverrun nr 260 nbargs 1 types: (timer_t) args: (timer_id) > -syscall sys_timer_delete nr 261 nbargs 1 types: (timer_t) args: (timer_id) > -syscall sys_clock_settime nr 262 nbargs 2 types: (const clockid_t, const struct timespec *) args: (which_clock, tp) > -syscall sys_clock_gettime nr 263 nbargs 2 types: (const clockid_t, struct timespec *) args: (which_clock, tp) > -syscall sys_clock_getres nr 264 nbargs 2 types: (const clockid_t, struct timespec *) args: (which_clock, tp) > -syscall sys_clock_nanosleep nr 265 nbargs 4 types: (const clockid_t, int, const struct timespec *, struct timespec *) args: (which_clock, flags, rqtp, rmtp) > -syscall sys_tgkill nr 268 nbargs 3 types: (pid_t, pid_t, int) args: (tgid, pid, sig) > -syscall sys_utimes nr 269 nbargs 2 types: (char *, struct timeval *) args: (filename, utimes) > -syscall sys_mq_open nr 274 nbargs 4 types: (const char *, int, mode_t, struct mq_attr *) args: (u_name, oflag, mode, u_attr) > -syscall sys_mq_unlink nr 275 nbargs 1 types: (const char *) args: (u_name) > -syscall sys_mq_timedsend nr 276 nbargs 5 types: (mqd_t, const char *, size_t, unsigned int, const struct timespec *) args: (mqdes, u_msg_ptr, msg_len, msg_prio, u_abs_timeout) > -syscall sys_mq_timedreceive nr 277 nbargs 5 types: (mqd_t, char *, size_t, unsigned int *, const struct timespec *) args: (mqdes, u_msg_ptr, msg_len, u_msg_prio, u_abs_timeout) > -syscall sys_mq_notify nr 278 nbargs 2 types: (mqd_t, const struct sigevent *) args: (mqdes, u_notification) > -syscall sys_mq_getsetattr nr 279 nbargs 3 types: (mqd_t, const struct mq_attr *, struct mq_attr *) args: (mqdes, u_mqstat, u_omqstat) > -syscall sys_waitid nr 280 nbargs 5 types: (int, pid_t, struct siginfo *, int, struct rusage *) args: (which, upid, infop, options, ru) > -syscall sys_socket nr 281 nbargs 3 types: (int, int, int) args: (family, type, protocol) > -syscall sys_bind nr 282 nbargs 3 types: (int, struct sockaddr *, int) args: (fd, umyaddr, addrlen) > -syscall sys_connect nr 283 nbargs 3 types: (int, struct sockaddr *, int) args: (fd, uservaddr, addrlen) > -syscall sys_listen nr 284 nbargs 2 types: (int, int) args: (fd, backlog) > -syscall sys_accept nr 285 nbargs 3 types: (int, struct sockaddr *, int *) args: (fd, upeer_sockaddr, upeer_addrlen) > -syscall sys_getsockname nr 286 nbargs 3 types: (int, struct sockaddr *, int *) args: (fd, usockaddr, usockaddr_len) > -syscall sys_getpeername nr 287 nbargs 3 types: (int, struct sockaddr *, int *) args: (fd, usockaddr, usockaddr_len) > -syscall sys_socketpair nr 288 nbargs 4 types: (int, int, int, int *) args: (family, type, protocol, usockvec) > -syscall sys_send nr 289 nbargs 4 types: (int, void *, size_t, unsigned) args: (fd, buff, len, flags) > -syscall sys_sendto nr 290 nbargs 6 types: (int, void *, size_t, unsigned, struct sockaddr *, int) args: (fd, buff, len, flags, addr, addr_len) > -syscall sys_recvfrom nr 292 nbargs 6 types: (int, void *, size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr, addr_len) > -syscall sys_shutdown nr 293 nbargs 2 types: (int, int) args: (fd, how) > -syscall sys_setsockopt nr 294 nbargs 5 types: (int, int, int, char *, int) args: (fd, level, optname, optval, optlen) > -syscall sys_getsockopt nr 295 nbargs 5 types: (int, int, int, char *, int *) args: (fd, level, optname, optval, optlen) > -syscall sys_sendmsg nr 296 nbargs 3 types: (int, struct msghdr *, unsigned) args: (fd, msg, flags) > -syscall sys_recvmsg nr 297 nbargs 3 types: (int, struct msghdr *, unsigned int) args: (fd, msg, flags) > -syscall sys_semop nr 298 nbargs 3 types: (int, struct sembuf *, unsigned) args: (semid, tsops, nsops) > -syscall sys_semget nr 299 nbargs 3 types: (key_t, int, int) args: (key, nsems, semflg) > -syscall sys_msgsnd nr 301 nbargs 4 types: (int, struct msgbuf *, size_t, int) args: (msqid, msgp, msgsz, msgflg) > -syscall sys_msgrcv nr 302 nbargs 5 types: (int, struct msgbuf *, size_t, long, int) args: (msqid, msgp, msgsz, msgtyp, msgflg) > -syscall sys_msgget nr 303 nbargs 2 types: (key_t, int) args: (key, msgflg) > -syscall sys_msgctl nr 304 nbargs 3 types: (int, int, struct msqid_ds *) args: (msqid, cmd, buf) > -syscall sys_shmat nr 305 nbargs 3 types: (int, char *, int) args: (shmid, shmaddr, shmflg) > -syscall sys_shmdt nr 306 nbargs 1 types: (char *) args: (shmaddr) > -syscall sys_shmget nr 307 nbargs 3 types: (key_t, size_t, int) args: (key, size, shmflg) > -syscall sys_shmctl nr 308 nbargs 3 types: (int, int, struct shmid_ds *) args: (shmid, cmd, buf) > -syscall sys_add_key nr 309 nbargs 5 types: (const char *, const char *, const void *, size_t, key_serial_t) args: (_type, _description, _payload, plen, ringid) > -syscall sys_request_key nr 310 nbargs 4 types: (const char *, const char *, const char *, key_serial_t) args: (_type, _description, _callout_info, destringid) > -syscall sys_keyctl nr 311 nbargs 5 types: (int, unsigned long, unsigned long, unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5) > -syscall sys_semtimedop nr 312 nbargs 4 types: (int, struct sembuf *, unsigned, const struct timespec *) args: (semid, tsops, nsops, timeout) > -syscall sys_ioprio_set nr 314 nbargs 3 types: (int, int, int) args: (which, who, ioprio) > -syscall sys_ioprio_get nr 315 nbargs 2 types: (int, int) args: (which, who) > -syscall sys_inotify_init nr 316 nbargs 0 types: () args: () > -syscall sys_inotify_add_watch nr 317 nbargs 3 types: (int, const char *, u32) args: (fd, pathname, mask) > -syscall sys_inotify_rm_watch nr 318 nbargs 2 types: (int, __s32) args: (fd, wd) > -syscall sys_openat nr 322 nbargs 4 types: (int, const char *, int, int) args: (dfd, filename, flags, mode) > -syscall sys_mkdirat nr 323 nbargs 3 types: (int, const char *, int) args: (dfd, pathname, mode) > -syscall sys_mknodat nr 324 nbargs 4 types: (int, const char *, int, unsigned) args: (dfd, filename, mode, dev) > -syscall sys_fchownat nr 325 nbargs 5 types: (int, const char *, uid_t, gid_t, int) args: (dfd, filename, user, group, flag) > -syscall sys_futimesat nr 326 nbargs 3 types: (int, const char *, struct timeval *) args: (dfd, filename, utimes) > -syscall sys_fstatat64 nr 327 nbargs 4 types: (int, const char *, struct stat64 *, int) args: (dfd, filename, statbuf, flag) > -syscall sys_unlinkat nr 328 nbargs 3 types: (int, const char *, int) args: (dfd, pathname, flag) > -syscall sys_renameat nr 329 nbargs 4 types: (int, const char *, int, const char *) args: (olddfd, oldname, newdfd, newname) > -syscall sys_linkat nr 330 nbargs 5 types: (int, const char *, int, const char *, int) args: (olddfd, oldname, newdfd, newname, flags) > -syscall sys_symlinkat nr 331 nbargs 3 types: (const char *, int, const char *) args: (oldname, newdfd, newname) > -syscall sys_readlinkat nr 332 nbargs 4 types: (int, const char *, char *, int) args: (dfd, pathname, buf, bufsiz) > -syscall sys_fchmodat nr 333 nbargs 3 types: (int, const char *, mode_t) args: (dfd, filename, mode) > -syscall sys_faccessat nr 334 nbargs 3 types: (int, const char *, int) args: (dfd, filename, mode) > -syscall sys_pselect6 nr 335 nbargs 6 types: (int, fd_set *, fd_set *, fd_set *, struct timespec *, void *) args: (n, inp, outp, exp, tsp, sig) > -syscall sys_ppoll nr 336 nbargs 5 types: (struct pollfd *, unsigned int, struct timespec *, const sigset_t *, size_t) args: (ufds, nfds, tsp, sigmask, sigsetsize) > -syscall sys_unshare nr 337 nbargs 1 types: (unsigned long) args: (unshare_flags) > -syscall sys_set_robust_list nr 338 nbargs 2 types: (struct robust_list_head *, size_t) args: (head, len) > -syscall sys_get_robust_list nr 339 nbargs 3 types: (int, struct robust_list_head * *, size_t *) args: (pid, head_ptr, len_ptr) > -syscall sys_splice nr 340 nbargs 6 types: (int, loff_t *, int, loff_t *, size_t, unsigned int) args: (fd_in, off_in, fd_out, off_out, len, flags) > -syscall sys_tee nr 342 nbargs 4 types: (int, int, size_t, unsigned int) args: (fdin, fdout, len, flags) > -syscall sys_vmsplice nr 343 nbargs 4 types: (int, const struct iovec *, unsigned long, unsigned int) args: (fd, iov, nr_segs, flags) > -syscall sys_getcpu nr 345 nbargs 3 types: (unsigned *, unsigned *, struct getcpu_cache *) args: (cpup, nodep, unused) > -syscall sys_epoll_pwait nr 346 nbargs 6 types: (int, struct epoll_event *, int, int, const sigset_t *, size_t) args: (epfd, events, maxevents, timeout, sigmask, sigsetsize) > -syscall sys_utimensat nr 348 nbargs 4 types: (int, const char *, struct timespec *, int) args: (dfd, filename, utimes, flags) > -syscall sys_signalfd nr 349 nbargs 3 types: (int, sigset_t *, size_t) args: (ufd, user_mask, sizemask) > -syscall sys_timerfd_create nr 350 nbargs 2 types: (int, int) args: (clockid, flags) > -syscall sys_eventfd nr 351 nbargs 1 types: (unsigned int) args: (count) > -syscall sys_timerfd_settime nr 353 nbargs 4 types: (int, int, const struct itimerspec *, struct itimerspec *) args: (ufd, flags, utmr, otmr) > -syscall sys_timerfd_gettime nr 354 nbargs 2 types: (int, struct itimerspec *) args: (ufd, otmr) > -syscall sys_signalfd4 nr 355 nbargs 4 types: (int, sigset_t *, size_t, int) args: (ufd, user_mask, sizemask, flags) > -syscall sys_eventfd2 nr 356 nbargs 2 types: (unsigned int, int) args: (count, flags) > -syscall sys_epoll_create1 nr 357 nbargs 1 types: (int) args: (flags) > -syscall sys_dup3 nr 358 nbargs 3 types: (unsigned int, unsigned int, int) args: (oldfd, newfd, flags) > -syscall sys_pipe2 nr 359 nbargs 2 types: (int *, int) args: (fildes, flags) > -syscall sys_inotify_init1 nr 360 nbargs 1 types: (int) args: (flags) > -syscall sys_preadv nr 361 nbargs 5 types: (unsigned long, const struct iovec *, unsigned long, unsigned long, unsigned long) args: (fd, vec, vlen, pos_l, pos_h) > -syscall sys_pwritev nr 362 nbargs 5 types: (unsigned long, const struct iovec *, unsigned long, unsigned long, unsigned long) args: (fd, vec, vlen, pos_l, pos_h) > -syscall sys_rt_tgsigqueueinfo nr 363 nbargs 4 types: (pid_t, pid_t, int, siginfo_t *) args: (tgid, pid, sig, uinfo) > -syscall sys_recvmmsg nr 365 nbargs 5 types: (int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *) args: (fd, mmsg, vlen, flags, timeout) > -syscall sys_accept4 nr 366 nbargs 4 types: (int, struct sockaddr *, int *, int) args: (fd, upeer_sockaddr, upeer_addrlen, flags) > -syscall sys_prlimit64 nr 369 nbargs 4 types: (pid_t, unsigned int, const struct rlimit64 *, struct rlimit64 *) args: (pid, resource, new_rlim, old_rlim) > diff --git a/instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 b/instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 > new file mode 100644 > index 0000000..65c3973 > --- /dev/null > +++ b/instrumentation/syscalls/3.4.25/arm-32-syscalls-3.4.25 > @@ -0,0 +1,299 @@ > +syscall sys_restart_syscall nr 0 nbargs 0 types: () args: () > +syscall sys_exit nr 1 nbargs 1 types: (int) args: (error_code) > +syscall sys_read nr 3 nbargs 3 types: (unsigned int, char *, size_t) args: (fd, buf, count) > +syscall sys_write nr 4 nbargs 3 types: (unsigned int, const char *, size_t) args: (fd, buf, count) > +syscall sys_open nr 5 nbargs 3 types: (const char *, int, umode_t) args: (filename, flags, mode) > +syscall sys_close nr 6 nbargs 1 types: (unsigned int) args: (fd) > +syscall sys_creat nr 8 nbargs 2 types: (const char *, umode_t) args: (pathname, mode) > +syscall sys_link nr 9 nbargs 2 types: (const char *, const char *) args: (oldname, newname) > +syscall sys_unlink nr 10 nbargs 1 types: (const char *) args: (pathname) > +syscall sys_chdir nr 12 nbargs 1 types: (const char *) args: (filename) > +syscall sys_mknod nr 14 nbargs 3 types: (const char *, umode_t, unsigned) args: (filename, mode, dev) > +syscall sys_chmod nr 15 nbargs 2 types: (const char *, umode_t) args: (filename, mode) > +syscall sys_lchown16 nr 16 nbargs 3 types: (const char *, old_uid_t, old_gid_t) args: (filename, user, group) > +syscall sys_lseek nr 19 nbargs 3 types: (unsigned int, off_t, unsigned int) args: (fd, offset, origin) > +syscall sys_getpid nr 20 nbargs 0 types: () args: () > +syscall sys_mount nr 21 nbargs 5 types: (char *, char *, char *, unsigned long, void *) args: (dev_name, dir_name, type, flags, data) > +syscall sys_setuid16 nr 23 nbargs 1 types: (old_uid_t) args: (uid) > +syscall sys_getuid16 nr 24 nbargs 0 types: () args: () > +syscall sys_ptrace nr 26 nbargs 4 types: (long, long, unsigned long, unsigned long) args: (request, pid, addr, data) > +syscall sys_pause nr 29 nbargs 0 types: () args: () > +syscall sys_access nr 33 nbargs 2 types: (const char *, int) args: (filename, mode) > +syscall sys_nice nr 34 nbargs 1 types: (int) args: (increment) > +syscall sys_sync nr 36 nbargs 0 types: () args: () > +syscall sys_kill nr 37 nbargs 2 types: (pid_t, int) args: (pid, sig) > +syscall sys_rename nr 38 nbargs 2 types: (const char *, const char *) args: (oldname, newname) > +syscall sys_mkdir nr 39 nbargs 2 types: (const char *, umode_t) args: (pathname, mode) > +syscall sys_rmdir nr 40 nbargs 1 types: (const char *) args: (pathname) > +syscall sys_dup nr 41 nbargs 1 types: (unsigned int) args: (fildes) > +syscall sys_pipe nr 42 nbargs 1 types: (int *) args: (fildes) > +syscall sys_times nr 43 nbargs 1 types: (struct tms *) args: (tbuf) > +syscall sys_brk nr 45 nbargs 1 types: (unsigned long) args: (brk) > +syscall sys_setgid16 nr 46 nbargs 1 types: (old_gid_t) args: (gid) > +syscall sys_getgid16 nr 47 nbargs 0 types: () args: () > +syscall sys_geteuid16 nr 49 nbargs 0 types: () args: () > +syscall sys_getegid16 nr 50 nbargs 0 types: () args: () > +syscall sys_acct nr 51 nbargs 1 types: (const char *) args: (name) > +syscall sys_umount nr 52 nbargs 2 types: (char *, int) args: (name, flags) > +syscall sys_ioctl nr 54 nbargs 3 types: (unsigned int, unsigned int, unsigned long) args: (fd, cmd, arg) > +syscall sys_fcntl nr 55 nbargs 3 types: (unsigned int, unsigned int, unsigned long) args: (fd, cmd, arg) > +syscall sys_setpgid nr 57 nbargs 2 types: (pid_t, pid_t) args: (pid, pgid) > +syscall sys_umask nr 60 nbargs 1 types: (int) args: (mask) > +syscall sys_chroot nr 61 nbargs 1 types: (const char *) args: (filename) > +syscall sys_ustat nr 62 nbargs 2 types: (unsigned, struct ustat *) args: (dev, ubuf) > +syscall sys_dup2 nr 63 nbargs 2 types: (unsigned int, unsigned int) args: (oldfd, newfd) > +syscall sys_getppid nr 64 nbargs 0 types: () args: () > +syscall sys_getpgrp nr 65 nbargs 0 types: () args: () > +syscall sys_setsid nr 66 nbargs 0 types: () args: () > +syscall sys_setreuid16 nr 70 nbargs 2 types: (old_uid_t, old_uid_t) args: (ruid, euid) > +syscall sys_setregid16 nr 71 nbargs 2 types: (old_gid_t, old_gid_t) args: (rgid, egid) > +syscall sys_sigpending nr 73 nbargs 1 types: (old_sigset_t *) args: (set) > +syscall sys_sethostname nr 74 nbargs 2 types: (char *, int) args: (name, len) > +syscall sys_setrlimit nr 75 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) > +syscall sys_getrusage nr 77 nbargs 2 types: (int, struct rusage *) args: (who, ru) > +syscall sys_gettimeofday nr 78 nbargs 2 types: (struct timeval *, struct timezone *) args: (tv, tz) > +syscall sys_settimeofday nr 79 nbargs 2 types: (struct timeval *, struct timezone *) args: (tv, tz) > +syscall sys_getgroups16 nr 80 nbargs 2 types: (int, old_gid_t *) args: (gidsetsize, grouplist) > +syscall sys_setgroups16 nr 81 nbargs 2 types: (int, old_gid_t *) args: (gidsetsize, grouplist) > +syscall sys_symlink nr 83 nbargs 2 types: (const char *, const char *) args: (oldname, newname) > +syscall sys_readlink nr 85 nbargs 3 types: (const char *, char *, int) args: (path, buf, bufsiz) > +syscall sys_uselib nr 86 nbargs 1 types: (const char *) args: (library) > +syscall sys_swapon nr 87 nbargs 2 types: (const char *, int) args: (specialfile, swap_flags) > +syscall sys_reboot nr 88 nbargs 4 types: (int, int, unsigned int, void *) args: (magic1, magic2, cmd, arg) > +syscall sys_munmap nr 91 nbargs 2 types: (unsigned long, size_t) args: (addr, len) > +syscall sys_truncate nr 92 nbargs 2 types: (const char *, long) args: (path, length) > +syscall sys_ftruncate nr 93 nbargs 2 types: (unsigned int, unsigned long) args: (fd, length) > +syscall sys_fchmod nr 94 nbargs 2 types: (unsigned int, umode_t) args: (fd, mode) > +syscall sys_fchown16 nr 95 nbargs 3 types: (unsigned int, old_uid_t, old_gid_t) args: (fd, user, group) > +syscall sys_getpriority nr 96 nbargs 2 types: (int, int) args: (which, who) > +syscall sys_setpriority nr 97 nbargs 3 types: (int, int, int) args: (which, who, niceval) > +syscall sys_statfs nr 99 nbargs 2 types: (const char *, struct statfs *) args: (pathname, buf) > +syscall sys_fstatfs nr 100 nbargs 2 types: (unsigned int, struct statfs *) args: (fd, buf) > +syscall sys_syslog nr 103 nbargs 3 types: (int, char *, int) args: (type, buf, len) > +syscall sys_setitimer nr 104 nbargs 3 types: (int, struct itimerval *, struct itimerval *) args: (which, value, ovalue) > +syscall sys_getitimer nr 105 nbargs 2 types: (int, struct itimerval *) args: (which, value) > +syscall sys_newstat nr 106 nbargs 2 types: (const char *, struct stat *) args: (filename, statbuf) > +syscall sys_newlstat nr 107 nbargs 2 types: (const char *, struct stat *) args: (filename, statbuf) > +syscall sys_newfstat nr 108 nbargs 2 types: (unsigned int, struct stat *) args: (fd, statbuf) > +syscall sys_vhangup nr 111 nbargs 0 types: () args: () > +syscall sys_wait4 nr 114 nbargs 4 types: (pid_t, int *, int, struct rusage *) args: (upid, stat_addr, options, ru) > +syscall sys_swapoff nr 115 nbargs 1 types: (const char *) args: (specialfile) > +syscall sys_sysinfo nr 116 nbargs 1 types: (struct sysinfo *) args: (info) > +syscall sys_fsync nr 118 nbargs 1 types: (unsigned int) args: (fd) > +syscall sys_setdomainname nr 121 nbargs 2 types: (char *, int) args: (name, len) > +syscall sys_newuname nr 122 nbargs 1 types: (struct new_utsname *) args: (name) > +syscall sys_adjtimex nr 124 nbargs 1 types: (struct timex *) args: (txc_p) > +syscall sys_mprotect nr 125 nbargs 3 types: (unsigned long, size_t, unsigned long) args: (start, len, prot) > +syscall sys_sigprocmask nr 126 nbargs 3 types: (int, old_sigset_t *, old_sigset_t *) args: (how, nset, oset) > +syscall sys_init_module nr 128 nbargs 3 types: (void *, unsigned long, const char *) args: (umod, len, uargs) > +syscall sys_delete_module nr 129 nbargs 2 types: (const char *, unsigned int) args: (name_user, flags) > +syscall sys_quotactl nr 131 nbargs 4 types: (unsigned int, const char *, qid_t, void *) args: (cmd, special, id, addr) > +syscall sys_getpgid nr 132 nbargs 1 types: (pid_t) args: (pid) > +syscall sys_fchdir nr 133 nbargs 1 types: (unsigned int) args: (fd) > +syscall sys_bdflush nr 134 nbargs 2 types: (int, long) args: (func, data) > +syscall sys_sysfs nr 135 nbargs 3 types: (int, unsigned long, unsigned long) args: (option, arg1, arg2) > +syscall sys_personality nr 136 nbargs 1 types: (unsigned int) args: (personality) > +syscall sys_setfsuid16 nr 138 nbargs 1 types: (old_uid_t) args: (uid) > +syscall sys_setfsgid16 nr 139 nbargs 1 types: (old_gid_t) args: (gid) > +syscall sys_llseek nr 140 nbargs 5 types: (unsigned int, unsigned long, unsigned long, loff_t *, unsigned int) args: (fd, offset_high, offset_low, result, origin) > +syscall sys_getdents nr 141 nbargs 3 types: (unsigned int, struct linux_dirent *, unsigned int) args: (fd, dirent, count) > +syscall sys_select nr 142 nbargs 5 types: (int, fd_set *, fd_set *, fd_set *, struct timeval *) args: (n, inp, outp, exp, tvp) > +syscall sys_flock nr 143 nbargs 2 types: (unsigned int, unsigned int) args: (fd, cmd) > +syscall sys_msync nr 144 nbargs 3 types: (unsigned long, size_t, int) args: (start, len, flags) > +syscall sys_readv nr 145 nbargs 3 types: (unsigned long, const struct iovec *, unsigned long) args: (fd, vec, vlen) > +syscall sys_writev nr 146 nbargs 3 types: (unsigned long, const struct iovec *, unsigned long) args: (fd, vec, vlen) > +syscall sys_getsid nr 147 nbargs 1 types: (pid_t) args: (pid) > +syscall sys_fdatasync nr 148 nbargs 1 types: (unsigned int) args: (fd) > +syscall sys_sysctl nr 149 nbargs 1 types: (struct __sysctl_args *) args: (args) > +syscall sys_mlock nr 150 nbargs 2 types: (unsigned long, size_t) args: (start, len) > +syscall sys_munlock nr 151 nbargs 2 types: (unsigned long, size_t) args: (start, len) > +syscall sys_mlockall nr 152 nbargs 1 types: (int) args: (flags) > +syscall sys_munlockall nr 153 nbargs 0 types: () args: () > +syscall sys_sched_setparam nr 154 nbargs 2 types: (pid_t, struct sched_param *) args: (pid, param) > +syscall sys_sched_getparam nr 155 nbargs 2 types: (pid_t, struct sched_param *) args: (pid, param) > +syscall sys_sched_setscheduler nr 156 nbargs 3 types: (pid_t, int, struct sched_param *) args: (pid, policy, param) > +syscall sys_sched_getscheduler nr 157 nbargs 1 types: (pid_t) args: (pid) > +syscall sys_sched_yield nr 158 nbargs 0 types: () args: () > +syscall sys_sched_get_priority_max nr 159 nbargs 1 types: (int) args: (policy) > +syscall sys_sched_get_priority_min nr 160 nbargs 1 types: (int) args: (policy) > +syscall sys_sched_rr_get_interval nr 161 nbargs 2 types: (pid_t, struct timespec *) args: (pid, interval) > +syscall sys_nanosleep nr 162 nbargs 2 types: (struct timespec *, struct timespec *) args: (rqtp, rmtp) > +syscall sys_mremap nr 163 nbargs 5 types: (unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) args: (addr, old_len, new_len, flags, new_addr) > +syscall sys_setresuid16 nr 164 nbargs 3 types: (old_uid_t, old_uid_t, old_uid_t) args: (ruid, euid, suid) > +syscall sys_getresuid16 nr 165 nbargs 3 types: (old_uid_t *, old_uid_t *, old_uid_t *) args: (ruid, euid, suid) > +syscall sys_poll nr 168 nbargs 3 types: (struct pollfd *, unsigned int, int) args: (ufds, nfds, timeout_msecs) > +syscall sys_setresgid16 nr 170 nbargs 3 types: (old_gid_t, old_gid_t, old_gid_t) args: (rgid, egid, sgid) > +syscall sys_getresgid16 nr 171 nbargs 3 types: (old_gid_t *, old_gid_t *, old_gid_t *) args: (rgid, egid, sgid) > +syscall sys_prctl nr 172 nbargs 5 types: (int, unsigned long, unsigned long, unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5) > +syscall sys_rt_sigaction nr 174 nbargs 4 types: (int, const struct sigaction *, struct sigaction *, size_t) args: (sig, act, oact, sigsetsize) > +syscall sys_rt_sigprocmask nr 175 nbargs 4 types: (int, sigset_t *, sigset_t *, size_t) args: (how, nset, oset, sigsetsize) > +syscall sys_rt_sigpending nr 176 nbargs 2 types: (sigset_t *, size_t) args: (set, sigsetsize) > +syscall sys_rt_sigtimedwait nr 177 nbargs 4 types: (const sigset_t *, siginfo_t *, const struct timespec *, size_t) args: (uthese, uinfo, uts, sigsetsize) > +syscall sys_rt_sigqueueinfo nr 178 nbargs 3 types: (pid_t, int, siginfo_t *) args: (pid, sig, uinfo) > +syscall sys_rt_sigsuspend nr 179 nbargs 2 types: (sigset_t *, size_t) args: (unewset, sigsetsize) > +syscall sys_chown16 nr 182 nbargs 3 types: (const char *, old_uid_t, old_gid_t) args: (filename, user, group) > +syscall sys_getcwd nr 183 nbargs 2 types: (char *, unsigned long) args: (buf, size) > +syscall sys_capget nr 184 nbargs 2 types: (cap_user_header_t, cap_user_data_t) args: (header, dataptr) > +syscall sys_capset nr 185 nbargs 2 types: (cap_user_header_t, const cap_user_data_t) args: (header, data) > +syscall sys_sendfile nr 187 nbargs 4 types: (int, int, off_t *, size_t) args: (out_fd, in_fd, offset, count) > +syscall sys_getrlimit nr 191 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) > +syscall sys_stat64 nr 195 nbargs 2 types: (const char *, struct stat64 *) args: (filename, statbuf) > +syscall sys_lstat64 nr 196 nbargs 2 types: (const char *, struct stat64 *) args: (filename, statbuf) > +syscall sys_fstat64 nr 197 nbargs 2 types: (unsigned long, struct stat64 *) args: (fd, statbuf) > +syscall sys_lchown nr 198 nbargs 3 types: (const char *, uid_t, gid_t) args: (filename, user, group) > +syscall sys_getuid nr 199 nbargs 0 types: () args: () > +syscall sys_getgid nr 200 nbargs 0 types: () args: () > +syscall sys_geteuid nr 201 nbargs 0 types: () args: () > +syscall sys_getegid nr 202 nbargs 0 types: () args: () > +syscall sys_setreuid nr 203 nbargs 2 types: (uid_t, uid_t) args: (ruid, euid) > +syscall sys_setregid nr 204 nbargs 2 types: (gid_t, gid_t) args: (rgid, egid) > +syscall sys_getgroups nr 205 nbargs 2 types: (int, gid_t *) args: (gidsetsize, grouplist) > +syscall sys_setgroups nr 206 nbargs 2 types: (int, gid_t *) args: (gidsetsize, grouplist) > +syscall sys_fchown nr 207 nbargs 3 types: (unsigned int, uid_t, gid_t) args: (fd, user, group) > +syscall sys_setresuid nr 208 nbargs 3 types: (uid_t, uid_t, uid_t) args: (ruid, euid, suid) > +syscall sys_getresuid nr 209 nbargs 3 types: (uid_t *, uid_t *, uid_t *) args: (ruid, euid, suid) > +syscall sys_setresgid nr 210 nbargs 3 types: (gid_t, gid_t, gid_t) args: (rgid, egid, sgid) > +syscall sys_getresgid nr 211 nbargs 3 types: (gid_t *, gid_t *, gid_t *) args: (rgid, egid, sgid) > +syscall sys_chown nr 212 nbargs 3 types: (const char *, uid_t, gid_t) args: (filename, user, group) > +syscall sys_setuid nr 213 nbargs 1 types: (uid_t) args: (uid) > +syscall sys_setgid nr 214 nbargs 1 types: (gid_t) args: (gid) > +syscall sys_setfsuid nr 215 nbargs 1 types: (uid_t) args: (uid) > +syscall sys_setfsgid nr 216 nbargs 1 types: (gid_t) args: (gid) > +syscall sys_getdents64 nr 217 nbargs 3 types: (unsigned int, struct linux_dirent64 *, unsigned int) args: (fd, dirent, count) > +syscall sys_pivot_root nr 218 nbargs 2 types: (const char *, const char *) args: (new_root, put_old) > +syscall sys_mincore nr 219 nbargs 3 types: (unsigned long, size_t, unsigned char *) args: (start, len, vec) > +syscall sys_madvise nr 220 nbargs 3 types: (unsigned long, size_t, int) args: (start, len_in, behavior) > +syscall sys_fcntl64 nr 221 nbargs 3 types: (unsigned int, unsigned int, unsigned long) args: (fd, cmd, arg) > +syscall sys_gettid nr 224 nbargs 0 types: () args: () > +syscall sys_setxattr nr 226 nbargs 5 types: (const char *, const char *, const void *, size_t, int) args: (pathname, name, value, size, flags) > +syscall sys_lsetxattr nr 227 nbargs 5 types: (const char *, const char *, const void *, size_t, int) args: (pathname, name, value, size, flags) > +syscall sys_fsetxattr nr 228 nbargs 5 types: (int, const char *, const void *, size_t, int) args: (fd, name, value, size, flags) > +syscall sys_getxattr nr 229 nbargs 4 types: (const char *, const char *, void *, size_t) args: (pathname, name, value, size) > +syscall sys_lgetxattr nr 230 nbargs 4 types: (const char *, const char *, void *, size_t) args: (pathname, name, value, size) > +syscall sys_fgetxattr nr 231 nbargs 4 types: (int, const char *, void *, size_t) args: (fd, name, value, size) > +syscall sys_listxattr nr 232 nbargs 3 types: (const char *, char *, size_t) args: (pathname, list, size) > +syscall sys_llistxattr nr 233 nbargs 3 types: (const char *, char *, size_t) args: (pathname, list, size) > +syscall sys_flistxattr nr 234 nbargs 3 types: (int, char *, size_t) args: (fd, list, size) > +syscall sys_removexattr nr 235 nbargs 2 types: (const char *, const char *) args: (pathname, name) > +syscall sys_lremovexattr nr 236 nbargs 2 types: (const char *, const char *) args: (pathname, name) > +syscall sys_fremovexattr nr 237 nbargs 2 types: (int, const char *) args: (fd, name) > +syscall sys_tkill nr 238 nbargs 2 types: (pid_t, int) args: (pid, sig) > +syscall sys_sendfile64 nr 239 nbargs 4 types: (int, int, loff_t *, size_t) args: (out_fd, in_fd, offset, count) > +syscall sys_futex nr 240 nbargs 6 types: (u32 *, int, u32, struct timespec *, u32 *, u32) args: (uaddr, op, val, utime, uaddr2, val3) > +syscall sys_sched_setaffinity nr 241 nbargs 3 types: (pid_t, unsigned int, unsigned long *) args: (pid, len, user_mask_ptr) > +syscall sys_sched_getaffinity nr 242 nbargs 3 types: (pid_t, unsigned int, unsigned long *) args: (pid, len, user_mask_ptr) > +syscall sys_io_setup nr 243 nbargs 2 types: (unsigned, aio_context_t *) args: (nr_events, ctxp) > +syscall sys_io_destroy nr 244 nbargs 1 types: (aio_context_t) args: (ctx) > +syscall sys_io_getevents nr 245 nbargs 5 types: (aio_context_t, long, long, struct io_event *, struct timespec *) args: (ctx_id, min_nr, nr, events, timeout) > +syscall sys_io_submit nr 246 nbargs 3 types: (aio_context_t, long, struct iocb * *) args: (ctx_id, nr, iocbpp) > +syscall sys_io_cancel nr 247 nbargs 3 types: (aio_context_t, struct iocb *, struct io_event *) args: (ctx_id, iocb, result) > +syscall sys_exit_group nr 248 nbargs 1 types: (int) args: (error_code) > +syscall sys_epoll_create nr 250 nbargs 1 types: (int) args: (size) > +syscall sys_epoll_ctl nr 251 nbargs 4 types: (int, int, int, struct epoll_event *) args: (epfd, op, fd, event) > +syscall sys_epoll_wait nr 252 nbargs 4 types: (int, struct epoll_event *, int, int) args: (epfd, events, maxevents, timeout) > +syscall sys_remap_file_pages nr 253 nbargs 5 types: (unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) args: (start, size, prot, pgoff, flags) > +syscall sys_set_tid_address nr 256 nbargs 1 types: (int *) args: (tidptr) > +syscall sys_timer_create nr 257 nbargs 3 types: (const clockid_t, struct sigevent *, timer_t *) args: (which_clock, timer_event_spec, created_timer_id) > +syscall sys_timer_settime nr 258 nbargs 4 types: (timer_t, int, const struct itimerspec *, struct itimerspec *) args: (timer_id, flags, new_setting, old_setting) > +syscall sys_timer_gettime nr 259 nbargs 2 types: (timer_t, struct itimerspec *) args: (timer_id, setting) > +syscall sys_timer_getoverrun nr 260 nbargs 1 types: (timer_t) args: (timer_id) > +syscall sys_timer_delete nr 261 nbargs 1 types: (timer_t) args: (timer_id) > +syscall sys_clock_settime nr 262 nbargs 2 types: (const clockid_t, const struct timespec *) args: (which_clock, tp) > +syscall sys_clock_gettime nr 263 nbargs 2 types: (const clockid_t, struct timespec *) args: (which_clock, tp) > +syscall sys_clock_getres nr 264 nbargs 2 types: (const clockid_t, struct timespec *) args: (which_clock, tp) > +syscall sys_clock_nanosleep nr 265 nbargs 4 types: (const clockid_t, int, const struct timespec *, struct timespec *) args: (which_clock, flags, rqtp, rmtp) > +syscall sys_tgkill nr 268 nbargs 3 types: (pid_t, pid_t, int) args: (tgid, pid, sig) > +syscall sys_utimes nr 269 nbargs 2 types: (char *, struct timeval *) args: (filename, utimes) > +syscall sys_mq_open nr 274 nbargs 4 types: (const char *, int, umode_t, struct mq_attr *) args: (u_name, oflag, mode, u_attr) > +syscall sys_mq_unlink nr 275 nbargs 1 types: (const char *) args: (u_name) > +syscall sys_mq_timedsend nr 276 nbargs 5 types: (mqd_t, const char *, size_t, unsigned int, const struct timespec *) args: (mqdes, u_msg_ptr, msg_len, msg_prio, u_abs_timeout) > +syscall sys_mq_timedreceive nr 277 nbargs 5 types: (mqd_t, char *, size_t, unsigned int *, const struct timespec *) args: (mqdes, u_msg_ptr, msg_len, u_msg_prio, u_abs_timeout) > +syscall sys_mq_notify nr 278 nbargs 2 types: (mqd_t, const struct sigevent *) args: (mqdes, u_notification) > +syscall sys_mq_getsetattr nr 279 nbargs 3 types: (mqd_t, const struct mq_attr *, struct mq_attr *) args: (mqdes, u_mqstat, u_omqstat) > +syscall sys_waitid nr 280 nbargs 5 types: (int, pid_t, struct siginfo *, int, struct rusage *) args: (which, upid, infop, options, ru) > +syscall sys_socket nr 281 nbargs 3 types: (int, int, int) args: (family, type, protocol) > +syscall sys_bind nr 282 nbargs 3 types: (int, struct sockaddr *, int) args: (fd, umyaddr, addrlen) > +syscall sys_connect nr 283 nbargs 3 types: (int, struct sockaddr *, int) args: (fd, uservaddr, addrlen) > +syscall sys_listen nr 284 nbargs 2 types: (int, int) args: (fd, backlog) > +syscall sys_accept nr 285 nbargs 3 types: (int, struct sockaddr *, int *) args: (fd, upeer_sockaddr, upeer_addrlen) > +syscall sys_getsockname nr 286 nbargs 3 types: (int, struct sockaddr *, int *) args: (fd, usockaddr, usockaddr_len) > +syscall sys_getpeername nr 287 nbargs 3 types: (int, struct sockaddr *, int *) args: (fd, usockaddr, usockaddr_len) > +syscall sys_socketpair nr 288 nbargs 4 types: (int, int, int, int *) args: (family, type, protocol, usockvec) > +syscall sys_send nr 289 nbargs 4 types: (int, void *, size_t, unsigned) args: (fd, buff, len, flags) > +syscall sys_sendto nr 290 nbargs 6 types: (int, void *, size_t, unsigned, struct sockaddr *, int) args: (fd, buff, len, flags, addr, addr_len) > +syscall sys_recvfrom nr 292 nbargs 6 types: (int, void *, size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr, addr_len) > +syscall sys_shutdown nr 293 nbargs 2 types: (int, int) args: (fd, how) > +syscall sys_setsockopt nr 294 nbargs 5 types: (int, int, int, char *, int) args: (fd, level, optname, optval, optlen) > +syscall sys_getsockopt nr 295 nbargs 5 types: (int, int, int, char *, int *) args: (fd, level, optname, optval, optlen) > +syscall sys_sendmsg nr 296 nbargs 3 types: (int, struct msghdr *, unsigned) args: (fd, msg, flags) > +syscall sys_recvmsg nr 297 nbargs 3 types: (int, struct msghdr *, unsigned int) args: (fd, msg, flags) > +syscall sys_semop nr 298 nbargs 3 types: (int, struct sembuf *, unsigned) args: (semid, tsops, nsops) > +syscall sys_semget nr 299 nbargs 3 types: (key_t, int, int) args: (key, nsems, semflg) > +syscall sys_msgsnd nr 301 nbargs 4 types: (int, struct msgbuf *, size_t, int) args: (msqid, msgp, msgsz, msgflg) > +syscall sys_msgrcv nr 302 nbargs 5 types: (int, struct msgbuf *, size_t, long, int) args: (msqid, msgp, msgsz, msgtyp, msgflg) > +syscall sys_msgget nr 303 nbargs 2 types: (key_t, int) args: (key, msgflg) > +syscall sys_msgctl nr 304 nbargs 3 types: (int, int, struct msqid_ds *) args: (msqid, cmd, buf) > +syscall sys_shmat nr 305 nbargs 3 types: (int, char *, int) args: (shmid, shmaddr, shmflg) > +syscall sys_shmdt nr 306 nbargs 1 types: (char *) args: (shmaddr) > +syscall sys_shmget nr 307 nbargs 3 types: (key_t, size_t, int) args: (key, size, shmflg) > +syscall sys_shmctl nr 308 nbargs 3 types: (int, int, struct shmid_ds *) args: (shmid, cmd, buf) > +syscall sys_add_key nr 309 nbargs 5 types: (const char *, const char *, const void *, size_t, key_serial_t) args: (_type, _description, _payload, plen, ringid) > +syscall sys_request_key nr 310 nbargs 4 types: (const char *, const char *, const char *, key_serial_t) args: (_type, _description, _callout_info, destringid) > +syscall sys_keyctl nr 311 nbargs 5 types: (int, unsigned long, unsigned long, unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5) > +syscall sys_semtimedop nr 312 nbargs 4 types: (int, struct sembuf *, unsigned, const struct timespec *) args: (semid, tsops, nsops, timeout) > +syscall sys_ioprio_set nr 314 nbargs 3 types: (int, int, int) args: (which, who, ioprio) > +syscall sys_ioprio_get nr 315 nbargs 2 types: (int, int) args: (which, who) > +syscall sys_inotify_init nr 316 nbargs 0 types: () args: () > +syscall sys_inotify_add_watch nr 317 nbargs 3 types: (int, const char *, u32) args: (fd, pathname, mask) > +syscall sys_inotify_rm_watch nr 318 nbargs 2 types: (int, __s32) args: (fd, wd) > +syscall sys_openat nr 322 nbargs 4 types: (int, const char *, int, umode_t) args: (dfd, filename, flags, mode) > +syscall sys_mkdirat nr 323 nbargs 3 types: (int, const char *, umode_t) args: (dfd, pathname, mode) > +syscall sys_mknodat nr 324 nbargs 4 types: (int, const char *, umode_t, unsigned) args: (dfd, filename, mode, dev) > +syscall sys_fchownat nr 325 nbargs 5 types: (int, const char *, uid_t, gid_t, int) args: (dfd, filename, user, group, flag) > +syscall sys_futimesat nr 326 nbargs 3 types: (int, const char *, struct timeval *) args: (dfd, filename, utimes) > +syscall sys_fstatat64 nr 327 nbargs 4 types: (int, const char *, struct stat64 *, int) args: (dfd, filename, statbuf, flag) > +syscall sys_unlinkat nr 328 nbargs 3 types: (int, const char *, int) args: (dfd, pathname, flag) > +syscall sys_renameat nr 329 nbargs 4 types: (int, const char *, int, const char *) args: (olddfd, oldname, newdfd, newname) > +syscall sys_linkat nr 330 nbargs 5 types: (int, const char *, int, const char *, int) args: (olddfd, oldname, newdfd, newname, flags) > +syscall sys_symlinkat nr 331 nbargs 3 types: (const char *, int, const char *) args: (oldname, newdfd, newname) > +syscall sys_readlinkat nr 332 nbargs 4 types: (int, const char *, char *, int) args: (dfd, pathname, buf, bufsiz) > +syscall sys_fchmodat nr 333 nbargs 3 types: (int, const char *, umode_t) args: (dfd, filename, mode) > +syscall sys_faccessat nr 334 nbargs 3 types: (int, const char *, int) args: (dfd, filename, mode) > +syscall sys_pselect6 nr 335 nbargs 6 types: (int, fd_set *, fd_set *, fd_set *, struct timespec *, void *) args: (n, inp, outp, exp, tsp, sig) > +syscall sys_ppoll nr 336 nbargs 5 types: (struct pollfd *, unsigned int, struct timespec *, const sigset_t *, size_t) args: (ufds, nfds, tsp, sigmask, sigsetsize) > +syscall sys_unshare nr 337 nbargs 1 types: (unsigned long) args: (unshare_flags) > +syscall sys_set_robust_list nr 338 nbargs 2 types: (struct robust_list_head *, size_t) args: (head, len) > +syscall sys_get_robust_list nr 339 nbargs 3 types: (int, struct robust_list_head * *, size_t *) args: (pid, head_ptr, len_ptr) > +syscall sys_splice nr 340 nbargs 6 types: (int, loff_t *, int, loff_t *, size_t, unsigned int) args: (fd_in, off_in, fd_out, off_out, len, flags) > +syscall sys_tee nr 342 nbargs 4 types: (int, int, size_t, unsigned int) args: (fdin, fdout, len, flags) > +syscall sys_vmsplice nr 343 nbargs 4 types: (int, const struct iovec *, unsigned long, unsigned int) args: (fd, iov, nr_segs, flags) > +syscall sys_getcpu nr 345 nbargs 3 types: (unsigned *, unsigned *, struct getcpu_cache *) args: (cpup, nodep, unused) > +syscall sys_epoll_pwait nr 346 nbargs 6 types: (int, struct epoll_event *, int, int, const sigset_t *, size_t) args: (epfd, events, maxevents, timeout, sigmask, sigsetsize) > +syscall sys_utimensat nr 348 nbargs 4 types: (int, const char *, struct timespec *, int) args: (dfd, filename, utimes, flags) > +syscall sys_signalfd nr 349 nbargs 3 types: (int, sigset_t *, size_t) args: (ufd, user_mask, sizemask) > +syscall sys_timerfd_create nr 350 nbargs 2 types: (int, int) args: (clockid, flags) > +syscall sys_eventfd nr 351 nbargs 1 types: (unsigned int) args: (count) > +syscall sys_timerfd_settime nr 353 nbargs 4 types: (int, int, const struct itimerspec *, struct itimerspec *) args: (ufd, flags, utmr, otmr) > +syscall sys_timerfd_gettime nr 354 nbargs 2 types: (int, struct itimerspec *) args: (ufd, otmr) > +syscall sys_signalfd4 nr 355 nbargs 4 types: (int, sigset_t *, size_t, int) args: (ufd, user_mask, sizemask, flags) > +syscall sys_eventfd2 nr 356 nbargs 2 types: (unsigned int, int) args: (count, flags) > +syscall sys_epoll_create1 nr 357 nbargs 1 types: (int) args: (flags) > +syscall sys_dup3 nr 358 nbargs 3 types: (unsigned int, unsigned int, int) args: (oldfd, newfd, flags) > +syscall sys_pipe2 nr 359 nbargs 2 types: (int *, int) args: (fildes, flags) > +syscall sys_inotify_init1 nr 360 nbargs 1 types: (int) args: (flags) > +syscall sys_preadv nr 361 nbargs 5 types: (unsigned long, const struct iovec *, unsigned long, unsigned long, unsigned long) args: (fd, vec, vlen, pos_l, pos_h) > +syscall sys_pwritev nr 362 nbargs 5 types: (unsigned long, const struct iovec *, unsigned long, unsigned long, unsigned long) args: (fd, vec, vlen, pos_l, pos_h) > +syscall sys_rt_tgsigqueueinfo nr 363 nbargs 4 types: (pid_t, pid_t, int, siginfo_t *) args: (tgid, pid, sig, uinfo) > +syscall sys_perf_event_open nr 364 nbargs 5 types: (struct perf_event_attr *, pid_t, int, int, unsigned long) args: (attr_uptr, pid, cpu, group_fd, flags) > +syscall sys_recvmmsg nr 365 nbargs 5 types: (int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *) args: (fd, mmsg, vlen, flags, timeout) > +syscall sys_accept4 nr 366 nbargs 4 types: (int, struct sockaddr *, int *, int) args: (fd, upeer_sockaddr, upeer_addrlen, flags) > +syscall sys_fanotify_init nr 367 nbargs 2 types: (unsigned int, unsigned int) args: (flags, event_f_flags) > +syscall sys_prlimit64 nr 369 nbargs 4 types: (pid_t, unsigned int, const struct rlimit64 *, struct rlimit64 *) args: (pid, resource, new_rlim, old_rlim) > +syscall sys_name_to_handle_at nr 370 nbargs 5 types: (int, const char *, struct file_handle *, int *, int) args: (dfd, name, handle, mnt_id, flag) > +syscall sys_open_by_handle_at nr 371 nbargs 3 types: (int, struct file_handle *, int) args: (mountdirfd, handle, flags) > +syscall sys_clock_adjtime nr 372 nbargs 2 types: (const clockid_t, struct timex *) args: (which_clock, utx) > +syscall sys_syncfs nr 373 nbargs 1 types: (int) args: (fd) > +syscall sys_sendmmsg nr 374 nbargs 4 types: (int, struct mmsghdr *, unsigned int, unsigned int) args: (fd, mmsg, vlen, flags) > +syscall sys_setns nr 375 nbargs 2 types: (int, int) args: (fd, nstype) > +syscall sys_process_vm_readv nr 376 nbargs 6 types: (pid_t, const struct iovec *, unsigned long, const struct iovec *, unsigned long, unsigned long) args: (pid, lvec, liovcnt, rvec, riovcnt, flags) > +syscall sys_process_vm_writev nr 377 nbargs 6 types: (pid_t, const struct iovec *, unsigned long, const struct iovec *, unsigned long, unsigned long) args: (pid, lvec, liovcnt, rvec, riovcnt, flags) > diff --git a/instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_integers.h b/instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_integers.h > deleted file mode 100644 > index 9419331..0000000 > --- a/instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_integers.h > +++ /dev/null > @@ -1,1145 +0,0 @@ > -/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */ > -#ifndef CREATE_SYSCALL_TABLE > - > -#if !defined(_TRACE_SYSCALLS_INTEGERS_H) || defined(TRACE_HEADER_MULTI_READ) > -#define _TRACE_SYSCALLS_INTEGERS_H > - > -#include > -#include > -#include "arm-32-syscalls-2.6.38_integers_override.h" > -#include "syscalls_integers_override.h" > - > -SC_DECLARE_EVENT_CLASS_NOARGS(syscalls_noargs, > - TP_STRUCT__entry(), > - TP_fast_assign(), > - TP_printk() > -) > -#ifndef OVERRIDE_32_sys_restart_syscall > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_restart_syscall) > -#endif > -#ifndef OVERRIDE_32_sys_getpid > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getpid) > -#endif > -#ifndef OVERRIDE_32_sys_getuid16 > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getuid16) > -#endif > -#ifndef OVERRIDE_32_sys_pause > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_pause) > -#endif > -#ifndef OVERRIDE_32_sys_sync > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sync) > -#endif > -#ifndef OVERRIDE_32_sys_getgid16 > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getgid16) > -#endif > -#ifndef OVERRIDE_32_sys_geteuid16 > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_geteuid16) > -#endif > -#ifndef OVERRIDE_32_sys_getegid16 > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getegid16) > -#endif > -#ifndef OVERRIDE_32_sys_getppid > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getppid) > -#endif > -#ifndef OVERRIDE_32_sys_getpgrp > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getpgrp) > -#endif > -#ifndef OVERRIDE_32_sys_setsid > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_setsid) > -#endif > -#ifndef OVERRIDE_32_sys_vhangup > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_vhangup) > -#endif > -#ifndef OVERRIDE_32_sys_munlockall > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_munlockall) > -#endif > -#ifndef OVERRIDE_32_sys_sched_yield > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sched_yield) > -#endif > -#ifndef OVERRIDE_32_sys_getuid > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getuid) > -#endif > -#ifndef OVERRIDE_32_sys_getgid > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getgid) > -#endif > -#ifndef OVERRIDE_32_sys_geteuid > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_geteuid) > -#endif > -#ifndef OVERRIDE_32_sys_getegid > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getegid) > -#endif > -#ifndef OVERRIDE_32_sys_gettid > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_gettid) > -#endif > -#ifndef OVERRIDE_32_sys_inotify_init > -SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_inotify_init) > -#endif > -#ifndef OVERRIDE_32_sys_exit > -SC_TRACE_EVENT(sys_exit, > - TP_PROTO(int error_code), > - TP_ARGS(error_code), > - TP_STRUCT__entry(__field(int, error_code)), > - TP_fast_assign(tp_assign(error_code, error_code)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_close > -SC_TRACE_EVENT(sys_close, > - TP_PROTO(unsigned int fd), > - TP_ARGS(fd), > - TP_STRUCT__entry(__field(unsigned int, fd)), > - TP_fast_assign(tp_assign(fd, fd)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setuid16 > -SC_TRACE_EVENT(sys_setuid16, > - TP_PROTO(old_uid_t uid), > - TP_ARGS(uid), > - TP_STRUCT__entry(__field(old_uid_t, uid)), > - TP_fast_assign(tp_assign(uid, uid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_nice > -SC_TRACE_EVENT(sys_nice, > - TP_PROTO(int increment), > - TP_ARGS(increment), > - TP_STRUCT__entry(__field(int, increment)), > - TP_fast_assign(tp_assign(increment, increment)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_dup > -SC_TRACE_EVENT(sys_dup, > - TP_PROTO(unsigned int fildes), > - TP_ARGS(fildes), > - TP_STRUCT__entry(__field(unsigned int, fildes)), > - TP_fast_assign(tp_assign(fildes, fildes)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_brk > -SC_TRACE_EVENT(sys_brk, > - TP_PROTO(unsigned long brk), > - TP_ARGS(brk), > - TP_STRUCT__entry(__field(unsigned long, brk)), > - TP_fast_assign(tp_assign(brk, brk)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setgid16 > -SC_TRACE_EVENT(sys_setgid16, > - TP_PROTO(old_gid_t gid), > - TP_ARGS(gid), > - TP_STRUCT__entry(__field(old_gid_t, gid)), > - TP_fast_assign(tp_assign(gid, gid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_umask > -SC_TRACE_EVENT(sys_umask, > - TP_PROTO(int mask), > - TP_ARGS(mask), > - TP_STRUCT__entry(__field(int, mask)), > - TP_fast_assign(tp_assign(mask, mask)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fsync > -SC_TRACE_EVENT(sys_fsync, > - TP_PROTO(unsigned int fd), > - TP_ARGS(fd), > - TP_STRUCT__entry(__field(unsigned int, fd)), > - TP_fast_assign(tp_assign(fd, fd)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getpgid > -SC_TRACE_EVENT(sys_getpgid, > - TP_PROTO(pid_t pid), > - TP_ARGS(pid), > - TP_STRUCT__entry(__field(pid_t, pid)), > - TP_fast_assign(tp_assign(pid, pid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fchdir > -SC_TRACE_EVENT(sys_fchdir, > - TP_PROTO(unsigned int fd), > - TP_ARGS(fd), > - TP_STRUCT__entry(__field(unsigned int, fd)), > - TP_fast_assign(tp_assign(fd, fd)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_personality > -SC_TRACE_EVENT(sys_personality, > - TP_PROTO(unsigned int personality), > - TP_ARGS(personality), > - TP_STRUCT__entry(__field(unsigned int, personality)), > - TP_fast_assign(tp_assign(personality, personality)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setfsuid16 > -SC_TRACE_EVENT(sys_setfsuid16, > - TP_PROTO(old_uid_t uid), > - TP_ARGS(uid), > - TP_STRUCT__entry(__field(old_uid_t, uid)), > - TP_fast_assign(tp_assign(uid, uid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setfsgid16 > -SC_TRACE_EVENT(sys_setfsgid16, > - TP_PROTO(old_gid_t gid), > - TP_ARGS(gid), > - TP_STRUCT__entry(__field(old_gid_t, gid)), > - TP_fast_assign(tp_assign(gid, gid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getsid > -SC_TRACE_EVENT(sys_getsid, > - TP_PROTO(pid_t pid), > - TP_ARGS(pid), > - TP_STRUCT__entry(__field(pid_t, pid)), > - TP_fast_assign(tp_assign(pid, pid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fdatasync > -SC_TRACE_EVENT(sys_fdatasync, > - TP_PROTO(unsigned int fd), > - TP_ARGS(fd), > - TP_STRUCT__entry(__field(unsigned int, fd)), > - TP_fast_assign(tp_assign(fd, fd)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mlockall > -SC_TRACE_EVENT(sys_mlockall, > - TP_PROTO(int flags), > - TP_ARGS(flags), > - TP_STRUCT__entry(__field(int, flags)), > - TP_fast_assign(tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sched_getscheduler > -SC_TRACE_EVENT(sys_sched_getscheduler, > - TP_PROTO(pid_t pid), > - TP_ARGS(pid), > - TP_STRUCT__entry(__field(pid_t, pid)), > - TP_fast_assign(tp_assign(pid, pid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sched_get_priority_max > -SC_TRACE_EVENT(sys_sched_get_priority_max, > - TP_PROTO(int policy), > - TP_ARGS(policy), > - TP_STRUCT__entry(__field(int, policy)), > - TP_fast_assign(tp_assign(policy, policy)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sched_get_priority_min > -SC_TRACE_EVENT(sys_sched_get_priority_min, > - TP_PROTO(int policy), > - TP_ARGS(policy), > - TP_STRUCT__entry(__field(int, policy)), > - TP_fast_assign(tp_assign(policy, policy)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setuid > -SC_TRACE_EVENT(sys_setuid, > - TP_PROTO(uid_t uid), > - TP_ARGS(uid), > - TP_STRUCT__entry(__field(uid_t, uid)), > - TP_fast_assign(tp_assign(uid, uid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setgid > -SC_TRACE_EVENT(sys_setgid, > - TP_PROTO(gid_t gid), > - TP_ARGS(gid), > - TP_STRUCT__entry(__field(gid_t, gid)), > - TP_fast_assign(tp_assign(gid, gid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setfsuid > -SC_TRACE_EVENT(sys_setfsuid, > - TP_PROTO(uid_t uid), > - TP_ARGS(uid), > - TP_STRUCT__entry(__field(uid_t, uid)), > - TP_fast_assign(tp_assign(uid, uid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setfsgid > -SC_TRACE_EVENT(sys_setfsgid, > - TP_PROTO(gid_t gid), > - TP_ARGS(gid), > - TP_STRUCT__entry(__field(gid_t, gid)), > - TP_fast_assign(tp_assign(gid, gid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_io_destroy > -SC_TRACE_EVENT(sys_io_destroy, > - TP_PROTO(aio_context_t ctx), > - TP_ARGS(ctx), > - TP_STRUCT__entry(__field(aio_context_t, ctx)), > - TP_fast_assign(tp_assign(ctx, ctx)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_exit_group > -SC_TRACE_EVENT(sys_exit_group, > - TP_PROTO(int error_code), > - TP_ARGS(error_code), > - TP_STRUCT__entry(__field(int, error_code)), > - TP_fast_assign(tp_assign(error_code, error_code)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_epoll_create > -SC_TRACE_EVENT(sys_epoll_create, > - TP_PROTO(int size), > - TP_ARGS(size), > - TP_STRUCT__entry(__field(int, size)), > - TP_fast_assign(tp_assign(size, size)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_timer_getoverrun > -SC_TRACE_EVENT(sys_timer_getoverrun, > - TP_PROTO(timer_t timer_id), > - TP_ARGS(timer_id), > - TP_STRUCT__entry(__field(timer_t, timer_id)), > - TP_fast_assign(tp_assign(timer_id, timer_id)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_timer_delete > -SC_TRACE_EVENT(sys_timer_delete, > - TP_PROTO(timer_t timer_id), > - TP_ARGS(timer_id), > - TP_STRUCT__entry(__field(timer_t, timer_id)), > - TP_fast_assign(tp_assign(timer_id, timer_id)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_unshare > -SC_TRACE_EVENT(sys_unshare, > - TP_PROTO(unsigned long unshare_flags), > - TP_ARGS(unshare_flags), > - TP_STRUCT__entry(__field(unsigned long, unshare_flags)), > - TP_fast_assign(tp_assign(unshare_flags, unshare_flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_eventfd > -SC_TRACE_EVENT(sys_eventfd, > - TP_PROTO(unsigned int count), > - TP_ARGS(count), > - TP_STRUCT__entry(__field(unsigned int, count)), > - TP_fast_assign(tp_assign(count, count)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_epoll_create1 > -SC_TRACE_EVENT(sys_epoll_create1, > - TP_PROTO(int flags), > - TP_ARGS(flags), > - TP_STRUCT__entry(__field(int, flags)), > - TP_fast_assign(tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_inotify_init1 > -SC_TRACE_EVENT(sys_inotify_init1, > - TP_PROTO(int flags), > - TP_ARGS(flags), > - TP_STRUCT__entry(__field(int, flags)), > - TP_fast_assign(tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_kill > -SC_TRACE_EVENT(sys_kill, > - TP_PROTO(pid_t pid, int sig), > - TP_ARGS(pid, sig), > - TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig)), > - TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setpgid > -SC_TRACE_EVENT(sys_setpgid, > - TP_PROTO(pid_t pid, pid_t pgid), > - TP_ARGS(pid, pgid), > - TP_STRUCT__entry(__field(pid_t, pid) __field(pid_t, pgid)), > - TP_fast_assign(tp_assign(pid, pid) tp_assign(pgid, pgid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_dup2 > -SC_TRACE_EVENT(sys_dup2, > - TP_PROTO(unsigned int oldfd, unsigned int newfd), > - TP_ARGS(oldfd, newfd), > - TP_STRUCT__entry(__field(unsigned int, oldfd) __field(unsigned int, newfd)), > - TP_fast_assign(tp_assign(oldfd, oldfd) tp_assign(newfd, newfd)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setreuid16 > -SC_TRACE_EVENT(sys_setreuid16, > - TP_PROTO(old_uid_t ruid, old_uid_t euid), > - TP_ARGS(ruid, euid), > - TP_STRUCT__entry(__field(old_uid_t, ruid) __field(old_uid_t, euid)), > - TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setregid16 > -SC_TRACE_EVENT(sys_setregid16, > - TP_PROTO(old_gid_t rgid, old_gid_t egid), > - TP_ARGS(rgid, egid), > - TP_STRUCT__entry(__field(old_gid_t, rgid) __field(old_gid_t, egid)), > - TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_munmap > -SC_TRACE_EVENT(sys_munmap, > - TP_PROTO(unsigned long addr, size_t len), > - TP_ARGS(addr, len), > - TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(size_t, len)), > - TP_fast_assign(tp_assign(addr, addr) tp_assign(len, len)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_ftruncate > -SC_TRACE_EVENT(sys_ftruncate, > - TP_PROTO(unsigned int fd, unsigned long length), > - TP_ARGS(fd, length), > - TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned long, length)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(length, length)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fchmod > -SC_TRACE_EVENT(sys_fchmod, > - TP_PROTO(unsigned int fd, mode_t mode), > - TP_ARGS(fd, mode), > - TP_STRUCT__entry(__field(unsigned int, fd) __field(mode_t, mode)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(mode, mode)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getpriority > -SC_TRACE_EVENT(sys_getpriority, > - TP_PROTO(int which, int who), > - TP_ARGS(which, who), > - TP_STRUCT__entry(__field(int, which) __field(int, who)), > - TP_fast_assign(tp_assign(which, which) tp_assign(who, who)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_bdflush > -SC_TRACE_EVENT(sys_bdflush, > - TP_PROTO(int func, long data), > - TP_ARGS(func, data), > - TP_STRUCT__entry(__field(int, func) __field(long, data)), > - TP_fast_assign(tp_assign(func, func) tp_assign(data, data)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_flock > -SC_TRACE_EVENT(sys_flock, > - TP_PROTO(unsigned int fd, unsigned int cmd), > - TP_ARGS(fd, cmd), > - TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mlock > -SC_TRACE_EVENT(sys_mlock, > - TP_PROTO(unsigned long start, size_t len), > - TP_ARGS(start, len), > - TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len)), > - TP_fast_assign(tp_assign(start, start) tp_assign(len, len)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_munlock > -SC_TRACE_EVENT(sys_munlock, > - TP_PROTO(unsigned long start, size_t len), > - TP_ARGS(start, len), > - TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len)), > - TP_fast_assign(tp_assign(start, start) tp_assign(len, len)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setreuid > -SC_TRACE_EVENT(sys_setreuid, > - TP_PROTO(uid_t ruid, uid_t euid), > - TP_ARGS(ruid, euid), > - TP_STRUCT__entry(__field(uid_t, ruid) __field(uid_t, euid)), > - TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setregid > -SC_TRACE_EVENT(sys_setregid, > - TP_PROTO(gid_t rgid, gid_t egid), > - TP_ARGS(rgid, egid), > - TP_STRUCT__entry(__field(gid_t, rgid) __field(gid_t, egid)), > - TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_tkill > -SC_TRACE_EVENT(sys_tkill, > - TP_PROTO(pid_t pid, int sig), > - TP_ARGS(pid, sig), > - TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig)), > - TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_listen > -SC_TRACE_EVENT(sys_listen, > - TP_PROTO(int fd, int backlog), > - TP_ARGS(fd, backlog), > - TP_STRUCT__entry(__field(int, fd) __field(int, backlog)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(backlog, backlog)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_shutdown > -SC_TRACE_EVENT(sys_shutdown, > - TP_PROTO(int fd, int how), > - TP_ARGS(fd, how), > - TP_STRUCT__entry(__field(int, fd) __field(int, how)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(how, how)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_msgget > -SC_TRACE_EVENT(sys_msgget, > - TP_PROTO(key_t key, int msgflg), > - TP_ARGS(key, msgflg), > - TP_STRUCT__entry(__field(key_t, key) __field(int, msgflg)), > - TP_fast_assign(tp_assign(key, key) tp_assign(msgflg, msgflg)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_ioprio_get > -SC_TRACE_EVENT(sys_ioprio_get, > - TP_PROTO(int which, int who), > - TP_ARGS(which, who), > - TP_STRUCT__entry(__field(int, which) __field(int, who)), > - TP_fast_assign(tp_assign(which, which) tp_assign(who, who)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_inotify_rm_watch > -SC_TRACE_EVENT(sys_inotify_rm_watch, > - TP_PROTO(int fd, __s32 wd), > - TP_ARGS(fd, wd), > - TP_STRUCT__entry(__field(int, fd) __field(__s32, wd)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(wd, wd)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_timerfd_create > -SC_TRACE_EVENT(sys_timerfd_create, > - TP_PROTO(int clockid, int flags), > - TP_ARGS(clockid, flags), > - TP_STRUCT__entry(__field(int, clockid) __field(int, flags)), > - TP_fast_assign(tp_assign(clockid, clockid) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_eventfd2 > -SC_TRACE_EVENT(sys_eventfd2, > - TP_PROTO(unsigned int count, int flags), > - TP_ARGS(count, flags), > - TP_STRUCT__entry(__field(unsigned int, count) __field(int, flags)), > - TP_fast_assign(tp_assign(count, count) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_lseek > -SC_TRACE_EVENT(sys_lseek, > - TP_PROTO(unsigned int fd, off_t offset, unsigned int origin), > - TP_ARGS(fd, offset, origin), > - TP_STRUCT__entry(__field(unsigned int, fd) __field(off_t, offset) __field(unsigned int, origin)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(offset, offset) tp_assign(origin, origin)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_ioctl > -SC_TRACE_EVENT(sys_ioctl, > - TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), > - TP_ARGS(fd, cmd, arg), > - TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fcntl > -SC_TRACE_EVENT(sys_fcntl, > - TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), > - TP_ARGS(fd, cmd, arg), > - TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fchown16 > -SC_TRACE_EVENT(sys_fchown16, > - TP_PROTO(unsigned int fd, old_uid_t user, old_gid_t group), > - TP_ARGS(fd, user, group), > - TP_STRUCT__entry(__field(unsigned int, fd) __field(old_uid_t, user) __field(old_gid_t, group)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(user, user) tp_assign(group, group)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setpriority > -SC_TRACE_EVENT(sys_setpriority, > - TP_PROTO(int which, int who, int niceval), > - TP_ARGS(which, who, niceval), > - TP_STRUCT__entry(__field(int, which) __field(int, who) __field(int, niceval)), > - TP_fast_assign(tp_assign(which, which) tp_assign(who, who) tp_assign(niceval, niceval)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mprotect > -SC_TRACE_EVENT(sys_mprotect, > - TP_PROTO(unsigned long start, size_t len, unsigned long prot), > - TP_ARGS(start, len, prot), > - TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field(unsigned long, prot)), > - TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(prot, prot)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sysfs > -SC_TRACE_EVENT(sys_sysfs, > - TP_PROTO(int option, unsigned long arg1, unsigned long arg2), > - TP_ARGS(option, arg1, arg2), > - TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg1) __field(unsigned long, arg2)), > - TP_fast_assign(tp_assign(option, option) tp_assign(arg1, arg1) tp_assign(arg2, arg2)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_msync > -SC_TRACE_EVENT(sys_msync, > - TP_PROTO(unsigned long start, size_t len, int flags), > - TP_ARGS(start, len, flags), > - TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field(int, flags)), > - TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setresuid16 > -SC_TRACE_EVENT(sys_setresuid16, > - TP_PROTO(old_uid_t ruid, old_uid_t euid, old_uid_t suid), > - TP_ARGS(ruid, euid, suid), > - TP_STRUCT__entry(__field(old_uid_t, ruid) __field(old_uid_t, euid) __field(old_uid_t, suid)), > - TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setresgid16 > -SC_TRACE_EVENT(sys_setresgid16, > - TP_PROTO(old_gid_t rgid, old_gid_t egid, old_gid_t sgid), > - TP_ARGS(rgid, egid, sgid), > - TP_STRUCT__entry(__field(old_gid_t, rgid) __field(old_gid_t, egid) __field(old_gid_t, sgid)), > - TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fchown > -SC_TRACE_EVENT(sys_fchown, > - TP_PROTO(unsigned int fd, uid_t user, gid_t group), > - TP_ARGS(fd, user, group), > - TP_STRUCT__entry(__field(unsigned int, fd) __field(uid_t, user) __field(gid_t, group)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(user, user) tp_assign(group, group)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setresuid > -SC_TRACE_EVENT(sys_setresuid, > - TP_PROTO(uid_t ruid, uid_t euid, uid_t suid), > - TP_ARGS(ruid, euid, suid), > - TP_STRUCT__entry(__field(uid_t, ruid) __field(uid_t, euid) __field(uid_t, suid)), > - TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setresgid > -SC_TRACE_EVENT(sys_setresgid, > - TP_PROTO(gid_t rgid, gid_t egid, gid_t sgid), > - TP_ARGS(rgid, egid, sgid), > - TP_STRUCT__entry(__field(gid_t, rgid) __field(gid_t, egid) __field(gid_t, sgid)), > - TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_madvise > -SC_TRACE_EVENT(sys_madvise, > - TP_PROTO(unsigned long start, size_t len_in, int behavior), > - TP_ARGS(start, len_in, behavior), > - TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len_in) __field(int, behavior)), > - TP_fast_assign(tp_assign(start, start) tp_assign(len_in, len_in) tp_assign(behavior, behavior)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fcntl64 > -SC_TRACE_EVENT(sys_fcntl64, > - TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), > - TP_ARGS(fd, cmd, arg), > - TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_tgkill > -SC_TRACE_EVENT(sys_tgkill, > - TP_PROTO(pid_t tgid, pid_t pid, int sig), > - TP_ARGS(tgid, pid, sig), > - TP_STRUCT__entry(__field(pid_t, tgid) __field(pid_t, pid) __field(int, sig)), > - TP_fast_assign(tp_assign(tgid, tgid) tp_assign(pid, pid) tp_assign(sig, sig)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_socket > -SC_TRACE_EVENT(sys_socket, > - TP_PROTO(int family, int type, int protocol), > - TP_ARGS(family, type, protocol), > - TP_STRUCT__entry(__field(int, family) __field(int, type) __field(int, protocol)), > - TP_fast_assign(tp_assign(family, family) tp_assign(type, type) tp_assign(protocol, protocol)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_semget > -SC_TRACE_EVENT(sys_semget, > - TP_PROTO(key_t key, int nsems, int semflg), > - TP_ARGS(key, nsems, semflg), > - TP_STRUCT__entry(__field(key_t, key) __field(int, nsems) __field(int, semflg)), > - TP_fast_assign(tp_assign(key, key) tp_assign(nsems, nsems) tp_assign(semflg, semflg)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_shmget > -SC_TRACE_EVENT(sys_shmget, > - TP_PROTO(key_t key, size_t size, int shmflg), > - TP_ARGS(key, size, shmflg), > - TP_STRUCT__entry(__field(key_t, key) __field(size_t, size) __field(int, shmflg)), > - TP_fast_assign(tp_assign(key, key) tp_assign(size, size) tp_assign(shmflg, shmflg)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_ioprio_set > -SC_TRACE_EVENT(sys_ioprio_set, > - TP_PROTO(int which, int who, int ioprio), > - TP_ARGS(which, who, ioprio), > - TP_STRUCT__entry(__field(int, which) __field(int, who) __field(int, ioprio)), > - TP_fast_assign(tp_assign(which, which) tp_assign(who, who) tp_assign(ioprio, ioprio)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_dup3 > -SC_TRACE_EVENT(sys_dup3, > - TP_PROTO(unsigned int oldfd, unsigned int newfd, int flags), > - TP_ARGS(oldfd, newfd, flags), > - TP_STRUCT__entry(__field(unsigned int, oldfd) __field(unsigned int, newfd) __field(int, flags)), > - TP_fast_assign(tp_assign(oldfd, oldfd) tp_assign(newfd, newfd) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_ptrace > -SC_TRACE_EVENT(sys_ptrace, > - TP_PROTO(long request, long pid, unsigned long addr, unsigned long data), > - TP_ARGS(request, pid, addr, data), > - TP_STRUCT__entry(__field(long, request) __field(long, pid) __field_hex(unsigned long, addr) __field(unsigned long, data)), > - TP_fast_assign(tp_assign(request, request) tp_assign(pid, pid) tp_assign(addr, addr) tp_assign(data, data)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_tee > -SC_TRACE_EVENT(sys_tee, > - TP_PROTO(int fdin, int fdout, size_t len, unsigned int flags), > - TP_ARGS(fdin, fdout, len, flags), > - TP_STRUCT__entry(__field(int, fdin) __field(int, fdout) __field(size_t, len) __field(unsigned int, flags)), > - TP_fast_assign(tp_assign(fdin, fdin) tp_assign(fdout, fdout) tp_assign(len, len) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mremap > -SC_TRACE_EVENT(sys_mremap, > - TP_PROTO(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr), > - TP_ARGS(addr, old_len, new_len, flags, new_addr), > - TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(unsigned long, old_len) __field(unsigned long, new_len) __field(unsigned long, flags) __field_hex(unsigned long, new_addr)), > - TP_fast_assign(tp_assign(addr, addr) tp_assign(old_len, old_len) tp_assign(new_len, new_len) tp_assign(flags, flags) tp_assign(new_addr, new_addr)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_prctl > -SC_TRACE_EVENT(sys_prctl, > - TP_PROTO(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5), > - TP_ARGS(option, arg2, arg3, arg4, arg5), > - TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg2) __field(unsigned long, arg3) __field(unsigned long, arg4) __field(unsigned long, arg5)), > - TP_fast_assign(tp_assign(option, option) tp_assign(arg2, arg2) tp_assign(arg3, arg3) tp_assign(arg4, arg4) tp_assign(arg5, arg5)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_remap_file_pages > -SC_TRACE_EVENT(sys_remap_file_pages, > - TP_PROTO(unsigned long start, unsigned long size, unsigned long prot, unsigned long pgoff, unsigned long flags), > - TP_ARGS(start, size, prot, pgoff, flags), > - TP_STRUCT__entry(__field(unsigned long, start) __field(unsigned long, size) __field(unsigned long, prot) __field(unsigned long, pgoff) __field(unsigned long, flags)), > - TP_fast_assign(tp_assign(start, start) tp_assign(size, size) tp_assign(prot, prot) tp_assign(pgoff, pgoff) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_keyctl > -SC_TRACE_EVENT(sys_keyctl, > - TP_PROTO(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5), > - TP_ARGS(option, arg2, arg3, arg4, arg5), > - TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg2) __field(unsigned long, arg3) __field(unsigned long, arg4) __field(unsigned long, arg5)), > - TP_fast_assign(tp_assign(option, option) tp_assign(arg2, arg2) tp_assign(arg3, arg3) tp_assign(arg4, arg4) tp_assign(arg5, arg5)), > - TP_printk() > -) > -#endif > - > -#endif /* _TRACE_SYSCALLS_INTEGERS_H */ > - > -/* This part must be outside protection */ > -#include "../../../probes/define_trace.h" > - > -#else /* CREATE_SYSCALL_TABLE */ > - > -#include "arm-32-syscalls-2.6.38_integers_override.h" > -#include "syscalls_integers_override.h" > - > -#ifndef OVERRIDE_TABLE_32_sys_restart_syscall > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_restart_syscall, 0, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getpid > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getpid, 20, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getuid16 > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getuid16, 24, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_pause > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_pause, 29, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sync > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sync, 36, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getgid16 > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getgid16, 47, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_geteuid16 > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_geteuid16, 49, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getegid16 > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getegid16, 50, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getppid > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getppid, 64, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getpgrp > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getpgrp, 65, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setsid > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_setsid, 66, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_vhangup > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_vhangup, 111, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_munlockall > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_munlockall, 153, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sched_yield > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sched_yield, 158, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getuid > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getuid, 199, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getgid > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getgid, 200, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_geteuid > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_geteuid, 201, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getegid > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getegid, 202, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_gettid > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_gettid, 224, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_inotify_init > -TRACE_SYSCALL_TABLE(syscalls_noargs, sys_inotify_init, 316, 0) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_exit > -TRACE_SYSCALL_TABLE(sys_exit, sys_exit, 1, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_close > -TRACE_SYSCALL_TABLE(sys_close, sys_close, 6, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_lseek > -TRACE_SYSCALL_TABLE(sys_lseek, sys_lseek, 19, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setuid16 > -TRACE_SYSCALL_TABLE(sys_setuid16, sys_setuid16, 23, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_ptrace > -TRACE_SYSCALL_TABLE(sys_ptrace, sys_ptrace, 26, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_nice > -TRACE_SYSCALL_TABLE(sys_nice, sys_nice, 34, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_kill > -TRACE_SYSCALL_TABLE(sys_kill, sys_kill, 37, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_dup > -TRACE_SYSCALL_TABLE(sys_dup, sys_dup, 41, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_brk > -TRACE_SYSCALL_TABLE(sys_brk, sys_brk, 45, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setgid16 > -TRACE_SYSCALL_TABLE(sys_setgid16, sys_setgid16, 46, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_ioctl > -TRACE_SYSCALL_TABLE(sys_ioctl, sys_ioctl, 54, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fcntl > -TRACE_SYSCALL_TABLE(sys_fcntl, sys_fcntl, 55, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setpgid > -TRACE_SYSCALL_TABLE(sys_setpgid, sys_setpgid, 57, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_umask > -TRACE_SYSCALL_TABLE(sys_umask, sys_umask, 60, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_dup2 > -TRACE_SYSCALL_TABLE(sys_dup2, sys_dup2, 63, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setreuid16 > -TRACE_SYSCALL_TABLE(sys_setreuid16, sys_setreuid16, 70, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setregid16 > -TRACE_SYSCALL_TABLE(sys_setregid16, sys_setregid16, 71, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_munmap > -TRACE_SYSCALL_TABLE(sys_munmap, sys_munmap, 91, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_ftruncate > -TRACE_SYSCALL_TABLE(sys_ftruncate, sys_ftruncate, 93, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fchmod > -TRACE_SYSCALL_TABLE(sys_fchmod, sys_fchmod, 94, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fchown16 > -TRACE_SYSCALL_TABLE(sys_fchown16, sys_fchown16, 95, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getpriority > -TRACE_SYSCALL_TABLE(sys_getpriority, sys_getpriority, 96, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setpriority > -TRACE_SYSCALL_TABLE(sys_setpriority, sys_setpriority, 97, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fsync > -TRACE_SYSCALL_TABLE(sys_fsync, sys_fsync, 118, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mprotect > -TRACE_SYSCALL_TABLE(sys_mprotect, sys_mprotect, 125, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getpgid > -TRACE_SYSCALL_TABLE(sys_getpgid, sys_getpgid, 132, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fchdir > -TRACE_SYSCALL_TABLE(sys_fchdir, sys_fchdir, 133, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_bdflush > -TRACE_SYSCALL_TABLE(sys_bdflush, sys_bdflush, 134, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sysfs > -TRACE_SYSCALL_TABLE(sys_sysfs, sys_sysfs, 135, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_personality > -TRACE_SYSCALL_TABLE(sys_personality, sys_personality, 136, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setfsuid16 > -TRACE_SYSCALL_TABLE(sys_setfsuid16, sys_setfsuid16, 138, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setfsgid16 > -TRACE_SYSCALL_TABLE(sys_setfsgid16, sys_setfsgid16, 139, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_flock > -TRACE_SYSCALL_TABLE(sys_flock, sys_flock, 143, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_msync > -TRACE_SYSCALL_TABLE(sys_msync, sys_msync, 144, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getsid > -TRACE_SYSCALL_TABLE(sys_getsid, sys_getsid, 147, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fdatasync > -TRACE_SYSCALL_TABLE(sys_fdatasync, sys_fdatasync, 148, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mlock > -TRACE_SYSCALL_TABLE(sys_mlock, sys_mlock, 150, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_munlock > -TRACE_SYSCALL_TABLE(sys_munlock, sys_munlock, 151, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mlockall > -TRACE_SYSCALL_TABLE(sys_mlockall, sys_mlockall, 152, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sched_getscheduler > -TRACE_SYSCALL_TABLE(sys_sched_getscheduler, sys_sched_getscheduler, 157, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sched_get_priority_max > -TRACE_SYSCALL_TABLE(sys_sched_get_priority_max, sys_sched_get_priority_max, 159, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sched_get_priority_min > -TRACE_SYSCALL_TABLE(sys_sched_get_priority_min, sys_sched_get_priority_min, 160, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mremap > -TRACE_SYSCALL_TABLE(sys_mremap, sys_mremap, 163, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setresuid16 > -TRACE_SYSCALL_TABLE(sys_setresuid16, sys_setresuid16, 164, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setresgid16 > -TRACE_SYSCALL_TABLE(sys_setresgid16, sys_setresgid16, 170, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_prctl > -TRACE_SYSCALL_TABLE(sys_prctl, sys_prctl, 172, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setreuid > -TRACE_SYSCALL_TABLE(sys_setreuid, sys_setreuid, 203, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setregid > -TRACE_SYSCALL_TABLE(sys_setregid, sys_setregid, 204, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fchown > -TRACE_SYSCALL_TABLE(sys_fchown, sys_fchown, 207, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setresuid > -TRACE_SYSCALL_TABLE(sys_setresuid, sys_setresuid, 208, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setresgid > -TRACE_SYSCALL_TABLE(sys_setresgid, sys_setresgid, 210, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setuid > -TRACE_SYSCALL_TABLE(sys_setuid, sys_setuid, 213, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setgid > -TRACE_SYSCALL_TABLE(sys_setgid, sys_setgid, 214, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setfsuid > -TRACE_SYSCALL_TABLE(sys_setfsuid, sys_setfsuid, 215, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setfsgid > -TRACE_SYSCALL_TABLE(sys_setfsgid, sys_setfsgid, 216, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_madvise > -TRACE_SYSCALL_TABLE(sys_madvise, sys_madvise, 220, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fcntl64 > -TRACE_SYSCALL_TABLE(sys_fcntl64, sys_fcntl64, 221, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_tkill > -TRACE_SYSCALL_TABLE(sys_tkill, sys_tkill, 238, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_io_destroy > -TRACE_SYSCALL_TABLE(sys_io_destroy, sys_io_destroy, 244, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_exit_group > -TRACE_SYSCALL_TABLE(sys_exit_group, sys_exit_group, 248, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_epoll_create > -TRACE_SYSCALL_TABLE(sys_epoll_create, sys_epoll_create, 250, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_remap_file_pages > -TRACE_SYSCALL_TABLE(sys_remap_file_pages, sys_remap_file_pages, 253, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_timer_getoverrun > -TRACE_SYSCALL_TABLE(sys_timer_getoverrun, sys_timer_getoverrun, 260, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_timer_delete > -TRACE_SYSCALL_TABLE(sys_timer_delete, sys_timer_delete, 261, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_tgkill > -TRACE_SYSCALL_TABLE(sys_tgkill, sys_tgkill, 268, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_socket > -TRACE_SYSCALL_TABLE(sys_socket, sys_socket, 281, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_listen > -TRACE_SYSCALL_TABLE(sys_listen, sys_listen, 284, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_shutdown > -TRACE_SYSCALL_TABLE(sys_shutdown, sys_shutdown, 293, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_semget > -TRACE_SYSCALL_TABLE(sys_semget, sys_semget, 299, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_msgget > -TRACE_SYSCALL_TABLE(sys_msgget, sys_msgget, 303, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_shmget > -TRACE_SYSCALL_TABLE(sys_shmget, sys_shmget, 307, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_keyctl > -TRACE_SYSCALL_TABLE(sys_keyctl, sys_keyctl, 311, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_ioprio_set > -TRACE_SYSCALL_TABLE(sys_ioprio_set, sys_ioprio_set, 314, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_ioprio_get > -TRACE_SYSCALL_TABLE(sys_ioprio_get, sys_ioprio_get, 315, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_inotify_rm_watch > -TRACE_SYSCALL_TABLE(sys_inotify_rm_watch, sys_inotify_rm_watch, 318, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_unshare > -TRACE_SYSCALL_TABLE(sys_unshare, sys_unshare, 337, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_tee > -TRACE_SYSCALL_TABLE(sys_tee, sys_tee, 342, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_timerfd_create > -TRACE_SYSCALL_TABLE(sys_timerfd_create, sys_timerfd_create, 350, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_eventfd > -TRACE_SYSCALL_TABLE(sys_eventfd, sys_eventfd, 351, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_eventfd2 > -TRACE_SYSCALL_TABLE(sys_eventfd2, sys_eventfd2, 356, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_epoll_create1 > -TRACE_SYSCALL_TABLE(sys_epoll_create1, sys_epoll_create1, 357, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_dup3 > -TRACE_SYSCALL_TABLE(sys_dup3, sys_dup3, 358, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_inotify_init1 > -TRACE_SYSCALL_TABLE(sys_inotify_init1, sys_inotify_init1, 360, 1) > -#endif > - > -#endif /* CREATE_SYSCALL_TABLE */ > diff --git a/instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_integers_override.h b/instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_integers_override.h > deleted file mode 100644 > index 895370f..0000000 > --- a/instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_integers_override.h > +++ /dev/null > @@ -1,52 +0,0 @@ > - > - > -#define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 > -#define OVERRIDE_TABLE_32_sys_sync_file_range2 > - > -#ifndef CREATE_SYSCALL_TABLE > - > -SC_TRACE_EVENT(sys_arm_fadvise64_64, > - TP_PROTO(int fd, int advice, loff_t offset, loff_t len), > - TP_ARGS(fd, advice, offset, len), > - TP_STRUCT__entry( > - __field_hex(int, fd) > - __field_hex(int, advice) > - __field_hex(loff_t, offset) > - __field_hex(loff_t, len)), > - TP_fast_assign( > - tp_assign(fd, fd) > - tp_assign(advice, advice) > - tp_assign(offset, offset) > - tp_assign(len, len)), > - TP_printk() > -) > - > -SC_TRACE_EVENT(sys_sync_file_range2, > - TP_PROTO(int fd, loff_t offset, loff_t nbytes, unsigned int flags), > - TP_ARGS(fd, offset, nbytes, flags), > - TP_STRUCT__entry( > - __field_hex(int, fd) > - __field_hex(loff_t, offset) > - __field_hex(loff_t, nbytes) > - __field_hex(unsigned int, flags)), > - TP_fast_assign( > - tp_assign(fd, fd) > - tp_assign(offset, offset) > - tp_assign(nbytes, nbytes) > - tp_assign(flags, flags)), > - TP_printk() > -) > - > -#else /* CREATE_SYSCALL_TABLE */ > - > -#define OVVERRIDE_TABLE_32_sys_mmap > -TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) > - > -#define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 > -TRACE_SYSCALL_TABLE(sys_arm_fadvise64_64, sys_arm_fadvise64_64, 270, 4) > -#define OVERRIDE_TABLE_32_sys_sync_file_range2 > -TRACE_SYSCALL_TABLE(sys_sync_file_range2, sys_sync_file_range2, 341, 4) > - > -#endif /* CREATE_SYSCALL_TABLE */ > - > - > diff --git a/instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_pointers.h b/instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_pointers.h > deleted file mode 100644 > index fc3d8a1..0000000 > --- a/instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_pointers.h > +++ /dev/null > @@ -1,2184 +0,0 @@ > -/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */ > -#ifndef CREATE_SYSCALL_TABLE > - > -#if !defined(_TRACE_SYSCALLS_POINTERS_H) || defined(TRACE_HEADER_MULTI_READ) > -#define _TRACE_SYSCALLS_POINTERS_H > - > -#include > -#include > -#include "arm-32-syscalls-2.6.38_pointers_override.h" > -#include "syscalls_pointers_override.h" > - > -#ifndef OVERRIDE_32_sys_unlink > -SC_TRACE_EVENT(sys_unlink, > - TP_PROTO(const char * pathname), > - TP_ARGS(pathname), > - TP_STRUCT__entry(__string_from_user(pathname, pathname)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_chdir > -SC_TRACE_EVENT(sys_chdir, > - TP_PROTO(const char * filename), > - TP_ARGS(filename), > - TP_STRUCT__entry(__string_from_user(filename, filename)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_rmdir > -SC_TRACE_EVENT(sys_rmdir, > - TP_PROTO(const char * pathname), > - TP_ARGS(pathname), > - TP_STRUCT__entry(__string_from_user(pathname, pathname)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_pipe > -SC_TRACE_EVENT(sys_pipe, > - TP_PROTO(int * fildes), > - TP_ARGS(fildes), > - TP_STRUCT__entry(__field_hex(int *, fildes)), > - TP_fast_assign(tp_assign(fildes, fildes)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_times > -SC_TRACE_EVENT(sys_times, > - TP_PROTO(struct tms * tbuf), > - TP_ARGS(tbuf), > - TP_STRUCT__entry(__field_hex(struct tms *, tbuf)), > - TP_fast_assign(tp_assign(tbuf, tbuf)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_chroot > -SC_TRACE_EVENT(sys_chroot, > - TP_PROTO(const char * filename), > - TP_ARGS(filename), > - TP_STRUCT__entry(__string_from_user(filename, filename)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sigpending > -SC_TRACE_EVENT(sys_sigpending, > - TP_PROTO(old_sigset_t * set), > - TP_ARGS(set), > - TP_STRUCT__entry(__field_hex(old_sigset_t *, set)), > - TP_fast_assign(tp_assign(set, set)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_uselib > -SC_TRACE_EVENT(sys_uselib, > - TP_PROTO(const char * library), > - TP_ARGS(library), > - TP_STRUCT__entry(__field_hex(const char *, library)), > - TP_fast_assign(tp_assign(library, library)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sysinfo > -SC_TRACE_EVENT(sys_sysinfo, > - TP_PROTO(struct sysinfo * info), > - TP_ARGS(info), > - TP_STRUCT__entry(__field_hex(struct sysinfo *, info)), > - TP_fast_assign(tp_assign(info, info)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_newuname > -SC_TRACE_EVENT(sys_newuname, > - TP_PROTO(struct new_utsname * name), > - TP_ARGS(name), > - TP_STRUCT__entry(__field_hex(struct new_utsname *, name)), > - TP_fast_assign(tp_assign(name, name)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_adjtimex > -SC_TRACE_EVENT(sys_adjtimex, > - TP_PROTO(struct timex * txc_p), > - TP_ARGS(txc_p), > - TP_STRUCT__entry(__field_hex(struct timex *, txc_p)), > - TP_fast_assign(tp_assign(txc_p, txc_p)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sysctl > -SC_TRACE_EVENT(sys_sysctl, > - TP_PROTO(struct __sysctl_args * args), > - TP_ARGS(args), > - TP_STRUCT__entry(__field_hex(struct __sysctl_args *, args)), > - TP_fast_assign(tp_assign(args, args)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_set_tid_address > -SC_TRACE_EVENT(sys_set_tid_address, > - TP_PROTO(int * tidptr), > - TP_ARGS(tidptr), > - TP_STRUCT__entry(__field_hex(int *, tidptr)), > - TP_fast_assign(tp_assign(tidptr, tidptr)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mq_unlink > -SC_TRACE_EVENT(sys_mq_unlink, > - TP_PROTO(const char * u_name), > - TP_ARGS(u_name), > - TP_STRUCT__entry(__string_from_user(u_name, u_name)), > - TP_fast_assign(tp_copy_string_from_user(u_name, u_name)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_shmdt > -SC_TRACE_EVENT(sys_shmdt, > - TP_PROTO(char * shmaddr), > - TP_ARGS(shmaddr), > - TP_STRUCT__entry(__field_hex(char *, shmaddr)), > - TP_fast_assign(tp_assign(shmaddr, shmaddr)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_creat > -SC_TRACE_EVENT(sys_creat, > - TP_PROTO(const char * pathname, int mode), > - TP_ARGS(pathname, mode), > - TP_STRUCT__entry(__string_from_user(pathname, pathname) __field(int, mode)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_link > -SC_TRACE_EVENT(sys_link, > - TP_PROTO(const char * oldname, const char * newname), > - TP_ARGS(oldname, newname), > - TP_STRUCT__entry(__string_from_user(oldname, oldname) __string_from_user(newname, newname)), > - TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_copy_string_from_user(newname, newname)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_chmod > -SC_TRACE_EVENT(sys_chmod, > - TP_PROTO(const char * filename, mode_t mode), > - TP_ARGS(filename, mode), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field(mode_t, mode)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_access > -SC_TRACE_EVENT(sys_access, > - TP_PROTO(const char * filename, int mode), > - TP_ARGS(filename, mode), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field(int, mode)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_rename > -SC_TRACE_EVENT(sys_rename, > - TP_PROTO(const char * oldname, const char * newname), > - TP_ARGS(oldname, newname), > - TP_STRUCT__entry(__string_from_user(oldname, oldname) __string_from_user(newname, newname)), > - TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_copy_string_from_user(newname, newname)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mkdir > -SC_TRACE_EVENT(sys_mkdir, > - TP_PROTO(const char * pathname, int mode), > - TP_ARGS(pathname, mode), > - TP_STRUCT__entry(__string_from_user(pathname, pathname) __field(int, mode)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_umount > -SC_TRACE_EVENT(sys_umount, > - TP_PROTO(char * name, int flags), > - TP_ARGS(name, flags), > - TP_STRUCT__entry(__string_from_user(name, name) __field(int, flags)), > - TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_ustat > -SC_TRACE_EVENT(sys_ustat, > - TP_PROTO(unsigned dev, struct ustat * ubuf), > - TP_ARGS(dev, ubuf), > - TP_STRUCT__entry(__field(unsigned, dev) __field_hex(struct ustat *, ubuf)), > - TP_fast_assign(tp_assign(dev, dev) tp_assign(ubuf, ubuf)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sethostname > -SC_TRACE_EVENT(sys_sethostname, > - TP_PROTO(char * name, int len), > - TP_ARGS(name, len), > - TP_STRUCT__entry(__string_from_user(name, name) __field(int, len)), > - TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(len, len)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setrlimit > -SC_TRACE_EVENT(sys_setrlimit, > - TP_PROTO(unsigned int resource, struct rlimit * rlim), > - TP_ARGS(resource, rlim), > - TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), > - TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getrusage > -SC_TRACE_EVENT(sys_getrusage, > - TP_PROTO(int who, struct rusage * ru), > - TP_ARGS(who, ru), > - TP_STRUCT__entry(__field(int, who) __field_hex(struct rusage *, ru)), > - TP_fast_assign(tp_assign(who, who) tp_assign(ru, ru)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_gettimeofday > -SC_TRACE_EVENT(sys_gettimeofday, > - TP_PROTO(struct timeval * tv, struct timezone * tz), > - TP_ARGS(tv, tz), > - TP_STRUCT__entry(__field_hex(struct timeval *, tv) __field_hex(struct timezone *, tz)), > - TP_fast_assign(tp_assign(tv, tv) tp_assign(tz, tz)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_settimeofday > -SC_TRACE_EVENT(sys_settimeofday, > - TP_PROTO(struct timeval * tv, struct timezone * tz), > - TP_ARGS(tv, tz), > - TP_STRUCT__entry(__field_hex(struct timeval *, tv) __field_hex(struct timezone *, tz)), > - TP_fast_assign(tp_assign(tv, tv) tp_assign(tz, tz)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getgroups16 > -SC_TRACE_EVENT(sys_getgroups16, > - TP_PROTO(int gidsetsize, old_gid_t * grouplist), > - TP_ARGS(gidsetsize, grouplist), > - TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(old_gid_t *, grouplist)), > - TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setgroups16 > -SC_TRACE_EVENT(sys_setgroups16, > - TP_PROTO(int gidsetsize, old_gid_t * grouplist), > - TP_ARGS(gidsetsize, grouplist), > - TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(old_gid_t *, grouplist)), > - TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_symlink > -SC_TRACE_EVENT(sys_symlink, > - TP_PROTO(const char * oldname, const char * newname), > - TP_ARGS(oldname, newname), > - TP_STRUCT__entry(__string_from_user(oldname, oldname) __string_from_user(newname, newname)), > - TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_copy_string_from_user(newname, newname)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_truncate > -SC_TRACE_EVENT(sys_truncate, > - TP_PROTO(const char * path, long length), > - TP_ARGS(path, length), > - TP_STRUCT__entry(__string_from_user(path, path) __field(long, length)), > - TP_fast_assign(tp_copy_string_from_user(path, path) tp_assign(length, length)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_statfs > -SC_TRACE_EVENT(sys_statfs, > - TP_PROTO(const char * pathname, struct statfs * buf), > - TP_ARGS(pathname, buf), > - TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(struct statfs *, buf)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(buf, buf)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fstatfs > -SC_TRACE_EVENT(sys_fstatfs, > - TP_PROTO(unsigned int fd, struct statfs * buf), > - TP_ARGS(fd, buf), > - TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct statfs *, buf)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getitimer > -SC_TRACE_EVENT(sys_getitimer, > - TP_PROTO(int which, struct itimerval * value), > - TP_ARGS(which, value), > - TP_STRUCT__entry(__field(int, which) __field_hex(struct itimerval *, value)), > - TP_fast_assign(tp_assign(which, which) tp_assign(value, value)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_newstat > -SC_TRACE_EVENT(sys_newstat, > - TP_PROTO(const char * filename, struct stat * statbuf), > - TP_ARGS(filename, statbuf), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat *, statbuf)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_newlstat > -SC_TRACE_EVENT(sys_newlstat, > - TP_PROTO(const char * filename, struct stat * statbuf), > - TP_ARGS(filename, statbuf), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat *, statbuf)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_newfstat > -SC_TRACE_EVENT(sys_newfstat, > - TP_PROTO(unsigned int fd, struct stat * statbuf), > - TP_ARGS(fd, statbuf), > - TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct stat *, statbuf)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(statbuf, statbuf)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setdomainname > -SC_TRACE_EVENT(sys_setdomainname, > - TP_PROTO(char * name, int len), > - TP_ARGS(name, len), > - TP_STRUCT__entry(__string_from_user(name, name) __field(int, len)), > - TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(len, len)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_delete_module > -SC_TRACE_EVENT(sys_delete_module, > - TP_PROTO(const char * name_user, unsigned int flags), > - TP_ARGS(name_user, flags), > - TP_STRUCT__entry(__string_from_user(name_user, name_user) __field(unsigned int, flags)), > - TP_fast_assign(tp_copy_string_from_user(name_user, name_user) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sched_setparam > -SC_TRACE_EVENT(sys_sched_setparam, > - TP_PROTO(pid_t pid, struct sched_param * param), > - TP_ARGS(pid, param), > - TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct sched_param *, param)), > - TP_fast_assign(tp_assign(pid, pid) tp_assign(param, param)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sched_getparam > -SC_TRACE_EVENT(sys_sched_getparam, > - TP_PROTO(pid_t pid, struct sched_param * param), > - TP_ARGS(pid, param), > - TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct sched_param *, param)), > - TP_fast_assign(tp_assign(pid, pid) tp_assign(param, param)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sched_rr_get_interval > -SC_TRACE_EVENT(sys_sched_rr_get_interval, > - TP_PROTO(pid_t pid, struct timespec * interval), > - TP_ARGS(pid, interval), > - TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct timespec *, interval)), > - TP_fast_assign(tp_assign(pid, pid) tp_assign(interval, interval)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_nanosleep > -SC_TRACE_EVENT(sys_nanosleep, > - TP_PROTO(struct timespec * rqtp, struct timespec * rmtp), > - TP_ARGS(rqtp, rmtp), > - TP_STRUCT__entry(__field_hex(struct timespec *, rqtp) __field_hex(struct timespec *, rmtp)), > - TP_fast_assign(tp_assign(rqtp, rqtp) tp_assign(rmtp, rmtp)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_rt_sigpending > -SC_TRACE_EVENT(sys_rt_sigpending, > - TP_PROTO(sigset_t * set, size_t sigsetsize), > - TP_ARGS(set, sigsetsize), > - TP_STRUCT__entry(__field_hex(sigset_t *, set) __field(size_t, sigsetsize)), > - TP_fast_assign(tp_assign(set, set) tp_assign(sigsetsize, sigsetsize)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_rt_sigsuspend > -SC_TRACE_EVENT(sys_rt_sigsuspend, > - TP_PROTO(sigset_t * unewset, size_t sigsetsize), > - TP_ARGS(unewset, sigsetsize), > - TP_STRUCT__entry(__field_hex(sigset_t *, unewset) __field(size_t, sigsetsize)), > - TP_fast_assign(tp_assign(unewset, unewset) tp_assign(sigsetsize, sigsetsize)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getcwd > -SC_TRACE_EVENT(sys_getcwd, > - TP_PROTO(char * buf, unsigned long size), > - TP_ARGS(buf, size), > - TP_STRUCT__entry(__field_hex(char *, buf) __field(unsigned long, size)), > - TP_fast_assign(tp_assign(buf, buf) tp_assign(size, size)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getrlimit > -SC_TRACE_EVENT(sys_getrlimit, > - TP_PROTO(unsigned int resource, struct rlimit * rlim), > - TP_ARGS(resource, rlim), > - TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), > - TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_stat64 > -SC_TRACE_EVENT(sys_stat64, > - TP_PROTO(const char * filename, struct stat64 * statbuf), > - TP_ARGS(filename, statbuf), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat64 *, statbuf)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_lstat64 > -SC_TRACE_EVENT(sys_lstat64, > - TP_PROTO(const char * filename, struct stat64 * statbuf), > - TP_ARGS(filename, statbuf), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat64 *, statbuf)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fstat64 > -SC_TRACE_EVENT(sys_fstat64, > - TP_PROTO(unsigned long fd, struct stat64 * statbuf), > - TP_ARGS(fd, statbuf), > - TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(struct stat64 *, statbuf)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(statbuf, statbuf)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getgroups > -SC_TRACE_EVENT(sys_getgroups, > - TP_PROTO(int gidsetsize, gid_t * grouplist), > - TP_ARGS(gidsetsize, grouplist), > - TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(gid_t *, grouplist)), > - TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setgroups > -SC_TRACE_EVENT(sys_setgroups, > - TP_PROTO(int gidsetsize, gid_t * grouplist), > - TP_ARGS(gidsetsize, grouplist), > - TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(gid_t *, grouplist)), > - TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_pivot_root > -SC_TRACE_EVENT(sys_pivot_root, > - TP_PROTO(const char * new_root, const char * put_old), > - TP_ARGS(new_root, put_old), > - TP_STRUCT__entry(__string_from_user(new_root, new_root) __string_from_user(put_old, put_old)), > - TP_fast_assign(tp_copy_string_from_user(new_root, new_root) tp_copy_string_from_user(put_old, put_old)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_removexattr > -SC_TRACE_EVENT(sys_removexattr, > - TP_PROTO(const char * pathname, const char * name), > - TP_ARGS(pathname, name), > - TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_lremovexattr > -SC_TRACE_EVENT(sys_lremovexattr, > - TP_PROTO(const char * pathname, const char * name), > - TP_ARGS(pathname, name), > - TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fremovexattr > -SC_TRACE_EVENT(sys_fremovexattr, > - TP_PROTO(int fd, const char * name), > - TP_ARGS(fd, name), > - TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name)), > - TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_io_setup > -SC_TRACE_EVENT(sys_io_setup, > - TP_PROTO(unsigned nr_events, aio_context_t * ctxp), > - TP_ARGS(nr_events, ctxp), > - TP_STRUCT__entry(__field(unsigned, nr_events) __field_hex(aio_context_t *, ctxp)), > - TP_fast_assign(tp_assign(nr_events, nr_events) tp_assign(ctxp, ctxp)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_timer_gettime > -SC_TRACE_EVENT(sys_timer_gettime, > - TP_PROTO(timer_t timer_id, struct itimerspec * setting), > - TP_ARGS(timer_id, setting), > - TP_STRUCT__entry(__field(timer_t, timer_id) __field_hex(struct itimerspec *, setting)), > - TP_fast_assign(tp_assign(timer_id, timer_id) tp_assign(setting, setting)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_clock_settime > -SC_TRACE_EVENT(sys_clock_settime, > - TP_PROTO(const clockid_t which_clock, const struct timespec * tp), > - TP_ARGS(which_clock, tp), > - TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(const struct timespec *, tp)), > - TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_clock_gettime > -SC_TRACE_EVENT(sys_clock_gettime, > - TP_PROTO(const clockid_t which_clock, struct timespec * tp), > - TP_ARGS(which_clock, tp), > - TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timespec *, tp)), > - TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_clock_getres > -SC_TRACE_EVENT(sys_clock_getres, > - TP_PROTO(const clockid_t which_clock, struct timespec * tp), > - TP_ARGS(which_clock, tp), > - TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timespec *, tp)), > - TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_utimes > -SC_TRACE_EVENT(sys_utimes, > - TP_PROTO(char * filename, struct timeval * utimes), > - TP_ARGS(filename, utimes), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct timeval *, utimes)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mq_notify > -SC_TRACE_EVENT(sys_mq_notify, > - TP_PROTO(mqd_t mqdes, const struct sigevent * u_notification), > - TP_ARGS(mqdes, u_notification), > - TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const struct sigevent *, u_notification)), > - TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_notification, u_notification)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_set_robust_list > -SC_TRACE_EVENT(sys_set_robust_list, > - TP_PROTO(struct robust_list_head * head, size_t len), > - TP_ARGS(head, len), > - TP_STRUCT__entry(__field_hex(struct robust_list_head *, head) __field(size_t, len)), > - TP_fast_assign(tp_assign(head, head) tp_assign(len, len)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_timerfd_gettime > -SC_TRACE_EVENT(sys_timerfd_gettime, > - TP_PROTO(int ufd, struct itimerspec * otmr), > - TP_ARGS(ufd, otmr), > - TP_STRUCT__entry(__field(int, ufd) __field_hex(struct itimerspec *, otmr)), > - TP_fast_assign(tp_assign(ufd, ufd) tp_assign(otmr, otmr)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_pipe2 > -SC_TRACE_EVENT(sys_pipe2, > - TP_PROTO(int * fildes, int flags), > - TP_ARGS(fildes, flags), > - TP_STRUCT__entry(__field_hex(int *, fildes) __field(int, flags)), > - TP_fast_assign(tp_assign(fildes, fildes) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_read > -SC_TRACE_EVENT(sys_read, > - TP_PROTO(unsigned int fd, char * buf, size_t count), > - TP_ARGS(fd, buf, count), > - TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(char *, buf) __field(size_t, count)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_write > -SC_TRACE_EVENT(sys_write, > - TP_PROTO(unsigned int fd, const char * buf, size_t count), > - TP_ARGS(fd, buf, count), > - TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_open > -SC_TRACE_EVENT(sys_open, > - TP_PROTO(const char * filename, int flags, int mode), > - TP_ARGS(filename, flags, mode), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field(int, flags) __field(int, mode)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(flags, flags) tp_assign(mode, mode)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mknod > -SC_TRACE_EVENT(sys_mknod, > - TP_PROTO(const char * filename, int mode, unsigned dev), > - TP_ARGS(filename, mode, dev), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field(int, mode) __field(unsigned, dev)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(mode, mode) tp_assign(dev, dev)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_lchown16 > -SC_TRACE_EVENT(sys_lchown16, > - TP_PROTO(const char * filename, old_uid_t user, old_gid_t group), > - TP_ARGS(filename, user, group), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field(old_uid_t, user) __field(old_gid_t, group)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_readlink > -SC_TRACE_EVENT(sys_readlink, > - TP_PROTO(const char * path, char * buf, int bufsiz), > - TP_ARGS(path, buf, bufsiz), > - TP_STRUCT__entry(__string_from_user(path, path) __field_hex(char *, buf) __field(int, bufsiz)), > - TP_fast_assign(tp_copy_string_from_user(path, path) tp_assign(buf, buf) tp_assign(bufsiz, bufsiz)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_syslog > -SC_TRACE_EVENT(sys_syslog, > - TP_PROTO(int type, char * buf, int len), > - TP_ARGS(type, buf, len), > - TP_STRUCT__entry(__field(int, type) __field_hex(char *, buf) __field(int, len)), > - TP_fast_assign(tp_assign(type, type) tp_assign(buf, buf) tp_assign(len, len)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setitimer > -SC_TRACE_EVENT(sys_setitimer, > - TP_PROTO(int which, struct itimerval * value, struct itimerval * ovalue), > - TP_ARGS(which, value, ovalue), > - TP_STRUCT__entry(__field(int, which) __field_hex(struct itimerval *, value) __field_hex(struct itimerval *, ovalue)), > - TP_fast_assign(tp_assign(which, which) tp_assign(value, value) tp_assign(ovalue, ovalue)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sigprocmask > -SC_TRACE_EVENT(sys_sigprocmask, > - TP_PROTO(int how, old_sigset_t * set, old_sigset_t * oset), > - TP_ARGS(how, set, oset), > - TP_STRUCT__entry(__field(int, how) __field_hex(old_sigset_t *, set) __field_hex(old_sigset_t *, oset)), > - TP_fast_assign(tp_assign(how, how) tp_assign(set, set) tp_assign(oset, oset)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_init_module > -SC_TRACE_EVENT(sys_init_module, > - TP_PROTO(void * umod, unsigned long len, const char * uargs), > - TP_ARGS(umod, len, uargs), > - TP_STRUCT__entry(__field_hex(void *, umod) __field(unsigned long, len) __field_hex(const char *, uargs)), > - TP_fast_assign(tp_assign(umod, umod) tp_assign(len, len) tp_assign(uargs, uargs)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getdents > -SC_TRACE_EVENT(sys_getdents, > - TP_PROTO(unsigned int fd, struct linux_dirent * dirent, unsigned int count), > - TP_ARGS(fd, dirent, count), > - TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct linux_dirent *, dirent) __field(unsigned int, count)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(dirent, dirent) tp_assign(count, count)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_readv > -SC_TRACE_EVENT(sys_readv, > - TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen), > - TP_ARGS(fd, vec, vlen), > - TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_writev > -SC_TRACE_EVENT(sys_writev, > - TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen), > - TP_ARGS(fd, vec, vlen), > - TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sched_setscheduler > -SC_TRACE_EVENT(sys_sched_setscheduler, > - TP_PROTO(pid_t pid, int policy, struct sched_param * param), > - TP_ARGS(pid, policy, param), > - TP_STRUCT__entry(__field(pid_t, pid) __field(int, policy) __field_hex(struct sched_param *, param)), > - TP_fast_assign(tp_assign(pid, pid) tp_assign(policy, policy) tp_assign(param, param)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getresuid16 > -SC_TRACE_EVENT(sys_getresuid16, > - TP_PROTO(old_uid_t * ruid, old_uid_t * euid, old_uid_t * suid), > - TP_ARGS(ruid, euid, suid), > - TP_STRUCT__entry(__field_hex(old_uid_t *, ruid) __field_hex(old_uid_t *, euid) __field_hex(old_uid_t *, suid)), > - TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_poll > -SC_TRACE_EVENT(sys_poll, > - TP_PROTO(struct pollfd * ufds, unsigned int nfds, long timeout_msecs), > - TP_ARGS(ufds, nfds, timeout_msecs), > - TP_STRUCT__entry(__field_hex(struct pollfd *, ufds) __field(unsigned int, nfds) __field(long, timeout_msecs)), > - TP_fast_assign(tp_assign(ufds, ufds) tp_assign(nfds, nfds) tp_assign(timeout_msecs, timeout_msecs)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getresgid16 > -SC_TRACE_EVENT(sys_getresgid16, > - TP_PROTO(old_gid_t * rgid, old_gid_t * egid, old_gid_t * sgid), > - TP_ARGS(rgid, egid, sgid), > - TP_STRUCT__entry(__field_hex(old_gid_t *, rgid) __field_hex(old_gid_t *, egid) __field_hex(old_gid_t *, sgid)), > - TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_rt_sigqueueinfo > -SC_TRACE_EVENT(sys_rt_sigqueueinfo, > - TP_PROTO(pid_t pid, int sig, siginfo_t * uinfo), > - TP_ARGS(pid, sig, uinfo), > - TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig) __field_hex(siginfo_t *, uinfo)), > - TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig) tp_assign(uinfo, uinfo)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_chown16 > -SC_TRACE_EVENT(sys_chown16, > - TP_PROTO(const char * filename, old_uid_t user, old_gid_t group), > - TP_ARGS(filename, user, group), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field(old_uid_t, user) __field(old_gid_t, group)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_lchown > -SC_TRACE_EVENT(sys_lchown, > - TP_PROTO(const char * filename, uid_t user, gid_t group), > - TP_ARGS(filename, user, group), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getresuid > -SC_TRACE_EVENT(sys_getresuid, > - TP_PROTO(uid_t * ruid, uid_t * euid, uid_t * suid), > - TP_ARGS(ruid, euid, suid), > - TP_STRUCT__entry(__field_hex(uid_t *, ruid) __field_hex(uid_t *, euid) __field_hex(uid_t *, suid)), > - TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getresgid > -SC_TRACE_EVENT(sys_getresgid, > - TP_PROTO(gid_t * rgid, gid_t * egid, gid_t * sgid), > - TP_ARGS(rgid, egid, sgid), > - TP_STRUCT__entry(__field_hex(gid_t *, rgid) __field_hex(gid_t *, egid) __field_hex(gid_t *, sgid)), > - TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_chown > -SC_TRACE_EVENT(sys_chown, > - TP_PROTO(const char * filename, uid_t user, gid_t group), > - TP_ARGS(filename, user, group), > - TP_STRUCT__entry(__string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group)), > - TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getdents64 > -SC_TRACE_EVENT(sys_getdents64, > - TP_PROTO(unsigned int fd, struct linux_dirent64 * dirent, unsigned int count), > - TP_ARGS(fd, dirent, count), > - TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct linux_dirent64 *, dirent) __field(unsigned int, count)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(dirent, dirent) tp_assign(count, count)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mincore > -SC_TRACE_EVENT(sys_mincore, > - TP_PROTO(unsigned long start, size_t len, unsigned char * vec), > - TP_ARGS(start, len, vec), > - TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field_hex(unsigned char *, vec)), > - TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(vec, vec)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_listxattr > -SC_TRACE_EVENT(sys_listxattr, > - TP_PROTO(const char * pathname, char * list, size_t size), > - TP_ARGS(pathname, list, size), > - TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(char *, list) __field(size_t, size)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(list, list) tp_assign(size, size)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_llistxattr > -SC_TRACE_EVENT(sys_llistxattr, > - TP_PROTO(const char * pathname, char * list, size_t size), > - TP_ARGS(pathname, list, size), > - TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(char *, list) __field(size_t, size)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(list, list) tp_assign(size, size)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_flistxattr > -SC_TRACE_EVENT(sys_flistxattr, > - TP_PROTO(int fd, char * list, size_t size), > - TP_ARGS(fd, list, size), > - TP_STRUCT__entry(__field(int, fd) __field_hex(char *, list) __field(size_t, size)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(list, list) tp_assign(size, size)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sched_setaffinity > -SC_TRACE_EVENT(sys_sched_setaffinity, > - TP_PROTO(pid_t pid, unsigned int len, unsigned long * user_mask_ptr), > - TP_ARGS(pid, len, user_mask_ptr), > - TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, len) __field_hex(unsigned long *, user_mask_ptr)), > - TP_fast_assign(tp_assign(pid, pid) tp_assign(len, len) tp_assign(user_mask_ptr, user_mask_ptr)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sched_getaffinity > -SC_TRACE_EVENT(sys_sched_getaffinity, > - TP_PROTO(pid_t pid, unsigned int len, unsigned long * user_mask_ptr), > - TP_ARGS(pid, len, user_mask_ptr), > - TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, len) __field_hex(unsigned long *, user_mask_ptr)), > - TP_fast_assign(tp_assign(pid, pid) tp_assign(len, len) tp_assign(user_mask_ptr, user_mask_ptr)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_io_submit > -SC_TRACE_EVENT(sys_io_submit, > - TP_PROTO(aio_context_t ctx_id, long nr, struct iocb * * iocbpp), > - TP_ARGS(ctx_id, nr, iocbpp), > - TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field(long, nr) __field_hex(struct iocb * *, iocbpp)), > - TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(nr, nr) tp_assign(iocbpp, iocbpp)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_io_cancel > -SC_TRACE_EVENT(sys_io_cancel, > - TP_PROTO(aio_context_t ctx_id, struct iocb * iocb, struct io_event * result), > - TP_ARGS(ctx_id, iocb, result), > - TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field_hex(struct iocb *, iocb) __field_hex(struct io_event *, result)), > - TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(iocb, iocb) tp_assign(result, result)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_timer_create > -SC_TRACE_EVENT(sys_timer_create, > - TP_PROTO(const clockid_t which_clock, struct sigevent * timer_event_spec, timer_t * created_timer_id), > - TP_ARGS(which_clock, timer_event_spec, created_timer_id), > - TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct sigevent *, timer_event_spec) __field_hex(timer_t *, created_timer_id)), > - TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(timer_event_spec, timer_event_spec) tp_assign(created_timer_id, created_timer_id)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mq_getsetattr > -SC_TRACE_EVENT(sys_mq_getsetattr, > - TP_PROTO(mqd_t mqdes, const struct mq_attr * u_mqstat, struct mq_attr * u_omqstat), > - TP_ARGS(mqdes, u_mqstat, u_omqstat), > - TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const struct mq_attr *, u_mqstat) __field_hex(struct mq_attr *, u_omqstat)), > - TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_mqstat, u_mqstat) tp_assign(u_omqstat, u_omqstat)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_bind > -SC_TRACE_EVENT(sys_bind, > - TP_PROTO(int fd, struct sockaddr * umyaddr, int addrlen), > - TP_ARGS(fd, umyaddr, addrlen), > - TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, umyaddr) __field_hex(int, addrlen)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(umyaddr, umyaddr) tp_assign(addrlen, addrlen)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_connect > -SC_TRACE_EVENT(sys_connect, > - TP_PROTO(int fd, struct sockaddr * uservaddr, int addrlen), > - TP_ARGS(fd, uservaddr, addrlen), > - TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, uservaddr) __field_hex(int, addrlen)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(uservaddr, uservaddr) tp_assign(addrlen, addrlen)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_accept > -SC_TRACE_EVENT(sys_accept, > - TP_PROTO(int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen), > - TP_ARGS(fd, upeer_sockaddr, upeer_addrlen), > - TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, upeer_sockaddr) __field_hex(int *, upeer_addrlen)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(upeer_sockaddr, upeer_sockaddr) tp_assign(upeer_addrlen, upeer_addrlen)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getsockname > -SC_TRACE_EVENT(sys_getsockname, > - TP_PROTO(int fd, struct sockaddr * usockaddr, int * usockaddr_len), > - TP_ARGS(fd, usockaddr, usockaddr_len), > - TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, usockaddr) __field_hex(int *, usockaddr_len)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(usockaddr, usockaddr) tp_assign(usockaddr_len, usockaddr_len)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getpeername > -SC_TRACE_EVENT(sys_getpeername, > - TP_PROTO(int fd, struct sockaddr * usockaddr, int * usockaddr_len), > - TP_ARGS(fd, usockaddr, usockaddr_len), > - TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, usockaddr) __field_hex(int *, usockaddr_len)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(usockaddr, usockaddr) tp_assign(usockaddr_len, usockaddr_len)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sendmsg > -SC_TRACE_EVENT(sys_sendmsg, > - TP_PROTO(int fd, struct msghdr * msg, unsigned flags), > - TP_ARGS(fd, msg, flags), > - TP_STRUCT__entry(__field(int, fd) __field_hex(struct msghdr *, msg) __field(unsigned, flags)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(msg, msg) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_recvmsg > -SC_TRACE_EVENT(sys_recvmsg, > - TP_PROTO(int fd, struct msghdr * msg, unsigned int flags), > - TP_ARGS(fd, msg, flags), > - TP_STRUCT__entry(__field(int, fd) __field_hex(struct msghdr *, msg) __field(unsigned int, flags)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(msg, msg) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_semop > -SC_TRACE_EVENT(sys_semop, > - TP_PROTO(int semid, struct sembuf * tsops, unsigned nsops), > - TP_ARGS(semid, tsops, nsops), > - TP_STRUCT__entry(__field(int, semid) __field_hex(struct sembuf *, tsops) __field(unsigned, nsops)), > - TP_fast_assign(tp_assign(semid, semid) tp_assign(tsops, tsops) tp_assign(nsops, nsops)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_msgctl > -SC_TRACE_EVENT(sys_msgctl, > - TP_PROTO(int msqid, int cmd, struct msqid_ds * buf), > - TP_ARGS(msqid, cmd, buf), > - TP_STRUCT__entry(__field(int, msqid) __field(int, cmd) __field_hex(struct msqid_ds *, buf)), > - TP_fast_assign(tp_assign(msqid, msqid) tp_assign(cmd, cmd) tp_assign(buf, buf)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_shmat > -SC_TRACE_EVENT(sys_shmat, > - TP_PROTO(int shmid, char * shmaddr, int shmflg), > - TP_ARGS(shmid, shmaddr, shmflg), > - TP_STRUCT__entry(__field(int, shmid) __field_hex(char *, shmaddr) __field(int, shmflg)), > - TP_fast_assign(tp_assign(shmid, shmid) tp_assign(shmaddr, shmaddr) tp_assign(shmflg, shmflg)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_shmctl > -SC_TRACE_EVENT(sys_shmctl, > - TP_PROTO(int shmid, int cmd, struct shmid_ds * buf), > - TP_ARGS(shmid, cmd, buf), > - TP_STRUCT__entry(__field(int, shmid) __field(int, cmd) __field_hex(struct shmid_ds *, buf)), > - TP_fast_assign(tp_assign(shmid, shmid) tp_assign(cmd, cmd) tp_assign(buf, buf)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_inotify_add_watch > -SC_TRACE_EVENT(sys_inotify_add_watch, > - TP_PROTO(int fd, const char * pathname, u32 mask), > - TP_ARGS(fd, pathname, mask), > - TP_STRUCT__entry(__field(int, fd) __string_from_user(pathname, pathname) __field(u32, mask)), > - TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(pathname, pathname) tp_assign(mask, mask)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mkdirat > -SC_TRACE_EVENT(sys_mkdirat, > - TP_PROTO(int dfd, const char * pathname, int mode), > - TP_ARGS(dfd, pathname, mode), > - TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field(int, mode)), > - TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_futimesat > -SC_TRACE_EVENT(sys_futimesat, > - TP_PROTO(int dfd, const char * filename, struct timeval * utimes), > - TP_ARGS(dfd, filename, utimes), > - TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct timeval *, utimes)), > - TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_unlinkat > -SC_TRACE_EVENT(sys_unlinkat, > - TP_PROTO(int dfd, const char * pathname, int flag), > - TP_ARGS(dfd, pathname, flag), > - TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field(int, flag)), > - TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(flag, flag)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_symlinkat > -SC_TRACE_EVENT(sys_symlinkat, > - TP_PROTO(const char * oldname, int newdfd, const char * newname), > - TP_ARGS(oldname, newdfd, newname), > - TP_STRUCT__entry(__string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname)), > - TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fchmodat > -SC_TRACE_EVENT(sys_fchmodat, > - TP_PROTO(int dfd, const char * filename, mode_t mode), > - TP_ARGS(dfd, filename, mode), > - TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(mode_t, mode)), > - TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_faccessat > -SC_TRACE_EVENT(sys_faccessat, > - TP_PROTO(int dfd, const char * filename, int mode), > - TP_ARGS(dfd, filename, mode), > - TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, mode)), > - TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_get_robust_list > -SC_TRACE_EVENT(sys_get_robust_list, > - TP_PROTO(int pid, struct robust_list_head * * head_ptr, size_t * len_ptr), > - TP_ARGS(pid, head_ptr, len_ptr), > - TP_STRUCT__entry(__field(int, pid) __field_hex(struct robust_list_head * *, head_ptr) __field_hex(size_t *, len_ptr)), > - TP_fast_assign(tp_assign(pid, pid) tp_assign(head_ptr, head_ptr) tp_assign(len_ptr, len_ptr)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getcpu > -SC_TRACE_EVENT(sys_getcpu, > - TP_PROTO(unsigned * cpup, unsigned * nodep, struct getcpu_cache * unused), > - TP_ARGS(cpup, nodep, unused), > - TP_STRUCT__entry(__field_hex(unsigned *, cpup) __field_hex(unsigned *, nodep) __field_hex(struct getcpu_cache *, unused)), > - TP_fast_assign(tp_assign(cpup, cpup) tp_assign(nodep, nodep) tp_assign(unused, unused)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_signalfd > -SC_TRACE_EVENT(sys_signalfd, > - TP_PROTO(int ufd, sigset_t * user_mask, size_t sizemask), > - TP_ARGS(ufd, user_mask, sizemask), > - TP_STRUCT__entry(__field(int, ufd) __field_hex(sigset_t *, user_mask) __field(size_t, sizemask)), > - TP_fast_assign(tp_assign(ufd, ufd) tp_assign(user_mask, user_mask) tp_assign(sizemask, sizemask)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_reboot > -SC_TRACE_EVENT(sys_reboot, > - TP_PROTO(int magic1, int magic2, unsigned int cmd, void * arg), > - TP_ARGS(magic1, magic2, cmd, arg), > - TP_STRUCT__entry(__field(int, magic1) __field(int, magic2) __field(unsigned int, cmd) __field_hex(void *, arg)), > - TP_fast_assign(tp_assign(magic1, magic1) tp_assign(magic2, magic2) tp_assign(cmd, cmd) tp_assign(arg, arg)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_wait4 > -SC_TRACE_EVENT(sys_wait4, > - TP_PROTO(pid_t upid, int * stat_addr, int options, struct rusage * ru), > - TP_ARGS(upid, stat_addr, options, ru), > - TP_STRUCT__entry(__field(pid_t, upid) __field_hex(int *, stat_addr) __field(int, options) __field_hex(struct rusage *, ru)), > - TP_fast_assign(tp_assign(upid, upid) tp_assign(stat_addr, stat_addr) tp_assign(options, options) tp_assign(ru, ru)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_rt_sigaction > -SC_TRACE_EVENT(sys_rt_sigaction, > - TP_PROTO(int sig, const struct sigaction * act, struct sigaction * oact, size_t sigsetsize), > - TP_ARGS(sig, act, oact, sigsetsize), > - TP_STRUCT__entry(__field(int, sig) __field_hex(const struct sigaction *, act) __field_hex(struct sigaction *, oact) __field(size_t, sigsetsize)), > - TP_fast_assign(tp_assign(sig, sig) tp_assign(act, act) tp_assign(oact, oact) tp_assign(sigsetsize, sigsetsize)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_rt_sigprocmask > -SC_TRACE_EVENT(sys_rt_sigprocmask, > - TP_PROTO(int how, sigset_t * set, sigset_t * oset, size_t sigsetsize), > - TP_ARGS(how, set, oset, sigsetsize), > - TP_STRUCT__entry(__field(int, how) __field_hex(sigset_t *, set) __field_hex(sigset_t *, oset) __field(size_t, sigsetsize)), > - TP_fast_assign(tp_assign(how, how) tp_assign(set, set) tp_assign(oset, oset) tp_assign(sigsetsize, sigsetsize)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_rt_sigtimedwait > -SC_TRACE_EVENT(sys_rt_sigtimedwait, > - TP_PROTO(const sigset_t * uthese, siginfo_t * uinfo, const struct timespec * uts, size_t sigsetsize), > - TP_ARGS(uthese, uinfo, uts, sigsetsize), > - TP_STRUCT__entry(__field_hex(const sigset_t *, uthese) __field_hex(siginfo_t *, uinfo) __field_hex(const struct timespec *, uts) __field(size_t, sigsetsize)), > - TP_fast_assign(tp_assign(uthese, uthese) tp_assign(uinfo, uinfo) tp_assign(uts, uts) tp_assign(sigsetsize, sigsetsize)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sendfile > -SC_TRACE_EVENT(sys_sendfile, > - TP_PROTO(int out_fd, int in_fd, off_t * offset, size_t count), > - TP_ARGS(out_fd, in_fd, offset, count), > - TP_STRUCT__entry(__field(int, out_fd) __field(int, in_fd) __field_hex(off_t *, offset) __field(size_t, count)), > - TP_fast_assign(tp_assign(out_fd, out_fd) tp_assign(in_fd, in_fd) tp_assign(offset, offset) tp_assign(count, count)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getxattr > -SC_TRACE_EVENT(sys_getxattr, > - TP_PROTO(const char * pathname, const char * name, void * value, size_t size), > - TP_ARGS(pathname, name, value, size), > - TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_lgetxattr > -SC_TRACE_EVENT(sys_lgetxattr, > - TP_PROTO(const char * pathname, const char * name, void * value, size_t size), > - TP_ARGS(pathname, name, value, size), > - TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fgetxattr > -SC_TRACE_EVENT(sys_fgetxattr, > - TP_PROTO(int fd, const char * name, void * value, size_t size), > - TP_ARGS(fd, name, value, size), > - TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), > - TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sendfile64 > -SC_TRACE_EVENT(sys_sendfile64, > - TP_PROTO(int out_fd, int in_fd, loff_t * offset, size_t count), > - TP_ARGS(out_fd, in_fd, offset, count), > - TP_STRUCT__entry(__field(int, out_fd) __field(int, in_fd) __field_hex(loff_t *, offset) __field(size_t, count)), > - TP_fast_assign(tp_assign(out_fd, out_fd) tp_assign(in_fd, in_fd) tp_assign(offset, offset) tp_assign(count, count)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_epoll_ctl > -SC_TRACE_EVENT(sys_epoll_ctl, > - TP_PROTO(int epfd, int op, int fd, struct epoll_event * event), > - TP_ARGS(epfd, op, fd, event), > - TP_STRUCT__entry(__field(int, epfd) __field(int, op) __field(int, fd) __field_hex(struct epoll_event *, event)), > - TP_fast_assign(tp_assign(epfd, epfd) tp_assign(op, op) tp_assign(fd, fd) tp_assign(event, event)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_epoll_wait > -SC_TRACE_EVENT(sys_epoll_wait, > - TP_PROTO(int epfd, struct epoll_event * events, int maxevents, int timeout), > - TP_ARGS(epfd, events, maxevents, timeout), > - TP_STRUCT__entry(__field(int, epfd) __field_hex(struct epoll_event *, events) __field(int, maxevents) __field(int, timeout)), > - TP_fast_assign(tp_assign(epfd, epfd) tp_assign(events, events) tp_assign(maxevents, maxevents) tp_assign(timeout, timeout)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_timer_settime > -SC_TRACE_EVENT(sys_timer_settime, > - TP_PROTO(timer_t timer_id, int flags, const struct itimerspec * new_setting, struct itimerspec * old_setting), > - TP_ARGS(timer_id, flags, new_setting, old_setting), > - TP_STRUCT__entry(__field(timer_t, timer_id) __field(int, flags) __field_hex(const struct itimerspec *, new_setting) __field_hex(struct itimerspec *, old_setting)), > - TP_fast_assign(tp_assign(timer_id, timer_id) tp_assign(flags, flags) tp_assign(new_setting, new_setting) tp_assign(old_setting, old_setting)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_clock_nanosleep > -SC_TRACE_EVENT(sys_clock_nanosleep, > - TP_PROTO(const clockid_t which_clock, int flags, const struct timespec * rqtp, struct timespec * rmtp), > - TP_ARGS(which_clock, flags, rqtp, rmtp), > - TP_STRUCT__entry(__field(const clockid_t, which_clock) __field(int, flags) __field_hex(const struct timespec *, rqtp) __field_hex(struct timespec *, rmtp)), > - TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(flags, flags) tp_assign(rqtp, rqtp) tp_assign(rmtp, rmtp)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mq_open > -SC_TRACE_EVENT(sys_mq_open, > - TP_PROTO(const char * u_name, int oflag, mode_t mode, struct mq_attr * u_attr), > - TP_ARGS(u_name, oflag, mode, u_attr), > - TP_STRUCT__entry(__string_from_user(u_name, u_name) __field(int, oflag) __field(mode_t, mode) __field_hex(struct mq_attr *, u_attr)), > - TP_fast_assign(tp_copy_string_from_user(u_name, u_name) tp_assign(oflag, oflag) tp_assign(mode, mode) tp_assign(u_attr, u_attr)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_socketpair > -SC_TRACE_EVENT(sys_socketpair, > - TP_PROTO(int family, int type, int protocol, int * usockvec), > - TP_ARGS(family, type, protocol, usockvec), > - TP_STRUCT__entry(__field(int, family) __field(int, type) __field(int, protocol) __field_hex(int *, usockvec)), > - TP_fast_assign(tp_assign(family, family) tp_assign(type, type) tp_assign(protocol, protocol) tp_assign(usockvec, usockvec)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_send > -SC_TRACE_EVENT(sys_send, > - TP_PROTO(int fd, void * buff, size_t len, unsigned flags), > - TP_ARGS(fd, buff, len, flags), > - TP_STRUCT__entry(__field(int, fd) __field_hex(void *, buff) __field(size_t, len) __field(unsigned, flags)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(buff, buff) tp_assign(len, len) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_msgsnd > -SC_TRACE_EVENT(sys_msgsnd, > - TP_PROTO(int msqid, struct msgbuf * msgp, size_t msgsz, int msgflg), > - TP_ARGS(msqid, msgp, msgsz, msgflg), > - TP_STRUCT__entry(__field(int, msqid) __field_hex(struct msgbuf *, msgp) __field(size_t, msgsz) __field(int, msgflg)), > - TP_fast_assign(tp_assign(msqid, msqid) tp_assign(msgp, msgp) tp_assign(msgsz, msgsz) tp_assign(msgflg, msgflg)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_request_key > -SC_TRACE_EVENT(sys_request_key, > - TP_PROTO(const char * _type, const char * _description, const char * _callout_info, key_serial_t destringid), > - TP_ARGS(_type, _description, _callout_info, destringid), > - TP_STRUCT__entry(__string_from_user(_type, _type) __field_hex(const char *, _description) __field_hex(const char *, _callout_info) __field(key_serial_t, destringid)), > - TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_callout_info, _callout_info) tp_assign(destringid, destringid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_semtimedop > -SC_TRACE_EVENT(sys_semtimedop, > - TP_PROTO(int semid, struct sembuf * tsops, unsigned nsops, const struct timespec * timeout), > - TP_ARGS(semid, tsops, nsops, timeout), > - TP_STRUCT__entry(__field(int, semid) __field_hex(struct sembuf *, tsops) __field(unsigned, nsops) __field_hex(const struct timespec *, timeout)), > - TP_fast_assign(tp_assign(semid, semid) tp_assign(tsops, tsops) tp_assign(nsops, nsops) tp_assign(timeout, timeout)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_openat > -SC_TRACE_EVENT(sys_openat, > - TP_PROTO(int dfd, const char * filename, int flags, int mode), > - TP_ARGS(dfd, filename, flags, mode), > - TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, flags) __field(int, mode)), > - TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(flags, flags) tp_assign(mode, mode)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mknodat > -SC_TRACE_EVENT(sys_mknodat, > - TP_PROTO(int dfd, const char * filename, int mode, unsigned dev), > - TP_ARGS(dfd, filename, mode, dev), > - TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, mode) __field(unsigned, dev)), > - TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode) tp_assign(dev, dev)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fstatat64 > -SC_TRACE_EVENT(sys_fstatat64, > - TP_PROTO(int dfd, const char * filename, struct stat64 * statbuf, int flag), > - TP_ARGS(dfd, filename, statbuf, flag), > - TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct stat64 *, statbuf) __field(int, flag)), > - TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf) tp_assign(flag, flag)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_renameat > -SC_TRACE_EVENT(sys_renameat, > - TP_PROTO(int olddfd, const char * oldname, int newdfd, const char * newname), > - TP_ARGS(olddfd, oldname, newdfd, newname), > - TP_STRUCT__entry(__field(int, olddfd) __string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname)), > - TP_fast_assign(tp_assign(olddfd, olddfd) tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_readlinkat > -SC_TRACE_EVENT(sys_readlinkat, > - TP_PROTO(int dfd, const char * pathname, char * buf, int bufsiz), > - TP_ARGS(dfd, pathname, buf, bufsiz), > - TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field_hex(char *, buf) __field(int, bufsiz)), > - TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(buf, buf) tp_assign(bufsiz, bufsiz)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_vmsplice > -SC_TRACE_EVENT(sys_vmsplice, > - TP_PROTO(int fd, const struct iovec * iov, unsigned long nr_segs, unsigned int flags), > - TP_ARGS(fd, iov, nr_segs, flags), > - TP_STRUCT__entry(__field(int, fd) __field_hex(const struct iovec *, iov) __field(unsigned long, nr_segs) __field(unsigned int, flags)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(iov, iov) tp_assign(nr_segs, nr_segs) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_utimensat > -SC_TRACE_EVENT(sys_utimensat, > - TP_PROTO(int dfd, const char * filename, struct timespec * utimes, int flags), > - TP_ARGS(dfd, filename, utimes, flags), > - TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct timespec *, utimes) __field(int, flags)), > - TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_timerfd_settime > -SC_TRACE_EVENT(sys_timerfd_settime, > - TP_PROTO(int ufd, int flags, const struct itimerspec * utmr, struct itimerspec * otmr), > - TP_ARGS(ufd, flags, utmr, otmr), > - TP_STRUCT__entry(__field(int, ufd) __field(int, flags) __field_hex(const struct itimerspec *, utmr) __field_hex(struct itimerspec *, otmr)), > - TP_fast_assign(tp_assign(ufd, ufd) tp_assign(flags, flags) tp_assign(utmr, utmr) tp_assign(otmr, otmr)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_signalfd4 > -SC_TRACE_EVENT(sys_signalfd4, > - TP_PROTO(int ufd, sigset_t * user_mask, size_t sizemask, int flags), > - TP_ARGS(ufd, user_mask, sizemask, flags), > - TP_STRUCT__entry(__field(int, ufd) __field_hex(sigset_t *, user_mask) __field(size_t, sizemask) __field(int, flags)), > - TP_fast_assign(tp_assign(ufd, ufd) tp_assign(user_mask, user_mask) tp_assign(sizemask, sizemask) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_rt_tgsigqueueinfo > -SC_TRACE_EVENT(sys_rt_tgsigqueueinfo, > - TP_PROTO(pid_t tgid, pid_t pid, int sig, siginfo_t * uinfo), > - TP_ARGS(tgid, pid, sig, uinfo), > - TP_STRUCT__entry(__field(pid_t, tgid) __field(pid_t, pid) __field(int, sig) __field_hex(siginfo_t *, uinfo)), > - TP_fast_assign(tp_assign(tgid, tgid) tp_assign(pid, pid) tp_assign(sig, sig) tp_assign(uinfo, uinfo)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_accept4 > -SC_TRACE_EVENT(sys_accept4, > - TP_PROTO(int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen, int flags), > - TP_ARGS(fd, upeer_sockaddr, upeer_addrlen, flags), > - TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, upeer_sockaddr) __field_hex(int *, upeer_addrlen) __field(int, flags)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(upeer_sockaddr, upeer_sockaddr) tp_assign(upeer_addrlen, upeer_addrlen) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_prlimit64 > -SC_TRACE_EVENT(sys_prlimit64, > - TP_PROTO(pid_t pid, unsigned int resource, const struct rlimit64 * new_rlim, struct rlimit64 * old_rlim), > - TP_ARGS(pid, resource, new_rlim, old_rlim), > - TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, resource) __field_hex(const struct rlimit64 *, new_rlim) __field_hex(struct rlimit64 *, old_rlim)), > - TP_fast_assign(tp_assign(pid, pid) tp_assign(resource, resource) tp_assign(new_rlim, new_rlim) tp_assign(old_rlim, old_rlim)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mount > -SC_TRACE_EVENT(sys_mount, > - TP_PROTO(char * dev_name, char * dir_name, char * type, unsigned long flags, void * data), > - TP_ARGS(dev_name, dir_name, type, flags, data), > - TP_STRUCT__entry(__string_from_user(dev_name, dev_name) __string_from_user(dir_name, dir_name) __string_from_user(type, type) __field(unsigned long, flags) __field_hex(void *, data)), > - TP_fast_assign(tp_copy_string_from_user(dev_name, dev_name) tp_copy_string_from_user(dir_name, dir_name) tp_copy_string_from_user(type, type) tp_assign(flags, flags) tp_assign(data, data)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_llseek > -SC_TRACE_EVENT(sys_llseek, > - TP_PROTO(unsigned int fd, unsigned long offset_high, unsigned long offset_low, loff_t * result, unsigned int origin), > - TP_ARGS(fd, offset_high, offset_low, result, origin), > - TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned long, offset_high) __field(unsigned long, offset_low) __field_hex(loff_t *, result) __field(unsigned int, origin)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(offset_high, offset_high) tp_assign(offset_low, offset_low) tp_assign(result, result) tp_assign(origin, origin)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_select > -SC_TRACE_EVENT(sys_select, > - TP_PROTO(int n, fd_set * inp, fd_set * outp, fd_set * exp, struct timeval * tvp), > - TP_ARGS(n, inp, outp, exp, tvp), > - TP_STRUCT__entry(__field(int, n) __field_hex(fd_set *, inp) __field_hex(fd_set *, outp) __field_hex(fd_set *, exp) __field_hex(struct timeval *, tvp)), > - TP_fast_assign(tp_assign(n, n) tp_assign(inp, inp) tp_assign(outp, outp) tp_assign(exp, exp) tp_assign(tvp, tvp)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setxattr > -SC_TRACE_EVENT(sys_setxattr, > - TP_PROTO(const char * pathname, const char * name, const void * value, size_t size, int flags), > - TP_ARGS(pathname, name, value, size, flags), > - TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_lsetxattr > -SC_TRACE_EVENT(sys_lsetxattr, > - TP_PROTO(const char * pathname, const char * name, const void * value, size_t size, int flags), > - TP_ARGS(pathname, name, value, size, flags), > - TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), > - TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fsetxattr > -SC_TRACE_EVENT(sys_fsetxattr, > - TP_PROTO(int fd, const char * name, const void * value, size_t size, int flags), > - TP_ARGS(fd, name, value, size, flags), > - TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), > - TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_io_getevents > -SC_TRACE_EVENT(sys_io_getevents, > - TP_PROTO(aio_context_t ctx_id, long min_nr, long nr, struct io_event * events, struct timespec * timeout), > - TP_ARGS(ctx_id, min_nr, nr, events, timeout), > - TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field(long, min_nr) __field(long, nr) __field_hex(struct io_event *, events) __field_hex(struct timespec *, timeout)), > - TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(min_nr, min_nr) tp_assign(nr, nr) tp_assign(events, events) tp_assign(timeout, timeout)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mq_timedsend > -SC_TRACE_EVENT(sys_mq_timedsend, > - TP_PROTO(mqd_t mqdes, const char * u_msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec * u_abs_timeout), > - TP_ARGS(mqdes, u_msg_ptr, msg_len, msg_prio, u_abs_timeout), > - TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const char *, u_msg_ptr) __field(size_t, msg_len) __field(unsigned int, msg_prio) __field_hex(const struct timespec *, u_abs_timeout)), > - TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_msg_ptr, u_msg_ptr) tp_assign(msg_len, msg_len) tp_assign(msg_prio, msg_prio) tp_assign(u_abs_timeout, u_abs_timeout)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_mq_timedreceive > -SC_TRACE_EVENT(sys_mq_timedreceive, > - TP_PROTO(mqd_t mqdes, char * u_msg_ptr, size_t msg_len, unsigned int * u_msg_prio, const struct timespec * u_abs_timeout), > - TP_ARGS(mqdes, u_msg_ptr, msg_len, u_msg_prio, u_abs_timeout), > - TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(char *, u_msg_ptr) __field(size_t, msg_len) __field_hex(unsigned int *, u_msg_prio) __field_hex(const struct timespec *, u_abs_timeout)), > - TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_msg_ptr, u_msg_ptr) tp_assign(msg_len, msg_len) tp_assign(u_msg_prio, u_msg_prio) tp_assign(u_abs_timeout, u_abs_timeout)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_waitid > -SC_TRACE_EVENT(sys_waitid, > - TP_PROTO(int which, pid_t upid, struct siginfo * infop, int options, struct rusage * ru), > - TP_ARGS(which, upid, infop, options, ru), > - TP_STRUCT__entry(__field(int, which) __field(pid_t, upid) __field_hex(struct siginfo *, infop) __field(int, options) __field_hex(struct rusage *, ru)), > - TP_fast_assign(tp_assign(which, which) tp_assign(upid, upid) tp_assign(infop, infop) tp_assign(options, options) tp_assign(ru, ru)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_setsockopt > -SC_TRACE_EVENT(sys_setsockopt, > - TP_PROTO(int fd, int level, int optname, char * optval, int optlen), > - TP_ARGS(fd, level, optname, optval, optlen), > - TP_STRUCT__entry(__field(int, fd) __field(int, level) __field(int, optname) __field_hex(char *, optval) __field(int, optlen)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(level, level) tp_assign(optname, optname) tp_assign(optval, optval) tp_assign(optlen, optlen)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_getsockopt > -SC_TRACE_EVENT(sys_getsockopt, > - TP_PROTO(int fd, int level, int optname, char * optval, int * optlen), > - TP_ARGS(fd, level, optname, optval, optlen), > - TP_STRUCT__entry(__field(int, fd) __field(int, level) __field(int, optname) __field_hex(char *, optval) __field_hex(int *, optlen)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(level, level) tp_assign(optname, optname) tp_assign(optval, optval) tp_assign(optlen, optlen)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_msgrcv > -SC_TRACE_EVENT(sys_msgrcv, > - TP_PROTO(int msqid, struct msgbuf * msgp, size_t msgsz, long msgtyp, int msgflg), > - TP_ARGS(msqid, msgp, msgsz, msgtyp, msgflg), > - TP_STRUCT__entry(__field(int, msqid) __field_hex(struct msgbuf *, msgp) __field(size_t, msgsz) __field(long, msgtyp) __field(int, msgflg)), > - TP_fast_assign(tp_assign(msqid, msqid) tp_assign(msgp, msgp) tp_assign(msgsz, msgsz) tp_assign(msgtyp, msgtyp) tp_assign(msgflg, msgflg)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_add_key > -SC_TRACE_EVENT(sys_add_key, > - TP_PROTO(const char * _type, const char * _description, const void * _payload, size_t plen, key_serial_t ringid), > - TP_ARGS(_type, _description, _payload, plen, ringid), > - TP_STRUCT__entry(__string_from_user(_type, _type) __field_hex(const char *, _description) __field_hex(const void *, _payload) __field(size_t, plen) __field(key_serial_t, ringid)), > - TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_payload, _payload) tp_assign(plen, plen) tp_assign(ringid, ringid)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_fchownat > -SC_TRACE_EVENT(sys_fchownat, > - TP_PROTO(int dfd, const char * filename, uid_t user, gid_t group, int flag), > - TP_ARGS(dfd, filename, user, group, flag), > - TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group) __field(int, flag)), > - TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group) tp_assign(flag, flag)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_linkat > -SC_TRACE_EVENT(sys_linkat, > - TP_PROTO(int olddfd, const char * oldname, int newdfd, const char * newname, int flags), > - TP_ARGS(olddfd, oldname, newdfd, newname, flags), > - TP_STRUCT__entry(__field(int, olddfd) __string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname) __field(int, flags)), > - TP_fast_assign(tp_assign(olddfd, olddfd) tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_ppoll > -SC_TRACE_EVENT(sys_ppoll, > - TP_PROTO(struct pollfd * ufds, unsigned int nfds, struct timespec * tsp, const sigset_t * sigmask, size_t sigsetsize), > - TP_ARGS(ufds, nfds, tsp, sigmask, sigsetsize), > - TP_STRUCT__entry(__field_hex(struct pollfd *, ufds) __field(unsigned int, nfds) __field_hex(struct timespec *, tsp) __field_hex(const sigset_t *, sigmask) __field(size_t, sigsetsize)), > - TP_fast_assign(tp_assign(ufds, ufds) tp_assign(nfds, nfds) tp_assign(tsp, tsp) tp_assign(sigmask, sigmask) tp_assign(sigsetsize, sigsetsize)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_preadv > -SC_TRACE_EVENT(sys_preadv, > - TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h), > - TP_ARGS(fd, vec, vlen, pos_l, pos_h), > - TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen) __field(unsigned long, pos_l) __field(unsigned long, pos_h)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen) tp_assign(pos_l, pos_l) tp_assign(pos_h, pos_h)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_pwritev > -SC_TRACE_EVENT(sys_pwritev, > - TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h), > - TP_ARGS(fd, vec, vlen, pos_l, pos_h), > - TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen) __field(unsigned long, pos_l) __field(unsigned long, pos_h)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen) tp_assign(pos_l, pos_l) tp_assign(pos_h, pos_h)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_recvmmsg > -SC_TRACE_EVENT(sys_recvmmsg, > - TP_PROTO(int fd, struct mmsghdr * mmsg, unsigned int vlen, unsigned int flags, struct timespec * timeout), > - TP_ARGS(fd, mmsg, vlen, flags, timeout), > - TP_STRUCT__entry(__field(int, fd) __field_hex(struct mmsghdr *, mmsg) __field(unsigned int, vlen) __field(unsigned int, flags) __field_hex(struct timespec *, timeout)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(mmsg, mmsg) tp_assign(vlen, vlen) tp_assign(flags, flags) tp_assign(timeout, timeout)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_futex > -SC_TRACE_EVENT(sys_futex, > - TP_PROTO(u32 * uaddr, int op, u32 val, struct timespec * utime, u32 * uaddr2, u32 val3), > - TP_ARGS(uaddr, op, val, utime, uaddr2, val3), > - TP_STRUCT__entry(__field_hex(u32 *, uaddr) __field(int, op) __field(u32, val) __field_hex(struct timespec *, utime) __field_hex(u32 *, uaddr2) __field(u32, val3)), > - TP_fast_assign(tp_assign(uaddr, uaddr) tp_assign(op, op) tp_assign(val, val) tp_assign(utime, utime) tp_assign(uaddr2, uaddr2) tp_assign(val3, val3)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_sendto > -SC_TRACE_EVENT(sys_sendto, > - TP_PROTO(int fd, void * buff, size_t len, unsigned flags, struct sockaddr * addr, int addr_len), > - TP_ARGS(fd, buff, len, flags, addr, addr_len), > - TP_STRUCT__entry(__field(int, fd) __field_hex(void *, buff) __field(size_t, len) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int, addr_len)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(buff, buff) tp_assign(len, len) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_recvfrom > -SC_TRACE_EVENT(sys_recvfrom, > - TP_PROTO(int fd, void * ubuf, size_t size, unsigned flags, struct sockaddr * addr, int * addr_len), > - TP_ARGS(fd, ubuf, size, flags, addr, addr_len), > - TP_STRUCT__entry(__field(int, fd) __field_hex(void *, ubuf) __field(size_t, size) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int *, addr_len)), > - TP_fast_assign(tp_assign(fd, fd) tp_assign(ubuf, ubuf) tp_assign(size, size) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_pselect6 > -SC_TRACE_EVENT(sys_pselect6, > - TP_PROTO(int n, fd_set * inp, fd_set * outp, fd_set * exp, struct timespec * tsp, void * sig), > - TP_ARGS(n, inp, outp, exp, tsp, sig), > - TP_STRUCT__entry(__field(int, n) __field_hex(fd_set *, inp) __field_hex(fd_set *, outp) __field_hex(fd_set *, exp) __field_hex(struct timespec *, tsp) __field_hex(void *, sig)), > - TP_fast_assign(tp_assign(n, n) tp_assign(inp, inp) tp_assign(outp, outp) tp_assign(exp, exp) tp_assign(tsp, tsp) tp_assign(sig, sig)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_splice > -SC_TRACE_EVENT(sys_splice, > - TP_PROTO(int fd_in, loff_t * off_in, int fd_out, loff_t * off_out, size_t len, unsigned int flags), > - TP_ARGS(fd_in, off_in, fd_out, off_out, len, flags), > - TP_STRUCT__entry(__field(int, fd_in) __field_hex(loff_t *, off_in) __field(int, fd_out) __field_hex(loff_t *, off_out) __field(size_t, len) __field(unsigned int, flags)), > - TP_fast_assign(tp_assign(fd_in, fd_in) tp_assign(off_in, off_in) tp_assign(fd_out, fd_out) tp_assign(off_out, off_out) tp_assign(len, len) tp_assign(flags, flags)), > - TP_printk() > -) > -#endif > -#ifndef OVERRIDE_32_sys_epoll_pwait > -SC_TRACE_EVENT(sys_epoll_pwait, > - TP_PROTO(int epfd, struct epoll_event * events, int maxevents, int timeout, const sigset_t * sigmask, size_t sigsetsize), > - TP_ARGS(epfd, events, maxevents, timeout, sigmask, sigsetsize), > - TP_STRUCT__entry(__field(int, epfd) __field_hex(struct epoll_event *, events) __field(int, maxevents) __field(int, timeout) __field_hex(const sigset_t *, sigmask) __field(size_t, sigsetsize)), > - TP_fast_assign(tp_assign(epfd, epfd) tp_assign(events, events) tp_assign(maxevents, maxevents) tp_assign(timeout, timeout) tp_assign(sigmask, sigmask) tp_assign(sigsetsize, sigsetsize)), > - TP_printk() > -) > -#endif > - > -#endif /* _TRACE_SYSCALLS_POINTERS_H */ > - > -/* This part must be outside protection */ > -#include "../../../probes/define_trace.h" > - > -#else /* CREATE_SYSCALL_TABLE */ > - > -#include "arm-32-syscalls-2.6.38_pointers_override.h" > -#include "syscalls_pointers_override.h" > - > -#ifndef OVERRIDE_TABLE_32_sys_read > -TRACE_SYSCALL_TABLE(sys_read, sys_read, 3, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_write > -TRACE_SYSCALL_TABLE(sys_write, sys_write, 4, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_open > -TRACE_SYSCALL_TABLE(sys_open, sys_open, 5, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_creat > -TRACE_SYSCALL_TABLE(sys_creat, sys_creat, 8, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_link > -TRACE_SYSCALL_TABLE(sys_link, sys_link, 9, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_unlink > -TRACE_SYSCALL_TABLE(sys_unlink, sys_unlink, 10, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_chdir > -TRACE_SYSCALL_TABLE(sys_chdir, sys_chdir, 12, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mknod > -TRACE_SYSCALL_TABLE(sys_mknod, sys_mknod, 14, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_chmod > -TRACE_SYSCALL_TABLE(sys_chmod, sys_chmod, 15, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_lchown16 > -TRACE_SYSCALL_TABLE(sys_lchown16, sys_lchown16, 16, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mount > -TRACE_SYSCALL_TABLE(sys_mount, sys_mount, 21, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_access > -TRACE_SYSCALL_TABLE(sys_access, sys_access, 33, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_rename > -TRACE_SYSCALL_TABLE(sys_rename, sys_rename, 38, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mkdir > -TRACE_SYSCALL_TABLE(sys_mkdir, sys_mkdir, 39, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_rmdir > -TRACE_SYSCALL_TABLE(sys_rmdir, sys_rmdir, 40, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_pipe > -TRACE_SYSCALL_TABLE(sys_pipe, sys_pipe, 42, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_times > -TRACE_SYSCALL_TABLE(sys_times, sys_times, 43, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_umount > -TRACE_SYSCALL_TABLE(sys_umount, sys_umount, 52, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_chroot > -TRACE_SYSCALL_TABLE(sys_chroot, sys_chroot, 61, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_ustat > -TRACE_SYSCALL_TABLE(sys_ustat, sys_ustat, 62, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sigpending > -TRACE_SYSCALL_TABLE(sys_sigpending, sys_sigpending, 73, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sethostname > -TRACE_SYSCALL_TABLE(sys_sethostname, sys_sethostname, 74, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setrlimit > -TRACE_SYSCALL_TABLE(sys_setrlimit, sys_setrlimit, 75, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getrusage > -TRACE_SYSCALL_TABLE(sys_getrusage, sys_getrusage, 77, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_gettimeofday > -TRACE_SYSCALL_TABLE(sys_gettimeofday, sys_gettimeofday, 78, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_settimeofday > -TRACE_SYSCALL_TABLE(sys_settimeofday, sys_settimeofday, 79, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getgroups16 > -TRACE_SYSCALL_TABLE(sys_getgroups16, sys_getgroups16, 80, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setgroups16 > -TRACE_SYSCALL_TABLE(sys_setgroups16, sys_setgroups16, 81, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_symlink > -TRACE_SYSCALL_TABLE(sys_symlink, sys_symlink, 83, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_readlink > -TRACE_SYSCALL_TABLE(sys_readlink, sys_readlink, 85, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_uselib > -TRACE_SYSCALL_TABLE(sys_uselib, sys_uselib, 86, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_reboot > -TRACE_SYSCALL_TABLE(sys_reboot, sys_reboot, 88, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_truncate > -TRACE_SYSCALL_TABLE(sys_truncate, sys_truncate, 92, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_statfs > -TRACE_SYSCALL_TABLE(sys_statfs, sys_statfs, 99, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fstatfs > -TRACE_SYSCALL_TABLE(sys_fstatfs, sys_fstatfs, 100, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_syslog > -TRACE_SYSCALL_TABLE(sys_syslog, sys_syslog, 103, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setitimer > -TRACE_SYSCALL_TABLE(sys_setitimer, sys_setitimer, 104, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getitimer > -TRACE_SYSCALL_TABLE(sys_getitimer, sys_getitimer, 105, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_newstat > -TRACE_SYSCALL_TABLE(sys_newstat, sys_newstat, 106, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_newlstat > -TRACE_SYSCALL_TABLE(sys_newlstat, sys_newlstat, 107, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_newfstat > -TRACE_SYSCALL_TABLE(sys_newfstat, sys_newfstat, 108, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_wait4 > -TRACE_SYSCALL_TABLE(sys_wait4, sys_wait4, 114, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sysinfo > -TRACE_SYSCALL_TABLE(sys_sysinfo, sys_sysinfo, 116, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setdomainname > -TRACE_SYSCALL_TABLE(sys_setdomainname, sys_setdomainname, 121, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_newuname > -TRACE_SYSCALL_TABLE(sys_newuname, sys_newuname, 122, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_adjtimex > -TRACE_SYSCALL_TABLE(sys_adjtimex, sys_adjtimex, 124, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sigprocmask > -TRACE_SYSCALL_TABLE(sys_sigprocmask, sys_sigprocmask, 126, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_init_module > -TRACE_SYSCALL_TABLE(sys_init_module, sys_init_module, 128, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_delete_module > -TRACE_SYSCALL_TABLE(sys_delete_module, sys_delete_module, 129, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_llseek > -TRACE_SYSCALL_TABLE(sys_llseek, sys_llseek, 140, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getdents > -TRACE_SYSCALL_TABLE(sys_getdents, sys_getdents, 141, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_select > -TRACE_SYSCALL_TABLE(sys_select, sys_select, 142, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_readv > -TRACE_SYSCALL_TABLE(sys_readv, sys_readv, 145, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_writev > -TRACE_SYSCALL_TABLE(sys_writev, sys_writev, 146, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sysctl > -TRACE_SYSCALL_TABLE(sys_sysctl, sys_sysctl, 149, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sched_setparam > -TRACE_SYSCALL_TABLE(sys_sched_setparam, sys_sched_setparam, 154, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sched_getparam > -TRACE_SYSCALL_TABLE(sys_sched_getparam, sys_sched_getparam, 155, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sched_setscheduler > -TRACE_SYSCALL_TABLE(sys_sched_setscheduler, sys_sched_setscheduler, 156, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sched_rr_get_interval > -TRACE_SYSCALL_TABLE(sys_sched_rr_get_interval, sys_sched_rr_get_interval, 161, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_nanosleep > -TRACE_SYSCALL_TABLE(sys_nanosleep, sys_nanosleep, 162, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getresuid16 > -TRACE_SYSCALL_TABLE(sys_getresuid16, sys_getresuid16, 165, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_poll > -TRACE_SYSCALL_TABLE(sys_poll, sys_poll, 168, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getresgid16 > -TRACE_SYSCALL_TABLE(sys_getresgid16, sys_getresgid16, 171, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_rt_sigaction > -TRACE_SYSCALL_TABLE(sys_rt_sigaction, sys_rt_sigaction, 174, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_rt_sigprocmask > -TRACE_SYSCALL_TABLE(sys_rt_sigprocmask, sys_rt_sigprocmask, 175, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_rt_sigpending > -TRACE_SYSCALL_TABLE(sys_rt_sigpending, sys_rt_sigpending, 176, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_rt_sigtimedwait > -TRACE_SYSCALL_TABLE(sys_rt_sigtimedwait, sys_rt_sigtimedwait, 177, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_rt_sigqueueinfo > -TRACE_SYSCALL_TABLE(sys_rt_sigqueueinfo, sys_rt_sigqueueinfo, 178, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_rt_sigsuspend > -TRACE_SYSCALL_TABLE(sys_rt_sigsuspend, sys_rt_sigsuspend, 179, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_chown16 > -TRACE_SYSCALL_TABLE(sys_chown16, sys_chown16, 182, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getcwd > -TRACE_SYSCALL_TABLE(sys_getcwd, sys_getcwd, 183, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sendfile > -TRACE_SYSCALL_TABLE(sys_sendfile, sys_sendfile, 187, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getrlimit > -TRACE_SYSCALL_TABLE(sys_getrlimit, sys_getrlimit, 191, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_stat64 > -TRACE_SYSCALL_TABLE(sys_stat64, sys_stat64, 195, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_lstat64 > -TRACE_SYSCALL_TABLE(sys_lstat64, sys_lstat64, 196, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fstat64 > -TRACE_SYSCALL_TABLE(sys_fstat64, sys_fstat64, 197, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_lchown > -TRACE_SYSCALL_TABLE(sys_lchown, sys_lchown, 198, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getgroups > -TRACE_SYSCALL_TABLE(sys_getgroups, sys_getgroups, 205, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setgroups > -TRACE_SYSCALL_TABLE(sys_setgroups, sys_setgroups, 206, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getresuid > -TRACE_SYSCALL_TABLE(sys_getresuid, sys_getresuid, 209, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getresgid > -TRACE_SYSCALL_TABLE(sys_getresgid, sys_getresgid, 211, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_chown > -TRACE_SYSCALL_TABLE(sys_chown, sys_chown, 212, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getdents64 > -TRACE_SYSCALL_TABLE(sys_getdents64, sys_getdents64, 217, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_pivot_root > -TRACE_SYSCALL_TABLE(sys_pivot_root, sys_pivot_root, 218, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mincore > -TRACE_SYSCALL_TABLE(sys_mincore, sys_mincore, 219, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setxattr > -TRACE_SYSCALL_TABLE(sys_setxattr, sys_setxattr, 226, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_lsetxattr > -TRACE_SYSCALL_TABLE(sys_lsetxattr, sys_lsetxattr, 227, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fsetxattr > -TRACE_SYSCALL_TABLE(sys_fsetxattr, sys_fsetxattr, 228, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getxattr > -TRACE_SYSCALL_TABLE(sys_getxattr, sys_getxattr, 229, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_lgetxattr > -TRACE_SYSCALL_TABLE(sys_lgetxattr, sys_lgetxattr, 230, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fgetxattr > -TRACE_SYSCALL_TABLE(sys_fgetxattr, sys_fgetxattr, 231, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_listxattr > -TRACE_SYSCALL_TABLE(sys_listxattr, sys_listxattr, 232, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_llistxattr > -TRACE_SYSCALL_TABLE(sys_llistxattr, sys_llistxattr, 233, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_flistxattr > -TRACE_SYSCALL_TABLE(sys_flistxattr, sys_flistxattr, 234, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_removexattr > -TRACE_SYSCALL_TABLE(sys_removexattr, sys_removexattr, 235, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_lremovexattr > -TRACE_SYSCALL_TABLE(sys_lremovexattr, sys_lremovexattr, 236, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fremovexattr > -TRACE_SYSCALL_TABLE(sys_fremovexattr, sys_fremovexattr, 237, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sendfile64 > -TRACE_SYSCALL_TABLE(sys_sendfile64, sys_sendfile64, 239, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_futex > -TRACE_SYSCALL_TABLE(sys_futex, sys_futex, 240, 6) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sched_setaffinity > -TRACE_SYSCALL_TABLE(sys_sched_setaffinity, sys_sched_setaffinity, 241, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sched_getaffinity > -TRACE_SYSCALL_TABLE(sys_sched_getaffinity, sys_sched_getaffinity, 242, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_io_setup > -TRACE_SYSCALL_TABLE(sys_io_setup, sys_io_setup, 243, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_io_getevents > -TRACE_SYSCALL_TABLE(sys_io_getevents, sys_io_getevents, 245, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_io_submit > -TRACE_SYSCALL_TABLE(sys_io_submit, sys_io_submit, 246, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_io_cancel > -TRACE_SYSCALL_TABLE(sys_io_cancel, sys_io_cancel, 247, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_epoll_ctl > -TRACE_SYSCALL_TABLE(sys_epoll_ctl, sys_epoll_ctl, 251, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_epoll_wait > -TRACE_SYSCALL_TABLE(sys_epoll_wait, sys_epoll_wait, 252, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_set_tid_address > -TRACE_SYSCALL_TABLE(sys_set_tid_address, sys_set_tid_address, 256, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_timer_create > -TRACE_SYSCALL_TABLE(sys_timer_create, sys_timer_create, 257, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_timer_settime > -TRACE_SYSCALL_TABLE(sys_timer_settime, sys_timer_settime, 258, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_timer_gettime > -TRACE_SYSCALL_TABLE(sys_timer_gettime, sys_timer_gettime, 259, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_clock_settime > -TRACE_SYSCALL_TABLE(sys_clock_settime, sys_clock_settime, 262, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_clock_gettime > -TRACE_SYSCALL_TABLE(sys_clock_gettime, sys_clock_gettime, 263, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_clock_getres > -TRACE_SYSCALL_TABLE(sys_clock_getres, sys_clock_getres, 264, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_clock_nanosleep > -TRACE_SYSCALL_TABLE(sys_clock_nanosleep, sys_clock_nanosleep, 265, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_utimes > -TRACE_SYSCALL_TABLE(sys_utimes, sys_utimes, 269, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mq_open > -TRACE_SYSCALL_TABLE(sys_mq_open, sys_mq_open, 274, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mq_unlink > -TRACE_SYSCALL_TABLE(sys_mq_unlink, sys_mq_unlink, 275, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mq_timedsend > -TRACE_SYSCALL_TABLE(sys_mq_timedsend, sys_mq_timedsend, 276, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mq_timedreceive > -TRACE_SYSCALL_TABLE(sys_mq_timedreceive, sys_mq_timedreceive, 277, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mq_notify > -TRACE_SYSCALL_TABLE(sys_mq_notify, sys_mq_notify, 278, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mq_getsetattr > -TRACE_SYSCALL_TABLE(sys_mq_getsetattr, sys_mq_getsetattr, 279, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_waitid > -TRACE_SYSCALL_TABLE(sys_waitid, sys_waitid, 280, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_bind > -TRACE_SYSCALL_TABLE(sys_bind, sys_bind, 282, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_connect > -TRACE_SYSCALL_TABLE(sys_connect, sys_connect, 283, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_accept > -TRACE_SYSCALL_TABLE(sys_accept, sys_accept, 285, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getsockname > -TRACE_SYSCALL_TABLE(sys_getsockname, sys_getsockname, 286, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getpeername > -TRACE_SYSCALL_TABLE(sys_getpeername, sys_getpeername, 287, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_socketpair > -TRACE_SYSCALL_TABLE(sys_socketpair, sys_socketpair, 288, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_send > -TRACE_SYSCALL_TABLE(sys_send, sys_send, 289, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sendto > -TRACE_SYSCALL_TABLE(sys_sendto, sys_sendto, 290, 6) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_recvfrom > -TRACE_SYSCALL_TABLE(sys_recvfrom, sys_recvfrom, 292, 6) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_setsockopt > -TRACE_SYSCALL_TABLE(sys_setsockopt, sys_setsockopt, 294, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getsockopt > -TRACE_SYSCALL_TABLE(sys_getsockopt, sys_getsockopt, 295, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_sendmsg > -TRACE_SYSCALL_TABLE(sys_sendmsg, sys_sendmsg, 296, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_recvmsg > -TRACE_SYSCALL_TABLE(sys_recvmsg, sys_recvmsg, 297, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_semop > -TRACE_SYSCALL_TABLE(sys_semop, sys_semop, 298, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_msgsnd > -TRACE_SYSCALL_TABLE(sys_msgsnd, sys_msgsnd, 301, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_msgrcv > -TRACE_SYSCALL_TABLE(sys_msgrcv, sys_msgrcv, 302, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_msgctl > -TRACE_SYSCALL_TABLE(sys_msgctl, sys_msgctl, 304, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_shmat > -TRACE_SYSCALL_TABLE(sys_shmat, sys_shmat, 305, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_shmdt > -TRACE_SYSCALL_TABLE(sys_shmdt, sys_shmdt, 306, 1) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_shmctl > -TRACE_SYSCALL_TABLE(sys_shmctl, sys_shmctl, 308, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_add_key > -TRACE_SYSCALL_TABLE(sys_add_key, sys_add_key, 309, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_request_key > -TRACE_SYSCALL_TABLE(sys_request_key, sys_request_key, 310, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_semtimedop > -TRACE_SYSCALL_TABLE(sys_semtimedop, sys_semtimedop, 312, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_inotify_add_watch > -TRACE_SYSCALL_TABLE(sys_inotify_add_watch, sys_inotify_add_watch, 317, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_openat > -TRACE_SYSCALL_TABLE(sys_openat, sys_openat, 322, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mkdirat > -TRACE_SYSCALL_TABLE(sys_mkdirat, sys_mkdirat, 323, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_mknodat > -TRACE_SYSCALL_TABLE(sys_mknodat, sys_mknodat, 324, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fchownat > -TRACE_SYSCALL_TABLE(sys_fchownat, sys_fchownat, 325, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_futimesat > -TRACE_SYSCALL_TABLE(sys_futimesat, sys_futimesat, 326, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fstatat64 > -TRACE_SYSCALL_TABLE(sys_fstatat64, sys_fstatat64, 327, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_unlinkat > -TRACE_SYSCALL_TABLE(sys_unlinkat, sys_unlinkat, 328, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_renameat > -TRACE_SYSCALL_TABLE(sys_renameat, sys_renameat, 329, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_linkat > -TRACE_SYSCALL_TABLE(sys_linkat, sys_linkat, 330, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_symlinkat > -TRACE_SYSCALL_TABLE(sys_symlinkat, sys_symlinkat, 331, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_readlinkat > -TRACE_SYSCALL_TABLE(sys_readlinkat, sys_readlinkat, 332, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_fchmodat > -TRACE_SYSCALL_TABLE(sys_fchmodat, sys_fchmodat, 333, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_faccessat > -TRACE_SYSCALL_TABLE(sys_faccessat, sys_faccessat, 334, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_pselect6 > -TRACE_SYSCALL_TABLE(sys_pselect6, sys_pselect6, 335, 6) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_ppoll > -TRACE_SYSCALL_TABLE(sys_ppoll, sys_ppoll, 336, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_set_robust_list > -TRACE_SYSCALL_TABLE(sys_set_robust_list, sys_set_robust_list, 338, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_get_robust_list > -TRACE_SYSCALL_TABLE(sys_get_robust_list, sys_get_robust_list, 339, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_splice > -TRACE_SYSCALL_TABLE(sys_splice, sys_splice, 340, 6) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_vmsplice > -TRACE_SYSCALL_TABLE(sys_vmsplice, sys_vmsplice, 343, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_getcpu > -TRACE_SYSCALL_TABLE(sys_getcpu, sys_getcpu, 345, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_epoll_pwait > -TRACE_SYSCALL_TABLE(sys_epoll_pwait, sys_epoll_pwait, 346, 6) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_utimensat > -TRACE_SYSCALL_TABLE(sys_utimensat, sys_utimensat, 348, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_signalfd > -TRACE_SYSCALL_TABLE(sys_signalfd, sys_signalfd, 349, 3) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_timerfd_settime > -TRACE_SYSCALL_TABLE(sys_timerfd_settime, sys_timerfd_settime, 353, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_timerfd_gettime > -TRACE_SYSCALL_TABLE(sys_timerfd_gettime, sys_timerfd_gettime, 354, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_signalfd4 > -TRACE_SYSCALL_TABLE(sys_signalfd4, sys_signalfd4, 355, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_pipe2 > -TRACE_SYSCALL_TABLE(sys_pipe2, sys_pipe2, 359, 2) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_preadv > -TRACE_SYSCALL_TABLE(sys_preadv, sys_preadv, 361, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_pwritev > -TRACE_SYSCALL_TABLE(sys_pwritev, sys_pwritev, 362, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_rt_tgsigqueueinfo > -TRACE_SYSCALL_TABLE(sys_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, 363, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_recvmmsg > -TRACE_SYSCALL_TABLE(sys_recvmmsg, sys_recvmmsg, 365, 5) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_accept4 > -TRACE_SYSCALL_TABLE(sys_accept4, sys_accept4, 366, 4) > -#endif > -#ifndef OVERRIDE_TABLE_32_sys_prlimit64 > -TRACE_SYSCALL_TABLE(sys_prlimit64, sys_prlimit64, 369, 4) > -#endif > - > -#endif /* CREATE_SYSCALL_TABLE */ > diff --git a/instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_pointers_override.h b/instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_pointers_override.h > deleted file mode 100644 > index 65131bb..0000000 > --- a/instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_pointers_override.h > +++ /dev/null > @@ -1,39 +0,0 @@ > - > -#define OVERRIDE_TABLE_32_sys_mmap2 > - > - > -#ifndef CREATE_SYSCALL_TABLE > - > -SC_TRACE_EVENT(sys_mmap2, > - TP_PROTO(void *addr, size_t len, int prot, > - int flags, int fd, off_t pgoff), > - TP_ARGS(addr, len, prot, flags, fd, pgoff), > - TP_STRUCT__entry( > - __field_hex(void *, addr) > - __field(size_t, len) > - __field(int, prot) > - __field(int, flags) > - __field(int, fd) > - __field(off_t, pgoff)), > - TP_fast_assign( > - tp_assign(addr, addr) > - tp_assign(len, len) > - tp_assign(prot, prot) > - tp_assign(flags, flags) > - tp_assign(fd, fd) > - tp_assign(pgoff, pgoff)), > - TP_printk() > -) > - > -#else /* CREATE_SYSCALL_TABLE */ > - > -#define OVERRIDE_TABLE_32_sys_execve > -TRACE_SYSCALL_TABLE(sys_execve, sys_execve, 11, 3) > -#define OVERRIDE_TABLE_32_sys_clone > -TRACE_SYSCALL_TABLE(sys_clone, sys_clone, 120, 5) > -#define OVERRIDE_TABLE_32_sys_mmap2 > -TRACE_SYSCALL_TABLE(sys_mmap2, sys_mmap2, 192, 6) > - > -#endif /* CREATE_SYSCALL_TABLE */ > - > - > diff --git a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers.h b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers.h > new file mode 100644 > index 0000000..9b10e5e > --- /dev/null > +++ b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers.h > @@ -0,0 +1,1181 @@ > +/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */ > +#ifndef CREATE_SYSCALL_TABLE > + > +#if !defined(_TRACE_SYSCALLS_INTEGERS_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_SYSCALLS_INTEGERS_H > + > +#include > +#include > +#include "arm-32-syscalls-3.4.25_integers_override.h" > +#include "syscalls_integers_override.h" > + > +SC_DECLARE_EVENT_CLASS_NOARGS(syscalls_noargs, > + TP_STRUCT__entry(), > + TP_fast_assign(), > + TP_printk() > +) > +#ifndef OVERRIDE_32_sys_restart_syscall > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_restart_syscall) > +#endif > +#ifndef OVERRIDE_32_sys_getpid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getpid) > +#endif > +#ifndef OVERRIDE_32_sys_getuid16 > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getuid16) > +#endif > +#ifndef OVERRIDE_32_sys_pause > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_pause) > +#endif > +#ifndef OVERRIDE_32_sys_sync > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sync) > +#endif > +#ifndef OVERRIDE_32_sys_getgid16 > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getgid16) > +#endif > +#ifndef OVERRIDE_32_sys_geteuid16 > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_geteuid16) > +#endif > +#ifndef OVERRIDE_32_sys_getegid16 > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getegid16) > +#endif > +#ifndef OVERRIDE_32_sys_getppid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getppid) > +#endif > +#ifndef OVERRIDE_32_sys_getpgrp > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getpgrp) > +#endif > +#ifndef OVERRIDE_32_sys_setsid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_setsid) > +#endif > +#ifndef OVERRIDE_32_sys_vhangup > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_vhangup) > +#endif > +#ifndef OVERRIDE_32_sys_munlockall > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_munlockall) > +#endif > +#ifndef OVERRIDE_32_sys_sched_yield > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sched_yield) > +#endif > +#ifndef OVERRIDE_32_sys_getuid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getuid) > +#endif > +#ifndef OVERRIDE_32_sys_getgid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getgid) > +#endif > +#ifndef OVERRIDE_32_sys_geteuid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_geteuid) > +#endif > +#ifndef OVERRIDE_32_sys_getegid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getegid) > +#endif > +#ifndef OVERRIDE_32_sys_gettid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_gettid) > +#endif > +#ifndef OVERRIDE_32_sys_inotify_init > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_inotify_init) > +#endif > +#ifndef OVERRIDE_32_sys_exit > +SC_TRACE_EVENT(sys_exit, > + TP_PROTO(int error_code), > + TP_ARGS(error_code), > + TP_STRUCT__entry(__field(int, error_code)), > + TP_fast_assign(tp_assign(error_code, error_code)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_close > +SC_TRACE_EVENT(sys_close, > + TP_PROTO(unsigned int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(unsigned int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setuid16 > +SC_TRACE_EVENT(sys_setuid16, > + TP_PROTO(old_uid_t uid), > + TP_ARGS(uid), > + TP_STRUCT__entry(__field(old_uid_t, uid)), > + TP_fast_assign(tp_assign(uid, uid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_nice > +SC_TRACE_EVENT(sys_nice, > + TP_PROTO(int increment), > + TP_ARGS(increment), > + TP_STRUCT__entry(__field(int, increment)), > + TP_fast_assign(tp_assign(increment, increment)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_dup > +SC_TRACE_EVENT(sys_dup, > + TP_PROTO(unsigned int fildes), > + TP_ARGS(fildes), > + TP_STRUCT__entry(__field(unsigned int, fildes)), > + TP_fast_assign(tp_assign(fildes, fildes)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_brk > +SC_TRACE_EVENT(sys_brk, > + TP_PROTO(unsigned long brk), > + TP_ARGS(brk), > + TP_STRUCT__entry(__field(unsigned long, brk)), > + TP_fast_assign(tp_assign(brk, brk)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setgid16 > +SC_TRACE_EVENT(sys_setgid16, > + TP_PROTO(old_gid_t gid), > + TP_ARGS(gid), > + TP_STRUCT__entry(__field(old_gid_t, gid)), > + TP_fast_assign(tp_assign(gid, gid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_umask > +SC_TRACE_EVENT(sys_umask, > + TP_PROTO(int mask), > + TP_ARGS(mask), > + TP_STRUCT__entry(__field(int, mask)), > + TP_fast_assign(tp_assign(mask, mask)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fsync > +SC_TRACE_EVENT(sys_fsync, > + TP_PROTO(unsigned int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(unsigned int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getpgid > +SC_TRACE_EVENT(sys_getpgid, > + TP_PROTO(pid_t pid), > + TP_ARGS(pid), > + TP_STRUCT__entry(__field(pid_t, pid)), > + TP_fast_assign(tp_assign(pid, pid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fchdir > +SC_TRACE_EVENT(sys_fchdir, > + TP_PROTO(unsigned int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(unsigned int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_personality > +SC_TRACE_EVENT(sys_personality, > + TP_PROTO(unsigned int personality), > + TP_ARGS(personality), > + TP_STRUCT__entry(__field(unsigned int, personality)), > + TP_fast_assign(tp_assign(personality, personality)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setfsuid16 > +SC_TRACE_EVENT(sys_setfsuid16, > + TP_PROTO(old_uid_t uid), > + TP_ARGS(uid), > + TP_STRUCT__entry(__field(old_uid_t, uid)), > + TP_fast_assign(tp_assign(uid, uid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setfsgid16 > +SC_TRACE_EVENT(sys_setfsgid16, > + TP_PROTO(old_gid_t gid), > + TP_ARGS(gid), > + TP_STRUCT__entry(__field(old_gid_t, gid)), > + TP_fast_assign(tp_assign(gid, gid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getsid > +SC_TRACE_EVENT(sys_getsid, > + TP_PROTO(pid_t pid), > + TP_ARGS(pid), > + TP_STRUCT__entry(__field(pid_t, pid)), > + TP_fast_assign(tp_assign(pid, pid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fdatasync > +SC_TRACE_EVENT(sys_fdatasync, > + TP_PROTO(unsigned int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(unsigned int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mlockall > +SC_TRACE_EVENT(sys_mlockall, > + TP_PROTO(int flags), > + TP_ARGS(flags), > + TP_STRUCT__entry(__field(int, flags)), > + TP_fast_assign(tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_getscheduler > +SC_TRACE_EVENT(sys_sched_getscheduler, > + TP_PROTO(pid_t pid), > + TP_ARGS(pid), > + TP_STRUCT__entry(__field(pid_t, pid)), > + TP_fast_assign(tp_assign(pid, pid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_get_priority_max > +SC_TRACE_EVENT(sys_sched_get_priority_max, > + TP_PROTO(int policy), > + TP_ARGS(policy), > + TP_STRUCT__entry(__field(int, policy)), > + TP_fast_assign(tp_assign(policy, policy)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_get_priority_min > +SC_TRACE_EVENT(sys_sched_get_priority_min, > + TP_PROTO(int policy), > + TP_ARGS(policy), > + TP_STRUCT__entry(__field(int, policy)), > + TP_fast_assign(tp_assign(policy, policy)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setuid > +SC_TRACE_EVENT(sys_setuid, > + TP_PROTO(uid_t uid), > + TP_ARGS(uid), > + TP_STRUCT__entry(__field(uid_t, uid)), > + TP_fast_assign(tp_assign(uid, uid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setgid > +SC_TRACE_EVENT(sys_setgid, > + TP_PROTO(gid_t gid), > + TP_ARGS(gid), > + TP_STRUCT__entry(__field(gid_t, gid)), > + TP_fast_assign(tp_assign(gid, gid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setfsuid > +SC_TRACE_EVENT(sys_setfsuid, > + TP_PROTO(uid_t uid), > + TP_ARGS(uid), > + TP_STRUCT__entry(__field(uid_t, uid)), > + TP_fast_assign(tp_assign(uid, uid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setfsgid > +SC_TRACE_EVENT(sys_setfsgid, > + TP_PROTO(gid_t gid), > + TP_ARGS(gid), > + TP_STRUCT__entry(__field(gid_t, gid)), > + TP_fast_assign(tp_assign(gid, gid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_io_destroy > +SC_TRACE_EVENT(sys_io_destroy, > + TP_PROTO(aio_context_t ctx), > + TP_ARGS(ctx), > + TP_STRUCT__entry(__field(aio_context_t, ctx)), > + TP_fast_assign(tp_assign(ctx, ctx)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_exit_group > +SC_TRACE_EVENT(sys_exit_group, > + TP_PROTO(int error_code), > + TP_ARGS(error_code), > + TP_STRUCT__entry(__field(int, error_code)), > + TP_fast_assign(tp_assign(error_code, error_code)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_epoll_create > +SC_TRACE_EVENT(sys_epoll_create, > + TP_PROTO(int size), > + TP_ARGS(size), > + TP_STRUCT__entry(__field(int, size)), > + TP_fast_assign(tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timer_getoverrun > +SC_TRACE_EVENT(sys_timer_getoverrun, > + TP_PROTO(timer_t timer_id), > + TP_ARGS(timer_id), > + TP_STRUCT__entry(__field(timer_t, timer_id)), > + TP_fast_assign(tp_assign(timer_id, timer_id)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timer_delete > +SC_TRACE_EVENT(sys_timer_delete, > + TP_PROTO(timer_t timer_id), > + TP_ARGS(timer_id), > + TP_STRUCT__entry(__field(timer_t, timer_id)), > + TP_fast_assign(tp_assign(timer_id, timer_id)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_unshare > +SC_TRACE_EVENT(sys_unshare, > + TP_PROTO(unsigned long unshare_flags), > + TP_ARGS(unshare_flags), > + TP_STRUCT__entry(__field(unsigned long, unshare_flags)), > + TP_fast_assign(tp_assign(unshare_flags, unshare_flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_eventfd > +SC_TRACE_EVENT(sys_eventfd, > + TP_PROTO(unsigned int count), > + TP_ARGS(count), > + TP_STRUCT__entry(__field(unsigned int, count)), > + TP_fast_assign(tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_epoll_create1 > +SC_TRACE_EVENT(sys_epoll_create1, > + TP_PROTO(int flags), > + TP_ARGS(flags), > + TP_STRUCT__entry(__field(int, flags)), > + TP_fast_assign(tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_inotify_init1 > +SC_TRACE_EVENT(sys_inotify_init1, > + TP_PROTO(int flags), > + TP_ARGS(flags), > + TP_STRUCT__entry(__field(int, flags)), > + TP_fast_assign(tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_syncfs > +SC_TRACE_EVENT(sys_syncfs, > + TP_PROTO(int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_kill > +SC_TRACE_EVENT(sys_kill, > + TP_PROTO(pid_t pid, int sig), > + TP_ARGS(pid, sig), > + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setpgid > +SC_TRACE_EVENT(sys_setpgid, > + TP_PROTO(pid_t pid, pid_t pgid), > + TP_ARGS(pid, pgid), > + TP_STRUCT__entry(__field(pid_t, pid) __field(pid_t, pgid)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(pgid, pgid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_dup2 > +SC_TRACE_EVENT(sys_dup2, > + TP_PROTO(unsigned int oldfd, unsigned int newfd), > + TP_ARGS(oldfd, newfd), > + TP_STRUCT__entry(__field(unsigned int, oldfd) __field(unsigned int, newfd)), > + TP_fast_assign(tp_assign(oldfd, oldfd) tp_assign(newfd, newfd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setreuid16 > +SC_TRACE_EVENT(sys_setreuid16, > + TP_PROTO(old_uid_t ruid, old_uid_t euid), > + TP_ARGS(ruid, euid), > + TP_STRUCT__entry(__field(old_uid_t, ruid) __field(old_uid_t, euid)), > + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setregid16 > +SC_TRACE_EVENT(sys_setregid16, > + TP_PROTO(old_gid_t rgid, old_gid_t egid), > + TP_ARGS(rgid, egid), > + TP_STRUCT__entry(__field(old_gid_t, rgid) __field(old_gid_t, egid)), > + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_munmap > +SC_TRACE_EVENT(sys_munmap, > + TP_PROTO(unsigned long addr, size_t len), > + TP_ARGS(addr, len), > + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(size_t, len)), > + TP_fast_assign(tp_assign(addr, addr) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ftruncate > +SC_TRACE_EVENT(sys_ftruncate, > + TP_PROTO(unsigned int fd, unsigned long length), > + TP_ARGS(fd, length), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned long, length)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(length, length)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fchmod > +SC_TRACE_EVENT(sys_fchmod, > + TP_PROTO(unsigned int fd, umode_t mode), > + TP_ARGS(fd, mode), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(umode_t, mode)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getpriority > +SC_TRACE_EVENT(sys_getpriority, > + TP_PROTO(int which, int who), > + TP_ARGS(which, who), > + TP_STRUCT__entry(__field(int, which) __field(int, who)), > + TP_fast_assign(tp_assign(which, which) tp_assign(who, who)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_bdflush > +SC_TRACE_EVENT(sys_bdflush, > + TP_PROTO(int func, long data), > + TP_ARGS(func, data), > + TP_STRUCT__entry(__field(int, func) __field(long, data)), > + TP_fast_assign(tp_assign(func, func) tp_assign(data, data)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_flock > +SC_TRACE_EVENT(sys_flock, > + TP_PROTO(unsigned int fd, unsigned int cmd), > + TP_ARGS(fd, cmd), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mlock > +SC_TRACE_EVENT(sys_mlock, > + TP_PROTO(unsigned long start, size_t len), > + TP_ARGS(start, len), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_munlock > +SC_TRACE_EVENT(sys_munlock, > + TP_PROTO(unsigned long start, size_t len), > + TP_ARGS(start, len), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setreuid > +SC_TRACE_EVENT(sys_setreuid, > + TP_PROTO(uid_t ruid, uid_t euid), > + TP_ARGS(ruid, euid), > + TP_STRUCT__entry(__field(uid_t, ruid) __field(uid_t, euid)), > + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setregid > +SC_TRACE_EVENT(sys_setregid, > + TP_PROTO(gid_t rgid, gid_t egid), > + TP_ARGS(rgid, egid), > + TP_STRUCT__entry(__field(gid_t, rgid) __field(gid_t, egid)), > + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_tkill > +SC_TRACE_EVENT(sys_tkill, > + TP_PROTO(pid_t pid, int sig), > + TP_ARGS(pid, sig), > + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_listen > +SC_TRACE_EVENT(sys_listen, > + TP_PROTO(int fd, int backlog), > + TP_ARGS(fd, backlog), > + TP_STRUCT__entry(__field(int, fd) __field(int, backlog)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(backlog, backlog)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_shutdown > +SC_TRACE_EVENT(sys_shutdown, > + TP_PROTO(int fd, int how), > + TP_ARGS(fd, how), > + TP_STRUCT__entry(__field(int, fd) __field(int, how)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(how, how)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_msgget > +SC_TRACE_EVENT(sys_msgget, > + TP_PROTO(key_t key, int msgflg), > + TP_ARGS(key, msgflg), > + TP_STRUCT__entry(__field(key_t, key) __field(int, msgflg)), > + TP_fast_assign(tp_assign(key, key) tp_assign(msgflg, msgflg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ioprio_get > +SC_TRACE_EVENT(sys_ioprio_get, > + TP_PROTO(int which, int who), > + TP_ARGS(which, who), > + TP_STRUCT__entry(__field(int, which) __field(int, who)), > + TP_fast_assign(tp_assign(which, which) tp_assign(who, who)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_inotify_rm_watch > +SC_TRACE_EVENT(sys_inotify_rm_watch, > + TP_PROTO(int fd, __s32 wd), > + TP_ARGS(fd, wd), > + TP_STRUCT__entry(__field(int, fd) __field(__s32, wd)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(wd, wd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timerfd_create > +SC_TRACE_EVENT(sys_timerfd_create, > + TP_PROTO(int clockid, int flags), > + TP_ARGS(clockid, flags), > + TP_STRUCT__entry(__field(int, clockid) __field(int, flags)), > + TP_fast_assign(tp_assign(clockid, clockid) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_eventfd2 > +SC_TRACE_EVENT(sys_eventfd2, > + TP_PROTO(unsigned int count, int flags), > + TP_ARGS(count, flags), > + TP_STRUCT__entry(__field(unsigned int, count) __field(int, flags)), > + TP_fast_assign(tp_assign(count, count) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fanotify_init > +SC_TRACE_EVENT(sys_fanotify_init, > + TP_PROTO(unsigned int flags, unsigned int event_f_flags), > + TP_ARGS(flags, event_f_flags), > + TP_STRUCT__entry(__field(unsigned int, flags) __field(unsigned int, event_f_flags)), > + TP_fast_assign(tp_assign(flags, flags) tp_assign(event_f_flags, event_f_flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setns > +SC_TRACE_EVENT(sys_setns, > + TP_PROTO(int fd, int nstype), > + TP_ARGS(fd, nstype), > + TP_STRUCT__entry(__field(int, fd) __field(int, nstype)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(nstype, nstype)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lseek > +SC_TRACE_EVENT(sys_lseek, > + TP_PROTO(unsigned int fd, off_t offset, unsigned int origin), > + TP_ARGS(fd, offset, origin), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(off_t, offset) __field(unsigned int, origin)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(offset, offset) tp_assign(origin, origin)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ioctl > +SC_TRACE_EVENT(sys_ioctl, > + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), > + TP_ARGS(fd, cmd, arg), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fcntl > +SC_TRACE_EVENT(sys_fcntl, > + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), > + TP_ARGS(fd, cmd, arg), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fchown16 > +SC_TRACE_EVENT(sys_fchown16, > + TP_PROTO(unsigned int fd, old_uid_t user, old_gid_t group), > + TP_ARGS(fd, user, group), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(old_uid_t, user) __field(old_gid_t, group)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(user, user) tp_assign(group, group)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setpriority > +SC_TRACE_EVENT(sys_setpriority, > + TP_PROTO(int which, int who, int niceval), > + TP_ARGS(which, who, niceval), > + TP_STRUCT__entry(__field(int, which) __field(int, who) __field(int, niceval)), > + TP_fast_assign(tp_assign(which, which) tp_assign(who, who) tp_assign(niceval, niceval)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mprotect > +SC_TRACE_EVENT(sys_mprotect, > + TP_PROTO(unsigned long start, size_t len, unsigned long prot), > + TP_ARGS(start, len, prot), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field(unsigned long, prot)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(prot, prot)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sysfs > +SC_TRACE_EVENT(sys_sysfs, > + TP_PROTO(int option, unsigned long arg1, unsigned long arg2), > + TP_ARGS(option, arg1, arg2), > + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg1) __field(unsigned long, arg2)), > + TP_fast_assign(tp_assign(option, option) tp_assign(arg1, arg1) tp_assign(arg2, arg2)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_msync > +SC_TRACE_EVENT(sys_msync, > + TP_PROTO(unsigned long start, size_t len, int flags), > + TP_ARGS(start, len, flags), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field(int, flags)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setresuid16 > +SC_TRACE_EVENT(sys_setresuid16, > + TP_PROTO(old_uid_t ruid, old_uid_t euid, old_uid_t suid), > + TP_ARGS(ruid, euid, suid), > + TP_STRUCT__entry(__field(old_uid_t, ruid) __field(old_uid_t, euid) __field(old_uid_t, suid)), > + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setresgid16 > +SC_TRACE_EVENT(sys_setresgid16, > + TP_PROTO(old_gid_t rgid, old_gid_t egid, old_gid_t sgid), > + TP_ARGS(rgid, egid, sgid), > + TP_STRUCT__entry(__field(old_gid_t, rgid) __field(old_gid_t, egid) __field(old_gid_t, sgid)), > + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fchown > +SC_TRACE_EVENT(sys_fchown, > + TP_PROTO(unsigned int fd, uid_t user, gid_t group), > + TP_ARGS(fd, user, group), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(uid_t, user) __field(gid_t, group)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(user, user) tp_assign(group, group)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setresuid > +SC_TRACE_EVENT(sys_setresuid, > + TP_PROTO(uid_t ruid, uid_t euid, uid_t suid), > + TP_ARGS(ruid, euid, suid), > + TP_STRUCT__entry(__field(uid_t, ruid) __field(uid_t, euid) __field(uid_t, suid)), > + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setresgid > +SC_TRACE_EVENT(sys_setresgid, > + TP_PROTO(gid_t rgid, gid_t egid, gid_t sgid), > + TP_ARGS(rgid, egid, sgid), > + TP_STRUCT__entry(__field(gid_t, rgid) __field(gid_t, egid) __field(gid_t, sgid)), > + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_madvise > +SC_TRACE_EVENT(sys_madvise, > + TP_PROTO(unsigned long start, size_t len_in, int behavior), > + TP_ARGS(start, len_in, behavior), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len_in) __field(int, behavior)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len_in, len_in) tp_assign(behavior, behavior)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fcntl64 > +SC_TRACE_EVENT(sys_fcntl64, > + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), > + TP_ARGS(fd, cmd, arg), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_tgkill > +SC_TRACE_EVENT(sys_tgkill, > + TP_PROTO(pid_t tgid, pid_t pid, int sig), > + TP_ARGS(tgid, pid, sig), > + TP_STRUCT__entry(__field(pid_t, tgid) __field(pid_t, pid) __field(int, sig)), > + TP_fast_assign(tp_assign(tgid, tgid) tp_assign(pid, pid) tp_assign(sig, sig)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_socket > +SC_TRACE_EVENT(sys_socket, > + TP_PROTO(int family, int type, int protocol), > + TP_ARGS(family, type, protocol), > + TP_STRUCT__entry(__field(int, family) __field(int, type) __field(int, protocol)), > + TP_fast_assign(tp_assign(family, family) tp_assign(type, type) tp_assign(protocol, protocol)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_semget > +SC_TRACE_EVENT(sys_semget, > + TP_PROTO(key_t key, int nsems, int semflg), > + TP_ARGS(key, nsems, semflg), > + TP_STRUCT__entry(__field(key_t, key) __field(int, nsems) __field(int, semflg)), > + TP_fast_assign(tp_assign(key, key) tp_assign(nsems, nsems) tp_assign(semflg, semflg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_shmget > +SC_TRACE_EVENT(sys_shmget, > + TP_PROTO(key_t key, size_t size, int shmflg), > + TP_ARGS(key, size, shmflg), > + TP_STRUCT__entry(__field(key_t, key) __field(size_t, size) __field(int, shmflg)), > + TP_fast_assign(tp_assign(key, key) tp_assign(size, size) tp_assign(shmflg, shmflg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ioprio_set > +SC_TRACE_EVENT(sys_ioprio_set, > + TP_PROTO(int which, int who, int ioprio), > + TP_ARGS(which, who, ioprio), > + TP_STRUCT__entry(__field(int, which) __field(int, who) __field(int, ioprio)), > + TP_fast_assign(tp_assign(which, which) tp_assign(who, who) tp_assign(ioprio, ioprio)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_dup3 > +SC_TRACE_EVENT(sys_dup3, > + TP_PROTO(unsigned int oldfd, unsigned int newfd, int flags), > + TP_ARGS(oldfd, newfd, flags), > + TP_STRUCT__entry(__field(unsigned int, oldfd) __field(unsigned int, newfd) __field(int, flags)), > + TP_fast_assign(tp_assign(oldfd, oldfd) tp_assign(newfd, newfd) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ptrace > +SC_TRACE_EVENT(sys_ptrace, > + TP_PROTO(long request, long pid, unsigned long addr, unsigned long data), > + TP_ARGS(request, pid, addr, data), > + TP_STRUCT__entry(__field(long, request) __field(long, pid) __field_hex(unsigned long, addr) __field(unsigned long, data)), > + TP_fast_assign(tp_assign(request, request) tp_assign(pid, pid) tp_assign(addr, addr) tp_assign(data, data)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_tee > +SC_TRACE_EVENT(sys_tee, > + TP_PROTO(int fdin, int fdout, size_t len, unsigned int flags), > + TP_ARGS(fdin, fdout, len, flags), > + TP_STRUCT__entry(__field(int, fdin) __field(int, fdout) __field(size_t, len) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fdin, fdin) tp_assign(fdout, fdout) tp_assign(len, len) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mremap > +SC_TRACE_EVENT(sys_mremap, > + TP_PROTO(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr), > + TP_ARGS(addr, old_len, new_len, flags, new_addr), > + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(unsigned long, old_len) __field(unsigned long, new_len) __field(unsigned long, flags) __field_hex(unsigned long, new_addr)), > + TP_fast_assign(tp_assign(addr, addr) tp_assign(old_len, old_len) tp_assign(new_len, new_len) tp_assign(flags, flags) tp_assign(new_addr, new_addr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_prctl > +SC_TRACE_EVENT(sys_prctl, > + TP_PROTO(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5), > + TP_ARGS(option, arg2, arg3, arg4, arg5), > + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg2) __field(unsigned long, arg3) __field(unsigned long, arg4) __field(unsigned long, arg5)), > + TP_fast_assign(tp_assign(option, option) tp_assign(arg2, arg2) tp_assign(arg3, arg3) tp_assign(arg4, arg4) tp_assign(arg5, arg5)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_remap_file_pages > +SC_TRACE_EVENT(sys_remap_file_pages, > + TP_PROTO(unsigned long start, unsigned long size, unsigned long prot, unsigned long pgoff, unsigned long flags), > + TP_ARGS(start, size, prot, pgoff, flags), > + TP_STRUCT__entry(__field(unsigned long, start) __field(unsigned long, size) __field(unsigned long, prot) __field(unsigned long, pgoff) __field(unsigned long, flags)), > + TP_fast_assign(tp_assign(start, start) tp_assign(size, size) tp_assign(prot, prot) tp_assign(pgoff, pgoff) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_keyctl > +SC_TRACE_EVENT(sys_keyctl, > + TP_PROTO(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5), > + TP_ARGS(option, arg2, arg3, arg4, arg5), > + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg2) __field(unsigned long, arg3) __field(unsigned long, arg4) __field(unsigned long, arg5)), > + TP_fast_assign(tp_assign(option, option) tp_assign(arg2, arg2) tp_assign(arg3, arg3) tp_assign(arg4, arg4) tp_assign(arg5, arg5)), > + TP_printk() > +) > +#endif > + > +#endif /* _TRACE_SYSCALLS_INTEGERS_H */ > + > +/* This part must be outside protection */ > +#include "../../../probes/define_trace.h" > + > +#else /* CREATE_SYSCALL_TABLE */ > + > +#include "arm-32-syscalls-3.4.25_integers_override.h" > +#include "syscalls_integers_override.h" > + > +#ifndef OVERRIDE_TABLE_32_sys_restart_syscall > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_restart_syscall, 0, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getpid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getpid, 20, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getuid16 > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getuid16, 24, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pause > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_pause, 29, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sync > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sync, 36, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getgid16 > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getgid16, 47, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_geteuid16 > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_geteuid16, 49, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getegid16 > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getegid16, 50, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getppid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getppid, 64, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getpgrp > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getpgrp, 65, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setsid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_setsid, 66, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_vhangup > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_vhangup, 111, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_munlockall > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_munlockall, 153, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_yield > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sched_yield, 158, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getuid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getuid, 199, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getgid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getgid, 200, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_geteuid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_geteuid, 201, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getegid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getegid, 202, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_gettid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_gettid, 224, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_inotify_init > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_inotify_init, 316, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_exit > +TRACE_SYSCALL_TABLE(sys_exit, sys_exit, 1, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_close > +TRACE_SYSCALL_TABLE(sys_close, sys_close, 6, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lseek > +TRACE_SYSCALL_TABLE(sys_lseek, sys_lseek, 19, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setuid16 > +TRACE_SYSCALL_TABLE(sys_setuid16, sys_setuid16, 23, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ptrace > +TRACE_SYSCALL_TABLE(sys_ptrace, sys_ptrace, 26, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_nice > +TRACE_SYSCALL_TABLE(sys_nice, sys_nice, 34, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_kill > +TRACE_SYSCALL_TABLE(sys_kill, sys_kill, 37, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_dup > +TRACE_SYSCALL_TABLE(sys_dup, sys_dup, 41, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_brk > +TRACE_SYSCALL_TABLE(sys_brk, sys_brk, 45, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setgid16 > +TRACE_SYSCALL_TABLE(sys_setgid16, sys_setgid16, 46, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ioctl > +TRACE_SYSCALL_TABLE(sys_ioctl, sys_ioctl, 54, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fcntl > +TRACE_SYSCALL_TABLE(sys_fcntl, sys_fcntl, 55, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setpgid > +TRACE_SYSCALL_TABLE(sys_setpgid, sys_setpgid, 57, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_umask > +TRACE_SYSCALL_TABLE(sys_umask, sys_umask, 60, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_dup2 > +TRACE_SYSCALL_TABLE(sys_dup2, sys_dup2, 63, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setreuid16 > +TRACE_SYSCALL_TABLE(sys_setreuid16, sys_setreuid16, 70, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setregid16 > +TRACE_SYSCALL_TABLE(sys_setregid16, sys_setregid16, 71, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_munmap > +TRACE_SYSCALL_TABLE(sys_munmap, sys_munmap, 91, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ftruncate > +TRACE_SYSCALL_TABLE(sys_ftruncate, sys_ftruncate, 93, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fchmod > +TRACE_SYSCALL_TABLE(sys_fchmod, sys_fchmod, 94, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fchown16 > +TRACE_SYSCALL_TABLE(sys_fchown16, sys_fchown16, 95, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getpriority > +TRACE_SYSCALL_TABLE(sys_getpriority, sys_getpriority, 96, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setpriority > +TRACE_SYSCALL_TABLE(sys_setpriority, sys_setpriority, 97, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fsync > +TRACE_SYSCALL_TABLE(sys_fsync, sys_fsync, 118, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mprotect > +TRACE_SYSCALL_TABLE(sys_mprotect, sys_mprotect, 125, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getpgid > +TRACE_SYSCALL_TABLE(sys_getpgid, sys_getpgid, 132, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fchdir > +TRACE_SYSCALL_TABLE(sys_fchdir, sys_fchdir, 133, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_bdflush > +TRACE_SYSCALL_TABLE(sys_bdflush, sys_bdflush, 134, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sysfs > +TRACE_SYSCALL_TABLE(sys_sysfs, sys_sysfs, 135, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_personality > +TRACE_SYSCALL_TABLE(sys_personality, sys_personality, 136, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setfsuid16 > +TRACE_SYSCALL_TABLE(sys_setfsuid16, sys_setfsuid16, 138, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setfsgid16 > +TRACE_SYSCALL_TABLE(sys_setfsgid16, sys_setfsgid16, 139, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_flock > +TRACE_SYSCALL_TABLE(sys_flock, sys_flock, 143, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_msync > +TRACE_SYSCALL_TABLE(sys_msync, sys_msync, 144, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getsid > +TRACE_SYSCALL_TABLE(sys_getsid, sys_getsid, 147, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fdatasync > +TRACE_SYSCALL_TABLE(sys_fdatasync, sys_fdatasync, 148, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mlock > +TRACE_SYSCALL_TABLE(sys_mlock, sys_mlock, 150, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_munlock > +TRACE_SYSCALL_TABLE(sys_munlock, sys_munlock, 151, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mlockall > +TRACE_SYSCALL_TABLE(sys_mlockall, sys_mlockall, 152, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_getscheduler > +TRACE_SYSCALL_TABLE(sys_sched_getscheduler, sys_sched_getscheduler, 157, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_get_priority_max > +TRACE_SYSCALL_TABLE(sys_sched_get_priority_max, sys_sched_get_priority_max, 159, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_get_priority_min > +TRACE_SYSCALL_TABLE(sys_sched_get_priority_min, sys_sched_get_priority_min, 160, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mremap > +TRACE_SYSCALL_TABLE(sys_mremap, sys_mremap, 163, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setresuid16 > +TRACE_SYSCALL_TABLE(sys_setresuid16, sys_setresuid16, 164, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setresgid16 > +TRACE_SYSCALL_TABLE(sys_setresgid16, sys_setresgid16, 170, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_prctl > +TRACE_SYSCALL_TABLE(sys_prctl, sys_prctl, 172, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setreuid > +TRACE_SYSCALL_TABLE(sys_setreuid, sys_setreuid, 203, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setregid > +TRACE_SYSCALL_TABLE(sys_setregid, sys_setregid, 204, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fchown > +TRACE_SYSCALL_TABLE(sys_fchown, sys_fchown, 207, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setresuid > +TRACE_SYSCALL_TABLE(sys_setresuid, sys_setresuid, 208, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setresgid > +TRACE_SYSCALL_TABLE(sys_setresgid, sys_setresgid, 210, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setuid > +TRACE_SYSCALL_TABLE(sys_setuid, sys_setuid, 213, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setgid > +TRACE_SYSCALL_TABLE(sys_setgid, sys_setgid, 214, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setfsuid > +TRACE_SYSCALL_TABLE(sys_setfsuid, sys_setfsuid, 215, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setfsgid > +TRACE_SYSCALL_TABLE(sys_setfsgid, sys_setfsgid, 216, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_madvise > +TRACE_SYSCALL_TABLE(sys_madvise, sys_madvise, 220, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fcntl64 > +TRACE_SYSCALL_TABLE(sys_fcntl64, sys_fcntl64, 221, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_tkill > +TRACE_SYSCALL_TABLE(sys_tkill, sys_tkill, 238, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_io_destroy > +TRACE_SYSCALL_TABLE(sys_io_destroy, sys_io_destroy, 244, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_exit_group > +TRACE_SYSCALL_TABLE(sys_exit_group, sys_exit_group, 248, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_epoll_create > +TRACE_SYSCALL_TABLE(sys_epoll_create, sys_epoll_create, 250, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_remap_file_pages > +TRACE_SYSCALL_TABLE(sys_remap_file_pages, sys_remap_file_pages, 253, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timer_getoverrun > +TRACE_SYSCALL_TABLE(sys_timer_getoverrun, sys_timer_getoverrun, 260, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timer_delete > +TRACE_SYSCALL_TABLE(sys_timer_delete, sys_timer_delete, 261, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_tgkill > +TRACE_SYSCALL_TABLE(sys_tgkill, sys_tgkill, 268, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_socket > +TRACE_SYSCALL_TABLE(sys_socket, sys_socket, 281, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_listen > +TRACE_SYSCALL_TABLE(sys_listen, sys_listen, 284, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_shutdown > +TRACE_SYSCALL_TABLE(sys_shutdown, sys_shutdown, 293, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_semget > +TRACE_SYSCALL_TABLE(sys_semget, sys_semget, 299, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_msgget > +TRACE_SYSCALL_TABLE(sys_msgget, sys_msgget, 303, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_shmget > +TRACE_SYSCALL_TABLE(sys_shmget, sys_shmget, 307, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_keyctl > +TRACE_SYSCALL_TABLE(sys_keyctl, sys_keyctl, 311, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ioprio_set > +TRACE_SYSCALL_TABLE(sys_ioprio_set, sys_ioprio_set, 314, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ioprio_get > +TRACE_SYSCALL_TABLE(sys_ioprio_get, sys_ioprio_get, 315, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_inotify_rm_watch > +TRACE_SYSCALL_TABLE(sys_inotify_rm_watch, sys_inotify_rm_watch, 318, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_unshare > +TRACE_SYSCALL_TABLE(sys_unshare, sys_unshare, 337, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_tee > +TRACE_SYSCALL_TABLE(sys_tee, sys_tee, 342, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timerfd_create > +TRACE_SYSCALL_TABLE(sys_timerfd_create, sys_timerfd_create, 350, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_eventfd > +TRACE_SYSCALL_TABLE(sys_eventfd, sys_eventfd, 351, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_eventfd2 > +TRACE_SYSCALL_TABLE(sys_eventfd2, sys_eventfd2, 356, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_epoll_create1 > +TRACE_SYSCALL_TABLE(sys_epoll_create1, sys_epoll_create1, 357, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_dup3 > +TRACE_SYSCALL_TABLE(sys_dup3, sys_dup3, 358, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_inotify_init1 > +TRACE_SYSCALL_TABLE(sys_inotify_init1, sys_inotify_init1, 360, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fanotify_init > +TRACE_SYSCALL_TABLE(sys_fanotify_init, sys_fanotify_init, 367, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_syncfs > +TRACE_SYSCALL_TABLE(sys_syncfs, sys_syncfs, 373, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setns > +TRACE_SYSCALL_TABLE(sys_setns, sys_setns, 375, 2) > +#endif > + > +#endif /* CREATE_SYSCALL_TABLE */ > diff --git a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.h b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.h > new file mode 100644 > index 0000000..895370f > --- /dev/null > +++ b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_integers_override.h > @@ -0,0 +1,52 @@ > + > + > +#define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 > +#define OVERRIDE_TABLE_32_sys_sync_file_range2 > + > +#ifndef CREATE_SYSCALL_TABLE > + > +SC_TRACE_EVENT(sys_arm_fadvise64_64, > + TP_PROTO(int fd, int advice, loff_t offset, loff_t len), > + TP_ARGS(fd, advice, offset, len), > + TP_STRUCT__entry( > + __field_hex(int, fd) > + __field_hex(int, advice) > + __field_hex(loff_t, offset) > + __field_hex(loff_t, len)), > + TP_fast_assign( > + tp_assign(fd, fd) > + tp_assign(advice, advice) > + tp_assign(offset, offset) > + tp_assign(len, len)), > + TP_printk() > +) > + > +SC_TRACE_EVENT(sys_sync_file_range2, > + TP_PROTO(int fd, loff_t offset, loff_t nbytes, unsigned int flags), > + TP_ARGS(fd, offset, nbytes, flags), > + TP_STRUCT__entry( > + __field_hex(int, fd) > + __field_hex(loff_t, offset) > + __field_hex(loff_t, nbytes) > + __field_hex(unsigned int, flags)), > + TP_fast_assign( > + tp_assign(fd, fd) > + tp_assign(offset, offset) > + tp_assign(nbytes, nbytes) > + tp_assign(flags, flags)), > + TP_printk() > +) > + > +#else /* CREATE_SYSCALL_TABLE */ > + > +#define OVVERRIDE_TABLE_32_sys_mmap > +TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) > + > +#define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 > +TRACE_SYSCALL_TABLE(sys_arm_fadvise64_64, sys_arm_fadvise64_64, 270, 4) > +#define OVERRIDE_TABLE_32_sys_sync_file_range2 > +TRACE_SYSCALL_TABLE(sys_sync_file_range2, sys_sync_file_range2, 341, 4) > + > +#endif /* CREATE_SYSCALL_TABLE */ > + > + > diff --git a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers.h b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers.h > new file mode 100644 > index 0000000..3a9c146 > --- /dev/null > +++ b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers.h > @@ -0,0 +1,2316 @@ > +/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */ > +#ifndef CREATE_SYSCALL_TABLE > + > +#if !defined(_TRACE_SYSCALLS_POINTERS_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_SYSCALLS_POINTERS_H > + > +#include > +#include > +#include "arm-32-syscalls-3.4.25_pointers_override.h" > +#include "syscalls_pointers_override.h" > + > +#ifndef OVERRIDE_32_sys_unlink > +SC_TRACE_EVENT(sys_unlink, > + TP_PROTO(const char * pathname), > + TP_ARGS(pathname), > + TP_STRUCT__entry(__string_from_user(pathname, pathname)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_chdir > +SC_TRACE_EVENT(sys_chdir, > + TP_PROTO(const char * filename), > + TP_ARGS(filename), > + TP_STRUCT__entry(__string_from_user(filename, filename)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rmdir > +SC_TRACE_EVENT(sys_rmdir, > + TP_PROTO(const char * pathname), > + TP_ARGS(pathname), > + TP_STRUCT__entry(__string_from_user(pathname, pathname)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_pipe > +SC_TRACE_EVENT(sys_pipe, > + TP_PROTO(int * fildes), > + TP_ARGS(fildes), > + TP_STRUCT__entry(__field_hex(int *, fildes)), > + TP_fast_assign(tp_assign(fildes, fildes)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_times > +SC_TRACE_EVENT(sys_times, > + TP_PROTO(struct tms * tbuf), > + TP_ARGS(tbuf), > + TP_STRUCT__entry(__field_hex(struct tms *, tbuf)), > + TP_fast_assign(tp_assign(tbuf, tbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_acct > +SC_TRACE_EVENT(sys_acct, > + TP_PROTO(const char * name), > + TP_ARGS(name), > + TP_STRUCT__entry(__string_from_user(name, name)), > + TP_fast_assign(tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_chroot > +SC_TRACE_EVENT(sys_chroot, > + TP_PROTO(const char * filename), > + TP_ARGS(filename), > + TP_STRUCT__entry(__string_from_user(filename, filename)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sigpending > +SC_TRACE_EVENT(sys_sigpending, > + TP_PROTO(old_sigset_t * set), > + TP_ARGS(set), > + TP_STRUCT__entry(__field_hex(old_sigset_t *, set)), > + TP_fast_assign(tp_assign(set, set)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_uselib > +SC_TRACE_EVENT(sys_uselib, > + TP_PROTO(const char * library), > + TP_ARGS(library), > + TP_STRUCT__entry(__field_hex(const char *, library)), > + TP_fast_assign(tp_assign(library, library)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_swapoff > +SC_TRACE_EVENT(sys_swapoff, > + TP_PROTO(const char * specialfile), > + TP_ARGS(specialfile), > + TP_STRUCT__entry(__string_from_user(specialfile, specialfile)), > + TP_fast_assign(tp_copy_string_from_user(specialfile, specialfile)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sysinfo > +SC_TRACE_EVENT(sys_sysinfo, > + TP_PROTO(struct sysinfo * info), > + TP_ARGS(info), > + TP_STRUCT__entry(__field_hex(struct sysinfo *, info)), > + TP_fast_assign(tp_assign(info, info)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_newuname > +SC_TRACE_EVENT(sys_newuname, > + TP_PROTO(struct new_utsname * name), > + TP_ARGS(name), > + TP_STRUCT__entry(__field_hex(struct new_utsname *, name)), > + TP_fast_assign(tp_assign(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_adjtimex > +SC_TRACE_EVENT(sys_adjtimex, > + TP_PROTO(struct timex * txc_p), > + TP_ARGS(txc_p), > + TP_STRUCT__entry(__field_hex(struct timex *, txc_p)), > + TP_fast_assign(tp_assign(txc_p, txc_p)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sysctl > +SC_TRACE_EVENT(sys_sysctl, > + TP_PROTO(struct __sysctl_args * args), > + TP_ARGS(args), > + TP_STRUCT__entry(__field_hex(struct __sysctl_args *, args)), > + TP_fast_assign(tp_assign(args, args)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_set_tid_address > +SC_TRACE_EVENT(sys_set_tid_address, > + TP_PROTO(int * tidptr), > + TP_ARGS(tidptr), > + TP_STRUCT__entry(__field_hex(int *, tidptr)), > + TP_fast_assign(tp_assign(tidptr, tidptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mq_unlink > +SC_TRACE_EVENT(sys_mq_unlink, > + TP_PROTO(const char * u_name), > + TP_ARGS(u_name), > + TP_STRUCT__entry(__string_from_user(u_name, u_name)), > + TP_fast_assign(tp_copy_string_from_user(u_name, u_name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_shmdt > +SC_TRACE_EVENT(sys_shmdt, > + TP_PROTO(char * shmaddr), > + TP_ARGS(shmaddr), > + TP_STRUCT__entry(__field_hex(char *, shmaddr)), > + TP_fast_assign(tp_assign(shmaddr, shmaddr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_creat > +SC_TRACE_EVENT(sys_creat, > + TP_PROTO(const char * pathname, umode_t mode), > + TP_ARGS(pathname, mode), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field(umode_t, mode)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_link > +SC_TRACE_EVENT(sys_link, > + TP_PROTO(const char * oldname, const char * newname), > + TP_ARGS(oldname, newname), > + TP_STRUCT__entry(__string_from_user(oldname, oldname) __string_from_user(newname, newname)), > + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_copy_string_from_user(newname, newname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_chmod > +SC_TRACE_EVENT(sys_chmod, > + TP_PROTO(const char * filename, umode_t mode), > + TP_ARGS(filename, mode), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(umode_t, mode)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_access > +SC_TRACE_EVENT(sys_access, > + TP_PROTO(const char * filename, int mode), > + TP_ARGS(filename, mode), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(int, mode)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rename > +SC_TRACE_EVENT(sys_rename, > + TP_PROTO(const char * oldname, const char * newname), > + TP_ARGS(oldname, newname), > + TP_STRUCT__entry(__string_from_user(oldname, oldname) __string_from_user(newname, newname)), > + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_copy_string_from_user(newname, newname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mkdir > +SC_TRACE_EVENT(sys_mkdir, > + TP_PROTO(const char * pathname, umode_t mode), > + TP_ARGS(pathname, mode), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field(umode_t, mode)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_umount > +SC_TRACE_EVENT(sys_umount, > + TP_PROTO(char * name, int flags), > + TP_ARGS(name, flags), > + TP_STRUCT__entry(__string_from_user(name, name) __field(int, flags)), > + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ustat > +SC_TRACE_EVENT(sys_ustat, > + TP_PROTO(unsigned dev, struct ustat * ubuf), > + TP_ARGS(dev, ubuf), > + TP_STRUCT__entry(__field(unsigned, dev) __field_hex(struct ustat *, ubuf)), > + TP_fast_assign(tp_assign(dev, dev) tp_assign(ubuf, ubuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sethostname > +SC_TRACE_EVENT(sys_sethostname, > + TP_PROTO(char * name, int len), > + TP_ARGS(name, len), > + TP_STRUCT__entry(__string_from_user(name, name) __field(int, len)), > + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setrlimit > +SC_TRACE_EVENT(sys_setrlimit, > + TP_PROTO(unsigned int resource, struct rlimit * rlim), > + TP_ARGS(resource, rlim), > + TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), > + TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getrusage > +SC_TRACE_EVENT(sys_getrusage, > + TP_PROTO(int who, struct rusage * ru), > + TP_ARGS(who, ru), > + TP_STRUCT__entry(__field(int, who) __field_hex(struct rusage *, ru)), > + TP_fast_assign(tp_assign(who, who) tp_assign(ru, ru)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_gettimeofday > +SC_TRACE_EVENT(sys_gettimeofday, > + TP_PROTO(struct timeval * tv, struct timezone * tz), > + TP_ARGS(tv, tz), > + TP_STRUCT__entry(__field_hex(struct timeval *, tv) __field_hex(struct timezone *, tz)), > + TP_fast_assign(tp_assign(tv, tv) tp_assign(tz, tz)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_settimeofday > +SC_TRACE_EVENT(sys_settimeofday, > + TP_PROTO(struct timeval * tv, struct timezone * tz), > + TP_ARGS(tv, tz), > + TP_STRUCT__entry(__field_hex(struct timeval *, tv) __field_hex(struct timezone *, tz)), > + TP_fast_assign(tp_assign(tv, tv) tp_assign(tz, tz)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getgroups16 > +SC_TRACE_EVENT(sys_getgroups16, > + TP_PROTO(int gidsetsize, old_gid_t * grouplist), > + TP_ARGS(gidsetsize, grouplist), > + TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(old_gid_t *, grouplist)), > + TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setgroups16 > +SC_TRACE_EVENT(sys_setgroups16, > + TP_PROTO(int gidsetsize, old_gid_t * grouplist), > + TP_ARGS(gidsetsize, grouplist), > + TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(old_gid_t *, grouplist)), > + TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_symlink > +SC_TRACE_EVENT(sys_symlink, > + TP_PROTO(const char * oldname, const char * newname), > + TP_ARGS(oldname, newname), > + TP_STRUCT__entry(__string_from_user(oldname, oldname) __string_from_user(newname, newname)), > + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_copy_string_from_user(newname, newname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_swapon > +SC_TRACE_EVENT(sys_swapon, > + TP_PROTO(const char * specialfile, int swap_flags), > + TP_ARGS(specialfile, swap_flags), > + TP_STRUCT__entry(__string_from_user(specialfile, specialfile) __field(int, swap_flags)), > + TP_fast_assign(tp_copy_string_from_user(specialfile, specialfile) tp_assign(swap_flags, swap_flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_truncate > +SC_TRACE_EVENT(sys_truncate, > + TP_PROTO(const char * path, long length), > + TP_ARGS(path, length), > + TP_STRUCT__entry(__string_from_user(path, path) __field(long, length)), > + TP_fast_assign(tp_copy_string_from_user(path, path) tp_assign(length, length)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_statfs > +SC_TRACE_EVENT(sys_statfs, > + TP_PROTO(const char * pathname, struct statfs * buf), > + TP_ARGS(pathname, buf), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(struct statfs *, buf)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fstatfs > +SC_TRACE_EVENT(sys_fstatfs, > + TP_PROTO(unsigned int fd, struct statfs * buf), > + TP_ARGS(fd, buf), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct statfs *, buf)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getitimer > +SC_TRACE_EVENT(sys_getitimer, > + TP_PROTO(int which, struct itimerval * value), > + TP_ARGS(which, value), > + TP_STRUCT__entry(__field(int, which) __field_hex(struct itimerval *, value)), > + TP_fast_assign(tp_assign(which, which) tp_assign(value, value)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_newstat > +SC_TRACE_EVENT(sys_newstat, > + TP_PROTO(const char * filename, struct stat * statbuf), > + TP_ARGS(filename, statbuf), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat *, statbuf)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_newlstat > +SC_TRACE_EVENT(sys_newlstat, > + TP_PROTO(const char * filename, struct stat * statbuf), > + TP_ARGS(filename, statbuf), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat *, statbuf)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_newfstat > +SC_TRACE_EVENT(sys_newfstat, > + TP_PROTO(unsigned int fd, struct stat * statbuf), > + TP_ARGS(fd, statbuf), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct stat *, statbuf)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setdomainname > +SC_TRACE_EVENT(sys_setdomainname, > + TP_PROTO(char * name, int len), > + TP_ARGS(name, len), > + TP_STRUCT__entry(__string_from_user(name, name) __field(int, len)), > + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_delete_module > +SC_TRACE_EVENT(sys_delete_module, > + TP_PROTO(const char * name_user, unsigned int flags), > + TP_ARGS(name_user, flags), > + TP_STRUCT__entry(__string_from_user(name_user, name_user) __field(unsigned int, flags)), > + TP_fast_assign(tp_copy_string_from_user(name_user, name_user) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_setparam > +SC_TRACE_EVENT(sys_sched_setparam, > + TP_PROTO(pid_t pid, struct sched_param * param), > + TP_ARGS(pid, param), > + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct sched_param *, param)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(param, param)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_getparam > +SC_TRACE_EVENT(sys_sched_getparam, > + TP_PROTO(pid_t pid, struct sched_param * param), > + TP_ARGS(pid, param), > + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct sched_param *, param)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(param, param)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_rr_get_interval > +SC_TRACE_EVENT(sys_sched_rr_get_interval, > + TP_PROTO(pid_t pid, struct timespec * interval), > + TP_ARGS(pid, interval), > + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct timespec *, interval)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(interval, interval)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_nanosleep > +SC_TRACE_EVENT(sys_nanosleep, > + TP_PROTO(struct timespec * rqtp, struct timespec * rmtp), > + TP_ARGS(rqtp, rmtp), > + TP_STRUCT__entry(__field_hex(struct timespec *, rqtp) __field_hex(struct timespec *, rmtp)), > + TP_fast_assign(tp_assign(rqtp, rqtp) tp_assign(rmtp, rmtp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_sigpending > +SC_TRACE_EVENT(sys_rt_sigpending, > + TP_PROTO(sigset_t * set, size_t sigsetsize), > + TP_ARGS(set, sigsetsize), > + TP_STRUCT__entry(__field_hex(sigset_t *, set) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(set, set) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_sigsuspend > +SC_TRACE_EVENT(sys_rt_sigsuspend, > + TP_PROTO(sigset_t * unewset, size_t sigsetsize), > + TP_ARGS(unewset, sigsetsize), > + TP_STRUCT__entry(__field_hex(sigset_t *, unewset) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(unewset, unewset) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getcwd > +SC_TRACE_EVENT(sys_getcwd, > + TP_PROTO(char * buf, unsigned long size), > + TP_ARGS(buf, size), > + TP_STRUCT__entry(__field_hex(char *, buf) __field(unsigned long, size)), > + TP_fast_assign(tp_assign(buf, buf) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getrlimit > +SC_TRACE_EVENT(sys_getrlimit, > + TP_PROTO(unsigned int resource, struct rlimit * rlim), > + TP_ARGS(resource, rlim), > + TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), > + TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_stat64 > +SC_TRACE_EVENT(sys_stat64, > + TP_PROTO(const char * filename, struct stat64 * statbuf), > + TP_ARGS(filename, statbuf), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat64 *, statbuf)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lstat64 > +SC_TRACE_EVENT(sys_lstat64, > + TP_PROTO(const char * filename, struct stat64 * statbuf), > + TP_ARGS(filename, statbuf), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat64 *, statbuf)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fstat64 > +SC_TRACE_EVENT(sys_fstat64, > + TP_PROTO(unsigned long fd, struct stat64 * statbuf), > + TP_ARGS(fd, statbuf), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(struct stat64 *, statbuf)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getgroups > +SC_TRACE_EVENT(sys_getgroups, > + TP_PROTO(int gidsetsize, gid_t * grouplist), > + TP_ARGS(gidsetsize, grouplist), > + TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(gid_t *, grouplist)), > + TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setgroups > +SC_TRACE_EVENT(sys_setgroups, > + TP_PROTO(int gidsetsize, gid_t * grouplist), > + TP_ARGS(gidsetsize, grouplist), > + TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(gid_t *, grouplist)), > + TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_pivot_root > +SC_TRACE_EVENT(sys_pivot_root, > + TP_PROTO(const char * new_root, const char * put_old), > + TP_ARGS(new_root, put_old), > + TP_STRUCT__entry(__string_from_user(new_root, new_root) __string_from_user(put_old, put_old)), > + TP_fast_assign(tp_copy_string_from_user(new_root, new_root) tp_copy_string_from_user(put_old, put_old)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_removexattr > +SC_TRACE_EVENT(sys_removexattr, > + TP_PROTO(const char * pathname, const char * name), > + TP_ARGS(pathname, name), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lremovexattr > +SC_TRACE_EVENT(sys_lremovexattr, > + TP_PROTO(const char * pathname, const char * name), > + TP_ARGS(pathname, name), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fremovexattr > +SC_TRACE_EVENT(sys_fremovexattr, > + TP_PROTO(int fd, const char * name), > + TP_ARGS(fd, name), > + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name)), > + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_io_setup > +SC_TRACE_EVENT(sys_io_setup, > + TP_PROTO(unsigned nr_events, aio_context_t * ctxp), > + TP_ARGS(nr_events, ctxp), > + TP_STRUCT__entry(__field(unsigned, nr_events) __field_hex(aio_context_t *, ctxp)), > + TP_fast_assign(tp_assign(nr_events, nr_events) tp_assign(ctxp, ctxp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timer_gettime > +SC_TRACE_EVENT(sys_timer_gettime, > + TP_PROTO(timer_t timer_id, struct itimerspec * setting), > + TP_ARGS(timer_id, setting), > + TP_STRUCT__entry(__field(timer_t, timer_id) __field_hex(struct itimerspec *, setting)), > + TP_fast_assign(tp_assign(timer_id, timer_id) tp_assign(setting, setting)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_clock_settime > +SC_TRACE_EVENT(sys_clock_settime, > + TP_PROTO(const clockid_t which_clock, const struct timespec * tp), > + TP_ARGS(which_clock, tp), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(const struct timespec *, tp)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_clock_gettime > +SC_TRACE_EVENT(sys_clock_gettime, > + TP_PROTO(const clockid_t which_clock, struct timespec * tp), > + TP_ARGS(which_clock, tp), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timespec *, tp)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_clock_getres > +SC_TRACE_EVENT(sys_clock_getres, > + TP_PROTO(const clockid_t which_clock, struct timespec * tp), > + TP_ARGS(which_clock, tp), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timespec *, tp)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_utimes > +SC_TRACE_EVENT(sys_utimes, > + TP_PROTO(char * filename, struct timeval * utimes), > + TP_ARGS(filename, utimes), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct timeval *, utimes)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mq_notify > +SC_TRACE_EVENT(sys_mq_notify, > + TP_PROTO(mqd_t mqdes, const struct sigevent * u_notification), > + TP_ARGS(mqdes, u_notification), > + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const struct sigevent *, u_notification)), > + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_notification, u_notification)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_set_robust_list > +SC_TRACE_EVENT(sys_set_robust_list, > + TP_PROTO(struct robust_list_head * head, size_t len), > + TP_ARGS(head, len), > + TP_STRUCT__entry(__field_hex(struct robust_list_head *, head) __field(size_t, len)), > + TP_fast_assign(tp_assign(head, head) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timerfd_gettime > +SC_TRACE_EVENT(sys_timerfd_gettime, > + TP_PROTO(int ufd, struct itimerspec * otmr), > + TP_ARGS(ufd, otmr), > + TP_STRUCT__entry(__field(int, ufd) __field_hex(struct itimerspec *, otmr)), > + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(otmr, otmr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_pipe2 > +SC_TRACE_EVENT(sys_pipe2, > + TP_PROTO(int * fildes, int flags), > + TP_ARGS(fildes, flags), > + TP_STRUCT__entry(__field_hex(int *, fildes) __field(int, flags)), > + TP_fast_assign(tp_assign(fildes, fildes) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_clock_adjtime > +SC_TRACE_EVENT(sys_clock_adjtime, > + TP_PROTO(const clockid_t which_clock, struct timex * utx), > + TP_ARGS(which_clock, utx), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timex *, utx)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(utx, utx)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_read > +SC_TRACE_EVENT(sys_read, > + TP_PROTO(unsigned int fd, char * buf, size_t count), > + TP_ARGS(fd, buf, count), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(char *, buf) __field(size_t, count)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_write > +SC_TRACE_EVENT(sys_write, > + TP_PROTO(unsigned int fd, const char * buf, size_t count), > + TP_ARGS(fd, buf, count), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_open > +SC_TRACE_EVENT(sys_open, > + TP_PROTO(const char * filename, int flags, umode_t mode), > + TP_ARGS(filename, flags, mode), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(int, flags) __field(umode_t, mode)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(flags, flags) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mknod > +SC_TRACE_EVENT(sys_mknod, > + TP_PROTO(const char * filename, umode_t mode, unsigned dev), > + TP_ARGS(filename, mode, dev), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(umode_t, mode) __field(unsigned, dev)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(mode, mode) tp_assign(dev, dev)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lchown16 > +SC_TRACE_EVENT(sys_lchown16, > + TP_PROTO(const char * filename, old_uid_t user, old_gid_t group), > + TP_ARGS(filename, user, group), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(old_uid_t, user) __field(old_gid_t, group)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_readlink > +SC_TRACE_EVENT(sys_readlink, > + TP_PROTO(const char * path, char * buf, int bufsiz), > + TP_ARGS(path, buf, bufsiz), > + TP_STRUCT__entry(__string_from_user(path, path) __field_hex(char *, buf) __field(int, bufsiz)), > + TP_fast_assign(tp_copy_string_from_user(path, path) tp_assign(buf, buf) tp_assign(bufsiz, bufsiz)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_syslog > +SC_TRACE_EVENT(sys_syslog, > + TP_PROTO(int type, char * buf, int len), > + TP_ARGS(type, buf, len), > + TP_STRUCT__entry(__field(int, type) __field_hex(char *, buf) __field(int, len)), > + TP_fast_assign(tp_assign(type, type) tp_assign(buf, buf) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setitimer > +SC_TRACE_EVENT(sys_setitimer, > + TP_PROTO(int which, struct itimerval * value, struct itimerval * ovalue), > + TP_ARGS(which, value, ovalue), > + TP_STRUCT__entry(__field(int, which) __field_hex(struct itimerval *, value) __field_hex(struct itimerval *, ovalue)), > + TP_fast_assign(tp_assign(which, which) tp_assign(value, value) tp_assign(ovalue, ovalue)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sigprocmask > +SC_TRACE_EVENT(sys_sigprocmask, > + TP_PROTO(int how, old_sigset_t * nset, old_sigset_t * oset), > + TP_ARGS(how, nset, oset), > + TP_STRUCT__entry(__field(int, how) __field_hex(old_sigset_t *, nset) __field_hex(old_sigset_t *, oset)), > + TP_fast_assign(tp_assign(how, how) tp_assign(nset, nset) tp_assign(oset, oset)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_init_module > +SC_TRACE_EVENT(sys_init_module, > + TP_PROTO(void * umod, unsigned long len, const char * uargs), > + TP_ARGS(umod, len, uargs), > + TP_STRUCT__entry(__field_hex(void *, umod) __field(unsigned long, len) __field_hex(const char *, uargs)), > + TP_fast_assign(tp_assign(umod, umod) tp_assign(len, len) tp_assign(uargs, uargs)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getdents > +SC_TRACE_EVENT(sys_getdents, > + TP_PROTO(unsigned int fd, struct linux_dirent * dirent, unsigned int count), > + TP_ARGS(fd, dirent, count), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct linux_dirent *, dirent) __field(unsigned int, count)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(dirent, dirent) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_readv > +SC_TRACE_EVENT(sys_readv, > + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen), > + TP_ARGS(fd, vec, vlen), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_writev > +SC_TRACE_EVENT(sys_writev, > + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen), > + TP_ARGS(fd, vec, vlen), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_setscheduler > +SC_TRACE_EVENT(sys_sched_setscheduler, > + TP_PROTO(pid_t pid, int policy, struct sched_param * param), > + TP_ARGS(pid, policy, param), > + TP_STRUCT__entry(__field(pid_t, pid) __field(int, policy) __field_hex(struct sched_param *, param)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(policy, policy) tp_assign(param, param)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getresuid16 > +SC_TRACE_EVENT(sys_getresuid16, > + TP_PROTO(old_uid_t * ruid, old_uid_t * euid, old_uid_t * suid), > + TP_ARGS(ruid, euid, suid), > + TP_STRUCT__entry(__field_hex(old_uid_t *, ruid) __field_hex(old_uid_t *, euid) __field_hex(old_uid_t *, suid)), > + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_poll > +SC_TRACE_EVENT(sys_poll, > + TP_PROTO(struct pollfd * ufds, unsigned int nfds, int timeout_msecs), > + TP_ARGS(ufds, nfds, timeout_msecs), > + TP_STRUCT__entry(__field_hex(struct pollfd *, ufds) __field(unsigned int, nfds) __field(int, timeout_msecs)), > + TP_fast_assign(tp_assign(ufds, ufds) tp_assign(nfds, nfds) tp_assign(timeout_msecs, timeout_msecs)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getresgid16 > +SC_TRACE_EVENT(sys_getresgid16, > + TP_PROTO(old_gid_t * rgid, old_gid_t * egid, old_gid_t * sgid), > + TP_ARGS(rgid, egid, sgid), > + TP_STRUCT__entry(__field_hex(old_gid_t *, rgid) __field_hex(old_gid_t *, egid) __field_hex(old_gid_t *, sgid)), > + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_sigqueueinfo > +SC_TRACE_EVENT(sys_rt_sigqueueinfo, > + TP_PROTO(pid_t pid, int sig, siginfo_t * uinfo), > + TP_ARGS(pid, sig, uinfo), > + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig) __field_hex(siginfo_t *, uinfo)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig) tp_assign(uinfo, uinfo)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_chown16 > +SC_TRACE_EVENT(sys_chown16, > + TP_PROTO(const char * filename, old_uid_t user, old_gid_t group), > + TP_ARGS(filename, user, group), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(old_uid_t, user) __field(old_gid_t, group)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lchown > +SC_TRACE_EVENT(sys_lchown, > + TP_PROTO(const char * filename, uid_t user, gid_t group), > + TP_ARGS(filename, user, group), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getresuid > +SC_TRACE_EVENT(sys_getresuid, > + TP_PROTO(uid_t * ruid, uid_t * euid, uid_t * suid), > + TP_ARGS(ruid, euid, suid), > + TP_STRUCT__entry(__field_hex(uid_t *, ruid) __field_hex(uid_t *, euid) __field_hex(uid_t *, suid)), > + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getresgid > +SC_TRACE_EVENT(sys_getresgid, > + TP_PROTO(gid_t * rgid, gid_t * egid, gid_t * sgid), > + TP_ARGS(rgid, egid, sgid), > + TP_STRUCT__entry(__field_hex(gid_t *, rgid) __field_hex(gid_t *, egid) __field_hex(gid_t *, sgid)), > + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_chown > +SC_TRACE_EVENT(sys_chown, > + TP_PROTO(const char * filename, uid_t user, gid_t group), > + TP_ARGS(filename, user, group), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getdents64 > +SC_TRACE_EVENT(sys_getdents64, > + TP_PROTO(unsigned int fd, struct linux_dirent64 * dirent, unsigned int count), > + TP_ARGS(fd, dirent, count), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct linux_dirent64 *, dirent) __field(unsigned int, count)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(dirent, dirent) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mincore > +SC_TRACE_EVENT(sys_mincore, > + TP_PROTO(unsigned long start, size_t len, unsigned char * vec), > + TP_ARGS(start, len, vec), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field_hex(unsigned char *, vec)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(vec, vec)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_listxattr > +SC_TRACE_EVENT(sys_listxattr, > + TP_PROTO(const char * pathname, char * list, size_t size), > + TP_ARGS(pathname, list, size), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(char *, list) __field(size_t, size)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(list, list) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_llistxattr > +SC_TRACE_EVENT(sys_llistxattr, > + TP_PROTO(const char * pathname, char * list, size_t size), > + TP_ARGS(pathname, list, size), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(char *, list) __field(size_t, size)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(list, list) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_flistxattr > +SC_TRACE_EVENT(sys_flistxattr, > + TP_PROTO(int fd, char * list, size_t size), > + TP_ARGS(fd, list, size), > + TP_STRUCT__entry(__field(int, fd) __field_hex(char *, list) __field(size_t, size)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(list, list) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_setaffinity > +SC_TRACE_EVENT(sys_sched_setaffinity, > + TP_PROTO(pid_t pid, unsigned int len, unsigned long * user_mask_ptr), > + TP_ARGS(pid, len, user_mask_ptr), > + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, len) __field_hex(unsigned long *, user_mask_ptr)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(len, len) tp_assign(user_mask_ptr, user_mask_ptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_getaffinity > +SC_TRACE_EVENT(sys_sched_getaffinity, > + TP_PROTO(pid_t pid, unsigned int len, unsigned long * user_mask_ptr), > + TP_ARGS(pid, len, user_mask_ptr), > + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, len) __field_hex(unsigned long *, user_mask_ptr)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(len, len) tp_assign(user_mask_ptr, user_mask_ptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_io_submit > +SC_TRACE_EVENT(sys_io_submit, > + TP_PROTO(aio_context_t ctx_id, long nr, struct iocb * * iocbpp), > + TP_ARGS(ctx_id, nr, iocbpp), > + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field(long, nr) __field_hex(struct iocb * *, iocbpp)), > + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(nr, nr) tp_assign(iocbpp, iocbpp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_io_cancel > +SC_TRACE_EVENT(sys_io_cancel, > + TP_PROTO(aio_context_t ctx_id, struct iocb * iocb, struct io_event * result), > + TP_ARGS(ctx_id, iocb, result), > + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field_hex(struct iocb *, iocb) __field_hex(struct io_event *, result)), > + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(iocb, iocb) tp_assign(result, result)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timer_create > +SC_TRACE_EVENT(sys_timer_create, > + TP_PROTO(const clockid_t which_clock, struct sigevent * timer_event_spec, timer_t * created_timer_id), > + TP_ARGS(which_clock, timer_event_spec, created_timer_id), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct sigevent *, timer_event_spec) __field_hex(timer_t *, created_timer_id)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(timer_event_spec, timer_event_spec) tp_assign(created_timer_id, created_timer_id)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mq_getsetattr > +SC_TRACE_EVENT(sys_mq_getsetattr, > + TP_PROTO(mqd_t mqdes, const struct mq_attr * u_mqstat, struct mq_attr * u_omqstat), > + TP_ARGS(mqdes, u_mqstat, u_omqstat), > + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const struct mq_attr *, u_mqstat) __field_hex(struct mq_attr *, u_omqstat)), > + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_mqstat, u_mqstat) tp_assign(u_omqstat, u_omqstat)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_bind > +SC_TRACE_EVENT(sys_bind, > + TP_PROTO(int fd, struct sockaddr * umyaddr, int addrlen), > + TP_ARGS(fd, umyaddr, addrlen), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, umyaddr) __field_hex(int, addrlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(umyaddr, umyaddr) tp_assign(addrlen, addrlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_connect > +SC_TRACE_EVENT(sys_connect, > + TP_PROTO(int fd, struct sockaddr * uservaddr, int addrlen), > + TP_ARGS(fd, uservaddr, addrlen), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, uservaddr) __field_hex(int, addrlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(uservaddr, uservaddr) tp_assign(addrlen, addrlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_accept > +SC_TRACE_EVENT(sys_accept, > + TP_PROTO(int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen), > + TP_ARGS(fd, upeer_sockaddr, upeer_addrlen), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, upeer_sockaddr) __field_hex(int *, upeer_addrlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(upeer_sockaddr, upeer_sockaddr) tp_assign(upeer_addrlen, upeer_addrlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getsockname > +SC_TRACE_EVENT(sys_getsockname, > + TP_PROTO(int fd, struct sockaddr * usockaddr, int * usockaddr_len), > + TP_ARGS(fd, usockaddr, usockaddr_len), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, usockaddr) __field_hex(int *, usockaddr_len)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(usockaddr, usockaddr) tp_assign(usockaddr_len, usockaddr_len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getpeername > +SC_TRACE_EVENT(sys_getpeername, > + TP_PROTO(int fd, struct sockaddr * usockaddr, int * usockaddr_len), > + TP_ARGS(fd, usockaddr, usockaddr_len), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, usockaddr) __field_hex(int *, usockaddr_len)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(usockaddr, usockaddr) tp_assign(usockaddr_len, usockaddr_len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sendmsg > +SC_TRACE_EVENT(sys_sendmsg, > + TP_PROTO(int fd, struct msghdr * msg, unsigned flags), > + TP_ARGS(fd, msg, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct msghdr *, msg) __field(unsigned, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(msg, msg) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_recvmsg > +SC_TRACE_EVENT(sys_recvmsg, > + TP_PROTO(int fd, struct msghdr * msg, unsigned int flags), > + TP_ARGS(fd, msg, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct msghdr *, msg) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(msg, msg) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_semop > +SC_TRACE_EVENT(sys_semop, > + TP_PROTO(int semid, struct sembuf * tsops, unsigned nsops), > + TP_ARGS(semid, tsops, nsops), > + TP_STRUCT__entry(__field(int, semid) __field_hex(struct sembuf *, tsops) __field(unsigned, nsops)), > + TP_fast_assign(tp_assign(semid, semid) tp_assign(tsops, tsops) tp_assign(nsops, nsops)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_msgctl > +SC_TRACE_EVENT(sys_msgctl, > + TP_PROTO(int msqid, int cmd, struct msqid_ds * buf), > + TP_ARGS(msqid, cmd, buf), > + TP_STRUCT__entry(__field(int, msqid) __field(int, cmd) __field_hex(struct msqid_ds *, buf)), > + TP_fast_assign(tp_assign(msqid, msqid) tp_assign(cmd, cmd) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_shmat > +SC_TRACE_EVENT(sys_shmat, > + TP_PROTO(int shmid, char * shmaddr, int shmflg), > + TP_ARGS(shmid, shmaddr, shmflg), > + TP_STRUCT__entry(__field(int, shmid) __field_hex(char *, shmaddr) __field(int, shmflg)), > + TP_fast_assign(tp_assign(shmid, shmid) tp_assign(shmaddr, shmaddr) tp_assign(shmflg, shmflg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_shmctl > +SC_TRACE_EVENT(sys_shmctl, > + TP_PROTO(int shmid, int cmd, struct shmid_ds * buf), > + TP_ARGS(shmid, cmd, buf), > + TP_STRUCT__entry(__field(int, shmid) __field(int, cmd) __field_hex(struct shmid_ds *, buf)), > + TP_fast_assign(tp_assign(shmid, shmid) tp_assign(cmd, cmd) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_inotify_add_watch > +SC_TRACE_EVENT(sys_inotify_add_watch, > + TP_PROTO(int fd, const char * pathname, u32 mask), > + TP_ARGS(fd, pathname, mask), > + TP_STRUCT__entry(__field(int, fd) __string_from_user(pathname, pathname) __field(u32, mask)), > + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(pathname, pathname) tp_assign(mask, mask)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mkdirat > +SC_TRACE_EVENT(sys_mkdirat, > + TP_PROTO(int dfd, const char * pathname, umode_t mode), > + TP_ARGS(dfd, pathname, mode), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field(umode_t, mode)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_futimesat > +SC_TRACE_EVENT(sys_futimesat, > + TP_PROTO(int dfd, const char * filename, struct timeval * utimes), > + TP_ARGS(dfd, filename, utimes), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct timeval *, utimes)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_unlinkat > +SC_TRACE_EVENT(sys_unlinkat, > + TP_PROTO(int dfd, const char * pathname, int flag), > + TP_ARGS(dfd, pathname, flag), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field(int, flag)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(flag, flag)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_symlinkat > +SC_TRACE_EVENT(sys_symlinkat, > + TP_PROTO(const char * oldname, int newdfd, const char * newname), > + TP_ARGS(oldname, newdfd, newname), > + TP_STRUCT__entry(__string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname)), > + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fchmodat > +SC_TRACE_EVENT(sys_fchmodat, > + TP_PROTO(int dfd, const char * filename, umode_t mode), > + TP_ARGS(dfd, filename, mode), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(umode_t, mode)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_faccessat > +SC_TRACE_EVENT(sys_faccessat, > + TP_PROTO(int dfd, const char * filename, int mode), > + TP_ARGS(dfd, filename, mode), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, mode)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_get_robust_list > +SC_TRACE_EVENT(sys_get_robust_list, > + TP_PROTO(int pid, struct robust_list_head * * head_ptr, size_t * len_ptr), > + TP_ARGS(pid, head_ptr, len_ptr), > + TP_STRUCT__entry(__field(int, pid) __field_hex(struct robust_list_head * *, head_ptr) __field_hex(size_t *, len_ptr)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(head_ptr, head_ptr) tp_assign(len_ptr, len_ptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getcpu > +SC_TRACE_EVENT(sys_getcpu, > + TP_PROTO(unsigned * cpup, unsigned * nodep, struct getcpu_cache * unused), > + TP_ARGS(cpup, nodep, unused), > + TP_STRUCT__entry(__field_hex(unsigned *, cpup) __field_hex(unsigned *, nodep) __field_hex(struct getcpu_cache *, unused)), > + TP_fast_assign(tp_assign(cpup, cpup) tp_assign(nodep, nodep) tp_assign(unused, unused)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_signalfd > +SC_TRACE_EVENT(sys_signalfd, > + TP_PROTO(int ufd, sigset_t * user_mask, size_t sizemask), > + TP_ARGS(ufd, user_mask, sizemask), > + TP_STRUCT__entry(__field(int, ufd) __field_hex(sigset_t *, user_mask) __field(size_t, sizemask)), > + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(user_mask, user_mask) tp_assign(sizemask, sizemask)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_open_by_handle_at > +SC_TRACE_EVENT(sys_open_by_handle_at, > + TP_PROTO(int mountdirfd, struct file_handle * handle, int flags), > + TP_ARGS(mountdirfd, handle, flags), > + TP_STRUCT__entry(__field(int, mountdirfd) __field_hex(struct file_handle *, handle) __field(int, flags)), > + TP_fast_assign(tp_assign(mountdirfd, mountdirfd) tp_assign(handle, handle) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_reboot > +SC_TRACE_EVENT(sys_reboot, > + TP_PROTO(int magic1, int magic2, unsigned int cmd, void * arg), > + TP_ARGS(magic1, magic2, cmd, arg), > + TP_STRUCT__entry(__field(int, magic1) __field(int, magic2) __field(unsigned int, cmd) __field_hex(void *, arg)), > + TP_fast_assign(tp_assign(magic1, magic1) tp_assign(magic2, magic2) tp_assign(cmd, cmd) tp_assign(arg, arg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_wait4 > +SC_TRACE_EVENT(sys_wait4, > + TP_PROTO(pid_t upid, int * stat_addr, int options, struct rusage * ru), > + TP_ARGS(upid, stat_addr, options, ru), > + TP_STRUCT__entry(__field(pid_t, upid) __field_hex(int *, stat_addr) __field(int, options) __field_hex(struct rusage *, ru)), > + TP_fast_assign(tp_assign(upid, upid) tp_assign(stat_addr, stat_addr) tp_assign(options, options) tp_assign(ru, ru)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_quotactl > +SC_TRACE_EVENT(sys_quotactl, > + TP_PROTO(unsigned int cmd, const char * special, qid_t id, void * addr), > + TP_ARGS(cmd, special, id, addr), > + TP_STRUCT__entry(__field(unsigned int, cmd) __field_hex(const char *, special) __field(qid_t, id) __field_hex(void *, addr)), > + TP_fast_assign(tp_assign(cmd, cmd) tp_assign(special, special) tp_assign(id, id) tp_assign(addr, addr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_sigaction > +SC_TRACE_EVENT(sys_rt_sigaction, > + TP_PROTO(int sig, const struct sigaction * act, struct sigaction * oact, size_t sigsetsize), > + TP_ARGS(sig, act, oact, sigsetsize), > + TP_STRUCT__entry(__field(int, sig) __field_hex(const struct sigaction *, act) __field_hex(struct sigaction *, oact) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(sig, sig) tp_assign(act, act) tp_assign(oact, oact) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_sigprocmask > +SC_TRACE_EVENT(sys_rt_sigprocmask, > + TP_PROTO(int how, sigset_t * nset, sigset_t * oset, size_t sigsetsize), > + TP_ARGS(how, nset, oset, sigsetsize), > + TP_STRUCT__entry(__field(int, how) __field_hex(sigset_t *, nset) __field_hex(sigset_t *, oset) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(how, how) tp_assign(nset, nset) tp_assign(oset, oset) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_sigtimedwait > +SC_TRACE_EVENT(sys_rt_sigtimedwait, > + TP_PROTO(const sigset_t * uthese, siginfo_t * uinfo, const struct timespec * uts, size_t sigsetsize), > + TP_ARGS(uthese, uinfo, uts, sigsetsize), > + TP_STRUCT__entry(__field_hex(const sigset_t *, uthese) __field_hex(siginfo_t *, uinfo) __field_hex(const struct timespec *, uts) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(uthese, uthese) tp_assign(uinfo, uinfo) tp_assign(uts, uts) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sendfile > +SC_TRACE_EVENT(sys_sendfile, > + TP_PROTO(int out_fd, int in_fd, off_t * offset, size_t count), > + TP_ARGS(out_fd, in_fd, offset, count), > + TP_STRUCT__entry(__field(int, out_fd) __field(int, in_fd) __field_hex(off_t *, offset) __field(size_t, count)), > + TP_fast_assign(tp_assign(out_fd, out_fd) tp_assign(in_fd, in_fd) tp_assign(offset, offset) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getxattr > +SC_TRACE_EVENT(sys_getxattr, > + TP_PROTO(const char * pathname, const char * name, void * value, size_t size), > + TP_ARGS(pathname, name, value, size), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lgetxattr > +SC_TRACE_EVENT(sys_lgetxattr, > + TP_PROTO(const char * pathname, const char * name, void * value, size_t size), > + TP_ARGS(pathname, name, value, size), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fgetxattr > +SC_TRACE_EVENT(sys_fgetxattr, > + TP_PROTO(int fd, const char * name, void * value, size_t size), > + TP_ARGS(fd, name, value, size), > + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), > + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sendfile64 > +SC_TRACE_EVENT(sys_sendfile64, > + TP_PROTO(int out_fd, int in_fd, loff_t * offset, size_t count), > + TP_ARGS(out_fd, in_fd, offset, count), > + TP_STRUCT__entry(__field(int, out_fd) __field(int, in_fd) __field_hex(loff_t *, offset) __field(size_t, count)), > + TP_fast_assign(tp_assign(out_fd, out_fd) tp_assign(in_fd, in_fd) tp_assign(offset, offset) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_epoll_ctl > +SC_TRACE_EVENT(sys_epoll_ctl, > + TP_PROTO(int epfd, int op, int fd, struct epoll_event * event), > + TP_ARGS(epfd, op, fd, event), > + TP_STRUCT__entry(__field(int, epfd) __field(int, op) __field(int, fd) __field_hex(struct epoll_event *, event)), > + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(op, op) tp_assign(fd, fd) tp_assign(event, event)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_epoll_wait > +SC_TRACE_EVENT(sys_epoll_wait, > + TP_PROTO(int epfd, struct epoll_event * events, int maxevents, int timeout), > + TP_ARGS(epfd, events, maxevents, timeout), > + TP_STRUCT__entry(__field(int, epfd) __field_hex(struct epoll_event *, events) __field(int, maxevents) __field(int, timeout)), > + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(events, events) tp_assign(maxevents, maxevents) tp_assign(timeout, timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timer_settime > +SC_TRACE_EVENT(sys_timer_settime, > + TP_PROTO(timer_t timer_id, int flags, const struct itimerspec * new_setting, struct itimerspec * old_setting), > + TP_ARGS(timer_id, flags, new_setting, old_setting), > + TP_STRUCT__entry(__field(timer_t, timer_id) __field(int, flags) __field_hex(const struct itimerspec *, new_setting) __field_hex(struct itimerspec *, old_setting)), > + TP_fast_assign(tp_assign(timer_id, timer_id) tp_assign(flags, flags) tp_assign(new_setting, new_setting) tp_assign(old_setting, old_setting)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_clock_nanosleep > +SC_TRACE_EVENT(sys_clock_nanosleep, > + TP_PROTO(const clockid_t which_clock, int flags, const struct timespec * rqtp, struct timespec * rmtp), > + TP_ARGS(which_clock, flags, rqtp, rmtp), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field(int, flags) __field_hex(const struct timespec *, rqtp) __field_hex(struct timespec *, rmtp)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(flags, flags) tp_assign(rqtp, rqtp) tp_assign(rmtp, rmtp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mq_open > +SC_TRACE_EVENT(sys_mq_open, > + TP_PROTO(const char * u_name, int oflag, umode_t mode, struct mq_attr * u_attr), > + TP_ARGS(u_name, oflag, mode, u_attr), > + TP_STRUCT__entry(__string_from_user(u_name, u_name) __field(int, oflag) __field(umode_t, mode) __field_hex(struct mq_attr *, u_attr)), > + TP_fast_assign(tp_copy_string_from_user(u_name, u_name) tp_assign(oflag, oflag) tp_assign(mode, mode) tp_assign(u_attr, u_attr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_socketpair > +SC_TRACE_EVENT(sys_socketpair, > + TP_PROTO(int family, int type, int protocol, int * usockvec), > + TP_ARGS(family, type, protocol, usockvec), > + TP_STRUCT__entry(__field(int, family) __field(int, type) __field(int, protocol) __field_hex(int *, usockvec)), > + TP_fast_assign(tp_assign(family, family) tp_assign(type, type) tp_assign(protocol, protocol) tp_assign(usockvec, usockvec)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_send > +SC_TRACE_EVENT(sys_send, > + TP_PROTO(int fd, void * buff, size_t len, unsigned flags), > + TP_ARGS(fd, buff, len, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, buff) __field(size_t, len) __field(unsigned, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buff, buff) tp_assign(len, len) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_msgsnd > +SC_TRACE_EVENT(sys_msgsnd, > + TP_PROTO(int msqid, struct msgbuf * msgp, size_t msgsz, int msgflg), > + TP_ARGS(msqid, msgp, msgsz, msgflg), > + TP_STRUCT__entry(__field(int, msqid) __field_hex(struct msgbuf *, msgp) __field(size_t, msgsz) __field(int, msgflg)), > + TP_fast_assign(tp_assign(msqid, msqid) tp_assign(msgp, msgp) tp_assign(msgsz, msgsz) tp_assign(msgflg, msgflg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_request_key > +SC_TRACE_EVENT(sys_request_key, > + TP_PROTO(const char * _type, const char * _description, const char * _callout_info, key_serial_t destringid), > + TP_ARGS(_type, _description, _callout_info, destringid), > + TP_STRUCT__entry(__string_from_user(_type, _type) __field_hex(const char *, _description) __field_hex(const char *, _callout_info) __field(key_serial_t, destringid)), > + TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_callout_info, _callout_info) tp_assign(destringid, destringid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_semtimedop > +SC_TRACE_EVENT(sys_semtimedop, > + TP_PROTO(int semid, struct sembuf * tsops, unsigned nsops, const struct timespec * timeout), > + TP_ARGS(semid, tsops, nsops, timeout), > + TP_STRUCT__entry(__field(int, semid) __field_hex(struct sembuf *, tsops) __field(unsigned, nsops) __field_hex(const struct timespec *, timeout)), > + TP_fast_assign(tp_assign(semid, semid) tp_assign(tsops, tsops) tp_assign(nsops, nsops) tp_assign(timeout, timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_openat > +SC_TRACE_EVENT(sys_openat, > + TP_PROTO(int dfd, const char * filename, int flags, umode_t mode), > + TP_ARGS(dfd, filename, flags, mode), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, flags) __field(umode_t, mode)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(flags, flags) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mknodat > +SC_TRACE_EVENT(sys_mknodat, > + TP_PROTO(int dfd, const char * filename, umode_t mode, unsigned dev), > + TP_ARGS(dfd, filename, mode, dev), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(umode_t, mode) __field(unsigned, dev)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode) tp_assign(dev, dev)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fstatat64 > +SC_TRACE_EVENT(sys_fstatat64, > + TP_PROTO(int dfd, const char * filename, struct stat64 * statbuf, int flag), > + TP_ARGS(dfd, filename, statbuf, flag), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct stat64 *, statbuf) __field(int, flag)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf) tp_assign(flag, flag)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_renameat > +SC_TRACE_EVENT(sys_renameat, > + TP_PROTO(int olddfd, const char * oldname, int newdfd, const char * newname), > + TP_ARGS(olddfd, oldname, newdfd, newname), > + TP_STRUCT__entry(__field(int, olddfd) __string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname)), > + TP_fast_assign(tp_assign(olddfd, olddfd) tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_readlinkat > +SC_TRACE_EVENT(sys_readlinkat, > + TP_PROTO(int dfd, const char * pathname, char * buf, int bufsiz), > + TP_ARGS(dfd, pathname, buf, bufsiz), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field_hex(char *, buf) __field(int, bufsiz)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(buf, buf) tp_assign(bufsiz, bufsiz)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_vmsplice > +SC_TRACE_EVENT(sys_vmsplice, > + TP_PROTO(int fd, const struct iovec * iov, unsigned long nr_segs, unsigned int flags), > + TP_ARGS(fd, iov, nr_segs, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(const struct iovec *, iov) __field(unsigned long, nr_segs) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(iov, iov) tp_assign(nr_segs, nr_segs) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_utimensat > +SC_TRACE_EVENT(sys_utimensat, > + TP_PROTO(int dfd, const char * filename, struct timespec * utimes, int flags), > + TP_ARGS(dfd, filename, utimes, flags), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct timespec *, utimes) __field(int, flags)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timerfd_settime > +SC_TRACE_EVENT(sys_timerfd_settime, > + TP_PROTO(int ufd, int flags, const struct itimerspec * utmr, struct itimerspec * otmr), > + TP_ARGS(ufd, flags, utmr, otmr), > + TP_STRUCT__entry(__field(int, ufd) __field(int, flags) __field_hex(const struct itimerspec *, utmr) __field_hex(struct itimerspec *, otmr)), > + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(flags, flags) tp_assign(utmr, utmr) tp_assign(otmr, otmr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_signalfd4 > +SC_TRACE_EVENT(sys_signalfd4, > + TP_PROTO(int ufd, sigset_t * user_mask, size_t sizemask, int flags), > + TP_ARGS(ufd, user_mask, sizemask, flags), > + TP_STRUCT__entry(__field(int, ufd) __field_hex(sigset_t *, user_mask) __field(size_t, sizemask) __field(int, flags)), > + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(user_mask, user_mask) tp_assign(sizemask, sizemask) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_tgsigqueueinfo > +SC_TRACE_EVENT(sys_rt_tgsigqueueinfo, > + TP_PROTO(pid_t tgid, pid_t pid, int sig, siginfo_t * uinfo), > + TP_ARGS(tgid, pid, sig, uinfo), > + TP_STRUCT__entry(__field(pid_t, tgid) __field(pid_t, pid) __field(int, sig) __field_hex(siginfo_t *, uinfo)), > + TP_fast_assign(tp_assign(tgid, tgid) tp_assign(pid, pid) tp_assign(sig, sig) tp_assign(uinfo, uinfo)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_accept4 > +SC_TRACE_EVENT(sys_accept4, > + TP_PROTO(int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen, int flags), > + TP_ARGS(fd, upeer_sockaddr, upeer_addrlen, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, upeer_sockaddr) __field_hex(int *, upeer_addrlen) __field(int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(upeer_sockaddr, upeer_sockaddr) tp_assign(upeer_addrlen, upeer_addrlen) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_prlimit64 > +SC_TRACE_EVENT(sys_prlimit64, > + TP_PROTO(pid_t pid, unsigned int resource, const struct rlimit64 * new_rlim, struct rlimit64 * old_rlim), > + TP_ARGS(pid, resource, new_rlim, old_rlim), > + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, resource) __field_hex(const struct rlimit64 *, new_rlim) __field_hex(struct rlimit64 *, old_rlim)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(resource, resource) tp_assign(new_rlim, new_rlim) tp_assign(old_rlim, old_rlim)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sendmmsg > +SC_TRACE_EVENT(sys_sendmmsg, > + TP_PROTO(int fd, struct mmsghdr * mmsg, unsigned int vlen, unsigned int flags), > + TP_ARGS(fd, mmsg, vlen, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct mmsghdr *, mmsg) __field(unsigned int, vlen) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(mmsg, mmsg) tp_assign(vlen, vlen) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mount > +SC_TRACE_EVENT(sys_mount, > + TP_PROTO(char * dev_name, char * dir_name, char * type, unsigned long flags, void * data), > + TP_ARGS(dev_name, dir_name, type, flags, data), > + TP_STRUCT__entry(__string_from_user(dev_name, dev_name) __string_from_user(dir_name, dir_name) __string_from_user(type, type) __field(unsigned long, flags) __field_hex(void *, data)), > + TP_fast_assign(tp_copy_string_from_user(dev_name, dev_name) tp_copy_string_from_user(dir_name, dir_name) tp_copy_string_from_user(type, type) tp_assign(flags, flags) tp_assign(data, data)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_llseek > +SC_TRACE_EVENT(sys_llseek, > + TP_PROTO(unsigned int fd, unsigned long offset_high, unsigned long offset_low, loff_t * result, unsigned int origin), > + TP_ARGS(fd, offset_high, offset_low, result, origin), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned long, offset_high) __field(unsigned long, offset_low) __field_hex(loff_t *, result) __field(unsigned int, origin)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(offset_high, offset_high) tp_assign(offset_low, offset_low) tp_assign(result, result) tp_assign(origin, origin)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_select > +SC_TRACE_EVENT(sys_select, > + TP_PROTO(int n, fd_set * inp, fd_set * outp, fd_set * exp, struct timeval * tvp), > + TP_ARGS(n, inp, outp, exp, tvp), > + TP_STRUCT__entry(__field(int, n) __field_hex(fd_set *, inp) __field_hex(fd_set *, outp) __field_hex(fd_set *, exp) __field_hex(struct timeval *, tvp)), > + TP_fast_assign(tp_assign(n, n) tp_assign(inp, inp) tp_assign(outp, outp) tp_assign(exp, exp) tp_assign(tvp, tvp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setxattr > +SC_TRACE_EVENT(sys_setxattr, > + TP_PROTO(const char * pathname, const char * name, const void * value, size_t size, int flags), > + TP_ARGS(pathname, name, value, size, flags), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lsetxattr > +SC_TRACE_EVENT(sys_lsetxattr, > + TP_PROTO(const char * pathname, const char * name, const void * value, size_t size, int flags), > + TP_ARGS(pathname, name, value, size, flags), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fsetxattr > +SC_TRACE_EVENT(sys_fsetxattr, > + TP_PROTO(int fd, const char * name, const void * value, size_t size, int flags), > + TP_ARGS(fd, name, value, size, flags), > + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_io_getevents > +SC_TRACE_EVENT(sys_io_getevents, > + TP_PROTO(aio_context_t ctx_id, long min_nr, long nr, struct io_event * events, struct timespec * timeout), > + TP_ARGS(ctx_id, min_nr, nr, events, timeout), > + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field(long, min_nr) __field(long, nr) __field_hex(struct io_event *, events) __field_hex(struct timespec *, timeout)), > + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(min_nr, min_nr) tp_assign(nr, nr) tp_assign(events, events) tp_assign(timeout, timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mq_timedsend > +SC_TRACE_EVENT(sys_mq_timedsend, > + TP_PROTO(mqd_t mqdes, const char * u_msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec * u_abs_timeout), > + TP_ARGS(mqdes, u_msg_ptr, msg_len, msg_prio, u_abs_timeout), > + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const char *, u_msg_ptr) __field(size_t, msg_len) __field(unsigned int, msg_prio) __field_hex(const struct timespec *, u_abs_timeout)), > + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_msg_ptr, u_msg_ptr) tp_assign(msg_len, msg_len) tp_assign(msg_prio, msg_prio) tp_assign(u_abs_timeout, u_abs_timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mq_timedreceive > +SC_TRACE_EVENT(sys_mq_timedreceive, > + TP_PROTO(mqd_t mqdes, char * u_msg_ptr, size_t msg_len, unsigned int * u_msg_prio, const struct timespec * u_abs_timeout), > + TP_ARGS(mqdes, u_msg_ptr, msg_len, u_msg_prio, u_abs_timeout), > + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(char *, u_msg_ptr) __field(size_t, msg_len) __field_hex(unsigned int *, u_msg_prio) __field_hex(const struct timespec *, u_abs_timeout)), > + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_msg_ptr, u_msg_ptr) tp_assign(msg_len, msg_len) tp_assign(u_msg_prio, u_msg_prio) tp_assign(u_abs_timeout, u_abs_timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_waitid > +SC_TRACE_EVENT(sys_waitid, > + TP_PROTO(int which, pid_t upid, struct siginfo * infop, int options, struct rusage * ru), > + TP_ARGS(which, upid, infop, options, ru), > + TP_STRUCT__entry(__field(int, which) __field(pid_t, upid) __field_hex(struct siginfo *, infop) __field(int, options) __field_hex(struct rusage *, ru)), > + TP_fast_assign(tp_assign(which, which) tp_assign(upid, upid) tp_assign(infop, infop) tp_assign(options, options) tp_assign(ru, ru)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setsockopt > +SC_TRACE_EVENT(sys_setsockopt, > + TP_PROTO(int fd, int level, int optname, char * optval, int optlen), > + TP_ARGS(fd, level, optname, optval, optlen), > + TP_STRUCT__entry(__field(int, fd) __field(int, level) __field(int, optname) __field_hex(char *, optval) __field(int, optlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(level, level) tp_assign(optname, optname) tp_assign(optval, optval) tp_assign(optlen, optlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getsockopt > +SC_TRACE_EVENT(sys_getsockopt, > + TP_PROTO(int fd, int level, int optname, char * optval, int * optlen), > + TP_ARGS(fd, level, optname, optval, optlen), > + TP_STRUCT__entry(__field(int, fd) __field(int, level) __field(int, optname) __field_hex(char *, optval) __field_hex(int *, optlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(level, level) tp_assign(optname, optname) tp_assign(optval, optval) tp_assign(optlen, optlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_msgrcv > +SC_TRACE_EVENT(sys_msgrcv, > + TP_PROTO(int msqid, struct msgbuf * msgp, size_t msgsz, long msgtyp, int msgflg), > + TP_ARGS(msqid, msgp, msgsz, msgtyp, msgflg), > + TP_STRUCT__entry(__field(int, msqid) __field_hex(struct msgbuf *, msgp) __field(size_t, msgsz) __field(long, msgtyp) __field(int, msgflg)), > + TP_fast_assign(tp_assign(msqid, msqid) tp_assign(msgp, msgp) tp_assign(msgsz, msgsz) tp_assign(msgtyp, msgtyp) tp_assign(msgflg, msgflg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_add_key > +SC_TRACE_EVENT(sys_add_key, > + TP_PROTO(const char * _type, const char * _description, const void * _payload, size_t plen, key_serial_t ringid), > + TP_ARGS(_type, _description, _payload, plen, ringid), > + TP_STRUCT__entry(__string_from_user(_type, _type) __field_hex(const char *, _description) __field_hex(const void *, _payload) __field(size_t, plen) __field(key_serial_t, ringid)), > + TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_payload, _payload) tp_assign(plen, plen) tp_assign(ringid, ringid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fchownat > +SC_TRACE_EVENT(sys_fchownat, > + TP_PROTO(int dfd, const char * filename, uid_t user, gid_t group, int flag), > + TP_ARGS(dfd, filename, user, group, flag), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group) __field(int, flag)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group) tp_assign(flag, flag)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_linkat > +SC_TRACE_EVENT(sys_linkat, > + TP_PROTO(int olddfd, const char * oldname, int newdfd, const char * newname, int flags), > + TP_ARGS(olddfd, oldname, newdfd, newname, flags), > + TP_STRUCT__entry(__field(int, olddfd) __string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname) __field(int, flags)), > + TP_fast_assign(tp_assign(olddfd, olddfd) tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ppoll > +SC_TRACE_EVENT(sys_ppoll, > + TP_PROTO(struct pollfd * ufds, unsigned int nfds, struct timespec * tsp, const sigset_t * sigmask, size_t sigsetsize), > + TP_ARGS(ufds, nfds, tsp, sigmask, sigsetsize), > + TP_STRUCT__entry(__field_hex(struct pollfd *, ufds) __field(unsigned int, nfds) __field_hex(struct timespec *, tsp) __field_hex(const sigset_t *, sigmask) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(ufds, ufds) tp_assign(nfds, nfds) tp_assign(tsp, tsp) tp_assign(sigmask, sigmask) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_preadv > +SC_TRACE_EVENT(sys_preadv, > + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h), > + TP_ARGS(fd, vec, vlen, pos_l, pos_h), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen) __field(unsigned long, pos_l) __field(unsigned long, pos_h)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen) tp_assign(pos_l, pos_l) tp_assign(pos_h, pos_h)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_pwritev > +SC_TRACE_EVENT(sys_pwritev, > + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h), > + TP_ARGS(fd, vec, vlen, pos_l, pos_h), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen) __field(unsigned long, pos_l) __field(unsigned long, pos_h)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen) tp_assign(pos_l, pos_l) tp_assign(pos_h, pos_h)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_perf_event_open > +SC_TRACE_EVENT(sys_perf_event_open, > + TP_PROTO(struct perf_event_attr * attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags), > + TP_ARGS(attr_uptr, pid, cpu, group_fd, flags), > + TP_STRUCT__entry(__field_hex(struct perf_event_attr *, attr_uptr) __field(pid_t, pid) __field(int, cpu) __field(int, group_fd) __field(unsigned long, flags)), > + TP_fast_assign(tp_assign(attr_uptr, attr_uptr) tp_assign(pid, pid) tp_assign(cpu, cpu) tp_assign(group_fd, group_fd) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_recvmmsg > +SC_TRACE_EVENT(sys_recvmmsg, > + TP_PROTO(int fd, struct mmsghdr * mmsg, unsigned int vlen, unsigned int flags, struct timespec * timeout), > + TP_ARGS(fd, mmsg, vlen, flags, timeout), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct mmsghdr *, mmsg) __field(unsigned int, vlen) __field(unsigned int, flags) __field_hex(struct timespec *, timeout)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(mmsg, mmsg) tp_assign(vlen, vlen) tp_assign(flags, flags) tp_assign(timeout, timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_name_to_handle_at > +SC_TRACE_EVENT(sys_name_to_handle_at, > + TP_PROTO(int dfd, const char * name, struct file_handle * handle, int * mnt_id, int flag), > + TP_ARGS(dfd, name, handle, mnt_id, flag), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(name, name) __field_hex(struct file_handle *, handle) __field_hex(int *, mnt_id) __field(int, flag)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(name, name) tp_assign(handle, handle) tp_assign(mnt_id, mnt_id) tp_assign(flag, flag)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_futex > +SC_TRACE_EVENT(sys_futex, > + TP_PROTO(u32 * uaddr, int op, u32 val, struct timespec * utime, u32 * uaddr2, u32 val3), > + TP_ARGS(uaddr, op, val, utime, uaddr2, val3), > + TP_STRUCT__entry(__field_hex(u32 *, uaddr) __field(int, op) __field(u32, val) __field_hex(struct timespec *, utime) __field_hex(u32 *, uaddr2) __field(u32, val3)), > + TP_fast_assign(tp_assign(uaddr, uaddr) tp_assign(op, op) tp_assign(val, val) tp_assign(utime, utime) tp_assign(uaddr2, uaddr2) tp_assign(val3, val3)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sendto > +SC_TRACE_EVENT(sys_sendto, > + TP_PROTO(int fd, void * buff, size_t len, unsigned flags, struct sockaddr * addr, int addr_len), > + TP_ARGS(fd, buff, len, flags, addr, addr_len), > + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, buff) __field(size_t, len) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int, addr_len)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buff, buff) tp_assign(len, len) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_recvfrom > +SC_TRACE_EVENT(sys_recvfrom, > + TP_PROTO(int fd, void * ubuf, size_t size, unsigned flags, struct sockaddr * addr, int * addr_len), > + TP_ARGS(fd, ubuf, size, flags, addr, addr_len), > + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, ubuf) __field(size_t, size) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int *, addr_len)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(ubuf, ubuf) tp_assign(size, size) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_pselect6 > +SC_TRACE_EVENT(sys_pselect6, > + TP_PROTO(int n, fd_set * inp, fd_set * outp, fd_set * exp, struct timespec * tsp, void * sig), > + TP_ARGS(n, inp, outp, exp, tsp, sig), > + TP_STRUCT__entry(__field(int, n) __field_hex(fd_set *, inp) __field_hex(fd_set *, outp) __field_hex(fd_set *, exp) __field_hex(struct timespec *, tsp) __field_hex(void *, sig)), > + TP_fast_assign(tp_assign(n, n) tp_assign(inp, inp) tp_assign(outp, outp) tp_assign(exp, exp) tp_assign(tsp, tsp) tp_assign(sig, sig)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_splice > +SC_TRACE_EVENT(sys_splice, > + TP_PROTO(int fd_in, loff_t * off_in, int fd_out, loff_t * off_out, size_t len, unsigned int flags), > + TP_ARGS(fd_in, off_in, fd_out, off_out, len, flags), > + TP_STRUCT__entry(__field(int, fd_in) __field_hex(loff_t *, off_in) __field(int, fd_out) __field_hex(loff_t *, off_out) __field(size_t, len) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fd_in, fd_in) tp_assign(off_in, off_in) tp_assign(fd_out, fd_out) tp_assign(off_out, off_out) tp_assign(len, len) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_epoll_pwait > +SC_TRACE_EVENT(sys_epoll_pwait, > + TP_PROTO(int epfd, struct epoll_event * events, int maxevents, int timeout, const sigset_t * sigmask, size_t sigsetsize), > + TP_ARGS(epfd, events, maxevents, timeout, sigmask, sigsetsize), > + TP_STRUCT__entry(__field(int, epfd) __field_hex(struct epoll_event *, events) __field(int, maxevents) __field(int, timeout) __field_hex(const sigset_t *, sigmask) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(events, events) tp_assign(maxevents, maxevents) tp_assign(timeout, timeout) tp_assign(sigmask, sigmask) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_process_vm_readv > +SC_TRACE_EVENT(sys_process_vm_readv, > + TP_PROTO(pid_t pid, const struct iovec * lvec, unsigned long liovcnt, const struct iovec * rvec, unsigned long riovcnt, unsigned long flags), > + TP_ARGS(pid, lvec, liovcnt, rvec, riovcnt, flags), > + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(const struct iovec *, lvec) __field(unsigned long, liovcnt) __field_hex(const struct iovec *, rvec) __field(unsigned long, riovcnt) __field(unsigned long, flags)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(lvec, lvec) tp_assign(liovcnt, liovcnt) tp_assign(rvec, rvec) tp_assign(riovcnt, riovcnt) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_process_vm_writev > +SC_TRACE_EVENT(sys_process_vm_writev, > + TP_PROTO(pid_t pid, const struct iovec * lvec, unsigned long liovcnt, const struct iovec * rvec, unsigned long riovcnt, unsigned long flags), > + TP_ARGS(pid, lvec, liovcnt, rvec, riovcnt, flags), > + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(const struct iovec *, lvec) __field(unsigned long, liovcnt) __field_hex(const struct iovec *, rvec) __field(unsigned long, riovcnt) __field(unsigned long, flags)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(lvec, lvec) tp_assign(liovcnt, liovcnt) tp_assign(rvec, rvec) tp_assign(riovcnt, riovcnt) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > + > +#endif /* _TRACE_SYSCALLS_POINTERS_H */ > + > +/* This part must be outside protection */ > +#include "../../../probes/define_trace.h" > + > +#else /* CREATE_SYSCALL_TABLE */ > + > +#include "arm-32-syscalls-3.4.25_pointers_override.h" > +#include "syscalls_pointers_override.h" > + > +#ifndef OVERRIDE_TABLE_32_sys_read > +TRACE_SYSCALL_TABLE(sys_read, sys_read, 3, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_write > +TRACE_SYSCALL_TABLE(sys_write, sys_write, 4, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_open > +TRACE_SYSCALL_TABLE(sys_open, sys_open, 5, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_creat > +TRACE_SYSCALL_TABLE(sys_creat, sys_creat, 8, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_link > +TRACE_SYSCALL_TABLE(sys_link, sys_link, 9, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_unlink > +TRACE_SYSCALL_TABLE(sys_unlink, sys_unlink, 10, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_chdir > +TRACE_SYSCALL_TABLE(sys_chdir, sys_chdir, 12, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mknod > +TRACE_SYSCALL_TABLE(sys_mknod, sys_mknod, 14, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_chmod > +TRACE_SYSCALL_TABLE(sys_chmod, sys_chmod, 15, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lchown16 > +TRACE_SYSCALL_TABLE(sys_lchown16, sys_lchown16, 16, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mount > +TRACE_SYSCALL_TABLE(sys_mount, sys_mount, 21, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_access > +TRACE_SYSCALL_TABLE(sys_access, sys_access, 33, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rename > +TRACE_SYSCALL_TABLE(sys_rename, sys_rename, 38, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mkdir > +TRACE_SYSCALL_TABLE(sys_mkdir, sys_mkdir, 39, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rmdir > +TRACE_SYSCALL_TABLE(sys_rmdir, sys_rmdir, 40, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pipe > +TRACE_SYSCALL_TABLE(sys_pipe, sys_pipe, 42, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_times > +TRACE_SYSCALL_TABLE(sys_times, sys_times, 43, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_acct > +TRACE_SYSCALL_TABLE(sys_acct, sys_acct, 51, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_umount > +TRACE_SYSCALL_TABLE(sys_umount, sys_umount, 52, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_chroot > +TRACE_SYSCALL_TABLE(sys_chroot, sys_chroot, 61, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ustat > +TRACE_SYSCALL_TABLE(sys_ustat, sys_ustat, 62, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sigpending > +TRACE_SYSCALL_TABLE(sys_sigpending, sys_sigpending, 73, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sethostname > +TRACE_SYSCALL_TABLE(sys_sethostname, sys_sethostname, 74, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setrlimit > +TRACE_SYSCALL_TABLE(sys_setrlimit, sys_setrlimit, 75, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getrusage > +TRACE_SYSCALL_TABLE(sys_getrusage, sys_getrusage, 77, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_gettimeofday > +TRACE_SYSCALL_TABLE(sys_gettimeofday, sys_gettimeofday, 78, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_settimeofday > +TRACE_SYSCALL_TABLE(sys_settimeofday, sys_settimeofday, 79, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getgroups16 > +TRACE_SYSCALL_TABLE(sys_getgroups16, sys_getgroups16, 80, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setgroups16 > +TRACE_SYSCALL_TABLE(sys_setgroups16, sys_setgroups16, 81, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_symlink > +TRACE_SYSCALL_TABLE(sys_symlink, sys_symlink, 83, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_readlink > +TRACE_SYSCALL_TABLE(sys_readlink, sys_readlink, 85, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_uselib > +TRACE_SYSCALL_TABLE(sys_uselib, sys_uselib, 86, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_swapon > +TRACE_SYSCALL_TABLE(sys_swapon, sys_swapon, 87, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_reboot > +TRACE_SYSCALL_TABLE(sys_reboot, sys_reboot, 88, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_truncate > +TRACE_SYSCALL_TABLE(sys_truncate, sys_truncate, 92, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_statfs > +TRACE_SYSCALL_TABLE(sys_statfs, sys_statfs, 99, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fstatfs > +TRACE_SYSCALL_TABLE(sys_fstatfs, sys_fstatfs, 100, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_syslog > +TRACE_SYSCALL_TABLE(sys_syslog, sys_syslog, 103, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setitimer > +TRACE_SYSCALL_TABLE(sys_setitimer, sys_setitimer, 104, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getitimer > +TRACE_SYSCALL_TABLE(sys_getitimer, sys_getitimer, 105, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_newstat > +TRACE_SYSCALL_TABLE(sys_newstat, sys_newstat, 106, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_newlstat > +TRACE_SYSCALL_TABLE(sys_newlstat, sys_newlstat, 107, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_newfstat > +TRACE_SYSCALL_TABLE(sys_newfstat, sys_newfstat, 108, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_wait4 > +TRACE_SYSCALL_TABLE(sys_wait4, sys_wait4, 114, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_swapoff > +TRACE_SYSCALL_TABLE(sys_swapoff, sys_swapoff, 115, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sysinfo > +TRACE_SYSCALL_TABLE(sys_sysinfo, sys_sysinfo, 116, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setdomainname > +TRACE_SYSCALL_TABLE(sys_setdomainname, sys_setdomainname, 121, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_newuname > +TRACE_SYSCALL_TABLE(sys_newuname, sys_newuname, 122, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_adjtimex > +TRACE_SYSCALL_TABLE(sys_adjtimex, sys_adjtimex, 124, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sigprocmask > +TRACE_SYSCALL_TABLE(sys_sigprocmask, sys_sigprocmask, 126, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_init_module > +TRACE_SYSCALL_TABLE(sys_init_module, sys_init_module, 128, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_delete_module > +TRACE_SYSCALL_TABLE(sys_delete_module, sys_delete_module, 129, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_quotactl > +TRACE_SYSCALL_TABLE(sys_quotactl, sys_quotactl, 131, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_llseek > +TRACE_SYSCALL_TABLE(sys_llseek, sys_llseek, 140, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getdents > +TRACE_SYSCALL_TABLE(sys_getdents, sys_getdents, 141, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_select > +TRACE_SYSCALL_TABLE(sys_select, sys_select, 142, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_readv > +TRACE_SYSCALL_TABLE(sys_readv, sys_readv, 145, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_writev > +TRACE_SYSCALL_TABLE(sys_writev, sys_writev, 146, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sysctl > +TRACE_SYSCALL_TABLE(sys_sysctl, sys_sysctl, 149, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_setparam > +TRACE_SYSCALL_TABLE(sys_sched_setparam, sys_sched_setparam, 154, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_getparam > +TRACE_SYSCALL_TABLE(sys_sched_getparam, sys_sched_getparam, 155, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_setscheduler > +TRACE_SYSCALL_TABLE(sys_sched_setscheduler, sys_sched_setscheduler, 156, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_rr_get_interval > +TRACE_SYSCALL_TABLE(sys_sched_rr_get_interval, sys_sched_rr_get_interval, 161, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_nanosleep > +TRACE_SYSCALL_TABLE(sys_nanosleep, sys_nanosleep, 162, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getresuid16 > +TRACE_SYSCALL_TABLE(sys_getresuid16, sys_getresuid16, 165, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_poll > +TRACE_SYSCALL_TABLE(sys_poll, sys_poll, 168, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getresgid16 > +TRACE_SYSCALL_TABLE(sys_getresgid16, sys_getresgid16, 171, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_sigaction > +TRACE_SYSCALL_TABLE(sys_rt_sigaction, sys_rt_sigaction, 174, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_sigprocmask > +TRACE_SYSCALL_TABLE(sys_rt_sigprocmask, sys_rt_sigprocmask, 175, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_sigpending > +TRACE_SYSCALL_TABLE(sys_rt_sigpending, sys_rt_sigpending, 176, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_sigtimedwait > +TRACE_SYSCALL_TABLE(sys_rt_sigtimedwait, sys_rt_sigtimedwait, 177, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_sigqueueinfo > +TRACE_SYSCALL_TABLE(sys_rt_sigqueueinfo, sys_rt_sigqueueinfo, 178, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_sigsuspend > +TRACE_SYSCALL_TABLE(sys_rt_sigsuspend, sys_rt_sigsuspend, 179, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_chown16 > +TRACE_SYSCALL_TABLE(sys_chown16, sys_chown16, 182, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getcwd > +TRACE_SYSCALL_TABLE(sys_getcwd, sys_getcwd, 183, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sendfile > +TRACE_SYSCALL_TABLE(sys_sendfile, sys_sendfile, 187, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getrlimit > +TRACE_SYSCALL_TABLE(sys_getrlimit, sys_getrlimit, 191, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_stat64 > +TRACE_SYSCALL_TABLE(sys_stat64, sys_stat64, 195, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lstat64 > +TRACE_SYSCALL_TABLE(sys_lstat64, sys_lstat64, 196, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fstat64 > +TRACE_SYSCALL_TABLE(sys_fstat64, sys_fstat64, 197, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lchown > +TRACE_SYSCALL_TABLE(sys_lchown, sys_lchown, 198, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getgroups > +TRACE_SYSCALL_TABLE(sys_getgroups, sys_getgroups, 205, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setgroups > +TRACE_SYSCALL_TABLE(sys_setgroups, sys_setgroups, 206, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getresuid > +TRACE_SYSCALL_TABLE(sys_getresuid, sys_getresuid, 209, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getresgid > +TRACE_SYSCALL_TABLE(sys_getresgid, sys_getresgid, 211, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_chown > +TRACE_SYSCALL_TABLE(sys_chown, sys_chown, 212, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getdents64 > +TRACE_SYSCALL_TABLE(sys_getdents64, sys_getdents64, 217, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pivot_root > +TRACE_SYSCALL_TABLE(sys_pivot_root, sys_pivot_root, 218, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mincore > +TRACE_SYSCALL_TABLE(sys_mincore, sys_mincore, 219, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setxattr > +TRACE_SYSCALL_TABLE(sys_setxattr, sys_setxattr, 226, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lsetxattr > +TRACE_SYSCALL_TABLE(sys_lsetxattr, sys_lsetxattr, 227, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fsetxattr > +TRACE_SYSCALL_TABLE(sys_fsetxattr, sys_fsetxattr, 228, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getxattr > +TRACE_SYSCALL_TABLE(sys_getxattr, sys_getxattr, 229, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lgetxattr > +TRACE_SYSCALL_TABLE(sys_lgetxattr, sys_lgetxattr, 230, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fgetxattr > +TRACE_SYSCALL_TABLE(sys_fgetxattr, sys_fgetxattr, 231, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_listxattr > +TRACE_SYSCALL_TABLE(sys_listxattr, sys_listxattr, 232, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_llistxattr > +TRACE_SYSCALL_TABLE(sys_llistxattr, sys_llistxattr, 233, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_flistxattr > +TRACE_SYSCALL_TABLE(sys_flistxattr, sys_flistxattr, 234, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_removexattr > +TRACE_SYSCALL_TABLE(sys_removexattr, sys_removexattr, 235, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lremovexattr > +TRACE_SYSCALL_TABLE(sys_lremovexattr, sys_lremovexattr, 236, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fremovexattr > +TRACE_SYSCALL_TABLE(sys_fremovexattr, sys_fremovexattr, 237, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sendfile64 > +TRACE_SYSCALL_TABLE(sys_sendfile64, sys_sendfile64, 239, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_futex > +TRACE_SYSCALL_TABLE(sys_futex, sys_futex, 240, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_setaffinity > +TRACE_SYSCALL_TABLE(sys_sched_setaffinity, sys_sched_setaffinity, 241, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_getaffinity > +TRACE_SYSCALL_TABLE(sys_sched_getaffinity, sys_sched_getaffinity, 242, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_io_setup > +TRACE_SYSCALL_TABLE(sys_io_setup, sys_io_setup, 243, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_io_getevents > +TRACE_SYSCALL_TABLE(sys_io_getevents, sys_io_getevents, 245, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_io_submit > +TRACE_SYSCALL_TABLE(sys_io_submit, sys_io_submit, 246, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_io_cancel > +TRACE_SYSCALL_TABLE(sys_io_cancel, sys_io_cancel, 247, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_epoll_ctl > +TRACE_SYSCALL_TABLE(sys_epoll_ctl, sys_epoll_ctl, 251, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_epoll_wait > +TRACE_SYSCALL_TABLE(sys_epoll_wait, sys_epoll_wait, 252, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_set_tid_address > +TRACE_SYSCALL_TABLE(sys_set_tid_address, sys_set_tid_address, 256, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timer_create > +TRACE_SYSCALL_TABLE(sys_timer_create, sys_timer_create, 257, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timer_settime > +TRACE_SYSCALL_TABLE(sys_timer_settime, sys_timer_settime, 258, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timer_gettime > +TRACE_SYSCALL_TABLE(sys_timer_gettime, sys_timer_gettime, 259, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_clock_settime > +TRACE_SYSCALL_TABLE(sys_clock_settime, sys_clock_settime, 262, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_clock_gettime > +TRACE_SYSCALL_TABLE(sys_clock_gettime, sys_clock_gettime, 263, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_clock_getres > +TRACE_SYSCALL_TABLE(sys_clock_getres, sys_clock_getres, 264, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_clock_nanosleep > +TRACE_SYSCALL_TABLE(sys_clock_nanosleep, sys_clock_nanosleep, 265, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_utimes > +TRACE_SYSCALL_TABLE(sys_utimes, sys_utimes, 269, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mq_open > +TRACE_SYSCALL_TABLE(sys_mq_open, sys_mq_open, 274, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mq_unlink > +TRACE_SYSCALL_TABLE(sys_mq_unlink, sys_mq_unlink, 275, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mq_timedsend > +TRACE_SYSCALL_TABLE(sys_mq_timedsend, sys_mq_timedsend, 276, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mq_timedreceive > +TRACE_SYSCALL_TABLE(sys_mq_timedreceive, sys_mq_timedreceive, 277, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mq_notify > +TRACE_SYSCALL_TABLE(sys_mq_notify, sys_mq_notify, 278, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mq_getsetattr > +TRACE_SYSCALL_TABLE(sys_mq_getsetattr, sys_mq_getsetattr, 279, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_waitid > +TRACE_SYSCALL_TABLE(sys_waitid, sys_waitid, 280, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_bind > +TRACE_SYSCALL_TABLE(sys_bind, sys_bind, 282, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_connect > +TRACE_SYSCALL_TABLE(sys_connect, sys_connect, 283, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_accept > +TRACE_SYSCALL_TABLE(sys_accept, sys_accept, 285, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getsockname > +TRACE_SYSCALL_TABLE(sys_getsockname, sys_getsockname, 286, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getpeername > +TRACE_SYSCALL_TABLE(sys_getpeername, sys_getpeername, 287, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_socketpair > +TRACE_SYSCALL_TABLE(sys_socketpair, sys_socketpair, 288, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_send > +TRACE_SYSCALL_TABLE(sys_send, sys_send, 289, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sendto > +TRACE_SYSCALL_TABLE(sys_sendto, sys_sendto, 290, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_recvfrom > +TRACE_SYSCALL_TABLE(sys_recvfrom, sys_recvfrom, 292, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setsockopt > +TRACE_SYSCALL_TABLE(sys_setsockopt, sys_setsockopt, 294, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getsockopt > +TRACE_SYSCALL_TABLE(sys_getsockopt, sys_getsockopt, 295, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sendmsg > +TRACE_SYSCALL_TABLE(sys_sendmsg, sys_sendmsg, 296, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_recvmsg > +TRACE_SYSCALL_TABLE(sys_recvmsg, sys_recvmsg, 297, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_semop > +TRACE_SYSCALL_TABLE(sys_semop, sys_semop, 298, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_msgsnd > +TRACE_SYSCALL_TABLE(sys_msgsnd, sys_msgsnd, 301, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_msgrcv > +TRACE_SYSCALL_TABLE(sys_msgrcv, sys_msgrcv, 302, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_msgctl > +TRACE_SYSCALL_TABLE(sys_msgctl, sys_msgctl, 304, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_shmat > +TRACE_SYSCALL_TABLE(sys_shmat, sys_shmat, 305, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_shmdt > +TRACE_SYSCALL_TABLE(sys_shmdt, sys_shmdt, 306, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_shmctl > +TRACE_SYSCALL_TABLE(sys_shmctl, sys_shmctl, 308, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_add_key > +TRACE_SYSCALL_TABLE(sys_add_key, sys_add_key, 309, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_request_key > +TRACE_SYSCALL_TABLE(sys_request_key, sys_request_key, 310, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_semtimedop > +TRACE_SYSCALL_TABLE(sys_semtimedop, sys_semtimedop, 312, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_inotify_add_watch > +TRACE_SYSCALL_TABLE(sys_inotify_add_watch, sys_inotify_add_watch, 317, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_openat > +TRACE_SYSCALL_TABLE(sys_openat, sys_openat, 322, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mkdirat > +TRACE_SYSCALL_TABLE(sys_mkdirat, sys_mkdirat, 323, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mknodat > +TRACE_SYSCALL_TABLE(sys_mknodat, sys_mknodat, 324, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fchownat > +TRACE_SYSCALL_TABLE(sys_fchownat, sys_fchownat, 325, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_futimesat > +TRACE_SYSCALL_TABLE(sys_futimesat, sys_futimesat, 326, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fstatat64 > +TRACE_SYSCALL_TABLE(sys_fstatat64, sys_fstatat64, 327, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_unlinkat > +TRACE_SYSCALL_TABLE(sys_unlinkat, sys_unlinkat, 328, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_renameat > +TRACE_SYSCALL_TABLE(sys_renameat, sys_renameat, 329, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_linkat > +TRACE_SYSCALL_TABLE(sys_linkat, sys_linkat, 330, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_symlinkat > +TRACE_SYSCALL_TABLE(sys_symlinkat, sys_symlinkat, 331, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_readlinkat > +TRACE_SYSCALL_TABLE(sys_readlinkat, sys_readlinkat, 332, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fchmodat > +TRACE_SYSCALL_TABLE(sys_fchmodat, sys_fchmodat, 333, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_faccessat > +TRACE_SYSCALL_TABLE(sys_faccessat, sys_faccessat, 334, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pselect6 > +TRACE_SYSCALL_TABLE(sys_pselect6, sys_pselect6, 335, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ppoll > +TRACE_SYSCALL_TABLE(sys_ppoll, sys_ppoll, 336, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_set_robust_list > +TRACE_SYSCALL_TABLE(sys_set_robust_list, sys_set_robust_list, 338, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_get_robust_list > +TRACE_SYSCALL_TABLE(sys_get_robust_list, sys_get_robust_list, 339, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_splice > +TRACE_SYSCALL_TABLE(sys_splice, sys_splice, 340, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_vmsplice > +TRACE_SYSCALL_TABLE(sys_vmsplice, sys_vmsplice, 343, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getcpu > +TRACE_SYSCALL_TABLE(sys_getcpu, sys_getcpu, 345, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_epoll_pwait > +TRACE_SYSCALL_TABLE(sys_epoll_pwait, sys_epoll_pwait, 346, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_utimensat > +TRACE_SYSCALL_TABLE(sys_utimensat, sys_utimensat, 348, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_signalfd > +TRACE_SYSCALL_TABLE(sys_signalfd, sys_signalfd, 349, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timerfd_settime > +TRACE_SYSCALL_TABLE(sys_timerfd_settime, sys_timerfd_settime, 353, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timerfd_gettime > +TRACE_SYSCALL_TABLE(sys_timerfd_gettime, sys_timerfd_gettime, 354, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_signalfd4 > +TRACE_SYSCALL_TABLE(sys_signalfd4, sys_signalfd4, 355, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pipe2 > +TRACE_SYSCALL_TABLE(sys_pipe2, sys_pipe2, 359, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_preadv > +TRACE_SYSCALL_TABLE(sys_preadv, sys_preadv, 361, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pwritev > +TRACE_SYSCALL_TABLE(sys_pwritev, sys_pwritev, 362, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_tgsigqueueinfo > +TRACE_SYSCALL_TABLE(sys_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, 363, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_perf_event_open > +TRACE_SYSCALL_TABLE(sys_perf_event_open, sys_perf_event_open, 364, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_recvmmsg > +TRACE_SYSCALL_TABLE(sys_recvmmsg, sys_recvmmsg, 365, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_accept4 > +TRACE_SYSCALL_TABLE(sys_accept4, sys_accept4, 366, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_prlimit64 > +TRACE_SYSCALL_TABLE(sys_prlimit64, sys_prlimit64, 369, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_name_to_handle_at > +TRACE_SYSCALL_TABLE(sys_name_to_handle_at, sys_name_to_handle_at, 370, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_open_by_handle_at > +TRACE_SYSCALL_TABLE(sys_open_by_handle_at, sys_open_by_handle_at, 371, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_clock_adjtime > +TRACE_SYSCALL_TABLE(sys_clock_adjtime, sys_clock_adjtime, 372, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sendmmsg > +TRACE_SYSCALL_TABLE(sys_sendmmsg, sys_sendmmsg, 374, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_process_vm_readv > +TRACE_SYSCALL_TABLE(sys_process_vm_readv, sys_process_vm_readv, 376, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_process_vm_writev > +TRACE_SYSCALL_TABLE(sys_process_vm_writev, sys_process_vm_writev, 377, 6) > +#endif > + > +#endif /* CREATE_SYSCALL_TABLE */ > diff --git a/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.h b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.h > new file mode 100644 > index 0000000..65131bb > --- /dev/null > +++ b/instrumentation/syscalls/headers/arm-32-syscalls-3.4.25_pointers_override.h > @@ -0,0 +1,39 @@ > + > +#define OVERRIDE_TABLE_32_sys_mmap2 > + > + > +#ifndef CREATE_SYSCALL_TABLE > + > +SC_TRACE_EVENT(sys_mmap2, > + TP_PROTO(void *addr, size_t len, int prot, > + int flags, int fd, off_t pgoff), > + TP_ARGS(addr, len, prot, flags, fd, pgoff), > + TP_STRUCT__entry( > + __field_hex(void *, addr) > + __field(size_t, len) > + __field(int, prot) > + __field(int, flags) > + __field(int, fd) > + __field(off_t, pgoff)), > + TP_fast_assign( > + tp_assign(addr, addr) > + tp_assign(len, len) > + tp_assign(prot, prot) > + tp_assign(flags, flags) > + tp_assign(fd, fd) > + tp_assign(pgoff, pgoff)), > + TP_printk() > +) > + > +#else /* CREATE_SYSCALL_TABLE */ > + > +#define OVERRIDE_TABLE_32_sys_execve > +TRACE_SYSCALL_TABLE(sys_execve, sys_execve, 11, 3) > +#define OVERRIDE_TABLE_32_sys_clone > +TRACE_SYSCALL_TABLE(sys_clone, sys_clone, 120, 5) > +#define OVERRIDE_TABLE_32_sys_mmap2 > +TRACE_SYSCALL_TABLE(sys_mmap2, sys_mmap2, 192, 6) > + > +#endif /* CREATE_SYSCALL_TABLE */ > + > + > diff --git a/instrumentation/syscalls/headers/syscalls_integers.h b/instrumentation/syscalls/headers/syscalls_integers.h > index 002130a..1ee96c5 100644 > --- a/instrumentation/syscalls/headers/syscalls_integers.h > +++ b/instrumentation/syscalls/headers/syscalls_integers.h > @@ -7,5 +7,5 @@ > #endif > > #ifdef CONFIG_ARM > -#include "arm-32-syscalls-2.6.38_integers.h" > +#include "arm-32-syscalls-3.4.25_integers.h" > #endif > diff --git a/instrumentation/syscalls/headers/syscalls_pointers.h b/instrumentation/syscalls/headers/syscalls_pointers.h > index 11b4979..44c74ed 100644 > --- a/instrumentation/syscalls/headers/syscalls_pointers.h > +++ b/instrumentation/syscalls/headers/syscalls_pointers.h > @@ -7,5 +7,5 @@ > #endif > > #ifdef CONFIG_ARM > -#include "arm-32-syscalls-2.6.38_pointers.h" > +#include "arm-32-syscalls-3.4.25_pointers.h" > #endif > -- > 1.7.9.5 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Fri May 10 12:09:31 2013 From: dgoulet at efficios.com (David Goulet) Date: Fri, 10 May 2013 12:09:31 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Add wrappers for pipe Message-ID: <1368202171-20158-1-git-send-email-dgoulet@efficios.com> This is to help use pipes in a way where partial read/write and EINTR are handled in one single call site. Two new files are created, pipe.c/.h which are part of libcommon. The open, close, read and write calls are implemented using a custom lttng_pipe data structure and protected by operation's mutex. A destroy function is also available to cleanup memory once done with a pipe. Signed-off-by: David Goulet --- src/common/Makefile.am | 3 +- src/common/pipe.c | 252 ++++++++++++++++++++++++++++++++++++++++++++++++ src/common/pipe.h | 62 ++++++++++++ 3 files changed, 316 insertions(+), 1 deletion(-) create mode 100644 src/common/pipe.c create mode 100644 src/common/pipe.h diff --git a/src/common/Makefile.am b/src/common/Makefile.am index f2ea40a..6ba6c2b 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -13,7 +13,8 @@ noinst_HEADERS = lttng-kernel.h defaults.h macros.h error.h futex.h \ noinst_LTLIBRARIES = libcommon.la libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \ - common.h futex.c futex.h uri.c uri.h defaults.c + common.h futex.c futex.h uri.c uri.h defaults.c \ + pipe.c pipe.h libcommon_la_LIBADD = -luuid # Consumer library diff --git a/src/common/pipe.c b/src/common/pipe.c new file mode 100644 index 0000000..89853da --- /dev/null +++ b/src/common/pipe.c @@ -0,0 +1,252 @@ +/* + * Copyright (C) 2013 - David Goulet + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License, version 2 only, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#define _GNU_SOURCE +#include +#include +#include + +#include + +#include "pipe.h" + +/* + * Lock read side of a pipe. + */ +static void lock_read_side(struct lttng_pipe *pipe) +{ + pthread_mutex_lock(&pipe->read_mutex); +} + +/* + * Unlock read side of a pipe. + */ +static void unlock_read_side(struct lttng_pipe *pipe) +{ + pthread_mutex_unlock(&pipe->read_mutex); +} + +/* + * Lock write side of a pipe. + */ +static void lock_write_side(struct lttng_pipe *pipe) +{ + pthread_mutex_lock(&pipe->write_mutex); +} + +/* + * Unlock write side of a pipe. + */ +static void unlock_write_side(struct lttng_pipe *pipe) +{ + pthread_mutex_unlock(&pipe->write_mutex); +} + +/* + * Open a new lttng pipe and set flags using fcntl(). + * + * Return a newly allocated lttng pipe on success or else NULL. + */ +struct lttng_pipe *lttng_pipe_open(int flags) +{ + int ret; + struct lttng_pipe *p; + + p = zmalloc(sizeof(*p)); + if (!p) { + PERROR("zmalloc pipe open"); + goto error; + } + + ret = pipe(p->fd); + if (ret < 0) { + PERROR("lttng pipe"); + goto error; + } + + if (flags) { + int i; + + for (i = 0; i < 2; i++) { + ret = fcntl(p->fd[i], F_SETFD, flags); + if (ret < 0) { + PERROR("fcntl lttng pipe %d", flags); + goto error; + } + } + } + + pthread_mutex_init(&p->read_mutex, NULL); + pthread_mutex_init(&p->write_mutex, NULL); + p->r_state = LTTNG_PIPE_STATE_OPENED; + p->w_state = LTTNG_PIPE_STATE_OPENED; + p->flags = flags; + + return p; + +error: + lttng_pipe_destroy(p); + return NULL; +} + +/* + * Close both read and write side of a lttng pipe. + * + * Return 0 on success else a negative value. + */ +int lttng_pipe_close(struct lttng_pipe *pipe) +{ + int ret, ret_val = 0; + + assert(pipe); + + /* Handle read side first. */ + lock_read_side(pipe); + if (LTTNG_PIPE_IS_READ_OPEN(pipe)) { + ret = close(pipe->fd[0]); + if (ret < 0) { + PERROR("close lttng read pipe"); + ret_val = ret; + } + pipe->r_state = LTTNG_PIPE_STATE_CLOSED; + } + unlock_read_side(pipe); + + /* Handle write side. */ + lock_write_side(pipe); + if (LTTNG_PIPE_IS_WRITE_OPEN(pipe)) { + ret = close(pipe->fd[0]); + if (ret < 0) { + PERROR("close lttng write pipe"); + ret_val = ret; + } + pipe->w_state = LTTNG_PIPE_STATE_CLOSED; + } + unlock_write_side(pipe); + + return ret_val; +} + +/* + * Close and destroy a lttng pipe object. Finally, pipe is freed. + */ +void lttng_pipe_destroy(struct lttng_pipe *pipe) +{ + if (!pipe) { + return; + } + + /* If pipe is already closed or not opened, this returns gracefully. */ + (void) lttng_pipe_close(pipe); + + (void) pthread_mutex_destroy(&pipe->read_mutex); + (void) pthread_mutex_destroy(&pipe->write_mutex); + free(pipe); +} + +/* + * Read on a lttng pipe and put the data in buf of at least size count. + * + * Return 0 on success or else a negative errno message from read(2). + */ +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count) +{ + ssize_t ret, read_len, read_left, index; + + assert(pipe); + assert(buf); + + lock_read_side(pipe); + + if (!LTTNG_PIPE_IS_READ_OPEN(pipe)) { + ret = -EBADF; + goto error; + } + + read_left = count; + index = 0; + do { + read_len = read(pipe->fd[0], buf + index, read_left); + if (read_len < 0) { + switch (errno) { + case EINTR: + /* Read again. */ + continue; + default: + PERROR("lttng pipe read"); + ret = -errno; + goto error; + } + } + read_left -= read_len; + index += read_len; + } while (read_left > 0); + + /* Everything went fine. */ + ret = 0; + +error: + unlock_read_side(pipe); + return ret; +} + +/* + * Write on a lttng pipe using the data in buf and size of count. + * + * Return 0 on success or else a negative errno message from write(2). + */ +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, + size_t count) +{ + ssize_t ret, write_len, write_left, index; + + assert(pipe); + assert(buf); + + lock_write_side(pipe); + + if (!LTTNG_PIPE_IS_WRITE_OPEN(pipe)) { + ret = -EBADF; + goto error; + } + + write_left = count; + index = 0; + do { + write_len = write(pipe->fd[1], buf + index, write_left); + if (write_len < 0) { + switch (errno) { + case EINTR: + /* Write again. */ + continue; + default: + PERROR("lttng pipe write"); + ret = -errno; + goto error; + } + } + write_left -= write_len; + index += write_len; + } while (write_left > 0); + + /* Everything went fine. */ + ret = 0; + +error: + unlock_write_side(pipe); + return ret; +} diff --git a/src/common/pipe.h b/src/common/pipe.h new file mode 100644 index 0000000..fdff4cb --- /dev/null +++ b/src/common/pipe.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2013 - David Goulet + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License, version 2 only, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef LTTNG_PIPE_H +#define LTTNG_PIPE_H + +#include + +#define LTTNG_PIPE_IS_READ_OPEN(p) \ + (p->r_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0) +#define LTTNG_PIPE_IS_WRITE_OPEN(p) \ + (p->w_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0) + +enum lttng_pipe_state { + LTTNG_PIPE_STATE_OPENED = 1, + LTTNG_PIPE_STATE_CLOSED = 2, +}; + +struct lttng_pipe { + /* Read: 0, Write: 1. */ + int fd[2]; + /* + * Flags of the pipe once opened. pipe(2) specifies either O_NONBLOCK or + * O_CLOEXEC can be used. Flags are set using fcntl(2) call. + */ + int flags; + + /* + * These states are protected by the operation mutex below. + */ + enum lttng_pipe_state r_state; + enum lttng_pipe_state w_state; + + /* Held for each read(2) operation. */ + pthread_mutex_t read_mutex; + /* Held for each write(2) operation. */ + pthread_mutex_t write_mutex; +}; + +struct lttng_pipe *lttng_pipe_open(int flags); +int lttng_pipe_close(struct lttng_pipe *pipe); +void lttng_pipe_destroy(struct lttng_pipe *pipe); + +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count); +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, + size_t count); + +#endif /* LTTNG_PIPE_H */ -- 1.7.10.4 From dgoulet at efficios.com Fri May 10 12:14:18 2013 From: dgoulet at efficios.com (David Goulet) Date: Fri, 10 May 2013 12:14:18 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Add --with-lttng-ust-prefix config option. In-Reply-To: <5176C890.6060607@codesourcery.com> References: <5176C890.6060607@codesourcery.com> Message-ID: <518D1CDA.1000400@efficios.com> Hi Stefan, This patch and "Add --version command-line option to lttng." where probably wrapped to 80 character by your mail client or something else making them "corrupted" for merging. See below. Stefan Seefeld: > This patch adds a configure option to the lttng-tools build system to > support lttng-ust being installed in a non-default location. > While configure.ac indicated to use "LDFLAGS=-L/lib" for this, > in reality this doesn't work since the include search path needs to be > adjusted as well. The patch sets both of these by means of a single new > config option. > > > Signed-off-by: Stefan Seefeld > --- > configure.ac | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/configure.ac b/configure.ac > index 4f85fc1..5b37780 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -163,6 +163,15 @@ AC_CHECK_DECL([caa_likely], [], > [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], > [[#include ]] For instance, here the include should be on the first line. More below. Can you resend one without wrapping the lines? Thanks! David > ) > > +AC_ARG_WITH(lttng-ust-prefix, > + AS_HELP_STRING([--with-lttng-ust-prefix=PATH], > + [Specify the installation prefix of the lttng-ust library. > + Headers must be in PATH/include; libraries in PATH/lib.]), > + [ > + CPPFLAGS="$CPPFLAGS -I${withval}/include" > + LDFLAGS="$LDFLAGS -L${withval}/lib64 -L${withval}/lib" > + ]) > + > # Check liblttng-ust-ctl library > AC_ARG_ENABLE(lttng-ust, > AS_HELP_STRING([--disable-lttng-ust],[build without LTTng-UST > (Userspace Tracing) support]), > @@ -174,7 +183,7 @@ AS_IF([test "x$lttng_ust_support" = "xyes"], [ > AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1], [has LTTng-UST > control support]) > lttng_ust_ctl_found=yes > ], > - [AC_MSG_ERROR([Cannot find LTTng-UST 2.1.x. Use [LDFLAGS]=-Ldir > to specify its location, or specify --disable-lttng-ust to build > lttng-tools without LTTng-UST support.])], > + [AC_MSG_ERROR([Cannot find LTTng-UST >= 2.1.x. Use > --with-lttng-ust-prefix=PREFIX to specify its location, or specify > --disable-lttng-ust to build lttng-tools without LTTng-UST support.])], > [-lurcu-common -lurcu-bp -lurcu-cds -lrt] > ) > ]) From mathieu.desnoyers at efficios.com Fri May 10 12:30:48 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 10 May 2013 12:30:48 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Add wrappers for pipe In-Reply-To: <1368202171-20158-1-git-send-email-dgoulet@efficios.com> References: <1368202171-20158-1-git-send-email-dgoulet@efficios.com> Message-ID: <20130510163048.GA22988@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > This is to help use pipes in a way where partial read/write and EINTR > are handled in one single call site. > > Two new files are created, pipe.c/.h which are part of libcommon. The > open, close, read and write calls are implemented using a custom > lttng_pipe data structure and protected by operation's mutex. A destroy > function is also available to cleanup memory once done with a pipe. > > Signed-off-by: David Goulet > --- > src/common/Makefile.am | 3 +- > src/common/pipe.c | 252 ++++++++++++++++++++++++++++++++++++++++++++++++ > src/common/pipe.h | 62 ++++++++++++ > 3 files changed, 316 insertions(+), 1 deletion(-) > create mode 100644 src/common/pipe.c > create mode 100644 src/common/pipe.h > > diff --git a/src/common/Makefile.am b/src/common/Makefile.am > index f2ea40a..6ba6c2b 100644 > --- a/src/common/Makefile.am > +++ b/src/common/Makefile.am > @@ -13,7 +13,8 @@ noinst_HEADERS = lttng-kernel.h defaults.h macros.h error.h futex.h \ > noinst_LTLIBRARIES = libcommon.la > > libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \ > - common.h futex.c futex.h uri.c uri.h defaults.c > + common.h futex.c futex.h uri.c uri.h defaults.c \ > + pipe.c pipe.h > libcommon_la_LIBADD = -luuid > > # Consumer library > diff --git a/src/common/pipe.c b/src/common/pipe.c > new file mode 100644 > index 0000000..89853da > --- /dev/null > +++ b/src/common/pipe.c > @@ -0,0 +1,252 @@ > +/* > + * Copyright (C) 2013 - David Goulet > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License, version 2 only, as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, but WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > + * more details. > + * > + * You should have received a copy of the GNU General Public License along with > + * this program; if not, write to the Free Software Foundation, Inc., 51 > + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +#define _GNU_SOURCE > +#include > +#include > +#include > + > +#include > + > +#include "pipe.h" > + > +/* > + * Lock read side of a pipe. > + */ > +static void lock_read_side(struct lttng_pipe *pipe) > +{ > + pthread_mutex_lock(&pipe->read_mutex); > +} > + > +/* > + * Unlock read side of a pipe. > + */ > +static void unlock_read_side(struct lttng_pipe *pipe) > +{ > + pthread_mutex_unlock(&pipe->read_mutex); > +} > + > +/* > + * Lock write side of a pipe. > + */ > +static void lock_write_side(struct lttng_pipe *pipe) > +{ > + pthread_mutex_lock(&pipe->write_mutex); > +} > + > +/* > + * Unlock write side of a pipe. > + */ > +static void unlock_write_side(struct lttng_pipe *pipe) > +{ > + pthread_mutex_unlock(&pipe->write_mutex); > +} > + > +/* > + * Open a new lttng pipe and set flags using fcntl(). > + * > + * Return a newly allocated lttng pipe on success or else NULL. > + */ > +struct lttng_pipe *lttng_pipe_open(int flags) > +{ > + int ret; > + struct lttng_pipe *p; > + > + p = zmalloc(sizeof(*p)); > + if (!p) { > + PERROR("zmalloc pipe open"); > + goto error; > + } > + > + ret = pipe(p->fd); > + if (ret < 0) { > + PERROR("lttng pipe"); > + goto error; > + } > + > + if (flags) { > + int i; > + > + for (i = 0; i < 2; i++) { > + ret = fcntl(p->fd[i], F_SETFD, flags); > + if (ret < 0) { > + PERROR("fcntl lttng pipe %d", flags); > + goto error; > + } > + } > + } > + > + pthread_mutex_init(&p->read_mutex, NULL); > + pthread_mutex_init(&p->write_mutex, NULL); > + p->r_state = LTTNG_PIPE_STATE_OPENED; > + p->w_state = LTTNG_PIPE_STATE_OPENED; > + p->flags = flags; > + > + return p; > + > +error: > + lttng_pipe_destroy(p); > + return NULL; > +} > + > +/* > + * Close both read and write side of a lttng pipe. > + * > + * Return 0 on success else a negative value. > + */ > +int lttng_pipe_close(struct lttng_pipe *pipe) we could split in pipe_close read vs write ? > +{ > + int ret, ret_val = 0; > + > + assert(pipe); > + > + /* Handle read side first. */ > + lock_read_side(pipe); > + if (LTTNG_PIPE_IS_READ_OPEN(pipe)) { > + ret = close(pipe->fd[0]); > + if (ret < 0) { > + PERROR("close lttng read pipe"); > + ret_val = ret; > + } > + pipe->r_state = LTTNG_PIPE_STATE_CLOSED; > + } > + unlock_read_side(pipe); > + > + /* Handle write side. */ > + lock_write_side(pipe); > + if (LTTNG_PIPE_IS_WRITE_OPEN(pipe)) { > + ret = close(pipe->fd[0]); > + if (ret < 0) { > + PERROR("close lttng write pipe"); > + ret_val = ret; > + } > + pipe->w_state = LTTNG_PIPE_STATE_CLOSED; > + } > + unlock_write_side(pipe); > + > + return ret_val; > +} > + > +/* > + * Close and destroy a lttng pipe object. Finally, pipe is freed. > + */ > +void lttng_pipe_destroy(struct lttng_pipe *pipe) > +{ > + if (!pipe) { > + return; > + } > + we could add interesting asserts here: if any of read/write lock is currently locked, fail with an assert. It is incorrect to have a concurrent thread using the pipe while we destroy it. > + /* If pipe is already closed or not opened, this returns gracefully. */ > + (void) lttng_pipe_close(pipe); > + > + (void) pthread_mutex_destroy(&pipe->read_mutex); > + (void) pthread_mutex_destroy(&pipe->write_mutex); > + free(pipe); > +} > + > +/* > + * Read on a lttng pipe and put the data in buf of at least size count. > + * > + * Return 0 on success or else a negative errno message from read(2). I would prefer that we return similar return values to read(). We expect "count - read_left" I guess. > + */ > +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count) > +{ > + ssize_t ret, read_len, read_left, index; > + > + assert(pipe); > + assert(buf); > + > + lock_read_side(pipe); > + > + if (!LTTNG_PIPE_IS_READ_OPEN(pipe)) { > + ret = -EBADF; > + goto error; > + } > + > + read_left = count; > + index = 0; > + do { > + read_len = read(pipe->fd[0], buf + index, read_left); > + if (read_len < 0) { > + switch (errno) { > + case EINTR: > + /* Read again. */ > + continue; > + default: > + PERROR("lttng pipe read"); > + ret = -errno; If we already have been able to read a some bytes in the previous passes, shouldn't we return that number of bytes instead ? > + goto error; > + } > + } > + read_left -= read_len; > + index += read_len; > + } while (read_left > 0); > + > + /* Everything went fine. */ > + ret = 0; > + > +error: > + unlock_read_side(pipe); > + return ret; > +} > + > +/* > + * Write on a lttng pipe using the data in buf and size of count. > + * > + * Return 0 on success or else a negative errno message from write(2). Similar comments about ret values as read above. > + */ > +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, > + size_t count) > +{ > + ssize_t ret, write_len, write_left, index; > + > + assert(pipe); > + assert(buf); > + > + lock_write_side(pipe); > + > + if (!LTTNG_PIPE_IS_WRITE_OPEN(pipe)) { > + ret = -EBADF; > + goto error; > + } > + > + write_left = count; > + index = 0; > + do { > + write_len = write(pipe->fd[1], buf + index, write_left); > + if (write_len < 0) { > + switch (errno) { > + case EINTR: > + /* Write again. */ > + continue; > + default: > + PERROR("lttng pipe write"); > + ret = -errno; > + goto error; > + } > + } > + write_left -= write_len; > + index += write_len; > + } while (write_left > 0); > + > + /* Everything went fine. */ > + ret = 0; > + > +error: > + unlock_write_side(pipe); > + return ret; > +} > diff --git a/src/common/pipe.h b/src/common/pipe.h > new file mode 100644 > index 0000000..fdff4cb > --- /dev/null > +++ b/src/common/pipe.h > @@ -0,0 +1,62 @@ > +/* > + * Copyright (C) 2013 - David Goulet > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License, version 2 only, as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, but WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > + * more details. > + * > + * You should have received a copy of the GNU General Public License along with > + * this program; if not, write to the Free Software Foundation, Inc., 51 > + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +#ifndef LTTNG_PIPE_H > +#define LTTNG_PIPE_H > + > +#include > + > +#define LTTNG_PIPE_IS_READ_OPEN(p) \ > + (p->r_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0) > +#define LTTNG_PIPE_IS_WRITE_OPEN(p) \ > + (p->w_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0) those two could be static inline. no need for macros. Thanks, Mathieu > + > +enum lttng_pipe_state { > + LTTNG_PIPE_STATE_OPENED = 1, > + LTTNG_PIPE_STATE_CLOSED = 2, > +}; > + > +struct lttng_pipe { > + /* Read: 0, Write: 1. */ > + int fd[2]; > + /* > + * Flags of the pipe once opened. pipe(2) specifies either O_NONBLOCK or > + * O_CLOEXEC can be used. Flags are set using fcntl(2) call. > + */ > + int flags; > + > + /* > + * These states are protected by the operation mutex below. > + */ > + enum lttng_pipe_state r_state; > + enum lttng_pipe_state w_state; > + > + /* Held for each read(2) operation. */ > + pthread_mutex_t read_mutex; > + /* Held for each write(2) operation. */ > + pthread_mutex_t write_mutex; > +}; > + > +struct lttng_pipe *lttng_pipe_open(int flags); > +int lttng_pipe_close(struct lttng_pipe *pipe); > +void lttng_pipe_destroy(struct lttng_pipe *pipe); > + > +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count); > +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, > + size_t count); > + > +#endif /* LTTNG_PIPE_H */ > -- > 1.7.10.4 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Fri May 10 13:14:10 2013 From: dgoulet at efficios.com (David Goulet) Date: Fri, 10 May 2013 13:14:10 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Add wrappers for pipe In-Reply-To: <20130510163048.GA22988@Krystal> References: <1368202171-20158-1-git-send-email-dgoulet@efficios.com> <20130510163048.GA22988@Krystal> Message-ID: <518D2AE2.7030300@efficios.com> Mathieu Desnoyers: > * David Goulet (dgoulet at efficios.com) wrote: >> This is to help use pipes in a way where partial read/write and EINTR >> are handled in one single call site. >> >> Two new files are created, pipe.c/.h which are part of libcommon. The >> open, close, read and write calls are implemented using a custom >> lttng_pipe data structure and protected by operation's mutex. A destroy >> function is also available to cleanup memory once done with a pipe. >> >> Signed-off-by: David Goulet >> --- >> src/common/Makefile.am | 3 +- >> src/common/pipe.c | 252 ++++++++++++++++++++++++++++++++++++++++++++++++ >> src/common/pipe.h | 62 ++++++++++++ >> 3 files changed, 316 insertions(+), 1 deletion(-) >> create mode 100644 src/common/pipe.c >> create mode 100644 src/common/pipe.h >> >> diff --git a/src/common/Makefile.am b/src/common/Makefile.am >> index f2ea40a..6ba6c2b 100644 >> --- a/src/common/Makefile.am >> +++ b/src/common/Makefile.am >> @@ -13,7 +13,8 @@ noinst_HEADERS = lttng-kernel.h defaults.h macros.h error.h futex.h \ >> noinst_LTLIBRARIES = libcommon.la >> >> libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \ >> - common.h futex.c futex.h uri.c uri.h defaults.c >> + common.h futex.c futex.h uri.c uri.h defaults.c \ >> + pipe.c pipe.h >> libcommon_la_LIBADD = -luuid >> >> # Consumer library >> diff --git a/src/common/pipe.c b/src/common/pipe.c >> new file mode 100644 >> index 0000000..89853da >> --- /dev/null >> +++ b/src/common/pipe.c >> @@ -0,0 +1,252 @@ >> +/* >> + * Copyright (C) 2013 - David Goulet >> + * >> + * This program is free software; you can redistribute it and/or modify it >> + * under the terms of the GNU General Public License, version 2 only, as >> + * published by the Free Software Foundation. >> + * >> + * This program is distributed in the hope that it will be useful, but WITHOUT >> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or >> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for >> + * more details. >> + * >> + * You should have received a copy of the GNU General Public License along with >> + * this program; if not, write to the Free Software Foundation, Inc., 51 >> + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >> + */ >> + >> +#define _GNU_SOURCE >> +#include >> +#include >> +#include >> + >> +#include >> + >> +#include "pipe.h" >> + >> +/* >> + * Lock read side of a pipe. >> + */ >> +static void lock_read_side(struct lttng_pipe *pipe) >> +{ >> + pthread_mutex_lock(&pipe->read_mutex); >> +} >> + >> +/* >> + * Unlock read side of a pipe. >> + */ >> +static void unlock_read_side(struct lttng_pipe *pipe) >> +{ >> + pthread_mutex_unlock(&pipe->read_mutex); >> +} >> + >> +/* >> + * Lock write side of a pipe. >> + */ >> +static void lock_write_side(struct lttng_pipe *pipe) >> +{ >> + pthread_mutex_lock(&pipe->write_mutex); >> +} >> + >> +/* >> + * Unlock write side of a pipe. >> + */ >> +static void unlock_write_side(struct lttng_pipe *pipe) >> +{ >> + pthread_mutex_unlock(&pipe->write_mutex); >> +} >> + >> +/* >> + * Open a new lttng pipe and set flags using fcntl(). >> + * >> + * Return a newly allocated lttng pipe on success or else NULL. >> + */ >> +struct lttng_pipe *lttng_pipe_open(int flags) >> +{ >> + int ret; >> + struct lttng_pipe *p; >> + >> + p = zmalloc(sizeof(*p)); >> + if (!p) { >> + PERROR("zmalloc pipe open"); >> + goto error; >> + } >> + >> + ret = pipe(p->fd); >> + if (ret < 0) { >> + PERROR("lttng pipe"); >> + goto error; >> + } >> + >> + if (flags) { >> + int i; >> + >> + for (i = 0; i < 2; i++) { >> + ret = fcntl(p->fd[i], F_SETFD, flags); >> + if (ret < 0) { >> + PERROR("fcntl lttng pipe %d", flags); >> + goto error; >> + } >> + } >> + } >> + >> + pthread_mutex_init(&p->read_mutex, NULL); >> + pthread_mutex_init(&p->write_mutex, NULL); >> + p->r_state = LTTNG_PIPE_STATE_OPENED; >> + p->w_state = LTTNG_PIPE_STATE_OPENED; >> + p->flags = flags; >> + >> + return p; >> + >> +error: >> + lttng_pipe_destroy(p); >> + return NULL; >> +} >> + >> +/* >> + * Close both read and write side of a lttng pipe. >> + * >> + * Return 0 on success else a negative value. >> + */ >> +int lttng_pipe_close(struct lttng_pipe *pipe) > > we could split in pipe_close read vs write ? Yup agreed. We have some case where we only close one side. > >> +{ >> + int ret, ret_val = 0; >> + >> + assert(pipe); >> + >> + /* Handle read side first. */ >> + lock_read_side(pipe); >> + if (LTTNG_PIPE_IS_READ_OPEN(pipe)) { >> + ret = close(pipe->fd[0]); >> + if (ret < 0) { >> + PERROR("close lttng read pipe"); >> + ret_val = ret; >> + } >> + pipe->r_state = LTTNG_PIPE_STATE_CLOSED; >> + } >> + unlock_read_side(pipe); >> + >> + /* Handle write side. */ >> + lock_write_side(pipe); >> + if (LTTNG_PIPE_IS_WRITE_OPEN(pipe)) { >> + ret = close(pipe->fd[0]); >> + if (ret < 0) { >> + PERROR("close lttng write pipe"); >> + ret_val = ret; >> + } >> + pipe->w_state = LTTNG_PIPE_STATE_CLOSED; >> + } >> + unlock_write_side(pipe); >> + >> + return ret_val; >> +} >> + >> +/* >> + * Close and destroy a lttng pipe object. Finally, pipe is freed. >> + */ >> +void lttng_pipe_destroy(struct lttng_pipe *pipe) >> +{ >> + if (!pipe) { >> + return; >> + } >> + > > we could add interesting asserts here: > > if any of read/write lock is currently locked, fail with an assert. It > is incorrect to have a concurrent thread using the pipe while we destroy > it. Makes sense. > > > >> + /* If pipe is already closed or not opened, this returns gracefully. */ >> + (void) lttng_pipe_close(pipe); >> + >> + (void) pthread_mutex_destroy(&pipe->read_mutex); >> + (void) pthread_mutex_destroy(&pipe->write_mutex); >> + free(pipe); >> +} >> + >> +/* >> + * Read on a lttng pipe and put the data in buf of at least size count. >> + * >> + * Return 0 on success or else a negative errno message from read(2). > > I would prefer that we return similar return values to read(). We expect > "count - read_left" I guess. Hmmmm on success "count" should be returned which is "index" here at the end of the loop. > >> + */ >> +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count) >> +{ >> + ssize_t ret, read_len, read_left, index; >> + >> + assert(pipe); >> + assert(buf); >> + >> + lock_read_side(pipe); >> + >> + if (!LTTNG_PIPE_IS_READ_OPEN(pipe)) { >> + ret = -EBADF; >> + goto error; >> + } >> + >> + read_left = count; >> + index = 0; >> + do { >> + read_len = read(pipe->fd[0], buf + index, read_left); >> + if (read_len < 0) { >> + switch (errno) { >> + case EINTR: >> + /* Read again. */ >> + continue; >> + default: >> + PERROR("lttng pipe read"); >> + ret = -errno; > > If we already have been able to read a some bytes in the previous > passes, shouldn't we return that number of bytes instead ? Don't think so. Let say we read 4 bytes out of 16 and the next read() fails with an error, the 12 remaining bytes won't be seen soon so we should definitely return an error because chances are the pipe is no longer usable for now. For a non block pipe, EAGAIN/EWOULDBLOCK can be returned which does not mean an error so in that case we could return the number of bytes read up to this point and document that the caller have to expect a returned value less than "count" meaning EAGAIN ? (the other would be to add a "ret_value" to the call but in that case the ret_value will probably always be EAGAIN for non block pipe and with a positive returned value). > >> + goto error; >> + } >> + } >> + read_left -= read_len; >> + index += read_len; >> + } while (read_left > 0); >> + >> + /* Everything went fine. */ >> + ret = 0; >> + >> +error: >> + unlock_read_side(pipe); >> + return ret; >> +} >> + >> +/* >> + * Write on a lttng pipe using the data in buf and size of count. >> + * >> + * Return 0 on success or else a negative errno message from write(2). > > Similar comments about ret values as read above. > >> + */ >> +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, >> + size_t count) >> +{ >> + ssize_t ret, write_len, write_left, index; >> + >> + assert(pipe); >> + assert(buf); >> + >> + lock_write_side(pipe); >> + >> + if (!LTTNG_PIPE_IS_WRITE_OPEN(pipe)) { >> + ret = -EBADF; >> + goto error; >> + } >> + >> + write_left = count; >> + index = 0; >> + do { >> + write_len = write(pipe->fd[1], buf + index, write_left); >> + if (write_len < 0) { >> + switch (errno) { >> + case EINTR: >> + /* Write again. */ >> + continue; >> + default: >> + PERROR("lttng pipe write"); >> + ret = -errno; >> + goto error; >> + } >> + } >> + write_left -= write_len; >> + index += write_len; >> + } while (write_left > 0); >> + >> + /* Everything went fine. */ >> + ret = 0; >> + >> +error: >> + unlock_write_side(pipe); >> + return ret; >> +} >> diff --git a/src/common/pipe.h b/src/common/pipe.h >> new file mode 100644 >> index 0000000..fdff4cb >> --- /dev/null >> +++ b/src/common/pipe.h >> @@ -0,0 +1,62 @@ >> +/* >> + * Copyright (C) 2013 - David Goulet >> + * >> + * This program is free software; you can redistribute it and/or modify it >> + * under the terms of the GNU General Public License, version 2 only, as >> + * published by the Free Software Foundation. >> + * >> + * This program is distributed in the hope that it will be useful, but WITHOUT >> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or >> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for >> + * more details. >> + * >> + * You should have received a copy of the GNU General Public License along with >> + * this program; if not, write to the Free Software Foundation, Inc., 51 >> + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >> + */ >> + >> +#ifndef LTTNG_PIPE_H >> +#define LTTNG_PIPE_H >> + >> +#include >> + >> +#define LTTNG_PIPE_IS_READ_OPEN(p) \ >> + (p->r_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0) >> +#define LTTNG_PIPE_IS_WRITE_OPEN(p) \ >> + (p->w_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0) > > those two could be static inline. no need for macros. With macros I can use CAPS :( ... No problem :P Cheers! David > > Thanks, > > Mathieu > >> + >> +enum lttng_pipe_state { >> + LTTNG_PIPE_STATE_OPENED = 1, >> + LTTNG_PIPE_STATE_CLOSED = 2, >> +}; >> + >> +struct lttng_pipe { >> + /* Read: 0, Write: 1. */ >> + int fd[2]; >> + /* >> + * Flags of the pipe once opened. pipe(2) specifies either O_NONBLOCK or >> + * O_CLOEXEC can be used. Flags are set using fcntl(2) call. >> + */ >> + int flags; >> + >> + /* >> + * These states are protected by the operation mutex below. >> + */ >> + enum lttng_pipe_state r_state; >> + enum lttng_pipe_state w_state; >> + >> + /* Held for each read(2) operation. */ >> + pthread_mutex_t read_mutex; >> + /* Held for each write(2) operation. */ >> + pthread_mutex_t write_mutex; >> +}; >> + >> +struct lttng_pipe *lttng_pipe_open(int flags); >> +int lttng_pipe_close(struct lttng_pipe *pipe); >> +void lttng_pipe_destroy(struct lttng_pipe *pipe); >> + >> +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count); >> +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, >> + size_t count); >> + >> +#endif /* LTTNG_PIPE_H */ >> -- >> 1.7.10.4 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From mathieu.desnoyers at efficios.com Fri May 10 13:26:22 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 10 May 2013 13:26:22 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Add wrappers for pipe In-Reply-To: <518D2AE2.7030300@efficios.com> References: <1368202171-20158-1-git-send-email-dgoulet@efficios.com> <20130510163048.GA22988@Krystal> <518D2AE2.7030300@efficios.com> Message-ID: <20130510172622.GA23648@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > > > Mathieu Desnoyers: > > * David Goulet (dgoulet at efficios.com) wrote: > >> This is to help use pipes in a way where partial read/write and EINTR > >> are handled in one single call site. > >> > >> Two new files are created, pipe.c/.h which are part of libcommon. The > >> open, close, read and write calls are implemented using a custom > >> lttng_pipe data structure and protected by operation's mutex. A destroy > >> function is also available to cleanup memory once done with a pipe. > >> > >> Signed-off-by: David Goulet > >> --- > >> src/common/Makefile.am | 3 +- > >> src/common/pipe.c | 252 ++++++++++++++++++++++++++++++++++++++++++++++++ > >> src/common/pipe.h | 62 ++++++++++++ > >> 3 files changed, 316 insertions(+), 1 deletion(-) > >> create mode 100644 src/common/pipe.c > >> create mode 100644 src/common/pipe.h > >> > >> diff --git a/src/common/Makefile.am b/src/common/Makefile.am > >> index f2ea40a..6ba6c2b 100644 > >> --- a/src/common/Makefile.am > >> +++ b/src/common/Makefile.am > >> @@ -13,7 +13,8 @@ noinst_HEADERS = lttng-kernel.h defaults.h macros.h error.h futex.h \ > >> noinst_LTLIBRARIES = libcommon.la > >> > >> libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \ > >> - common.h futex.c futex.h uri.c uri.h defaults.c > >> + common.h futex.c futex.h uri.c uri.h defaults.c \ > >> + pipe.c pipe.h > >> libcommon_la_LIBADD = -luuid > >> > >> # Consumer library > >> diff --git a/src/common/pipe.c b/src/common/pipe.c > >> new file mode 100644 > >> index 0000000..89853da > >> --- /dev/null > >> +++ b/src/common/pipe.c > >> @@ -0,0 +1,252 @@ > >> +/* > >> + * Copyright (C) 2013 - David Goulet > >> + * > >> + * This program is free software; you can redistribute it and/or modify it > >> + * under the terms of the GNU General Public License, version 2 only, as > >> + * published by the Free Software Foundation. > >> + * > >> + * This program is distributed in the hope that it will be useful, but WITHOUT > >> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > >> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > >> + * more details. > >> + * > >> + * You should have received a copy of the GNU General Public License along with > >> + * this program; if not, write to the Free Software Foundation, Inc., 51 > >> + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > >> + */ > >> + > >> +#define _GNU_SOURCE > >> +#include > >> +#include > >> +#include > >> + > >> +#include > >> + > >> +#include "pipe.h" > >> + > >> +/* > >> + * Lock read side of a pipe. > >> + */ > >> +static void lock_read_side(struct lttng_pipe *pipe) > >> +{ > >> + pthread_mutex_lock(&pipe->read_mutex); > >> +} > >> + > >> +/* > >> + * Unlock read side of a pipe. > >> + */ > >> +static void unlock_read_side(struct lttng_pipe *pipe) > >> +{ > >> + pthread_mutex_unlock(&pipe->read_mutex); > >> +} > >> + > >> +/* > >> + * Lock write side of a pipe. > >> + */ > >> +static void lock_write_side(struct lttng_pipe *pipe) > >> +{ > >> + pthread_mutex_lock(&pipe->write_mutex); > >> +} > >> + > >> +/* > >> + * Unlock write side of a pipe. > >> + */ > >> +static void unlock_write_side(struct lttng_pipe *pipe) > >> +{ > >> + pthread_mutex_unlock(&pipe->write_mutex); > >> +} > >> + > >> +/* > >> + * Open a new lttng pipe and set flags using fcntl(). > >> + * > >> + * Return a newly allocated lttng pipe on success or else NULL. > >> + */ > >> +struct lttng_pipe *lttng_pipe_open(int flags) > >> +{ > >> + int ret; > >> + struct lttng_pipe *p; > >> + > >> + p = zmalloc(sizeof(*p)); > >> + if (!p) { > >> + PERROR("zmalloc pipe open"); > >> + goto error; > >> + } > >> + > >> + ret = pipe(p->fd); > >> + if (ret < 0) { > >> + PERROR("lttng pipe"); > >> + goto error; > >> + } > >> + > >> + if (flags) { > >> + int i; > >> + > >> + for (i = 0; i < 2; i++) { > >> + ret = fcntl(p->fd[i], F_SETFD, flags); > >> + if (ret < 0) { > >> + PERROR("fcntl lttng pipe %d", flags); > >> + goto error; > >> + } > >> + } > >> + } > >> + > >> + pthread_mutex_init(&p->read_mutex, NULL); > >> + pthread_mutex_init(&p->write_mutex, NULL); > >> + p->r_state = LTTNG_PIPE_STATE_OPENED; > >> + p->w_state = LTTNG_PIPE_STATE_OPENED; > >> + p->flags = flags; > >> + > >> + return p; > >> + > >> +error: > >> + lttng_pipe_destroy(p); > >> + return NULL; > >> +} > >> + > >> +/* > >> + * Close both read and write side of a lttng pipe. > >> + * > >> + * Return 0 on success else a negative value. > >> + */ > >> +int lttng_pipe_close(struct lttng_pipe *pipe) > > > > we could split in pipe_close read vs write ? > > Yup agreed. We have some case where we only close one side. > > > > >> +{ > >> + int ret, ret_val = 0; > >> + > >> + assert(pipe); > >> + > >> + /* Handle read side first. */ > >> + lock_read_side(pipe); > >> + if (LTTNG_PIPE_IS_READ_OPEN(pipe)) { > >> + ret = close(pipe->fd[0]); > >> + if (ret < 0) { > >> + PERROR("close lttng read pipe"); > >> + ret_val = ret; > >> + } > >> + pipe->r_state = LTTNG_PIPE_STATE_CLOSED; > >> + } > >> + unlock_read_side(pipe); > >> + > >> + /* Handle write side. */ > >> + lock_write_side(pipe); > >> + if (LTTNG_PIPE_IS_WRITE_OPEN(pipe)) { > >> + ret = close(pipe->fd[0]); > >> + if (ret < 0) { > >> + PERROR("close lttng write pipe"); > >> + ret_val = ret; > >> + } > >> + pipe->w_state = LTTNG_PIPE_STATE_CLOSED; > >> + } > >> + unlock_write_side(pipe); > >> + > >> + return ret_val; > >> +} > >> + > >> +/* > >> + * Close and destroy a lttng pipe object. Finally, pipe is freed. > >> + */ > >> +void lttng_pipe_destroy(struct lttng_pipe *pipe) > >> +{ > >> + if (!pipe) { > >> + return; > >> + } > >> + > > > > we could add interesting asserts here: > > > > if any of read/write lock is currently locked, fail with an assert. It > > is incorrect to have a concurrent thread using the pipe while we destroy > > it. > > Makes sense. > > > > > > > > >> + /* If pipe is already closed or not opened, this returns gracefully. */ > >> + (void) lttng_pipe_close(pipe); > >> + > >> + (void) pthread_mutex_destroy(&pipe->read_mutex); > >> + (void) pthread_mutex_destroy(&pipe->write_mutex); > >> + free(pipe); > >> +} > >> + > >> +/* > >> + * Read on a lttng pipe and put the data in buf of at least size count. > >> + * > >> + * Return 0 on success or else a negative errno message from read(2). > > > > I would prefer that we return similar return values to read(). We expect > > "count - read_left" I guess. > > Hmmmm on success "count" should be returned which is "index" here at the > end of the loop. > > > > >> + */ > >> +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count) > >> +{ > >> + ssize_t ret, read_len, read_left, index; > >> + > >> + assert(pipe); > >> + assert(buf); > >> + > >> + lock_read_side(pipe); > >> + > >> + if (!LTTNG_PIPE_IS_READ_OPEN(pipe)) { > >> + ret = -EBADF; > >> + goto error; > >> + } > >> + > >> + read_left = count; > >> + index = 0; > >> + do { > >> + read_len = read(pipe->fd[0], buf + index, read_left); > >> + if (read_len < 0) { > >> + switch (errno) { > >> + case EINTR: > >> + /* Read again. */ > >> + continue; > >> + default: > >> + PERROR("lttng pipe read"); > >> + ret = -errno; > > > > If we already have been able to read a some bytes in the previous > > passes, shouldn't we return that number of bytes instead ? > > Don't think so. Let say we read 4 bytes out of 16 and the next read() > fails with an error, the 12 remaining bytes won't be seen soon so we > should definitely return an error because chances are the pipe is no > longer usable for now. > > For a non block pipe, EAGAIN/EWOULDBLOCK can be returned which does not > mean an error so in that case we could return the number of bytes read > up to this point and document that the caller have to expect a returned > value less than "count" meaning EAGAIN ? (the other would be to add a > "ret_value" to the call but in that case the ret_value will probably > always be EAGAIN for non block pipe and with a positive returned value). ideally, make the behavior as similar as read() as possible. so returning a value of the number of bytes read so far would be fine. Thanks, Mathieu > > > > >> + goto error; > >> + } > >> + } > >> + read_left -= read_len; > >> + index += read_len; > >> + } while (read_left > 0); > >> + > >> + /* Everything went fine. */ > >> + ret = 0; > >> + > >> +error: > >> + unlock_read_side(pipe); > >> + return ret; > >> +} > >> + > >> +/* > >> + * Write on a lttng pipe using the data in buf and size of count. > >> + * > >> + * Return 0 on success or else a negative errno message from write(2). > > > > Similar comments about ret values as read above. > > > >> + */ > >> +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, > >> + size_t count) > >> +{ > >> + ssize_t ret, write_len, write_left, index; > >> + > >> + assert(pipe); > >> + assert(buf); > >> + > >> + lock_write_side(pipe); > >> + > >> + if (!LTTNG_PIPE_IS_WRITE_OPEN(pipe)) { > >> + ret = -EBADF; > >> + goto error; > >> + } > >> + > >> + write_left = count; > >> + index = 0; > >> + do { > >> + write_len = write(pipe->fd[1], buf + index, write_left); > >> + if (write_len < 0) { > >> + switch (errno) { > >> + case EINTR: > >> + /* Write again. */ > >> + continue; > >> + default: > >> + PERROR("lttng pipe write"); > >> + ret = -errno; > >> + goto error; > >> + } > >> + } > >> + write_left -= write_len; > >> + index += write_len; > >> + } while (write_left > 0); > >> + > >> + /* Everything went fine. */ > >> + ret = 0; > >> + > >> +error: > >> + unlock_write_side(pipe); > >> + return ret; > >> +} > >> diff --git a/src/common/pipe.h b/src/common/pipe.h > >> new file mode 100644 > >> index 0000000..fdff4cb > >> --- /dev/null > >> +++ b/src/common/pipe.h > >> @@ -0,0 +1,62 @@ > >> +/* > >> + * Copyright (C) 2013 - David Goulet > >> + * > >> + * This program is free software; you can redistribute it and/or modify it > >> + * under the terms of the GNU General Public License, version 2 only, as > >> + * published by the Free Software Foundation. > >> + * > >> + * This program is distributed in the hope that it will be useful, but WITHOUT > >> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > >> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > >> + * more details. > >> + * > >> + * You should have received a copy of the GNU General Public License along with > >> + * this program; if not, write to the Free Software Foundation, Inc., 51 > >> + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > >> + */ > >> + > >> +#ifndef LTTNG_PIPE_H > >> +#define LTTNG_PIPE_H > >> + > >> +#include > >> + > >> +#define LTTNG_PIPE_IS_READ_OPEN(p) \ > >> + (p->r_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0) > >> +#define LTTNG_PIPE_IS_WRITE_OPEN(p) \ > >> + (p->w_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0) > > > > those two could be static inline. no need for macros. > > With macros I can use CAPS :( ... No problem :P > > Cheers! > David > > > > > Thanks, > > > > Mathieu > > > >> + > >> +enum lttng_pipe_state { > >> + LTTNG_PIPE_STATE_OPENED = 1, > >> + LTTNG_PIPE_STATE_CLOSED = 2, > >> +}; > >> + > >> +struct lttng_pipe { > >> + /* Read: 0, Write: 1. */ > >> + int fd[2]; > >> + /* > >> + * Flags of the pipe once opened. pipe(2) specifies either O_NONBLOCK or > >> + * O_CLOEXEC can be used. Flags are set using fcntl(2) call. > >> + */ > >> + int flags; > >> + > >> + /* > >> + * These states are protected by the operation mutex below. > >> + */ > >> + enum lttng_pipe_state r_state; > >> + enum lttng_pipe_state w_state; > >> + > >> + /* Held for each read(2) operation. */ > >> + pthread_mutex_t read_mutex; > >> + /* Held for each write(2) operation. */ > >> + pthread_mutex_t write_mutex; > >> +}; > >> + > >> +struct lttng_pipe *lttng_pipe_open(int flags); > >> +int lttng_pipe_close(struct lttng_pipe *pipe); > >> +void lttng_pipe_destroy(struct lttng_pipe *pipe); > >> + > >> +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count); > >> +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, > >> + size_t count); > >> + > >> +#endif /* LTTNG_PIPE_H */ > >> -- > >> 1.7.10.4 > >> > >> > >> _______________________________________________ > >> lttng-dev mailing list > >> lttng-dev at lists.lttng.org > >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Fri May 10 14:24:20 2013 From: dgoulet at efficios.com (David Goulet) Date: Fri, 10 May 2013 14:24:20 -0400 Subject: [lttng-dev] [PATCH lttng-tools v2] Add wrappers for pipe Message-ID: <1368210260-20425-1-git-send-email-dgoulet@efficios.com> This is to help use pipes in a way where partial read/write and EINTR are handled in one single call site. Two new files are created, pipe.c/.h which are part of libcommon. The open, close, read_close, write_close, read and write calls are implemented using a custom lttng_pipe data structure and protected by operation's mutex. A destroy function is also available to cleanup memory once done with a pipe. Signed-off-by: David Goulet --- src/common/Makefile.am | 3 +- src/common/pipe.c | 315 ++++++++++++++++++++++++++++++++++++++++++++++++ src/common/pipe.h | 76 ++++++++++++ 3 files changed, 393 insertions(+), 1 deletion(-) create mode 100644 src/common/pipe.c create mode 100644 src/common/pipe.h diff --git a/src/common/Makefile.am b/src/common/Makefile.am index f2ea40a..6ba6c2b 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -13,7 +13,8 @@ noinst_HEADERS = lttng-kernel.h defaults.h macros.h error.h futex.h \ noinst_LTLIBRARIES = libcommon.la libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \ - common.h futex.c futex.h uri.c uri.h defaults.c + common.h futex.c futex.h uri.c uri.h defaults.c \ + pipe.c pipe.h libcommon_la_LIBADD = -luuid # Consumer library diff --git a/src/common/pipe.c b/src/common/pipe.c new file mode 100644 index 0000000..9242a09 --- /dev/null +++ b/src/common/pipe.c @@ -0,0 +1,315 @@ +/* + * Copyright (C) 2013 - David Goulet + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License, version 2 only, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#define _GNU_SOURCE +#include +#include +#include + +#include + +#include "pipe.h" + +/* + * Lock read side of a pipe. + */ +static void lock_read_side(struct lttng_pipe *pipe) +{ + pthread_mutex_lock(&pipe->read_mutex); +} + +/* + * Unlock read side of a pipe. + */ +static void unlock_read_side(struct lttng_pipe *pipe) +{ + pthread_mutex_unlock(&pipe->read_mutex); +} + +/* + * Lock write side of a pipe. + */ +static void lock_write_side(struct lttng_pipe *pipe) +{ + pthread_mutex_lock(&pipe->write_mutex); +} + +/* + * Unlock write side of a pipe. + */ +static void unlock_write_side(struct lttng_pipe *pipe) +{ + pthread_mutex_unlock(&pipe->write_mutex); +} + +/* + * Open a new lttng pipe and set flags using fcntl(). + * + * Return a newly allocated lttng pipe on success or else NULL. + */ +struct lttng_pipe *lttng_pipe_open(int flags) +{ + int ret; + struct lttng_pipe *p; + + p = zmalloc(sizeof(*p)); + if (!p) { + PERROR("zmalloc pipe open"); + goto error; + } + + ret = pipe(p->fd); + if (ret < 0) { + PERROR("lttng pipe"); + goto error; + } + + if (flags) { + int i; + + for (i = 0; i < 2; i++) { + ret = fcntl(p->fd[i], F_SETFD, flags); + if (ret < 0) { + PERROR("fcntl lttng pipe %d", flags); + goto error; + } + } + } + + pthread_mutex_init(&p->read_mutex, NULL); + pthread_mutex_init(&p->write_mutex, NULL); + p->r_state = LTTNG_PIPE_STATE_OPENED; + p->w_state = LTTNG_PIPE_STATE_OPENED; + p->flags = flags; + + return p; + +error: + lttng_pipe_destroy(p); + return NULL; +} + +/* + * Close read side of a lttng pipe. + * + * Return 0 on success else a negative value. + */ +int lttng_pipe_read_close(struct lttng_pipe *pipe) +{ + int ret, ret_val = 0; + + assert(pipe); + + /* Handle read side first. */ + lock_read_side(pipe); + if (lttng_pipe_is_read_open(pipe)) { + do { + ret = close(pipe->fd[0]); + } while (ret < 0 && errno == EINTR); + if (ret < 0) { + PERROR("close lttng read pipe"); + ret_val = -errno; + } + pipe->r_state = LTTNG_PIPE_STATE_CLOSED; + } + unlock_read_side(pipe); + + return ret_val; +} + +/* + * Close write side of a lttng pipe. + * + * Return 0 on success else a negative value. + */ +int lttng_pipe_write_close(struct lttng_pipe *pipe) +{ + int ret, ret_val = 0; + + assert(pipe); + + lock_write_side(pipe); + if (lttng_pipe_is_write_open(pipe)) { + do { + ret = close(pipe->fd[1]); + } while (ret < 0 && errno == EINTR); + if (ret < 0) { + PERROR("close lttng write pipe"); + ret_val = -errno; + } + pipe->w_state = LTTNG_PIPE_STATE_CLOSED; + } + unlock_write_side(pipe); + + return ret_val; +} + +/* + * Close both read and write side of a lttng pipe. + * + * Return 0 on success else a negative value. + */ +int lttng_pipe_close(struct lttng_pipe *pipe) +{ + int ret, ret_val = 0; + + assert(pipe); + + ret = lttng_pipe_read_close(pipe); + if (ret < 0) { + ret_val = ret; + } + + ret = lttng_pipe_write_close(pipe); + if (ret < 0) { + ret_val = ret; + } + + return ret_val; +} + +/* + * Close and destroy a lttng pipe object. Finally, pipe is freed. + */ +void lttng_pipe_destroy(struct lttng_pipe *pipe) +{ + int ret; + + if (!pipe) { + return; + } + + /* Wrong code flow. Destroy should *never* be called with mutex locked. */ + ret = pthread_mutex_trylock(&pipe->read_mutex); + assert(!ret); + ret = pthread_mutex_trylock(&pipe->write_mutex); + assert(!ret); + + /* If pipe is already closed or not opened, this returns gracefully. */ + (void) lttng_pipe_close(pipe); + + (void) pthread_mutex_destroy(&pipe->read_mutex); + (void) pthread_mutex_destroy(&pipe->write_mutex); + free(pipe); +} + +/* + * Read on a lttng pipe and put the data in buf of at least size count. + * + * Return 0 on success or else a negative errno message from read(2). + */ +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count) +{ + ssize_t ret, read_len, read_left, index; + + assert(pipe); + assert(buf); + + lock_read_side(pipe); + + if (!lttng_pipe_is_read_open(pipe)) { + ret = -EBADF; + goto error; + } + + read_left = count; + index = 0; + do { + read_len = read(pipe->fd[0], buf + index, read_left); + if (read_len < 0) { + ret = -errno; + if (errno == EINTR) { + /* Read again. */ + continue; + } else if (errno == EAGAIN || errno == EWOULDBLOCK) { + /* + * Return the number of bytes read up to this point if any. + */ + if (index) { + ret = index; + } + goto error; + } else { + PERROR("lttng pipe read"); + goto error; + } + } + read_left -= read_len; + index += read_len; + } while (read_left > 0); + + /* Everything went fine. */ + ret = index; + +error: + unlock_read_side(pipe); + return ret; +} + +/* + * Write on a lttng pipe using the data in buf and size of count. + * + * Return 0 on success or else a negative errno message from write(2). + */ +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, + size_t count) +{ + ssize_t ret, write_len, write_left, index; + + assert(pipe); + assert(buf); + + lock_write_side(pipe); + + if (!lttng_pipe_is_write_open(pipe)) { + ret = -EBADF; + goto error; + } + + write_left = count; + index = 0; + do { + write_len = write(pipe->fd[1], buf + index, write_left); + if (write_len < 0) { + ret = -errno; + if (errno == EINTR) { + /* Read again. */ + continue; + } else if (errno == EAGAIN || errno == EWOULDBLOCK) { + /* + * Return the number of bytes read up to this point if any. + */ + if (index) { + ret = index; + } + goto error; + } else { + PERROR("lttng pipe write"); + goto error; + } + } + write_left -= write_len; + index += write_len; + } while (write_left > 0); + + /* Everything went fine. */ + ret = index; + +error: + unlock_write_side(pipe); + return ret; +} diff --git a/src/common/pipe.h b/src/common/pipe.h new file mode 100644 index 0000000..acd05d8 --- /dev/null +++ b/src/common/pipe.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2013 - David Goulet + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License, version 2 only, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef LTTNG_PIPE_H +#define LTTNG_PIPE_H + +#include + +enum lttng_pipe_state { + LTTNG_PIPE_STATE_OPENED = 1, + LTTNG_PIPE_STATE_CLOSED = 2, +}; + +struct lttng_pipe { + /* Read: 0, Write: 1. */ + int fd[2]; + /* + * Flags of the pipe once opened. pipe(2) specifies either O_NONBLOCK or + * O_CLOEXEC can be used. Flags are set using fcntl(2) call. + */ + int flags; + + /* + * These states are protected by the operation mutex below. + */ + enum lttng_pipe_state r_state; + enum lttng_pipe_state w_state; + + /* Held for each read(2) operation. */ + pthread_mutex_t read_mutex; + /* Held for each write(2) operation. */ + pthread_mutex_t write_mutex; +}; + +/* + * Return 1 if read side is open else 0. + */ +static inline int lttng_pipe_is_read_open(struct lttng_pipe *pipe) +{ + return pipe->r_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0; +} + +/* + * Return 1 if write side is open else 0. + */ +static inline int lttng_pipe_is_write_open(struct lttng_pipe *pipe) +{ + return pipe->w_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0; +} + +struct lttng_pipe *lttng_pipe_open(int flags); +int lttng_pipe_write_close(struct lttng_pipe *pipe); +int lttng_pipe_read_close(struct lttng_pipe *pipe); +/* Close both side of pipe. */ +int lttng_pipe_close(struct lttng_pipe *pipe); +void lttng_pipe_destroy(struct lttng_pipe *pipe); + +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count); +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, + size_t count); + +#endif /* LTTNG_PIPE_H */ -- 1.7.10.4 From mathieu.desnoyers at efficios.com Sat May 11 10:48:12 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Sat, 11 May 2013 10:48:12 -0400 Subject: [lttng-dev] [PATCH lttng-tools v2] Add wrappers for pipe In-Reply-To: <1368210260-20425-1-git-send-email-dgoulet@efficios.com> References: <1368210260-20425-1-git-send-email-dgoulet@efficios.com> Message-ID: <20130511144812.GB11892@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > This is to help use pipes in a way where partial read/write and EINTR > are handled in one single call site. > > Two new files are created, pipe.c/.h which are part of libcommon. The > open, close, read_close, write_close, read and write calls are > implemented using a custom lttng_pipe data structure and protected by > operation's mutex. A destroy function is also available to cleanup > memory once done with a pipe. > > Signed-off-by: David Goulet > --- > src/common/Makefile.am | 3 +- > src/common/pipe.c | 315 ++++++++++++++++++++++++++++++++++++++++++++++++ > src/common/pipe.h | 76 ++++++++++++ > 3 files changed, 393 insertions(+), 1 deletion(-) > create mode 100644 src/common/pipe.c > create mode 100644 src/common/pipe.h > > diff --git a/src/common/Makefile.am b/src/common/Makefile.am > index f2ea40a..6ba6c2b 100644 > --- a/src/common/Makefile.am > +++ b/src/common/Makefile.am > @@ -13,7 +13,8 @@ noinst_HEADERS = lttng-kernel.h defaults.h macros.h error.h futex.h \ > noinst_LTLIBRARIES = libcommon.la > > libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \ > - common.h futex.c futex.h uri.c uri.h defaults.c > + common.h futex.c futex.h uri.c uri.h defaults.c \ > + pipe.c pipe.h > libcommon_la_LIBADD = -luuid > > # Consumer library > diff --git a/src/common/pipe.c b/src/common/pipe.c > new file mode 100644 > index 0000000..9242a09 > --- /dev/null > +++ b/src/common/pipe.c > @@ -0,0 +1,315 @@ > +/* > + * Copyright (C) 2013 - David Goulet > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License, version 2 only, as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, but WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > + * more details. > + * > + * You should have received a copy of the GNU General Public License along with > + * this program; if not, write to the Free Software Foundation, Inc., 51 > + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +#define _GNU_SOURCE > +#include > +#include > +#include > + > +#include > + > +#include "pipe.h" > + > +/* > + * Lock read side of a pipe. > + */ > +static void lock_read_side(struct lttng_pipe *pipe) > +{ > + pthread_mutex_lock(&pipe->read_mutex); > +} > + > +/* > + * Unlock read side of a pipe. > + */ > +static void unlock_read_side(struct lttng_pipe *pipe) > +{ > + pthread_mutex_unlock(&pipe->read_mutex); > +} > + > +/* > + * Lock write side of a pipe. > + */ > +static void lock_write_side(struct lttng_pipe *pipe) > +{ > + pthread_mutex_lock(&pipe->write_mutex); > +} > + > +/* > + * Unlock write side of a pipe. > + */ > +static void unlock_write_side(struct lttng_pipe *pipe) > +{ > + pthread_mutex_unlock(&pipe->write_mutex); > +} > + > +/* > + * Open a new lttng pipe and set flags using fcntl(). > + * > + * Return a newly allocated lttng pipe on success or else NULL. > + */ > +struct lttng_pipe *lttng_pipe_open(int flags) > +{ > + int ret; > + struct lttng_pipe *p; > + > + p = zmalloc(sizeof(*p)); > + if (!p) { > + PERROR("zmalloc pipe open"); > + goto error; > + } > + > + ret = pipe(p->fd); > + if (ret < 0) { > + PERROR("lttng pipe"); > + goto error; > + } > + > + if (flags) { > + int i; > + > + for (i = 0; i < 2; i++) { > + ret = fcntl(p->fd[i], F_SETFD, flags); > + if (ret < 0) { > + PERROR("fcntl lttng pipe %d", flags); > + goto error; > + } > + } > + } > + > + pthread_mutex_init(&p->read_mutex, NULL); > + pthread_mutex_init(&p->write_mutex, NULL); > + p->r_state = LTTNG_PIPE_STATE_OPENED; > + p->w_state = LTTNG_PIPE_STATE_OPENED; > + p->flags = flags; > + > + return p; > + > +error: > + lttng_pipe_destroy(p); > + return NULL; > +} > + > +/* > + * Close read side of a lttng pipe. > + * > + * Return 0 on success else a negative value. > + */ > +int lttng_pipe_read_close(struct lttng_pipe *pipe) > +{ > + int ret, ret_val = 0; > + > + assert(pipe); > + > + /* Handle read side first. */ > + lock_read_side(pipe); > + if (lttng_pipe_is_read_open(pipe)) { > + do { > + ret = close(pipe->fd[0]); > + } while (ret < 0 && errno == EINTR); > + if (ret < 0) { > + PERROR("close lttng read pipe"); > + ret_val = -errno; > + } > + pipe->r_state = LTTNG_PIPE_STATE_CLOSED; > + } > + unlock_read_side(pipe); > + > + return ret_val; > +} > + > +/* > + * Close write side of a lttng pipe. > + * > + * Return 0 on success else a negative value. > + */ > +int lttng_pipe_write_close(struct lttng_pipe *pipe) > +{ > + int ret, ret_val = 0; > + > + assert(pipe); > + > + lock_write_side(pipe); > + if (lttng_pipe_is_write_open(pipe)) { > + do { > + ret = close(pipe->fd[1]); > + } while (ret < 0 && errno == EINTR); > + if (ret < 0) { > + PERROR("close lttng write pipe"); > + ret_val = -errno; > + } > + pipe->w_state = LTTNG_PIPE_STATE_CLOSED; > + } > + unlock_write_side(pipe); > + > + return ret_val; > +} > + > +/* > + * Close both read and write side of a lttng pipe. > + * > + * Return 0 on success else a negative value. > + */ > +int lttng_pipe_close(struct lttng_pipe *pipe) > +{ > + int ret, ret_val = 0; > + > + assert(pipe); > + > + ret = lttng_pipe_read_close(pipe); > + if (ret < 0) { > + ret_val = ret; > + } > + > + ret = lttng_pipe_write_close(pipe); > + if (ret < 0) { > + ret_val = ret; > + } > + > + return ret_val; > +} > + > +/* > + * Close and destroy a lttng pipe object. Finally, pipe is freed. > + */ > +void lttng_pipe_destroy(struct lttng_pipe *pipe) > +{ > + int ret; > + > + if (!pipe) { > + return; > + } > + > + /* Wrong code flow. Destroy should *never* be called with mutex locked. */ > + ret = pthread_mutex_trylock(&pipe->read_mutex); > + assert(!ret); > + ret = pthread_mutex_trylock(&pipe->write_mutex); > + assert(!ret); the issue here is that you trylock, then succeed, and then take the locks again within close, thus deadlocking. The rest looks good, thanks! Mathieu > + > + /* If pipe is already closed or not opened, this returns gracefully. */ > + (void) lttng_pipe_close(pipe); > + > + (void) pthread_mutex_destroy(&pipe->read_mutex); > + (void) pthread_mutex_destroy(&pipe->write_mutex); > + free(pipe); > +} > + > +/* > + * Read on a lttng pipe and put the data in buf of at least size count. > + * > + * Return 0 on success or else a negative errno message from read(2). > + */ > +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count) > +{ > + ssize_t ret, read_len, read_left, index; > + > + assert(pipe); > + assert(buf); > + > + lock_read_side(pipe); > + > + if (!lttng_pipe_is_read_open(pipe)) { > + ret = -EBADF; > + goto error; > + } > + > + read_left = count; > + index = 0; > + do { > + read_len = read(pipe->fd[0], buf + index, read_left); > + if (read_len < 0) { > + ret = -errno; > + if (errno == EINTR) { > + /* Read again. */ > + continue; > + } else if (errno == EAGAIN || errno == EWOULDBLOCK) { > + /* > + * Return the number of bytes read up to this point if any. > + */ > + if (index) { > + ret = index; > + } > + goto error; > + } else { > + PERROR("lttng pipe read"); > + goto error; > + } > + } > + read_left -= read_len; > + index += read_len; > + } while (read_left > 0); > + > + /* Everything went fine. */ > + ret = index; > + > +error: > + unlock_read_side(pipe); > + return ret; > +} > + > +/* > + * Write on a lttng pipe using the data in buf and size of count. > + * > + * Return 0 on success or else a negative errno message from write(2). > + */ > +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, > + size_t count) > +{ > + ssize_t ret, write_len, write_left, index; > + > + assert(pipe); > + assert(buf); > + > + lock_write_side(pipe); > + > + if (!lttng_pipe_is_write_open(pipe)) { > + ret = -EBADF; > + goto error; > + } > + > + write_left = count; > + index = 0; > + do { > + write_len = write(pipe->fd[1], buf + index, write_left); > + if (write_len < 0) { > + ret = -errno; > + if (errno == EINTR) { > + /* Read again. */ > + continue; > + } else if (errno == EAGAIN || errno == EWOULDBLOCK) { > + /* > + * Return the number of bytes read up to this point if any. > + */ > + if (index) { > + ret = index; > + } > + goto error; > + } else { > + PERROR("lttng pipe write"); > + goto error; > + } > + } > + write_left -= write_len; > + index += write_len; > + } while (write_left > 0); > + > + /* Everything went fine. */ > + ret = index; > + > +error: > + unlock_write_side(pipe); > + return ret; > +} > diff --git a/src/common/pipe.h b/src/common/pipe.h > new file mode 100644 > index 0000000..acd05d8 > --- /dev/null > +++ b/src/common/pipe.h > @@ -0,0 +1,76 @@ > +/* > + * Copyright (C) 2013 - David Goulet > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License, version 2 only, as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, but WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > + * more details. > + * > + * You should have received a copy of the GNU General Public License along with > + * this program; if not, write to the Free Software Foundation, Inc., 51 > + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +#ifndef LTTNG_PIPE_H > +#define LTTNG_PIPE_H > + > +#include > + > +enum lttng_pipe_state { > + LTTNG_PIPE_STATE_OPENED = 1, > + LTTNG_PIPE_STATE_CLOSED = 2, > +}; > + > +struct lttng_pipe { > + /* Read: 0, Write: 1. */ > + int fd[2]; > + /* > + * Flags of the pipe once opened. pipe(2) specifies either O_NONBLOCK or > + * O_CLOEXEC can be used. Flags are set using fcntl(2) call. > + */ > + int flags; > + > + /* > + * These states are protected by the operation mutex below. > + */ > + enum lttng_pipe_state r_state; > + enum lttng_pipe_state w_state; > + > + /* Held for each read(2) operation. */ > + pthread_mutex_t read_mutex; > + /* Held for each write(2) operation. */ > + pthread_mutex_t write_mutex; > +}; > + > +/* > + * Return 1 if read side is open else 0. > + */ > +static inline int lttng_pipe_is_read_open(struct lttng_pipe *pipe) > +{ > + return pipe->r_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0; > +} > + > +/* > + * Return 1 if write side is open else 0. > + */ > +static inline int lttng_pipe_is_write_open(struct lttng_pipe *pipe) > +{ > + return pipe->w_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0; > +} > + > +struct lttng_pipe *lttng_pipe_open(int flags); > +int lttng_pipe_write_close(struct lttng_pipe *pipe); > +int lttng_pipe_read_close(struct lttng_pipe *pipe); > +/* Close both side of pipe. */ > +int lttng_pipe_close(struct lttng_pipe *pipe); > +void lttng_pipe_destroy(struct lttng_pipe *pipe); > + > +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count); > +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, > + size_t count); > + > +#endif /* LTTNG_PIPE_H */ > -- > 1.7.10.4 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From francis.giraldeau at gmail.com Sat May 11 20:25:33 2013 From: francis.giraldeau at gmail.com (Francis Giraldeau) Date: Sat, 11 May 2013 20:25:33 -0400 Subject: [lttng-dev] [PATCH] Fix linker library order Message-ID: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> Libraries must be specified after the binary target. Signed-off-by: Francis Giraldeau --- doc/examples/demo/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile index 7ae6547..bbc8ccb 100644 --- a/doc/examples/demo/Makefile +++ b/doc/examples/demo/Makefile @@ -55,7 +55,7 @@ demo.o: demo.c $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< demo: demo.o - $(CC) -o $@ $(LIBS) $^ + $(CC) -o $@ $^ $(LIBS) .PHONY: clean clean: -- 1.8.1.2 From francis.giraldeau at gmail.com Sat May 11 20:31:52 2013 From: francis.giraldeau at gmail.com (Francis Giraldeau) Date: Sat, 11 May 2013 20:31:52 -0400 Subject: [lttng-dev] [PATCH] Fix typo in run script Message-ID: <1368318712-31852-1-git-send-email-francis.giraldeau@gmail.com> The actual library is liblttng-ust-libc-wrapper.so Signed-off-by: Francis Giraldeau --- liblttng-ust-libc-wrapper/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liblttng-ust-libc-wrapper/run b/liblttng-ust-libc-wrapper/run index 2583d23..80d4175 100755 --- a/liblttng-ust-libc-wrapper/run +++ b/liblttng-ust-libc-wrapper/run @@ -1,3 +1,3 @@ #!/bin/sh -LD_VERBOSE=1 LD_PRELOAD=.libs/liblttng-ust-libc.so ${*} +LD_VERBOSE=1 LD_PRELOAD=.libs/liblttng-ust-libc-wrapper.so ${*} -- 1.8.1.2 From francis.giraldeau at gmail.com Sat May 11 20:44:39 2013 From: francis.giraldeau at gmail.com (Francis Giraldeau) Date: Sat, 11 May 2013 20:44:39 -0400 Subject: [lttng-dev] [PATCH] Fix (another) linker library order Message-ID: <1368319479-7433-1-git-send-email-francis.giraldeau@gmail.com> Libraries must be specified after the binary target. Signed-off-by: Francis Giraldeau --- doc/examples/hello-static-lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/hello-static-lib/Makefile b/doc/examples/hello-static-lib/Makefile index a5bf2df..dd246f7 100644 --- a/doc/examples/hello-static-lib/Makefile +++ b/doc/examples/hello-static-lib/Makefile @@ -46,7 +46,7 @@ hello.o: hello.c $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< hello: hello.o lttng-ust-provider-hello.a - $(CC) -o $@ $(LDFLAGS) $(LIBS) $^ + $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) .PHONY: clean clean: -- 1.8.1.2 From francis.giraldeau at gmail.com Sat May 11 21:10:49 2013 From: francis.giraldeau at gmail.com (Francis Giraldeau) Date: Sat, 11 May 2013 21:10:49 -0400 Subject: [lttng-dev] UST context causes empty trace Message-ID: <518EEC19.6080504@gmail.com> With 2.2.0-rc2, when enabling some context for UST, the generated trace is empty. Here is a small script to reproduce the problem: $ cat do.sh lttng create lttng enable-channel u -u lttng enable-event -c u -a -u lttng add-context -c u -u -t vpid -t vtid lttng start $@ lttng stop lttng view lttng destroy When commenting out the "add-context" command, then the trace is generated correctly. Does someone else is able to confirm the problem? Thanks, Francis Giraldeau -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4489 bytes Desc: Signature cryptographique S/MIME URL: From mathieu.desnoyers at efficios.com Sat May 11 22:59:17 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Sat, 11 May 2013 22:59:17 -0400 Subject: [lttng-dev] [PATCH] Fix linker library order In-Reply-To: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> References: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> Message-ID: <20130512025917.GB405@Krystal> * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: > Libraries must be specified after the binary target. merged, thanks! Mathieu > > Signed-off-by: Francis Giraldeau > --- > doc/examples/demo/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile > index 7ae6547..bbc8ccb 100644 > --- a/doc/examples/demo/Makefile > +++ b/doc/examples/demo/Makefile > @@ -55,7 +55,7 @@ demo.o: demo.c > $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > > demo: demo.o > - $(CC) -o $@ $(LIBS) $^ > + $(CC) -o $@ $^ $(LIBS) > > .PHONY: clean > clean: > -- > 1.8.1.2 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Sat May 11 22:59:54 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Sat, 11 May 2013 22:59:54 -0400 Subject: [lttng-dev] [PATCH] Fix typo in run script In-Reply-To: <1368318712-31852-1-git-send-email-francis.giraldeau@gmail.com> References: <1368318712-31852-1-git-send-email-francis.giraldeau@gmail.com> Message-ID: <20130512025954.GC405@Krystal> * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: > The actual library is liblttng-ust-libc-wrapper.so merged, thanks! Mathieu > > Signed-off-by: Francis Giraldeau > --- > liblttng-ust-libc-wrapper/run | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/liblttng-ust-libc-wrapper/run b/liblttng-ust-libc-wrapper/run > index 2583d23..80d4175 100755 > --- a/liblttng-ust-libc-wrapper/run > +++ b/liblttng-ust-libc-wrapper/run > @@ -1,3 +1,3 @@ > #!/bin/sh > > -LD_VERBOSE=1 LD_PRELOAD=.libs/liblttng-ust-libc.so ${*} > +LD_VERBOSE=1 LD_PRELOAD=.libs/liblttng-ust-libc-wrapper.so ${*} > -- > 1.8.1.2 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Sat May 11 23:00:25 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Sat, 11 May 2013 23:00:25 -0400 Subject: [lttng-dev] [PATCH] Fix (another) linker library order In-Reply-To: <1368319479-7433-1-git-send-email-francis.giraldeau@gmail.com> References: <1368319479-7433-1-git-send-email-francis.giraldeau@gmail.com> Message-ID: <20130512030024.GD405@Krystal> * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: > Libraries must be specified after the binary target. merged, thanks, Mathieu > > Signed-off-by: Francis Giraldeau > --- > doc/examples/hello-static-lib/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/doc/examples/hello-static-lib/Makefile b/doc/examples/hello-static-lib/Makefile > index a5bf2df..dd246f7 100644 > --- a/doc/examples/hello-static-lib/Makefile > +++ b/doc/examples/hello-static-lib/Makefile > @@ -46,7 +46,7 @@ hello.o: hello.c > $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > > hello: hello.o lttng-ust-provider-hello.a > - $(CC) -o $@ $(LDFLAGS) $(LIBS) $^ > + $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) > > .PHONY: clean > clean: > -- > 1.8.1.2 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Sat May 11 23:08:02 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Sat, 11 May 2013 23:08:02 -0400 Subject: [lttng-dev] UST context causes empty trace In-Reply-To: <518EEC19.6080504@gmail.com> References: <518EEC19.6080504@gmail.com> Message-ID: <20130512030802.GE405@Krystal> Yes, it's broken here too. Can you open a bug report against UST please? it looks like those are missing when we enable UST contexts: libust[26034/26049]: Sent register channel notification: chan_id 0, header_type 1 (in ustcomm_register_channel() at lttng-ust-comm.c:1053) [...] libust[26034/26034]: Sent register event notification for name "ust_tests_hello:tptest": ret_code 0, event_id 0 (in ustcomm_register_event() at lttng-ust-comm.c:948) libust[26034/26034]: Sent register event notification for name "ust_tests_hello:tptest_sighandler": ret_code 0, event_id 1 (in ustcomm_register_event() at lttng-ust-comm.c:948) (I get those in a run where I don't enable any UST context, but not in the problematic case) the rest seems to be there when launching the app with LTTNG_UST_DEBUG=1 env var set. So it looks like an issue within UST. Thanks, Mathieu * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: > With 2.2.0-rc2, when enabling some context for UST, the generated trace > is empty. Here is a small script to reproduce the problem: > > $ cat do.sh > lttng create > lttng enable-channel u -u > lttng enable-event -c u -a -u > lttng add-context -c u -u -t vpid -t vtid > lttng start > $@ > lttng stop > lttng view > lttng destroy > > When commenting out the "add-context" command, then the trace is > generated correctly. Does someone else is able to confirm the problem? > > Thanks, > > Francis Giraldeau > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From soariez at gmail.com Sun May 12 05:27:29 2013 From: soariez at gmail.com (Zifei Tong) Date: Sun, 12 May 2013 17:27:29 +0800 Subject: [lttng-dev] UST context causes empty trace In-Reply-To: <20130512030802.GE405@Krystal> References: <518EEC19.6080504@gmail.com> <20130512030802.GE405@Krystal> Message-ID: Hi, I did some debugging one this issue. The problem only occurs when we have more than one context field. So this will not work, too: lttng create lttng enable-event -a -u lttng add-context -u -t vpid lttng add-context -u -t vtid lttng start $@ lttng stop sleep 1 lttng view lttng destroy The problem I found out is wrong `fields` argument passed into `ustcomm_register_channel`. The `fields` argument passed is a pointer to the `event_field` of the first element in a `lttng_ctx_field` array, but not a `lttng_event_field` array as expected. Please see the patch for more details. The patch works on my machine. But I wonder if there is something wrong or maybe a better fix. Please review. Thanks, Zifei Tong Signed-off-by: Zifei Tong --- liblttng-ust/lttng-events.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index e4faf60..7afe13f 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -260,9 +260,10 @@ int lttng_session_enable(struct lttng_session *session) */ cds_list_for_each_entry(chan, &session->chan_head, node) { const struct lttng_ctx *ctx; - const struct lttng_event_field *fields = NULL; + struct lttng_event_field *fields = NULL; size_t nr_fields = 0; uint32_t chan_id; + int i; /* don't change it if session stop/restart */ if (chan->header_type) @@ -270,7 +271,9 @@ int lttng_session_enable(struct lttng_session *session) ctx = chan->ctx; if (ctx) { nr_fields = ctx->nr_fields; - fields = &ctx->fields->event_field; + fields = malloc(nr_fields * sizeof(struct lttng_event_field)); + for (i = 0; i < nr_fields; i++) + fields[i] = ctx->fields[i].event_field; } ret = ustcomm_register_channel(notify_socket, session->objd, @@ -279,6 +282,8 @@ int lttng_session_enable(struct lttng_session *session) fields, &chan_id, &chan->header_type); + if (fields != NULL) + free(fields); if (ret) { DBG("Error (%d) registering channel to sessiond", ret); return ret; -- 1.8.2.2 On 5/12/13, Mathieu Desnoyers wrote: > Yes, it's broken here too. Can you open a bug report against UST please? > > it looks like those are missing when we enable UST contexts: > > libust[26034/26049]: Sent register channel notification: chan_id 0, > header_type 1 > (in ustcomm_register_channel() at lttng-ust-comm.c:1053) > [...] > libust[26034/26034]: Sent register event notification for name > "ust_tests_hello:tptest": ret_code 0, event_id 0 > (in ustcomm_register_event() at lttng-ust-comm.c:948) > libust[26034/26034]: Sent register event notification for name > "ust_tests_hello:tptest_sighandler": ret_code 0, event_id 1 > (in ustcomm_register_event() at lttng-ust-comm.c:948) > > (I get those in a run where I don't enable any UST context, but not in > the problematic case) > > the rest seems to be there when launching the app with LTTNG_UST_DEBUG=1 > env var set. So it looks like an issue within UST. > > Thanks, > > Mathieu > > * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: >> With 2.2.0-rc2, when enabling some context for UST, the generated trace >> is empty. Here is a small script to reproduce the problem: >> >> $ cat do.sh >> lttng create >> lttng enable-channel u -u >> lttng enable-event -c u -a -u >> lttng add-context -c u -u -t vpid -t vtid >> lttng start >> $@ >> lttng stop >> lttng view >> lttng destroy >> >> When commenting out the "add-context" command, then the trace is >> generated correctly. Does someone else is able to confirm the problem? >> >> Thanks, >> >> Francis Giraldeau >> > > > >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > -- -- Best Regards, ??? (Zifei Tong) College of Computer Science and Technology, Zhejiang University soariez at gmail.com / tongzifei at zju.edu.cn From francis.giraldeau at gmail.com Sun May 12 11:00:09 2013 From: francis.giraldeau at gmail.com (Francis Giraldeau) Date: Sun, 12 May 2013 11:00:09 -0400 Subject: [lttng-dev] UST context causes empty trace In-Reply-To: References: <518EEC19.6080504@gmail.com> <20130512030802.GE405@Krystal> Message-ID: <518FAE79.1010009@gmail.com> I confirm that this patch solved the problem. Thanks! Francis Le 2013-05-12 05:27, Zifei Tong a ?crit : > Hi, > > I did some debugging one this issue. The problem only occurs when we > have more than one context field. > So this will not work, too: > > lttng create > lttng enable-event -a -u > lttng add-context -u -t vpid > lttng add-context -u -t vtid > lttng start > $@ > lttng stop > sleep 1 > lttng view > lttng destroy > > The problem I found out is wrong `fields` argument passed into > `ustcomm_register_channel`. > The `fields` argument passed is a pointer to the `event_field` of the > first element in a `lttng_ctx_field` array, > but not a `lttng_event_field` array as expected. > > Please see the patch for more details. > > The patch works on my machine. But I wonder if there is something > wrong or maybe a better fix. > Please review. > > Thanks, > > Zifei Tong > > Signed-off-by: Zifei Tong > --- > liblttng-ust/lttng-events.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c > index e4faf60..7afe13f 100644 > --- a/liblttng-ust/lttng-events.c > +++ b/liblttng-ust/lttng-events.c > @@ -260,9 +260,10 @@ int lttng_session_enable(struct lttng_session *session) > */ > cds_list_for_each_entry(chan, &session->chan_head, node) { > const struct lttng_ctx *ctx; > - const struct lttng_event_field *fields = NULL; > + struct lttng_event_field *fields = NULL; > size_t nr_fields = 0; > uint32_t chan_id; > + int i; > > /* don't change it if session stop/restart */ > if (chan->header_type) > @@ -270,7 +271,9 @@ int lttng_session_enable(struct lttng_session *session) > ctx = chan->ctx; > if (ctx) { > nr_fields = ctx->nr_fields; > - fields = &ctx->fields->event_field; > + fields = malloc(nr_fields * sizeof(struct lttng_event_field)); > + for (i = 0; i < nr_fields; i++) > + fields[i] = ctx->fields[i].event_field; > } > ret = ustcomm_register_channel(notify_socket, > session->objd, > @@ -279,6 +282,8 @@ int lttng_session_enable(struct lttng_session *session) > fields, > &chan_id, > &chan->header_type); > + if (fields != NULL) > + free(fields); > if (ret) { > DBG("Error (%d) registering channel to sessiond", ret); > return ret; -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4489 bytes Desc: Signature cryptographique S/MIME URL: From AMITM at il.ibm.com Mon May 13 02:40:53 2013 From: AMITM at il.ibm.com (Amit Margalit) Date: Mon, 13 May 2013 09:40:53 +0300 Subject: [lttng-dev] Is there a way to make LTTng use the same subbuffers for multiple processes? In-Reply-To: <20130510145032.GG20313@Krystal> References: <1871619348.1882721367199149384.JavaMail.root@srv11.zimbra.polymtl.ca> <20130429162752.GB17859@Krystal> <20130510145032.GG20313@Krystal> Message-ID: Security trumps most things, IMHO, so for me this is (one of the few) valid reasons to change backward compatibility. An environment variable is a good solution to allow controlling this. Thank you. Amit Margalit IBM XIV - Storage Reinvented XIV-NAS Development Team Tel. 03-689-7774 Fax. 03-689-7230 From: Mathieu Desnoyers To: Amit Margalit/Israel/IBM at IBMIL Cc: lttng-dev at lists.lttng.org, Michel Dagenais Date: 05/10/2013 05:50 PM Subject: Re: [lttng-dev] Is there a way to make LTTng use the same subbuffers for multiple processes? I expect we could let an environment variable control this. I would be tempted to make the default behavior switch to the new user ID buffers in the future though, for security reasons. Thoughts ? Thanks, Mathieu * Amit Margalit (AMITM at il.ibm.com) wrote: > This (current) behavior you describe is very suitable for our needs. > > Is there an intention to insert a hook into setuid() in the future? > If yes - will the existing behavior remain as a default and the hook be > used only if I choose to use it? > > Thanks, > > Amit Margalit > IBM XIV - Storage Reinvented > XIV-NAS Development Team > Tel. 03-689-7774 > Fax. 03-689-7230 > > > > From: Mathieu Desnoyers > To: Amit Margalit/Israel/IBM at IBMIL > Cc: Michel Dagenais , > lttng-dev at lists.lttng.org > Date: 04/29/2013 07:27 PM > Subject: Re: [lttng-dev] Is there a way to make LTTng use the same > subbuffers for multiple processes? > > > > * Amit Margalit (AMITM at il.ibm.com) wrote: > > Another 2.2 question - > > > > What if I have a single process, that forks, and each child process then > > > changes its own UID. Will the tracing continue on the parent UID > buffers? > > Yes, we indeed currently keep the user ID that was effective at process > creation or last exec() encountered, because we don't have hooks in > libc's setuid() at the moment. > > Thanks, > > Mathieu > > > > > Thanks, > > > > Amit Margalit > > IBM XIV - Storage Reinvented > > XIV-NAS Development Team > > Tel. 03-689-7774 > > Fax. 03-689-7230 > > > > > > > > From: Michel Dagenais > > To: Amit Margalit/Israel/IBM at IBMIL > > Cc: lttng-dev at lists.lttng.org > > Date: 04/29/2013 04:32 AM > > Subject: Re: [lttng-dev] Is there a way to make LTTng use the > same > > subbuffers for multiple processes? > > > > > > > > > > > Our system is a 12-core x86 (6-core + HT). If I take 4 subbuffers of > > 1MB, this means 4MB per > > > process. As the number of processes rises, this becomes prohibitive. > > > For example, we may need to support > 500 sub-processes ==> 500 * 4MB > = > > 2GB - > > > which is a bit too much. Is there a way to tell LTTng to share the > > sub-buffers with forked processes? > > > > This is the number one feature listed in the changelog for lttng-tools > and > > UST for version 2.2. The first release candidate is out so you can try > the > > feature, and the final 2.2 version should not be too far away. > > > > http://lttng.org/lttng-tools-220-rc1 > > - Add UST per UID buffers support > > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From liljegren.mats2 at gmail.com Mon May 13 03:29:49 2013 From: liljegren.mats2 at gmail.com (Mats Liljegren) Date: Mon, 13 May 2013 09:29:49 +0200 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: <20130510145620.GH20313@Krystal> References: <20130426151444.GA2260@Krystal> <20130426153819.GA3026@Krystal> <20130426161439.GA5547@Krystal> <20130430144323.GB31980@Krystal> <20130510145620.GH20313@Krystal> Message-ID: On Fri, May 10, 2013 at 4:56 PM, Mathieu Desnoyers wrote: > * Mats Liljegren (liljegren.mats2 at gmail.com) wrote: >> >> --buffers-global Use shared buffer for the whole system (-k only) >> > >> > This option would be clearer as "--buffers-per-cpu" maybe ? >> >> This makes me even more confused... The name "buffers-global" is very >> clear to me. Opposites would be buffers private for a CPU, for a UID, >> and so on. Is the option "--buffers-global" meant to be an opposite of >> "--buffers-uid" and "--buffers-pid"? This would seems strange since >> those two are only for user space tracing while "--buffers-global" is >> for kernel tracing. By the way, isn't "--buffers-per-cpu" default? Oh >> well... > > Currently, we have: > > kernel tracing: --buffers-global (those are per-cpu buffers) > > ust tracing: --buffers-pid, --buffers-uid (those are also per-cpu buffers) > > We currently don't implement "single buffer" shared across all CPUs. > > By the way, the fact that e.g. --buffers-global is only available for > kernel tracing today does not mean it will never be available for ust in > future versions. So for data buffers, you can have them per pid & cpu, per uid and cpu or only per cpu where the last option is the only option for kernel tracing. This was then according to my first belief then, it was the help text of the lttng command that made me believe otherwise. Then I'd vote for renaming --buffers-global to --buffers-per-cpu, which apparently is not only default but also the only available option for kernel tracing. If I've understood things correctly, there are plans for offering per-cpu buffers when tracing user space as well, which then would be the reason for keeping the option. >> >> But the real confusion lies in the fact that I cannot see the option >> being used for anything. It sets the file local variable >> opt_buffers_global, and is used for a sanity check. But I can't see it >> being used for anything else. Have I missed something here? > > David ? > > the "lttng" command passes it to liblttng-ctl, which asks lttng-sessiond > to allocate the buffer. Then, buffer allocation is handled by either > sessiond or consumerd (depending if kernel or ust tracing), using either > the lttng-modules ABI or liblttng-ust-ctl. This is where the allocation > really happens. Thanks for the info. I'll take a deep dive into the design and see if I can make a more intelligent modification. When thinking about it, it might be possible to keep things per-cpu-ish, since I have no need for inter-cpu support when writing. It is only the flushing that needs to be done on another CPU. Not sure what that means yet since I haven't dived into the design yet. /Mats From anna.dushistova at gmail.com Mon May 13 02:16:04 2013 From: anna.dushistova at gmail.com (Anna Dushistova) Date: Mon, 13 May 2013 10:16:04 +0400 Subject: [lttng-dev] [RFC PATCH 0/2] babeltrace legacy LTT 2.6 converter Message-ID: Hi Jan, I tried out your patch for the 2.6->ctf converter( http://lists.lttng.org/pipermail/lttng-dev/2013-April/020081.html) with the following trace: https://github.com/fchouinard/LTTng/blob/master/samples/trace-2.6-22K.tar.gz from http://wiki.eclipse.org/Linux_Tools_Project/LTTng/User_Guide#Downloading_Sample_Tracesand it crashed with segmentation fault. Anna. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.desnoyers at efficios.com Mon May 13 06:06:45 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 13 May 2013 06:06:45 -0400 Subject: [lttng-dev] UST context causes empty trace In-Reply-To: References: <518EEC19.6080504@gmail.com> <20130512030802.GE405@Krystal> Message-ID: <20130513100645.GA13173@Krystal> Fixed by: commit 83e43212040a26aca40a4f8fefaa3682e9edaa57 Author: Mathieu Desnoyers Date: Mon May 13 06:02:55 2013 -0400 Fix: incorrect support for multi-context * Zifei Tong wrote: > I did some debugging one this issue. The problem only occurs when we > have more than one context field. > So this will not work, too: > > lttng create > lttng enable-event -a -u > lttng add-context -u -t vpid > lttng add-context -u -t vtid > lttng start > $@ > lttng stop > sleep 1 > lttng view > lttng destroy > > The problem I found out is wrong `fields` argument passed into > `ustcomm_register_channel`. > The `fields` argument passed is a pointer to the `event_field` of the > first element in a `lttng_ctx_field` array, but not a > `lttng_event_field` array as expected. Fixes #529 Reported-by: Francis Giraldeau Signed-off-by: Mathieu Desnoyers Thanks! Mathieu * Zifei Tong (soariez at gmail.com) wrote: > Hi, > > I did some debugging one this issue. The problem only occurs when we > have more than one context field. > So this will not work, too: > > lttng create > lttng enable-event -a -u > lttng add-context -u -t vpid > lttng add-context -u -t vtid > lttng start > $@ > lttng stop > sleep 1 > lttng view > lttng destroy > > The problem I found out is wrong `fields` argument passed into > `ustcomm_register_channel`. > The `fields` argument passed is a pointer to the `event_field` of the > first element in a `lttng_ctx_field` array, > but not a `lttng_event_field` array as expected. > > Please see the patch for more details. > > The patch works on my machine. But I wonder if there is something > wrong or maybe a better fix. > Please review. > > Thanks, > > Zifei Tong > > Signed-off-by: Zifei Tong > --- > liblttng-ust/lttng-events.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c > index e4faf60..7afe13f 100644 > --- a/liblttng-ust/lttng-events.c > +++ b/liblttng-ust/lttng-events.c > @@ -260,9 +260,10 @@ int lttng_session_enable(struct lttng_session *session) > */ > cds_list_for_each_entry(chan, &session->chan_head, node) { > const struct lttng_ctx *ctx; > - const struct lttng_event_field *fields = NULL; > + struct lttng_event_field *fields = NULL; > size_t nr_fields = 0; > uint32_t chan_id; > + int i; > > /* don't change it if session stop/restart */ > if (chan->header_type) > @@ -270,7 +271,9 @@ int lttng_session_enable(struct lttng_session *session) > ctx = chan->ctx; > if (ctx) { > nr_fields = ctx->nr_fields; > - fields = &ctx->fields->event_field; > + fields = malloc(nr_fields * sizeof(struct lttng_event_field)); > + for (i = 0; i < nr_fields; i++) > + fields[i] = ctx->fields[i].event_field; > } > ret = ustcomm_register_channel(notify_socket, > session->objd, > @@ -279,6 +282,8 @@ int lttng_session_enable(struct lttng_session *session) > fields, > &chan_id, > &chan->header_type); > + if (fields != NULL) > + free(fields); > if (ret) { > DBG("Error (%d) registering channel to sessiond", ret); > return ret; > -- > 1.8.2.2 > > On 5/12/13, Mathieu Desnoyers wrote: > > Yes, it's broken here too. Can you open a bug report against UST please? > > > > it looks like those are missing when we enable UST contexts: > > > > libust[26034/26049]: Sent register channel notification: chan_id 0, > > header_type 1 > > (in ustcomm_register_channel() at lttng-ust-comm.c:1053) > > [...] > > libust[26034/26034]: Sent register event notification for name > > "ust_tests_hello:tptest": ret_code 0, event_id 0 > > (in ustcomm_register_event() at lttng-ust-comm.c:948) > > libust[26034/26034]: Sent register event notification for name > > "ust_tests_hello:tptest_sighandler": ret_code 0, event_id 1 > > (in ustcomm_register_event() at lttng-ust-comm.c:948) > > > > (I get those in a run where I don't enable any UST context, but not in > > the problematic case) > > > > the rest seems to be there when launching the app with LTTNG_UST_DEBUG=1 > > env var set. So it looks like an issue within UST. > > > > Thanks, > > > > Mathieu > > > > * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: > >> With 2.2.0-rc2, when enabling some context for UST, the generated trace > >> is empty. Here is a small script to reproduce the problem: > >> > >> $ cat do.sh > >> lttng create > >> lttng enable-channel u -u > >> lttng enable-event -c u -a -u > >> lttng add-context -c u -u -t vpid -t vtid > >> lttng start > >> $@ > >> lttng stop > >> lttng view > >> lttng destroy > >> > >> When commenting out the "add-context" command, then the trace is > >> generated correctly. Does someone else is able to confirm the problem? > >> > >> Thanks, > >> > >> Francis Giraldeau > >> > > > > > > > >> _______________________________________________ > >> lttng-dev mailing list > >> lttng-dev at lists.lttng.org > >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > > > -- > > Mathieu Desnoyers > > EfficiOS Inc. > > http://www.efficios.com > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > > -- > -- > Best Regards, > ??? (Zifei Tong) > College of Computer Science and Technology, Zhejiang University > > soariez at gmail.com / tongzifei at zju.edu.cn -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jan.glauber at gmail.com Mon May 13 06:40:53 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Mon, 13 May 2013 12:40:53 +0200 Subject: [lttng-dev] [RFC PATCH 0/2] babeltrace legacy LTT 2.6 converter In-Reply-To: References: Message-ID: <20130513104051.GA2802@hal> On Mon, May 13, 2013 at 10:16:04AM +0400, Anna Dushistova wrote: > Hi Jan, > > I tried out your patch for the 2.6->ctf converter( > http://lists.lttng.org/pipermail/lttng-dev/2013-April/020081.html) > with the following trace: > https://github.com/fchouinard/LTTng/blob/master/samples/trace-2.6-22K.tar.gz > > from > http://wiki.eclipse.org/Linux_Tools_Project/LTTng/User_Guide#Downloading_Sample_Tracesand > it crashed > with segmentation fault. Hi Anna, could it be that the tar file itself is in the trace directory when you run babeltrace-legacy? I think I've only implemented rudimentary file checking, so the legacy converter assumes all files in the directory belong to the trace. Please try removing any files that do not belong to the trace. That said, the converter should better check all files for the correct header... Regards, Jan > Anna. -- Jan Glauber --- Harman Becker Automotive GmbH System Profiling & Optimizing Team From jbernard at tuxion.com Mon May 13 10:33:18 2013 From: jbernard at tuxion.com (Jon Bernard) Date: Mon, 13 May 2013 10:33:18 -0400 Subject: [lttng-dev] [PATCH lttng-modules] Remove bashism in lttng-syscalls-generate-headers.sh Message-ID: <20130513143318.GA18192@quintessa> Options to echo are not portable. In particular, the 'echo -e' option is implemented by some shells, including bash, to expand escape sequences. However, dash is one of the other family of shells that instead expands escape sequences by default. The printf command is portable and much more reliable. --- instrumentation/syscalls/lttng-syscalls-generate-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/syscalls/lttng-syscalls-generate-headers.sh b/instrumentation/syscalls/lttng-syscalls-generate-headers.sh index 046dc06..1754ae8 100755 --- a/instrumentation/syscalls/lttng-syscalls-generate-headers.sh +++ b/instrumentation/syscalls/lttng-syscalls-generate-headers.sh @@ -59,7 +59,7 @@ if [ "$CLASS" = integers ]; then NRARGS=0 -echo -e \ +printf \ 'SC_DECLARE_EVENT_CLASS_NOARGS(syscalls_noargs,\n'\ ' TP_STRUCT__entry(),\n'\ ' TP_fast_assign(),\n'\ -- 1.7.10.4 -- Jon From mathieu.desnoyers at efficios.com Mon May 13 11:40:03 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 13 May 2013 11:40:03 -0400 Subject: [lttng-dev] [PATCH lttng-modules] Remove bashism in lttng-syscalls-generate-headers.sh In-Reply-To: <20130513143318.GA18192@quintessa> References: <20130513143318.GA18192@quintessa> Message-ID: <20130513154002.GA24686@Krystal> * Jon Bernard (jbernard at tuxion.com) wrote: > Options to echo are not portable. In particular, the 'echo -e' option is > implemented by some shells, including bash, to expand escape sequences. However, > dash is one of the other family of shells that instead expands escape sequences > by default. merged into master and stable-2.2 (in preparation for 2.2 final). Thanks! Mathieu > > The printf command is portable and much more reliable. > --- > instrumentation/syscalls/lttng-syscalls-generate-headers.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/instrumentation/syscalls/lttng-syscalls-generate-headers.sh b/instrumentation/syscalls/lttng-syscalls-generate-headers.sh > index 046dc06..1754ae8 100755 > --- a/instrumentation/syscalls/lttng-syscalls-generate-headers.sh > +++ b/instrumentation/syscalls/lttng-syscalls-generate-headers.sh > @@ -59,7 +59,7 @@ if [ "$CLASS" = integers ]; then > > NRARGS=0 > > -echo -e \ > +printf \ > 'SC_DECLARE_EVENT_CLASS_NOARGS(syscalls_noargs,\n'\ > ' TP_STRUCT__entry(),\n'\ > ' TP_fast_assign(),\n'\ > -- > 1.7.10.4 > > > -- > Jon > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From Paul_Woegerer at mentor.com Mon May 13 11:48:55 2013 From: Paul_Woegerer at mentor.com (Woegerer, Paul) Date: Mon, 13 May 2013 17:48:55 +0200 Subject: [lttng-dev] [PATCH lttng-modules] Add system calls definitions for powerpc-32 Message-ID: <51910B67.5050605@mentor.com> Hi Mathieu, the five patches below add basic support for syscall tracing on 32-bit PowerPC platforms. I have created and tested them on our Freescale p2020rdb board running 32-bit Linux 3.0.34. It would be great if these patches could still make it into the upcoming lttng 2.2 release (as there was no syscall tracing for PowerPC before there should be no risk of regression). Many Thanks, Paul >From 6efae4d60067f571e7fc633ce2b6677866085c6d Mon Sep 17 00:00:00 2001 From: Paul Woegerer Date: Mon, 29 Apr 2013 17:28:39 +0200 Subject: [PATCH 1/5] Added powerpc-32 syscall headers for linux 3.0.34 --- .../syscalls/3.0.34/powerpc-32-syscalls-3.0.34 | 286 +++ .../headers/powerpc-32-syscalls-3.0.34_integers.h | 1043 +++++++++ .../headers/powerpc-32-syscalls-3.0.34_pointers.h | 2316 ++++++++++++++++++++ 3 files changed, 3645 insertions(+) create mode 100644 instrumentation/syscalls/3.0.34/powerpc-32-syscalls-3.0.34 create mode 100644 instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers.h create mode 100644 instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers.h diff --git a/instrumentation/syscalls/3.0.34/powerpc-32-syscalls-3.0.34 b/instrumentation/syscalls/3.0.34/powerpc-32-syscalls-3.0.34 new file mode 100644 index 0000000..f951c7a --- /dev/null +++ b/instrumentation/syscalls/3.0.34/powerpc-32-syscalls-3.0.34 @@ -0,0 +1,286 @@ +syscall sys_restart_syscall nr 0 nbargs 0 types: () args: () +syscall sys_exit nr 1 nbargs 1 types: (int) args: (error_code) +syscall sys_read nr 3 nbargs 3 types: (unsigned int, char *, size_t) args: (fd, buf, count) +syscall sys_write nr 4 nbargs 3 types: (unsigned int, const char *, size_t) args: (fd, buf, count) +syscall sys_open nr 5 nbargs 3 types: (const char *, int, int) args: (filename, flags, mode) +syscall sys_close nr 6 nbargs 1 types: (unsigned int) args: (fd) +syscall sys_waitpid nr 7 nbargs 3 types: (pid_t, int *, int) args: (pid, stat_addr, options) +syscall sys_creat nr 8 nbargs 2 types: (const char *, int) args: (pathname, mode) +syscall sys_link nr 9 nbargs 2 types: (const char *, const char *) args: (oldname, newname) +syscall sys_unlink nr 10 nbargs 1 types: (const char *) args: (pathname) +syscall sys_chdir nr 12 nbargs 1 types: (const char *) args: (filename) +syscall sys_time nr 13 nbargs 1 types: (time_t *) args: (tloc) +syscall sys_mknod nr 14 nbargs 3 types: (const char *, int, unsigned) args: (filename, mode, dev) +syscall sys_chmod nr 15 nbargs 2 types: (const char *, mode_t) args: (filename, mode) +syscall sys_lchown nr 16 nbargs 3 types: (const char *, uid_t, gid_t) args: (filename, user, group) +syscall sys_stat nr 18 nbargs 2 types: (const char *, struct __old_kernel_stat *) args: (filename, statbuf) +syscall sys_lseek nr 19 nbargs 3 types: (unsigned int, off_t, unsigned int) args: (fd, offset, origin) +syscall sys_getpid nr 20 nbargs 0 types: () args: () +syscall sys_mount nr 21 nbargs 5 types: (char *, char *, char *, unsigned long, void *) args: (dev_name, dir_name, type, flags, data) +syscall sys_oldumount nr 22 nbargs 1 types: (char *) args: (name) +syscall sys_setuid nr 23 nbargs 1 types: (uid_t) args: (uid) +syscall sys_getuid nr 24 nbargs 0 types: () args: () +syscall sys_stime nr 25 nbargs 1 types: (time_t *) args: (tptr) +syscall sys_ptrace nr 26 nbargs 4 types: (long, long, unsigned long, unsigned long) args: (request, pid, addr, data) +syscall sys_alarm nr 27 nbargs 1 types: (unsigned int) args: (seconds) +syscall sys_fstat nr 28 nbargs 2 types: (unsigned int, struct __old_kernel_stat *) args: (fd, statbuf) +syscall sys_pause nr 29 nbargs 0 types: () args: () +syscall sys_utime nr 30 nbargs 2 types: (char *, struct utimbuf *) args: (filename, times) +syscall sys_access nr 33 nbargs 2 types: (const char *, int) args: (filename, mode) +syscall sys_nice nr 34 nbargs 1 types: (int) args: (increment) +syscall sys_sync nr 36 nbargs 0 types: () args: () +syscall sys_kill nr 37 nbargs 2 types: (pid_t, int) args: (pid, sig) +syscall sys_rename nr 38 nbargs 2 types: (const char *, const char *) args: (oldname, newname) +syscall sys_mkdir nr 39 nbargs 2 types: (const char *, int) args: (pathname, mode) +syscall sys_rmdir nr 40 nbargs 1 types: (const char *) args: (pathname) +syscall sys_dup nr 41 nbargs 1 types: (unsigned int) args: (fildes) +syscall sys_pipe nr 42 nbargs 1 types: (int *) args: (fildes) +syscall sys_times nr 43 nbargs 1 types: (struct tms *) args: (tbuf) +syscall sys_brk nr 45 nbargs 1 types: (unsigned long) args: (brk) +syscall sys_setgid nr 46 nbargs 1 types: (gid_t) args: (gid) +syscall sys_getgid nr 47 nbargs 0 types: () args: () +syscall sys_signal nr 48 nbargs 2 types: (int, __sighandler_t) args: (sig, handler) +syscall sys_geteuid nr 49 nbargs 0 types: () args: () +syscall sys_getegid nr 50 nbargs 0 types: () args: () +syscall sys_acct nr 51 nbargs 1 types: (const char *) args: (name) +syscall sys_umount nr 52 nbargs 2 types: (char *, int) args: (name, flags) +syscall sys_ioctl nr 54 nbargs 3 types: (unsigned int, unsigned int, unsigned long) args: (fd, cmd, arg) +syscall sys_fcntl nr 55 nbargs 3 types: (unsigned int, unsigned int, unsigned long) args: (fd, cmd, arg) +syscall sys_setpgid nr 57 nbargs 2 types: (pid_t, pid_t) args: (pid, pgid) +syscall sys_olduname nr 59 nbargs 1 types: (struct oldold_utsname *) args: (name) +syscall sys_umask nr 60 nbargs 1 types: (int) args: (mask) +syscall sys_chroot nr 61 nbargs 1 types: (const char *) args: (filename) +syscall sys_ustat nr 62 nbargs 2 types: (unsigned, struct ustat *) args: (dev, ubuf) +syscall sys_dup2 nr 63 nbargs 2 types: (unsigned int, unsigned int) args: (oldfd, newfd) +syscall sys_getppid nr 64 nbargs 0 types: () args: () +syscall sys_getpgrp nr 65 nbargs 0 types: () args: () +syscall sys_setsid nr 66 nbargs 0 types: () args: () +syscall sys_sgetmask nr 68 nbargs 0 types: () args: () +syscall sys_ssetmask nr 69 nbargs 1 types: (int) args: (newmask) +syscall sys_setreuid nr 70 nbargs 2 types: (uid_t, uid_t) args: (ruid, euid) +syscall sys_setregid nr 71 nbargs 2 types: (gid_t, gid_t) args: (rgid, egid) +syscall sys_sigpending nr 73 nbargs 1 types: (old_sigset_t *) args: (set) +syscall sys_sethostname nr 74 nbargs 2 types: (char *, int) args: (name, len) +syscall sys_setrlimit nr 75 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) +syscall sys_old_getrlimit nr 76 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) +syscall sys_getrusage nr 77 nbargs 2 types: (int, struct rusage *) args: (who, ru) +syscall sys_gettimeofday nr 78 nbargs 2 types: (struct timeval *, struct timezone *) args: (tv, tz) +syscall sys_settimeofday nr 79 nbargs 2 types: (struct timeval *, struct timezone *) args: (tv, tz) +syscall sys_getgroups nr 80 nbargs 2 types: (int, gid_t *) args: (gidsetsize, grouplist) +syscall sys_setgroups nr 81 nbargs 2 types: (int, gid_t *) args: (gidsetsize, grouplist) +syscall sys_symlink nr 83 nbargs 2 types: (const char *, const char *) args: (oldname, newname) +syscall sys_lstat nr 84 nbargs 2 types: (const char *, struct __old_kernel_stat *) args: (filename, statbuf) +syscall sys_readlink nr 85 nbargs 3 types: (const char *, char *, int) args: (path, buf, bufsiz) +syscall sys_uselib nr 86 nbargs 1 types: (const char *) args: (library) +syscall sys_swapon nr 87 nbargs 2 types: (const char *, int) args: (specialfile, swap_flags) +syscall sys_reboot nr 88 nbargs 4 types: (int, int, unsigned int, void *) args: (magic1, magic2, cmd, arg) +syscall sys_old_readdir nr 89 nbargs 3 types: (unsigned int, struct old_linux_dirent *, unsigned int) args: (fd, dirent, count) +syscall sys_munmap nr 91 nbargs 2 types: (unsigned long, size_t) args: (addr, len) +syscall sys_truncate nr 92 nbargs 2 types: (const char *, long) args: (path, length) +syscall sys_ftruncate nr 93 nbargs 2 types: (unsigned int, unsigned long) args: (fd, length) +syscall sys_fchmod nr 94 nbargs 2 types: (unsigned int, mode_t) args: (fd, mode) +syscall sys_fchown nr 95 nbargs 3 types: (unsigned int, uid_t, gid_t) args: (fd, user, group) +syscall sys_getpriority nr 96 nbargs 2 types: (int, int) args: (which, who) +syscall sys_setpriority nr 97 nbargs 3 types: (int, int, int) args: (which, who, niceval) +syscall sys_statfs nr 99 nbargs 2 types: (const char *, struct statfs *) args: (pathname, buf) +syscall sys_fstatfs nr 100 nbargs 2 types: (unsigned int, struct statfs *) args: (fd, buf) +syscall sys_socketcall nr 102 nbargs 2 types: (int, unsigned long *) args: (call, args) +syscall sys_syslog nr 103 nbargs 3 types: (int, char *, int) args: (type, buf, len) +syscall sys_setitimer nr 104 nbargs 3 types: (int, struct itimerval *, struct itimerval *) args: (which, value, ovalue) +syscall sys_getitimer nr 105 nbargs 2 types: (int, struct itimerval *) args: (which, value) +syscall sys_newstat nr 106 nbargs 2 types: (const char *, struct stat *) args: (filename, statbuf) +syscall sys_newlstat nr 107 nbargs 2 types: (const char *, struct stat *) args: (filename, statbuf) +syscall sys_newfstat nr 108 nbargs 2 types: (unsigned int, struct stat *) args: (fd, statbuf) +syscall sys_uname nr 109 nbargs 1 types: (struct old_utsname *) args: (name) +syscall sys_vhangup nr 111 nbargs 0 types: () args: () +syscall sys_wait4 nr 114 nbargs 4 types: (pid_t, int *, int, struct rusage *) args: (upid, stat_addr, options, ru) +syscall sys_swapoff nr 115 nbargs 1 types: (const char *) args: (specialfile) +syscall sys_sysinfo nr 116 nbargs 1 types: (struct sysinfo *) args: (info) +syscall sys_ipc nr 117 nbargs 6 types: (unsigned int, int, unsigned long, unsigned long, void *, long) args: (call, first, second, third, ptr, fifth) +syscall sys_fsync nr 118 nbargs 1 types: (unsigned int) args: (fd) +syscall sys_setdomainname nr 121 nbargs 2 types: (char *, int) args: (name, len) +syscall sys_newuname nr 122 nbargs 1 types: (struct new_utsname *) args: (name) +syscall sys_adjtimex nr 124 nbargs 1 types: (struct timex *) args: (txc_p) +syscall sys_mprotect nr 125 nbargs 3 types: (unsigned long, size_t, unsigned long) args: (start, len, prot) +syscall sys_sigprocmask nr 126 nbargs 3 types: (int, old_sigset_t *, old_sigset_t *) args: (how, nset, oset) +syscall sys_init_module nr 128 nbargs 3 types: (void *, unsigned long, const char *) args: (umod, len, uargs) +syscall sys_delete_module nr 129 nbargs 2 types: (const char *, unsigned int) args: (name_user, flags) +syscall sys_getpgid nr 132 nbargs 1 types: (pid_t) args: (pid) +syscall sys_fchdir nr 133 nbargs 1 types: (unsigned int) args: (fd) +syscall sys_bdflush nr 134 nbargs 2 types: (int, long) args: (func, data) +syscall sys_sysfs nr 135 nbargs 3 types: (int, unsigned long, unsigned long) args: (option, arg1, arg2) +syscall sys_personality nr 136 nbargs 1 types: (unsigned int) args: (personality) +syscall sys_setfsuid nr 138 nbargs 1 types: (uid_t) args: (uid) +syscall sys_setfsgid nr 139 nbargs 1 types: (gid_t) args: (gid) +syscall sys_llseek nr 140 nbargs 5 types: (unsigned int, unsigned long, unsigned long, loff_t *, unsigned int) args: (fd, offset_high, offset_low, result, origin) +syscall sys_getdents nr 141 nbargs 3 types: (unsigned int, struct linux_dirent *, unsigned int) args: (fd, dirent, count) +syscall sys_select nr 142 nbargs 5 types: (int, fd_set *, fd_set *, fd_set *, struct timeval *) args: (n, inp, outp, exp, tvp) +syscall sys_flock nr 143 nbargs 2 types: (unsigned int, unsigned int) args: (fd, cmd) +syscall sys_msync nr 144 nbargs 3 types: (unsigned long, size_t, int) args: (start, len, flags) +syscall sys_readv nr 145 nbargs 3 types: (unsigned long, const struct iovec *, unsigned long) args: (fd, vec, vlen) +syscall sys_writev nr 146 nbargs 3 types: (unsigned long, const struct iovec *, unsigned long) args: (fd, vec, vlen) +syscall sys_getsid nr 147 nbargs 1 types: (pid_t) args: (pid) +syscall sys_fdatasync nr 148 nbargs 1 types: (unsigned int) args: (fd) +syscall sys_sysctl nr 149 nbargs 1 types: (struct __sysctl_args *) args: (args) +syscall sys_mlock nr 150 nbargs 2 types: (unsigned long, size_t) args: (start, len) +syscall sys_munlock nr 151 nbargs 2 types: (unsigned long, size_t) args: (start, len) +syscall sys_mlockall nr 152 nbargs 1 types: (int) args: (flags) +syscall sys_munlockall nr 153 nbargs 0 types: () args: () +syscall sys_sched_setparam nr 154 nbargs 2 types: (pid_t, struct sched_param *) args: (pid, param) +syscall sys_sched_getparam nr 155 nbargs 2 types: (pid_t, struct sched_param *) args: (pid, param) +syscall sys_sched_setscheduler nr 156 nbargs 3 types: (pid_t, int, struct sched_param *) args: (pid, policy, param) +syscall sys_sched_getscheduler nr 157 nbargs 1 types: (pid_t) args: (pid) +syscall sys_sched_yield nr 158 nbargs 0 types: () args: () +syscall sys_sched_get_priority_max nr 159 nbargs 1 types: (int) args: (policy) +syscall sys_sched_get_priority_min nr 160 nbargs 1 types: (int) args: (policy) +syscall sys_sched_rr_get_interval nr 161 nbargs 2 types: (pid_t, struct timespec *) args: (pid, interval) +syscall sys_nanosleep nr 162 nbargs 2 types: (struct timespec *, struct timespec *) args: (rqtp, rmtp) +syscall sys_mremap nr 163 nbargs 5 types: (unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) args: (addr, old_len, new_len, flags, new_addr) +syscall sys_setresuid nr 164 nbargs 3 types: (uid_t, uid_t, uid_t) args: (ruid, euid, suid) +syscall sys_getresuid nr 165 nbargs 3 types: (uid_t *, uid_t *, uid_t *) args: (ruid, euid, suid) +syscall sys_poll nr 167 nbargs 3 types: (struct pollfd *, unsigned int, long) args: (ufds, nfds, timeout_msecs) +syscall sys_nfsservctl nr 168 nbargs 3 types: (int, struct nfsctl_arg *, void *) args: (cmd, arg, res) +syscall sys_setresgid nr 169 nbargs 3 types: (gid_t, gid_t, gid_t) args: (rgid, egid, sgid) +syscall sys_getresgid nr 170 nbargs 3 types: (gid_t *, gid_t *, gid_t *) args: (rgid, egid, sgid) +syscall sys_prctl nr 171 nbargs 5 types: (int, unsigned long, unsigned long, unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5) +syscall sys_rt_sigaction nr 173 nbargs 4 types: (int, const struct sigaction *, struct sigaction *, size_t) args: (sig, act, oact, sigsetsize) +syscall sys_rt_sigprocmask nr 174 nbargs 4 types: (int, sigset_t *, sigset_t *, size_t) args: (how, nset, oset, sigsetsize) +syscall sys_rt_sigpending nr 175 nbargs 2 types: (sigset_t *, size_t) args: (set, sigsetsize) +syscall sys_rt_sigtimedwait nr 176 nbargs 4 types: (const sigset_t *, siginfo_t *, const struct timespec *, size_t) args: (uthese, uinfo, uts, sigsetsize) +syscall sys_rt_sigqueueinfo nr 177 nbargs 3 types: (pid_t, int, siginfo_t *) args: (pid, sig, uinfo) +syscall sys_rt_sigsuspend nr 178 nbargs 2 types: (sigset_t *, size_t) args: (unewset, sigsetsize) +syscall sys_chown nr 181 nbargs 3 types: (const char *, uid_t, gid_t) args: (filename, user, group) +syscall sys_getcwd nr 182 nbargs 2 types: (char *, unsigned long) args: (buf, size) +syscall sys_capget nr 183 nbargs 2 types: (cap_user_header_t, cap_user_data_t) args: (header, dataptr) +syscall sys_capset nr 184 nbargs 2 types: (cap_user_header_t, const cap_user_data_t) args: (header, data) +syscall sys_sendfile nr 186 nbargs 4 types: (int, int, off_t *, size_t) args: (out_fd, in_fd, offset, count) +syscall sys_getrlimit nr 190 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) +syscall sys_stat64 nr 195 nbargs 2 types: (const char *, struct stat64 *) args: (filename, statbuf) +syscall sys_lstat64 nr 196 nbargs 2 types: (const char *, struct stat64 *) args: (filename, statbuf) +syscall sys_fstat64 nr 197 nbargs 2 types: (unsigned long, struct stat64 *) args: (fd, statbuf) +syscall sys_pciconfig_read nr 198 nbargs 5 types: (unsigned long, unsigned long, unsigned long, unsigned long, void *) args: (bus, dfn, off, len, buf) +syscall sys_pciconfig_write nr 199 nbargs 5 types: (unsigned long, unsigned long, unsigned long, unsigned long, void *) args: (bus, dfn, off, len, buf) +syscall sys_getdents64 nr 202 nbargs 3 types: (unsigned int, struct linux_dirent64 *, unsigned int) args: (fd, dirent, count) +syscall sys_pivot_root nr 203 nbargs 2 types: (const char *, const char *) args: (new_root, put_old) +syscall sys_fcntl64 nr 204 nbargs 3 types: (unsigned int, unsigned int, unsigned long) args: (fd, cmd, arg) +syscall sys_madvise nr 205 nbargs 3 types: (unsigned long, size_t, int) args: (start, len_in, behavior) +syscall sys_mincore nr 206 nbargs 3 types: (unsigned long, size_t, unsigned char *) args: (start, len, vec) +syscall sys_gettid nr 207 nbargs 0 types: () args: () +syscall sys_tkill nr 208 nbargs 2 types: (pid_t, int) args: (pid, sig) +syscall sys_setxattr nr 209 nbargs 5 types: (const char *, const char *, const void *, size_t, int) args: (pathname, name, value, size, flags) +syscall sys_lsetxattr nr 210 nbargs 5 types: (const char *, const char *, const void *, size_t, int) args: (pathname, name, value, size, flags) +syscall sys_fsetxattr nr 211 nbargs 5 types: (int, const char *, const void *, size_t, int) args: (fd, name, value, size, flags) +syscall sys_getxattr nr 212 nbargs 4 types: (const char *, const char *, void *, size_t) args: (pathname, name, value, size) +syscall sys_lgetxattr nr 213 nbargs 4 types: (const char *, const char *, void *, size_t) args: (pathname, name, value, size) +syscall sys_fgetxattr nr 214 nbargs 4 types: (int, const char *, void *, size_t) args: (fd, name, value, size) +syscall sys_listxattr nr 215 nbargs 3 types: (const char *, char *, size_t) args: (pathname, list, size) +syscall sys_llistxattr nr 216 nbargs 3 types: (const char *, char *, size_t) args: (pathname, list, size) +syscall sys_flistxattr nr 217 nbargs 3 types: (int, char *, size_t) args: (fd, list, size) +syscall sys_removexattr nr 218 nbargs 2 types: (const char *, const char *) args: (pathname, name) +syscall sys_lremovexattr nr 219 nbargs 2 types: (const char *, const char *) args: (pathname, name) +syscall sys_fremovexattr nr 220 nbargs 2 types: (int, const char *) args: (fd, name) +syscall sys_futex nr 221 nbargs 6 types: (u32 *, int, u32, struct timespec *, u32 *, u32) args: (uaddr, op, val, utime, uaddr2, val3) +syscall sys_sched_setaffinity nr 222 nbargs 3 types: (pid_t, unsigned int, unsigned long *) args: (pid, len, user_mask_ptr) +syscall sys_sched_getaffinity nr 223 nbargs 3 types: (pid_t, unsigned int, unsigned long *) args: (pid, len, user_mask_ptr) +syscall sys_sendfile64 nr 226 nbargs 4 types: (int, int, loff_t *, size_t) args: (out_fd, in_fd, offset, count) +syscall sys_io_setup nr 227 nbargs 2 types: (unsigned, aio_context_t *) args: (nr_events, ctxp) +syscall sys_io_destroy nr 228 nbargs 1 types: (aio_context_t) args: (ctx) +syscall sys_io_getevents nr 229 nbargs 5 types: (aio_context_t, long, long, struct io_event *, struct timespec *) args: (ctx_id, min_nr, nr, events, timeout) +syscall sys_io_submit nr 230 nbargs 3 types: (aio_context_t, long, struct iocb * *) args: (ctx_id, nr, iocbpp) +syscall sys_io_cancel nr 231 nbargs 3 types: (aio_context_t, struct iocb *, struct io_event *) args: (ctx_id, iocb, result) +syscall sys_set_tid_address nr 232 nbargs 1 types: (int *) args: (tidptr) +syscall sys_exit_group nr 234 nbargs 1 types: (int) args: (error_code) +syscall sys_epoll_create nr 236 nbargs 1 types: (int) args: (size) +syscall sys_epoll_ctl nr 237 nbargs 4 types: (int, int, int, struct epoll_event *) args: (epfd, op, fd, event) +syscall sys_epoll_wait nr 238 nbargs 4 types: (int, struct epoll_event *, int, int) args: (epfd, events, maxevents, timeout) +syscall sys_remap_file_pages nr 239 nbargs 5 types: (unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) args: (start, size, prot, pgoff, flags) +syscall sys_timer_create nr 240 nbargs 3 types: (const clockid_t, struct sigevent *, timer_t *) args: (which_clock, timer_event_spec, created_timer_id) +syscall sys_timer_settime nr 241 nbargs 4 types: (timer_t, int, const struct itimerspec *, struct itimerspec *) args: (timer_id, flags, new_setting, old_setting) +syscall sys_timer_gettime nr 242 nbargs 2 types: (timer_t, struct itimerspec *) args: (timer_id, setting) +syscall sys_timer_getoverrun nr 243 nbargs 1 types: (timer_t) args: (timer_id) +syscall sys_timer_delete nr 244 nbargs 1 types: (timer_t) args: (timer_id) +syscall sys_clock_settime nr 245 nbargs 2 types: (const clockid_t, const struct timespec *) args: (which_clock, tp) +syscall sys_clock_gettime nr 246 nbargs 2 types: (const clockid_t, struct timespec *) args: (which_clock, tp) +syscall sys_clock_getres nr 247 nbargs 2 types: (const clockid_t, struct timespec *) args: (which_clock, tp) +syscall sys_clock_nanosleep nr 248 nbargs 4 types: (const clockid_t, int, const struct timespec *, struct timespec *) args: (which_clock, flags, rqtp, rmtp) +syscall sys_tgkill nr 250 nbargs 3 types: (pid_t, pid_t, int) args: (tgid, pid, sig) +syscall sys_utimes nr 251 nbargs 2 types: (char *, struct timeval *) args: (filename, utimes) +syscall sys_statfs64 nr 252 nbargs 3 types: (const char *, size_t, struct statfs64 *) args: (pathname, sz, buf) +syscall sys_fstatfs64 nr 253 nbargs 3 types: (unsigned int, size_t, struct statfs64 *) args: (fd, sz, buf) +syscall sys_mq_open nr 262 nbargs 4 types: (const char *, int, mode_t, struct mq_attr *) args: (u_name, oflag, mode, u_attr) +syscall sys_mq_unlink nr 263 nbargs 1 types: (const char *) args: (u_name) +syscall sys_mq_timedsend nr 264 nbargs 5 types: (mqd_t, const char *, size_t, unsigned int, const struct timespec *) args: (mqdes, u_msg_ptr, msg_len, msg_prio, u_abs_timeout) +syscall sys_mq_timedreceive nr 265 nbargs 5 types: (mqd_t, char *, size_t, unsigned int *, const struct timespec *) args: (mqdes, u_msg_ptr, msg_len, u_msg_prio, u_abs_timeout) +syscall sys_mq_notify nr 266 nbargs 2 types: (mqd_t, const struct sigevent *) args: (mqdes, u_notification) +syscall sys_mq_getsetattr nr 267 nbargs 3 types: (mqd_t, const struct mq_attr *, struct mq_attr *) args: (mqdes, u_mqstat, u_omqstat) +syscall sys_add_key nr 269 nbargs 5 types: (const char *, const char *, const void *, size_t, key_serial_t) args: (_type, _description, _payload, plen, ringid) +syscall sys_request_key nr 270 nbargs 4 types: (const char *, const char *, const char *, key_serial_t) args: (_type, _description, _callout_info, destringid) +syscall sys_keyctl nr 271 nbargs 5 types: (int, unsigned long, unsigned long, unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5) +syscall sys_waitid nr 272 nbargs 5 types: (int, pid_t, struct siginfo *, int, struct rusage *) args: (which, upid, infop, options, ru) +syscall sys_ioprio_set nr 273 nbargs 3 types: (int, int, int) args: (which, who, ioprio) +syscall sys_ioprio_get nr 274 nbargs 2 types: (int, int) args: (which, who) +syscall sys_inotify_init nr 275 nbargs 0 types: () args: () +syscall sys_inotify_add_watch nr 276 nbargs 3 types: (int, const char *, u32) args: (fd, pathname, mask) +syscall sys_inotify_rm_watch nr 277 nbargs 2 types: (int, __s32) args: (fd, wd) +syscall sys_pselect6 nr 280 nbargs 6 types: (int, fd_set *, fd_set *, fd_set *, struct timespec *, void *) args: (n, inp, outp, exp, tsp, sig) +syscall sys_ppoll nr 281 nbargs 5 types: (struct pollfd *, unsigned int, struct timespec *, const sigset_t *, size_t) args: (ufds, nfds, tsp, sigmask, sigsetsize) +syscall sys_unshare nr 282 nbargs 1 types: (unsigned long) args: (unshare_flags) +syscall sys_splice nr 283 nbargs 6 types: (int, loff_t *, int, loff_t *, size_t, unsigned int) args: (fd_in, off_in, fd_out, off_out, len, flags) +syscall sys_tee nr 284 nbargs 4 types: (int, int, size_t, unsigned int) args: (fdin, fdout, len, flags) +syscall sys_vmsplice nr 285 nbargs 4 types: (int, const struct iovec *, unsigned long, unsigned int) args: (fd, iov, nr_segs, flags) +syscall sys_openat nr 286 nbargs 4 types: (int, const char *, int, int) args: (dfd, filename, flags, mode) +syscall sys_mkdirat nr 287 nbargs 3 types: (int, const char *, int) args: (dfd, pathname, mode) +syscall sys_mknodat nr 288 nbargs 4 types: (int, const char *, int, unsigned) args: (dfd, filename, mode, dev) +syscall sys_fchownat nr 289 nbargs 5 types: (int, const char *, uid_t, gid_t, int) args: (dfd, filename, user, group, flag) +syscall sys_futimesat nr 290 nbargs 3 types: (int, const char *, struct timeval *) args: (dfd, filename, utimes) +syscall sys_fstatat64 nr 291 nbargs 4 types: (int, const char *, struct stat64 *, int) args: (dfd, filename, statbuf, flag) +syscall sys_unlinkat nr 292 nbargs 3 types: (int, const char *, int) args: (dfd, pathname, flag) +syscall sys_renameat nr 293 nbargs 4 types: (int, const char *, int, const char *) args: (olddfd, oldname, newdfd, newname) +syscall sys_linkat nr 294 nbargs 5 types: (int, const char *, int, const char *, int) args: (olddfd, oldname, newdfd, newname, flags) +syscall sys_symlinkat nr 295 nbargs 3 types: (const char *, int, const char *) args: (oldname, newdfd, newname) +syscall sys_readlinkat nr 296 nbargs 4 types: (int, const char *, char *, int) args: (dfd, pathname, buf, bufsiz) +syscall sys_fchmodat nr 297 nbargs 3 types: (int, const char *, mode_t) args: (dfd, filename, mode) +syscall sys_faccessat nr 298 nbargs 3 types: (int, const char *, int) args: (dfd, filename, mode) +syscall sys_get_robust_list nr 299 nbargs 3 types: (int, struct robust_list_head * *, size_t *) args: (pid, head_ptr, len_ptr) +syscall sys_set_robust_list nr 300 nbargs 2 types: (struct robust_list_head *, size_t) args: (head, len) +syscall sys_getcpu nr 302 nbargs 3 types: (unsigned *, unsigned *, struct getcpu_cache *) args: (cpup, nodep, unused) +syscall sys_epoll_pwait nr 303 nbargs 6 types: (int, struct epoll_event *, int, int, const sigset_t *, size_t) args: (epfd, events, maxevents, timeout, sigmask, sigsetsize) +syscall sys_utimensat nr 304 nbargs 4 types: (int, const char *, struct timespec *, int) args: (dfd, filename, utimes, flags) +syscall sys_signalfd nr 305 nbargs 3 types: (int, sigset_t *, size_t) args: (ufd, user_mask, sizemask) +syscall sys_timerfd_create nr 306 nbargs 2 types: (int, int) args: (clockid, flags) +syscall sys_eventfd nr 307 nbargs 1 types: (unsigned int) args: (count) +syscall sys_timerfd_settime nr 311 nbargs 4 types: (int, int, const struct itimerspec *, struct itimerspec *) args: (ufd, flags, utmr, otmr) +syscall sys_timerfd_gettime nr 312 nbargs 2 types: (int, struct itimerspec *) args: (ufd, otmr) +syscall sys_signalfd4 nr 313 nbargs 4 types: (int, sigset_t *, size_t, int) args: (ufd, user_mask, sizemask, flags) +syscall sys_eventfd2 nr 314 nbargs 2 types: (unsigned int, int) args: (count, flags) +syscall sys_epoll_create1 nr 315 nbargs 1 types: (int) args: (flags) +syscall sys_dup3 nr 316 nbargs 3 types: (unsigned int, unsigned int, int) args: (oldfd, newfd, flags) +syscall sys_pipe2 nr 317 nbargs 2 types: (int *, int) args: (fildes, flags) +syscall sys_inotify_init1 nr 318 nbargs 1 types: (int) args: (flags) +syscall sys_perf_event_open nr 319 nbargs 5 types: (struct perf_event_attr *, pid_t, int, int, unsigned long) args: (attr_uptr, pid, cpu, group_fd, flags) +syscall sys_preadv nr 320 nbargs 5 types: (unsigned long, const struct iovec *, unsigned long, unsigned long, unsigned long) args: (fd, vec, vlen, pos_l, pos_h) +syscall sys_pwritev nr 321 nbargs 5 types: (unsigned long, const struct iovec *, unsigned long, unsigned long, unsigned long) args: (fd, vec, vlen, pos_l, pos_h) +syscall sys_rt_tgsigqueueinfo nr 322 nbargs 4 types: (pid_t, pid_t, int, siginfo_t *) args: (tgid, pid, sig, uinfo) +syscall sys_prlimit64 nr 325 nbargs 4 types: (pid_t, unsigned int, const struct rlimit64 *, struct rlimit64 *) args: (pid, resource, new_rlim, old_rlim) +syscall sys_socket nr 326 nbargs 3 types: (int, int, int) args: (family, type, protocol) +syscall sys_bind nr 327 nbargs 3 types: (int, struct sockaddr *, int) args: (fd, umyaddr, addrlen) +syscall sys_connect nr 328 nbargs 3 types: (int, struct sockaddr *, int) args: (fd, uservaddr, addrlen) +syscall sys_listen nr 329 nbargs 2 types: (int, int) args: (fd, backlog) +syscall sys_accept nr 330 nbargs 3 types: (int, struct sockaddr *, int *) args: (fd, upeer_sockaddr, upeer_addrlen) +syscall sys_getsockname nr 331 nbargs 3 types: (int, struct sockaddr *, int *) args: (fd, usockaddr, usockaddr_len) +syscall sys_getpeername nr 332 nbargs 3 types: (int, struct sockaddr *, int *) args: (fd, usockaddr, usockaddr_len) +syscall sys_socketpair nr 333 nbargs 4 types: (int, int, int, int *) args: (family, type, protocol, usockvec) +syscall sys_send nr 334 nbargs 4 types: (int, void *, size_t, unsigned) args: (fd, buff, len, flags) +syscall sys_sendto nr 335 nbargs 6 types: (int, void *, size_t, unsigned, struct sockaddr *, int) args: (fd, buff, len, flags, addr, addr_len) +syscall sys_recvfrom nr 337 nbargs 6 types: (int, void *, size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr, addr_len) +syscall sys_shutdown nr 338 nbargs 2 types: (int, int) args: (fd, how) +syscall sys_setsockopt nr 339 nbargs 5 types: (int, int, int, char *, int) args: (fd, level, optname, optval, optlen) +syscall sys_getsockopt nr 340 nbargs 5 types: (int, int, int, char *, int *) args: (fd, level, optname, optval, optlen) +syscall sys_sendmsg nr 341 nbargs 3 types: (int, struct msghdr *, unsigned) args: (fd, msg, flags) +syscall sys_recvmsg nr 342 nbargs 3 types: (int, struct msghdr *, unsigned int) args: (fd, msg, flags) +syscall sys_recvmmsg nr 343 nbargs 5 types: (int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *) args: (fd, mmsg, vlen, flags, timeout) +syscall sys_accept4 nr 344 nbargs 4 types: (int, struct sockaddr *, int *, int) args: (fd, upeer_sockaddr, upeer_addrlen, flags) +syscall sys_clock_adjtime nr 347 nbargs 2 types: (const clockid_t, struct timex *) args: (which_clock, utx) +syscall sys_syncfs nr 348 nbargs 1 types: (int) args: (fd) +syscall sys_sendmmsg nr 349 nbargs 4 types: (int, struct mmsghdr *, unsigned int, unsigned int) args: (fd, mmsg, vlen, flags) +syscall sys_setns nr 350 nbargs 2 types: (int, int) args: (fd, nstype) diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers.h new file mode 100644 index 0000000..f8ff459 --- /dev/null +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers.h @@ -0,0 +1,1043 @@ +/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */ +#ifndef CREATE_SYSCALL_TABLE + +#if !defined(_TRACE_SYSCALLS_INTEGERS_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_SYSCALLS_INTEGERS_H + +#include +#include +#include "powerpc-32-syscalls-3.0.34_integers_override.h" +#include "syscalls_integers_override.h" + +SC_DECLARE_EVENT_CLASS_NOARGS(syscalls_noargs, + TP_STRUCT__entry(), + TP_fast_assign(), + TP_printk() +) +#ifndef OVERRIDE_32_sys_restart_syscall +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_restart_syscall) +#endif +#ifndef OVERRIDE_32_sys_getpid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getpid) +#endif +#ifndef OVERRIDE_32_sys_getuid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getuid) +#endif +#ifndef OVERRIDE_32_sys_pause +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_pause) +#endif +#ifndef OVERRIDE_32_sys_sync +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sync) +#endif +#ifndef OVERRIDE_32_sys_getgid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getgid) +#endif +#ifndef OVERRIDE_32_sys_geteuid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_geteuid) +#endif +#ifndef OVERRIDE_32_sys_getegid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getegid) +#endif +#ifndef OVERRIDE_32_sys_getppid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getppid) +#endif +#ifndef OVERRIDE_32_sys_getpgrp +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getpgrp) +#endif +#ifndef OVERRIDE_32_sys_setsid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_setsid) +#endif +#ifndef OVERRIDE_32_sys_sgetmask +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sgetmask) +#endif +#ifndef OVERRIDE_32_sys_vhangup +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_vhangup) +#endif +#ifndef OVERRIDE_32_sys_munlockall +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_munlockall) +#endif +#ifndef OVERRIDE_32_sys_sched_yield +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sched_yield) +#endif +#ifndef OVERRIDE_32_sys_gettid +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_gettid) +#endif +#ifndef OVERRIDE_32_sys_inotify_init +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_inotify_init) +#endif +#ifndef OVERRIDE_32_sys_exit +SC_TRACE_EVENT(sys_exit, + TP_PROTO(int error_code), + TP_ARGS(error_code), + TP_STRUCT__entry(__field(int, error_code)), + TP_fast_assign(tp_assign(error_code, error_code)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_close +SC_TRACE_EVENT(sys_close, + TP_PROTO(unsigned int fd), + TP_ARGS(fd), + TP_STRUCT__entry(__field(unsigned int, fd)), + TP_fast_assign(tp_assign(fd, fd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setuid +SC_TRACE_EVENT(sys_setuid, + TP_PROTO(uid_t uid), + TP_ARGS(uid), + TP_STRUCT__entry(__field(uid_t, uid)), + TP_fast_assign(tp_assign(uid, uid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_alarm +SC_TRACE_EVENT(sys_alarm, + TP_PROTO(unsigned int seconds), + TP_ARGS(seconds), + TP_STRUCT__entry(__field(unsigned int, seconds)), + TP_fast_assign(tp_assign(seconds, seconds)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_nice +SC_TRACE_EVENT(sys_nice, + TP_PROTO(int increment), + TP_ARGS(increment), + TP_STRUCT__entry(__field(int, increment)), + TP_fast_assign(tp_assign(increment, increment)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_dup +SC_TRACE_EVENT(sys_dup, + TP_PROTO(unsigned int fildes), + TP_ARGS(fildes), + TP_STRUCT__entry(__field(unsigned int, fildes)), + TP_fast_assign(tp_assign(fildes, fildes)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_brk +SC_TRACE_EVENT(sys_brk, + TP_PROTO(unsigned long brk), + TP_ARGS(brk), + TP_STRUCT__entry(__field(unsigned long, brk)), + TP_fast_assign(tp_assign(brk, brk)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setgid +SC_TRACE_EVENT(sys_setgid, + TP_PROTO(gid_t gid), + TP_ARGS(gid), + TP_STRUCT__entry(__field(gid_t, gid)), + TP_fast_assign(tp_assign(gid, gid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_umask +SC_TRACE_EVENT(sys_umask, + TP_PROTO(int mask), + TP_ARGS(mask), + TP_STRUCT__entry(__field(int, mask)), + TP_fast_assign(tp_assign(mask, mask)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_ssetmask +SC_TRACE_EVENT(sys_ssetmask, + TP_PROTO(int newmask), + TP_ARGS(newmask), + TP_STRUCT__entry(__field(int, newmask)), + TP_fast_assign(tp_assign(newmask, newmask)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fsync +SC_TRACE_EVENT(sys_fsync, + TP_PROTO(unsigned int fd), + TP_ARGS(fd), + TP_STRUCT__entry(__field(unsigned int, fd)), + TP_fast_assign(tp_assign(fd, fd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getpgid +SC_TRACE_EVENT(sys_getpgid, + TP_PROTO(pid_t pid), + TP_ARGS(pid), + TP_STRUCT__entry(__field(pid_t, pid)), + TP_fast_assign(tp_assign(pid, pid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fchdir +SC_TRACE_EVENT(sys_fchdir, + TP_PROTO(unsigned int fd), + TP_ARGS(fd), + TP_STRUCT__entry(__field(unsigned int, fd)), + TP_fast_assign(tp_assign(fd, fd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_personality +SC_TRACE_EVENT(sys_personality, + TP_PROTO(unsigned int personality), + TP_ARGS(personality), + TP_STRUCT__entry(__field(unsigned int, personality)), + TP_fast_assign(tp_assign(personality, personality)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setfsuid +SC_TRACE_EVENT(sys_setfsuid, + TP_PROTO(uid_t uid), + TP_ARGS(uid), + TP_STRUCT__entry(__field(uid_t, uid)), + TP_fast_assign(tp_assign(uid, uid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setfsgid +SC_TRACE_EVENT(sys_setfsgid, + TP_PROTO(gid_t gid), + TP_ARGS(gid), + TP_STRUCT__entry(__field(gid_t, gid)), + TP_fast_assign(tp_assign(gid, gid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getsid +SC_TRACE_EVENT(sys_getsid, + TP_PROTO(pid_t pid), + TP_ARGS(pid), + TP_STRUCT__entry(__field(pid_t, pid)), + TP_fast_assign(tp_assign(pid, pid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fdatasync +SC_TRACE_EVENT(sys_fdatasync, + TP_PROTO(unsigned int fd), + TP_ARGS(fd), + TP_STRUCT__entry(__field(unsigned int, fd)), + TP_fast_assign(tp_assign(fd, fd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mlockall +SC_TRACE_EVENT(sys_mlockall, + TP_PROTO(int flags), + TP_ARGS(flags), + TP_STRUCT__entry(__field(int, flags)), + TP_fast_assign(tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sched_getscheduler +SC_TRACE_EVENT(sys_sched_getscheduler, + TP_PROTO(pid_t pid), + TP_ARGS(pid), + TP_STRUCT__entry(__field(pid_t, pid)), + TP_fast_assign(tp_assign(pid, pid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sched_get_priority_max +SC_TRACE_EVENT(sys_sched_get_priority_max, + TP_PROTO(int policy), + TP_ARGS(policy), + TP_STRUCT__entry(__field(int, policy)), + TP_fast_assign(tp_assign(policy, policy)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sched_get_priority_min +SC_TRACE_EVENT(sys_sched_get_priority_min, + TP_PROTO(int policy), + TP_ARGS(policy), + TP_STRUCT__entry(__field(int, policy)), + TP_fast_assign(tp_assign(policy, policy)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_io_destroy +SC_TRACE_EVENT(sys_io_destroy, + TP_PROTO(aio_context_t ctx), + TP_ARGS(ctx), + TP_STRUCT__entry(__field(aio_context_t, ctx)), + TP_fast_assign(tp_assign(ctx, ctx)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_exit_group +SC_TRACE_EVENT(sys_exit_group, + TP_PROTO(int error_code), + TP_ARGS(error_code), + TP_STRUCT__entry(__field(int, error_code)), + TP_fast_assign(tp_assign(error_code, error_code)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_epoll_create +SC_TRACE_EVENT(sys_epoll_create, + TP_PROTO(int size), + TP_ARGS(size), + TP_STRUCT__entry(__field(int, size)), + TP_fast_assign(tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_timer_getoverrun +SC_TRACE_EVENT(sys_timer_getoverrun, + TP_PROTO(timer_t timer_id), + TP_ARGS(timer_id), + TP_STRUCT__entry(__field(timer_t, timer_id)), + TP_fast_assign(tp_assign(timer_id, timer_id)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_timer_delete +SC_TRACE_EVENT(sys_timer_delete, + TP_PROTO(timer_t timer_id), + TP_ARGS(timer_id), + TP_STRUCT__entry(__field(timer_t, timer_id)), + TP_fast_assign(tp_assign(timer_id, timer_id)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_unshare +SC_TRACE_EVENT(sys_unshare, + TP_PROTO(unsigned long unshare_flags), + TP_ARGS(unshare_flags), + TP_STRUCT__entry(__field(unsigned long, unshare_flags)), + TP_fast_assign(tp_assign(unshare_flags, unshare_flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_eventfd +SC_TRACE_EVENT(sys_eventfd, + TP_PROTO(unsigned int count), + TP_ARGS(count), + TP_STRUCT__entry(__field(unsigned int, count)), + TP_fast_assign(tp_assign(count, count)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_epoll_create1 +SC_TRACE_EVENT(sys_epoll_create1, + TP_PROTO(int flags), + TP_ARGS(flags), + TP_STRUCT__entry(__field(int, flags)), + TP_fast_assign(tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_inotify_init1 +SC_TRACE_EVENT(sys_inotify_init1, + TP_PROTO(int flags), + TP_ARGS(flags), + TP_STRUCT__entry(__field(int, flags)), + TP_fast_assign(tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_syncfs +SC_TRACE_EVENT(sys_syncfs, + TP_PROTO(int fd), + TP_ARGS(fd), + TP_STRUCT__entry(__field(int, fd)), + TP_fast_assign(tp_assign(fd, fd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_kill +SC_TRACE_EVENT(sys_kill, + TP_PROTO(pid_t pid, int sig), + TP_ARGS(pid, sig), + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_signal +SC_TRACE_EVENT(sys_signal, + TP_PROTO(int sig, __sighandler_t handler), + TP_ARGS(sig, handler), + TP_STRUCT__entry(__field(int, sig) __field(__sighandler_t, handler)), + TP_fast_assign(tp_assign(sig, sig) tp_assign(handler, handler)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setpgid +SC_TRACE_EVENT(sys_setpgid, + TP_PROTO(pid_t pid, pid_t pgid), + TP_ARGS(pid, pgid), + TP_STRUCT__entry(__field(pid_t, pid) __field(pid_t, pgid)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(pgid, pgid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_dup2 +SC_TRACE_EVENT(sys_dup2, + TP_PROTO(unsigned int oldfd, unsigned int newfd), + TP_ARGS(oldfd, newfd), + TP_STRUCT__entry(__field(unsigned int, oldfd) __field(unsigned int, newfd)), + TP_fast_assign(tp_assign(oldfd, oldfd) tp_assign(newfd, newfd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setreuid +SC_TRACE_EVENT(sys_setreuid, + TP_PROTO(uid_t ruid, uid_t euid), + TP_ARGS(ruid, euid), + TP_STRUCT__entry(__field(uid_t, ruid) __field(uid_t, euid)), + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setregid +SC_TRACE_EVENT(sys_setregid, + TP_PROTO(gid_t rgid, gid_t egid), + TP_ARGS(rgid, egid), + TP_STRUCT__entry(__field(gid_t, rgid) __field(gid_t, egid)), + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_munmap +SC_TRACE_EVENT(sys_munmap, + TP_PROTO(unsigned long addr, size_t len), + TP_ARGS(addr, len), + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(size_t, len)), + TP_fast_assign(tp_assign(addr, addr) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_ftruncate +SC_TRACE_EVENT(sys_ftruncate, + TP_PROTO(unsigned int fd, unsigned long length), + TP_ARGS(fd, length), + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned long, length)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(length, length)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fchmod +SC_TRACE_EVENT(sys_fchmod, + TP_PROTO(unsigned int fd, mode_t mode), + TP_ARGS(fd, mode), + TP_STRUCT__entry(__field(unsigned int, fd) __field(mode_t, mode)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getpriority +SC_TRACE_EVENT(sys_getpriority, + TP_PROTO(int which, int who), + TP_ARGS(which, who), + TP_STRUCT__entry(__field(int, which) __field(int, who)), + TP_fast_assign(tp_assign(which, which) tp_assign(who, who)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_bdflush +SC_TRACE_EVENT(sys_bdflush, + TP_PROTO(int func, long data), + TP_ARGS(func, data), + TP_STRUCT__entry(__field(int, func) __field(long, data)), + TP_fast_assign(tp_assign(func, func) tp_assign(data, data)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_flock +SC_TRACE_EVENT(sys_flock, + TP_PROTO(unsigned int fd, unsigned int cmd), + TP_ARGS(fd, cmd), + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mlock +SC_TRACE_EVENT(sys_mlock, + TP_PROTO(unsigned long start, size_t len), + TP_ARGS(start, len), + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len)), + TP_fast_assign(tp_assign(start, start) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_munlock +SC_TRACE_EVENT(sys_munlock, + TP_PROTO(unsigned long start, size_t len), + TP_ARGS(start, len), + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len)), + TP_fast_assign(tp_assign(start, start) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_tkill +SC_TRACE_EVENT(sys_tkill, + TP_PROTO(pid_t pid, int sig), + TP_ARGS(pid, sig), + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_ioprio_get +SC_TRACE_EVENT(sys_ioprio_get, + TP_PROTO(int which, int who), + TP_ARGS(which, who), + TP_STRUCT__entry(__field(int, which) __field(int, who)), + TP_fast_assign(tp_assign(which, which) tp_assign(who, who)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_inotify_rm_watch +SC_TRACE_EVENT(sys_inotify_rm_watch, + TP_PROTO(int fd, __s32 wd), + TP_ARGS(fd, wd), + TP_STRUCT__entry(__field(int, fd) __field(__s32, wd)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(wd, wd)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_timerfd_create +SC_TRACE_EVENT(sys_timerfd_create, + TP_PROTO(int clockid, int flags), + TP_ARGS(clockid, flags), + TP_STRUCT__entry(__field(int, clockid) __field(int, flags)), + TP_fast_assign(tp_assign(clockid, clockid) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_eventfd2 +SC_TRACE_EVENT(sys_eventfd2, + TP_PROTO(unsigned int count, int flags), + TP_ARGS(count, flags), + TP_STRUCT__entry(__field(unsigned int, count) __field(int, flags)), + TP_fast_assign(tp_assign(count, count) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_listen +SC_TRACE_EVENT(sys_listen, + TP_PROTO(int fd, int backlog), + TP_ARGS(fd, backlog), + TP_STRUCT__entry(__field(int, fd) __field(int, backlog)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(backlog, backlog)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_shutdown +SC_TRACE_EVENT(sys_shutdown, + TP_PROTO(int fd, int how), + TP_ARGS(fd, how), + TP_STRUCT__entry(__field(int, fd) __field(int, how)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(how, how)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setns +SC_TRACE_EVENT(sys_setns, + TP_PROTO(int fd, int nstype), + TP_ARGS(fd, nstype), + TP_STRUCT__entry(__field(int, fd) __field(int, nstype)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(nstype, nstype)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_lseek +SC_TRACE_EVENT(sys_lseek, + TP_PROTO(unsigned int fd, off_t offset, unsigned int origin), + TP_ARGS(fd, offset, origin), + TP_STRUCT__entry(__field(unsigned int, fd) __field(off_t, offset) __field(unsigned int, origin)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(offset, offset) tp_assign(origin, origin)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_ioctl +SC_TRACE_EVENT(sys_ioctl, + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), + TP_ARGS(fd, cmd, arg), + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fcntl +SC_TRACE_EVENT(sys_fcntl, + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), + TP_ARGS(fd, cmd, arg), + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fchown +SC_TRACE_EVENT(sys_fchown, + TP_PROTO(unsigned int fd, uid_t user, gid_t group), + TP_ARGS(fd, user, group), + TP_STRUCT__entry(__field(unsigned int, fd) __field(uid_t, user) __field(gid_t, group)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(user, user) tp_assign(group, group)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setpriority +SC_TRACE_EVENT(sys_setpriority, + TP_PROTO(int which, int who, int niceval), + TP_ARGS(which, who, niceval), + TP_STRUCT__entry(__field(int, which) __field(int, who) __field(int, niceval)), + TP_fast_assign(tp_assign(which, which) tp_assign(who, who) tp_assign(niceval, niceval)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mprotect +SC_TRACE_EVENT(sys_mprotect, + TP_PROTO(unsigned long start, size_t len, unsigned long prot), + TP_ARGS(start, len, prot), + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field(unsigned long, prot)), + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(prot, prot)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sysfs +SC_TRACE_EVENT(sys_sysfs, + TP_PROTO(int option, unsigned long arg1, unsigned long arg2), + TP_ARGS(option, arg1, arg2), + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg1) __field(unsigned long, arg2)), + TP_fast_assign(tp_assign(option, option) tp_assign(arg1, arg1) tp_assign(arg2, arg2)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_msync +SC_TRACE_EVENT(sys_msync, + TP_PROTO(unsigned long start, size_t len, int flags), + TP_ARGS(start, len, flags), + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field(int, flags)), + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setresuid +SC_TRACE_EVENT(sys_setresuid, + TP_PROTO(uid_t ruid, uid_t euid, uid_t suid), + TP_ARGS(ruid, euid, suid), + TP_STRUCT__entry(__field(uid_t, ruid) __field(uid_t, euid) __field(uid_t, suid)), + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setresgid +SC_TRACE_EVENT(sys_setresgid, + TP_PROTO(gid_t rgid, gid_t egid, gid_t sgid), + TP_ARGS(rgid, egid, sgid), + TP_STRUCT__entry(__field(gid_t, rgid) __field(gid_t, egid) __field(gid_t, sgid)), + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fcntl64 +SC_TRACE_EVENT(sys_fcntl64, + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), + TP_ARGS(fd, cmd, arg), + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_madvise +SC_TRACE_EVENT(sys_madvise, + TP_PROTO(unsigned long start, size_t len_in, int behavior), + TP_ARGS(start, len_in, behavior), + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len_in) __field(int, behavior)), + TP_fast_assign(tp_assign(start, start) tp_assign(len_in, len_in) tp_assign(behavior, behavior)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_tgkill +SC_TRACE_EVENT(sys_tgkill, + TP_PROTO(pid_t tgid, pid_t pid, int sig), + TP_ARGS(tgid, pid, sig), + TP_STRUCT__entry(__field(pid_t, tgid) __field(pid_t, pid) __field(int, sig)), + TP_fast_assign(tp_assign(tgid, tgid) tp_assign(pid, pid) tp_assign(sig, sig)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_ioprio_set +SC_TRACE_EVENT(sys_ioprio_set, + TP_PROTO(int which, int who, int ioprio), + TP_ARGS(which, who, ioprio), + TP_STRUCT__entry(__field(int, which) __field(int, who) __field(int, ioprio)), + TP_fast_assign(tp_assign(which, which) tp_assign(who, who) tp_assign(ioprio, ioprio)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_dup3 +SC_TRACE_EVENT(sys_dup3, + TP_PROTO(unsigned int oldfd, unsigned int newfd, int flags), + TP_ARGS(oldfd, newfd, flags), + TP_STRUCT__entry(__field(unsigned int, oldfd) __field(unsigned int, newfd) __field(int, flags)), + TP_fast_assign(tp_assign(oldfd, oldfd) tp_assign(newfd, newfd) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_socket +SC_TRACE_EVENT(sys_socket, + TP_PROTO(int family, int type, int protocol), + TP_ARGS(family, type, protocol), + TP_STRUCT__entry(__field(int, family) __field(int, type) __field(int, protocol)), + TP_fast_assign(tp_assign(family, family) tp_assign(type, type) tp_assign(protocol, protocol)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_ptrace +SC_TRACE_EVENT(sys_ptrace, + TP_PROTO(long request, long pid, unsigned long addr, unsigned long data), + TP_ARGS(request, pid, addr, data), + TP_STRUCT__entry(__field(long, request) __field(long, pid) __field_hex(unsigned long, addr) __field(unsigned long, data)), + TP_fast_assign(tp_assign(request, request) tp_assign(pid, pid) tp_assign(addr, addr) tp_assign(data, data)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_tee +SC_TRACE_EVENT(sys_tee, + TP_PROTO(int fdin, int fdout, size_t len, unsigned int flags), + TP_ARGS(fdin, fdout, len, flags), + TP_STRUCT__entry(__field(int, fdin) __field(int, fdout) __field(size_t, len) __field(unsigned int, flags)), + TP_fast_assign(tp_assign(fdin, fdin) tp_assign(fdout, fdout) tp_assign(len, len) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mremap +SC_TRACE_EVENT(sys_mremap, + TP_PROTO(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr), + TP_ARGS(addr, old_len, new_len, flags, new_addr), + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(unsigned long, old_len) __field(unsigned long, new_len) __field(unsigned long, flags) __field_hex(unsigned long, new_addr)), + TP_fast_assign(tp_assign(addr, addr) tp_assign(old_len, old_len) tp_assign(new_len, new_len) tp_assign(flags, flags) tp_assign(new_addr, new_addr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_prctl +SC_TRACE_EVENT(sys_prctl, + TP_PROTO(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5), + TP_ARGS(option, arg2, arg3, arg4, arg5), + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg2) __field(unsigned long, arg3) __field(unsigned long, arg4) __field(unsigned long, arg5)), + TP_fast_assign(tp_assign(option, option) tp_assign(arg2, arg2) tp_assign(arg3, arg3) tp_assign(arg4, arg4) tp_assign(arg5, arg5)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_remap_file_pages +SC_TRACE_EVENT(sys_remap_file_pages, + TP_PROTO(unsigned long start, unsigned long size, unsigned long prot, unsigned long pgoff, unsigned long flags), + TP_ARGS(start, size, prot, pgoff, flags), + TP_STRUCT__entry(__field(unsigned long, start) __field(unsigned long, size) __field(unsigned long, prot) __field(unsigned long, pgoff) __field(unsigned long, flags)), + TP_fast_assign(tp_assign(start, start) tp_assign(size, size) tp_assign(prot, prot) tp_assign(pgoff, pgoff) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_keyctl +SC_TRACE_EVENT(sys_keyctl, + TP_PROTO(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5), + TP_ARGS(option, arg2, arg3, arg4, arg5), + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg2) __field(unsigned long, arg3) __field(unsigned long, arg4) __field(unsigned long, arg5)), + TP_fast_assign(tp_assign(option, option) tp_assign(arg2, arg2) tp_assign(arg3, arg3) tp_assign(arg4, arg4) tp_assign(arg5, arg5)), + TP_printk() +) +#endif + +#endif /* _TRACE_SYSCALLS_INTEGERS_H */ + +/* This part must be outside protection */ +#include "../../../probes/define_trace.h" + +#else /* CREATE_SYSCALL_TABLE */ + +#include "powerpc-32-syscalls-3.0.34_integers_override.h" +#include "syscalls_integers_override.h" + +#ifndef OVERRIDE_TABLE_32_sys_restart_syscall +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_restart_syscall, 0, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getpid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getpid, 20, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getuid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getuid, 24, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_pause +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_pause, 29, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sync +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sync, 36, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getgid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getgid, 47, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_geteuid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_geteuid, 49, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getegid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getegid, 50, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getppid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getppid, 64, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getpgrp +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getpgrp, 65, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setsid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_setsid, 66, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sgetmask +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sgetmask, 68, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_vhangup +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_vhangup, 111, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_munlockall +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_munlockall, 153, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sched_yield +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sched_yield, 158, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_gettid +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_gettid, 207, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_inotify_init +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_inotify_init, 275, 0) +#endif +#ifndef OVERRIDE_TABLE_32_sys_exit +TRACE_SYSCALL_TABLE(sys_exit, sys_exit, 1, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_close +TRACE_SYSCALL_TABLE(sys_close, sys_close, 6, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_lseek +TRACE_SYSCALL_TABLE(sys_lseek, sys_lseek, 19, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setuid +TRACE_SYSCALL_TABLE(sys_setuid, sys_setuid, 23, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_ptrace +TRACE_SYSCALL_TABLE(sys_ptrace, sys_ptrace, 26, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_alarm +TRACE_SYSCALL_TABLE(sys_alarm, sys_alarm, 27, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_nice +TRACE_SYSCALL_TABLE(sys_nice, sys_nice, 34, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_kill +TRACE_SYSCALL_TABLE(sys_kill, sys_kill, 37, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_dup +TRACE_SYSCALL_TABLE(sys_dup, sys_dup, 41, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_brk +TRACE_SYSCALL_TABLE(sys_brk, sys_brk, 45, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setgid +TRACE_SYSCALL_TABLE(sys_setgid, sys_setgid, 46, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_signal +TRACE_SYSCALL_TABLE(sys_signal, sys_signal, 48, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_ioctl +TRACE_SYSCALL_TABLE(sys_ioctl, sys_ioctl, 54, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fcntl +TRACE_SYSCALL_TABLE(sys_fcntl, sys_fcntl, 55, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setpgid +TRACE_SYSCALL_TABLE(sys_setpgid, sys_setpgid, 57, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_umask +TRACE_SYSCALL_TABLE(sys_umask, sys_umask, 60, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_dup2 +TRACE_SYSCALL_TABLE(sys_dup2, sys_dup2, 63, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_ssetmask +TRACE_SYSCALL_TABLE(sys_ssetmask, sys_ssetmask, 69, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setreuid +TRACE_SYSCALL_TABLE(sys_setreuid, sys_setreuid, 70, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setregid +TRACE_SYSCALL_TABLE(sys_setregid, sys_setregid, 71, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_munmap +TRACE_SYSCALL_TABLE(sys_munmap, sys_munmap, 91, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_ftruncate +TRACE_SYSCALL_TABLE(sys_ftruncate, sys_ftruncate, 93, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fchmod +TRACE_SYSCALL_TABLE(sys_fchmod, sys_fchmod, 94, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fchown +TRACE_SYSCALL_TABLE(sys_fchown, sys_fchown, 95, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getpriority +TRACE_SYSCALL_TABLE(sys_getpriority, sys_getpriority, 96, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setpriority +TRACE_SYSCALL_TABLE(sys_setpriority, sys_setpriority, 97, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fsync +TRACE_SYSCALL_TABLE(sys_fsync, sys_fsync, 118, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mprotect +TRACE_SYSCALL_TABLE(sys_mprotect, sys_mprotect, 125, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getpgid +TRACE_SYSCALL_TABLE(sys_getpgid, sys_getpgid, 132, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fchdir +TRACE_SYSCALL_TABLE(sys_fchdir, sys_fchdir, 133, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_bdflush +TRACE_SYSCALL_TABLE(sys_bdflush, sys_bdflush, 134, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sysfs +TRACE_SYSCALL_TABLE(sys_sysfs, sys_sysfs, 135, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_personality +TRACE_SYSCALL_TABLE(sys_personality, sys_personality, 136, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setfsuid +TRACE_SYSCALL_TABLE(sys_setfsuid, sys_setfsuid, 138, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setfsgid +TRACE_SYSCALL_TABLE(sys_setfsgid, sys_setfsgid, 139, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_flock +TRACE_SYSCALL_TABLE(sys_flock, sys_flock, 143, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_msync +TRACE_SYSCALL_TABLE(sys_msync, sys_msync, 144, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getsid +TRACE_SYSCALL_TABLE(sys_getsid, sys_getsid, 147, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fdatasync +TRACE_SYSCALL_TABLE(sys_fdatasync, sys_fdatasync, 148, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mlock +TRACE_SYSCALL_TABLE(sys_mlock, sys_mlock, 150, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_munlock +TRACE_SYSCALL_TABLE(sys_munlock, sys_munlock, 151, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mlockall +TRACE_SYSCALL_TABLE(sys_mlockall, sys_mlockall, 152, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sched_getscheduler +TRACE_SYSCALL_TABLE(sys_sched_getscheduler, sys_sched_getscheduler, 157, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sched_get_priority_max +TRACE_SYSCALL_TABLE(sys_sched_get_priority_max, sys_sched_get_priority_max, 159, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sched_get_priority_min +TRACE_SYSCALL_TABLE(sys_sched_get_priority_min, sys_sched_get_priority_min, 160, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mremap +TRACE_SYSCALL_TABLE(sys_mremap, sys_mremap, 163, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setresuid +TRACE_SYSCALL_TABLE(sys_setresuid, sys_setresuid, 164, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setresgid +TRACE_SYSCALL_TABLE(sys_setresgid, sys_setresgid, 169, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_prctl +TRACE_SYSCALL_TABLE(sys_prctl, sys_prctl, 171, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fcntl64 +TRACE_SYSCALL_TABLE(sys_fcntl64, sys_fcntl64, 204, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_madvise +TRACE_SYSCALL_TABLE(sys_madvise, sys_madvise, 205, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_tkill +TRACE_SYSCALL_TABLE(sys_tkill, sys_tkill, 208, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_io_destroy +TRACE_SYSCALL_TABLE(sys_io_destroy, sys_io_destroy, 228, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_exit_group +TRACE_SYSCALL_TABLE(sys_exit_group, sys_exit_group, 234, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_epoll_create +TRACE_SYSCALL_TABLE(sys_epoll_create, sys_epoll_create, 236, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_remap_file_pages +TRACE_SYSCALL_TABLE(sys_remap_file_pages, sys_remap_file_pages, 239, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_timer_getoverrun +TRACE_SYSCALL_TABLE(sys_timer_getoverrun, sys_timer_getoverrun, 243, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_timer_delete +TRACE_SYSCALL_TABLE(sys_timer_delete, sys_timer_delete, 244, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_tgkill +TRACE_SYSCALL_TABLE(sys_tgkill, sys_tgkill, 250, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_keyctl +TRACE_SYSCALL_TABLE(sys_keyctl, sys_keyctl, 271, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_ioprio_set +TRACE_SYSCALL_TABLE(sys_ioprio_set, sys_ioprio_set, 273, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_ioprio_get +TRACE_SYSCALL_TABLE(sys_ioprio_get, sys_ioprio_get, 274, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_inotify_rm_watch +TRACE_SYSCALL_TABLE(sys_inotify_rm_watch, sys_inotify_rm_watch, 277, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_unshare +TRACE_SYSCALL_TABLE(sys_unshare, sys_unshare, 282, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_tee +TRACE_SYSCALL_TABLE(sys_tee, sys_tee, 284, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_timerfd_create +TRACE_SYSCALL_TABLE(sys_timerfd_create, sys_timerfd_create, 306, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_eventfd +TRACE_SYSCALL_TABLE(sys_eventfd, sys_eventfd, 307, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_eventfd2 +TRACE_SYSCALL_TABLE(sys_eventfd2, sys_eventfd2, 314, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_epoll_create1 +TRACE_SYSCALL_TABLE(sys_epoll_create1, sys_epoll_create1, 315, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_dup3 +TRACE_SYSCALL_TABLE(sys_dup3, sys_dup3, 316, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_inotify_init1 +TRACE_SYSCALL_TABLE(sys_inotify_init1, sys_inotify_init1, 318, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_socket +TRACE_SYSCALL_TABLE(sys_socket, sys_socket, 326, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_listen +TRACE_SYSCALL_TABLE(sys_listen, sys_listen, 329, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_shutdown +TRACE_SYSCALL_TABLE(sys_shutdown, sys_shutdown, 338, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_syncfs +TRACE_SYSCALL_TABLE(sys_syncfs, sys_syncfs, 348, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setns +TRACE_SYSCALL_TABLE(sys_setns, sys_setns, 350, 2) +#endif + +#endif /* CREATE_SYSCALL_TABLE */ diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers.h new file mode 100644 index 0000000..4244db4 --- /dev/null +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers.h @@ -0,0 +1,2316 @@ +/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */ +#ifndef CREATE_SYSCALL_TABLE + +#if !defined(_TRACE_SYSCALLS_POINTERS_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_SYSCALLS_POINTERS_H + +#include +#include +#include "powerpc-32-syscalls-3.0.34_pointers_override.h" +#include "syscalls_pointers_override.h" + +#ifndef OVERRIDE_32_sys_unlink +SC_TRACE_EVENT(sys_unlink, + TP_PROTO(const char * pathname), + TP_ARGS(pathname), + TP_STRUCT__entry(__string_from_user(pathname, pathname)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_chdir +SC_TRACE_EVENT(sys_chdir, + TP_PROTO(const char * filename), + TP_ARGS(filename), + TP_STRUCT__entry(__string_from_user(filename, filename)), + TP_fast_assign(tp_copy_string_from_user(filename, filename)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_time +SC_TRACE_EVENT(sys_time, + TP_PROTO(time_t * tloc), + TP_ARGS(tloc), + TP_STRUCT__entry(__field_hex(time_t *, tloc)), + TP_fast_assign(tp_assign(tloc, tloc)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_oldumount +SC_TRACE_EVENT(sys_oldumount, + TP_PROTO(char * name), + TP_ARGS(name), + TP_STRUCT__entry(__string_from_user(name, name)), + TP_fast_assign(tp_copy_string_from_user(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_stime +SC_TRACE_EVENT(sys_stime, + TP_PROTO(time_t * tptr), + TP_ARGS(tptr), + TP_STRUCT__entry(__field_hex(time_t *, tptr)), + TP_fast_assign(tp_assign(tptr, tptr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_rmdir +SC_TRACE_EVENT(sys_rmdir, + TP_PROTO(const char * pathname), + TP_ARGS(pathname), + TP_STRUCT__entry(__string_from_user(pathname, pathname)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_pipe +SC_TRACE_EVENT(sys_pipe, + TP_PROTO(int * fildes), + TP_ARGS(fildes), + TP_STRUCT__entry(__field_hex(int *, fildes)), + TP_fast_assign(tp_assign(fildes, fildes)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_times +SC_TRACE_EVENT(sys_times, + TP_PROTO(struct tms * tbuf), + TP_ARGS(tbuf), + TP_STRUCT__entry(__field_hex(struct tms *, tbuf)), + TP_fast_assign(tp_assign(tbuf, tbuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_acct +SC_TRACE_EVENT(sys_acct, + TP_PROTO(const char * name), + TP_ARGS(name), + TP_STRUCT__entry(__string_from_user(name, name)), + TP_fast_assign(tp_copy_string_from_user(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_olduname +SC_TRACE_EVENT(sys_olduname, + TP_PROTO(struct oldold_utsname * name), + TP_ARGS(name), + TP_STRUCT__entry(__field_hex(struct oldold_utsname *, name)), + TP_fast_assign(tp_assign(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_chroot +SC_TRACE_EVENT(sys_chroot, + TP_PROTO(const char * filename), + TP_ARGS(filename), + TP_STRUCT__entry(__string_from_user(filename, filename)), + TP_fast_assign(tp_copy_string_from_user(filename, filename)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sigpending +SC_TRACE_EVENT(sys_sigpending, + TP_PROTO(old_sigset_t * set), + TP_ARGS(set), + TP_STRUCT__entry(__field_hex(old_sigset_t *, set)), + TP_fast_assign(tp_assign(set, set)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_uselib +SC_TRACE_EVENT(sys_uselib, + TP_PROTO(const char * library), + TP_ARGS(library), + TP_STRUCT__entry(__field_hex(const char *, library)), + TP_fast_assign(tp_assign(library, library)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_uname +SC_TRACE_EVENT(sys_uname, + TP_PROTO(struct old_utsname * name), + TP_ARGS(name), + TP_STRUCT__entry(__field_hex(struct old_utsname *, name)), + TP_fast_assign(tp_assign(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_swapoff +SC_TRACE_EVENT(sys_swapoff, + TP_PROTO(const char * specialfile), + TP_ARGS(specialfile), + TP_STRUCT__entry(__string_from_user(specialfile, specialfile)), + TP_fast_assign(tp_copy_string_from_user(specialfile, specialfile)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sysinfo +SC_TRACE_EVENT(sys_sysinfo, + TP_PROTO(struct sysinfo * info), + TP_ARGS(info), + TP_STRUCT__entry(__field_hex(struct sysinfo *, info)), + TP_fast_assign(tp_assign(info, info)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_newuname +SC_TRACE_EVENT(sys_newuname, + TP_PROTO(struct new_utsname * name), + TP_ARGS(name), + TP_STRUCT__entry(__field_hex(struct new_utsname *, name)), + TP_fast_assign(tp_assign(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_adjtimex +SC_TRACE_EVENT(sys_adjtimex, + TP_PROTO(struct timex * txc_p), + TP_ARGS(txc_p), + TP_STRUCT__entry(__field_hex(struct timex *, txc_p)), + TP_fast_assign(tp_assign(txc_p, txc_p)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sysctl +SC_TRACE_EVENT(sys_sysctl, + TP_PROTO(struct __sysctl_args * args), + TP_ARGS(args), + TP_STRUCT__entry(__field_hex(struct __sysctl_args *, args)), + TP_fast_assign(tp_assign(args, args)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_set_tid_address +SC_TRACE_EVENT(sys_set_tid_address, + TP_PROTO(int * tidptr), + TP_ARGS(tidptr), + TP_STRUCT__entry(__field_hex(int *, tidptr)), + TP_fast_assign(tp_assign(tidptr, tidptr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mq_unlink +SC_TRACE_EVENT(sys_mq_unlink, + TP_PROTO(const char * u_name), + TP_ARGS(u_name), + TP_STRUCT__entry(__string_from_user(u_name, u_name)), + TP_fast_assign(tp_copy_string_from_user(u_name, u_name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_creat +SC_TRACE_EVENT(sys_creat, + TP_PROTO(const char * pathname, int mode), + TP_ARGS(pathname, mode), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field(int, mode)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_link +SC_TRACE_EVENT(sys_link, + TP_PROTO(const char * oldname, const char * newname), + TP_ARGS(oldname, newname), + TP_STRUCT__entry(__string_from_user(oldname, oldname) __string_from_user(newname, newname)), + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_copy_string_from_user(newname, newname)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_chmod +SC_TRACE_EVENT(sys_chmod, + TP_PROTO(const char * filename, mode_t mode), + TP_ARGS(filename, mode), + TP_STRUCT__entry(__string_from_user(filename, filename) __field(mode_t, mode)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_stat +SC_TRACE_EVENT(sys_stat, + TP_PROTO(const char * filename, struct __old_kernel_stat * statbuf), + TP_ARGS(filename, statbuf), + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct __old_kernel_stat *, statbuf)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fstat +SC_TRACE_EVENT(sys_fstat, + TP_PROTO(unsigned int fd, struct __old_kernel_stat * statbuf), + TP_ARGS(fd, statbuf), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct __old_kernel_stat *, statbuf)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(statbuf, statbuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_utime +SC_TRACE_EVENT(sys_utime, + TP_PROTO(char * filename, struct utimbuf * times), + TP_ARGS(filename, times), + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct utimbuf *, times)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(times, times)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_access +SC_TRACE_EVENT(sys_access, + TP_PROTO(const char * filename, int mode), + TP_ARGS(filename, mode), + TP_STRUCT__entry(__string_from_user(filename, filename) __field(int, mode)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_rename +SC_TRACE_EVENT(sys_rename, + TP_PROTO(const char * oldname, const char * newname), + TP_ARGS(oldname, newname), + TP_STRUCT__entry(__string_from_user(oldname, oldname) __string_from_user(newname, newname)), + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_copy_string_from_user(newname, newname)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mkdir +SC_TRACE_EVENT(sys_mkdir, + TP_PROTO(const char * pathname, int mode), + TP_ARGS(pathname, mode), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field(int, mode)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_umount +SC_TRACE_EVENT(sys_umount, + TP_PROTO(char * name, int flags), + TP_ARGS(name, flags), + TP_STRUCT__entry(__string_from_user(name, name) __field(int, flags)), + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_ustat +SC_TRACE_EVENT(sys_ustat, + TP_PROTO(unsigned dev, struct ustat * ubuf), + TP_ARGS(dev, ubuf), + TP_STRUCT__entry(__field(unsigned, dev) __field_hex(struct ustat *, ubuf)), + TP_fast_assign(tp_assign(dev, dev) tp_assign(ubuf, ubuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sethostname +SC_TRACE_EVENT(sys_sethostname, + TP_PROTO(char * name, int len), + TP_ARGS(name, len), + TP_STRUCT__entry(__string_from_user(name, name) __field(int, len)), + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setrlimit +SC_TRACE_EVENT(sys_setrlimit, + TP_PROTO(unsigned int resource, struct rlimit * rlim), + TP_ARGS(resource, rlim), + TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), + TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_old_getrlimit +SC_TRACE_EVENT(sys_old_getrlimit, + TP_PROTO(unsigned int resource, struct rlimit * rlim), + TP_ARGS(resource, rlim), + TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), + TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getrusage +SC_TRACE_EVENT(sys_getrusage, + TP_PROTO(int who, struct rusage * ru), + TP_ARGS(who, ru), + TP_STRUCT__entry(__field(int, who) __field_hex(struct rusage *, ru)), + TP_fast_assign(tp_assign(who, who) tp_assign(ru, ru)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_gettimeofday +SC_TRACE_EVENT(sys_gettimeofday, + TP_PROTO(struct timeval * tv, struct timezone * tz), + TP_ARGS(tv, tz), + TP_STRUCT__entry(__field_hex(struct timeval *, tv) __field_hex(struct timezone *, tz)), + TP_fast_assign(tp_assign(tv, tv) tp_assign(tz, tz)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_settimeofday +SC_TRACE_EVENT(sys_settimeofday, + TP_PROTO(struct timeval * tv, struct timezone * tz), + TP_ARGS(tv, tz), + TP_STRUCT__entry(__field_hex(struct timeval *, tv) __field_hex(struct timezone *, tz)), + TP_fast_assign(tp_assign(tv, tv) tp_assign(tz, tz)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getgroups +SC_TRACE_EVENT(sys_getgroups, + TP_PROTO(int gidsetsize, gid_t * grouplist), + TP_ARGS(gidsetsize, grouplist), + TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(gid_t *, grouplist)), + TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setgroups +SC_TRACE_EVENT(sys_setgroups, + TP_PROTO(int gidsetsize, gid_t * grouplist), + TP_ARGS(gidsetsize, grouplist), + TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(gid_t *, grouplist)), + TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_symlink +SC_TRACE_EVENT(sys_symlink, + TP_PROTO(const char * oldname, const char * newname), + TP_ARGS(oldname, newname), + TP_STRUCT__entry(__string_from_user(oldname, oldname) __string_from_user(newname, newname)), + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_copy_string_from_user(newname, newname)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_lstat +SC_TRACE_EVENT(sys_lstat, + TP_PROTO(const char * filename, struct __old_kernel_stat * statbuf), + TP_ARGS(filename, statbuf), + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct __old_kernel_stat *, statbuf)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_swapon +SC_TRACE_EVENT(sys_swapon, + TP_PROTO(const char * specialfile, int swap_flags), + TP_ARGS(specialfile, swap_flags), + TP_STRUCT__entry(__string_from_user(specialfile, specialfile) __field(int, swap_flags)), + TP_fast_assign(tp_copy_string_from_user(specialfile, specialfile) tp_assign(swap_flags, swap_flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_truncate +SC_TRACE_EVENT(sys_truncate, + TP_PROTO(const char * path, long length), + TP_ARGS(path, length), + TP_STRUCT__entry(__string_from_user(path, path) __field(long, length)), + TP_fast_assign(tp_copy_string_from_user(path, path) tp_assign(length, length)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_statfs +SC_TRACE_EVENT(sys_statfs, + TP_PROTO(const char * pathname, struct statfs * buf), + TP_ARGS(pathname, buf), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(struct statfs *, buf)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(buf, buf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fstatfs +SC_TRACE_EVENT(sys_fstatfs, + TP_PROTO(unsigned int fd, struct statfs * buf), + TP_ARGS(fd, buf), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct statfs *, buf)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_socketcall +SC_TRACE_EVENT(sys_socketcall, + TP_PROTO(int call, unsigned long * args), + TP_ARGS(call, args), + TP_STRUCT__entry(__field(int, call) __field_hex(unsigned long *, args)), + TP_fast_assign(tp_assign(call, call) tp_assign(args, args)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getitimer +SC_TRACE_EVENT(sys_getitimer, + TP_PROTO(int which, struct itimerval * value), + TP_ARGS(which, value), + TP_STRUCT__entry(__field(int, which) __field_hex(struct itimerval *, value)), + TP_fast_assign(tp_assign(which, which) tp_assign(value, value)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_newstat +SC_TRACE_EVENT(sys_newstat, + TP_PROTO(const char * filename, struct stat * statbuf), + TP_ARGS(filename, statbuf), + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat *, statbuf)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_newlstat +SC_TRACE_EVENT(sys_newlstat, + TP_PROTO(const char * filename, struct stat * statbuf), + TP_ARGS(filename, statbuf), + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat *, statbuf)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_newfstat +SC_TRACE_EVENT(sys_newfstat, + TP_PROTO(unsigned int fd, struct stat * statbuf), + TP_ARGS(fd, statbuf), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct stat *, statbuf)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(statbuf, statbuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setdomainname +SC_TRACE_EVENT(sys_setdomainname, + TP_PROTO(char * name, int len), + TP_ARGS(name, len), + TP_STRUCT__entry(__string_from_user(name, name) __field(int, len)), + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_delete_module +SC_TRACE_EVENT(sys_delete_module, + TP_PROTO(const char * name_user, unsigned int flags), + TP_ARGS(name_user, flags), + TP_STRUCT__entry(__string_from_user(name_user, name_user) __field(unsigned int, flags)), + TP_fast_assign(tp_copy_string_from_user(name_user, name_user) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sched_setparam +SC_TRACE_EVENT(sys_sched_setparam, + TP_PROTO(pid_t pid, struct sched_param * param), + TP_ARGS(pid, param), + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct sched_param *, param)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(param, param)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sched_getparam +SC_TRACE_EVENT(sys_sched_getparam, + TP_PROTO(pid_t pid, struct sched_param * param), + TP_ARGS(pid, param), + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct sched_param *, param)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(param, param)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sched_rr_get_interval +SC_TRACE_EVENT(sys_sched_rr_get_interval, + TP_PROTO(pid_t pid, struct timespec * interval), + TP_ARGS(pid, interval), + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct timespec *, interval)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(interval, interval)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_nanosleep +SC_TRACE_EVENT(sys_nanosleep, + TP_PROTO(struct timespec * rqtp, struct timespec * rmtp), + TP_ARGS(rqtp, rmtp), + TP_STRUCT__entry(__field_hex(struct timespec *, rqtp) __field_hex(struct timespec *, rmtp)), + TP_fast_assign(tp_assign(rqtp, rqtp) tp_assign(rmtp, rmtp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_rt_sigpending +SC_TRACE_EVENT(sys_rt_sigpending, + TP_PROTO(sigset_t * set, size_t sigsetsize), + TP_ARGS(set, sigsetsize), + TP_STRUCT__entry(__field_hex(sigset_t *, set) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(set, set) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_rt_sigsuspend +SC_TRACE_EVENT(sys_rt_sigsuspend, + TP_PROTO(sigset_t * unewset, size_t sigsetsize), + TP_ARGS(unewset, sigsetsize), + TP_STRUCT__entry(__field_hex(sigset_t *, unewset) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(unewset, unewset) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getcwd +SC_TRACE_EVENT(sys_getcwd, + TP_PROTO(char * buf, unsigned long size), + TP_ARGS(buf, size), + TP_STRUCT__entry(__field_hex(char *, buf) __field(unsigned long, size)), + TP_fast_assign(tp_assign(buf, buf) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getrlimit +SC_TRACE_EVENT(sys_getrlimit, + TP_PROTO(unsigned int resource, struct rlimit * rlim), + TP_ARGS(resource, rlim), + TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), + TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_stat64 +SC_TRACE_EVENT(sys_stat64, + TP_PROTO(const char * filename, struct stat64 * statbuf), + TP_ARGS(filename, statbuf), + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat64 *, statbuf)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_lstat64 +SC_TRACE_EVENT(sys_lstat64, + TP_PROTO(const char * filename, struct stat64 * statbuf), + TP_ARGS(filename, statbuf), + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat64 *, statbuf)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fstat64 +SC_TRACE_EVENT(sys_fstat64, + TP_PROTO(unsigned long fd, struct stat64 * statbuf), + TP_ARGS(fd, statbuf), + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(struct stat64 *, statbuf)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(statbuf, statbuf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_pivot_root +SC_TRACE_EVENT(sys_pivot_root, + TP_PROTO(const char * new_root, const char * put_old), + TP_ARGS(new_root, put_old), + TP_STRUCT__entry(__string_from_user(new_root, new_root) __string_from_user(put_old, put_old)), + TP_fast_assign(tp_copy_string_from_user(new_root, new_root) tp_copy_string_from_user(put_old, put_old)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_removexattr +SC_TRACE_EVENT(sys_removexattr, + TP_PROTO(const char * pathname, const char * name), + TP_ARGS(pathname, name), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_lremovexattr +SC_TRACE_EVENT(sys_lremovexattr, + TP_PROTO(const char * pathname, const char * name), + TP_ARGS(pathname, name), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fremovexattr +SC_TRACE_EVENT(sys_fremovexattr, + TP_PROTO(int fd, const char * name), + TP_ARGS(fd, name), + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name)), + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_io_setup +SC_TRACE_EVENT(sys_io_setup, + TP_PROTO(unsigned nr_events, aio_context_t * ctxp), + TP_ARGS(nr_events, ctxp), + TP_STRUCT__entry(__field(unsigned, nr_events) __field_hex(aio_context_t *, ctxp)), + TP_fast_assign(tp_assign(nr_events, nr_events) tp_assign(ctxp, ctxp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_timer_gettime +SC_TRACE_EVENT(sys_timer_gettime, + TP_PROTO(timer_t timer_id, struct itimerspec * setting), + TP_ARGS(timer_id, setting), + TP_STRUCT__entry(__field(timer_t, timer_id) __field_hex(struct itimerspec *, setting)), + TP_fast_assign(tp_assign(timer_id, timer_id) tp_assign(setting, setting)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_clock_settime +SC_TRACE_EVENT(sys_clock_settime, + TP_PROTO(const clockid_t which_clock, const struct timespec * tp), + TP_ARGS(which_clock, tp), + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(const struct timespec *, tp)), + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_clock_gettime +SC_TRACE_EVENT(sys_clock_gettime, + TP_PROTO(const clockid_t which_clock, struct timespec * tp), + TP_ARGS(which_clock, tp), + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timespec *, tp)), + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_clock_getres +SC_TRACE_EVENT(sys_clock_getres, + TP_PROTO(const clockid_t which_clock, struct timespec * tp), + TP_ARGS(which_clock, tp), + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timespec *, tp)), + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_utimes +SC_TRACE_EVENT(sys_utimes, + TP_PROTO(char * filename, struct timeval * utimes), + TP_ARGS(filename, utimes), + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct timeval *, utimes)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mq_notify +SC_TRACE_EVENT(sys_mq_notify, + TP_PROTO(mqd_t mqdes, const struct sigevent * u_notification), + TP_ARGS(mqdes, u_notification), + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const struct sigevent *, u_notification)), + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_notification, u_notification)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_set_robust_list +SC_TRACE_EVENT(sys_set_robust_list, + TP_PROTO(struct robust_list_head * head, size_t len), + TP_ARGS(head, len), + TP_STRUCT__entry(__field_hex(struct robust_list_head *, head) __field(size_t, len)), + TP_fast_assign(tp_assign(head, head) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_timerfd_gettime +SC_TRACE_EVENT(sys_timerfd_gettime, + TP_PROTO(int ufd, struct itimerspec * otmr), + TP_ARGS(ufd, otmr), + TP_STRUCT__entry(__field(int, ufd) __field_hex(struct itimerspec *, otmr)), + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(otmr, otmr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_pipe2 +SC_TRACE_EVENT(sys_pipe2, + TP_PROTO(int * fildes, int flags), + TP_ARGS(fildes, flags), + TP_STRUCT__entry(__field_hex(int *, fildes) __field(int, flags)), + TP_fast_assign(tp_assign(fildes, fildes) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_clock_adjtime +SC_TRACE_EVENT(sys_clock_adjtime, + TP_PROTO(const clockid_t which_clock, struct timex * utx), + TP_ARGS(which_clock, utx), + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timex *, utx)), + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(utx, utx)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_read +SC_TRACE_EVENT(sys_read, + TP_PROTO(unsigned int fd, char * buf, size_t count), + TP_ARGS(fd, buf, count), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(char *, buf) __field(size_t, count)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_write +SC_TRACE_EVENT(sys_write, + TP_PROTO(unsigned int fd, const char * buf, size_t count), + TP_ARGS(fd, buf, count), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_open +SC_TRACE_EVENT(sys_open, + TP_PROTO(const char * filename, int flags, int mode), + TP_ARGS(filename, flags, mode), + TP_STRUCT__entry(__string_from_user(filename, filename) __field(int, flags) __field(int, mode)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(flags, flags) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_waitpid +SC_TRACE_EVENT(sys_waitpid, + TP_PROTO(pid_t pid, int * stat_addr, int options), + TP_ARGS(pid, stat_addr, options), + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(int *, stat_addr) __field(int, options)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(stat_addr, stat_addr) tp_assign(options, options)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mknod +SC_TRACE_EVENT(sys_mknod, + TP_PROTO(const char * filename, int mode, unsigned dev), + TP_ARGS(filename, mode, dev), + TP_STRUCT__entry(__string_from_user(filename, filename) __field(int, mode) __field(unsigned, dev)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(mode, mode) tp_assign(dev, dev)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_lchown +SC_TRACE_EVENT(sys_lchown, + TP_PROTO(const char * filename, uid_t user, gid_t group), + TP_ARGS(filename, user, group), + TP_STRUCT__entry(__string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_readlink +SC_TRACE_EVENT(sys_readlink, + TP_PROTO(const char * path, char * buf, int bufsiz), + TP_ARGS(path, buf, bufsiz), + TP_STRUCT__entry(__string_from_user(path, path) __field_hex(char *, buf) __field(int, bufsiz)), + TP_fast_assign(tp_copy_string_from_user(path, path) tp_assign(buf, buf) tp_assign(bufsiz, bufsiz)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_old_readdir +SC_TRACE_EVENT(sys_old_readdir, + TP_PROTO(unsigned int fd, struct old_linux_dirent * dirent, unsigned int count), + TP_ARGS(fd, dirent, count), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct old_linux_dirent *, dirent) __field(unsigned int, count)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(dirent, dirent) tp_assign(count, count)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_syslog +SC_TRACE_EVENT(sys_syslog, + TP_PROTO(int type, char * buf, int len), + TP_ARGS(type, buf, len), + TP_STRUCT__entry(__field(int, type) __field_hex(char *, buf) __field(int, len)), + TP_fast_assign(tp_assign(type, type) tp_assign(buf, buf) tp_assign(len, len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setitimer +SC_TRACE_EVENT(sys_setitimer, + TP_PROTO(int which, struct itimerval * value, struct itimerval * ovalue), + TP_ARGS(which, value, ovalue), + TP_STRUCT__entry(__field(int, which) __field_hex(struct itimerval *, value) __field_hex(struct itimerval *, ovalue)), + TP_fast_assign(tp_assign(which, which) tp_assign(value, value) tp_assign(ovalue, ovalue)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sigprocmask +SC_TRACE_EVENT(sys_sigprocmask, + TP_PROTO(int how, old_sigset_t * nset, old_sigset_t * oset), + TP_ARGS(how, nset, oset), + TP_STRUCT__entry(__field(int, how) __field_hex(old_sigset_t *, nset) __field_hex(old_sigset_t *, oset)), + TP_fast_assign(tp_assign(how, how) tp_assign(nset, nset) tp_assign(oset, oset)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_init_module +SC_TRACE_EVENT(sys_init_module, + TP_PROTO(void * umod, unsigned long len, const char * uargs), + TP_ARGS(umod, len, uargs), + TP_STRUCT__entry(__field_hex(void *, umod) __field(unsigned long, len) __field_hex(const char *, uargs)), + TP_fast_assign(tp_assign(umod, umod) tp_assign(len, len) tp_assign(uargs, uargs)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getdents +SC_TRACE_EVENT(sys_getdents, + TP_PROTO(unsigned int fd, struct linux_dirent * dirent, unsigned int count), + TP_ARGS(fd, dirent, count), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct linux_dirent *, dirent) __field(unsigned int, count)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(dirent, dirent) tp_assign(count, count)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_readv +SC_TRACE_EVENT(sys_readv, + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen), + TP_ARGS(fd, vec, vlen), + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_writev +SC_TRACE_EVENT(sys_writev, + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen), + TP_ARGS(fd, vec, vlen), + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sched_setscheduler +SC_TRACE_EVENT(sys_sched_setscheduler, + TP_PROTO(pid_t pid, int policy, struct sched_param * param), + TP_ARGS(pid, policy, param), + TP_STRUCT__entry(__field(pid_t, pid) __field(int, policy) __field_hex(struct sched_param *, param)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(policy, policy) tp_assign(param, param)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getresuid +SC_TRACE_EVENT(sys_getresuid, + TP_PROTO(uid_t * ruid, uid_t * euid, uid_t * suid), + TP_ARGS(ruid, euid, suid), + TP_STRUCT__entry(__field_hex(uid_t *, ruid) __field_hex(uid_t *, euid) __field_hex(uid_t *, suid)), + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_poll +SC_TRACE_EVENT(sys_poll, + TP_PROTO(struct pollfd * ufds, unsigned int nfds, long timeout_msecs), + TP_ARGS(ufds, nfds, timeout_msecs), + TP_STRUCT__entry(__field_hex(struct pollfd *, ufds) __field(unsigned int, nfds) __field(long, timeout_msecs)), + TP_fast_assign(tp_assign(ufds, ufds) tp_assign(nfds, nfds) tp_assign(timeout_msecs, timeout_msecs)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_nfsservctl +SC_TRACE_EVENT(sys_nfsservctl, + TP_PROTO(int cmd, struct nfsctl_arg * arg, void * res), + TP_ARGS(cmd, arg, res), + TP_STRUCT__entry(__field(int, cmd) __field_hex(struct nfsctl_arg *, arg) __field_hex(void *, res)), + TP_fast_assign(tp_assign(cmd, cmd) tp_assign(arg, arg) tp_assign(res, res)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getresgid +SC_TRACE_EVENT(sys_getresgid, + TP_PROTO(gid_t * rgid, gid_t * egid, gid_t * sgid), + TP_ARGS(rgid, egid, sgid), + TP_STRUCT__entry(__field_hex(gid_t *, rgid) __field_hex(gid_t *, egid) __field_hex(gid_t *, sgid)), + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_rt_sigqueueinfo +SC_TRACE_EVENT(sys_rt_sigqueueinfo, + TP_PROTO(pid_t pid, int sig, siginfo_t * uinfo), + TP_ARGS(pid, sig, uinfo), + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig) __field_hex(siginfo_t *, uinfo)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig) tp_assign(uinfo, uinfo)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_chown +SC_TRACE_EVENT(sys_chown, + TP_PROTO(const char * filename, uid_t user, gid_t group), + TP_ARGS(filename, user, group), + TP_STRUCT__entry(__string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group)), + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getdents64 +SC_TRACE_EVENT(sys_getdents64, + TP_PROTO(unsigned int fd, struct linux_dirent64 * dirent, unsigned int count), + TP_ARGS(fd, dirent, count), + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct linux_dirent64 *, dirent) __field(unsigned int, count)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(dirent, dirent) tp_assign(count, count)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mincore +SC_TRACE_EVENT(sys_mincore, + TP_PROTO(unsigned long start, size_t len, unsigned char * vec), + TP_ARGS(start, len, vec), + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field_hex(unsigned char *, vec)), + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(vec, vec)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_listxattr +SC_TRACE_EVENT(sys_listxattr, + TP_PROTO(const char * pathname, char * list, size_t size), + TP_ARGS(pathname, list, size), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(char *, list) __field(size_t, size)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(list, list) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_llistxattr +SC_TRACE_EVENT(sys_llistxattr, + TP_PROTO(const char * pathname, char * list, size_t size), + TP_ARGS(pathname, list, size), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(char *, list) __field(size_t, size)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(list, list) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_flistxattr +SC_TRACE_EVENT(sys_flistxattr, + TP_PROTO(int fd, char * list, size_t size), + TP_ARGS(fd, list, size), + TP_STRUCT__entry(__field(int, fd) __field_hex(char *, list) __field(size_t, size)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(list, list) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sched_setaffinity +SC_TRACE_EVENT(sys_sched_setaffinity, + TP_PROTO(pid_t pid, unsigned int len, unsigned long * user_mask_ptr), + TP_ARGS(pid, len, user_mask_ptr), + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, len) __field_hex(unsigned long *, user_mask_ptr)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(len, len) tp_assign(user_mask_ptr, user_mask_ptr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sched_getaffinity +SC_TRACE_EVENT(sys_sched_getaffinity, + TP_PROTO(pid_t pid, unsigned int len, unsigned long * user_mask_ptr), + TP_ARGS(pid, len, user_mask_ptr), + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, len) __field_hex(unsigned long *, user_mask_ptr)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(len, len) tp_assign(user_mask_ptr, user_mask_ptr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_io_submit +SC_TRACE_EVENT(sys_io_submit, + TP_PROTO(aio_context_t ctx_id, long nr, struct iocb * * iocbpp), + TP_ARGS(ctx_id, nr, iocbpp), + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field(long, nr) __field_hex(struct iocb * *, iocbpp)), + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(nr, nr) tp_assign(iocbpp, iocbpp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_io_cancel +SC_TRACE_EVENT(sys_io_cancel, + TP_PROTO(aio_context_t ctx_id, struct iocb * iocb, struct io_event * result), + TP_ARGS(ctx_id, iocb, result), + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field_hex(struct iocb *, iocb) __field_hex(struct io_event *, result)), + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(iocb, iocb) tp_assign(result, result)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_timer_create +SC_TRACE_EVENT(sys_timer_create, + TP_PROTO(const clockid_t which_clock, struct sigevent * timer_event_spec, timer_t * created_timer_id), + TP_ARGS(which_clock, timer_event_spec, created_timer_id), + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct sigevent *, timer_event_spec) __field_hex(timer_t *, created_timer_id)), + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(timer_event_spec, timer_event_spec) tp_assign(created_timer_id, created_timer_id)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_statfs64 +SC_TRACE_EVENT(sys_statfs64, + TP_PROTO(const char * pathname, size_t sz, struct statfs64 * buf), + TP_ARGS(pathname, sz, buf), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field(size_t, sz) __field_hex(struct statfs64 *, buf)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(sz, sz) tp_assign(buf, buf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fstatfs64 +SC_TRACE_EVENT(sys_fstatfs64, + TP_PROTO(unsigned int fd, size_t sz, struct statfs64 * buf), + TP_ARGS(fd, sz, buf), + TP_STRUCT__entry(__field(unsigned int, fd) __field(size_t, sz) __field_hex(struct statfs64 *, buf)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(sz, sz) tp_assign(buf, buf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mq_getsetattr +SC_TRACE_EVENT(sys_mq_getsetattr, + TP_PROTO(mqd_t mqdes, const struct mq_attr * u_mqstat, struct mq_attr * u_omqstat), + TP_ARGS(mqdes, u_mqstat, u_omqstat), + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const struct mq_attr *, u_mqstat) __field_hex(struct mq_attr *, u_omqstat)), + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_mqstat, u_mqstat) tp_assign(u_omqstat, u_omqstat)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_inotify_add_watch +SC_TRACE_EVENT(sys_inotify_add_watch, + TP_PROTO(int fd, const char * pathname, u32 mask), + TP_ARGS(fd, pathname, mask), + TP_STRUCT__entry(__field(int, fd) __string_from_user(pathname, pathname) __field(u32, mask)), + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(pathname, pathname) tp_assign(mask, mask)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mkdirat +SC_TRACE_EVENT(sys_mkdirat, + TP_PROTO(int dfd, const char * pathname, int mode), + TP_ARGS(dfd, pathname, mode), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field(int, mode)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_futimesat +SC_TRACE_EVENT(sys_futimesat, + TP_PROTO(int dfd, const char * filename, struct timeval * utimes), + TP_ARGS(dfd, filename, utimes), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct timeval *, utimes)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_unlinkat +SC_TRACE_EVENT(sys_unlinkat, + TP_PROTO(int dfd, const char * pathname, int flag), + TP_ARGS(dfd, pathname, flag), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field(int, flag)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(flag, flag)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_symlinkat +SC_TRACE_EVENT(sys_symlinkat, + TP_PROTO(const char * oldname, int newdfd, const char * newname), + TP_ARGS(oldname, newdfd, newname), + TP_STRUCT__entry(__string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname)), + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fchmodat +SC_TRACE_EVENT(sys_fchmodat, + TP_PROTO(int dfd, const char * filename, mode_t mode), + TP_ARGS(dfd, filename, mode), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(mode_t, mode)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_faccessat +SC_TRACE_EVENT(sys_faccessat, + TP_PROTO(int dfd, const char * filename, int mode), + TP_ARGS(dfd, filename, mode), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, mode)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_get_robust_list +SC_TRACE_EVENT(sys_get_robust_list, + TP_PROTO(int pid, struct robust_list_head * * head_ptr, size_t * len_ptr), + TP_ARGS(pid, head_ptr, len_ptr), + TP_STRUCT__entry(__field(int, pid) __field_hex(struct robust_list_head * *, head_ptr) __field_hex(size_t *, len_ptr)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(head_ptr, head_ptr) tp_assign(len_ptr, len_ptr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getcpu +SC_TRACE_EVENT(sys_getcpu, + TP_PROTO(unsigned * cpup, unsigned * nodep, struct getcpu_cache * unused), + TP_ARGS(cpup, nodep, unused), + TP_STRUCT__entry(__field_hex(unsigned *, cpup) __field_hex(unsigned *, nodep) __field_hex(struct getcpu_cache *, unused)), + TP_fast_assign(tp_assign(cpup, cpup) tp_assign(nodep, nodep) tp_assign(unused, unused)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_signalfd +SC_TRACE_EVENT(sys_signalfd, + TP_PROTO(int ufd, sigset_t * user_mask, size_t sizemask), + TP_ARGS(ufd, user_mask, sizemask), + TP_STRUCT__entry(__field(int, ufd) __field_hex(sigset_t *, user_mask) __field(size_t, sizemask)), + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(user_mask, user_mask) tp_assign(sizemask, sizemask)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_bind +SC_TRACE_EVENT(sys_bind, + TP_PROTO(int fd, struct sockaddr * umyaddr, int addrlen), + TP_ARGS(fd, umyaddr, addrlen), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, umyaddr) __field_hex(int, addrlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(umyaddr, umyaddr) tp_assign(addrlen, addrlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_connect +SC_TRACE_EVENT(sys_connect, + TP_PROTO(int fd, struct sockaddr * uservaddr, int addrlen), + TP_ARGS(fd, uservaddr, addrlen), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, uservaddr) __field_hex(int, addrlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(uservaddr, uservaddr) tp_assign(addrlen, addrlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_accept +SC_TRACE_EVENT(sys_accept, + TP_PROTO(int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen), + TP_ARGS(fd, upeer_sockaddr, upeer_addrlen), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, upeer_sockaddr) __field_hex(int *, upeer_addrlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(upeer_sockaddr, upeer_sockaddr) tp_assign(upeer_addrlen, upeer_addrlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getsockname +SC_TRACE_EVENT(sys_getsockname, + TP_PROTO(int fd, struct sockaddr * usockaddr, int * usockaddr_len), + TP_ARGS(fd, usockaddr, usockaddr_len), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, usockaddr) __field_hex(int *, usockaddr_len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(usockaddr, usockaddr) tp_assign(usockaddr_len, usockaddr_len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getpeername +SC_TRACE_EVENT(sys_getpeername, + TP_PROTO(int fd, struct sockaddr * usockaddr, int * usockaddr_len), + TP_ARGS(fd, usockaddr, usockaddr_len), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, usockaddr) __field_hex(int *, usockaddr_len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(usockaddr, usockaddr) tp_assign(usockaddr_len, usockaddr_len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sendmsg +SC_TRACE_EVENT(sys_sendmsg, + TP_PROTO(int fd, struct msghdr * msg, unsigned flags), + TP_ARGS(fd, msg, flags), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct msghdr *, msg) __field(unsigned, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(msg, msg) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_recvmsg +SC_TRACE_EVENT(sys_recvmsg, + TP_PROTO(int fd, struct msghdr * msg, unsigned int flags), + TP_ARGS(fd, msg, flags), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct msghdr *, msg) __field(unsigned int, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(msg, msg) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_reboot +SC_TRACE_EVENT(sys_reboot, + TP_PROTO(int magic1, int magic2, unsigned int cmd, void * arg), + TP_ARGS(magic1, magic2, cmd, arg), + TP_STRUCT__entry(__field(int, magic1) __field(int, magic2) __field(unsigned int, cmd) __field_hex(void *, arg)), + TP_fast_assign(tp_assign(magic1, magic1) tp_assign(magic2, magic2) tp_assign(cmd, cmd) tp_assign(arg, arg)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_wait4 +SC_TRACE_EVENT(sys_wait4, + TP_PROTO(pid_t upid, int * stat_addr, int options, struct rusage * ru), + TP_ARGS(upid, stat_addr, options, ru), + TP_STRUCT__entry(__field(pid_t, upid) __field_hex(int *, stat_addr) __field(int, options) __field_hex(struct rusage *, ru)), + TP_fast_assign(tp_assign(upid, upid) tp_assign(stat_addr, stat_addr) tp_assign(options, options) tp_assign(ru, ru)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_rt_sigaction +SC_TRACE_EVENT(sys_rt_sigaction, + TP_PROTO(int sig, const struct sigaction * act, struct sigaction * oact, size_t sigsetsize), + TP_ARGS(sig, act, oact, sigsetsize), + TP_STRUCT__entry(__field(int, sig) __field_hex(const struct sigaction *, act) __field_hex(struct sigaction *, oact) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(sig, sig) tp_assign(act, act) tp_assign(oact, oact) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_rt_sigprocmask +SC_TRACE_EVENT(sys_rt_sigprocmask, + TP_PROTO(int how, sigset_t * nset, sigset_t * oset, size_t sigsetsize), + TP_ARGS(how, nset, oset, sigsetsize), + TP_STRUCT__entry(__field(int, how) __field_hex(sigset_t *, nset) __field_hex(sigset_t *, oset) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(how, how) tp_assign(nset, nset) tp_assign(oset, oset) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_rt_sigtimedwait +SC_TRACE_EVENT(sys_rt_sigtimedwait, + TP_PROTO(const sigset_t * uthese, siginfo_t * uinfo, const struct timespec * uts, size_t sigsetsize), + TP_ARGS(uthese, uinfo, uts, sigsetsize), + TP_STRUCT__entry(__field_hex(const sigset_t *, uthese) __field_hex(siginfo_t *, uinfo) __field_hex(const struct timespec *, uts) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(uthese, uthese) tp_assign(uinfo, uinfo) tp_assign(uts, uts) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sendfile +SC_TRACE_EVENT(sys_sendfile, + TP_PROTO(int out_fd, int in_fd, off_t * offset, size_t count), + TP_ARGS(out_fd, in_fd, offset, count), + TP_STRUCT__entry(__field(int, out_fd) __field(int, in_fd) __field_hex(off_t *, offset) __field(size_t, count)), + TP_fast_assign(tp_assign(out_fd, out_fd) tp_assign(in_fd, in_fd) tp_assign(offset, offset) tp_assign(count, count)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getxattr +SC_TRACE_EVENT(sys_getxattr, + TP_PROTO(const char * pathname, const char * name, void * value, size_t size), + TP_ARGS(pathname, name, value, size), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_lgetxattr +SC_TRACE_EVENT(sys_lgetxattr, + TP_PROTO(const char * pathname, const char * name, void * value, size_t size), + TP_ARGS(pathname, name, value, size), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fgetxattr +SC_TRACE_EVENT(sys_fgetxattr, + TP_PROTO(int fd, const char * name, void * value, size_t size), + TP_ARGS(fd, name, value, size), + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sendfile64 +SC_TRACE_EVENT(sys_sendfile64, + TP_PROTO(int out_fd, int in_fd, loff_t * offset, size_t count), + TP_ARGS(out_fd, in_fd, offset, count), + TP_STRUCT__entry(__field(int, out_fd) __field(int, in_fd) __field_hex(loff_t *, offset) __field(size_t, count)), + TP_fast_assign(tp_assign(out_fd, out_fd) tp_assign(in_fd, in_fd) tp_assign(offset, offset) tp_assign(count, count)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_epoll_ctl +SC_TRACE_EVENT(sys_epoll_ctl, + TP_PROTO(int epfd, int op, int fd, struct epoll_event * event), + TP_ARGS(epfd, op, fd, event), + TP_STRUCT__entry(__field(int, epfd) __field(int, op) __field(int, fd) __field_hex(struct epoll_event *, event)), + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(op, op) tp_assign(fd, fd) tp_assign(event, event)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_epoll_wait +SC_TRACE_EVENT(sys_epoll_wait, + TP_PROTO(int epfd, struct epoll_event * events, int maxevents, int timeout), + TP_ARGS(epfd, events, maxevents, timeout), + TP_STRUCT__entry(__field(int, epfd) __field_hex(struct epoll_event *, events) __field(int, maxevents) __field(int, timeout)), + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(events, events) tp_assign(maxevents, maxevents) tp_assign(timeout, timeout)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_timer_settime +SC_TRACE_EVENT(sys_timer_settime, + TP_PROTO(timer_t timer_id, int flags, const struct itimerspec * new_setting, struct itimerspec * old_setting), + TP_ARGS(timer_id, flags, new_setting, old_setting), + TP_STRUCT__entry(__field(timer_t, timer_id) __field(int, flags) __field_hex(const struct itimerspec *, new_setting) __field_hex(struct itimerspec *, old_setting)), + TP_fast_assign(tp_assign(timer_id, timer_id) tp_assign(flags, flags) tp_assign(new_setting, new_setting) tp_assign(old_setting, old_setting)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_clock_nanosleep +SC_TRACE_EVENT(sys_clock_nanosleep, + TP_PROTO(const clockid_t which_clock, int flags, const struct timespec * rqtp, struct timespec * rmtp), + TP_ARGS(which_clock, flags, rqtp, rmtp), + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field(int, flags) __field_hex(const struct timespec *, rqtp) __field_hex(struct timespec *, rmtp)), + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(flags, flags) tp_assign(rqtp, rqtp) tp_assign(rmtp, rmtp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mq_open +SC_TRACE_EVENT(sys_mq_open, + TP_PROTO(const char * u_name, int oflag, mode_t mode, struct mq_attr * u_attr), + TP_ARGS(u_name, oflag, mode, u_attr), + TP_STRUCT__entry(__string_from_user(u_name, u_name) __field(int, oflag) __field(mode_t, mode) __field_hex(struct mq_attr *, u_attr)), + TP_fast_assign(tp_copy_string_from_user(u_name, u_name) tp_assign(oflag, oflag) tp_assign(mode, mode) tp_assign(u_attr, u_attr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_request_key +SC_TRACE_EVENT(sys_request_key, + TP_PROTO(const char * _type, const char * _description, const char * _callout_info, key_serial_t destringid), + TP_ARGS(_type, _description, _callout_info, destringid), + TP_STRUCT__entry(__string_from_user(_type, _type) __field_hex(const char *, _description) __field_hex(const char *, _callout_info) __field(key_serial_t, destringid)), + TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_callout_info, _callout_info) tp_assign(destringid, destringid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_vmsplice +SC_TRACE_EVENT(sys_vmsplice, + TP_PROTO(int fd, const struct iovec * iov, unsigned long nr_segs, unsigned int flags), + TP_ARGS(fd, iov, nr_segs, flags), + TP_STRUCT__entry(__field(int, fd) __field_hex(const struct iovec *, iov) __field(unsigned long, nr_segs) __field(unsigned int, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(iov, iov) tp_assign(nr_segs, nr_segs) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_openat +SC_TRACE_EVENT(sys_openat, + TP_PROTO(int dfd, const char * filename, int flags, int mode), + TP_ARGS(dfd, filename, flags, mode), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, flags) __field(int, mode)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(flags, flags) tp_assign(mode, mode)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mknodat +SC_TRACE_EVENT(sys_mknodat, + TP_PROTO(int dfd, const char * filename, int mode, unsigned dev), + TP_ARGS(dfd, filename, mode, dev), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, mode) __field(unsigned, dev)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode) tp_assign(dev, dev)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fstatat64 +SC_TRACE_EVENT(sys_fstatat64, + TP_PROTO(int dfd, const char * filename, struct stat64 * statbuf, int flag), + TP_ARGS(dfd, filename, statbuf, flag), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct stat64 *, statbuf) __field(int, flag)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf) tp_assign(flag, flag)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_renameat +SC_TRACE_EVENT(sys_renameat, + TP_PROTO(int olddfd, const char * oldname, int newdfd, const char * newname), + TP_ARGS(olddfd, oldname, newdfd, newname), + TP_STRUCT__entry(__field(int, olddfd) __string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname)), + TP_fast_assign(tp_assign(olddfd, olddfd) tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_readlinkat +SC_TRACE_EVENT(sys_readlinkat, + TP_PROTO(int dfd, const char * pathname, char * buf, int bufsiz), + TP_ARGS(dfd, pathname, buf, bufsiz), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field_hex(char *, buf) __field(int, bufsiz)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(buf, buf) tp_assign(bufsiz, bufsiz)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_utimensat +SC_TRACE_EVENT(sys_utimensat, + TP_PROTO(int dfd, const char * filename, struct timespec * utimes, int flags), + TP_ARGS(dfd, filename, utimes, flags), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct timespec *, utimes) __field(int, flags)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_timerfd_settime +SC_TRACE_EVENT(sys_timerfd_settime, + TP_PROTO(int ufd, int flags, const struct itimerspec * utmr, struct itimerspec * otmr), + TP_ARGS(ufd, flags, utmr, otmr), + TP_STRUCT__entry(__field(int, ufd) __field(int, flags) __field_hex(const struct itimerspec *, utmr) __field_hex(struct itimerspec *, otmr)), + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(flags, flags) tp_assign(utmr, utmr) tp_assign(otmr, otmr)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_signalfd4 +SC_TRACE_EVENT(sys_signalfd4, + TP_PROTO(int ufd, sigset_t * user_mask, size_t sizemask, int flags), + TP_ARGS(ufd, user_mask, sizemask, flags), + TP_STRUCT__entry(__field(int, ufd) __field_hex(sigset_t *, user_mask) __field(size_t, sizemask) __field(int, flags)), + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(user_mask, user_mask) tp_assign(sizemask, sizemask) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_rt_tgsigqueueinfo +SC_TRACE_EVENT(sys_rt_tgsigqueueinfo, + TP_PROTO(pid_t tgid, pid_t pid, int sig, siginfo_t * uinfo), + TP_ARGS(tgid, pid, sig, uinfo), + TP_STRUCT__entry(__field(pid_t, tgid) __field(pid_t, pid) __field(int, sig) __field_hex(siginfo_t *, uinfo)), + TP_fast_assign(tp_assign(tgid, tgid) tp_assign(pid, pid) tp_assign(sig, sig) tp_assign(uinfo, uinfo)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_prlimit64 +SC_TRACE_EVENT(sys_prlimit64, + TP_PROTO(pid_t pid, unsigned int resource, const struct rlimit64 * new_rlim, struct rlimit64 * old_rlim), + TP_ARGS(pid, resource, new_rlim, old_rlim), + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, resource) __field_hex(const struct rlimit64 *, new_rlim) __field_hex(struct rlimit64 *, old_rlim)), + TP_fast_assign(tp_assign(pid, pid) tp_assign(resource, resource) tp_assign(new_rlim, new_rlim) tp_assign(old_rlim, old_rlim)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_socketpair +SC_TRACE_EVENT(sys_socketpair, + TP_PROTO(int family, int type, int protocol, int * usockvec), + TP_ARGS(family, type, protocol, usockvec), + TP_STRUCT__entry(__field(int, family) __field(int, type) __field(int, protocol) __field_hex(int *, usockvec)), + TP_fast_assign(tp_assign(family, family) tp_assign(type, type) tp_assign(protocol, protocol) tp_assign(usockvec, usockvec)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_send +SC_TRACE_EVENT(sys_send, + TP_PROTO(int fd, void * buff, size_t len, unsigned flags), + TP_ARGS(fd, buff, len, flags), + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, buff) __field(size_t, len) __field(unsigned, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buff, buff) tp_assign(len, len) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_accept4 +SC_TRACE_EVENT(sys_accept4, + TP_PROTO(int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen, int flags), + TP_ARGS(fd, upeer_sockaddr, upeer_addrlen, flags), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, upeer_sockaddr) __field_hex(int *, upeer_addrlen) __field(int, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(upeer_sockaddr, upeer_sockaddr) tp_assign(upeer_addrlen, upeer_addrlen) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sendmmsg +SC_TRACE_EVENT(sys_sendmmsg, + TP_PROTO(int fd, struct mmsghdr * mmsg, unsigned int vlen, unsigned int flags), + TP_ARGS(fd, mmsg, vlen, flags), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct mmsghdr *, mmsg) __field(unsigned int, vlen) __field(unsigned int, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(mmsg, mmsg) tp_assign(vlen, vlen) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mount +SC_TRACE_EVENT(sys_mount, + TP_PROTO(char * dev_name, char * dir_name, char * type, unsigned long flags, void * data), + TP_ARGS(dev_name, dir_name, type, flags, data), + TP_STRUCT__entry(__string_from_user(dev_name, dev_name) __string_from_user(dir_name, dir_name) __string_from_user(type, type) __field(unsigned long, flags) __field_hex(void *, data)), + TP_fast_assign(tp_copy_string_from_user(dev_name, dev_name) tp_copy_string_from_user(dir_name, dir_name) tp_copy_string_from_user(type, type) tp_assign(flags, flags) tp_assign(data, data)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_llseek +SC_TRACE_EVENT(sys_llseek, + TP_PROTO(unsigned int fd, unsigned long offset_high, unsigned long offset_low, loff_t * result, unsigned int origin), + TP_ARGS(fd, offset_high, offset_low, result, origin), + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned long, offset_high) __field(unsigned long, offset_low) __field_hex(loff_t *, result) __field(unsigned int, origin)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(offset_high, offset_high) tp_assign(offset_low, offset_low) tp_assign(result, result) tp_assign(origin, origin)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_select +SC_TRACE_EVENT(sys_select, + TP_PROTO(int n, fd_set * inp, fd_set * outp, fd_set * exp, struct timeval * tvp), + TP_ARGS(n, inp, outp, exp, tvp), + TP_STRUCT__entry(__field(int, n) __field_hex(fd_set *, inp) __field_hex(fd_set *, outp) __field_hex(fd_set *, exp) __field_hex(struct timeval *, tvp)), + TP_fast_assign(tp_assign(n, n) tp_assign(inp, inp) tp_assign(outp, outp) tp_assign(exp, exp) tp_assign(tvp, tvp)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_pciconfig_read +SC_TRACE_EVENT(sys_pciconfig_read, + TP_PROTO(unsigned long bus, unsigned long dfn, unsigned long off, unsigned long len, void * buf), + TP_ARGS(bus, dfn, off, len, buf), + TP_STRUCT__entry(__field(unsigned long, bus) __field(unsigned long, dfn) __field(unsigned long, off) __field(unsigned long, len) __field_hex(void *, buf)), + TP_fast_assign(tp_assign(bus, bus) tp_assign(dfn, dfn) tp_assign(off, off) tp_assign(len, len) tp_assign(buf, buf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_pciconfig_write +SC_TRACE_EVENT(sys_pciconfig_write, + TP_PROTO(unsigned long bus, unsigned long dfn, unsigned long off, unsigned long len, void * buf), + TP_ARGS(bus, dfn, off, len, buf), + TP_STRUCT__entry(__field(unsigned long, bus) __field(unsigned long, dfn) __field(unsigned long, off) __field(unsigned long, len) __field_hex(void *, buf)), + TP_fast_assign(tp_assign(bus, bus) tp_assign(dfn, dfn) tp_assign(off, off) tp_assign(len, len) tp_assign(buf, buf)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setxattr +SC_TRACE_EVENT(sys_setxattr, + TP_PROTO(const char * pathname, const char * name, const void * value, size_t size, int flags), + TP_ARGS(pathname, name, value, size, flags), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_lsetxattr +SC_TRACE_EVENT(sys_lsetxattr, + TP_PROTO(const char * pathname, const char * name, const void * value, size_t size, int flags), + TP_ARGS(pathname, name, value, size, flags), + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fsetxattr +SC_TRACE_EVENT(sys_fsetxattr, + TP_PROTO(int fd, const char * name, const void * value, size_t size, int flags), + TP_ARGS(fd, name, value, size, flags), + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_io_getevents +SC_TRACE_EVENT(sys_io_getevents, + TP_PROTO(aio_context_t ctx_id, long min_nr, long nr, struct io_event * events, struct timespec * timeout), + TP_ARGS(ctx_id, min_nr, nr, events, timeout), + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field(long, min_nr) __field(long, nr) __field_hex(struct io_event *, events) __field_hex(struct timespec *, timeout)), + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(min_nr, min_nr) tp_assign(nr, nr) tp_assign(events, events) tp_assign(timeout, timeout)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mq_timedsend +SC_TRACE_EVENT(sys_mq_timedsend, + TP_PROTO(mqd_t mqdes, const char * u_msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec * u_abs_timeout), + TP_ARGS(mqdes, u_msg_ptr, msg_len, msg_prio, u_abs_timeout), + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const char *, u_msg_ptr) __field(size_t, msg_len) __field(unsigned int, msg_prio) __field_hex(const struct timespec *, u_abs_timeout)), + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_msg_ptr, u_msg_ptr) tp_assign(msg_len, msg_len) tp_assign(msg_prio, msg_prio) tp_assign(u_abs_timeout, u_abs_timeout)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_mq_timedreceive +SC_TRACE_EVENT(sys_mq_timedreceive, + TP_PROTO(mqd_t mqdes, char * u_msg_ptr, size_t msg_len, unsigned int * u_msg_prio, const struct timespec * u_abs_timeout), + TP_ARGS(mqdes, u_msg_ptr, msg_len, u_msg_prio, u_abs_timeout), + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(char *, u_msg_ptr) __field(size_t, msg_len) __field_hex(unsigned int *, u_msg_prio) __field_hex(const struct timespec *, u_abs_timeout)), + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_msg_ptr, u_msg_ptr) tp_assign(msg_len, msg_len) tp_assign(u_msg_prio, u_msg_prio) tp_assign(u_abs_timeout, u_abs_timeout)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_add_key +SC_TRACE_EVENT(sys_add_key, + TP_PROTO(const char * _type, const char * _description, const void * _payload, size_t plen, key_serial_t ringid), + TP_ARGS(_type, _description, _payload, plen, ringid), + TP_STRUCT__entry(__string_from_user(_type, _type) __field_hex(const char *, _description) __field_hex(const void *, _payload) __field(size_t, plen) __field(key_serial_t, ringid)), + TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_payload, _payload) tp_assign(plen, plen) tp_assign(ringid, ringid)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_waitid +SC_TRACE_EVENT(sys_waitid, + TP_PROTO(int which, pid_t upid, struct siginfo * infop, int options, struct rusage * ru), + TP_ARGS(which, upid, infop, options, ru), + TP_STRUCT__entry(__field(int, which) __field(pid_t, upid) __field_hex(struct siginfo *, infop) __field(int, options) __field_hex(struct rusage *, ru)), + TP_fast_assign(tp_assign(which, which) tp_assign(upid, upid) tp_assign(infop, infop) tp_assign(options, options) tp_assign(ru, ru)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_ppoll +SC_TRACE_EVENT(sys_ppoll, + TP_PROTO(struct pollfd * ufds, unsigned int nfds, struct timespec * tsp, const sigset_t * sigmask, size_t sigsetsize), + TP_ARGS(ufds, nfds, tsp, sigmask, sigsetsize), + TP_STRUCT__entry(__field_hex(struct pollfd *, ufds) __field(unsigned int, nfds) __field_hex(struct timespec *, tsp) __field_hex(const sigset_t *, sigmask) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(ufds, ufds) tp_assign(nfds, nfds) tp_assign(tsp, tsp) tp_assign(sigmask, sigmask) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_fchownat +SC_TRACE_EVENT(sys_fchownat, + TP_PROTO(int dfd, const char * filename, uid_t user, gid_t group, int flag), + TP_ARGS(dfd, filename, user, group, flag), + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group) __field(int, flag)), + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group) tp_assign(flag, flag)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_linkat +SC_TRACE_EVENT(sys_linkat, + TP_PROTO(int olddfd, const char * oldname, int newdfd, const char * newname, int flags), + TP_ARGS(olddfd, oldname, newdfd, newname, flags), + TP_STRUCT__entry(__field(int, olddfd) __string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname) __field(int, flags)), + TP_fast_assign(tp_assign(olddfd, olddfd) tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_perf_event_open +SC_TRACE_EVENT(sys_perf_event_open, + TP_PROTO(struct perf_event_attr * attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags), + TP_ARGS(attr_uptr, pid, cpu, group_fd, flags), + TP_STRUCT__entry(__field_hex(struct perf_event_attr *, attr_uptr) __field(pid_t, pid) __field(int, cpu) __field(int, group_fd) __field(unsigned long, flags)), + TP_fast_assign(tp_assign(attr_uptr, attr_uptr) tp_assign(pid, pid) tp_assign(cpu, cpu) tp_assign(group_fd, group_fd) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_preadv +SC_TRACE_EVENT(sys_preadv, + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h), + TP_ARGS(fd, vec, vlen, pos_l, pos_h), + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen) __field(unsigned long, pos_l) __field(unsigned long, pos_h)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen) tp_assign(pos_l, pos_l) tp_assign(pos_h, pos_h)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_pwritev +SC_TRACE_EVENT(sys_pwritev, + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h), + TP_ARGS(fd, vec, vlen, pos_l, pos_h), + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen) __field(unsigned long, pos_l) __field(unsigned long, pos_h)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen) tp_assign(pos_l, pos_l) tp_assign(pos_h, pos_h)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_setsockopt +SC_TRACE_EVENT(sys_setsockopt, + TP_PROTO(int fd, int level, int optname, char * optval, int optlen), + TP_ARGS(fd, level, optname, optval, optlen), + TP_STRUCT__entry(__field(int, fd) __field(int, level) __field(int, optname) __field_hex(char *, optval) __field(int, optlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(level, level) tp_assign(optname, optname) tp_assign(optval, optval) tp_assign(optlen, optlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_getsockopt +SC_TRACE_EVENT(sys_getsockopt, + TP_PROTO(int fd, int level, int optname, char * optval, int * optlen), + TP_ARGS(fd, level, optname, optval, optlen), + TP_STRUCT__entry(__field(int, fd) __field(int, level) __field(int, optname) __field_hex(char *, optval) __field_hex(int *, optlen)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(level, level) tp_assign(optname, optname) tp_assign(optval, optval) tp_assign(optlen, optlen)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_recvmmsg +SC_TRACE_EVENT(sys_recvmmsg, + TP_PROTO(int fd, struct mmsghdr * mmsg, unsigned int vlen, unsigned int flags, struct timespec * timeout), + TP_ARGS(fd, mmsg, vlen, flags, timeout), + TP_STRUCT__entry(__field(int, fd) __field_hex(struct mmsghdr *, mmsg) __field(unsigned int, vlen) __field(unsigned int, flags) __field_hex(struct timespec *, timeout)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(mmsg, mmsg) tp_assign(vlen, vlen) tp_assign(flags, flags) tp_assign(timeout, timeout)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_ipc +SC_TRACE_EVENT(sys_ipc, + TP_PROTO(unsigned int call, int first, unsigned long second, unsigned long third, void * ptr, long fifth), + TP_ARGS(call, first, second, third, ptr, fifth), + TP_STRUCT__entry(__field(unsigned int, call) __field(int, first) __field(unsigned long, second) __field(unsigned long, third) __field_hex(void *, ptr) __field(long, fifth)), + TP_fast_assign(tp_assign(call, call) tp_assign(first, first) tp_assign(second, second) tp_assign(third, third) tp_assign(ptr, ptr) tp_assign(fifth, fifth)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_futex +SC_TRACE_EVENT(sys_futex, + TP_PROTO(u32 * uaddr, int op, u32 val, struct timespec * utime, u32 * uaddr2, u32 val3), + TP_ARGS(uaddr, op, val, utime, uaddr2, val3), + TP_STRUCT__entry(__field_hex(u32 *, uaddr) __field(int, op) __field(u32, val) __field_hex(struct timespec *, utime) __field_hex(u32 *, uaddr2) __field(u32, val3)), + TP_fast_assign(tp_assign(uaddr, uaddr) tp_assign(op, op) tp_assign(val, val) tp_assign(utime, utime) tp_assign(uaddr2, uaddr2) tp_assign(val3, val3)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_pselect6 +SC_TRACE_EVENT(sys_pselect6, + TP_PROTO(int n, fd_set * inp, fd_set * outp, fd_set * exp, struct timespec * tsp, void * sig), + TP_ARGS(n, inp, outp, exp, tsp, sig), + TP_STRUCT__entry(__field(int, n) __field_hex(fd_set *, inp) __field_hex(fd_set *, outp) __field_hex(fd_set *, exp) __field_hex(struct timespec *, tsp) __field_hex(void *, sig)), + TP_fast_assign(tp_assign(n, n) tp_assign(inp, inp) tp_assign(outp, outp) tp_assign(exp, exp) tp_assign(tsp, tsp) tp_assign(sig, sig)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_splice +SC_TRACE_EVENT(sys_splice, + TP_PROTO(int fd_in, loff_t * off_in, int fd_out, loff_t * off_out, size_t len, unsigned int flags), + TP_ARGS(fd_in, off_in, fd_out, off_out, len, flags), + TP_STRUCT__entry(__field(int, fd_in) __field_hex(loff_t *, off_in) __field(int, fd_out) __field_hex(loff_t *, off_out) __field(size_t, len) __field(unsigned int, flags)), + TP_fast_assign(tp_assign(fd_in, fd_in) tp_assign(off_in, off_in) tp_assign(fd_out, fd_out) tp_assign(off_out, off_out) tp_assign(len, len) tp_assign(flags, flags)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_epoll_pwait +SC_TRACE_EVENT(sys_epoll_pwait, + TP_PROTO(int epfd, struct epoll_event * events, int maxevents, int timeout, const sigset_t * sigmask, size_t sigsetsize), + TP_ARGS(epfd, events, maxevents, timeout, sigmask, sigsetsize), + TP_STRUCT__entry(__field(int, epfd) __field_hex(struct epoll_event *, events) __field(int, maxevents) __field(int, timeout) __field_hex(const sigset_t *, sigmask) __field(size_t, sigsetsize)), + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(events, events) tp_assign(maxevents, maxevents) tp_assign(timeout, timeout) tp_assign(sigmask, sigmask) tp_assign(sigsetsize, sigsetsize)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_sendto +SC_TRACE_EVENT(sys_sendto, + TP_PROTO(int fd, void * buff, size_t len, unsigned flags, struct sockaddr * addr, int addr_len), + TP_ARGS(fd, buff, len, flags, addr, addr_len), + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, buff) __field(size_t, len) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int, addr_len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(buff, buff) tp_assign(len, len) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), + TP_printk() +) +#endif +#ifndef OVERRIDE_32_sys_recvfrom +SC_TRACE_EVENT(sys_recvfrom, + TP_PROTO(int fd, void * ubuf, size_t size, unsigned flags, struct sockaddr * addr, int * addr_len), + TP_ARGS(fd, ubuf, size, flags, addr, addr_len), + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, ubuf) __field(size_t, size) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int *, addr_len)), + TP_fast_assign(tp_assign(fd, fd) tp_assign(ubuf, ubuf) tp_assign(size, size) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), + TP_printk() +) +#endif + +#endif /* _TRACE_SYSCALLS_POINTERS_H */ + +/* This part must be outside protection */ +#include "../../../probes/define_trace.h" + +#else /* CREATE_SYSCALL_TABLE */ + +#include "powerpc-32-syscalls-3.0.34_pointers_override.h" +#include "syscalls_pointers_override.h" + +#ifndef OVERRIDE_TABLE_32_sys_read +TRACE_SYSCALL_TABLE(sys_read, sys_read, 3, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_write +TRACE_SYSCALL_TABLE(sys_write, sys_write, 4, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_open +TRACE_SYSCALL_TABLE(sys_open, sys_open, 5, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_waitpid +TRACE_SYSCALL_TABLE(sys_waitpid, sys_waitpid, 7, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_creat +TRACE_SYSCALL_TABLE(sys_creat, sys_creat, 8, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_link +TRACE_SYSCALL_TABLE(sys_link, sys_link, 9, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_unlink +TRACE_SYSCALL_TABLE(sys_unlink, sys_unlink, 10, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_chdir +TRACE_SYSCALL_TABLE(sys_chdir, sys_chdir, 12, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_time +TRACE_SYSCALL_TABLE(sys_time, sys_time, 13, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mknod +TRACE_SYSCALL_TABLE(sys_mknod, sys_mknod, 14, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_chmod +TRACE_SYSCALL_TABLE(sys_chmod, sys_chmod, 15, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_lchown +TRACE_SYSCALL_TABLE(sys_lchown, sys_lchown, 16, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_stat +TRACE_SYSCALL_TABLE(sys_stat, sys_stat, 18, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mount +TRACE_SYSCALL_TABLE(sys_mount, sys_mount, 21, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_oldumount +TRACE_SYSCALL_TABLE(sys_oldumount, sys_oldumount, 22, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_stime +TRACE_SYSCALL_TABLE(sys_stime, sys_stime, 25, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fstat +TRACE_SYSCALL_TABLE(sys_fstat, sys_fstat, 28, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_utime +TRACE_SYSCALL_TABLE(sys_utime, sys_utime, 30, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_access +TRACE_SYSCALL_TABLE(sys_access, sys_access, 33, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_rename +TRACE_SYSCALL_TABLE(sys_rename, sys_rename, 38, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mkdir +TRACE_SYSCALL_TABLE(sys_mkdir, sys_mkdir, 39, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_rmdir +TRACE_SYSCALL_TABLE(sys_rmdir, sys_rmdir, 40, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_pipe +TRACE_SYSCALL_TABLE(sys_pipe, sys_pipe, 42, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_times +TRACE_SYSCALL_TABLE(sys_times, sys_times, 43, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_acct +TRACE_SYSCALL_TABLE(sys_acct, sys_acct, 51, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_umount +TRACE_SYSCALL_TABLE(sys_umount, sys_umount, 52, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_olduname +TRACE_SYSCALL_TABLE(sys_olduname, sys_olduname, 59, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_chroot +TRACE_SYSCALL_TABLE(sys_chroot, sys_chroot, 61, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_ustat +TRACE_SYSCALL_TABLE(sys_ustat, sys_ustat, 62, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sigpending +TRACE_SYSCALL_TABLE(sys_sigpending, sys_sigpending, 73, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sethostname +TRACE_SYSCALL_TABLE(sys_sethostname, sys_sethostname, 74, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setrlimit +TRACE_SYSCALL_TABLE(sys_setrlimit, sys_setrlimit, 75, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_old_getrlimit +TRACE_SYSCALL_TABLE(sys_old_getrlimit, sys_old_getrlimit, 76, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getrusage +TRACE_SYSCALL_TABLE(sys_getrusage, sys_getrusage, 77, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_gettimeofday +TRACE_SYSCALL_TABLE(sys_gettimeofday, sys_gettimeofday, 78, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_settimeofday +TRACE_SYSCALL_TABLE(sys_settimeofday, sys_settimeofday, 79, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getgroups +TRACE_SYSCALL_TABLE(sys_getgroups, sys_getgroups, 80, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setgroups +TRACE_SYSCALL_TABLE(sys_setgroups, sys_setgroups, 81, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_symlink +TRACE_SYSCALL_TABLE(sys_symlink, sys_symlink, 83, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_lstat +TRACE_SYSCALL_TABLE(sys_lstat, sys_lstat, 84, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_readlink +TRACE_SYSCALL_TABLE(sys_readlink, sys_readlink, 85, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_uselib +TRACE_SYSCALL_TABLE(sys_uselib, sys_uselib, 86, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_swapon +TRACE_SYSCALL_TABLE(sys_swapon, sys_swapon, 87, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_reboot +TRACE_SYSCALL_TABLE(sys_reboot, sys_reboot, 88, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_old_readdir +TRACE_SYSCALL_TABLE(sys_old_readdir, sys_old_readdir, 89, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_truncate +TRACE_SYSCALL_TABLE(sys_truncate, sys_truncate, 92, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_statfs +TRACE_SYSCALL_TABLE(sys_statfs, sys_statfs, 99, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fstatfs +TRACE_SYSCALL_TABLE(sys_fstatfs, sys_fstatfs, 100, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_socketcall +TRACE_SYSCALL_TABLE(sys_socketcall, sys_socketcall, 102, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_syslog +TRACE_SYSCALL_TABLE(sys_syslog, sys_syslog, 103, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setitimer +TRACE_SYSCALL_TABLE(sys_setitimer, sys_setitimer, 104, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getitimer +TRACE_SYSCALL_TABLE(sys_getitimer, sys_getitimer, 105, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_newstat +TRACE_SYSCALL_TABLE(sys_newstat, sys_newstat, 106, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_newlstat +TRACE_SYSCALL_TABLE(sys_newlstat, sys_newlstat, 107, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_newfstat +TRACE_SYSCALL_TABLE(sys_newfstat, sys_newfstat, 108, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_uname +TRACE_SYSCALL_TABLE(sys_uname, sys_uname, 109, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_wait4 +TRACE_SYSCALL_TABLE(sys_wait4, sys_wait4, 114, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_swapoff +TRACE_SYSCALL_TABLE(sys_swapoff, sys_swapoff, 115, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sysinfo +TRACE_SYSCALL_TABLE(sys_sysinfo, sys_sysinfo, 116, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_ipc +TRACE_SYSCALL_TABLE(sys_ipc, sys_ipc, 117, 6) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setdomainname +TRACE_SYSCALL_TABLE(sys_setdomainname, sys_setdomainname, 121, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_newuname +TRACE_SYSCALL_TABLE(sys_newuname, sys_newuname, 122, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_adjtimex +TRACE_SYSCALL_TABLE(sys_adjtimex, sys_adjtimex, 124, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sigprocmask +TRACE_SYSCALL_TABLE(sys_sigprocmask, sys_sigprocmask, 126, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_init_module +TRACE_SYSCALL_TABLE(sys_init_module, sys_init_module, 128, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_delete_module +TRACE_SYSCALL_TABLE(sys_delete_module, sys_delete_module, 129, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_llseek +TRACE_SYSCALL_TABLE(sys_llseek, sys_llseek, 140, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getdents +TRACE_SYSCALL_TABLE(sys_getdents, sys_getdents, 141, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_select +TRACE_SYSCALL_TABLE(sys_select, sys_select, 142, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_readv +TRACE_SYSCALL_TABLE(sys_readv, sys_readv, 145, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_writev +TRACE_SYSCALL_TABLE(sys_writev, sys_writev, 146, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sysctl +TRACE_SYSCALL_TABLE(sys_sysctl, sys_sysctl, 149, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sched_setparam +TRACE_SYSCALL_TABLE(sys_sched_setparam, sys_sched_setparam, 154, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sched_getparam +TRACE_SYSCALL_TABLE(sys_sched_getparam, sys_sched_getparam, 155, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sched_setscheduler +TRACE_SYSCALL_TABLE(sys_sched_setscheduler, sys_sched_setscheduler, 156, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sched_rr_get_interval +TRACE_SYSCALL_TABLE(sys_sched_rr_get_interval, sys_sched_rr_get_interval, 161, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_nanosleep +TRACE_SYSCALL_TABLE(sys_nanosleep, sys_nanosleep, 162, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getresuid +TRACE_SYSCALL_TABLE(sys_getresuid, sys_getresuid, 165, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_poll +TRACE_SYSCALL_TABLE(sys_poll, sys_poll, 167, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_nfsservctl +TRACE_SYSCALL_TABLE(sys_nfsservctl, sys_nfsservctl, 168, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getresgid +TRACE_SYSCALL_TABLE(sys_getresgid, sys_getresgid, 170, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_rt_sigaction +TRACE_SYSCALL_TABLE(sys_rt_sigaction, sys_rt_sigaction, 173, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_rt_sigprocmask +TRACE_SYSCALL_TABLE(sys_rt_sigprocmask, sys_rt_sigprocmask, 174, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_rt_sigpending +TRACE_SYSCALL_TABLE(sys_rt_sigpending, sys_rt_sigpending, 175, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_rt_sigtimedwait +TRACE_SYSCALL_TABLE(sys_rt_sigtimedwait, sys_rt_sigtimedwait, 176, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_rt_sigqueueinfo +TRACE_SYSCALL_TABLE(sys_rt_sigqueueinfo, sys_rt_sigqueueinfo, 177, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_rt_sigsuspend +TRACE_SYSCALL_TABLE(sys_rt_sigsuspend, sys_rt_sigsuspend, 178, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_chown +TRACE_SYSCALL_TABLE(sys_chown, sys_chown, 181, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getcwd +TRACE_SYSCALL_TABLE(sys_getcwd, sys_getcwd, 182, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sendfile +TRACE_SYSCALL_TABLE(sys_sendfile, sys_sendfile, 186, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getrlimit +TRACE_SYSCALL_TABLE(sys_getrlimit, sys_getrlimit, 190, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_stat64 +TRACE_SYSCALL_TABLE(sys_stat64, sys_stat64, 195, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_lstat64 +TRACE_SYSCALL_TABLE(sys_lstat64, sys_lstat64, 196, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fstat64 +TRACE_SYSCALL_TABLE(sys_fstat64, sys_fstat64, 197, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_pciconfig_read +TRACE_SYSCALL_TABLE(sys_pciconfig_read, sys_pciconfig_read, 198, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_pciconfig_write +TRACE_SYSCALL_TABLE(sys_pciconfig_write, sys_pciconfig_write, 199, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getdents64 +TRACE_SYSCALL_TABLE(sys_getdents64, sys_getdents64, 202, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_pivot_root +TRACE_SYSCALL_TABLE(sys_pivot_root, sys_pivot_root, 203, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mincore +TRACE_SYSCALL_TABLE(sys_mincore, sys_mincore, 206, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setxattr +TRACE_SYSCALL_TABLE(sys_setxattr, sys_setxattr, 209, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_lsetxattr +TRACE_SYSCALL_TABLE(sys_lsetxattr, sys_lsetxattr, 210, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fsetxattr +TRACE_SYSCALL_TABLE(sys_fsetxattr, sys_fsetxattr, 211, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getxattr +TRACE_SYSCALL_TABLE(sys_getxattr, sys_getxattr, 212, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_lgetxattr +TRACE_SYSCALL_TABLE(sys_lgetxattr, sys_lgetxattr, 213, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fgetxattr +TRACE_SYSCALL_TABLE(sys_fgetxattr, sys_fgetxattr, 214, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_listxattr +TRACE_SYSCALL_TABLE(sys_listxattr, sys_listxattr, 215, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_llistxattr +TRACE_SYSCALL_TABLE(sys_llistxattr, sys_llistxattr, 216, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_flistxattr +TRACE_SYSCALL_TABLE(sys_flistxattr, sys_flistxattr, 217, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_removexattr +TRACE_SYSCALL_TABLE(sys_removexattr, sys_removexattr, 218, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_lremovexattr +TRACE_SYSCALL_TABLE(sys_lremovexattr, sys_lremovexattr, 219, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fremovexattr +TRACE_SYSCALL_TABLE(sys_fremovexattr, sys_fremovexattr, 220, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_futex +TRACE_SYSCALL_TABLE(sys_futex, sys_futex, 221, 6) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sched_setaffinity +TRACE_SYSCALL_TABLE(sys_sched_setaffinity, sys_sched_setaffinity, 222, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sched_getaffinity +TRACE_SYSCALL_TABLE(sys_sched_getaffinity, sys_sched_getaffinity, 223, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sendfile64 +TRACE_SYSCALL_TABLE(sys_sendfile64, sys_sendfile64, 226, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_io_setup +TRACE_SYSCALL_TABLE(sys_io_setup, sys_io_setup, 227, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_io_getevents +TRACE_SYSCALL_TABLE(sys_io_getevents, sys_io_getevents, 229, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_io_submit +TRACE_SYSCALL_TABLE(sys_io_submit, sys_io_submit, 230, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_io_cancel +TRACE_SYSCALL_TABLE(sys_io_cancel, sys_io_cancel, 231, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_set_tid_address +TRACE_SYSCALL_TABLE(sys_set_tid_address, sys_set_tid_address, 232, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_epoll_ctl +TRACE_SYSCALL_TABLE(sys_epoll_ctl, sys_epoll_ctl, 237, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_epoll_wait +TRACE_SYSCALL_TABLE(sys_epoll_wait, sys_epoll_wait, 238, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_timer_create +TRACE_SYSCALL_TABLE(sys_timer_create, sys_timer_create, 240, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_timer_settime +TRACE_SYSCALL_TABLE(sys_timer_settime, sys_timer_settime, 241, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_timer_gettime +TRACE_SYSCALL_TABLE(sys_timer_gettime, sys_timer_gettime, 242, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_clock_settime +TRACE_SYSCALL_TABLE(sys_clock_settime, sys_clock_settime, 245, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_clock_gettime +TRACE_SYSCALL_TABLE(sys_clock_gettime, sys_clock_gettime, 246, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_clock_getres +TRACE_SYSCALL_TABLE(sys_clock_getres, sys_clock_getres, 247, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_clock_nanosleep +TRACE_SYSCALL_TABLE(sys_clock_nanosleep, sys_clock_nanosleep, 248, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_utimes +TRACE_SYSCALL_TABLE(sys_utimes, sys_utimes, 251, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_statfs64 +TRACE_SYSCALL_TABLE(sys_statfs64, sys_statfs64, 252, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fstatfs64 +TRACE_SYSCALL_TABLE(sys_fstatfs64, sys_fstatfs64, 253, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mq_open +TRACE_SYSCALL_TABLE(sys_mq_open, sys_mq_open, 262, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mq_unlink +TRACE_SYSCALL_TABLE(sys_mq_unlink, sys_mq_unlink, 263, 1) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mq_timedsend +TRACE_SYSCALL_TABLE(sys_mq_timedsend, sys_mq_timedsend, 264, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mq_timedreceive +TRACE_SYSCALL_TABLE(sys_mq_timedreceive, sys_mq_timedreceive, 265, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mq_notify +TRACE_SYSCALL_TABLE(sys_mq_notify, sys_mq_notify, 266, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mq_getsetattr +TRACE_SYSCALL_TABLE(sys_mq_getsetattr, sys_mq_getsetattr, 267, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_add_key +TRACE_SYSCALL_TABLE(sys_add_key, sys_add_key, 269, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_request_key +TRACE_SYSCALL_TABLE(sys_request_key, sys_request_key, 270, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_waitid +TRACE_SYSCALL_TABLE(sys_waitid, sys_waitid, 272, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_inotify_add_watch +TRACE_SYSCALL_TABLE(sys_inotify_add_watch, sys_inotify_add_watch, 276, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_pselect6 +TRACE_SYSCALL_TABLE(sys_pselect6, sys_pselect6, 280, 6) +#endif +#ifndef OVERRIDE_TABLE_32_sys_ppoll +TRACE_SYSCALL_TABLE(sys_ppoll, sys_ppoll, 281, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_splice +TRACE_SYSCALL_TABLE(sys_splice, sys_splice, 283, 6) +#endif +#ifndef OVERRIDE_TABLE_32_sys_vmsplice +TRACE_SYSCALL_TABLE(sys_vmsplice, sys_vmsplice, 285, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_openat +TRACE_SYSCALL_TABLE(sys_openat, sys_openat, 286, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mkdirat +TRACE_SYSCALL_TABLE(sys_mkdirat, sys_mkdirat, 287, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_mknodat +TRACE_SYSCALL_TABLE(sys_mknodat, sys_mknodat, 288, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fchownat +TRACE_SYSCALL_TABLE(sys_fchownat, sys_fchownat, 289, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_futimesat +TRACE_SYSCALL_TABLE(sys_futimesat, sys_futimesat, 290, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fstatat64 +TRACE_SYSCALL_TABLE(sys_fstatat64, sys_fstatat64, 291, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_unlinkat +TRACE_SYSCALL_TABLE(sys_unlinkat, sys_unlinkat, 292, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_renameat +TRACE_SYSCALL_TABLE(sys_renameat, sys_renameat, 293, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_linkat +TRACE_SYSCALL_TABLE(sys_linkat, sys_linkat, 294, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_symlinkat +TRACE_SYSCALL_TABLE(sys_symlinkat, sys_symlinkat, 295, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_readlinkat +TRACE_SYSCALL_TABLE(sys_readlinkat, sys_readlinkat, 296, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_fchmodat +TRACE_SYSCALL_TABLE(sys_fchmodat, sys_fchmodat, 297, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_faccessat +TRACE_SYSCALL_TABLE(sys_faccessat, sys_faccessat, 298, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_get_robust_list +TRACE_SYSCALL_TABLE(sys_get_robust_list, sys_get_robust_list, 299, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_set_robust_list +TRACE_SYSCALL_TABLE(sys_set_robust_list, sys_set_robust_list, 300, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getcpu +TRACE_SYSCALL_TABLE(sys_getcpu, sys_getcpu, 302, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_epoll_pwait +TRACE_SYSCALL_TABLE(sys_epoll_pwait, sys_epoll_pwait, 303, 6) +#endif +#ifndef OVERRIDE_TABLE_32_sys_utimensat +TRACE_SYSCALL_TABLE(sys_utimensat, sys_utimensat, 304, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_signalfd +TRACE_SYSCALL_TABLE(sys_signalfd, sys_signalfd, 305, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_timerfd_settime +TRACE_SYSCALL_TABLE(sys_timerfd_settime, sys_timerfd_settime, 311, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_timerfd_gettime +TRACE_SYSCALL_TABLE(sys_timerfd_gettime, sys_timerfd_gettime, 312, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_signalfd4 +TRACE_SYSCALL_TABLE(sys_signalfd4, sys_signalfd4, 313, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_pipe2 +TRACE_SYSCALL_TABLE(sys_pipe2, sys_pipe2, 317, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_perf_event_open +TRACE_SYSCALL_TABLE(sys_perf_event_open, sys_perf_event_open, 319, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_preadv +TRACE_SYSCALL_TABLE(sys_preadv, sys_preadv, 320, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_pwritev +TRACE_SYSCALL_TABLE(sys_pwritev, sys_pwritev, 321, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_rt_tgsigqueueinfo +TRACE_SYSCALL_TABLE(sys_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, 322, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_prlimit64 +TRACE_SYSCALL_TABLE(sys_prlimit64, sys_prlimit64, 325, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_bind +TRACE_SYSCALL_TABLE(sys_bind, sys_bind, 327, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_connect +TRACE_SYSCALL_TABLE(sys_connect, sys_connect, 328, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_accept +TRACE_SYSCALL_TABLE(sys_accept, sys_accept, 330, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getsockname +TRACE_SYSCALL_TABLE(sys_getsockname, sys_getsockname, 331, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getpeername +TRACE_SYSCALL_TABLE(sys_getpeername, sys_getpeername, 332, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_socketpair +TRACE_SYSCALL_TABLE(sys_socketpair, sys_socketpair, 333, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_send +TRACE_SYSCALL_TABLE(sys_send, sys_send, 334, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sendto +TRACE_SYSCALL_TABLE(sys_sendto, sys_sendto, 335, 6) +#endif +#ifndef OVERRIDE_TABLE_32_sys_recvfrom +TRACE_SYSCALL_TABLE(sys_recvfrom, sys_recvfrom, 337, 6) +#endif +#ifndef OVERRIDE_TABLE_32_sys_setsockopt +TRACE_SYSCALL_TABLE(sys_setsockopt, sys_setsockopt, 339, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_getsockopt +TRACE_SYSCALL_TABLE(sys_getsockopt, sys_getsockopt, 340, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sendmsg +TRACE_SYSCALL_TABLE(sys_sendmsg, sys_sendmsg, 341, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_recvmsg +TRACE_SYSCALL_TABLE(sys_recvmsg, sys_recvmsg, 342, 3) +#endif +#ifndef OVERRIDE_TABLE_32_sys_recvmmsg +TRACE_SYSCALL_TABLE(sys_recvmmsg, sys_recvmmsg, 343, 5) +#endif +#ifndef OVERRIDE_TABLE_32_sys_accept4 +TRACE_SYSCALL_TABLE(sys_accept4, sys_accept4, 344, 4) +#endif +#ifndef OVERRIDE_TABLE_32_sys_clock_adjtime +TRACE_SYSCALL_TABLE(sys_clock_adjtime, sys_clock_adjtime, 347, 2) +#endif +#ifndef OVERRIDE_TABLE_32_sys_sendmmsg +TRACE_SYSCALL_TABLE(sys_sendmmsg, sys_sendmmsg, 349, 4) +#endif + +#endif /* CREATE_SYSCALL_TABLE */ -- 1.8.1.4 >From d27f0b823b593a60372f5440661fe29657401f94 Mon Sep 17 00:00:00 2001 From: Paul Woegerer Date: Mon, 29 Apr 2013 17:36:10 +0200 Subject: [PATCH 2/5] Added ifdef for CONFIG_PPC --- instrumentation/syscalls/headers/syscalls_integers.h | 4 ++++ instrumentation/syscalls/headers/syscalls_pointers.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/instrumentation/syscalls/headers/syscalls_integers.h b/instrumentation/syscalls/headers/syscalls_integers.h index 002130a..8fa73e0 100644 --- a/instrumentation/syscalls/headers/syscalls_integers.h +++ b/instrumentation/syscalls/headers/syscalls_integers.h @@ -9,3 +9,7 @@ #ifdef CONFIG_ARM #include "arm-32-syscalls-2.6.38_integers.h" #endif + +#ifdef CONFIG_PPC +#include "powerpc-32-syscalls-3.0.34_integers.h" +#endif diff --git a/instrumentation/syscalls/headers/syscalls_pointers.h b/instrumentation/syscalls/headers/syscalls_pointers.h index 11b4979..dd115c8 100644 --- a/instrumentation/syscalls/headers/syscalls_pointers.h +++ b/instrumentation/syscalls/headers/syscalls_pointers.h @@ -9,3 +9,7 @@ #ifdef CONFIG_ARM #include "arm-32-syscalls-2.6.38_pointers.h" #endif + +#ifdef CONFIG_PPC +#include "powerpc-32-syscalls-3.0.34_pointers.h" +#endif -- 1.8.1.4 >From 4de3e9c7c0b2d04f282176651c50541bd463f72a Mon Sep 17 00:00:00 2001 From: Paul Woegerer Date: Tue, 30 Apr 2013 17:26:57 +0200 Subject: [PATCH 3/5] Add dummy *_override headers for powerpc-32-syscalls --- .../syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h | 3 +++ .../syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h create mode 100644 instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h new file mode 100644 index 0000000..d3c09ee --- /dev/null +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h @@ -0,0 +1,3 @@ +/* + * This is a place-holder for PPC integer syscall definition override. + */ diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h new file mode 100644 index 0000000..efe2c1f --- /dev/null +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h @@ -0,0 +1,3 @@ +/* + * This is a place-holder for PPC pointer syscall definition override. + */ -- 1.8.1.4 >From ceff663acceb2885a42883dff8112cf91b4e4f06 Mon Sep 17 00:00:00 2001 From: Paul Woegerer Date: Thu, 2 May 2013 17:02:29 +0200 Subject: [PATCH 4/5] Add sys_mmap, sys_clone and sys_execve to powerpc-32-syscalls --- .../headers/powerpc-32-syscalls-3.0.34_integers_override.h | 12 +++++++++--- .../headers/powerpc-32-syscalls-3.0.34_pointers_override.h | 14 +++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h index d3c09ee..6696f43 100644 --- a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h @@ -1,3 +1,9 @@ -/* - * This is a place-holder for PPC integer syscall definition override. - */ +#ifndef CREATE_SYSCALL_TABLE + +#else /* CREATE_SYSCALL_TABLE */ + +#define OVVERRIDE_TABLE_32_sys_mmap +TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) + +#endif /* CREATE_SYSCALL_TABLE */ + diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h index efe2c1f..c7a56c0 100644 --- a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h @@ -1,3 +1,11 @@ -/* - * This is a place-holder for PPC pointer syscall definition override. - */ +#ifndef CREATE_SYSCALL_TABLE + +#else /* CREATE_SYSCALL_TABLE */ + +#define OVERRIDE_TABLE_32_sys_execve +TRACE_SYSCALL_TABLE(sys_execve, sys_execve, 11, 3) +#define OVERRIDE_TABLE_32_sys_clone +TRACE_SYSCALL_TABLE(sys_clone, sys_clone, 120, 5) + +#endif /* CREATE_SYSCALL_TABLE */ + -- 1.8.1.4 >From de493ac797631c0a32bee106e18cebd7e9f38a5c Mon Sep 17 00:00:00 2001 From: Paul Woegerer Date: Fri, 3 May 2013 16:08:19 +0200 Subject: [PATCH 5/5] Add sys_mmap2 to powerpc-32-syscalls --- .../powerpc-32-syscalls-3.0.34_pointers_override.h | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h index c7a56c0..7a5d134 100644 --- a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h @@ -1,11 +1,36 @@ +#define OVERRIDE_TABLE_32_sys_mmap2 + #ifndef CREATE_SYSCALL_TABLE +SC_TRACE_EVENT(sys_mmap2, + TP_PROTO(void *addr, size_t len, int prot, + int flags, int fd, off_t pgoff), + TP_ARGS(addr, len, prot, flags, fd, pgoff), + TP_STRUCT__entry( + __field_hex(void *, addr) + __field(size_t, len) + __field(int, prot) + __field(int, flags) + __field(int, fd) + __field(off_t, pgoff)), + TP_fast_assign( + tp_assign(addr, addr) + tp_assign(len, len) + tp_assign(prot, prot) + tp_assign(flags, flags) + tp_assign(fd, fd) + tp_assign(pgoff, pgoff)), + TP_printk() +) + #else /* CREATE_SYSCALL_TABLE */ #define OVERRIDE_TABLE_32_sys_execve TRACE_SYSCALL_TABLE(sys_execve, sys_execve, 11, 3) #define OVERRIDE_TABLE_32_sys_clone TRACE_SYSCALL_TABLE(sys_clone, sys_clone, 120, 5) +#define OVERRIDE_TABLE_32_sys_mmap2 +TRACE_SYSCALL_TABLE(sys_mmap2, sys_mmap2, 192, 6) #endif /* CREATE_SYSCALL_TABLE */ -- 1.8.1.4 -- Paul Woegerer | SW Development Engineer http://go.mentor.com/sourceryanalyzer Mentor Embedded(tm) | Prinz Eugen Stra?e 72/2/4, Vienna, 1040 Austria Nucleus? | Linux? | Android(tm) | Services | UI | Multi-OS Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. From mathieu.desnoyers at efficios.com Mon May 13 12:25:46 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 13 May 2013 12:25:46 -0400 Subject: [lttng-dev] [PATCH lttng-modules] Add system calls definitions for powerpc-32 In-Reply-To: <51910B67.5050605@mentor.com> References: <51910B67.5050605@mentor.com> Message-ID: <20130513162546.GA25907@Krystal> * Woegerer, Paul (Paul_Woegerer at mentor.com) wrote: > Hi Mathieu, > > the five patches below add basic support for syscall tracing on 32-bit PowerPC platforms. > > I have created and tested them on our Freescale p2020rdb board running 32-bit Linux 3.0.34. > It would be great if these patches could still make it into the upcoming lttng 2.2 release > (as there was no syscall tracing for PowerPC before there should be no risk of regression). Hi Paul, Thanks for providing these. I pulled them into lttng-modules master branch. Unfortunately, 2.2 is feature-frozen at this stage of the cycle, but don't worry, they are queued for 2.3! Mathieu > > > Many Thanks, > Paul > > > From 6efae4d60067f571e7fc633ce2b6677866085c6d Mon Sep 17 00:00:00 2001 > From: Paul Woegerer > Date: Mon, 29 Apr 2013 17:28:39 +0200 > Subject: [PATCH 1/5] Added powerpc-32 syscall headers for linux 3.0.34 > > --- > .../syscalls/3.0.34/powerpc-32-syscalls-3.0.34 | 286 +++ > .../headers/powerpc-32-syscalls-3.0.34_integers.h | 1043 +++++++++ > .../headers/powerpc-32-syscalls-3.0.34_pointers.h | 2316 ++++++++++++++++++++ > 3 files changed, 3645 insertions(+) > create mode 100644 instrumentation/syscalls/3.0.34/powerpc-32-syscalls-3.0.34 > create mode 100644 instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers.h > create mode 100644 instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers.h > > diff --git a/instrumentation/syscalls/3.0.34/powerpc-32-syscalls-3.0.34 b/instrumentation/syscalls/3.0.34/powerpc-32-syscalls-3.0.34 > new file mode 100644 > index 0000000..f951c7a > --- /dev/null > +++ b/instrumentation/syscalls/3.0.34/powerpc-32-syscalls-3.0.34 > @@ -0,0 +1,286 @@ > +syscall sys_restart_syscall nr 0 nbargs 0 types: () args: () > +syscall sys_exit nr 1 nbargs 1 types: (int) args: (error_code) > +syscall sys_read nr 3 nbargs 3 types: (unsigned int, char *, size_t) args: (fd, buf, count) > +syscall sys_write nr 4 nbargs 3 types: (unsigned int, const char *, size_t) args: (fd, buf, count) > +syscall sys_open nr 5 nbargs 3 types: (const char *, int, int) args: (filename, flags, mode) > +syscall sys_close nr 6 nbargs 1 types: (unsigned int) args: (fd) > +syscall sys_waitpid nr 7 nbargs 3 types: (pid_t, int *, int) args: (pid, stat_addr, options) > +syscall sys_creat nr 8 nbargs 2 types: (const char *, int) args: (pathname, mode) > +syscall sys_link nr 9 nbargs 2 types: (const char *, const char *) args: (oldname, newname) > +syscall sys_unlink nr 10 nbargs 1 types: (const char *) args: (pathname) > +syscall sys_chdir nr 12 nbargs 1 types: (const char *) args: (filename) > +syscall sys_time nr 13 nbargs 1 types: (time_t *) args: (tloc) > +syscall sys_mknod nr 14 nbargs 3 types: (const char *, int, unsigned) args: (filename, mode, dev) > +syscall sys_chmod nr 15 nbargs 2 types: (const char *, mode_t) args: (filename, mode) > +syscall sys_lchown nr 16 nbargs 3 types: (const char *, uid_t, gid_t) args: (filename, user, group) > +syscall sys_stat nr 18 nbargs 2 types: (const char *, struct __old_kernel_stat *) args: (filename, statbuf) > +syscall sys_lseek nr 19 nbargs 3 types: (unsigned int, off_t, unsigned int) args: (fd, offset, origin) > +syscall sys_getpid nr 20 nbargs 0 types: () args: () > +syscall sys_mount nr 21 nbargs 5 types: (char *, char *, char *, unsigned long, void *) args: (dev_name, dir_name, type, flags, data) > +syscall sys_oldumount nr 22 nbargs 1 types: (char *) args: (name) > +syscall sys_setuid nr 23 nbargs 1 types: (uid_t) args: (uid) > +syscall sys_getuid nr 24 nbargs 0 types: () args: () > +syscall sys_stime nr 25 nbargs 1 types: (time_t *) args: (tptr) > +syscall sys_ptrace nr 26 nbargs 4 types: (long, long, unsigned long, unsigned long) args: (request, pid, addr, data) > +syscall sys_alarm nr 27 nbargs 1 types: (unsigned int) args: (seconds) > +syscall sys_fstat nr 28 nbargs 2 types: (unsigned int, struct __old_kernel_stat *) args: (fd, statbuf) > +syscall sys_pause nr 29 nbargs 0 types: () args: () > +syscall sys_utime nr 30 nbargs 2 types: (char *, struct utimbuf *) args: (filename, times) > +syscall sys_access nr 33 nbargs 2 types: (const char *, int) args: (filename, mode) > +syscall sys_nice nr 34 nbargs 1 types: (int) args: (increment) > +syscall sys_sync nr 36 nbargs 0 types: () args: () > +syscall sys_kill nr 37 nbargs 2 types: (pid_t, int) args: (pid, sig) > +syscall sys_rename nr 38 nbargs 2 types: (const char *, const char *) args: (oldname, newname) > +syscall sys_mkdir nr 39 nbargs 2 types: (const char *, int) args: (pathname, mode) > +syscall sys_rmdir nr 40 nbargs 1 types: (const char *) args: (pathname) > +syscall sys_dup nr 41 nbargs 1 types: (unsigned int) args: (fildes) > +syscall sys_pipe nr 42 nbargs 1 types: (int *) args: (fildes) > +syscall sys_times nr 43 nbargs 1 types: (struct tms *) args: (tbuf) > +syscall sys_brk nr 45 nbargs 1 types: (unsigned long) args: (brk) > +syscall sys_setgid nr 46 nbargs 1 types: (gid_t) args: (gid) > +syscall sys_getgid nr 47 nbargs 0 types: () args: () > +syscall sys_signal nr 48 nbargs 2 types: (int, __sighandler_t) args: (sig, handler) > +syscall sys_geteuid nr 49 nbargs 0 types: () args: () > +syscall sys_getegid nr 50 nbargs 0 types: () args: () > +syscall sys_acct nr 51 nbargs 1 types: (const char *) args: (name) > +syscall sys_umount nr 52 nbargs 2 types: (char *, int) args: (name, flags) > +syscall sys_ioctl nr 54 nbargs 3 types: (unsigned int, unsigned int, unsigned long) args: (fd, cmd, arg) > +syscall sys_fcntl nr 55 nbargs 3 types: (unsigned int, unsigned int, unsigned long) args: (fd, cmd, arg) > +syscall sys_setpgid nr 57 nbargs 2 types: (pid_t, pid_t) args: (pid, pgid) > +syscall sys_olduname nr 59 nbargs 1 types: (struct oldold_utsname *) args: (name) > +syscall sys_umask nr 60 nbargs 1 types: (int) args: (mask) > +syscall sys_chroot nr 61 nbargs 1 types: (const char *) args: (filename) > +syscall sys_ustat nr 62 nbargs 2 types: (unsigned, struct ustat *) args: (dev, ubuf) > +syscall sys_dup2 nr 63 nbargs 2 types: (unsigned int, unsigned int) args: (oldfd, newfd) > +syscall sys_getppid nr 64 nbargs 0 types: () args: () > +syscall sys_getpgrp nr 65 nbargs 0 types: () args: () > +syscall sys_setsid nr 66 nbargs 0 types: () args: () > +syscall sys_sgetmask nr 68 nbargs 0 types: () args: () > +syscall sys_ssetmask nr 69 nbargs 1 types: (int) args: (newmask) > +syscall sys_setreuid nr 70 nbargs 2 types: (uid_t, uid_t) args: (ruid, euid) > +syscall sys_setregid nr 71 nbargs 2 types: (gid_t, gid_t) args: (rgid, egid) > +syscall sys_sigpending nr 73 nbargs 1 types: (old_sigset_t *) args: (set) > +syscall sys_sethostname nr 74 nbargs 2 types: (char *, int) args: (name, len) > +syscall sys_setrlimit nr 75 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) > +syscall sys_old_getrlimit nr 76 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) > +syscall sys_getrusage nr 77 nbargs 2 types: (int, struct rusage *) args: (who, ru) > +syscall sys_gettimeofday nr 78 nbargs 2 types: (struct timeval *, struct timezone *) args: (tv, tz) > +syscall sys_settimeofday nr 79 nbargs 2 types: (struct timeval *, struct timezone *) args: (tv, tz) > +syscall sys_getgroups nr 80 nbargs 2 types: (int, gid_t *) args: (gidsetsize, grouplist) > +syscall sys_setgroups nr 81 nbargs 2 types: (int, gid_t *) args: (gidsetsize, grouplist) > +syscall sys_symlink nr 83 nbargs 2 types: (const char *, const char *) args: (oldname, newname) > +syscall sys_lstat nr 84 nbargs 2 types: (const char *, struct __old_kernel_stat *) args: (filename, statbuf) > +syscall sys_readlink nr 85 nbargs 3 types: (const char *, char *, int) args: (path, buf, bufsiz) > +syscall sys_uselib nr 86 nbargs 1 types: (const char *) args: (library) > +syscall sys_swapon nr 87 nbargs 2 types: (const char *, int) args: (specialfile, swap_flags) > +syscall sys_reboot nr 88 nbargs 4 types: (int, int, unsigned int, void *) args: (magic1, magic2, cmd, arg) > +syscall sys_old_readdir nr 89 nbargs 3 types: (unsigned int, struct old_linux_dirent *, unsigned int) args: (fd, dirent, count) > +syscall sys_munmap nr 91 nbargs 2 types: (unsigned long, size_t) args: (addr, len) > +syscall sys_truncate nr 92 nbargs 2 types: (const char *, long) args: (path, length) > +syscall sys_ftruncate nr 93 nbargs 2 types: (unsigned int, unsigned long) args: (fd, length) > +syscall sys_fchmod nr 94 nbargs 2 types: (unsigned int, mode_t) args: (fd, mode) > +syscall sys_fchown nr 95 nbargs 3 types: (unsigned int, uid_t, gid_t) args: (fd, user, group) > +syscall sys_getpriority nr 96 nbargs 2 types: (int, int) args: (which, who) > +syscall sys_setpriority nr 97 nbargs 3 types: (int, int, int) args: (which, who, niceval) > +syscall sys_statfs nr 99 nbargs 2 types: (const char *, struct statfs *) args: (pathname, buf) > +syscall sys_fstatfs nr 100 nbargs 2 types: (unsigned int, struct statfs *) args: (fd, buf) > +syscall sys_socketcall nr 102 nbargs 2 types: (int, unsigned long *) args: (call, args) > +syscall sys_syslog nr 103 nbargs 3 types: (int, char *, int) args: (type, buf, len) > +syscall sys_setitimer nr 104 nbargs 3 types: (int, struct itimerval *, struct itimerval *) args: (which, value, ovalue) > +syscall sys_getitimer nr 105 nbargs 2 types: (int, struct itimerval *) args: (which, value) > +syscall sys_newstat nr 106 nbargs 2 types: (const char *, struct stat *) args: (filename, statbuf) > +syscall sys_newlstat nr 107 nbargs 2 types: (const char *, struct stat *) args: (filename, statbuf) > +syscall sys_newfstat nr 108 nbargs 2 types: (unsigned int, struct stat *) args: (fd, statbuf) > +syscall sys_uname nr 109 nbargs 1 types: (struct old_utsname *) args: (name) > +syscall sys_vhangup nr 111 nbargs 0 types: () args: () > +syscall sys_wait4 nr 114 nbargs 4 types: (pid_t, int *, int, struct rusage *) args: (upid, stat_addr, options, ru) > +syscall sys_swapoff nr 115 nbargs 1 types: (const char *) args: (specialfile) > +syscall sys_sysinfo nr 116 nbargs 1 types: (struct sysinfo *) args: (info) > +syscall sys_ipc nr 117 nbargs 6 types: (unsigned int, int, unsigned long, unsigned long, void *, long) args: (call, first, second, third, ptr, fifth) > +syscall sys_fsync nr 118 nbargs 1 types: (unsigned int) args: (fd) > +syscall sys_setdomainname nr 121 nbargs 2 types: (char *, int) args: (name, len) > +syscall sys_newuname nr 122 nbargs 1 types: (struct new_utsname *) args: (name) > +syscall sys_adjtimex nr 124 nbargs 1 types: (struct timex *) args: (txc_p) > +syscall sys_mprotect nr 125 nbargs 3 types: (unsigned long, size_t, unsigned long) args: (start, len, prot) > +syscall sys_sigprocmask nr 126 nbargs 3 types: (int, old_sigset_t *, old_sigset_t *) args: (how, nset, oset) > +syscall sys_init_module nr 128 nbargs 3 types: (void *, unsigned long, const char *) args: (umod, len, uargs) > +syscall sys_delete_module nr 129 nbargs 2 types: (const char *, unsigned int) args: (name_user, flags) > +syscall sys_getpgid nr 132 nbargs 1 types: (pid_t) args: (pid) > +syscall sys_fchdir nr 133 nbargs 1 types: (unsigned int) args: (fd) > +syscall sys_bdflush nr 134 nbargs 2 types: (int, long) args: (func, data) > +syscall sys_sysfs nr 135 nbargs 3 types: (int, unsigned long, unsigned long) args: (option, arg1, arg2) > +syscall sys_personality nr 136 nbargs 1 types: (unsigned int) args: (personality) > +syscall sys_setfsuid nr 138 nbargs 1 types: (uid_t) args: (uid) > +syscall sys_setfsgid nr 139 nbargs 1 types: (gid_t) args: (gid) > +syscall sys_llseek nr 140 nbargs 5 types: (unsigned int, unsigned long, unsigned long, loff_t *, unsigned int) args: (fd, offset_high, offset_low, result, origin) > +syscall sys_getdents nr 141 nbargs 3 types: (unsigned int, struct linux_dirent *, unsigned int) args: (fd, dirent, count) > +syscall sys_select nr 142 nbargs 5 types: (int, fd_set *, fd_set *, fd_set *, struct timeval *) args: (n, inp, outp, exp, tvp) > +syscall sys_flock nr 143 nbargs 2 types: (unsigned int, unsigned int) args: (fd, cmd) > +syscall sys_msync nr 144 nbargs 3 types: (unsigned long, size_t, int) args: (start, len, flags) > +syscall sys_readv nr 145 nbargs 3 types: (unsigned long, const struct iovec *, unsigned long) args: (fd, vec, vlen) > +syscall sys_writev nr 146 nbargs 3 types: (unsigned long, const struct iovec *, unsigned long) args: (fd, vec, vlen) > +syscall sys_getsid nr 147 nbargs 1 types: (pid_t) args: (pid) > +syscall sys_fdatasync nr 148 nbargs 1 types: (unsigned int) args: (fd) > +syscall sys_sysctl nr 149 nbargs 1 types: (struct __sysctl_args *) args: (args) > +syscall sys_mlock nr 150 nbargs 2 types: (unsigned long, size_t) args: (start, len) > +syscall sys_munlock nr 151 nbargs 2 types: (unsigned long, size_t) args: (start, len) > +syscall sys_mlockall nr 152 nbargs 1 types: (int) args: (flags) > +syscall sys_munlockall nr 153 nbargs 0 types: () args: () > +syscall sys_sched_setparam nr 154 nbargs 2 types: (pid_t, struct sched_param *) args: (pid, param) > +syscall sys_sched_getparam nr 155 nbargs 2 types: (pid_t, struct sched_param *) args: (pid, param) > +syscall sys_sched_setscheduler nr 156 nbargs 3 types: (pid_t, int, struct sched_param *) args: (pid, policy, param) > +syscall sys_sched_getscheduler nr 157 nbargs 1 types: (pid_t) args: (pid) > +syscall sys_sched_yield nr 158 nbargs 0 types: () args: () > +syscall sys_sched_get_priority_max nr 159 nbargs 1 types: (int) args: (policy) > +syscall sys_sched_get_priority_min nr 160 nbargs 1 types: (int) args: (policy) > +syscall sys_sched_rr_get_interval nr 161 nbargs 2 types: (pid_t, struct timespec *) args: (pid, interval) > +syscall sys_nanosleep nr 162 nbargs 2 types: (struct timespec *, struct timespec *) args: (rqtp, rmtp) > +syscall sys_mremap nr 163 nbargs 5 types: (unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) args: (addr, old_len, new_len, flags, new_addr) > +syscall sys_setresuid nr 164 nbargs 3 types: (uid_t, uid_t, uid_t) args: (ruid, euid, suid) > +syscall sys_getresuid nr 165 nbargs 3 types: (uid_t *, uid_t *, uid_t *) args: (ruid, euid, suid) > +syscall sys_poll nr 167 nbargs 3 types: (struct pollfd *, unsigned int, long) args: (ufds, nfds, timeout_msecs) > +syscall sys_nfsservctl nr 168 nbargs 3 types: (int, struct nfsctl_arg *, void *) args: (cmd, arg, res) > +syscall sys_setresgid nr 169 nbargs 3 types: (gid_t, gid_t, gid_t) args: (rgid, egid, sgid) > +syscall sys_getresgid nr 170 nbargs 3 types: (gid_t *, gid_t *, gid_t *) args: (rgid, egid, sgid) > +syscall sys_prctl nr 171 nbargs 5 types: (int, unsigned long, unsigned long, unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5) > +syscall sys_rt_sigaction nr 173 nbargs 4 types: (int, const struct sigaction *, struct sigaction *, size_t) args: (sig, act, oact, sigsetsize) > +syscall sys_rt_sigprocmask nr 174 nbargs 4 types: (int, sigset_t *, sigset_t *, size_t) args: (how, nset, oset, sigsetsize) > +syscall sys_rt_sigpending nr 175 nbargs 2 types: (sigset_t *, size_t) args: (set, sigsetsize) > +syscall sys_rt_sigtimedwait nr 176 nbargs 4 types: (const sigset_t *, siginfo_t *, const struct timespec *, size_t) args: (uthese, uinfo, uts, sigsetsize) > +syscall sys_rt_sigqueueinfo nr 177 nbargs 3 types: (pid_t, int, siginfo_t *) args: (pid, sig, uinfo) > +syscall sys_rt_sigsuspend nr 178 nbargs 2 types: (sigset_t *, size_t) args: (unewset, sigsetsize) > +syscall sys_chown nr 181 nbargs 3 types: (const char *, uid_t, gid_t) args: (filename, user, group) > +syscall sys_getcwd nr 182 nbargs 2 types: (char *, unsigned long) args: (buf, size) > +syscall sys_capget nr 183 nbargs 2 types: (cap_user_header_t, cap_user_data_t) args: (header, dataptr) > +syscall sys_capset nr 184 nbargs 2 types: (cap_user_header_t, const cap_user_data_t) args: (header, data) > +syscall sys_sendfile nr 186 nbargs 4 types: (int, int, off_t *, size_t) args: (out_fd, in_fd, offset, count) > +syscall sys_getrlimit nr 190 nbargs 2 types: (unsigned int, struct rlimit *) args: (resource, rlim) > +syscall sys_stat64 nr 195 nbargs 2 types: (const char *, struct stat64 *) args: (filename, statbuf) > +syscall sys_lstat64 nr 196 nbargs 2 types: (const char *, struct stat64 *) args: (filename, statbuf) > +syscall sys_fstat64 nr 197 nbargs 2 types: (unsigned long, struct stat64 *) args: (fd, statbuf) > +syscall sys_pciconfig_read nr 198 nbargs 5 types: (unsigned long, unsigned long, unsigned long, unsigned long, void *) args: (bus, dfn, off, len, buf) > +syscall sys_pciconfig_write nr 199 nbargs 5 types: (unsigned long, unsigned long, unsigned long, unsigned long, void *) args: (bus, dfn, off, len, buf) > +syscall sys_getdents64 nr 202 nbargs 3 types: (unsigned int, struct linux_dirent64 *, unsigned int) args: (fd, dirent, count) > +syscall sys_pivot_root nr 203 nbargs 2 types: (const char *, const char *) args: (new_root, put_old) > +syscall sys_fcntl64 nr 204 nbargs 3 types: (unsigned int, unsigned int, unsigned long) args: (fd, cmd, arg) > +syscall sys_madvise nr 205 nbargs 3 types: (unsigned long, size_t, int) args: (start, len_in, behavior) > +syscall sys_mincore nr 206 nbargs 3 types: (unsigned long, size_t, unsigned char *) args: (start, len, vec) > +syscall sys_gettid nr 207 nbargs 0 types: () args: () > +syscall sys_tkill nr 208 nbargs 2 types: (pid_t, int) args: (pid, sig) > +syscall sys_setxattr nr 209 nbargs 5 types: (const char *, const char *, const void *, size_t, int) args: (pathname, name, value, size, flags) > +syscall sys_lsetxattr nr 210 nbargs 5 types: (const char *, const char *, const void *, size_t, int) args: (pathname, name, value, size, flags) > +syscall sys_fsetxattr nr 211 nbargs 5 types: (int, const char *, const void *, size_t, int) args: (fd, name, value, size, flags) > +syscall sys_getxattr nr 212 nbargs 4 types: (const char *, const char *, void *, size_t) args: (pathname, name, value, size) > +syscall sys_lgetxattr nr 213 nbargs 4 types: (const char *, const char *, void *, size_t) args: (pathname, name, value, size) > +syscall sys_fgetxattr nr 214 nbargs 4 types: (int, const char *, void *, size_t) args: (fd, name, value, size) > +syscall sys_listxattr nr 215 nbargs 3 types: (const char *, char *, size_t) args: (pathname, list, size) > +syscall sys_llistxattr nr 216 nbargs 3 types: (const char *, char *, size_t) args: (pathname, list, size) > +syscall sys_flistxattr nr 217 nbargs 3 types: (int, char *, size_t) args: (fd, list, size) > +syscall sys_removexattr nr 218 nbargs 2 types: (const char *, const char *) args: (pathname, name) > +syscall sys_lremovexattr nr 219 nbargs 2 types: (const char *, const char *) args: (pathname, name) > +syscall sys_fremovexattr nr 220 nbargs 2 types: (int, const char *) args: (fd, name) > +syscall sys_futex nr 221 nbargs 6 types: (u32 *, int, u32, struct timespec *, u32 *, u32) args: (uaddr, op, val, utime, uaddr2, val3) > +syscall sys_sched_setaffinity nr 222 nbargs 3 types: (pid_t, unsigned int, unsigned long *) args: (pid, len, user_mask_ptr) > +syscall sys_sched_getaffinity nr 223 nbargs 3 types: (pid_t, unsigned int, unsigned long *) args: (pid, len, user_mask_ptr) > +syscall sys_sendfile64 nr 226 nbargs 4 types: (int, int, loff_t *, size_t) args: (out_fd, in_fd, offset, count) > +syscall sys_io_setup nr 227 nbargs 2 types: (unsigned, aio_context_t *) args: (nr_events, ctxp) > +syscall sys_io_destroy nr 228 nbargs 1 types: (aio_context_t) args: (ctx) > +syscall sys_io_getevents nr 229 nbargs 5 types: (aio_context_t, long, long, struct io_event *, struct timespec *) args: (ctx_id, min_nr, nr, events, timeout) > +syscall sys_io_submit nr 230 nbargs 3 types: (aio_context_t, long, struct iocb * *) args: (ctx_id, nr, iocbpp) > +syscall sys_io_cancel nr 231 nbargs 3 types: (aio_context_t, struct iocb *, struct io_event *) args: (ctx_id, iocb, result) > +syscall sys_set_tid_address nr 232 nbargs 1 types: (int *) args: (tidptr) > +syscall sys_exit_group nr 234 nbargs 1 types: (int) args: (error_code) > +syscall sys_epoll_create nr 236 nbargs 1 types: (int) args: (size) > +syscall sys_epoll_ctl nr 237 nbargs 4 types: (int, int, int, struct epoll_event *) args: (epfd, op, fd, event) > +syscall sys_epoll_wait nr 238 nbargs 4 types: (int, struct epoll_event *, int, int) args: (epfd, events, maxevents, timeout) > +syscall sys_remap_file_pages nr 239 nbargs 5 types: (unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) args: (start, size, prot, pgoff, flags) > +syscall sys_timer_create nr 240 nbargs 3 types: (const clockid_t, struct sigevent *, timer_t *) args: (which_clock, timer_event_spec, created_timer_id) > +syscall sys_timer_settime nr 241 nbargs 4 types: (timer_t, int, const struct itimerspec *, struct itimerspec *) args: (timer_id, flags, new_setting, old_setting) > +syscall sys_timer_gettime nr 242 nbargs 2 types: (timer_t, struct itimerspec *) args: (timer_id, setting) > +syscall sys_timer_getoverrun nr 243 nbargs 1 types: (timer_t) args: (timer_id) > +syscall sys_timer_delete nr 244 nbargs 1 types: (timer_t) args: (timer_id) > +syscall sys_clock_settime nr 245 nbargs 2 types: (const clockid_t, const struct timespec *) args: (which_clock, tp) > +syscall sys_clock_gettime nr 246 nbargs 2 types: (const clockid_t, struct timespec *) args: (which_clock, tp) > +syscall sys_clock_getres nr 247 nbargs 2 types: (const clockid_t, struct timespec *) args: (which_clock, tp) > +syscall sys_clock_nanosleep nr 248 nbargs 4 types: (const clockid_t, int, const struct timespec *, struct timespec *) args: (which_clock, flags, rqtp, rmtp) > +syscall sys_tgkill nr 250 nbargs 3 types: (pid_t, pid_t, int) args: (tgid, pid, sig) > +syscall sys_utimes nr 251 nbargs 2 types: (char *, struct timeval *) args: (filename, utimes) > +syscall sys_statfs64 nr 252 nbargs 3 types: (const char *, size_t, struct statfs64 *) args: (pathname, sz, buf) > +syscall sys_fstatfs64 nr 253 nbargs 3 types: (unsigned int, size_t, struct statfs64 *) args: (fd, sz, buf) > +syscall sys_mq_open nr 262 nbargs 4 types: (const char *, int, mode_t, struct mq_attr *) args: (u_name, oflag, mode, u_attr) > +syscall sys_mq_unlink nr 263 nbargs 1 types: (const char *) args: (u_name) > +syscall sys_mq_timedsend nr 264 nbargs 5 types: (mqd_t, const char *, size_t, unsigned int, const struct timespec *) args: (mqdes, u_msg_ptr, msg_len, msg_prio, u_abs_timeout) > +syscall sys_mq_timedreceive nr 265 nbargs 5 types: (mqd_t, char *, size_t, unsigned int *, const struct timespec *) args: (mqdes, u_msg_ptr, msg_len, u_msg_prio, u_abs_timeout) > +syscall sys_mq_notify nr 266 nbargs 2 types: (mqd_t, const struct sigevent *) args: (mqdes, u_notification) > +syscall sys_mq_getsetattr nr 267 nbargs 3 types: (mqd_t, const struct mq_attr *, struct mq_attr *) args: (mqdes, u_mqstat, u_omqstat) > +syscall sys_add_key nr 269 nbargs 5 types: (const char *, const char *, const void *, size_t, key_serial_t) args: (_type, _description, _payload, plen, ringid) > +syscall sys_request_key nr 270 nbargs 4 types: (const char *, const char *, const char *, key_serial_t) args: (_type, _description, _callout_info, destringid) > +syscall sys_keyctl nr 271 nbargs 5 types: (int, unsigned long, unsigned long, unsigned long, unsigned long) args: (option, arg2, arg3, arg4, arg5) > +syscall sys_waitid nr 272 nbargs 5 types: (int, pid_t, struct siginfo *, int, struct rusage *) args: (which, upid, infop, options, ru) > +syscall sys_ioprio_set nr 273 nbargs 3 types: (int, int, int) args: (which, who, ioprio) > +syscall sys_ioprio_get nr 274 nbargs 2 types: (int, int) args: (which, who) > +syscall sys_inotify_init nr 275 nbargs 0 types: () args: () > +syscall sys_inotify_add_watch nr 276 nbargs 3 types: (int, const char *, u32) args: (fd, pathname, mask) > +syscall sys_inotify_rm_watch nr 277 nbargs 2 types: (int, __s32) args: (fd, wd) > +syscall sys_pselect6 nr 280 nbargs 6 types: (int, fd_set *, fd_set *, fd_set *, struct timespec *, void *) args: (n, inp, outp, exp, tsp, sig) > +syscall sys_ppoll nr 281 nbargs 5 types: (struct pollfd *, unsigned int, struct timespec *, const sigset_t *, size_t) args: (ufds, nfds, tsp, sigmask, sigsetsize) > +syscall sys_unshare nr 282 nbargs 1 types: (unsigned long) args: (unshare_flags) > +syscall sys_splice nr 283 nbargs 6 types: (int, loff_t *, int, loff_t *, size_t, unsigned int) args: (fd_in, off_in, fd_out, off_out, len, flags) > +syscall sys_tee nr 284 nbargs 4 types: (int, int, size_t, unsigned int) args: (fdin, fdout, len, flags) > +syscall sys_vmsplice nr 285 nbargs 4 types: (int, const struct iovec *, unsigned long, unsigned int) args: (fd, iov, nr_segs, flags) > +syscall sys_openat nr 286 nbargs 4 types: (int, const char *, int, int) args: (dfd, filename, flags, mode) > +syscall sys_mkdirat nr 287 nbargs 3 types: (int, const char *, int) args: (dfd, pathname, mode) > +syscall sys_mknodat nr 288 nbargs 4 types: (int, const char *, int, unsigned) args: (dfd, filename, mode, dev) > +syscall sys_fchownat nr 289 nbargs 5 types: (int, const char *, uid_t, gid_t, int) args: (dfd, filename, user, group, flag) > +syscall sys_futimesat nr 290 nbargs 3 types: (int, const char *, struct timeval *) args: (dfd, filename, utimes) > +syscall sys_fstatat64 nr 291 nbargs 4 types: (int, const char *, struct stat64 *, int) args: (dfd, filename, statbuf, flag) > +syscall sys_unlinkat nr 292 nbargs 3 types: (int, const char *, int) args: (dfd, pathname, flag) > +syscall sys_renameat nr 293 nbargs 4 types: (int, const char *, int, const char *) args: (olddfd, oldname, newdfd, newname) > +syscall sys_linkat nr 294 nbargs 5 types: (int, const char *, int, const char *, int) args: (olddfd, oldname, newdfd, newname, flags) > +syscall sys_symlinkat nr 295 nbargs 3 types: (const char *, int, const char *) args: (oldname, newdfd, newname) > +syscall sys_readlinkat nr 296 nbargs 4 types: (int, const char *, char *, int) args: (dfd, pathname, buf, bufsiz) > +syscall sys_fchmodat nr 297 nbargs 3 types: (int, const char *, mode_t) args: (dfd, filename, mode) > +syscall sys_faccessat nr 298 nbargs 3 types: (int, const char *, int) args: (dfd, filename, mode) > +syscall sys_get_robust_list nr 299 nbargs 3 types: (int, struct robust_list_head * *, size_t *) args: (pid, head_ptr, len_ptr) > +syscall sys_set_robust_list nr 300 nbargs 2 types: (struct robust_list_head *, size_t) args: (head, len) > +syscall sys_getcpu nr 302 nbargs 3 types: (unsigned *, unsigned *, struct getcpu_cache *) args: (cpup, nodep, unused) > +syscall sys_epoll_pwait nr 303 nbargs 6 types: (int, struct epoll_event *, int, int, const sigset_t *, size_t) args: (epfd, events, maxevents, timeout, sigmask, sigsetsize) > +syscall sys_utimensat nr 304 nbargs 4 types: (int, const char *, struct timespec *, int) args: (dfd, filename, utimes, flags) > +syscall sys_signalfd nr 305 nbargs 3 types: (int, sigset_t *, size_t) args: (ufd, user_mask, sizemask) > +syscall sys_timerfd_create nr 306 nbargs 2 types: (int, int) args: (clockid, flags) > +syscall sys_eventfd nr 307 nbargs 1 types: (unsigned int) args: (count) > +syscall sys_timerfd_settime nr 311 nbargs 4 types: (int, int, const struct itimerspec *, struct itimerspec *) args: (ufd, flags, utmr, otmr) > +syscall sys_timerfd_gettime nr 312 nbargs 2 types: (int, struct itimerspec *) args: (ufd, otmr) > +syscall sys_signalfd4 nr 313 nbargs 4 types: (int, sigset_t *, size_t, int) args: (ufd, user_mask, sizemask, flags) > +syscall sys_eventfd2 nr 314 nbargs 2 types: (unsigned int, int) args: (count, flags) > +syscall sys_epoll_create1 nr 315 nbargs 1 types: (int) args: (flags) > +syscall sys_dup3 nr 316 nbargs 3 types: (unsigned int, unsigned int, int) args: (oldfd, newfd, flags) > +syscall sys_pipe2 nr 317 nbargs 2 types: (int *, int) args: (fildes, flags) > +syscall sys_inotify_init1 nr 318 nbargs 1 types: (int) args: (flags) > +syscall sys_perf_event_open nr 319 nbargs 5 types: (struct perf_event_attr *, pid_t, int, int, unsigned long) args: (attr_uptr, pid, cpu, group_fd, flags) > +syscall sys_preadv nr 320 nbargs 5 types: (unsigned long, const struct iovec *, unsigned long, unsigned long, unsigned long) args: (fd, vec, vlen, pos_l, pos_h) > +syscall sys_pwritev nr 321 nbargs 5 types: (unsigned long, const struct iovec *, unsigned long, unsigned long, unsigned long) args: (fd, vec, vlen, pos_l, pos_h) > +syscall sys_rt_tgsigqueueinfo nr 322 nbargs 4 types: (pid_t, pid_t, int, siginfo_t *) args: (tgid, pid, sig, uinfo) > +syscall sys_prlimit64 nr 325 nbargs 4 types: (pid_t, unsigned int, const struct rlimit64 *, struct rlimit64 *) args: (pid, resource, new_rlim, old_rlim) > +syscall sys_socket nr 326 nbargs 3 types: (int, int, int) args: (family, type, protocol) > +syscall sys_bind nr 327 nbargs 3 types: (int, struct sockaddr *, int) args: (fd, umyaddr, addrlen) > +syscall sys_connect nr 328 nbargs 3 types: (int, struct sockaddr *, int) args: (fd, uservaddr, addrlen) > +syscall sys_listen nr 329 nbargs 2 types: (int, int) args: (fd, backlog) > +syscall sys_accept nr 330 nbargs 3 types: (int, struct sockaddr *, int *) args: (fd, upeer_sockaddr, upeer_addrlen) > +syscall sys_getsockname nr 331 nbargs 3 types: (int, struct sockaddr *, int *) args: (fd, usockaddr, usockaddr_len) > +syscall sys_getpeername nr 332 nbargs 3 types: (int, struct sockaddr *, int *) args: (fd, usockaddr, usockaddr_len) > +syscall sys_socketpair nr 333 nbargs 4 types: (int, int, int, int *) args: (family, type, protocol, usockvec) > +syscall sys_send nr 334 nbargs 4 types: (int, void *, size_t, unsigned) args: (fd, buff, len, flags) > +syscall sys_sendto nr 335 nbargs 6 types: (int, void *, size_t, unsigned, struct sockaddr *, int) args: (fd, buff, len, flags, addr, addr_len) > +syscall sys_recvfrom nr 337 nbargs 6 types: (int, void *, size_t, unsigned, struct sockaddr *, int *) args: (fd, ubuf, size, flags, addr, addr_len) > +syscall sys_shutdown nr 338 nbargs 2 types: (int, int) args: (fd, how) > +syscall sys_setsockopt nr 339 nbargs 5 types: (int, int, int, char *, int) args: (fd, level, optname, optval, optlen) > +syscall sys_getsockopt nr 340 nbargs 5 types: (int, int, int, char *, int *) args: (fd, level, optname, optval, optlen) > +syscall sys_sendmsg nr 341 nbargs 3 types: (int, struct msghdr *, unsigned) args: (fd, msg, flags) > +syscall sys_recvmsg nr 342 nbargs 3 types: (int, struct msghdr *, unsigned int) args: (fd, msg, flags) > +syscall sys_recvmmsg nr 343 nbargs 5 types: (int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *) args: (fd, mmsg, vlen, flags, timeout) > +syscall sys_accept4 nr 344 nbargs 4 types: (int, struct sockaddr *, int *, int) args: (fd, upeer_sockaddr, upeer_addrlen, flags) > +syscall sys_clock_adjtime nr 347 nbargs 2 types: (const clockid_t, struct timex *) args: (which_clock, utx) > +syscall sys_syncfs nr 348 nbargs 1 types: (int) args: (fd) > +syscall sys_sendmmsg nr 349 nbargs 4 types: (int, struct mmsghdr *, unsigned int, unsigned int) args: (fd, mmsg, vlen, flags) > +syscall sys_setns nr 350 nbargs 2 types: (int, int) args: (fd, nstype) > diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers.h > new file mode 100644 > index 0000000..f8ff459 > --- /dev/null > +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers.h > @@ -0,0 +1,1043 @@ > +/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */ > +#ifndef CREATE_SYSCALL_TABLE > + > +#if !defined(_TRACE_SYSCALLS_INTEGERS_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_SYSCALLS_INTEGERS_H > + > +#include > +#include > +#include "powerpc-32-syscalls-3.0.34_integers_override.h" > +#include "syscalls_integers_override.h" > + > +SC_DECLARE_EVENT_CLASS_NOARGS(syscalls_noargs, > + TP_STRUCT__entry(), > + TP_fast_assign(), > + TP_printk() > +) > +#ifndef OVERRIDE_32_sys_restart_syscall > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_restart_syscall) > +#endif > +#ifndef OVERRIDE_32_sys_getpid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getpid) > +#endif > +#ifndef OVERRIDE_32_sys_getuid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getuid) > +#endif > +#ifndef OVERRIDE_32_sys_pause > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_pause) > +#endif > +#ifndef OVERRIDE_32_sys_sync > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sync) > +#endif > +#ifndef OVERRIDE_32_sys_getgid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getgid) > +#endif > +#ifndef OVERRIDE_32_sys_geteuid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_geteuid) > +#endif > +#ifndef OVERRIDE_32_sys_getegid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getegid) > +#endif > +#ifndef OVERRIDE_32_sys_getppid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getppid) > +#endif > +#ifndef OVERRIDE_32_sys_getpgrp > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_getpgrp) > +#endif > +#ifndef OVERRIDE_32_sys_setsid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_setsid) > +#endif > +#ifndef OVERRIDE_32_sys_sgetmask > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sgetmask) > +#endif > +#ifndef OVERRIDE_32_sys_vhangup > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_vhangup) > +#endif > +#ifndef OVERRIDE_32_sys_munlockall > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_munlockall) > +#endif > +#ifndef OVERRIDE_32_sys_sched_yield > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_sched_yield) > +#endif > +#ifndef OVERRIDE_32_sys_gettid > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_gettid) > +#endif > +#ifndef OVERRIDE_32_sys_inotify_init > +SC_DEFINE_EVENT_NOARGS(syscalls_noargs, sys_inotify_init) > +#endif > +#ifndef OVERRIDE_32_sys_exit > +SC_TRACE_EVENT(sys_exit, > + TP_PROTO(int error_code), > + TP_ARGS(error_code), > + TP_STRUCT__entry(__field(int, error_code)), > + TP_fast_assign(tp_assign(error_code, error_code)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_close > +SC_TRACE_EVENT(sys_close, > + TP_PROTO(unsigned int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(unsigned int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setuid > +SC_TRACE_EVENT(sys_setuid, > + TP_PROTO(uid_t uid), > + TP_ARGS(uid), > + TP_STRUCT__entry(__field(uid_t, uid)), > + TP_fast_assign(tp_assign(uid, uid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_alarm > +SC_TRACE_EVENT(sys_alarm, > + TP_PROTO(unsigned int seconds), > + TP_ARGS(seconds), > + TP_STRUCT__entry(__field(unsigned int, seconds)), > + TP_fast_assign(tp_assign(seconds, seconds)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_nice > +SC_TRACE_EVENT(sys_nice, > + TP_PROTO(int increment), > + TP_ARGS(increment), > + TP_STRUCT__entry(__field(int, increment)), > + TP_fast_assign(tp_assign(increment, increment)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_dup > +SC_TRACE_EVENT(sys_dup, > + TP_PROTO(unsigned int fildes), > + TP_ARGS(fildes), > + TP_STRUCT__entry(__field(unsigned int, fildes)), > + TP_fast_assign(tp_assign(fildes, fildes)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_brk > +SC_TRACE_EVENT(sys_brk, > + TP_PROTO(unsigned long brk), > + TP_ARGS(brk), > + TP_STRUCT__entry(__field(unsigned long, brk)), > + TP_fast_assign(tp_assign(brk, brk)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setgid > +SC_TRACE_EVENT(sys_setgid, > + TP_PROTO(gid_t gid), > + TP_ARGS(gid), > + TP_STRUCT__entry(__field(gid_t, gid)), > + TP_fast_assign(tp_assign(gid, gid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_umask > +SC_TRACE_EVENT(sys_umask, > + TP_PROTO(int mask), > + TP_ARGS(mask), > + TP_STRUCT__entry(__field(int, mask)), > + TP_fast_assign(tp_assign(mask, mask)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ssetmask > +SC_TRACE_EVENT(sys_ssetmask, > + TP_PROTO(int newmask), > + TP_ARGS(newmask), > + TP_STRUCT__entry(__field(int, newmask)), > + TP_fast_assign(tp_assign(newmask, newmask)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fsync > +SC_TRACE_EVENT(sys_fsync, > + TP_PROTO(unsigned int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(unsigned int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getpgid > +SC_TRACE_EVENT(sys_getpgid, > + TP_PROTO(pid_t pid), > + TP_ARGS(pid), > + TP_STRUCT__entry(__field(pid_t, pid)), > + TP_fast_assign(tp_assign(pid, pid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fchdir > +SC_TRACE_EVENT(sys_fchdir, > + TP_PROTO(unsigned int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(unsigned int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_personality > +SC_TRACE_EVENT(sys_personality, > + TP_PROTO(unsigned int personality), > + TP_ARGS(personality), > + TP_STRUCT__entry(__field(unsigned int, personality)), > + TP_fast_assign(tp_assign(personality, personality)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setfsuid > +SC_TRACE_EVENT(sys_setfsuid, > + TP_PROTO(uid_t uid), > + TP_ARGS(uid), > + TP_STRUCT__entry(__field(uid_t, uid)), > + TP_fast_assign(tp_assign(uid, uid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setfsgid > +SC_TRACE_EVENT(sys_setfsgid, > + TP_PROTO(gid_t gid), > + TP_ARGS(gid), > + TP_STRUCT__entry(__field(gid_t, gid)), > + TP_fast_assign(tp_assign(gid, gid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getsid > +SC_TRACE_EVENT(sys_getsid, > + TP_PROTO(pid_t pid), > + TP_ARGS(pid), > + TP_STRUCT__entry(__field(pid_t, pid)), > + TP_fast_assign(tp_assign(pid, pid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fdatasync > +SC_TRACE_EVENT(sys_fdatasync, > + TP_PROTO(unsigned int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(unsigned int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mlockall > +SC_TRACE_EVENT(sys_mlockall, > + TP_PROTO(int flags), > + TP_ARGS(flags), > + TP_STRUCT__entry(__field(int, flags)), > + TP_fast_assign(tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_getscheduler > +SC_TRACE_EVENT(sys_sched_getscheduler, > + TP_PROTO(pid_t pid), > + TP_ARGS(pid), > + TP_STRUCT__entry(__field(pid_t, pid)), > + TP_fast_assign(tp_assign(pid, pid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_get_priority_max > +SC_TRACE_EVENT(sys_sched_get_priority_max, > + TP_PROTO(int policy), > + TP_ARGS(policy), > + TP_STRUCT__entry(__field(int, policy)), > + TP_fast_assign(tp_assign(policy, policy)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_get_priority_min > +SC_TRACE_EVENT(sys_sched_get_priority_min, > + TP_PROTO(int policy), > + TP_ARGS(policy), > + TP_STRUCT__entry(__field(int, policy)), > + TP_fast_assign(tp_assign(policy, policy)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_io_destroy > +SC_TRACE_EVENT(sys_io_destroy, > + TP_PROTO(aio_context_t ctx), > + TP_ARGS(ctx), > + TP_STRUCT__entry(__field(aio_context_t, ctx)), > + TP_fast_assign(tp_assign(ctx, ctx)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_exit_group > +SC_TRACE_EVENT(sys_exit_group, > + TP_PROTO(int error_code), > + TP_ARGS(error_code), > + TP_STRUCT__entry(__field(int, error_code)), > + TP_fast_assign(tp_assign(error_code, error_code)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_epoll_create > +SC_TRACE_EVENT(sys_epoll_create, > + TP_PROTO(int size), > + TP_ARGS(size), > + TP_STRUCT__entry(__field(int, size)), > + TP_fast_assign(tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timer_getoverrun > +SC_TRACE_EVENT(sys_timer_getoverrun, > + TP_PROTO(timer_t timer_id), > + TP_ARGS(timer_id), > + TP_STRUCT__entry(__field(timer_t, timer_id)), > + TP_fast_assign(tp_assign(timer_id, timer_id)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timer_delete > +SC_TRACE_EVENT(sys_timer_delete, > + TP_PROTO(timer_t timer_id), > + TP_ARGS(timer_id), > + TP_STRUCT__entry(__field(timer_t, timer_id)), > + TP_fast_assign(tp_assign(timer_id, timer_id)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_unshare > +SC_TRACE_EVENT(sys_unshare, > + TP_PROTO(unsigned long unshare_flags), > + TP_ARGS(unshare_flags), > + TP_STRUCT__entry(__field(unsigned long, unshare_flags)), > + TP_fast_assign(tp_assign(unshare_flags, unshare_flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_eventfd > +SC_TRACE_EVENT(sys_eventfd, > + TP_PROTO(unsigned int count), > + TP_ARGS(count), > + TP_STRUCT__entry(__field(unsigned int, count)), > + TP_fast_assign(tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_epoll_create1 > +SC_TRACE_EVENT(sys_epoll_create1, > + TP_PROTO(int flags), > + TP_ARGS(flags), > + TP_STRUCT__entry(__field(int, flags)), > + TP_fast_assign(tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_inotify_init1 > +SC_TRACE_EVENT(sys_inotify_init1, > + TP_PROTO(int flags), > + TP_ARGS(flags), > + TP_STRUCT__entry(__field(int, flags)), > + TP_fast_assign(tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_syncfs > +SC_TRACE_EVENT(sys_syncfs, > + TP_PROTO(int fd), > + TP_ARGS(fd), > + TP_STRUCT__entry(__field(int, fd)), > + TP_fast_assign(tp_assign(fd, fd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_kill > +SC_TRACE_EVENT(sys_kill, > + TP_PROTO(pid_t pid, int sig), > + TP_ARGS(pid, sig), > + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_signal > +SC_TRACE_EVENT(sys_signal, > + TP_PROTO(int sig, __sighandler_t handler), > + TP_ARGS(sig, handler), > + TP_STRUCT__entry(__field(int, sig) __field(__sighandler_t, handler)), > + TP_fast_assign(tp_assign(sig, sig) tp_assign(handler, handler)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setpgid > +SC_TRACE_EVENT(sys_setpgid, > + TP_PROTO(pid_t pid, pid_t pgid), > + TP_ARGS(pid, pgid), > + TP_STRUCT__entry(__field(pid_t, pid) __field(pid_t, pgid)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(pgid, pgid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_dup2 > +SC_TRACE_EVENT(sys_dup2, > + TP_PROTO(unsigned int oldfd, unsigned int newfd), > + TP_ARGS(oldfd, newfd), > + TP_STRUCT__entry(__field(unsigned int, oldfd) __field(unsigned int, newfd)), > + TP_fast_assign(tp_assign(oldfd, oldfd) tp_assign(newfd, newfd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setreuid > +SC_TRACE_EVENT(sys_setreuid, > + TP_PROTO(uid_t ruid, uid_t euid), > + TP_ARGS(ruid, euid), > + TP_STRUCT__entry(__field(uid_t, ruid) __field(uid_t, euid)), > + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setregid > +SC_TRACE_EVENT(sys_setregid, > + TP_PROTO(gid_t rgid, gid_t egid), > + TP_ARGS(rgid, egid), > + TP_STRUCT__entry(__field(gid_t, rgid) __field(gid_t, egid)), > + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_munmap > +SC_TRACE_EVENT(sys_munmap, > + TP_PROTO(unsigned long addr, size_t len), > + TP_ARGS(addr, len), > + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(size_t, len)), > + TP_fast_assign(tp_assign(addr, addr) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ftruncate > +SC_TRACE_EVENT(sys_ftruncate, > + TP_PROTO(unsigned int fd, unsigned long length), > + TP_ARGS(fd, length), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned long, length)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(length, length)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fchmod > +SC_TRACE_EVENT(sys_fchmod, > + TP_PROTO(unsigned int fd, mode_t mode), > + TP_ARGS(fd, mode), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(mode_t, mode)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getpriority > +SC_TRACE_EVENT(sys_getpriority, > + TP_PROTO(int which, int who), > + TP_ARGS(which, who), > + TP_STRUCT__entry(__field(int, which) __field(int, who)), > + TP_fast_assign(tp_assign(which, which) tp_assign(who, who)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_bdflush > +SC_TRACE_EVENT(sys_bdflush, > + TP_PROTO(int func, long data), > + TP_ARGS(func, data), > + TP_STRUCT__entry(__field(int, func) __field(long, data)), > + TP_fast_assign(tp_assign(func, func) tp_assign(data, data)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_flock > +SC_TRACE_EVENT(sys_flock, > + TP_PROTO(unsigned int fd, unsigned int cmd), > + TP_ARGS(fd, cmd), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mlock > +SC_TRACE_EVENT(sys_mlock, > + TP_PROTO(unsigned long start, size_t len), > + TP_ARGS(start, len), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_munlock > +SC_TRACE_EVENT(sys_munlock, > + TP_PROTO(unsigned long start, size_t len), > + TP_ARGS(start, len), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_tkill > +SC_TRACE_EVENT(sys_tkill, > + TP_PROTO(pid_t pid, int sig), > + TP_ARGS(pid, sig), > + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ioprio_get > +SC_TRACE_EVENT(sys_ioprio_get, > + TP_PROTO(int which, int who), > + TP_ARGS(which, who), > + TP_STRUCT__entry(__field(int, which) __field(int, who)), > + TP_fast_assign(tp_assign(which, which) tp_assign(who, who)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_inotify_rm_watch > +SC_TRACE_EVENT(sys_inotify_rm_watch, > + TP_PROTO(int fd, __s32 wd), > + TP_ARGS(fd, wd), > + TP_STRUCT__entry(__field(int, fd) __field(__s32, wd)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(wd, wd)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timerfd_create > +SC_TRACE_EVENT(sys_timerfd_create, > + TP_PROTO(int clockid, int flags), > + TP_ARGS(clockid, flags), > + TP_STRUCT__entry(__field(int, clockid) __field(int, flags)), > + TP_fast_assign(tp_assign(clockid, clockid) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_eventfd2 > +SC_TRACE_EVENT(sys_eventfd2, > + TP_PROTO(unsigned int count, int flags), > + TP_ARGS(count, flags), > + TP_STRUCT__entry(__field(unsigned int, count) __field(int, flags)), > + TP_fast_assign(tp_assign(count, count) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_listen > +SC_TRACE_EVENT(sys_listen, > + TP_PROTO(int fd, int backlog), > + TP_ARGS(fd, backlog), > + TP_STRUCT__entry(__field(int, fd) __field(int, backlog)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(backlog, backlog)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_shutdown > +SC_TRACE_EVENT(sys_shutdown, > + TP_PROTO(int fd, int how), > + TP_ARGS(fd, how), > + TP_STRUCT__entry(__field(int, fd) __field(int, how)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(how, how)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setns > +SC_TRACE_EVENT(sys_setns, > + TP_PROTO(int fd, int nstype), > + TP_ARGS(fd, nstype), > + TP_STRUCT__entry(__field(int, fd) __field(int, nstype)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(nstype, nstype)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lseek > +SC_TRACE_EVENT(sys_lseek, > + TP_PROTO(unsigned int fd, off_t offset, unsigned int origin), > + TP_ARGS(fd, offset, origin), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(off_t, offset) __field(unsigned int, origin)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(offset, offset) tp_assign(origin, origin)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ioctl > +SC_TRACE_EVENT(sys_ioctl, > + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), > + TP_ARGS(fd, cmd, arg), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fcntl > +SC_TRACE_EVENT(sys_fcntl, > + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), > + TP_ARGS(fd, cmd, arg), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fchown > +SC_TRACE_EVENT(sys_fchown, > + TP_PROTO(unsigned int fd, uid_t user, gid_t group), > + TP_ARGS(fd, user, group), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(uid_t, user) __field(gid_t, group)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(user, user) tp_assign(group, group)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setpriority > +SC_TRACE_EVENT(sys_setpriority, > + TP_PROTO(int which, int who, int niceval), > + TP_ARGS(which, who, niceval), > + TP_STRUCT__entry(__field(int, which) __field(int, who) __field(int, niceval)), > + TP_fast_assign(tp_assign(which, which) tp_assign(who, who) tp_assign(niceval, niceval)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mprotect > +SC_TRACE_EVENT(sys_mprotect, > + TP_PROTO(unsigned long start, size_t len, unsigned long prot), > + TP_ARGS(start, len, prot), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field(unsigned long, prot)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(prot, prot)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sysfs > +SC_TRACE_EVENT(sys_sysfs, > + TP_PROTO(int option, unsigned long arg1, unsigned long arg2), > + TP_ARGS(option, arg1, arg2), > + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg1) __field(unsigned long, arg2)), > + TP_fast_assign(tp_assign(option, option) tp_assign(arg1, arg1) tp_assign(arg2, arg2)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_msync > +SC_TRACE_EVENT(sys_msync, > + TP_PROTO(unsigned long start, size_t len, int flags), > + TP_ARGS(start, len, flags), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field(int, flags)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setresuid > +SC_TRACE_EVENT(sys_setresuid, > + TP_PROTO(uid_t ruid, uid_t euid, uid_t suid), > + TP_ARGS(ruid, euid, suid), > + TP_STRUCT__entry(__field(uid_t, ruid) __field(uid_t, euid) __field(uid_t, suid)), > + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setresgid > +SC_TRACE_EVENT(sys_setresgid, > + TP_PROTO(gid_t rgid, gid_t egid, gid_t sgid), > + TP_ARGS(rgid, egid, sgid), > + TP_STRUCT__entry(__field(gid_t, rgid) __field(gid_t, egid) __field(gid_t, sgid)), > + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fcntl64 > +SC_TRACE_EVENT(sys_fcntl64, > + TP_PROTO(unsigned int fd, unsigned int cmd, unsigned long arg), > + TP_ARGS(fd, cmd, arg), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned int, cmd) __field(unsigned long, arg)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(cmd, cmd) tp_assign(arg, arg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_madvise > +SC_TRACE_EVENT(sys_madvise, > + TP_PROTO(unsigned long start, size_t len_in, int behavior), > + TP_ARGS(start, len_in, behavior), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len_in) __field(int, behavior)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len_in, len_in) tp_assign(behavior, behavior)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_tgkill > +SC_TRACE_EVENT(sys_tgkill, > + TP_PROTO(pid_t tgid, pid_t pid, int sig), > + TP_ARGS(tgid, pid, sig), > + TP_STRUCT__entry(__field(pid_t, tgid) __field(pid_t, pid) __field(int, sig)), > + TP_fast_assign(tp_assign(tgid, tgid) tp_assign(pid, pid) tp_assign(sig, sig)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ioprio_set > +SC_TRACE_EVENT(sys_ioprio_set, > + TP_PROTO(int which, int who, int ioprio), > + TP_ARGS(which, who, ioprio), > + TP_STRUCT__entry(__field(int, which) __field(int, who) __field(int, ioprio)), > + TP_fast_assign(tp_assign(which, which) tp_assign(who, who) tp_assign(ioprio, ioprio)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_dup3 > +SC_TRACE_EVENT(sys_dup3, > + TP_PROTO(unsigned int oldfd, unsigned int newfd, int flags), > + TP_ARGS(oldfd, newfd, flags), > + TP_STRUCT__entry(__field(unsigned int, oldfd) __field(unsigned int, newfd) __field(int, flags)), > + TP_fast_assign(tp_assign(oldfd, oldfd) tp_assign(newfd, newfd) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_socket > +SC_TRACE_EVENT(sys_socket, > + TP_PROTO(int family, int type, int protocol), > + TP_ARGS(family, type, protocol), > + TP_STRUCT__entry(__field(int, family) __field(int, type) __field(int, protocol)), > + TP_fast_assign(tp_assign(family, family) tp_assign(type, type) tp_assign(protocol, protocol)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ptrace > +SC_TRACE_EVENT(sys_ptrace, > + TP_PROTO(long request, long pid, unsigned long addr, unsigned long data), > + TP_ARGS(request, pid, addr, data), > + TP_STRUCT__entry(__field(long, request) __field(long, pid) __field_hex(unsigned long, addr) __field(unsigned long, data)), > + TP_fast_assign(tp_assign(request, request) tp_assign(pid, pid) tp_assign(addr, addr) tp_assign(data, data)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_tee > +SC_TRACE_EVENT(sys_tee, > + TP_PROTO(int fdin, int fdout, size_t len, unsigned int flags), > + TP_ARGS(fdin, fdout, len, flags), > + TP_STRUCT__entry(__field(int, fdin) __field(int, fdout) __field(size_t, len) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fdin, fdin) tp_assign(fdout, fdout) tp_assign(len, len) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mremap > +SC_TRACE_EVENT(sys_mremap, > + TP_PROTO(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr), > + TP_ARGS(addr, old_len, new_len, flags, new_addr), > + TP_STRUCT__entry(__field_hex(unsigned long, addr) __field(unsigned long, old_len) __field(unsigned long, new_len) __field(unsigned long, flags) __field_hex(unsigned long, new_addr)), > + TP_fast_assign(tp_assign(addr, addr) tp_assign(old_len, old_len) tp_assign(new_len, new_len) tp_assign(flags, flags) tp_assign(new_addr, new_addr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_prctl > +SC_TRACE_EVENT(sys_prctl, > + TP_PROTO(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5), > + TP_ARGS(option, arg2, arg3, arg4, arg5), > + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg2) __field(unsigned long, arg3) __field(unsigned long, arg4) __field(unsigned long, arg5)), > + TP_fast_assign(tp_assign(option, option) tp_assign(arg2, arg2) tp_assign(arg3, arg3) tp_assign(arg4, arg4) tp_assign(arg5, arg5)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_remap_file_pages > +SC_TRACE_EVENT(sys_remap_file_pages, > + TP_PROTO(unsigned long start, unsigned long size, unsigned long prot, unsigned long pgoff, unsigned long flags), > + TP_ARGS(start, size, prot, pgoff, flags), > + TP_STRUCT__entry(__field(unsigned long, start) __field(unsigned long, size) __field(unsigned long, prot) __field(unsigned long, pgoff) __field(unsigned long, flags)), > + TP_fast_assign(tp_assign(start, start) tp_assign(size, size) tp_assign(prot, prot) tp_assign(pgoff, pgoff) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_keyctl > +SC_TRACE_EVENT(sys_keyctl, > + TP_PROTO(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5), > + TP_ARGS(option, arg2, arg3, arg4, arg5), > + TP_STRUCT__entry(__field(int, option) __field(unsigned long, arg2) __field(unsigned long, arg3) __field(unsigned long, arg4) __field(unsigned long, arg5)), > + TP_fast_assign(tp_assign(option, option) tp_assign(arg2, arg2) tp_assign(arg3, arg3) tp_assign(arg4, arg4) tp_assign(arg5, arg5)), > + TP_printk() > +) > +#endif > + > +#endif /* _TRACE_SYSCALLS_INTEGERS_H */ > + > +/* This part must be outside protection */ > +#include "../../../probes/define_trace.h" > + > +#else /* CREATE_SYSCALL_TABLE */ > + > +#include "powerpc-32-syscalls-3.0.34_integers_override.h" > +#include "syscalls_integers_override.h" > + > +#ifndef OVERRIDE_TABLE_32_sys_restart_syscall > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_restart_syscall, 0, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getpid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getpid, 20, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getuid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getuid, 24, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pause > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_pause, 29, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sync > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sync, 36, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getgid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getgid, 47, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_geteuid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_geteuid, 49, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getegid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getegid, 50, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getppid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getppid, 64, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getpgrp > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_getpgrp, 65, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setsid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_setsid, 66, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sgetmask > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sgetmask, 68, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_vhangup > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_vhangup, 111, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_munlockall > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_munlockall, 153, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_yield > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_sched_yield, 158, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_gettid > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_gettid, 207, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_inotify_init > +TRACE_SYSCALL_TABLE(syscalls_noargs, sys_inotify_init, 275, 0) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_exit > +TRACE_SYSCALL_TABLE(sys_exit, sys_exit, 1, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_close > +TRACE_SYSCALL_TABLE(sys_close, sys_close, 6, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lseek > +TRACE_SYSCALL_TABLE(sys_lseek, sys_lseek, 19, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setuid > +TRACE_SYSCALL_TABLE(sys_setuid, sys_setuid, 23, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ptrace > +TRACE_SYSCALL_TABLE(sys_ptrace, sys_ptrace, 26, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_alarm > +TRACE_SYSCALL_TABLE(sys_alarm, sys_alarm, 27, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_nice > +TRACE_SYSCALL_TABLE(sys_nice, sys_nice, 34, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_kill > +TRACE_SYSCALL_TABLE(sys_kill, sys_kill, 37, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_dup > +TRACE_SYSCALL_TABLE(sys_dup, sys_dup, 41, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_brk > +TRACE_SYSCALL_TABLE(sys_brk, sys_brk, 45, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setgid > +TRACE_SYSCALL_TABLE(sys_setgid, sys_setgid, 46, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_signal > +TRACE_SYSCALL_TABLE(sys_signal, sys_signal, 48, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ioctl > +TRACE_SYSCALL_TABLE(sys_ioctl, sys_ioctl, 54, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fcntl > +TRACE_SYSCALL_TABLE(sys_fcntl, sys_fcntl, 55, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setpgid > +TRACE_SYSCALL_TABLE(sys_setpgid, sys_setpgid, 57, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_umask > +TRACE_SYSCALL_TABLE(sys_umask, sys_umask, 60, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_dup2 > +TRACE_SYSCALL_TABLE(sys_dup2, sys_dup2, 63, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ssetmask > +TRACE_SYSCALL_TABLE(sys_ssetmask, sys_ssetmask, 69, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setreuid > +TRACE_SYSCALL_TABLE(sys_setreuid, sys_setreuid, 70, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setregid > +TRACE_SYSCALL_TABLE(sys_setregid, sys_setregid, 71, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_munmap > +TRACE_SYSCALL_TABLE(sys_munmap, sys_munmap, 91, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ftruncate > +TRACE_SYSCALL_TABLE(sys_ftruncate, sys_ftruncate, 93, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fchmod > +TRACE_SYSCALL_TABLE(sys_fchmod, sys_fchmod, 94, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fchown > +TRACE_SYSCALL_TABLE(sys_fchown, sys_fchown, 95, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getpriority > +TRACE_SYSCALL_TABLE(sys_getpriority, sys_getpriority, 96, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setpriority > +TRACE_SYSCALL_TABLE(sys_setpriority, sys_setpriority, 97, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fsync > +TRACE_SYSCALL_TABLE(sys_fsync, sys_fsync, 118, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mprotect > +TRACE_SYSCALL_TABLE(sys_mprotect, sys_mprotect, 125, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getpgid > +TRACE_SYSCALL_TABLE(sys_getpgid, sys_getpgid, 132, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fchdir > +TRACE_SYSCALL_TABLE(sys_fchdir, sys_fchdir, 133, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_bdflush > +TRACE_SYSCALL_TABLE(sys_bdflush, sys_bdflush, 134, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sysfs > +TRACE_SYSCALL_TABLE(sys_sysfs, sys_sysfs, 135, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_personality > +TRACE_SYSCALL_TABLE(sys_personality, sys_personality, 136, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setfsuid > +TRACE_SYSCALL_TABLE(sys_setfsuid, sys_setfsuid, 138, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setfsgid > +TRACE_SYSCALL_TABLE(sys_setfsgid, sys_setfsgid, 139, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_flock > +TRACE_SYSCALL_TABLE(sys_flock, sys_flock, 143, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_msync > +TRACE_SYSCALL_TABLE(sys_msync, sys_msync, 144, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getsid > +TRACE_SYSCALL_TABLE(sys_getsid, sys_getsid, 147, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fdatasync > +TRACE_SYSCALL_TABLE(sys_fdatasync, sys_fdatasync, 148, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mlock > +TRACE_SYSCALL_TABLE(sys_mlock, sys_mlock, 150, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_munlock > +TRACE_SYSCALL_TABLE(sys_munlock, sys_munlock, 151, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mlockall > +TRACE_SYSCALL_TABLE(sys_mlockall, sys_mlockall, 152, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_getscheduler > +TRACE_SYSCALL_TABLE(sys_sched_getscheduler, sys_sched_getscheduler, 157, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_get_priority_max > +TRACE_SYSCALL_TABLE(sys_sched_get_priority_max, sys_sched_get_priority_max, 159, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_get_priority_min > +TRACE_SYSCALL_TABLE(sys_sched_get_priority_min, sys_sched_get_priority_min, 160, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mremap > +TRACE_SYSCALL_TABLE(sys_mremap, sys_mremap, 163, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setresuid > +TRACE_SYSCALL_TABLE(sys_setresuid, sys_setresuid, 164, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setresgid > +TRACE_SYSCALL_TABLE(sys_setresgid, sys_setresgid, 169, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_prctl > +TRACE_SYSCALL_TABLE(sys_prctl, sys_prctl, 171, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fcntl64 > +TRACE_SYSCALL_TABLE(sys_fcntl64, sys_fcntl64, 204, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_madvise > +TRACE_SYSCALL_TABLE(sys_madvise, sys_madvise, 205, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_tkill > +TRACE_SYSCALL_TABLE(sys_tkill, sys_tkill, 208, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_io_destroy > +TRACE_SYSCALL_TABLE(sys_io_destroy, sys_io_destroy, 228, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_exit_group > +TRACE_SYSCALL_TABLE(sys_exit_group, sys_exit_group, 234, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_epoll_create > +TRACE_SYSCALL_TABLE(sys_epoll_create, sys_epoll_create, 236, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_remap_file_pages > +TRACE_SYSCALL_TABLE(sys_remap_file_pages, sys_remap_file_pages, 239, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timer_getoverrun > +TRACE_SYSCALL_TABLE(sys_timer_getoverrun, sys_timer_getoverrun, 243, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timer_delete > +TRACE_SYSCALL_TABLE(sys_timer_delete, sys_timer_delete, 244, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_tgkill > +TRACE_SYSCALL_TABLE(sys_tgkill, sys_tgkill, 250, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_keyctl > +TRACE_SYSCALL_TABLE(sys_keyctl, sys_keyctl, 271, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ioprio_set > +TRACE_SYSCALL_TABLE(sys_ioprio_set, sys_ioprio_set, 273, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ioprio_get > +TRACE_SYSCALL_TABLE(sys_ioprio_get, sys_ioprio_get, 274, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_inotify_rm_watch > +TRACE_SYSCALL_TABLE(sys_inotify_rm_watch, sys_inotify_rm_watch, 277, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_unshare > +TRACE_SYSCALL_TABLE(sys_unshare, sys_unshare, 282, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_tee > +TRACE_SYSCALL_TABLE(sys_tee, sys_tee, 284, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timerfd_create > +TRACE_SYSCALL_TABLE(sys_timerfd_create, sys_timerfd_create, 306, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_eventfd > +TRACE_SYSCALL_TABLE(sys_eventfd, sys_eventfd, 307, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_eventfd2 > +TRACE_SYSCALL_TABLE(sys_eventfd2, sys_eventfd2, 314, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_epoll_create1 > +TRACE_SYSCALL_TABLE(sys_epoll_create1, sys_epoll_create1, 315, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_dup3 > +TRACE_SYSCALL_TABLE(sys_dup3, sys_dup3, 316, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_inotify_init1 > +TRACE_SYSCALL_TABLE(sys_inotify_init1, sys_inotify_init1, 318, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_socket > +TRACE_SYSCALL_TABLE(sys_socket, sys_socket, 326, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_listen > +TRACE_SYSCALL_TABLE(sys_listen, sys_listen, 329, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_shutdown > +TRACE_SYSCALL_TABLE(sys_shutdown, sys_shutdown, 338, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_syncfs > +TRACE_SYSCALL_TABLE(sys_syncfs, sys_syncfs, 348, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setns > +TRACE_SYSCALL_TABLE(sys_setns, sys_setns, 350, 2) > +#endif > + > +#endif /* CREATE_SYSCALL_TABLE */ > diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers.h > new file mode 100644 > index 0000000..4244db4 > --- /dev/null > +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers.h > @@ -0,0 +1,2316 @@ > +/* THIS FILE IS AUTO-GENERATED. DO NOT EDIT */ > +#ifndef CREATE_SYSCALL_TABLE > + > +#if !defined(_TRACE_SYSCALLS_POINTERS_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_SYSCALLS_POINTERS_H > + > +#include > +#include > +#include "powerpc-32-syscalls-3.0.34_pointers_override.h" > +#include "syscalls_pointers_override.h" > + > +#ifndef OVERRIDE_32_sys_unlink > +SC_TRACE_EVENT(sys_unlink, > + TP_PROTO(const char * pathname), > + TP_ARGS(pathname), > + TP_STRUCT__entry(__string_from_user(pathname, pathname)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_chdir > +SC_TRACE_EVENT(sys_chdir, > + TP_PROTO(const char * filename), > + TP_ARGS(filename), > + TP_STRUCT__entry(__string_from_user(filename, filename)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_time > +SC_TRACE_EVENT(sys_time, > + TP_PROTO(time_t * tloc), > + TP_ARGS(tloc), > + TP_STRUCT__entry(__field_hex(time_t *, tloc)), > + TP_fast_assign(tp_assign(tloc, tloc)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_oldumount > +SC_TRACE_EVENT(sys_oldumount, > + TP_PROTO(char * name), > + TP_ARGS(name), > + TP_STRUCT__entry(__string_from_user(name, name)), > + TP_fast_assign(tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_stime > +SC_TRACE_EVENT(sys_stime, > + TP_PROTO(time_t * tptr), > + TP_ARGS(tptr), > + TP_STRUCT__entry(__field_hex(time_t *, tptr)), > + TP_fast_assign(tp_assign(tptr, tptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rmdir > +SC_TRACE_EVENT(sys_rmdir, > + TP_PROTO(const char * pathname), > + TP_ARGS(pathname), > + TP_STRUCT__entry(__string_from_user(pathname, pathname)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_pipe > +SC_TRACE_EVENT(sys_pipe, > + TP_PROTO(int * fildes), > + TP_ARGS(fildes), > + TP_STRUCT__entry(__field_hex(int *, fildes)), > + TP_fast_assign(tp_assign(fildes, fildes)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_times > +SC_TRACE_EVENT(sys_times, > + TP_PROTO(struct tms * tbuf), > + TP_ARGS(tbuf), > + TP_STRUCT__entry(__field_hex(struct tms *, tbuf)), > + TP_fast_assign(tp_assign(tbuf, tbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_acct > +SC_TRACE_EVENT(sys_acct, > + TP_PROTO(const char * name), > + TP_ARGS(name), > + TP_STRUCT__entry(__string_from_user(name, name)), > + TP_fast_assign(tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_olduname > +SC_TRACE_EVENT(sys_olduname, > + TP_PROTO(struct oldold_utsname * name), > + TP_ARGS(name), > + TP_STRUCT__entry(__field_hex(struct oldold_utsname *, name)), > + TP_fast_assign(tp_assign(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_chroot > +SC_TRACE_EVENT(sys_chroot, > + TP_PROTO(const char * filename), > + TP_ARGS(filename), > + TP_STRUCT__entry(__string_from_user(filename, filename)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sigpending > +SC_TRACE_EVENT(sys_sigpending, > + TP_PROTO(old_sigset_t * set), > + TP_ARGS(set), > + TP_STRUCT__entry(__field_hex(old_sigset_t *, set)), > + TP_fast_assign(tp_assign(set, set)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_uselib > +SC_TRACE_EVENT(sys_uselib, > + TP_PROTO(const char * library), > + TP_ARGS(library), > + TP_STRUCT__entry(__field_hex(const char *, library)), > + TP_fast_assign(tp_assign(library, library)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_uname > +SC_TRACE_EVENT(sys_uname, > + TP_PROTO(struct old_utsname * name), > + TP_ARGS(name), > + TP_STRUCT__entry(__field_hex(struct old_utsname *, name)), > + TP_fast_assign(tp_assign(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_swapoff > +SC_TRACE_EVENT(sys_swapoff, > + TP_PROTO(const char * specialfile), > + TP_ARGS(specialfile), > + TP_STRUCT__entry(__string_from_user(specialfile, specialfile)), > + TP_fast_assign(tp_copy_string_from_user(specialfile, specialfile)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sysinfo > +SC_TRACE_EVENT(sys_sysinfo, > + TP_PROTO(struct sysinfo * info), > + TP_ARGS(info), > + TP_STRUCT__entry(__field_hex(struct sysinfo *, info)), > + TP_fast_assign(tp_assign(info, info)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_newuname > +SC_TRACE_EVENT(sys_newuname, > + TP_PROTO(struct new_utsname * name), > + TP_ARGS(name), > + TP_STRUCT__entry(__field_hex(struct new_utsname *, name)), > + TP_fast_assign(tp_assign(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_adjtimex > +SC_TRACE_EVENT(sys_adjtimex, > + TP_PROTO(struct timex * txc_p), > + TP_ARGS(txc_p), > + TP_STRUCT__entry(__field_hex(struct timex *, txc_p)), > + TP_fast_assign(tp_assign(txc_p, txc_p)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sysctl > +SC_TRACE_EVENT(sys_sysctl, > + TP_PROTO(struct __sysctl_args * args), > + TP_ARGS(args), > + TP_STRUCT__entry(__field_hex(struct __sysctl_args *, args)), > + TP_fast_assign(tp_assign(args, args)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_set_tid_address > +SC_TRACE_EVENT(sys_set_tid_address, > + TP_PROTO(int * tidptr), > + TP_ARGS(tidptr), > + TP_STRUCT__entry(__field_hex(int *, tidptr)), > + TP_fast_assign(tp_assign(tidptr, tidptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mq_unlink > +SC_TRACE_EVENT(sys_mq_unlink, > + TP_PROTO(const char * u_name), > + TP_ARGS(u_name), > + TP_STRUCT__entry(__string_from_user(u_name, u_name)), > + TP_fast_assign(tp_copy_string_from_user(u_name, u_name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_creat > +SC_TRACE_EVENT(sys_creat, > + TP_PROTO(const char * pathname, int mode), > + TP_ARGS(pathname, mode), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field(int, mode)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_link > +SC_TRACE_EVENT(sys_link, > + TP_PROTO(const char * oldname, const char * newname), > + TP_ARGS(oldname, newname), > + TP_STRUCT__entry(__string_from_user(oldname, oldname) __string_from_user(newname, newname)), > + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_copy_string_from_user(newname, newname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_chmod > +SC_TRACE_EVENT(sys_chmod, > + TP_PROTO(const char * filename, mode_t mode), > + TP_ARGS(filename, mode), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(mode_t, mode)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_stat > +SC_TRACE_EVENT(sys_stat, > + TP_PROTO(const char * filename, struct __old_kernel_stat * statbuf), > + TP_ARGS(filename, statbuf), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct __old_kernel_stat *, statbuf)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fstat > +SC_TRACE_EVENT(sys_fstat, > + TP_PROTO(unsigned int fd, struct __old_kernel_stat * statbuf), > + TP_ARGS(fd, statbuf), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct __old_kernel_stat *, statbuf)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_utime > +SC_TRACE_EVENT(sys_utime, > + TP_PROTO(char * filename, struct utimbuf * times), > + TP_ARGS(filename, times), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct utimbuf *, times)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(times, times)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_access > +SC_TRACE_EVENT(sys_access, > + TP_PROTO(const char * filename, int mode), > + TP_ARGS(filename, mode), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(int, mode)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rename > +SC_TRACE_EVENT(sys_rename, > + TP_PROTO(const char * oldname, const char * newname), > + TP_ARGS(oldname, newname), > + TP_STRUCT__entry(__string_from_user(oldname, oldname) __string_from_user(newname, newname)), > + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_copy_string_from_user(newname, newname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mkdir > +SC_TRACE_EVENT(sys_mkdir, > + TP_PROTO(const char * pathname, int mode), > + TP_ARGS(pathname, mode), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field(int, mode)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_umount > +SC_TRACE_EVENT(sys_umount, > + TP_PROTO(char * name, int flags), > + TP_ARGS(name, flags), > + TP_STRUCT__entry(__string_from_user(name, name) __field(int, flags)), > + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ustat > +SC_TRACE_EVENT(sys_ustat, > + TP_PROTO(unsigned dev, struct ustat * ubuf), > + TP_ARGS(dev, ubuf), > + TP_STRUCT__entry(__field(unsigned, dev) __field_hex(struct ustat *, ubuf)), > + TP_fast_assign(tp_assign(dev, dev) tp_assign(ubuf, ubuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sethostname > +SC_TRACE_EVENT(sys_sethostname, > + TP_PROTO(char * name, int len), > + TP_ARGS(name, len), > + TP_STRUCT__entry(__string_from_user(name, name) __field(int, len)), > + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setrlimit > +SC_TRACE_EVENT(sys_setrlimit, > + TP_PROTO(unsigned int resource, struct rlimit * rlim), > + TP_ARGS(resource, rlim), > + TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), > + TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_old_getrlimit > +SC_TRACE_EVENT(sys_old_getrlimit, > + TP_PROTO(unsigned int resource, struct rlimit * rlim), > + TP_ARGS(resource, rlim), > + TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), > + TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getrusage > +SC_TRACE_EVENT(sys_getrusage, > + TP_PROTO(int who, struct rusage * ru), > + TP_ARGS(who, ru), > + TP_STRUCT__entry(__field(int, who) __field_hex(struct rusage *, ru)), > + TP_fast_assign(tp_assign(who, who) tp_assign(ru, ru)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_gettimeofday > +SC_TRACE_EVENT(sys_gettimeofday, > + TP_PROTO(struct timeval * tv, struct timezone * tz), > + TP_ARGS(tv, tz), > + TP_STRUCT__entry(__field_hex(struct timeval *, tv) __field_hex(struct timezone *, tz)), > + TP_fast_assign(tp_assign(tv, tv) tp_assign(tz, tz)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_settimeofday > +SC_TRACE_EVENT(sys_settimeofday, > + TP_PROTO(struct timeval * tv, struct timezone * tz), > + TP_ARGS(tv, tz), > + TP_STRUCT__entry(__field_hex(struct timeval *, tv) __field_hex(struct timezone *, tz)), > + TP_fast_assign(tp_assign(tv, tv) tp_assign(tz, tz)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getgroups > +SC_TRACE_EVENT(sys_getgroups, > + TP_PROTO(int gidsetsize, gid_t * grouplist), > + TP_ARGS(gidsetsize, grouplist), > + TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(gid_t *, grouplist)), > + TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setgroups > +SC_TRACE_EVENT(sys_setgroups, > + TP_PROTO(int gidsetsize, gid_t * grouplist), > + TP_ARGS(gidsetsize, grouplist), > + TP_STRUCT__entry(__field(int, gidsetsize) __field_hex(gid_t *, grouplist)), > + TP_fast_assign(tp_assign(gidsetsize, gidsetsize) tp_assign(grouplist, grouplist)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_symlink > +SC_TRACE_EVENT(sys_symlink, > + TP_PROTO(const char * oldname, const char * newname), > + TP_ARGS(oldname, newname), > + TP_STRUCT__entry(__string_from_user(oldname, oldname) __string_from_user(newname, newname)), > + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_copy_string_from_user(newname, newname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lstat > +SC_TRACE_EVENT(sys_lstat, > + TP_PROTO(const char * filename, struct __old_kernel_stat * statbuf), > + TP_ARGS(filename, statbuf), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct __old_kernel_stat *, statbuf)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_swapon > +SC_TRACE_EVENT(sys_swapon, > + TP_PROTO(const char * specialfile, int swap_flags), > + TP_ARGS(specialfile, swap_flags), > + TP_STRUCT__entry(__string_from_user(specialfile, specialfile) __field(int, swap_flags)), > + TP_fast_assign(tp_copy_string_from_user(specialfile, specialfile) tp_assign(swap_flags, swap_flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_truncate > +SC_TRACE_EVENT(sys_truncate, > + TP_PROTO(const char * path, long length), > + TP_ARGS(path, length), > + TP_STRUCT__entry(__string_from_user(path, path) __field(long, length)), > + TP_fast_assign(tp_copy_string_from_user(path, path) tp_assign(length, length)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_statfs > +SC_TRACE_EVENT(sys_statfs, > + TP_PROTO(const char * pathname, struct statfs * buf), > + TP_ARGS(pathname, buf), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(struct statfs *, buf)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fstatfs > +SC_TRACE_EVENT(sys_fstatfs, > + TP_PROTO(unsigned int fd, struct statfs * buf), > + TP_ARGS(fd, buf), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct statfs *, buf)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_socketcall > +SC_TRACE_EVENT(sys_socketcall, > + TP_PROTO(int call, unsigned long * args), > + TP_ARGS(call, args), > + TP_STRUCT__entry(__field(int, call) __field_hex(unsigned long *, args)), > + TP_fast_assign(tp_assign(call, call) tp_assign(args, args)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getitimer > +SC_TRACE_EVENT(sys_getitimer, > + TP_PROTO(int which, struct itimerval * value), > + TP_ARGS(which, value), > + TP_STRUCT__entry(__field(int, which) __field_hex(struct itimerval *, value)), > + TP_fast_assign(tp_assign(which, which) tp_assign(value, value)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_newstat > +SC_TRACE_EVENT(sys_newstat, > + TP_PROTO(const char * filename, struct stat * statbuf), > + TP_ARGS(filename, statbuf), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat *, statbuf)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_newlstat > +SC_TRACE_EVENT(sys_newlstat, > + TP_PROTO(const char * filename, struct stat * statbuf), > + TP_ARGS(filename, statbuf), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat *, statbuf)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_newfstat > +SC_TRACE_EVENT(sys_newfstat, > + TP_PROTO(unsigned int fd, struct stat * statbuf), > + TP_ARGS(fd, statbuf), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct stat *, statbuf)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setdomainname > +SC_TRACE_EVENT(sys_setdomainname, > + TP_PROTO(char * name, int len), > + TP_ARGS(name, len), > + TP_STRUCT__entry(__string_from_user(name, name) __field(int, len)), > + TP_fast_assign(tp_copy_string_from_user(name, name) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_delete_module > +SC_TRACE_EVENT(sys_delete_module, > + TP_PROTO(const char * name_user, unsigned int flags), > + TP_ARGS(name_user, flags), > + TP_STRUCT__entry(__string_from_user(name_user, name_user) __field(unsigned int, flags)), > + TP_fast_assign(tp_copy_string_from_user(name_user, name_user) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_setparam > +SC_TRACE_EVENT(sys_sched_setparam, > + TP_PROTO(pid_t pid, struct sched_param * param), > + TP_ARGS(pid, param), > + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct sched_param *, param)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(param, param)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_getparam > +SC_TRACE_EVENT(sys_sched_getparam, > + TP_PROTO(pid_t pid, struct sched_param * param), > + TP_ARGS(pid, param), > + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct sched_param *, param)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(param, param)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_rr_get_interval > +SC_TRACE_EVENT(sys_sched_rr_get_interval, > + TP_PROTO(pid_t pid, struct timespec * interval), > + TP_ARGS(pid, interval), > + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(struct timespec *, interval)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(interval, interval)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_nanosleep > +SC_TRACE_EVENT(sys_nanosleep, > + TP_PROTO(struct timespec * rqtp, struct timespec * rmtp), > + TP_ARGS(rqtp, rmtp), > + TP_STRUCT__entry(__field_hex(struct timespec *, rqtp) __field_hex(struct timespec *, rmtp)), > + TP_fast_assign(tp_assign(rqtp, rqtp) tp_assign(rmtp, rmtp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_sigpending > +SC_TRACE_EVENT(sys_rt_sigpending, > + TP_PROTO(sigset_t * set, size_t sigsetsize), > + TP_ARGS(set, sigsetsize), > + TP_STRUCT__entry(__field_hex(sigset_t *, set) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(set, set) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_sigsuspend > +SC_TRACE_EVENT(sys_rt_sigsuspend, > + TP_PROTO(sigset_t * unewset, size_t sigsetsize), > + TP_ARGS(unewset, sigsetsize), > + TP_STRUCT__entry(__field_hex(sigset_t *, unewset) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(unewset, unewset) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getcwd > +SC_TRACE_EVENT(sys_getcwd, > + TP_PROTO(char * buf, unsigned long size), > + TP_ARGS(buf, size), > + TP_STRUCT__entry(__field_hex(char *, buf) __field(unsigned long, size)), > + TP_fast_assign(tp_assign(buf, buf) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getrlimit > +SC_TRACE_EVENT(sys_getrlimit, > + TP_PROTO(unsigned int resource, struct rlimit * rlim), > + TP_ARGS(resource, rlim), > + TP_STRUCT__entry(__field(unsigned int, resource) __field_hex(struct rlimit *, rlim)), > + TP_fast_assign(tp_assign(resource, resource) tp_assign(rlim, rlim)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_stat64 > +SC_TRACE_EVENT(sys_stat64, > + TP_PROTO(const char * filename, struct stat64 * statbuf), > + TP_ARGS(filename, statbuf), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat64 *, statbuf)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lstat64 > +SC_TRACE_EVENT(sys_lstat64, > + TP_PROTO(const char * filename, struct stat64 * statbuf), > + TP_ARGS(filename, statbuf), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct stat64 *, statbuf)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fstat64 > +SC_TRACE_EVENT(sys_fstat64, > + TP_PROTO(unsigned long fd, struct stat64 * statbuf), > + TP_ARGS(fd, statbuf), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(struct stat64 *, statbuf)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(statbuf, statbuf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_pivot_root > +SC_TRACE_EVENT(sys_pivot_root, > + TP_PROTO(const char * new_root, const char * put_old), > + TP_ARGS(new_root, put_old), > + TP_STRUCT__entry(__string_from_user(new_root, new_root) __string_from_user(put_old, put_old)), > + TP_fast_assign(tp_copy_string_from_user(new_root, new_root) tp_copy_string_from_user(put_old, put_old)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_removexattr > +SC_TRACE_EVENT(sys_removexattr, > + TP_PROTO(const char * pathname, const char * name), > + TP_ARGS(pathname, name), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lremovexattr > +SC_TRACE_EVENT(sys_lremovexattr, > + TP_PROTO(const char * pathname, const char * name), > + TP_ARGS(pathname, name), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fremovexattr > +SC_TRACE_EVENT(sys_fremovexattr, > + TP_PROTO(int fd, const char * name), > + TP_ARGS(fd, name), > + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name)), > + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_io_setup > +SC_TRACE_EVENT(sys_io_setup, > + TP_PROTO(unsigned nr_events, aio_context_t * ctxp), > + TP_ARGS(nr_events, ctxp), > + TP_STRUCT__entry(__field(unsigned, nr_events) __field_hex(aio_context_t *, ctxp)), > + TP_fast_assign(tp_assign(nr_events, nr_events) tp_assign(ctxp, ctxp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timer_gettime > +SC_TRACE_EVENT(sys_timer_gettime, > + TP_PROTO(timer_t timer_id, struct itimerspec * setting), > + TP_ARGS(timer_id, setting), > + TP_STRUCT__entry(__field(timer_t, timer_id) __field_hex(struct itimerspec *, setting)), > + TP_fast_assign(tp_assign(timer_id, timer_id) tp_assign(setting, setting)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_clock_settime > +SC_TRACE_EVENT(sys_clock_settime, > + TP_PROTO(const clockid_t which_clock, const struct timespec * tp), > + TP_ARGS(which_clock, tp), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(const struct timespec *, tp)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_clock_gettime > +SC_TRACE_EVENT(sys_clock_gettime, > + TP_PROTO(const clockid_t which_clock, struct timespec * tp), > + TP_ARGS(which_clock, tp), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timespec *, tp)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_clock_getres > +SC_TRACE_EVENT(sys_clock_getres, > + TP_PROTO(const clockid_t which_clock, struct timespec * tp), > + TP_ARGS(which_clock, tp), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timespec *, tp)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(tp, tp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_utimes > +SC_TRACE_EVENT(sys_utimes, > + TP_PROTO(char * filename, struct timeval * utimes), > + TP_ARGS(filename, utimes), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field_hex(struct timeval *, utimes)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mq_notify > +SC_TRACE_EVENT(sys_mq_notify, > + TP_PROTO(mqd_t mqdes, const struct sigevent * u_notification), > + TP_ARGS(mqdes, u_notification), > + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const struct sigevent *, u_notification)), > + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_notification, u_notification)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_set_robust_list > +SC_TRACE_EVENT(sys_set_robust_list, > + TP_PROTO(struct robust_list_head * head, size_t len), > + TP_ARGS(head, len), > + TP_STRUCT__entry(__field_hex(struct robust_list_head *, head) __field(size_t, len)), > + TP_fast_assign(tp_assign(head, head) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timerfd_gettime > +SC_TRACE_EVENT(sys_timerfd_gettime, > + TP_PROTO(int ufd, struct itimerspec * otmr), > + TP_ARGS(ufd, otmr), > + TP_STRUCT__entry(__field(int, ufd) __field_hex(struct itimerspec *, otmr)), > + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(otmr, otmr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_pipe2 > +SC_TRACE_EVENT(sys_pipe2, > + TP_PROTO(int * fildes, int flags), > + TP_ARGS(fildes, flags), > + TP_STRUCT__entry(__field_hex(int *, fildes) __field(int, flags)), > + TP_fast_assign(tp_assign(fildes, fildes) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_clock_adjtime > +SC_TRACE_EVENT(sys_clock_adjtime, > + TP_PROTO(const clockid_t which_clock, struct timex * utx), > + TP_ARGS(which_clock, utx), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct timex *, utx)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(utx, utx)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_read > +SC_TRACE_EVENT(sys_read, > + TP_PROTO(unsigned int fd, char * buf, size_t count), > + TP_ARGS(fd, buf, count), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(char *, buf) __field(size_t, count)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_write > +SC_TRACE_EVENT(sys_write, > + TP_PROTO(unsigned int fd, const char * buf, size_t count), > + TP_ARGS(fd, buf, count), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(const char *, buf) __field(size_t, count)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buf, buf) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_open > +SC_TRACE_EVENT(sys_open, > + TP_PROTO(const char * filename, int flags, int mode), > + TP_ARGS(filename, flags, mode), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(int, flags) __field(int, mode)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(flags, flags) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_waitpid > +SC_TRACE_EVENT(sys_waitpid, > + TP_PROTO(pid_t pid, int * stat_addr, int options), > + TP_ARGS(pid, stat_addr, options), > + TP_STRUCT__entry(__field(pid_t, pid) __field_hex(int *, stat_addr) __field(int, options)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(stat_addr, stat_addr) tp_assign(options, options)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mknod > +SC_TRACE_EVENT(sys_mknod, > + TP_PROTO(const char * filename, int mode, unsigned dev), > + TP_ARGS(filename, mode, dev), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(int, mode) __field(unsigned, dev)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(mode, mode) tp_assign(dev, dev)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lchown > +SC_TRACE_EVENT(sys_lchown, > + TP_PROTO(const char * filename, uid_t user, gid_t group), > + TP_ARGS(filename, user, group), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_readlink > +SC_TRACE_EVENT(sys_readlink, > + TP_PROTO(const char * path, char * buf, int bufsiz), > + TP_ARGS(path, buf, bufsiz), > + TP_STRUCT__entry(__string_from_user(path, path) __field_hex(char *, buf) __field(int, bufsiz)), > + TP_fast_assign(tp_copy_string_from_user(path, path) tp_assign(buf, buf) tp_assign(bufsiz, bufsiz)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_old_readdir > +SC_TRACE_EVENT(sys_old_readdir, > + TP_PROTO(unsigned int fd, struct old_linux_dirent * dirent, unsigned int count), > + TP_ARGS(fd, dirent, count), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct old_linux_dirent *, dirent) __field(unsigned int, count)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(dirent, dirent) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_syslog > +SC_TRACE_EVENT(sys_syslog, > + TP_PROTO(int type, char * buf, int len), > + TP_ARGS(type, buf, len), > + TP_STRUCT__entry(__field(int, type) __field_hex(char *, buf) __field(int, len)), > + TP_fast_assign(tp_assign(type, type) tp_assign(buf, buf) tp_assign(len, len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setitimer > +SC_TRACE_EVENT(sys_setitimer, > + TP_PROTO(int which, struct itimerval * value, struct itimerval * ovalue), > + TP_ARGS(which, value, ovalue), > + TP_STRUCT__entry(__field(int, which) __field_hex(struct itimerval *, value) __field_hex(struct itimerval *, ovalue)), > + TP_fast_assign(tp_assign(which, which) tp_assign(value, value) tp_assign(ovalue, ovalue)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sigprocmask > +SC_TRACE_EVENT(sys_sigprocmask, > + TP_PROTO(int how, old_sigset_t * nset, old_sigset_t * oset), > + TP_ARGS(how, nset, oset), > + TP_STRUCT__entry(__field(int, how) __field_hex(old_sigset_t *, nset) __field_hex(old_sigset_t *, oset)), > + TP_fast_assign(tp_assign(how, how) tp_assign(nset, nset) tp_assign(oset, oset)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_init_module > +SC_TRACE_EVENT(sys_init_module, > + TP_PROTO(void * umod, unsigned long len, const char * uargs), > + TP_ARGS(umod, len, uargs), > + TP_STRUCT__entry(__field_hex(void *, umod) __field(unsigned long, len) __field_hex(const char *, uargs)), > + TP_fast_assign(tp_assign(umod, umod) tp_assign(len, len) tp_assign(uargs, uargs)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getdents > +SC_TRACE_EVENT(sys_getdents, > + TP_PROTO(unsigned int fd, struct linux_dirent * dirent, unsigned int count), > + TP_ARGS(fd, dirent, count), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct linux_dirent *, dirent) __field(unsigned int, count)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(dirent, dirent) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_readv > +SC_TRACE_EVENT(sys_readv, > + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen), > + TP_ARGS(fd, vec, vlen), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_writev > +SC_TRACE_EVENT(sys_writev, > + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen), > + TP_ARGS(fd, vec, vlen), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_setscheduler > +SC_TRACE_EVENT(sys_sched_setscheduler, > + TP_PROTO(pid_t pid, int policy, struct sched_param * param), > + TP_ARGS(pid, policy, param), > + TP_STRUCT__entry(__field(pid_t, pid) __field(int, policy) __field_hex(struct sched_param *, param)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(policy, policy) tp_assign(param, param)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getresuid > +SC_TRACE_EVENT(sys_getresuid, > + TP_PROTO(uid_t * ruid, uid_t * euid, uid_t * suid), > + TP_ARGS(ruid, euid, suid), > + TP_STRUCT__entry(__field_hex(uid_t *, ruid) __field_hex(uid_t *, euid) __field_hex(uid_t *, suid)), > + TP_fast_assign(tp_assign(ruid, ruid) tp_assign(euid, euid) tp_assign(suid, suid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_poll > +SC_TRACE_EVENT(sys_poll, > + TP_PROTO(struct pollfd * ufds, unsigned int nfds, long timeout_msecs), > + TP_ARGS(ufds, nfds, timeout_msecs), > + TP_STRUCT__entry(__field_hex(struct pollfd *, ufds) __field(unsigned int, nfds) __field(long, timeout_msecs)), > + TP_fast_assign(tp_assign(ufds, ufds) tp_assign(nfds, nfds) tp_assign(timeout_msecs, timeout_msecs)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_nfsservctl > +SC_TRACE_EVENT(sys_nfsservctl, > + TP_PROTO(int cmd, struct nfsctl_arg * arg, void * res), > + TP_ARGS(cmd, arg, res), > + TP_STRUCT__entry(__field(int, cmd) __field_hex(struct nfsctl_arg *, arg) __field_hex(void *, res)), > + TP_fast_assign(tp_assign(cmd, cmd) tp_assign(arg, arg) tp_assign(res, res)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getresgid > +SC_TRACE_EVENT(sys_getresgid, > + TP_PROTO(gid_t * rgid, gid_t * egid, gid_t * sgid), > + TP_ARGS(rgid, egid, sgid), > + TP_STRUCT__entry(__field_hex(gid_t *, rgid) __field_hex(gid_t *, egid) __field_hex(gid_t *, sgid)), > + TP_fast_assign(tp_assign(rgid, rgid) tp_assign(egid, egid) tp_assign(sgid, sgid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_sigqueueinfo > +SC_TRACE_EVENT(sys_rt_sigqueueinfo, > + TP_PROTO(pid_t pid, int sig, siginfo_t * uinfo), > + TP_ARGS(pid, sig, uinfo), > + TP_STRUCT__entry(__field(pid_t, pid) __field(int, sig) __field_hex(siginfo_t *, uinfo)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(sig, sig) tp_assign(uinfo, uinfo)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_chown > +SC_TRACE_EVENT(sys_chown, > + TP_PROTO(const char * filename, uid_t user, gid_t group), > + TP_ARGS(filename, user, group), > + TP_STRUCT__entry(__string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group)), > + TP_fast_assign(tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getdents64 > +SC_TRACE_EVENT(sys_getdents64, > + TP_PROTO(unsigned int fd, struct linux_dirent64 * dirent, unsigned int count), > + TP_ARGS(fd, dirent, count), > + TP_STRUCT__entry(__field(unsigned int, fd) __field_hex(struct linux_dirent64 *, dirent) __field(unsigned int, count)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(dirent, dirent) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mincore > +SC_TRACE_EVENT(sys_mincore, > + TP_PROTO(unsigned long start, size_t len, unsigned char * vec), > + TP_ARGS(start, len, vec), > + TP_STRUCT__entry(__field(unsigned long, start) __field(size_t, len) __field_hex(unsigned char *, vec)), > + TP_fast_assign(tp_assign(start, start) tp_assign(len, len) tp_assign(vec, vec)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_listxattr > +SC_TRACE_EVENT(sys_listxattr, > + TP_PROTO(const char * pathname, char * list, size_t size), > + TP_ARGS(pathname, list, size), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(char *, list) __field(size_t, size)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(list, list) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_llistxattr > +SC_TRACE_EVENT(sys_llistxattr, > + TP_PROTO(const char * pathname, char * list, size_t size), > + TP_ARGS(pathname, list, size), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field_hex(char *, list) __field(size_t, size)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(list, list) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_flistxattr > +SC_TRACE_EVENT(sys_flistxattr, > + TP_PROTO(int fd, char * list, size_t size), > + TP_ARGS(fd, list, size), > + TP_STRUCT__entry(__field(int, fd) __field_hex(char *, list) __field(size_t, size)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(list, list) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_setaffinity > +SC_TRACE_EVENT(sys_sched_setaffinity, > + TP_PROTO(pid_t pid, unsigned int len, unsigned long * user_mask_ptr), > + TP_ARGS(pid, len, user_mask_ptr), > + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, len) __field_hex(unsigned long *, user_mask_ptr)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(len, len) tp_assign(user_mask_ptr, user_mask_ptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sched_getaffinity > +SC_TRACE_EVENT(sys_sched_getaffinity, > + TP_PROTO(pid_t pid, unsigned int len, unsigned long * user_mask_ptr), > + TP_ARGS(pid, len, user_mask_ptr), > + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, len) __field_hex(unsigned long *, user_mask_ptr)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(len, len) tp_assign(user_mask_ptr, user_mask_ptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_io_submit > +SC_TRACE_EVENT(sys_io_submit, > + TP_PROTO(aio_context_t ctx_id, long nr, struct iocb * * iocbpp), > + TP_ARGS(ctx_id, nr, iocbpp), > + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field(long, nr) __field_hex(struct iocb * *, iocbpp)), > + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(nr, nr) tp_assign(iocbpp, iocbpp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_io_cancel > +SC_TRACE_EVENT(sys_io_cancel, > + TP_PROTO(aio_context_t ctx_id, struct iocb * iocb, struct io_event * result), > + TP_ARGS(ctx_id, iocb, result), > + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field_hex(struct iocb *, iocb) __field_hex(struct io_event *, result)), > + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(iocb, iocb) tp_assign(result, result)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timer_create > +SC_TRACE_EVENT(sys_timer_create, > + TP_PROTO(const clockid_t which_clock, struct sigevent * timer_event_spec, timer_t * created_timer_id), > + TP_ARGS(which_clock, timer_event_spec, created_timer_id), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field_hex(struct sigevent *, timer_event_spec) __field_hex(timer_t *, created_timer_id)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(timer_event_spec, timer_event_spec) tp_assign(created_timer_id, created_timer_id)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_statfs64 > +SC_TRACE_EVENT(sys_statfs64, > + TP_PROTO(const char * pathname, size_t sz, struct statfs64 * buf), > + TP_ARGS(pathname, sz, buf), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __field(size_t, sz) __field_hex(struct statfs64 *, buf)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_assign(sz, sz) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fstatfs64 > +SC_TRACE_EVENT(sys_fstatfs64, > + TP_PROTO(unsigned int fd, size_t sz, struct statfs64 * buf), > + TP_ARGS(fd, sz, buf), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(size_t, sz) __field_hex(struct statfs64 *, buf)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(sz, sz) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mq_getsetattr > +SC_TRACE_EVENT(sys_mq_getsetattr, > + TP_PROTO(mqd_t mqdes, const struct mq_attr * u_mqstat, struct mq_attr * u_omqstat), > + TP_ARGS(mqdes, u_mqstat, u_omqstat), > + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const struct mq_attr *, u_mqstat) __field_hex(struct mq_attr *, u_omqstat)), > + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_mqstat, u_mqstat) tp_assign(u_omqstat, u_omqstat)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_inotify_add_watch > +SC_TRACE_EVENT(sys_inotify_add_watch, > + TP_PROTO(int fd, const char * pathname, u32 mask), > + TP_ARGS(fd, pathname, mask), > + TP_STRUCT__entry(__field(int, fd) __string_from_user(pathname, pathname) __field(u32, mask)), > + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(pathname, pathname) tp_assign(mask, mask)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mkdirat > +SC_TRACE_EVENT(sys_mkdirat, > + TP_PROTO(int dfd, const char * pathname, int mode), > + TP_ARGS(dfd, pathname, mode), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field(int, mode)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_futimesat > +SC_TRACE_EVENT(sys_futimesat, > + TP_PROTO(int dfd, const char * filename, struct timeval * utimes), > + TP_ARGS(dfd, filename, utimes), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct timeval *, utimes)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_unlinkat > +SC_TRACE_EVENT(sys_unlinkat, > + TP_PROTO(int dfd, const char * pathname, int flag), > + TP_ARGS(dfd, pathname, flag), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field(int, flag)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(flag, flag)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_symlinkat > +SC_TRACE_EVENT(sys_symlinkat, > + TP_PROTO(const char * oldname, int newdfd, const char * newname), > + TP_ARGS(oldname, newdfd, newname), > + TP_STRUCT__entry(__string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname)), > + TP_fast_assign(tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fchmodat > +SC_TRACE_EVENT(sys_fchmodat, > + TP_PROTO(int dfd, const char * filename, mode_t mode), > + TP_ARGS(dfd, filename, mode), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(mode_t, mode)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_faccessat > +SC_TRACE_EVENT(sys_faccessat, > + TP_PROTO(int dfd, const char * filename, int mode), > + TP_ARGS(dfd, filename, mode), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, mode)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_get_robust_list > +SC_TRACE_EVENT(sys_get_robust_list, > + TP_PROTO(int pid, struct robust_list_head * * head_ptr, size_t * len_ptr), > + TP_ARGS(pid, head_ptr, len_ptr), > + TP_STRUCT__entry(__field(int, pid) __field_hex(struct robust_list_head * *, head_ptr) __field_hex(size_t *, len_ptr)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(head_ptr, head_ptr) tp_assign(len_ptr, len_ptr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getcpu > +SC_TRACE_EVENT(sys_getcpu, > + TP_PROTO(unsigned * cpup, unsigned * nodep, struct getcpu_cache * unused), > + TP_ARGS(cpup, nodep, unused), > + TP_STRUCT__entry(__field_hex(unsigned *, cpup) __field_hex(unsigned *, nodep) __field_hex(struct getcpu_cache *, unused)), > + TP_fast_assign(tp_assign(cpup, cpup) tp_assign(nodep, nodep) tp_assign(unused, unused)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_signalfd > +SC_TRACE_EVENT(sys_signalfd, > + TP_PROTO(int ufd, sigset_t * user_mask, size_t sizemask), > + TP_ARGS(ufd, user_mask, sizemask), > + TP_STRUCT__entry(__field(int, ufd) __field_hex(sigset_t *, user_mask) __field(size_t, sizemask)), > + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(user_mask, user_mask) tp_assign(sizemask, sizemask)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_bind > +SC_TRACE_EVENT(sys_bind, > + TP_PROTO(int fd, struct sockaddr * umyaddr, int addrlen), > + TP_ARGS(fd, umyaddr, addrlen), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, umyaddr) __field_hex(int, addrlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(umyaddr, umyaddr) tp_assign(addrlen, addrlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_connect > +SC_TRACE_EVENT(sys_connect, > + TP_PROTO(int fd, struct sockaddr * uservaddr, int addrlen), > + TP_ARGS(fd, uservaddr, addrlen), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, uservaddr) __field_hex(int, addrlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(uservaddr, uservaddr) tp_assign(addrlen, addrlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_accept > +SC_TRACE_EVENT(sys_accept, > + TP_PROTO(int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen), > + TP_ARGS(fd, upeer_sockaddr, upeer_addrlen), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, upeer_sockaddr) __field_hex(int *, upeer_addrlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(upeer_sockaddr, upeer_sockaddr) tp_assign(upeer_addrlen, upeer_addrlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getsockname > +SC_TRACE_EVENT(sys_getsockname, > + TP_PROTO(int fd, struct sockaddr * usockaddr, int * usockaddr_len), > + TP_ARGS(fd, usockaddr, usockaddr_len), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, usockaddr) __field_hex(int *, usockaddr_len)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(usockaddr, usockaddr) tp_assign(usockaddr_len, usockaddr_len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getpeername > +SC_TRACE_EVENT(sys_getpeername, > + TP_PROTO(int fd, struct sockaddr * usockaddr, int * usockaddr_len), > + TP_ARGS(fd, usockaddr, usockaddr_len), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, usockaddr) __field_hex(int *, usockaddr_len)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(usockaddr, usockaddr) tp_assign(usockaddr_len, usockaddr_len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sendmsg > +SC_TRACE_EVENT(sys_sendmsg, > + TP_PROTO(int fd, struct msghdr * msg, unsigned flags), > + TP_ARGS(fd, msg, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct msghdr *, msg) __field(unsigned, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(msg, msg) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_recvmsg > +SC_TRACE_EVENT(sys_recvmsg, > + TP_PROTO(int fd, struct msghdr * msg, unsigned int flags), > + TP_ARGS(fd, msg, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct msghdr *, msg) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(msg, msg) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_reboot > +SC_TRACE_EVENT(sys_reboot, > + TP_PROTO(int magic1, int magic2, unsigned int cmd, void * arg), > + TP_ARGS(magic1, magic2, cmd, arg), > + TP_STRUCT__entry(__field(int, magic1) __field(int, magic2) __field(unsigned int, cmd) __field_hex(void *, arg)), > + TP_fast_assign(tp_assign(magic1, magic1) tp_assign(magic2, magic2) tp_assign(cmd, cmd) tp_assign(arg, arg)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_wait4 > +SC_TRACE_EVENT(sys_wait4, > + TP_PROTO(pid_t upid, int * stat_addr, int options, struct rusage * ru), > + TP_ARGS(upid, stat_addr, options, ru), > + TP_STRUCT__entry(__field(pid_t, upid) __field_hex(int *, stat_addr) __field(int, options) __field_hex(struct rusage *, ru)), > + TP_fast_assign(tp_assign(upid, upid) tp_assign(stat_addr, stat_addr) tp_assign(options, options) tp_assign(ru, ru)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_sigaction > +SC_TRACE_EVENT(sys_rt_sigaction, > + TP_PROTO(int sig, const struct sigaction * act, struct sigaction * oact, size_t sigsetsize), > + TP_ARGS(sig, act, oact, sigsetsize), > + TP_STRUCT__entry(__field(int, sig) __field_hex(const struct sigaction *, act) __field_hex(struct sigaction *, oact) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(sig, sig) tp_assign(act, act) tp_assign(oact, oact) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_sigprocmask > +SC_TRACE_EVENT(sys_rt_sigprocmask, > + TP_PROTO(int how, sigset_t * nset, sigset_t * oset, size_t sigsetsize), > + TP_ARGS(how, nset, oset, sigsetsize), > + TP_STRUCT__entry(__field(int, how) __field_hex(sigset_t *, nset) __field_hex(sigset_t *, oset) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(how, how) tp_assign(nset, nset) tp_assign(oset, oset) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_sigtimedwait > +SC_TRACE_EVENT(sys_rt_sigtimedwait, > + TP_PROTO(const sigset_t * uthese, siginfo_t * uinfo, const struct timespec * uts, size_t sigsetsize), > + TP_ARGS(uthese, uinfo, uts, sigsetsize), > + TP_STRUCT__entry(__field_hex(const sigset_t *, uthese) __field_hex(siginfo_t *, uinfo) __field_hex(const struct timespec *, uts) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(uthese, uthese) tp_assign(uinfo, uinfo) tp_assign(uts, uts) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sendfile > +SC_TRACE_EVENT(sys_sendfile, > + TP_PROTO(int out_fd, int in_fd, off_t * offset, size_t count), > + TP_ARGS(out_fd, in_fd, offset, count), > + TP_STRUCT__entry(__field(int, out_fd) __field(int, in_fd) __field_hex(off_t *, offset) __field(size_t, count)), > + TP_fast_assign(tp_assign(out_fd, out_fd) tp_assign(in_fd, in_fd) tp_assign(offset, offset) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getxattr > +SC_TRACE_EVENT(sys_getxattr, > + TP_PROTO(const char * pathname, const char * name, void * value, size_t size), > + TP_ARGS(pathname, name, value, size), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lgetxattr > +SC_TRACE_EVENT(sys_lgetxattr, > + TP_PROTO(const char * pathname, const char * name, void * value, size_t size), > + TP_ARGS(pathname, name, value, size), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fgetxattr > +SC_TRACE_EVENT(sys_fgetxattr, > + TP_PROTO(int fd, const char * name, void * value, size_t size), > + TP_ARGS(fd, name, value, size), > + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name) __field_hex(void *, value) __field(size_t, size)), > + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sendfile64 > +SC_TRACE_EVENT(sys_sendfile64, > + TP_PROTO(int out_fd, int in_fd, loff_t * offset, size_t count), > + TP_ARGS(out_fd, in_fd, offset, count), > + TP_STRUCT__entry(__field(int, out_fd) __field(int, in_fd) __field_hex(loff_t *, offset) __field(size_t, count)), > + TP_fast_assign(tp_assign(out_fd, out_fd) tp_assign(in_fd, in_fd) tp_assign(offset, offset) tp_assign(count, count)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_epoll_ctl > +SC_TRACE_EVENT(sys_epoll_ctl, > + TP_PROTO(int epfd, int op, int fd, struct epoll_event * event), > + TP_ARGS(epfd, op, fd, event), > + TP_STRUCT__entry(__field(int, epfd) __field(int, op) __field(int, fd) __field_hex(struct epoll_event *, event)), > + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(op, op) tp_assign(fd, fd) tp_assign(event, event)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_epoll_wait > +SC_TRACE_EVENT(sys_epoll_wait, > + TP_PROTO(int epfd, struct epoll_event * events, int maxevents, int timeout), > + TP_ARGS(epfd, events, maxevents, timeout), > + TP_STRUCT__entry(__field(int, epfd) __field_hex(struct epoll_event *, events) __field(int, maxevents) __field(int, timeout)), > + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(events, events) tp_assign(maxevents, maxevents) tp_assign(timeout, timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timer_settime > +SC_TRACE_EVENT(sys_timer_settime, > + TP_PROTO(timer_t timer_id, int flags, const struct itimerspec * new_setting, struct itimerspec * old_setting), > + TP_ARGS(timer_id, flags, new_setting, old_setting), > + TP_STRUCT__entry(__field(timer_t, timer_id) __field(int, flags) __field_hex(const struct itimerspec *, new_setting) __field_hex(struct itimerspec *, old_setting)), > + TP_fast_assign(tp_assign(timer_id, timer_id) tp_assign(flags, flags) tp_assign(new_setting, new_setting) tp_assign(old_setting, old_setting)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_clock_nanosleep > +SC_TRACE_EVENT(sys_clock_nanosleep, > + TP_PROTO(const clockid_t which_clock, int flags, const struct timespec * rqtp, struct timespec * rmtp), > + TP_ARGS(which_clock, flags, rqtp, rmtp), > + TP_STRUCT__entry(__field(const clockid_t, which_clock) __field(int, flags) __field_hex(const struct timespec *, rqtp) __field_hex(struct timespec *, rmtp)), > + TP_fast_assign(tp_assign(which_clock, which_clock) tp_assign(flags, flags) tp_assign(rqtp, rqtp) tp_assign(rmtp, rmtp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mq_open > +SC_TRACE_EVENT(sys_mq_open, > + TP_PROTO(const char * u_name, int oflag, mode_t mode, struct mq_attr * u_attr), > + TP_ARGS(u_name, oflag, mode, u_attr), > + TP_STRUCT__entry(__string_from_user(u_name, u_name) __field(int, oflag) __field(mode_t, mode) __field_hex(struct mq_attr *, u_attr)), > + TP_fast_assign(tp_copy_string_from_user(u_name, u_name) tp_assign(oflag, oflag) tp_assign(mode, mode) tp_assign(u_attr, u_attr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_request_key > +SC_TRACE_EVENT(sys_request_key, > + TP_PROTO(const char * _type, const char * _description, const char * _callout_info, key_serial_t destringid), > + TP_ARGS(_type, _description, _callout_info, destringid), > + TP_STRUCT__entry(__string_from_user(_type, _type) __field_hex(const char *, _description) __field_hex(const char *, _callout_info) __field(key_serial_t, destringid)), > + TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_callout_info, _callout_info) tp_assign(destringid, destringid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_vmsplice > +SC_TRACE_EVENT(sys_vmsplice, > + TP_PROTO(int fd, const struct iovec * iov, unsigned long nr_segs, unsigned int flags), > + TP_ARGS(fd, iov, nr_segs, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(const struct iovec *, iov) __field(unsigned long, nr_segs) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(iov, iov) tp_assign(nr_segs, nr_segs) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_openat > +SC_TRACE_EVENT(sys_openat, > + TP_PROTO(int dfd, const char * filename, int flags, int mode), > + TP_ARGS(dfd, filename, flags, mode), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, flags) __field(int, mode)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(flags, flags) tp_assign(mode, mode)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mknodat > +SC_TRACE_EVENT(sys_mknodat, > + TP_PROTO(int dfd, const char * filename, int mode, unsigned dev), > + TP_ARGS(dfd, filename, mode, dev), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(int, mode) __field(unsigned, dev)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(mode, mode) tp_assign(dev, dev)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fstatat64 > +SC_TRACE_EVENT(sys_fstatat64, > + TP_PROTO(int dfd, const char * filename, struct stat64 * statbuf, int flag), > + TP_ARGS(dfd, filename, statbuf, flag), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct stat64 *, statbuf) __field(int, flag)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(statbuf, statbuf) tp_assign(flag, flag)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_renameat > +SC_TRACE_EVENT(sys_renameat, > + TP_PROTO(int olddfd, const char * oldname, int newdfd, const char * newname), > + TP_ARGS(olddfd, oldname, newdfd, newname), > + TP_STRUCT__entry(__field(int, olddfd) __string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname)), > + TP_fast_assign(tp_assign(olddfd, olddfd) tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_readlinkat > +SC_TRACE_EVENT(sys_readlinkat, > + TP_PROTO(int dfd, const char * pathname, char * buf, int bufsiz), > + TP_ARGS(dfd, pathname, buf, bufsiz), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(pathname, pathname) __field_hex(char *, buf) __field(int, bufsiz)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(pathname, pathname) tp_assign(buf, buf) tp_assign(bufsiz, bufsiz)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_utimensat > +SC_TRACE_EVENT(sys_utimensat, > + TP_PROTO(int dfd, const char * filename, struct timespec * utimes, int flags), > + TP_ARGS(dfd, filename, utimes, flags), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field_hex(struct timespec *, utimes) __field(int, flags)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(utimes, utimes) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_timerfd_settime > +SC_TRACE_EVENT(sys_timerfd_settime, > + TP_PROTO(int ufd, int flags, const struct itimerspec * utmr, struct itimerspec * otmr), > + TP_ARGS(ufd, flags, utmr, otmr), > + TP_STRUCT__entry(__field(int, ufd) __field(int, flags) __field_hex(const struct itimerspec *, utmr) __field_hex(struct itimerspec *, otmr)), > + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(flags, flags) tp_assign(utmr, utmr) tp_assign(otmr, otmr)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_signalfd4 > +SC_TRACE_EVENT(sys_signalfd4, > + TP_PROTO(int ufd, sigset_t * user_mask, size_t sizemask, int flags), > + TP_ARGS(ufd, user_mask, sizemask, flags), > + TP_STRUCT__entry(__field(int, ufd) __field_hex(sigset_t *, user_mask) __field(size_t, sizemask) __field(int, flags)), > + TP_fast_assign(tp_assign(ufd, ufd) tp_assign(user_mask, user_mask) tp_assign(sizemask, sizemask) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_rt_tgsigqueueinfo > +SC_TRACE_EVENT(sys_rt_tgsigqueueinfo, > + TP_PROTO(pid_t tgid, pid_t pid, int sig, siginfo_t * uinfo), > + TP_ARGS(tgid, pid, sig, uinfo), > + TP_STRUCT__entry(__field(pid_t, tgid) __field(pid_t, pid) __field(int, sig) __field_hex(siginfo_t *, uinfo)), > + TP_fast_assign(tp_assign(tgid, tgid) tp_assign(pid, pid) tp_assign(sig, sig) tp_assign(uinfo, uinfo)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_prlimit64 > +SC_TRACE_EVENT(sys_prlimit64, > + TP_PROTO(pid_t pid, unsigned int resource, const struct rlimit64 * new_rlim, struct rlimit64 * old_rlim), > + TP_ARGS(pid, resource, new_rlim, old_rlim), > + TP_STRUCT__entry(__field(pid_t, pid) __field(unsigned int, resource) __field_hex(const struct rlimit64 *, new_rlim) __field_hex(struct rlimit64 *, old_rlim)), > + TP_fast_assign(tp_assign(pid, pid) tp_assign(resource, resource) tp_assign(new_rlim, new_rlim) tp_assign(old_rlim, old_rlim)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_socketpair > +SC_TRACE_EVENT(sys_socketpair, > + TP_PROTO(int family, int type, int protocol, int * usockvec), > + TP_ARGS(family, type, protocol, usockvec), > + TP_STRUCT__entry(__field(int, family) __field(int, type) __field(int, protocol) __field_hex(int *, usockvec)), > + TP_fast_assign(tp_assign(family, family) tp_assign(type, type) tp_assign(protocol, protocol) tp_assign(usockvec, usockvec)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_send > +SC_TRACE_EVENT(sys_send, > + TP_PROTO(int fd, void * buff, size_t len, unsigned flags), > + TP_ARGS(fd, buff, len, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, buff) __field(size_t, len) __field(unsigned, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buff, buff) tp_assign(len, len) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_accept4 > +SC_TRACE_EVENT(sys_accept4, > + TP_PROTO(int fd, struct sockaddr * upeer_sockaddr, int * upeer_addrlen, int flags), > + TP_ARGS(fd, upeer_sockaddr, upeer_addrlen, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct sockaddr *, upeer_sockaddr) __field_hex(int *, upeer_addrlen) __field(int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(upeer_sockaddr, upeer_sockaddr) tp_assign(upeer_addrlen, upeer_addrlen) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sendmmsg > +SC_TRACE_EVENT(sys_sendmmsg, > + TP_PROTO(int fd, struct mmsghdr * mmsg, unsigned int vlen, unsigned int flags), > + TP_ARGS(fd, mmsg, vlen, flags), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct mmsghdr *, mmsg) __field(unsigned int, vlen) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(mmsg, mmsg) tp_assign(vlen, vlen) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mount > +SC_TRACE_EVENT(sys_mount, > + TP_PROTO(char * dev_name, char * dir_name, char * type, unsigned long flags, void * data), > + TP_ARGS(dev_name, dir_name, type, flags, data), > + TP_STRUCT__entry(__string_from_user(dev_name, dev_name) __string_from_user(dir_name, dir_name) __string_from_user(type, type) __field(unsigned long, flags) __field_hex(void *, data)), > + TP_fast_assign(tp_copy_string_from_user(dev_name, dev_name) tp_copy_string_from_user(dir_name, dir_name) tp_copy_string_from_user(type, type) tp_assign(flags, flags) tp_assign(data, data)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_llseek > +SC_TRACE_EVENT(sys_llseek, > + TP_PROTO(unsigned int fd, unsigned long offset_high, unsigned long offset_low, loff_t * result, unsigned int origin), > + TP_ARGS(fd, offset_high, offset_low, result, origin), > + TP_STRUCT__entry(__field(unsigned int, fd) __field(unsigned long, offset_high) __field(unsigned long, offset_low) __field_hex(loff_t *, result) __field(unsigned int, origin)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(offset_high, offset_high) tp_assign(offset_low, offset_low) tp_assign(result, result) tp_assign(origin, origin)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_select > +SC_TRACE_EVENT(sys_select, > + TP_PROTO(int n, fd_set * inp, fd_set * outp, fd_set * exp, struct timeval * tvp), > + TP_ARGS(n, inp, outp, exp, tvp), > + TP_STRUCT__entry(__field(int, n) __field_hex(fd_set *, inp) __field_hex(fd_set *, outp) __field_hex(fd_set *, exp) __field_hex(struct timeval *, tvp)), > + TP_fast_assign(tp_assign(n, n) tp_assign(inp, inp) tp_assign(outp, outp) tp_assign(exp, exp) tp_assign(tvp, tvp)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_pciconfig_read > +SC_TRACE_EVENT(sys_pciconfig_read, > + TP_PROTO(unsigned long bus, unsigned long dfn, unsigned long off, unsigned long len, void * buf), > + TP_ARGS(bus, dfn, off, len, buf), > + TP_STRUCT__entry(__field(unsigned long, bus) __field(unsigned long, dfn) __field(unsigned long, off) __field(unsigned long, len) __field_hex(void *, buf)), > + TP_fast_assign(tp_assign(bus, bus) tp_assign(dfn, dfn) tp_assign(off, off) tp_assign(len, len) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_pciconfig_write > +SC_TRACE_EVENT(sys_pciconfig_write, > + TP_PROTO(unsigned long bus, unsigned long dfn, unsigned long off, unsigned long len, void * buf), > + TP_ARGS(bus, dfn, off, len, buf), > + TP_STRUCT__entry(__field(unsigned long, bus) __field(unsigned long, dfn) __field(unsigned long, off) __field(unsigned long, len) __field_hex(void *, buf)), > + TP_fast_assign(tp_assign(bus, bus) tp_assign(dfn, dfn) tp_assign(off, off) tp_assign(len, len) tp_assign(buf, buf)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setxattr > +SC_TRACE_EVENT(sys_setxattr, > + TP_PROTO(const char * pathname, const char * name, const void * value, size_t size, int flags), > + TP_ARGS(pathname, name, value, size, flags), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_lsetxattr > +SC_TRACE_EVENT(sys_lsetxattr, > + TP_PROTO(const char * pathname, const char * name, const void * value, size_t size, int flags), > + TP_ARGS(pathname, name, value, size, flags), > + TP_STRUCT__entry(__string_from_user(pathname, pathname) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), > + TP_fast_assign(tp_copy_string_from_user(pathname, pathname) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fsetxattr > +SC_TRACE_EVENT(sys_fsetxattr, > + TP_PROTO(int fd, const char * name, const void * value, size_t size, int flags), > + TP_ARGS(fd, name, value, size, flags), > + TP_STRUCT__entry(__field(int, fd) __string_from_user(name, name) __field_hex(const void *, value) __field(size_t, size) __field(int, flags)), > + TP_fast_assign(tp_assign(fd, fd) tp_copy_string_from_user(name, name) tp_assign(value, value) tp_assign(size, size) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_io_getevents > +SC_TRACE_EVENT(sys_io_getevents, > + TP_PROTO(aio_context_t ctx_id, long min_nr, long nr, struct io_event * events, struct timespec * timeout), > + TP_ARGS(ctx_id, min_nr, nr, events, timeout), > + TP_STRUCT__entry(__field(aio_context_t, ctx_id) __field(long, min_nr) __field(long, nr) __field_hex(struct io_event *, events) __field_hex(struct timespec *, timeout)), > + TP_fast_assign(tp_assign(ctx_id, ctx_id) tp_assign(min_nr, min_nr) tp_assign(nr, nr) tp_assign(events, events) tp_assign(timeout, timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mq_timedsend > +SC_TRACE_EVENT(sys_mq_timedsend, > + TP_PROTO(mqd_t mqdes, const char * u_msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec * u_abs_timeout), > + TP_ARGS(mqdes, u_msg_ptr, msg_len, msg_prio, u_abs_timeout), > + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(const char *, u_msg_ptr) __field(size_t, msg_len) __field(unsigned int, msg_prio) __field_hex(const struct timespec *, u_abs_timeout)), > + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_msg_ptr, u_msg_ptr) tp_assign(msg_len, msg_len) tp_assign(msg_prio, msg_prio) tp_assign(u_abs_timeout, u_abs_timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_mq_timedreceive > +SC_TRACE_EVENT(sys_mq_timedreceive, > + TP_PROTO(mqd_t mqdes, char * u_msg_ptr, size_t msg_len, unsigned int * u_msg_prio, const struct timespec * u_abs_timeout), > + TP_ARGS(mqdes, u_msg_ptr, msg_len, u_msg_prio, u_abs_timeout), > + TP_STRUCT__entry(__field(mqd_t, mqdes) __field_hex(char *, u_msg_ptr) __field(size_t, msg_len) __field_hex(unsigned int *, u_msg_prio) __field_hex(const struct timespec *, u_abs_timeout)), > + TP_fast_assign(tp_assign(mqdes, mqdes) tp_assign(u_msg_ptr, u_msg_ptr) tp_assign(msg_len, msg_len) tp_assign(u_msg_prio, u_msg_prio) tp_assign(u_abs_timeout, u_abs_timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_add_key > +SC_TRACE_EVENT(sys_add_key, > + TP_PROTO(const char * _type, const char * _description, const void * _payload, size_t plen, key_serial_t ringid), > + TP_ARGS(_type, _description, _payload, plen, ringid), > + TP_STRUCT__entry(__string_from_user(_type, _type) __field_hex(const char *, _description) __field_hex(const void *, _payload) __field(size_t, plen) __field(key_serial_t, ringid)), > + TP_fast_assign(tp_copy_string_from_user(_type, _type) tp_assign(_description, _description) tp_assign(_payload, _payload) tp_assign(plen, plen) tp_assign(ringid, ringid)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_waitid > +SC_TRACE_EVENT(sys_waitid, > + TP_PROTO(int which, pid_t upid, struct siginfo * infop, int options, struct rusage * ru), > + TP_ARGS(which, upid, infop, options, ru), > + TP_STRUCT__entry(__field(int, which) __field(pid_t, upid) __field_hex(struct siginfo *, infop) __field(int, options) __field_hex(struct rusage *, ru)), > + TP_fast_assign(tp_assign(which, which) tp_assign(upid, upid) tp_assign(infop, infop) tp_assign(options, options) tp_assign(ru, ru)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ppoll > +SC_TRACE_EVENT(sys_ppoll, > + TP_PROTO(struct pollfd * ufds, unsigned int nfds, struct timespec * tsp, const sigset_t * sigmask, size_t sigsetsize), > + TP_ARGS(ufds, nfds, tsp, sigmask, sigsetsize), > + TP_STRUCT__entry(__field_hex(struct pollfd *, ufds) __field(unsigned int, nfds) __field_hex(struct timespec *, tsp) __field_hex(const sigset_t *, sigmask) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(ufds, ufds) tp_assign(nfds, nfds) tp_assign(tsp, tsp) tp_assign(sigmask, sigmask) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_fchownat > +SC_TRACE_EVENT(sys_fchownat, > + TP_PROTO(int dfd, const char * filename, uid_t user, gid_t group, int flag), > + TP_ARGS(dfd, filename, user, group, flag), > + TP_STRUCT__entry(__field(int, dfd) __string_from_user(filename, filename) __field(uid_t, user) __field(gid_t, group) __field(int, flag)), > + TP_fast_assign(tp_assign(dfd, dfd) tp_copy_string_from_user(filename, filename) tp_assign(user, user) tp_assign(group, group) tp_assign(flag, flag)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_linkat > +SC_TRACE_EVENT(sys_linkat, > + TP_PROTO(int olddfd, const char * oldname, int newdfd, const char * newname, int flags), > + TP_ARGS(olddfd, oldname, newdfd, newname, flags), > + TP_STRUCT__entry(__field(int, olddfd) __string_from_user(oldname, oldname) __field(int, newdfd) __string_from_user(newname, newname) __field(int, flags)), > + TP_fast_assign(tp_assign(olddfd, olddfd) tp_copy_string_from_user(oldname, oldname) tp_assign(newdfd, newdfd) tp_copy_string_from_user(newname, newname) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_perf_event_open > +SC_TRACE_EVENT(sys_perf_event_open, > + TP_PROTO(struct perf_event_attr * attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags), > + TP_ARGS(attr_uptr, pid, cpu, group_fd, flags), > + TP_STRUCT__entry(__field_hex(struct perf_event_attr *, attr_uptr) __field(pid_t, pid) __field(int, cpu) __field(int, group_fd) __field(unsigned long, flags)), > + TP_fast_assign(tp_assign(attr_uptr, attr_uptr) tp_assign(pid, pid) tp_assign(cpu, cpu) tp_assign(group_fd, group_fd) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_preadv > +SC_TRACE_EVENT(sys_preadv, > + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h), > + TP_ARGS(fd, vec, vlen, pos_l, pos_h), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen) __field(unsigned long, pos_l) __field(unsigned long, pos_h)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen) tp_assign(pos_l, pos_l) tp_assign(pos_h, pos_h)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_pwritev > +SC_TRACE_EVENT(sys_pwritev, > + TP_PROTO(unsigned long fd, const struct iovec * vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h), > + TP_ARGS(fd, vec, vlen, pos_l, pos_h), > + TP_STRUCT__entry(__field(unsigned long, fd) __field_hex(const struct iovec *, vec) __field(unsigned long, vlen) __field(unsigned long, pos_l) __field(unsigned long, pos_h)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(vec, vec) tp_assign(vlen, vlen) tp_assign(pos_l, pos_l) tp_assign(pos_h, pos_h)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_setsockopt > +SC_TRACE_EVENT(sys_setsockopt, > + TP_PROTO(int fd, int level, int optname, char * optval, int optlen), > + TP_ARGS(fd, level, optname, optval, optlen), > + TP_STRUCT__entry(__field(int, fd) __field(int, level) __field(int, optname) __field_hex(char *, optval) __field(int, optlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(level, level) tp_assign(optname, optname) tp_assign(optval, optval) tp_assign(optlen, optlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_getsockopt > +SC_TRACE_EVENT(sys_getsockopt, > + TP_PROTO(int fd, int level, int optname, char * optval, int * optlen), > + TP_ARGS(fd, level, optname, optval, optlen), > + TP_STRUCT__entry(__field(int, fd) __field(int, level) __field(int, optname) __field_hex(char *, optval) __field_hex(int *, optlen)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(level, level) tp_assign(optname, optname) tp_assign(optval, optval) tp_assign(optlen, optlen)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_recvmmsg > +SC_TRACE_EVENT(sys_recvmmsg, > + TP_PROTO(int fd, struct mmsghdr * mmsg, unsigned int vlen, unsigned int flags, struct timespec * timeout), > + TP_ARGS(fd, mmsg, vlen, flags, timeout), > + TP_STRUCT__entry(__field(int, fd) __field_hex(struct mmsghdr *, mmsg) __field(unsigned int, vlen) __field(unsigned int, flags) __field_hex(struct timespec *, timeout)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(mmsg, mmsg) tp_assign(vlen, vlen) tp_assign(flags, flags) tp_assign(timeout, timeout)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_ipc > +SC_TRACE_EVENT(sys_ipc, > + TP_PROTO(unsigned int call, int first, unsigned long second, unsigned long third, void * ptr, long fifth), > + TP_ARGS(call, first, second, third, ptr, fifth), > + TP_STRUCT__entry(__field(unsigned int, call) __field(int, first) __field(unsigned long, second) __field(unsigned long, third) __field_hex(void *, ptr) __field(long, fifth)), > + TP_fast_assign(tp_assign(call, call) tp_assign(first, first) tp_assign(second, second) tp_assign(third, third) tp_assign(ptr, ptr) tp_assign(fifth, fifth)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_futex > +SC_TRACE_EVENT(sys_futex, > + TP_PROTO(u32 * uaddr, int op, u32 val, struct timespec * utime, u32 * uaddr2, u32 val3), > + TP_ARGS(uaddr, op, val, utime, uaddr2, val3), > + TP_STRUCT__entry(__field_hex(u32 *, uaddr) __field(int, op) __field(u32, val) __field_hex(struct timespec *, utime) __field_hex(u32 *, uaddr2) __field(u32, val3)), > + TP_fast_assign(tp_assign(uaddr, uaddr) tp_assign(op, op) tp_assign(val, val) tp_assign(utime, utime) tp_assign(uaddr2, uaddr2) tp_assign(val3, val3)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_pselect6 > +SC_TRACE_EVENT(sys_pselect6, > + TP_PROTO(int n, fd_set * inp, fd_set * outp, fd_set * exp, struct timespec * tsp, void * sig), > + TP_ARGS(n, inp, outp, exp, tsp, sig), > + TP_STRUCT__entry(__field(int, n) __field_hex(fd_set *, inp) __field_hex(fd_set *, outp) __field_hex(fd_set *, exp) __field_hex(struct timespec *, tsp) __field_hex(void *, sig)), > + TP_fast_assign(tp_assign(n, n) tp_assign(inp, inp) tp_assign(outp, outp) tp_assign(exp, exp) tp_assign(tsp, tsp) tp_assign(sig, sig)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_splice > +SC_TRACE_EVENT(sys_splice, > + TP_PROTO(int fd_in, loff_t * off_in, int fd_out, loff_t * off_out, size_t len, unsigned int flags), > + TP_ARGS(fd_in, off_in, fd_out, off_out, len, flags), > + TP_STRUCT__entry(__field(int, fd_in) __field_hex(loff_t *, off_in) __field(int, fd_out) __field_hex(loff_t *, off_out) __field(size_t, len) __field(unsigned int, flags)), > + TP_fast_assign(tp_assign(fd_in, fd_in) tp_assign(off_in, off_in) tp_assign(fd_out, fd_out) tp_assign(off_out, off_out) tp_assign(len, len) tp_assign(flags, flags)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_epoll_pwait > +SC_TRACE_EVENT(sys_epoll_pwait, > + TP_PROTO(int epfd, struct epoll_event * events, int maxevents, int timeout, const sigset_t * sigmask, size_t sigsetsize), > + TP_ARGS(epfd, events, maxevents, timeout, sigmask, sigsetsize), > + TP_STRUCT__entry(__field(int, epfd) __field_hex(struct epoll_event *, events) __field(int, maxevents) __field(int, timeout) __field_hex(const sigset_t *, sigmask) __field(size_t, sigsetsize)), > + TP_fast_assign(tp_assign(epfd, epfd) tp_assign(events, events) tp_assign(maxevents, maxevents) tp_assign(timeout, timeout) tp_assign(sigmask, sigmask) tp_assign(sigsetsize, sigsetsize)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_sendto > +SC_TRACE_EVENT(sys_sendto, > + TP_PROTO(int fd, void * buff, size_t len, unsigned flags, struct sockaddr * addr, int addr_len), > + TP_ARGS(fd, buff, len, flags, addr, addr_len), > + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, buff) __field(size_t, len) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int, addr_len)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(buff, buff) tp_assign(len, len) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), > + TP_printk() > +) > +#endif > +#ifndef OVERRIDE_32_sys_recvfrom > +SC_TRACE_EVENT(sys_recvfrom, > + TP_PROTO(int fd, void * ubuf, size_t size, unsigned flags, struct sockaddr * addr, int * addr_len), > + TP_ARGS(fd, ubuf, size, flags, addr, addr_len), > + TP_STRUCT__entry(__field(int, fd) __field_hex(void *, ubuf) __field(size_t, size) __field(unsigned, flags) __field_hex(struct sockaddr *, addr) __field_hex(int *, addr_len)), > + TP_fast_assign(tp_assign(fd, fd) tp_assign(ubuf, ubuf) tp_assign(size, size) tp_assign(flags, flags) tp_assign(addr, addr) tp_assign(addr_len, addr_len)), > + TP_printk() > +) > +#endif > + > +#endif /* _TRACE_SYSCALLS_POINTERS_H */ > + > +/* This part must be outside protection */ > +#include "../../../probes/define_trace.h" > + > +#else /* CREATE_SYSCALL_TABLE */ > + > +#include "powerpc-32-syscalls-3.0.34_pointers_override.h" > +#include "syscalls_pointers_override.h" > + > +#ifndef OVERRIDE_TABLE_32_sys_read > +TRACE_SYSCALL_TABLE(sys_read, sys_read, 3, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_write > +TRACE_SYSCALL_TABLE(sys_write, sys_write, 4, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_open > +TRACE_SYSCALL_TABLE(sys_open, sys_open, 5, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_waitpid > +TRACE_SYSCALL_TABLE(sys_waitpid, sys_waitpid, 7, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_creat > +TRACE_SYSCALL_TABLE(sys_creat, sys_creat, 8, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_link > +TRACE_SYSCALL_TABLE(sys_link, sys_link, 9, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_unlink > +TRACE_SYSCALL_TABLE(sys_unlink, sys_unlink, 10, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_chdir > +TRACE_SYSCALL_TABLE(sys_chdir, sys_chdir, 12, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_time > +TRACE_SYSCALL_TABLE(sys_time, sys_time, 13, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mknod > +TRACE_SYSCALL_TABLE(sys_mknod, sys_mknod, 14, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_chmod > +TRACE_SYSCALL_TABLE(sys_chmod, sys_chmod, 15, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lchown > +TRACE_SYSCALL_TABLE(sys_lchown, sys_lchown, 16, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_stat > +TRACE_SYSCALL_TABLE(sys_stat, sys_stat, 18, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mount > +TRACE_SYSCALL_TABLE(sys_mount, sys_mount, 21, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_oldumount > +TRACE_SYSCALL_TABLE(sys_oldumount, sys_oldumount, 22, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_stime > +TRACE_SYSCALL_TABLE(sys_stime, sys_stime, 25, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fstat > +TRACE_SYSCALL_TABLE(sys_fstat, sys_fstat, 28, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_utime > +TRACE_SYSCALL_TABLE(sys_utime, sys_utime, 30, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_access > +TRACE_SYSCALL_TABLE(sys_access, sys_access, 33, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rename > +TRACE_SYSCALL_TABLE(sys_rename, sys_rename, 38, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mkdir > +TRACE_SYSCALL_TABLE(sys_mkdir, sys_mkdir, 39, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rmdir > +TRACE_SYSCALL_TABLE(sys_rmdir, sys_rmdir, 40, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pipe > +TRACE_SYSCALL_TABLE(sys_pipe, sys_pipe, 42, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_times > +TRACE_SYSCALL_TABLE(sys_times, sys_times, 43, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_acct > +TRACE_SYSCALL_TABLE(sys_acct, sys_acct, 51, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_umount > +TRACE_SYSCALL_TABLE(sys_umount, sys_umount, 52, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_olduname > +TRACE_SYSCALL_TABLE(sys_olduname, sys_olduname, 59, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_chroot > +TRACE_SYSCALL_TABLE(sys_chroot, sys_chroot, 61, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ustat > +TRACE_SYSCALL_TABLE(sys_ustat, sys_ustat, 62, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sigpending > +TRACE_SYSCALL_TABLE(sys_sigpending, sys_sigpending, 73, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sethostname > +TRACE_SYSCALL_TABLE(sys_sethostname, sys_sethostname, 74, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setrlimit > +TRACE_SYSCALL_TABLE(sys_setrlimit, sys_setrlimit, 75, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_old_getrlimit > +TRACE_SYSCALL_TABLE(sys_old_getrlimit, sys_old_getrlimit, 76, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getrusage > +TRACE_SYSCALL_TABLE(sys_getrusage, sys_getrusage, 77, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_gettimeofday > +TRACE_SYSCALL_TABLE(sys_gettimeofday, sys_gettimeofday, 78, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_settimeofday > +TRACE_SYSCALL_TABLE(sys_settimeofday, sys_settimeofday, 79, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getgroups > +TRACE_SYSCALL_TABLE(sys_getgroups, sys_getgroups, 80, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setgroups > +TRACE_SYSCALL_TABLE(sys_setgroups, sys_setgroups, 81, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_symlink > +TRACE_SYSCALL_TABLE(sys_symlink, sys_symlink, 83, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lstat > +TRACE_SYSCALL_TABLE(sys_lstat, sys_lstat, 84, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_readlink > +TRACE_SYSCALL_TABLE(sys_readlink, sys_readlink, 85, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_uselib > +TRACE_SYSCALL_TABLE(sys_uselib, sys_uselib, 86, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_swapon > +TRACE_SYSCALL_TABLE(sys_swapon, sys_swapon, 87, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_reboot > +TRACE_SYSCALL_TABLE(sys_reboot, sys_reboot, 88, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_old_readdir > +TRACE_SYSCALL_TABLE(sys_old_readdir, sys_old_readdir, 89, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_truncate > +TRACE_SYSCALL_TABLE(sys_truncate, sys_truncate, 92, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_statfs > +TRACE_SYSCALL_TABLE(sys_statfs, sys_statfs, 99, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fstatfs > +TRACE_SYSCALL_TABLE(sys_fstatfs, sys_fstatfs, 100, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_socketcall > +TRACE_SYSCALL_TABLE(sys_socketcall, sys_socketcall, 102, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_syslog > +TRACE_SYSCALL_TABLE(sys_syslog, sys_syslog, 103, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setitimer > +TRACE_SYSCALL_TABLE(sys_setitimer, sys_setitimer, 104, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getitimer > +TRACE_SYSCALL_TABLE(sys_getitimer, sys_getitimer, 105, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_newstat > +TRACE_SYSCALL_TABLE(sys_newstat, sys_newstat, 106, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_newlstat > +TRACE_SYSCALL_TABLE(sys_newlstat, sys_newlstat, 107, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_newfstat > +TRACE_SYSCALL_TABLE(sys_newfstat, sys_newfstat, 108, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_uname > +TRACE_SYSCALL_TABLE(sys_uname, sys_uname, 109, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_wait4 > +TRACE_SYSCALL_TABLE(sys_wait4, sys_wait4, 114, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_swapoff > +TRACE_SYSCALL_TABLE(sys_swapoff, sys_swapoff, 115, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sysinfo > +TRACE_SYSCALL_TABLE(sys_sysinfo, sys_sysinfo, 116, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ipc > +TRACE_SYSCALL_TABLE(sys_ipc, sys_ipc, 117, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setdomainname > +TRACE_SYSCALL_TABLE(sys_setdomainname, sys_setdomainname, 121, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_newuname > +TRACE_SYSCALL_TABLE(sys_newuname, sys_newuname, 122, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_adjtimex > +TRACE_SYSCALL_TABLE(sys_adjtimex, sys_adjtimex, 124, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sigprocmask > +TRACE_SYSCALL_TABLE(sys_sigprocmask, sys_sigprocmask, 126, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_init_module > +TRACE_SYSCALL_TABLE(sys_init_module, sys_init_module, 128, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_delete_module > +TRACE_SYSCALL_TABLE(sys_delete_module, sys_delete_module, 129, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_llseek > +TRACE_SYSCALL_TABLE(sys_llseek, sys_llseek, 140, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getdents > +TRACE_SYSCALL_TABLE(sys_getdents, sys_getdents, 141, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_select > +TRACE_SYSCALL_TABLE(sys_select, sys_select, 142, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_readv > +TRACE_SYSCALL_TABLE(sys_readv, sys_readv, 145, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_writev > +TRACE_SYSCALL_TABLE(sys_writev, sys_writev, 146, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sysctl > +TRACE_SYSCALL_TABLE(sys_sysctl, sys_sysctl, 149, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_setparam > +TRACE_SYSCALL_TABLE(sys_sched_setparam, sys_sched_setparam, 154, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_getparam > +TRACE_SYSCALL_TABLE(sys_sched_getparam, sys_sched_getparam, 155, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_setscheduler > +TRACE_SYSCALL_TABLE(sys_sched_setscheduler, sys_sched_setscheduler, 156, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_rr_get_interval > +TRACE_SYSCALL_TABLE(sys_sched_rr_get_interval, sys_sched_rr_get_interval, 161, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_nanosleep > +TRACE_SYSCALL_TABLE(sys_nanosleep, sys_nanosleep, 162, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getresuid > +TRACE_SYSCALL_TABLE(sys_getresuid, sys_getresuid, 165, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_poll > +TRACE_SYSCALL_TABLE(sys_poll, sys_poll, 167, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_nfsservctl > +TRACE_SYSCALL_TABLE(sys_nfsservctl, sys_nfsservctl, 168, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getresgid > +TRACE_SYSCALL_TABLE(sys_getresgid, sys_getresgid, 170, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_sigaction > +TRACE_SYSCALL_TABLE(sys_rt_sigaction, sys_rt_sigaction, 173, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_sigprocmask > +TRACE_SYSCALL_TABLE(sys_rt_sigprocmask, sys_rt_sigprocmask, 174, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_sigpending > +TRACE_SYSCALL_TABLE(sys_rt_sigpending, sys_rt_sigpending, 175, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_sigtimedwait > +TRACE_SYSCALL_TABLE(sys_rt_sigtimedwait, sys_rt_sigtimedwait, 176, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_sigqueueinfo > +TRACE_SYSCALL_TABLE(sys_rt_sigqueueinfo, sys_rt_sigqueueinfo, 177, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_sigsuspend > +TRACE_SYSCALL_TABLE(sys_rt_sigsuspend, sys_rt_sigsuspend, 178, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_chown > +TRACE_SYSCALL_TABLE(sys_chown, sys_chown, 181, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getcwd > +TRACE_SYSCALL_TABLE(sys_getcwd, sys_getcwd, 182, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sendfile > +TRACE_SYSCALL_TABLE(sys_sendfile, sys_sendfile, 186, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getrlimit > +TRACE_SYSCALL_TABLE(sys_getrlimit, sys_getrlimit, 190, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_stat64 > +TRACE_SYSCALL_TABLE(sys_stat64, sys_stat64, 195, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lstat64 > +TRACE_SYSCALL_TABLE(sys_lstat64, sys_lstat64, 196, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fstat64 > +TRACE_SYSCALL_TABLE(sys_fstat64, sys_fstat64, 197, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pciconfig_read > +TRACE_SYSCALL_TABLE(sys_pciconfig_read, sys_pciconfig_read, 198, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pciconfig_write > +TRACE_SYSCALL_TABLE(sys_pciconfig_write, sys_pciconfig_write, 199, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getdents64 > +TRACE_SYSCALL_TABLE(sys_getdents64, sys_getdents64, 202, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pivot_root > +TRACE_SYSCALL_TABLE(sys_pivot_root, sys_pivot_root, 203, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mincore > +TRACE_SYSCALL_TABLE(sys_mincore, sys_mincore, 206, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setxattr > +TRACE_SYSCALL_TABLE(sys_setxattr, sys_setxattr, 209, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lsetxattr > +TRACE_SYSCALL_TABLE(sys_lsetxattr, sys_lsetxattr, 210, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fsetxattr > +TRACE_SYSCALL_TABLE(sys_fsetxattr, sys_fsetxattr, 211, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getxattr > +TRACE_SYSCALL_TABLE(sys_getxattr, sys_getxattr, 212, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lgetxattr > +TRACE_SYSCALL_TABLE(sys_lgetxattr, sys_lgetxattr, 213, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fgetxattr > +TRACE_SYSCALL_TABLE(sys_fgetxattr, sys_fgetxattr, 214, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_listxattr > +TRACE_SYSCALL_TABLE(sys_listxattr, sys_listxattr, 215, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_llistxattr > +TRACE_SYSCALL_TABLE(sys_llistxattr, sys_llistxattr, 216, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_flistxattr > +TRACE_SYSCALL_TABLE(sys_flistxattr, sys_flistxattr, 217, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_removexattr > +TRACE_SYSCALL_TABLE(sys_removexattr, sys_removexattr, 218, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_lremovexattr > +TRACE_SYSCALL_TABLE(sys_lremovexattr, sys_lremovexattr, 219, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fremovexattr > +TRACE_SYSCALL_TABLE(sys_fremovexattr, sys_fremovexattr, 220, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_futex > +TRACE_SYSCALL_TABLE(sys_futex, sys_futex, 221, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_setaffinity > +TRACE_SYSCALL_TABLE(sys_sched_setaffinity, sys_sched_setaffinity, 222, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sched_getaffinity > +TRACE_SYSCALL_TABLE(sys_sched_getaffinity, sys_sched_getaffinity, 223, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sendfile64 > +TRACE_SYSCALL_TABLE(sys_sendfile64, sys_sendfile64, 226, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_io_setup > +TRACE_SYSCALL_TABLE(sys_io_setup, sys_io_setup, 227, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_io_getevents > +TRACE_SYSCALL_TABLE(sys_io_getevents, sys_io_getevents, 229, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_io_submit > +TRACE_SYSCALL_TABLE(sys_io_submit, sys_io_submit, 230, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_io_cancel > +TRACE_SYSCALL_TABLE(sys_io_cancel, sys_io_cancel, 231, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_set_tid_address > +TRACE_SYSCALL_TABLE(sys_set_tid_address, sys_set_tid_address, 232, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_epoll_ctl > +TRACE_SYSCALL_TABLE(sys_epoll_ctl, sys_epoll_ctl, 237, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_epoll_wait > +TRACE_SYSCALL_TABLE(sys_epoll_wait, sys_epoll_wait, 238, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timer_create > +TRACE_SYSCALL_TABLE(sys_timer_create, sys_timer_create, 240, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timer_settime > +TRACE_SYSCALL_TABLE(sys_timer_settime, sys_timer_settime, 241, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timer_gettime > +TRACE_SYSCALL_TABLE(sys_timer_gettime, sys_timer_gettime, 242, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_clock_settime > +TRACE_SYSCALL_TABLE(sys_clock_settime, sys_clock_settime, 245, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_clock_gettime > +TRACE_SYSCALL_TABLE(sys_clock_gettime, sys_clock_gettime, 246, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_clock_getres > +TRACE_SYSCALL_TABLE(sys_clock_getres, sys_clock_getres, 247, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_clock_nanosleep > +TRACE_SYSCALL_TABLE(sys_clock_nanosleep, sys_clock_nanosleep, 248, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_utimes > +TRACE_SYSCALL_TABLE(sys_utimes, sys_utimes, 251, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_statfs64 > +TRACE_SYSCALL_TABLE(sys_statfs64, sys_statfs64, 252, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fstatfs64 > +TRACE_SYSCALL_TABLE(sys_fstatfs64, sys_fstatfs64, 253, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mq_open > +TRACE_SYSCALL_TABLE(sys_mq_open, sys_mq_open, 262, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mq_unlink > +TRACE_SYSCALL_TABLE(sys_mq_unlink, sys_mq_unlink, 263, 1) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mq_timedsend > +TRACE_SYSCALL_TABLE(sys_mq_timedsend, sys_mq_timedsend, 264, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mq_timedreceive > +TRACE_SYSCALL_TABLE(sys_mq_timedreceive, sys_mq_timedreceive, 265, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mq_notify > +TRACE_SYSCALL_TABLE(sys_mq_notify, sys_mq_notify, 266, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mq_getsetattr > +TRACE_SYSCALL_TABLE(sys_mq_getsetattr, sys_mq_getsetattr, 267, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_add_key > +TRACE_SYSCALL_TABLE(sys_add_key, sys_add_key, 269, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_request_key > +TRACE_SYSCALL_TABLE(sys_request_key, sys_request_key, 270, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_waitid > +TRACE_SYSCALL_TABLE(sys_waitid, sys_waitid, 272, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_inotify_add_watch > +TRACE_SYSCALL_TABLE(sys_inotify_add_watch, sys_inotify_add_watch, 276, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pselect6 > +TRACE_SYSCALL_TABLE(sys_pselect6, sys_pselect6, 280, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_ppoll > +TRACE_SYSCALL_TABLE(sys_ppoll, sys_ppoll, 281, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_splice > +TRACE_SYSCALL_TABLE(sys_splice, sys_splice, 283, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_vmsplice > +TRACE_SYSCALL_TABLE(sys_vmsplice, sys_vmsplice, 285, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_openat > +TRACE_SYSCALL_TABLE(sys_openat, sys_openat, 286, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mkdirat > +TRACE_SYSCALL_TABLE(sys_mkdirat, sys_mkdirat, 287, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_mknodat > +TRACE_SYSCALL_TABLE(sys_mknodat, sys_mknodat, 288, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fchownat > +TRACE_SYSCALL_TABLE(sys_fchownat, sys_fchownat, 289, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_futimesat > +TRACE_SYSCALL_TABLE(sys_futimesat, sys_futimesat, 290, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fstatat64 > +TRACE_SYSCALL_TABLE(sys_fstatat64, sys_fstatat64, 291, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_unlinkat > +TRACE_SYSCALL_TABLE(sys_unlinkat, sys_unlinkat, 292, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_renameat > +TRACE_SYSCALL_TABLE(sys_renameat, sys_renameat, 293, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_linkat > +TRACE_SYSCALL_TABLE(sys_linkat, sys_linkat, 294, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_symlinkat > +TRACE_SYSCALL_TABLE(sys_symlinkat, sys_symlinkat, 295, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_readlinkat > +TRACE_SYSCALL_TABLE(sys_readlinkat, sys_readlinkat, 296, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_fchmodat > +TRACE_SYSCALL_TABLE(sys_fchmodat, sys_fchmodat, 297, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_faccessat > +TRACE_SYSCALL_TABLE(sys_faccessat, sys_faccessat, 298, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_get_robust_list > +TRACE_SYSCALL_TABLE(sys_get_robust_list, sys_get_robust_list, 299, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_set_robust_list > +TRACE_SYSCALL_TABLE(sys_set_robust_list, sys_set_robust_list, 300, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getcpu > +TRACE_SYSCALL_TABLE(sys_getcpu, sys_getcpu, 302, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_epoll_pwait > +TRACE_SYSCALL_TABLE(sys_epoll_pwait, sys_epoll_pwait, 303, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_utimensat > +TRACE_SYSCALL_TABLE(sys_utimensat, sys_utimensat, 304, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_signalfd > +TRACE_SYSCALL_TABLE(sys_signalfd, sys_signalfd, 305, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timerfd_settime > +TRACE_SYSCALL_TABLE(sys_timerfd_settime, sys_timerfd_settime, 311, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_timerfd_gettime > +TRACE_SYSCALL_TABLE(sys_timerfd_gettime, sys_timerfd_gettime, 312, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_signalfd4 > +TRACE_SYSCALL_TABLE(sys_signalfd4, sys_signalfd4, 313, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pipe2 > +TRACE_SYSCALL_TABLE(sys_pipe2, sys_pipe2, 317, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_perf_event_open > +TRACE_SYSCALL_TABLE(sys_perf_event_open, sys_perf_event_open, 319, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_preadv > +TRACE_SYSCALL_TABLE(sys_preadv, sys_preadv, 320, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_pwritev > +TRACE_SYSCALL_TABLE(sys_pwritev, sys_pwritev, 321, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_rt_tgsigqueueinfo > +TRACE_SYSCALL_TABLE(sys_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo, 322, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_prlimit64 > +TRACE_SYSCALL_TABLE(sys_prlimit64, sys_prlimit64, 325, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_bind > +TRACE_SYSCALL_TABLE(sys_bind, sys_bind, 327, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_connect > +TRACE_SYSCALL_TABLE(sys_connect, sys_connect, 328, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_accept > +TRACE_SYSCALL_TABLE(sys_accept, sys_accept, 330, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getsockname > +TRACE_SYSCALL_TABLE(sys_getsockname, sys_getsockname, 331, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getpeername > +TRACE_SYSCALL_TABLE(sys_getpeername, sys_getpeername, 332, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_socketpair > +TRACE_SYSCALL_TABLE(sys_socketpair, sys_socketpair, 333, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_send > +TRACE_SYSCALL_TABLE(sys_send, sys_send, 334, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sendto > +TRACE_SYSCALL_TABLE(sys_sendto, sys_sendto, 335, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_recvfrom > +TRACE_SYSCALL_TABLE(sys_recvfrom, sys_recvfrom, 337, 6) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_setsockopt > +TRACE_SYSCALL_TABLE(sys_setsockopt, sys_setsockopt, 339, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_getsockopt > +TRACE_SYSCALL_TABLE(sys_getsockopt, sys_getsockopt, 340, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sendmsg > +TRACE_SYSCALL_TABLE(sys_sendmsg, sys_sendmsg, 341, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_recvmsg > +TRACE_SYSCALL_TABLE(sys_recvmsg, sys_recvmsg, 342, 3) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_recvmmsg > +TRACE_SYSCALL_TABLE(sys_recvmmsg, sys_recvmmsg, 343, 5) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_accept4 > +TRACE_SYSCALL_TABLE(sys_accept4, sys_accept4, 344, 4) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_clock_adjtime > +TRACE_SYSCALL_TABLE(sys_clock_adjtime, sys_clock_adjtime, 347, 2) > +#endif > +#ifndef OVERRIDE_TABLE_32_sys_sendmmsg > +TRACE_SYSCALL_TABLE(sys_sendmmsg, sys_sendmmsg, 349, 4) > +#endif > + > +#endif /* CREATE_SYSCALL_TABLE */ > -- > 1.8.1.4 > > > From d27f0b823b593a60372f5440661fe29657401f94 Mon Sep 17 00:00:00 2001 > From: Paul Woegerer > Date: Mon, 29 Apr 2013 17:36:10 +0200 > Subject: [PATCH 2/5] Added ifdef for CONFIG_PPC > > --- > instrumentation/syscalls/headers/syscalls_integers.h | 4 ++++ > instrumentation/syscalls/headers/syscalls_pointers.h | 4 ++++ > 2 files changed, 8 insertions(+) > > diff --git a/instrumentation/syscalls/headers/syscalls_integers.h b/instrumentation/syscalls/headers/syscalls_integers.h > index 002130a..8fa73e0 100644 > --- a/instrumentation/syscalls/headers/syscalls_integers.h > +++ b/instrumentation/syscalls/headers/syscalls_integers.h > @@ -9,3 +9,7 @@ > #ifdef CONFIG_ARM > #include "arm-32-syscalls-2.6.38_integers.h" > #endif > + > +#ifdef CONFIG_PPC > +#include "powerpc-32-syscalls-3.0.34_integers.h" > +#endif > diff --git a/instrumentation/syscalls/headers/syscalls_pointers.h b/instrumentation/syscalls/headers/syscalls_pointers.h > index 11b4979..dd115c8 100644 > --- a/instrumentation/syscalls/headers/syscalls_pointers.h > +++ b/instrumentation/syscalls/headers/syscalls_pointers.h > @@ -9,3 +9,7 @@ > #ifdef CONFIG_ARM > #include "arm-32-syscalls-2.6.38_pointers.h" > #endif > + > +#ifdef CONFIG_PPC > +#include "powerpc-32-syscalls-3.0.34_pointers.h" > +#endif > -- > 1.8.1.4 > > > From 4de3e9c7c0b2d04f282176651c50541bd463f72a Mon Sep 17 00:00:00 2001 > From: Paul Woegerer > Date: Tue, 30 Apr 2013 17:26:57 +0200 > Subject: [PATCH 3/5] Add dummy *_override headers for powerpc-32-syscalls > > --- > .../syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h | 3 +++ > .../syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h | 3 +++ > 2 files changed, 6 insertions(+) > create mode 100644 instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h > create mode 100644 instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h > > diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h > new file mode 100644 > index 0000000..d3c09ee > --- /dev/null > +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h > @@ -0,0 +1,3 @@ > +/* > + * This is a place-holder for PPC integer syscall definition override. > + */ > diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h > new file mode 100644 > index 0000000..efe2c1f > --- /dev/null > +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h > @@ -0,0 +1,3 @@ > +/* > + * This is a place-holder for PPC pointer syscall definition override. > + */ > -- > 1.8.1.4 > > > From ceff663acceb2885a42883dff8112cf91b4e4f06 Mon Sep 17 00:00:00 2001 > From: Paul Woegerer > Date: Thu, 2 May 2013 17:02:29 +0200 > Subject: [PATCH 4/5] Add sys_mmap, sys_clone and sys_execve to > powerpc-32-syscalls > > --- > .../headers/powerpc-32-syscalls-3.0.34_integers_override.h | 12 +++++++++--- > .../headers/powerpc-32-syscalls-3.0.34_pointers_override.h | 14 +++++++++++--- > 2 files changed, 20 insertions(+), 6 deletions(-) > > diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h > index d3c09ee..6696f43 100644 > --- a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h > +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_integers_override.h > @@ -1,3 +1,9 @@ > -/* > - * This is a place-holder for PPC integer syscall definition override. > - */ > +#ifndef CREATE_SYSCALL_TABLE > + > +#else /* CREATE_SYSCALL_TABLE */ > + > +#define OVVERRIDE_TABLE_32_sys_mmap > +TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) > + > +#endif /* CREATE_SYSCALL_TABLE */ > + > diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h > index efe2c1f..c7a56c0 100644 > --- a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h > +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h > @@ -1,3 +1,11 @@ > -/* > - * This is a place-holder for PPC pointer syscall definition override. > - */ > +#ifndef CREATE_SYSCALL_TABLE > + > +#else /* CREATE_SYSCALL_TABLE */ > + > +#define OVERRIDE_TABLE_32_sys_execve > +TRACE_SYSCALL_TABLE(sys_execve, sys_execve, 11, 3) > +#define OVERRIDE_TABLE_32_sys_clone > +TRACE_SYSCALL_TABLE(sys_clone, sys_clone, 120, 5) > + > +#endif /* CREATE_SYSCALL_TABLE */ > + > -- > 1.8.1.4 > > > From de493ac797631c0a32bee106e18cebd7e9f38a5c Mon Sep 17 00:00:00 2001 > From: Paul Woegerer > Date: Fri, 3 May 2013 16:08:19 +0200 > Subject: [PATCH 5/5] Add sys_mmap2 to powerpc-32-syscalls > > --- > .../powerpc-32-syscalls-3.0.34_pointers_override.h | 25 ++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h > index c7a56c0..7a5d134 100644 > --- a/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h > +++ b/instrumentation/syscalls/headers/powerpc-32-syscalls-3.0.34_pointers_override.h > @@ -1,11 +1,36 @@ > +#define OVERRIDE_TABLE_32_sys_mmap2 > + > #ifndef CREATE_SYSCALL_TABLE > > +SC_TRACE_EVENT(sys_mmap2, > + TP_PROTO(void *addr, size_t len, int prot, > + int flags, int fd, off_t pgoff), > + TP_ARGS(addr, len, prot, flags, fd, pgoff), > + TP_STRUCT__entry( > + __field_hex(void *, addr) > + __field(size_t, len) > + __field(int, prot) > + __field(int, flags) > + __field(int, fd) > + __field(off_t, pgoff)), > + TP_fast_assign( > + tp_assign(addr, addr) > + tp_assign(len, len) > + tp_assign(prot, prot) > + tp_assign(flags, flags) > + tp_assign(fd, fd) > + tp_assign(pgoff, pgoff)), > + TP_printk() > +) > + > #else /* CREATE_SYSCALL_TABLE */ > > #define OVERRIDE_TABLE_32_sys_execve > TRACE_SYSCALL_TABLE(sys_execve, sys_execve, 11, 3) > #define OVERRIDE_TABLE_32_sys_clone > TRACE_SYSCALL_TABLE(sys_clone, sys_clone, 120, 5) > +#define OVERRIDE_TABLE_32_sys_mmap2 > +TRACE_SYSCALL_TABLE(sys_mmap2, sys_mmap2, 192, 6) > > #endif /* CREATE_SYSCALL_TABLE */ > > -- > 1.8.1.4 > > > -- > Paul Woegerer | SW Development Engineer > http://go.mentor.com/sourceryanalyzer > > Mentor Embedded(tm) | Prinz Eugen Stra?e 72/2/4, Vienna, 1040 Austria > Nucleus? | Linux? | Android(tm) | Services | UI | Multi-OS > > Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. > Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Mon May 13 15:43:06 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 13 May 2013 15:43:06 -0400 Subject: [lttng-dev] [PATCH lttng-tools v2] Add wrappers for pipe In-Reply-To: <20130511144812.GB11892@Krystal> References: <1368210260-20425-1-git-send-email-dgoulet@efficios.com> <20130511144812.GB11892@Krystal> Message-ID: <5191424A.2070105@efficios.com> Mathieu Desnoyers: > * David Goulet (dgoulet at efficios.com) wrote: >> This is to help use pipes in a way where partial read/write and EINTR >> are handled in one single call site. >> >> Two new files are created, pipe.c/.h which are part of libcommon. The >> open, close, read_close, write_close, read and write calls are >> implemented using a custom lttng_pipe data structure and protected by >> operation's mutex. A destroy function is also available to cleanup >> memory once done with a pipe. >> >> Signed-off-by: David Goulet >> --- >> src/common/Makefile.am | 3 +- >> src/common/pipe.c | 315 ++++++++++++++++++++++++++++++++++++++++++++++++ >> src/common/pipe.h | 76 ++++++++++++ >> 3 files changed, 393 insertions(+), 1 deletion(-) >> create mode 100644 src/common/pipe.c >> create mode 100644 src/common/pipe.h >> >> diff --git a/src/common/Makefile.am b/src/common/Makefile.am >> index f2ea40a..6ba6c2b 100644 >> --- a/src/common/Makefile.am >> +++ b/src/common/Makefile.am >> @@ -13,7 +13,8 @@ noinst_HEADERS = lttng-kernel.h defaults.h macros.h error.h futex.h \ >> noinst_LTLIBRARIES = libcommon.la >> >> libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \ >> - common.h futex.c futex.h uri.c uri.h defaults.c >> + common.h futex.c futex.h uri.c uri.h defaults.c \ >> + pipe.c pipe.h >> libcommon_la_LIBADD = -luuid >> >> # Consumer library >> diff --git a/src/common/pipe.c b/src/common/pipe.c >> new file mode 100644 >> index 0000000..9242a09 >> --- /dev/null >> +++ b/src/common/pipe.c >> @@ -0,0 +1,315 @@ >> +/* >> + * Copyright (C) 2013 - David Goulet >> + * >> + * This program is free software; you can redistribute it and/or modify it >> + * under the terms of the GNU General Public License, version 2 only, as >> + * published by the Free Software Foundation. >> + * >> + * This program is distributed in the hope that it will be useful, but WITHOUT >> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or >> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for >> + * more details. >> + * >> + * You should have received a copy of the GNU General Public License along with >> + * this program; if not, write to the Free Software Foundation, Inc., 51 >> + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >> + */ >> + >> +#define _GNU_SOURCE >> +#include >> +#include >> +#include >> + >> +#include >> + >> +#include "pipe.h" >> + >> +/* >> + * Lock read side of a pipe. >> + */ >> +static void lock_read_side(struct lttng_pipe *pipe) >> +{ >> + pthread_mutex_lock(&pipe->read_mutex); >> +} >> + >> +/* >> + * Unlock read side of a pipe. >> + */ >> +static void unlock_read_side(struct lttng_pipe *pipe) >> +{ >> + pthread_mutex_unlock(&pipe->read_mutex); >> +} >> + >> +/* >> + * Lock write side of a pipe. >> + */ >> +static void lock_write_side(struct lttng_pipe *pipe) >> +{ >> + pthread_mutex_lock(&pipe->write_mutex); >> +} >> + >> +/* >> + * Unlock write side of a pipe. >> + */ >> +static void unlock_write_side(struct lttng_pipe *pipe) >> +{ >> + pthread_mutex_unlock(&pipe->write_mutex); >> +} >> + >> +/* >> + * Open a new lttng pipe and set flags using fcntl(). >> + * >> + * Return a newly allocated lttng pipe on success or else NULL. >> + */ >> +struct lttng_pipe *lttng_pipe_open(int flags) >> +{ >> + int ret; >> + struct lttng_pipe *p; >> + >> + p = zmalloc(sizeof(*p)); >> + if (!p) { >> + PERROR("zmalloc pipe open"); >> + goto error; >> + } >> + >> + ret = pipe(p->fd); >> + if (ret < 0) { >> + PERROR("lttng pipe"); >> + goto error; >> + } >> + >> + if (flags) { >> + int i; >> + >> + for (i = 0; i < 2; i++) { >> + ret = fcntl(p->fd[i], F_SETFD, flags); >> + if (ret < 0) { >> + PERROR("fcntl lttng pipe %d", flags); >> + goto error; >> + } >> + } >> + } >> + >> + pthread_mutex_init(&p->read_mutex, NULL); >> + pthread_mutex_init(&p->write_mutex, NULL); >> + p->r_state = LTTNG_PIPE_STATE_OPENED; >> + p->w_state = LTTNG_PIPE_STATE_OPENED; >> + p->flags = flags; >> + >> + return p; >> + >> +error: >> + lttng_pipe_destroy(p); >> + return NULL; >> +} >> + >> +/* >> + * Close read side of a lttng pipe. >> + * >> + * Return 0 on success else a negative value. >> + */ >> +int lttng_pipe_read_close(struct lttng_pipe *pipe) >> +{ >> + int ret, ret_val = 0; >> + >> + assert(pipe); >> + >> + /* Handle read side first. */ >> + lock_read_side(pipe); >> + if (lttng_pipe_is_read_open(pipe)) { >> + do { >> + ret = close(pipe->fd[0]); >> + } while (ret < 0 && errno == EINTR); >> + if (ret < 0) { >> + PERROR("close lttng read pipe"); >> + ret_val = -errno; >> + } >> + pipe->r_state = LTTNG_PIPE_STATE_CLOSED; >> + } >> + unlock_read_side(pipe); >> + >> + return ret_val; >> +} >> + >> +/* >> + * Close write side of a lttng pipe. >> + * >> + * Return 0 on success else a negative value. >> + */ >> +int lttng_pipe_write_close(struct lttng_pipe *pipe) >> +{ >> + int ret, ret_val = 0; >> + >> + assert(pipe); >> + >> + lock_write_side(pipe); >> + if (lttng_pipe_is_write_open(pipe)) { >> + do { >> + ret = close(pipe->fd[1]); >> + } while (ret < 0 && errno == EINTR); >> + if (ret < 0) { >> + PERROR("close lttng write pipe"); >> + ret_val = -errno; >> + } >> + pipe->w_state = LTTNG_PIPE_STATE_CLOSED; >> + } >> + unlock_write_side(pipe); >> + >> + return ret_val; >> +} >> + >> +/* >> + * Close both read and write side of a lttng pipe. >> + * >> + * Return 0 on success else a negative value. >> + */ >> +int lttng_pipe_close(struct lttng_pipe *pipe) >> +{ >> + int ret, ret_val = 0; >> + >> + assert(pipe); >> + >> + ret = lttng_pipe_read_close(pipe); >> + if (ret < 0) { >> + ret_val = ret; >> + } >> + >> + ret = lttng_pipe_write_close(pipe); >> + if (ret < 0) { >> + ret_val = ret; >> + } >> + >> + return ret_val; >> +} >> + >> +/* >> + * Close and destroy a lttng pipe object. Finally, pipe is freed. >> + */ >> +void lttng_pipe_destroy(struct lttng_pipe *pipe) >> +{ >> + int ret; >> + >> + if (!pipe) { >> + return; >> + } >> + >> + /* Wrong code flow. Destroy should *never* be called with mutex locked. */ >> + ret = pthread_mutex_trylock(&pipe->read_mutex); >> + assert(!ret); >> + ret = pthread_mutex_trylock(&pipe->write_mutex); >> + assert(!ret); > What should be done then ? David > the issue here is that you trylock, then succeed, and then take the > locks again within close, thus deadlocking. > > The rest looks good, thanks! > > Mathieu > >> + >> + /* If pipe is already closed or not opened, this returns gracefully. */ >> + (void) lttng_pipe_close(pipe); >> + >> + (void) pthread_mutex_destroy(&pipe->read_mutex); >> + (void) pthread_mutex_destroy(&pipe->write_mutex); >> + free(pipe); >> +} >> + >> +/* >> + * Read on a lttng pipe and put the data in buf of at least size count. >> + * >> + * Return 0 on success or else a negative errno message from read(2). >> + */ >> +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count) >> +{ >> + ssize_t ret, read_len, read_left, index; >> + >> + assert(pipe); >> + assert(buf); >> + >> + lock_read_side(pipe); >> + >> + if (!lttng_pipe_is_read_open(pipe)) { >> + ret = -EBADF; >> + goto error; >> + } >> + >> + read_left = count; >> + index = 0; >> + do { >> + read_len = read(pipe->fd[0], buf + index, read_left); >> + if (read_len < 0) { >> + ret = -errno; >> + if (errno == EINTR) { >> + /* Read again. */ >> + continue; >> + } else if (errno == EAGAIN || errno == EWOULDBLOCK) { >> + /* >> + * Return the number of bytes read up to this point if any. >> + */ >> + if (index) { >> + ret = index; >> + } >> + goto error; >> + } else { >> + PERROR("lttng pipe read"); >> + goto error; >> + } >> + } >> + read_left -= read_len; >> + index += read_len; >> + } while (read_left > 0); >> + >> + /* Everything went fine. */ >> + ret = index; >> + >> +error: >> + unlock_read_side(pipe); >> + return ret; >> +} >> + >> +/* >> + * Write on a lttng pipe using the data in buf and size of count. >> + * >> + * Return 0 on success or else a negative errno message from write(2). >> + */ >> +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, >> + size_t count) >> +{ >> + ssize_t ret, write_len, write_left, index; >> + >> + assert(pipe); >> + assert(buf); >> + >> + lock_write_side(pipe); >> + >> + if (!lttng_pipe_is_write_open(pipe)) { >> + ret = -EBADF; >> + goto error; >> + } >> + >> + write_left = count; >> + index = 0; >> + do { >> + write_len = write(pipe->fd[1], buf + index, write_left); >> + if (write_len < 0) { >> + ret = -errno; >> + if (errno == EINTR) { >> + /* Read again. */ >> + continue; >> + } else if (errno == EAGAIN || errno == EWOULDBLOCK) { >> + /* >> + * Return the number of bytes read up to this point if any. >> + */ >> + if (index) { >> + ret = index; >> + } >> + goto error; >> + } else { >> + PERROR("lttng pipe write"); >> + goto error; >> + } >> + } >> + write_left -= write_len; >> + index += write_len; >> + } while (write_left > 0); >> + >> + /* Everything went fine. */ >> + ret = index; >> + >> +error: >> + unlock_write_side(pipe); >> + return ret; >> +} >> diff --git a/src/common/pipe.h b/src/common/pipe.h >> new file mode 100644 >> index 0000000..acd05d8 >> --- /dev/null >> +++ b/src/common/pipe.h >> @@ -0,0 +1,76 @@ >> +/* >> + * Copyright (C) 2013 - David Goulet >> + * >> + * This program is free software; you can redistribute it and/or modify it >> + * under the terms of the GNU General Public License, version 2 only, as >> + * published by the Free Software Foundation. >> + * >> + * This program is distributed in the hope that it will be useful, but WITHOUT >> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or >> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for >> + * more details. >> + * >> + * You should have received a copy of the GNU General Public License along with >> + * this program; if not, write to the Free Software Foundation, Inc., 51 >> + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >> + */ >> + >> +#ifndef LTTNG_PIPE_H >> +#define LTTNG_PIPE_H >> + >> +#include >> + >> +enum lttng_pipe_state { >> + LTTNG_PIPE_STATE_OPENED = 1, >> + LTTNG_PIPE_STATE_CLOSED = 2, >> +}; >> + >> +struct lttng_pipe { >> + /* Read: 0, Write: 1. */ >> + int fd[2]; >> + /* >> + * Flags of the pipe once opened. pipe(2) specifies either O_NONBLOCK or >> + * O_CLOEXEC can be used. Flags are set using fcntl(2) call. >> + */ >> + int flags; >> + >> + /* >> + * These states are protected by the operation mutex below. >> + */ >> + enum lttng_pipe_state r_state; >> + enum lttng_pipe_state w_state; >> + >> + /* Held for each read(2) operation. */ >> + pthread_mutex_t read_mutex; >> + /* Held for each write(2) operation. */ >> + pthread_mutex_t write_mutex; >> +}; >> + >> +/* >> + * Return 1 if read side is open else 0. >> + */ >> +static inline int lttng_pipe_is_read_open(struct lttng_pipe *pipe) >> +{ >> + return pipe->r_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0; >> +} >> + >> +/* >> + * Return 1 if write side is open else 0. >> + */ >> +static inline int lttng_pipe_is_write_open(struct lttng_pipe *pipe) >> +{ >> + return pipe->w_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0; >> +} >> + >> +struct lttng_pipe *lttng_pipe_open(int flags); >> +int lttng_pipe_write_close(struct lttng_pipe *pipe); >> +int lttng_pipe_read_close(struct lttng_pipe *pipe); >> +/* Close both side of pipe. */ >> +int lttng_pipe_close(struct lttng_pipe *pipe); >> +void lttng_pipe_destroy(struct lttng_pipe *pipe); >> + >> +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count); >> +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, >> + size_t count); >> + >> +#endif /* LTTNG_PIPE_H */ >> -- >> 1.7.10.4 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From mathieu.desnoyers at efficios.com Mon May 13 16:05:38 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 13 May 2013 16:05:38 -0400 Subject: [lttng-dev] [PATCH lttng-tools v2] Add wrappers for pipe In-Reply-To: <5191424A.2070105@efficios.com> References: <1368210260-20425-1-git-send-email-dgoulet@efficios.com> <20130511144812.GB11892@Krystal> <5191424A.2070105@efficios.com> Message-ID: <20130513200538.GA7999@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > > > Mathieu Desnoyers: > > * David Goulet (dgoulet at efficios.com) wrote: > >> This is to help use pipes in a way where partial read/write and EINTR > >> are handled in one single call site. > >> > >> Two new files are created, pipe.c/.h which are part of libcommon. The > >> open, close, read_close, write_close, read and write calls are > >> implemented using a custom lttng_pipe data structure and protected by > >> operation's mutex. A destroy function is also available to cleanup > >> memory once done with a pipe. > >> > >> Signed-off-by: David Goulet > >> --- > >> src/common/Makefile.am | 3 +- > >> src/common/pipe.c | 315 ++++++++++++++++++++++++++++++++++++++++++++++++ > >> src/common/pipe.h | 76 ++++++++++++ > >> 3 files changed, 393 insertions(+), 1 deletion(-) > >> create mode 100644 src/common/pipe.c > >> create mode 100644 src/common/pipe.h > >> > >> diff --git a/src/common/Makefile.am b/src/common/Makefile.am > >> index f2ea40a..6ba6c2b 100644 > >> --- a/src/common/Makefile.am > >> +++ b/src/common/Makefile.am > >> @@ -13,7 +13,8 @@ noinst_HEADERS = lttng-kernel.h defaults.h macros.h error.h futex.h \ > >> noinst_LTLIBRARIES = libcommon.la > >> > >> libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \ > >> - common.h futex.c futex.h uri.c uri.h defaults.c > >> + common.h futex.c futex.h uri.c uri.h defaults.c \ > >> + pipe.c pipe.h > >> libcommon_la_LIBADD = -luuid > >> > >> # Consumer library > >> diff --git a/src/common/pipe.c b/src/common/pipe.c > >> new file mode 100644 > >> index 0000000..9242a09 > >> --- /dev/null > >> +++ b/src/common/pipe.c > >> @@ -0,0 +1,315 @@ > >> +/* > >> + * Copyright (C) 2013 - David Goulet > >> + * > >> + * This program is free software; you can redistribute it and/or modify it > >> + * under the terms of the GNU General Public License, version 2 only, as > >> + * published by the Free Software Foundation. > >> + * > >> + * This program is distributed in the hope that it will be useful, but WITHOUT > >> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > >> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > >> + * more details. > >> + * > >> + * You should have received a copy of the GNU General Public License along with > >> + * this program; if not, write to the Free Software Foundation, Inc., 51 > >> + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > >> + */ > >> + > >> +#define _GNU_SOURCE > >> +#include > >> +#include > >> +#include > >> + > >> +#include > >> + > >> +#include "pipe.h" > >> + > >> +/* > >> + * Lock read side of a pipe. > >> + */ > >> +static void lock_read_side(struct lttng_pipe *pipe) > >> +{ > >> + pthread_mutex_lock(&pipe->read_mutex); > >> +} > >> + > >> +/* > >> + * Unlock read side of a pipe. > >> + */ > >> +static void unlock_read_side(struct lttng_pipe *pipe) > >> +{ > >> + pthread_mutex_unlock(&pipe->read_mutex); > >> +} > >> + > >> +/* > >> + * Lock write side of a pipe. > >> + */ > >> +static void lock_write_side(struct lttng_pipe *pipe) > >> +{ > >> + pthread_mutex_lock(&pipe->write_mutex); > >> +} > >> + > >> +/* > >> + * Unlock write side of a pipe. > >> + */ > >> +static void unlock_write_side(struct lttng_pipe *pipe) > >> +{ > >> + pthread_mutex_unlock(&pipe->write_mutex); > >> +} > >> + > >> +/* > >> + * Open a new lttng pipe and set flags using fcntl(). > >> + * > >> + * Return a newly allocated lttng pipe on success or else NULL. > >> + */ > >> +struct lttng_pipe *lttng_pipe_open(int flags) > >> +{ > >> + int ret; > >> + struct lttng_pipe *p; > >> + > >> + p = zmalloc(sizeof(*p)); > >> + if (!p) { > >> + PERROR("zmalloc pipe open"); > >> + goto error; > >> + } > >> + > >> + ret = pipe(p->fd); > >> + if (ret < 0) { > >> + PERROR("lttng pipe"); > >> + goto error; > >> + } > >> + > >> + if (flags) { > >> + int i; > >> + > >> + for (i = 0; i < 2; i++) { > >> + ret = fcntl(p->fd[i], F_SETFD, flags); > >> + if (ret < 0) { > >> + PERROR("fcntl lttng pipe %d", flags); > >> + goto error; > >> + } > >> + } > >> + } > >> + > >> + pthread_mutex_init(&p->read_mutex, NULL); > >> + pthread_mutex_init(&p->write_mutex, NULL); > >> + p->r_state = LTTNG_PIPE_STATE_OPENED; > >> + p->w_state = LTTNG_PIPE_STATE_OPENED; > >> + p->flags = flags; > >> + > >> + return p; > >> + > >> +error: > >> + lttng_pipe_destroy(p); > >> + return NULL; > >> +} > >> + > >> +/* > >> + * Close read side of a lttng pipe. > >> + * > >> + * Return 0 on success else a negative value. > >> + */ > >> +int lttng_pipe_read_close(struct lttng_pipe *pipe) > >> +{ > >> + int ret, ret_val = 0; > >> + > >> + assert(pipe); > >> + > >> + /* Handle read side first. */ > >> + lock_read_side(pipe); > >> + if (lttng_pipe_is_read_open(pipe)) { > >> + do { > >> + ret = close(pipe->fd[0]); > >> + } while (ret < 0 && errno == EINTR); > >> + if (ret < 0) { > >> + PERROR("close lttng read pipe"); > >> + ret_val = -errno; > >> + } > >> + pipe->r_state = LTTNG_PIPE_STATE_CLOSED; > >> + } > >> + unlock_read_side(pipe); > >> + > >> + return ret_val; > >> +} > >> + > >> +/* > >> + * Close write side of a lttng pipe. > >> + * > >> + * Return 0 on success else a negative value. > >> + */ > >> +int lttng_pipe_write_close(struct lttng_pipe *pipe) > >> +{ > >> + int ret, ret_val = 0; > >> + > >> + assert(pipe); > >> + > >> + lock_write_side(pipe); > >> + if (lttng_pipe_is_write_open(pipe)) { > >> + do { > >> + ret = close(pipe->fd[1]); > >> + } while (ret < 0 && errno == EINTR); > >> + if (ret < 0) { > >> + PERROR("close lttng write pipe"); > >> + ret_val = -errno; > >> + } > >> + pipe->w_state = LTTNG_PIPE_STATE_CLOSED; > >> + } > >> + unlock_write_side(pipe); > >> + > >> + return ret_val; > >> +} > >> + > >> +/* > >> + * Close both read and write side of a lttng pipe. > >> + * > >> + * Return 0 on success else a negative value. > >> + */ > >> +int lttng_pipe_close(struct lttng_pipe *pipe) > >> +{ > >> + int ret, ret_val = 0; > >> + > >> + assert(pipe); > >> + > >> + ret = lttng_pipe_read_close(pipe); > >> + if (ret < 0) { > >> + ret_val = ret; > >> + } > >> + > >> + ret = lttng_pipe_write_close(pipe); > >> + if (ret < 0) { > >> + ret_val = ret; > >> + } > >> + > >> + return ret_val; > >> +} > >> + > >> +/* > >> + * Close and destroy a lttng pipe object. Finally, pipe is freed. > >> + */ > >> +void lttng_pipe_destroy(struct lttng_pipe *pipe) > >> +{ > >> + int ret; > >> + > >> + if (!pipe) { > >> + return; > >> + } > >> + > >> + /* Wrong code flow. Destroy should *never* be called with mutex locked. */ > >> + ret = pthread_mutex_trylock(&pipe->read_mutex); > >> + assert(!ret); > >> + ret = pthread_mutex_trylock(&pipe->write_mutex); > >> + assert(!ret); > > > > What should be done then ? try lock try lock call versions of function that don't take the lock internally unlock unlock destroy x2 free split the close pipe functions into one internal (static) that does not take the lock, and one externally exposed that takes the lock and calls the internal one. A leading unscore in front of the internal functions should do the trick. Thanks, Mathieu > > David > > > the issue here is that you trylock, then succeed, and then take the > > locks again within close, thus deadlocking. > > > > The rest looks good, thanks! > > > > Mathieu > > > >> + > >> + /* If pipe is already closed or not opened, this returns gracefully. */ > >> + (void) lttng_pipe_close(pipe); > >> + > >> + (void) pthread_mutex_destroy(&pipe->read_mutex); > >> + (void) pthread_mutex_destroy(&pipe->write_mutex); > >> + free(pipe); > >> +} > >> + > >> +/* > >> + * Read on a lttng pipe and put the data in buf of at least size count. > >> + * > >> + * Return 0 on success or else a negative errno message from read(2). > >> + */ > >> +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count) > >> +{ > >> + ssize_t ret, read_len, read_left, index; > >> + > >> + assert(pipe); > >> + assert(buf); > >> + > >> + lock_read_side(pipe); > >> + > >> + if (!lttng_pipe_is_read_open(pipe)) { > >> + ret = -EBADF; > >> + goto error; > >> + } > >> + > >> + read_left = count; > >> + index = 0; > >> + do { > >> + read_len = read(pipe->fd[0], buf + index, read_left); > >> + if (read_len < 0) { > >> + ret = -errno; > >> + if (errno == EINTR) { > >> + /* Read again. */ > >> + continue; > >> + } else if (errno == EAGAIN || errno == EWOULDBLOCK) { > >> + /* > >> + * Return the number of bytes read up to this point if any. > >> + */ > >> + if (index) { > >> + ret = index; > >> + } > >> + goto error; > >> + } else { > >> + PERROR("lttng pipe read"); > >> + goto error; > >> + } > >> + } > >> + read_left -= read_len; > >> + index += read_len; > >> + } while (read_left > 0); > >> + > >> + /* Everything went fine. */ > >> + ret = index; > >> + > >> +error: > >> + unlock_read_side(pipe); > >> + return ret; > >> +} > >> + > >> +/* > >> + * Write on a lttng pipe using the data in buf and size of count. > >> + * > >> + * Return 0 on success or else a negative errno message from write(2). > >> + */ > >> +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, > >> + size_t count) > >> +{ > >> + ssize_t ret, write_len, write_left, index; > >> + > >> + assert(pipe); > >> + assert(buf); > >> + > >> + lock_write_side(pipe); > >> + > >> + if (!lttng_pipe_is_write_open(pipe)) { > >> + ret = -EBADF; > >> + goto error; > >> + } > >> + > >> + write_left = count; > >> + index = 0; > >> + do { > >> + write_len = write(pipe->fd[1], buf + index, write_left); > >> + if (write_len < 0) { > >> + ret = -errno; > >> + if (errno == EINTR) { > >> + /* Read again. */ > >> + continue; > >> + } else if (errno == EAGAIN || errno == EWOULDBLOCK) { > >> + /* > >> + * Return the number of bytes read up to this point if any. > >> + */ > >> + if (index) { > >> + ret = index; > >> + } > >> + goto error; > >> + } else { > >> + PERROR("lttng pipe write"); > >> + goto error; > >> + } > >> + } > >> + write_left -= write_len; > >> + index += write_len; > >> + } while (write_left > 0); > >> + > >> + /* Everything went fine. */ > >> + ret = index; > >> + > >> +error: > >> + unlock_write_side(pipe); > >> + return ret; > >> +} > >> diff --git a/src/common/pipe.h b/src/common/pipe.h > >> new file mode 100644 > >> index 0000000..acd05d8 > >> --- /dev/null > >> +++ b/src/common/pipe.h > >> @@ -0,0 +1,76 @@ > >> +/* > >> + * Copyright (C) 2013 - David Goulet > >> + * > >> + * This program is free software; you can redistribute it and/or modify it > >> + * under the terms of the GNU General Public License, version 2 only, as > >> + * published by the Free Software Foundation. > >> + * > >> + * This program is distributed in the hope that it will be useful, but WITHOUT > >> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > >> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > >> + * more details. > >> + * > >> + * You should have received a copy of the GNU General Public License along with > >> + * this program; if not, write to the Free Software Foundation, Inc., 51 > >> + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > >> + */ > >> + > >> +#ifndef LTTNG_PIPE_H > >> +#define LTTNG_PIPE_H > >> + > >> +#include > >> + > >> +enum lttng_pipe_state { > >> + LTTNG_PIPE_STATE_OPENED = 1, > >> + LTTNG_PIPE_STATE_CLOSED = 2, > >> +}; > >> + > >> +struct lttng_pipe { > >> + /* Read: 0, Write: 1. */ > >> + int fd[2]; > >> + /* > >> + * Flags of the pipe once opened. pipe(2) specifies either O_NONBLOCK or > >> + * O_CLOEXEC can be used. Flags are set using fcntl(2) call. > >> + */ > >> + int flags; > >> + > >> + /* > >> + * These states are protected by the operation mutex below. > >> + */ > >> + enum lttng_pipe_state r_state; > >> + enum lttng_pipe_state w_state; > >> + > >> + /* Held for each read(2) operation. */ > >> + pthread_mutex_t read_mutex; > >> + /* Held for each write(2) operation. */ > >> + pthread_mutex_t write_mutex; > >> +}; > >> + > >> +/* > >> + * Return 1 if read side is open else 0. > >> + */ > >> +static inline int lttng_pipe_is_read_open(struct lttng_pipe *pipe) > >> +{ > >> + return pipe->r_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0; > >> +} > >> + > >> +/* > >> + * Return 1 if write side is open else 0. > >> + */ > >> +static inline int lttng_pipe_is_write_open(struct lttng_pipe *pipe) > >> +{ > >> + return pipe->w_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0; > >> +} > >> + > >> +struct lttng_pipe *lttng_pipe_open(int flags); > >> +int lttng_pipe_write_close(struct lttng_pipe *pipe); > >> +int lttng_pipe_read_close(struct lttng_pipe *pipe); > >> +/* Close both side of pipe. */ > >> +int lttng_pipe_close(struct lttng_pipe *pipe); > >> +void lttng_pipe_destroy(struct lttng_pipe *pipe); > >> + > >> +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count); > >> +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, > >> + size_t count); > >> + > >> +#endif /* LTTNG_PIPE_H */ > >> -- > >> 1.7.10.4 > >> > >> > >> _______________________________________________ > >> lttng-dev mailing list > >> lttng-dev at lists.lttng.org > >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon May 13 16:20:23 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 13 May 2013 16:20:23 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 08/28] Add MinGW implementation of mmap and munmap In-Reply-To: <009B25148989C6458484484699278506E537E8A5@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E8A5@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 7:49 AM, Ikaheimonen, JP wrote: > Implementations of mmap and munmap using Windows API. > The header file sys/mman.h is now indirectly included by > include/babeltrace/compat/mman.h . > For MinGW, PAGE_SIZE is defined as a constant instead of > using a sysconf() setting. > --- > compat/Makefile.am | 4 +- > compat/compat_mman.c | 128 ++++++++++++++++++++++++++++++++++++ > converter/babeltrace-log.c | 2 +- > formats/bt-dummy/bt-dummy.c | 2 +- > formats/ctf-metadata/ctf-metadata.c | 2 +- > formats/ctf-text/ctf-text.c | 2 +- > formats/ctf/ctf.c | 2 +- > include/babeltrace/align.h | 5 ++ > include/babeltrace/compat/mman.h | 24 +++++++ > include/babeltrace/ctf-text/types.h | 2 +- > include/babeltrace/mmap-align.h | 2 +- > 11 files changed, 166 insertions(+), 9 deletions(-) > create mode 100644 compat/compat_mman.c > create mode 100644 include/babeltrace/compat/mman.h > > diff --git a/compat/Makefile.am b/compat/Makefile.am > index e624a79..e573854 100644 > --- a/compat/Makefile.am > +++ b/compat/Makefile.am > @@ -9,5 +9,5 @@ libcompat_la_LDFLAGS = \ > -Wl,--no-as-needed > > if BABELTRACE_BUILD_WITH_MINGW > -libcompat_la_SOURCES += compat_uuid.c > -endif > \ No newline at end of file > +libcompat_la_SOURCES += compat_mman.c compat_uuid.c > +endif > diff --git a/compat/compat_mman.c b/compat/compat_mman.c > new file mode 100644 > index 0000000..0e45260 > --- /dev/null > +++ b/compat/compat_mman.c > @@ -0,0 +1,128 @@ > +/* This file is only built under MINGW32 */ > + > +#include > +#include > +#include > + > +#define HAS_FLAG( BITSET, FLAG ) ( ( BITSET & FLAG ) == FLAG ) > + > +typedef struct > +{ > + HANDLE hFile; > + HANDLE hFileMappingObject; > + unsigned char *start_addr; > + long offset; > +} mmap_data; > + > +mmap_data *arr_mmap_data = NULL; > +size_t arr_mmap_data_size = 0; > +DWORD allocationGranularity = 0; > + > +void mmap_data_add( mmap_data data ) > +{ > + arr_mmap_data = (mmap_data *) realloc( arr_mmap_data, ( arr_mmap_data_size + 1 ) * sizeof( mmap_data ) ); > + arr_mmap_data[ arr_mmap_data_size ] = data; > + arr_mmap_data_size += 1; > +} > + > +mmap_data *mmap_data_find_addr( unsigned char *start_addr ) > +{ > + size_t i; > + for( i = 0; i < arr_mmap_data_size; ++i ) > + if( arr_mmap_data[i].start_addr + arr_mmap_data[i].offset == start_addr ) > + return arr_mmap_data + i; > + > + return NULL; > +} > + > +/* mmap for mingw32 */ > +void *mmap( void *ptr, long size, long prot, long type, long handle, long arg ) > +{ > + //__builtin_printf( "mmap: %p, %d, %d, %d, %d, %d\n", ptr, size, prot, type, handle, arg ); > + mmap_data data_entry; > + long offset; > + > + if (allocationGranularity == 0) > + { > + SYSTEM_INFO sysinfo; > + GetSystemInfo(&sysinfo); > + allocationGranularity = sysinfo.dwAllocationGranularity; > + } > + > + if( prot == PROT_NONE || HAS_FLAG( prot, PROT_EXEC ) ) > + return MAP_FAILED; /* not supported - fail safe */ > + > + data_entry.hFile = (HANDLE) _get_osfhandle( handle ); > + if( data_entry.hFile != INVALID_HANDLE_VALUE ) > + { > + > + /* There is no 1:1 mapping, best effort strategy */ > + DWORD flProtect = PAGE_READONLY; > + DWORD dwDesiredAccess = FILE_MAP_READ; > + > + if( HAS_FLAG( prot, PROT_WRITE ) ) > + { > + flProtect = PAGE_READWRITE; > + if( HAS_FLAG( prot, PROT_READ ) ) > + dwDesiredAccess = FILE_MAP_ALL_ACCESS; > + else > + dwDesiredAccess = FILE_MAP_WRITE; > + } > + > + if( HAS_FLAG( type, MAP_PRIVATE ) ) > + { > + flProtect = PAGE_WRITECOPY; > + dwDesiredAccess = FILE_MAP_COPY; > + } > + > + data_entry.hFileMappingObject = CreateFileMapping( data_entry.hFile, NULL, flProtect, 0, 0, NULL ); > + if( data_entry.hFileMappingObject != NULL ) > + { > + DWORD filesizelow; > + DWORD filesizehigh; > + filesizelow = GetFileSize(data_entry.hFile, &filesizehigh); > + offset = 0; > + while (arg > allocationGranularity) > + { > + if (filesizelow < allocationGranularity) > + { > + filesizehigh--; > + } > + filesizelow -= allocationGranularity; > + > + arg -= allocationGranularity; > + offset += allocationGranularity; > + } > + data_entry.offset = arg; > + size = size + arg; > + if ((size > filesizelow) && (filesizehigh == 0)) > + { > + size = filesizelow; > + } > + data_entry.start_addr = MapViewOfFile( data_entry.hFileMappingObject, dwDesiredAccess, 0, offset, size); > + if( data_entry.start_addr != NULL ) > + { > + mmap_data_add( data_entry ); > + return (void *)(data_entry.start_addr + arg); > + } > + } > + > + } > + > + return MAP_FAILED; > +} > + > + > +/* munmap for mingw32 */ > +long munmap( void *ptr, long size ) > +{ > + mmap_data *data_entry = mmap_data_find_addr( ptr ); > + if( data_entry != NULL && UnmapViewOfFile( data_entry->start_addr ) != 0 ) > + { > + CloseHandle( data_entry->hFileMappingObject ); > + data_entry->start_addr = NULL; > + return 0; > + } > + > + return -1; > +} > diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c > index 52a2fe1..b11eb99 100644 > --- a/converter/babeltrace-log.c > +++ b/converter/babeltrace-log.c > @@ -33,7 +33,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > diff --git a/formats/bt-dummy/bt-dummy.c b/formats/bt-dummy/bt-dummy.c > index 6192e88..4be9741 100644 > --- a/formats/bt-dummy/bt-dummy.c > +++ b/formats/bt-dummy/bt-dummy.c > @@ -28,7 +28,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > diff --git a/formats/ctf-metadata/ctf-metadata.c b/formats/ctf-metadata/ctf-metadata.c > index a5a74c3..7ac36e1 100644 > --- a/formats/ctf-metadata/ctf-metadata.c > +++ b/formats/ctf-metadata/ctf-metadata.c > @@ -31,7 +31,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c > index 48ce31b..bc5c2a7 100644 > --- a/formats/ctf-text/ctf-text.c > +++ b/formats/ctf-text/ctf-text.c > @@ -32,7 +32,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c > index d77c93a..0cfad44 100644 > --- a/formats/ctf/ctf.c > +++ b/formats/ctf/ctf.c > @@ -37,7 +37,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > diff --git a/include/babeltrace/align.h b/include/babeltrace/align.h > index f6a1966..e7d715e 100644 > --- a/include/babeltrace/align.h > +++ b/include/babeltrace/align.h > @@ -30,8 +30,13 @@ > #include > > #ifndef PAGE_SIZE /* Cygwin limits.h defines its own PAGE_SIZE */ > +#ifdef __MINGW32__ > +#define PAGE_SIZE 4096 You could get the real page size like this on Windows: #define WIN32_LEAN_AND_MEAN #include #define PAGE_SIZE ({SYSTEM_INFO sys_info; GetSystemInfo (&sys_info); sys_info.dwPageSize;}) > +#else > #define PAGE_SIZE sysconf(_SC_PAGE_SIZE) > #endif > +#endif > + > > #define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1) > #define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask)) > diff --git a/include/babeltrace/compat/mman.h b/include/babeltrace/compat/mman.h > new file mode 100644 > index 0000000..a004b1e > --- /dev/null > +++ b/include/babeltrace/compat/mman.h > @@ -0,0 +1,24 @@ > +#ifndef _BABELTRACE_INCLUDE_COMPAT_MMAN_H > +#define _BABELTRACE_INCLUDE_COMPAT_MMAN_H > + > +#ifdef __MINGW32__ > + > +#define PROT_READ 0x1 > +#define PROT_WRITE 0x2 > +#define PROT_EXEC 0x4 > +#define PROT_NONE 0x0 > + > +#define MAP_SHARED 0x01 > +#define MAP_PRIVATE 0x02 > +#define MAP_FAILED ((void *) -1) > + > +/* mmap for mingw32 */ > +void *mmap (void *ptr, long size, long prot, long type, long handle, long arg); > +/* munmap for mingw32 */ > +long munmap (void *ptr, long size); > + > +#else > +#include > +#endif > + > +#endif /* _BABELTRACE_INCLUDE_COMPAT_MMAN_H */ > diff --git a/include/babeltrace/ctf-text/types.h b/include/babeltrace/ctf-text/types.h > index 7b4b717..c528355 100644 > --- a/include/babeltrace/ctf-text/types.h > +++ b/include/babeltrace/ctf-text/types.h > @@ -27,7 +27,7 @@ > * SOFTWARE. > */ > > -#include > +#include > #include > #include > #include > diff --git a/include/babeltrace/mmap-align.h b/include/babeltrace/mmap-align.h > index f7c18fa..3d90c85 100644 > --- a/include/babeltrace/mmap-align.h > +++ b/include/babeltrace/mmap-align.h > @@ -27,7 +27,7 @@ > > #include > #include > -#include > +#include > > /* > * This header implements a wrapper over mmap (mmap_align) that memory > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon May 13 16:20:28 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 13 May 2013 16:20:28 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 25/28] Replace mkdir with compat_mkdir In-Reply-To: <009B25148989C6458484484699278506E537E9CA@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E9CA@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 8:05 AM, Ikaheimonen, JP wrote: > The MinGW implementation of mkdir only accepts one parameter. > Replace mkdir with compat_mkdir that in MinGW will ignore the > parameters after the first one. > --- > converter/babeltrace-log.c | 2 +- > include/babeltrace/compat/fcntl.h | 27 +++++++++++++++++++++++++++ > 2 files changed, 28 insertions(+), 1 deletion(-) > > diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c > index ac3bb3f..f997aad 100644 > --- a/converter/babeltrace-log.c > +++ b/converter/babeltrace-log.c > @@ -332,7 +332,7 @@ int main(int argc, char **argv) > exit(EXIT_SUCCESS); > } > > - ret = mkdir(s_outputname, S_IRWXU|S_IRWXG); > + ret = compat_mkdir(s_outputname, S_IRWXU|S_IRWXG); Not sure about this... A mkdir macro dropping the second parameter might be more appropriate. > if (ret) { > perror("mkdir"); > goto error; > diff --git a/include/babeltrace/compat/fcntl.h b/include/babeltrace/compat/fcntl.h > index f58a1bf..167353c 100644 > --- a/include/babeltrace/compat/fcntl.h > +++ b/include/babeltrace/compat/fcntl.h > @@ -6,6 +6,18 @@ > #include > #include > > +#ifndef S_IRGRP > +#define S_IRGRP 0 > +#endif > + > +#ifndef S_IWGRP > +#define S_IWGRP 0 > +#endif > + > +#ifndef S_IRWXG > +#define S_IRWXG 0 > +#endif > + > #ifdef __MINGW32__ > static inline > int posix_fallocate(int fd, off_t offset, off_t len) > @@ -68,4 +80,19 @@ int compat_closedirfd(int dirfd) > #endif > } > > +static inline > +int compat_mkdir(const char *pathname, ...) > +{ > +#ifdef __MINGW32__ > + return mkdir(pathname); > +#else > + mode_t mode = 0; > + va_list args; > + va_start (args, pathname); > + mode = (mode_t)va_arg(args, int); > + va_end(args); > + return mkdir(pathname, mode); > +#endif > +} > + > #endif > \ No newline at end of file > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon May 13 16:20:32 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 13 May 2013 16:20:32 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 19/28] Add MinGW implementation of posix_fallocate In-Reply-To: <009B25148989C6458484484699278506E537E962@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E962@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 8:00 AM, Ikaheimonen, JP wrote: > Add dummy MinGW implementation of posix_fallocate. > The implementation does not do anything, and always returns zero. > --- > formats/ctf/ctf.c | 2 +- > include/babeltrace/compat/fcntl.h | 13 +++++++++++++ > 2 files changed, 14 insertions(+), 1 deletion(-) > create mode 100644 include/babeltrace/compat/fcntl.h > > diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c > index c29fcd7..431b2d4 100644 > --- a/formats/ctf/ctf.c > +++ b/formats/ctf/ctf.c > @@ -41,7 +41,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > diff --git a/include/babeltrace/compat/fcntl.h b/include/babeltrace/compat/fcntl.h > new file mode 100644 > index 0000000..0707c28 > --- /dev/null > +++ b/include/babeltrace/compat/fcntl.h > @@ -0,0 +1,13 @@ > +#ifndef _BABELTRACE_INCLUDE_COMPAT_FCNTL_H > +#define _BABELTRACE_INCLUDE_COMPAT_FCNTL_H > + > +#include > +#ifdef __MINGW32__ > +static inline > +int posix_fallocate(int fd, off_t offset, off_t len) > +{ This functionality can be achieved using SetFilePointerEx/SetEndOfFile on Windows. > + return 0; > +} > +#endif > + > +#endif > \ No newline at end of file > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon May 13 16:20:37 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 13 May 2013 16:20:37 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 18/28] Add MinGW implementation of strnlen In-Reply-To: <009B25148989C6458484484699278506E537E951@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E951@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 8:00 AM, Ikaheimonen, JP wrote: > --- > compat/compat_strlib.c | 23 +++++++++++++++++++++++ > formats/ctf/types/string.c | 2 +- > include/babeltrace/compat/string.h | 1 + > 3 files changed, 25 insertions(+), 1 deletion(-) > > diff --git a/compat/compat_strlib.c b/compat/compat_strlib.c > index 3cbd455..980a8f5 100644 > --- a/compat/compat_strlib.c > +++ b/compat/compat_strlib.c > @@ -50,6 +50,29 @@ int strerror_r(int errnum, char *buf, size_t buflen) > buf[buflen - 1] = '\0'; > return 0; > } > + > +size_t strnlen(const char *str, size_t maxlen) > +{ Any reason you are not using the native strnlen? I'm fairly sure it is available on Windows. I know MinGW does not provide some standard function prototypes (may or may not be the case here)... I think finding the function's address explicitly would be more appropriate here (using GetProcAddress on msvcrt.dll). > + char * ptr; > + size_t len; > + ptr = (char *)str; > + len = 0; > + > + /* while there still are characters in the string */ > + while(*ptr != '\0') { > + /* increment counter */ > + len++; > + /* check that we do not exceed the given maximum */ > + if (len == maxlen) { > + return len; > + } > + /* next character */ > + ptr++; > + > + } > + return len; > +} > + > #endif > > int compat_strerror_r(int errnum, char *buf, size_t buflen) > diff --git a/formats/ctf/types/string.c b/formats/ctf/types/string.c > index a2433bf..a2f513d 100644 > --- a/formats/ctf/types/string.c > +++ b/formats/ctf/types/string.c > @@ -29,7 +29,7 @@ > #include > #include > #include /* C99 limits */ > -#include > +#include > > int ctf_string_read(struct bt_stream_pos *ppos, struct bt_definition *definition) > { > diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h > index 501d003..82f411e 100644 > --- a/include/babeltrace/compat/string.h > +++ b/include/babeltrace/compat/string.h > @@ -5,6 +5,7 @@ > > #ifdef __MINGW32__ > char *strtok_r(char *str, const char *delim, char **nextp); > +size_t strnlen(const char *str, size_t maxlen); > #endif > > int compat_strerror_r(int errnum, char *buf, size_t buflen); > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon May 13 16:20:41 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 13 May 2013 16:20:41 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 16/28] Add MinGW implementation of strtok_r In-Reply-To: <009B25148989C6458484484699278506E537E92F@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E92F@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 7:57 AM, Ikaheimonen, JP wrote: > --- > compat/compat_strlib.c | 40 ++++++++++++++++++++++++++++++++++++++ > converter/babeltrace.c | 2 +- > include/babeltrace/compat/string.h | 4 ++++ > 3 files changed, 45 insertions(+), 1 deletion(-) > > diff --git a/compat/compat_strlib.c b/compat/compat_strlib.c > index 7413e74..3cbd455 100644 > --- a/compat/compat_strlib.c > +++ b/compat/compat_strlib.c > @@ -1,6 +1,46 @@ > #include > > #ifdef __MINGW32__ > + > +char* strtok_r( Any reason you can't use strtok_s? > + char *str, > + const char *delim, > + char **nextp) > +{ > + char *ret; > + > + /* if str is NULL, continue from nextp */ > + if (str == NULL) { > + str = *nextp; > + } > + /* skip the leading delimiter characters */ > + str += strspn(str, delim); > + > + /* return NULL if all are delimiters */ > + if (*str == '\0') { > + return NULL; > + } > + /* return the pointer to the first character that is not delimiter */ > + ret = str; > + > + /* scan to the next delimiter */ > + str += strcspn(str, delim); > + > + /* if we found a delimiter instead of a NUL */ > + if (*str) { > + /* replace the delimiter with the NUL */ > + *str = '\0'; > + /* next time, scan from the character after NUL */ > + *nextp = str + 1; > + } > + else { > + /* end of string: next time, scan at the end (NUL) again */ > + *nextp = str; > + } > + > + return ret; > +} > + > int strerror_r(int errnum, char *buf, size_t buflen) > { > /* non-recursive implementation of strerror_r */ > diff --git a/converter/babeltrace.c b/converter/babeltrace.c > index 7b3db49..f4a9217 100644 > --- a/converter/babeltrace.c > +++ b/converter/babeltrace.c > @@ -49,7 +49,7 @@ > #include > #include > #include > -#include > +#include > > #include /* for clocks */ > > diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h > index 8591b7e..501d003 100644 > --- a/include/babeltrace/compat/string.h > +++ b/include/babeltrace/compat/string.h > @@ -3,6 +3,10 @@ > > #include > > +#ifdef __MINGW32__ > +char *strtok_r(char *str, const char *delim, char **nextp); > +#endif > + > int compat_strerror_r(int errnum, char *buf, size_t buflen); > > #endif > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon May 13 16:20:47 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 13 May 2013 16:20:47 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 14/28] Add MinGW implementation of fpathconf In-Reply-To: <009B25148989C6458484484699278506E537E90D@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E90D@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 7:55 AM, Ikaheimonen, JP wrote: > The MinGW implementation of fpathconf will always return MAX_PATH. > --- > formats/ctf/ctf.c | 2 +- > include/babeltrace/compat/unistd.h | 21 +++++++++++++++++++++ > 2 files changed, 22 insertions(+), 1 deletion(-) > create mode 100644 include/babeltrace/compat/unistd.h > > diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c > index 255a492..c29fcd7 100644 > --- a/formats/ctf/ctf.c > +++ b/formats/ctf/ctf.c > @@ -44,7 +44,7 @@ > #include > #include > #include > -#include > +#include > #include > > #include "metadata/ctf-scanner.h" > diff --git a/include/babeltrace/compat/unistd.h b/include/babeltrace/compat/unistd.h > new file mode 100644 > index 0000000..f275b22 > --- /dev/null > +++ b/include/babeltrace/compat/unistd.h > @@ -0,0 +1,21 @@ > +#ifndef _BABELTRACE_INCLUDE_COMPAT_UNISTD_H > +#define _BABELTRACE_INCLUDE_COMPAT_UNISTD_H > + > +#include > + > +#ifndef _PC_NAME_MAX > +#define _PC_NAME_MAX 0 > +#endif > + > +#ifdef __MINGW32__ > + > +static inline > +int fpathconf (int fd, int name) > +{ > + /* dummy function that always returns MAX_PATH */ > + return MAX_PATH; > +} > + > +#endif > + > +#endif > \ No newline at end of file ^ This file is missing a new-line character at the end. > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon May 13 16:20:51 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 13 May 2013 16:20:51 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 12/28] Add MinGW implementation of localtime_r In-Reply-To: <009B25148989C6458484484699278506E537E8E9@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E8E9@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 7:53 AM, Ikaheimonen, JP wrote: > --- > include/babeltrace/compat/time.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/babeltrace/compat/time.h b/include/babeltrace/compat/time.h > index ccfc860..d5cb7fd 100644 > --- a/include/babeltrace/compat/time.h > +++ b/include/babeltrace/compat/time.h > @@ -15,5 +15,13 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result) > return result; > } > > +static inline > +struct tm *localtime_r(const time_t *timep, struct tm *result) > +{ > + struct tm * r; > + r = localtime(timep); > + memcpy(result, r, sizeof (struct tm)); > + return result; > +} Why not use localtime_s? > #endif > #endif > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon May 13 16:20:56 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 13 May 2013 16:20:56 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 11/28] Add MinGW implementation of gmtime_r In-Reply-To: <009B25148989C6458484484699278506E537E8D8@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E8D8@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 7:52 AM, Ikaheimonen, JP wrote: > Add a (non-recursive) implementation of gmtime_r as it is > missing in the MinGW standard library. > Implementation is written in file include/babeltrace/compat/time.h > which must be included in the source files that call gmtime_r. > --- > formats/ctf/ctf.c | 1 + > include/babeltrace/compat/time.h | 19 +++++++++++++++++++ > 2 files changed, 20 insertions(+) > create mode 100644 include/babeltrace/compat/time.h > > diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c > index 0cfad44..255a492 100644 > --- a/formats/ctf/ctf.c > +++ b/formats/ctf/ctf.c > @@ -52,6 +52,7 @@ > #include "metadata/ctf-ast.h" > #include "events-private.h" > #include "babeltrace/compat/memstream.h" > +#include > > #define LOG2_CHAR_BIT 3 > > diff --git a/include/babeltrace/compat/time.h b/include/babeltrace/compat/time.h > new file mode 100644 > index 0000000..ccfc860 > --- /dev/null > +++ b/include/babeltrace/compat/time.h > @@ -0,0 +1,19 @@ > +#ifndef _BABELTRACE_INCLUDE_COMPAT_TIME_H > +#define _BABELTRACE_INCLUDE_COMPAT_TIME_H > + > +#include > +#include > + > +#ifdef __MINGW32__ > + > +static inline > +struct tm *gmtime_r(const time_t *timep, struct tm *result) > +{ > + struct tm * r; > + r = gmtime(timep); > + memcpy(result, r, sizeof (struct tm)); > + return result; > +} Why not use gmtime_s? Inverting the arguments should do the trick. > + > +#endif > +#endif > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon May 13 16:21:01 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 13 May 2013 16:21:01 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 10/28] Memstream functions for MinGW32 In-Reply-To: <009B25148989C6458484484699278506E537E8C7@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E8C7@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 7:51 AM, Ikaheimonen, JP wrote: > In Windows, you cannot unlink a file while it is still in use, > so we won't even try. > Add a Windows-specific implementation of mkstemp, which provides a > temporary file in the correct Windows directory. The temporary > file is opened with such flags that it will be deleted once it's closed. > --- > compat/Makefile.am | 2 +- > compat/compat_stdlib.c | 22 ++++++++++++++++++++++ > include/babeltrace/compat/memstream.h | 18 ++++++++++++++---- > include/babeltrace/compat/stdlib.h | 11 +++++++++++ > 4 files changed, 48 insertions(+), 5 deletions(-) > create mode 100644 compat/compat_stdlib.c > create mode 100644 include/babeltrace/compat/stdlib.h > > diff --git a/compat/Makefile.am b/compat/Makefile.am > index e573854..e5a41d9 100644 > --- a/compat/Makefile.am > +++ b/compat/Makefile.am > @@ -9,5 +9,5 @@ libcompat_la_LDFLAGS = \ > -Wl,--no-as-needed > > if BABELTRACE_BUILD_WITH_MINGW > -libcompat_la_SOURCES += compat_mman.c compat_uuid.c > +libcompat_la_SOURCES += compat_mman.c compat_uuid.c compat_stdlib.c > endif > diff --git a/compat/compat_stdlib.c b/compat/compat_stdlib.c > new file mode 100644 > index 0000000..51a032c > --- /dev/null > +++ b/compat/compat_stdlib.c > @@ -0,0 +1,22 @@ > +/* This file is only built under MINGW32 */ > + > +#include > +#include > + > +int mkstemp(char *template) > +{ > + char tempPath[MAX_PATH]; > + char tmpname[MAX_PATH]; > + HANDLE file; > + > + extern int _open_osfhandle(int *, int); > + > + /* Ignore the template. Use Windows calls to create a temporary file whose name begins with BBT */ > + GetTempPath(MAX_PATH, tempPath); > + GetTempFileName(tempPath, "BBT", 0, tmpname); > + > + file = CreateFile(tmpname, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, > + NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, NULL); > + > + return _open_osfhandle((int *)file, 0); > +} > diff --git a/include/babeltrace/compat/memstream.h b/include/babeltrace/compat/memstream.h > index d2a96cb..44bc30c 100644 > --- a/include/babeltrace/compat/memstream.h > +++ b/include/babeltrace/compat/memstream.h > @@ -1,5 +1,5 @@ > -#ifndef _BABELTRACE_FORMAT_CTF_MEMSTREAM_H > -#define _BABELTRACE_FORMAT_CTF_MEMSTREAM_H > +#ifndef _BABELTRACE_COMPAT_MEMSTREAM_H > +#define _BABELTRACE_COMPAT_MEMSTREAM_H > > /* > * format/ctf/memstream.h > @@ -41,7 +41,7 @@ FILE *babeltrace_fmemopen(void *buf, size_t size, const char *mode) > > #else /* BABELTRACE_HAVE_FMEMOPEN */ > > -#include > +#include > #include > > /* > @@ -85,10 +85,14 @@ FILE *babeltrace_fmemopen(void *buf, size_t size, const char *mode) > goto error_close; > } > /* We keep the handle open, but can unlink the file on the VFS. */ > + /* Unlinking under MINGW only gives an error, so let's not even try. */ unlink() is necessary; we don't want to leave temporary files lying around. Please define an "unlink" macro in a single place to override it instead of using numerous instances of "#ifndef __MINGW32__". > +#ifndef __MINGW32__ > ret = unlink(tmpname); > if (ret < 0) { > perror("unlink"); > } > +#endif > + > return fp; > > error_close: > @@ -97,10 +101,12 @@ error_close: > perror("close"); > } > error_unlink: > +#ifndef __MINGW32__ > ret = unlink(tmpname); > if (ret < 0) { > perror("unlink"); > } > +#endif > return NULL; > } > > @@ -154,17 +160,21 @@ FILE *babeltrace_open_memstream(char **ptr, size_t *sizeloc) > * with read from fp. No need to keep the file around, just the > * handle. > */ > +#ifndef __MINGW32__ > ret = unlink(tmpname); > if (ret < 0) { > perror("unlink"); > } > +#endif > return fp; > > error_unlink: > +#ifndef __MINGW32__ > ret = unlink(tmpname); > if (ret < 0) { > perror("unlink"); > } > +#endif > return NULL; > } > > @@ -233,4 +243,4 @@ error_free: > > #endif /* BABELTRACE_HAVE_OPEN_MEMSTREAM */ > > -#endif /* _BABELTRACE_FORMAT_CTF_MEMSTREAM_H */ > +#endif /* _BABELTRACE_COMPAT_MEMSTREAM_H */ > diff --git a/include/babeltrace/compat/stdlib.h b/include/babeltrace/compat/stdlib.h > new file mode 100644 > index 0000000..385fff1 > --- /dev/null > +++ b/include/babeltrace/compat/stdlib.h > @@ -0,0 +1,11 @@ > +#ifndef _BABELTRACE_COMPAT_STDLIB_H > +#define BABELTRACE_COMPAT_STDLIB_H > + > +#include > + > +#ifdef __MINGW32__ > +int mkstemp(char *template); > +#endif > + > +#endif > + > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon May 13 16:21:04 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 13 May 2013 16:21:04 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 09/28] Add MinGW implementation of strerror_r In-Reply-To: <009B25148989C6458484484699278506E537E8B6@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E8B6@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 7:50 AM, Ikaheimonen, JP wrote: > --- > compat/compat_strlib.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/compat/compat_strlib.c b/compat/compat_strlib.c > index 9aabb07..7413e74 100644 > --- a/compat/compat_strlib.c > +++ b/compat/compat_strlib.c > @@ -1,5 +1,17 @@ > #include > > +#ifdef __MINGW32__ > +int strerror_r(int errnum, char *buf, size_t buflen) > +{ > + /* non-recursive implementation of strerror_r */ Is there a reason you are not using Windows' strerror_s()? > + char * retbuf; > + retbuf = strerror(errnum); > + strncpy(buf, retbuf, buflen); > + buf[buflen - 1] = '\0'; > + return 0; > +} > +#endif > + > int compat_strerror_r(int errnum, char *buf, size_t buflen) > { > #if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon May 13 16:21:08 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 13 May 2013 16:21:08 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 03/28] Move build-specific strerror_r to compat directory In-Reply-To: <009B25148989C6458484484699278506E537E844@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E844@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 7:46 AM, Ikaheimonen, JP wrote: > Add a new source directory 'compat'. > In that directory, add a new file 'strlib.c'. > In that file, add a new function compat_strerror_r that encapsulates > the build-specific differences of strerror_r. > Where strerror_r is used, now use compat_strerror_r. > --- > Makefile.am | 2 +- > compat/Makefile.am | 10 ++++++++++ > compat/compat_strlib.c | 17 +++++++++++++++++ > configure.ac | 1 + > include/babeltrace/babeltrace-internal.h | 32 +++----------------------------- > include/babeltrace/compat/string.h | 9 +++++++++ > lib/Makefile.am | 3 ++- > 7 files changed, 43 insertions(+), 31 deletions(-) > create mode 100644 compat/Makefile.am > create mode 100644 compat/compat_strlib.c > create mode 100644 include/babeltrace/compat/string.h > > diff --git a/Makefile.am b/Makefile.am > index b25b58f..cdfad5a 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -2,7 +2,7 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include > > ACLOCAL_AMFLAGS = -I m4 > > -SUBDIRS = include types lib formats converter tests doc extras > +SUBDIRS = include types compat lib formats converter tests doc extras > > dist_doc_DATA = ChangeLog LICENSE mit-license.txt gpl-2.0.txt \ > std-ext-lib.txt > diff --git a/compat/Makefile.am b/compat/Makefile.am > new file mode 100644 > index 0000000..d756aa7 > --- /dev/null > +++ b/compat/Makefile.am > @@ -0,0 +1,10 @@ > +AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include > + > +lib_LTLIBRARIES = libcompat.la > + > +libcompat_la_SOURCES = \ > + compat_strlib.c > + > +libcompat_la_LDFLAGS = \ > + -Wl,--no-as-needed > + > diff --git a/compat/compat_strlib.c b/compat/compat_strlib.c > new file mode 100644 > index 0000000..9aabb07 > --- /dev/null > +++ b/compat/compat_strlib.c > @@ -0,0 +1,17 @@ > +#include > + > +int compat_strerror_r(int errnum, char *buf, size_t buflen) Is there a specific reason why you can't redefine this as a macro instead of changing the function's name? > +{ > +#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) > +/* XSI-compliant strerror_r */ > + return strerror_r(errnum, buf, buflen); > +#else > +/* GNU-compliant strerror_r */ > + char * retbuf; > + retbuf = strerror_r(errnum, buf, buflen); > + if (retbuf != buf) > + strcpy(buf, retbuf); > + return 0; > +#endif > +} > + > diff --git a/configure.ac b/configure.ac > index 83822d6..29366da 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -93,6 +93,7 @@ AC_SUBST(babeltracectfincludedir) > AC_CONFIG_FILES([ > Makefile > types/Makefile > + compat/Makefile > formats/Makefile > formats/ctf/Makefile > formats/ctf/types/Makefile > diff --git a/include/babeltrace/babeltrace-internal.h b/include/babeltrace/babeltrace-internal.h > index 22866bc..35382de 100644 > --- a/include/babeltrace/babeltrace-internal.h > +++ b/include/babeltrace/babeltrace-internal.h > @@ -27,7 +27,7 @@ > #include > #include > #include > -#include > +#include > > #define PERROR_BUFLEN 200 > > @@ -81,46 +81,20 @@ extern int babeltrace_verbose, babeltrace_debug; > perrorstr, \ > ## args) > > -#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) > - > #define _bt_printf_perror(fp, fmt, args...) \ > ({ \ > char buf[PERROR_BUFLEN] = "Error in strerror_r()"; \ > - strerror_r(errno, buf, sizeof(buf)); \ > + compat_strerror_r(errno, buf, sizeof(buf)); \ > _bt_printfe(fp, "error", buf, fmt, ## args); \ > }) > > #define _bt_printfl_perror(fp, lineno, fmt, args...) \ > ({ \ > char buf[PERROR_BUFLEN] = "Error in strerror_r()"; \ > - strerror_r(errno, buf, sizeof(buf)); \ > + compat_strerror_r(errno, buf, sizeof(buf)); \ > _bt_printfle(fp, "error", lineno, buf, fmt, ## args); \ > }) > > -#else > - > -/* > - * Version using GNU strerror_r, for linux with appropriate defines. > - */ > - > -#define _bt_printf_perror(fp, fmt, args...) \ > - ({ \ > - char *buf; \ > - char tmp[PERROR_BUFLEN] = "Error in strerror_r()"; \ > - buf = strerror_r(errno, tmp, sizeof(tmp)); \ > - _bt_printfe(fp, "error", buf, fmt, ## args); \ > - }) > - > -#define _bt_printfl_perror(fp, lineno, fmt, args...) \ > - ({ \ > - char *buf; \ > - char tmp[PERROR_BUFLEN] = "Error in strerror_r()"; \ > - buf = strerror_r(errno, tmp, sizeof(tmp)); \ > - _bt_printfle(fp, "error", lineno, buf, fmt, ## args); \ > - }) > - > -#endif > - > /* printf without lineno information */ > #define printf_fatal(fmt, args...) \ > _bt_printf(stderr, "fatal", fmt, ## args) > diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h > new file mode 100644 > index 0000000..8591b7e > --- /dev/null > +++ b/include/babeltrace/compat/string.h > @@ -0,0 +1,9 @@ > +#ifndef _BABELTRACE_COMPAT_STRING_H > +#define BABELTRACE_COMPAT_STRING_H > + > +#include > + > +int compat_strerror_r(int errnum, char *buf, size_t buflen); > + > +#endif > + > diff --git a/lib/Makefile.am b/lib/Makefile.am > index 7ffb164..fa470c0 100644 > --- a/lib/Makefile.am > +++ b/lib/Makefile.am > @@ -14,4 +14,5 @@ libbabeltrace_la_SOURCES = babeltrace.c \ > libbabeltrace_la_LDFLAGS = \ > -Wl,--no-as-needed \ > prio_heap/libprio_heap.la \ > - $(top_builddir)/types/libbabeltrace_types.la > + $(top_builddir)/types/libbabeltrace_types.la \ > + $(top_builddir)/compat/libcompat.la > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Mon May 13 16:21:15 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 13 May 2013 16:21:15 -0400 Subject: [lttng-dev] [babeltrace RFC PATCH 06/28] Add MinGW implementation of UUID In-Reply-To: <009B25148989C6458484484699278506E537E866@EU-MBX-01.mgc.mentorg.com> References: <009B25148989C6458484484699278506E537E866@EU-MBX-01.mgc.mentorg.com> Message-ID: On Thu, May 2, 2013 at 7:47 AM, Ikaheimonen, JP wrote: > Implementation of UUID functions for MinGW32, using Windows API. > --- > compat/Makefile.am | 3 ++ > compat/compat_uuid.c | 75 ++++++++++++++++++++++++++++++++++++++++ > configure.ac | 5 ++- > include/babeltrace/compat/uuid.h | 32 ++++++++++++++++- > 4 files changed, 113 insertions(+), 2 deletions(-) > create mode 100644 compat/compat_uuid.c > > diff --git a/compat/Makefile.am b/compat/Makefile.am > index d756aa7..e624a79 100644 > --- a/compat/Makefile.am > +++ b/compat/Makefile.am > @@ -8,3 +8,6 @@ libcompat_la_SOURCES = \ > libcompat_la_LDFLAGS = \ > -Wl,--no-as-needed > > +if BABELTRACE_BUILD_WITH_MINGW > +libcompat_la_SOURCES += compat_uuid.c > +endif > \ No newline at end of file > diff --git a/compat/compat_uuid.c b/compat/compat_uuid.c > new file mode 100644 > index 0000000..0e67f73 > --- /dev/null > +++ b/compat/compat_uuid.c > @@ -0,0 +1,75 @@ > +/* This file is only built under MINGW32 */ > + > +#include > +#include > +#include > + > +static void fix_uuid_endian(struct UUID * uuid) > +{ > + unsigned char * ptr; > + unsigned char tmp; > + #define SWAP(p, i, j) tmp=*(p+i);*(p+i)=*(p+j);*(p+j)=tmp; > + ptr = (unsigned char *)uuid; > + SWAP(ptr, 0, 3) > + SWAP(ptr, 1, 2) > + SWAP(ptr, 4, 5) > + SWAP(ptr, 6, 7) > + > +} > + > +int compat_uuid_generate(unsigned char *uuid_out) > +{ > + RPC_STATUS status; > + status = UuidCreate((struct UUID *)uuid_out); > + if (status == RPC_S_OK) > + return 0; > + else > + return -1; > +} > + > +int compat_uuid_unparse(const unsigned char *uuid_in, char *str_out) > +{ > + RPC_STATUS status; > + unsigned char *alloc_str; > + int ret; > + fix_uuid_endian(uuid_in); > + status = UuidToString((struct UUID *)uuid_in, &alloc_str); > + fix_uuid_endian(uuid_in); > + if (status == RPC_S_OK) { > + strcpy(str_out, alloc_str); > + ret = 0; > + } else { > + ret = -1; > + } > + RpcStringFree(alloc_str); > + return ret; > +} > + > +int compat_uuid_parse(const char *str_in, unsigned char *uuid_out) > +{ > + RPC_STATUS status; > + > + status = UuidFromString(str_in, (struct UUID *)uuid_out); > + fix_uuid_endian(uuid_out); > + > + if (status == RPC_S_OK) > + return 0; > + else > + return -1; > +} > + > +int compat_uuid_compare(const unsigned char *uuid_a, > + const unsigned char *uuid_b) > +{ > + RPC_STATUS status; > + int ret; > + > + if (UuidCompare((struct UUID *)uuid_a, (struct UUID *)uuid_b, &status) == 0) > + ret = 0; > + else > + { > + ret = -1; > + } > + return ret; > + > +} > diff --git a/configure.ac b/configure.ac > index 65e867c..5f9e38d 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -60,7 +60,10 @@ AC_CHECK_LIB([uuid], [uuid_generate], > have_libc_uuid=yes > ], > [ > - AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.]) > + # for MinGW32 we have our own internal implemenation of uuid using Windows functions. > + if test "x$MINGW32" = xno; then > + AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.]) > + fi > ]) > ] > ) > diff --git a/include/babeltrace/compat/uuid.h b/include/babeltrace/compat/uuid.h > index 2ce7467..a916a49 100644 > --- a/include/babeltrace/compat/uuid.h > +++ b/include/babeltrace/compat/uuid.h > @@ -122,8 +122,38 @@ int babeltrace_uuid_compare(const unsigned char *uuid_a, > return -1; > } > > +#elif defined(__MINGW32__) > +static inline > +int babeltrace_uuid_generate(unsigned char *uuid_out) > +{ > + extern int compat_uuid_generate(unsigned char *uuid_out); > + return compat_uuid_generate(uuid_out); > +} > + > +static inline > +int babeltrace_uuid_unparse(const unsigned char *uuid_in, char *str_out) > +{ > + extern int compat_uuid_unparse(const unsigned char *uuid_in, char *str_out); > + return compat_uuid_unparse(uuid_in, str_out); > +} > + > +static inline > +int babeltrace_uuid_parse(const char *str_in, unsigned char *uuid_out) > +{ > + extern int compat_uuid_parse(const char *str_in, unsigned char *uuid_out); > + return compat_uuid_parse(str_in, uuid_out); > +} > + > +static inline > +int babeltrace_uuid_compare(const unsigned char *uuid_a, > + const unsigned char *uuid_b) > +{ > + extern int compat_uuid_compare(const unsigned char *uuid_a, > + const unsigned char *uuid_b); > + return compat_uuid_compare(uuid_a, uuid_b); > +} > #else > #error "Babeltrace needs to have a UUID generator configured." > #endif > > -#endif /* _BABELTRACE_UUID_H */ > +#endif /* _BABELTRACE_INCLUDE_COMPAT_UUID_H */ Please change this at the beginning of the file too. > -- > 1.8.1.msysgit.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Mon May 13 16:27:16 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 13 May 2013 16:27:16 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Add wrappers for pipe Message-ID: <1368476836-13803-1-git-send-email-dgoulet@efficios.com> This is to help use pipes in a way where partial read/write and EINTR are handled in one single call site. Two new files are created, pipe.c/.h which are part of libcommon. The open, close, read_close, write_close, read and write calls are implemented using a custom lttng_pipe data structure and protected by operation's mutex. A destroy function is also available to cleanup memory once done with a pipe. Signed-off-by: David Goulet --- src/common/Makefile.am | 3 +- src/common/pipe.c | 362 ++++++++++++++++++++++++++++++++++++++++++++++++ src/common/pipe.h | 76 ++++++++++ 3 files changed, 440 insertions(+), 1 deletion(-) create mode 100644 src/common/pipe.c create mode 100644 src/common/pipe.h diff --git a/src/common/Makefile.am b/src/common/Makefile.am index f2ea40a..6ba6c2b 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -13,7 +13,8 @@ noinst_HEADERS = lttng-kernel.h defaults.h macros.h error.h futex.h \ noinst_LTLIBRARIES = libcommon.la libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \ - common.h futex.c futex.h uri.c uri.h defaults.c + common.h futex.c futex.h uri.c uri.h defaults.c \ + pipe.c pipe.h libcommon_la_LIBADD = -luuid # Consumer library diff --git a/src/common/pipe.c b/src/common/pipe.c new file mode 100644 index 0000000..713db97 --- /dev/null +++ b/src/common/pipe.c @@ -0,0 +1,362 @@ +/* + * Copyright (C) 2013 - David Goulet + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License, version 2 only, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#define _GNU_SOURCE +#include +#include +#include + +#include + +#include "pipe.h" + +/* + * Lock read side of a pipe. + */ +static void lock_read_side(struct lttng_pipe *pipe) +{ + pthread_mutex_lock(&pipe->read_mutex); +} + +/* + * Unlock read side of a pipe. + */ +static void unlock_read_side(struct lttng_pipe *pipe) +{ + pthread_mutex_unlock(&pipe->read_mutex); +} + +/* + * Lock write side of a pipe. + */ +static void lock_write_side(struct lttng_pipe *pipe) +{ + pthread_mutex_lock(&pipe->write_mutex); +} + +/* + * Unlock write side of a pipe. + */ +static void unlock_write_side(struct lttng_pipe *pipe) +{ + pthread_mutex_unlock(&pipe->write_mutex); +} + +/* + * Internal function. Close read side of pipe WITHOUT locking the mutex. + * + * Return 0 on success else a negative errno from close(2). + */ +static int _pipe_read_close(struct lttng_pipe *pipe) +{ + int ret, ret_val = 0; + + assert(pipe); + + if (!lttng_pipe_is_read_open(pipe)) { + goto end; + } + + do { + ret = close(pipe->fd[0]); + } while (ret < 0 && errno == EINTR); + if (ret < 0) { + PERROR("close lttng read pipe"); + ret_val = -errno; + } + pipe->r_state = LTTNG_PIPE_STATE_CLOSED; + +end: + return ret_val; +} + +/* + * Internal function. Close write side of pipe WITHOUT locking the mutex. + * + * Return 0 on success else a negative errno from close(2). + */ +static int _pipe_write_close(struct lttng_pipe *pipe) +{ + int ret, ret_val = 0; + + assert(pipe); + + if (!lttng_pipe_is_write_open(pipe)) { + goto end; + } + + do { + ret = close(pipe->fd[1]); + } while (ret < 0 && errno == EINTR); + if (ret < 0) { + PERROR("close lttng write pipe"); + ret_val = -errno; + } + pipe->w_state = LTTNG_PIPE_STATE_CLOSED; + +end: + return ret_val; +} + + +/* + * Open a new lttng pipe and set flags using fcntl(). + * + * Return a newly allocated lttng pipe on success or else NULL. + */ +struct lttng_pipe *lttng_pipe_open(int flags) +{ + int ret; + struct lttng_pipe *p; + + p = zmalloc(sizeof(*p)); + if (!p) { + PERROR("zmalloc pipe open"); + goto error; + } + + ret = pipe(p->fd); + if (ret < 0) { + PERROR("lttng pipe"); + goto error; + } + + if (flags) { + int i; + + for (i = 0; i < 2; i++) { + ret = fcntl(p->fd[i], F_SETFD, flags); + if (ret < 0) { + PERROR("fcntl lttng pipe %d", flags); + goto error; + } + } + } + + pthread_mutex_init(&p->read_mutex, NULL); + pthread_mutex_init(&p->write_mutex, NULL); + p->r_state = LTTNG_PIPE_STATE_OPENED; + p->w_state = LTTNG_PIPE_STATE_OPENED; + p->flags = flags; + + return p; + +error: + lttng_pipe_destroy(p); + return NULL; +} + +/* + * Close read side of a lttng pipe. + * + * Return 0 on success else a negative value. + */ +int lttng_pipe_read_close(struct lttng_pipe *pipe) +{ + int ret; + + assert(pipe); + + /* Handle read side first. */ + lock_read_side(pipe); + ret = _pipe_read_close(pipe); + unlock_read_side(pipe); + + return ret; +} + +/* + * Close write side of a lttng pipe. + * + * Return 0 on success else a negative value. + */ +int lttng_pipe_write_close(struct lttng_pipe *pipe) +{ + int ret; + + assert(pipe); + + lock_write_side(pipe); + ret = _pipe_write_close(pipe); + unlock_write_side(pipe); + + return ret; +} + +/* + * Close both read and write side of a lttng pipe. + * + * Return 0 on success else a negative value. + */ +int lttng_pipe_close(struct lttng_pipe *pipe) +{ + int ret, ret_val = 0; + + assert(pipe); + + ret = lttng_pipe_read_close(pipe); + if (ret < 0) { + ret_val = ret; + } + + ret = lttng_pipe_write_close(pipe); + if (ret < 0) { + ret_val = ret; + } + + return ret_val; +} + +/* + * Close and destroy a lttng pipe object. Finally, pipe is freed. + */ +void lttng_pipe_destroy(struct lttng_pipe *pipe) +{ + int ret; + + if (!pipe) { + return; + } + + /* + * Destroy should *never* be called with a locked mutex. These must always + * succeed so we unlock them after the close pipe below. + */ + ret = pthread_mutex_trylock(&pipe->read_mutex); + assert(!ret); + ret = pthread_mutex_trylock(&pipe->write_mutex); + assert(!ret); + + /* Close pipes WITHOUT trying to lock the pipes. */ + (void) _pipe_read_close(pipe); + (void) _pipe_write_close(pipe); + + unlock_read_side(pipe); + unlock_write_side(pipe); + + (void) pthread_mutex_destroy(&pipe->read_mutex); + (void) pthread_mutex_destroy(&pipe->write_mutex); + + free(pipe); +} + +/* + * Read on a lttng pipe and put the data in buf of at least size count. + * + * Return 0 on success or else a negative errno message from read(2). + */ +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count) +{ + ssize_t ret, read_len, read_left, index; + + assert(pipe); + assert(buf); + + lock_read_side(pipe); + + if (!lttng_pipe_is_read_open(pipe)) { + ret = -EBADF; + goto error; + } + + read_left = count; + index = 0; + do { + read_len = read(pipe->fd[0], buf + index, read_left); + if (read_len < 0) { + ret = -errno; + if (errno == EINTR) { + /* Read again. */ + continue; + } else if (errno == EAGAIN || errno == EWOULDBLOCK) { + /* + * Return the number of bytes read up to this point if any. + */ + if (index) { + ret = index; + } + goto error; + } else { + PERROR("lttng pipe read"); + goto error; + } + } + read_left -= read_len; + index += read_len; + } while (read_left > 0); + + /* Everything went fine. */ + ret = index; + +error: + unlock_read_side(pipe); + return ret; +} + +/* + * Write on a lttng pipe using the data in buf and size of count. + * + * Return 0 on success or else a negative errno message from write(2). + */ +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, + size_t count) +{ + ssize_t ret, write_len, write_left, index; + + assert(pipe); + assert(buf); + + lock_write_side(pipe); + + if (!lttng_pipe_is_write_open(pipe)) { + ret = -EBADF; + goto error; + } + + write_left = count; + index = 0; + do { + write_len = write(pipe->fd[1], buf + index, write_left); + if (write_len < 0) { + ret = -errno; + if (errno == EINTR) { + /* Read again. */ + continue; + } else if (errno == EAGAIN || errno == EWOULDBLOCK) { + /* + * Return the number of bytes read up to this point if any. + */ + if (index) { + ret = index; + } + goto error; + } else { + PERROR("lttng pipe write"); + goto error; + } + } + write_left -= write_len; + index += write_len; + } while (write_left > 0); + + /* Everything went fine. */ + ret = index; + +error: + unlock_write_side(pipe); + return ret; +} diff --git a/src/common/pipe.h b/src/common/pipe.h new file mode 100644 index 0000000..acd05d8 --- /dev/null +++ b/src/common/pipe.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2013 - David Goulet + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License, version 2 only, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef LTTNG_PIPE_H +#define LTTNG_PIPE_H + +#include + +enum lttng_pipe_state { + LTTNG_PIPE_STATE_OPENED = 1, + LTTNG_PIPE_STATE_CLOSED = 2, +}; + +struct lttng_pipe { + /* Read: 0, Write: 1. */ + int fd[2]; + /* + * Flags of the pipe once opened. pipe(2) specifies either O_NONBLOCK or + * O_CLOEXEC can be used. Flags are set using fcntl(2) call. + */ + int flags; + + /* + * These states are protected by the operation mutex below. + */ + enum lttng_pipe_state r_state; + enum lttng_pipe_state w_state; + + /* Held for each read(2) operation. */ + pthread_mutex_t read_mutex; + /* Held for each write(2) operation. */ + pthread_mutex_t write_mutex; +}; + +/* + * Return 1 if read side is open else 0. + */ +static inline int lttng_pipe_is_read_open(struct lttng_pipe *pipe) +{ + return pipe->r_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0; +} + +/* + * Return 1 if write side is open else 0. + */ +static inline int lttng_pipe_is_write_open(struct lttng_pipe *pipe) +{ + return pipe->w_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0; +} + +struct lttng_pipe *lttng_pipe_open(int flags); +int lttng_pipe_write_close(struct lttng_pipe *pipe); +int lttng_pipe_read_close(struct lttng_pipe *pipe); +/* Close both side of pipe. */ +int lttng_pipe_close(struct lttng_pipe *pipe); +void lttng_pipe_destroy(struct lttng_pipe *pipe); + +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count); +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, + size_t count); + +#endif /* LTTNG_PIPE_H */ -- 1.7.10.4 From mathieu.desnoyers at efficios.com Mon May 13 16:42:20 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 13 May 2013 16:42:20 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Add wrappers for pipe In-Reply-To: <1368476836-13803-1-git-send-email-dgoulet@efficios.com> References: <1368476836-13803-1-git-send-email-dgoulet@efficios.com> Message-ID: <20130513204220.GA8716@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > This is to help use pipes in a way where partial read/write and EINTR > are handled in one single call site. > > Two new files are created, pipe.c/.h which are part of libcommon. The > open, close, read_close, write_close, read and write calls are > implemented using a custom lttng_pipe data structure and protected by > operation's mutex. A destroy function is also available to cleanup > memory once done with a pipe. Acked-by: Mathieu Desnoyers > > Signed-off-by: David Goulet > --- > src/common/Makefile.am | 3 +- > src/common/pipe.c | 362 ++++++++++++++++++++++++++++++++++++++++++++++++ > src/common/pipe.h | 76 ++++++++++ > 3 files changed, 440 insertions(+), 1 deletion(-) > create mode 100644 src/common/pipe.c > create mode 100644 src/common/pipe.h > > diff --git a/src/common/Makefile.am b/src/common/Makefile.am > index f2ea40a..6ba6c2b 100644 > --- a/src/common/Makefile.am > +++ b/src/common/Makefile.am > @@ -13,7 +13,8 @@ noinst_HEADERS = lttng-kernel.h defaults.h macros.h error.h futex.h \ > noinst_LTLIBRARIES = libcommon.la > > libcommon_la_SOURCES = error.h error.c utils.c utils.h runas.c runas.h \ > - common.h futex.c futex.h uri.c uri.h defaults.c > + common.h futex.c futex.h uri.c uri.h defaults.c \ > + pipe.c pipe.h > libcommon_la_LIBADD = -luuid > > # Consumer library > diff --git a/src/common/pipe.c b/src/common/pipe.c > new file mode 100644 > index 0000000..713db97 > --- /dev/null > +++ b/src/common/pipe.c > @@ -0,0 +1,362 @@ > +/* > + * Copyright (C) 2013 - David Goulet > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License, version 2 only, as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, but WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > + * more details. > + * > + * You should have received a copy of the GNU General Public License along with > + * this program; if not, write to the Free Software Foundation, Inc., 51 > + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +#define _GNU_SOURCE > +#include > +#include > +#include > + > +#include > + > +#include "pipe.h" > + > +/* > + * Lock read side of a pipe. > + */ > +static void lock_read_side(struct lttng_pipe *pipe) > +{ > + pthread_mutex_lock(&pipe->read_mutex); > +} > + > +/* > + * Unlock read side of a pipe. > + */ > +static void unlock_read_side(struct lttng_pipe *pipe) > +{ > + pthread_mutex_unlock(&pipe->read_mutex); > +} > + > +/* > + * Lock write side of a pipe. > + */ > +static void lock_write_side(struct lttng_pipe *pipe) > +{ > + pthread_mutex_lock(&pipe->write_mutex); > +} > + > +/* > + * Unlock write side of a pipe. > + */ > +static void unlock_write_side(struct lttng_pipe *pipe) > +{ > + pthread_mutex_unlock(&pipe->write_mutex); > +} > + > +/* > + * Internal function. Close read side of pipe WITHOUT locking the mutex. > + * > + * Return 0 on success else a negative errno from close(2). > + */ > +static int _pipe_read_close(struct lttng_pipe *pipe) > +{ > + int ret, ret_val = 0; > + > + assert(pipe); > + > + if (!lttng_pipe_is_read_open(pipe)) { > + goto end; > + } > + > + do { > + ret = close(pipe->fd[0]); > + } while (ret < 0 && errno == EINTR); > + if (ret < 0) { > + PERROR("close lttng read pipe"); > + ret_val = -errno; > + } > + pipe->r_state = LTTNG_PIPE_STATE_CLOSED; > + > +end: > + return ret_val; > +} > + > +/* > + * Internal function. Close write side of pipe WITHOUT locking the mutex. > + * > + * Return 0 on success else a negative errno from close(2). > + */ > +static int _pipe_write_close(struct lttng_pipe *pipe) > +{ > + int ret, ret_val = 0; > + > + assert(pipe); > + > + if (!lttng_pipe_is_write_open(pipe)) { > + goto end; > + } > + > + do { > + ret = close(pipe->fd[1]); > + } while (ret < 0 && errno == EINTR); > + if (ret < 0) { > + PERROR("close lttng write pipe"); > + ret_val = -errno; > + } > + pipe->w_state = LTTNG_PIPE_STATE_CLOSED; > + > +end: > + return ret_val; > +} > + > + > +/* > + * Open a new lttng pipe and set flags using fcntl(). > + * > + * Return a newly allocated lttng pipe on success or else NULL. > + */ > +struct lttng_pipe *lttng_pipe_open(int flags) > +{ > + int ret; > + struct lttng_pipe *p; > + > + p = zmalloc(sizeof(*p)); > + if (!p) { > + PERROR("zmalloc pipe open"); > + goto error; > + } > + > + ret = pipe(p->fd); > + if (ret < 0) { > + PERROR("lttng pipe"); > + goto error; > + } > + > + if (flags) { > + int i; > + > + for (i = 0; i < 2; i++) { > + ret = fcntl(p->fd[i], F_SETFD, flags); > + if (ret < 0) { > + PERROR("fcntl lttng pipe %d", flags); > + goto error; > + } > + } > + } > + > + pthread_mutex_init(&p->read_mutex, NULL); > + pthread_mutex_init(&p->write_mutex, NULL); > + p->r_state = LTTNG_PIPE_STATE_OPENED; > + p->w_state = LTTNG_PIPE_STATE_OPENED; > + p->flags = flags; > + > + return p; > + > +error: > + lttng_pipe_destroy(p); > + return NULL; > +} > + > +/* > + * Close read side of a lttng pipe. > + * > + * Return 0 on success else a negative value. > + */ > +int lttng_pipe_read_close(struct lttng_pipe *pipe) > +{ > + int ret; > + > + assert(pipe); > + > + /* Handle read side first. */ > + lock_read_side(pipe); > + ret = _pipe_read_close(pipe); > + unlock_read_side(pipe); > + > + return ret; > +} > + > +/* > + * Close write side of a lttng pipe. > + * > + * Return 0 on success else a negative value. > + */ > +int lttng_pipe_write_close(struct lttng_pipe *pipe) > +{ > + int ret; > + > + assert(pipe); > + > + lock_write_side(pipe); > + ret = _pipe_write_close(pipe); > + unlock_write_side(pipe); > + > + return ret; > +} > + > +/* > + * Close both read and write side of a lttng pipe. > + * > + * Return 0 on success else a negative value. > + */ > +int lttng_pipe_close(struct lttng_pipe *pipe) > +{ > + int ret, ret_val = 0; > + > + assert(pipe); > + > + ret = lttng_pipe_read_close(pipe); > + if (ret < 0) { > + ret_val = ret; > + } > + > + ret = lttng_pipe_write_close(pipe); > + if (ret < 0) { > + ret_val = ret; > + } > + > + return ret_val; > +} > + > +/* > + * Close and destroy a lttng pipe object. Finally, pipe is freed. > + */ > +void lttng_pipe_destroy(struct lttng_pipe *pipe) > +{ > + int ret; > + > + if (!pipe) { > + return; > + } > + > + /* > + * Destroy should *never* be called with a locked mutex. These must always > + * succeed so we unlock them after the close pipe below. > + */ > + ret = pthread_mutex_trylock(&pipe->read_mutex); > + assert(!ret); > + ret = pthread_mutex_trylock(&pipe->write_mutex); > + assert(!ret); > + > + /* Close pipes WITHOUT trying to lock the pipes. */ > + (void) _pipe_read_close(pipe); > + (void) _pipe_write_close(pipe); > + > + unlock_read_side(pipe); > + unlock_write_side(pipe); > + > + (void) pthread_mutex_destroy(&pipe->read_mutex); > + (void) pthread_mutex_destroy(&pipe->write_mutex); > + > + free(pipe); > +} > + > +/* > + * Read on a lttng pipe and put the data in buf of at least size count. > + * > + * Return 0 on success or else a negative errno message from read(2). > + */ > +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count) > +{ > + ssize_t ret, read_len, read_left, index; > + > + assert(pipe); > + assert(buf); > + > + lock_read_side(pipe); > + > + if (!lttng_pipe_is_read_open(pipe)) { > + ret = -EBADF; > + goto error; > + } > + > + read_left = count; > + index = 0; > + do { > + read_len = read(pipe->fd[0], buf + index, read_left); > + if (read_len < 0) { > + ret = -errno; > + if (errno == EINTR) { > + /* Read again. */ > + continue; > + } else if (errno == EAGAIN || errno == EWOULDBLOCK) { > + /* > + * Return the number of bytes read up to this point if any. > + */ > + if (index) { > + ret = index; > + } > + goto error; > + } else { > + PERROR("lttng pipe read"); > + goto error; > + } > + } > + read_left -= read_len; > + index += read_len; > + } while (read_left > 0); > + > + /* Everything went fine. */ > + ret = index; > + > +error: > + unlock_read_side(pipe); > + return ret; > +} > + > +/* > + * Write on a lttng pipe using the data in buf and size of count. > + * > + * Return 0 on success or else a negative errno message from write(2). > + */ > +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, > + size_t count) > +{ > + ssize_t ret, write_len, write_left, index; > + > + assert(pipe); > + assert(buf); > + > + lock_write_side(pipe); > + > + if (!lttng_pipe_is_write_open(pipe)) { > + ret = -EBADF; > + goto error; > + } > + > + write_left = count; > + index = 0; > + do { > + write_len = write(pipe->fd[1], buf + index, write_left); > + if (write_len < 0) { > + ret = -errno; > + if (errno == EINTR) { > + /* Read again. */ > + continue; > + } else if (errno == EAGAIN || errno == EWOULDBLOCK) { > + /* > + * Return the number of bytes read up to this point if any. > + */ > + if (index) { > + ret = index; > + } > + goto error; > + } else { > + PERROR("lttng pipe write"); > + goto error; > + } > + } > + write_left -= write_len; > + index += write_len; > + } while (write_left > 0); > + > + /* Everything went fine. */ > + ret = index; > + > +error: > + unlock_write_side(pipe); > + return ret; > +} > diff --git a/src/common/pipe.h b/src/common/pipe.h > new file mode 100644 > index 0000000..acd05d8 > --- /dev/null > +++ b/src/common/pipe.h > @@ -0,0 +1,76 @@ > +/* > + * Copyright (C) 2013 - David Goulet > + * > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License, version 2 only, as > + * published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, but WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > + * more details. > + * > + * You should have received a copy of the GNU General Public License along with > + * this program; if not, write to the Free Software Foundation, Inc., 51 > + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +#ifndef LTTNG_PIPE_H > +#define LTTNG_PIPE_H > + > +#include > + > +enum lttng_pipe_state { > + LTTNG_PIPE_STATE_OPENED = 1, > + LTTNG_PIPE_STATE_CLOSED = 2, > +}; > + > +struct lttng_pipe { > + /* Read: 0, Write: 1. */ > + int fd[2]; > + /* > + * Flags of the pipe once opened. pipe(2) specifies either O_NONBLOCK or > + * O_CLOEXEC can be used. Flags are set using fcntl(2) call. > + */ > + int flags; > + > + /* > + * These states are protected by the operation mutex below. > + */ > + enum lttng_pipe_state r_state; > + enum lttng_pipe_state w_state; > + > + /* Held for each read(2) operation. */ > + pthread_mutex_t read_mutex; > + /* Held for each write(2) operation. */ > + pthread_mutex_t write_mutex; > +}; > + > +/* > + * Return 1 if read side is open else 0. > + */ > +static inline int lttng_pipe_is_read_open(struct lttng_pipe *pipe) > +{ > + return pipe->r_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0; > +} > + > +/* > + * Return 1 if write side is open else 0. > + */ > +static inline int lttng_pipe_is_write_open(struct lttng_pipe *pipe) > +{ > + return pipe->w_state == LTTNG_PIPE_STATE_OPENED ? 1 : 0; > +} > + > +struct lttng_pipe *lttng_pipe_open(int flags); > +int lttng_pipe_write_close(struct lttng_pipe *pipe); > +int lttng_pipe_read_close(struct lttng_pipe *pipe); > +/* Close both side of pipe. */ > +int lttng_pipe_close(struct lttng_pipe *pipe); > +void lttng_pipe_destroy(struct lttng_pipe *pipe); > + > +ssize_t lttng_pipe_read(struct lttng_pipe *pipe, void *buf, size_t count); > +ssize_t lttng_pipe_write(struct lttng_pipe *pipe, const void *buf, > + size_t count); > + > +#endif /* LTTNG_PIPE_H */ > -- > 1.7.10.4 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From Daniel.Thibault at drdc-rddc.gc.ca Mon May 13 16:58:50 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Mon, 13 May 2013 20:58:50 +0000 Subject: [lttng-dev] User-space tracing by the root lttng-sessiond Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D1201A@VAL-E-02.valcartier.drdc-rddc.gc.ca> I ran a little experiment whose results surprised me. Using a non-tracing group user account, I first made sure I had a root lttng-sessiond running and a user-space lttng-sessiond. In the first I set up a trace for some kernel events plus all user-space events. In the second I set up a trace for all user-space events only. Both traces were started, then the lttng-ust/doc/examples/easy-ust/sample demo was run to generate the user-space events. Then both traces were stopped and destroyed. I noted there were three lttng-consumerd daemons: one in user-space, the other two owned by root. Presumably one is servicing the kernel events while the other is servicing the user-space events. (Question: If there were several users active at once, would there be several root user-space lttng-consumerd daemons or still just one?) As expected, both traces show the sample user-space events (with no losses, it turns out). What surprised me, however, is that the pairs of events were not in synch. Since they're all coming out of the same trace provider, I would expect the time-stamp to be issued once (by the tracepoint provider), and then two copies of the event to go into the two trace buffers for eventual storage. Could it be that the tracepoint provider instead issues two separate events, one for each of its clients? (For the record, the pairs of events were out of synch by at least 4187 ns (670 times out of 100 000), and as much as 3 326 405 ns (once); in 93% of the time root event lags after the user-space event) This seems problematic to me, since multiple traces capturing the same event won't be able to reconcile their copies with each other. Daniel U. Thibault Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure Qu?bec QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?| Government of Canada From christian.babeux at efficios.com Mon May 13 17:51:03 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Mon, 13 May 2013 17:51:03 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Tests: Remove unused utils.h header Message-ID: <1368481863-10412-1-git-send-email-christian.babeux@efficios.com> Signed-off-by: Christian Babeux --- tests/utils/Makefile.am | 4 ++-- tests/utils/utils.h | 43 ------------------------------------------- 2 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 tests/utils/utils.h diff --git a/tests/utils/Makefile.am b/tests/utils/Makefile.am index 1b362fc..25c6e04 100644 --- a/tests/utils/Makefile.am +++ b/tests/utils/Makefile.am @@ -1,4 +1,4 @@ SUBDIRS = tap -EXTRA_DIST = utils.sh utils.h test_utils.py -dist_noinst_SCRIPTS = utils.sh utils.h test_utils.py +EXTRA_DIST = utils.sh test_utils.py +dist_noinst_SCRIPTS = utils.sh test_utils.py diff --git a/tests/utils/utils.h b/tests/utils/utils.h deleted file mode 100644 index 94891c0..0000000 --- a/tests/utils/utils.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) - 2011 David Goulet - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by as - * published by the Free Software Foundation; only version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include - -#define BRIGHT 1 -#define GREEN 32 -#define RED 31 - -#define PRINT_OK() \ -do { \ - /* Check for color support */ \ - if (isatty(STDOUT_FILENO)) { \ - printf("%c[%d;%dmOK%c[%dm\n", 0x1B, BRIGHT, GREEN, 0x1B, 0); \ - } else { \ - printf("OK\n"); \ - } \ -} while (0) - -#define PRINT_FAIL() \ -do { \ - /* Check for color support */ \ - if (isatty(STDOUT_FILENO)) { \ - printf("%c[%d;%dmFAIL%c[%dm\n", 0x1B, BRIGHT, RED, 0x1B, 0); \ - } else { \ - printf("FAIL\n"); \ - } \ -} while (0) -- 1.8.2.2 From alexmonthy at voxpopuli.im Mon May 13 17:57:28 2013 From: alexmonthy at voxpopuli.im (Alexandre Montplaisir) Date: Mon, 13 May 2013 17:57:28 -0400 Subject: [lttng-dev] [PATCH] Fix linker library order In-Reply-To: <20130512025917.GB405@Krystal> References: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> <20130512025917.GB405@Krystal> Message-ID: <519161C8.5000305@voxpopuli.im> On 13-05-11 10:59 PM, Mathieu Desnoyers wrote: > * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: >> Libraries must be specified after the binary target. > merged, thanks! > > Mathieu This seems to have broken the daily PPA packages: https://launchpadlibrarian.net/139804087/buildlog_ubuntu-saucy-amd64.lttng-ust_2.2~pre-0%2Bbzr1574%2Bpack37%2B201305131247~saucy1_FAILEDTOBUILD.txt.gz That package has no particular patches. If I build it locally from source it builds fine, but if I build the package locally (with dpkg-buildpackage), I get the same error. It could be related to the --as-needed problem we've had before... Cheers, Alex > >> Signed-off-by: Francis Giraldeau >> --- >> doc/examples/demo/Makefile | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile >> index 7ae6547..bbc8ccb 100644 >> --- a/doc/examples/demo/Makefile >> +++ b/doc/examples/demo/Makefile >> @@ -55,7 +55,7 @@ demo.o: demo.c >> $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< >> >> demo: demo.o >> - $(CC) -o $@ $(LIBS) $^ >> + $(CC) -o $@ $^ $(LIBS) >> >> .PHONY: clean >> clean: >> -- >> 1.8.1.2 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From christian.babeux at efficios.com Mon May 13 18:30:51 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Mon, 13 May 2013 18:30:51 -0400 Subject: [lttng-dev] [PATCH lttng-tools 1/6] Tests: Cleanup and move gen-ust-events testapp under utils Message-ID: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> This will improve the maintainability and stop the copying madness going on in each test needing a UST sample application. Application under test should go in tests/utils/testapp//. Signed-off-by: Christian Babeux --- configure.ac | 2 + tests/utils/Makefile.am | 2 +- tests/utils/testapp/Makefile.am | 2 + tests/utils/testapp/gen-ust-events/Makefile.am | 15 ++++++ .../utils/testapp/gen-ust-events/gen-ust-events.c | 58 ++++++++++++++++++++++ tests/utils/testapp/gen-ust-events/tp.c | 15 ++++++ tests/utils/testapp/gen-ust-events/tp.h | 56 +++++++++++++++++++++ 7 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 tests/utils/testapp/Makefile.am create mode 100644 tests/utils/testapp/gen-ust-events/Makefile.am create mode 100644 tests/utils/testapp/gen-ust-events/gen-ust-events.c create mode 100644 tests/utils/testapp/gen-ust-events/tp.c create mode 100644 tests/utils/testapp/gen-ust-events/tp.h diff --git a/configure.ac b/configure.ac index 650ae7f..9f14c12 100644 --- a/configure.ac +++ b/configure.ac @@ -341,6 +341,8 @@ AC_CONFIG_FILES([ tests/unit/Makefile tests/utils/Makefile tests/utils/tap/Makefile + tests/utils/testapp/Makefile + tests/utils/testapp/gen-ust-events/Makefile ]) AC_OUTPUT diff --git a/tests/utils/Makefile.am b/tests/utils/Makefile.am index 25c6e04..e0de483 100644 --- a/tests/utils/Makefile.am +++ b/tests/utils/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = tap +SUBDIRS = tap testapp EXTRA_DIST = utils.sh test_utils.py dist_noinst_SCRIPTS = utils.sh test_utils.py diff --git a/tests/utils/testapp/Makefile.am b/tests/utils/testapp/Makefile.am new file mode 100644 index 0000000..8b631ee --- /dev/null +++ b/tests/utils/testapp/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = gen-ust-events + diff --git a/tests/utils/testapp/gen-ust-events/Makefile.am b/tests/utils/testapp/gen-ust-events/Makefile.am new file mode 100644 index 0000000..1be5835 --- /dev/null +++ b/tests/utils/testapp/gen-ust-events/Makefile.am @@ -0,0 +1,15 @@ +AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(srcdir) -O2 -g +AM_LDFLAGS = + +if LTTNG_TOOLS_BUILD_WITH_LIBDL +AM_LDFLAGS += -ldl +endif +if LTTNG_TOOLS_BUILD_WITH_LIBC_DL +AM_LDFLAGS += -lc +endif + +if HAVE_LIBLTTNG_UST_CTL +noinst_PROGRAMS = gen-ust-events +gen_ust_events_SOURCES = gen-ust-events.c tp.c tp.h +gen_ust_events_LDADD = -llttng-ust +endif diff --git a/tests/utils/testapp/gen-ust-events/gen-ust-events.c b/tests/utils/testapp/gen-ust-events/gen-ust-events.c new file mode 100644 index 0000000..edf40ee --- /dev/null +++ b/tests/utils/testapp/gen-ust-events/gen-ust-events.c @@ -0,0 +1,58 @@ +/* + * Copyright (C) - 2012 David Goulet + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define TRACEPOINT_DEFINE +#include "tp.h" + +int main(int argc, char **argv) +{ + int i, netint; + long values[] = { 1, 2, 3 }; + char text[10] = "test"; + double dbl = 2.0; + float flt = 2222.0; + unsigned int nr_iter = 100; + useconds_t nr_usec = 0; + + if (argc >= 2) { + nr_iter = atoi(argv[1]); + } + + if (argc == 3) { + /* By default, don't wait unless user specifies. */ + nr_usec = atoi(argv[2]); + } + + for (i = 0; i < nr_iter; i++) { + netint = htonl(i); + tracepoint(tp, tptest, i, netint, values, text, strlen(text), + dbl, flt); + usleep(nr_usec); + } + + return 0; +} diff --git a/tests/utils/testapp/gen-ust-events/tp.c b/tests/utils/testapp/gen-ust-events/tp.c new file mode 100644 index 0000000..a09561d --- /dev/null +++ b/tests/utils/testapp/gen-ust-events/tp.c @@ -0,0 +1,15 @@ +/* + * Copyright (c) - 2012 David Goulet + * + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR + * IMPLIED. ANY USE IS AT YOUR OWN RISK. + * + * Permission is hereby granted to use or copy this program for any purpose, + * provided the above notices are retained on all copies. Permission to modify + * the code and to distribute modified code is granted, provided the above + * notices are retained, and a notice that the code was modified is included + * with the above copyright notice. + */ + +#define TRACEPOINT_CREATE_PROBES +#include "tp.h" diff --git a/tests/utils/testapp/gen-ust-events/tp.h b/tests/utils/testapp/gen-ust-events/tp.h new file mode 100644 index 0000000..6ffbc32 --- /dev/null +++ b/tests/utils/testapp/gen-ust-events/tp.h @@ -0,0 +1,56 @@ +#undef TRACEPOINT_PROVIDER +#define TRACEPOINT_PROVIDER tp + +#if !defined(_TRACEPOINT_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ) +#define _TRACEPOINT_TP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Copyright (C) 2011 Mathieu Desnoyers + * + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED + * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. + * + * Permission is hereby granted to use or copy this program + * for any purpose, provided the above notices are retained on all copies. + * Permission to modify the code and to distribute modified code is granted, + * provided the above notices are retained, and a notice that the code was + * modified is included with the above copyright notice. + */ + +#include + +TRACEPOINT_EVENT(tp, tptest, + TP_ARGS(int, anint, int, netint, long *, values, + char *, text, size_t, textlen, + double, doublearg, float, floatarg), + TP_FIELDS( + ctf_integer(int, intfield, anint) + ctf_integer_hex(int, intfield2, anint) + ctf_integer(long, longfield, anint) + ctf_integer_network(int, netintfield, netint) + ctf_integer_network_hex(int, netintfieldhex, netint) + ctf_array(long, arrfield1, values, 3) + ctf_array_text(char, arrfield2, text, 10) + ctf_sequence(char, seqfield1, text, size_t, textlen) + ctf_sequence_text(char, seqfield2, text, size_t, textlen) + ctf_string(stringfield, text) + ctf_float(float, floatfield, floatarg) + ctf_float(double, doublefield, doublearg) + ) +) + +#endif /* _TRACEPOINT_TP_H */ + +#undef TRACEPOINT_INCLUDE_FILE +#define TRACEPOINT_INCLUDE_FILE ./tp.h + +/* This part must be outside ifdef protection */ +#include + +#ifdef __cplusplus +} +#endif -- 1.8.2.2 From christian.babeux at efficios.com Mon May 13 18:30:52 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Mon, 13 May 2013 18:30:52 -0400 Subject: [lttng-dev] [PATCH lttng-tools 2/6] Tests: Replace usage of gen-ust-events testapp in streaming tests In-Reply-To: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> References: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1368484256-6666-2-git-send-email-christian.babeux@efficios.com> Use the gen-ust-events binary found under tests/utils/testapp/gen-ust-events/. Signed-off-by: Christian Babeux --- tests/regression/tools/streaming/Makefile.am | 16 ------ tests/regression/tools/streaming/gen-ust-events.c | 59 ---------------------- .../tools/streaming/test_high_throughput_limits | 12 +++-- tests/regression/tools/streaming/test_ust | 16 +++--- tests/regression/tools/streaming/tp.c | 15 ------ tests/regression/tools/streaming/tp.h | 56 -------------------- 6 files changed, 17 insertions(+), 157 deletions(-) delete mode 100644 tests/regression/tools/streaming/gen-ust-events.c delete mode 100644 tests/regression/tools/streaming/tp.c delete mode 100644 tests/regression/tools/streaming/tp.h diff --git a/tests/regression/tools/streaming/Makefile.am b/tests/regression/tools/streaming/Makefile.am index e424350..050cdea 100644 --- a/tests/regression/tools/streaming/Makefile.am +++ b/tests/regression/tools/streaming/Makefile.am @@ -1,18 +1,2 @@ -AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(srcdir) -O2 -g -AM_LDFLAGS = - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -AM_LDFLAGS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -AM_LDFLAGS += -lc -endif - -if HAVE_LIBLTTNG_UST_CTL -noinst_PROGRAMS = gen-ust-events -gen_ust_events_SOURCES = gen-ust-events.c tp.c tp.h -gen_ust_events_LDADD = -llttng-ust -endif - noinst_SCRIPTS = test_ust test_kernel test_high_throughput_limits EXTRA_DIST = test_ust test_kernel test_high_throughput_limits diff --git a/tests/regression/tools/streaming/gen-ust-events.c b/tests/regression/tools/streaming/gen-ust-events.c deleted file mode 100644 index 1385119..0000000 --- a/tests/regression/tools/streaming/gen-ust-events.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) - 2012 David Goulet - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define TRACEPOINT_DEFINE -#include "tp.h" - -int main(int argc, char **argv) -{ - int i, netint; - long values[] = { 1, 2, 3 }; - char text[10] = "test"; - double dbl = 2.0; - float flt = 2222.0; - /* Generate 30 events. */ - unsigned int nr_iter = 100; - useconds_t nr_usec = 0; - - if (argc >= 2) { - nr_iter = atoi(argv[1]); - } - - if (argc == 3) { - /* By default, don't wait unless user specifies. */ - nr_usec = atoi(argv[2]); - } - - for (i = 0; i < nr_iter; i++) { - netint = htonl(i); - tracepoint(tp, tptest, i, netint, values, text, strlen(text), dbl, - flt); - usleep(nr_usec); - } - - return 0; -} diff --git a/tests/regression/tools/streaming/test_high_throughput_limits b/tests/regression/tools/streaming/test_high_throughput_limits index f3885a8..b2c8864 100755 --- a/tests/regression/tools/streaming/test_high_throughput_limits +++ b/tests/regression/tools/streaming/test_high_throughput_limits @@ -22,7 +22,9 @@ CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../../.. NR_APP_ITER=10 NR_ITER=1000000 -BIN_NAME="gen-ust-events" +TESTAPP_PATH="$TESTDIR/utils/testapp" +TESTAPP_NAME="gen-ust-events" +TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="high-throughput" EVENT_NAME="tp:tptest" SESSIOND_CTRL_PORT=5342 @@ -35,8 +37,8 @@ NUM_TESTS=112 source $TESTDIR/utils/utils.sh -if [ ! -x "$CURDIR/$BIN_NAME" ]; then - BAIL_OUT "No UST nevents binary detected." +if [ ! -x "$TESTAPP_BIN" ]; then + BAIL_OUT "No UST events binary detected." fi function set_bw_limit @@ -89,13 +91,13 @@ function run_apps # due to very slow communication between the consumer and relayd making # the status reply from the consumer quite slow thus delaying the # registration done message. - LTTNG_UST_REGISTER_TIMEOUT=-1 ./$CURDIR/$BIN_NAME $NR_ITER & >/dev/null 2>&1 + LTTNG_UST_REGISTER_TIMEOUT=-1 $TESTAPP_BIN $NR_ITER & >/dev/null 2>&1 done } function wait_apps { - while [ -n "$(pidof $BIN_NAME)" ]; do + while [ -n "$(pidof $TESTAPP_NAME)" ]; do sleep 1 done pass "Wait for applications to end" diff --git a/tests/regression/tools/streaming/test_ust b/tests/regression/tools/streaming/test_ust index 333b2e9..785a9a8 100755 --- a/tests/regression/tools/streaming/test_ust +++ b/tests/regression/tools/streaming/test_ust @@ -18,7 +18,11 @@ TEST_DESC="Streaming - User space tracing" CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../../.. -BIN_NAME="gen-ust-events" +NR_ITER=5 +NR_USEC_WAIT=1000000 +TESTAPP_PATH="$TESTDIR/utils/testapp" +TESTAPP_NAME="gen-ust-events" +TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="stream" EVENT_NAME="tp:tptest" PID_RELAYD=0 @@ -29,8 +33,8 @@ NUM_TESTS=18 source $TESTDIR/utils/utils.sh -if [ ! -x "$CURDIR/$BIN_NAME" ]; then - BAIL_OUT "No UST nevents binary detected." +if [ ! -x "$TESTAPP_BIN" ]; then + BAIL_OUT "No UST events binary detected." fi function lttng_create_session_uri @@ -42,7 +46,7 @@ function lttng_create_session_uri function wait_apps { - while [ -n "$(pidof $BIN_NAME)" ]; do + while [ -n "$(pidof $TESTAPP_NAME)" ]; do sleep 0.5 done pass "Wait for applications to end" @@ -57,7 +61,7 @@ function test_ust_before_start () enable_ust_lttng_event $SESSION_NAME $EVENT_NAME # Run 5 times with a 1 second delay - ./$CURDIR/$BIN_NAME 5 1000000 >/dev/null 2>&1 & + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 & start_lttng_tracing $SESSION_NAME @@ -75,7 +79,7 @@ function test_ust_after_start () start_lttng_tracing $SESSION_NAME # Run 5 times with a 1 second delay - ./$CURDIR/$BIN_NAME 5 1000000 >/dev/null 2>&1 & + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 & wait_apps diff --git a/tests/regression/tools/streaming/tp.c b/tests/regression/tools/streaming/tp.c deleted file mode 100644 index a09561d..0000000 --- a/tests/regression/tools/streaming/tp.c +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) - 2012 David Goulet - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR - * IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any purpose, - * provided the above notices are retained on all copies. Permission to modify - * the code and to distribute modified code is granted, provided the above - * notices are retained, and a notice that the code was modified is included - * with the above copyright notice. - */ - -#define TRACEPOINT_CREATE_PROBES -#include "tp.h" diff --git a/tests/regression/tools/streaming/tp.h b/tests/regression/tools/streaming/tp.h deleted file mode 100644 index 6ffbc32..0000000 --- a/tests/regression/tools/streaming/tp.h +++ /dev/null @@ -1,56 +0,0 @@ -#undef TRACEPOINT_PROVIDER -#define TRACEPOINT_PROVIDER tp - -#if !defined(_TRACEPOINT_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ) -#define _TRACEPOINT_TP_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Copyright (C) 2011 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - */ - -#include - -TRACEPOINT_EVENT(tp, tptest, - TP_ARGS(int, anint, int, netint, long *, values, - char *, text, size_t, textlen, - double, doublearg, float, floatarg), - TP_FIELDS( - ctf_integer(int, intfield, anint) - ctf_integer_hex(int, intfield2, anint) - ctf_integer(long, longfield, anint) - ctf_integer_network(int, netintfield, netint) - ctf_integer_network_hex(int, netintfieldhex, netint) - ctf_array(long, arrfield1, values, 3) - ctf_array_text(char, arrfield2, text, 10) - ctf_sequence(char, seqfield1, text, size_t, textlen) - ctf_sequence_text(char, seqfield2, text, size_t, textlen) - ctf_string(stringfield, text) - ctf_float(float, floatfield, floatarg) - ctf_float(double, doublefield, doublearg) - ) -) - -#endif /* _TRACEPOINT_TP_H */ - -#undef TRACEPOINT_INCLUDE_FILE -#define TRACEPOINT_INCLUDE_FILE ./tp.h - -/* This part must be outside ifdef protection */ -#include - -#ifdef __cplusplus -} -#endif -- 1.8.2.2 From christian.babeux at efficios.com Mon May 13 18:30:53 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Mon, 13 May 2013 18:30:53 -0400 Subject: [lttng-dev] [PATCH lttng-tools 3/6] Tests: Replace usage of gen-ust-events testapp in ust before-after test In-Reply-To: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> References: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1368484256-6666-3-git-send-email-christian.babeux@efficios.com> Use the gen-ust-events binary found under tests/utils/testapp/gen-ust-events/. Signed-off-by: Christian Babeux --- tests/regression/ust/before-after/Makefile.am | 14 ------ tests/regression/ust/before-after/gen-nevents.c | 56 ---------------------- .../regression/ust/before-after/test_before_after | 14 +++--- tests/regression/ust/before-after/tp.c | 16 ------- .../regression/ust/before-after/ust_gen_nevents.h | 56 ---------------------- 5 files changed, 8 insertions(+), 148 deletions(-) delete mode 100644 tests/regression/ust/before-after/gen-nevents.c delete mode 100644 tests/regression/ust/before-after/tp.c delete mode 100644 tests/regression/ust/before-after/ust_gen_nevents.h diff --git a/tests/regression/ust/before-after/Makefile.am b/tests/regression/ust/before-after/Makefile.am index f883a32..e37fe96 100644 --- a/tests/regression/ust/before-after/Makefile.am +++ b/tests/regression/ust/before-after/Makefile.am @@ -1,16 +1,2 @@ -AM_CFLAGS = -I$(srcdir) -O2 -AM_LDFLAGS = -llttng-ust - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -AM_LDFLAGS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -AM_LDFLAGS += -lc -endif - -noinst_PROGRAMS = gen-nevents -gen_nevents_SOURCES = gen-nevents.c tp.c ust_gen_nevents.h -gen_nevents_LDADD = -llttng-ust - noinst_SCRIPTS = test_before_after EXTRA_DIST = test_before_after diff --git a/tests/regression/ust/before-after/gen-nevents.c b/tests/regression/ust/before-after/gen-nevents.c deleted file mode 100644 index b2c1992..0000000 --- a/tests/regression/ust/before-after/gen-nevents.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) - 2009 Pierre-Marc Fournier - * Copyright (C) - 2011 Mathieu Desnoyers - * Copyright (C) - 2012 David Goulet - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define TRACEPOINT_DEFINE -#include "ust_gen_nevents.h" - -int main(int argc, char **argv) -{ - int i, netint; - long values[] = { 1, 2, 3 }; - char text[10] = "test"; - double dbl = 2.0; - float flt = 2222.0; - unsigned int nr_iter = 100; - - if (argc == 2) { - nr_iter = atoi(argv[1]); - } - - for (i = 0; i < nr_iter; i++) { - netint = htonl(i); - tracepoint(ust_gen_nevents, tptest, i, netint, values, text, - strlen(text), dbl, flt); - usleep(100000); - } - - return 0; -} diff --git a/tests/regression/ust/before-after/test_before_after b/tests/regression/ust/before-after/test_before_after index c3e24f7..6d45bb5 100755 --- a/tests/regression/ust/before-after/test_before_after +++ b/tests/regression/ust/before-after/test_before_after @@ -19,27 +19,29 @@ TEST_DESC="UST tracer - Start tracing before and after execution" CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../../.. NR_ITER=100 +NR_USEC_WAIT=100000 +TESTAPP_PATH="$TESTDIR/utils/testapp" +TESTAPP_NAME="gen-ust-events" +TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="per-session" -EVENT_NAME="ust_gen_nevents:tptest" +EVENT_NAME="tp:tptest" NUM_TESTS=16 source $TESTDIR/utils/utils.sh -if [ ! -x "$CURDIR/gen-nevents" ]; then +if [ ! -x "$TESTAPP_BIN" ]; then BAIL_OUT "No UST nevents binary detected." fi # MUST set TESTDIR before calling those functions test_before_apps() { - local out - # BEFORE application is spawned create_lttng_session $SESSION_NAME $TRACE_PATH enable_ust_lttng_event $SESSION_NAME $EVENT_NAME start_lttng_tracing $SESSION_NAME - ./$CURDIR/gen-nevents $NR_ITER + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ok $? "Start application to trace" stop_lttng_tracing $SESSION_NAME @@ -53,7 +55,7 @@ test_before_apps() { test_after_apps() { local out - ./$CURDIR/gen-nevents 100 & + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & ok $? "Start application to trace" # BEFORE application is spawned diff --git a/tests/regression/ust/before-after/tp.c b/tests/regression/ust/before-after/tp.c deleted file mode 100644 index e291924..0000000 --- a/tests/regression/ust/before-after/tp.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) - 2011 Mathieu Desnoyers - * Copyright (c) - 2012 David Goulet - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR - * IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any purpose, - * provided the above notices are retained on all copies. Permission to modify - * the code and to distribute modified code is granted, provided the above - * notices are retained, and a notice that the code was modified is included - * with the above copyright notice. - */ - -#define TRACEPOINT_CREATE_PROBES -#include "ust_gen_nevents.h" diff --git a/tests/regression/ust/before-after/ust_gen_nevents.h b/tests/regression/ust/before-after/ust_gen_nevents.h deleted file mode 100644 index bc09c44..0000000 --- a/tests/regression/ust/before-after/ust_gen_nevents.h +++ /dev/null @@ -1,56 +0,0 @@ -#undef TRACEPOINT_PROVIDER -#define TRACEPOINT_PROVIDER ust_gen_nevents - -#if !defined(_TRACEPOINT_UST_GEN_NEVENTS_H) || defined(TRACEPOINT_HEADER_MULTI_READ) -#define _TRACEPOINT_UST_GEN_NEVENTS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Copyright (C) 2011 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - */ - -#include - -TRACEPOINT_EVENT(ust_gen_nevents, tptest, - TP_ARGS(int, anint, int, netint, long *, values, - char *, text, size_t, textlen, - double, doublearg, float, floatarg), - TP_FIELDS( - ctf_integer(int, intfield, anint) - ctf_integer_hex(int, intfield2, anint) - ctf_integer(long, longfield, anint) - ctf_integer_network(int, netintfield, netint) - ctf_integer_network_hex(int, netintfieldhex, netint) - ctf_array(long, arrfield1, values, 3) - ctf_array_text(char, arrfield2, text, 10) - ctf_sequence(char, seqfield1, text, size_t, textlen) - ctf_sequence_text(char, seqfield2, text, size_t, textlen) - ctf_string(stringfield, text) - ctf_float(float, floatfield, floatarg) - ctf_float(double, doublefield, doublearg) - ) -) - -#endif /* _TRACEPOINT_UST_GEN_NEVENTS_H */ - -#undef TRACEPOINT_INCLUDE_FILE -#define TRACEPOINT_INCLUDE_FILE ./ust_gen_nevents.h - -/* This part must be outside ifdef protection */ -#include - -#ifdef __cplusplus -} -#endif -- 1.8.2.2 From christian.babeux at efficios.com Mon May 13 18:30:54 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Mon, 13 May 2013 18:30:54 -0400 Subject: [lttng-dev] [PATCH lttng-tools 4/6] Tests: Replace usage of gen-ust-events testapp in ust buffers-uid test In-Reply-To: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> References: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1368484256-6666-4-git-send-email-christian.babeux@efficios.com> Use the gen-ust-events binary found under tests/utils/testapp/gen-ust-events/. Signed-off-by: Christian Babeux --- tests/regression/ust/buffers-uid/Makefile.am | 14 ------ tests/regression/ust/buffers-uid/gen-nevents.c | 56 ---------------------- tests/regression/ust/buffers-uid/test_buffers_uid | 24 ++++++---- tests/regression/ust/buffers-uid/tp.c | 16 ------- tests/regression/ust/buffers-uid/ust_gen_nevents.h | 56 ---------------------- 5 files changed, 14 insertions(+), 152 deletions(-) delete mode 100644 tests/regression/ust/buffers-uid/gen-nevents.c delete mode 100644 tests/regression/ust/buffers-uid/tp.c delete mode 100644 tests/regression/ust/buffers-uid/ust_gen_nevents.h diff --git a/tests/regression/ust/buffers-uid/Makefile.am b/tests/regression/ust/buffers-uid/Makefile.am index 31fb019..4fefd80 100644 --- a/tests/regression/ust/buffers-uid/Makefile.am +++ b/tests/regression/ust/buffers-uid/Makefile.am @@ -1,16 +1,2 @@ -AM_CFLAGS = -I$(srcdir) -O2 -AM_LDFLAGS = -llttng-ust - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -AM_LDFLAGS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -AM_LDFLAGS += -lc -endif - -noinst_PROGRAMS = gen-nevents -gen_nevents_SOURCES = gen-nevents.c tp.c ust_gen_nevents.h -gen_nevents_LDADD = -llttng-ust - noinst_SCRIPTS = test_buffers_uid EXTRA_DIST = test_buffers_uid diff --git a/tests/regression/ust/buffers-uid/gen-nevents.c b/tests/regression/ust/buffers-uid/gen-nevents.c deleted file mode 100644 index b2c1992..0000000 --- a/tests/regression/ust/buffers-uid/gen-nevents.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) - 2009 Pierre-Marc Fournier - * Copyright (C) - 2011 Mathieu Desnoyers - * Copyright (C) - 2012 David Goulet - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define TRACEPOINT_DEFINE -#include "ust_gen_nevents.h" - -int main(int argc, char **argv) -{ - int i, netint; - long values[] = { 1, 2, 3 }; - char text[10] = "test"; - double dbl = 2.0; - float flt = 2222.0; - unsigned int nr_iter = 100; - - if (argc == 2) { - nr_iter = atoi(argv[1]); - } - - for (i = 0; i < nr_iter; i++) { - netint = htonl(i); - tracepoint(ust_gen_nevents, tptest, i, netint, values, text, - strlen(text), dbl, flt); - usleep(100000); - } - - return 0; -} diff --git a/tests/regression/ust/buffers-uid/test_buffers_uid b/tests/regression/ust/buffers-uid/test_buffers_uid index 3b5c7a6..6af675c 100755 --- a/tests/regression/ust/buffers-uid/test_buffers_uid +++ b/tests/regression/ust/buffers-uid/test_buffers_uid @@ -19,15 +19,19 @@ TEST_DESC="UST tracer - Tracing with per UID buffers" CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../../.. NR_ITER=100 +NR_USEC_WAIT=100000 SESSION_NAME="buffers-uid" -EVENT_NAME="ust_gen_nevents:tptest" -BIN_NAME="gen-nevents" + +TESTAPP_PATH="$TESTDIR/utils/testapp" +TESTAPP_NAME="gen-ust-events" +TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" +EVENT_NAME="tp:tptest" NUM_TESTS=58 source $TESTDIR/utils/utils.sh -if [ ! -x "$CURDIR/gen-nevents" ]; then - BAIL_OUT "No UST nevents binary detected." +if [ ! -x "$TESTAPP_BIN" ]; then + BAIL_OUT "No UST events binary detected." fi # MUST set TESTDIR before calling those functions @@ -44,7 +48,7 @@ function enable_channel_per_uid() function wait_apps { diag "Waiting for applications to end..." - while [ -n "$(pidof $BIN_NAME)" ]; do + while [ -n "$(pidof $TESTAPP_NAME)" ]; do sleep 1 done } @@ -62,7 +66,7 @@ test_after_multiple_apps() { start_lttng_tracing $SESSION_NAME for i in `seq 1 5`; do - ./$CURDIR/$BIN_NAME $NR_ITER & >/dev/null 2>&1 + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & >/dev/null 2>&1 ok $? "Start application $i for tracing" done wait_apps @@ -82,7 +86,7 @@ test_before_multiple_apps() { diag "Start multiple applications BEFORE tracing is started" for i in `seq 1 5`; do - ./$CURDIR/$BIN_NAME $NR_ITER & >/dev/null 2>&1 + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & >/dev/null 2>&1 ok $? "Start application $i for tracing" done @@ -125,7 +129,7 @@ test_after_app() { enable_ust_lttng_event $SESSION_NAME $EVENT_NAME start_lttng_tracing $SESSION_NAME - ./$CURDIR/$BIN_NAME $NR_ITER + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ok $? "Start application to trace" stop_lttng_tracing $SESSION_NAME @@ -141,7 +145,7 @@ test_before_app() { diag "Start application BEFORE tracing is started" - ./$CURDIR/$BIN_NAME $NR_ITER & + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & ok $? "Start application to trace" # BEFORE application is spawned @@ -197,7 +201,7 @@ test_multiple_channels() { ok $? "Enable event $EVENT_NAME for session $SESSION_NAME in channel4" start_lttng_tracing $SESSION_NAME - ./$CURDIR/$BIN_NAME $NR_ITER + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ok $? "Start application to trace" stop_lttng_tracing $SESSION_NAME diff --git a/tests/regression/ust/buffers-uid/tp.c b/tests/regression/ust/buffers-uid/tp.c deleted file mode 100644 index e291924..0000000 --- a/tests/regression/ust/buffers-uid/tp.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) - 2011 Mathieu Desnoyers - * Copyright (c) - 2012 David Goulet - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR - * IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any purpose, - * provided the above notices are retained on all copies. Permission to modify - * the code and to distribute modified code is granted, provided the above - * notices are retained, and a notice that the code was modified is included - * with the above copyright notice. - */ - -#define TRACEPOINT_CREATE_PROBES -#include "ust_gen_nevents.h" diff --git a/tests/regression/ust/buffers-uid/ust_gen_nevents.h b/tests/regression/ust/buffers-uid/ust_gen_nevents.h deleted file mode 100644 index bc09c44..0000000 --- a/tests/regression/ust/buffers-uid/ust_gen_nevents.h +++ /dev/null @@ -1,56 +0,0 @@ -#undef TRACEPOINT_PROVIDER -#define TRACEPOINT_PROVIDER ust_gen_nevents - -#if !defined(_TRACEPOINT_UST_GEN_NEVENTS_H) || defined(TRACEPOINT_HEADER_MULTI_READ) -#define _TRACEPOINT_UST_GEN_NEVENTS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Copyright (C) 2011 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - */ - -#include - -TRACEPOINT_EVENT(ust_gen_nevents, tptest, - TP_ARGS(int, anint, int, netint, long *, values, - char *, text, size_t, textlen, - double, doublearg, float, floatarg), - TP_FIELDS( - ctf_integer(int, intfield, anint) - ctf_integer_hex(int, intfield2, anint) - ctf_integer(long, longfield, anint) - ctf_integer_network(int, netintfield, netint) - ctf_integer_network_hex(int, netintfieldhex, netint) - ctf_array(long, arrfield1, values, 3) - ctf_array_text(char, arrfield2, text, 10) - ctf_sequence(char, seqfield1, text, size_t, textlen) - ctf_sequence_text(char, seqfield2, text, size_t, textlen) - ctf_string(stringfield, text) - ctf_float(float, floatfield, floatarg) - ctf_float(double, doublefield, doublearg) - ) -) - -#endif /* _TRACEPOINT_UST_GEN_NEVENTS_H */ - -#undef TRACEPOINT_INCLUDE_FILE -#define TRACEPOINT_INCLUDE_FILE ./ust_gen_nevents.h - -/* This part must be outside ifdef protection */ -#include - -#ifdef __cplusplus -} -#endif -- 1.8.2.2 From christian.babeux at efficios.com Mon May 13 18:30:55 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Mon, 13 May 2013 18:30:55 -0400 Subject: [lttng-dev] [PATCH lttng-tools 5/6] Tests: Replace usage of gen-ust-events testapp in ust nprocesses test In-Reply-To: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> References: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1368484256-6666-5-git-send-email-christian.babeux@efficios.com> Use the gen-ust-events binary found under tests/utils/testapp/gen-ust-events/. Signed-off-by: Christian Babeux --- tests/regression/ust/nprocesses/Makefile.am | 14 ------ tests/regression/ust/nprocesses/gen-events-time.c | 61 ----------------------- tests/regression/ust/nprocesses/test_nprocesses | 28 ++++++----- tests/regression/ust/nprocesses/tp.c | 16 ------ tests/regression/ust/nprocesses/ust_gen_event.h | 56 --------------------- 5 files changed, 16 insertions(+), 159 deletions(-) delete mode 100644 tests/regression/ust/nprocesses/gen-events-time.c delete mode 100644 tests/regression/ust/nprocesses/tp.c delete mode 100644 tests/regression/ust/nprocesses/ust_gen_event.h diff --git a/tests/regression/ust/nprocesses/Makefile.am b/tests/regression/ust/nprocesses/Makefile.am index 3113a34..70a4eea 100644 --- a/tests/regression/ust/nprocesses/Makefile.am +++ b/tests/regression/ust/nprocesses/Makefile.am @@ -1,16 +1,2 @@ -AM_CFLAGS = -I$(srcdir) -O2 -AM_LDFLAGS = -llttng-ust - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -AM_LDFLAGS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -AM_LDFLAGS += -lc -endif - -noinst_PROGRAMS = gen-events-time -gen_events_time_SOURCES = gen-events-time.c tp.c ust_gen_event.h -gen_events_time_LDADD = -llttng-ust - noinst_SCRIPTS = test_nprocesses EXTRA_DIST = test_nprocesses diff --git a/tests/regression/ust/nprocesses/gen-events-time.c b/tests/regression/ust/nprocesses/gen-events-time.c deleted file mode 100644 index bc5b68c..0000000 --- a/tests/regression/ust/nprocesses/gen-events-time.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) - 2009 Pierre-Marc Fournier - * Copyright (C) - 2011 Mathieu Desnoyers - * Copyright (C) - 2012 David Goulet - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define TRACEPOINT_DEFINE -#include "ust_gen_event.h" - -int main(int argc, char **argv) -{ - int i, netint; - long values[] = { 1, 2, 3 }; - char text[10] = "test"; - double dbl = 2.0; - float flt = 2222.0; - /* Default loop time is 60 sec since each round sleeps 1 sec */ - unsigned int nr_iter = 60; - - fclose(stdout); - fclose(stderr); - fclose(stdin); - - if (argc == 2) { - nr_iter = atoi(argv[1]); - } - - for (i = 0; i < nr_iter; i++) { - netint = htonl(i); - tracepoint(ust_gen_event, tptest, i, netint, values, text, - strlen(text), dbl, flt); - sleep(1); - } - - return 0; -} diff --git a/tests/regression/ust/nprocesses/test_nprocesses b/tests/regression/ust/nprocesses/test_nprocesses index f9ed0b1..1660c21 100755 --- a/tests/regression/ust/nprocesses/test_nprocesses +++ b/tests/regression/ust/nprocesses/test_nprocesses @@ -14,21 +14,25 @@ # You should have received a copy of the GNU Lesser General Public License # along with this library; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -NR_ITER=30 -TEST_DESC="UST tracer - Generate $NR_ITER process" +NUM_PROCESS=30 +TEST_DESC="UST tracer - Generate $NUM_PROCESS process" CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../../.. -TEST_BIN_NAME="gen-events-time" +NR_ITER=1000 +NR_USEC_WAIT=1000000 +TESTAPP_PATH="$TESTDIR/utils/testapp" +TESTAPP_NAME="gen-ust-events" +TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="ust-nprocesses" -EVENT_NAME="ust_gen_event:tptest" +EVENT_NAME="tp:tptest" TEST_WAIT_SEC=5 NUM_TESTS=9 source $TESTDIR/utils/utils.sh -if [ ! -x "$CURDIR/$TEST_BIN_NAME" ]; then - BAIL_OUT "No UST $TEST_BIN_NAME binary detected." +if [ ! -x "$TESTAPP_BIN" ]; then + BAIL_OUT "No UST $TESTAPP_BIN binary detected." fi # MUST set TESTDIR before calling those functions @@ -41,15 +45,15 @@ start_lttng_sessiond # Start test for 1000 seconds -for i in `seq 1 $NR_ITER` +for i in `seq 1 $NUM_PROCESS` do - ./$CURDIR/$TEST_BIN_NAME 1000 >/dev/null 2>&1 & + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 & done reg_app_count=0 -while [ $reg_app_count -ne $NR_ITER ]; do +while [ $reg_app_count -ne $NUM_PROCESS ]; do listing=$($TESTDIR/../src/bin/lttng/$LTTNG_BIN list -u) - reg_app_count=$(echo -n $listing | sed "s/$TEST_BIN_NAME/$TEST_BIN_NAME\n/g" | grep "$TEST_BIN_NAME" | wc -l) + reg_app_count=$(echo -n $listing | sed "s#$TESTAPP_BIN#$TESTAPP_BIN\n#g" | grep "$TESTAPP_BIN" | wc -l) done pass "Trace validation" @@ -71,8 +75,8 @@ destroy_lttng_session $SESSION_NAME rm -rf $TRACE_PATH -while [ -n "$(pidof $TEST_BIN_NAME)" ]; do - killall -q $TEST_BIN_NAME >/dev/null 2>&1 +while [ -n "$(pidof $TESTAPP_NAME)" ]; do + killall -q $TESTAPP_NAME >/dev/null 2>&1 sleep 0.5 done diff --git a/tests/regression/ust/nprocesses/tp.c b/tests/regression/ust/nprocesses/tp.c deleted file mode 100644 index 438139e..0000000 --- a/tests/regression/ust/nprocesses/tp.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) - 2011 Mathieu Desnoyers - * Copyright (c) - 2012 David Goulet - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR - * IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any purpose, - * provided the above notices are retained on all copies. Permission to modify - * the code and to distribute modified code is granted, provided the above - * notices are retained, and a notice that the code was modified is included - * with the above copyright notice. - */ - -#define TRACEPOINT_CREATE_PROBES -#include "ust_gen_event.h" diff --git a/tests/regression/ust/nprocesses/ust_gen_event.h b/tests/regression/ust/nprocesses/ust_gen_event.h deleted file mode 100644 index 5bdcb37..0000000 --- a/tests/regression/ust/nprocesses/ust_gen_event.h +++ /dev/null @@ -1,56 +0,0 @@ -#undef TRACEPOINT_PROVIDER -#define TRACEPOINT_PROVIDER ust_gen_event - -#if !defined(_TRACEPOINT_UST_GEN_EVENT_H) || defined(TRACEPOINT_HEADER_MULTI_READ) -#define _TRACEPOINT_UST_GEN_EVENT_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Copyright (C) 2011 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - */ - -#include - -TRACEPOINT_EVENT(ust_gen_event, tptest, - TP_ARGS(int, anint, int, netint, long *, values, - char *, text, size_t, textlen, - double, doublearg, float, floatarg), - TP_FIELDS( - ctf_integer(int, intfield, anint) - ctf_integer_hex(int, intfield2, anint) - ctf_integer(long, longfield, anint) - ctf_integer_network(int, netintfield, netint) - ctf_integer_network_hex(int, netintfieldhex, netint) - ctf_array(long, arrfield1, values, 3) - ctf_array_text(char, arrfield2, text, 10) - ctf_sequence(char, seqfield1, text, size_t, textlen) - ctf_sequence_text(char, seqfield2, text, size_t, textlen) - ctf_string(stringfield, text) - ctf_float(float, floatfield, floatarg) - ctf_float(double, doublefield, doublearg) - ) -) - -#endif /* _TRACEPOINT_UST_GEN_EVENT_H */ - -#undef TRACEPOINT_INCLUDE_FILE -#define TRACEPOINT_INCLUDE_FILE ./ust_gen_event.h - -/* This part must be outside ifdef protection */ -#include - -#ifdef __cplusplus -} -#endif -- 1.8.2.2 From christian.babeux at efficios.com Mon May 13 18:30:56 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Mon, 13 May 2013 18:30:56 -0400 Subject: [lttng-dev] [PATCH lttng-tools 6/6] Tests: Replace usage of gen-ust-events testapp in ust metadata-flush test In-Reply-To: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> References: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1368484256-6666-6-git-send-email-christian.babeux@efficios.com> Use the gen-ust-events binary found under tests/utils/testapp/gen-ust-events/. Signed-off-by: Christian Babeux --- .../ust/periodical-metadata-flush/Makefile.am | 14 ------ .../ust/periodical-metadata-flush/gen-nevents.c | 56 ---------------------- .../test_periodical_metadata_flush | 20 ++++---- .../regression/ust/periodical-metadata-flush/tp.c | 16 ------- .../periodical-metadata-flush/ust_gen_nevents.h | 56 ---------------------- 5 files changed, 12 insertions(+), 150 deletions(-) delete mode 100644 tests/regression/ust/periodical-metadata-flush/gen-nevents.c delete mode 100644 tests/regression/ust/periodical-metadata-flush/tp.c delete mode 100644 tests/regression/ust/periodical-metadata-flush/ust_gen_nevents.h diff --git a/tests/regression/ust/periodical-metadata-flush/Makefile.am b/tests/regression/ust/periodical-metadata-flush/Makefile.am index 72013e8..c020920 100644 --- a/tests/regression/ust/periodical-metadata-flush/Makefile.am +++ b/tests/regression/ust/periodical-metadata-flush/Makefile.am @@ -1,16 +1,2 @@ -AM_CFLAGS = -I$(srcdir) -O2 -AM_LDFLAGS = -llttng-ust - -if LTTNG_TOOLS_BUILD_WITH_LIBDL -AM_LDFLAGS += -ldl -endif -if LTTNG_TOOLS_BUILD_WITH_LIBC_DL -AM_LDFLAGS += -lc -endif - -noinst_PROGRAMS = gen-nevents -gen_nevents_SOURCES = gen-nevents.c tp.c ust_gen_nevents.h -gen_nevents_LDADD = -llttng-ust - noinst_SCRIPTS = test_periodical_metadata_flush EXTRA_DIST = test_periodical_metadata_flush diff --git a/tests/regression/ust/periodical-metadata-flush/gen-nevents.c b/tests/regression/ust/periodical-metadata-flush/gen-nevents.c deleted file mode 100644 index b2c1992..0000000 --- a/tests/regression/ust/periodical-metadata-flush/gen-nevents.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) - 2009 Pierre-Marc Fournier - * Copyright (C) - 2011 Mathieu Desnoyers - * Copyright (C) - 2012 David Goulet - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define TRACEPOINT_DEFINE -#include "ust_gen_nevents.h" - -int main(int argc, char **argv) -{ - int i, netint; - long values[] = { 1, 2, 3 }; - char text[10] = "test"; - double dbl = 2.0; - float flt = 2222.0; - unsigned int nr_iter = 100; - - if (argc == 2) { - nr_iter = atoi(argv[1]); - } - - for (i = 0; i < nr_iter; i++) { - netint = htonl(i); - tracepoint(ust_gen_nevents, tptest, i, netint, values, text, - strlen(text), dbl, flt); - usleep(100000); - } - - return 0; -} diff --git a/tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush b/tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush index 2d984d5..18d8a46 100755 --- a/tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush +++ b/tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush @@ -19,15 +19,19 @@ TEST_DESC="UST tracer - Tracing with per UID buffers and periodical flush" CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../../.. NR_ITER=100 +NR_USEC_WAIT=100000 +TESTAPP_PATH="$TESTDIR/utils/testapp" +TESTAPP_NAME="gen-ust-events" +TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="periodical-flush" -EVENT_NAME="ust_gen_nevents:tptest" +EVENT_NAME="tp:tptest" BIN_NAME="gen-nevents" NUM_TESTS=38 source $TESTDIR/utils/utils.sh -if [ ! -x "$CURDIR/gen-nevents" ]; then - BAIL_OUT "No UST nevents binary detected." +if [ ! -x "$TESTAPP_BIN" ]; then + BAIL_OUT "No UST events binary detected." fi # MUST set TESTDIR before calling those functions @@ -62,7 +66,7 @@ function enable_metadata_per_pid() function wait_apps { diag "Waiting for applications to end..." - while [ -n "$(pidof $BIN_NAME)" ]; do + while [ -n "$(pidof $TESTAPP_NAME)" ]; do sleep 1 done } @@ -79,7 +83,7 @@ test_after_app_pid() { enable_ust_lttng_event $SESSION_NAME $EVENT_NAME start_lttng_tracing $SESSION_NAME - ./$CURDIR/$BIN_NAME $NR_ITER + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ok $? "Start application to trace" stop_lttng_tracing $SESSION_NAME @@ -95,7 +99,7 @@ test_before_app_pid() { diag "Start application BEFORE tracing is started" - ./$CURDIR/$BIN_NAME $NR_ITER & + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & ok $? "Start application to trace" # BEFORE application is spawned @@ -139,7 +143,7 @@ test_after_app_uid() { enable_ust_lttng_event $SESSION_NAME $EVENT_NAME start_lttng_tracing $SESSION_NAME - ./$CURDIR/$BIN_NAME $NR_ITER + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ok $? "Start application to trace" stop_lttng_tracing $SESSION_NAME @@ -155,7 +159,7 @@ test_before_app_uid() { diag "Start application BEFORE tracing is started" - ./$CURDIR/$BIN_NAME $NR_ITER & + $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & ok $? "Start application to trace" # BEFORE application is spawned diff --git a/tests/regression/ust/periodical-metadata-flush/tp.c b/tests/regression/ust/periodical-metadata-flush/tp.c deleted file mode 100644 index e291924..0000000 --- a/tests/regression/ust/periodical-metadata-flush/tp.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) - 2011 Mathieu Desnoyers - * Copyright (c) - 2012 David Goulet - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR - * IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any purpose, - * provided the above notices are retained on all copies. Permission to modify - * the code and to distribute modified code is granted, provided the above - * notices are retained, and a notice that the code was modified is included - * with the above copyright notice. - */ - -#define TRACEPOINT_CREATE_PROBES -#include "ust_gen_nevents.h" diff --git a/tests/regression/ust/periodical-metadata-flush/ust_gen_nevents.h b/tests/regression/ust/periodical-metadata-flush/ust_gen_nevents.h deleted file mode 100644 index bc09c44..0000000 --- a/tests/regression/ust/periodical-metadata-flush/ust_gen_nevents.h +++ /dev/null @@ -1,56 +0,0 @@ -#undef TRACEPOINT_PROVIDER -#define TRACEPOINT_PROVIDER ust_gen_nevents - -#if !defined(_TRACEPOINT_UST_GEN_NEVENTS_H) || defined(TRACEPOINT_HEADER_MULTI_READ) -#define _TRACEPOINT_UST_GEN_NEVENTS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Copyright (C) 2011 Mathieu Desnoyers - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED - * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program - * for any purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - */ - -#include - -TRACEPOINT_EVENT(ust_gen_nevents, tptest, - TP_ARGS(int, anint, int, netint, long *, values, - char *, text, size_t, textlen, - double, doublearg, float, floatarg), - TP_FIELDS( - ctf_integer(int, intfield, anint) - ctf_integer_hex(int, intfield2, anint) - ctf_integer(long, longfield, anint) - ctf_integer_network(int, netintfield, netint) - ctf_integer_network_hex(int, netintfieldhex, netint) - ctf_array(long, arrfield1, values, 3) - ctf_array_text(char, arrfield2, text, 10) - ctf_sequence(char, seqfield1, text, size_t, textlen) - ctf_sequence_text(char, seqfield2, text, size_t, textlen) - ctf_string(stringfield, text) - ctf_float(float, floatfield, floatarg) - ctf_float(double, doublefield, doublearg) - ) -) - -#endif /* _TRACEPOINT_UST_GEN_NEVENTS_H */ - -#undef TRACEPOINT_INCLUDE_FILE -#define TRACEPOINT_INCLUDE_FILE ./ust_gen_nevents.h - -/* This part must be outside ifdef protection */ -#include - -#ifdef __cplusplus -} -#endif -- 1.8.2.2 From mathieu.desnoyers at efficios.com Tue May 14 02:52:44 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 14 May 2013 02:52:44 -0400 Subject: [lttng-dev] [PATCH] Fix linker library order In-Reply-To: <519161C8.5000305@voxpopuli.im> References: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> <20130512025917.GB405@Krystal> <519161C8.5000305@voxpopuli.im> Message-ID: <20130514065244.GA5066@Krystal> * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > On 13-05-11 10:59 PM, Mathieu Desnoyers wrote: > > * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: > >> Libraries must be specified after the binary target. > > merged, thanks! > > > > Mathieu > > This seems to have broken the daily PPA packages: > https://launchpadlibrarian.net/139804087/buildlog_ubuntu-saucy-amd64.lttng-ust_2.2~pre-0%2Bbzr1574%2Bpack37%2B201305131247~saucy1_FAILEDTOBUILD.txt.gz > > That package has no particular patches. If I build it locally from > source it builds fine, but if I build the package locally (with > dpkg-buildpackage), I get the same error. It could be related to the > --as-needed problem we've had before... Francis, can you explain why your change was needed in the first place ? Thanks, Mathieu > > Cheers, > Alex > > > > >> Signed-off-by: Francis Giraldeau > >> --- > >> doc/examples/demo/Makefile | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile > >> index 7ae6547..bbc8ccb 100644 > >> --- a/doc/examples/demo/Makefile > >> +++ b/doc/examples/demo/Makefile > >> @@ -55,7 +55,7 @@ demo.o: demo.c > >> $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > >> > >> demo: demo.o > >> - $(CC) -o $@ $(LIBS) $^ > >> + $(CC) -o $@ $^ $(LIBS) > >> > >> .PHONY: clean > >> clean: > >> -- > >> 1.8.1.2 > >> > >> > >> _______________________________________________ > >> lttng-dev mailing list > >> lttng-dev at lists.lttng.org > >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 14 03:05:45 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 14 May 2013 03:05:45 -0400 Subject: [lttng-dev] User-space tracing by the root lttng-sessiond In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD12D1201A@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD12D1201A@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: <20130514070545.GA5213@Krystal> * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > I ran a little experiment whose results surprised me. Using a non-tracing group user account, I first made sure I had a root lttng-sessiond running and a user-space lttng-sessiond. In the first I set up a trace for some kernel events plus all user-space events. In the second I set up a trace for all user-space events only. Both traces were started, then the lttng-ust/doc/examples/easy-ust/sample demo was run to generate the user-space events. Then both traces were stopped and destroyed. > > I noted there were three lttng-consumerd daemons: one in user-space, the other two owned by root. Presumably one is servicing the kernel events while the other is servicing the user-space events. yes > (Question: If there were several users active at once, would there be several root user-space lttng-consumerd daemons or still just one?) no > > As expected, both traces show the sample user-space events (with no losses, it turns out). What surprised me, however, is that the pairs of events were not in synch. Since they're all coming out of the same trace provider, I would expect the time-stamp to be issued once (by the tracepoint provider), and then two copies of the event to go into the two trace buffers for eventual storage. Could it be that the tracepoint provider instead issues two separate events, one for each of its clients? yes > (For the record, the pairs of events were out of synch by at least 4187 ns (670 times out of 100 000), and as much as 3 326 405 ns (once); in 93% of the time root event lags after the user-space event) can be caused by interruption (for 4k ns) and preemption (for the 3s hit). > > This seems problematic to me, since multiple traces capturing the same event won't be able to reconcile their copies with each other. since timestamps have to match the event physical order in the streams, we need to assign one timestamp for each buffer. no way around this. and yes, tracing is not stopping the world, so you can expect to have slight timing inaccuracy like this. It's a trade-off between perfect timing accuracy and tracer overhead. Thanks, Mathieu > > Daniel U. Thibault > Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) > Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) > 2459 route de la Bravoure > Qu?bec QC? G3J 1X5 > CANADA > Vox?: (418) 844-4000 x4245 > Fax?: (418) 844-4538 > NAC?: 918V QSDJ > Gouvernement du Canada?| Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 14 08:08:53 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 14 May 2013 08:08:53 -0400 Subject: [lttng-dev] [Babeltrace RFC PATCH 03/28] Move build-specific strerror_r to compat directory In-Reply-To: References: <009B25148989C6458484484699278506E537E844@EU-MBX-01.mgc.mentorg.com> Message-ID: <20130514120853.GD21745@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > On Thu, May 2, 2013 at 7:46 AM, Ikaheimonen, JP > wrote: > > Add a new source directory 'compat'. > > In that directory, add a new file 'strlib.c'. > > In that file, add a new function compat_strerror_r that encapsulates > > the build-specific differences of strerror_r. > > Where strerror_r is used, now use compat_strerror_r. > > --- > > Makefile.am | 2 +- > > compat/Makefile.am | 10 ++++++++++ > > compat/compat_strlib.c | 17 +++++++++++++++++ > > configure.ac | 1 + > > include/babeltrace/babeltrace-internal.h | 32 +++----------------------------- > > include/babeltrace/compat/string.h | 9 +++++++++ > > lib/Makefile.am | 3 ++- > > 7 files changed, 43 insertions(+), 31 deletions(-) > > create mode 100644 compat/Makefile.am > > create mode 100644 compat/compat_strlib.c > > create mode 100644 include/babeltrace/compat/string.h > > > > diff --git a/Makefile.am b/Makefile.am > > index b25b58f..cdfad5a 100644 > > --- a/Makefile.am > > +++ b/Makefile.am > > @@ -2,7 +2,7 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include > > > > ACLOCAL_AMFLAGS = -I m4 > > > > -SUBDIRS = include types lib formats converter tests doc extras > > +SUBDIRS = include types compat lib formats converter tests doc extras > > > > dist_doc_DATA = ChangeLog LICENSE mit-license.txt gpl-2.0.txt \ > > std-ext-lib.txt > > diff --git a/compat/Makefile.am b/compat/Makefile.am > > new file mode 100644 > > index 0000000..d756aa7 > > --- /dev/null > > +++ b/compat/Makefile.am > > @@ -0,0 +1,10 @@ > > +AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include > > + > > +lib_LTLIBRARIES = libcompat.la > > + > > +libcompat_la_SOURCES = \ > > + compat_strlib.c > > + > > +libcompat_la_LDFLAGS = \ > > + -Wl,--no-as-needed > > + > > diff --git a/compat/compat_strlib.c b/compat/compat_strlib.c > > new file mode 100644 > > index 0000000..9aabb07 > > --- /dev/null > > +++ b/compat/compat_strlib.c > > @@ -0,0 +1,17 @@ > > +#include > > + > > +int compat_strerror_r(int errnum, char *buf, size_t buflen) > > Is there a specific reason why you can't redefine this as a macro > instead of changing the function's name? whenever possible, we try to use static inline rather than macros. This provides much better type verification, and cleaner compiler error reporting. however, a big note on how to make clean wrappers: Do: #if something int myfct(args) { ... } #else int myfct(args) { ... } #endif and _not_ the glibc-style oddness: int myfct(args) { #if something ... #else ... #endif } putting preprocessor conditions within functions is purely evil. ;-) Thanks, Mathieu > > > +{ > > +#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) > > +/* XSI-compliant strerror_r */ > > + return strerror_r(errnum, buf, buflen); > > +#else > > +/* GNU-compliant strerror_r */ > > + char * retbuf; > > + retbuf = strerror_r(errnum, buf, buflen); > > + if (retbuf != buf) > > + strcpy(buf, retbuf); > > + return 0; > > +#endif > > +} > > + > > diff --git a/configure.ac b/configure.ac > > index 83822d6..29366da 100644 > > --- a/configure.ac > > +++ b/configure.ac > > @@ -93,6 +93,7 @@ AC_SUBST(babeltracectfincludedir) > > AC_CONFIG_FILES([ > > Makefile > > types/Makefile > > + compat/Makefile > > formats/Makefile > > formats/ctf/Makefile > > formats/ctf/types/Makefile > > diff --git a/include/babeltrace/babeltrace-internal.h b/include/babeltrace/babeltrace-internal.h > > index 22866bc..35382de 100644 > > --- a/include/babeltrace/babeltrace-internal.h > > +++ b/include/babeltrace/babeltrace-internal.h > > @@ -27,7 +27,7 @@ > > #include > > #include > > #include > > -#include > > +#include > > > > #define PERROR_BUFLEN 200 > > > > @@ -81,46 +81,20 @@ extern int babeltrace_verbose, babeltrace_debug; > > perrorstr, \ > > ## args) > > > > -#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) > > - > > #define _bt_printf_perror(fp, fmt, args...) \ > > ({ \ > > char buf[PERROR_BUFLEN] = "Error in strerror_r()"; \ > > - strerror_r(errno, buf, sizeof(buf)); \ > > + compat_strerror_r(errno, buf, sizeof(buf)); \ > > _bt_printfe(fp, "error", buf, fmt, ## args); \ > > }) > > > > #define _bt_printfl_perror(fp, lineno, fmt, args...) \ > > ({ \ > > char buf[PERROR_BUFLEN] = "Error in strerror_r()"; \ > > - strerror_r(errno, buf, sizeof(buf)); \ > > + compat_strerror_r(errno, buf, sizeof(buf)); \ > > _bt_printfle(fp, "error", lineno, buf, fmt, ## args); \ > > }) > > > > -#else > > - > > -/* > > - * Version using GNU strerror_r, for linux with appropriate defines. > > - */ > > - > > -#define _bt_printf_perror(fp, fmt, args...) \ > > - ({ \ > > - char *buf; \ > > - char tmp[PERROR_BUFLEN] = "Error in strerror_r()"; \ > > - buf = strerror_r(errno, tmp, sizeof(tmp)); \ > > - _bt_printfe(fp, "error", buf, fmt, ## args); \ > > - }) > > - > > -#define _bt_printfl_perror(fp, lineno, fmt, args...) \ > > - ({ \ > > - char *buf; \ > > - char tmp[PERROR_BUFLEN] = "Error in strerror_r()"; \ > > - buf = strerror_r(errno, tmp, sizeof(tmp)); \ > > - _bt_printfle(fp, "error", lineno, buf, fmt, ## args); \ > > - }) > > - > > -#endif > > - > > /* printf without lineno information */ > > #define printf_fatal(fmt, args...) \ > > _bt_printf(stderr, "fatal", fmt, ## args) > > diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h > > new file mode 100644 > > index 0000000..8591b7e > > --- /dev/null > > +++ b/include/babeltrace/compat/string.h > > @@ -0,0 +1,9 @@ > > +#ifndef _BABELTRACE_COMPAT_STRING_H > > +#define BABELTRACE_COMPAT_STRING_H > > + > > +#include > > + > > +int compat_strerror_r(int errnum, char *buf, size_t buflen); > > + > > +#endif > > + > > diff --git a/lib/Makefile.am b/lib/Makefile.am > > index 7ffb164..fa470c0 100644 > > --- a/lib/Makefile.am > > +++ b/lib/Makefile.am > > @@ -14,4 +14,5 @@ libbabeltrace_la_SOURCES = babeltrace.c \ > > libbabeltrace_la_LDFLAGS = \ > > -Wl,--no-as-needed \ > > prio_heap/libprio_heap.la \ > > - $(top_builddir)/types/libbabeltrace_types.la > > + $(top_builddir)/types/libbabeltrace_types.la \ > > + $(top_builddir)/compat/libcompat.la > > -- > > 1.8.1.msysgit.1 > > > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > -- > J?r?mie Galarneau > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 14 08:12:01 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 14 May 2013 08:12:01 -0400 Subject: [lttng-dev] [babeltrace RFC PATCH 06/28] Add MinGW implementation of UUID In-Reply-To: References: <009B25148989C6458484484699278506E537E866@EU-MBX-01.mgc.mentorg.com> Message-ID: <20130514121201.GE21745@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > On Thu, May 2, 2013 at 7:47 AM, Ikaheimonen, JP > wrote: > > Implementation of UUID functions for MinGW32, using Windows API. > > --- > > compat/Makefile.am | 3 ++ > > compat/compat_uuid.c | 75 ++++++++++++++++++++++++++++++++++++++++ > > configure.ac | 5 ++- > > include/babeltrace/compat/uuid.h | 32 ++++++++++++++++- > > 4 files changed, 113 insertions(+), 2 deletions(-) > > create mode 100644 compat/compat_uuid.c > > > > diff --git a/compat/Makefile.am b/compat/Makefile.am > > index d756aa7..e624a79 100644 > > --- a/compat/Makefile.am > > +++ b/compat/Makefile.am > > @@ -8,3 +8,6 @@ libcompat_la_SOURCES = \ > > libcompat_la_LDFLAGS = \ > > -Wl,--no-as-needed > > > > +if BABELTRACE_BUILD_WITH_MINGW > > +libcompat_la_SOURCES += compat_uuid.c > > +endif > > \ No newline at end of file > > diff --git a/compat/compat_uuid.c b/compat/compat_uuid.c > > new file mode 100644 > > index 0000000..0e67f73 > > --- /dev/null > > +++ b/compat/compat_uuid.c > > @@ -0,0 +1,75 @@ > > +/* This file is only built under MINGW32 */ > > + > > +#include > > +#include > > +#include > > + > > +static void fix_uuid_endian(struct UUID * uuid) > > +{ > > + unsigned char * ptr; > > + unsigned char tmp; > > + #define SWAP(p, i, j) tmp=*(p+i);*(p+i)=*(p+j);*(p+j)=tmp; surprising. Isn't there a standard byteswap in windows ? > > + ptr = (unsigned char *)uuid; > > + SWAP(ptr, 0, 3) > > + SWAP(ptr, 1, 2) > > + SWAP(ptr, 4, 5) > > + SWAP(ptr, 6, 7) > > + Please remove whiteline. > > +} > > + > > +int compat_uuid_generate(unsigned char *uuid_out) > > +{ > > + RPC_STATUS status; valid here and elsewhere: please put an empty line between variable declarations and code. Thanks, Mathieu > > + status = UuidCreate((struct UUID *)uuid_out); > > + if (status == RPC_S_OK) > > + return 0; > > + else > > + return -1; > > +} > > + > > +int compat_uuid_unparse(const unsigned char *uuid_in, char *str_out) > > +{ > > + RPC_STATUS status; > > + unsigned char *alloc_str; > > + int ret; > > + fix_uuid_endian(uuid_in); > > + status = UuidToString((struct UUID *)uuid_in, &alloc_str); > > + fix_uuid_endian(uuid_in); > > + if (status == RPC_S_OK) { > > + strcpy(str_out, alloc_str); > > + ret = 0; > > + } else { > > + ret = -1; > > + } > > + RpcStringFree(alloc_str); > > + return ret; > > +} > > + > > +int compat_uuid_parse(const char *str_in, unsigned char *uuid_out) > > +{ > > + RPC_STATUS status; > > + > > + status = UuidFromString(str_in, (struct UUID *)uuid_out); > > + fix_uuid_endian(uuid_out); > > + > > + if (status == RPC_S_OK) > > + return 0; > > + else > > + return -1; > > +} > > + > > +int compat_uuid_compare(const unsigned char *uuid_a, > > + const unsigned char *uuid_b) > > +{ > > + RPC_STATUS status; > > + int ret; > > + > > + if (UuidCompare((struct UUID *)uuid_a, (struct UUID *)uuid_b, &status) == 0) > > + ret = 0; > > + else > > + { > > + ret = -1; > > + } > > + return ret; > > + > > +} > > diff --git a/configure.ac b/configure.ac > > index 65e867c..5f9e38d 100644 > > --- a/configure.ac > > +++ b/configure.ac > > @@ -60,7 +60,10 @@ AC_CHECK_LIB([uuid], [uuid_generate], > > have_libc_uuid=yes > > ], > > [ > > - AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.]) > > + # for MinGW32 we have our own internal implemenation of uuid using Windows functions. > > + if test "x$MINGW32" = xno; then > > + AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.]) > > + fi > > ]) > > ] > > ) > > diff --git a/include/babeltrace/compat/uuid.h b/include/babeltrace/compat/uuid.h > > index 2ce7467..a916a49 100644 > > --- a/include/babeltrace/compat/uuid.h > > +++ b/include/babeltrace/compat/uuid.h > > @@ -122,8 +122,38 @@ int babeltrace_uuid_compare(const unsigned char *uuid_a, > > return -1; > > } > > > > +#elif defined(__MINGW32__) > > +static inline > > +int babeltrace_uuid_generate(unsigned char *uuid_out) > > +{ > > + extern int compat_uuid_generate(unsigned char *uuid_out); > > + return compat_uuid_generate(uuid_out); > > +} > > + > > +static inline > > +int babeltrace_uuid_unparse(const unsigned char *uuid_in, char *str_out) > > +{ > > + extern int compat_uuid_unparse(const unsigned char *uuid_in, char *str_out); > > + return compat_uuid_unparse(uuid_in, str_out); > > +} > > + > > +static inline > > +int babeltrace_uuid_parse(const char *str_in, unsigned char *uuid_out) > > +{ > > + extern int compat_uuid_parse(const char *str_in, unsigned char *uuid_out); > > + return compat_uuid_parse(str_in, uuid_out); > > +} > > + > > +static inline > > +int babeltrace_uuid_compare(const unsigned char *uuid_a, > > + const unsigned char *uuid_b) > > +{ > > + extern int compat_uuid_compare(const unsigned char *uuid_a, > > + const unsigned char *uuid_b); > > + return compat_uuid_compare(uuid_a, uuid_b); > > +} > > #else > > #error "Babeltrace needs to have a UUID generator configured." > > #endif > > > > -#endif /* _BABELTRACE_UUID_H */ > > +#endif /* _BABELTRACE_INCLUDE_COMPAT_UUID_H */ > > Please change this at the beginning of the file too. > > > -- > > 1.8.1.msysgit.1 > > > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > -- > J?r?mie Galarneau > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 14 08:37:24 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 14 May 2013 08:37:24 -0400 Subject: [lttng-dev] [PATCH] Fix linker library order In-Reply-To: <20130514065244.GA5066@Krystal> References: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> <20130512025917.GB405@Krystal> <519161C8.5000305@voxpopuli.im> <20130514065244.GA5066@Krystal> Message-ID: <20130514123724.GA24238@Krystal> * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: > * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > > On 13-05-11 10:59 PM, Mathieu Desnoyers wrote: > > > * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: > > >> Libraries must be specified after the binary target. > > > merged, thanks! > > > > > > Mathieu > > > > This seems to have broken the daily PPA packages: > > https://launchpadlibrarian.net/139804087/buildlog_ubuntu-saucy-amd64.lttng-ust_2.2~pre-0%2Bbzr1574%2Bpack37%2B201305131247~saucy1_FAILEDTOBUILD.txt.gz > > > > That package has no particular patches. If I build it locally from > > source it builds fine, but if I build the package locally (with > > dpkg-buildpackage), I get the same error. It could be related to the > > --as-needed problem we've had before... > > Francis, can you explain why your change was needed in the first place ? Hrm, actually, these patches are wrong. commit 725e63c5194bfdcde0a2a3507aca156ba36cf49f for instance: "Libraries must be specified after the binary target." demo: demo.o - $(CC) -o $@ $(LIBS) $^ + $(CC) -o $@ $^ $(LIBS) the binary target here is "$@". $^ is the source file name (demo.c). this patch moves the source file name prior to the libraries, which is incorrect (ref: gcc(1)). The input files should appear last. So it breaks builds where $(LIBS) is non-empty. I will revert commits: commit a51ac6d9a011ba10b0be396dc1e801b2fc829651 Author: Francis Giraldeau Date: Sat May 11 22:59:21 2013 -0400 Fix (another) linker library order Libraries must be specified after the binary target. Signed-off-by: Francis Giraldeau Signed-off-by: Mathieu Desnoyers commit 725e63c5194bfdcde0a2a3507aca156ba36cf49f Author: Francis Giraldeau Date: Sat May 11 22:58:12 2013 -0400 Fix linker library order Libraries must be specified after the binary target. Signed-off-by: Francis Giraldeau Signed-off-by: Mathieu Desnoyers Thanks, Mathieu > > Thanks, > > Mathieu > > > > > Cheers, > > Alex > > > > > > > >> Signed-off-by: Francis Giraldeau > > >> --- > > >> doc/examples/demo/Makefile | 2 +- > > >> 1 file changed, 1 insertion(+), 1 deletion(-) > > >> > > >> diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile > > >> index 7ae6547..bbc8ccb 100644 > > >> --- a/doc/examples/demo/Makefile > > >> +++ b/doc/examples/demo/Makefile > > >> @@ -55,7 +55,7 @@ demo.o: demo.c > > >> $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > > >> > > >> demo: demo.o > > >> - $(CC) -o $@ $(LIBS) $^ > > >> + $(CC) -o $@ $^ $(LIBS) > > >> > > >> .PHONY: clean > > >> clean: > > >> -- > > >> 1.8.1.2 > > >> > > >> > > >> _______________________________________________ > > >> lttng-dev mailing list > > >> lttng-dev at lists.lttng.org > > >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From Daniel.Thibault at drdc-rddc.gc.ca Tue May 14 09:21:03 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Tue, 14 May 2013 13:21:03 +0000 Subject: [lttng-dev] User-space tracing by the root lttng-sessiond In-Reply-To: <20130514070545.GA5213@Krystal> References: <48CF5AC71E61DB46B70D0F388054EFFD12D1201A@VAL-E-02.valcartier.drdc-rddc.gc.ca> <20130514070545.GA5213@Krystal> Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D1210D@VAL-E-02.valcartier.drdc-rddc.gc.ca> > > (Question: If there were several users active at once, would there be > > several root user-space lttng-consumerd daemons or still just one?) > > no Please clarify: no, there will be several root user-space lttng-consumerd daemons or no, there will be just one root user-space lttng-consumerd daemon? > > This seems problematic to me, since multiple traces capturing the same event won't be able to reconcile their copies with each other. > > since timestamps have to match the event physical order in the streams, we need to assign one timestamp for each buffer. no way around this. Are the time-stamps issued by the tracepoint provider or by the "buffer registrar" (i.e. the time-stamp is looked up when the event is written to the buffer)? Daniel U. Thibault Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure Qu?bec QC G3J 1X5 CANADA Vox : (418) 844-4000 x4245 Fax : (418) 844-4538 NAC : 918V QSDJ Gouvernement du Canada | Government of Canada From mathieu.desnoyers at efficios.com Tue May 14 09:41:45 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 14 May 2013 09:41:45 -0400 Subject: [lttng-dev] User-space tracing by the root lttng-sessiond In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD12D1210D@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD12D1201A@VAL-E-02.valcartier.drdc-rddc.gc.ca> <20130514070545.GA5213@Krystal> <48CF5AC71E61DB46B70D0F388054EFFD12D1210D@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: <20130514134145.GA28060@Krystal> * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > > > (Question: If there were several users active at once, would there be > > > several root user-space lttng-consumerd daemons or still just one?) > > > > no > > Please clarify: no, there will be several root user-space > lttng-consumerd daemons or no, there will be just one root > user-space lttng-consumerd daemon? still just one. > > > > This seems problematic to me, since multiple traces capturing the same event won't be able to reconcile their copies with each other. > > > > since timestamps have to match the event physical order in the streams, we need to assign one timestamp for each buffer. no way around this. > > Are the time-stamps issued by the tracepoint provider or by the > "buffer registrar" (i.e. the time-stamp is looked up when the event > is written to the buffer)? the latter. Thanks, Mathieu > > Daniel U. Thibault > Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) > Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) > 2459 route de la Bravoure > Qu?bec QC G3J 1X5 > CANADA > Vox : (418) 844-4000 x4245 > Fax : (418) 844-4538 > NAC : 918V QSDJ > Gouvernement du Canada | Government of Canada > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Tue May 14 10:20:04 2013 From: dgoulet at efficios.com (David Goulet) Date: Tue, 14 May 2013 10:20:04 -0400 Subject: [lttng-dev] [PATCH lttng-tools 1/6] Tests: Cleanup and move gen-ust-events testapp under utils In-Reply-To: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> References: <1368484256-6666-1-git-send-email-christian.babeux@efficios.com> Message-ID: <51924814.3020509@efficios.com> All 6 patches merged. David Christian Babeux: > This will improve the maintainability and stop the copying madness going > on in each test needing a UST sample application. > > Application under test should go in tests/utils/testapp//. > > Signed-off-by: Christian Babeux > --- > configure.ac | 2 + > tests/utils/Makefile.am | 2 +- > tests/utils/testapp/Makefile.am | 2 + > tests/utils/testapp/gen-ust-events/Makefile.am | 15 ++++++ > .../utils/testapp/gen-ust-events/gen-ust-events.c | 58 ++++++++++++++++++++++ > tests/utils/testapp/gen-ust-events/tp.c | 15 ++++++ > tests/utils/testapp/gen-ust-events/tp.h | 56 +++++++++++++++++++++ > 7 files changed, 149 insertions(+), 1 deletion(-) > create mode 100644 tests/utils/testapp/Makefile.am > create mode 100644 tests/utils/testapp/gen-ust-events/Makefile.am > create mode 100644 tests/utils/testapp/gen-ust-events/gen-ust-events.c > create mode 100644 tests/utils/testapp/gen-ust-events/tp.c > create mode 100644 tests/utils/testapp/gen-ust-events/tp.h > > diff --git a/configure.ac b/configure.ac > index 650ae7f..9f14c12 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -341,6 +341,8 @@ AC_CONFIG_FILES([ > tests/unit/Makefile > tests/utils/Makefile > tests/utils/tap/Makefile > + tests/utils/testapp/Makefile > + tests/utils/testapp/gen-ust-events/Makefile > ]) > > AC_OUTPUT > diff --git a/tests/utils/Makefile.am b/tests/utils/Makefile.am > index 25c6e04..e0de483 100644 > --- a/tests/utils/Makefile.am > +++ b/tests/utils/Makefile.am > @@ -1,4 +1,4 @@ > -SUBDIRS = tap > +SUBDIRS = tap testapp > > EXTRA_DIST = utils.sh test_utils.py > dist_noinst_SCRIPTS = utils.sh test_utils.py > diff --git a/tests/utils/testapp/Makefile.am b/tests/utils/testapp/Makefile.am > new file mode 100644 > index 0000000..8b631ee > --- /dev/null > +++ b/tests/utils/testapp/Makefile.am > @@ -0,0 +1,2 @@ > +SUBDIRS = gen-ust-events > + > diff --git a/tests/utils/testapp/gen-ust-events/Makefile.am b/tests/utils/testapp/gen-ust-events/Makefile.am > new file mode 100644 > index 0000000..1be5835 > --- /dev/null > +++ b/tests/utils/testapp/gen-ust-events/Makefile.am > @@ -0,0 +1,15 @@ > +AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(srcdir) -O2 -g > +AM_LDFLAGS = > + > +if LTTNG_TOOLS_BUILD_WITH_LIBDL > +AM_LDFLAGS += -ldl > +endif > +if LTTNG_TOOLS_BUILD_WITH_LIBC_DL > +AM_LDFLAGS += -lc > +endif > + > +if HAVE_LIBLTTNG_UST_CTL > +noinst_PROGRAMS = gen-ust-events > +gen_ust_events_SOURCES = gen-ust-events.c tp.c tp.h > +gen_ust_events_LDADD = -llttng-ust > +endif > diff --git a/tests/utils/testapp/gen-ust-events/gen-ust-events.c b/tests/utils/testapp/gen-ust-events/gen-ust-events.c > new file mode 100644 > index 0000000..edf40ee > --- /dev/null > +++ b/tests/utils/testapp/gen-ust-events/gen-ust-events.c > @@ -0,0 +1,58 @@ > +/* > + * Copyright (C) - 2012 David Goulet > + * > + * This library is free software; you can redistribute it and/or modify it > + * under the terms of the GNU Lesser General Public License as published by the > + * Free Software Foundation; version 2.1 of the License. > + * > + * This library is distributed in the hope that it will be useful, but WITHOUT > + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License > + * for more details. > + * > + * You should have received a copy of the GNU Lesser General Public License > + * along with this library; if not, write to the Free Software Foundation, > + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define TRACEPOINT_DEFINE > +#include "tp.h" > + > +int main(int argc, char **argv) > +{ > + int i, netint; > + long values[] = { 1, 2, 3 }; > + char text[10] = "test"; > + double dbl = 2.0; > + float flt = 2222.0; > + unsigned int nr_iter = 100; > + useconds_t nr_usec = 0; > + > + if (argc >= 2) { > + nr_iter = atoi(argv[1]); > + } > + > + if (argc == 3) { > + /* By default, don't wait unless user specifies. */ > + nr_usec = atoi(argv[2]); > + } > + > + for (i = 0; i < nr_iter; i++) { > + netint = htonl(i); > + tracepoint(tp, tptest, i, netint, values, text, strlen(text), > + dbl, flt); > + usleep(nr_usec); > + } > + > + return 0; > +} > diff --git a/tests/utils/testapp/gen-ust-events/tp.c b/tests/utils/testapp/gen-ust-events/tp.c > new file mode 100644 > index 0000000..a09561d > --- /dev/null > +++ b/tests/utils/testapp/gen-ust-events/tp.c > @@ -0,0 +1,15 @@ > +/* > + * Copyright (c) - 2012 David Goulet > + * > + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR > + * IMPLIED. ANY USE IS AT YOUR OWN RISK. > + * > + * Permission is hereby granted to use or copy this program for any purpose, > + * provided the above notices are retained on all copies. Permission to modify > + * the code and to distribute modified code is granted, provided the above > + * notices are retained, and a notice that the code was modified is included > + * with the above copyright notice. > + */ > + > +#define TRACEPOINT_CREATE_PROBES > +#include "tp.h" > diff --git a/tests/utils/testapp/gen-ust-events/tp.h b/tests/utils/testapp/gen-ust-events/tp.h > new file mode 100644 > index 0000000..6ffbc32 > --- /dev/null > +++ b/tests/utils/testapp/gen-ust-events/tp.h > @@ -0,0 +1,56 @@ > +#undef TRACEPOINT_PROVIDER > +#define TRACEPOINT_PROVIDER tp > + > +#if !defined(_TRACEPOINT_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ) > +#define _TRACEPOINT_TP_H > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +/* > + * Copyright (C) 2011 Mathieu Desnoyers > + * > + * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED > + * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. > + * > + * Permission is hereby granted to use or copy this program > + * for any purpose, provided the above notices are retained on all copies. > + * Permission to modify the code and to distribute modified code is granted, > + * provided the above notices are retained, and a notice that the code was > + * modified is included with the above copyright notice. > + */ > + > +#include > + > +TRACEPOINT_EVENT(tp, tptest, > + TP_ARGS(int, anint, int, netint, long *, values, > + char *, text, size_t, textlen, > + double, doublearg, float, floatarg), > + TP_FIELDS( > + ctf_integer(int, intfield, anint) > + ctf_integer_hex(int, intfield2, anint) > + ctf_integer(long, longfield, anint) > + ctf_integer_network(int, netintfield, netint) > + ctf_integer_network_hex(int, netintfieldhex, netint) > + ctf_array(long, arrfield1, values, 3) > + ctf_array_text(char, arrfield2, text, 10) > + ctf_sequence(char, seqfield1, text, size_t, textlen) > + ctf_sequence_text(char, seqfield2, text, size_t, textlen) > + ctf_string(stringfield, text) > + ctf_float(float, floatfield, floatarg) > + ctf_float(double, doublefield, doublearg) > + ) > +) > + > +#endif /* _TRACEPOINT_TP_H */ > + > +#undef TRACEPOINT_INCLUDE_FILE > +#define TRACEPOINT_INCLUDE_FILE ./tp.h > + > +/* This part must be outside ifdef protection */ > +#include > + > +#ifdef __cplusplus > +} > +#endif From dgoulet at efficios.com Tue May 14 10:20:23 2013 From: dgoulet at efficios.com (David Goulet) Date: Tue, 14 May 2013 10:20:23 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Tests: Remove unused utils.h header In-Reply-To: <1368481863-10412-1-git-send-email-christian.babeux@efficios.com> References: <1368481863-10412-1-git-send-email-christian.babeux@efficios.com> Message-ID: <51924827.9040907@efficios.com> Merged with a small modification that removes the include in one of the unit test. David Christian Babeux: > Signed-off-by: Christian Babeux > --- > tests/utils/Makefile.am | 4 ++-- > tests/utils/utils.h | 43 ------------------------------------------- > 2 files changed, 2 insertions(+), 45 deletions(-) > delete mode 100644 tests/utils/utils.h > > diff --git a/tests/utils/Makefile.am b/tests/utils/Makefile.am > index 1b362fc..25c6e04 100644 > --- a/tests/utils/Makefile.am > +++ b/tests/utils/Makefile.am > @@ -1,4 +1,4 @@ > SUBDIRS = tap > > -EXTRA_DIST = utils.sh utils.h test_utils.py > -dist_noinst_SCRIPTS = utils.sh utils.h test_utils.py > +EXTRA_DIST = utils.sh test_utils.py > +dist_noinst_SCRIPTS = utils.sh test_utils.py > diff --git a/tests/utils/utils.h b/tests/utils/utils.h > deleted file mode 100644 > index 94891c0..0000000 > --- a/tests/utils/utils.h > +++ /dev/null > @@ -1,43 +0,0 @@ > -/* > - * Copyright (c) - 2011 David Goulet > - * > - * This program is free software; you can redistribute it and/or modify it > - * under the terms of the GNU General Public License as published by as > - * published by the Free Software Foundation; only version 2 of the License. > - * > - * This program is distributed in the hope that it will be useful, but WITHOUT > - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > - * more details. > - * > - * You should have received a copy of the GNU General Public License along with > - * this program; if not, write to the Free Software Foundation, Inc., 51 > - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > - */ > - > -#include > -#include > - > -#define BRIGHT 1 > -#define GREEN 32 > -#define RED 31 > - > -#define PRINT_OK() \ > -do { \ > - /* Check for color support */ \ > - if (isatty(STDOUT_FILENO)) { \ > - printf("%c[%d;%dmOK%c[%dm\n", 0x1B, BRIGHT, GREEN, 0x1B, 0); \ > - } else { \ > - printf("OK\n"); \ > - } \ > -} while (0) > - > -#define PRINT_FAIL() \ > -do { \ > - /* Check for color support */ \ > - if (isatty(STDOUT_FILENO)) { \ > - printf("%c[%d;%dmFAIL%c[%dm\n", 0x1B, BRIGHT, RED, 0x1B, 0); \ > - } else { \ > - printf("FAIL\n"); \ > - } \ > -} while (0) From simon.marchi at polymtl.ca Tue May 14 13:38:29 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Tue, 14 May 2013 13:38:29 -0400 Subject: [lttng-dev] [PATCH] Fix linker library order In-Reply-To: <20130514123724.GA24238@Krystal> References: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> <20130512025917.GB405@Krystal> <519161C8.5000305@voxpopuli.im> <20130514065244.GA5066@Krystal> <20130514123724.GA24238@Krystal> Message-ID: On 14 May 2013 08:37, Mathieu Desnoyers wrote: > > * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: > > * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > > > On 13-05-11 10:59 PM, Mathieu Desnoyers wrote: > > > > * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: > > > >> Libraries must be specified after the binary target. > > > > merged, thanks! > > > > > > > > Mathieu > > > > > > This seems to have broken the daily PPA packages: > > > https://launchpadlibrarian.net/139804087/buildlog_ubuntu-saucy-amd64.lttng-ust_2.2~pre-0%2Bbzr1574%2Bpack37%2B201305131247~saucy1_FAILEDTOBUILD.txt.gz > > > > > > That package has no particular patches. If I build it locally from > > > source it builds fine, but if I build the package locally (with > > > dpkg-buildpackage), I get the same error. It could be related to the > > > --as-needed problem we've had before... > > > > Francis, can you explain why your change was needed in the first place ? > > Hrm, actually, these patches are wrong. I believe these patches are correct. > > commit 725e63c5194bfdcde0a2a3507aca156ba36cf49f for instance: > > "Libraries must be specified after the binary target." > > demo: demo.o > - $(CC) -o $@ $(LIBS) $^ > + $(CC) -o $@ $^ $(LIBS) > > the binary target here is "$@". > > $^ is the source file name (demo.c). > > this patch moves the source file name prior to the libraries, which is > incorrect (ref: gcc(1)). The input files should appear last. > > So it breaks builds where $(LIBS) is non-empty. Actually, $^ here is "demo.o", not "demo. Also, the libs should appear after the objects on the command line. See the "-l" section in http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html. On most setup this doesn't matter, since -Wl,--no-as-needed was the default pretty much everywhere. Ubuntu decided to use -Wl,--as-needed to avoid unnecessary dependencies, so the order becomes important. If you try to manual build on a recent Ubuntu you will get undefined references to dlopen and such. So this patch is good. If you read carefully the log sent by Alexandre, you see that it is when building the shared libs in this directory (lttng-ust-provider-ust-tests-demo.so) that the build fails. I don't know why it fails, but Alexandre hinted that passing "-fPIE -pie" to build a shared library is weird (it is usually -fPIC -pic). I am not sure where that comes from. This behaviour only happens when building the package, not when building manually. > > I will revert commits: > > commit a51ac6d9a011ba10b0be396dc1e801b2fc829651 > Author: Francis Giraldeau > Date: Sat May 11 22:59:21 2013 -0400 > > Fix (another) linker library order > > Libraries must be specified after the binary target. > > Signed-off-by: Francis Giraldeau > Signed-off-by: Mathieu Desnoyers > > commit 725e63c5194bfdcde0a2a3507aca156ba36cf49f > Author: Francis Giraldeau > Date: Sat May 11 22:58:12 2013 -0400 > > Fix linker library order > > Libraries must be specified after the binary target. > > Signed-off-by: Francis Giraldeau > Signed-off-by: Mathieu Desnoyers > > > Thanks, > > Mathieu > > > > > Thanks, > > > > Mathieu > > > > > > > > Cheers, > > > Alex > > > > > > > > > > >> Signed-off-by: Francis Giraldeau > > > >> --- > > > >> doc/examples/demo/Makefile | 2 +- > > > >> 1 file changed, 1 insertion(+), 1 deletion(-) > > > >> > > > >> diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile > > > >> index 7ae6547..bbc8ccb 100644 > > > >> --- a/doc/examples/demo/Makefile > > > >> +++ b/doc/examples/demo/Makefile > > > >> @@ -55,7 +55,7 @@ demo.o: demo.c > > > >> $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > > > >> > > > >> demo: demo.o > > > >> - $(CC) -o $@ $(LIBS) $^ > > > >> + $(CC) -o $@ $^ $(LIBS) > > > >> > > > >> .PHONY: clean > > > >> clean: > > > >> -- > > > >> 1.8.1.2 > > > >> > > > >> > > > >> _______________________________________________ > > > >> lttng-dev mailing list > > > >> lttng-dev at lists.lttng.org > > > >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > > > > -- > > Mathieu Desnoyers > > EfficiOS Inc. > > http://www.efficios.com > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From dgoulet at efficios.com Tue May 14 13:52:13 2013 From: dgoulet at efficios.com (David Goulet) Date: Tue, 14 May 2013 13:52:13 -0400 Subject: [lttng-dev] [PATCH 1/3 lttng-tools] Change consumer_data_pipe to be a lttng_pipe Message-ID: <1368553935-17162-1-git-send-email-dgoulet@efficios.com> Also, an important change here is that this pipe is no longer in non block mode. Before sending stream's pointer over this pipe, only one byte was written thus making it unlikely to fail in a read/write race condition between threads. Now, 4 bytes are written so keeping this pipe non block with threads is a bit of a "looking for trouble situation". The lttng pipe wrappers make sure that the read and write side are synchronized between threads using a mutex for each side. Furthermore, the read and write handle partial I/O and EINTR meaning that once the call returns we are sure that either everything was read/written or an error occured thus making it not possible for the read side to block indefinitely after a poll event. Signed-off-by: David Goulet --- src/common/consumer.c | 53 ++++++++++++-------------- src/common/consumer.h | 3 +- src/common/kernel-consumer/kernel-consumer.c | 3 +- src/common/ust-consumer/ust-consumer.c | 2 +- 4 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/common/consumer.c b/src/common/consumer.c index 01266a7..bd618dd 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -91,6 +91,20 @@ static void notify_thread_pipe(int wpipe) } while (ret < 0 && errno == EINTR); } +/* + * Notify a thread lttng pipe to poll back again. This usually means that some + * global state has changed so we just send back the thread in a poll wait + * call. + */ +static void notify_thread_lttng_pipe(struct lttng_pipe *pipe) +{ + struct lttng_consumer_stream *null_stream = NULL; + + assert(pipe); + + (void) lttng_pipe_write(pipe, &null_stream, sizeof(null_stream)); +} + static void notify_channel_pipe(struct lttng_consumer_local_data *ctx, struct lttng_consumer_channel *chan, uint64_t key, @@ -406,7 +420,7 @@ static void cleanup_relayd(struct consumer_relayd_sock_pair *relayd, * read of this status which happens AFTER receiving this notify. */ if (ctx) { - notify_thread_pipe(ctx->consumer_data_pipe[1]); + notify_thread_lttng_pipe(ctx->consumer_data_pipe); notify_thread_pipe(ctx->consumer_metadata_pipe[1]); } } @@ -971,7 +985,7 @@ static int update_poll_array(struct lttng_consumer_local_data *ctx, * Insert the consumer_data_pipe at the end of the array and don't * increment i so nb_fd is the number of real FD. */ - (*pollfd)[i].fd = ctx->consumer_data_pipe[0]; + (*pollfd)[i].fd = lttng_pipe_get_readfd(ctx->consumer_data_pipe); (*pollfd)[i].events = POLLIN | POLLPRI; return i; } @@ -1167,26 +1181,11 @@ struct lttng_consumer_local_data *lttng_consumer_create( ctx->on_recv_stream = recv_stream; ctx->on_update_stream = update_stream; - ret = pipe(ctx->consumer_data_pipe); - if (ret < 0) { - PERROR("Error creating poll pipe"); + ctx->consumer_data_pipe = lttng_pipe_open(0); + if (!ctx->consumer_data_pipe) { goto error_poll_pipe; } - /* set read end of the pipe to non-blocking */ - ret = fcntl(ctx->consumer_data_pipe[0], F_SETFL, O_NONBLOCK); - if (ret < 0) { - PERROR("fcntl O_NONBLOCK"); - goto error_poll_fcntl; - } - - /* set write end of the pipe to non-blocking */ - ret = fcntl(ctx->consumer_data_pipe[1], F_SETFL, O_NONBLOCK); - if (ret < 0) { - PERROR("fcntl O_NONBLOCK"); - goto error_poll_fcntl; - } - ret = pipe(ctx->consumer_should_quit); if (ret < 0) { PERROR("Error creating recv pipe"); @@ -1225,9 +1224,8 @@ error_channel_pipe: utils_close_pipe(ctx->consumer_thread_pipe); error_thread_pipe: utils_close_pipe(ctx->consumer_should_quit); -error_poll_fcntl: error_quit_pipe: - utils_close_pipe(ctx->consumer_data_pipe); + lttng_pipe_destroy(ctx->consumer_data_pipe); error_poll_pipe: free(ctx); error: @@ -1253,7 +1251,7 @@ void lttng_consumer_destroy(struct lttng_consumer_local_data *ctx) } utils_close_pipe(ctx->consumer_thread_pipe); utils_close_pipe(ctx->consumer_channel_pipe); - utils_close_pipe(ctx->consumer_data_pipe); + lttng_pipe_destroy(ctx->consumer_data_pipe); utils_close_pipe(ctx->consumer_should_quit); utils_close_pipe(ctx->consumer_splice_metadata_pipe); @@ -2402,13 +2400,10 @@ void *consumer_thread_data_poll(void *data) ssize_t pipe_readlen; DBG("consumer_data_pipe wake up"); - /* Consume 1 byte of pipe data */ - do { - pipe_readlen = read(ctx->consumer_data_pipe[0], &new_stream, - sizeof(new_stream)); - } while (pipe_readlen == -1 && errno == EINTR); + pipe_readlen = lttng_pipe_read(ctx->consumer_data_pipe, + &new_stream, sizeof(new_stream)); if (pipe_readlen < 0) { - PERROR("read consumer data pipe"); + ERR("Consumer data pipe ret %ld", pipe_readlen); /* Continue so we can at least handle the current stream(s). */ continue; } @@ -2968,7 +2963,7 @@ end: * Notify the data poll thread to poll back again and test the * consumer_quit state that we just set so to quit gracefully. */ - notify_thread_pipe(ctx->consumer_data_pipe[1]); + notify_thread_lttng_pipe(ctx->consumer_data_pipe); notify_channel_pipe(ctx, NULL, -1, CONSUMER_CHANNEL_QUIT); diff --git a/src/common/consumer.h b/src/common/consumer.h index 43989e4..91039e8 100644 --- a/src/common/consumer.h +++ b/src/common/consumer.h @@ -31,6 +31,7 @@ #include #include #include +#include /* Commands for consumer */ enum lttng_consumer_command { @@ -346,7 +347,7 @@ struct lttng_consumer_local_data { int consumer_channel_pipe[2]; int consumer_splice_metadata_pipe[2]; /* Data stream poll thread pipe. To transfer data stream to the thread */ - int consumer_data_pipe[2]; + struct lttng_pipe *consumer_data_pipe; /* to let the signal handler wake up the fd receiver thread */ int consumer_should_quit[2]; /* Metadata poll thread pipe. Transfer metadata stream to it */ diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index 2cf9ac1..d8aec49 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -289,7 +290,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, if (new_stream->metadata_flag) { stream_pipe = ctx->consumer_metadata_pipe[1]; } else { - stream_pipe = ctx->consumer_data_pipe[1]; + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); } do { diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 031a7cb..ddf80da 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -191,7 +191,7 @@ static int send_stream_to_thread(struct lttng_consumer_stream *stream, if (stream->metadata_flag) { stream_pipe = ctx->consumer_metadata_pipe[1]; } else { - stream_pipe = ctx->consumer_data_pipe[1]; + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); } do { -- 1.7.10.4 From dgoulet at efficios.com Tue May 14 13:52:14 2013 From: dgoulet at efficios.com (David Goulet) Date: Tue, 14 May 2013 13:52:14 -0400 Subject: [lttng-dev] [PATCH 2/3 lttng-tools] Change consumer_metadata_pipe to be a lttng_pipe In-Reply-To: <1368553935-17162-1-git-send-email-dgoulet@efficios.com> References: <1368553935-17162-1-git-send-email-dgoulet@efficios.com> Message-ID: <1368553935-17162-2-git-send-email-dgoulet@efficios.com> Signed-off-by: David Goulet --- src/common/consumer.c | 42 ++++++++------------------ src/common/consumer.h | 2 +- src/common/kernel-consumer/kernel-consumer.c | 2 +- src/common/ust-consumer/ust-consumer.c | 2 +- 4 files changed, 15 insertions(+), 33 deletions(-) diff --git a/src/common/consumer.c b/src/common/consumer.c index bd618dd..ef35927 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -77,21 +77,6 @@ static struct lttng_ht *metadata_ht; static struct lttng_ht *data_ht; /* - * Notify a thread pipe to poll back again. This usually means that some global - * state has changed so we just send back the thread in a poll wait call. - */ -static void notify_thread_pipe(int wpipe) -{ - int ret; - - do { - struct lttng_consumer_stream *null_stream = NULL; - - ret = write(wpipe, &null_stream, sizeof(null_stream)); - } while (ret < 0 && errno == EINTR); -} - -/* * Notify a thread lttng pipe to poll back again. This usually means that some * global state has changed so we just send back the thread in a poll wait * call. @@ -421,7 +406,7 @@ static void cleanup_relayd(struct consumer_relayd_sock_pair *relayd, */ if (ctx) { notify_thread_lttng_pipe(ctx->consumer_data_pipe); - notify_thread_pipe(ctx->consumer_metadata_pipe[1]); + notify_thread_lttng_pipe(ctx->consumer_metadata_pipe); } } @@ -1204,8 +1189,8 @@ struct lttng_consumer_local_data *lttng_consumer_create( goto error_channel_pipe; } - ret = utils_create_pipe(ctx->consumer_metadata_pipe); - if (ret < 0) { + ctx->consumer_metadata_pipe = lttng_pipe_open(0); + if (!ctx->consumer_metadata_pipe) { goto error_metadata_pipe; } @@ -1217,7 +1202,7 @@ struct lttng_consumer_local_data *lttng_consumer_create( return ctx; error_splice_pipe: - utils_close_pipe(ctx->consumer_metadata_pipe); + lttng_pipe_destroy(ctx->consumer_metadata_pipe); error_metadata_pipe: utils_close_pipe(ctx->consumer_channel_pipe); error_channel_pipe: @@ -1252,6 +1237,7 @@ void lttng_consumer_destroy(struct lttng_consumer_local_data *ctx) utils_close_pipe(ctx->consumer_thread_pipe); utils_close_pipe(ctx->consumer_channel_pipe); lttng_pipe_destroy(ctx->consumer_data_pipe); + lttng_pipe_destroy(ctx->consumer_metadata_pipe); utils_close_pipe(ctx->consumer_should_quit); utils_close_pipe(ctx->consumer_splice_metadata_pipe); @@ -2132,7 +2118,8 @@ void *consumer_thread_metadata_poll(void *data) goto end_poll; } - ret = lttng_poll_add(&events, ctx->consumer_metadata_pipe[0], LPOLLIN); + ret = lttng_poll_add(&events, + lttng_pipe_get_readfd(ctx->consumer_metadata_pipe), LPOLLIN); if (ret < 0) { goto end; } @@ -2170,18 +2157,16 @@ restart: continue; } - if (pollfd == ctx->consumer_metadata_pipe[0]) { + if (pollfd == lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)) { if (revents & (LPOLLERR | LPOLLHUP )) { DBG("Metadata thread pipe hung up"); /* * Remove the pipe from the poll set and continue the loop * since their might be data to consume. */ - lttng_poll_del(&events, ctx->consumer_metadata_pipe[0]); - ret = close(ctx->consumer_metadata_pipe[0]); - if (ret < 0) { - PERROR("close metadata pipe"); - } + lttng_poll_del(&events, + lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)); + lttng_pipe_read_close(ctx->consumer_metadata_pipe); continue; } else if (revents & LPOLLIN) { do { @@ -2541,10 +2526,7 @@ end: * only tracked fd in the poll set. The thread will take care of closing * the read side. */ - ret = close(ctx->consumer_metadata_pipe[1]); - if (ret < 0) { - PERROR("close data pipe"); - } + (void) lttng_pipe_write_close(ctx->consumer_metadata_pipe); destroy_data_stream_ht(data_ht); diff --git a/src/common/consumer.h b/src/common/consumer.h index 91039e8..3726fd1 100644 --- a/src/common/consumer.h +++ b/src/common/consumer.h @@ -351,7 +351,7 @@ struct lttng_consumer_local_data { /* to let the signal handler wake up the fd receiver thread */ int consumer_should_quit[2]; /* Metadata poll thread pipe. Transfer metadata stream to it */ - int consumer_metadata_pipe[2]; + struct lttng_pipe *consumer_metadata_pipe; }; /* diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index d8aec49..f23fc9c 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -288,7 +288,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, /* Get the right pipe where the stream will be sent. */ if (new_stream->metadata_flag) { - stream_pipe = ctx->consumer_metadata_pipe[1]; + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); } else { stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); } diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index ddf80da..a81e9d4 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -189,7 +189,7 @@ static int send_stream_to_thread(struct lttng_consumer_stream *stream, /* Get the right pipe where the stream will be sent. */ if (stream->metadata_flag) { - stream_pipe = ctx->consumer_metadata_pipe[1]; + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); } else { stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); } -- 1.7.10.4 From dgoulet at efficios.com Tue May 14 13:52:15 2013 From: dgoulet at efficios.com (David Goulet) Date: Tue, 14 May 2013 13:52:15 -0400 Subject: [lttng-dev] [PATCH 3/3 lttng-tools] Fix: use lttng pipe to send new stream to thread In-Reply-To: <1368553935-17162-1-git-send-email-dgoulet@efficios.com> References: <1368553935-17162-1-git-send-email-dgoulet@efficios.com> Message-ID: <1368553935-17162-3-git-send-email-dgoulet@efficios.com> Signed-off-by: David Goulet --- src/common/kernel-consumer/kernel-consumer.c | 15 +++++++-------- src/common/ust-consumer/ust-consumer.c | 16 ++++++++-------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index f23fc9c..d985014 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -168,7 +168,8 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, } case LTTNG_CONSUMER_ADD_STREAM: { - int fd, stream_pipe; + int fd; + struct lttng_pipe *stream_pipe; struct consumer_relayd_sock_pair *relayd = NULL; struct lttng_consumer_stream *new_stream; struct lttng_consumer_channel *channel; @@ -288,18 +289,16 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, /* Get the right pipe where the stream will be sent. */ if (new_stream->metadata_flag) { - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); + stream_pipe = ctx->consumer_metadata_pipe; } else { - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); + stream_pipe = ctx->consumer_data_pipe; } - do { - ret = write(stream_pipe, &new_stream, sizeof(new_stream)); - } while (ret < 0 && errno == EINTR); + ret = lttng_pipe_write(stream_pipe, &new_stream, sizeof(new_stream)); if (ret < 0) { - PERROR("Consumer write %s stream to pipe %d", + ERR("Consumer write %s stream to pipe %d", new_stream->metadata_flag ? "metadata" : "data", - stream_pipe); + lttng_pipe_get_writefd(stream_pipe)); consumer_del_stream(new_stream, NULL); goto end_nosignal; } diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index a81e9d4..fa46634 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -185,21 +185,21 @@ error: static int send_stream_to_thread(struct lttng_consumer_stream *stream, struct lttng_consumer_local_data *ctx) { - int ret, stream_pipe; + int ret; + struct lttng_pipe *stream_pipe; /* Get the right pipe where the stream will be sent. */ if (stream->metadata_flag) { - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); + stream_pipe = ctx->consumer_metadata_pipe; } else { - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); + stream_pipe = ctx->consumer_data_pipe; } - do { - ret = write(stream_pipe, &stream, sizeof(stream)); - } while (ret < 0 && errno == EINTR); + ret = lttng_pipe_write(stream_pipe, &stream, sizeof(stream)); if (ret < 0) { - PERROR("Consumer write %s stream to pipe %d", - stream->metadata_flag ? "metadata" : "data", stream_pipe); + ERR("Consumer write %s stream to pipe %d", + stream->metadata_flag ? "metadata" : "data", + lttng_pipe_get_writefd(stream_pipe)); } return ret; -- 1.7.10.4 From francis.giraldeau at gmail.com Tue May 14 14:32:24 2013 From: francis.giraldeau at gmail.com (Francis Giraldeau) Date: Tue, 14 May 2013 14:32:24 -0400 Subject: [lttng-dev] [PATCH] Fix linker library order In-Reply-To: References: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> <20130512025917.GB405@Krystal> <519161C8.5000305@voxpopuli.im> <20130514065244.GA5066@Krystal> <20130514123724.GA24238@Krystal> Message-ID: <51928338.1050004@gmail.com> Le 2013-05-14 13:38, Simon Marchi a ?crit : > On 14 May 2013 08:37, Mathieu Desnoyers wrote: >> * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: >>> * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: >>>> On 13-05-11 10:59 PM, Mathieu Desnoyers wrote: >>>>> * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: >>>>>> Libraries must be specified after the binary target. >>>>> merged, thanks! >>>>> >>>>> Mathieu >>>> This seems to have broken the daily PPA packages: >>>> https://launchpadlibrarian.net/139804087/buildlog_ubuntu-saucy-amd64.lttng-ust_2.2~pre-0%2Bbzr1574%2Bpack37%2B201305131247~saucy1_FAILEDTOBUILD.txt.gz >>>> >>>> That package has no particular patches. If I build it locally from >>>> source it builds fine, but if I build the package locally (with >>>> dpkg-buildpackage), I get the same error. It could be related to the >>>> --as-needed problem we've had before... >>> Francis, can you explain why your change was needed in the first place ? >> Hrm, actually, these patches are wrong. > > I believe these patches are correct. > >> commit 725e63c5194bfdcde0a2a3507aca156ba36cf49f for instance: >> >> "Libraries must be specified after the binary target." >> >> demo: demo.o >> - $(CC) -o $@ $(LIBS) $^ >> + $(CC) -o $@ $^ $(LIBS) >> >> the binary target here is "$@". >> >> $^ is the source file name (demo.c). >> >> this patch moves the source file name prior to the libraries, which is >> incorrect (ref: gcc(1)). The input files should appear last. >> >> So it breaks builds where $(LIBS) is non-empty. > Actually, $^ here is "demo.o", not "demo. Also, the libs should appear > after the objects on the command line. See the "-l" section in > http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html. On most setup > this doesn't matter, since -Wl,--no-as-needed was the default pretty > much everywhere. Ubuntu decided to use -Wl,--as-needed to avoid > unnecessary dependencies, so the order becomes important. If you try > to manual build on a recent Ubuntu you will get undefined references > to dlopen and such. So this patch is good. > > If you read carefully the log sent by Alexandre, you see that it is > when building the shared libs in this directory > (lttng-ust-provider-ust-tests-demo.so) that the build fails. I don't > know why it fails, but Alexandre hinted that passing "-fPIE -pie" to > build a shared library is weird (it is usually -fPIC -pic). I am not > sure where that comes from. This behaviour only happens when building > the package, not when building manually. It seems quite right. Here is what happens with prior library order: $ cd lttng-ust/doc/examples/demo $ make gcc -o demo -ldl demo.o demo.o: In function `__tracepoint__init_urcu_sym': demo.c:(.text+0x20): undefined reference to `dlsym' By inverting library order as specified in patches, the compilation succeeds: $ make gcc -o demo demo.o -ldl So, reverting the patches will break the build. We should look at the other problem related to packaging and fix it. Thanks, Francis -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4489 bytes Desc: Signature cryptographique S/MIME URL: From francis.giraldeau at gmail.com Tue May 14 16:15:32 2013 From: francis.giraldeau at gmail.com (Francis Giraldeau) Date: Tue, 14 May 2013 16:15:32 -0400 Subject: [lttng-dev] [PATCH] Remove -pie flag for shared library Message-ID: <1368562532-19566-1-git-send-email-francis.giraldeau@gmail.com> Some build environment with hardening enabled adds -pie flags to LDFLAGS. While it's required for ELF binaries, it doesn't make sens for shared libraries. For this case, filter-out the erroneous option. Signed-off-by: Francis Giraldeau --- doc/examples/demo/Makefile | 6 ++++-- doc/examples/easy-ust/Makefile | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile index bbc8ccb..3145146 100644 --- a/doc/examples/demo/Makefile +++ b/doc/examples/demo/Makefile @@ -34,6 +34,8 @@ EMPTY_AUTOMAKE_TARGETS = distdir install install-data install-exec uninstall \ $(EMPTY_AUTOMAKE_TARGETS): endif +CLEAN_LDFLAGS = $(filter-out -pie,$(LDFLAGS)) + all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so tp.o: tp.c ust_tests_demo.h @@ -43,13 +45,13 @@ tp2.o: tp2.c ust_tests_demo2.h $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o - $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $^ + $(CC) -shared -o $@ $(CLEAN_LDFLAGS) -llttng-ust $^ tp3.o: tp3.c ust_tests_demo3.h $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< lttng-ust-provider-ust-tests-demo3.so: tp3.o - $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $^ + $(CC) -shared -o $@ $(CLEAN_LDFLAGS) -llttng-ust $^ demo.o: demo.c $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< diff --git a/doc/examples/easy-ust/Makefile b/doc/examples/easy-ust/Makefile index e20e53a..e95a2c5 100644 --- a/doc/examples/easy-ust/Makefile +++ b/doc/examples/easy-ust/Makefile @@ -36,10 +36,12 @@ EMPTY_AUTOMAKE_TARGETS = distdir install install-data install-exec uninstall \ $(EMPTY_AUTOMAKE_TARGETS): endif +CLEAN_LDFLAGS = $(filter-out -pie,$(LDFLAGS)) + all: sample sample: sample.o tp.o - $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) + $(CC) -o $@ $^ $(CLEAN_LDFLAGS) $(LIBS) sample.o: sample.c sample_component_provider.h $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< -- 1.8.1.2 From alexmonthy at voxpopuli.im Tue May 14 16:51:01 2013 From: alexmonthy at voxpopuli.im (Alexandre Montplaisir) Date: Tue, 14 May 2013 16:51:01 -0400 Subject: [lttng-dev] [PATCH] Fix linker library order In-Reply-To: References: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> <20130512025917.GB405@Krystal> <519161C8.5000305@voxpopuli.im> <20130514065244.GA5066@Krystal> <20130514123724.GA24238@Krystal> Message-ID: <5192A3B5.6080302@voxpopuli.im> On 13-05-14 01:38 PM, Simon Marchi wrote: > [...] > > If you read carefully the log sent by Alexandre, you see that it is > when building the shared libs in this directory > (lttng-ust-provider-ust-tests-demo.so) that the build fails. I don't > know why it fails, but Alexandre hinted that passing "-fPIE -pie" to > build a shared library is weird (it is usually -fPIC -pic). I am not > sure where that comes from. This behaviour only happens when building > the package, not when building manually. We build the daily packages with all Debian security options (this is kind of a future-proofing to find problems like this one, I don't think the "real" Debian packages use it). See http://wiki.debian.org/Hardening#DEB_BUILD_HARDENING_PIE_.28gcc.2Fg.2B-.2B-_-fPIE_-pie.29 So far it handled the autotools-powered Makefiles correctly (libraries are built with -fPIC, binaries with -fPIE), but it seems to cause problems with hand-written Makefiles like the one in doc/examples/demo. We could fix it with a package-specific patch, either by using autotools to build this directory, or maybe not building it at all, since it's just an example that we don't install... Thanks all, Alex From jeremie.galarneau at efficios.com Tue May 14 16:55:40 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Tue, 14 May 2013 16:55:40 -0400 Subject: [lttng-dev] [PATCH] Fix linker library order In-Reply-To: <5192A3B5.6080302@voxpopuli.im> References: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> <20130512025917.GB405@Krystal> <519161C8.5000305@voxpopuli.im> <20130514065244.GA5066@Krystal> <20130514123724.GA24238@Krystal> <5192A3B5.6080302@voxpopuli.im> Message-ID: Francis has already submitted a patch but we could also add a "--disable-examples" switch to configure if hand-crafted Makefiles become a problem. On Tue, May 14, 2013 at 4:51 PM, Alexandre Montplaisir wrote: > On 13-05-14 01:38 PM, Simon Marchi wrote: >> [...] >> >> If you read carefully the log sent by Alexandre, you see that it is >> when building the shared libs in this directory >> (lttng-ust-provider-ust-tests-demo.so) that the build fails. I don't >> know why it fails, but Alexandre hinted that passing "-fPIE -pie" to >> build a shared library is weird (it is usually -fPIC -pic). I am not >> sure where that comes from. This behaviour only happens when building >> the package, not when building manually. > > We build the daily packages with all Debian security options (this is > kind of a future-proofing to find problems like this one, I don't think > the "real" Debian packages use it). > > See > http://wiki.debian.org/Hardening#DEB_BUILD_HARDENING_PIE_.28gcc.2Fg.2B-.2B-_-fPIE_-pie.29 > > So far it handled the autotools-powered Makefiles correctly (libraries > are built with -fPIC, binaries with -fPIE), but it seems to cause > problems with hand-written Makefiles like the one in doc/examples/demo. > > We could fix it with a package-specific patch, either by using autotools > to build this directory, or maybe not building it at all, since it's > just an example that we don't install... > > > Thanks all, > Alex > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From simon.marchi at polymtl.ca Tue May 14 17:05:59 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Tue, 14 May 2013 17:05:59 -0400 Subject: [lttng-dev] [PATCH] Remove -pie flag for shared library In-Reply-To: <1368562532-19566-1-git-send-email-francis.giraldeau@gmail.com> References: <1368562532-19566-1-git-send-email-francis.giraldeau@gmail.com> Message-ID: Thank you Francis. I tested your patch locally and it works, so I included it in the packaging on Launchpad so that the package builds for now. However, it would be preferable if the problem could be addressed more gracefully upstream. Simon On 14 May 2013 16:15, Francis Giraldeau wrote: > Some build environment with hardening enabled adds -pie flags to LDFLAGS. While > it's required for ELF binaries, it doesn't make sens for shared libraries. For > this case, filter-out the erroneous option. > > Signed-off-by: Francis Giraldeau > --- > doc/examples/demo/Makefile | 6 ++++-- > doc/examples/easy-ust/Makefile | 4 +++- > 2 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile > index bbc8ccb..3145146 100644 > --- a/doc/examples/demo/Makefile > +++ b/doc/examples/demo/Makefile > @@ -34,6 +34,8 @@ EMPTY_AUTOMAKE_TARGETS = distdir install install-data install-exec uninstall \ > $(EMPTY_AUTOMAKE_TARGETS): > endif > > +CLEAN_LDFLAGS = $(filter-out -pie,$(LDFLAGS)) > + > all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so > > tp.o: tp.c ust_tests_demo.h > @@ -43,13 +45,13 @@ tp2.o: tp2.c ust_tests_demo2.h > $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > > lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o > - $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $^ > + $(CC) -shared -o $@ $(CLEAN_LDFLAGS) -llttng-ust $^ > > tp3.o: tp3.c ust_tests_demo3.h > $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > > lttng-ust-provider-ust-tests-demo3.so: tp3.o > - $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $^ > + $(CC) -shared -o $@ $(CLEAN_LDFLAGS) -llttng-ust $^ > > demo.o: demo.c > $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > diff --git a/doc/examples/easy-ust/Makefile b/doc/examples/easy-ust/Makefile > index e20e53a..e95a2c5 100644 > --- a/doc/examples/easy-ust/Makefile > +++ b/doc/examples/easy-ust/Makefile > @@ -36,10 +36,12 @@ EMPTY_AUTOMAKE_TARGETS = distdir install install-data install-exec uninstall \ > $(EMPTY_AUTOMAKE_TARGETS): > endif > > +CLEAN_LDFLAGS = $(filter-out -pie,$(LDFLAGS)) > + > all: sample > > sample: sample.o tp.o > - $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) > + $(CC) -o $@ $^ $(CLEAN_LDFLAGS) $(LIBS) > > sample.o: sample.c sample_component_provider.h > $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > -- > 1.8.1.2 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From jeremie.galarneau at efficios.com Tue May 14 17:11:26 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Tue, 14 May 2013 17:11:26 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Add warning about default prefix and library paths to README Message-ID: <1368565886-20536-1-git-send-email-jeremie.galarneau@efficios.com> Fixes #467 Signed-off-by: J?r?mie Galarneau --- README | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README b/README index 4b3053c..2a335ce 100644 --- a/README +++ b/README @@ -52,6 +52,11 @@ INSTALLATION INSTRUCTIONS: If compiling from the git repository, run ./bootstrap before running the configure script, to generate it. + Note that configure sets '/usr/local' as the default prefix for files it + installs. However, this path is not part of most distributions' default + library path which will cause builds depending on liblttng-ust to fail unless + '-L/usr/local/lib' is added to LDFLAGS. You may provide a custom prefix to + configure by using the --prefix switch. USAGE: -- 1.8.2.2 From mathieu.desnoyers at efficios.com Tue May 14 17:46:08 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 14 May 2013 17:46:08 -0400 Subject: [lttng-dev] [PATCH] Fix linker library order In-Reply-To: <5192A3B5.6080302@voxpopuli.im> References: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> <20130512025917.GB405@Krystal> <519161C8.5000305@voxpopuli.im> <20130514065244.GA5066@Krystal> <20130514123724.GA24238@Krystal> <5192A3B5.6080302@voxpopuli.im> Message-ID: <20130514214608.GA9634@Krystal> * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > On 13-05-14 01:38 PM, Simon Marchi wrote: > > [...] > > > > If you read carefully the log sent by Alexandre, you see that it is > > when building the shared libs in this directory > > (lttng-ust-provider-ust-tests-demo.so) that the build fails. I don't > > know why it fails, but Alexandre hinted that passing "-fPIE -pie" to > > build a shared library is weird (it is usually -fPIC -pic). I am not > > sure where that comes from. This behaviour only happens when building > > the package, not when building manually. > > We build the daily packages with all Debian security options (this is > kind of a future-proofing to find problems like this one, I don't think > the "real" Debian packages use it). > > See > http://wiki.debian.org/Hardening#DEB_BUILD_HARDENING_PIE_.28gcc.2Fg.2B-.2B-_-fPIE_-pie.29 > > So far it handled the autotools-powered Makefiles correctly (libraries > are built with -fPIC, binaries with -fPIE), but it seems to cause > problems with hand-written Makefiles like the one in doc/examples/demo. > > We could fix it with a package-specific patch, either by using autotools > to build this directory, or maybe not building it at all, since it's > just an example that we don't install... has this been fixed by the recent revert ? > > > Thanks all, > Alex -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 14 17:51:53 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 14 May 2013 17:51:53 -0400 Subject: [lttng-dev] [PATCH] Fix linker library order In-Reply-To: <20130514214608.GA9634@Krystal> References: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> <20130512025917.GB405@Krystal> <519161C8.5000305@voxpopuli.im> <20130514065244.GA5066@Krystal> <20130514123724.GA24238@Krystal> <5192A3B5.6080302@voxpopuli.im> <20130514214608.GA9634@Krystal> Message-ID: <20130514215153.GB9634@Krystal> * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: > * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > > On 13-05-14 01:38 PM, Simon Marchi wrote: > > > [...] > > > > > > If you read carefully the log sent by Alexandre, you see that it is > > > when building the shared libs in this directory > > > (lttng-ust-provider-ust-tests-demo.so) that the build fails. I don't > > > know why it fails, but Alexandre hinted that passing "-fPIE -pie" to > > > build a shared library is weird (it is usually -fPIC -pic). I am not > > > sure where that comes from. This behaviour only happens when building > > > the package, not when building manually. > > > > We build the daily packages with all Debian security options (this is > > kind of a future-proofing to find problems like this one, I don't think > > the "real" Debian packages use it). > > > > See > > http://wiki.debian.org/Hardening#DEB_BUILD_HARDENING_PIE_.28gcc.2Fg.2B-.2B-_-fPIE_-pie.29 > > > > So far it handled the autotools-powered Makefiles correctly (libraries > > are built with -fPIC, binaries with -fPIE), but it seems to cause > > problems with hand-written Makefiles like the one in doc/examples/demo. > > > > We could fix it with a package-specific patch, either by using autotools > > to build this directory, or maybe not building it at all, since it's > > just an example that we don't install... > > has this been fixed by the recent revert ? ok, I read the rest of my mailbox. Let's discuss this tomorrow when my head is straightened up. Thanks, Mathieu > > > > > > > Thanks all, > > Alex > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From christian.babeux at efficios.com Tue May 14 17:53:45 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Tue, 14 May 2013 17:53:45 -0400 Subject: [lttng-dev] [PATCH lttng-tools 1/3] Tests: Move the babelstats utility to tests/utils Message-ID: <1368568427-8289-1-git-send-email-christian.babeux@efficios.com> This utility will prove useful in trace validation for other tests, so put it in a common location accessible by the tests. Signed-off-by: Christian Babeux --- tests/regression/tools/filtering/Makefile.am | 4 +- tests/regression/tools/filtering/babelstats.pl | 174 --------------------- tests/regression/tools/filtering/test_valid_filter | 4 +- tests/utils/babelstats.pl | 174 +++++++++++++++++++++ 4 files changed, 178 insertions(+), 178 deletions(-) delete mode 100755 tests/regression/tools/filtering/babelstats.pl create mode 100755 tests/utils/babelstats.pl diff --git a/tests/regression/tools/filtering/Makefile.am b/tests/regression/tools/filtering/Makefile.am index 5629da2..ca60dbf 100644 --- a/tests/regression/tools/filtering/Makefile.am +++ b/tests/regression/tools/filtering/Makefile.am @@ -14,5 +14,5 @@ gen_ust_events_SOURCES = gen-ust-events.c tp.c tp.h gen_ust_events_LDADD = -llttng-ust endif -noinst_SCRIPTS = test_unsupported_op test_invalid_filter test_valid_filter babelstats.pl -EXTRA_DIST = test_unsupported_op test_invalid_filter test_valid_filter babelstats.pl +noinst_SCRIPTS = test_unsupported_op test_invalid_filter test_valid_filter +EXTRA_DIST = test_unsupported_op test_invalid_filter test_valid_filter diff --git a/tests/regression/tools/filtering/babelstats.pl b/tests/regression/tools/filtering/babelstats.pl deleted file mode 100755 index d8d4dd0..0000000 --- a/tests/regression/tools/filtering/babelstats.pl +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/perl - -# Copyright (C) - 2012 Christian Babeux -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License, version 2 only, as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -use strict; -use warnings; - -use Getopt::Long; - -my $opt_tracepoint; - -GetOptions('tracepoint=s' => \$opt_tracepoint) - or die("Invalid command-line option\n"); - -defined($opt_tracepoint) - or die("Missing tracepoint, use --tracepoint "); - -# Parse an array string. -# The format is as follow: [ [index] = value, ... ] -sub parse_array -{ - my ($arr_str) = @_; - my @array = (); - - # Strip leading and ending brackets, remove whitespace - $arr_str =~ s/^\[//; - $arr_str =~ s/\]$//; - $arr_str =~ s/\s//g; - - my @entries = split(',', $arr_str); - - foreach my $entry (@entries) { - if ($entry =~ /^\[(\d+)\]=(\d+)$/) { - my $index = $1; - my $value = $2; - splice @array, $index, 0, $value; - } - } - - return \@array; -} - -# Parse fields values. -# Format can either be a name = array or a name = value pair. -sub parse_fields -{ - my ($fields_str) = @_; - my %fields_hash; - - my $field_name = '[\w\d_]+'; - my $field_value = '[\w\d_\\\*"]+'; - my $array = '\[(?:\s\[\d+\]\s=\s\d+,)*\s\[\d+\]\s=\s\d+\s\]'; - - # Split the various fields - my @fields = ($fields_str =~ /$field_name\s=\s(?:$array|$field_value)/g); - - foreach my $field (@fields) { - if ($field =~ /($field_name)\s=\s($array)/) { - my $name = $1; - my $value = parse_array($2); - $fields_hash{$name} = $value; - } - - if ($field =~ /($field_name)\s=\s($field_value)/) { - my $name = $1; - my $value = $2; - $fields_hash{$name} = $value; - } - } - - return \%fields_hash; -} - -# Using an event array, merge all the fields -# of a particular tracepoint. -sub merge_fields -{ - my ($events_ref) = @_; - my %merged; - - foreach my $event (@{$events_ref}) { - my $tp_provider = $event->{'tp_provider'}; - my $tp_name = $event->{'tp_name'}; - my $tracepoint = "$tp_provider:$tp_name"; - - foreach my $key (keys %{$event->{'fields'}}) { - my $val = $event->{'fields'}->{$key}; - - # TODO: Merge of array is not implemented. - next if (ref($val) eq 'ARRAY'); - $merged{$tracepoint}{$key}{$val} = undef; - } - } - - return \%merged; -} - -# Print the minimum and maximum of each fields -# for a particular tracepoint. -sub print_fields_stats -{ - my ($merged_ref, $tracepoint) = @_; - - return unless ($tracepoint && exists $merged_ref->{$tracepoint}); - - foreach my $field (keys %{$merged_ref->{$tracepoint}}) { - my @sorted; - my @val = keys ($merged_ref->{$tracepoint}->{$field}); - - if ($val[0] =~ /^\d+$/) { - # Sort numerically - @sorted = sort { $a <=> $b } @val; - } elsif ($val[0] =~ /^0x[\da-f]+$/i) { - # Convert the hex values and sort numerically - @sorted = sort { hex($a) <=> hex($b) } @val; - } else { - # Fallback, alphabetical sort - @sorted = sort { lc($a) cmp lc($b) } @val; - } - - my $min = $sorted[0]; - my $max = $sorted[-1]; - - print "$field $min $max\n"; - } -} - -my @events; - -while (<>) -{ - my $timestamp = '\[(.*)\]'; - my $elapsed = '\((.*)\)'; - my $hostname = '.*'; - my $pname = '.*'; - my $pid = '\d+'; - my $tp_provider = '.*'; - my $tp_name = '.*'; - my $cpu_info = '{\scpu_id\s=\s(\d+)\s\}'; - my $fields = '{(.*)}'; - - # Parse babeltrace text output format - if (/$timestamp\s$elapsed\s($hostname):($pname):($pid)\s($tp_provider):($tp_name):\s$cpu_info,\s$fields/) { - my %event_hash; - - $event_hash{'timestamp'} = $1; - $event_hash{'elapsed'} = $2; - $event_hash{'hostname'} = $3; - $event_hash{'pname'} = $4; - $event_hash{'pid'} = $5; - $event_hash{'tp_provider'} = $6; - $event_hash{'tp_name'} = $7; - $event_hash{'cpu_id'} = $8; - $event_hash{'fields'} = parse_fields($9); - - push @events, \%event_hash; - } -} - -my %merged_fields = %{merge_fields(\@{events})}; -print_fields_stats(\%merged_fields, $opt_tracepoint); diff --git a/tests/regression/tools/filtering/test_valid_filter b/tests/regression/tools/filtering/test_valid_filter index 7170eb5..a62cc1e 100755 --- a/tests/regression/tools/filtering/test_valid_filter +++ b/tests/regression/tools/filtering/test_valid_filter @@ -21,7 +21,7 @@ CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../../.. LTTNG_BIN="lttng" BIN_NAME="gen-ust-events" -STATS_BIN="babelstats.pl" +STATS_BIN="$TESTDIR/utils/babelstats.pl" SESSION_NAME="valid_filter" EVENT_NAME="tp:tptest" NR_ITER=100 @@ -81,7 +81,7 @@ function test_valid_filter # Destroy session destroy_lttng_session $SESSION_NAME - stats=`babeltrace $trace_path | $CURDIR/$STATS_BIN --tracepoint $EVENT_NAME` + stats=`babeltrace $trace_path | $STATS_BIN --tracepoint $EVENT_NAME` rm -rf $trace_path diff --git a/tests/utils/babelstats.pl b/tests/utils/babelstats.pl new file mode 100755 index 0000000..d8d4dd0 --- /dev/null +++ b/tests/utils/babelstats.pl @@ -0,0 +1,174 @@ +#!/usr/bin/perl + +# Copyright (C) - 2012 Christian Babeux +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License, version 2 only, as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use strict; +use warnings; + +use Getopt::Long; + +my $opt_tracepoint; + +GetOptions('tracepoint=s' => \$opt_tracepoint) + or die("Invalid command-line option\n"); + +defined($opt_tracepoint) + or die("Missing tracepoint, use --tracepoint "); + +# Parse an array string. +# The format is as follow: [ [index] = value, ... ] +sub parse_array +{ + my ($arr_str) = @_; + my @array = (); + + # Strip leading and ending brackets, remove whitespace + $arr_str =~ s/^\[//; + $arr_str =~ s/\]$//; + $arr_str =~ s/\s//g; + + my @entries = split(',', $arr_str); + + foreach my $entry (@entries) { + if ($entry =~ /^\[(\d+)\]=(\d+)$/) { + my $index = $1; + my $value = $2; + splice @array, $index, 0, $value; + } + } + + return \@array; +} + +# Parse fields values. +# Format can either be a name = array or a name = value pair. +sub parse_fields +{ + my ($fields_str) = @_; + my %fields_hash; + + my $field_name = '[\w\d_]+'; + my $field_value = '[\w\d_\\\*"]+'; + my $array = '\[(?:\s\[\d+\]\s=\s\d+,)*\s\[\d+\]\s=\s\d+\s\]'; + + # Split the various fields + my @fields = ($fields_str =~ /$field_name\s=\s(?:$array|$field_value)/g); + + foreach my $field (@fields) { + if ($field =~ /($field_name)\s=\s($array)/) { + my $name = $1; + my $value = parse_array($2); + $fields_hash{$name} = $value; + } + + if ($field =~ /($field_name)\s=\s($field_value)/) { + my $name = $1; + my $value = $2; + $fields_hash{$name} = $value; + } + } + + return \%fields_hash; +} + +# Using an event array, merge all the fields +# of a particular tracepoint. +sub merge_fields +{ + my ($events_ref) = @_; + my %merged; + + foreach my $event (@{$events_ref}) { + my $tp_provider = $event->{'tp_provider'}; + my $tp_name = $event->{'tp_name'}; + my $tracepoint = "$tp_provider:$tp_name"; + + foreach my $key (keys %{$event->{'fields'}}) { + my $val = $event->{'fields'}->{$key}; + + # TODO: Merge of array is not implemented. + next if (ref($val) eq 'ARRAY'); + $merged{$tracepoint}{$key}{$val} = undef; + } + } + + return \%merged; +} + +# Print the minimum and maximum of each fields +# for a particular tracepoint. +sub print_fields_stats +{ + my ($merged_ref, $tracepoint) = @_; + + return unless ($tracepoint && exists $merged_ref->{$tracepoint}); + + foreach my $field (keys %{$merged_ref->{$tracepoint}}) { + my @sorted; + my @val = keys ($merged_ref->{$tracepoint}->{$field}); + + if ($val[0] =~ /^\d+$/) { + # Sort numerically + @sorted = sort { $a <=> $b } @val; + } elsif ($val[0] =~ /^0x[\da-f]+$/i) { + # Convert the hex values and sort numerically + @sorted = sort { hex($a) <=> hex($b) } @val; + } else { + # Fallback, alphabetical sort + @sorted = sort { lc($a) cmp lc($b) } @val; + } + + my $min = $sorted[0]; + my $max = $sorted[-1]; + + print "$field $min $max\n"; + } +} + +my @events; + +while (<>) +{ + my $timestamp = '\[(.*)\]'; + my $elapsed = '\((.*)\)'; + my $hostname = '.*'; + my $pname = '.*'; + my $pid = '\d+'; + my $tp_provider = '.*'; + my $tp_name = '.*'; + my $cpu_info = '{\scpu_id\s=\s(\d+)\s\}'; + my $fields = '{(.*)}'; + + # Parse babeltrace text output format + if (/$timestamp\s$elapsed\s($hostname):($pname):($pid)\s($tp_provider):($tp_name):\s$cpu_info,\s$fields/) { + my %event_hash; + + $event_hash{'timestamp'} = $1; + $event_hash{'elapsed'} = $2; + $event_hash{'hostname'} = $3; + $event_hash{'pname'} = $4; + $event_hash{'pid'} = $5; + $event_hash{'tp_provider'} = $6; + $event_hash{'tp_name'} = $7; + $event_hash{'cpu_id'} = $8; + $event_hash{'fields'} = parse_fields($9); + + push @events, \%event_hash; + } +} + +my %merged_fields = %{merge_fields(\@{events})}; +print_fields_stats(\%merged_fields, $opt_tracepoint); -- 1.8.2.2 From christian.babeux at efficios.com Tue May 14 17:53:46 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Tue, 14 May 2013 17:53:46 -0400 Subject: [lttng-dev] [PATCH lttng-tools 2/3] Tests: Add the tracefile count test In-Reply-To: <1368568427-8289-1-git-send-email-christian.babeux@efficios.com> References: <1368568427-8289-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1368568427-8289-2-git-send-email-christian.babeux@efficios.com> This test validate the newly introduced tracefile count feature. In order to so, we enable a channel with the appropriate limits in overwrite mode. The later constraint is to ensure that at least the last few events are properly recorded and that we can validate that they are present in the resulting trace (with the help of babeltrace and babelstats). We also validate that the tracefile count (per stream) in the trace folder is conform to the one passed on the command line. Signed-off-by: Christian Babeux --- configure.ac | 1 + tests/fast_regression | 1 + tests/long_regression | 1 + .../regression/tools/tracefile-limits/Makefile.am | 2 + .../tools/tracefile-limits/test_tracefile_count | 174 +++++++++++++++++++++ 5 files changed, 179 insertions(+) create mode 100644 tests/regression/tools/tracefile-limits/Makefile.am create mode 100644 tests/regression/tools/tracefile-limits/test_tracefile_count diff --git a/configure.ac b/configure.ac index 9f14c12..9bb5e67 100644 --- a/configure.ac +++ b/configure.ac @@ -323,6 +323,7 @@ AC_CONFIG_FILES([ tests/regression/tools/streaming/Makefile tests/regression/tools/filtering/Makefile tests/regression/tools/health/Makefile + tests/regression/tools/tracefile-limits/Makefile tests/regression/ust/Makefile tests/regression/ust/nprocesses/Makefile tests/regression/ust/high-throughput/Makefile diff --git a/tests/fast_regression b/tests/fast_regression index e6a883b..db26f1c 100644 --- a/tests/fast_regression +++ b/tests/fast_regression @@ -5,6 +5,7 @@ regression/tools/health/test_thread_exit regression/tools/health/test_thread_stall regression/tools/health/test_tp_fail regression/tools/streaming/test_ust +regression/tools/tracefile-limits/test_tracefile_count regression/ust/before-after/test_before_after regression/ust/buffers-uid/test_buffers_uid regression/ust/periodical-metadata-flush/test_periodical_metadata_flush diff --git a/tests/long_regression b/tests/long_regression index c198178..3780bd4 100644 --- a/tests/long_regression +++ b/tests/long_regression @@ -5,6 +5,7 @@ regression/tools/health/test_thread_exit regression/tools/health/test_thread_stall regression/tools/health/test_tp_fail regression/tools/streaming/test_ust +regression/tools/tracefile-limits/test_tracefile_count regression/ust/before-after/test_before_after regression/ust/buffers-uid/test_buffers_uid regression/ust/high-throughput/test_high_throughput diff --git a/tests/regression/tools/tracefile-limits/Makefile.am b/tests/regression/tools/tracefile-limits/Makefile.am new file mode 100644 index 0000000..441d2bd --- /dev/null +++ b/tests/regression/tools/tracefile-limits/Makefile.am @@ -0,0 +1,2 @@ +noinst_SCRIPTS = test_tracefile_count +EXTRA_DIST = test_tracefile_count diff --git a/tests/regression/tools/tracefile-limits/test_tracefile_count b/tests/regression/tools/tracefile-limits/test_tracefile_count new file mode 100644 index 0000000..41b89f0 --- /dev/null +++ b/tests/regression/tools/tracefile-limits/test_tracefile_count @@ -0,0 +1,174 @@ +#!/bin/bash +# +# Copyright (C) - 2013 Christian Babeux +# +# This library is free software; you can redistribute it and/or modify it under +# the terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +TEST_DESC="Tracefile count limits" + +CURDIR=$(dirname $0)/ +TESTDIR=$CURDIR/../../.. + +TESTAPP_PATH="$TESTDIR/utils/testapp" +TESTAPP_NAME="gen-ust-events" +TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" + +STATS_BIN="$TESTDIR/utils/babelstats.pl" +NUM_TESTS=146 + +source $TESTDIR/utils/utils.sh + +if [ ! -x "$TESTAPP_BIN" ]; then + BAIL_OUT "No UST events binary detected." +fi + +function wait_apps +{ + while [ -n "$(pidof $TESTAPP_NAME)" ]; do + sleep 0.5 + done + pass "Wait for applications to end" +} + +function enable_lttng_channel_count_limit () +{ + sess_name="$1" + channel_name="$2" + tracefile_count_limit="$3" + + test_name="Enable channel $channel_name " + test_name+="for session $sess_name: " + test_name+="$tracefile_count_limit tracefiles" + + $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel \ + -u $channel_name -s $sess_name \ + -C 4096 -W $tracefile_count_limit \ + --overwrite >/dev/null 2>&1 + + ok $? "$test_name" +} + +function enable_ust_lttng_event_per_channel () +{ + sess_name="$1" + event_name="$2" + channel_name="$3" + + test_name="Enable event $event_name " + test_name+="for session $sess_name " + test_name+="in channel $channel_name" + + $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" \ + -s $sess_name -u -c $channel_name >/dev/null 2>&1 + + ok $? "$test_name" +} + +function validate_min_max +{ + stats="$1" + field="$2" + expected_min="$3" + expected_max="$4" + + echo $stats | grep -q -E "$field $expected_min $expected_max" + return $? +} + +function validate_file_count +{ + path="$1" + file_pattern="$2" + expected_max_count="$3" + + count=`find $path -name "$file_pattern" -type f | wc -l` + + if [ "$count" -gt "$expected_max_count" ]; then + fail "Validate file count: $file_pattern" + diag "File count: $count expected: $expected_max_count" + else + pass "Validate file count: $file_pattern" + fi +} + +function test_tracefile_count_limit () +{ + count_limit="$1" + trace_path=$(mktemp -d) + session_name=$(randstring 16 0) + channel_name="channel" + event_name="tp:tptest" + num_iter=1000 + expected_max=$(($num_iter - 1)) + + diag "Test tracefile count limit : $count_limit tracefiles" + + create_lttng_session $session_name $trace_path + + enable_lttng_channel_count_limit \ + $session_name $channel_name $count_limit + + enable_ust_lttng_event_per_channel \ + $session_name $event_name $channel_name + + start_lttng_tracing $session_name + + $TESTAPP_BIN $num_iter >/dev/null 2>&1 & + + wait_apps + + stop_lttng_tracing $session_name + + destroy_lttng_session $session_name + + # Validate tracing dir + + num_cpu=`nproc` + + for cpuno in $(seq 0 $(($num_cpu - 1))) + do + validate_file_count \ + $trace_path "${channel_name}_${cpuno}_*" $count_limit + done + + # Validate tracing data + + stats=`babeltrace $trace_path | $STATS_BIN --tracepoint $event_name` + + validate_min_max "$stats" "intfield" "[0-9]+" "$expected_max" + ok $? "Trace validation - intfield" + + validate_min_max "$stats" "netintfield" "[0-9]+" "$expected_max" + ok $? "Trace validation - netintfield" + + validate_min_max "$stats" "longfield" "[0-9]+" "$expected_max" + ok $? "Trace validation - longfield" + + rm -rf $trace_path +} + +plan_tests $NUM_TESTS + +print_test_banner "$TEST_DESC" + +start_lttng_sessiond + +LIMITS=("1" "2" "4" "8" "10" "16" "32" "64") + +for limit in ${LIMITS[@]}; +do + test_tracefile_count_limit $limit +done + +stop_lttng_sessiond -- 1.8.2.2 From christian.babeux at efficios.com Tue May 14 17:53:47 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Tue, 14 May 2013 17:53:47 -0400 Subject: [lttng-dev] [PATCH lttng-tools 3/3] Tests: Add the tracefile size test In-Reply-To: <1368568427-8289-1-git-send-email-christian.babeux@efficios.com> References: <1368568427-8289-1-git-send-email-christian.babeux@efficios.com> Message-ID: <1368568427-8289-3-git-send-email-christian.babeux@efficios.com> This test validate the newly introduced tracefile count feature. In order to so, we enable a channel with the appropriate file size limits. After running an instrumented application, we validate that each file in the trace folder is no larger than the limit set on the command line and also that some events are present (it's possible that the tracer discard events, so we can't validate on a fixed number of events in the resulting trace). Signed-off-by: Christian Babeux --- tests/fast_regression | 1 + tests/long_regression | 2 + .../regression/tools/tracefile-limits/Makefile.am | 4 +- .../tools/tracefile-limits/test_tracefile_size | 154 +++++++++++++++++++++ 4 files changed, 159 insertions(+), 2 deletions(-) create mode 100644 tests/regression/tools/tracefile-limits/test_tracefile_size diff --git a/tests/fast_regression b/tests/fast_regression index db26f1c..a7ba925 100644 --- a/tests/fast_regression +++ b/tests/fast_regression @@ -6,6 +6,7 @@ regression/tools/health/test_thread_stall regression/tools/health/test_tp_fail regression/tools/streaming/test_ust regression/tools/tracefile-limits/test_tracefile_count +regression/tools/tracefile-limits/test_tracefile_size regression/ust/before-after/test_before_after regression/ust/buffers-uid/test_buffers_uid regression/ust/periodical-metadata-flush/test_periodical_metadata_flush diff --git a/tests/long_regression b/tests/long_regression index 3780bd4..246259a 100644 --- a/tests/long_regression +++ b/tests/long_regression @@ -6,8 +6,10 @@ regression/tools/health/test_thread_stall regression/tools/health/test_tp_fail regression/tools/streaming/test_ust regression/tools/tracefile-limits/test_tracefile_count +regression/tools/tracefile-limits/test_tracefile_size regression/ust/before-after/test_before_after regression/ust/buffers-uid/test_buffers_uid +regression/ust/periodical-metadata-flush/test_periodical_metadata_flush regression/ust/high-throughput/test_high_throughput regression/ust/low-throughput/test_low_throughput regression/ust/multi-session/test_multi_session diff --git a/tests/regression/tools/tracefile-limits/Makefile.am b/tests/regression/tools/tracefile-limits/Makefile.am index 441d2bd..f6ca236 100644 --- a/tests/regression/tools/tracefile-limits/Makefile.am +++ b/tests/regression/tools/tracefile-limits/Makefile.am @@ -1,2 +1,2 @@ -noinst_SCRIPTS = test_tracefile_count -EXTRA_DIST = test_tracefile_count +noinst_SCRIPTS = test_tracefile_count test_tracefile_size +EXTRA_DIST = test_tracefile_count test_tracefile_size diff --git a/tests/regression/tools/tracefile-limits/test_tracefile_size b/tests/regression/tools/tracefile-limits/test_tracefile_size new file mode 100644 index 0000000..99301b5 --- /dev/null +++ b/tests/regression/tools/tracefile-limits/test_tracefile_size @@ -0,0 +1,154 @@ +#!/bin/bash +# +# Copyright (C) - 2013 Christian Babeux +# +# This library is free software; you can redistribute it and/or modify it under +# the terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +TEST_DESC="Tracefile size limits" + +CURDIR=$(dirname $0)/ +TESTDIR=$CURDIR/../../.. + +NR_ITER=1000 + +TESTAPP_PATH="$TESTDIR/utils/testapp" +TESTAPP_NAME="gen-ust-events" +TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" + +NUM_TESTS=47 + +source $TESTDIR/utils/utils.sh + +if [ ! -x "$TESTAPP_BIN" ]; then + BAIL_OUT "No UST events binary detected." +fi + +function wait_apps +{ + while [ -n "$(pidof $TESTAPP_NAME)" ]; do + sleep 0.5 + done + pass "Wait for applications to end" +} + +function enable_lttng_channel_size_limit () +{ + sess_name="$1" + channel_name="$2" + tracefile_size_limit="$3" + + test_name="Enable channel $channel_name " + test_name+="for session $sess_name: " + test_name+="$tracefile_size_limit bytes tracefile limit" + + $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-channel \ + -u $channel_name -s $sess_name \ + -C $tracefile_size_limit >/dev/null 2>&1 + + ok $? "$test_name" +} + +function enable_ust_lttng_event_per_channel () +{ + sess_name="$1" + event_name="$2" + channel_name="$3" + + test_name="Enable event $event_name " + test_name+="for session $sess_name " + test_name+="in channel $channel_name" + + $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event "$event_name" \ + -s $sess_name -u -c $channel_name >/dev/null 2>&1 + + ok $? "$test_name" +} + +function check_file_size () +{ + path="$1" + file_pattern="$2" + expected_max_size="$3" + + find $path -name "$file_pattern" -exec stat -c '%n %s' {} \; \ + | while read file_info; + do + name=$(echo $file_info | cut -f1 -d ' ') + size=$(echo $file_info | cut -f2 -d ' ') + + if [ "$size" -gt "$expected_max_size" ]; then + diag_msg="file: $name size: $size" + diag_msg+="expected maximum size: $expected_max_size" + diag "$diag_msg" + exit 1 + fi + done + + ok $? "File size validation" +} + +function test_tracefile_size_limit () +{ + size_limit="$1" + trace_path=$(mktemp -d) + session_name=$(randstring 16 0) + channel_name="channel" + event_name="tp:tptest" + + diag "Test tracefile size limit : $size_limit bytes" + + create_lttng_session $session_name $trace_path + + enable_lttng_channel_size_limit \ + $session_name $channel_name $size_limit + + enable_ust_lttng_event_per_channel \ + $session_name $event_name $channel_name + + start_lttng_tracing $session_name + + $TESTAPP_BIN $NR_ITER >/dev/null 2>&1 & + + wait_apps + + stop_lttng_tracing $session_name + + destroy_lttng_session $session_name + + # Validate file size, each one shall be no larger than the + # specified size limit + + check_file_size $trace_path "${channel_name}_*" $size_limit + + # Validate tracing data, we should at least have some events + + validate_trace $event_name $trace_path + + rm -rf $trace_path +} + +plan_tests $NUM_TESTS + +print_test_banner "$TEST_DESC" + +start_lttng_sessiond + +LIMITS=("4096" "8192" "16384" "32768" "65536") + +for limit in ${LIMITS[@]}; +do + test_tracefile_size_limit $limit +done + +stop_lttng_sessiond -- 1.8.2.2 From jeremie.galarneau at efficios.com Tue May 14 18:08:54 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Tue, 14 May 2013 18:08:54 -0400 Subject: [lttng-dev] [PATCH babeltrace] Fix: Suppress a compiler warning (always-false condition) Message-ID: <1368569334-6700-1-git-send-email-jeremie.galarneau@efficios.com> Clang reports an always-false condition (checking if an unsigned value < 0) caused by a type mismatch in ctf-visitor-generate-io-struct.c. Remove trailing whitespaces. Signed-off-by: J?r?mie Galarneau --- formats/ctf/metadata/ctf-visitor-generate-io-struct.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c index 0002fe4..c4208b7 100644 --- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c +++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c @@ -649,7 +649,7 @@ int ctf_typedef_visit(FILE *fd, int depth, struct declaration_scope *scope, bt_list_for_each_entry(iter, type_declarators, siblings) { struct bt_declaration *type_declaration; int ret; - + type_declaration = ctf_type_declarator_visit(fd, depth, type_specifier_list, &identifier, iter, @@ -865,7 +865,6 @@ struct bt_declaration *ctf_declaration_struct_visit(FILE *fd, if (name) { if (bt_lookup_struct_declaration(g_quark_from_string(name), declaration_scope)) { - fprintf(fd, "[error] %s: struct %s already declared in scope\n", __func__, name); return NULL; } @@ -936,7 +935,6 @@ struct bt_declaration *ctf_declaration_variant_visit(FILE *fd, if (name) { if (bt_lookup_variant_declaration(g_quark_from_string(name), declaration_scope)) { - fprintf(fd, "[error] %s: variant %s already declared in scope\n", __func__, name); return NULL; } @@ -1105,7 +1103,6 @@ struct bt_declaration *ctf_declaration_enum_visit(FILE *fd, int depth, if (name) { if (bt_lookup_enum_declaration(g_quark_from_string(name), declaration_scope)) { - fprintf(fd, "[error] %s: enum %s already declared in scope\n", __func__, name); return NULL; } @@ -1233,7 +1230,7 @@ int get_boolean(FILE *fd, int depth, struct ctf_node *unary_expression) fprintf(fd, "[error] %s: unexpected unary expression type\n", __func__); return -EINVAL; - } + } } @@ -1479,9 +1476,9 @@ struct bt_declaration *ctf_declaration_floating_point_visit(FILE *fd, int depth, struct ctf_trace *trace) { struct ctf_node *expression; - uint64_t alignment = 1, exp_dig = 0, mant_dig = 0, - byte_order = trace->byte_order; - int has_alignment = 0, has_exp_dig = 0, has_mant_dig = 0; + uint64_t alignment = 1, exp_dig = 0, mant_dig = 0; + int byte_order = trace->byte_order, has_alignment = 0, + has_exp_dig = 0, has_mant_dig = 0; struct declaration_float *float_declaration; bt_list_for_each_entry(expression, expressions, siblings) { -- 1.8.2.2 From jeremie.galarneau at efficios.com Tue May 14 18:13:40 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Tue, 14 May 2013 18:13:40 -0400 Subject: [lttng-dev] [PATCH babeltrace] Remove unused array in bt_context_add_traces_recursive Message-ID: <1368569620-6774-1-git-send-email-jeremie.galarneau@efficios.com> Signed-off-by: J?r?mie Galarneau --- converter/babeltrace.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index 2fd371c..1008351 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -490,15 +490,11 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, void (*packet_seek)(struct bt_stream_pos *pos, size_t offset, int whence)) { - - GArray *trace_ids; - int ret = 0; + int ret = 0, trace_ids = 0; /* Should lock traversed_paths mutex here if used in multithread */ traversed_paths = g_ptr_array_new(); - trace_ids = g_array_new(FALSE, TRUE, sizeof(int)); - ret = nftw(path, traverse_trace_dir, 10, 0); /* Process the array if ntfw did not return a fatal error */ @@ -520,7 +516,7 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, /* Allow to skip erroneous traces. */ ret = 1; /* partial error */ } else { - g_array_append_val(trace_ids, trace_id); + trace_ids++; } g_string_free(trace_path, TRUE); } @@ -534,11 +530,10 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, /* * Return an error if no trace can be opened. */ - if (trace_ids->len == 0) { + if (trace_ids == 0) { fprintf(stderr, "[error] Cannot open any trace for reading.\n\n"); ret = -ENOENT; /* failure */ } - g_array_free(trace_ids, TRUE); return ret; } -- 1.8.2.2 From mathieu.desnoyers at efficios.com Wed May 15 02:05:54 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 15 May 2013 02:05:54 -0400 Subject: [lttng-dev] [PATCH] Fix linker library order In-Reply-To: References: <1368318333-31522-1-git-send-email-francis.giraldeau@gmail.com> <20130512025917.GB405@Krystal> <519161C8.5000305@voxpopuli.im> <20130514065244.GA5066@Krystal> <20130514123724.GA24238@Krystal> Message-ID: <20130515060553.GA16332@Krystal> * Simon Marchi (simon.marchi at polymtl.ca) wrote: > On 14 May 2013 08:37, Mathieu Desnoyers wrote: > > > > * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: > > > * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > > > > On 13-05-11 10:59 PM, Mathieu Desnoyers wrote: > > > > > * Francis Giraldeau (francis.giraldeau at gmail.com) wrote: > > > > >> Libraries must be specified after the binary target. > > > > > merged, thanks! > > > > > > > > > > Mathieu > > > > > > > > This seems to have broken the daily PPA packages: > > > > https://launchpadlibrarian.net/139804087/buildlog_ubuntu-saucy-amd64.lttng-ust_2.2~pre-0%2Bbzr1574%2Bpack37%2B201305131247~saucy1_FAILEDTOBUILD.txt.gz > > > > > > > > That package has no particular patches. If I build it locally from > > > > source it builds fine, but if I build the package locally (with > > > > dpkg-buildpackage), I get the same error. It could be related to the > > > > --as-needed problem we've had before... > > > > > > Francis, can you explain why your change was needed in the first place ? > > > > Hrm, actually, these patches are wrong. > > > I believe these patches are correct. > > > > > commit 725e63c5194bfdcde0a2a3507aca156ba36cf49f for instance: > > > > "Libraries must be specified after the binary target." > > > > demo: demo.o > > - $(CC) -o $@ $(LIBS) $^ > > + $(CC) -o $@ $^ $(LIBS) > > > > the binary target here is "$@". > > > > $^ is the source file name (demo.c). > > > > this patch moves the source file name prior to the libraries, which is > > incorrect (ref: gcc(1)). The input files should appear last. > > > > So it breaks builds where $(LIBS) is non-empty. > > Actually, $^ here is "demo.o", not "demo. Also, the libs should appear > after the objects on the command line. See the "-l" section in > http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html. On most setup > this doesn't matter, since -Wl,--no-as-needed was the default pretty > much everywhere. Ubuntu decided to use -Wl,--as-needed to avoid > unnecessary dependencies, so the order becomes important. If you try > to manual build on a recent Ubuntu you will get undefined references > to dlopen and such. So this patch is good. > > If you read carefully the log sent by Alexandre, you see that it is > when building the shared libs in this directory > (lttng-ust-provider-ust-tests-demo.so) that the build fails. I don't > know why it fails, but Alexandre hinted that passing "-fPIE -pie" to > build a shared library is weird (it is usually -fPIC -pic). I am not > sure where that comes from. This behaviour only happens when building > the package, not when building manually. OK, I'm reverting the 2 reverts (now that's clumsy) ;-). I'm adding your explanation to the changelog of those reverts. Thanks, Mathieu > > > > > I will revert commits: > > > > commit a51ac6d9a011ba10b0be396dc1e801b2fc829651 > > Author: Francis Giraldeau > > Date: Sat May 11 22:59:21 2013 -0400 > > > > Fix (another) linker library order > > > > Libraries must be specified after the binary target. > > > > Signed-off-by: Francis Giraldeau > > Signed-off-by: Mathieu Desnoyers > > > > commit 725e63c5194bfdcde0a2a3507aca156ba36cf49f > > Author: Francis Giraldeau > > Date: Sat May 11 22:58:12 2013 -0400 > > > > Fix linker library order > > > > Libraries must be specified after the binary target. > > > > Signed-off-by: Francis Giraldeau > > Signed-off-by: Mathieu Desnoyers > > > > > > Thanks, > > > > Mathieu > > > > > > > > Thanks, > > > > > > Mathieu > > > > > > > > > > > Cheers, > > > > Alex > > > > > > > > > > > > > >> Signed-off-by: Francis Giraldeau > > > > >> --- > > > > >> doc/examples/demo/Makefile | 2 +- > > > > >> 1 file changed, 1 insertion(+), 1 deletion(-) > > > > >> > > > > >> diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile > > > > >> index 7ae6547..bbc8ccb 100644 > > > > >> --- a/doc/examples/demo/Makefile > > > > >> +++ b/doc/examples/demo/Makefile > > > > >> @@ -55,7 +55,7 @@ demo.o: demo.c > > > > >> $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > > > > >> > > > > >> demo: demo.o > > > > >> - $(CC) -o $@ $(LIBS) $^ > > > > >> + $(CC) -o $@ $^ $(LIBS) > > > > >> > > > > >> .PHONY: clean > > > > >> clean: > > > > >> -- > > > > >> 1.8.1.2 > > > > >> > > > > >> > > > > >> _______________________________________________ > > > > >> lttng-dev mailing list > > > > >> lttng-dev at lists.lttng.org > > > > >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > > > > > > > -- > > > Mathieu Desnoyers > > > EfficiOS Inc. > > > http://www.efficios.com > > > > > > _______________________________________________ > > > lttng-dev mailing list > > > lttng-dev at lists.lttng.org > > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > -- > > Mathieu Desnoyers > > EfficiOS Inc. > > http://www.efficios.com > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Wed May 15 02:08:14 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 15 May 2013 02:08:14 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Add warning about default prefix and library paths to README In-Reply-To: <1368565886-20536-1-git-send-email-jeremie.galarneau@efficios.com> References: <1368565886-20536-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130515060814.GA16392@Krystal> merged, thanks! Mathieu * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > Fixes #467 > > Signed-off-by: J?r?mie Galarneau > --- > README | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/README b/README > index 4b3053c..2a335ce 100644 > --- a/README > +++ b/README > @@ -52,6 +52,11 @@ INSTALLATION INSTRUCTIONS: > If compiling from the git repository, run ./bootstrap before running > the configure script, to generate it. > > + Note that configure sets '/usr/local' as the default prefix for files it > + installs. However, this path is not part of most distributions' default > + library path which will cause builds depending on liblttng-ust to fail unless > + '-L/usr/local/lib' is added to LDFLAGS. You may provide a custom prefix to > + configure by using the --prefix switch. > > USAGE: > > -- > 1.8.2.2 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Wed May 15 02:11:30 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 15 May 2013 02:11:30 -0400 Subject: [lttng-dev] [PATCH babeltrace] Fix: Suppress a compiler warning (always-false condition) In-Reply-To: <1368569334-6700-1-git-send-email-jeremie.galarneau@efficios.com> References: <1368569334-6700-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130515061130.GB16392@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > Clang reports an always-false condition (checking if an unsigned value < 0) > caused by a type mismatch in ctf-visitor-generate-io-struct.c. manually split into 2 commits (cleanups is a separate commit). merged, Thanks, Mathieu > > Remove trailing whitespaces. > > Signed-off-by: J?r?mie Galarneau > --- > formats/ctf/metadata/ctf-visitor-generate-io-struct.c | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > > diff --git a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > index 0002fe4..c4208b7 100644 > --- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > +++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > @@ -649,7 +649,7 @@ int ctf_typedef_visit(FILE *fd, int depth, struct declaration_scope *scope, > bt_list_for_each_entry(iter, type_declarators, siblings) { > struct bt_declaration *type_declaration; > int ret; > - > + > type_declaration = ctf_type_declarator_visit(fd, depth, > type_specifier_list, > &identifier, iter, > @@ -865,7 +865,6 @@ struct bt_declaration *ctf_declaration_struct_visit(FILE *fd, > if (name) { > if (bt_lookup_struct_declaration(g_quark_from_string(name), > declaration_scope)) { > - > fprintf(fd, "[error] %s: struct %s already declared in scope\n", __func__, name); > return NULL; > } > @@ -936,7 +935,6 @@ struct bt_declaration *ctf_declaration_variant_visit(FILE *fd, > if (name) { > if (bt_lookup_variant_declaration(g_quark_from_string(name), > declaration_scope)) { > - > fprintf(fd, "[error] %s: variant %s already declared in scope\n", __func__, name); > return NULL; > } > @@ -1105,7 +1103,6 @@ struct bt_declaration *ctf_declaration_enum_visit(FILE *fd, int depth, > if (name) { > if (bt_lookup_enum_declaration(g_quark_from_string(name), > declaration_scope)) { > - > fprintf(fd, "[error] %s: enum %s already declared in scope\n", __func__, name); > return NULL; > } > @@ -1233,7 +1230,7 @@ int get_boolean(FILE *fd, int depth, struct ctf_node *unary_expression) > fprintf(fd, "[error] %s: unexpected unary expression type\n", > __func__); > return -EINVAL; > - } > + } > > } > > @@ -1479,9 +1476,9 @@ struct bt_declaration *ctf_declaration_floating_point_visit(FILE *fd, int depth, > struct ctf_trace *trace) > { > struct ctf_node *expression; > - uint64_t alignment = 1, exp_dig = 0, mant_dig = 0, > - byte_order = trace->byte_order; > - int has_alignment = 0, has_exp_dig = 0, has_mant_dig = 0; > + uint64_t alignment = 1, exp_dig = 0, mant_dig = 0; > + int byte_order = trace->byte_order, has_alignment = 0, > + has_exp_dig = 0, has_mant_dig = 0; > struct declaration_float *float_declaration; > > bt_list_for_each_entry(expression, expressions, siblings) { > -- > 1.8.2.2 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Wed May 15 02:12:51 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 15 May 2013 02:12:51 -0400 Subject: [lttng-dev] [PATCH babeltrace] Remove unused array in bt_context_add_traces_recursive In-Reply-To: <1368569620-6774-1-git-send-email-jeremie.galarneau@efficios.com> References: <1368569620-6774-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130515061251.GC16392@Krystal> merged, thanks! Mathieu * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > > Signed-off-by: J?r?mie Galarneau > --- > converter/babeltrace.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/converter/babeltrace.c b/converter/babeltrace.c > index 2fd371c..1008351 100644 > --- a/converter/babeltrace.c > +++ b/converter/babeltrace.c > @@ -490,15 +490,11 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, > void (*packet_seek)(struct bt_stream_pos *pos, > size_t offset, int whence)) > { > - > - GArray *trace_ids; > - int ret = 0; > + int ret = 0, trace_ids = 0; > > /* Should lock traversed_paths mutex here if used in multithread */ > > traversed_paths = g_ptr_array_new(); > - trace_ids = g_array_new(FALSE, TRUE, sizeof(int)); > - > ret = nftw(path, traverse_trace_dir, 10, 0); > > /* Process the array if ntfw did not return a fatal error */ > @@ -520,7 +516,7 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, > /* Allow to skip erroneous traces. */ > ret = 1; /* partial error */ > } else { > - g_array_append_val(trace_ids, trace_id); > + trace_ids++; > } > g_string_free(trace_path, TRUE); > } > @@ -534,11 +530,10 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path, > /* > * Return an error if no trace can be opened. > */ > - if (trace_ids->len == 0) { > + if (trace_ids == 0) { > fprintf(stderr, "[error] Cannot open any trace for reading.\n\n"); > ret = -ENOENT; /* failure */ > } > - g_array_free(trace_ids, TRUE); > return ret; > } > > -- > 1.8.2.2 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jan.glauber at gmail.com Wed May 15 04:55:41 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Wed, 15 May 2013 10:55:41 +0200 Subject: [lttng-dev] [RFC PATCH 1/2] Resurrect LTT type parser In-Reply-To: <20130510151102.GI20313@Krystal> References: <3401d96aafec4a5e2ca84879d0fe2d84599ccf6c.1366364119.git.jan.glauber@gmail.com> <20130510151102.GI20313@Krystal> Message-ID: <20130515085540.GA26874@hal> On Fri, May 10, 2013 at 11:11:02AM -0400, Mathieu Desnoyers wrote: > * Jan Glauber (jan.glauber at gmail.com) wrote: > > Parse legacy LTT trace type format strings. > > Resurrected from lttng-ust (serialize.c) git commit id: 31607b3 > > and slightly adopted to be useable by babeltrace-legacy. > > > > Signed-off-by: Jan Glauber > > --- > > converter/ltt-type-parser.c | 303 ++++++++++++++++++++++++++++++++++ > > include/babeltrace/ltt-type-parser.h | 17 ++ > > 2 files changed, 320 insertions(+) > > create mode 100644 converter/ltt-type-parser.c > > create mode 100644 include/babeltrace/ltt-type-parser.h > > > > diff --git a/converter/ltt-type-parser.c b/converter/ltt-type-parser.c > > new file mode 100644 > > index 0000000..4290ee1 > > --- /dev/null > > +++ b/converter/ltt-type-parser.c > > @@ -0,0 +1,303 @@ > > +/* > > + * ltt-type-parser.c > > + * > > + * Parse legacy LTT trace type format strings. > > + * Resurrected from lttng-ust (serialize.c) git commit id: 31607b3 > > + * and slightly adopted to be useable by babeltrace-legacy. > > + * > > + * Copyright Mathieu Desnoyers, March 2007. > > The original license of this code was LGPLv2.1+. It cannot be relicensed > to MIT-license without prior acceptance of each contributor. OK, so this code should stay LGPLv2.1+. Seems like I copied the license from the wrong place. Ideally this code would be provided by you, I just send it along so the converter can be compiled. --Jan > Thanks, > > Mathieu > > > + * > > + * Permission is hereby granted, free of charge, to any person obtaining a copy > > + * of this software and associated documentation files (the "Software"), to deal > > + * in the Software without restriction, including without limitation the rights > > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > > + * copies of the Software, and to permit persons to whom the Software is > > + * furnished to do so, subject to the following conditions: > > + * > > + * The above copyright notice and this permission notice shall be included in > > + * all copies or substantial portions of the Software. > > + * > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > > + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > > + * SOFTWARE. > > + */ > > + > > +#include > > +#include > > +#include > > +#include "babeltrace/ltt-type-parser.h" > > + > > +/* > > + * Restrictions: > > + * Field width and precision are *not* supported. > > + * %n not supported. > > + */ > > +static const char *parse_c_type(const char *fmt, char *c_size, > > + enum ltt_type *c_type, char *base, > > + char *outfmt, int arch_size, > > + int size_long, int size_size_t) > > +{ > > + int qualifier; > > + > > + /* process flags : ignore standard print formats for now. */ > > +repeat: > > + switch (*fmt) { > > + case '-': > > + case '+': > > + case ' ': > > + case '#': > > + case '0': > > + ++fmt; > > + goto repeat; > > + } > > + > > + /* get the conversion qualifier */ > > + qualifier = -1; > > + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || > > + *fmt == 'Z' || *fmt == 'z' || *fmt == 't' || > > + *fmt == 'S') { > > + qualifier = *fmt; > > + ++fmt; > > + if (qualifier == 'l' && *fmt == 'l') { > > + qualifier = 'L'; > > + ++fmt; > > + } > > + } > > + > > + if (outfmt) { > > + if (qualifier != -1) > > + *outfmt++ = (char)qualifier; > > + *outfmt++ = *fmt; > > + *outfmt = 0; > > + } > > + > > + switch (*fmt) { > > + case 'c': > > + *base = 10; > > + *c_type = LTT_TYPE_UNSIGNED_INT; > > + *c_size = sizeof(unsigned char); > > + goto parse_end; > > + case 's': > > + *c_type = LTT_TYPE_STRING; > > + goto parse_end; > > + case 'p': > > + *base = 16; > > + *c_type = LTT_TYPE_UNSIGNED_INT; > > + *c_size = arch_size; > > + goto parse_end; > > + case 'd': > > + case 'i': > > + *base = 10; > > + *c_type = LTT_TYPE_SIGNED_INT; > > + break; > > + case 'o': > > + *base = 8; > > + *c_type = LTT_TYPE_UNSIGNED_INT; > > + break; > > + case 'u': > > + *base = 10; > > + *c_type = LTT_TYPE_UNSIGNED_INT; > > + break; > > + case 'x': > > + case 'X': > > + *base = 16; > > + *c_type = LTT_TYPE_UNSIGNED_INT; > > + break; > > + default: > > + if (!*fmt) > > + --fmt; > > + goto parse_end; > > + } > > + switch (qualifier) { > > + case 'L': > > + *c_size = sizeof(long long); > > + break; > > + case 'l': > > + *c_size = size_long; > > + break; > > + case 'Z': > > + case 'z': > > + *c_size = size_size_t; > > + break; > > + case 'h': > > + *c_size = sizeof(short); > > + break; > > + default: > > + *c_size = sizeof(int); > > + } > > + > > +parse_end: > > + return fmt; > > +} > > + > > +static inline const char *parse_trace_type(const char *fmt, > > + char *trace_size, enum ltt_type *trace_type, > > + char *base, unsigned long *attributes, > > + int arch_size, int size_long, int size_size_t) > > +{ > > + int qualifier; > > + > > + /* parse attributes. */ > > +repeat: > > + switch (*fmt) { > > + case 'n': > > + *attributes |= (1<<1); > > + ++fmt; > > + goto repeat; > > + } > > + > > + /* get the conversion qualifier */ > > + qualifier = -1; > > + if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || > > + *fmt == 'Z' || *fmt == 'z' || *fmt == 't' || > > + *fmt == 'S' || *fmt == '1' || *fmt == '2' || > > + *fmt == '4' || *fmt == 8) { > > + qualifier = *fmt; > > + ++fmt; > > + if (qualifier == 'l' && *fmt == 'l') { > > + qualifier = 'L'; > > + ++fmt; > > + } > > + } > > + > > + switch (*fmt) { > > + case 'c': > > + *base = 10; > > + *trace_type = LTT_TYPE_UNSIGNED_INT; > > + *trace_size = sizeof(unsigned char); > > + goto parse_end; > > + case 's': > > + *trace_type = LTT_TYPE_STRING; > > + goto parse_end; > > + case 'p': > > + *base = 16; > > + *trace_type = LTT_TYPE_UNSIGNED_INT; > > + *trace_size = arch_size; > > + goto parse_end; > > + case 'd': > > + case 'i': > > + *base = 10; > > + *trace_type = LTT_TYPE_SIGNED_INT; > > + break; > > + case 'o': > > + *base = 8; > > + *trace_type = LTT_TYPE_UNSIGNED_INT; > > + break; > > + case 'u': > > + *base = 10; > > + *trace_type = LTT_TYPE_UNSIGNED_INT; > > + break; > > + case 'x': > > + case 'X': > > + *base = 16; > > + *trace_type = LTT_TYPE_UNSIGNED_INT; > > + break; > > + default: > > + if (!*fmt) > > + --fmt; > > + goto parse_end; > > + } > > + switch (qualifier) { > > + case 'L': > > + *trace_size = sizeof(long long); > > + break; > > + case 'l': > > + *trace_size = size_long; > > + break; > > + case 'Z': > > + case 'z': > > + *trace_size = size_size_t; > > + break; > > + case 'h': > > + *trace_size = sizeof(short); > > + break; > > + case '1': > > + *trace_size = sizeof(uint8_t); > > + break; > > + case '2': > > + *trace_size = sizeof(uint16_t); > > + break; > > + case '4': > > + *trace_size = sizeof(uint32_t); > > + break; > > + case '8': > > + *trace_size = sizeof(uint64_t); > > + break; > > + default: > > + *trace_size = sizeof(int); > > + } > > + > > +parse_end: > > + return fmt; > > +} > > + > > +int parse_format(char *out, const char *fmt, > > + int arch_size, int size_long, int size_size_t, > > + int (*write) (char *p, char trace_size, char c_size, > > + enum ltt_type c_type, char base, char *name)) > > +{ > > + char trace_size = 0, c_size = 0; /* 0 (unset), 1, 2, 4, 8 bytes */ > > + char base = 0; /* 0 (unset), 10, 16 */ > > + enum ltt_type trace_type = LTT_TYPE_NONE, c_type = LTT_TYPE_NONE; > > + unsigned long attributes = 0; > > + char name[256]; > > + char *pname = name; > > + int len = 0; > > + > > + memset(name, 0, sizeof(name)); > > + > > + for (; *fmt ; ++fmt) { > > + switch (*fmt) { > > + case '#': > > + /* tracetypes (#) */ > > + ++fmt; /* skip first '#' */ > > + if (*fmt == '#') /* Escaped ## */ > > + break; > > + attributes = 0; > > + fmt = parse_trace_type(fmt, &trace_size, &trace_type, > > + &base, &attributes, > > + arch_size, size_long, size_size_t); > > + break; > > + case '%': > > + /* c types (%) */ > > + ++fmt; /* skip first '%' */ > > + if (*fmt == '%') /* Escaped %% */ > > + break; > > + fmt = parse_c_type(fmt, &c_size, &c_type, &base, NULL, > > + arch_size, size_long, size_size_t); > > + /* > > + * Output c types if no trace types has been > > + * specified. > > + */ > > + if (!trace_size) > > + trace_size = c_size; > > + if (trace_type == LTT_TYPE_NONE) > > + trace_type = c_type; > > + if (c_type == LTT_TYPE_STRING) > > + trace_type = LTT_TYPE_STRING; > > + /* perform write */ > > + len += write(out + len, trace_size, c_size, trace_type, > > + base, name); > > + trace_size = 0; > > + c_size = 0; > > + trace_type = LTT_TYPE_NONE; > > + c_size = LTT_TYPE_NONE; > > + attributes = 0; > > + memset(name, 0, sizeof(name)); > > + pname = name; > > + break; > > + case ' ': > > + /* skip spaces */ > > + continue; > > + default: > > + /* default is to copy the text as parameter name */ > > + *pname = *fmt; > > + pname++; > > + } > > + } > > + return len; > > +} > > diff --git a/include/babeltrace/ltt-type-parser.h b/include/babeltrace/ltt-type-parser.h > > new file mode 100644 > > index 0000000..85d9a92 > > --- /dev/null > > +++ b/include/babeltrace/ltt-type-parser.h > > @@ -0,0 +1,17 @@ > > +#ifndef _LTT_TYPE_PARSER_H > > +#define _LTT_TYPE_PARSER_H > > + > > +#include > > + > > +enum ltt_type { > > + LTT_TYPE_SIGNED_INT, > > + LTT_TYPE_UNSIGNED_INT, > > + LTT_TYPE_STRING, > > + LTT_TYPE_NONE, > > +}; > > + > > +int parse_format(char *out, const char *fmt, int arch_size, > > + int size_long, int size_size_t, > > + int (*write) (char *p, char trace_size, char c_size, > > + enum ltt_type c_type, char base, char *name)); > > +#endif > > -- > > 1.7.9.5 > > > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com -- Jan Glauber --- Harman Becker Automotive GmbH System Profiling & Optimizing Team From David.OShea at quantum.com Wed May 15 07:38:10 2013 From: David.OShea at quantum.com (David OShea) Date: Wed, 15 May 2013 11:38:10 +0000 Subject: [lttng-dev] Patches to enable building on CentOS 5.x (glibc 2.5) Message-ID: <20998D40D9A2B7499CA5A3A2666CB1EB23FDCE2B@ZURMSG1.QUANTUM.com> Hi, Would contributions of patches to enable lttng-tools and lttng-ust to build with glibc 2.5 (as is shipped with CentOS 5.x) and to enable lttng-gen-tp to run with Python 2.4 (as shipped on CentOS 5.x) be accepted? What is missing from glibc 2.5 is: - a system call wrapper for sched_getcpu() - a system call wrapper for sync_file_range() - htobe32() and other similar endian conversion functions babeltrace and userspace-rcu did not require patching. Thanks in advance, David P.S. If you see this, thanks for all your recent replies, Mathieu, I will try to get back to you soon! ---------------------------------------------------------------------- The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt. From dgoulet at efficios.com Wed May 15 11:52:48 2013 From: dgoulet at efficios.com (David Goulet) Date: Wed, 15 May 2013 11:52:48 -0400 Subject: [lttng-dev] [PATCH lttng-tools 1/3] Tests: Move the babelstats utility to tests/utils In-Reply-To: <1368568427-8289-1-git-send-email-christian.babeux@efficios.com> References: <1368568427-8289-1-git-send-email-christian.babeux@efficios.com> Message-ID: <5193AF50.6030508@efficios.com> All 3 patches merged! Thanks David Christian Babeux: > This utility will prove useful in trace validation for other tests, > so put it in a common location accessible by the tests. > > Signed-off-by: Christian Babeux > --- > tests/regression/tools/filtering/Makefile.am | 4 +- > tests/regression/tools/filtering/babelstats.pl | 174 --------------------- > tests/regression/tools/filtering/test_valid_filter | 4 +- > tests/utils/babelstats.pl | 174 +++++++++++++++++++++ > 4 files changed, 178 insertions(+), 178 deletions(-) > delete mode 100755 tests/regression/tools/filtering/babelstats.pl > create mode 100755 tests/utils/babelstats.pl > > diff --git a/tests/regression/tools/filtering/Makefile.am b/tests/regression/tools/filtering/Makefile.am > index 5629da2..ca60dbf 100644 > --- a/tests/regression/tools/filtering/Makefile.am > +++ b/tests/regression/tools/filtering/Makefile.am > @@ -14,5 +14,5 @@ gen_ust_events_SOURCES = gen-ust-events.c tp.c tp.h > gen_ust_events_LDADD = -llttng-ust > endif > > -noinst_SCRIPTS = test_unsupported_op test_invalid_filter test_valid_filter babelstats.pl > -EXTRA_DIST = test_unsupported_op test_invalid_filter test_valid_filter babelstats.pl > +noinst_SCRIPTS = test_unsupported_op test_invalid_filter test_valid_filter > +EXTRA_DIST = test_unsupported_op test_invalid_filter test_valid_filter > diff --git a/tests/regression/tools/filtering/babelstats.pl b/tests/regression/tools/filtering/babelstats.pl > deleted file mode 100755 > index d8d4dd0..0000000 > --- a/tests/regression/tools/filtering/babelstats.pl > +++ /dev/null > @@ -1,174 +0,0 @@ > -#!/usr/bin/perl > - > -# Copyright (C) - 2012 Christian Babeux > -# > -# This program is free software; you can redistribute it and/or modify it > -# under the terms of the GNU General Public License, version 2 only, as > -# published by the Free Software Foundation. > -# > -# This program is distributed in the hope that it will be useful, but WITHOUT > -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > -# more details. > -# > -# You should have received a copy of the GNU General Public License along with > -# this program; if not, write to the Free Software Foundation, Inc., 51 > -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > - > -use strict; > -use warnings; > - > -use Getopt::Long; > - > -my $opt_tracepoint; > - > -GetOptions('tracepoint=s' => \$opt_tracepoint) > - or die("Invalid command-line option\n"); > - > -defined($opt_tracepoint) > - or die("Missing tracepoint, use --tracepoint "); > - > -# Parse an array string. > -# The format is as follow: [ [index] = value, ... ] > -sub parse_array > -{ > - my ($arr_str) = @_; > - my @array = (); > - > - # Strip leading and ending brackets, remove whitespace > - $arr_str =~ s/^\[//; > - $arr_str =~ s/\]$//; > - $arr_str =~ s/\s//g; > - > - my @entries = split(',', $arr_str); > - > - foreach my $entry (@entries) { > - if ($entry =~ /^\[(\d+)\]=(\d+)$/) { > - my $index = $1; > - my $value = $2; > - splice @array, $index, 0, $value; > - } > - } > - > - return \@array; > -} > - > -# Parse fields values. > -# Format can either be a name = array or a name = value pair. > -sub parse_fields > -{ > - my ($fields_str) = @_; > - my %fields_hash; > - > - my $field_name = '[\w\d_]+'; > - my $field_value = '[\w\d_\\\*"]+'; > - my $array = '\[(?:\s\[\d+\]\s=\s\d+,)*\s\[\d+\]\s=\s\d+\s\]'; > - > - # Split the various fields > - my @fields = ($fields_str =~ /$field_name\s=\s(?:$array|$field_value)/g); > - > - foreach my $field (@fields) { > - if ($field =~ /($field_name)\s=\s($array)/) { > - my $name = $1; > - my $value = parse_array($2); > - $fields_hash{$name} = $value; > - } > - > - if ($field =~ /($field_name)\s=\s($field_value)/) { > - my $name = $1; > - my $value = $2; > - $fields_hash{$name} = $value; > - } > - } > - > - return \%fields_hash; > -} > - > -# Using an event array, merge all the fields > -# of a particular tracepoint. > -sub merge_fields > -{ > - my ($events_ref) = @_; > - my %merged; > - > - foreach my $event (@{$events_ref}) { > - my $tp_provider = $event->{'tp_provider'}; > - my $tp_name = $event->{'tp_name'}; > - my $tracepoint = "$tp_provider:$tp_name"; > - > - foreach my $key (keys %{$event->{'fields'}}) { > - my $val = $event->{'fields'}->{$key}; > - > - # TODO: Merge of array is not implemented. > - next if (ref($val) eq 'ARRAY'); > - $merged{$tracepoint}{$key}{$val} = undef; > - } > - } > - > - return \%merged; > -} > - > -# Print the minimum and maximum of each fields > -# for a particular tracepoint. > -sub print_fields_stats > -{ > - my ($merged_ref, $tracepoint) = @_; > - > - return unless ($tracepoint && exists $merged_ref->{$tracepoint}); > - > - foreach my $field (keys %{$merged_ref->{$tracepoint}}) { > - my @sorted; > - my @val = keys ($merged_ref->{$tracepoint}->{$field}); > - > - if ($val[0] =~ /^\d+$/) { > - # Sort numerically > - @sorted = sort { $a <=> $b } @val; > - } elsif ($val[0] =~ /^0x[\da-f]+$/i) { > - # Convert the hex values and sort numerically > - @sorted = sort { hex($a) <=> hex($b) } @val; > - } else { > - # Fallback, alphabetical sort > - @sorted = sort { lc($a) cmp lc($b) } @val; > - } > - > - my $min = $sorted[0]; > - my $max = $sorted[-1]; > - > - print "$field $min $max\n"; > - } > -} > - > -my @events; > - > -while (<>) > -{ > - my $timestamp = '\[(.*)\]'; > - my $elapsed = '\((.*)\)'; > - my $hostname = '.*'; > - my $pname = '.*'; > - my $pid = '\d+'; > - my $tp_provider = '.*'; > - my $tp_name = '.*'; > - my $cpu_info = '{\scpu_id\s=\s(\d+)\s\}'; > - my $fields = '{(.*)}'; > - > - # Parse babeltrace text output format > - if (/$timestamp\s$elapsed\s($hostname):($pname):($pid)\s($tp_provider):($tp_name):\s$cpu_info,\s$fields/) { > - my %event_hash; > - > - $event_hash{'timestamp'} = $1; > - $event_hash{'elapsed'} = $2; > - $event_hash{'hostname'} = $3; > - $event_hash{'pname'} = $4; > - $event_hash{'pid'} = $5; > - $event_hash{'tp_provider'} = $6; > - $event_hash{'tp_name'} = $7; > - $event_hash{'cpu_id'} = $8; > - $event_hash{'fields'} = parse_fields($9); > - > - push @events, \%event_hash; > - } > -} > - > -my %merged_fields = %{merge_fields(\@{events})}; > -print_fields_stats(\%merged_fields, $opt_tracepoint); > diff --git a/tests/regression/tools/filtering/test_valid_filter b/tests/regression/tools/filtering/test_valid_filter > index 7170eb5..a62cc1e 100755 > --- a/tests/regression/tools/filtering/test_valid_filter > +++ b/tests/regression/tools/filtering/test_valid_filter > @@ -21,7 +21,7 @@ CURDIR=$(dirname $0)/ > TESTDIR=$CURDIR/../../.. > LTTNG_BIN="lttng" > BIN_NAME="gen-ust-events" > -STATS_BIN="babelstats.pl" > +STATS_BIN="$TESTDIR/utils/babelstats.pl" > SESSION_NAME="valid_filter" > EVENT_NAME="tp:tptest" > NR_ITER=100 > @@ -81,7 +81,7 @@ function test_valid_filter > # Destroy session > destroy_lttng_session $SESSION_NAME > > - stats=`babeltrace $trace_path | $CURDIR/$STATS_BIN --tracepoint $EVENT_NAME` > + stats=`babeltrace $trace_path | $STATS_BIN --tracepoint $EVENT_NAME` > > rm -rf $trace_path > > diff --git a/tests/utils/babelstats.pl b/tests/utils/babelstats.pl > new file mode 100755 > index 0000000..d8d4dd0 > --- /dev/null > +++ b/tests/utils/babelstats.pl > @@ -0,0 +1,174 @@ > +#!/usr/bin/perl > + > +# Copyright (C) - 2012 Christian Babeux > +# > +# This program is free software; you can redistribute it and/or modify it > +# under the terms of the GNU General Public License, version 2 only, as > +# published by the Free Software Foundation. > +# > +# This program is distributed in the hope that it will be useful, but WITHOUT > +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for > +# more details. > +# > +# You should have received a copy of the GNU General Public License along with > +# this program; if not, write to the Free Software Foundation, Inc., 51 > +# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + > +use strict; > +use warnings; > + > +use Getopt::Long; > + > +my $opt_tracepoint; > + > +GetOptions('tracepoint=s' => \$opt_tracepoint) > + or die("Invalid command-line option\n"); > + > +defined($opt_tracepoint) > + or die("Missing tracepoint, use --tracepoint "); > + > +# Parse an array string. > +# The format is as follow: [ [index] = value, ... ] > +sub parse_array > +{ > + my ($arr_str) = @_; > + my @array = (); > + > + # Strip leading and ending brackets, remove whitespace > + $arr_str =~ s/^\[//; > + $arr_str =~ s/\]$//; > + $arr_str =~ s/\s//g; > + > + my @entries = split(',', $arr_str); > + > + foreach my $entry (@entries) { > + if ($entry =~ /^\[(\d+)\]=(\d+)$/) { > + my $index = $1; > + my $value = $2; > + splice @array, $index, 0, $value; > + } > + } > + > + return \@array; > +} > + > +# Parse fields values. > +# Format can either be a name = array or a name = value pair. > +sub parse_fields > +{ > + my ($fields_str) = @_; > + my %fields_hash; > + > + my $field_name = '[\w\d_]+'; > + my $field_value = '[\w\d_\\\*"]+'; > + my $array = '\[(?:\s\[\d+\]\s=\s\d+,)*\s\[\d+\]\s=\s\d+\s\]'; > + > + # Split the various fields > + my @fields = ($fields_str =~ /$field_name\s=\s(?:$array|$field_value)/g); > + > + foreach my $field (@fields) { > + if ($field =~ /($field_name)\s=\s($array)/) { > + my $name = $1; > + my $value = parse_array($2); > + $fields_hash{$name} = $value; > + } > + > + if ($field =~ /($field_name)\s=\s($field_value)/) { > + my $name = $1; > + my $value = $2; > + $fields_hash{$name} = $value; > + } > + } > + > + return \%fields_hash; > +} > + > +# Using an event array, merge all the fields > +# of a particular tracepoint. > +sub merge_fields > +{ > + my ($events_ref) = @_; > + my %merged; > + > + foreach my $event (@{$events_ref}) { > + my $tp_provider = $event->{'tp_provider'}; > + my $tp_name = $event->{'tp_name'}; > + my $tracepoint = "$tp_provider:$tp_name"; > + > + foreach my $key (keys %{$event->{'fields'}}) { > + my $val = $event->{'fields'}->{$key}; > + > + # TODO: Merge of array is not implemented. > + next if (ref($val) eq 'ARRAY'); > + $merged{$tracepoint}{$key}{$val} = undef; > + } > + } > + > + return \%merged; > +} > + > +# Print the minimum and maximum of each fields > +# for a particular tracepoint. > +sub print_fields_stats > +{ > + my ($merged_ref, $tracepoint) = @_; > + > + return unless ($tracepoint && exists $merged_ref->{$tracepoint}); > + > + foreach my $field (keys %{$merged_ref->{$tracepoint}}) { > + my @sorted; > + my @val = keys ($merged_ref->{$tracepoint}->{$field}); > + > + if ($val[0] =~ /^\d+$/) { > + # Sort numerically > + @sorted = sort { $a <=> $b } @val; > + } elsif ($val[0] =~ /^0x[\da-f]+$/i) { > + # Convert the hex values and sort numerically > + @sorted = sort { hex($a) <=> hex($b) } @val; > + } else { > + # Fallback, alphabetical sort > + @sorted = sort { lc($a) cmp lc($b) } @val; > + } > + > + my $min = $sorted[0]; > + my $max = $sorted[-1]; > + > + print "$field $min $max\n"; > + } > +} > + > +my @events; > + > +while (<>) > +{ > + my $timestamp = '\[(.*)\]'; > + my $elapsed = '\((.*)\)'; > + my $hostname = '.*'; > + my $pname = '.*'; > + my $pid = '\d+'; > + my $tp_provider = '.*'; > + my $tp_name = '.*'; > + my $cpu_info = '{\scpu_id\s=\s(\d+)\s\}'; > + my $fields = '{(.*)}'; > + > + # Parse babeltrace text output format > + if (/$timestamp\s$elapsed\s($hostname):($pname):($pid)\s($tp_provider):($tp_name):\s$cpu_info,\s$fields/) { > + my %event_hash; > + > + $event_hash{'timestamp'} = $1; > + $event_hash{'elapsed'} = $2; > + $event_hash{'hostname'} = $3; > + $event_hash{'pname'} = $4; > + $event_hash{'pid'} = $5; > + $event_hash{'tp_provider'} = $6; > + $event_hash{'tp_name'} = $7; > + $event_hash{'cpu_id'} = $8; > + $event_hash{'fields'} = parse_fields($9); > + > + push @events, \%event_hash; > + } > +} > + > +my %merged_fields = %{merge_fields(\@{events})}; > +print_fields_stats(\%merged_fields, $opt_tracepoint); From jeremie.galarneau at efficios.com Wed May 15 12:39:15 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Wed, 15 May 2013 12:39:15 -0400 Subject: [lttng-dev] [PATCH babeltrace] Fix: Remove extra quote after an include directive Message-ID: <1368635955-13695-1-git-send-email-jeremie.galarneau@efficios.com> Signed-off-by: J?r?mie Galarneau --- formats/ctf/ctf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index b27f2ec..bb94e52 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -51,7 +51,7 @@ #include "metadata/ctf-parser.h" #include "metadata/ctf-ast.h" #include "events-private.h" -#include " +#include #define LOG2_CHAR_BIT 3 -- 1.8.2.2 From mathieu.desnoyers at efficios.com Wed May 15 12:50:30 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 15 May 2013 12:50:30 -0400 Subject: [lttng-dev] [PATCH babeltrace] Fix: Remove extra quote after an include directive In-Reply-To: <1368635955-13695-1-git-send-email-jeremie.galarneau@efficios.com> References: <1368635955-13695-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130515165030.GA10924@Krystal> in which tree did you find this ? * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > Signed-off-by: J?r?mie Galarneau > --- > formats/ctf/ctf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c > index b27f2ec..bb94e52 100644 > --- a/formats/ctf/ctf.c > +++ b/formats/ctf/ctf.c > @@ -51,7 +51,7 @@ > #include "metadata/ctf-parser.h" > #include "metadata/ctf-ast.h" > #include "events-private.h" > -#include " > +#include > > #define LOG2_CHAR_BIT 3 > > -- > 1.8.2.2 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Wed May 15 13:01:01 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Wed, 15 May 2013 13:01:01 -0400 Subject: [lttng-dev] [PATCH babeltrace] Fix: Remove extra quote after an include directive In-Reply-To: <20130515165030.GA10924@Krystal> References: <1368635955-13695-1-git-send-email-jeremie.galarneau@efficios.com> <20130515165030.GA10924@Krystal> Message-ID: It was introduced here: https://bugs.lttng.org/projects/babeltrace/repository/revisions/4cb26dfbd763c06d99bf1069e2d1f3a569858e32/diff On Wed, May 15, 2013 at 12:50 PM, Mathieu Desnoyers wrote: > in which tree did you find this ? > > * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: >> Signed-off-by: J?r?mie Galarneau >> --- >> formats/ctf/ctf.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c >> index b27f2ec..bb94e52 100644 >> --- a/formats/ctf/ctf.c >> +++ b/formats/ctf/ctf.c >> @@ -51,7 +51,7 @@ >> #include "metadata/ctf-parser.h" >> #include "metadata/ctf-ast.h" >> #include "events-private.h" >> -#include " >> +#include >> >> #define LOG2_CHAR_BIT 3 >> >> -- >> 1.8.2.2 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Wed May 15 15:05:43 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 15 May 2013 15:05:43 -0400 Subject: [lttng-dev] [PATCH babeltrace] Fix: Remove extra quote after an include directive In-Reply-To: References: <1368635955-13695-1-git-send-email-jeremie.galarneau@efficios.com> <20130515165030.GA10924@Krystal> Message-ID: <20130515190543.GA12448@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > It was introduced here: > https://bugs.lttng.org/projects/babeltrace/repository/revisions/4cb26dfbd763c06d99bf1069e2d1f3a569858e32/diff OK, I was probably looking at the wrong file. Merged, thanks! Mathieu > > On Wed, May 15, 2013 at 12:50 PM, Mathieu Desnoyers > wrote: > > in which tree did you find this ? > > > > * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > >> Signed-off-by: J?r?mie Galarneau > >> --- > >> formats/ctf/ctf.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c > >> index b27f2ec..bb94e52 100644 > >> --- a/formats/ctf/ctf.c > >> +++ b/formats/ctf/ctf.c > >> @@ -51,7 +51,7 @@ > >> #include "metadata/ctf-parser.h" > >> #include "metadata/ctf-ast.h" > >> #include "events-private.h" > >> -#include " > >> +#include > >> > >> #define LOG2_CHAR_BIT 3 > >> > >> -- > >> 1.8.2.2 > >> > >> > >> _______________________________________________ > >> lttng-dev mailing list > >> lttng-dev at lists.lttng.org > >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > -- > > Mathieu Desnoyers > > EfficiOS Inc. > > http://www.efficios.com > > > > -- > J?r?mie Galarneau > EfficiOS Inc. > http://www.efficios.com -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Wed May 15 15:16:41 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 15 May 2013 15:16:41 -0400 Subject: [lttng-dev] [PATCH 1/3 lttng-tools] Change consumer_data_pipe to be a lttng_pipe In-Reply-To: <1368553935-17162-1-git-send-email-dgoulet@efficios.com> References: <1368553935-17162-1-git-send-email-dgoulet@efficios.com> Message-ID: <20130515191641.GA12581@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > Also, an important change here is that this pipe is no longer in non > block mode. Before sending stream's pointer over this pipe, only one > byte was written thus making it unlikely to fail in a read/write race > condition between threads. Now, 4 bytes are written so keeping this pipe > non block with threads is a bit of a "looking for trouble situation". > > The lttng pipe wrappers make sure that the read and write side are > synchronized between threads using a mutex for each side. Furthermore, > the read and write handle partial I/O and EINTR meaning that once the > call returns we are sure that either everything was read/written or an > error occured thus making it not possible for the read side to block > indefinitely after a poll event. > > Signed-off-by: David Goulet > --- > src/common/consumer.c | 53 ++++++++++++-------------- > src/common/consumer.h | 3 +- > src/common/kernel-consumer/kernel-consumer.c | 3 +- > src/common/ust-consumer/ust-consumer.c | 2 +- > 4 files changed, 29 insertions(+), 32 deletions(-) > > diff --git a/src/common/consumer.c b/src/common/consumer.c > index 01266a7..bd618dd 100644 > --- a/src/common/consumer.c > +++ b/src/common/consumer.c > @@ -91,6 +91,20 @@ static void notify_thread_pipe(int wpipe) > } while (ret < 0 && errno == EINTR); > } > > +/* > + * Notify a thread lttng pipe to poll back again. This usually means that some > + * global state has changed so we just send back the thread in a poll wait > + * call. > + */ > +static void notify_thread_lttng_pipe(struct lttng_pipe *pipe) > +{ > + struct lttng_consumer_stream *null_stream = NULL; > + > + assert(pipe); > + > + (void) lttng_pipe_write(pipe, &null_stream, sizeof(null_stream)); > +} > + > static void notify_channel_pipe(struct lttng_consumer_local_data *ctx, > struct lttng_consumer_channel *chan, > uint64_t key, > @@ -406,7 +420,7 @@ static void cleanup_relayd(struct consumer_relayd_sock_pair *relayd, > * read of this status which happens AFTER receiving this notify. > */ > if (ctx) { > - notify_thread_pipe(ctx->consumer_data_pipe[1]); > + notify_thread_lttng_pipe(ctx->consumer_data_pipe); > notify_thread_pipe(ctx->consumer_metadata_pipe[1]); > } > } > @@ -971,7 +985,7 @@ static int update_poll_array(struct lttng_consumer_local_data *ctx, > * Insert the consumer_data_pipe at the end of the array and don't > * increment i so nb_fd is the number of real FD. > */ > - (*pollfd)[i].fd = ctx->consumer_data_pipe[0]; > + (*pollfd)[i].fd = lttng_pipe_get_readfd(ctx->consumer_data_pipe); > (*pollfd)[i].events = POLLIN | POLLPRI; > return i; > } > @@ -1167,26 +1181,11 @@ struct lttng_consumer_local_data *lttng_consumer_create( > ctx->on_recv_stream = recv_stream; > ctx->on_update_stream = update_stream; > > - ret = pipe(ctx->consumer_data_pipe); > - if (ret < 0) { > - PERROR("Error creating poll pipe"); > + ctx->consumer_data_pipe = lttng_pipe_open(0); > + if (!ctx->consumer_data_pipe) { > goto error_poll_pipe; > } > > - /* set read end of the pipe to non-blocking */ > - ret = fcntl(ctx->consumer_data_pipe[0], F_SETFL, O_NONBLOCK); > - if (ret < 0) { > - PERROR("fcntl O_NONBLOCK"); > - goto error_poll_fcntl; > - } > - > - /* set write end of the pipe to non-blocking */ > - ret = fcntl(ctx->consumer_data_pipe[1], F_SETFL, O_NONBLOCK); > - if (ret < 0) { > - PERROR("fcntl O_NONBLOCK"); > - goto error_poll_fcntl; > - } > - > ret = pipe(ctx->consumer_should_quit); > if (ret < 0) { > PERROR("Error creating recv pipe"); > @@ -1225,9 +1224,8 @@ error_channel_pipe: > utils_close_pipe(ctx->consumer_thread_pipe); > error_thread_pipe: > utils_close_pipe(ctx->consumer_should_quit); > -error_poll_fcntl: > error_quit_pipe: > - utils_close_pipe(ctx->consumer_data_pipe); > + lttng_pipe_destroy(ctx->consumer_data_pipe); > error_poll_pipe: > free(ctx); > error: > @@ -1253,7 +1251,7 @@ void lttng_consumer_destroy(struct lttng_consumer_local_data *ctx) > } > utils_close_pipe(ctx->consumer_thread_pipe); > utils_close_pipe(ctx->consumer_channel_pipe); > - utils_close_pipe(ctx->consumer_data_pipe); > + lttng_pipe_destroy(ctx->consumer_data_pipe); > utils_close_pipe(ctx->consumer_should_quit); > utils_close_pipe(ctx->consumer_splice_metadata_pipe); > > @@ -2402,13 +2400,10 @@ void *consumer_thread_data_poll(void *data) > ssize_t pipe_readlen; > > DBG("consumer_data_pipe wake up"); > - /* Consume 1 byte of pipe data */ > - do { > - pipe_readlen = read(ctx->consumer_data_pipe[0], &new_stream, > - sizeof(new_stream)); > - } while (pipe_readlen == -1 && errno == EINTR); > + pipe_readlen = lttng_pipe_read(ctx->consumer_data_pipe, > + &new_stream, sizeof(new_stream)); > if (pipe_readlen < 0) { can lttng_pipe_read return a value smaller than sizeof(new_stream) on some error conditions ? (but higher than 0) Thanks, Mathieu > - PERROR("read consumer data pipe"); > + ERR("Consumer data pipe ret %ld", pipe_readlen); > /* Continue so we can at least handle the current stream(s). */ > continue; > } > @@ -2968,7 +2963,7 @@ end: > * Notify the data poll thread to poll back again and test the > * consumer_quit state that we just set so to quit gracefully. > */ > - notify_thread_pipe(ctx->consumer_data_pipe[1]); > + notify_thread_lttng_pipe(ctx->consumer_data_pipe); > > notify_channel_pipe(ctx, NULL, -1, CONSUMER_CHANNEL_QUIT); > > diff --git a/src/common/consumer.h b/src/common/consumer.h > index 43989e4..91039e8 100644 > --- a/src/common/consumer.h > +++ b/src/common/consumer.h > @@ -31,6 +31,7 @@ > #include > #include > #include > +#include > > /* Commands for consumer */ > enum lttng_consumer_command { > @@ -346,7 +347,7 @@ struct lttng_consumer_local_data { > int consumer_channel_pipe[2]; > int consumer_splice_metadata_pipe[2]; > /* Data stream poll thread pipe. To transfer data stream to the thread */ > - int consumer_data_pipe[2]; > + struct lttng_pipe *consumer_data_pipe; > /* to let the signal handler wake up the fd receiver thread */ > int consumer_should_quit[2]; > /* Metadata poll thread pipe. Transfer metadata stream to it */ > diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c > index 2cf9ac1..d8aec49 100644 > --- a/src/common/kernel-consumer/kernel-consumer.c > +++ b/src/common/kernel-consumer/kernel-consumer.c > @@ -34,6 +34,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -289,7 +290,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, > if (new_stream->metadata_flag) { > stream_pipe = ctx->consumer_metadata_pipe[1]; > } else { > - stream_pipe = ctx->consumer_data_pipe[1]; > + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); > } > > do { > diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c > index 031a7cb..ddf80da 100644 > --- a/src/common/ust-consumer/ust-consumer.c > +++ b/src/common/ust-consumer/ust-consumer.c > @@ -191,7 +191,7 @@ static int send_stream_to_thread(struct lttng_consumer_stream *stream, > if (stream->metadata_flag) { > stream_pipe = ctx->consumer_metadata_pipe[1]; > } else { > - stream_pipe = ctx->consumer_data_pipe[1]; > + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); > } > > do { > -- > 1.7.10.4 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Wed May 15 15:19:07 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 15 May 2013 15:19:07 -0400 Subject: [lttng-dev] [PATCH 2/3 lttng-tools] Change consumer_metadata_pipe to be a lttng_pipe In-Reply-To: <1368553935-17162-2-git-send-email-dgoulet@efficios.com> References: <1368553935-17162-1-git-send-email-dgoulet@efficios.com> <1368553935-17162-2-git-send-email-dgoulet@efficios.com> Message-ID: <20130515191907.GB12581@Krystal> why isn't this patch using lttng_pipe_read() ? * David Goulet (dgoulet at efficios.com) wrote: > Signed-off-by: David Goulet > --- > src/common/consumer.c | 42 ++++++++------------------ > src/common/consumer.h | 2 +- > src/common/kernel-consumer/kernel-consumer.c | 2 +- > src/common/ust-consumer/ust-consumer.c | 2 +- > 4 files changed, 15 insertions(+), 33 deletions(-) > > diff --git a/src/common/consumer.c b/src/common/consumer.c > index bd618dd..ef35927 100644 > --- a/src/common/consumer.c > +++ b/src/common/consumer.c > @@ -77,21 +77,6 @@ static struct lttng_ht *metadata_ht; > static struct lttng_ht *data_ht; > > /* > - * Notify a thread pipe to poll back again. This usually means that some global > - * state has changed so we just send back the thread in a poll wait call. > - */ > -static void notify_thread_pipe(int wpipe) > -{ > - int ret; > - > - do { > - struct lttng_consumer_stream *null_stream = NULL; > - > - ret = write(wpipe, &null_stream, sizeof(null_stream)); > - } while (ret < 0 && errno == EINTR); > -} > - > -/* > * Notify a thread lttng pipe to poll back again. This usually means that some > * global state has changed so we just send back the thread in a poll wait > * call. > @@ -421,7 +406,7 @@ static void cleanup_relayd(struct consumer_relayd_sock_pair *relayd, > */ > if (ctx) { > notify_thread_lttng_pipe(ctx->consumer_data_pipe); > - notify_thread_pipe(ctx->consumer_metadata_pipe[1]); > + notify_thread_lttng_pipe(ctx->consumer_metadata_pipe); > } > } > > @@ -1204,8 +1189,8 @@ struct lttng_consumer_local_data *lttng_consumer_create( > goto error_channel_pipe; > } > > - ret = utils_create_pipe(ctx->consumer_metadata_pipe); > - if (ret < 0) { > + ctx->consumer_metadata_pipe = lttng_pipe_open(0); > + if (!ctx->consumer_metadata_pipe) { > goto error_metadata_pipe; > } > > @@ -1217,7 +1202,7 @@ struct lttng_consumer_local_data *lttng_consumer_create( > return ctx; > > error_splice_pipe: > - utils_close_pipe(ctx->consumer_metadata_pipe); > + lttng_pipe_destroy(ctx->consumer_metadata_pipe); > error_metadata_pipe: > utils_close_pipe(ctx->consumer_channel_pipe); > error_channel_pipe: > @@ -1252,6 +1237,7 @@ void lttng_consumer_destroy(struct lttng_consumer_local_data *ctx) > utils_close_pipe(ctx->consumer_thread_pipe); > utils_close_pipe(ctx->consumer_channel_pipe); > lttng_pipe_destroy(ctx->consumer_data_pipe); > + lttng_pipe_destroy(ctx->consumer_metadata_pipe); > utils_close_pipe(ctx->consumer_should_quit); > utils_close_pipe(ctx->consumer_splice_metadata_pipe); > > @@ -2132,7 +2118,8 @@ void *consumer_thread_metadata_poll(void *data) > goto end_poll; > } > > - ret = lttng_poll_add(&events, ctx->consumer_metadata_pipe[0], LPOLLIN); > + ret = lttng_poll_add(&events, > + lttng_pipe_get_readfd(ctx->consumer_metadata_pipe), LPOLLIN); > if (ret < 0) { > goto end; > } > @@ -2170,18 +2157,16 @@ restart: > continue; > } > > - if (pollfd == ctx->consumer_metadata_pipe[0]) { > + if (pollfd == lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)) { > if (revents & (LPOLLERR | LPOLLHUP )) { > DBG("Metadata thread pipe hung up"); > /* > * Remove the pipe from the poll set and continue the loop > * since their might be data to consume. > */ > - lttng_poll_del(&events, ctx->consumer_metadata_pipe[0]); > - ret = close(ctx->consumer_metadata_pipe[0]); > - if (ret < 0) { > - PERROR("close metadata pipe"); > - } > + lttng_poll_del(&events, > + lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)); > + lttng_pipe_read_close(ctx->consumer_metadata_pipe); > continue; > } else if (revents & LPOLLIN) { > do { > @@ -2541,10 +2526,7 @@ end: > * only tracked fd in the poll set. The thread will take care of closing > * the read side. > */ > - ret = close(ctx->consumer_metadata_pipe[1]); > - if (ret < 0) { > - PERROR("close data pipe"); > - } > + (void) lttng_pipe_write_close(ctx->consumer_metadata_pipe); > > destroy_data_stream_ht(data_ht); > > diff --git a/src/common/consumer.h b/src/common/consumer.h > index 91039e8..3726fd1 100644 > --- a/src/common/consumer.h > +++ b/src/common/consumer.h > @@ -351,7 +351,7 @@ struct lttng_consumer_local_data { > /* to let the signal handler wake up the fd receiver thread */ > int consumer_should_quit[2]; > /* Metadata poll thread pipe. Transfer metadata stream to it */ > - int consumer_metadata_pipe[2]; > + struct lttng_pipe *consumer_metadata_pipe; > }; > > /* > diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c > index d8aec49..f23fc9c 100644 > --- a/src/common/kernel-consumer/kernel-consumer.c > +++ b/src/common/kernel-consumer/kernel-consumer.c > @@ -288,7 +288,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, > > /* Get the right pipe where the stream will be sent. */ > if (new_stream->metadata_flag) { > - stream_pipe = ctx->consumer_metadata_pipe[1]; > + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); > } else { > stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); > } > diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c > index ddf80da..a81e9d4 100644 > --- a/src/common/ust-consumer/ust-consumer.c > +++ b/src/common/ust-consumer/ust-consumer.c > @@ -189,7 +189,7 @@ static int send_stream_to_thread(struct lttng_consumer_stream *stream, > > /* Get the right pipe where the stream will be sent. */ > if (stream->metadata_flag) { > - stream_pipe = ctx->consumer_metadata_pipe[1]; > + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); > } else { > stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); > } > -- > 1.7.10.4 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Wed May 15 15:20:38 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 15 May 2013 15:20:38 -0400 Subject: [lttng-dev] [PATCH 3/3 lttng-tools] Fix: use lttng pipe to send new stream to thread In-Reply-To: <1368553935-17162-3-git-send-email-dgoulet@efficios.com> References: <1368553935-17162-1-git-send-email-dgoulet@efficios.com> <1368553935-17162-3-git-send-email-dgoulet@efficios.com> Message-ID: <20130515192038.GC12581@Krystal> same question about not using lttng_pipe_read() here. Thanks, Mathieu * David Goulet (dgoulet at efficios.com) wrote: > Signed-off-by: David Goulet > --- > src/common/kernel-consumer/kernel-consumer.c | 15 +++++++-------- > src/common/ust-consumer/ust-consumer.c | 16 ++++++++-------- > 2 files changed, 15 insertions(+), 16 deletions(-) > > diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c > index f23fc9c..d985014 100644 > --- a/src/common/kernel-consumer/kernel-consumer.c > +++ b/src/common/kernel-consumer/kernel-consumer.c > @@ -168,7 +168,8 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, > } > case LTTNG_CONSUMER_ADD_STREAM: > { > - int fd, stream_pipe; > + int fd; > + struct lttng_pipe *stream_pipe; > struct consumer_relayd_sock_pair *relayd = NULL; > struct lttng_consumer_stream *new_stream; > struct lttng_consumer_channel *channel; > @@ -288,18 +289,16 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, > > /* Get the right pipe where the stream will be sent. */ > if (new_stream->metadata_flag) { > - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); > + stream_pipe = ctx->consumer_metadata_pipe; > } else { > - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); > + stream_pipe = ctx->consumer_data_pipe; > } > > - do { > - ret = write(stream_pipe, &new_stream, sizeof(new_stream)); > - } while (ret < 0 && errno == EINTR); > + ret = lttng_pipe_write(stream_pipe, &new_stream, sizeof(new_stream)); > if (ret < 0) { > - PERROR("Consumer write %s stream to pipe %d", > + ERR("Consumer write %s stream to pipe %d", > new_stream->metadata_flag ? "metadata" : "data", > - stream_pipe); > + lttng_pipe_get_writefd(stream_pipe)); > consumer_del_stream(new_stream, NULL); > goto end_nosignal; > } > diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c > index a81e9d4..fa46634 100644 > --- a/src/common/ust-consumer/ust-consumer.c > +++ b/src/common/ust-consumer/ust-consumer.c > @@ -185,21 +185,21 @@ error: > static int send_stream_to_thread(struct lttng_consumer_stream *stream, > struct lttng_consumer_local_data *ctx) > { > - int ret, stream_pipe; > + int ret; > + struct lttng_pipe *stream_pipe; > > /* Get the right pipe where the stream will be sent. */ > if (stream->metadata_flag) { > - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); > + stream_pipe = ctx->consumer_metadata_pipe; > } else { > - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); > + stream_pipe = ctx->consumer_data_pipe; > } > > - do { > - ret = write(stream_pipe, &stream, sizeof(stream)); > - } while (ret < 0 && errno == EINTR); > + ret = lttng_pipe_write(stream_pipe, &stream, sizeof(stream)); > if (ret < 0) { > - PERROR("Consumer write %s stream to pipe %d", > - stream->metadata_flag ? "metadata" : "data", stream_pipe); > + ERR("Consumer write %s stream to pipe %d", > + stream->metadata_flag ? "metadata" : "data", > + lttng_pipe_get_writefd(stream_pipe)); > } > > return ret; > -- > 1.7.10.4 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Wed May 15 15:21:13 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Wed, 15 May 2013 15:21:13 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Tests: Remove temporary trace directory on bail-out Message-ID: <1368645673-24342-1-git-send-email-jeremie.galarneau@efficios.com> Signed-off-by: J?r?mie Galarneau --- tests/utils/test_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index 5e00de4..4b38630 100644 --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -48,8 +48,8 @@ def bail(diag, session_info = None): if session_info is not None: stop_session(session_info, True) - if os.path.exists(session_info.trace_path): - shutil.rmtree(session_info.trace_path) + if os.path.exists(session_info.tmp_directory): + shutil.rmtree(session_info.tmp_directory) exit(-1) def print_test_result(result, number, description): -- 1.8.2.2 From dgoulet at efficios.com Wed May 15 15:32:22 2013 From: dgoulet at efficios.com (David Goulet) Date: Wed, 15 May 2013 15:32:22 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Tests: Remove temporary trace directory on bail-out In-Reply-To: <1368645673-24342-1-git-send-email-jeremie.galarneau@efficios.com> References: <1368645673-24342-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <5193E2C6.6020002@efficios.com> Merged! J?r?mie Galarneau: > Signed-off-by: J?r?mie Galarneau > --- > tests/utils/test_utils.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py > index 5e00de4..4b38630 100644 > --- a/tests/utils/test_utils.py > +++ b/tests/utils/test_utils.py > @@ -48,8 +48,8 @@ def bail(diag, session_info = None): > if session_info is not None: > stop_session(session_info, True) > > - if os.path.exists(session_info.trace_path): > - shutil.rmtree(session_info.trace_path) > + if os.path.exists(session_info.tmp_directory): > + shutil.rmtree(session_info.tmp_directory) > exit(-1) > > def print_test_result(result, number, description): From Daniel.Thibault at drdc-rddc.gc.ca Wed May 15 16:34:07 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Wed, 15 May 2013 20:34:07 +0000 Subject: [lttng-dev] Updated easy-ust Makefile In-Reply-To: <20130510142534.GB20313@Krystal> References: <48CF5AC71E61DB46B70D0F388054EFFD028E81@VAL-E-01.valcartier.drdc-rddc.gc.ca> <20130510142534.GB20313@Krystal> Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D17FE9@VAL-E-02.valcartier.drdc-rddc.gc.ca> -----Message d'origine----- De?: Mathieu Desnoyers [mailto:mathieu.desnoyers at efficios.com] Envoy??: 10 mai 2013 10:26 > Every problem related to your distribution not having /usr/local/lib in ld.so.conf by default should be handled by adding documentation to the project, not modifying makefiles. > > Jeremie will take care of adding this info to the documentation. My understanding is that adding ' LDFLAGS = -L/usr/local/lib' to the compilation calls will make no difference on distributions that do include /usr/local/lib by default. Ubuntu does not, so it needs that LDFLAGS in order for its unmodified makefile to succeed. Since this simple addition breaks no other distro (as far as I know), why not make lttng-ust/doc/examples/easy-ust more inclusive? Daniel U. Thibault Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure Qu?bec QC G3J 1X5 CANADA Vox : (418) 844-4000 x4245 Fax : (418) 844-4538 NAC : 918V QSDJ Gouvernement du Canada | Government of Canada From jeremie.galarneau at efficios.com Wed May 15 17:02:49 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Wed, 15 May 2013 17:02:49 -0400 Subject: [lttng-dev] Updated easy-ust Makefile In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD12D17FE9@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD028E81@VAL-E-01.valcartier.drdc-rddc.gc.ca> <20130510142534.GB20313@Krystal> <48CF5AC71E61DB46B70D0F388054EFFD12D17FE9@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: I'd prefer we keep documentation as distribution-agnostic as possible; that includes example Makefiles. It's not unreasonable to expect users to install the libraries in a location that is part of their library path. Regards, J?r?mie On Wed, May 15, 2013 at 4:34 PM, Thibault, Daniel wrote: > -----Message d'origine----- > De : Mathieu Desnoyers [mailto:mathieu.desnoyers at efficios.com] > Envoy? : 10 mai 2013 10:26 > >> Every problem related to your distribution not having /usr/local/lib in ld.so.conf by default should be handled by adding documentation to the project, not modifying makefiles. >> >> Jeremie will take care of adding this info to the documentation. > > My understanding is that adding ' LDFLAGS = -L/usr/local/lib' to the compilation calls will make no difference on distributions that do include /usr/local/lib by default. Ubuntu does not, so it needs that LDFLAGS in order for its unmodified makefile to succeed. Since this simple addition breaks no other distro (as far as I know), why not make lttng-ust/doc/examples/easy-ust more inclusive? > > Daniel U. Thibault > Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) > Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) > 2459 route de la Bravoure > Qu?bec QC G3J 1X5 > CANADA > Vox : (418) 844-4000 x4245 > Fax : (418) 844-4538 > NAC : 918V QSDJ > Gouvernement du Canada | Government of Canada > -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From laijs at cn.fujitsu.com Wed May 15 21:58:34 2013 From: laijs at cn.fujitsu.com (Lai Jiangshan) Date: Thu, 16 May 2013 09:58:34 +0800 Subject: [lttng-dev] [PATCH] urcu: avoid false sharing for rcu_gp_ctr In-Reply-To: <20130509151018.GC27168@Krystal> References: <50C19575.2070802@cn.fujitsu.com> <20130506124433.GB12699@Krystal> <518A144D.7090805@cn.fujitsu.com> <20130508135343.GA8230@Krystal> <20130508181936.GA9919@Krystal> <518B4D8F.20108@cn.fujitsu.com> <20130509122748.GA23531@Krystal> <20130509151018.GC27168@Krystal> Message-ID: <51943D4A.20907@cn.fujitsu.com> On 05/09/2013 11:10 PM, Mathieu Desnoyers wrote: > * Lai Jiangshan (eag0628 at gmail.com) wrote: > [...] >> I think this code can be moved into urcu.c > > good point! How about this ? Hi, I don't see any obvious bad thing, but I can't carefully check it currently, It seems OK for me. Could you make it some progress. Thanks, Lai > > --- > diff --git a/urcu.c b/urcu.c > index b3f94da..1d5c06f 100644 > --- a/urcu.c > +++ b/urcu.c > @@ -62,6 +62,24 @@ > */ > #define RCU_QS_ACTIVE_ATTEMPTS 100 > > +/* > + * RCU_MEMBARRIER is only possibly available on Linux. > + */ > +#if defined(RCU_MEMBARRIER) && defined(__linux__) > +#include > +#endif > + > +/* If the headers do not support SYS_membarrier, fall back on RCU_MB */ > +#ifdef SYS_membarrier > +# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) > +#else > +# define membarrier(...) -ENOSYS > +#endif > + > +#define MEMBARRIER_EXPEDITED (1 << 0) > +#define MEMBARRIER_DELAYED (1 << 1) > +#define MEMBARRIER_QUERY (1 << 16) > + > #ifdef RCU_MEMBARRIER > static int init_done; > int rcu_has_sys_membarrier; > @@ -139,7 +157,7 @@ static void mutex_unlock(pthread_mutex_t *mutex) > static void smp_mb_master(int group) > { > if (caa_likely(rcu_has_sys_membarrier)) > - membarrier(MEMBARRIER_EXPEDITED); > + (void) membarrier(MEMBARRIER_EXPEDITED); > else > cmm_smp_mb(); > } > diff --git a/urcu/map/urcu.h b/urcu/map/urcu.h > index 217bff5..77b3721 100644 > --- a/urcu/map/urcu.h > +++ b/urcu/map/urcu.h > @@ -38,31 +38,6 @@ > #define RCU_MEMBARRIER > #endif > > -/* > - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to > - * RCU_MB > - * otherwise. > - */ > -#if !defined(__linux__) && defined(RCU_MEMBARRIER) > -#undef RCU_MEMBARRIER > -#define RCU_MB > -#endif > - > -#ifdef RCU_MEMBARRIER > -#include > - > -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ > -#ifdef SYS_membarrier > -# define MEMBARRIER_EXPEDITED (1 << 0) > -# define MEMBARRIER_DELAYED (1 << 1) > -# define MEMBARRIER_QUERY (1 << 16) > -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) > -#else > -# undef RCU_MEMBARRIER > -# define RCU_MB > -#endif > -#endif > - > #ifdef RCU_MEMBARRIER > > #define rcu_read_lock rcu_read_lock_memb > diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h > index bee97ee..53d2610 100644 > --- a/urcu/static/urcu.h > +++ b/urcu/static/urcu.h > @@ -52,30 +52,6 @@ extern "C" { > #endif > > /* > - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to RCU_MB > - * otherwise. > - */ > -#if !defined(__linux__) && defined(RCU_MEMBARRIER) > -#undef RCU_MEMBARRIER > -#define RCU_MB > -#endif > - > -#ifdef RCU_MEMBARRIER > -#include > - > -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ > -#ifdef SYS_membarrier > -# define MEMBARRIER_EXPEDITED (1 << 0) > -# define MEMBARRIER_DELAYED (1 << 1) > -# define MEMBARRIER_QUERY (1 << 16) > -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) > -#else > -# undef RCU_MEMBARRIER > -# define RCU_MB > -#endif > -#endif > - > -/* > * This code section can only be included in LGPL 2.1 compatible source code. > * See below for the function call wrappers which can be used in code meant to > * be only linked with the Userspace RCU library. This comes with a small > From mathieu.desnoyers at efficios.com Thu May 16 01:52:20 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 16 May 2013 01:52:20 -0400 Subject: [lttng-dev] [PATCH] urcu: avoid false sharing for rcu_gp_ctr In-Reply-To: <51943D4A.20907@cn.fujitsu.com> References: <20130506124433.GB12699@Krystal> <518A144D.7090805@cn.fujitsu.com> <20130508135343.GA8230@Krystal> <20130508181936.GA9919@Krystal> <518B4D8F.20108@cn.fujitsu.com> <20130509122748.GA23531@Krystal> <20130509151018.GC27168@Krystal> <51943D4A.20907@cn.fujitsu.com> Message-ID: <20130516055220.GA24224@Krystal> * Lai Jiangshan (laijs at cn.fujitsu.com) wrote: > On 05/09/2013 11:10 PM, Mathieu Desnoyers wrote: > > * Lai Jiangshan (eag0628 at gmail.com) wrote: > > [...] > >> I think this code can be moved into urcu.c > > > > good point! How about this ? > > Hi, I don't see any obvious bad thing, but I can't carefully check it > currently, It seems OK for me. > > Could you make it some progress. Thanks. Merged as: commit 553b7eb9da3a223368abdf3f6a5ead35acf8a20b Author: Mathieu Desnoyers Date: Wed May 8 09:53:45 2013 -0400 Fix: membarrier fallback symbol conflict Mathieu > > Thanks, > Lai > > > > > --- > > diff --git a/urcu.c b/urcu.c > > index b3f94da..1d5c06f 100644 > > --- a/urcu.c > > +++ b/urcu.c > > @@ -62,6 +62,24 @@ > > */ > > #define RCU_QS_ACTIVE_ATTEMPTS 100 > > > > +/* > > + * RCU_MEMBARRIER is only possibly available on Linux. > > + */ > > +#if defined(RCU_MEMBARRIER) && defined(__linux__) > > +#include > > +#endif > > + > > +/* If the headers do not support SYS_membarrier, fall back on RCU_MB */ > > +#ifdef SYS_membarrier > > +# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) > > +#else > > +# define membarrier(...) -ENOSYS > > +#endif > > + > > +#define MEMBARRIER_EXPEDITED (1 << 0) > > +#define MEMBARRIER_DELAYED (1 << 1) > > +#define MEMBARRIER_QUERY (1 << 16) > > + > > #ifdef RCU_MEMBARRIER > > static int init_done; > > int rcu_has_sys_membarrier; > > @@ -139,7 +157,7 @@ static void mutex_unlock(pthread_mutex_t *mutex) > > static void smp_mb_master(int group) > > { > > if (caa_likely(rcu_has_sys_membarrier)) > > - membarrier(MEMBARRIER_EXPEDITED); > > + (void) membarrier(MEMBARRIER_EXPEDITED); > > else > > cmm_smp_mb(); > > } > > diff --git a/urcu/map/urcu.h b/urcu/map/urcu.h > > index 217bff5..77b3721 100644 > > --- a/urcu/map/urcu.h > > +++ b/urcu/map/urcu.h > > @@ -38,31 +38,6 @@ > > #define RCU_MEMBARRIER > > #endif > > > > -/* > > - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to > > - * RCU_MB > > - * otherwise. > > - */ > > -#if !defined(__linux__) && defined(RCU_MEMBARRIER) > > -#undef RCU_MEMBARRIER > > -#define RCU_MB > > -#endif > > - > > -#ifdef RCU_MEMBARRIER > > -#include > > - > > -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ > > -#ifdef SYS_membarrier > > -# define MEMBARRIER_EXPEDITED (1 << 0) > > -# define MEMBARRIER_DELAYED (1 << 1) > > -# define MEMBARRIER_QUERY (1 << 16) > > -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) > > -#else > > -# undef RCU_MEMBARRIER > > -# define RCU_MB > > -#endif > > -#endif > > - > > #ifdef RCU_MEMBARRIER > > > > #define rcu_read_lock rcu_read_lock_memb > > diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h > > index bee97ee..53d2610 100644 > > --- a/urcu/static/urcu.h > > +++ b/urcu/static/urcu.h > > @@ -52,30 +52,6 @@ extern "C" { > > #endif > > > > /* > > - * RCU_MEMBARRIER is only possibly available on Linux. Fallback to RCU_MB > > - * otherwise. > > - */ > > -#if !defined(__linux__) && defined(RCU_MEMBARRIER) > > -#undef RCU_MEMBARRIER > > -#define RCU_MB > > -#endif > > - > > -#ifdef RCU_MEMBARRIER > > -#include > > - > > -/* If the headers do not support SYS_membarrier, statically use RCU_MB */ > > -#ifdef SYS_membarrier > > -# define MEMBARRIER_EXPEDITED (1 << 0) > > -# define MEMBARRIER_DELAYED (1 << 1) > > -# define MEMBARRIER_QUERY (1 << 16) > > -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) > > -#else > > -# undef RCU_MEMBARRIER > > -# define RCU_MB > > -#endif > > -#endif > > - > > -/* > > * This code section can only be included in LGPL 2.1 compatible source code. > > * See below for the function call wrappers which can be used in code meant to > > * be only linked with the Userspace RCU library. This comes with a small > > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jp_ikaheimonen at mentor.com Thu May 16 06:01:06 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Thu, 16 May 2013 10:01:06 +0000 Subject: [lttng-dev] [Babeltrace RFC PATCH 03/28] Move build-specific strerror_r to compat directory In-Reply-To: <20130514120853.GD21745@Krystal> References: <009B25148989C6458484484699278506E537E844@EU-MBX-01.mgc.mentorg.com> <20130514120853.GD21745@Krystal> Message-ID: <009B25148989C6458484484699278506E5382A55@EU-MBX-01.mgc.mentorg.com> Mathieu, Jeremie: thank you for your comments. I will prepare a new set of patches, and post them sometime early next week. Thanks again, JP Ikaheimonen Mentor Graphics -----Original Message----- From: Mathieu Desnoyers [mailto:mathieu.desnoyers at efficios.com] Sent: 14. toukokuuta 2013 15:09 To: J?r?mie Galarneau Cc: Ikaheimonen, JP; lttng-dev at lists.lttng.org Subject: Re: [lttng-dev] [Babeltrace RFC PATCH 03/28] Move build-specific strerror_r to compat directory * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > On Thu, May 2, 2013 at 7:46 AM, Ikaheimonen, JP > wrote: > > Add a new source directory 'compat'. > > In that directory, add a new file 'strlib.c'. > > In that file, add a new function compat_strerror_r that encapsulates > > the build-specific differences of strerror_r. > > Where strerror_r is used, now use compat_strerror_r. > > --- > > Makefile.am | 2 +- > > compat/Makefile.am | 10 ++++++++++ > > compat/compat_strlib.c | 17 +++++++++++++++++ > > configure.ac | 1 + > > include/babeltrace/babeltrace-internal.h | 32 +++----------------------------- > > include/babeltrace/compat/string.h | 9 +++++++++ > > lib/Makefile.am | 3 ++- > > 7 files changed, 43 insertions(+), 31 deletions(-) create mode > > 100644 compat/Makefile.am create mode 100644 compat/compat_strlib.c > > create mode 100644 include/babeltrace/compat/string.h > > > > diff --git a/Makefile.am b/Makefile.am index b25b58f..cdfad5a 100644 > > --- a/Makefile.am > > +++ b/Makefile.am > > @@ -2,7 +2,7 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) > > -I$(top_srcdir)/include > > > > ACLOCAL_AMFLAGS = -I m4 > > > > -SUBDIRS = include types lib formats converter tests doc extras > > +SUBDIRS = include types compat lib formats converter tests doc > > +extras > > > > dist_doc_DATA = ChangeLog LICENSE mit-license.txt gpl-2.0.txt \ > > std-ext-lib.txt > > diff --git a/compat/Makefile.am b/compat/Makefile.am new file mode > > 100644 index 0000000..d756aa7 > > --- /dev/null > > +++ b/compat/Makefile.am > > @@ -0,0 +1,10 @@ > > +AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include > > + > > +lib_LTLIBRARIES = libcompat.la > > + > > +libcompat_la_SOURCES = \ > > + compat_strlib.c > > + > > +libcompat_la_LDFLAGS = \ > > + -Wl,--no-as-needed > > + > > diff --git a/compat/compat_strlib.c b/compat/compat_strlib.c new > > file mode 100644 index 0000000..9aabb07 > > --- /dev/null > > +++ b/compat/compat_strlib.c > > @@ -0,0 +1,17 @@ > > +#include > > + > > +int compat_strerror_r(int errnum, char *buf, size_t buflen) > > Is there a specific reason why you can't redefine this as a macro > instead of changing the function's name? whenever possible, we try to use static inline rather than macros. This provides much better type verification, and cleaner compiler error reporting. however, a big note on how to make clean wrappers: Do: #if something int myfct(args) { ... } #else int myfct(args) { ... } #endif and _not_ the glibc-style oddness: int myfct(args) { #if something ... #else ... #endif } putting preprocessor conditions within functions is purely evil. ;-) Thanks, Mathieu > > > +{ > > +#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || > > +_XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) > > +/* XSI-compliant strerror_r */ > > + return strerror_r(errnum, buf, buflen); #else > > +/* GNU-compliant strerror_r */ > > + char * retbuf; > > + retbuf = strerror_r(errnum, buf, buflen); > > + if (retbuf != buf) > > + strcpy(buf, retbuf); > > + return 0; > > +#endif > > +} > > + > > diff --git a/configure.ac b/configure.ac index 83822d6..29366da > > 100644 > > --- a/configure.ac > > +++ b/configure.ac > > @@ -93,6 +93,7 @@ AC_SUBST(babeltracectfincludedir) > > AC_CONFIG_FILES([ > > Makefile > > types/Makefile > > + compat/Makefile > > formats/Makefile > > formats/ctf/Makefile > > formats/ctf/types/Makefile > > diff --git a/include/babeltrace/babeltrace-internal.h > > b/include/babeltrace/babeltrace-internal.h > > index 22866bc..35382de 100644 > > --- a/include/babeltrace/babeltrace-internal.h > > +++ b/include/babeltrace/babeltrace-internal.h > > @@ -27,7 +27,7 @@ > > #include > > #include > > #include > > -#include > > +#include > > > > #define PERROR_BUFLEN 200 > > > > @@ -81,46 +81,20 @@ extern int babeltrace_verbose, babeltrace_debug; > > perrorstr, \ > > ## args) > > > > -#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || > > _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) > > - > > #define _bt_printf_perror(fp, fmt, args...) \ > > ({ \ > > char buf[PERROR_BUFLEN] = "Error in strerror_r()"; \ > > - strerror_r(errno, buf, sizeof(buf)); \ > > + compat_strerror_r(errno, buf, sizeof(buf)); \ > > _bt_printfe(fp, "error", buf, fmt, ## args); \ > > }) > > > > #define _bt_printfl_perror(fp, lineno, fmt, args...) \ > > ({ \ > > char buf[PERROR_BUFLEN] = "Error in strerror_r()"; \ > > - strerror_r(errno, buf, sizeof(buf)); \ > > + compat_strerror_r(errno, buf, sizeof(buf)); \ > > _bt_printfle(fp, "error", lineno, buf, fmt, ## args); \ > > }) > > > > -#else > > - > > -/* > > - * Version using GNU strerror_r, for linux with appropriate defines. > > - */ > > - > > -#define _bt_printf_perror(fp, fmt, args...) \ > > - ({ \ > > - char *buf; \ > > - char tmp[PERROR_BUFLEN] = "Error in strerror_r()"; \ > > - buf = strerror_r(errno, tmp, sizeof(tmp)); \ > > - _bt_printfe(fp, "error", buf, fmt, ## args); \ > > - }) > > - > > -#define _bt_printfl_perror(fp, lineno, fmt, args...) \ > > - ({ \ > > - char *buf; \ > > - char tmp[PERROR_BUFLEN] = "Error in strerror_r()"; \ > > - buf = strerror_r(errno, tmp, sizeof(tmp)); \ > > - _bt_printfle(fp, "error", lineno, buf, fmt, ## args); \ > > - }) > > - > > -#endif > > - > > /* printf without lineno information */ > > #define printf_fatal(fmt, args...) \ > > _bt_printf(stderr, "fatal", fmt, ## args) diff --git > > a/include/babeltrace/compat/string.h > > b/include/babeltrace/compat/string.h > > new file mode 100644 > > index 0000000..8591b7e > > --- /dev/null > > +++ b/include/babeltrace/compat/string.h > > @@ -0,0 +1,9 @@ > > +#ifndef _BABELTRACE_COMPAT_STRING_H #define > > +BABELTRACE_COMPAT_STRING_H > > + > > +#include > > + > > +int compat_strerror_r(int errnum, char *buf, size_t buflen); > > + > > +#endif > > + > > diff --git a/lib/Makefile.am b/lib/Makefile.am index > > 7ffb164..fa470c0 100644 > > --- a/lib/Makefile.am > > +++ b/lib/Makefile.am > > @@ -14,4 +14,5 @@ libbabeltrace_la_SOURCES = babeltrace.c \ > > libbabeltrace_la_LDFLAGS = \ > > -Wl,--no-as-needed \ > > prio_heap/libprio_heap.la \ > > - $(top_builddir)/types/libbabeltrace_types.la > > + $(top_builddir)/types/libbabeltrace_types.la \ > > + $(top_builddir)/compat/libcompat.la > > -- > > 1.8.1.msysgit.1 > > > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > -- > J?r?mie Galarneau > EfficiOS Inc. > http://www.efficios.com > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Thu May 16 09:54:52 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 16 May 2013 09:54:52 -0400 Subject: [lttng-dev] [PATCH 1/3 lttng-tools] Change consumer_data_pipe to be a lttng_pipe In-Reply-To: <20130515191641.GA12581@Krystal> References: <1368553935-17162-1-git-send-email-dgoulet@efficios.com> <20130515191641.GA12581@Krystal> Message-ID: <5194E52C.90806@efficios.com> Mathieu Desnoyers: > * David Goulet (dgoulet at efficios.com) wrote: >> Also, an important change here is that this pipe is no longer in non >> block mode. Before sending stream's pointer over this pipe, only one >> byte was written thus making it unlikely to fail in a read/write race >> condition between threads. Now, 4 bytes are written so keeping this pipe >> non block with threads is a bit of a "looking for trouble situation". >> >> The lttng pipe wrappers make sure that the read and write side are >> synchronized between threads using a mutex for each side. Furthermore, >> the read and write handle partial I/O and EINTR meaning that once the >> call returns we are sure that either everything was read/written or an >> error occured thus making it not possible for the read side to block >> indefinitely after a poll event. >> >> Signed-off-by: David Goulet >> --- >> src/common/consumer.c | 53 ++++++++++++-------------- >> src/common/consumer.h | 3 +- >> src/common/kernel-consumer/kernel-consumer.c | 3 +- >> src/common/ust-consumer/ust-consumer.c | 2 +- >> 4 files changed, 29 insertions(+), 32 deletions(-) >> >> diff --git a/src/common/consumer.c b/src/common/consumer.c >> index 01266a7..bd618dd 100644 >> --- a/src/common/consumer.c >> +++ b/src/common/consumer.c >> @@ -91,6 +91,20 @@ static void notify_thread_pipe(int wpipe) >> } while (ret < 0 && errno == EINTR); >> } >> >> +/* >> + * Notify a thread lttng pipe to poll back again. This usually means that some >> + * global state has changed so we just send back the thread in a poll wait >> + * call. >> + */ >> +static void notify_thread_lttng_pipe(struct lttng_pipe *pipe) >> +{ >> + struct lttng_consumer_stream *null_stream = NULL; >> + >> + assert(pipe); >> + >> + (void) lttng_pipe_write(pipe, &null_stream, sizeof(null_stream)); >> +} >> + >> static void notify_channel_pipe(struct lttng_consumer_local_data *ctx, >> struct lttng_consumer_channel *chan, >> uint64_t key, >> @@ -406,7 +420,7 @@ static void cleanup_relayd(struct consumer_relayd_sock_pair *relayd, >> * read of this status which happens AFTER receiving this notify. >> */ >> if (ctx) { >> - notify_thread_pipe(ctx->consumer_data_pipe[1]); >> + notify_thread_lttng_pipe(ctx->consumer_data_pipe); >> notify_thread_pipe(ctx->consumer_metadata_pipe[1]); >> } >> } >> @@ -971,7 +985,7 @@ static int update_poll_array(struct lttng_consumer_local_data *ctx, >> * Insert the consumer_data_pipe at the end of the array and don't >> * increment i so nb_fd is the number of real FD. >> */ >> - (*pollfd)[i].fd = ctx->consumer_data_pipe[0]; >> + (*pollfd)[i].fd = lttng_pipe_get_readfd(ctx->consumer_data_pipe); >> (*pollfd)[i].events = POLLIN | POLLPRI; >> return i; >> } >> @@ -1167,26 +1181,11 @@ struct lttng_consumer_local_data *lttng_consumer_create( >> ctx->on_recv_stream = recv_stream; >> ctx->on_update_stream = update_stream; >> >> - ret = pipe(ctx->consumer_data_pipe); >> - if (ret < 0) { >> - PERROR("Error creating poll pipe"); >> + ctx->consumer_data_pipe = lttng_pipe_open(0); >> + if (!ctx->consumer_data_pipe) { >> goto error_poll_pipe; >> } >> >> - /* set read end of the pipe to non-blocking */ >> - ret = fcntl(ctx->consumer_data_pipe[0], F_SETFL, O_NONBLOCK); >> - if (ret < 0) { >> - PERROR("fcntl O_NONBLOCK"); >> - goto error_poll_fcntl; >> - } >> - >> - /* set write end of the pipe to non-blocking */ >> - ret = fcntl(ctx->consumer_data_pipe[1], F_SETFL, O_NONBLOCK); >> - if (ret < 0) { >> - PERROR("fcntl O_NONBLOCK"); >> - goto error_poll_fcntl; >> - } >> - >> ret = pipe(ctx->consumer_should_quit); >> if (ret < 0) { >> PERROR("Error creating recv pipe"); >> @@ -1225,9 +1224,8 @@ error_channel_pipe: >> utils_close_pipe(ctx->consumer_thread_pipe); >> error_thread_pipe: >> utils_close_pipe(ctx->consumer_should_quit); >> -error_poll_fcntl: >> error_quit_pipe: >> - utils_close_pipe(ctx->consumer_data_pipe); >> + lttng_pipe_destroy(ctx->consumer_data_pipe); >> error_poll_pipe: >> free(ctx); >> error: >> @@ -1253,7 +1251,7 @@ void lttng_consumer_destroy(struct lttng_consumer_local_data *ctx) >> } >> utils_close_pipe(ctx->consumer_thread_pipe); >> utils_close_pipe(ctx->consumer_channel_pipe); >> - utils_close_pipe(ctx->consumer_data_pipe); >> + lttng_pipe_destroy(ctx->consumer_data_pipe); >> utils_close_pipe(ctx->consumer_should_quit); >> utils_close_pipe(ctx->consumer_splice_metadata_pipe); >> >> @@ -2402,13 +2400,10 @@ void *consumer_thread_data_poll(void *data) >> ssize_t pipe_readlen; >> >> DBG("consumer_data_pipe wake up"); >> - /* Consume 1 byte of pipe data */ >> - do { >> - pipe_readlen = read(ctx->consumer_data_pipe[0], &new_stream, >> - sizeof(new_stream)); >> - } while (pipe_readlen == -1 && errno == EINTR); >> + pipe_readlen = lttng_pipe_read(ctx->consumer_data_pipe, >> + &new_stream, sizeof(new_stream)); >> if (pipe_readlen < 0) { > > can lttng_pipe_read return a value smaller than sizeof(new_stream) on > some error conditions ? (but higher than 0) As long as the pipe is not in NON BLOCK mode, no. It's either the full number of bytes or a negative value. The wrapper takes care of partial read and EINTR. David > > Thanks, > > Mathieu > >> - PERROR("read consumer data pipe"); >> + ERR("Consumer data pipe ret %ld", pipe_readlen); >> /* Continue so we can at least handle the current stream(s). */ >> continue; >> } >> @@ -2968,7 +2963,7 @@ end: >> * Notify the data poll thread to poll back again and test the >> * consumer_quit state that we just set so to quit gracefully. >> */ >> - notify_thread_pipe(ctx->consumer_data_pipe[1]); >> + notify_thread_lttng_pipe(ctx->consumer_data_pipe); >> >> notify_channel_pipe(ctx, NULL, -1, CONSUMER_CHANNEL_QUIT); >> >> diff --git a/src/common/consumer.h b/src/common/consumer.h >> index 43989e4..91039e8 100644 >> --- a/src/common/consumer.h >> +++ b/src/common/consumer.h >> @@ -31,6 +31,7 @@ >> #include >> #include >> #include >> +#include >> >> /* Commands for consumer */ >> enum lttng_consumer_command { >> @@ -346,7 +347,7 @@ struct lttng_consumer_local_data { >> int consumer_channel_pipe[2]; >> int consumer_splice_metadata_pipe[2]; >> /* Data stream poll thread pipe. To transfer data stream to the thread */ >> - int consumer_data_pipe[2]; >> + struct lttng_pipe *consumer_data_pipe; >> /* to let the signal handler wake up the fd receiver thread */ >> int consumer_should_quit[2]; >> /* Metadata poll thread pipe. Transfer metadata stream to it */ >> diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c >> index 2cf9ac1..d8aec49 100644 >> --- a/src/common/kernel-consumer/kernel-consumer.c >> +++ b/src/common/kernel-consumer/kernel-consumer.c >> @@ -34,6 +34,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> >> @@ -289,7 +290,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, >> if (new_stream->metadata_flag) { >> stream_pipe = ctx->consumer_metadata_pipe[1]; >> } else { >> - stream_pipe = ctx->consumer_data_pipe[1]; >> + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); >> } >> >> do { >> diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c >> index 031a7cb..ddf80da 100644 >> --- a/src/common/ust-consumer/ust-consumer.c >> +++ b/src/common/ust-consumer/ust-consumer.c >> @@ -191,7 +191,7 @@ static int send_stream_to_thread(struct lttng_consumer_stream *stream, >> if (stream->metadata_flag) { >> stream_pipe = ctx->consumer_metadata_pipe[1]; >> } else { >> - stream_pipe = ctx->consumer_data_pipe[1]; >> + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); >> } >> >> do { >> -- >> 1.7.10.4 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From dgoulet at efficios.com Thu May 16 09:56:24 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 16 May 2013 09:56:24 -0400 Subject: [lttng-dev] [PATCH 2/3 lttng-tools] Change consumer_metadata_pipe to be a lttng_pipe In-Reply-To: <20130515191907.GB12581@Krystal> References: <1368553935-17162-1-git-send-email-dgoulet@efficios.com> <1368553935-17162-2-git-send-email-dgoulet@efficios.com> <20130515191907.GB12581@Krystal> Message-ID: <5194E588.4010602@efficios.com> Oh that's a *really* good catch. My bad, I forgot to change the read() from that pipe in the metadata thread. I'll be re-sending this one. Mathieu Desnoyers: > why isn't this patch using lttng_pipe_read() ? > > * David Goulet (dgoulet at efficios.com) wrote: >> Signed-off-by: David Goulet >> --- >> src/common/consumer.c | 42 ++++++++------------------ >> src/common/consumer.h | 2 +- >> src/common/kernel-consumer/kernel-consumer.c | 2 +- >> src/common/ust-consumer/ust-consumer.c | 2 +- >> 4 files changed, 15 insertions(+), 33 deletions(-) >> >> diff --git a/src/common/consumer.c b/src/common/consumer.c >> index bd618dd..ef35927 100644 >> --- a/src/common/consumer.c >> +++ b/src/common/consumer.c >> @@ -77,21 +77,6 @@ static struct lttng_ht *metadata_ht; >> static struct lttng_ht *data_ht; >> >> /* >> - * Notify a thread pipe to poll back again. This usually means that some global >> - * state has changed so we just send back the thread in a poll wait call. >> - */ >> -static void notify_thread_pipe(int wpipe) >> -{ >> - int ret; >> - >> - do { >> - struct lttng_consumer_stream *null_stream = NULL; >> - >> - ret = write(wpipe, &null_stream, sizeof(null_stream)); >> - } while (ret < 0 && errno == EINTR); >> -} >> - >> -/* >> * Notify a thread lttng pipe to poll back again. This usually means that some >> * global state has changed so we just send back the thread in a poll wait >> * call. >> @@ -421,7 +406,7 @@ static void cleanup_relayd(struct consumer_relayd_sock_pair *relayd, >> */ >> if (ctx) { >> notify_thread_lttng_pipe(ctx->consumer_data_pipe); >> - notify_thread_pipe(ctx->consumer_metadata_pipe[1]); >> + notify_thread_lttng_pipe(ctx->consumer_metadata_pipe); >> } >> } >> >> @@ -1204,8 +1189,8 @@ struct lttng_consumer_local_data *lttng_consumer_create( >> goto error_channel_pipe; >> } >> >> - ret = utils_create_pipe(ctx->consumer_metadata_pipe); >> - if (ret < 0) { >> + ctx->consumer_metadata_pipe = lttng_pipe_open(0); >> + if (!ctx->consumer_metadata_pipe) { >> goto error_metadata_pipe; >> } >> >> @@ -1217,7 +1202,7 @@ struct lttng_consumer_local_data *lttng_consumer_create( >> return ctx; >> >> error_splice_pipe: >> - utils_close_pipe(ctx->consumer_metadata_pipe); >> + lttng_pipe_destroy(ctx->consumer_metadata_pipe); >> error_metadata_pipe: >> utils_close_pipe(ctx->consumer_channel_pipe); >> error_channel_pipe: >> @@ -1252,6 +1237,7 @@ void lttng_consumer_destroy(struct lttng_consumer_local_data *ctx) >> utils_close_pipe(ctx->consumer_thread_pipe); >> utils_close_pipe(ctx->consumer_channel_pipe); >> lttng_pipe_destroy(ctx->consumer_data_pipe); >> + lttng_pipe_destroy(ctx->consumer_metadata_pipe); >> utils_close_pipe(ctx->consumer_should_quit); >> utils_close_pipe(ctx->consumer_splice_metadata_pipe); >> >> @@ -2132,7 +2118,8 @@ void *consumer_thread_metadata_poll(void *data) >> goto end_poll; >> } >> >> - ret = lttng_poll_add(&events, ctx->consumer_metadata_pipe[0], LPOLLIN); >> + ret = lttng_poll_add(&events, >> + lttng_pipe_get_readfd(ctx->consumer_metadata_pipe), LPOLLIN); >> if (ret < 0) { >> goto end; >> } >> @@ -2170,18 +2157,16 @@ restart: >> continue; >> } >> >> - if (pollfd == ctx->consumer_metadata_pipe[0]) { >> + if (pollfd == lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)) { >> if (revents & (LPOLLERR | LPOLLHUP )) { >> DBG("Metadata thread pipe hung up"); >> /* >> * Remove the pipe from the poll set and continue the loop >> * since their might be data to consume. >> */ >> - lttng_poll_del(&events, ctx->consumer_metadata_pipe[0]); >> - ret = close(ctx->consumer_metadata_pipe[0]); >> - if (ret < 0) { >> - PERROR("close metadata pipe"); >> - } >> + lttng_poll_del(&events, >> + lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)); >> + lttng_pipe_read_close(ctx->consumer_metadata_pipe); >> continue; >> } else if (revents & LPOLLIN) { >> do { >> @@ -2541,10 +2526,7 @@ end: >> * only tracked fd in the poll set. The thread will take care of closing >> * the read side. >> */ >> - ret = close(ctx->consumer_metadata_pipe[1]); >> - if (ret < 0) { >> - PERROR("close data pipe"); >> - } >> + (void) lttng_pipe_write_close(ctx->consumer_metadata_pipe); >> >> destroy_data_stream_ht(data_ht); >> >> diff --git a/src/common/consumer.h b/src/common/consumer.h >> index 91039e8..3726fd1 100644 >> --- a/src/common/consumer.h >> +++ b/src/common/consumer.h >> @@ -351,7 +351,7 @@ struct lttng_consumer_local_data { >> /* to let the signal handler wake up the fd receiver thread */ >> int consumer_should_quit[2]; >> /* Metadata poll thread pipe. Transfer metadata stream to it */ >> - int consumer_metadata_pipe[2]; >> + struct lttng_pipe *consumer_metadata_pipe; >> }; >> >> /* >> diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c >> index d8aec49..f23fc9c 100644 >> --- a/src/common/kernel-consumer/kernel-consumer.c >> +++ b/src/common/kernel-consumer/kernel-consumer.c >> @@ -288,7 +288,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, >> >> /* Get the right pipe where the stream will be sent. */ >> if (new_stream->metadata_flag) { >> - stream_pipe = ctx->consumer_metadata_pipe[1]; >> + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); >> } else { >> stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); >> } >> diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c >> index ddf80da..a81e9d4 100644 >> --- a/src/common/ust-consumer/ust-consumer.c >> +++ b/src/common/ust-consumer/ust-consumer.c >> @@ -189,7 +189,7 @@ static int send_stream_to_thread(struct lttng_consumer_stream *stream, >> >> /* Get the right pipe where the stream will be sent. */ >> if (stream->metadata_flag) { >> - stream_pipe = ctx->consumer_metadata_pipe[1]; >> + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); >> } else { >> stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); >> } >> -- >> 1.7.10.4 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From dgoulet at efficios.com Thu May 16 09:57:57 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 16 May 2013 09:57:57 -0400 Subject: [lttng-dev] [PATCH 3/3 lttng-tools] Fix: use lttng pipe to send new stream to thread In-Reply-To: <20130515192038.GC12581@Krystal> References: <1368553935-17162-1-git-send-email-dgoulet@efficios.com> <1368553935-17162-3-git-send-email-dgoulet@efficios.com> <20130515192038.GC12581@Krystal> Message-ID: <5194E5E5.20702@efficios.com> The read() calls are in the thread that were changed by the previous patches. This patch is to completely remove traditional pipe from the sessiond thread for data and metadata streams. David Mathieu Desnoyers: > same question about not using lttng_pipe_read() here. > > Thanks, > > Mathieu > > * David Goulet (dgoulet at efficios.com) wrote: >> Signed-off-by: David Goulet >> --- >> src/common/kernel-consumer/kernel-consumer.c | 15 +++++++-------- >> src/common/ust-consumer/ust-consumer.c | 16 ++++++++-------- >> 2 files changed, 15 insertions(+), 16 deletions(-) >> >> diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c >> index f23fc9c..d985014 100644 >> --- a/src/common/kernel-consumer/kernel-consumer.c >> +++ b/src/common/kernel-consumer/kernel-consumer.c >> @@ -168,7 +168,8 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, >> } >> case LTTNG_CONSUMER_ADD_STREAM: >> { >> - int fd, stream_pipe; >> + int fd; >> + struct lttng_pipe *stream_pipe; >> struct consumer_relayd_sock_pair *relayd = NULL; >> struct lttng_consumer_stream *new_stream; >> struct lttng_consumer_channel *channel; >> @@ -288,18 +289,16 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, >> >> /* Get the right pipe where the stream will be sent. */ >> if (new_stream->metadata_flag) { >> - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); >> + stream_pipe = ctx->consumer_metadata_pipe; >> } else { >> - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); >> + stream_pipe = ctx->consumer_data_pipe; >> } >> >> - do { >> - ret = write(stream_pipe, &new_stream, sizeof(new_stream)); >> - } while (ret < 0 && errno == EINTR); >> + ret = lttng_pipe_write(stream_pipe, &new_stream, sizeof(new_stream)); >> if (ret < 0) { >> - PERROR("Consumer write %s stream to pipe %d", >> + ERR("Consumer write %s stream to pipe %d", >> new_stream->metadata_flag ? "metadata" : "data", >> - stream_pipe); >> + lttng_pipe_get_writefd(stream_pipe)); >> consumer_del_stream(new_stream, NULL); >> goto end_nosignal; >> } >> diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c >> index a81e9d4..fa46634 100644 >> --- a/src/common/ust-consumer/ust-consumer.c >> +++ b/src/common/ust-consumer/ust-consumer.c >> @@ -185,21 +185,21 @@ error: >> static int send_stream_to_thread(struct lttng_consumer_stream *stream, >> struct lttng_consumer_local_data *ctx) >> { >> - int ret, stream_pipe; >> + int ret; >> + struct lttng_pipe *stream_pipe; >> >> /* Get the right pipe where the stream will be sent. */ >> if (stream->metadata_flag) { >> - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); >> + stream_pipe = ctx->consumer_metadata_pipe; >> } else { >> - stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); >> + stream_pipe = ctx->consumer_data_pipe; >> } >> >> - do { >> - ret = write(stream_pipe, &stream, sizeof(stream)); >> - } while (ret < 0 && errno == EINTR); >> + ret = lttng_pipe_write(stream_pipe, &stream, sizeof(stream)); >> if (ret < 0) { >> - PERROR("Consumer write %s stream to pipe %d", >> - stream->metadata_flag ? "metadata" : "data", stream_pipe); >> + ERR("Consumer write %s stream to pipe %d", >> + stream->metadata_flag ? "metadata" : "data", >> + lttng_pipe_get_writefd(stream_pipe)); >> } >> >> return ret; >> -- >> 1.7.10.4 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From dgoulet at efficios.com Thu May 16 10:42:26 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 16 May 2013 10:42:26 -0400 Subject: [lttng-dev] [PATCH 2/3 lttng-tools v2] Change consumer_metadata_pipe to be a lttng_pipe Message-ID: <1368715346-28720-1-git-send-email-dgoulet@efficios.com> The read() call in the metadata thread is also changed to use the lttng pipe read wrapper. Signed-off-by: David Goulet --- src/common/consumer.c | 58 +++++++++----------------- src/common/consumer.h | 2 +- src/common/kernel-consumer/kernel-consumer.c | 2 +- src/common/ust-consumer/ust-consumer.c | 2 +- 4 files changed, 22 insertions(+), 42 deletions(-) diff --git a/src/common/consumer.c b/src/common/consumer.c index ca51ce0..c63e6e6 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -77,21 +77,6 @@ static struct lttng_ht *metadata_ht; static struct lttng_ht *data_ht; /* - * Notify a thread pipe to poll back again. This usually means that some global - * state has changed so we just send back the thread in a poll wait call. - */ -static void notify_thread_pipe(int wpipe) -{ - int ret; - - do { - struct lttng_consumer_stream *null_stream = NULL; - - ret = write(wpipe, &null_stream, sizeof(null_stream)); - } while (ret < 0 && errno == EINTR); -} - -/* * Notify a thread lttng pipe to poll back again. This usually means that some * global state has changed so we just send back the thread in a poll wait * call. @@ -423,7 +408,7 @@ static void cleanup_relayd(struct consumer_relayd_sock_pair *relayd, */ if (ctx) { notify_thread_lttng_pipe(ctx->consumer_data_pipe); - notify_thread_pipe(ctx->consumer_metadata_pipe[1]); + notify_thread_lttng_pipe(ctx->consumer_metadata_pipe); } } @@ -1206,8 +1191,8 @@ struct lttng_consumer_local_data *lttng_consumer_create( goto error_channel_pipe; } - ret = utils_create_pipe(ctx->consumer_metadata_pipe); - if (ret < 0) { + ctx->consumer_metadata_pipe = lttng_pipe_open(0); + if (!ctx->consumer_metadata_pipe) { goto error_metadata_pipe; } @@ -1219,7 +1204,7 @@ struct lttng_consumer_local_data *lttng_consumer_create( return ctx; error_splice_pipe: - utils_close_pipe(ctx->consumer_metadata_pipe); + lttng_pipe_destroy(ctx->consumer_metadata_pipe); error_metadata_pipe: utils_close_pipe(ctx->consumer_channel_pipe); error_channel_pipe: @@ -1254,6 +1239,7 @@ void lttng_consumer_destroy(struct lttng_consumer_local_data *ctx) utils_close_pipe(ctx->consumer_thread_pipe); utils_close_pipe(ctx->consumer_channel_pipe); lttng_pipe_destroy(ctx->consumer_data_pipe); + lttng_pipe_destroy(ctx->consumer_metadata_pipe); utils_close_pipe(ctx->consumer_should_quit); utils_close_pipe(ctx->consumer_splice_metadata_pipe); @@ -2134,7 +2120,8 @@ void *consumer_thread_metadata_poll(void *data) goto end_poll; } - ret = lttng_poll_add(&events, ctx->consumer_metadata_pipe[0], LPOLLIN); + ret = lttng_poll_add(&events, + lttng_pipe_get_readfd(ctx->consumer_metadata_pipe), LPOLLIN); if (ret < 0) { goto end; } @@ -2172,30 +2159,26 @@ restart: continue; } - if (pollfd == ctx->consumer_metadata_pipe[0]) { + if (pollfd == lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)) { if (revents & (LPOLLERR | LPOLLHUP )) { DBG("Metadata thread pipe hung up"); /* * Remove the pipe from the poll set and continue the loop * since their might be data to consume. */ - lttng_poll_del(&events, ctx->consumer_metadata_pipe[0]); - ret = close(ctx->consumer_metadata_pipe[0]); - if (ret < 0) { - PERROR("close metadata pipe"); - } + lttng_poll_del(&events, + lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)); + lttng_pipe_read_close(ctx->consumer_metadata_pipe); continue; } else if (revents & LPOLLIN) { - do { - /* Get the stream pointer received */ - ret = read(pollfd, &stream, sizeof(stream)); - } while (ret < 0 && errno == EINTR); - if (ret < 0 || - ret < sizeof(struct lttng_consumer_stream *)) { - PERROR("read metadata stream"); + ssize_t pipe_len; + + pipe_len = lttng_pipe_read(ctx->consumer_metadata_pipe, + &stream, sizeof(stream)); + if (pipe_len < 0) { + ERR("read metadata stream, ret: %ld", pipe_len); /* - * Let's continue here and hope we can still work - * without stopping the consumer. XXX: Should we? + * Continue here to handle the rest of the streams. */ continue; } @@ -2543,10 +2526,7 @@ end: * only tracked fd in the poll set. The thread will take care of closing * the read side. */ - ret = close(ctx->consumer_metadata_pipe[1]); - if (ret < 0) { - PERROR("close data pipe"); - } + (void) lttng_pipe_write_close(ctx->consumer_metadata_pipe); destroy_data_stream_ht(data_ht); diff --git a/src/common/consumer.h b/src/common/consumer.h index 91039e8..3726fd1 100644 --- a/src/common/consumer.h +++ b/src/common/consumer.h @@ -351,7 +351,7 @@ struct lttng_consumer_local_data { /* to let the signal handler wake up the fd receiver thread */ int consumer_should_quit[2]; /* Metadata poll thread pipe. Transfer metadata stream to it */ - int consumer_metadata_pipe[2]; + struct lttng_pipe *consumer_metadata_pipe; }; /* diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index d8aec49..f23fc9c 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -288,7 +288,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, /* Get the right pipe where the stream will be sent. */ if (new_stream->metadata_flag) { - stream_pipe = ctx->consumer_metadata_pipe[1]; + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); } else { stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); } diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index ddf80da..a81e9d4 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -189,7 +189,7 @@ static int send_stream_to_thread(struct lttng_consumer_stream *stream, /* Get the right pipe where the stream will be sent. */ if (stream->metadata_flag) { - stream_pipe = ctx->consumer_metadata_pipe[1]; + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); } else { stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); } -- 1.7.10.4 From yannick.brosseau at gmail.com Thu May 16 11:14:14 2013 From: yannick.brosseau at gmail.com (Brosseau, Yannick) Date: Thu, 16 May 2013 11:14:14 -0400 Subject: [lttng-dev] Patches to enable building on CentOS 5.x (glibc 2.5) In-Reply-To: <20998D40D9A2B7499CA5A3A2666CB1EB23FDCE2B@ZURMSG1.QUANTUM.com> References: <20998D40D9A2B7499CA5A3A2666CB1EB23FDCE2B@ZURMSG1.QUANTUM.com> Message-ID: Hi, So you made it work with CentOS 5? I don't know if we want it upstream, but I could maybe use them to build a package for EPEL5. Yannick On Wed, May 15, 2013 at 7:38 AM, David OShea wrote: > Hi, > > Would contributions of patches to enable lttng-tools and lttng-ust to > build with glibc 2.5 (as is shipped with CentOS 5.x) and to enable > lttng-gen-tp to run with Python 2.4 (as shipped on CentOS 5.x) be accepted? > > What is missing from glibc 2.5 is: > > - a system call wrapper for sched_getcpu() > - a system call wrapper for sync_file_range() > - htobe32() and other similar endian conversion functions > > babeltrace and userspace-rcu did not require patching. > > Thanks in advance, > David > > P.S. If you see this, thanks for all your recent replies, Mathieu, I will > try to get back to you soon! > > ---------------------------------------------------------------------- > The information contained in this transmission may be confidential. Any > disclosure, copying, or further distribution of confidential information is > not permitted unless such privilege is explicitly granted in writing by > Quantum. Quantum reserves the right to have electronic communications, > including email and attachments, sent across its networks filtered through > anti virus and spam software programs and retain such messages in order to > comply with applicable data security and retention requirements. Quantum is > not responsible for the proper and complete transmission of the substance > of this communication or for any delay in its receipt. > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > -- Yannick Brosseau yannickbrosseau.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ionut5001 at gmail.com Fri May 17 01:32:01 2013 From: ionut5001 at gmail.com (Ionut D.) Date: Fri, 17 May 2013 08:32:01 +0300 Subject: [lttng-dev] LTTNG on Android ICS Message-ID: Hello all, 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. 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. It is ok? what I am trying to do ? to integrate and build by using the Android build system. 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 ? 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. I mention that I am trying to build lttng 2.x on ICS 4.0.3. Would be great if you will give me a tutorial about how to do it. Ionut -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.OShea at quantum.com Fri May 17 02:52:08 2013 From: David.OShea at quantum.com (David OShea) Date: Fri, 17 May 2013 06:52:08 +0000 Subject: [lttng-dev] Patches to enable building on CentOS 5.x (glibc 2.5) In-Reply-To: References: <20998D40D9A2B7499CA5A3A2666CB1EB23FDCE2B@ZURMSG1.QUANTUM.com> Message-ID: <20998D40D9A2B7499CA5A3A2666CB1EB23FDDEC5@ZURMSG1.QUANTUM.com> Hi Yannick, Yes, we patched the latest (as of around a month ago) versions to work on CentOS 5. Sorry, I neglected to mention that this is for UST only, not kernel tracing, hence my not saying anything about the modules! If the changes aren't going to go upstream into the git repositories, I imagine there is more chance of the CentOS 5 support becoming broken - something could be committed upstream that requires further patching, or conflicts with the patches. In this case, then, I don't think EPEL packages would help us much, and quite possibly nobody else is interested in CentOS 5 :) Also, we needed to backport some lttng-ust commits from master to get support for dynamic trace providers to work, so we're more interested in seeing future releases include the changes than seeing a patched version of the current release, and therefore I don't think there would be any value in us moving to an EPEL package for the same version of LTTng that we're already using. I can certainly provide the patches to you anyway, but I'm not so keen to spend time improving them if they're not going upstream, e.g. one thing I think needs to be investigated is whether the kernel versions provided by CentOS 5 include the system calls that we had to add wrappers for; I haven't paid any attention to what kernel version I'm using, I'm not sure if it is a standard CentOS 5 one. Thanks! David From: Brosseau, Yannick [mailto:yannick.brosseau at gmail.com] Sent: Friday, 17 May 2013 12:44 AM To: David OShea Cc: lttng-dev at lists.lttng.org Subject: Re: [lttng-dev] Patches to enable building on CentOS 5.x (glibc 2.5) Hi, So you made it work with CentOS 5? I don't know if we want it upstream, but I could maybe use them to build a package for EPEL5. Yannick On Wed, May 15, 2013 at 7:38 AM, David OShea > wrote: Hi, Would contributions of patches to enable lttng-tools and lttng-ust to build with glibc 2.5 (as is shipped with CentOS 5.x) and to enable lttng-gen-tp to run with Python 2.4 (as shipped on CentOS 5.x) be accepted? What is missing from glibc 2.5 is: - a system call wrapper for sched_getcpu() - a system call wrapper for sync_file_range() - htobe32() and other similar endian conversion functions babeltrace and userspace-rcu did not require patching. Thanks in advance, David P.S. If you see this, thanks for all your recent replies, Mathieu, I will try to get back to you soon! ---------------------------------------------------------------------- The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt. _______________________________________________ lttng-dev mailing list lttng-dev at lists.lttng.org http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Yannick Brosseau yannickbrosseau.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis.giraldeau at gmail.com Fri May 17 07:50:40 2013 From: francis.giraldeau at gmail.com (Francis Giraldeau) Date: Fri, 17 May 2013 07:50:40 -0400 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: <51961990.5010801@gmail.com> Le 2013-05-17 01:32, Ionut D. a ?crit : > Hello all, > > 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. > > 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. > > It is ok? what I am trying to do ? to integrate and build by using the > Android build system. > 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 ? Hi! A group of students at Ecole Polytechnique of Montreal worked on that topic. They were able to get a kernel trace from Nexus 7 tablet. It required small modifications to tools, and cleanup is in process to merge patches upstream[1]. Kernel tracing is working, while UST requires still some work on few bugs. I received the confirmation from the students the build scripts they created will be released under open source licence soon. LTTng tools depends on two libraries libpopt and libuuid that are in android sources. It's simpler to just build the whole thing. Once tools are built, then they can be installed on the target. A tutorial would be a must! I'm installing it on my phone right now, if nobody else did the tutorial by then, I will do so. That would be great if this was to be integrated in the dev tools in the android source repo! Cheers, Francis [1] http://git.dorsal.polymtl.ca/~cbriere?p=lttng-tools.git;a=summary branch portAndroid-rebased-signed -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4489 bytes Desc: Signature cryptographique S/MIME URL: From pierre-luc.st-charles at polymtl.ca Fri May 17 09:47:48 2013 From: pierre-luc.st-charles at polymtl.ca (Pierre-Luc St-Charles) Date: Fri, 17 May 2013 09:47:48 -0400 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: Alright, small update for all following a quick (non-mailing-list) exchange: 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 here; still not perfect). 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). 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). 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). 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. So, simple 'how do I put LTTng on Android' workflow would be this: - Compile modules (using NDK) against device's kernel, making sure its config is appropriate, ship them over via ADB - Compile required external libraries (using repo build system) for the device, ship them over via ADB - 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) - Cross-compile LTTng-* for the device (using NDK), ship binaries over via ADB Then, on the device, start up the sessiond manually & start tracing. I think I went over everything, but if there's a part that's still cloudy, don't hesitate. -PL On May 17, 2013 1:32 AM, "Ionut D." wrote: > Hello all, > > 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. > > 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. > > It is ok? what I am trying to do ? to integrate and build by using the > Android build system. > 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 ? > > 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. > > I mention that I am trying to build lttng 2.x on ICS 4.0.3. > > Would be great if you will give me a tutorial about how to do it. > > Ionut > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sancelot at free.fr Fri May 17 10:58:58 2013 From: sancelot at free.fr (=?ISO-8859-1?Q?St=E9phane_ANCELOT?=) Date: Fri, 17 May 2013 16:58:58 +0200 Subject: [lttng-dev] newbie and kernel trace Message-ID: <519645B2.5090709@free.fr> Hi, I am trying to reimplement LTTNG 2. in xenomai api. the main problem is that I do not sea any of my new events available in lttng 2. my kernel compiles fine and here is what I done to set it up : file include/trace/events/pod.h : #undef TRACE_SYSTEM #define TRACE_SYSTEM xenotrace #if !defined(_XENOTRACE_H) || defined(TRACE_HEADER_MULTI_READ) #define _XENOTRACE_H #include TRACE_EVENT( xn_nucleus_thread_init, TP_PROTO(struct xnthread *thread,char *thread_name,xnflags_t flags,const char *class,int prio), TP_ARGS(thread,thread_name,flags,class,prio), TP_STRUCT__entry( __field(struct xnthread *,thread) __array(char ,thread_name, XNOBJECT_NAME_LEN ) __field(xnflags_t,flags) __array(char,class, XNOBJECT_NAME_LEN ) __field(int, prio ) ), TP_fast_assign( __entry->thread = thread; memcpy(__entry->thread_name,thread_name, XNOBJECT_NAME_LEN); __entry->flags = flags; memcpy(__entry->class,class, XNOBJECT_NAME_LEN); __entry->prio = prio; ), TP_printk("thread %p thread_name %s flags %lu class %s prio %d", __entry->thread, __entry->thread_name, __entry->flags,__entry->class, __entry->prio) ); #endif /* This part must be outside protection */ #include in pod.h : #define CREATE_TRACE_POINTS #include From jeremie.galarneau at efficios.com Fri May 17 11:13:25 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Fri, 17 May 2013 11:13:25 -0400 Subject: [lttng-dev] newbie and kernel trace In-Reply-To: <519645B2.5090709@free.fr> References: <519645B2.5090709@free.fr> Message-ID: Hi St?phane, We're going to need more details than that. Which kernel version are you using? Can you see the other kernel events in your trace? If not, can you show us how you are setting up your session? Thanks, J?r?mie On Fri, May 17, 2013 at 10:58 AM, St?phane ANCELOT wrote: > Hi, > > I am trying to reimplement LTTNG 2. in xenomai api. > > the main problem is that I do not sea any of my new events available in > lttng 2. > > > my kernel compiles fine and here is what I done to set it up : > > file include/trace/events/pod.h : > > #undef TRACE_SYSTEM > #define TRACE_SYSTEM xenotrace > > #if !defined(_XENOTRACE_H) || defined(TRACE_HEADER_MULTI_READ) > > #define _XENOTRACE_H > > #include > > > TRACE_EVENT( xn_nucleus_thread_init, > TP_PROTO(struct xnthread *thread,char *thread_name,xnflags_t > flags,const char *class,int prio), > TP_ARGS(thread,thread_name,flags,class,prio), > > TP_STRUCT__entry( > __field(struct xnthread *,thread) > __array(char ,thread_name, XNOBJECT_NAME_LEN ) > __field(xnflags_t,flags) > __array(char,class, XNOBJECT_NAME_LEN ) > __field(int, prio ) > ), > > TP_fast_assign( > __entry->thread = thread; > memcpy(__entry->thread_name,thread_name, XNOBJECT_NAME_LEN); > __entry->flags = flags; > memcpy(__entry->class,class, XNOBJECT_NAME_LEN); > __entry->prio = prio; > ), > > TP_printk("thread %p thread_name %s flags %lu class %s prio > %d", > __entry->thread, __entry->thread_name, > __entry->flags,__entry->class, > __entry->prio) > ); > > #endif > > /* This part must be outside protection */ > #include > > > > in pod.h : > #define CREATE_TRACE_POINTS > #include > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From sunyin51 at gmail.com Fri May 17 11:21:07 2013 From: sunyin51 at gmail.com (yin sun) Date: Fri, 17 May 2013 08:21:07 -0700 Subject: [lttng-dev] Patches to enable building on CentOS 5.x (glibc 2.5) In-Reply-To: <20998D40D9A2B7499CA5A3A2666CB1EB23FDDEC5@ZURMSG1.QUANTUM.com> References: <20998D40D9A2B7499CA5A3A2666CB1EB23FDCE2B@ZURMSG1.QUANTUM.com> <20998D40D9A2B7499CA5A3A2666CB1EB23FDDEC5@ZURMSG1.QUANTUM.com> Message-ID: Support lower version of glibc does provide value. In my case, it will enable me easily port to existing production system, which is always several versions behind. Thanks, /Yin On Thu, May 16, 2013 at 11:52 PM, David OShea wrote: > Hi Yannick, > > > > Yes, we patched the latest (as of around a month ago) versions to work on > CentOS 5. Sorry, I neglected to mention that this is for UST only, not > kernel tracing, hence my not saying anything about the modules! > > > > If the changes aren?t going to go upstream into the git repositories, I > imagine there is more chance of the CentOS 5 support becoming broken ? > something could be committed upstream that requires further patching, or > conflicts with the patches. In this case, then, I don?t think EPEL packages > would help us much, and quite possibly nobody else is interested in CentOS 5 > :) Also, we needed to backport some lttng-ust commits from master to get > support for dynamic trace providers to work, so we?re more interested in > seeing future releases include the changes than seeing a patched version of > the current release, and therefore I don?t think there would be any value in > us moving to an EPEL package for the same version of LTTng that we?re > already using. > > > > I can certainly provide the patches to you anyway, but I?m not so keen to > spend time improving them if they?re not going upstream, e.g. one thing I > think needs to be investigated is whether the kernel versions provided by > CentOS 5 include the system calls that we had to add wrappers for; I haven?t > paid any attention to what kernel version I?m using, I?m not sure if it is a > standard CentOS 5 one. > > > > Thanks! > David > > > > > > From: Brosseau, Yannick [mailto:yannick.brosseau at gmail.com] > Sent: Friday, 17 May 2013 12:44 AM > To: David OShea > Cc: lttng-dev at lists.lttng.org > Subject: Re: [lttng-dev] Patches to enable building on CentOS 5.x (glibc > 2.5) > > > > Hi, > > So you made it work with CentOS 5? > > I don't know if we want it upstream, but I could maybe use them to build a > package for EPEL5. > > Yannick > > > > On Wed, May 15, 2013 at 7:38 AM, David OShea > wrote: > > Hi, > > Would contributions of patches to enable lttng-tools and lttng-ust to build > with glibc 2.5 (as is shipped with CentOS 5.x) and to enable lttng-gen-tp to > run with Python 2.4 (as shipped on CentOS 5.x) be accepted? > > What is missing from glibc 2.5 is: > > - a system call wrapper for sched_getcpu() > - a system call wrapper for sync_file_range() > - htobe32() and other similar endian conversion functions > > babeltrace and userspace-rcu did not require patching. > > Thanks in advance, > David > > P.S. If you see this, thanks for all your recent replies, Mathieu, I will > try to get back to you soon! > > ---------------------------------------------------------------------- > The information contained in this transmission may be confidential. Any > disclosure, copying, or further distribution of confidential information is > not permitted unless such privilege is explicitly granted in writing by > Quantum. Quantum reserves the right to have electronic communications, > including email and attachments, sent across its networks filtered through > anti virus and spam software programs and retain such messages in order to > comply with applicable data security and retention requirements. Quantum is > not responsible for the proper and complete transmission of the substance of > this communication or for any delay in its receipt. > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > > -- > Yannick Brosseau > yannickbrosseau.com > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From yangw.wang5 at unb.ca Fri May 17 12:15:14 2013 From: yangw.wang5 at unb.ca (Yang Wang) Date: Fri, 17 May 2013 16:15:14 +0000 Subject: [lttng-dev] Mariadb+LTTng 2.x Message-ID: <8E0A14A4C9B95B459AE214584119C1EB417EDCD7@tulip.ad.unb.ca> I have ported Mariadb+UST1.0 to Mariadb+LTTng 2.0. but when I initialize system tables scripts/mysql_install_db --basedir=/usr/local/mysql --user=mysql It reports libust[7848/7853]: Error: incorrect message size: 292 (in ustcomm_recv_app_reply() at lttng-ust-comm.c:523) libust[7848/7853]: Error: incorrect message size: 292 (in ustcomm_recv_app_reply() at lttng-ust-comm.c:523) libust[7848/7853]: Error: incorrect message size: 292 (in ustcomm_recv_app_reply() at lttng-ust-comm.c:523) 130517 13:12:20 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete I am using lttng-ust-2.1.2 Could anyone help me figure out the reason? Thanks Yang From mathieu.desnoyers at efficios.com Fri May 17 14:46:04 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 17 May 2013 14:46:04 -0400 Subject: [lttng-dev] Mariadb+LTTng 2.x In-Reply-To: <8E0A14A4C9B95B459AE214584119C1EB417EDCD7@tulip.ad.unb.ca> References: <8E0A14A4C9B95B459AE214584119C1EB417EDCD7@tulip.ad.unb.ca> Message-ID: <20130517184604.GA2020@Krystal> lttng-ust 2.1 is not compatible with lttng-tools 2.0. 2.1 with 2.1, 2.0 with 2.0. Thanks, Mathieu * Yang Wang (yangw.wang5 at unb.ca) wrote: > I have ported Mariadb+UST1.0 to Mariadb+LTTng 2.0. > but when I initialize system tables > > scripts/mysql_install_db --basedir=/usr/local/mysql --user=mysql > > It reports > > libust[7848/7853]: Error: incorrect message size: 292 > (in ustcomm_recv_app_reply() at lttng-ust-comm.c:523) > libust[7848/7853]: Error: incorrect message size: 292 > (in ustcomm_recv_app_reply() at lttng-ust-comm.c:523) > libust[7848/7853]: Error: incorrect message size: 292 > (in ustcomm_recv_app_reply() at lttng-ust-comm.c:523) > 130517 13:12:20 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete > > > I am using lttng-ust-2.1.2 > > Could anyone help me figure out the reason? > > Thanks > > Yang -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From yangw.wang5 at unb.ca Fri May 17 17:21:10 2013 From: yangw.wang5 at unb.ca (Yang Wang) Date: Fri, 17 May 2013 21:21:10 +0000 Subject: [lttng-dev] Mariadb+LTTng 2.x In-Reply-To: <20130517184604.GA2020@Krystal> References: <8E0A14A4C9B95B459AE214584119C1EB417EDCD7@tulip.ad.unb.ca>, <20130517184604.GA2020@Krystal> Message-ID: <8E0A14A4C9B95B459AE214584119C1EB417EFCEC@tulip.ad.unb.ca> It seems not this compatibility problem. I have removed all ust1.0 stuffs in the instrumented Mariadb code and replaced with lttng-ust 2.x say, tracepoint statements, trancepoint provider files, probes files and use the lib -llttng-ust instead of -lust. Anything I missed? Is "libust[7848/7853]: " reported from lttng-tools 2.0? Actually, this is printed from lttng-ust-2.1.2 Thanks Yang ________________________________________ From: Mathieu Desnoyers [mathieu.desnoyers at efficios.com] Sent: Friday, May 17, 2013 3:46 PM To: Yang Wang Cc: Yannick Brosseau; David Goulet; Alexandre Montplaisir; Graeme Johnson; Kenneth Kent; lttng-dev at lists.lttng.org Subject: Re: Mariadb+LTTng 2.x lttng-ust 2.1 is not compatible with lttng-tools 2.0. 2.1 with 2.1, 2.0 with 2.0. Thanks, Mathieu * Yang Wang (yangw.wang5 at unb.ca) wrote: > I have ported Mariadb+UST1.0 to Mariadb+LTTng 2.0. > but when I initialize system tables > > scripts/mysql_install_db --basedir=/usr/local/mysql --user=mysql > > It reports > > libust[7848/7853]: Error: incorrect message size: 292 > (in ustcomm_recv_app_reply() at lttng-ust-comm.c:523) > libust[7848/7853]: Error: incorrect message size: 292 > (in ustcomm_recv_app_reply() at lttng-ust-comm.c:523) > libust[7848/7853]: Error: incorrect message size: 292 > (in ustcomm_recv_app_reply() at lttng-ust-comm.c:523) > 130517 13:12:20 [Note] /usr/local/mysql/libexec/mysqld: Shutdown complete > > > I am using lttng-ust-2.1.2 > > Could anyone help me figure out the reason? > > Thanks > > Yang -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From alexmonthy at voxpopuli.im Fri May 17 17:28:39 2013 From: alexmonthy at voxpopuli.im (Alexandre Montplaisir) Date: Fri, 17 May 2013 17:28:39 -0400 Subject: [lttng-dev] Mariadb+LTTng 2.x In-Reply-To: <8E0A14A4C9B95B459AE214584119C1EB417EFCEC@tulip.ad.unb.ca> References: <8E0A14A4C9B95B459AE214584119C1EB417EDCD7@tulip.ad.unb.ca>, <20130517184604.GA2020@Krystal> <8E0A14A4C9B95B459AE214584119C1EB417EFCEC@tulip.ad.unb.ca> Message-ID: <5196A107.7070706@voxpopuli.im> Hi Yang, On 13-05-17 05:21 PM, Yang Wang wrote: > It seems not this compatibility problem. I have removed all ust1.0 stuffs in the instrumented Mariadb code and > replaced with lttng-ust 2.x say, tracepoint statements, trancepoint provider files, probes files and use the lib -llttng-ust instead of -lust. Anything I missed? Mathieu was talking about 2.0 vs 2.1, not 0.x vs 2.x. If you compiled your application with lttng-ust 2.1, make sure you use lttng-tools 2.1 to trace it. lttng-tools 2.0 will not work. > > Is "libust[7848/7853]: " reported from lttng-tools 2.0? Actually, this is printed from Yeah I think this is normal, this is old stuff that dates from the 0.x days, but lttng-ust still prints it that way. Cheers, Alex From ionut5001 at gmail.com Sat May 18 03:21:52 2013 From: ionut5001 at gmail.com (Ionut D.) Date: Sat, 18 May 2013 10:21:52 +0300 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: Great informations! I will post back the results. On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < pierre-luc.st-charles at polymtl.ca> wrote: > Alright, small update for all following a quick (non-mailing-list) > exchange: > > 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 here; > still not perfect). > > 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). > > 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). > > 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). > > 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. > > So, simple 'how do I put LTTng on Android' workflow would be this: > > - Compile modules (using NDK) against device's kernel, making sure its > config is appropriate, ship them over via ADB > > - Compile required external libraries (using repo build system) for the > device, ship them over via ADB > > - 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) > > - Cross-compile LTTng-* for the device (using NDK), ship binaries over > via ADB > > Then, on the device, start up the sessiond manually & start tracing. > > > I think I went over everything, but if there's a part that's still cloudy, > don't hesitate. > > > -PL > > > On May 17, 2013 1:32 AM, "Ionut D." wrote: > >> Hello all, >> >> 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. >> >> 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. >> >> It is ok? what I am trying to do ? to integrate and build by using the >> Android build system. >> 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 ? >> >> 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. >> >> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >> >> Would be great if you will give me a tutorial about how to do it. >> >> Ionut >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From yangw.wang5 at unb.ca Sat May 18 13:18:45 2013 From: yangw.wang5 at unb.ca (Yang Wang) Date: Sat, 18 May 2013 17:18:45 +0000 Subject: [lttng-dev] Mariadb+LTTng 2.x In-Reply-To: <5196A107.7070706@voxpopuli.im> References: <8E0A14A4C9B95B459AE214584119C1EB417EDCD7@tulip.ad.unb.ca>, <20130517184604.GA2020@Krystal> <8E0A14A4C9B95B459AE214584119C1EB417EFCEC@tulip.ad.unb.ca>, <5196A107.7070706@voxpopuli.im> Message-ID: <8E0A14A4C9B95B459AE214584119C1EB417EFD06@tulip.ad.unb.ca> Hello Alex, I reinstalled lttng-tools-2.1.0 and compiled Mariadb with lttng-ust.2.1.2(now they work together) The following is related to lttng-tools-2.1.0 in /usr/local/lib after I reinstalled it. -rw-r--r-- 1 root root 1018130 May 18 13:50 liblttng-ctl.a -rwxr-xr-x 1 root root 1035 May 18 13:50 liblttng-ctl.la lrwxrwxrwx 1 root root 21 May 18 13:50 liblttng-ctl.so -> liblttng-ctl.so.0.0.0 lrwxrwxrwx 1 root root 21 May 18 13:50 liblttng-ctl.so.0 -> liblttng-ctl.so.0.0.0 -rwxr-xr-x 1 root root 491876 May 18 13:50 liblttng-ctl.so.0.0.0 But it reports the same error as before. If it is a compatibility problem, why my instrumented J9 VM with lttng-ust.2.1.2 has no this errors? Yang ________________________________________ From: Alexandre Montplaisir [alexmonthy at voxpopuli.im] Sent: Friday, May 17, 2013 6:28 PM To: Yang Wang Cc: Mathieu Desnoyers; Yannick Brosseau; David Goulet; Graeme Johnson; Kenneth Kent; lttng-dev at lists.lttng.org Subject: Re: Mariadb+LTTng 2.x Hi Yang, On 13-05-17 05:21 PM, Yang Wang wrote: > It seems not this compatibility problem. I have removed all ust1.0 stuffs in the instrumented Mariadb code and > replaced with lttng-ust 2.x say, tracepoint statements, trancepoint provider files, probes files and use the lib -llttng-ust instead of -lust. Anything I missed? Mathieu was talking about 2.0 vs 2.1, not 0.x vs 2.x. If you compiled your application with lttng-ust 2.1, make sure you use lttng-tools 2.1 to trace it. lttng-tools 2.0 will not work. > > Is "libust[7848/7853]: " reported from lttng-tools 2.0? Actually, this is printed from Yeah I think this is normal, this is old stuff that dates from the 0.x days, but lttng-ust still prints it that way. Cheers, Alex From jp_ikaheimonen at mentor.com Mon May 20 04:34:51 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Mon, 20 May 2013 08:34:51 +0000 Subject: [lttng-dev] [Babeltrace PATCH 00/01] Move strerror_r to compat directory Message-ID: <009B25148989C6458484484699278506E5382C44@EU-MBX-01.mgc.mentorg.com> Hi, I separated this patch from my MinGW-specific patch set into a separate (one-patch) set. This particular change is not MinGW-specific, and should be applied separately. The upcoming MinGW patch set will require this patch as well. I hope to have implemented all the changes that were commented upon. These include: - The new function compat_strerror_r is a static inline function, completely defined in the header file. - Because there are no new .c files, there are fewer changes to the build files. - The new code follows the coding conventions of this community. Cheers, JP Ikaheimonen | SW Development Engineer http://go.mentor.com/sourceryanalyzer Mentor Embedded(tm) | Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. From jp_ikaheimonen at mentor.com Mon May 20 04:34:56 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Mon, 20 May 2013 08:34:56 +0000 Subject: [lttng-dev] [Babeltrace PATCH 01/01] Move strerror_r to compat directory Message-ID: <009B25148989C6458484484699278506E5382C4B@EU-MBX-01.mgc.mentorg.com> The usage of strerror_r is platform dependent. Add new function compat_strerror_r to include/babeltrace/compat/string.h, and hide the platform-dependent usage there. Use the aforementioned header file instead of standard string.h where necessary. --- include/Makefile.am | 1 + include/babeltrace/babeltrace-internal.h | 32 +++----------------------------- include/babeltrace/compat/string.h | 28 ++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 29 deletions(-) create mode 100644 include/babeltrace/compat/string.h diff --git a/include/Makefile.am b/include/Makefile.am index eee2ac1..f121d84 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -33,5 +33,6 @@ noinst_HEADERS = \ babeltrace/trace-handle-internal.h \ babeltrace/compat/uuid.h \ babeltrace/compat/memstream.h \ + babeltrace/compat/string.h \ babeltrace/endian.h \ babeltrace/mmap-align.h diff --git a/include/babeltrace/babeltrace-internal.h b/include/babeltrace/babeltrace-internal.h index 9b9ffbd..1f379ee 100644 --- a/include/babeltrace/babeltrace-internal.h +++ b/include/babeltrace/babeltrace-internal.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #define PERROR_BUFLEN 200 @@ -81,46 +81,20 @@ extern int babeltrace_verbose, babeltrace_debug; perrorstr, \ ## args) -#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) - #define _bt_printf_perror(fp, fmt, args...) \ ({ \ char buf[PERROR_BUFLEN] = "Error in strerror_r()"; \ - strerror_r(errno, buf, sizeof(buf)); \ + compat_strerror_r(errno, buf, sizeof(buf)); \ _bt_printfe(fp, "error", buf, fmt, ## args); \ }) #define _bt_printfl_perror(fp, lineno, fmt, args...) \ ({ \ char buf[PERROR_BUFLEN] = "Error in strerror_r()"; \ - strerror_r(errno, buf, sizeof(buf)); \ + compat_strerror_r(errno, buf, sizeof(buf)); \ _bt_printfle(fp, "error", lineno, buf, fmt, ## args); \ }) -#else - -/* - * Version using GNU strerror_r, for linux with appropriate defines. - */ - -#define _bt_printf_perror(fp, fmt, args...) \ - ({ \ - char *buf; \ - char tmp[PERROR_BUFLEN] = "Error in strerror_r()"; \ - buf = strerror_r(errno, tmp, sizeof(tmp)); \ - _bt_printfe(fp, "error", buf, fmt, ## args); \ - }) - -#define _bt_printfl_perror(fp, lineno, fmt, args...) \ - ({ \ - char *buf; \ - char tmp[PERROR_BUFLEN] = "Error in strerror_r()"; \ - buf = strerror_r(errno, tmp, sizeof(tmp)); \ - _bt_printfle(fp, "error", lineno, buf, fmt, ## args); \ - }) - -#endif - /* printf without lineno information */ #define printf_fatal(fmt, args...) \ _bt_printf(stderr, "fatal", fmt, ## args) diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h new file mode 100644 index 0000000..62cf1bf --- /dev/null +++ b/include/babeltrace/compat/string.h @@ -0,0 +1,28 @@ +#ifndef _BABELTRACE_COMPAT_STRING_H +#define _BABELTRACE_COMPAT_STRING_H + +#include + +#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) + +/* XSI-compliant strerror_r */ +static inline int compat_strerror_r(int errnum, char *buf, size_t buflen) +{ + return strerror_r(errnum, buf, buflen); +} + +#else + +/* GNU-compliant strerror_r */ +static inline int compat_strerror_r(int errnum, char *buf, size_t buflen) +{ + char * retbuf; + retbuf = strerror_r(errnum, buf, buflen); + if (retbuf != buf) + strcpy(buf, retbuf); + return 0; +} + +#endif + +#endif /* _BABELTRACE_COMPAT_STRING_H */ -- 1.8.1.msysgit.1 From mathieu.desnoyers at efficios.com Mon May 20 10:31:44 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 20 May 2013 10:31:44 -0400 Subject: [lttng-dev] [PATCH 2/3 lttng-tools v2] Change consumer_metadata_pipe to be a lttng_pipe In-Reply-To: <1368715346-28720-1-git-send-email-dgoulet@efficios.com> References: <1368715346-28720-1-git-send-email-dgoulet@efficios.com> Message-ID: <20130520143144.GB6390@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > The read() call in the metadata thread is also changed to use the lttng > pipe read wrapper. Acked-by: Mathieu Desnoyers > > Signed-off-by: David Goulet > --- > src/common/consumer.c | 58 +++++++++----------------- > src/common/consumer.h | 2 +- > src/common/kernel-consumer/kernel-consumer.c | 2 +- > src/common/ust-consumer/ust-consumer.c | 2 +- > 4 files changed, 22 insertions(+), 42 deletions(-) > > diff --git a/src/common/consumer.c b/src/common/consumer.c > index ca51ce0..c63e6e6 100644 > --- a/src/common/consumer.c > +++ b/src/common/consumer.c > @@ -77,21 +77,6 @@ static struct lttng_ht *metadata_ht; > static struct lttng_ht *data_ht; > > /* > - * Notify a thread pipe to poll back again. This usually means that some global > - * state has changed so we just send back the thread in a poll wait call. > - */ > -static void notify_thread_pipe(int wpipe) > -{ > - int ret; > - > - do { > - struct lttng_consumer_stream *null_stream = NULL; > - > - ret = write(wpipe, &null_stream, sizeof(null_stream)); > - } while (ret < 0 && errno == EINTR); > -} > - > -/* > * Notify a thread lttng pipe to poll back again. This usually means that some > * global state has changed so we just send back the thread in a poll wait > * call. > @@ -423,7 +408,7 @@ static void cleanup_relayd(struct consumer_relayd_sock_pair *relayd, > */ > if (ctx) { > notify_thread_lttng_pipe(ctx->consumer_data_pipe); > - notify_thread_pipe(ctx->consumer_metadata_pipe[1]); > + notify_thread_lttng_pipe(ctx->consumer_metadata_pipe); > } > } > > @@ -1206,8 +1191,8 @@ struct lttng_consumer_local_data *lttng_consumer_create( > goto error_channel_pipe; > } > > - ret = utils_create_pipe(ctx->consumer_metadata_pipe); > - if (ret < 0) { > + ctx->consumer_metadata_pipe = lttng_pipe_open(0); > + if (!ctx->consumer_metadata_pipe) { > goto error_metadata_pipe; > } > > @@ -1219,7 +1204,7 @@ struct lttng_consumer_local_data *lttng_consumer_create( > return ctx; > > error_splice_pipe: > - utils_close_pipe(ctx->consumer_metadata_pipe); > + lttng_pipe_destroy(ctx->consumer_metadata_pipe); > error_metadata_pipe: > utils_close_pipe(ctx->consumer_channel_pipe); > error_channel_pipe: > @@ -1254,6 +1239,7 @@ void lttng_consumer_destroy(struct lttng_consumer_local_data *ctx) > utils_close_pipe(ctx->consumer_thread_pipe); > utils_close_pipe(ctx->consumer_channel_pipe); > lttng_pipe_destroy(ctx->consumer_data_pipe); > + lttng_pipe_destroy(ctx->consumer_metadata_pipe); > utils_close_pipe(ctx->consumer_should_quit); > utils_close_pipe(ctx->consumer_splice_metadata_pipe); > > @@ -2134,7 +2120,8 @@ void *consumer_thread_metadata_poll(void *data) > goto end_poll; > } > > - ret = lttng_poll_add(&events, ctx->consumer_metadata_pipe[0], LPOLLIN); > + ret = lttng_poll_add(&events, > + lttng_pipe_get_readfd(ctx->consumer_metadata_pipe), LPOLLIN); > if (ret < 0) { > goto end; > } > @@ -2172,30 +2159,26 @@ restart: > continue; > } > > - if (pollfd == ctx->consumer_metadata_pipe[0]) { > + if (pollfd == lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)) { > if (revents & (LPOLLERR | LPOLLHUP )) { > DBG("Metadata thread pipe hung up"); > /* > * Remove the pipe from the poll set and continue the loop > * since their might be data to consume. > */ > - lttng_poll_del(&events, ctx->consumer_metadata_pipe[0]); > - ret = close(ctx->consumer_metadata_pipe[0]); > - if (ret < 0) { > - PERROR("close metadata pipe"); > - } > + lttng_poll_del(&events, > + lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)); > + lttng_pipe_read_close(ctx->consumer_metadata_pipe); > continue; > } else if (revents & LPOLLIN) { > - do { > - /* Get the stream pointer received */ > - ret = read(pollfd, &stream, sizeof(stream)); > - } while (ret < 0 && errno == EINTR); > - if (ret < 0 || > - ret < sizeof(struct lttng_consumer_stream *)) { > - PERROR("read metadata stream"); > + ssize_t pipe_len; > + > + pipe_len = lttng_pipe_read(ctx->consumer_metadata_pipe, > + &stream, sizeof(stream)); > + if (pipe_len < 0) { > + ERR("read metadata stream, ret: %ld", pipe_len); > /* > - * Let's continue here and hope we can still work > - * without stopping the consumer. XXX: Should we? > + * Continue here to handle the rest of the streams. > */ > continue; > } > @@ -2543,10 +2526,7 @@ end: > * only tracked fd in the poll set. The thread will take care of closing > * the read side. > */ > - ret = close(ctx->consumer_metadata_pipe[1]); > - if (ret < 0) { > - PERROR("close data pipe"); > - } > + (void) lttng_pipe_write_close(ctx->consumer_metadata_pipe); > > destroy_data_stream_ht(data_ht); > > diff --git a/src/common/consumer.h b/src/common/consumer.h > index 91039e8..3726fd1 100644 > --- a/src/common/consumer.h > +++ b/src/common/consumer.h > @@ -351,7 +351,7 @@ struct lttng_consumer_local_data { > /* to let the signal handler wake up the fd receiver thread */ > int consumer_should_quit[2]; > /* Metadata poll thread pipe. Transfer metadata stream to it */ > - int consumer_metadata_pipe[2]; > + struct lttng_pipe *consumer_metadata_pipe; > }; > > /* > diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c > index d8aec49..f23fc9c 100644 > --- a/src/common/kernel-consumer/kernel-consumer.c > +++ b/src/common/kernel-consumer/kernel-consumer.c > @@ -288,7 +288,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, > > /* Get the right pipe where the stream will be sent. */ > if (new_stream->metadata_flag) { > - stream_pipe = ctx->consumer_metadata_pipe[1]; > + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); > } else { > stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); > } > diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c > index ddf80da..a81e9d4 100644 > --- a/src/common/ust-consumer/ust-consumer.c > +++ b/src/common/ust-consumer/ust-consumer.c > @@ -189,7 +189,7 @@ static int send_stream_to_thread(struct lttng_consumer_stream *stream, > > /* Get the right pipe where the stream will be sent. */ > if (stream->metadata_flag) { > - stream_pipe = ctx->consumer_metadata_pipe[1]; > + stream_pipe = lttng_pipe_get_writefd(ctx->consumer_metadata_pipe); > } else { > stream_pipe = lttng_pipe_get_writefd(ctx->consumer_data_pipe); > } > -- > 1.7.10.4 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From sancelot at free.fr Tue May 21 02:34:59 2013 From: sancelot at free.fr (=?ISO-8859-1?Q?St=E9phane_ANCELOT?=) Date: Tue, 21 May 2013 08:34:59 +0200 Subject: [lttng-dev] newbie and kernel trace In-Reply-To: References: <519645B2.5090709@free.fr> Message-ID: <519B1593.1030709@free.fr> Hi, I am using a kernel 2.6.34, yes I can see the other events that are already programmed in the kernel, like irq_handler_entry,irq_handler_exit and so on. I am cross compiling everything from a 64 bit os to a 32 bit target. to launch my session I am using the following commands : export LD_LIBRARY_PATH=../lib echo launching lttng-sessiond ./lttng-sessiond --consumerd32-path ../lib/lttng/libexec/lttng-consumerd & sleep 1 echo creation session ./lttng create mysession/kernel ./lttng enable-event sched_switch,sched_process_fork,irq_handler_entry,irq_handler_exit -k ./lttng start When I am using lttng list, I have only the predefined kernels tracepoints, not mine :-( root at FTX10-TF-506213:~/LTTNG/bin# ./lttng list -k Kernel events: ------------- workqueue_insertion (loglevel: TRACE_EMERG (0)) (type: tracepoint) workqueue_execution (loglevel: TRACE_EMERG (0)) (type: tracepoint) workqueue_creation (loglevel: TRACE_EMERG (0)) (type: tracepoint) workqueue_destruction (loglevel: TRACE_EMERG (0)) (type: tracepoint) timer_init (loglevel: TRACE_EMERG (0)) (type: tracepoint) timer_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) timer_expire_entry (loglevel: TRACE_EMERG (0)) (type: tracepoint) timer_expire_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) timer_cancel (loglevel: TRACE_EMERG (0)) (type: tracepoint) hrtimer_init (loglevel: TRACE_EMERG (0)) (type: tracepoint) hrtimer_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) hrtimer_expire_entry (loglevel: TRACE_EMERG (0)) (type: tracepoint) hrtimer_expire_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) hrtimer_cancel (loglevel: TRACE_EMERG (0)) (type: tracepoint) itimer_state (loglevel: TRACE_EMERG (0)) (type: tracepoint) itimer_expire (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_end (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_process_state (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_file_descriptor (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_vm_map (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_network_interface (loglevel: TRACE_EMERG (0)) (type: tracepoint) lttng_statedump_interrupt (loglevel: TRACE_EMERG (0)) (type: tracepoint) skb_kfree (loglevel: TRACE_EMERG (0)) (type: tracepoint) skb_copy_datagram_iovec (loglevel: TRACE_EMERG (0)) (type: tracepoint) signal_generate (loglevel: TRACE_EMERG (0)) (type: tracepoint) signal_deliver (loglevel: TRACE_EMERG (0)) (type: tracepoint) signal_overflow_fail (loglevel: TRACE_EMERG (0)) (type: tracepoint) signal_lose_info (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_kthread_stop (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_kthread_stop_ret (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_wakeup (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_wakeup_new (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_switch (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_migrate_task (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_process_free (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_process_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_wait_task (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_process_wait (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_process_fork (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_stat_wait (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_stat_sleep (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_stat_iowait (loglevel: TRACE_EMERG (0)) (type: tracepoint) sched_stat_runtime (loglevel: TRACE_EMERG (0)) (type: tracepoint) power_start (loglevel: TRACE_EMERG (0)) (type: tracepoint) power_frequency (loglevel: TRACE_EMERG (0)) (type: tracepoint) power_end (loglevel: TRACE_EMERG (0)) (type: tracepoint) napi_poll (loglevel: TRACE_EMERG (0)) (type: tracepoint) module_load (loglevel: TRACE_EMERG (0)) (type: tracepoint) module_free (loglevel: TRACE_EMERG (0)) (type: tracepoint) module_get (loglevel: TRACE_EMERG (0)) (type: tracepoint) module_put (loglevel: TRACE_EMERG (0)) (type: tracepoint) module_request (loglevel: TRACE_EMERG (0)) (type: tracepoint) kmem_kmalloc (loglevel: TRACE_EMERG (0)) (type: tracepoint) kmem_cache_alloc (loglevel: TRACE_EMERG (0)) (type: tracepoint) kmem_kmalloc_node (loglevel: TRACE_EMERG (0)) (type: tracepoint) kmem_cache_alloc_node (loglevel: TRACE_EMERG (0)) (type: tracepoint) kmem_kfree (loglevel: TRACE_EMERG (0)) (type: tracepoint) kmem_cache_free (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_page_free_direct (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_pagevec_free (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_page_alloc (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_page_alloc_zone_locked (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_page_pcpu_drain (loglevel: TRACE_EMERG (0)) (type: tracepoint) mm_page_alloc_extfrag (loglevel: TRACE_EMERG (0)) (type: tracepoint) irq_handler_entry (loglevel: TRACE_EMERG (0)) (type: tracepoint) irq_handler_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) softirq_entry (loglevel: TRACE_EMERG (0)) (type: tracepoint) softirq_exit (loglevel: TRACE_EMERG (0)) (type: tracepoint) softirq_raise (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_rq_abort (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_rq_requeue (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_rq_complete (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_rq_insert (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_rq_issue (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_bio_bounce (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_bio_complete (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_bio_backmerge (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_bio_frontmerge (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_bio_queue (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_getrq (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_sleeprq (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_plug (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_unplug_timer (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_unplug_io (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_split (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) block_rq_remap (loglevel: TRACE_EMERG (0)) (type: tracepoint) I attached my kernel .config file. Regards, Steph On 17/05/2013 17:13, J?r?mie Galarneau wrote: > Hi St?phane, > > We're going to need more details than that. Which kernel version are you using? > Can you see the other kernel events in your trace? If not, can you > show us how you are setting up your session? > Thanks, > J?r?mie > > On Fri, May 17, 2013 at 10:58 AM, St?phane ANCELOT wrote: >> Hi, >> >> I am trying to reimplement LTTNG 2. in xenomai api. >> >> the main problem is that I do not sea any of my new events available in >> lttng 2. >> >> >> my kernel compiles fine and here is what I done to set it up : >> >> file include/trace/events/pod.h : >> >> #undef TRACE_SYSTEM >> #define TRACE_SYSTEM xenotrace >> >> #if !defined(_XENOTRACE_H) || defined(TRACE_HEADER_MULTI_READ) >> >> #define _XENOTRACE_H >> >> #include >> >> >> TRACE_EVENT( xn_nucleus_thread_init, >> TP_PROTO(struct xnthread *thread,char *thread_name,xnflags_t >> flags,const char *class,int prio), >> TP_ARGS(thread,thread_name,flags,class,prio), >> >> TP_STRUCT__entry( >> __field(struct xnthread *,thread) >> __array(char ,thread_name, XNOBJECT_NAME_LEN ) >> __field(xnflags_t,flags) >> __array(char,class, XNOBJECT_NAME_LEN ) >> __field(int, prio ) >> ), >> >> TP_fast_assign( >> __entry->thread = thread; >> memcpy(__entry->thread_name,thread_name, XNOBJECT_NAME_LEN); >> __entry->flags = flags; >> memcpy(__entry->class,class, XNOBJECT_NAME_LEN); >> __entry->prio = prio; >> ), >> >> TP_printk("thread %p thread_name %s flags %lu class %s prio >> %d", >> __entry->thread, __entry->thread_name, >> __entry->flags,__entry->class, >> __entry->prio) >> ); >> >> #endif >> >> /* This part must be outside protection */ >> #include >> >> >> >> in pod.h : >> #define CREATE_TRACE_POINTS >> #include >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -------------- next part -------------- # # Automatically generated make config: don't edit # Linux kernel version: 2.6.34 # Thu May 16 17:08:10 2013 # # CONFIG_64BIT is not set CONFIG_X86_32=y # CONFIG_X86_64 is not set CONFIG_X86=y CONFIG_OUTPUT_FORMAT="elf32-i386" CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" CONFIG_GENERIC_TIME=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_MMU=y CONFIG_ZONE_DMA=y # CONFIG_NEED_DMA_MAP_STATE is not set CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y # CONFIG_RWSEM_GENERIC_SPINLOCK is not set CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y CONFIG_GENERIC_CALIBRATE_DELAY=y # CONFIG_GENERIC_TIME_VSYSCALL is not set CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_DEFAULT_IDLE=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_HAVE_SETUP_PER_CPU_AREA=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y # CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_SUSPEND_POSSIBLE=y # CONFIG_ZONE_DMA32 is not set CONFIG_ARCH_POPULATES_NODE_MAP=y # CONFIG_AUDIT_ARCH is not set CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y CONFIG_HAVE_EARLY_RES=y CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_X86_32_LAZY_GS=y CONFIG_KTIME_SCALAR=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" CONFIG_CONSTRUCTORS=y # # General setup # CONFIG_EXPERIMENTAL=y CONFIG_BROKEN_ON_SMP=y CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_LOCALVERSION="-ipipe-uniproc256-lttng" CONFIG_LOCALVERSION_AUTO=y CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_BZIP2=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_LZO=y CONFIG_KERNEL_GZIP=y # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_LZMA is not set # CONFIG_KERNEL_LZO is not set # CONFIG_SWAP is not set CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set # CONFIG_AUDIT is not set # # RCU Subsystem # CONFIG_TREE_RCU=y # CONFIG_TREE_PREEMPT_RCU is not set # CONFIG_TINY_RCU is not set # CONFIG_RCU_TRACE is not set CONFIG_RCU_FANOUT=32 # CONFIG_RCU_FANOUT_EXACT is not set # CONFIG_TREE_RCU_TRACE is not set CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y # CONFIG_CGROUPS is not set # CONFIG_SYSFS_DEPRECATED_V2 is not set # CONFIG_RELAY is not set # CONFIG_NAMESPACES is not set # CONFIG_BLK_DEV_INITRD is not set # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y CONFIG_ANON_INODES=y CONFIG_EMBEDDED=y CONFIG_UID16=y CONFIG_SYSCTL_SYSCALL=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_PCSPKR_PLATFORM=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SIGNALFD=y CONFIG_TIMERFD=y CONFIG_EVENTFD=y CONFIG_SHMEM=y CONFIG_AIO=y CONFIG_HAVE_PERF_EVENTS=y # # Kernel Performance Events And Counters # CONFIG_PERF_EVENTS=y # CONFIG_PERF_COUNTERS is not set CONFIG_VM_EVENT_COUNTERS=y CONFIG_PCI_QUIRKS=y CONFIG_COMPAT_BRK=y CONFIG_SLAB=y # CONFIG_SLUB is not set # CONFIG_SLOB is not set # CONFIG_PROFILING is not set CONFIG_TRACEPOINTS=y CONFIG_HAVE_OPROFILE=y # CONFIG_KPROBES is not set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y CONFIG_HAVE_IOREMAP_PROT=y CONFIG_HAVE_KPROBES=y CONFIG_HAVE_KRETPROBES=y CONFIG_HAVE_OPTPROBES=y CONFIG_HAVE_ARCH_TRACEHOOK=y CONFIG_HAVE_DMA_ATTRS=y CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_DMA_API_DEBUG=y CONFIG_HAVE_HW_BREAKPOINT=y CONFIG_HAVE_USER_RETURN_NOTIFIER=y # # GCOV-based kernel profiling # CONFIG_GCOV_KERNEL=y CONFIG_GCOV_PROFILE_ALL=y # CONFIG_SLOW_WORK is not set CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_SLABINFO=y CONFIG_RT_MUTEXES=y CONFIG_BASE_SMALL=0 CONFIG_MODULES=y # CONFIG_MODULE_FORCE_LOAD is not set CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_MODVERSIONS=y # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_BLOCK=y # CONFIG_LBDAF is not set # CONFIG_BLK_DEV_BSG is not set # CONFIG_BLK_DEV_INTEGRITY is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y # CONFIG_DEFAULT_DEADLINE is not set CONFIG_DEFAULT_CFQ=y # CONFIG_DEFAULT_NOOP is not set CONFIG_DEFAULT_IOSCHED="cfq" # CONFIG_INLINE_SPIN_TRYLOCK is not set # CONFIG_INLINE_SPIN_TRYLOCK_BH is not set # CONFIG_INLINE_SPIN_LOCK is not set # CONFIG_INLINE_SPIN_LOCK_BH is not set # CONFIG_INLINE_SPIN_LOCK_IRQ is not set # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set # CONFIG_INLINE_SPIN_UNLOCK is not set # CONFIG_INLINE_SPIN_UNLOCK_BH is not set # CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set # CONFIG_INLINE_READ_TRYLOCK is not set # CONFIG_INLINE_READ_LOCK is not set # CONFIG_INLINE_READ_LOCK_BH is not set # CONFIG_INLINE_READ_LOCK_IRQ is not set # CONFIG_INLINE_READ_LOCK_IRQSAVE is not set # CONFIG_INLINE_READ_UNLOCK is not set # CONFIG_INLINE_READ_UNLOCK_BH is not set # CONFIG_INLINE_READ_UNLOCK_IRQ is not set # CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set # CONFIG_INLINE_WRITE_TRYLOCK is not set # CONFIG_INLINE_WRITE_LOCK is not set # CONFIG_INLINE_WRITE_LOCK_BH is not set # CONFIG_INLINE_WRITE_LOCK_IRQ is not set # CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set # CONFIG_INLINE_WRITE_UNLOCK is not set # CONFIG_INLINE_WRITE_UNLOCK_BH is not set # CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set # CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set # CONFIG_MUTEX_SPIN_ON_OWNER is not set # # Real-time sub-system # CONFIG_XENOMAI=y CONFIG_XENO_GENERIC_STACKPOOL=y CONFIG_XENO_FASTSYNCH=y CONFIG_XENO_OPT_NUCLEUS=y CONFIG_XENO_OPT_PERVASIVE=y CONFIG_XENO_OPT_PRIOCPL=y CONFIG_XENO_OPT_PIPELINE_HEAD=y # CONFIG_XENO_OPT_SCHED_CLASSES is not set CONFIG_XENO_OPT_PIPE=y CONFIG_XENO_OPT_PIPE_NRDEV=32 CONFIG_XENO_OPT_REGISTRY_NRSLOTS=512 CONFIG_XENO_OPT_SYS_HEAPSZ=256 CONFIG_XENO_OPT_SYS_STACKPOOLSZ=128 CONFIG_XENO_OPT_SEM_HEAPSZ=12 CONFIG_XENO_OPT_GLOBAL_SEM_HEAPSZ=12 CONFIG_XENO_OPT_STATS=y # CONFIG_XENO_OPT_DEBUG is not set # CONFIG_XENO_OPT_SHIRQ is not set # # Timing # # CONFIG_XENO_OPT_TIMING_PERIODIC is not set CONFIG_XENO_OPT_TIMING_VIRTICK=1000 CONFIG_XENO_OPT_TIMING_SCHEDLAT=0 # # Scalability # # CONFIG_XENO_OPT_SCALABLE_SCHED is not set CONFIG_XENO_OPT_TIMER_LIST=y # CONFIG_XENO_OPT_TIMER_HEAP is not set # CONFIG_XENO_OPT_TIMER_WHEEL is not set # # Machine # CONFIG_XENO_HW_FPU=y # # NMI watchdog # CONFIG_XENO_HW_NMI_DEBUG_LATENCY=y CONFIG_XENO_HW_NMI_DEBUG_LATENCY_MAX=100 # # SMI workaround # # CONFIG_XENO_HW_SMI_DETECT_DISABLE is not set CONFIG_XENO_HW_SMI_DETECT=y CONFIG_XENO_HW_SMI_WORKAROUND=y CONFIG_XENO_HW_SMI_ALL=y # # Interfaces # CONFIG_XENO_SKIN_NATIVE=y CONFIG_XENO_OPT_NATIVE_PERIOD=0 CONFIG_XENO_OPT_NATIVE_PIPE=y CONFIG_XENO_OPT_NATIVE_PIPE_BUFSZ=1024 CONFIG_XENO_OPT_NATIVE_SEM=y CONFIG_XENO_OPT_NATIVE_EVENT=y CONFIG_XENO_OPT_NATIVE_MUTEX=y CONFIG_XENO_OPT_NATIVE_COND=y CONFIG_XENO_OPT_NATIVE_QUEUE=y CONFIG_XENO_OPT_NATIVE_BUFFER=y CONFIG_XENO_OPT_NATIVE_HEAP=y CONFIG_XENO_OPT_NATIVE_ALARM=y CONFIG_XENO_OPT_NATIVE_MPS=y # CONFIG_XENO_OPT_NATIVE_INTR is not set CONFIG_XENO_SKIN_POSIX=y CONFIG_XENO_OPT_POSIX_PERIOD=0 # CONFIG_XENO_OPT_POSIX_SHM is not set # CONFIG_XENO_OPT_POSIX_INTR is not set # CONFIG_XENO_OPT_POSIX_SELECT is not set CONFIG_XENO_OPT_DEBUG_POSIX=y # CONFIG_XENO_SKIN_PSOS is not set # CONFIG_XENO_SKIN_UITRON is not set # CONFIG_XENO_SKIN_VRTX is not set # CONFIG_XENO_SKIN_VXWORKS is not set # CONFIG_XENO_SKIN_RTAI is not set # CONFIG_XENO_OPT_NOWARN_DEPRECATED is not set CONFIG_XENO_SKIN_RTDM=y CONFIG_XENO_OPT_RTDM_PERIOD=0 CONFIG_XENO_OPT_RTDM_FILDES=128 # CONFIG_XENO_OPT_RTDM_SELECT is not set # # Drivers # # # Serial drivers # # CONFIG_XENO_DRIVERS_16550A is not set # # Testing drivers # # CONFIG_XENO_DRIVERS_TESTING_LEGACY_NAMES is not set # CONFIG_XENO_DRIVERS_TIMERBENCH is not set # CONFIG_XENO_DRIVERS_IRQBENCH is not set # CONFIG_XENO_DRIVERS_SWITCHTEST is not set # CONFIG_XENO_DRIVERS_SIGTEST is not set # CONFIG_XENO_DRIVERS_RTDMTEST is not set # # CAN drivers # # CONFIG_XENO_DRIVERS_CAN is not set # # ANALOGY drivers # # CONFIG_XENO_DRIVERS_ANALOGY is not set # # Real-time IPC drivers # # CONFIG_XENO_DRIVERS_RTIPC is not set # CONFIG_FREEZER is not set # # Processor type and features # CONFIG_TICK_ONESHOT=y # CONFIG_NO_HZ is not set CONFIG_HIGH_RES_TIMERS=y CONFIG_GENERIC_CLOCKEVENTS_BUILD=y # CONFIG_SMP is not set # CONFIG_SPARSE_IRQ is not set CONFIG_X86_MPPARSE=y # CONFIG_X86_EXTENDED_PLATFORM is not set CONFIG_SCHED_OMIT_FRAME_POINTER=y CONFIG_NO_BOOTMEM=y # CONFIG_MEMTEST is not set # CONFIG_M386 is not set # CONFIG_M486 is not set # CONFIG_M586 is not set # CONFIG_M586TSC is not set # CONFIG_M586MMX is not set # CONFIG_M686 is not set # CONFIG_MPENTIUMII is not set # CONFIG_MPENTIUMIII is not set CONFIG_MPENTIUMM=y # CONFIG_MPENTIUM4 is not set # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MK8 is not set # CONFIG_MCRUSOE is not set # CONFIG_MEFFICEON is not set # CONFIG_MWINCHIPC6 is not set # CONFIG_MWINCHIP3D is not set # CONFIG_MGEODEGX1 is not set # CONFIG_MGEODE_LX is not set # CONFIG_MCYRIXIII is not set # CONFIG_MVIAC3_2 is not set # CONFIG_MVIAC7 is not set # CONFIG_MPSC is not set # CONFIG_MCORE2 is not set # CONFIG_MATOM is not set # CONFIG_GENERIC_CPU is not set CONFIG_X86_GENERIC=y CONFIG_X86_CPU=y CONFIG_X86_INTERNODE_CACHE_SHIFT=6 CONFIG_X86_CMPXCHG=y CONFIG_X86_L1_CACHE_SHIFT=6 CONFIG_X86_XADD=y CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_USE_PPRO_CHECKSUM=y CONFIG_X86_TSC=y CONFIG_X86_CMPXCHG64=y CONFIG_X86_CMOV=y CONFIG_X86_MINIMUM_CPU_FAMILY=5 CONFIG_X86_DEBUGCTLMSR=y CONFIG_PROCESSOR_SELECT=y CONFIG_CPU_SUP_INTEL=y CONFIG_CPU_SUP_CYRIX_32=y CONFIG_CPU_SUP_AMD=y CONFIG_CPU_SUP_CENTAUR=y CONFIG_CPU_SUP_TRANSMETA_32=y CONFIG_CPU_SUP_UMC_32=y # CONFIG_X86_DS is not set # CONFIG_HPET_TIMER is not set CONFIG_DMI=y # CONFIG_IOMMU_HELPER is not set # CONFIG_IOMMU_API is not set CONFIG_NR_CPUS=1 # CONFIG_PREEMPT_NONE is not set # CONFIG_PREEMPT_VOLUNTARY is not set CONFIG_PREEMPT=y CONFIG_IPIPE=y CONFIG_IPIPE_DOMAINS=4 CONFIG_IPIPE_DELAYED_ATOMICSW=y # CONFIG_IPIPE_UNMASKED_CONTEXT_SWITCH is not set CONFIG_X86_UP_APIC=y CONFIG_X86_UP_IOAPIC=y CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y # CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS is not set # CONFIG_X86_MCE is not set # CONFIG_VM86 is not set # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set # CONFIG_X86_REBOOTFIXUPS is not set CONFIG_MICROCODE=m CONFIG_MICROCODE_INTEL=y # CONFIG_MICROCODE_AMD is not set CONFIG_MICROCODE_OLD_INTERFACE=y CONFIG_X86_MSR=m CONFIG_X86_CPUID=m # CONFIG_NOHIGHMEM is not set CONFIG_HIGHMEM4G=y # CONFIG_HIGHMEM64G is not set CONFIG_VMSPLIT_3G=y # CONFIG_VMSPLIT_3G_OPT is not set # CONFIG_VMSPLIT_2G is not set # CONFIG_VMSPLIT_2G_OPT is not set # CONFIG_VMSPLIT_1G is not set CONFIG_PAGE_OFFSET=0xC0000000 CONFIG_HIGHMEM=y # CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set CONFIG_ARCH_FLATMEM_ENABLE=y CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_ARCH_SELECT_MEMORY_MODEL=y CONFIG_ILLEGAL_POINTER_VALUE=0 CONFIG_SELECT_MEMORY_MODEL=y CONFIG_FLATMEM_MANUAL=y # CONFIG_DISCONTIGMEM_MANUAL is not set # CONFIG_SPARSEMEM_MANUAL is not set CONFIG_FLATMEM=y CONFIG_FLAT_NODE_MEM_MAP=y CONFIG_SPARSEMEM_STATIC=y CONFIG_PAGEFLAGS_EXTENDED=y CONFIG_SPLIT_PTLOCK_CPUS=4 # CONFIG_PHYS_ADDR_T_64BIT is not set CONFIG_ZONE_DMA_FLAG=1 CONFIG_BOUNCE=y CONFIG_VIRT_TO_BUS=y # CONFIG_KSM is not set CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 # CONFIG_HIGHPTE is not set # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set CONFIG_X86_RESERVE_LOW_64K=y # CONFIG_MATH_EMULATION is not set CONFIG_MTRR=y CONFIG_MTRR_SANITIZER=y CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0 CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1 # CONFIG_X86_PAT is not set CONFIG_SECCOMP=y # CONFIG_CC_STACKPROTECTOR is not set # CONFIG_HZ_100 is not set CONFIG_HZ_250=y # CONFIG_HZ_300 is not set # CONFIG_HZ_1000 is not set CONFIG_HZ=250 CONFIG_SCHED_HRTICK=y # CONFIG_KEXEC is not set # CONFIG_CRASH_DUMP is not set CONFIG_PHYSICAL_START=0x1000000 # CONFIG_RELOCATABLE is not set CONFIG_PHYSICAL_ALIGN=0x100000 # CONFIG_COMPAT_VDSO is not set # CONFIG_CMDLINE_BOOL is not set CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y # # Power management and ACPI options # # CONFIG_PM is not set # CONFIG_SFI is not set # # CPU Frequency scaling # # CONFIG_CPU_FREQ is not set # CONFIG_CPU_IDLE is not set # # Bus options (PCI etc.) # CONFIG_PCI=y # CONFIG_PCI_GOBIOS is not set # CONFIG_PCI_GOMMCONFIG is not set # CONFIG_PCI_GODIRECT is not set # CONFIG_PCI_GOOLPC is not set CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_PCI_DOMAINS=y CONFIG_PCIEPORTBUS=y CONFIG_PCIEAER=y # CONFIG_PCIE_ECRC is not set # CONFIG_PCIEAER_INJECT is not set # CONFIG_PCIEASPM is not set CONFIG_ARCH_SUPPORTS_MSI=y CONFIG_PCI_MSI=y # CONFIG_PCI_STUB is not set CONFIG_HT_IRQ=y # CONFIG_PCI_IOV is not set CONFIG_ISA_DMA_API=y # CONFIG_ISA is not set # CONFIG_MCA is not set # CONFIG_SCx200 is not set # CONFIG_OLPC is not set CONFIG_K8_NB=y # CONFIG_PCCARD is not set # CONFIG_HOTPLUG_PCI is not set # # Executable file formats / Emulations # CONFIG_BINFMT_ELF=y # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set CONFIG_HAVE_AOUT=y CONFIG_BINFMT_AOUT=m CONFIG_BINFMT_MISC=m CONFIG_HAVE_ATOMIC_IOMAP=y CONFIG_NET=y # # Networking options # CONFIG_PACKET=y CONFIG_UNIX=y CONFIG_XFRM=y CONFIG_XFRM_USER=m # CONFIG_XFRM_SUB_POLICY is not set # CONFIG_XFRM_MIGRATE is not set # CONFIG_XFRM_STATISTICS is not set CONFIG_XFRM_IPCOMP=m CONFIG_NET_KEY=m # CONFIG_NET_KEY_MIGRATE is not set CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_ADVANCED_ROUTER=y CONFIG_ASK_IP_FIB_HASH=y # CONFIG_IP_FIB_TRIE is not set CONFIG_IP_FIB_HASH=y CONFIG_IP_MULTIPLE_TABLES=y CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_VERBOSE=y # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=m CONFIG_NET_IPGRE=m CONFIG_NET_IPGRE_BROADCAST=y CONFIG_IP_MROUTE=y CONFIG_IP_PIMSM_V1=y CONFIG_IP_PIMSM_V2=y # CONFIG_ARPD is not set CONFIG_SYN_COOKIES=y CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m CONFIG_INET_XFRM_TUNNEL=m CONFIG_INET_TUNNEL=y CONFIG_INET_XFRM_MODE_TRANSPORT=y CONFIG_INET_XFRM_MODE_TUNNEL=y CONFIG_INET_XFRM_MODE_BEET=y # CONFIG_INET_LRO is not set CONFIG_INET_DIAG=y CONFIG_INET_TCP_DIAG=y # CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TCP_CONG_CUBIC=y CONFIG_DEFAULT_TCP_CONG="cubic" # CONFIG_TCP_MD5SIG is not set CONFIG_IPV6=y # CONFIG_IPV6_PRIVACY is not set # CONFIG_IPV6_ROUTER_PREF is not set # CONFIG_IPV6_OPTIMISTIC_DAD is not set # CONFIG_INET6_AH is not set # CONFIG_INET6_ESP is not set # CONFIG_INET6_IPCOMP is not set # CONFIG_IPV6_MIP6 is not set # CONFIG_INET6_XFRM_TUNNEL is not set # CONFIG_INET6_TUNNEL is not set CONFIG_INET6_XFRM_MODE_TRANSPORT=y CONFIG_INET6_XFRM_MODE_TUNNEL=y CONFIG_INET6_XFRM_MODE_BEET=y # CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set CONFIG_IPV6_SIT=y # CONFIG_IPV6_SIT_6RD is not set CONFIG_IPV6_NDISC_NODETYPE=y # CONFIG_IPV6_TUNNEL is not set # CONFIG_IPV6_MULTIPLE_TABLES is not set # CONFIG_IPV6_MROUTE is not set # CONFIG_NETWORK_SECMARK is not set # CONFIG_NETFILTER is not set # CONFIG_IP_DCCP is not set CONFIG_IP_SCTP=m # CONFIG_SCTP_DBG_MSG is not set # CONFIG_SCTP_DBG_OBJCNT is not set # CONFIG_SCTP_HMAC_NONE is not set # CONFIG_SCTP_HMAC_SHA1 is not set CONFIG_SCTP_HMAC_MD5=y # CONFIG_RDS is not set # CONFIG_TIPC is not set # CONFIG_ATM is not set # CONFIG_BRIDGE is not set # CONFIG_NET_DSA is not set CONFIG_VLAN_8021Q=m # CONFIG_VLAN_8021Q_GVRP is not set # CONFIG_DECNET is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # CONFIG_PHONET is not set # CONFIG_IEEE802154 is not set # CONFIG_NET_SCHED is not set # CONFIG_DCB is not set # # Network testing # # CONFIG_NET_PKTGEN is not set # CONFIG_NET_DROP_MONITOR is not set # CONFIG_HAMRADIO is not set # CONFIG_CAN is not set # CONFIG_IRDA is not set # CONFIG_BT is not set # CONFIG_AF_RXRPC is not set CONFIG_FIB_RULES=y CONFIG_WIRELESS=y # CONFIG_CFG80211 is not set # CONFIG_LIB80211 is not set # # CFG80211 needs to be enabled for MAC80211 # # CONFIG_WIMAX is not set # CONFIG_RFKILL is not set # CONFIG_NET_9P is not set # # Device Drivers # # # Generic Driver Options # CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y CONFIG_STANDALONE=y # CONFIG_PREVENT_FIRMWARE_BUILD is not set CONFIG_FW_LOADER=y # CONFIG_FIRMWARE_IN_KERNEL is not set CONFIG_EXTRA_FIRMWARE="" # CONFIG_SYS_HYPERVISOR is not set # CONFIG_CONNECTOR is not set # CONFIG_MTD is not set # CONFIG_PARPORT is not set CONFIG_BLK_DEV=y # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set # # DRBD disabled because PROC_FS, INET or CONNECTOR not selected # CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=8192 # CONFIG_BLK_DEV_XIP is not set # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set # CONFIG_BLK_DEV_HD is not set # CONFIG_MISC_DEVICES is not set CONFIG_HAVE_IDE=y # CONFIG_IDE is not set # # SCSI device support # CONFIG_SCSI_MOD=y # CONFIG_RAID_ATTRS is not set CONFIG_SCSI=y CONFIG_SCSI_DMA=y # CONFIG_SCSI_TGT is not set # CONFIG_SCSI_NETLINK is not set CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y # CONFIG_CHR_DEV_ST is not set # CONFIG_CHR_DEV_OSST is not set # CONFIG_BLK_DEV_SR is not set CONFIG_CHR_DEV_SG=y # CONFIG_CHR_DEV_SCH is not set CONFIG_SCSI_MULTI_LUN=y # CONFIG_SCSI_CONSTANTS is not set CONFIG_SCSI_LOGGING=y # CONFIG_SCSI_SCAN_ASYNC is not set CONFIG_SCSI_WAIT_SCAN=m # # SCSI Transports # CONFIG_SCSI_SPI_ATTRS=m # CONFIG_SCSI_FC_ATTRS is not set # CONFIG_SCSI_ISCSI_ATTRS is not set # CONFIG_SCSI_SAS_LIBSAS is not set # CONFIG_SCSI_SRP_ATTRS is not set # CONFIG_SCSI_LOWLEVEL is not set # CONFIG_SCSI_DH is not set # CONFIG_SCSI_OSD_INITIATOR is not set CONFIG_ATA=y # CONFIG_ATA_NONSTANDARD is not set CONFIG_ATA_VERBOSE_ERROR=y CONFIG_SATA_PMP=y CONFIG_SATA_AHCI=y # CONFIG_SATA_SIL24 is not set CONFIG_ATA_SFF=y # CONFIG_SATA_SVW is not set CONFIG_ATA_PIIX=y # CONFIG_SATA_MV is not set # CONFIG_SATA_NV is not set # CONFIG_PDC_ADMA is not set # CONFIG_SATA_QSTOR is not set # CONFIG_SATA_PROMISE is not set # CONFIG_SATA_SX4 is not set # CONFIG_SATA_SIL is not set # CONFIG_SATA_SIS is not set # CONFIG_SATA_ULI is not set # CONFIG_SATA_VIA is not set # CONFIG_SATA_VITESSE is not set # CONFIG_SATA_INIC162X is not set # CONFIG_PATA_ALI is not set # CONFIG_PATA_AMD is not set # CONFIG_PATA_ARTOP is not set # CONFIG_PATA_ATP867X is not set # CONFIG_PATA_ATIIXP is not set # CONFIG_PATA_CMD640_PCI is not set # CONFIG_PATA_CMD64X is not set # CONFIG_PATA_CS5520 is not set # CONFIG_PATA_CS5530 is not set # CONFIG_PATA_CS5535 is not set # CONFIG_PATA_CS5536 is not set # CONFIG_PATA_CYPRESS is not set # CONFIG_PATA_EFAR is not set # CONFIG_ATA_GENERIC is not set # CONFIG_PATA_HPT366 is not set # CONFIG_PATA_HPT37X is not set # CONFIG_PATA_HPT3X2N is not set # CONFIG_PATA_HPT3X3 is not set # CONFIG_PATA_IT821X is not set # CONFIG_PATA_IT8213 is not set # CONFIG_PATA_JMICRON is not set # CONFIG_PATA_LEGACY is not set # CONFIG_PATA_TRIFLEX is not set # CONFIG_PATA_MARVELL is not set CONFIG_PATA_MPIIX=y # CONFIG_PATA_OLDPIIX is not set # CONFIG_PATA_NETCELL is not set # CONFIG_PATA_NINJA32 is not set # CONFIG_PATA_NS87410 is not set # CONFIG_PATA_NS87415 is not set # CONFIG_PATA_OPTI is not set # CONFIG_PATA_OPTIDMA is not set # CONFIG_PATA_PDC2027X is not set # CONFIG_PATA_PDC_OLD is not set # CONFIG_PATA_RADISYS is not set # CONFIG_PATA_RDC is not set # CONFIG_PATA_RZ1000 is not set # CONFIG_PATA_SC1200 is not set # CONFIG_PATA_SERVERWORKS is not set # CONFIG_PATA_SIL680 is not set # CONFIG_PATA_SIS is not set # CONFIG_PATA_TOSHIBA is not set # CONFIG_PATA_VIA is not set # CONFIG_PATA_WINBOND is not set # CONFIG_PATA_PLATFORM is not set # CONFIG_PATA_SCH is not set # CONFIG_MD is not set # CONFIG_FUSION is not set # # IEEE 1394 (FireWire) support # # # You can enable one or both FireWire driver stacks. # # # The newer stack is recommended. # # CONFIG_FIREWIRE is not set # CONFIG_IEEE1394 is not set # CONFIG_I2O is not set # CONFIG_MACINTOSH_DRIVERS is not set CONFIG_NETDEVICES=y CONFIG_DUMMY=m # CONFIG_BONDING is not set # CONFIG_MACVLAN is not set CONFIG_EQUALIZER=y CONFIG_TUN=m # CONFIG_VETH is not set # CONFIG_ARCNET is not set # CONFIG_PHYLIB is not set CONFIG_NET_ETHERNET=y CONFIG_MII=m # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_CASSINI is not set # CONFIG_NET_VENDOR_3COM is not set # CONFIG_ETHOC is not set # CONFIG_DNET is not set # CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set # CONFIG_IBM_NEW_EMAC_ZMII is not set # CONFIG_IBM_NEW_EMAC_RGMII is not set # CONFIG_IBM_NEW_EMAC_TAH is not set # CONFIG_IBM_NEW_EMAC_EMAC4 is not set # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set CONFIG_NET_PCI=y # CONFIG_PCNET32 is not set # CONFIG_AMD8111_ETH is not set # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_KSZ884X_PCI is not set # CONFIG_B44 is not set # CONFIG_FORCEDETH is not set CONFIG_E100=m # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set # CONFIG_NE2K_PCI is not set CONFIG_8139CP=m CONFIG_8139TOO=m CONFIG_8139TOO_PIO=y # CONFIG_8139TOO_TUNE_TWISTER is not set CONFIG_8139TOO_8129=y # CONFIG_8139_OLD_RX_RESET is not set # CONFIG_R6040 is not set CONFIG_SIS900=m # CONFIG_EPIC100 is not set # CONFIG_SMSC9420 is not set # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set # CONFIG_KS8842 is not set # CONFIG_KS8851_MLL is not set CONFIG_VIA_RHINE=m # CONFIG_VIA_RHINE_MMIO is not set # CONFIG_SC92031 is not set # CONFIG_ATL2 is not set CONFIG_NETDEV_1000=y # CONFIG_ACENIC is not set # CONFIG_DL2K is not set CONFIG_E1000=m CONFIG_E1000E=m # CONFIG_IP1000 is not set CONFIG_IGB=m # CONFIG_IGBVF is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set CONFIG_R8169=m # CONFIG_R8169_VLAN is not set CONFIG_SIS190=m # CONFIG_SKGE is not set # CONFIG_SKY2 is not set CONFIG_VIA_VELOCITY=m # CONFIG_TIGON3 is not set # CONFIG_BNX2 is not set # CONFIG_CNIC is not set # CONFIG_QLA3XXX is not set # CONFIG_ATL1 is not set # CONFIG_ATL1E is not set # CONFIG_ATL1C is not set # CONFIG_JME is not set # CONFIG_NETDEV_10000 is not set # CONFIG_TR is not set # CONFIG_WLAN is not set # # Enable WiMAX (Networking options) to see the WiMAX drivers # # # USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set # CONFIG_USB_USBNET is not set # CONFIG_USB_IPHETH is not set # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set # CONFIG_NET_FC is not set # CONFIG_NETCONSOLE is not set # CONFIG_NETPOLL is not set # CONFIG_NET_POLL_CONTROLLER is not set # CONFIG_VMXNET3 is not set # CONFIG_ISDN is not set # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # CONFIG_INPUT_FF_MEMLESS is not set # CONFIG_INPUT_POLLDEV is not set # CONFIG_INPUT_SPARSEKMAP is not set # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set CONFIG_INPUT_EVDEV=y # CONFIG_INPUT_EVBUG is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y # CONFIG_KEYBOARD_ADP5588 is not set CONFIG_KEYBOARD_ATKBD=y # CONFIG_QT2160 is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_MAX7359 is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_KEYBOARD_OPENCORES is not set # CONFIG_KEYBOARD_STOWAWAY is not set # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_XTKBD is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y CONFIG_MOUSE_PS2_ALPS=y CONFIG_MOUSE_PS2_LOGIPS2PP=y CONFIG_MOUSE_PS2_SYNAPTICS=y CONFIG_MOUSE_PS2_LIFEBOOK=y CONFIG_MOUSE_PS2_TRACKPOINT=y # CONFIG_MOUSE_PS2_ELANTECH is not set # CONFIG_MOUSE_PS2_SENTELIC is not set # CONFIG_MOUSE_PS2_TOUCHKIT is not set CONFIG_MOUSE_SERIAL=y # CONFIG_MOUSE_APPLETOUCH is not set # CONFIG_MOUSE_BCM5974 is not set # CONFIG_MOUSE_VSXXXAA is not set # CONFIG_MOUSE_SYNAPTICS_I2C is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TABLET is not set CONFIG_INPUT_TOUCHSCREEN=y # CONFIG_TOUCHSCREEN_AD7879_I2C is not set # CONFIG_TOUCHSCREEN_AD7879 is not set # CONFIG_TOUCHSCREEN_DYNAPRO is not set # CONFIG_TOUCHSCREEN_EETI is not set # CONFIG_TOUCHSCREEN_FUJITSU is not set # CONFIG_TOUCHSCREEN_GUNZE is not set CONFIG_TOUCHSCREEN_ELO=m # CONFIG_TOUCHSCREEN_WACOM_W8001 is not set # CONFIG_TOUCHSCREEN_MCS5000 is not set CONFIG_TOUCHSCREEN_MTOUCH=m # CONFIG_TOUCHSCREEN_INEXIO is not set # CONFIG_TOUCHSCREEN_MK712 is not set # CONFIG_TOUCHSCREEN_PENMOUNT is not set # CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set # CONFIG_TOUCHSCREEN_TOUCHWIN is not set # CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set # CONFIG_TOUCHSCREEN_TOUCHIT213 is not set # CONFIG_TOUCHSCREEN_TSC2007 is not set # CONFIG_INPUT_MISC is not set # # Hardware I/O ports # CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set CONFIG_SERIO_PCIPS2=y CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set # CONFIG_SERIO_ALTERA_PS2 is not set # CONFIG_GAMEPORT is not set # # Character devices # CONFIG_VT=y CONFIG_CONSOLE_TRANSLATIONS=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y CONFIG_VT_HW_CONSOLE_BINDING=y CONFIG_DEVKMEM=y # CONFIG_SERIAL_NONSTANDARD is not set # CONFIG_NOZOMI is not set # # Serial drivers # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_SERIAL_8250_PCI=y CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 CONFIG_SERIAL_8250_EXTENDED=y # CONFIG_SERIAL_8250_MANY_PORTS is not set CONFIG_SERIAL_8250_SHARE_IRQ=y CONFIG_SERIAL_8250_DETECT_IRQ=y # CONFIG_SERIAL_8250_RSA is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_JSM is not set # CONFIG_SERIAL_TIMBERDALE is not set CONFIG_UNIX98_PTYS=y # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_IPMI_HANDLER is not set CONFIG_HW_RANDOM=y # CONFIG_HW_RANDOM_TIMERIOMEM is not set CONFIG_HW_RANDOM_INTEL=y CONFIG_HW_RANDOM_AMD=y CONFIG_HW_RANDOM_GEODE=y CONFIG_HW_RANDOM_VIA=y CONFIG_NVRAM=y CONFIG_RTC=m # CONFIG_GEN_RTC is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # CONFIG_SONYPI is not set # CONFIG_MWAVE is not set # CONFIG_PC8736x_GPIO is not set # CONFIG_NSC_GPIO is not set # CONFIG_CS5535_GPIO is not set # CONFIG_RAW_DRIVER is not set # CONFIG_HANGCHECK_TIMER is not set # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set # CONFIG_I2C_CHARDEV is not set # CONFIG_I2C_HELPER_AUTO is not set # CONFIG_I2C_SMBUS is not set # # I2C Algorithms # CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_ALGOPCF is not set # CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support # # # PC SMBus host controller drivers # # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set # CONFIG_I2C_ALI15X3 is not set # CONFIG_I2C_AMD756 is not set # CONFIG_I2C_AMD8111 is not set CONFIG_I2C_I801=y CONFIG_I2C_ISCH=y CONFIG_I2C_PIIX4=y # CONFIG_I2C_NFORCE2 is not set # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # # I2C system bus drivers (mostly embedded / system-on-chip) # # CONFIG_I2C_OCORES is not set # CONFIG_I2C_SIMTEC is not set # CONFIG_I2C_XILINX is not set # # External I2C/SMBus adapter drivers # # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_TAOS_EVM is not set # CONFIG_I2C_TINY_USB is not set # # Other I2C/SMBus bus drivers # # CONFIG_I2C_PCA_PLATFORM is not set # CONFIG_I2C_STUB is not set # CONFIG_SCx200_ACB is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_SPI is not set # # PPS support # # CONFIG_PPS is not set CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y # CONFIG_GPIOLIB is not set # CONFIG_W1 is not set # CONFIG_POWER_SUPPLY is not set # CONFIG_HWMON is not set # CONFIG_THERMAL is not set # CONFIG_WATCHDOG is not set CONFIG_SSB_POSSIBLE=y # # Sonics Silicon Backplane # # CONFIG_SSB is not set # # Multifunction device drivers # CONFIG_MFD_CORE=y # CONFIG_MFD_88PM860X is not set # CONFIG_MFD_SM501 is not set # CONFIG_HTC_PASIC3 is not set # CONFIG_TWL4030_CORE is not set # CONFIG_MFD_TMIO is not set # CONFIG_PMIC_DA903X is not set # CONFIG_PMIC_ADP5520 is not set # CONFIG_MFD_MAX8925 is not set # CONFIG_MFD_WM8400 is not set # CONFIG_MFD_WM831X is not set # CONFIG_MFD_WM8350_I2C is not set # CONFIG_MFD_WM8994 is not set # CONFIG_MFD_PCF50633 is not set # CONFIG_AB3100_CORE is not set CONFIG_LPC_SCH=y # CONFIG_REGULATOR is not set # CONFIG_MEDIA_SUPPORT is not set # # Graphics support # CONFIG_AGP=y CONFIG_AGP_ALI=y CONFIG_AGP_ATI=y CONFIG_AGP_AMD=y # CONFIG_AGP_AMD64 is not set CONFIG_AGP_INTEL=y CONFIG_AGP_NVIDIA=y CONFIG_AGP_SIS=y CONFIG_AGP_SWORKS=y CONFIG_AGP_VIA=y # CONFIG_AGP_EFFICEON is not set CONFIG_VGA_ARB=y CONFIG_VGA_ARB_MAX_GPUS=16 CONFIG_DRM=y CONFIG_DRM_KMS_HELPER=m CONFIG_DRM_TTM=m CONFIG_DRM_TDFX=m CONFIG_DRM_R128=m CONFIG_DRM_RADEON=m # CONFIG_DRM_RADEON_KMS is not set CONFIG_DRM_I810=m CONFIG_DRM_I830=m CONFIG_DRM_I915=m CONFIG_DRM_I915_KMS=y CONFIG_DRM_MGA=m CONFIG_DRM_SIS=m CONFIG_DRM_VIA=m CONFIG_DRM_SAVAGE=m CONFIG_VGASTATE=m # CONFIG_VIDEO_OUTPUT_CONTROL is not set CONFIG_FB=m CONFIG_FIRMWARE_EDID=y CONFIG_FB_DDC=m # CONFIG_FB_BOOT_VESA_SUPPORT is not set CONFIG_FB_CFB_FILLRECT=m CONFIG_FB_CFB_COPYAREA=m CONFIG_FB_CFB_IMAGEBLIT=m # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set # CONFIG_FB_SYS_FILLRECT is not set # CONFIG_FB_SYS_COPYAREA is not set # CONFIG_FB_SYS_IMAGEBLIT is not set # CONFIG_FB_FOREIGN_ENDIAN is not set # CONFIG_FB_SYS_FOPS is not set # CONFIG_FB_SVGALIB is not set # CONFIG_FB_MACMODES is not set CONFIG_FB_BACKLIGHT=y CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_TILEBLITTING is not set # # Frame buffer hardware drivers # # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set # CONFIG_FB_ARC is not set # CONFIG_FB_VGA16 is not set # CONFIG_FB_N411 is not set # CONFIG_FB_HGA is not set # CONFIG_FB_S1D13XXX is not set CONFIG_FB_NVIDIA=m CONFIG_FB_NVIDIA_I2C=y # CONFIG_FB_NVIDIA_DEBUG is not set CONFIG_FB_NVIDIA_BACKLIGHT=y CONFIG_FB_RIVA=m CONFIG_FB_RIVA_I2C=y # CONFIG_FB_RIVA_DEBUG is not set CONFIG_FB_RIVA_BACKLIGHT=y CONFIG_FB_I810=m CONFIG_FB_I810_GTF=y CONFIG_FB_I810_I2C=y CONFIG_FB_LE80578=m CONFIG_FB_CARILLO_RANCH=m CONFIG_FB_INTEL=m # CONFIG_FB_INTEL_DEBUG is not set CONFIG_FB_INTEL_I2C=y # CONFIG_FB_MATROX is not set # CONFIG_FB_RADEON is not set # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY is not set # CONFIG_FB_S3 is not set # CONFIG_FB_SAVAGE is not set # CONFIG_FB_SIS is not set # CONFIG_FB_VIA is not set # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_3DFX is not set # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_VT8623 is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_ARK is not set # CONFIG_FB_PM3 is not set # CONFIG_FB_CARMINE is not set # CONFIG_FB_GEODE is not set # CONFIG_FB_TMIO is not set # CONFIG_FB_VIRTUAL is not set # CONFIG_FB_METRONOME is not set # CONFIG_FB_MB862XX is not set # CONFIG_FB_BROADSHEET is not set CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_LCD_CLASS_DEVICE=m # CONFIG_LCD_ILI9320 is not set # CONFIG_LCD_PLATFORM is not set CONFIG_BACKLIGHT_CLASS_DEVICE=m CONFIG_BACKLIGHT_GENERIC=m # CONFIG_BACKLIGHT_PROGEAR is not set # CONFIG_BACKLIGHT_CARILLO_RANCH is not set # CONFIG_BACKLIGHT_MBP_NVIDIA is not set # CONFIG_BACKLIGHT_SAHARA is not set # # Display device support # # CONFIG_DISPLAY_SUPPORT is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y # CONFIG_VGACON_SOFT_SCROLLBACK is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=m # CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y # CONFIG_LOGO is not set # CONFIG_SOUND is not set CONFIG_HID_SUPPORT=y CONFIG_HID=y # CONFIG_HIDRAW is not set # # USB Input Devices # CONFIG_USB_HID=m # CONFIG_HID_PID is not set # CONFIG_USB_HIDDEV is not set # # USB HID Boot Protocol drivers # # CONFIG_USB_KBD is not set # CONFIG_USB_MOUSE is not set # # Special HID drivers # # CONFIG_HID_3M_PCT is not set # CONFIG_HID_A4TECH is not set # CONFIG_HID_APPLE is not set # CONFIG_HID_BELKIN is not set # CONFIG_HID_CHERRY is not set # CONFIG_HID_CHICONY is not set # CONFIG_HID_CYPRESS is not set # CONFIG_HID_DRAGONRISE is not set # CONFIG_HID_EZKEY is not set # CONFIG_HID_KYE is not set # CONFIG_HID_GYRATION is not set # CONFIG_HID_TWINHAN is not set # CONFIG_HID_KENSINGTON is not set # CONFIG_HID_LOGITECH is not set # CONFIG_HID_MICROSOFT is not set # CONFIG_HID_MOSART is not set # CONFIG_HID_MONTEREY is not set # CONFIG_HID_NTRIG is not set # CONFIG_HID_ORTEK is not set # CONFIG_HID_PANTHERLORD is not set # CONFIG_HID_PETALYNX is not set # CONFIG_HID_QUANTA is not set # CONFIG_HID_SAMSUNG is not set # CONFIG_HID_SONY is not set # CONFIG_HID_STANTUM is not set # CONFIG_HID_SUNPLUS is not set # CONFIG_HID_GREENASIA is not set # CONFIG_HID_SMARTJOYPLUS is not set # CONFIG_HID_TOPSEED is not set # CONFIG_HID_THRUSTMASTER is not set # CONFIG_HID_ZEROPLUS is not set CONFIG_USB_SUPPORT=y CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y CONFIG_USB_ARCH_HAS_EHCI=y CONFIG_USB=y # CONFIG_USB_DEBUG is not set # CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set # # Miscellaneous USB options # # CONFIG_USB_DEVICEFS is not set # CONFIG_USB_DEVICE_CLASS is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_OTG_WHITELIST is not set # CONFIG_USB_OTG_BLACKLIST_HUB is not set # CONFIG_USB_MON is not set # CONFIG_USB_WUSB is not set # CONFIG_USB_WUSB_CBAF is not set # # USB Host Controller Drivers # # CONFIG_USB_C67X00_HCD is not set # CONFIG_USB_XHCI_HCD is not set CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_ROOT_HUB_TT=y # CONFIG_USB_EHCI_TT_NEWSCHED is not set # CONFIG_USB_OXU210HP_HCD is not set # CONFIG_USB_ISP116X_HCD is not set # CONFIG_USB_ISP1760_HCD is not set # CONFIG_USB_ISP1362_HCD is not set # CONFIG_USB_OHCI_HCD is not set CONFIG_USB_UHCI_HCD=m # CONFIG_USB_SL811_HCD is not set # CONFIG_USB_R8A66597_HCD is not set # CONFIG_USB_WHCI_HCD is not set # CONFIG_USB_HWA_HCD is not set # # USB Device Class drivers # # CONFIG_USB_ACM is not set CONFIG_USB_PRINTER=m # CONFIG_USB_WDM is not set # CONFIG_USB_TMC is not set # # NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may # # # also be needed; see USB_STORAGE Help for more info # CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_DATAFAB is not set # CONFIG_USB_STORAGE_FREECOM is not set # CONFIG_USB_STORAGE_ISD200 is not set # CONFIG_USB_STORAGE_USBAT is not set # CONFIG_USB_STORAGE_SDDR09 is not set # CONFIG_USB_STORAGE_SDDR55 is not set # CONFIG_USB_STORAGE_JUMPSHOT is not set # CONFIG_USB_STORAGE_ALAUDA is not set # CONFIG_USB_STORAGE_ONETOUCH is not set # CONFIG_USB_STORAGE_KARMA is not set # CONFIG_USB_STORAGE_CYPRESS_ATACB is not set # CONFIG_USB_LIBUSUAL is not set # # USB Imaging devices # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set # # USB port drivers # # CONFIG_USB_SERIAL is not set # # USB Miscellaneous drivers # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set # CONFIG_USB_ADUTUX is not set # CONFIG_USB_SEVSEG is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYPRESS_CY7C63 is not set # CONFIG_USB_CYTHERM is not set # CONFIG_USB_IDMOUSE is not set # CONFIG_USB_FTDI_ELAN is not set # CONFIG_USB_APPLEDISPLAY is not set # CONFIG_USB_SISUSBVGA is not set # CONFIG_USB_LD is not set # CONFIG_USB_TRANCEVIBRATOR is not set # CONFIG_USB_IOWARRIOR is not set # CONFIG_USB_TEST is not set # CONFIG_USB_ISIGHTFW is not set # CONFIG_USB_GADGET is not set # # OTG and related infrastructure # # CONFIG_NOP_USB_XCEIV is not set # CONFIG_UWB is not set # CONFIG_MMC is not set # CONFIG_MEMSTICK is not set # CONFIG_NEW_LEDS is not set # CONFIG_ACCESSIBILITY is not set # CONFIG_INFINIBAND is not set # CONFIG_EDAC is not set # CONFIG_RTC_CLASS is not set # CONFIG_DMADEVICES is not set # CONFIG_AUXDISPLAY is not set # CONFIG_UIO is not set # # TI VLYNQ # # CONFIG_STAGING is not set CONFIG_X86_PLATFORM_DEVICES=y # # Firmware Drivers # CONFIG_EDD=m # CONFIG_EDD_OFF is not set CONFIG_FIRMWARE_MEMMAP=y # CONFIG_DELL_RBU is not set # CONFIG_DCDBAS is not set CONFIG_DMIID=y # CONFIG_ISCSI_IBFT_FIND is not set # # File systems # CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y # CONFIG_EXT2_FS_SECURITY is not set # CONFIG_EXT2_FS_XIP is not set CONFIG_EXT3_FS=y # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y # CONFIG_EXT3_FS_SECURITY is not set # CONFIG_EXT4_FS is not set CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y # CONFIG_XFS_FS is not set # CONFIG_OCFS2_FS is not set # CONFIG_BTRFS_FS is not set # CONFIG_NILFS2_FS is not set CONFIG_FILE_LOCKING=y CONFIG_FSNOTIFY=y CONFIG_DNOTIFY=y CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y # CONFIG_QUOTA is not set CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m # CONFIG_FUSE_FS is not set # # Caches # # CONFIG_FSCACHE is not set # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=y CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_UDF_FS=m CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=y CONFIG_MSDOS_FS=y CONFIG_VFAT_FS=y CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_NTFS_FS=m # CONFIG_NTFS_DEBUG is not set # CONFIG_NTFS_RW is not set # # Pseudo filesystems # CONFIG_PROC_FS=y # CONFIG_PROC_KCORE is not set CONFIG_PROC_SYSCTL=y CONFIG_PROC_PAGE_MONITOR=y CONFIG_SYSFS=y CONFIG_TMPFS=y # CONFIG_TMPFS_POSIX_ACL is not set # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set # CONFIG_CONFIGFS_FS is not set CONFIG_MISC_FILESYSTEMS=y # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set # CONFIG_LOGFS is not set CONFIG_CRAMFS=y # CONFIG_SQUASHFS is not set # CONFIG_VXFS_FS is not set CONFIG_MINIX_FS=m # CONFIG_OMFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set CONFIG_ROMFS_FS=m CONFIG_ROMFS_BACKED_BY_BLOCK=y # CONFIG_ROMFS_BACKED_BY_MTD is not set # CONFIG_ROMFS_BACKED_BY_BOTH is not set CONFIG_ROMFS_ON_BLOCK=y # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set CONFIG_NETWORK_FILESYSTEMS=y CONFIG_NFS_FS=y CONFIG_NFS_V3=y # CONFIG_NFS_V3_ACL is not set # CONFIG_NFS_V4 is not set # CONFIG_NFSD is not set CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_NFS_COMMON=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_CEPH_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # # Partition Types # CONFIG_PARTITION_ADVANCED=y # CONFIG_ACORN_PARTITION is not set # CONFIG_OSF_PARTITION is not set # CONFIG_AMIGA_PARTITION is not set # CONFIG_ATARI_PARTITION is not set # CONFIG_MAC_PARTITION is not set CONFIG_MSDOS_PARTITION=y CONFIG_BSD_DISKLABEL=y CONFIG_MINIX_SUBPARTITION=y CONFIG_SOLARIS_X86_PARTITION=y CONFIG_UNIXWARE_DISKLABEL=y CONFIG_LDM_PARTITION=y # CONFIG_LDM_DEBUG is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set # CONFIG_SUN_PARTITION is not set # CONFIG_KARMA_PARTITION is not set # CONFIG_EFI_PARTITION is not set # CONFIG_SYSV68_PARTITION is not set CONFIG_NLS=y CONFIG_NLS_DEFAULT="cp437" CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_737=y CONFIG_NLS_CODEPAGE_775=y CONFIG_NLS_CODEPAGE_850=y CONFIG_NLS_CODEPAGE_852=y CONFIG_NLS_CODEPAGE_855=y CONFIG_NLS_CODEPAGE_857=y CONFIG_NLS_CODEPAGE_860=y CONFIG_NLS_CODEPAGE_861=y CONFIG_NLS_CODEPAGE_862=y CONFIG_NLS_CODEPAGE_863=y CONFIG_NLS_CODEPAGE_864=y CONFIG_NLS_CODEPAGE_865=y CONFIG_NLS_CODEPAGE_866=y CONFIG_NLS_CODEPAGE_869=y CONFIG_NLS_CODEPAGE_936=y # CONFIG_NLS_CODEPAGE_950 is not set # CONFIG_NLS_CODEPAGE_932 is not set # CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set CONFIG_NLS_ISO8859_8=y CONFIG_NLS_CODEPAGE_1250=y CONFIG_NLS_CODEPAGE_1251=y # CONFIG_NLS_ASCII is not set CONFIG_NLS_ISO8859_1=y CONFIG_NLS_ISO8859_2=y CONFIG_NLS_ISO8859_3=y CONFIG_NLS_ISO8859_4=y CONFIG_NLS_ISO8859_5=y CONFIG_NLS_ISO8859_6=y CONFIG_NLS_ISO8859_7=y CONFIG_NLS_ISO8859_9=y CONFIG_NLS_ISO8859_13=y CONFIG_NLS_ISO8859_14=y CONFIG_NLS_ISO8859_15=y CONFIG_NLS_KOI8_R=y CONFIG_NLS_KOI8_U=y CONFIG_NLS_UTF8=y # CONFIG_DLM is not set # # Kernel hacking # CONFIG_TRACE_IRQFLAGS_SUPPORT=y # CONFIG_PRINTK_TIME is not set CONFIG_ENABLE_WARN_DEPRECATED=y CONFIG_ENABLE_MUST_CHECK=y CONFIG_FRAME_WARN=1024 # CONFIG_MAGIC_SYSRQ is not set # CONFIG_STRIP_ASM_SYMS is not set CONFIG_UNUSED_SYMBOLS=y CONFIG_DEBUG_FS=y # CONFIG_HEADERS_CHECK is not set # CONFIG_IPIPE_DEBUG is not set # CONFIG_DEBUG_KERNEL is not set CONFIG_TRACE_IRQFLAGS=y CONFIG_STACKTRACE=y CONFIG_DEBUG_BUGVERBOSE=y # CONFIG_DEBUG_MEMORY_INIT is not set CONFIG_ARCH_WANT_FRAME_POINTERS=y CONFIG_FRAME_POINTER=y # CONFIG_RCU_CPU_STALL_DETECTOR is not set # CONFIG_LKDTM is not set # CONFIG_LATENCYTOP is not set # CONFIG_SYSCTL_SYSCALL_CHECK is not set CONFIG_USER_STACKTRACE_SUPPORT=y CONFIG_NOP_TRACER=y CONFIG_HAVE_FTRACE_NMI_ENTER=y CONFIG_HAVE_FUNCTION_TRACER=y CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y CONFIG_HAVE_DYNAMIC_FTRACE=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_TRACER_MAX_TRACE=y CONFIG_RING_BUFFER=y CONFIG_FTRACE_NMI_ENTER=y CONFIG_EVENT_TRACING=y CONFIG_CONTEXT_SWITCH_TRACER=y CONFIG_RING_BUFFER_ALLOW_SWAP=y CONFIG_TRACING=y CONFIG_GENERIC_TRACER=y CONFIG_TRACING_SUPPORT=y CONFIG_FTRACE=y CONFIG_FUNCTION_TRACER=y CONFIG_FUNCTION_GRAPH_TRACER=y CONFIG_IRQSOFF_TRACER=y CONFIG_PREEMPT_TRACER=y # CONFIG_SYSPROF_TRACER is not set CONFIG_SCHED_TRACER=y CONFIG_FTRACE_SYSCALLS=y # CONFIG_BOOT_TRACER is not set CONFIG_BRANCH_PROFILE_NONE=y # CONFIG_PROFILE_ANNOTATED_BRANCHES is not set # CONFIG_PROFILE_ALL_BRANCHES is not set # CONFIG_KSYM_TRACER is not set # CONFIG_STACK_TRACER is not set # CONFIG_KMEMTRACE is not set # CONFIG_WORKQUEUE_TRACER is not set # CONFIG_BLK_DEV_IO_TRACE is not set CONFIG_DYNAMIC_FTRACE=y # CONFIG_FUNCTION_PROFILER is not set CONFIG_FTRACE_MCOUNT_RECORD=y # CONFIG_FTRACE_STARTUP_TEST is not set # CONFIG_MMIOTRACE is not set # CONFIG_RING_BUFFER_BENCHMARK is not set # CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set # CONFIG_DYNAMIC_DEBUG is not set # CONFIG_DMA_API_DEBUG is not set # CONFIG_SAMPLES is not set CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_KMEMCHECK=y # CONFIG_STRICT_DEVMEM is not set CONFIG_X86_VERBOSE_BOOTUP=y CONFIG_EARLY_PRINTK=y # CONFIG_EARLY_PRINTK_DBGP is not set # CONFIG_4KSTACKS is not set CONFIG_DOUBLEFAULT=y # CONFIG_IOMMU_STRESS is not set CONFIG_HAVE_MMIOTRACE_SUPPORT=y CONFIG_IO_DELAY_TYPE_0X80=0 CONFIG_IO_DELAY_TYPE_0XED=1 CONFIG_IO_DELAY_TYPE_UDELAY=2 CONFIG_IO_DELAY_TYPE_NONE=3 CONFIG_IO_DELAY_0X80=y # CONFIG_IO_DELAY_0XED is not set # CONFIG_IO_DELAY_UDELAY is not set # CONFIG_IO_DELAY_NONE is not set CONFIG_DEFAULT_IO_DELAY_TYPE=0 # CONFIG_OPTIMIZE_INLINING is not set # # Security options # # CONFIG_KEYS is not set # CONFIG_SECURITY is not set # CONFIG_SECURITYFS is not set # CONFIG_DEFAULT_SECURITY_SELINUX is not set # CONFIG_DEFAULT_SECURITY_SMACK is not set # CONFIG_DEFAULT_SECURITY_TOMOYO is not set CONFIG_DEFAULT_SECURITY_DAC=y CONFIG_DEFAULT_SECURITY="" CONFIG_CRYPTO=y # # Crypto core or helper # CONFIG_CRYPTO_ALGAPI=y CONFIG_CRYPTO_ALGAPI2=y CONFIG_CRYPTO_AEAD=m CONFIG_CRYPTO_AEAD2=y CONFIG_CRYPTO_BLKCIPHER=m CONFIG_CRYPTO_BLKCIPHER2=y CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_HASH2=y CONFIG_CRYPTO_RNG2=y CONFIG_CRYPTO_PCOMP=y CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_MANAGER2=y # CONFIG_CRYPTO_GF128MUL is not set CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_WORKQUEUE=y # CONFIG_CRYPTO_CRYPTD is not set CONFIG_CRYPTO_AUTHENC=m CONFIG_CRYPTO_TEST=m # # Authenticated Encryption with Associated Data # # CONFIG_CRYPTO_CCM is not set # CONFIG_CRYPTO_GCM is not set # CONFIG_CRYPTO_SEQIV is not set # # Block modes # CONFIG_CRYPTO_CBC=m # CONFIG_CRYPTO_CTR is not set # CONFIG_CRYPTO_CTS is not set # CONFIG_CRYPTO_ECB is not set # CONFIG_CRYPTO_LRW is not set # CONFIG_CRYPTO_PCBC is not set # CONFIG_CRYPTO_XTS is not set # # Hash modes # CONFIG_CRYPTO_HMAC=y # CONFIG_CRYPTO_XCBC is not set # CONFIG_CRYPTO_VMAC is not set # # Digest # CONFIG_CRYPTO_CRC32C=m # CONFIG_CRYPTO_CRC32C_INTEL is not set # CONFIG_CRYPTO_GHASH is not set CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD5=m # CONFIG_CRYPTO_MICHAEL_MIC is not set # CONFIG_CRYPTO_RMD128 is not set # CONFIG_CRYPTO_RMD160 is not set # CONFIG_CRYPTO_RMD256 is not set # CONFIG_CRYPTO_RMD320 is not set CONFIG_CRYPTO_SHA1=m CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m # CONFIG_CRYPTO_TGR192 is not set # CONFIG_CRYPTO_WP512 is not set # # Ciphers # # CONFIG_CRYPTO_AES is not set # CONFIG_CRYPTO_AES_586 is not set # CONFIG_CRYPTO_ANUBIS is not set CONFIG_CRYPTO_ARC4=m CONFIG_CRYPTO_BLOWFISH=m # CONFIG_CRYPTO_CAMELLIA is not set CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m CONFIG_CRYPTO_DES=m # CONFIG_CRYPTO_FCRYPT is not set # CONFIG_CRYPTO_KHAZAD is not set # CONFIG_CRYPTO_SALSA20 is not set # CONFIG_CRYPTO_SALSA20_586 is not set # CONFIG_CRYPTO_SEED is not set CONFIG_CRYPTO_SERPENT=m # CONFIG_CRYPTO_TEA is not set CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_TWOFISH_COMMON=m # CONFIG_CRYPTO_TWOFISH_586 is not set # # Compression # CONFIG_CRYPTO_DEFLATE=m # CONFIG_CRYPTO_ZLIB is not set # CONFIG_CRYPTO_LZO is not set # # Random Number Generation # # CONFIG_CRYPTO_ANSI_CPRNG is not set # CONFIG_CRYPTO_HW is not set CONFIG_HAVE_KVM=y # CONFIG_VIRTUALIZATION is not set CONFIG_BINARY_PRINTF=y # # Library routines # CONFIG_BITREVERSE=y CONFIG_GENERIC_FIND_FIRST_BIT=y CONFIG_GENERIC_FIND_NEXT_BIT=y CONFIG_GENERIC_FIND_LAST_BIT=y CONFIG_CRC_CCITT=m # CONFIG_CRC16 is not set # CONFIG_CRC_T10DIF is not set CONFIG_CRC_ITU_T=m CONFIG_CRC32=y # CONFIG_CRC7 is not set CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT=y CONFIG_HAS_DMA=y CONFIG_NLATTR=y From sancelot at free.fr Tue May 21 05:54:42 2013 From: sancelot at free.fr (=?ISO-8859-1?Q?St=E9phane_ANCELOT?=) Date: Tue, 21 May 2013 11:54:42 +0200 Subject: [lttng-dev] newbie and kernel trace In-Reply-To: References: <519645B2.5090709@free.fr> Message-ID: <519B4462.2030103@free.fr> Hi, I have read the Documentation/trace/tracepoints.txt file. I modified my code to acknowledge it. I am again unable to list my tracepoints using lttng list . (I also tried lttng enable-channel before...). So , only one step I have not made : Is it mandatory to register the probe functions ??? Regards, S.Ancelot On 17/05/2013 17:13, J?r?mie Galarneau wrote: > Hi St?phane, > > We're going to need more details than that. Which kernel version are you using? > Can you see the other kernel events in your trace? If not, can you > show us how you are setting up your session? > > Thanks, > J?r?mie > > On Fri, May 17, 2013 at 10:58 AM, St?phane ANCELOT wrote: >> Hi, >> >> I am trying to reimplement LTTNG 2. in xenomai api. >> >> the main problem is that I do not sea any of my new events available in >> lttng 2. >> >> >> my kernel compiles fine and here is what I done to set it up : >> >> file include/trace/events/pod.h : >> >> #undef TRACE_SYSTEM >> #define TRACE_SYSTEM xenotrace >> >> #if !defined(_XENOTRACE_H) || defined(TRACE_HEADER_MULTI_READ) >> >> #define _XENOTRACE_H >> >> #include >> >> >> TRACE_EVENT( xn_nucleus_thread_init, >> TP_PROTO(struct xnthread *thread,char *thread_name,xnflags_t >> flags,const char *class,int prio), >> TP_ARGS(thread,thread_name,flags,class,prio), >> >> TP_STRUCT__entry( >> __field(struct xnthread *,thread) >> __array(char ,thread_name, XNOBJECT_NAME_LEN ) >> __field(xnflags_t,flags) >> __array(char,class, XNOBJECT_NAME_LEN ) >> __field(int, prio ) >> ), >> >> TP_fast_assign( >> __entry->thread = thread; >> memcpy(__entry->thread_name,thread_name, XNOBJECT_NAME_LEN); >> __entry->flags = flags; >> memcpy(__entry->class,class, XNOBJECT_NAME_LEN); >> __entry->prio = prio; >> ), >> >> TP_printk("thread %p thread_name %s flags %lu class %s prio >> %d", >> __entry->thread, __entry->thread_name, >> __entry->flags,__entry->class, >> __entry->prio) >> ); >> >> #endif >> >> /* This part must be outside protection */ >> #include >> >> >> >> in pod.h : >> #define CREATE_TRACE_POINTS >> #include >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > From ionut5001 at gmail.com Tue May 21 06:26:25 2013 From: ionut5001 at gmail.com (Ionut D.) Date: Tue, 21 May 2013 13:26:25 +0300 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: 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? In file included from external/lttng-tools/src/common/compat/compat-fcntl.c:19: external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: In function 'splice': external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: error: '__NR_splice' undeclared (first use in this function) external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: error: (Each undeclared identifier is reported only once external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: error: for each function it appears in.) In file included from external/lttng-tools/src/common/compat/compat-fcntl.c:19: external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: warning: "POSIX_FADV_DONTNEED" redefined In file included from external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, from external/lttng-tools/src/common/compat/compat-fcntl.c:19: bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is the location of the previous definition In file included from bionic/libc/include/sys/select.h:34, from bionic/libc/include/unistd.h:34, from external/lttng-tools/src/common/compat/compat-fcntl.c:20: external/lttng-tools/src/common/compat/signal.h: At top level: external/lttng-tools/src/common/compat/signal.h:27: error: expected ';', ',' or ')' before '*' token external/lttng-tools/src/common/compat/signal.h:28: error: expected ';', ',' or ')' before '*' token external/lttng-tools/src/common/compat/signal.h:29: error: expected ';', ',' or ')' before '*' token In file included from bionic/libc/include/unistd.h:34, from external/lttng-tools/src/common/compat/compat-fcntl.c:20: bionic/libc/include/sys/select.h:42: error: expected ';', ',' or ')' before '*' token On Sat, May 18, 2013 at 10:21 AM, Ionut D. wrote: > Great informations! I will post back the results. > > > On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < > pierre-luc.st-charles at polymtl.ca> wrote: > >> Alright, small update for all following a quick (non-mailing-list) >> exchange: >> >> 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 here; >> still not perfect). >> >> 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). >> >> 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). >> >> 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). >> >> 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. >> >> So, simple 'how do I put LTTng on Android' workflow would be this: >> >> - Compile modules (using NDK) against device's kernel, making sure its >> config is appropriate, ship them over via ADB >> >> - Compile required external libraries (using repo build system) for the >> device, ship them over via ADB >> >> - 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) >> >> - Cross-compile LTTng-* for the device (using NDK), ship binaries over >> via ADB >> >> Then, on the device, start up the sessiond manually & start tracing. >> >> >> I think I went over everything, but if there's a part that's still >> cloudy, don't hesitate. >> >> >> -PL >> >> >> On May 17, 2013 1:32 AM, "Ionut D." wrote: >> >>> Hello all, >>> >>> 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. >>> >>> 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. >>> >>> It is ok? what I am trying to do ? to integrate and build by using the >>> Android build system. >>> 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 ? >>> >>> 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. >>> >>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>> >>> Would be great if you will give me a tutorial about how to do it. >>> >>> Ionut >>> >>> _______________________________________________ >>> lttng-dev mailing list >>> lttng-dev at lists.lttng.org >>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierre-luc.st-charles at polymtl.ca Tue May 21 10:15:59 2013 From: pierre-luc.st-charles at polymtl.ca (Pierre-Luc St-Charles) Date: Tue, 21 May 2013 10:15:59 -0400 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: 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. 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. 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? -PL On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: > 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? > > > In file included from > external/lttng-tools/src/common/compat/compat-fcntl.c:19: > external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: > In function 'splice': > external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: > error: '__NR_splice' undeclared (first use in this function) > external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: > error: (Each undeclared identifier is reported only once > external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: > error: for each function it appears in.) > In file included from > external/lttng-tools/src/common/compat/compat-fcntl.c:19: > external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: > warning: "POSIX_FADV_DONTNEED" redefined > In file included from > external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, > from > external/lttng-tools/src/common/compat/compat-fcntl.c:19: > bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is the > location of the previous definition > In file included from bionic/libc/include/sys/select.h:34, > from bionic/libc/include/unistd.h:34, > from > external/lttng-tools/src/common/compat/compat-fcntl.c:20: > external/lttng-tools/src/common/compat/signal.h: At top level: > external/lttng-tools/src/common/compat/signal.h:27: error: expected ';', > ',' or ')' before '*' token > external/lttng-tools/src/common/compat/signal.h:28: error: expected ';', > ',' or ')' before '*' token > external/lttng-tools/src/common/compat/signal.h:29: error: expected ';', > ',' or ')' before '*' token > In file included from bionic/libc/include/unistd.h:34, > from > external/lttng-tools/src/common/compat/compat-fcntl.c:20: > bionic/libc/include/sys/select.h:42: error: expected ';', ',' or ')' > before '*' token > > > > On Sat, May 18, 2013 at 10:21 AM, Ionut D. wrote: > >> Great informations! I will post back the results. >> >> >> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >> pierre-luc.st-charles at polymtl.ca> wrote: >> >>> Alright, small update for all following a quick (non-mailing-list) >>> exchange: >>> >>> 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 here; >>> still not perfect). >>> >>> 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). >>> >>> 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). >>> >>> 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). >>> >>> 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. >>> >>> So, simple 'how do I put LTTng on Android' workflow would be this: >>> >>> - Compile modules (using NDK) against device's kernel, making sure its >>> config is appropriate, ship them over via ADB >>> >>> - Compile required external libraries (using repo build system) for >>> the device, ship them over via ADB >>> >>> - 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) >>> >>> - Cross-compile LTTng-* for the device (using NDK), ship binaries over >>> via ADB >>> >>> Then, on the device, start up the sessiond manually & start tracing. >>> >>> >>> I think I went over everything, but if there's a part that's still >>> cloudy, don't hesitate. >>> >>> >>> -PL >>> >>> >>> On May 17, 2013 1:32 AM, "Ionut D." wrote: >>> >>>> Hello all, >>>> >>>> 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. >>>> >>>> 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. >>>> >>>> It is ok? what I am trying to do ? to integrate and build by using the >>>> Android build system. >>>> 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 ? >>>> >>>> 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. >>>> >>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>> >>>> Would be great if you will give me a tutorial about how to do it. >>>> >>>> Ionut >>>> >>>> _______________________________________________ >>>> lttng-dev mailing list >>>> lttng-dev at lists.lttng.org >>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>> >>>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ionut5001 at gmail.com Tue May 21 11:29:06 2013 From: ionut5001 at gmail.com (Ionut D.) Date: Tue, 21 May 2013 18:29:06 +0300 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: 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: NDK: #grep -r __NR_splice . ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define __NR_splice 313 ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define __NR_splice 313 bionic: grep -r __NR_splice bionic bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice 313 bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice 341 bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice 313 Looking through results I see that '__NR_splice' it not in unistd.h and I know this is important. Ionut On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < pierre-luc.st-charles at polymtl.ca> wrote: > 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. > > 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. > > 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? > > -PL > > > On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: > >> 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? >> >> >> In file included from >> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >> In function 'splice': >> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >> error: '__NR_splice' undeclared (first use in this function) >> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >> error: (Each undeclared identifier is reported only once >> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >> error: for each function it appears in.) >> In file included from >> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >> warning: "POSIX_FADV_DONTNEED" redefined >> In file included from >> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >> from >> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is the >> location of the previous definition >> In file included from bionic/libc/include/sys/select.h:34, >> from bionic/libc/include/unistd.h:34, >> from >> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >> external/lttng-tools/src/common/compat/signal.h: At top level: >> external/lttng-tools/src/common/compat/signal.h:27: error: expected ';', >> ',' or ')' before '*' token >> external/lttng-tools/src/common/compat/signal.h:28: error: expected ';', >> ',' or ')' before '*' token >> external/lttng-tools/src/common/compat/signal.h:29: error: expected ';', >> ',' or ')' before '*' token >> In file included from bionic/libc/include/unistd.h:34, >> from >> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >> bionic/libc/include/sys/select.h:42: error: expected ';', ',' or ')' >> before '*' token >> >> >> >> On Sat, May 18, 2013 at 10:21 AM, Ionut D. wrote: >> >>> Great informations! I will post back the results. >>> >>> >>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>> pierre-luc.st-charles at polymtl.ca> wrote: >>> >>>> Alright, small update for all following a quick (non-mailing-list) >>>> exchange: >>>> >>>> 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 here; >>>> still not perfect). >>>> >>>> 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). >>>> >>>> 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). >>>> >>>> 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). >>>> >>>> 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. >>>> >>>> So, simple 'how do I put LTTng on Android' workflow would be this: >>>> >>>> - Compile modules (using NDK) against device's kernel, making sure >>>> its config is appropriate, ship them over via ADB >>>> >>>> - Compile required external libraries (using repo build system) for >>>> the device, ship them over via ADB >>>> >>>> - 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) >>>> >>>> - Cross-compile LTTng-* for the device (using NDK), ship binaries >>>> over via ADB >>>> >>>> Then, on the device, start up the sessiond manually & start tracing. >>>> >>>> >>>> I think I went over everything, but if there's a part that's still >>>> cloudy, don't hesitate. >>>> >>>> >>>> -PL >>>> >>>> >>>> On May 17, 2013 1:32 AM, "Ionut D." wrote: >>>> >>>>> Hello all, >>>>> >>>>> 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. >>>>> >>>>> 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. >>>>> >>>>> It is ok? what I am trying to do ? to integrate and build by using the >>>>> Android build system. >>>>> 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 ? >>>>> >>>>> 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. >>>>> >>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>> >>>>> Would be great if you will give me a tutorial about how to do it. >>>>> >>>>> Ionut >>>>> >>>>> _______________________________________________ >>>>> lttng-dev mailing list >>>>> lttng-dev at lists.lttng.org >>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>> >>>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierre-luc.st-charles at polymtl.ca Tue May 21 14:26:34 2013 From: pierre-luc.st-charles at polymtl.ca (Pierre-Luc St-Charles) Date: Tue, 21 May 2013 14:26:34 -0400 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: 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). On Tue, May 21, 2013 at 11:29 AM, Ionut D. wrote: > 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: > > NDK: > #grep -r __NR_splice . > ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define > __NR_splice 313 > ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define > __NR_splice 313 > > bionic: > grep -r __NR_splice bionic > bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice 313 > bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice 341 > bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice 313 > > Looking through results I see that '__NR_splice' it not in unistd.h and I > know this is important. > > Ionut > > > On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < > pierre-luc.st-charles at polymtl.ca> wrote: > >> 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. >> >> 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. >> >> 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? >> >> -PL >> >> >> On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: >> >>> 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? >>> >>> >>> In file included from >>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >>> In function 'splice': >>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>> error: '__NR_splice' undeclared (first use in this function) >>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>> error: (Each undeclared identifier is reported only once >>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>> error: for each function it appears in.) >>> In file included from >>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >>> warning: "POSIX_FADV_DONTNEED" redefined >>> In file included from >>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >>> from >>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is the >>> location of the previous definition >>> In file included from bionic/libc/include/sys/select.h:34, >>> from bionic/libc/include/unistd.h:34, >>> from >>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>> external/lttng-tools/src/common/compat/signal.h: At top level: >>> external/lttng-tools/src/common/compat/signal.h:27: error: expected ';', >>> ',' or ')' before '*' token >>> external/lttng-tools/src/common/compat/signal.h:28: error: expected ';', >>> ',' or ')' before '*' token >>> external/lttng-tools/src/common/compat/signal.h:29: error: expected ';', >>> ',' or ')' before '*' token >>> In file included from bionic/libc/include/unistd.h:34, >>> from >>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>> bionic/libc/include/sys/select.h:42: error: expected ';', ',' or ')' >>> before '*' token >>> >>> >>> >>> On Sat, May 18, 2013 at 10:21 AM, Ionut D. wrote: >>> >>>> Great informations! I will post back the results. >>>> >>>> >>>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>> >>>>> Alright, small update for all following a quick (non-mailing-list) >>>>> exchange: >>>>> >>>>> 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 >>>>> here; >>>>> still not perfect). >>>>> >>>>> 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). >>>>> >>>>> 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). >>>>> >>>>> 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). >>>>> >>>>> 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. >>>>> >>>>> So, simple 'how do I put LTTng on Android' workflow would be this: >>>>> >>>>> - Compile modules (using NDK) against device's kernel, making sure >>>>> its config is appropriate, ship them over via ADB >>>>> >>>>> - Compile required external libraries (using repo build system) for >>>>> the device, ship them over via ADB >>>>> >>>>> - 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) >>>>> >>>>> - Cross-compile LTTng-* for the device (using NDK), ship binaries >>>>> over via ADB >>>>> >>>>> Then, on the device, start up the sessiond manually & start tracing. >>>>> >>>>> >>>>> I think I went over everything, but if there's a part that's still >>>>> cloudy, don't hesitate. >>>>> >>>>> >>>>> -PL >>>>> >>>>> >>>>> On May 17, 2013 1:32 AM, "Ionut D." wrote: >>>>> >>>>>> Hello all, >>>>>> >>>>>> 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. >>>>>> >>>>>> 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. >>>>>> >>>>>> It is ok? what I am trying to do ? to integrate and build by using >>>>>> the Android build system. >>>>>> 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 ? >>>>>> >>>>>> 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. >>>>>> >>>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>>> >>>>>> Would be great if you will give me a tutorial about how to do it. >>>>>> >>>>>> Ionut >>>>>> >>>>>> _______________________________________________ >>>>>> lttng-dev mailing list >>>>>> lttng-dev at lists.lttng.org >>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>> >>>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jp_ikaheimonen at mentor.com Wed May 22 04:04:58 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:04:58 +0000 Subject: [lttng-dev] [Babeltrace PATCH 00/23] Add MinGW32 libraries to executables Message-ID: <009B25148989C6458484484699278506E5382EC1@EU-MBX-01.mgc.mentorg.com> Hi, here is the new patch set that makes it possible to compile Babeltrace on MinGW32. I have taken your previous comments into account wherever possible. This patch set requires the patch I sent earlier, titled " [Babeltrace PATCH 01/01] Move strerror_r to compat directory " , and should be applied on top of that. Some notes: MinGW, especially MinGW32, is very lacking in library functions. (Indeed, 'minimal'). Some functions that are found in Microsoft Visual Studio run time libraries are not accessible in MinGW32. These include any *_s functions such as strerror_s, gmtime_s, localtime_s and strtok_s; also strnlen is conspicuously missing. No byte-swapping function, either. It would have been possible to link to those functions dynamically, finding the function address from the DLL etc, but I'm not doing it, because in the end, my goal is to create a statically linked tool, with minimal dependencies to shared libraries. That is why, instead of using a well-known library function, I have resorted to implementing one on my own. I'm still open for any comments that you might have. Thanks, JP Ikaheimonen | SW Development Engineer http://go.mentor.com/sourceryanalyzer Mentor Embedded(tm) | Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. From jp_ikaheimonen at mentor.com Wed May 22 04:05:09 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:05:09 +0000 Subject: [lttng-dev] [Babeltrace PATCH 01/23] Add MinGW32 libraries to executables Message-ID: <009B25148989C6458484484699278506E5382EC9@EU-MBX-01.mgc.mentorg.com> Make configure.ac aware of MinGW, and set up a variable we can use in make files. Under MinGW, add platform specific libraries to all link commands. --- configure.ac | 9 +++++++++ converter/Makefile.am | 5 +++++ formats/ctf/metadata/Makefile.am | 3 +++ 3 files changed, 17 insertions(+) diff --git a/configure.ac b/configure.ac index 83822d6..17efc87 100644 --- a/configure.ac +++ b/configure.ac @@ -37,6 +37,15 @@ AC_FUNC_MALLOC AC_FUNC_MMAP AC_CHECK_FUNCS([bzero gettimeofday munmap strtoul]) +# Check for MinGW32. +MINGW32=no +case $host in + *-*-mingw*) + MINGW32=yes;; +esac + +AM_CONDITIONAL([BABELTRACE_BUILD_WITH_MINGW], [test "x$MINGW32" = "xyes"]) + # Check for libuuid AC_CHECK_LIB([uuid], [uuid_generate], [ diff --git a/converter/Makefile.am b/converter/Makefile.am index de70313..8ef71a2 100644 --- a/converter/Makefile.am +++ b/converter/Makefile.am @@ -29,3 +29,8 @@ endif if BABELTRACE_BUILD_WITH_LIBC_UUID babeltrace_log_LDADD += -lc endif + +if BABELTRACE_BUILD_WITH_MINGW +babeltrace_log_LDADD += -lrpcrt4 -lintl -liconv -lole32 -lpopt -lpthread +babeltrace_LDADD += -lrpcrt4 -lintl -liconv -lole32 -lpopt -lpthread +endif diff --git a/formats/ctf/metadata/Makefile.am b/formats/ctf/metadata/Makefile.am index b33ce55..69f7127 100644 --- a/formats/ctf/metadata/Makefile.am +++ b/formats/ctf/metadata/Makefile.am @@ -27,6 +27,9 @@ endif if BABELTRACE_BUILD_WITH_LIBC_UUID libctf_ast_la_LIBADD += -lc endif +if BABELTRACE_BUILD_WITH_MINGW +libctf_ast_la_LIBADD += -lrpcrt4 -lintl -liconv -lole32 -lpopt +endif noinst_PROGRAMS = ctf-parser-test ctf_parser_test_SOURCES = ctf-parser-test.c -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:05:24 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:05:24 +0000 Subject: [lttng-dev] [Babeltrace PATCH 02/23] Add Windows exe files to .gitignore Message-ID: <009B25148989C6458484484699278506E5382ED5@EU-MBX-01.mgc.mentorg.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 752308e..dab17d3 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ core formats/ctf/metadata/ctf-parser.output stamp-h1 babeltrace.pc +*.exe -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:05:35 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:05:35 +0000 Subject: [lttng-dev] [Babeltrace PATCH 03/23] Add MinGW implementation of UUID functions Message-ID: <009B25148989C6458484484699278506E5382EED@EU-MBX-01.mgc.mentorg.com> Add implementation of the UUID functions for MinGW. The Windows UUID standard has a different endian from what we expect, so also do endian conversion for the UUID data types as needed. Add the MinGW implementation file to the build system. In configure.ac, assume that MinGW UUID functions exist. --- Makefile.am | 2 +- compat/Makefile.am | 12 ++++++ compat/compat_uuid.c | 80 ++++++++++++++++++++++++++++++++++++++++ configure.ac | 6 ++- converter/Makefile.am | 4 +- include/babeltrace/compat/uuid.h | 39 ++++++++++++++++++-- lib/Makefile.am | 3 +- 7 files changed, 138 insertions(+), 8 deletions(-) create mode 100644 compat/Makefile.am create mode 100644 compat/compat_uuid.c diff --git a/Makefile.am b/Makefile.am index b25b58f..cdfad5a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = include types lib formats converter tests doc extras +SUBDIRS = include types compat lib formats converter tests doc extras dist_doc_DATA = ChangeLog LICENSE mit-license.txt gpl-2.0.txt \ std-ext-lib.txt diff --git a/compat/Makefile.am b/compat/Makefile.am new file mode 100644 index 0000000..79be1c8 --- /dev/null +++ b/compat/Makefile.am @@ -0,0 +1,12 @@ +AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include + +lib_LTLIBRARIES = libcompat.la + +libcompat_la_SOURCES = + +libcompat_la_LDFLAGS = \ + -Wl,--no-as-needed + +if BABELTRACE_BUILD_WITH_MINGW +libcompat_la_SOURCES += compat_uuid.c +endif diff --git a/compat/compat_uuid.c b/compat/compat_uuid.c new file mode 100644 index 0000000..585436c --- /dev/null +++ b/compat/compat_uuid.c @@ -0,0 +1,80 @@ +/* This file is only built under MINGW32 */ + +#include +#include +#include + +static void fix_uuid_endian(unsigned char * ptr) +{ + unsigned char tmp; + + /* MinGW does not provide byteswap - implement our own version. */ + #define SWAP(p, i, j) tmp=*(p+i);*(p+i)=*(p+j);*(p+j)=tmp; + + SWAP(ptr, 0, 3) + SWAP(ptr, 1, 2) + SWAP(ptr, 4, 5) + SWAP(ptr, 6, 7) +} + +int compat_uuid_generate(unsigned char *uuid_out) +{ + RPC_STATUS status; + + status = UuidCreate((struct UUID *)uuid_out); + if (status == RPC_S_OK) + return 0; + else + return -1; +} + +int compat_uuid_unparse(const unsigned char *uuid_in, char *str_out) +{ + RPC_STATUS status; + unsigned char *alloc_str; + int ret; + unsigned char copy_of_uuid_in[16]; + + /* make a modifyable copy of uuid_in */ + memcpy(copy_of_uuid_in, uuid_in, 16); + + fix_uuid_endian(copy_of_uuid_in); + status = UuidToString((struct UUID *)copy_of_uuid_in, &alloc_str); + + if (status == RPC_S_OK) { + strcpy(str_out, (char *)alloc_str); + ret = 0; + } else { + ret = -1; + } + RpcStringFree(&alloc_str); + return ret; +} + +int compat_uuid_parse(const char *str_in, unsigned char *uuid_out) +{ + RPC_STATUS status; + + status = UuidFromString((unsigned char *)str_in, (struct UUID *)uuid_out); + fix_uuid_endian(uuid_out); + + if (status == RPC_S_OK) + return 0; + else + return -1; +} + +int compat_uuid_compare(const unsigned char *uuid_a, + const unsigned char *uuid_b) +{ + RPC_STATUS status; + int ret; + + if (UuidCompare((struct UUID *)uuid_a, (struct UUID *)uuid_b, &status) == 0) + ret = 0; + else + { + ret = -1; + } + return ret; +} diff --git a/configure.ac b/configure.ac index 17efc87..5f9e38d 100644 --- a/configure.ac +++ b/configure.ac @@ -60,7 +60,10 @@ AC_CHECK_LIB([uuid], [uuid_generate], have_libc_uuid=yes ], [ - AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.]) + # for MinGW32 we have our own internal implemenation of uuid using Windows functions. + if test "x$MINGW32" = xno; then + AC_MSG_ERROR([Cannot find libuuid uuid_generate nor libc uuid_create. Use [LDFLAGS]=-Ldir to specify their location.]) + fi ]) ] ) @@ -102,6 +105,7 @@ AC_SUBST(babeltracectfincludedir) AC_CONFIG_FILES([ Makefile types/Makefile + compat/Makefile formats/Makefile formats/ctf/Makefile formats/ctf/types/Makefile diff --git a/converter/Makefile.am b/converter/Makefile.am index 8ef71a2..3248d44 100644 --- a/converter/Makefile.am +++ b/converter/Makefile.am @@ -13,6 +13,7 @@ babeltrace_LDFLAGS = -Wl,--no-as-needed babeltrace_LDADD = \ $(top_builddir)/lib/libbabeltrace.la \ $(top_builddir)/formats/ctf/libbabeltrace-ctf.la \ + $(top_builddir)/compat/libcompat.la \ $(top_builddir)/formats/ctf-text/libbabeltrace-ctf-text.la \ $(top_builddir)/formats/ctf-metadata/libbabeltrace-ctf-metadata.la \ $(top_builddir)/formats/bt-dummy/libbabeltrace-dummy.la @@ -21,7 +22,8 @@ babeltrace_log_SOURCES = babeltrace-log.c babeltrace_log_LDADD = \ $(top_builddir)/lib/libbabeltrace.la \ - $(top_builddir)/formats/ctf/libbabeltrace-ctf.la + $(top_builddir)/formats/ctf/libbabeltrace-ctf.la \ + $(top_builddir)/compat/libcompat.la if BABELTRACE_BUILD_WITH_LIBUUID babeltrace_log_LDADD += -luuid diff --git a/include/babeltrace/compat/uuid.h b/include/babeltrace/compat/uuid.h index 2ce7467..2f52f40 100644 --- a/include/babeltrace/compat/uuid.h +++ b/include/babeltrace/compat/uuid.h @@ -1,8 +1,8 @@ -#ifndef _BABELTRACE_UUID_H -#define _BABELTRACE_UUID_H +#ifndef _BABELTRACE_COMPAT_UUID_H +#define _BABELTRACE_COMPAT_UUID_H /* - * babeltrace/uuid.h + * babeltrace/compat/uuid.h * * Copyright (C) 2011 Mathieu Desnoyers * @@ -122,8 +122,39 @@ int babeltrace_uuid_compare(const unsigned char *uuid_a, return -1; } +#elif defined(__MINGW32__) +static inline +int babeltrace_uuid_generate(unsigned char *uuid_out) +{ + extern int compat_uuid_generate(unsigned char *uuid_out); + return compat_uuid_generate(uuid_out); +} + +static inline +int babeltrace_uuid_unparse(const unsigned char *uuid_in, char *str_out) +{ + extern int compat_uuid_unparse(const unsigned char *uuid_in, char *str_out); + return compat_uuid_unparse(uuid_in, str_out); +} + +static inline +int babeltrace_uuid_parse(const char *str_in, unsigned char *uuid_out) +{ + extern int compat_uuid_parse(const char *str_in, unsigned char *uuid_out); + return compat_uuid_parse(str_in, uuid_out); +} + +static inline +int babeltrace_uuid_compare(const unsigned char *uuid_a, + const unsigned char *uuid_b) +{ + extern int compat_uuid_compare(const unsigned char *uuid_a, + const unsigned char *uuid_b); + return compat_uuid_compare(uuid_a, uuid_b); +} + #else #error "Babeltrace needs to have a UUID generator configured." #endif -#endif /* _BABELTRACE_UUID_H */ +#endif /* _BABELTRACE_COMPAT_UUID_H */ diff --git a/lib/Makefile.am b/lib/Makefile.am index 7ffb164..fa470c0 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -14,4 +14,5 @@ libbabeltrace_la_SOURCES = babeltrace.c \ libbabeltrace_la_LDFLAGS = \ -Wl,--no-as-needed \ prio_heap/libprio_heap.la \ - $(top_builddir)/types/libbabeltrace_types.la + $(top_builddir)/types/libbabeltrace_types.la \ + $(top_builddir)/compat/libcompat.la -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:05:44 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:05:44 +0000 Subject: [lttng-dev] [Babeltrace PATCH 04/23] Add MinGW definitions to endian.h Message-ID: <009B25148989C6458484484699278506E5382EF4@EU-MBX-01.mgc.mentorg.com> --- include/babeltrace/endian.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/babeltrace/endian.h b/include/babeltrace/endian.h index 9eee0c1..f15a44f 100644 --- a/include/babeltrace/endian.h +++ b/include/babeltrace/endian.h @@ -29,6 +29,22 @@ #ifdef __FreeBSD__ #include +#elif defined(__MINGW32__) +#ifndef __BIG_ENDIAN +#define __BIG_ENDIAN 4321 +#endif +#ifndef __LITTLE_ENDIAN +#define __LITTLE_ENDIAN 1234 +#endif + +#ifndef __BYTE_ORDER +#define __BYTE_ORDER __LITTLE_ENDIAN +#endif + +#define LITTLE_ENDIAN __LITTLE_ENDIAN +#define BIG_ENDIAN __BIG_ENDIAN +#define PDP_ENDIAN __PDP_ENDIAN +#define BYTE_ORDER __BYTE_ORDER #else #include #endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:05:53 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:05:53 +0000 Subject: [lttng-dev] [Babeltrace PATCH 05/23] Add MinGW implementations of mmap and munmap Message-ID: <009B25148989C6458484484699278506E5382F01@EU-MBX-01.mgc.mentorg.com> Add MinGW implementations of mmap, munmap and PAGE_SIZE. Add file include/babeltrace/compat/mman.h which in turn indirectly includes sys/mman.h in systems that have that file. Use babeltrace/compat/mman.h instead of sys/mman.h . --- compat/Makefile.am | 2 +- compat/compat_mman.c | 138 ++++++++++++++++++++++++++++++++++++ converter/babeltrace-log.c | 2 +- formats/bt-dummy/bt-dummy.c | 2 +- formats/ctf-metadata/ctf-metadata.c | 2 +- formats/ctf-text/ctf-text.c | 2 +- formats/ctf/ctf.c | 2 +- include/babeltrace/align.h | 6 ++ include/babeltrace/compat/mman.h | 24 +++++++ include/babeltrace/ctf-text/types.h | 2 +- include/babeltrace/mmap-align.h | 2 +- 11 files changed, 176 insertions(+), 8 deletions(-) create mode 100644 compat/compat_mman.c create mode 100644 include/babeltrace/compat/mman.h diff --git a/compat/Makefile.am b/compat/Makefile.am index 79be1c8..00a7e02 100644 --- a/compat/Makefile.am +++ b/compat/Makefile.am @@ -8,5 +8,5 @@ libcompat_la_LDFLAGS = \ -Wl,--no-as-needed if BABELTRACE_BUILD_WITH_MINGW -libcompat_la_SOURCES += compat_uuid.c +libcompat_la_SOURCES += compat_mman.c compat_uuid.c endif diff --git a/compat/compat_mman.c b/compat/compat_mman.c new file mode 100644 index 0000000..5618deb --- /dev/null +++ b/compat/compat_mman.c @@ -0,0 +1,138 @@ +/* This file is only built under MINGW32 */ + +#include +#include +#include + +#define HAS_FLAG( BITSET, FLAG ) ( ( BITSET & FLAG ) == FLAG ) + +typedef struct +{ + HANDLE hFile; + HANDLE hFileMappingObject; + unsigned char *start_addr; + long offset; +} mmap_data; + +mmap_data *arr_mmap_data = NULL; +size_t arr_mmap_data_size = 0; +DWORD allocationGranularity = 0; + +void mmap_data_add( mmap_data data ) +{ + arr_mmap_data = (mmap_data *) realloc( arr_mmap_data, ( arr_mmap_data_size + 1 ) * sizeof( mmap_data ) ); + arr_mmap_data[ arr_mmap_data_size ] = data; + arr_mmap_data_size += 1; +} + +mmap_data *mmap_data_find_addr( unsigned char *start_addr ) +{ + size_t i; + + for( i = 0; i < arr_mmap_data_size; ++i ) + if( arr_mmap_data[i].start_addr + arr_mmap_data[i].offset == start_addr ) + return arr_mmap_data + i; + + return NULL; +} + +/* mmap for mingw32 */ +void *mmap( void *ptr, long size, long prot, long type, long handle, long arg ) +{ + mmap_data data_entry; + long offset; + + if (allocationGranularity == 0) + { + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + allocationGranularity = sysinfo.dwAllocationGranularity; + } + + if( prot == PROT_NONE || HAS_FLAG( prot, PROT_EXEC ) ) + return MAP_FAILED; /* not supported - fail safe */ + + data_entry.hFile = (HANDLE) _get_osfhandle( handle ); + if( data_entry.hFile != INVALID_HANDLE_VALUE ) + { + + /* There is no 1:1 mapping, best effort strategy */ + DWORD flProtect = PAGE_READONLY; + DWORD dwDesiredAccess = FILE_MAP_READ; + + if( HAS_FLAG( prot, PROT_WRITE ) ) + { + flProtect = PAGE_READWRITE; + if( HAS_FLAG( prot, PROT_READ ) ) + dwDesiredAccess = FILE_MAP_ALL_ACCESS; + else + dwDesiredAccess = FILE_MAP_WRITE; + } + + if( HAS_FLAG( type, MAP_PRIVATE ) ) + { + flProtect = PAGE_WRITECOPY; + dwDesiredAccess = FILE_MAP_COPY; + } + + data_entry.hFileMappingObject = CreateFileMapping( data_entry.hFile, NULL, flProtect, 0, 0, NULL ); + if( data_entry.hFileMappingObject != NULL ) + { + DWORD filesizelow; + DWORD filesizehigh; + + filesizelow = GetFileSize(data_entry.hFile, &filesizehigh); + offset = 0; + while (arg > allocationGranularity) + { + if (filesizelow < allocationGranularity) + { + filesizehigh--; + } + filesizelow -= allocationGranularity; + + arg -= allocationGranularity; + offset += allocationGranularity; + } + data_entry.offset = arg; + size = size + arg; + if ((size > filesizelow) && (filesizehigh == 0)) + { + size = filesizelow; + } + data_entry.start_addr = MapViewOfFile( data_entry.hFileMappingObject, dwDesiredAccess, 0, offset, size); + if( data_entry.start_addr != NULL ) + { + mmap_data_add( data_entry ); + return (void *)(data_entry.start_addr + arg); + } + } + + } + + return MAP_FAILED; +} + + +/* munmap for mingw32 */ +long munmap( void *ptr, long size ) +{ + mmap_data *data_entry = mmap_data_find_addr( ptr ); + if( data_entry != NULL && UnmapViewOfFile( data_entry->start_addr ) != 0 ) + { + CloseHandle( data_entry->hFileMappingObject ); + data_entry->start_addr = NULL; + return 0; + } + + return -1; +} + +/* PAGESIZE for mingw */ +unsigned int getpagesize(void) +{ + SYSTEM_INFO sys_info; + + GetSystemInfo(&sys_info); + return sys_info.dwPageSize; +} diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c index 537a8bf..ee9b309 100644 --- a/converter/babeltrace-log.c +++ b/converter/babeltrace-log.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/formats/bt-dummy/bt-dummy.c b/formats/bt-dummy/bt-dummy.c index 6192e88..4be9741 100644 --- a/formats/bt-dummy/bt-dummy.c +++ b/formats/bt-dummy/bt-dummy.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/formats/ctf-metadata/ctf-metadata.c b/formats/ctf-metadata/ctf-metadata.c index a5a74c3..7ac36e1 100644 --- a/formats/ctf-metadata/ctf-metadata.c +++ b/formats/ctf-metadata/ctf-metadata.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index 48ce31b..bc5c2a7 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index bb94e52..bb43664 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/babeltrace/align.h b/include/babeltrace/align.h index f6a1966..4a46925 100644 --- a/include/babeltrace/align.h +++ b/include/babeltrace/align.h @@ -27,11 +27,17 @@ #include #include + #include #ifndef PAGE_SIZE /* Cygwin limits.h defines its own PAGE_SIZE */ +#ifdef __MINGW32__ +extern unsigned int getpagesize(void); +#define PAGE_SIZE getpagesize() +#else #define PAGE_SIZE sysconf(_SC_PAGE_SIZE) #endif +#endif #define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1) #define __ALIGN_MASK(x, mask) (((x) + (mask)) & ~(mask)) diff --git a/include/babeltrace/compat/mman.h b/include/babeltrace/compat/mman.h new file mode 100644 index 0000000..a004b1e --- /dev/null +++ b/include/babeltrace/compat/mman.h @@ -0,0 +1,24 @@ +#ifndef _BABELTRACE_INCLUDE_COMPAT_MMAN_H +#define _BABELTRACE_INCLUDE_COMPAT_MMAN_H + +#ifdef __MINGW32__ + +#define PROT_READ 0x1 +#define PROT_WRITE 0x2 +#define PROT_EXEC 0x4 +#define PROT_NONE 0x0 + +#define MAP_SHARED 0x01 +#define MAP_PRIVATE 0x02 +#define MAP_FAILED ((void *) -1) + +/* mmap for mingw32 */ +void *mmap (void *ptr, long size, long prot, long type, long handle, long arg); +/* munmap for mingw32 */ +long munmap (void *ptr, long size); + +#else +#include +#endif + +#endif /* _BABELTRACE_INCLUDE_COMPAT_MMAN_H */ diff --git a/include/babeltrace/ctf-text/types.h b/include/babeltrace/ctf-text/types.h index 7b4b717..c528355 100644 --- a/include/babeltrace/ctf-text/types.h +++ b/include/babeltrace/ctf-text/types.h @@ -27,7 +27,7 @@ * SOFTWARE. */ -#include +#include #include #include #include diff --git a/include/babeltrace/mmap-align.h b/include/babeltrace/mmap-align.h index f7c18fa..3d90c85 100644 --- a/include/babeltrace/mmap-align.h +++ b/include/babeltrace/mmap-align.h @@ -27,7 +27,7 @@ #include #include -#include +#include /* * This header implements a wrapper over mmap (mmap_align) that memory -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:06:05 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:06:05 +0000 Subject: [lttng-dev] [Babeltrace PATCH 06/23] Add MinGW implementation of strerror_r Message-ID: <009B25148989C6458484484699278506E5382F0C@EU-MBX-01.mgc.mentorg.com> Add MinGW implementation of strerror_r. Visual C runtime libraries include a function strerror_s, but unfortunately the current release of MinGW32 does not provide it. We have our own non-secure implementation instead. --- include/babeltrace/compat/string.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h index 62cf1bf..2584ecb 100644 --- a/include/babeltrace/compat/string.h +++ b/include/babeltrace/compat/string.h @@ -3,7 +3,20 @@ #include -#if !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) +#ifdef __MINGW32__ + +static inline int compat_strerror_r(int errnum, char *buf, size_t buflen) +{ + /* non-recursive implementation of strerror_r */ + /* Windows function strerror_s is not available in MinGW32 */ + char * retbuf; + + retbuf = strerror(errnum); + strncpy(buf, retbuf, buflen); + buf[buflen - 1] = '\0'; + return 0; +} +#elif !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) /* XSI-compliant strerror_r */ static inline int compat_strerror_r(int errnum, char *buf, size_t buflen) @@ -17,6 +30,7 @@ static inline int compat_strerror_r(int errnum, char *buf, size_t buflen) static inline int compat_strerror_r(int errnum, char *buf, size_t buflen) { char * retbuf; + retbuf = strerror_r(errnum, buf, buflen); if (retbuf != buf) strcpy(buf, retbuf); -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:06:13 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:06:13 +0000 Subject: [lttng-dev] [Babeltrace PATCH 07/23] Memstream functions for MinGW32 Message-ID: <009B25148989C6458484484699278506E5382F1A@EU-MBX-01.mgc.mentorg.com> Add a Windows-specific implementation of mktemp, which provides a temporary file in the correct TEMP directory. The temporary file is opened in such a manner that it will be deleted when it is closed. Rename the unlink function to unlink_open_file, which unlinks the file in non-MinGW systems. Under MinGW, the file will be deleted by Windows, when the file is closed. --- compat/Makefile.am | 2 +- compat/compat_stdlib.c | 24 ++++++++++++++++++++++++ include/babeltrace/compat/memstream.h | 20 ++++++++++++-------- include/babeltrace/compat/stdlib.h | 17 +++++++++++++++++ 4 files changed, 54 insertions(+), 9 deletions(-) create mode 100644 compat/compat_stdlib.c create mode 100644 include/babeltrace/compat/stdlib.h diff --git a/compat/Makefile.am b/compat/Makefile.am index 00a7e02..16dd2e9 100644 --- a/compat/Makefile.am +++ b/compat/Makefile.am @@ -8,5 +8,5 @@ libcompat_la_LDFLAGS = \ -Wl,--no-as-needed if BABELTRACE_BUILD_WITH_MINGW -libcompat_la_SOURCES += compat_mman.c compat_uuid.c +libcompat_la_SOURCES += compat_mman.c compat_uuid.c compat_stdlib.c endif diff --git a/compat/compat_stdlib.c b/compat/compat_stdlib.c new file mode 100644 index 0000000..17e0b71 --- /dev/null +++ b/compat/compat_stdlib.c @@ -0,0 +1,24 @@ +/* This file is only built under MINGW32 */ + +#include +#include + +int mkstemp(char *template) +{ + char tempPath[MAX_PATH]; + char tmpname[MAX_PATH]; + HANDLE file; + + extern int _open_osfhandle(int *, int); + + /* Ignore the template. Use Windows calls to create a temporary file whose name begins with BBT */ + GetTempPath(MAX_PATH, tempPath); + GetTempFileName(tempPath, "BBT", 0, tmpname); + + /* Note that the file is opened with the attribute + FILE_FLAG_DELETE_ON_CLOSE. This unlinks the file automatically when it is closed. */ + file = CreateFile(tmpname, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, NULL); + + return _open_osfhandle((int *)file, 0); +} diff --git a/include/babeltrace/compat/memstream.h b/include/babeltrace/compat/memstream.h index d2a96cb..fb24ad9 100644 --- a/include/babeltrace/compat/memstream.h +++ b/include/babeltrace/compat/memstream.h @@ -1,8 +1,8 @@ -#ifndef _BABELTRACE_FORMAT_CTF_MEMSTREAM_H -#define _BABELTRACE_FORMAT_CTF_MEMSTREAM_H +#ifndef _BABELTRACE_COMPAT_MEMSTREAM_H +#define _BABELTRACE_COMPAT_MEMSTREAM_H /* - * format/ctf/memstream.h + * include/babeltrace/compat/memstream.h * * Copyright 2012 (c) - Mathieu Desnoyers * @@ -41,7 +41,7 @@ FILE *babeltrace_fmemopen(void *buf, size_t size, const char *mode) #else /* BABELTRACE_HAVE_FMEMOPEN */ -#include +#include #include /* @@ -84,11 +84,13 @@ FILE *babeltrace_fmemopen(void *buf, size_t size, const char *mode) perror("fseek"); goto error_close; } + /* We keep the handle open, but can unlink the file on the VFS. */ - ret = unlink(tmpname); + ret = unlink_open_file(tmpname); if (ret < 0) { perror("unlink"); } + return fp; error_close: @@ -97,10 +99,12 @@ error_close: perror("close"); } error_unlink: +#ifndef __MINGW32__ ret = unlink(tmpname); if (ret < 0) { perror("unlink"); } +#endif return NULL; } @@ -154,14 +158,14 @@ FILE *babeltrace_open_memstream(char **ptr, size_t *sizeloc) * with read from fp. No need to keep the file around, just the * handle. */ - ret = unlink(tmpname); + ret = unlink_open_file(tmpname); if (ret < 0) { perror("unlink"); } return fp; error_unlink: - ret = unlink(tmpname); + ret = unlink_open_file(tmpname); if (ret < 0) { perror("unlink"); } @@ -233,4 +237,4 @@ error_free: #endif /* BABELTRACE_HAVE_OPEN_MEMSTREAM */ -#endif /* _BABELTRACE_FORMAT_CTF_MEMSTREAM_H */ +#endif /* _BABELTRACE_COMPAT_MEMSTREAM_H */ diff --git a/include/babeltrace/compat/stdlib.h b/include/babeltrace/compat/stdlib.h new file mode 100644 index 0000000..25670eb --- /dev/null +++ b/include/babeltrace/compat/stdlib.h @@ -0,0 +1,17 @@ +#ifndef _BABELTRACE_COMPAT_STDLIB_H +#define BABELTRACE_COMPAT_STDLIB_H + +#include + +#ifdef __MINGW32__ +int mkstemp(char *template); + +/* Under MINGW32, we cannot unlink a file while it is open. */ +/* Instead, we have opened the file (in mkstemp) in such a way + that it will be automatically deleted when it gets closed. */ +#define unlink_open_file(X) 0 +#else +#define unlink_open_file(X) unlink(X) +#endif + +#endif /* BABELTRACE_COMPAT_STDLIB_H */ -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:06:21 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:06:21 +0000 Subject: [lttng-dev] [Babeltrace PATCH 08/23] Add MinGW implementation of gmtime_r Message-ID: <009B25148989C6458484484699278506E5382F29@EU-MBX-01.mgc.mentorg.com> Add a (non-recursive) implementation of gmtime_r, as it missing in the MinGW library. Implementation is written in file include/babeltrace/compat/time.h which must be included in the source files that call gmtime_r. Note that the Windows function gmtime_s is not available under MinGW32. --- formats/ctf/ctf.c | 1 + include/babeltrace/compat/time.h | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 include/babeltrace/compat/time.h diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index bb43664..2f743c7 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -52,6 +52,7 @@ #include "metadata/ctf-ast.h" #include "events-private.h" #include +#include #define LOG2_CHAR_BIT 3 diff --git a/include/babeltrace/compat/time.h b/include/babeltrace/compat/time.h new file mode 100644 index 0000000..3238d58 --- /dev/null +++ b/include/babeltrace/compat/time.h @@ -0,0 +1,20 @@ +#ifndef _BABELTRACE_INCLUDE_COMPAT_TIME_H +#define _BABELTRACE_INCLUDE_COMPAT_TIME_H + +#include +#include + +#ifdef __MINGW32__ + +static inline +struct tm *gmtime_r(const time_t *timep, struct tm *result) +{ + struct tm * r; + + r = gmtime(timep); + memcpy(result, r, sizeof (struct tm)); + return result; +} + +#endif +#endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:06:29 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:06:29 +0000 Subject: [lttng-dev] [Babeltrace PATCH 09/23] Add MinGW implementaion of localtime_r Message-ID: <009B25148989C6458484484699278506E5382F40@EU-MBX-01.mgc.mentorg.com> Add a (non-recursive) implementation of localtime_r for MinGW32. MinGW does not include the Windows Visual C function localtime_s, so the implementation uses localtime() instead. --- include/babeltrace/compat/time.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/babeltrace/compat/time.h b/include/babeltrace/compat/time.h index 3238d58..5f23bfa 100644 --- a/include/babeltrace/compat/time.h +++ b/include/babeltrace/compat/time.h @@ -16,5 +16,14 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result) return result; } +static inline +struct tm *localtime_r(const time_t *timep, struct tm *result) +{ + struct tm * r; + + r = localtime(timep); + memcpy(result, r, sizeof (struct tm)); + return result; +} #endif #endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:06:38 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:06:38 +0000 Subject: [lttng-dev] [Babeltrace PATCH 10/23] Add MinGW implementation of fpathconf Message-ID: <009B25148989C6458484484699278506E5382F56@EU-MBX-01.mgc.mentorg.com> The MinGW implementation of fpathconf will always return MAX_PATH. --- formats/ctf/ctf.c | 2 +- include/babeltrace/compat/unistd.h | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 include/babeltrace/compat/unistd.h diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 2f743c7..b476a29 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include "metadata/ctf-scanner.h" diff --git a/include/babeltrace/compat/unistd.h b/include/babeltrace/compat/unistd.h new file mode 100644 index 0000000..d39dd50 --- /dev/null +++ b/include/babeltrace/compat/unistd.h @@ -0,0 +1,21 @@ +#ifndef _BABELTRACE_INCLUDE_COMPAT_UNISTD_H +#define _BABELTRACE_INCLUDE_COMPAT_UNISTD_H + +#include + +#ifndef _PC_NAME_MAX +#define _PC_NAME_MAX 0 +#endif + +#ifdef __MINGW32__ + +static inline +int fpathconf (int fd, int name) +{ + /* dummy function that always returns MAX_PATH */ + return MAX_PATH; +} + +#endif + +#endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:06:45 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:06:45 +0000 Subject: [lttng-dev] [Babeltrace PATCH 11/23] Add MinGW implementation of nftw Message-ID: <009B25148989C6458484484699278506E5382F62@EU-MBX-01.mgc.mentorg.com> Add MinGW implementation of nftw. This implementation works only with plain directories containing plain files. --- converter/babeltrace.c | 2 +- include/babeltrace/compat/ftw.h | 73 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 include/babeltrace/compat/ftw.h diff --git a/converter/babeltrace.c b/converter/babeltrace.c index d5a7040..b356c43 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include /* for clocks */ diff --git a/include/babeltrace/compat/ftw.h b/include/babeltrace/compat/ftw.h new file mode 100644 index 0000000..f1e7bfd --- /dev/null +++ b/include/babeltrace/compat/ftw.h @@ -0,0 +1,73 @@ +#ifndef _BABELTRACE_INCLUDE_COMPAT_FTW_H +#define _BABELTRACE_INCLUDE_COMPAT_FTW_H + +#ifndef __MINGW32__ +#include +#else + +#include + +struct FTW { + int base; + int level; +}; + + +#define FTW_F 0 +#define FTW_D 1 +#define FTW_DNR 2 +#define FTW_NS 3 +#define FTW_SL 4 + +static inline +int nftw(const char *dirpath, + int (*fn) (const char *fpath, const struct stat *sb, + int typeflag, struct FTW *ftwbuf), + int nopenfd, int flags) +{ + CHAR szSearch[MAX_PATH] = {0}; + CHAR szDirectory[MAX_PATH] = {0}; + HANDLE hFind = NULL; + WIN32_FIND_DATAA FindFileData; + + sprintf(szSearch, "%s%s", dirpath, "\\*"); + hFind = FindFirstFileA(szSearch, &FindFileData); + if(hFind == INVALID_HANDLE_VALUE) + { + /* print error */ + return -1; + } + do { + + if((FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) + { + /* this is a directory */ + /* skip '..' */ + if (strcmp(FindFileData.cFileName, "..") == 0) + continue; + + /* return '.' but do not recurse into it */ + if (strcmp(FindFileData.cFileName, ".") == 0) + { + (*fn)(dirpath, 0, FTW_D, 0); + continue; + } + + /* for others, recurse into them */ + sprintf(szDirectory, "%s/%s", dirpath, FindFileData.cFileName); + nftw(szDirectory, fn, nopenfd, flags); + + } + else + { + /* for files, report but do not recurse */ + sprintf(szDirectory, "%s/%s", dirpath, FindFileData.cFileName); + (*fn)(szDirectory, 0, FTW_F, 0); + } + } while(FindNextFileA(hFind, &FindFileData)); + + FindClose(hFind); + return 0; +} +#endif +#endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:06:52 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:06:52 +0000 Subject: [lttng-dev] [Babeltrace PATCH 12/23] Add MinGW implementation of strtok_r Message-ID: <009B25148989C6458484484699278506E5382F73@EU-MBX-01.mgc.mentorg.com> Add an implementation for strtok_r for MinGW, where it is missing. The Windows equivalent strtok_s seems to be missing in MinGW as well. --- include/babeltrace/compat/string.h | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h index 2584ecb..1db5837 100644 --- a/include/babeltrace/compat/string.h +++ b/include/babeltrace/compat/string.h @@ -5,6 +5,45 @@ #ifdef __MINGW32__ +static inline char* strtok_r( + char *str, + const char *delim, + char **nextp) +{ + char *ret; + + /* if str is NULL, continue from nextp */ + if (str == NULL) { + str = *nextp; + } + /* skip the leading delimiter characters */ + str += strspn(str, delim); + + /* return NULL if all are delimiters */ + if (*str == '\0') { + return NULL; + } + /* return the pointer to the first character that is not delimiter */ + ret = str; + + /* scan to the next delimiter */ + str += strcspn(str, delim); + + /* if we found a delimiter instead of a NUL */ + if (*str) { + /* replace the delimiter with the NUL */ + *str = '\0'; + /* next time, scan from the character after NUL */ + *nextp = str + 1; + } + else { + /* end of string: next time, scan at the end (NUL) again */ + *nextp = str; + } + + return ret; +} + static inline int compat_strerror_r(int errnum, char *buf, size_t buflen) { /* non-recursive implementation of strerror_r */ -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:06:58 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:06:58 +0000 Subject: [lttng-dev] [Babeltrace PATCH 13/23] Add MinGW implementation of sleep Message-ID: <009B25148989C6458484484699278506E5382F7B@EU-MBX-01.mgc.mentorg.com> Add new function sleep() that calls Windows Sleep() instead. --- converter/babeltrace.c | 2 +- include/babeltrace/compat/unistd.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index b356c43..5cc9949 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/babeltrace/compat/unistd.h b/include/babeltrace/compat/unistd.h index d39dd50..5a741a1 100644 --- a/include/babeltrace/compat/unistd.h +++ b/include/babeltrace/compat/unistd.h @@ -16,6 +16,11 @@ int fpathconf (int fd, int name) return MAX_PATH; } -#endif +static inline +void sleep(unsigned int x) +{ + Sleep(1000 * x); +} #endif +#endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:07:04 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:07:04 +0000 Subject: [lttng-dev] [Babeltrace PATCH 14/23] Add MinGW implementation of strnlen Message-ID: <009B25148989C6458484484699278506E5382F8A@EU-MBX-01.mgc.mentorg.com> Add an implementation of strnlen for MinGW, as it does not provide that function in its runtime library. --- include/babeltrace/compat/string.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h index 1db5837..14e7b53 100644 --- a/include/babeltrace/compat/string.h +++ b/include/babeltrace/compat/string.h @@ -44,6 +44,30 @@ static inline char* strtok_r( return ret; } +static inline +size_t strnlen(const char *str, size_t maxlen) +{ + char * ptr; + size_t len; + + ptr = (char *)str; + len = 0; + + /* while there still are characters in the string */ + while(*ptr != '\0') { + /* increment counter */ + len++; + /* check that we do not exceed the given maximum */ + if (len == maxlen) { + return len; + } + /* next character */ + ptr++; + + } + return len; +} + static inline int compat_strerror_r(int errnum, char *buf, size_t buflen) { /* non-recursive implementation of strerror_r */ -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:07:10 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:07:10 +0000 Subject: [lttng-dev] [Babeltrace PATCH 15/23] Add MinGW implementation of posix_fallocate Message-ID: <009B25148989C6458484484699278506E5382F92@EU-MBX-01.mgc.mentorg.com> Add MinGW implementation of posix_fallocate. The implementation is in a new source file (compat_fcntl.c). Add the new source file to the build. --- compat/Makefile.am | 2 +- compat/compat_fcntl.c | 23 +++++++++++++++++++++++ formats/ctf/ctf.c | 2 +- include/babeltrace/compat/fcntl.h | 11 +++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 compat/compat_fcntl.c create mode 100644 include/babeltrace/compat/fcntl.h diff --git a/compat/Makefile.am b/compat/Makefile.am index 16dd2e9..03b3daf 100644 --- a/compat/Makefile.am +++ b/compat/Makefile.am @@ -8,5 +8,5 @@ libcompat_la_LDFLAGS = \ -Wl,--no-as-needed if BABELTRACE_BUILD_WITH_MINGW -libcompat_la_SOURCES += compat_mman.c compat_uuid.c compat_stdlib.c +libcompat_la_SOURCES += compat_mman.c compat_uuid.c compat_stdlib.c compat_fcntl.c endif diff --git a/compat/compat_fcntl.c b/compat/compat_fcntl.c new file mode 100644 index 0000000..3fd23a9 --- /dev/null +++ b/compat/compat_fcntl.c @@ -0,0 +1,23 @@ +/* This file is only built under MINGW32 */ + +#include +#include + +int posix_fallocate(int fd, off_t offset, off_t len) +{ + HANDLE handle; + LARGE_INTEGER current_pos; + LARGE_INTEGER pos; + BOOL ret; + + handle = (HANDLE) _get_osfhandle(fd); + pos.QuadPart = 0; + SetFilePointerEx(handle, pos, ¤t_pos, FILE_CURRENT); + pos.QuadPart = (__int64)offset + (__int64)len; + SetFilePointerEx(handle, pos, NULL, FILE_BEGIN); + ret = SetEndOfFile(handle); + SetFilePointerEx(handle, current_pos, NULL, FILE_BEGIN); + if (ret == 0) + return -1; + return 0; +} diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index b476a29..0db23c3 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/babeltrace/compat/fcntl.h b/include/babeltrace/compat/fcntl.h new file mode 100644 index 0000000..9fc7539 --- /dev/null +++ b/include/babeltrace/compat/fcntl.h @@ -0,0 +1,11 @@ +#ifndef _BABELTRACE_INCLUDE_COMPAT_FCNTL_H +#define _BABELTRACE_INCLUDE_COMPAT_FCNTL_H + +#include +#ifdef __MINGW32__ + +int posix_fallocate(int fd, off_t offset, off_t len); + +#endif + +#endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:07:16 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:07:16 +0000 Subject: [lttng-dev] [Babeltrace PATCH 16/23] Add MinGW implementation of readdir_r Message-ID: <009B25148989C6458484484699278506E5382F9E@EU-MBX-01.mgc.mentorg.com> --- formats/ctf/ctf.c | 2 +- include/babeltrace/compat/dirent.h | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 include/babeltrace/compat/dirent.h diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 0db23c3..ad3c3b1 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/babeltrace/compat/dirent.h b/include/babeltrace/compat/dirent.h new file mode 100644 index 0000000..281f40b --- /dev/null +++ b/include/babeltrace/compat/dirent.h @@ -0,0 +1,20 @@ +#ifndef _BABELTRACE_INCLUDE_COMPAT_DIRENT_H +#define _BABELTRACE_INCLUDE_COMPAT_DIRENT_H + +#include + +#ifdef __MINGW32__ +static inline +int readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result) +{ + errno = 0; + entry = readdir (dirp); + *result = entry; + if (entry == NULL && errno != 0) { + return -1; + } + return 0; +} +#endif + +#endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:07:21 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:07:21 +0000 Subject: [lttng-dev] [Babeltrace PATCH 17/23] Add MinGW implementation of flockfile Message-ID: <009B25148989C6458484484699278506E5382FAA@EU-MBX-01.mgc.mentorg.com> Add a dummy implementation of flockfile for MinGW. The function does not do anything; it only returns. --- include/babeltrace/compat/stdio.h | 14 ++++++++++++++ tests/lib/tap.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 include/babeltrace/compat/stdio.h diff --git a/include/babeltrace/compat/stdio.h b/include/babeltrace/compat/stdio.h new file mode 100644 index 0000000..62ecf97 --- /dev/null +++ b/include/babeltrace/compat/stdio.h @@ -0,0 +1,14 @@ +#ifndef _BABELTRACE_COMPAT_STDIO_H +#define _BABELTRACE_COMPAT_STDIO_H + +#include + +#ifdef __MINGW32__ +static inline void flockfile (FILE * filehandle) +{ + return; +} + +#endif + +#endif diff --git a/tests/lib/tap.c b/tests/lib/tap.c index a430951..8bcdf36 100644 --- a/tests/lib/tap.c +++ b/tests/lib/tap.c @@ -27,7 +27,7 @@ #define _GNU_SOURCE #include #include -#include +#include #include #include "tap.h" -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:07:27 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:07:27 +0000 Subject: [lttng-dev] [Babeltrace PATCH 18/23] Add MinGW implementation of funlockfile Message-ID: <009B25148989C6458484484699278506E5382FB2@EU-MBX-01.mgc.mentorg.com> Add a dummy MinGW implementation of funlockfile. This function does not do anything, it only returns. --- include/babeltrace/compat/stdio.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/babeltrace/compat/stdio.h b/include/babeltrace/compat/stdio.h index 62ecf97..be64e60 100644 --- a/include/babeltrace/compat/stdio.h +++ b/include/babeltrace/compat/stdio.h @@ -8,6 +8,10 @@ static inline void flockfile (FILE * filehandle) { return; } +static inline void funlockfile(FILE * filehandle) +{ + return; +} #endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:07:33 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:07:33 +0000 Subject: [lttng-dev] [Babeltrace PATCH 19/23] Add MinGW substitutes for openat and related Message-ID: <009B25148989C6458484484699278506E5382FC2@EU-MBX-01.mgc.mentorg.com> Check if the build system has openat() support. If it does not, we have to open files based on the directory name instead of the directory handle. Substitute openat() with compat_openat() that also takes the directory path name as a parameter. If we don't have openat(), replace the function dirfd() with a dummy. Also, if we don't have openat(), open() and close() will not work for directories. Replace those with compat_opendirfd and compat_closedirfd() with dummy equivalents, as the function compat_openat() takes care of opening the file. --- configure.ac | 7 ++++ converter/babeltrace-log.c | 10 +++--- converter/babeltrace.c | 10 +++--- formats/ctf/ctf.c | 8 ++--- include/babeltrace/compat/dirent.h | 11 ++++++ include/babeltrace/compat/fcntl.h | 69 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 101 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 5f9e38d..168fb91 100644 --- a/configure.ac +++ b/configure.ac @@ -84,6 +84,13 @@ AC_CHECK_LIB([c], [open_memstream], ] ) +# Check for openat +AC_CHECK_LIB([c], [openat], +[ + AC_DEFINE_UNQUOTED([BABELTRACE_HAVE_OPENAT], 1, [Has openat support.]) +] +) + AC_CHECK_LIB([popt], [poptGetContext], [], [AC_MSG_ERROR([Cannot find popt.])] ) diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c index ee9b309..a2db91a 100644 --- a/converter/babeltrace-log.c +++ b/converter/babeltrace-log.c @@ -32,9 +32,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -343,20 +343,20 @@ int main(int argc, char **argv) perror("opendir"); goto error_rmdir; } - dir_fd = dirfd(dir); + dir_fd = compat_dirfd(dir); if (dir_fd < 0) { perror("dirfd"); goto error_closedir; } - fd = openat(dir_fd, "datastream", O_RDWR|O_CREAT, + fd = compat_openat(s_outputname, dir_fd, "datastream", O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); if (fd < 0) { perror("openat"); goto error_closedirfd; } - metadata_fd = openat(dir_fd, "metadata", O_RDWR|O_CREAT, + metadata_fd = compat_openat(s_outputname, dir_fd, "metadata", O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP); if (metadata_fd < 0) { perror("openat"); diff --git a/converter/babeltrace.c b/converter/babeltrace.c index 5cc9949..2658c2e 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include @@ -435,15 +435,15 @@ static int traverse_trace_dir(const char *fpath, const struct stat *sb, if (tflag != FTW_D) return 0; - dirfd = open(fpath, 0); + dirfd = compat_opendirfd(fpath, 0); if (dirfd < 0) { fprintf(stderr, "[error] [Context] Unable to open trace " "directory file descriptor.\n"); return 0; /* partial error */ } - metafd = openat(dirfd, "metadata", O_RDONLY); + metafd = compat_openat(fpath, dirfd, "metadata", O_RDONLY); if (metafd < 0) { - closeret = close(dirfd); + closeret = compat_closedirfd(dirfd); if (closeret < 0) { perror("close"); return -1; @@ -458,7 +458,7 @@ static int traverse_trace_dir(const char *fpath, const struct stat *sb, perror("close"); err_close = 1; } - closeret = close(dirfd); + closeret = compat_closedirfd(dirfd); if (closeret < 0) { perror("close"); err_close = 1; diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index ad3c3b1..ffa5387 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1098,7 +1098,7 @@ int ctf_open_trace_metadata_read(struct ctf_trace *td, metadata_stream->pos.fd = -1; } else { td->metadata = &metadata_stream->parent; - metadata_stream->pos.fd = openat(td->dirfd, "metadata", O_RDONLY); + metadata_stream->pos.fd = compat_openat(td->parent.path, td->dirfd, "metadata", O_RDONLY); if (metadata_stream->pos.fd < 0) { fprintf(stderr, "Unable to open metadata.\n"); ret = -1; @@ -1681,7 +1681,7 @@ int ctf_open_file_stream_read(struct ctf_trace *td, const char *path, int flags, struct ctf_file_stream *file_stream; struct stat statbuf; - fd = openat(td->dirfd, path, flags); + fd = compat_openat(td->parent.path, td->dirfd, path, flags); if (fd < 0) { perror("File stream openat()"); ret = fd; @@ -1774,7 +1774,7 @@ int ctf_open_trace_read(struct ctf_trace *td, goto error; } - td->dirfd = open(path, 0); + td->dirfd = compat_opendirfd(path, 0); if (td->dirfd < 0) { fprintf(stderr, "[error] Unable to open trace directory file descriptor for path \"%s\".\n", path); perror("Trace directory open"); @@ -1832,7 +1832,7 @@ int ctf_open_trace_read(struct ctf_trace *td, readdir_error: free(dirent); error_metadata: - closeret = close(td->dirfd); + closeret = compat_closedirfd(td->dirfd); if (closeret) { perror("Error on fd close"); } diff --git a/include/babeltrace/compat/dirent.h b/include/babeltrace/compat/dirent.h index 281f40b..a7d6227 100644 --- a/include/babeltrace/compat/dirent.h +++ b/include/babeltrace/compat/dirent.h @@ -17,4 +17,15 @@ int readdir_r (DIR *dirp, struct dirent *entry, struct dirent **result) } #endif +static inline +int compat_dirfd(DIR * dirp) +{ +#ifdef BABELTRACE_HAVE_OPENAT + return dirfd(dirp); +#else + /* ignore dirfd - see compat_openat() */ + return 0; +#endif +} + #endif diff --git a/include/babeltrace/compat/fcntl.h b/include/babeltrace/compat/fcntl.h index 9fc7539..2d6f8e5 100644 --- a/include/babeltrace/compat/fcntl.h +++ b/include/babeltrace/compat/fcntl.h @@ -2,10 +2,79 @@ #define _BABELTRACE_INCLUDE_COMPAT_FCNTL_H #include +#include +#include +#include +#include + #ifdef __MINGW32__ int posix_fallocate(int fd, off_t offset, off_t len); #endif +/* + If we have BABELTRACE_HAVE_OPENAT, then + openat() and dirfd() work, and open() and close() can + work on directories. + + If we don't have BABELTRACE_HAVE_OPENAT, + then we have to open files based on the directory name, + not the directory handle. The functions + compat_[opendirfd | closedirfd | dirfd] all are dummied + to return zero, and compat_openat() takes care of the + opening of the file, using the given path. +*/ +#ifdef BABELTRACE_HAVE_OPENAT +static inline +int compat_openat(const char * dirname, int dirfd, const char *pathname, int flags, ...) +{ + mode_t mode = 0; + va_list args; + + va_start (args, flags); + mode = (mode_t)va_arg(args, int); + va_end(args); + return openat(dirfd, pathname, flags, mode); +} + +static inline +int compat_opendirfd(const char *fpath, int flags) +{ + return open(fpath, flags); +} + +static inline +int compat_closedirfd(int dirfd) +{ + return close(dirfd); +} + +#else + +static inline +int compat_openat(const char * dirname, int dirfd, const char *pathname, int flags, ...) +{ + char szSearch[MAX_PATH] = {0}; + + sprintf(szSearch, "%s/%s", dirname, pathname); +#ifdef __MINGW32__ + flags = flags | O_BINARY; #endif + return open(szSearch, flags); +} + +static inline +int compat_opendirfd(const char *fpath, int flags) +{ + return 0; +} + +static inline +int compat_closedirfd(int dirfd) +{ + return 0; +} +#endif /* BABELTRACE_HAVE_OPENAT */ + +#endif /* _BABELTRACE_INCLUDE_COMPAT_FCNTL_H */ -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:07:39 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:07:39 +0000 Subject: [lttng-dev] [Babeltrace PATCH 20/23] Replace mkdir with a more compatible compat_mkdir Message-ID: <009B25148989C6458484484699278506E5382FE8@EU-MBX-01.mgc.mentorg.com> The MinGW implementation of mkdir only accepts one parameter. Replace mkdir with compat_mkdir that in MinGW will ignore the parameters after the first one. --- converter/babeltrace-log.c | 2 +- include/babeltrace/compat/fcntl.h | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/converter/babeltrace-log.c b/converter/babeltrace-log.c index a2db91a..570a420 100644 --- a/converter/babeltrace-log.c +++ b/converter/babeltrace-log.c @@ -332,7 +332,7 @@ int main(int argc, char **argv) exit(EXIT_SUCCESS); } - ret = mkdir(s_outputname, S_IRWXU|S_IRWXG); + ret = compat_mkdir(s_outputname, S_IRWXU|S_IRWXG); if (ret) { perror("mkdir"); goto error; diff --git a/include/babeltrace/compat/fcntl.h b/include/babeltrace/compat/fcntl.h index 2d6f8e5..efca923 100644 --- a/include/babeltrace/compat/fcntl.h +++ b/include/babeltrace/compat/fcntl.h @@ -7,10 +7,31 @@ #include #include +#ifndef S_IRGRP +#define S_IRGRP 0 +#endif + +#ifndef S_IWGRP +#define S_IWGRP 0 +#endif + +#ifndef S_IRWXG +#define S_IRWXG 0 +#endif + #ifdef __MINGW32__ int posix_fallocate(int fd, off_t offset, off_t len); +static inline +int compat_mkdir(const char *pathname, ...) +{ + return mkdir(pathname); +} +#else + +#define compat_mkdir(X,Y) mkdir((X),(Y)) + #endif /* -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:08:13 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:08:13 +0000 Subject: [lttng-dev] [Babeltrace PATCH 21/23] Add MinGW implementation of getline Message-ID: <009B25148989C6458484484699278506E538300B@EU-MBX-01.mgc.mentorg.com> --- include/babeltrace/compat/string.h | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/include/babeltrace/compat/string.h b/include/babeltrace/compat/string.h index 14e7b53..e2612f4 100644 --- a/include/babeltrace/compat/string.h +++ b/include/babeltrace/compat/string.h @@ -5,6 +5,10 @@ #ifdef __MINGW32__ +#include +#include +#include + static inline char* strtok_r( char *str, const char *delim, @@ -79,6 +83,44 @@ static inline int compat_strerror_r(int errnum, char *buf, size_t buflen) buf[buflen - 1] = '\0'; return 0; } + +static inline +ssize_t getline(char **buf, size_t *len, FILE *stream) +{ + int c = EOF; + ssize_t count = (ssize_t)0; + + if( feof( stream ) || ferror( stream ) ) + return -1; + + for(;;) { + /* read character from stream */ + c = fgetc(stream); + if (c == EOF) { + break; + } + if (c == '\n') { + break; + } + + /* store to *buf */ + /* check if it fits - space for character and NUL */ + if (count > *len - 2) { + /* have to allocate more space */ + *len = *len + 100; + *buf = realloc(*buf, *len); + if (*buf == NULL) { + errno = ENOMEM; + return (ssize_t)-1; + } + } + (*buf)[count] = c; + count++; + } + (*buf)[count] = '\0'; + return (count == (ssize_t)0) ? (ssize_t)-1 : (ssize_t)0; +} + #elif !defined(__linux__) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) /* XSI-compliant strerror_r */ -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:08:21 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:08:21 +0000 Subject: [lttng-dev] [Babeltrace PATCH 22/23] MinGW implementation of [v]asprintf Message-ID: <009B25148989C6458484484699278506E5383016@EU-MBX-01.mgc.mentorg.com> --- include/babeltrace/compat/stdio.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/include/babeltrace/compat/stdio.h b/include/babeltrace/compat/stdio.h index be64e60..cce3c70 100644 --- a/include/babeltrace/compat/stdio.h +++ b/include/babeltrace/compat/stdio.h @@ -4,6 +4,10 @@ #include #ifdef __MINGW32__ + +#include +#include + static inline void flockfile (FILE * filehandle) { return; @@ -13,6 +17,41 @@ static inline void funlockfile(FILE * filehandle) return; } +static inline +int vasprintf(char ** strp, const char * fmt, va_list argv) +{ + int ret; + char * buf; + size_t size = 100; + + /* allocate even bigger chunks of memory until the string fits */ + for(;;) { + buf = malloc(size); + if (buf == (char *)0) { + ret = -1; + break; + } + ret = vsnprintf(buf, size, fmt, argv); + if (ret < size) + break; + size = size + 100; + free(buf); + } + return ret; +} + +static inline +int asprintf(char ** strp, const char *fmt, ...) +{ + int ret; + va_list argv; + + va_start(argv, fmt); + ret = vasprintf(strp, fmt, argv); + va_end(argv); + return ret; +} + #endif #endif -- 1.8.1.msysgit.1 From jp_ikaheimonen at mentor.com Wed May 22 04:08:31 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Wed, 22 May 2013 08:08:31 +0000 Subject: [lttng-dev] [Babeltrace PATCH 23/23] Open files as binary under Windows Message-ID: <009B25148989C6458484484699278506E538301F@EU-MBX-01.mgc.mentorg.com> When opening files with open() or fdopen(), use the "b" flag to avoid CR/LF transformations under Windows. --- formats/ctf/ctf.c | 2 +- include/babeltrace/compat/memstream.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index ffa5387..5a7779f 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1105,7 +1105,7 @@ int ctf_open_trace_metadata_read(struct ctf_trace *td, goto end_free; } - fp = fdopen(metadata_stream->pos.fd, "r"); + fp = fdopen(metadata_stream->pos.fd, "rb"); if (!fp) { fprintf(stderr, "[error] Unable to open metadata stream.\n"); perror("Metadata stream open"); diff --git a/include/babeltrace/compat/memstream.h b/include/babeltrace/compat/memstream.h index fb24ad9..cc5328d 100644 --- a/include/babeltrace/compat/memstream.h +++ b/include/babeltrace/compat/memstream.h @@ -70,7 +70,7 @@ FILE *babeltrace_fmemopen(void *buf, size_t size, const char *mode) /* * We need to write to the file. */ - fp = fdopen(ret, "w+"); + fp = fdopen(ret, "w+b"); if (!fp) { goto error_unlink; } @@ -149,7 +149,7 @@ FILE *babeltrace_open_memstream(char **ptr, size_t *sizeloc) if (ret < 0) { return NULL; } - fp = fdopen(ret, "w+"); + fp = fdopen(ret, "w+b"); if (!fp) { goto error_unlink; } -- 1.8.1.msysgit.1 From mathieu.desnoyers at efficios.com Wed May 22 08:50:52 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 22 May 2013 08:50:52 -0400 Subject: [lttng-dev] newbie and kernel trace In-Reply-To: <519B4462.2030103@free.fr> References: <519645B2.5090709@free.fr> <519B4462.2030103@free.fr> Message-ID: <20130522125052.GC1203@Krystal> * St?phane ANCELOT (sancelot at free.fr) wrote: > Hi, > I have read the Documentation/trace/tracepoints.txt file. > > I modified my code to acknowledge it. > > I am again unable to list my tracepoints using lttng list . (I also > tried lttng enable-channel before...). > > So , only one step I have not made : > Is it mandatory to register the probe functions ??? Remember that the probe provider module .ko needs to be loaded manually (if it is a new one that is not listed in the sessiond automatically loaded module list). Please provide the complete diff of the modifications you did to lttng-modules so we can provide further help. Thanks, Mathieu > > > Regards, > S.Ancelot > > > > > On 17/05/2013 17:13, J?r?mie Galarneau wrote: >> Hi St?phane, >> >> We're going to need more details than that. Which kernel version are you using? >> Can you see the other kernel events in your trace? If not, can you >> show us how you are setting up your session? >> >> Thanks, >> J?r?mie >> >> On Fri, May 17, 2013 at 10:58 AM, St?phane ANCELOT wrote: >>> Hi, >>> >>> I am trying to reimplement LTTNG 2. in xenomai api. >>> >>> the main problem is that I do not sea any of my new events available in >>> lttng 2. >>> >>> >>> my kernel compiles fine and here is what I done to set it up : >>> >>> file include/trace/events/pod.h : >>> >>> #undef TRACE_SYSTEM >>> #define TRACE_SYSTEM xenotrace >>> >>> #if !defined(_XENOTRACE_H) || defined(TRACE_HEADER_MULTI_READ) >>> >>> #define _XENOTRACE_H >>> >>> #include >>> >>> >>> TRACE_EVENT( xn_nucleus_thread_init, >>> TP_PROTO(struct xnthread *thread,char *thread_name,xnflags_t >>> flags,const char *class,int prio), >>> TP_ARGS(thread,thread_name,flags,class,prio), >>> >>> TP_STRUCT__entry( >>> __field(struct xnthread *,thread) >>> __array(char ,thread_name, XNOBJECT_NAME_LEN ) >>> __field(xnflags_t,flags) >>> __array(char,class, XNOBJECT_NAME_LEN ) >>> __field(int, prio ) >>> ), >>> >>> TP_fast_assign( >>> __entry->thread = thread; >>> memcpy(__entry->thread_name,thread_name, XNOBJECT_NAME_LEN); >>> __entry->flags = flags; >>> memcpy(__entry->class,class, XNOBJECT_NAME_LEN); >>> __entry->prio = prio; >>> ), >>> >>> TP_printk("thread %p thread_name %s flags %lu class %s prio >>> %d", >>> __entry->thread, __entry->thread_name, >>> __entry->flags,__entry->class, >>> __entry->prio) >>> ); >>> >>> #endif >>> >>> /* This part must be outside protection */ >>> #include >>> >>> >>> >>> in pod.h : >>> #define CREATE_TRACE_POINTS >>> #include >>> >>> _______________________________________________ >>> lttng-dev mailing list >>> lttng-dev at lists.lttng.org >>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >> >> > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Wed May 22 08:54:29 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 22 May 2013 08:54:29 -0400 Subject: [lttng-dev] Mariadb+LTTng 2.x In-Reply-To: <8E0A14A4C9B95B459AE214584119C1EB417EFD06@tulip.ad.unb.ca> References: <5196A107.7070706@voxpopuli.im> <8E0A14A4C9B95B459AE214584119C1EB417EFD06@tulip.ad.unb.ca> Message-ID: <20130522125429.GD1203@Krystal> Ensure that you don't have a old sessiond binary still running, that you issue ldconfig as root, that you don't have stale old libs in /usr/lib nor /usr/local/lib Thanks, Mathieu * Yang Wang (yangw.wang5 at unb.ca) wrote: > Hello Alex, > > I reinstalled lttng-tools-2.1.0 and compiled Mariadb with lttng-ust.2.1.2(now they work together) > The following is related to lttng-tools-2.1.0 in /usr/local/lib after I reinstalled it. > > -rw-r--r-- 1 root root 1018130 May 18 13:50 liblttng-ctl.a > -rwxr-xr-x 1 root root 1035 May 18 13:50 liblttng-ctl.la > lrwxrwxrwx 1 root root 21 May 18 13:50 liblttng-ctl.so -> liblttng-ctl.so.0.0.0 > lrwxrwxrwx 1 root root 21 May 18 13:50 liblttng-ctl.so.0 -> liblttng-ctl.so.0.0.0 > -rwxr-xr-x 1 root root 491876 May 18 13:50 liblttng-ctl.so.0.0.0 > > But it reports the same error as before. If it is a compatibility problem, why my instrumented > J9 VM with lttng-ust.2.1.2 has no this errors? > > Yang > > ________________________________________ > From: Alexandre Montplaisir [alexmonthy at voxpopuli.im] > Sent: Friday, May 17, 2013 6:28 PM > To: Yang Wang > Cc: Mathieu Desnoyers; Yannick Brosseau; David Goulet; Graeme Johnson; Kenneth Kent; lttng-dev at lists.lttng.org > Subject: Re: Mariadb+LTTng 2.x > > Hi Yang, > > On 13-05-17 05:21 PM, Yang Wang wrote: > > It seems not this compatibility problem. I have removed all ust1.0 stuffs in the instrumented Mariadb code and > > replaced with lttng-ust 2.x say, tracepoint statements, trancepoint provider files, probes files and use the lib -llttng-ust instead of -lust. Anything I missed? > > Mathieu was talking about 2.0 vs 2.1, not 0.x vs 2.x. > > If you compiled your application with lttng-ust 2.1, make sure you use > lttng-tools 2.1 to trace it. lttng-tools 2.0 will not work. > > > > > Is "libust[7848/7853]: " reported from lttng-tools 2.0? Actually, this is printed from > > Yeah I think this is normal, this is old stuff that dates from the 0.x > days, but lttng-ust still prints it that way. > > > Cheers, > Alex > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From matthew.khouzam at ericsson.com Wed May 22 10:04:41 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Wed, 22 May 2013 10:04:41 -0400 Subject: [lttng-dev] CTF viewing with timeless events Message-ID: <519CD079.2010701@ericsson.com> Hello Tracing fans and mole appreciators, I was given an interesting corner case and want to explain how I believe it should be handled. You are given a trace with no timestamps, and n channels. How do you display the events? I propose (and have implemented) that we have a secondary fallback key to sort events. Right now, I believe babeltrace will sort by timestamp and that's it. The eclipse viewer sorts by timestamp and if timestamps match, it sorts by stream file name. In one given trace, stream file names are unique like (channel_0). This means if you have 5 stream files with five events each, it will always output as "stream1: e1-e2-e3-e4-e5 stream2: e1-e2-e3-e4-e5 stream3: e1-e2-e3-e4-e5 stream4: e1-e2-e3-e4-e5 stream5: e1-e2-e3-e4-e5" This should avoid confusion from a reader's perspective. Comments? From simon.marchi at polymtl.ca Wed May 22 13:18:34 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 22 May 2013 13:18:34 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Add parameter -f to rm in Makefile clean target Message-ID: <1369243114-26735-1-git-send-email-simon.marchi@polymtl.ca> If the files we want to delete do not exist (for example after a failed build), the make clean fails. Signed-off-by: Simon Marchi --- liblttng-ust-java/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/liblttng-ust-java/Makefile.am b/liblttng-ust-java/Makefile.am index 4c998dc..57b9532 100644 --- a/liblttng-ust-java/Makefile.am +++ b/liblttng-ust-java/Makefile.am @@ -11,8 +11,8 @@ liblttng_ust_java_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-u all: LTTngUst.class org_lttng_ust_LTTngUst.h liblttng-ust-java.jar clean-local: - rm org_lttng_ust_LTTngUst.h - rm liblttng-ust-java.jar + rm -f org_lttng_ust_LTTngUst.h + rm -f liblttng-ust-java.jar rm -rf org/ LTTngUst.c: org_lttng_ust_LTTngUst.h -- 1.8.1.2 From mathieu.desnoyers at efficios.com Wed May 22 13:24:06 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 22 May 2013 13:24:06 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Add parameter -f to rm in Makefile clean target In-Reply-To: <1369243114-26735-1-git-send-email-simon.marchi@polymtl.ca> References: <1369243114-26735-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: <20130522172405.GB14069@Krystal> * Simon Marchi (simon.marchi at polymtl.ca) wrote: > If the files we want to delete do not exist (for example after a failed > build), the make clean fails. merged, thanks! Mathieu > > Signed-off-by: Simon Marchi > --- > liblttng-ust-java/Makefile.am | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/liblttng-ust-java/Makefile.am b/liblttng-ust-java/Makefile.am > index 4c998dc..57b9532 100644 > --- a/liblttng-ust-java/Makefile.am > +++ b/liblttng-ust-java/Makefile.am > @@ -11,8 +11,8 @@ liblttng_ust_java_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-u > all: LTTngUst.class org_lttng_ust_LTTngUst.h liblttng-ust-java.jar > > clean-local: > - rm org_lttng_ust_LTTngUst.h > - rm liblttng-ust-java.jar > + rm -f org_lttng_ust_LTTngUst.h > + rm -f liblttng-ust-java.jar > rm -rf org/ > > LTTngUst.c: org_lttng_ust_LTTngUst.h > -- > 1.8.1.2 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From suchakrapani.sharma at polymtl.ca Wed May 22 14:46:22 2013 From: suchakrapani.sharma at polymtl.ca (Suchakra Sharma) Date: Wed, 22 May 2013 14:46:22 -0400 Subject: [lttng-dev] Issue with dynamic load and UST Message-ID: <1369248382.1847.41.camel@station15.dorsal.polymtl.ca> Hi, Zifei recently did a demo of dynamic tracing using ust with dyninst [1] The traces are being generated and I did some experiments by adding some more 'tracepoint types' too [2]. This seemed to be a promising approach but then there's an error as follows when I start tracing on a fresh rebooted machine (if a normal session of static userspace tracing is done once, the problem doesn't occur): libust[3429/3429]: Error: Timed out waiting for lttng-sessiond (in lttng_ust_init() at lttng-ust-comm.c:1072) This occurred even after separating the tracepoints [3] Backtrace is at [4]. I was able to reproduce it on my two machines with UST 2.1.2 and dyninst 8.1 (Fedora 18) Is it possible to circumvent this problem somehow? (it seems to be an inherent issue with dlopen w/ sessiond but I may be wrong) [1] https://gist.github.com/anonymous/5599765 [2] https://gist.github.com/tuxology/5602019 [3] https://gist.github.com/anonymous/5605050 [4] https://gist.github.com/5kg/5604931 -- Suchakra From christian.babeux at efficios.com Wed May 22 16:29:33 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Wed, 22 May 2013 16:29:33 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Tests: Fix possible segfault in health check thread exit test Message-ID: <1369254573-1342-1-git-send-email-christian.babeux@efficios.com> The testpoints in the thread_manage_clients and thread_manage_apps are called after a rcu_register_thread() call. The testpoints were not unregistering their respective thread which could later on cause a segfault when shutting down the session daemon. Signed-off-by: Christian Babeux --- tests/regression/tools/health/health_exit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/regression/tools/health/health_exit.c b/tests/regression/tools/health/health_exit.c index 8e41405..8d1d05c 100644 --- a/tests/regression/tools/health/health_exit.c +++ b/tests/regression/tools/health/health_exit.c @@ -18,6 +18,7 @@ #include #include #include +#include /* * Check if the specified environment variable is set. @@ -40,6 +41,7 @@ int __testpoint_thread_manage_clients(void) const char *var = "LTTNG_THREAD_MANAGE_CLIENTS_EXIT"; if (check_env_var(var)) { + rcu_unregister_thread(); pthread_exit(NULL); } @@ -62,6 +64,7 @@ int __testpoint_thread_manage_apps(void) const char *var = "LTTNG_THREAD_MANAGE_APPS_EXIT"; if (check_env_var(var)) { + rcu_unregister_thread(); pthread_exit(NULL); } -- 1.8.2.2 From dgoulet at efficios.com Wed May 22 17:02:31 2013 From: dgoulet at efficios.com (David Goulet) Date: Wed, 22 May 2013 17:02:31 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Tests: Fix possible segfault in health check thread exit test In-Reply-To: <1369254573-1342-1-git-send-email-christian.babeux@efficios.com> References: <1369254573-1342-1-git-send-email-christian.babeux@efficios.com> Message-ID: <519D3267.3060101@efficios.com> Merged! Christian Babeux: > The testpoints in the thread_manage_clients and thread_manage_apps > are called after a rcu_register_thread() call. The testpoints were > not unregistering their respective thread which could later on cause > a segfault when shutting down the session daemon. > > Signed-off-by: Christian Babeux > --- > tests/regression/tools/health/health_exit.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tests/regression/tools/health/health_exit.c b/tests/regression/tools/health/health_exit.c > index 8e41405..8d1d05c 100644 > --- a/tests/regression/tools/health/health_exit.c > +++ b/tests/regression/tools/health/health_exit.c > @@ -18,6 +18,7 @@ > #include > #include > #include > +#include > > /* > * Check if the specified environment variable is set. > @@ -40,6 +41,7 @@ int __testpoint_thread_manage_clients(void) > const char *var = "LTTNG_THREAD_MANAGE_CLIENTS_EXIT"; > > if (check_env_var(var)) { > + rcu_unregister_thread(); > pthread_exit(NULL); > } > > @@ -62,6 +64,7 @@ int __testpoint_thread_manage_apps(void) > const char *var = "LTTNG_THREAD_MANAGE_APPS_EXIT"; > > if (check_env_var(var)) { > + rcu_unregister_thread(); > pthread_exit(NULL); > } > From jan.glauber at gmail.com Thu May 23 07:02:36 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Thu, 23 May 2013 13:02:36 +0200 Subject: [lttng-dev] [PATCH lttng-modules] Fix CPU hotplug section mismatches Message-ID: <1369306957-2562-1-git-send-email-jan.glauber@gmail.com> Get rid of the following section mismatches: WARNING: /home/jang/temp/lttng-modules-2.2.0-r0/git/lttng-tracer.o(.text+0x19dc0): Section mismatch in reference from the function lttng_add_perf_counter_to_ctx() to the function .cpuinit.text:lttng_perf_counter_cpu_hp_callback() The function lttng_add_perf_counter_to_ctx() references the function __cpuinit lttng_perf_counter_cpu_hp_callback(). This is often because lttng_add_perf_counter_to_ctx lacks a __cpuinit annotation or the annotation of lttng_perf_counter_cpu_hp_callback is wrong. WARNING: /home/jang/temp/lttng-modules-2.2.0-r0/git/lib/lttng-lib-ring-buffer.o(.text+0x1204): Section mismatch in reference from the function channel_backend_init() to the function .cpuinit.text:lib_ring_buffer_cpu_hp_callback() The function channel_backend_init() references the function __cpuinit lib_ring_buffer_cpu_hp_callback(). This is often because channel_backend_init lacks a __cpuinit annotation or the annotation of lib_ring_buffer_cpu_hp_callback is wrong. WARNING: /home/jang/temp/lttng-modules-2.2.0-r0/git/lib/lttng-lib-ring-buffer.o(.text+0x269c): Section mismatch in reference from the function channel_create() to the function .cpuinit.text:lib_ring_buffer_cpu_hp_callback() The function channel_create() references the function __cpuinit lib_ring_buffer_cpu_hp_callback(). This is often because channel_create lacks a __cpuinit annotation or the annotation of lib_ring_buffer_cpu_hp_callback is wrong. WARNING: /home/jang/temp/lttng-modules-2.2.0-r0/git/lib/lttng-lib-ring-buffer.o(.text+0x4a1c): Section mismatch in reference from the function channel_iterator_init() to the function .cpuinit.text:channel_iterator_cpu_hotplug() The function channel_iterator_init() references the function __cpuinit channel_iterator_cpu_hotplug(). This is often because channel_iterator_init lacks a __cpuinit annotation or the annotation of channel_iterator_cpu_hotplug is wrong. Signed-off-by: Jan Glauber --- lib/ringbuffer/ring_buffer_backend.c | 2 +- lib/ringbuffer/ring_buffer_frontend.c | 2 +- lib/ringbuffer/ring_buffer_iterator.c | 2 +- lttng-context-perf-counters.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ringbuffer/ring_buffer_backend.c b/lib/ringbuffer/ring_buffer_backend.c index 84e7dfb..69ad2a7 100644 --- a/lib/ringbuffer/ring_buffer_backend.c +++ b/lib/ringbuffer/ring_buffer_backend.c @@ -253,7 +253,7 @@ void channel_backend_reset(struct channel_backend *chanb) * Returns the success/failure of the operation. (%NOTIFY_OK, %NOTIFY_BAD) */ static -int __cpuinit lib_ring_buffer_cpu_hp_callback(struct notifier_block *nb, +int lib_ring_buffer_cpu_hp_callback(struct notifier_block *nb, unsigned long action, void *hcpu) { diff --git a/lib/ringbuffer/ring_buffer_frontend.c b/lib/ringbuffer/ring_buffer_frontend.c index 2626afa..bff920d 100644 --- a/lib/ringbuffer/ring_buffer_frontend.c +++ b/lib/ringbuffer/ring_buffer_frontend.c @@ -402,7 +402,7 @@ static void lib_ring_buffer_stop_read_timer(struct lib_ring_buffer *buf) * Returns the success/failure of the operation. (%NOTIFY_OK, %NOTIFY_BAD) */ static -int __cpuinit lib_ring_buffer_cpu_hp_callback(struct notifier_block *nb, +int lib_ring_buffer_cpu_hp_callback(struct notifier_block *nb, unsigned long action, void *hcpu) { diff --git a/lib/ringbuffer/ring_buffer_iterator.c b/lib/ringbuffer/ring_buffer_iterator.c index e7c6cb7..9d0197c 100644 --- a/lib/ringbuffer/ring_buffer_iterator.c +++ b/lib/ringbuffer/ring_buffer_iterator.c @@ -351,7 +351,7 @@ void lib_ring_buffer_iterator_init(struct channel *chan, struct lib_ring_buffer #ifdef CONFIG_HOTPLUG_CPU static -int __cpuinit channel_iterator_cpu_hotplug(struct notifier_block *nb, +int channel_iterator_cpu_hotplug(struct notifier_block *nb, unsigned long action, void *hcpu) { diff --git a/lttng-context-perf-counters.c b/lttng-context-perf-counters.c index e0714eb..73f4e95 100644 --- a/lttng-context-perf-counters.c +++ b/lttng-context-perf-counters.c @@ -120,7 +120,7 @@ void lttng_destroy_perf_counter_field(struct lttng_ctx_field *field) * soon). */ static -int __cpuinit lttng_perf_counter_cpu_hp_callback(struct notifier_block *nb, +int lttng_perf_counter_cpu_hp_callback(struct notifier_block *nb, unsigned long action, void *hcpu) { -- 1.7.9.5 From ionut5001 at gmail.com Thu May 23 07:19:08 2013 From: ionut5001 at gmail.com (Ionut D.) Date: Thu, 23 May 2013 14:19:08 +0300 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: Sorry for my late response. At the end after different some adds (defines in libc) I managed to compile them for ICS with NDK r7c. I was a problem of environment. On Tue, May 21, 2013 at 9:26 PM, Pierre-Luc St-Charles < pierre-luc.st-charles at polymtl.ca> wrote: > 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). > > > On Tue, May 21, 2013 at 11:29 AM, Ionut D. wrote: > >> 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: >> >> NDK: >> #grep -r __NR_splice . >> ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define >> __NR_splice 313 >> ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define >> __NR_splice 313 >> >> bionic: >> grep -r __NR_splice bionic >> bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice 313 >> bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice 341 >> bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice 313 >> >> Looking through results I see that '__NR_splice' it not in unistd.h and I >> know this is important. >> >> Ionut >> >> >> On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < >> pierre-luc.st-charles at polymtl.ca> wrote: >> >>> 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. >>> >>> 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. >>> >>> 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? >>> >>> -PL >>> >>> >>> On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: >>> >>>> 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? >>>> >>>> >>>> In file included from >>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >>>> In function 'splice': >>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>> error: '__NR_splice' undeclared (first use in this function) >>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>> error: (Each undeclared identifier is reported only once >>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>> error: for each function it appears in.) >>>> In file included from >>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >>>> warning: "POSIX_FADV_DONTNEED" redefined >>>> In file included from >>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >>>> from >>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is the >>>> location of the previous definition >>>> In file included from bionic/libc/include/sys/select.h:34, >>>> from bionic/libc/include/unistd.h:34, >>>> from >>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>> external/lttng-tools/src/common/compat/signal.h: At top level: >>>> external/lttng-tools/src/common/compat/signal.h:27: error: expected >>>> ';', ',' or ')' before '*' token >>>> external/lttng-tools/src/common/compat/signal.h:28: error: expected >>>> ';', ',' or ')' before '*' token >>>> external/lttng-tools/src/common/compat/signal.h:29: error: expected >>>> ';', ',' or ')' before '*' token >>>> In file included from bionic/libc/include/unistd.h:34, >>>> from >>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>> bionic/libc/include/sys/select.h:42: error: expected ';', ',' or ')' >>>> before '*' token >>>> >>>> >>>> >>>> On Sat, May 18, 2013 at 10:21 AM, Ionut D. wrote: >>>> >>>>> Great informations! I will post back the results. >>>>> >>>>> >>>>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>> >>>>>> Alright, small update for all following a quick (non-mailing-list) >>>>>> exchange: >>>>>> >>>>>> 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 >>>>>> here; >>>>>> still not perfect). >>>>>> >>>>>> 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). >>>>>> >>>>>> 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). >>>>>> >>>>>> 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). >>>>>> >>>>>> 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. >>>>>> >>>>>> So, simple 'how do I put LTTng on Android' workflow would be this: >>>>>> >>>>>> - Compile modules (using NDK) against device's kernel, making sure >>>>>> its config is appropriate, ship them over via ADB >>>>>> >>>>>> - Compile required external libraries (using repo build system) for >>>>>> the device, ship them over via ADB >>>>>> >>>>>> - 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) >>>>>> >>>>>> - Cross-compile LTTng-* for the device (using NDK), ship binaries >>>>>> over via ADB >>>>>> >>>>>> Then, on the device, start up the sessiond manually & start tracing. >>>>>> >>>>>> >>>>>> I think I went over everything, but if there's a part that's still >>>>>> cloudy, don't hesitate. >>>>>> >>>>>> >>>>>> -PL >>>>>> >>>>>> >>>>>> On May 17, 2013 1:32 AM, "Ionut D." wrote: >>>>>> >>>>>>> Hello all, >>>>>>> >>>>>>> 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. >>>>>>> >>>>>>> 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. >>>>>>> >>>>>>> It is ok? what I am trying to do ? to integrate and build by using >>>>>>> the Android build system. >>>>>>> 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 ? >>>>>>> >>>>>>> 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. >>>>>>> >>>>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>>>> >>>>>>> Would be great if you will give me a tutorial about how to do it. >>>>>>> >>>>>>> Ionut >>>>>>> >>>>>>> _______________________________________________ >>>>>>> lttng-dev mailing list >>>>>>> lttng-dev at lists.lttng.org >>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>> >>>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.desnoyers at efficios.com Thu May 23 07:37:42 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 23 May 2013 07:37:42 -0400 Subject: [lttng-dev] [PATCH lttng-modules] Fix CPU hotplug section mismatches In-Reply-To: <1369306957-2562-1-git-send-email-jan.glauber@gmail.com> References: <1369306957-2562-1-git-send-email-jan.glauber@gmail.com> Message-ID: <20130523113742.GA11265@Krystal> Merged, thanks! Mathieu * Jan Glauber (jan.glauber at gmail.com) wrote: > Get rid of the following section mismatches: > > WARNING: /home/jang/temp/lttng-modules-2.2.0-r0/git/lttng-tracer.o(.text+0x19dc0): Section mismatch in reference from the function lttng_add_perf_counter_to_ctx() to the function .cpuinit.text:lttng_perf_counter_cpu_hp_callback() > The function lttng_add_perf_counter_to_ctx() references > the function __cpuinit lttng_perf_counter_cpu_hp_callback(). > This is often because lttng_add_perf_counter_to_ctx lacks a __cpuinit > annotation or the annotation of lttng_perf_counter_cpu_hp_callback is wrong. > > WARNING: /home/jang/temp/lttng-modules-2.2.0-r0/git/lib/lttng-lib-ring-buffer.o(.text+0x1204): Section mismatch in reference from the function channel_backend_init() to the function .cpuinit.text:lib_ring_buffer_cpu_hp_callback() > The function channel_backend_init() references > the function __cpuinit lib_ring_buffer_cpu_hp_callback(). > This is often because channel_backend_init lacks a __cpuinit > annotation or the annotation of lib_ring_buffer_cpu_hp_callback is wrong. > > WARNING: /home/jang/temp/lttng-modules-2.2.0-r0/git/lib/lttng-lib-ring-buffer.o(.text+0x269c): Section mismatch in reference from the function channel_create() to the function .cpuinit.text:lib_ring_buffer_cpu_hp_callback() > The function channel_create() references > the function __cpuinit lib_ring_buffer_cpu_hp_callback(). > This is often because channel_create lacks a __cpuinit > annotation or the annotation of lib_ring_buffer_cpu_hp_callback is wrong. > > WARNING: /home/jang/temp/lttng-modules-2.2.0-r0/git/lib/lttng-lib-ring-buffer.o(.text+0x4a1c): Section mismatch in reference from the function channel_iterator_init() to the function .cpuinit.text:channel_iterator_cpu_hotplug() > The function channel_iterator_init() references > the function __cpuinit channel_iterator_cpu_hotplug(). > This is often because channel_iterator_init lacks a __cpuinit > annotation or the annotation of channel_iterator_cpu_hotplug is wrong. > > Signed-off-by: Jan Glauber > --- > lib/ringbuffer/ring_buffer_backend.c | 2 +- > lib/ringbuffer/ring_buffer_frontend.c | 2 +- > lib/ringbuffer/ring_buffer_iterator.c | 2 +- > lttng-context-perf-counters.c | 2 +- > 4 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/lib/ringbuffer/ring_buffer_backend.c b/lib/ringbuffer/ring_buffer_backend.c > index 84e7dfb..69ad2a7 100644 > --- a/lib/ringbuffer/ring_buffer_backend.c > +++ b/lib/ringbuffer/ring_buffer_backend.c > @@ -253,7 +253,7 @@ void channel_backend_reset(struct channel_backend *chanb) > * Returns the success/failure of the operation. (%NOTIFY_OK, %NOTIFY_BAD) > */ > static > -int __cpuinit lib_ring_buffer_cpu_hp_callback(struct notifier_block *nb, > +int lib_ring_buffer_cpu_hp_callback(struct notifier_block *nb, > unsigned long action, > void *hcpu) > { > diff --git a/lib/ringbuffer/ring_buffer_frontend.c b/lib/ringbuffer/ring_buffer_frontend.c > index 2626afa..bff920d 100644 > --- a/lib/ringbuffer/ring_buffer_frontend.c > +++ b/lib/ringbuffer/ring_buffer_frontend.c > @@ -402,7 +402,7 @@ static void lib_ring_buffer_stop_read_timer(struct lib_ring_buffer *buf) > * Returns the success/failure of the operation. (%NOTIFY_OK, %NOTIFY_BAD) > */ > static > -int __cpuinit lib_ring_buffer_cpu_hp_callback(struct notifier_block *nb, > +int lib_ring_buffer_cpu_hp_callback(struct notifier_block *nb, > unsigned long action, > void *hcpu) > { > diff --git a/lib/ringbuffer/ring_buffer_iterator.c b/lib/ringbuffer/ring_buffer_iterator.c > index e7c6cb7..9d0197c 100644 > --- a/lib/ringbuffer/ring_buffer_iterator.c > +++ b/lib/ringbuffer/ring_buffer_iterator.c > @@ -351,7 +351,7 @@ void lib_ring_buffer_iterator_init(struct channel *chan, struct lib_ring_buffer > > #ifdef CONFIG_HOTPLUG_CPU > static > -int __cpuinit channel_iterator_cpu_hotplug(struct notifier_block *nb, > +int channel_iterator_cpu_hotplug(struct notifier_block *nb, > unsigned long action, > void *hcpu) > { > diff --git a/lttng-context-perf-counters.c b/lttng-context-perf-counters.c > index e0714eb..73f4e95 100644 > --- a/lttng-context-perf-counters.c > +++ b/lttng-context-perf-counters.c > @@ -120,7 +120,7 @@ void lttng_destroy_perf_counter_field(struct lttng_ctx_field *field) > * soon). > */ > static > -int __cpuinit lttng_perf_counter_cpu_hp_callback(struct notifier_block *nb, > +int lttng_perf_counter_cpu_hp_callback(struct notifier_block *nb, > unsigned long action, > void *hcpu) > { > -- > 1.7.9.5 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From Daniel.Thibault at drdc-rddc.gc.ca Thu May 23 09:13:29 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 23 May 2013 13:13:29 +0000 Subject: [lttng-dev] CTF viewing with timeless events Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D1A81F@VAL-E-02.valcartier.drdc-rddc.gc.ca> Date: Wed, 22 May 2013 10:04:41 -0400 From: Matthew Khouzam I was given an interesting corner case and want to explain how I believe it should be handled. You are given a trace with no timestamps, and n channels. How do you display the events? I propose (and have implemented) that we have a secondary fallback key to sort events. Right now, I believe babeltrace will sort by timestamp and that's it. The eclipse viewer sorts by timestamp and if timestamps match, it sorts by stream file name. In one given trace, stream file names are unique like (channel_0). This means if you have 5 stream files with five events each, it will always output as "stream1: e1-e2-e3-e4-e5 stream2: e1-e2-e3-e4-e5 stream3: e1-e2-e3-e4-e5 stream4: e1-e2-e3-e4-e5 stream5: e1-e2-e3-e4-e5" This should avoid confusion from a reader's perspective. Comments? ------------------------------ At first I thought this had to be wrong because trace events always have a time-stamp, but then I reread the CTF spec and, indeed, *all* of the event packet context fields are optional, so it is possible to have a timeless trace. In which case I agree with this design. Daniel U. Thibault Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure Qu?bec QC G3J 1X5 CANADA Vox : (418) 844-4000 x4245 Fax : (418) 844-4538 NAC : 918V QSDJ Gouvernement du Canada | Government of Canada From ionut5001 at gmail.com Thu May 23 10:40:38 2013 From: ionut5001 at gmail.com (Ionut D.) Date: Thu, 23 May 2013 17:40:38 +0300 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: About the kernel modules. Where should they be located on the target? Should I have modprobe or insmod it is enough? On Thu, May 23, 2013 at 2:19 PM, Ionut D. wrote: > Sorry for my late response. At the end after different some adds (defines > in libc) I managed to compile them for ICS with NDK r7c. I was a problem of > environment. > > > On Tue, May 21, 2013 at 9:26 PM, Pierre-Luc St-Charles < > pierre-luc.st-charles at polymtl.ca> wrote: > >> 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). >> >> >> On Tue, May 21, 2013 at 11:29 AM, Ionut D. wrote: >> >>> 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: >>> >>> NDK: >>> #grep -r __NR_splice . >>> ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define >>> __NR_splice 313 >>> ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define >>> __NR_splice 313 >>> >>> bionic: >>> grep -r __NR_splice bionic >>> bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice 313 >>> bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice 341 >>> bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice 313 >>> >>> Looking through results I see that '__NR_splice' it not in unistd.h and >>> I know this is important. >>> >>> Ionut >>> >>> >>> On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < >>> pierre-luc.st-charles at polymtl.ca> wrote: >>> >>>> 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. >>>> >>>> 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. >>>> >>>> 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? >>>> >>>> -PL >>>> >>>> >>>> On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: >>>> >>>>> 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? >>>>> >>>>> >>>>> In file included from >>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >>>>> In function 'splice': >>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>> error: '__NR_splice' undeclared (first use in this function) >>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>> error: (Each undeclared identifier is reported only once >>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>> error: for each function it appears in.) >>>>> In file included from >>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >>>>> warning: "POSIX_FADV_DONTNEED" redefined >>>>> In file included from >>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >>>>> from >>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is the >>>>> location of the previous definition >>>>> In file included from bionic/libc/include/sys/select.h:34, >>>>> from bionic/libc/include/unistd.h:34, >>>>> from >>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>> external/lttng-tools/src/common/compat/signal.h: At top level: >>>>> external/lttng-tools/src/common/compat/signal.h:27: error: expected >>>>> ';', ',' or ')' before '*' token >>>>> external/lttng-tools/src/common/compat/signal.h:28: error: expected >>>>> ';', ',' or ')' before '*' token >>>>> external/lttng-tools/src/common/compat/signal.h:29: error: expected >>>>> ';', ',' or ')' before '*' token >>>>> In file included from bionic/libc/include/unistd.h:34, >>>>> from >>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>> bionic/libc/include/sys/select.h:42: error: expected ';', ',' or ')' >>>>> before '*' token >>>>> >>>>> >>>>> >>>>> On Sat, May 18, 2013 at 10:21 AM, Ionut D. wrote: >>>>> >>>>>> Great informations! I will post back the results. >>>>>> >>>>>> >>>>>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>> >>>>>>> Alright, small update for all following a quick (non-mailing-list) >>>>>>> exchange: >>>>>>> >>>>>>> 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 >>>>>>> here; >>>>>>> still not perfect). >>>>>>> >>>>>>> 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). >>>>>>> >>>>>>> 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). >>>>>>> >>>>>>> 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). >>>>>>> >>>>>>> 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. >>>>>>> >>>>>>> So, simple 'how do I put LTTng on Android' workflow would be this: >>>>>>> >>>>>>> - Compile modules (using NDK) against device's kernel, making sure >>>>>>> its config is appropriate, ship them over via ADB >>>>>>> >>>>>>> - Compile required external libraries (using repo build system) >>>>>>> for the device, ship them over via ADB >>>>>>> >>>>>>> - 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) >>>>>>> >>>>>>> - Cross-compile LTTng-* for the device (using NDK), ship binaries >>>>>>> over via ADB >>>>>>> >>>>>>> Then, on the device, start up the sessiond manually & start tracing. >>>>>>> >>>>>>> >>>>>>> I think I went over everything, but if there's a part that's still >>>>>>> cloudy, don't hesitate. >>>>>>> >>>>>>> >>>>>>> -PL >>>>>>> >>>>>>> >>>>>>> On May 17, 2013 1:32 AM, "Ionut D." wrote: >>>>>>> >>>>>>>> Hello all, >>>>>>>> >>>>>>>> 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. >>>>>>>> >>>>>>>> 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. >>>>>>>> >>>>>>>> It is ok? what I am trying to do ? to integrate and build by using >>>>>>>> the Android build system. >>>>>>>> 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 ? >>>>>>>> >>>>>>>> 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. >>>>>>>> >>>>>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>>>>> >>>>>>>> Would be great if you will give me a tutorial about how to do it. >>>>>>>> >>>>>>>> Ionut >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> lttng-dev mailing list >>>>>>>> lttng-dev at lists.lttng.org >>>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>>> >>>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.briere at polymtl.ca Thu May 23 11:09:19 2013 From: charles.briere at polymtl.ca (=?ISO-8859-1?Q?Charles_Bri=E8re?=) Date: Thu, 23 May 2013 11:09:19 -0400 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: Module location doesn't really matter, we used to push them to /data/... or /sdcard/... . Modprobe doesn't exists on Android so you'll need to use insmod. We used this script in order to compile, push to device and load modules. We also made a presentation you might be interested in that can be viewed on https://docs.google.com/presentation/d/14lte2AchEAyxMk3WSQ53SdbBm2tfmABBFQojuUhxg7Y/pub?start=false&loop=false&delayms=3000 On Thu, May 23, 2013 at 10:40 AM, Ionut D. wrote: > About the kernel modules. Where should they be located on the target? > Should I have modprobe or insmod it is enough? > > > On Thu, May 23, 2013 at 2:19 PM, Ionut D. wrote: > >> Sorry for my late response. At the end after different some adds (defines >> in libc) I managed to compile them for ICS with NDK r7c. I was a problem of >> environment. >> >> >> On Tue, May 21, 2013 at 9:26 PM, Pierre-Luc St-Charles < >> pierre-luc.st-charles at polymtl.ca> wrote: >> >>> 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). >>> >>> >>> On Tue, May 21, 2013 at 11:29 AM, Ionut D. wrote: >>> >>>> 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: >>>> >>>> NDK: >>>> #grep -r __NR_splice . >>>> ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define >>>> __NR_splice 313 >>>> ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define >>>> __NR_splice 313 >>>> >>>> bionic: >>>> grep -r __NR_splice bionic >>>> bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice 313 >>>> bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice 341 >>>> bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice 313 >>>> >>>> Looking through results I see that '__NR_splice' it not in unistd.h and >>>> I know this is important. >>>> >>>> Ionut >>>> >>>> >>>> On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < >>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>> >>>>> 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. >>>>> >>>>> 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. >>>>> >>>>> 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? >>>>> >>>>> -PL >>>>> >>>>> >>>>> On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: >>>>> >>>>>> 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? >>>>>> >>>>>> >>>>>> In file included from >>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >>>>>> In function 'splice': >>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>> error: '__NR_splice' undeclared (first use in this function) >>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>> error: (Each undeclared identifier is reported only once >>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>> error: for each function it appears in.) >>>>>> In file included from >>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >>>>>> warning: "POSIX_FADV_DONTNEED" redefined >>>>>> In file included from >>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >>>>>> from >>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is the >>>>>> location of the previous definition >>>>>> In file included from bionic/libc/include/sys/select.h:34, >>>>>> from bionic/libc/include/unistd.h:34, >>>>>> from >>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>> external/lttng-tools/src/common/compat/signal.h: At top level: >>>>>> external/lttng-tools/src/common/compat/signal.h:27: error: expected >>>>>> ';', ',' or ')' before '*' token >>>>>> external/lttng-tools/src/common/compat/signal.h:28: error: expected >>>>>> ';', ',' or ')' before '*' token >>>>>> external/lttng-tools/src/common/compat/signal.h:29: error: expected >>>>>> ';', ',' or ')' before '*' token >>>>>> In file included from bionic/libc/include/unistd.h:34, >>>>>> from >>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>> bionic/libc/include/sys/select.h:42: error: expected ';', ',' or ')' >>>>>> before '*' token >>>>>> >>>>>> >>>>>> >>>>>> On Sat, May 18, 2013 at 10:21 AM, Ionut D. wrote: >>>>>> >>>>>>> Great informations! I will post back the results. >>>>>>> >>>>>>> >>>>>>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>> >>>>>>>> Alright, small update for all following a quick (non-mailing-list) >>>>>>>> exchange: >>>>>>>> >>>>>>>> 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 >>>>>>>> here; >>>>>>>> still not perfect). >>>>>>>> >>>>>>>> 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). >>>>>>>> >>>>>>>> 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). >>>>>>>> >>>>>>>> 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). >>>>>>>> >>>>>>>> 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. >>>>>>>> >>>>>>>> So, simple 'how do I put LTTng on Android' workflow would be this: >>>>>>>> >>>>>>>> - Compile modules (using NDK) against device's kernel, making >>>>>>>> sure its config is appropriate, ship them over via ADB >>>>>>>> >>>>>>>> - Compile required external libraries (using repo build system) >>>>>>>> for the device, ship them over via ADB >>>>>>>> >>>>>>>> - 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) >>>>>>>> >>>>>>>> - Cross-compile LTTng-* for the device (using NDK), ship binaries >>>>>>>> over via ADB >>>>>>>> >>>>>>>> Then, on the device, start up the sessiond manually & start tracing. >>>>>>>> >>>>>>>> >>>>>>>> I think I went over everything, but if there's a part that's still >>>>>>>> cloudy, don't hesitate. >>>>>>>> >>>>>>>> >>>>>>>> -PL >>>>>>>> >>>>>>>> >>>>>>>> On May 17, 2013 1:32 AM, "Ionut D." wrote: >>>>>>>> >>>>>>>>> Hello all, >>>>>>>>> >>>>>>>>> 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. >>>>>>>>> >>>>>>>>> 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. >>>>>>>>> >>>>>>>>> It is ok? what I am trying to do ? to integrate and build by using >>>>>>>>> the Android build system. >>>>>>>>> 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 ? >>>>>>>>> >>>>>>>>> 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. >>>>>>>>> >>>>>>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>>>>>> >>>>>>>>> Would be great if you will give me a tutorial about how to do it. >>>>>>>>> >>>>>>>>> Ionut >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> lttng-dev mailing list >>>>>>>>> lttng-dev at lists.lttng.org >>>>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>>>> >>>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yangw.wang5 at unb.ca Thu May 23 15:04:17 2013 From: yangw.wang5 at unb.ca (Yang Wang) Date: Thu, 23 May 2013 19:04:17 +0000 Subject: [lttng-dev] Mariadb+LTTng2.x works Message-ID: <8E0A14A4C9B95B459AE214584119C1EB417EFDAE@tulip.ad.unb.ca> Mariadb+LTTng2.x is now working. Let me know if you all know any java benchmark to test it? Yang ________________________________________ From: Mathieu Desnoyers [mathieu.desnoyers at efficios.com] Sent: Wednesday, May 22, 2013 9:54 AM To: Yang Wang Cc: Alexandre Montplaisir; Yannick Brosseau; David Goulet; Graeme Johnson; Kenneth Kent; lttng-dev at lists.lttng.org Subject: Re: Mariadb+LTTng 2.x Ensure that you don't have a old sessiond binary still running, that you issue ldconfig as root, that you don't have stale old libs in /usr/lib nor /usr/local/lib Thanks, Mathieu * Yang Wang (yangw.wang5 at unb.ca) wrote: > Hello Alex, > > I reinstalled lttng-tools-2.1.0 and compiled Mariadb with lttng-ust.2.1.2(now they work together) > The following is related to lttng-tools-2.1.0 in /usr/local/lib after I reinstalled it. > > -rw-r--r-- 1 root root 1018130 May 18 13:50 liblttng-ctl.a > -rwxr-xr-x 1 root root 1035 May 18 13:50 liblttng-ctl.la > lrwxrwxrwx 1 root root 21 May 18 13:50 liblttng-ctl.so -> liblttng-ctl.so.0.0.0 > lrwxrwxrwx 1 root root 21 May 18 13:50 liblttng-ctl.so.0 -> liblttng-ctl.so.0.0.0 > -rwxr-xr-x 1 root root 491876 May 18 13:50 liblttng-ctl.so.0.0.0 > > But it reports the same error as before. If it is a compatibility problem, why my instrumented > J9 VM with lttng-ust.2.1.2 has no this errors? > > Yang > > ________________________________________ > From: Alexandre Montplaisir [alexmonthy at voxpopuli.im] > Sent: Friday, May 17, 2013 6:28 PM > To: Yang Wang > Cc: Mathieu Desnoyers; Yannick Brosseau; David Goulet; Graeme Johnson; Kenneth Kent; lttng-dev at lists.lttng.org > Subject: Re: Mariadb+LTTng 2.x > > Hi Yang, > > On 13-05-17 05:21 PM, Yang Wang wrote: > > It seems not this compatibility problem. I have removed all ust1.0 stuffs in the instrumented Mariadb code and > > replaced with lttng-ust 2.x say, tracepoint statements, trancepoint provider files, probes files and use the lib -llttng-ust instead of -lust. Anything I missed? > > Mathieu was talking about 2.0 vs 2.1, not 0.x vs 2.x. > > If you compiled your application with lttng-ust 2.1, make sure you use > lttng-tools 2.1 to trace it. lttng-tools 2.0 will not work. > > > > > Is "libust[7848/7853]: " reported from lttng-tools 2.0? Actually, this is printed from > > Yeah I think this is normal, this is old stuff that dates from the 0.x > days, but lttng-ust still prints it that way. > > > Cheers, > Alex > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jdesfossez at efficios.com Thu May 23 16:13:35 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Thu, 23 May 2013 16:13:35 -0400 Subject: [lttng-dev] [LTTNG-TOOLS PATCH] Fix: close wait_fd on kernel tracing Message-ID: <1369340015-6895-1-git-send-email-jdesfossez@efficios.com> The wait_fd in the kernel consumer streams was not closed causing a leak of FDs in the consumer and never triggering the teardown mechanism in the kernel tracer. Signed-off-by: Julien Desfossez --- src/common/consumer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/consumer.c b/src/common/consumer.c index 044a504..84865d3 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -463,6 +463,10 @@ void consumer_del_stream(struct lttng_consumer_stream *stream, PERROR("munmap"); } } + ret = close(stream->wait_fd); + if (ret) { + PERROR("close"); + } break; case LTTNG_CONSUMER32_UST: case LTTNG_CONSUMER64_UST: -- 1.7.10.4 From jdesfossez at efficios.com Thu May 23 17:07:08 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Thu, 23 May 2013 17:07:08 -0400 Subject: [lttng-dev] [LTTNG-TOOLS PATCH] Fix: error handling in kernel add_channel Message-ID: <1369343228-11014-1-git-send-email-jdesfossez@efficios.com> consumer_add_channel can return an error, it needs to be handled. Also, init_kernel_tracing returns a positive lttng_error_code on error, so the check in start_kernel_session needs to be for ret != 0. Signed-off-by: Julien Desfossez --- src/bin/lttng-sessiond/cmd.c | 2 +- src/common/consumer.c | 2 +- src/common/kernel-consumer/kernel-consumer.c | 19 +++++++++++++------ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 4eacb3c..cbf2bce 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -754,7 +754,7 @@ static int start_kernel_session(struct ltt_kernel_session *ksess, int wpipe) /* Setup kernel consumer socket and send fds to it */ ret = init_kernel_tracing(ksess); - if (ret < 0) { + if (ret != 0) { ret = LTTNG_ERR_KERN_START_FAIL; goto error; } diff --git a/src/common/consumer.c b/src/common/consumer.c index 84865d3..c9e4bae 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -903,7 +903,7 @@ int consumer_add_channel(struct lttng_consumer_channel *channel, /* Channel already exist. Ignore the insertion */ ERR("Consumer add channel key %" PRIu64 " already exists!", channel->key); - ret = -1; + ret = LTTNG_ERR_KERN_CHAN_EXIST; goto end; } diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index d985014..f3a3a22 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -122,6 +122,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, case LTTNG_CONSUMER_ADD_CHANNEL: { struct lttng_consumer_channel *new_channel; + int ret_recv; /* First send a status message before receiving the fds. */ ret = consumer_send_status_msg(sock, ret_code); @@ -129,7 +130,6 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, /* Somehow, the session daemon is not responding anymore. */ goto end_nosignal; } - DBG("consumer_add_channel %" PRIu64, msg.u.channel.channel_key); new_channel = consumer_allocate_channel(msg.u.channel.channel_key, msg.u.channel.session_id, msg.u.channel.pathname, @@ -155,15 +155,22 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, }; if (ctx->on_recv_channel != NULL) { - ret = ctx->on_recv_channel(new_channel); - if (ret == 0) { - consumer_add_channel(new_channel, ctx); - } else if (ret < 0) { + ret_recv = ctx->on_recv_channel(new_channel); + if (ret_recv == 0) { + ret = consumer_add_channel(new_channel, ctx); + } else if (ret_recv < 0) { goto end_nosignal; } } else { - consumer_add_channel(new_channel, ctx); + ret = consumer_add_channel(new_channel, ctx); + } + + /* If we received an error in add_channel, we need to report it. */ + if (ret != 0) { + consumer_send_status_msg(sock, ret); + goto end_nosignal; } + goto end_nosignal; } case LTTNG_CONSUMER_ADD_STREAM: -- 1.7.10.4 From jdesfossez at efficios.com Thu May 23 17:43:51 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Thu, 23 May 2013 17:43:51 -0400 Subject: [lttng-dev] [LTTNG-TOOLS PATCH] Fix: increment channel refcount on add_stream Message-ID: <1369345431-15885-1-git-send-email-jdesfossez@efficios.com> Signed-off-by: Julien Desfossez --- src/common/consumer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/consumer.c b/src/common/consumer.c index c9e4bae..bfb809a 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -663,6 +663,9 @@ static int add_stream(struct lttng_consumer_stream *stream, uatomic_inc(&relayd->refcount); } + /* Update channel refcount once added without error(s). */ + uatomic_inc(&stream->chan->refcount); + /* * When nb_init_stream_left reaches 0, we don't need to trigger any action * in terms of destroying the associated channel, because the action that -- 1.7.10.4 From mathieu.desnoyers at efficios.com Thu May 23 18:07:16 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 23 May 2013 18:07:16 -0400 Subject: [lttng-dev] [LTTNG-TOOLS PATCH] Fix: increment channel refcount on add_stream In-Reply-To: <1369345431-15885-1-git-send-email-jdesfossez@efficios.com> References: <1369345431-15885-1-git-send-email-jdesfossez@efficios.com> Message-ID: <20130523220716.GB16552@Krystal> * Julien Desfossez (jdesfossez at efficios.com) wrote: > Signed-off-by: Julien Desfossez check the impact on the ust side ? > --- > src/common/consumer.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/common/consumer.c b/src/common/consumer.c > index c9e4bae..bfb809a 100644 > --- a/src/common/consumer.c > +++ b/src/common/consumer.c > @@ -663,6 +663,9 @@ static int add_stream(struct lttng_consumer_stream *stream, > uatomic_inc(&relayd->refcount); > } > > + /* Update channel refcount once added without error(s). */ > + uatomic_inc(&stream->chan->refcount); > + > /* > * When nb_init_stream_left reaches 0, we don't need to trigger any action > * in terms of destroying the associated channel, because the action that > -- > 1.7.10.4 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Thu May 23 18:09:29 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 23 May 2013 18:09:29 -0400 Subject: [lttng-dev] [LTTNG-TOOLS PATCH] Fix: increment channel refcount on add_stream In-Reply-To: <20130523220716.GB16552@Krystal> References: <1369345431-15885-1-git-send-email-jdesfossez@efficios.com> <20130523220716.GB16552@Krystal> Message-ID: <519E9399.1040109@efficios.com> We can't merge that for UST. However, it needs to be done on the kernel side! Removing it from the add_stream did impact the kernel. This is a good fine but should not be done there. See commit: b31398bb2b3fa91a53dea3b36fd693da4b50e0d3 David Mathieu Desnoyers: > * Julien Desfossez (jdesfossez at efficios.com) wrote: >> Signed-off-by: Julien Desfossez > > check the impact on the ust side ? > >> --- >> src/common/consumer.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/src/common/consumer.c b/src/common/consumer.c >> index c9e4bae..bfb809a 100644 >> --- a/src/common/consumer.c >> +++ b/src/common/consumer.c >> @@ -663,6 +663,9 @@ static int add_stream(struct lttng_consumer_stream *stream, >> uatomic_inc(&relayd->refcount); >> } >> >> + /* Update channel refcount once added without error(s). */ >> + uatomic_inc(&stream->chan->refcount); >> + >> /* >> * When nb_init_stream_left reaches 0, we don't need to trigger any action >> * in terms of destroying the associated channel, because the action that >> -- >> 1.7.10.4 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > From jdesfossez at efficios.com Thu May 23 19:07:20 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Thu, 23 May 2013 19:07:20 -0400 Subject: [lttng-dev] [LTTNG-TOOLS PATCH v2] Fix: increment channel refcount on add_stream Message-ID: <1369350440-30563-1-git-send-email-jdesfossez@efficios.com> Signed-off-by: Julien Desfossez --- src/common/kernel-consumer/kernel-consumer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index f3a3a22..f47c498 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -255,6 +255,12 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, new_stream->chan = channel; new_stream->wait_fd = fd; + /* Metadata chan refcount is increment in add_metadata_stream */ + if (new_stream->chan->type != CONSUMER_CHANNEL_TYPE_METADATA) { + /* Update channel refcount */ + uatomic_inc(&new_stream->chan->refcount); + } + /* * The buffer flush is done on the session daemon side for the kernel * so no need for the stream "hangup_flush_done" variable to be -- 1.7.10.4 From David.OShea at quantum.com Thu May 23 20:23:25 2013 From: David.OShea at quantum.com (David OShea) Date: Fri, 24 May 2013 00:23:25 +0000 Subject: [lttng-dev] Patches to enable building on CentOS 5.x (glibc 2.5) In-Reply-To: References: <20998D40D9A2B7499CA5A3A2666CB1EB23FDCE2B@ZURMSG1.QUANTUM.com> <20998D40D9A2B7499CA5A3A2666CB1EB23FDDEC5@ZURMSG1.QUANTUM.com> Message-ID: <20998D40D9A2B7499CA5A3A2666CB1EB23FDEE5A@ZURMSG1.QUANTUM.com> Hi all, Since there is more than one user interested in old glibc versions, does that mean we might be able to get the support into mainline? Thanks in advance, David > -----Original Message----- > From: yin sun [mailto:sunyin51 at gmail.com] > Sent: Saturday, 18 May 2013 12:51 AM > To: David OShea > Cc: Brosseau, Yannick; lttng-dev at lists.lttng.org > Subject: Re: [lttng-dev] Patches to enable building on CentOS 5.x > (glibc 2.5) > > Support lower version of glibc does provide value. In my case, it will > enable me easily port to existing production system, which is always > several versions behind. > > Thanks, > /Yin > > On Thu, May 16, 2013 at 11:52 PM, David OShea > wrote: > > Hi Yannick, > > > > > > > > Yes, we patched the latest (as of around a month ago) versions to > work on > > CentOS 5. Sorry, I neglected to mention that this is for UST only, > not > > kernel tracing, hence my not saying anything about the modules! > > > > > > > > If the changes aren't going to go upstream into the git repositories, > I > > imagine there is more chance of the CentOS 5 support becoming broken > - > > something could be committed upstream that requires further patching, > or > > conflicts with the patches. In this case, then, I don't think EPEL > packages > > would help us much, and quite possibly nobody else is interested in > CentOS 5 > > :) Also, we needed to backport some lttng-ust commits from master to > get > > support for dynamic trace providers to work, so we're more interested > in > > seeing future releases include the changes than seeing a patched > version of > > the current release, and therefore I don't think there would be any > value in > > us moving to an EPEL package for the same version of LTTng that we're > > already using. > > > > > > > > I can certainly provide the patches to you anyway, but I'm not so > keen to > > spend time improving them if they're not going upstream, e.g. one > thing I > > think needs to be investigated is whether the kernel versions > provided by > > CentOS 5 include the system calls that we had to add wrappers for; I > haven't > > paid any attention to what kernel version I'm using, I'm not sure if > it is a > > standard CentOS 5 one. > > > > > > > > Thanks! > > David > > > > > > > > > > > > From: Brosseau, Yannick [mailto:yannick.brosseau at gmail.com] > > Sent: Friday, 17 May 2013 12:44 AM > > To: David OShea > > Cc: lttng-dev at lists.lttng.org > > Subject: Re: [lttng-dev] Patches to enable building on CentOS 5.x > (glibc > > 2.5) > > > > > > > > Hi, > > > > So you made it work with CentOS 5? > > > > I don't know if we want it upstream, but I could maybe use them to > build a > > package for EPEL5. > > > > Yannick > > > > > > > > On Wed, May 15, 2013 at 7:38 AM, David OShea > > > wrote: > > > > Hi, > > > > Would contributions of patches to enable lttng-tools and lttng-ust to > build > > with glibc 2.5 (as is shipped with CentOS 5.x) and to enable lttng- > gen-tp to > > run with Python 2.4 (as shipped on CentOS 5.x) be accepted? > > > > What is missing from glibc 2.5 is: > > > > - a system call wrapper for sched_getcpu() > > - a system call wrapper for sync_file_range() > > - htobe32() and other similar endian conversion functions > > > > babeltrace and userspace-rcu did not require patching. > > > > Thanks in advance, > > David > > > > P.S. If you see this, thanks for all your recent replies, Mathieu, I > will > > try to get back to you soon! > > > > --------------------------------------------------------------------- > - > > The information contained in this transmission may be confidential. > Any > > disclosure, copying, or further distribution of confidential > information is > > not permitted unless such privilege is explicitly granted in writing > by > > Quantum. Quantum reserves the right to have electronic > communications, > > including email and attachments, sent across its networks filtered > through > > anti virus and spam software programs and retain such messages in > order to > > comply with applicable data security and retention requirements. > Quantum is > > not responsible for the proper and complete transmission of the > substance of > > this communication or for any delay in its receipt. > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > > > > > > > -- > > Yannick Brosseau > > yannickbrosseau.com > > > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > From ionut5001 at gmail.com Fri May 24 04:07:10 2013 From: ionut5001 at gmail.com (Ionut D.) Date: Fri, 24 May 2013 11:07:10 +0300 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: Hello, Thank you for the slides. I manged to build the kernel modules and I insmod them manually. On the device I copied in /data/lttng following binaries `lttng`, `lttng-relayd` and `lttng-sessiond`. If I execute `./lttng list -k` it shows me a list of available kernel events. I create a session called mysession with `./lttng create mysession` and I enable tracing on all the event with `./lttng enable-event -a -k`. But here starts my problem. The output of the last command is the following: root at android:/data/lttng # ./lttng enable-event -a -k PERROR [3681/3681]: kernel start consumer exec: (null) (in spawn_consumerd() at main.c:2007) Error: Condition timed out. The consumer thread was never ready. Killing it Warning: Using pthread_kill as pthread_cancel is missing on the current platform PERROR [3608/3658]: write poll pipe: (null) (in notify_thread_pipe() at utils.c:43) Error: Events: Fatal error of the session daemon (channel channel0, session mysession) Do you have any idea about what could be wrong? What options should I check in the kernel configuration? (I checked all that is under Tracing) --Ionut On Thu, May 23, 2013 at 6:09 PM, Charles Bri?re wrote: > Module location doesn't really matter, we used to push them to /data/... > or /sdcard/... . > > Modprobe doesn't exists on Android so you'll need to use insmod. We used this > script in order to compile, push to device and load modules. > > We also made a presentation you might be interested in that can be viewed > on > https://docs.google.com/presentation/d/14lte2AchEAyxMk3WSQ53SdbBm2tfmABBFQojuUhxg7Y/pub?start=false&loop=false&delayms=3000 > > > On Thu, May 23, 2013 at 10:40 AM, Ionut D. wrote: > >> About the kernel modules. Where should they be located on the target? >> Should I have modprobe or insmod it is enough? >> >> >> On Thu, May 23, 2013 at 2:19 PM, Ionut D. wrote: >> >>> Sorry for my late response. At the end after different some adds >>> (defines in libc) I managed to compile them for ICS with NDK r7c. I was a >>> problem of environment. >>> >>> >>> On Tue, May 21, 2013 at 9:26 PM, Pierre-Luc St-Charles < >>> pierre-luc.st-charles at polymtl.ca> wrote: >>> >>>> 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). >>>> >>>> >>>> On Tue, May 21, 2013 at 11:29 AM, Ionut D. wrote: >>>> >>>>> 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: >>>>> >>>>> NDK: >>>>> #grep -r __NR_splice . >>>>> ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define >>>>> __NR_splice 313 >>>>> ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define >>>>> __NR_splice 313 >>>>> >>>>> bionic: >>>>> grep -r __NR_splice bionic >>>>> bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice 313 >>>>> bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice 341 >>>>> bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice 313 >>>>> >>>>> Looking through results I see that '__NR_splice' it not in unistd.h >>>>> and I know this is important. >>>>> >>>>> Ionut >>>>> >>>>> >>>>> On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < >>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>> >>>>>> 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. >>>>>> >>>>>> 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. >>>>>> >>>>>> 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? >>>>>> >>>>>> -PL >>>>>> >>>>>> >>>>>> On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: >>>>>> >>>>>>> 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? >>>>>>> >>>>>>> >>>>>>> In file included from >>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >>>>>>> In function 'splice': >>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>> error: '__NR_splice' undeclared (first use in this function) >>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>> error: (Each undeclared identifier is reported only once >>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>> error: for each function it appears in.) >>>>>>> In file included from >>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >>>>>>> warning: "POSIX_FADV_DONTNEED" redefined >>>>>>> In file included from >>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >>>>>>> from >>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is the >>>>>>> location of the previous definition >>>>>>> In file included from bionic/libc/include/sys/select.h:34, >>>>>>> from bionic/libc/include/unistd.h:34, >>>>>>> from >>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>> external/lttng-tools/src/common/compat/signal.h: At top level: >>>>>>> external/lttng-tools/src/common/compat/signal.h:27: error: expected >>>>>>> ';', ',' or ')' before '*' token >>>>>>> external/lttng-tools/src/common/compat/signal.h:28: error: expected >>>>>>> ';', ',' or ')' before '*' token >>>>>>> external/lttng-tools/src/common/compat/signal.h:29: error: expected >>>>>>> ';', ',' or ')' before '*' token >>>>>>> In file included from bionic/libc/include/unistd.h:34, >>>>>>> from >>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>> bionic/libc/include/sys/select.h:42: error: expected ';', ',' or ')' >>>>>>> before '*' token >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Sat, May 18, 2013 at 10:21 AM, Ionut D. wrote: >>>>>>> >>>>>>>> Great informations! I will post back the results. >>>>>>>> >>>>>>>> >>>>>>>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>> >>>>>>>>> Alright, small update for all following a quick (non-mailing-list) >>>>>>>>> exchange: >>>>>>>>> >>>>>>>>> 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 >>>>>>>>> here; >>>>>>>>> still not perfect). >>>>>>>>> >>>>>>>>> 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). >>>>>>>>> >>>>>>>>> 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). >>>>>>>>> >>>>>>>>> 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). >>>>>>>>> >>>>>>>>> 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. >>>>>>>>> >>>>>>>>> So, simple 'how do I put LTTng on Android' workflow would be this: >>>>>>>>> >>>>>>>>> - Compile modules (using NDK) against device's kernel, making >>>>>>>>> sure its config is appropriate, ship them over via ADB >>>>>>>>> >>>>>>>>> - Compile required external libraries (using repo build system) >>>>>>>>> for the device, ship them over via ADB >>>>>>>>> >>>>>>>>> - 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) >>>>>>>>> >>>>>>>>> - Cross-compile LTTng-* for the device (using NDK), ship >>>>>>>>> binaries over via ADB >>>>>>>>> >>>>>>>>> Then, on the device, start up the sessiond manually & start >>>>>>>>> tracing. >>>>>>>>> >>>>>>>>> >>>>>>>>> I think I went over everything, but if there's a part that's still >>>>>>>>> cloudy, don't hesitate. >>>>>>>>> >>>>>>>>> >>>>>>>>> -PL >>>>>>>>> >>>>>>>>> >>>>>>>>> On May 17, 2013 1:32 AM, "Ionut D." wrote: >>>>>>>>> >>>>>>>>>> Hello all, >>>>>>>>>> >>>>>>>>>> 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. >>>>>>>>>> >>>>>>>>>> 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. >>>>>>>>>> >>>>>>>>>> It is ok? what I am trying to do ? to integrate and build by >>>>>>>>>> using the Android build system. >>>>>>>>>> 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 ? >>>>>>>>>> >>>>>>>>>> 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. >>>>>>>>>> >>>>>>>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>>>>>>> >>>>>>>>>> Would be great if you will give me a tutorial about how to do it. >>>>>>>>>> >>>>>>>>>> Ionut >>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>>>>> lttng-dev mailing list >>>>>>>>>> lttng-dev at lists.lttng.org >>>>>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>>>>> >>>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ionut5001 at gmail.com Fri May 24 06:44:27 2013 From: ionut5001 at gmail.com (Ionut D.) Date: Fri, 24 May 2013 13:44:27 +0300 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: I managed to fix it. It was not finding `lttng-consumerd`, I fixed it by configuring the package with the right path. But, about the kernel modules the question is still pertinent. What options should I check in the kernel configuration? I saw that in my case not all the lttng kernel modules have been compiled. On Fri, May 24, 2013 at 11:07 AM, Ionut D. wrote: > Hello, > > Thank you for the slides. I manged to build the kernel modules and I > insmod them manually. On the device I copied in /data/lttng following > binaries `lttng`, `lttng-relayd` and `lttng-sessiond`. If I execute > `./lttng list -k` it shows me a list of available kernel events. I create a > session called mysession with `./lttng create mysession` and I enable > tracing on all the event with `./lttng enable-event -a -k`. But here starts > my problem. > > The output of the last command is the following: > > root at android:/data/lttng # ./lttng enable-event -a -k > PERROR [3681/3681]: kernel start consumer exec: (null) (in > spawn_consumerd() at main.c:2007) > Error: Condition timed out. The consumer thread was never ready. Killing it > Warning: Using pthread_kill as pthread_cancel is missing on the current > platform > PERROR [3608/3658]: write poll pipe: (null) (in notify_thread_pipe() at > utils.c:43) > Error: Events: Fatal error of the session daemon (channel channel0, > session mysession) > > Do you have any idea about what could be wrong? What options should I > check in the kernel configuration? (I checked all that is under Tracing) > > --Ionut > > > > > > On Thu, May 23, 2013 at 6:09 PM, Charles Bri?re > wrote: > >> Module location doesn't really matter, we used to push them to /data/... >> or /sdcard/... . >> >> Modprobe doesn't exists on Android so you'll need to use insmod. We used this >> script in order to compile, push to device and load modules. >> >> We also made a presentation you might be interested in that can be viewed >> on >> https://docs.google.com/presentation/d/14lte2AchEAyxMk3WSQ53SdbBm2tfmABBFQojuUhxg7Y/pub?start=false&loop=false&delayms=3000 >> >> >> On Thu, May 23, 2013 at 10:40 AM, Ionut D. wrote: >> >>> About the kernel modules. Where should they be located on the target? >>> Should I have modprobe or insmod it is enough? >>> >>> >>> On Thu, May 23, 2013 at 2:19 PM, Ionut D. wrote: >>> >>>> Sorry for my late response. At the end after different some adds >>>> (defines in libc) I managed to compile them for ICS with NDK r7c. I was a >>>> problem of environment. >>>> >>>> >>>> On Tue, May 21, 2013 at 9:26 PM, Pierre-Luc St-Charles < >>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>> >>>>> 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). >>>>> >>>>> >>>>> On Tue, May 21, 2013 at 11:29 AM, Ionut D. wrote: >>>>> >>>>>> 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: >>>>>> >>>>>> NDK: >>>>>> #grep -r __NR_splice . >>>>>> ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>> __NR_splice 313 >>>>>> ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>> __NR_splice 313 >>>>>> >>>>>> bionic: >>>>>> grep -r __NR_splice bionic >>>>>> bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice 313 >>>>>> bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice 341 >>>>>> bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice 313 >>>>>> >>>>>> Looking through results I see that '__NR_splice' it not in unistd.h >>>>>> and I know this is important. >>>>>> >>>>>> Ionut >>>>>> >>>>>> >>>>>> On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < >>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>> >>>>>>> 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. >>>>>>> >>>>>>> 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. >>>>>>> >>>>>>> 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? >>>>>>> >>>>>>> -PL >>>>>>> >>>>>>> >>>>>>> On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: >>>>>>> >>>>>>>> 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? >>>>>>>> >>>>>>>> >>>>>>>> In file included from >>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >>>>>>>> In function 'splice': >>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>> error: '__NR_splice' undeclared (first use in this function) >>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>> error: (Each undeclared identifier is reported only once >>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>> error: for each function it appears in.) >>>>>>>> In file included from >>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >>>>>>>> warning: "POSIX_FADV_DONTNEED" redefined >>>>>>>> In file included from >>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >>>>>>>> from >>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is >>>>>>>> the location of the previous definition >>>>>>>> In file included from bionic/libc/include/sys/select.h:34, >>>>>>>> from bionic/libc/include/unistd.h:34, >>>>>>>> from >>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>> external/lttng-tools/src/common/compat/signal.h: At top level: >>>>>>>> external/lttng-tools/src/common/compat/signal.h:27: error: expected >>>>>>>> ';', ',' or ')' before '*' token >>>>>>>> external/lttng-tools/src/common/compat/signal.h:28: error: expected >>>>>>>> ';', ',' or ')' before '*' token >>>>>>>> external/lttng-tools/src/common/compat/signal.h:29: error: expected >>>>>>>> ';', ',' or ')' before '*' token >>>>>>>> In file included from bionic/libc/include/unistd.h:34, >>>>>>>> from >>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>> bionic/libc/include/sys/select.h:42: error: expected ';', ',' or >>>>>>>> ')' before '*' token >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Sat, May 18, 2013 at 10:21 AM, Ionut D. wrote: >>>>>>>> >>>>>>>>> Great informations! I will post back the results. >>>>>>>>> >>>>>>>>> >>>>>>>>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>> >>>>>>>>>> Alright, small update for all following a quick >>>>>>>>>> (non-mailing-list) exchange: >>>>>>>>>> >>>>>>>>>> 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 >>>>>>>>>> here; >>>>>>>>>> still not perfect). >>>>>>>>>> >>>>>>>>>> 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). >>>>>>>>>> >>>>>>>>>> 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). >>>>>>>>>> >>>>>>>>>> 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). >>>>>>>>>> >>>>>>>>>> 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. >>>>>>>>>> >>>>>>>>>> So, simple 'how do I put LTTng on Android' workflow would be this: >>>>>>>>>> >>>>>>>>>> - Compile modules (using NDK) against device's kernel, making >>>>>>>>>> sure its config is appropriate, ship them over via ADB >>>>>>>>>> >>>>>>>>>> - Compile required external libraries (using repo build system) >>>>>>>>>> for the device, ship them over via ADB >>>>>>>>>> >>>>>>>>>> - 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) >>>>>>>>>> >>>>>>>>>> - Cross-compile LTTng-* for the device (using NDK), ship >>>>>>>>>> binaries over via ADB >>>>>>>>>> >>>>>>>>>> Then, on the device, start up the sessiond manually & start >>>>>>>>>> tracing. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> I think I went over everything, but if there's a part that's >>>>>>>>>> still cloudy, don't hesitate. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -PL >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On May 17, 2013 1:32 AM, "Ionut D." wrote: >>>>>>>>>> >>>>>>>>>>> Hello all, >>>>>>>>>>> >>>>>>>>>>> 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. >>>>>>>>>>> >>>>>>>>>>> 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. >>>>>>>>>>> >>>>>>>>>>> It is ok? what I am trying to do ? to integrate and build by >>>>>>>>>>> using the Android build system. >>>>>>>>>>> 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 ? >>>>>>>>>>> >>>>>>>>>>> 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. >>>>>>>>>>> >>>>>>>>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>>>>>>>> >>>>>>>>>>> Would be great if you will give me a tutorial about how to do it. >>>>>>>>>>> >>>>>>>>>>> Ionut >>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> lttng-dev mailing list >>>>>>>>>>> lttng-dev at lists.lttng.org >>>>>>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >>> _______________________________________________ >>> lttng-dev mailing list >>> lttng-dev at lists.lttng.org >>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierre-luc.st-charles at polymtl.ca Fri May 24 09:46:59 2013 From: pierre-luc.st-charles at polymtl.ca (Pierre-Luc St-Charles) Date: Fri, 24 May 2013 09:46:59 -0400 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: The required kernel configuration options for the modules are listed in the lttng-module README file, located in its project root directory. Some of the 'optional' options also listed there are simply not supported by 3.0.x ARM kernels (such as HAVE_SYSCALL_TRACEPOINTS), so you might be missing some modules compared to what you would get on a (x86 arch w/ recent kernel) platform. You can find more information on syscall tracing on ARM here: http://comments.gmane.org/gmane.linux.kernel.tracing.lttng.devel/5086 On Fri, May 24, 2013 at 6:44 AM, Ionut D. wrote: > I managed to fix it. It was not finding `lttng-consumerd`, I fixed it by > configuring the package with the right path. But, about the kernel modules > the question is still pertinent. What options should I check in the > kernel configuration? I saw that in my case not all the lttng kernel > modules have been compiled. > > > On Fri, May 24, 2013 at 11:07 AM, Ionut D. wrote: > >> Hello, >> >> Thank you for the slides. I manged to build the kernel modules and I >> insmod them manually. On the device I copied in /data/lttng following >> binaries `lttng`, `lttng-relayd` and `lttng-sessiond`. If I execute >> `./lttng list -k` it shows me a list of available kernel events. I create a >> session called mysession with `./lttng create mysession` and I enable >> tracing on all the event with `./lttng enable-event -a -k`. But here starts >> my problem. >> >> The output of the last command is the following: >> >> root at android:/data/lttng # ./lttng enable-event -a -k >> PERROR [3681/3681]: kernel start consumer exec: (null) (in >> spawn_consumerd() at main.c:2007) >> Error: Condition timed out. The consumer thread was never ready. Killing >> it >> Warning: Using pthread_kill as pthread_cancel is missing on the current >> platform >> PERROR [3608/3658]: write poll pipe: (null) (in notify_thread_pipe() at >> utils.c:43) >> Error: Events: Fatal error of the session daemon (channel channel0, >> session mysession) >> >> Do you have any idea about what could be wrong? What options should I >> check in the kernel configuration? (I checked all that is under Tracing) >> >> --Ionut >> >> >> >> >> >> On Thu, May 23, 2013 at 6:09 PM, Charles Bri?re < >> charles.briere at polymtl.ca> wrote: >> >>> Module location doesn't really matter, we used to push them to /data/... >>> or /sdcard/... . >>> >>> Modprobe doesn't exists on Android so you'll need to use insmod. We >>> used this scriptin order to compile, push to device and load modules. >>> >>> We also made a presentation you might be interested in that can be >>> viewed on >>> https://docs.google.com/presentation/d/14lte2AchEAyxMk3WSQ53SdbBm2tfmABBFQojuUhxg7Y/pub?start=false&loop=false&delayms=3000 >>> >>> >>> On Thu, May 23, 2013 at 10:40 AM, Ionut D. wrote: >>> >>>> About the kernel modules. Where should they be located on the target? >>>> Should I have modprobe or insmod it is enough? >>>> >>>> >>>> On Thu, May 23, 2013 at 2:19 PM, Ionut D. wrote: >>>> >>>>> Sorry for my late response. At the end after different some adds >>>>> (defines in libc) I managed to compile them for ICS with NDK r7c. I was a >>>>> problem of environment. >>>>> >>>>> >>>>> On Tue, May 21, 2013 at 9:26 PM, Pierre-Luc St-Charles < >>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>> >>>>>> 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). >>>>>> >>>>>> >>>>>> On Tue, May 21, 2013 at 11:29 AM, Ionut D. wrote: >>>>>> >>>>>>> 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: >>>>>>> >>>>>>> NDK: >>>>>>> #grep -r __NR_splice . >>>>>>> ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>>> __NR_splice 313 >>>>>>> ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>>> __NR_splice 313 >>>>>>> >>>>>>> bionic: >>>>>>> grep -r __NR_splice bionic >>>>>>> bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice 313 >>>>>>> bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice 341 >>>>>>> bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice 313 >>>>>>> >>>>>>> Looking through results I see that '__NR_splice' it not in unistd.h >>>>>>> and I know this is important. >>>>>>> >>>>>>> Ionut >>>>>>> >>>>>>> >>>>>>> On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < >>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>> >>>>>>>> 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. >>>>>>>> >>>>>>>> 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. >>>>>>>> >>>>>>>> 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? >>>>>>>> >>>>>>>> -PL >>>>>>>> >>>>>>>> >>>>>>>> On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: >>>>>>>> >>>>>>>>> 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? >>>>>>>>> >>>>>>>>> >>>>>>>>> In file included from >>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >>>>>>>>> In function 'splice': >>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>> error: '__NR_splice' undeclared (first use in this function) >>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>> error: (Each undeclared identifier is reported only once >>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>> error: for each function it appears in.) >>>>>>>>> In file included from >>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >>>>>>>>> warning: "POSIX_FADV_DONTNEED" redefined >>>>>>>>> In file included from >>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >>>>>>>>> from >>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is >>>>>>>>> the location of the previous definition >>>>>>>>> In file included from bionic/libc/include/sys/select.h:34, >>>>>>>>> from bionic/libc/include/unistd.h:34, >>>>>>>>> from >>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>>> external/lttng-tools/src/common/compat/signal.h: At top level: >>>>>>>>> external/lttng-tools/src/common/compat/signal.h:27: error: >>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>> external/lttng-tools/src/common/compat/signal.h:28: error: >>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>> external/lttng-tools/src/common/compat/signal.h:29: error: >>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>> In file included from bionic/libc/include/unistd.h:34, >>>>>>>>> from >>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>>> bionic/libc/include/sys/select.h:42: error: expected ';', ',' or >>>>>>>>> ')' before '*' token >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Sat, May 18, 2013 at 10:21 AM, Ionut D. wrote: >>>>>>>>> >>>>>>>>>> Great informations! I will post back the results. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>>> >>>>>>>>>>> Alright, small update for all following a quick >>>>>>>>>>> (non-mailing-list) exchange: >>>>>>>>>>> >>>>>>>>>>> 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 >>>>>>>>>>> here; >>>>>>>>>>> still not perfect). >>>>>>>>>>> >>>>>>>>>>> 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). >>>>>>>>>>> >>>>>>>>>>> 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). >>>>>>>>>>> >>>>>>>>>>> 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). >>>>>>>>>>> >>>>>>>>>>> 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. >>>>>>>>>>> >>>>>>>>>>> So, simple 'how do I put LTTng on Android' workflow would be >>>>>>>>>>> this: >>>>>>>>>>> >>>>>>>>>>> - Compile modules (using NDK) against device's kernel, making >>>>>>>>>>> sure its config is appropriate, ship them over via ADB >>>>>>>>>>> >>>>>>>>>>> - Compile required external libraries (using repo build >>>>>>>>>>> system) for the device, ship them over via ADB >>>>>>>>>>> >>>>>>>>>>> - 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) >>>>>>>>>>> >>>>>>>>>>> - Cross-compile LTTng-* for the device (using NDK), ship >>>>>>>>>>> binaries over via ADB >>>>>>>>>>> >>>>>>>>>>> Then, on the device, start up the sessiond manually & start >>>>>>>>>>> tracing. >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> I think I went over everything, but if there's a part that's >>>>>>>>>>> still cloudy, don't hesitate. >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -PL >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On May 17, 2013 1:32 AM, "Ionut D." wrote: >>>>>>>>>>> >>>>>>>>>>>> Hello all, >>>>>>>>>>>> >>>>>>>>>>>> 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. >>>>>>>>>>>> >>>>>>>>>>>> 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. >>>>>>>>>>>> >>>>>>>>>>>> It is ok? what I am trying to do ? to integrate and build by >>>>>>>>>>>> using the Android build system. >>>>>>>>>>>> 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 ? >>>>>>>>>>>> >>>>>>>>>>>> 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. >>>>>>>>>>>> >>>>>>>>>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>>>>>>>>> >>>>>>>>>>>> Would be great if you will give me a tutorial about how to do >>>>>>>>>>>> it. >>>>>>>>>>>> >>>>>>>>>>>> Ionut >>>>>>>>>>>> >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> lttng-dev mailing list >>>>>>>>>>>> lttng-dev at lists.lttng.org >>>>>>>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>>> _______________________________________________ >>>> lttng-dev mailing list >>>> lttng-dev at lists.lttng.org >>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From francis.giraldeau at gmail.com Fri May 24 15:04:10 2013 From: francis.giraldeau at gmail.com (Francis Giraldeau) Date: Fri, 24 May 2013 15:04:10 -0400 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: Hi, I got some problem compiling required libraries for lttng-tools. I did a full android build within repo: $ source build/envsetup.sh $ lunch # with full_maguro-eng $ m Build is fine, but when trying to run configure in lttng-tools, it can't find liboprofile_popt. Here is the error message in config.log: /home/francis/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/francis/android/repo/out/target/product/maguro/obj/STATIC_LIBRARIES/liboprofile_popt_intermediates/liboprofile_popt.a(popthelp.o): in function singleOptionHelp.isra.4:bionic/libc/include/stdio.h:483: error: undefined reference to '__sprintf_chk' It seems that only the static library of liboprofile_popt is compiled. The symbol is defined in libc.a and libc.so: $ nm ./out/target/product/maguro/obj/SHARED_LIBRARIES/libc_intermediates/LINKED/libc.so | grep -E "__strlen_chk|__sprintf_chk" 0001395d T __sprintf_chk 00012df1 T __strlen_chk I tried to compile the configtest.c file by hand and it worked, so it really seems to be some kind of environment variable that make it fail. For the people who managed to do the configure, what arguments should be supplied to configure? Or maybe it's my android build that is incomplete? Should I build sub-directories in addition to the build in the root android repo sources? Cheers! Francis 2013/5/24 Pierre-Luc St-Charles > The required kernel configuration options for the modules are listed in > the lttng-module README file, located in its project root directory. Some > of the 'optional' options also listed there are simply not supported by > 3.0.x ARM kernels (such as HAVE_SYSCALL_TRACEPOINTS), so you might be > missing some modules compared to what you would get on a (x86 arch w/ > recent kernel) platform. > > You can find more information on syscall tracing on ARM here: > http://comments.gmane.org/gmane.linux.kernel.tracing.lttng.devel/5086 > > > On Fri, May 24, 2013 at 6:44 AM, Ionut D. wrote: > >> I managed to fix it. It was not finding `lttng-consumerd`, I fixed it by >> configuring the package with the right path. But, about the kernel modules >> the question is still pertinent. What options should I check in the >> kernel configuration? I saw that in my case not all the lttng kernel >> modules have been compiled. >> >> >> On Fri, May 24, 2013 at 11:07 AM, Ionut D. wrote: >> >>> Hello, >>> >>> Thank you for the slides. I manged to build the kernel modules and I >>> insmod them manually. On the device I copied in /data/lttng following >>> binaries `lttng`, `lttng-relayd` and `lttng-sessiond`. If I execute >>> `./lttng list -k` it shows me a list of available kernel events. I create a >>> session called mysession with `./lttng create mysession` and I enable >>> tracing on all the event with `./lttng enable-event -a -k`. But here starts >>> my problem. >>> >>> The output of the last command is the following: >>> >>> root at android:/data/lttng # ./lttng enable-event -a -k >>> PERROR [3681/3681]: kernel start consumer exec: (null) (in >>> spawn_consumerd() at main.c:2007) >>> Error: Condition timed out. The consumer thread was never ready. Killing >>> it >>> Warning: Using pthread_kill as pthread_cancel is missing on the current >>> platform >>> PERROR [3608/3658]: write poll pipe: (null) (in notify_thread_pipe() at >>> utils.c:43) >>> Error: Events: Fatal error of the session daemon (channel channel0, >>> session mysession) >>> >>> Do you have any idea about what could be wrong? What options should I >>> check in the kernel configuration? (I checked all that is under Tracing) >>> >>> --Ionut >>> >>> >>> >>> >>> >>> On Thu, May 23, 2013 at 6:09 PM, Charles Bri?re < >>> charles.briere at polymtl.ca> wrote: >>> >>>> Module location doesn't really matter, we used to push them to >>>> /data/... or /sdcard/... . >>>> >>>> Modprobe doesn't exists on Android so you'll need to use insmod. We >>>> used this scriptin order to compile, push to device and load modules. >>>> >>>> We also made a presentation you might be interested in that can be >>>> viewed on >>>> https://docs.google.com/presentation/d/14lte2AchEAyxMk3WSQ53SdbBm2tfmABBFQojuUhxg7Y/pub?start=false&loop=false&delayms=3000 >>>> >>>> >>>> On Thu, May 23, 2013 at 10:40 AM, Ionut D. wrote: >>>> >>>>> About the kernel modules. Where should they be located on the target? >>>>> Should I have modprobe or insmod it is enough? >>>>> >>>>> >>>>> On Thu, May 23, 2013 at 2:19 PM, Ionut D. wrote: >>>>> >>>>>> Sorry for my late response. At the end after different some adds >>>>>> (defines in libc) I managed to compile them for ICS with NDK r7c. I was a >>>>>> problem of environment. >>>>>> >>>>>> >>>>>> On Tue, May 21, 2013 at 9:26 PM, Pierre-Luc St-Charles < >>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>> >>>>>>> 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). >>>>>>> >>>>>>> >>>>>>> On Tue, May 21, 2013 at 11:29 AM, Ionut D. wrote: >>>>>>> >>>>>>>> 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: >>>>>>>> >>>>>>>> NDK: >>>>>>>> #grep -r __NR_splice . >>>>>>>> ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>>>> __NR_splice 313 >>>>>>>> ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>>>> __NR_splice 313 >>>>>>>> >>>>>>>> bionic: >>>>>>>> grep -r __NR_splice bionic >>>>>>>> bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice 313 >>>>>>>> bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice 341 >>>>>>>> bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice 313 >>>>>>>> >>>>>>>> Looking through results I see that '__NR_splice' it not in unistd.h >>>>>>>> and I know this is important. >>>>>>>> >>>>>>>> Ionut >>>>>>>> >>>>>>>> >>>>>>>> On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < >>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>> >>>>>>>>> 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. >>>>>>>>> >>>>>>>>> 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. >>>>>>>>> >>>>>>>>> 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? >>>>>>>>> >>>>>>>>> -PL >>>>>>>>> >>>>>>>>> >>>>>>>>> On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: >>>>>>>>> >>>>>>>>>> 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? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> In file included from >>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >>>>>>>>>> In function 'splice': >>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>> error: '__NR_splice' undeclared (first use in this function) >>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>> error: (Each undeclared identifier is reported only once >>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>> error: for each function it appears in.) >>>>>>>>>> In file included from >>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >>>>>>>>>> warning: "POSIX_FADV_DONTNEED" redefined >>>>>>>>>> In file included from >>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >>>>>>>>>> from >>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is >>>>>>>>>> the location of the previous definition >>>>>>>>>> In file included from bionic/libc/include/sys/select.h:34, >>>>>>>>>> from bionic/libc/include/unistd.h:34, >>>>>>>>>> from >>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>>>> external/lttng-tools/src/common/compat/signal.h: At top level: >>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:27: error: >>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:28: error: >>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:29: error: >>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>> In file included from bionic/libc/include/unistd.h:34, >>>>>>>>>> from >>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>>>> bionic/libc/include/sys/select.h:42: error: expected ';', ',' or >>>>>>>>>> ')' before '*' token >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Sat, May 18, 2013 at 10:21 AM, Ionut D. wrote: >>>>>>>>>> >>>>>>>>>>> Great informations! I will post back the results. >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>>>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>>>> >>>>>>>>>>>> Alright, small update for all following a quick >>>>>>>>>>>> (non-mailing-list) exchange: >>>>>>>>>>>> >>>>>>>>>>>> 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 >>>>>>>>>>>> here; >>>>>>>>>>>> still not perfect). >>>>>>>>>>>> >>>>>>>>>>>> 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). >>>>>>>>>>>> >>>>>>>>>>>> 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). >>>>>>>>>>>> >>>>>>>>>>>> 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). >>>>>>>>>>>> >>>>>>>>>>>> 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. >>>>>>>>>>>> >>>>>>>>>>>> So, simple 'how do I put LTTng on Android' workflow would be >>>>>>>>>>>> this: >>>>>>>>>>>> >>>>>>>>>>>> - Compile modules (using NDK) against device's kernel, making >>>>>>>>>>>> sure its config is appropriate, ship them over via ADB >>>>>>>>>>>> >>>>>>>>>>>> - Compile required external libraries (using repo build >>>>>>>>>>>> system) for the device, ship them over via ADB >>>>>>>>>>>> >>>>>>>>>>>> - 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) >>>>>>>>>>>> >>>>>>>>>>>> - Cross-compile LTTng-* for the device (using NDK), ship >>>>>>>>>>>> binaries over via ADB >>>>>>>>>>>> >>>>>>>>>>>> Then, on the device, start up the sessiond manually & start >>>>>>>>>>>> tracing. >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> I think I went over everything, but if there's a part that's >>>>>>>>>>>> still cloudy, don't hesitate. >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> -PL >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On May 17, 2013 1:32 AM, "Ionut D." >>>>>>>>>>>> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> Hello all, >>>>>>>>>>>>> >>>>>>>>>>>>> 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. >>>>>>>>>>>>> >>>>>>>>>>>>> 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. >>>>>>>>>>>>> >>>>>>>>>>>>> It is ok? what I am trying to do ? to integrate and build by >>>>>>>>>>>>> using the Android build system. >>>>>>>>>>>>> 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 ? >>>>>>>>>>>>> >>>>>>>>>>>>> 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. >>>>>>>>>>>>> >>>>>>>>>>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>>>>>>>>>> >>>>>>>>>>>>> Would be great if you will give me a tutorial about how to do >>>>>>>>>>>>> it. >>>>>>>>>>>>> >>>>>>>>>>>>> Ionut >>>>>>>>>>>>> >>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>> lttng-dev mailing list >>>>>>>>>>>>> lttng-dev at lists.lttng.org >>>>>>>>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> lttng-dev mailing list >>>>> lttng-dev at lists.lttng.org >>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>> >>>>> >>>> >>> >> > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierre-luc.st-charles at polymtl.ca Fri May 24 16:36:54 2013 From: pierre-luc.st-charles at polymtl.ca (Pierre-Luc St-Charles) Date: Fri, 24 May 2013 16:36:54 -0400 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: Good news: you (most likely) won't need to recompile the whole platform to fix the problem! I think we bumped in a similar bitter-sweet-awful error a while back: after some hefty searches, we found it might have something to do with the Android build system globally 'fortifying' the sources against unsafe functions when compiling some of the most recent versions of the platform. I believe adding -D_FORTIFY_SOURCE=0 to the CPPFLAGS when building the tools solved it for us. -PL On Fri, May 24, 2013 at 3:04 PM, Francis Giraldeau < francis.giraldeau at gmail.com> wrote: > Hi, > > I got some problem compiling required libraries for lttng-tools. I did a > full android build within repo: > > $ source build/envsetup.sh > $ lunch # with full_maguro-eng > $ m > > Build is fine, but when trying to run configure in lttng-tools, it can't > find liboprofile_popt. Here is the error message in config.log: > > /home/francis/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: > /home/francis/android/repo/out/target/product/maguro/obj/STATIC_LIBRARIES/liboprofile_popt_intermediates/liboprofile_popt.a(popthelp.o): > in function singleOptionHelp.isra.4:bionic/libc/include/stdio.h:483: error: > undefined reference to '__sprintf_chk' > > It seems that only the static library of liboprofile_popt is compiled. > > The symbol is defined in libc.a and libc.so: > > $ nm > ./out/target/product/maguro/obj/SHARED_LIBRARIES/libc_intermediates/LINKED/libc.so > | grep -E "__strlen_chk|__sprintf_chk" > 0001395d T __sprintf_chk > 00012df1 T __strlen_chk > > I tried to compile the configtest.c file by hand and it worked, so it > really seems to be some kind of environment variable that make it fail. > > For the people who managed to do the configure, what arguments should be > supplied to configure? Or maybe it's my android build that is incomplete? > Should I build sub-directories in addition to the build in the root android > repo sources? > > Cheers! > > Francis > > > 2013/5/24 Pierre-Luc St-Charles > >> The required kernel configuration options for the modules are listed in >> the lttng-module README file, located in its project root directory. Some >> of the 'optional' options also listed there are simply not supported by >> 3.0.x ARM kernels (such as HAVE_SYSCALL_TRACEPOINTS), so you might be >> missing some modules compared to what you would get on a (x86 arch w/ >> recent kernel) platform. >> >> You can find more information on syscall tracing on ARM here: >> http://comments.gmane.org/gmane.linux.kernel.tracing.lttng.devel/5086 >> >> >> On Fri, May 24, 2013 at 6:44 AM, Ionut D. wrote: >> >>> I managed to fix it. It was not finding `lttng-consumerd`, I fixed it by >>> configuring the package with the right path. But, about the kernel modules >>> the question is still pertinent. What options should I check in the >>> kernel configuration? I saw that in my case not all the lttng kernel >>> modules have been compiled. >>> >>> >>> On Fri, May 24, 2013 at 11:07 AM, Ionut D. wrote: >>> >>>> Hello, >>>> >>>> Thank you for the slides. I manged to build the kernel modules and I >>>> insmod them manually. On the device I copied in /data/lttng following >>>> binaries `lttng`, `lttng-relayd` and `lttng-sessiond`. If I execute >>>> `./lttng list -k` it shows me a list of available kernel events. I create a >>>> session called mysession with `./lttng create mysession` and I enable >>>> tracing on all the event with `./lttng enable-event -a -k`. But here starts >>>> my problem. >>>> >>>> The output of the last command is the following: >>>> >>>> root at android:/data/lttng # ./lttng enable-event -a -k >>>> PERROR [3681/3681]: kernel start consumer exec: (null) (in >>>> spawn_consumerd() at main.c:2007) >>>> Error: Condition timed out. The consumer thread was never ready. >>>> Killing it >>>> Warning: Using pthread_kill as pthread_cancel is missing on the current >>>> platform >>>> PERROR [3608/3658]: write poll pipe: (null) (in notify_thread_pipe() at >>>> utils.c:43) >>>> Error: Events: Fatal error of the session daemon (channel channel0, >>>> session mysession) >>>> >>>> Do you have any idea about what could be wrong? What options should I >>>> check in the kernel configuration? (I checked all that is under Tracing) >>>> >>>> --Ionut >>>> >>>> >>>> >>>> >>>> >>>> On Thu, May 23, 2013 at 6:09 PM, Charles Bri?re < >>>> charles.briere at polymtl.ca> wrote: >>>> >>>>> Module location doesn't really matter, we used to push them to >>>>> /data/... or /sdcard/... . >>>>> >>>>> Modprobe doesn't exists on Android so you'll need to use insmod. We >>>>> used this scriptin order to compile, push to device and load modules. >>>>> >>>>> We also made a presentation you might be interested in that can be >>>>> viewed on >>>>> https://docs.google.com/presentation/d/14lte2AchEAyxMk3WSQ53SdbBm2tfmABBFQojuUhxg7Y/pub?start=false&loop=false&delayms=3000 >>>>> >>>>> >>>>> On Thu, May 23, 2013 at 10:40 AM, Ionut D. wrote: >>>>> >>>>>> About the kernel modules. Where should they be located on the target? >>>>>> Should I have modprobe or insmod it is enough? >>>>>> >>>>>> >>>>>> On Thu, May 23, 2013 at 2:19 PM, Ionut D. wrote: >>>>>> >>>>>>> Sorry for my late response. At the end after different some adds >>>>>>> (defines in libc) I managed to compile them for ICS with NDK r7c. I was a >>>>>>> problem of environment. >>>>>>> >>>>>>> >>>>>>> On Tue, May 21, 2013 at 9:26 PM, Pierre-Luc St-Charles < >>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>> >>>>>>>> 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). >>>>>>>> >>>>>>>> >>>>>>>> On Tue, May 21, 2013 at 11:29 AM, Ionut D. wrote: >>>>>>>> >>>>>>>>> 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: >>>>>>>>> >>>>>>>>> NDK: >>>>>>>>> #grep -r __NR_splice . >>>>>>>>> ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>>>>> __NR_splice 313 >>>>>>>>> ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>>>>> __NR_splice 313 >>>>>>>>> >>>>>>>>> bionic: >>>>>>>>> grep -r __NR_splice bionic >>>>>>>>> bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice 313 >>>>>>>>> bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice 341 >>>>>>>>> bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice 313 >>>>>>>>> >>>>>>>>> Looking through results I see that '__NR_splice' it not in >>>>>>>>> unistd.h and I know this is important. >>>>>>>>> >>>>>>>>> Ionut >>>>>>>>> >>>>>>>>> >>>>>>>>> On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < >>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>> >>>>>>>>>> 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. >>>>>>>>>> >>>>>>>>>> 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. >>>>>>>>>> >>>>>>>>>> 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? >>>>>>>>>> >>>>>>>>>> -PL >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: >>>>>>>>>> >>>>>>>>>>> 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? >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> In file included from >>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >>>>>>>>>>> In function 'splice': >>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>>> error: '__NR_splice' undeclared (first use in this function) >>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>>> error: (Each undeclared identifier is reported only once >>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>>> error: for each function it appears in.) >>>>>>>>>>> In file included from >>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >>>>>>>>>>> warning: "POSIX_FADV_DONTNEED" redefined >>>>>>>>>>> In file included from >>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >>>>>>>>>>> from >>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>>> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this is >>>>>>>>>>> the location of the previous definition >>>>>>>>>>> In file included from bionic/libc/include/sys/select.h:34, >>>>>>>>>>> from bionic/libc/include/unistd.h:34, >>>>>>>>>>> from >>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h: At top level: >>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:27: error: >>>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:28: error: >>>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:29: error: >>>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>>> In file included from bionic/libc/include/unistd.h:34, >>>>>>>>>>> from >>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>>>>> bionic/libc/include/sys/select.h:42: error: expected ';', ',' or >>>>>>>>>>> ')' before '*' token >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Sat, May 18, 2013 at 10:21 AM, Ionut D. wrote: >>>>>>>>>>> >>>>>>>>>>>> Great informations! I will post back the results. >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>>>>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> Alright, small update for all following a quick >>>>>>>>>>>>> (non-mailing-list) exchange: >>>>>>>>>>>>> >>>>>>>>>>>>> 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 >>>>>>>>>>>>> here; >>>>>>>>>>>>> still not perfect). >>>>>>>>>>>>> >>>>>>>>>>>>> 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). >>>>>>>>>>>>> >>>>>>>>>>>>> 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). >>>>>>>>>>>>> >>>>>>>>>>>>> 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). >>>>>>>>>>>>> >>>>>>>>>>>>> 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. >>>>>>>>>>>>> >>>>>>>>>>>>> So, simple 'how do I put LTTng on Android' workflow would be >>>>>>>>>>>>> this: >>>>>>>>>>>>> >>>>>>>>>>>>> - Compile modules (using NDK) against device's kernel, >>>>>>>>>>>>> making sure its config is appropriate, ship them over via ADB >>>>>>>>>>>>> >>>>>>>>>>>>> - Compile required external libraries (using repo build >>>>>>>>>>>>> system) for the device, ship them over via ADB >>>>>>>>>>>>> >>>>>>>>>>>>> - 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) >>>>>>>>>>>>> >>>>>>>>>>>>> - Cross-compile LTTng-* for the device (using NDK), ship >>>>>>>>>>>>> binaries over via ADB >>>>>>>>>>>>> >>>>>>>>>>>>> Then, on the device, start up the sessiond manually & start >>>>>>>>>>>>> tracing. >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> I think I went over everything, but if there's a part that's >>>>>>>>>>>>> still cloudy, don't hesitate. >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> -PL >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> On May 17, 2013 1:32 AM, "Ionut D." >>>>>>>>>>>>> wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> Hello all, >>>>>>>>>>>>>> >>>>>>>>>>>>>> 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. >>>>>>>>>>>>>> >>>>>>>>>>>>>> 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. >>>>>>>>>>>>>> >>>>>>>>>>>>>> It is ok? what I am trying to do ? to integrate and build by >>>>>>>>>>>>>> using the Android build system. >>>>>>>>>>>>>> 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 ? >>>>>>>>>>>>>> >>>>>>>>>>>>>> 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. >>>>>>>>>>>>>> >>>>>>>>>>>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>>>>>>>>>>> >>>>>>>>>>>>>> Would be great if you will give me a tutorial about how to do >>>>>>>>>>>>>> it. >>>>>>>>>>>>>> >>>>>>>>>>>>>> Ionut >>>>>>>>>>>>>> >>>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>>> lttng-dev mailing list >>>>>>>>>>>>>> lttng-dev at lists.lttng.org >>>>>>>>>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> lttng-dev mailing list >>>>>> lttng-dev at lists.lttng.org >>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>> >>>>>> >>>>> >>>> >>> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >> >> > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From weinrea at gmail.com Sun May 26 08:51:04 2013 From: weinrea at gmail.com (Aryeh Weinreb) Date: Sun, 26 May 2013 15:51:04 +0300 Subject: [lttng-dev] Getting started with UST Message-ID: Hi, I'm trying to get UST working for the first time on RHEL 6.4. I compiled and installed the following packages: userspace-rcu-0.7.6 lttng-ust-2.1.2 lttng-tools-2.0.5 babeltrace-1.1.0 When I ran the sample app in lttng-ust/examples I couldn't see any traces. # lttng create test_session Session test_session created. Traces will be written in /root/lttng-traces/test_session-20130526-071315 # lttng start Tracing started for session test_session # cd /usr/local/share/doc/lttng-ust/examples/gen-tp/ # make lttng-gen-tp -o sample_tracepoint.h sample_tracepoint.tp gcc -c -o sample.o sample.c lttng-gen-tp -o sample_tracepoint.c sample_tracepoint.tp lttng-gen-tp -o sample_tracepoint.o sample_tracepoint.tp gcc -o sample sample.o sample_tracepoint.o -ldl -llttng-ust rm sample_tracepoint.c # ./sample # lttng stop Tracing stopped for session test_session # lttng view Trace directory: /root/lttng-traces/test_session-20130526-071315 [error] Cannot open any trace for reading. [error] opening trace "/root/lttng-traces/test_session-20130526-071315" for reading. [error] none of the specified trace paths could be opened. # ls -l /root/lttng-traces/test_session-20130526-071315 total 0 What am I doing wrong? I attached the debug log from the lttng-sessiond. Thanks, Aryeh -------------- next part -------------- # lttng-sessiond --verbose --no-kernel DEBUG3: Creating LTTng run directory: /var/run/lttng [in create_lttng_rundir() at main.c:4325] DEBUG1: Client socket path /var/run/lttng/client-lttng-sessiond [in main() at main.c:4617] DEBUG1: Application socket path /var/run/lttng/apps-lttng-sessiond [in main() at main.c:4618] DEBUG1: LTTng run directory path: /var/run/lttng [in main() at main.c:4619] DEBUG3: Created hashtable size 4 at 0x24ce0a0 of type 1 [in lttng_ht_new() at hashtable.c:96] DEBUG3: Created hashtable size 4 at 0x24ce340 of type 1 [in lttng_ht_new() at hashtable.c:96] DEBUG1: Signal handler set for SIGTERM, SIGPIPE and SIGINT [in set_signal_handler() at main.c:4459] Warning: No tracing group detected DEBUG1: epoll set max size is 363581 [in compat_epoll_set_max_size() at compat-epoll.c:224] DEBUG1: [thread] Manage application started [in thread_manage_apps() at main.c:1179] DEBUG1: Apps thread polling on 2 fds [in thread_manage_apps() at main.c:1200] DEBUG1: Thread manage kernel started [in thread_manage_kernel() at main.c:876] DEBUG1: Updating kernel poll set [in update_kernel_poll() at main.c:748] DEBUG1: Thread kernel polling on 2 fds [in thread_manage_kernel() at main.c:905] DEBUG1: [thread] Manage application registration started [in thread_registration_apps() at main.c:1392] DEBUG1: Notifying applications of session daemon state: 1 [in notify_ust_apps() at main.c:687] DEBUG1: Got the wait shm fd 17 [in get_wait_shm() at shm.c:117] DEBUG1: Futex wait update active 1 [in futex_wait_update() at futex.c:62] DEBUG1: Accepting application registration [in thread_registration_apps() at main.c:1423] DEBUG1: [thread] Dispatch UST command started [in thread_dispatch_ust_registration() at main.c:1324] DEBUG1: Futex n to 1 prepare done [in futex_nto1_prepare() at futex.c:73] DEBUG1: Woken up but nothing in the UST command queue [in thread_dispatch_ust_registration() at main.c:1334] DEBUG1: [thread] Manage client started [in thread_manage_clients() at main.c:3802] DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3834] DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3871] DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3906] DEBUG1: Nothing recv() from client... continuing [in thread_manage_clients() at main.c:3910] DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:534] DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3834] DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3871] DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3906] DEBUG1: Processing client command 8 [in process_client_msg() at main.c:3317] DEBUG3: mkdir() recursive /root/lttng-traces/test_session-20130526-071315 with mode 504 for uid 0 and gid 0 [in run_as_mkdir_recursive() at runas.c:339] DEBUG1: Using run_as_clone [in run_as() at runas.c:323] DEBUG1: Tracing session test_session created in /root/lttng-traces/test_session-20130526-071315 with ID 1 by UID 0 GID 0 [in session_create() at session.c:232] DEBUG1: Sending response (size: 16, retcode: Success) [in thread_manage_clients() at main.c:3944] DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:534] DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3834] DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3871] DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3906] DEBUG1: Nothing recv() from client... continuing [in thread_manage_clients() at main.c:3910] DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:534] DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3834] DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3871] DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3906] DEBUG1: Processing client command 16 [in process_client_msg() at main.c:3317] DEBUG1: Getting session test_session by name [in process_client_msg() at main.c:3372] DEBUG1: Sending response (size: 16, retcode: Success) [in thread_manage_clients() at main.c:3944] DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:534] DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3834] DEBUG1: UST registration received with pid:8433 ppid:25028 uid:0 gid:0 sock:18 name:sample (version 2.1) [in thread_registration_apps() at main.c:1510] DEBUG1: Futex n to 1 wake done [in futex_nto1_wake() at futex.c:100] DEBUG1: Accepting application registration [in thread_registration_apps() at main.c:1423] DEBUG1: Futex n to 1 wait done [in futex_nto1_wait() at futex.c:87] DEBUG1: Futex n to 1 prepare done [in futex_nto1_prepare() at futex.c:73] DEBUG1: Dispatching UST registration pid:8433 ppid:25028 uid:0 gid:0 sock:18 name:sample (version 2.1) [in thread_dispatch_ust_registration() at main.c:1346] DEBUG1: Woken up but nothing in the UST command queue [in thread_dispatch_ust_registration() at main.c:1334] DEBUG3: Created hashtable size 4 at 0x7fdd6c0009d0 of type 1 [in lttng_ht_new() at hashtable.c:96] DEBUG1: App registered with pid:8433 ppid:25028 uid:0 gid:0 sock:18 name:sample (version 2.1) [in ust_app_register() at ust-app.c:1365] DEBUG1: Apps with sock 18 added to poll set [in thread_manage_apps() at main.c:1280] DEBUG1: Apps thread polling on 3 fds [in thread_manage_apps() at main.c:1200] DEBUG1: PID 8433 unregistering with sock 18 [in ust_app_unregister() at ust-app.c:1395] DEBUG1: Apps thread polling on 2 fds [in thread_manage_apps() at main.c:1200] DEBUG3: Call RCU deleting app PID 8433 [in delete_ust_app_rcu() at ust-app.c:237] DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3871] DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3906] DEBUG1: Nothing recv() from client... continuing [in thread_manage_clients() at main.c:3910] DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:534] DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3834] DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3871] DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3906] DEBUG1: Processing client command 17 [in process_client_msg() at main.c:3317] DEBUG1: Getting session test_session by name [in process_client_msg() at main.c:3372] DEBUG1: Sending response (size: 16, retcode: Success) [in thread_manage_clients() at main.c:3944] DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:534] DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3834] DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3871] DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3906] DEBUG1: Processing client command 13 [in process_client_msg() at main.c:3317] DEBUG1: Counting number of available session for UID 0 GID 0 [in lttng_sessions_count() at main.c:2057] DEBUG1: Getting all available session for UID 0 GID 0 [in list_lttng_sessions() at main.c:2084] DEBUG1: Sending response (size: 4388, retcode: Success) [in thread_manage_clients() at main.c:3944] DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:534] DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3834] DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3871] DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3906] DEBUG1: Nothing recv() from client... continuing [in thread_manage_clients() at main.c:3910] DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:534] DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3834] DEBUG1: Wait for client response [in thread_manage_clients() at main.c:3871] DEBUG1: Receiving data from client ... [in thread_manage_clients() at main.c:3906] DEBUG1: Processing client command 9 [in process_client_msg() at main.c:3317] DEBUG1: Getting session test_session by name [in process_client_msg() at main.c:3372] DEBUG3: No kernel session when tearing down session [in teardown_kernel_session() at main.c:363] DEBUG3: No UST session when tearing down session [in teardown_ust_session() at main.c:390] DEBUG1: Destroying session test_session [in session_destroy() at session.c:151] DEBUG1: Sending response (size: 16, retcode: Success) [in thread_manage_clients() at main.c:3944] DEBUG1: Clean command context structure [in clean_command_ctx() at main.c:534] DEBUG1: Accepting client command ... [in thread_manage_clients() at main.c:3834] DEBUG1: Updating kernel poll set [in update_kernel_poll() at main.c:748] DEBUG1: Thread kernel polling on 2 fds [in thread_manage_kernel() at main.c:905] From yannick.brosseau at gmail.com Sun May 26 09:10:46 2013 From: yannick.brosseau at gmail.com (Yannick Brosseau) Date: Sun, 26 May 2013 09:10:46 -0400 Subject: [lttng-dev] Getting started with UST In-Reply-To: References: Message-ID: <51A209D6.6010802@gmail.com> Hi, Did you forgot to enable some event, for example: lttng enable-event -u -a (For all userspace events) On 2013-05-26 08:51, Aryeh Weinreb wrote: > Hi, > I'm trying to get UST working for the first time on RHEL 6.4. > > I compiled and installed the following packages: > userspace-rcu-0.7.6 > lttng-ust-2.1.2 > lttng-tools-2.0.5 > babeltrace-1.1.0 > > When I ran the sample app in lttng-ust/examples I couldn't see any traces. > > # lttng create test_session > Session test_session created. > Traces will be written in /root/lttng-traces/test_session-20130526-071315 > > # lttng start > Tracing started for session test_session > > # cd /usr/local/share/doc/lttng-ust/examples/gen-tp/ > > # make > lttng-gen-tp -o sample_tracepoint.h sample_tracepoint.tp > gcc -c -o sample.o sample.c > lttng-gen-tp -o sample_tracepoint.c sample_tracepoint.tp > lttng-gen-tp -o sample_tracepoint.o sample_tracepoint.tp > gcc -o sample sample.o sample_tracepoint.o -ldl -llttng-ust > rm sample_tracepoint.c > > # ./sample > > # lttng stop > Tracing stopped for session test_session > > # lttng view > Trace directory: /root/lttng-traces/test_session-20130526-071315 > > [error] Cannot open any trace for reading. > > [error] opening trace > "/root/lttng-traces/test_session-20130526-071315" for reading. > > [error] none of the specified trace paths could be opened. > > # ls -l /root/lttng-traces/test_session-20130526-071315 > total 0 > > > What am I doing wrong? I attached the debug log from the lttng-sessiond. > > Thanks, > Aryeh > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From weinrea at gmail.com Sun May 26 09:26:32 2013 From: weinrea at gmail.com (Aryeh Weinreb) Date: Sun, 26 May 2013 16:26:32 +0300 Subject: [lttng-dev] Getting started with UST In-Reply-To: <51A209D6.6010802@gmail.com> References: <51A209D6.6010802@gmail.com> Message-ID: On Sun, May 26, 2013 at 4:10 PM, Yannick Brosseau wrote: > Hi, > > Did you forgot to enable some event, for example: > lttng enable-event -u -a > (For all userspace events) > I did now, but I still can't get anything. # lttng list my_session Tracing session my_session: [active] Trace path: /root/lttng-traces/my_session-20130526-074913 === Domain: UST global === Channels: ------------- - channel0: [enabled] Attributes: overwrite mode: 0 subbufers size: 4096 number of subbufers: 4 switch timer interval: 0 read timer interval: 200 output: mmap() Events: * (type: tracepoint) [enabled] # ./sample # lttng view Trace directory: /root/lttng-traces/my_session-20130526-074913 [error] Cannot open any trace for reading. [error] opening trace "/root/lttng-traces/my_session-20130526-074913" for reading. [error] none of the specified trace paths could be opened. # ls -l /root/lttng-traces/my_session-20130526-074913 total 4 drwxrwx--- 2 root root 4096 May 26 07:49 ust # ls -l /root/lttng-traces/my_session-20130526-074913/ust/ total 0 # lttng list -u UST events: ------------- None From mathieu.desnoyers at efficios.com Sun May 26 09:55:32 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Sun, 26 May 2013 09:55:32 -0400 Subject: [lttng-dev] Getting started with UST In-Reply-To: References: <51A209D6.6010802@gmail.com> Message-ID: <20130526135531.GA17287@Krystal> * Aryeh Weinreb (weinrea at gmail.com) wrote: > On Sun, May 26, 2013 at 4:10 PM, Yannick Brosseau > wrote: > > Hi, > > > > Did you forgot to enable some event, for example: > > lttng enable-event -u -a > > (For all userspace events) > > > > I did now, but I still can't get anything. upgrade lttng-tools to 2.1.x. It's required along with lttng-ust 2.1.x. Thanks, Mathieu > > # lttng list my_session > Tracing session my_session: [active] > Trace path: /root/lttng-traces/my_session-20130526-074913 > > === Domain: UST global === > > Channels: > ------------- > - channel0: [enabled] > > Attributes: > overwrite mode: 0 > subbufers size: 4096 > number of subbufers: 4 > switch timer interval: 0 > read timer interval: 200 > output: mmap() > > Events: > * (type: tracepoint) [enabled] > > > # ./sample > > # lttng view > Trace directory: /root/lttng-traces/my_session-20130526-074913 > > [error] Cannot open any trace for reading. > > [error] opening trace "/root/lttng-traces/my_session-20130526-074913" > for reading. > > [error] none of the specified trace paths could be opened. > > > # ls -l /root/lttng-traces/my_session-20130526-074913 > total 4 > drwxrwx--- 2 root root 4096 May 26 07:49 ust > > # ls -l /root/lttng-traces/my_session-20130526-074913/ust/ > total 0 > > # lttng list -u > UST events: > ------------- > None > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From christian.babeux at efficios.com Mon May 27 18:57:18 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Mon, 27 May 2013 18:57:18 -0400 Subject: [lttng-dev] Announcing GSoC 2013 Accepted Students Message-ID: Hi lttng-cyborgs, We have had great applications for our first participation in Google Summer of Code 2013! The time for proposals evaluation has officially ended and Google announced the GSoC 2013 participants [1]. For GSoC 2013 we will have the following projects/students/mentors: Project: Babeltrace Pythonic Bindings + Lua Bindings (if time allows) [2] Student: Xiaona Han (irc: sabrina) Mentor: J?r?mie Galarneau (irc: jgalar) Project: Dynamic instrumentation support in UST [2] Student: Zifei Tong (irc: zifeitong) Mentor: Christian Babeux (irc: cbab) Thanks to all the students who have applied, The LTTng GSoC Team. [1] - https://www.google-melange.com/gsoc/org/google/gsoc2013/lttng [2] - http://bugs.lttng.org/projects/lttng/wiki/Google_Summer_of_Code_2013 From jeremie.galarneau at efficios.com Mon May 27 23:38:45 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Mon, 27 May 2013 23:38:45 -0400 Subject: [lttng-dev] [PATCH babeltrace] Add bt_stream_pos to bt_trace_descriptor Message-ID: <1369712328-17921-1-git-send-email-jeremie.galarneau@efficios.com> This is intended to provide a generic way to access the bt_stream_pos API without having to make assumptions about the output format's descriptor layout. Renamed format-internal.h to trace-descriptor-internal.h to make it more representative of the interface it really contains. Signed-off-by: J?r?mie Galarneau --- formats/bt-dummy/bt-dummy.c | 3 ++ formats/ctf-metadata/ctf-metadata.c | 3 ++ formats/ctf-text/ctf-text.c | 3 ++ formats/ctf/ctf.c | 11 ++++-- include/Makefile.am | 5 ++- include/babeltrace/ctf-ir/metadata.h | 2 +- include/babeltrace/ctf-text/types.h | 2 +- include/babeltrace/format-internal.h | 54 ------------------------- include/babeltrace/trace-descriptor-internal.h | 55 ++++++++++++++++++++++++++ include/babeltrace/trace-descriptor.h | 53 +++++++++++++++++++++++++ lib/Makefile.am | 3 +- lib/trace-descriptor.c | 42 ++++++++++++++++++++ 12 files changed, 174 insertions(+), 62 deletions(-) delete mode 100644 include/babeltrace/format-internal.h create mode 100644 include/babeltrace/trace-descriptor-internal.h create mode 100644 include/babeltrace/trace-descriptor.h create mode 100644 lib/trace-descriptor.c diff --git a/formats/bt-dummy/bt-dummy.c b/formats/bt-dummy/bt-dummy.c index 6192e88..d9767fc 100644 --- a/formats/bt-dummy/bt-dummy.c +++ b/formats/bt-dummy/bt-dummy.c @@ -55,6 +55,8 @@ struct bt_trace_descriptor *bt_dummy_open_trace(const char *path, int flags, pos->parent.rw_table = NULL; pos->parent.event_cb = bt_dummy_write_event; pos->parent.trace = &pos->trace_descriptor; + pos->trace_descriptor.stream_pos = g_ptr_array_sized_new(1); + g_ptr_array_add(pos->trace_descriptor.stream_pos, pos); return &pos->trace_descriptor; } @@ -64,6 +66,7 @@ int bt_dummy_close_trace(struct bt_trace_descriptor *td) struct ctf_text_stream_pos *pos = container_of(td, struct ctf_text_stream_pos, trace_descriptor); + g_ptr_array_free(td->stream_pos, TRUE); free(pos); return 0; } diff --git a/formats/ctf-metadata/ctf-metadata.c b/formats/ctf-metadata/ctf-metadata.c index a5a74c3..e8774eb 100644 --- a/formats/ctf-metadata/ctf-metadata.c +++ b/formats/ctf-metadata/ctf-metadata.c @@ -96,6 +96,8 @@ struct bt_trace_descriptor *ctf_metadata_open_trace(const char *path, int flags, pos->fp = fp; pos->parent.pre_trace_cb = ctf_metadata_trace_pre_handler; pos->parent.trace = &pos->trace_descriptor; + pos->trace_descriptor.stream_pos = g_ptr_array_sized_new(1); + g_ptr_array_add(pos->trace_descriptor.stream_pos, pos); pos->print_names = 0; break; case O_RDONLY: @@ -116,6 +118,7 @@ int ctf_metadata_close_trace(struct bt_trace_descriptor *td) int ret; struct ctf_text_stream_pos *pos = container_of(td, struct ctf_text_stream_pos, trace_descriptor); + g_ptr_array_free(td->stream_pos, TRUE); if (pos->fp != stdout) { ret = fclose(pos->fp); if (ret) { diff --git a/formats/ctf-text/ctf-text.c b/formats/ctf-text/ctf-text.c index 48ce31b..c3b55ed 100644 --- a/formats/ctf-text/ctf-text.c +++ b/formats/ctf-text/ctf-text.c @@ -562,6 +562,8 @@ struct bt_trace_descriptor *ctf_text_open_trace(const char *path, int flags, pos->parent.rw_table = write_dispatch_table; pos->parent.event_cb = ctf_text_write_event; pos->parent.trace = &pos->trace_descriptor; + pos->trace_descriptor.stream_pos = g_ptr_array_sized_new(1); + g_ptr_array_add(pos->trace_descriptor.stream_pos, pos); pos->print_names = 0; break; case O_RDONLY: @@ -582,6 +584,7 @@ int ctf_text_close_trace(struct bt_trace_descriptor *td) int ret; struct ctf_text_stream_pos *pos = container_of(td, struct ctf_text_stream_pos, trace_descriptor); + g_ptr_array_free(td->stream_pos, TRUE); if (pos->fp != stdout) { ret = fclose(pos->fp); if (ret) { diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index bb94e52..aee80b1 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1728,9 +1728,10 @@ int ctf_open_file_stream_read(struct ctf_trace *td, const char *path, int flags, fprintf(stderr, "[error] Stream index creation error.\n"); goto error_index; } - /* Add stream file to stream class */ + /* Add stream file to stream class and trace descriptor */ g_ptr_array_add(file_stream->parent.stream_class->streams, &file_stream->parent); + g_ptr_array_add(td->parent.stream_pos, &file_stream->pos.parent); return 0; error_index: @@ -1864,6 +1865,7 @@ struct bt_trace_descriptor *ctf_open_trace(const char *path, int flags, packet_seek = ctf_packet_seek; td = g_new0(struct ctf_trace, 1); + td->parent.stream_pos = g_ptr_array_new(); switch (flags & O_ACCMODE) { case O_RDONLY: @@ -1871,7 +1873,8 @@ struct bt_trace_descriptor *ctf_open_trace(const char *path, int flags, fprintf(stderr, "[error] Path missing for input CTF trace.\n"); goto error; } - ret = ctf_open_trace_read(td, path, flags, packet_seek, metadata_fp); + ret = ctf_open_trace_read(td, path, flags, packet_seek, + metadata_fp); if (ret) goto error; break; @@ -1885,6 +1888,7 @@ struct bt_trace_descriptor *ctf_open_trace(const char *path, int flags, return &td->parent; error: + g_ptr_array_free(td->parent.stream_pos, TRUE); g_free(td); return NULL; } @@ -1967,9 +1971,10 @@ int ctf_open_mmap_stream_read(struct ctf_trace *td, */ file_stream->parent.current_clock = td->parent.single_clock; - /* Add stream file to stream class */ + /* Add stream file to stream class and trace descriptor */ g_ptr_array_add(file_stream->parent.stream_class->streams, &file_stream->parent); + g_ptr_array_add(td->parent.stream_pos, &file_stream->pos.parent); return 0; error_index: diff --git a/include/Makefile.am b/include/Makefile.am index eee2ac1..c953fac 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,7 +5,8 @@ babeltraceinclude_HEADERS = \ babeltrace/iterator.h \ babeltrace/trace-handle.h \ babeltrace/list.h \ - babeltrace/clock-types.h + babeltrace/clock-types.h \ + babeltrace/trace-descriptor.h babeltracectfinclude_HEADERS = \ babeltrace/ctf/events.h \ @@ -19,7 +20,7 @@ noinst_HEADERS = \ babeltrace/clock-internal.h \ babeltrace/compiler.h \ babeltrace/context-internal.h \ - babeltrace/format-internal.h \ + babeltrace/trace-descriptor-internal.h \ babeltrace/iterator-internal.h \ babeltrace/trace-collection.h \ babeltrace/prio_heap.h \ diff --git a/include/babeltrace/ctf-ir/metadata.h b/include/babeltrace/ctf-ir/metadata.h index 5e92984..458d4d9 100644 --- a/include/babeltrace/ctf-ir/metadata.h +++ b/include/babeltrace/ctf-ir/metadata.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/include/babeltrace/ctf-text/types.h b/include/babeltrace/ctf-text/types.h index 7b4b717..89b99f8 100644 --- a/include/babeltrace/ctf-text/types.h +++ b/include/babeltrace/ctf-text/types.h @@ -35,7 +35,7 @@ #include #include #include -#include +#include /* * Inherit from both struct bt_stream_pos and struct bt_trace_descriptor. diff --git a/include/babeltrace/format-internal.h b/include/babeltrace/format-internal.h deleted file mode 100644 index 7f3eb5e..0000000 --- a/include/babeltrace/format-internal.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef _BABELTRACE_FORMAT_INTERNAL_H -#define _BABELTRACE_FORMAT_INTERNAL_H - -/* - * BabelTrace - * - * Trace Format Internal Header - * - * Copyright 2010-2013 EfficiOS Inc. and Linux Foundation - * - * Author: Mathieu Desnoyers - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Parent trace descriptor */ -struct bt_trace_descriptor { - char path[PATH_MAX]; /* trace path */ - struct bt_context *ctx; - struct bt_trace_handle *handle; - struct trace_collection *collection; /* Container of this trace */ - GHashTable *clocks; - struct ctf_clock *single_clock; /* currently supports only one clock */ -}; - -#ifdef __cplusplus -} -#endif - -#endif /* _BABELTRACE_FORMAT_INTERNAL_H */ diff --git a/include/babeltrace/trace-descriptor-internal.h b/include/babeltrace/trace-descriptor-internal.h new file mode 100644 index 0000000..8ec23bb --- /dev/null +++ b/include/babeltrace/trace-descriptor-internal.h @@ -0,0 +1,55 @@ +#ifndef _BABELTRACE_TRACE_DESCRIPTOR_INTERNAL_H +#define _BABELTRACE_TRACE_DESCRIPTOR_INTERNAL_H + +/* + * BabelTrace + * + * Trace Descriptor Internal Header + * + * Copyright 2010-2013 EfficiOS Inc. and Linux Foundation + * + * Author: Mathieu Desnoyers + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Parent trace descriptor */ +struct bt_trace_descriptor { + char path[PATH_MAX]; /* trace path */ + struct bt_context *ctx; + struct bt_trace_handle *handle; + struct trace_collection *collection; /* Container of this trace */ + GHashTable *clocks; + struct ctf_clock *single_clock; /* currently supports only one clock */ + GPtrArray *stream_pos; /* Pointers to bt_stream_pos */ +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _BABELTRACE_TRACE_DESCRIPTOR_INTERNAL_H */ diff --git a/include/babeltrace/trace-descriptor.h b/include/babeltrace/trace-descriptor.h new file mode 100644 index 0000000..0ae4b8b --- /dev/null +++ b/include/babeltrace/trace-descriptor.h @@ -0,0 +1,53 @@ +#ifndef _BABELTRACE_TRACE_DESCRIPTOR_H +#define _BABELTRACE_TRACE_DESCRIPTOR_H + +/* + * BabelTrace + * + * Trace Descriptor Header + * + * Copyright 2013 EfficiOS Inc. and Linux Foundation + * + * Author: J?r?mie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include + +struct bt_trace_descriptor; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * bt_trace_descriptor_get_stream_pos: Get the stream_pos array associated + * with descriptor's trace + * + * Return: Array of pointers to struct bt_stream_pos + */ +extern const GPtrArray *bt_trace_descriptor_get_stream_pos( + const struct bt_trace_descriptor *descriptor); + +#ifdef __cplusplus +} +#endif + +#endif /* _BABELTRACE_TRACE_DESCRIPTOR_H */ diff --git a/lib/Makefile.am b/lib/Makefile.am index 7ffb164..379688d 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -9,7 +9,8 @@ libbabeltrace_la_SOURCES = babeltrace.c \ context.c \ trace-handle.c \ trace-collection.c \ - registry.c + registry.c \ + trace-descriptor.c libbabeltrace_la_LDFLAGS = \ -Wl,--no-as-needed \ diff --git a/lib/trace-descriptor.c b/lib/trace-descriptor.c new file mode 100644 index 0000000..4001679 --- /dev/null +++ b/lib/trace-descriptor.c @@ -0,0 +1,42 @@ +/* + * trace-descriptor.c + * + * Babeltrace Library + * + * Copyright 2013 EfficiOS Inc. and Linux Foundation + * + * Author: J?r?mie Galarneau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include + +const GPtrArray *bt_trace_descriptor_get_stream_pos( + const struct bt_trace_descriptor *descriptor) +{ + const GPtrArray *ret; + if (!descriptor) { + ret = NULL; + goto end; + } + ret = descriptor->stream_pos; +end: + return ret; +} -- 1.8.2.3 From jeremie.galarneau at efficios.com Mon May 27 23:38:46 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Mon, 27 May 2013 23:38:46 -0400 Subject: [lttng-dev] [PATCH babeltrace] Fix converter code relying on the output type being ctf-text In-Reply-To: <1369712328-17921-1-git-send-email-jeremie.galarneau@efficios.com> References: <1369712328-17921-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <1369712328-17921-2-git-send-email-jeremie.galarneau@efficios.com> Signed-off-by: J?r?mie Galarneau --- converter/babeltrace.c | 92 ++++++++++++++++++++++++++------------------- include/babeltrace/format.h | 2 +- 2 files changed, 54 insertions(+), 40 deletions(-) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index d5a7040..8f09845 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -546,25 +546,33 @@ static int trace_pre_handler(struct bt_trace_descriptor *td_write, struct bt_context *ctx) { - struct ctf_text_stream_pos *sout; - struct trace_collection *tc; int ret, i; + struct trace_collection *tc = ctx->tc; + const GPtrArray *out_streams = bt_trace_descriptor_get_stream_pos(td_write); - sout = container_of(td_write, struct ctf_text_stream_pos, - trace_descriptor); - - if (!sout->parent.pre_trace_cb) - return 0; + if (!out_streams) { + ret = -1; + goto end; + } - tc = ctx->tc; for (i = 0; i < tc->array->len; i++) { - struct bt_trace_descriptor *td = + int sout_nr; + struct bt_trace_descriptor *in_descriptor = g_ptr_array_index(tc->array, i); - ret = sout->parent.pre_trace_cb(&sout->parent, td); - if (ret) { - fprintf(stderr, "[error] Writing to trace pre handler failed.\n"); - goto end; + for (sout_nr = 0; sout_nr < out_streams->len; ++sout_nr) { + struct bt_stream_pos *sout = + g_ptr_array_index(out_streams, sout_nr); + + if (!sout->pre_trace_cb) { + continue; + } + + ret = sout->pre_trace_cb(sout, in_descriptor); + if (ret) { + fprintf(stderr, "[error] Writing to trace pre handler failed.\n"); + goto end; + } } } ret = 0; @@ -576,25 +584,28 @@ static int trace_post_handler(struct bt_trace_descriptor *td_write, struct bt_context *ctx) { - struct ctf_text_stream_pos *sout; - struct trace_collection *tc; int ret, i; + struct trace_collection *tc = ctx->tc; + const GPtrArray *out_streams = bt_trace_descriptor_get_stream_pos(td_write); - sout = container_of(td_write, struct ctf_text_stream_pos, - trace_descriptor); - - if (!sout->parent.post_trace_cb) - return 0; - - tc = ctx->tc; for (i = 0; i < tc->array->len; i++) { - struct bt_trace_descriptor *td = + int sout_nr; + struct bt_trace_descriptor *in_descriptor = g_ptr_array_index(tc->array, i); - ret = sout->parent.post_trace_cb(&sout->parent, td); - if (ret) { - fprintf(stderr, "[error] Writing to trace post handler failed.\n"); - goto end; + for (sout_nr = 0; sout_nr < out_streams->len; ++sout_nr) { + struct bt_stream_pos *sout = + g_ptr_array_index(out_streams, sout_nr); + + if (!sout->pre_trace_cb) { + continue; + } + + ret = sout->post_trace_cb(sout, in_descriptor); + if (ret) { + fprintf(stderr, "[error] Writing to trace post handler failed.\n"); + goto end; + } } } ret = 0; @@ -607,16 +618,10 @@ int convert_trace(struct bt_trace_descriptor *td_write, struct bt_context *ctx) { struct bt_ctf_iter *iter; - struct ctf_text_stream_pos *sout; struct bt_iter_pos begin_pos; struct bt_ctf_event *ctf_event; int ret; - - sout = container_of(td_write, struct ctf_text_stream_pos, - trace_descriptor); - - if (!sout->parent.event_cb) - return 0; + const GPtrArray *out_streams = bt_trace_descriptor_get_stream_pos(td_write); begin_pos.type = BT_SEEK_BEGIN; iter = bt_ctf_iter_create(ctx, &begin_pos, NULL); @@ -625,14 +630,23 @@ int convert_trace(struct bt_trace_descriptor *td_write, goto error_iter; } while ((ctf_event = bt_ctf_iter_read_event(iter))) { - ret = sout->parent.event_cb(&sout->parent, ctf_event->parent->stream); - if (ret) { - fprintf(stderr, "[error] Writing event failed.\n"); - goto end; + int sout_nr; + for (sout_nr = 0; sout_nr < out_streams->len; ++sout_nr) { + struct bt_stream_pos *sout = + g_ptr_array_index(out_streams, sout_nr); + if (!sout->event_cb) { + continue; + } + ret = sout->event_cb(sout, ctf_event->parent->stream); + if (ret) { + fprintf(stderr, "[error] Writing event failed.\n"); + goto end; + } } ret = bt_iter_next(bt_ctf_get_iter(iter)); - if (ret < 0) + if (ret < 0) { goto end; + } } ret = 0; diff --git a/include/babeltrace/format.h b/include/babeltrace/format.h index 07e854f..9f3d1c8 100644 --- a/include/babeltrace/format.h +++ b/include/babeltrace/format.h @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -44,7 +45,6 @@ typedef int bt_intern_str; struct bt_stream_pos; struct bt_context; struct bt_trace_handle; -struct bt_trace_descriptor; struct bt_mmap_stream { int fd; -- 1.8.2.3 From jeremie.galarneau at efficios.com Mon May 27 23:38:47 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Mon, 27 May 2013 23:38:47 -0400 Subject: [lttng-dev] [PATCH babeltrace] Add a format-agnostic iterator creation mechanism In-Reply-To: <1369712328-17921-1-git-send-email-jeremie.galarneau@efficios.com> References: <1369712328-17921-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <1369712328-17921-3-git-send-email-jeremie.galarneau@efficios.com> Iterators now expose an event providing function so that a user does not need to know the input trace format to get "bt_ctf_event"s. A context can now create a specialized iterator depending on its input trace format. Signed-off-by: J?r?mie Galarneau --- converter/babeltrace.c | 10 +++--- formats/ctf/ctf.c | 3 ++ formats/ctf/iterator.c | 34 +++++++++++++------- include/babeltrace/context-internal.h | 1 + include/babeltrace/context.h | 31 ++++++++++++++++++ include/babeltrace/ctf/iterator.h | 6 ++-- include/babeltrace/format.h | 14 +++++++++ include/babeltrace/iterator-internal.h | 1 + include/babeltrace/iterator.h | 11 +++++++ lib/context.c | 57 ++++++++++++++++++++++++++++++++++ lib/iterator.c | 14 +++++++++ tests/lib/test-seeks.c | 42 ++++++++++++------------- 12 files changed, 183 insertions(+), 41 deletions(-) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index 8f09845..c86df93 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -617,19 +617,19 @@ static int convert_trace(struct bt_trace_descriptor *td_write, struct bt_context *ctx) { - struct bt_ctf_iter *iter; + struct bt_iter *iter; struct bt_iter_pos begin_pos; struct bt_ctf_event *ctf_event; int ret; const GPtrArray *out_streams = bt_trace_descriptor_get_stream_pos(td_write); begin_pos.type = BT_SEEK_BEGIN; - iter = bt_ctf_iter_create(ctx, &begin_pos, NULL); + iter = bt_context_create_iterator(ctx, &begin_pos, NULL); if (!iter) { ret = -1; goto error_iter; } - while ((ctf_event = bt_ctf_iter_read_event(iter))) { + while ((ctf_event = bt_iter_get_event(iter))) { int sout_nr; for (sout_nr = 0; sout_nr < out_streams->len; ++sout_nr) { struct bt_stream_pos *sout = @@ -643,7 +643,7 @@ int convert_trace(struct bt_trace_descriptor *td_write, goto end; } } - ret = bt_iter_next(bt_ctf_get_iter(iter)); + ret = bt_iter_next(iter); if (ret < 0) { goto end; } @@ -651,7 +651,7 @@ int convert_trace(struct bt_trace_descriptor *td_write, ret = 0; end: - bt_ctf_iter_destroy(iter); + bt_context_destroy_iterator(ctx, iter); error_iter: return ret; } diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index aee80b1..c029791 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -144,6 +145,8 @@ struct bt_format ctf_format = { .timestamp_begin = ctf_timestamp_begin, .timestamp_end = ctf_timestamp_end, .convert_index_timestamp = ctf_convert_index_timestamp, + .iterator_create = bt_ctf_iter_create, + .iterator_destroy = bt_ctf_iter_destroy }; static diff --git a/formats/ctf/iterator.c b/formats/ctf/iterator.c index d2cd914..a294167 100644 --- a/formats/ctf/iterator.c +++ b/formats/ctf/iterator.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,7 @@ #include "events-private.h" -struct bt_ctf_iter *bt_ctf_iter_create(struct bt_context *ctx, +struct bt_iter *bt_ctf_iter_create(struct bt_context *ctx, const struct bt_iter_pos *begin_pos, const struct bt_iter_pos *end_pos) { @@ -60,10 +61,11 @@ struct bt_ctf_iter *bt_ctf_iter_create(struct bt_context *ctx, iter->recalculate_dep_graph = 0; iter->main_callbacks.callback = NULL; iter->dep_gc = g_ptr_array_new(); - return iter; + iter->parent.get_event = bt_ctf_iter_read_event; + return &iter->parent; } -void bt_ctf_iter_destroy(struct bt_ctf_iter *iter) +void bt_ctf_iter_destroy(struct bt_iter *iter) { struct bt_stream_callbacks *bt_stream_cb; struct bt_callback_chain *bt_chain; @@ -71,13 +73,16 @@ void bt_ctf_iter_destroy(struct bt_ctf_iter *iter) assert(iter); + struct bt_ctf_iter *ctf_iter = + container_of(iter, struct bt_ctf_iter, parent); + /* free all events callbacks */ - if (iter->main_callbacks.callback) - g_array_free(iter->main_callbacks.callback, TRUE); + if (ctf_iter->main_callbacks.callback) + g_array_free(ctf_iter->main_callbacks.callback, TRUE); /* free per-event callbacks */ - for (i = 0; i < iter->callbacks->len; i++) { - bt_stream_cb = &g_array_index(iter->callbacks, + for (i = 0; i < ctf_iter->callbacks->len; i++) { + bt_stream_cb = &g_array_index(ctf_iter->callbacks, struct bt_stream_callbacks, i); if (!bt_stream_cb || !bt_stream_cb->per_id_callbacks) continue; @@ -90,10 +95,10 @@ void bt_ctf_iter_destroy(struct bt_ctf_iter *iter) } g_array_free(bt_stream_cb->per_id_callbacks, TRUE); } - g_array_free(iter->callbacks, TRUE); - g_ptr_array_free(iter->dep_gc, TRUE); + g_array_free(ctf_iter->callbacks, TRUE); + g_ptr_array_free(ctf_iter->dep_gc, TRUE); - bt_iter_fini(&iter->parent); + bt_iter_fini(iter); g_free(iter); } @@ -158,9 +163,14 @@ stop: return NULL; } -struct bt_ctf_event *bt_ctf_iter_read_event(struct bt_ctf_iter *iter) +struct bt_ctf_event *bt_ctf_iter_read_event(struct bt_iter *iter) { - return bt_ctf_iter_read_event_flags(iter, NULL); + struct bt_ctf_iter *ctf_iter; + if (!iter) { + return NULL; + } + ctf_iter = container_of(iter, struct bt_ctf_iter, parent); + return bt_ctf_iter_read_event_flags(ctf_iter, NULL); } uint64_t bt_ctf_get_lost_events_count(struct bt_ctf_iter *iter) diff --git a/include/babeltrace/context-internal.h b/include/babeltrace/context-internal.h index 17d6202..7600d8d 100644 --- a/include/babeltrace/context-internal.h +++ b/include/babeltrace/context-internal.h @@ -51,6 +51,7 @@ struct bt_context { int refcount; int last_trace_handle_id; struct bt_iter *current_iterator; + struct bt_format *input_trace_format; }; #endif /* _BABELTRACE_CONTEXT_INTERNAL_H */ diff --git a/include/babeltrace/context.h b/include/babeltrace/context.h index b28df09..6455b65 100644 --- a/include/babeltrace/context.h +++ b/include/babeltrace/context.h @@ -32,6 +32,7 @@ */ #include +#include #include #ifdef __cplusplus @@ -96,6 +97,36 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path, int bt_context_remove_trace(struct bt_context *ctx, int trace_id); /* + * bt_context_create_iterator: Allocate an iterator on the current trace + * collection's events. + * + * begin_pos and end_pos are optional parameters to specify the position + * at which the trace collection should be seeked upon iterator + * creation, and the position at which iteration will start returning + * "EOF". + * + * By default, if begin_pos is NULL, a BT_SEEK_CUR is performed at + * creation. By default, if end_pos is NULL, a BT_SEEK_END (end of + * trace) is the EOF criterion. + * + * Return a pointer to the newly allocated iterator. + * + * Only one iterator can be created against a context. If more than one + * iterator is being created for the same context, the second creation + * will return NULL. The previous iterator must be destroyed before + * creation of the new iterator for this function to succeed. + */ +struct bt_iter *bt_context_create_iterator(struct bt_context *ctx, + const struct bt_iter_pos *position_begin, + const struct bt_iter_pos *position_end); + +/* + * bt_context_destroy_iterator: Free a trace collection iterator. + */ +void bt_context_destroy_iterator(struct bt_context *ctx, + struct bt_iter *iterator); + +/* * bt_context_get and bt_context_put : increments and decrement the * refcount of the context * diff --git a/include/babeltrace/ctf/iterator.h b/include/babeltrace/ctf/iterator.h index ec6aac7..159e4a4 100644 --- a/include/babeltrace/ctf/iterator.h +++ b/include/babeltrace/ctf/iterator.h @@ -59,7 +59,7 @@ struct bt_ctf_event; * will return NULL. The previous iterator must be destroyed before * creation of the new iterator for this function to succeed. */ -struct bt_ctf_iter *bt_ctf_iter_create(struct bt_context *ctx, +struct bt_iter *bt_ctf_iter_create(struct bt_context *ctx, const struct bt_iter_pos *begin_pos, const struct bt_iter_pos *end_pos); @@ -71,7 +71,7 @@ struct bt_iter *bt_ctf_get_iter(struct bt_ctf_iter *iter); /* * bt_ctf_iter_destroy - Free a CTF trace collection iterator. */ -void bt_ctf_iter_destroy(struct bt_ctf_iter *iter); +void bt_ctf_iter_destroy(struct bt_iter *iter); /* * bt_ctf_iter_read_event: Read the iterator's current event data. @@ -80,7 +80,7 @@ void bt_ctf_iter_destroy(struct bt_ctf_iter *iter); * * Return current event on success, NULL on end of trace. */ -struct bt_ctf_event *bt_ctf_iter_read_event(struct bt_ctf_iter *iter); +struct bt_ctf_event *bt_ctf_iter_read_event(struct bt_iter *iter); /* * bt_ctf_iter_read_event_flags: Read the iterator's current event data. diff --git a/include/babeltrace/format.h b/include/babeltrace/format.h index 9f3d1c8..c170d83 100644 --- a/include/babeltrace/format.h +++ b/include/babeltrace/format.h @@ -45,6 +45,9 @@ typedef int bt_intern_str; struct bt_stream_pos; struct bt_context; struct bt_trace_handle; +struct bt_trace_descriptor; +struct bt_iter; +struct bt_iter_pos; struct bt_mmap_stream { int fd; @@ -77,6 +80,17 @@ struct bt_format { uint64_t (*timestamp_end)(struct bt_trace_descriptor *descriptor, struct bt_trace_handle *handle, enum bt_clock_type type); int (*convert_index_timestamp)(struct bt_trace_descriptor *descriptor); + + /* + * Only one iterator can be created against a context. If more than one + * iterator is being created for the same context, the second creation + * will return NULL. The previous iterator must be destroyed before + * creation of the new iterator for this function to succeed. + */ + struct bt_iter *(*iterator_create)(struct bt_context *ctx, + const struct bt_iter_pos *begin_pos, + const struct bt_iter_pos *end_pos); + void (*iterator_destroy)(struct bt_iter *iterator); }; extern struct bt_format *bt_lookup_format(bt_intern_str qname); diff --git a/include/babeltrace/iterator-internal.h b/include/babeltrace/iterator-internal.h index 2b0b2f2..2008d76 100644 --- a/include/babeltrace/iterator-internal.h +++ b/include/babeltrace/iterator-internal.h @@ -39,6 +39,7 @@ struct bt_iter { struct ptr_heap *stream_heap; struct bt_context *ctx; const struct bt_iter_pos *end_pos; + struct bt_ctf_event *(*get_event)(struct bt_iter *iter); }; /* diff --git a/include/babeltrace/iterator.h b/include/babeltrace/iterator.h index 360a9c7..aa189a8 100644 --- a/include/babeltrace/iterator.h +++ b/include/babeltrace/iterator.h @@ -27,6 +27,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -40,6 +41,7 @@ enum { /* Forward declarations */ struct bt_iter; struct bt_saved_pos; +struct bt_ctf_event; /* * bt_iter is an abstract class, each format has to implement its own @@ -123,6 +125,15 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *pos); struct bt_iter_pos *bt_iter_create_time_pos(struct bt_iter *iter, uint64_t timestamp); +/* + * bt_iter_get_event: Get the iterator's current event data + * + * @iter trace collection iterator (input). Should not be NULL. + * + * Return current event on success, NULL on end of trace. + */ +struct bt_ctf_event *bt_iter_get_event(struct bt_iter *iter); + #ifdef __cplusplus } #endif diff --git a/lib/context.c b/lib/context.c index dc77366..61215a3 100644 --- a/lib/context.c +++ b/lib/context.c @@ -87,6 +87,12 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path, ret = -1; goto end; } + if (ctx->input_trace_format && ctx->input_trace_format != fmt) { + fprintf(stderr, "[error] [Context] Opening traces of different formats in the same context is not supported.\n"); + ret = -1; + goto end; + } + ctx->input_trace_format = fmt; if (path) { td = fmt->open_trace(path, O_RDONLY, packet_seek, NULL); if (!td) { @@ -211,3 +217,54 @@ void bt_context_put(struct bt_context *ctx) if (ctx->refcount == 0) bt_context_destroy(ctx); } + +struct bt_iter *bt_context_create_iterator(struct bt_context *ctx, + const struct bt_iter_pos *position_begin, + const struct bt_iter_pos *position_end) +{ + struct bt_iter *iter = NULL; + struct bt_format *fmt; + assert(ctx); + + if (!ctx->input_trace_format) { + fprintf(stderr, "[error] No trace opened in context.\n"); + goto end; + } + fmt = ctx->input_trace_format; + if (!fmt->iterator_create) { + fprintf(stderr, "[error] The %s format plug-in did not register an iterator creation function.\n", g_quark_to_string(fmt->name)); + goto end; + } + iter = fmt->iterator_create(ctx, position_begin, position_end); + + if (!ctx->current_iterator) { + fprintf(stderr, "[error] The %s format plug-in did not call bt_iter_init in its iterator creation function.\n", + g_quark_to_string(fmt->name)); + } + +end: + return iter; +} + +void bt_context_destroy_iterator(struct bt_context *ctx, + struct bt_iter *iter) +{ + struct bt_format *fmt; + assert(ctx); + + if (!ctx->input_trace_format) { + fprintf(stderr, "[error] No trace opened in context.\n"); + return; + } + fmt = ctx->input_trace_format; + if (!fmt->iterator_destroy) { + fprintf(stderr, "[error] The %s format plug-in did not register an iterator destruction function.\n", + g_quark_to_string(fmt->name)); + return; + } + fmt->iterator_destroy(iter); + if (ctx->current_iterator) { + fprintf(stderr, "[warn] The %s format plug-in did not call bt_iter_fini in its iterator destruction function.\n", + g_quark_to_string(fmt->name)); + } +} diff --git a/lib/iterator.c b/lib/iterator.c index 4190e65..b838000 100644 --- a/lib/iterator.c +++ b/lib/iterator.c @@ -805,3 +805,17 @@ int bt_iter_next(struct bt_iter *iter) end: return ret; } + +struct bt_ctf_event *bt_iter_get_event(struct bt_iter *iter) +{ + struct bt_ctf_event *event; + if (!iter->get_event) { + event = NULL; + fprintf(stderr, "[error] No get_event callback registered by the output plug-in.\n"); + goto end; + } + event = iter->get_event(iter); + +end: + return event; +} diff --git a/tests/lib/test-seeks.c b/tests/lib/test-seeks.c index 47bb42e..69e4d4b 100644 --- a/tests/lib/test-seeks.c +++ b/tests/lib/test-seeks.c @@ -37,7 +37,7 @@ void run_seek_begin(char *path, uint64_t expected_begin) { struct bt_context *ctx; - struct bt_ctf_iter *iter; + struct bt_iter *iter; struct bt_ctf_event *event; struct bt_iter_pos newpos; int ret; @@ -51,12 +51,12 @@ void run_seek_begin(char *path, uint64_t expected_begin) } /* Create iterator with null begin and end */ - iter = bt_ctf_iter_create(ctx, NULL, NULL); + iter = bt_context_create_iterator(ctx, NULL, NULL); if (!iter) { plan_skip_all("Cannot create valid iterator"); } - event = bt_ctf_iter_read_event(iter); + event = bt_iter_get_event(iter); ok(event, "Event valid"); @@ -67,7 +67,7 @@ void run_seek_begin(char *path, uint64_t expected_begin) /* Validate that we get the same value after a seek begin */ newpos.type = BT_SEEK_BEGIN; - ret = bt_iter_set_pos(bt_ctf_get_iter(iter), &newpos); + ret = bt_iter_set_pos(iter, &newpos); ok(ret == 0, "Seek begin retval %d", ret); @@ -86,7 +86,7 @@ void run_seek_begin(char *path, uint64_t expected_begin) void run_seek_last(char *path, uint64_t expected_last) { struct bt_context *ctx; - struct bt_ctf_iter *iter; + struct bt_iter *iter; struct bt_ctf_event *event; struct bt_iter_pos newpos; int ret; @@ -99,18 +99,18 @@ void run_seek_last(char *path, uint64_t expected_last) } /* Create iterator with null last and end */ - iter = bt_ctf_iter_create(ctx, NULL, NULL); + iter = bt_context_create_iterator(ctx, NULL, NULL); if (!iter) { plan_skip_all("Cannot create valid iterator"); } - event = bt_ctf_iter_read_event(iter); + event = bt_iter_get_event(iter); ok(event, "Event valid at beginning"); /* Seek to last */ newpos.type = BT_SEEK_LAST; - ret = bt_iter_set_pos(bt_ctf_get_iter(iter), &newpos); + ret = bt_iter_set_pos(iter, &newpos); ok(ret == 0, "Seek last retval %d", ret); @@ -123,11 +123,11 @@ void run_seek_last(char *path, uint64_t expected_last) ok1(timestamp_last == expected_last); /* Try to read next event */ - ret = bt_iter_next(bt_ctf_get_iter(iter)); + ret = bt_iter_next(iter); ok(ret == 0, "iter next should return an error"); - event = bt_ctf_iter_read_event(iter); + event = bt_iter_get_event(iter); ok(event == 0, "Event after last should be invalid"); @@ -139,7 +139,7 @@ void run_seek_cycles(char *path, uint64_t expected_last) { struct bt_context *ctx; - struct bt_ctf_iter *iter; + struct bt_iter *iter; struct bt_ctf_event *event; struct bt_iter_pos newpos; int ret; @@ -152,22 +152,22 @@ void run_seek_cycles(char *path, } /* Create iterator with null last and end */ - iter = bt_ctf_iter_create(ctx, NULL, NULL); + iter = bt_context_create_iterator(ctx, NULL, NULL); if (!iter) { plan_skip_all("Cannot create valid iterator"); } - event = bt_ctf_iter_read_event(iter); + event = bt_iter_get_event(iter); ok(event, "Event valid at beginning"); /* Seek to last */ newpos.type = BT_SEEK_LAST; - ret = bt_iter_set_pos(bt_ctf_get_iter(iter), &newpos); + ret = bt_iter_set_pos(iter, &newpos); ok(ret == 0, "Seek last retval %d", ret); - event = bt_ctf_iter_read_event(iter); + event = bt_iter_get_event(iter); ok(event, "Event valid at last position"); @@ -176,21 +176,21 @@ void run_seek_cycles(char *path, ok1(timestamp == expected_last); /* Try to read next event */ - ret = bt_iter_next(bt_ctf_get_iter(iter)); + ret = bt_iter_next(iter); ok(ret == 0, "iter next should return an error"); - event = bt_ctf_iter_read_event(iter); + event = bt_iter_get_event(iter); ok(event == 0, "Event after last should be invalid"); /* Seek to BEGIN */ newpos.type = BT_SEEK_BEGIN; - ret = bt_iter_set_pos(bt_ctf_get_iter(iter), &newpos); + ret = bt_iter_set_pos(iter, &newpos); ok(ret == 0, "Seek begin retval %d", ret); - event = bt_ctf_iter_read_event(iter); + event = bt_iter_get_event(iter); ok(event, "Event valid at first position"); @@ -200,11 +200,11 @@ void run_seek_cycles(char *path, /* Seek last again */ newpos.type = BT_SEEK_LAST; - ret = bt_iter_set_pos(bt_ctf_get_iter(iter), &newpos); + ret = bt_iter_set_pos(iter, &newpos); ok(ret == 0, "Seek last retval %d", ret); - event = bt_ctf_iter_read_event(iter); + event = bt_iter_get_event(iter); ok(event, "Event valid at last position"); -- 1.8.2.3 From jeremie.galarneau at efficios.com Mon May 27 23:38:48 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Mon, 27 May 2013 23:38:48 -0400 Subject: [lttng-dev] [PATCH babeltrace] Remove useless variable assignment In-Reply-To: <1369712328-17921-1-git-send-email-jeremie.galarneau@efficios.com> References: <1369712328-17921-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <1369712328-17921-4-git-send-email-jeremie.galarneau@efficios.com> Signed-off-by: J?r?mie Galarneau --- formats/ctf/metadata/ctf-visitor-generate-io-struct.c | 1 - 1 file changed, 1 deletion(-) diff --git a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c index 626eb6b..664d0af 100644 --- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c +++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c @@ -875,7 +875,6 @@ struct bt_declaration *ctf_declaration_struct_visit(FILE *fd, ret = get_unary_unsigned(min_align, &min_align_value); if (ret) { fprintf(fd, "[error] %s: unexpected unary expression for structure \"align\" attribute\n", __func__); - ret = -EINVAL; goto error; } } -- 1.8.2.3 From ionut5001 at gmail.com Tue May 28 08:18:47 2013 From: ionut5001 at gmail.com (Ionut D.) Date: Tue, 28 May 2013 15:18:47 +0300 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: lttng-relayd is functional? Because I want to start it and fails with: DEBUG3 [3661/3661]: URI string: tcp://0.0.0.0:5342 (in uri_parse() at uri.c:250) DEBUG3 [3661/3661]: URI dtype: 1, proto: 1, host: 0.0.0.0, subdir: , ctrl: 5342, data: 0 (in uri_parse() at uri.c:464) DEBUG3 [3661/3661]: URI string: tcp://0.0.0.0:5343 (in uri_parse() at uri.c:250) DEBUG3 [3661/3661]: URI dtype: 1, proto: 1, host: 0.0.0.0, subdir: , ctrl: 5343, data: 0 (in uri_parse() at uri.c:464) DEBUG1 [3661/3661]: Signal handler set for SIGTERM, SIGPIPE and SIGINT (in set_signal_handler() at main.c:346) DEBUG1 [3661/3661]: epoll set max size is 76382 (in compat_epoll_set_max_size() at compat-epoll.c:270) DEBUG1 [3661/3662]: [thread] Relay dispatcher started (in relay_thread_dispatcher() at main.c:646) DEBUG1 [3661/3662]: Futex n to 1 prepare done (in futex_nto1_prepare() at futex.c:75) DEBUG1 [3661/3662]: Woken up but nothing in the relay command queue (in relay_thread_dispatcher() at main.c:656) DEBUG1 [3661/3664]: [thread] Relay listener started (in relay_thread_listener() at main.c:484) DEBUG1 [3661/3663]: [thread] Relay worker started (in relay_thread_worker() at main.c:1772) DEBUG1 [3661/3664]: Listening on sock 7 (in relay_init_sock() at main.c:430) assertion "URCU_TLS(rcu_reader).need_mb == 0" failed: file "urcu.c", line 435, function "rcu_register_thread_mb" DEBUG1 [3661/3664]: Listening on sock 9 (in relay_init_sock() at main.c:430) DEBUG1 [3661/3664]: Listener accepting connections (in relay_thread_listener() at main.c:517) Segmentation fault On Fri, May 24, 2013 at 11:36 PM, Pierre-Luc St-Charles < pierre-luc.st-charles at polymtl.ca> wrote: > Good news: you (most likely) won't need to recompile the whole platform to > fix the problem! > > I think we bumped in a similar bitter-sweet-awful error a while back: > after some hefty searches, we found it might have something to do with the > Android build system globally 'fortifying' the sources against unsafe > functions when compiling some of the most recent versions of the platform. > I believe adding -D_FORTIFY_SOURCE=0 to the CPPFLAGS when building the > tools solved it for us. > > -PL > > > On Fri, May 24, 2013 at 3:04 PM, Francis Giraldeau < > francis.giraldeau at gmail.com> wrote: > >> Hi, >> >> I got some problem compiling required libraries for lttng-tools. I did a >> full android build within repo: >> >> $ source build/envsetup.sh >> $ lunch # with full_maguro-eng >> $ m >> >> Build is fine, but when trying to run configure in lttng-tools, it can't >> find liboprofile_popt. Here is the error message in config.log: >> >> /home/francis/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: >> /home/francis/android/repo/out/target/product/maguro/obj/STATIC_LIBRARIES/liboprofile_popt_intermediates/liboprofile_popt.a(popthelp.o): >> in function singleOptionHelp.isra.4:bionic/libc/include/stdio.h:483: error: >> undefined reference to '__sprintf_chk' >> >> It seems that only the static library of liboprofile_popt is compiled. >> >> The symbol is defined in libc.a and libc.so: >> >> $ nm >> ./out/target/product/maguro/obj/SHARED_LIBRARIES/libc_intermediates/LINKED/libc.so >> | grep -E "__strlen_chk|__sprintf_chk" >> 0001395d T __sprintf_chk >> 00012df1 T __strlen_chk >> >> I tried to compile the configtest.c file by hand and it worked, so it >> really seems to be some kind of environment variable that make it fail. >> >> For the people who managed to do the configure, what arguments should be >> supplied to configure? Or maybe it's my android build that is incomplete? >> Should I build sub-directories in addition to the build in the root android >> repo sources? >> >> Cheers! >> >> Francis >> >> >> 2013/5/24 Pierre-Luc St-Charles >> >>> The required kernel configuration options for the modules are listed in >>> the lttng-module README file, located in its project root directory. Some >>> of the 'optional' options also listed there are simply not supported by >>> 3.0.x ARM kernels (such as HAVE_SYSCALL_TRACEPOINTS), so you might be >>> missing some modules compared to what you would get on a (x86 arch w/ >>> recent kernel) platform. >>> >>> You can find more information on syscall tracing on ARM here: >>> http://comments.gmane.org/gmane.linux.kernel.tracing.lttng.devel/5086 >>> >>> >>> On Fri, May 24, 2013 at 6:44 AM, Ionut D. wrote: >>> >>>> I managed to fix it. It was not finding `lttng-consumerd`, I fixed it >>>> by configuring the package with the right path. But, about the kernel >>>> modules the question is still pertinent. What options should I check >>>> in the kernel configuration? I saw that in my case not all the lttng kernel >>>> modules have been compiled. >>>> >>>> >>>> On Fri, May 24, 2013 at 11:07 AM, Ionut D. wrote: >>>> >>>>> Hello, >>>>> >>>>> Thank you for the slides. I manged to build the kernel modules and I >>>>> insmod them manually. On the device I copied in /data/lttng following >>>>> binaries `lttng`, `lttng-relayd` and `lttng-sessiond`. If I execute >>>>> `./lttng list -k` it shows me a list of available kernel events. I create a >>>>> session called mysession with `./lttng create mysession` and I enable >>>>> tracing on all the event with `./lttng enable-event -a -k`. But here starts >>>>> my problem. >>>>> >>>>> The output of the last command is the following: >>>>> >>>>> root at android:/data/lttng # ./lttng enable-event -a -k >>>>> PERROR [3681/3681]: kernel start consumer exec: (null) (in >>>>> spawn_consumerd() at main.c:2007) >>>>> Error: Condition timed out. The consumer thread was never ready. >>>>> Killing it >>>>> Warning: Using pthread_kill as pthread_cancel is missing on the >>>>> current platform >>>>> PERROR [3608/3658]: write poll pipe: (null) (in notify_thread_pipe() >>>>> at utils.c:43) >>>>> Error: Events: Fatal error of the session daemon (channel channel0, >>>>> session mysession) >>>>> >>>>> Do you have any idea about what could be wrong? What options should I >>>>> check in the kernel configuration? (I checked all that is under Tracing) >>>>> >>>>> --Ionut >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> On Thu, May 23, 2013 at 6:09 PM, Charles Bri?re < >>>>> charles.briere at polymtl.ca> wrote: >>>>> >>>>>> Module location doesn't really matter, we used to push them to >>>>>> /data/... or /sdcard/... . >>>>>> >>>>>> Modprobe doesn't exists on Android so you'll need to use insmod. We >>>>>> used this scriptin order to compile, push to device and load modules. >>>>>> >>>>>> We also made a presentation you might be interested in that can be >>>>>> viewed on >>>>>> https://docs.google.com/presentation/d/14lte2AchEAyxMk3WSQ53SdbBm2tfmABBFQojuUhxg7Y/pub?start=false&loop=false&delayms=3000 >>>>>> >>>>>> >>>>>> On Thu, May 23, 2013 at 10:40 AM, Ionut D. wrote: >>>>>> >>>>>>> About the kernel modules. Where should they be located on the >>>>>>> target? Should I have modprobe or insmod it is enough? >>>>>>> >>>>>>> >>>>>>> On Thu, May 23, 2013 at 2:19 PM, Ionut D. wrote: >>>>>>> >>>>>>>> Sorry for my late response. At the end after different some adds >>>>>>>> (defines in libc) I managed to compile them for ICS with NDK r7c. I was a >>>>>>>> problem of environment. >>>>>>>> >>>>>>>> >>>>>>>> On Tue, May 21, 2013 at 9:26 PM, Pierre-Luc St-Charles < >>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>> >>>>>>>>> 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). >>>>>>>>> >>>>>>>>> >>>>>>>>> On Tue, May 21, 2013 at 11:29 AM, Ionut D. wrote: >>>>>>>>> >>>>>>>>>> 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: >>>>>>>>>> >>>>>>>>>> NDK: >>>>>>>>>> #grep -r __NR_splice . >>>>>>>>>> ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>>>>>> __NR_splice 313 >>>>>>>>>> ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>>>>>> __NR_splice 313 >>>>>>>>>> >>>>>>>>>> bionic: >>>>>>>>>> grep -r __NR_splice bionic >>>>>>>>>> bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice 313 >>>>>>>>>> bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice 341 >>>>>>>>>> bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice >>>>>>>>>> 313 >>>>>>>>>> >>>>>>>>>> Looking through results I see that '__NR_splice' it not in >>>>>>>>>> unistd.h and I know this is important. >>>>>>>>>> >>>>>>>>>> Ionut >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < >>>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>>> >>>>>>>>>>> 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. >>>>>>>>>>> >>>>>>>>>>> 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. >>>>>>>>>>> >>>>>>>>>>> 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? >>>>>>>>>>> >>>>>>>>>>> -PL >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: >>>>>>>>>>> >>>>>>>>>>>> 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? >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> In file included from >>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >>>>>>>>>>>> In function 'splice': >>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>>>> error: '__NR_splice' undeclared (first use in this function) >>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>>>> error: (Each undeclared identifier is reported only once >>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>>>> error: for each function it appears in.) >>>>>>>>>>>> In file included from >>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >>>>>>>>>>>> warning: "POSIX_FADV_DONTNEED" redefined >>>>>>>>>>>> In file included from >>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >>>>>>>>>>>> from >>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>>>> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this >>>>>>>>>>>> is the location of the previous definition >>>>>>>>>>>> In file included from bionic/libc/include/sys/select.h:34, >>>>>>>>>>>> from bionic/libc/include/unistd.h:34, >>>>>>>>>>>> from >>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h: At top level: >>>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:27: error: >>>>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:28: error: >>>>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:29: error: >>>>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>>>> In file included from bionic/libc/include/unistd.h:34, >>>>>>>>>>>> from >>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>>>>>> bionic/libc/include/sys/select.h:42: error: expected ';', ',' >>>>>>>>>>>> or ')' before '*' token >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On Sat, May 18, 2013 at 10:21 AM, Ionut D. >>>>>>>>>>> > wrote: >>>>>>>>>>>> >>>>>>>>>>>>> Great informations! I will post back the results. >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>>>>>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> Alright, small update for all following a quick >>>>>>>>>>>>>> (non-mailing-list) exchange: >>>>>>>>>>>>>> >>>>>>>>>>>>>> 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 >>>>>>>>>>>>>> here; >>>>>>>>>>>>>> still not perfect). >>>>>>>>>>>>>> >>>>>>>>>>>>>> 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). >>>>>>>>>>>>>> >>>>>>>>>>>>>> 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). >>>>>>>>>>>>>> >>>>>>>>>>>>>> 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). >>>>>>>>>>>>>> >>>>>>>>>>>>>> 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. >>>>>>>>>>>>>> >>>>>>>>>>>>>> So, simple 'how do I put LTTng on Android' workflow would be >>>>>>>>>>>>>> this: >>>>>>>>>>>>>> >>>>>>>>>>>>>> - Compile modules (using NDK) against device's kernel, >>>>>>>>>>>>>> making sure its config is appropriate, ship them over via ADB >>>>>>>>>>>>>> >>>>>>>>>>>>>> - Compile required external libraries (using repo build >>>>>>>>>>>>>> system) for the device, ship them over via ADB >>>>>>>>>>>>>> >>>>>>>>>>>>>> - 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) >>>>>>>>>>>>>> >>>>>>>>>>>>>> - Cross-compile LTTng-* for the device (using NDK), ship >>>>>>>>>>>>>> binaries over via ADB >>>>>>>>>>>>>> >>>>>>>>>>>>>> Then, on the device, start up the sessiond manually & start >>>>>>>>>>>>>> tracing. >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> I think I went over everything, but if there's a part that's >>>>>>>>>>>>>> still cloudy, don't hesitate. >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> -PL >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> On May 17, 2013 1:32 AM, "Ionut D." >>>>>>>>>>>>>> wrote: >>>>>>>>>>>>>> >>>>>>>>>>>>>>> Hello all, >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> 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. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> 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. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> It is ok? what I am trying to do ? to integrate and build by >>>>>>>>>>>>>>> using the Android build system. >>>>>>>>>>>>>>> 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 ? >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> 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. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Would be great if you will give me a tutorial about how to >>>>>>>>>>>>>>> do it. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Ionut >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>>>> lttng-dev mailing list >>>>>>>>>>>>>>> lttng-dev at lists.lttng.org >>>>>>>>>>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> lttng-dev mailing list >>>>>>> lttng-dev at lists.lttng.org >>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >>> _______________________________________________ >>> lttng-dev mailing list >>> lttng-dev at lists.lttng.org >>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>> >>> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >> >> > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sancelot at free.fr Tue May 28 08:31:53 2013 From: sancelot at free.fr (=?ISO-8859-1?Q?St=E9phane_ANCELOT?=) Date: Tue, 28 May 2013 14:31:53 +0200 Subject: [lttng-dev] using a custom channel Message-ID: <51A4A3B9.7010303@free.fr> Hi, I finally managed to create my trace events probes... I copied my .h header in instrumentation/event/lttng-module and create a lttng probe module but now, I would like to use other channels than channel0 , how to do this, I tried using xn_nucleus_blahblah as event name, but it has not helped , it is seen in channel0 Regards, Steph From thomas.petazzoni at free-electrons.com Tue May 28 09:27:06 2013 From: thomas.petazzoni at free-electrons.com (Thomas Petazzoni) Date: Tue, 28 May 2013 15:27:06 +0200 Subject: [lttng-dev] [PATCH 1/2] Do not call posix_fallocate() on uClibc Message-ID: <1369747627-21626-1-git-send-email-thomas.petazzoni@free-electrons.com> uClibc does not implement posix_fallocate(), and posix_fallocate() is mostly only an hint to the kernel that we will need such or such amount of space inside a file. So we just don't call posix_fallocate() when building against uClibc. Signed-off-by: Thomas Petazzoni --- formats/ctf/ctf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index bb94e52..77aef28 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -723,9 +724,11 @@ void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence) } pos->content_size = -1U; /* Unknown at this point */ pos->packet_size = WRITE_PACKET_LEN; +#ifndef __UCLIBC__ off = posix_fallocate(pos->fd, pos->mmap_offset, pos->packet_size / CHAR_BIT); assert(off >= 0); +#endif pos->offset = 0; } else { read_next_packet: -- 1.7.9.5 From thomas.petazzoni at free-electrons.com Tue May 28 09:27:07 2013 From: thomas.petazzoni at free-electrons.com (Thomas Petazzoni) Date: Tue, 28 May 2013 15:27:07 +0200 Subject: [lttng-dev] [PATCH 2/2] Support old compilers In-Reply-To: <1369747627-21626-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1369747627-21626-1-git-send-email-thomas.petazzoni@free-electrons.com> Message-ID: <1369747627-21626-2-git-send-email-thomas.petazzoni@free-electrons.com> Some old compilers do not use C99 as their default C language variant, for example gcc 4.3.x, which is used on some old machines. When such a compiler is used, by default, ULLONG_MAX is not visible. Adding -std=gnu99 is needed to make this definition visible. In autoconf speak, this translates into the need of using AC_PROC_CC_STDC instead of AC_PROG_CC. See http://www.gnu.org/software/autoconf/manual/autoconf-2.65/html_node/C-Compiler.html for more details. Signed-off-by: Thomas Petazzoni --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 83822d6..3ddcb7c 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ AC_CONFIG_HEADERS([config.h]) AC_SYS_LARGEFILE # Checks for programs. -AC_PROG_CC +AC_PROG_CC_STDC AC_PROG_MAKE_SET LT_INIT AC_PROG_YACC -- 1.7.9.5 From pierre-luc.st-charles at polymtl.ca Tue May 28 09:27:40 2013 From: pierre-luc.st-charles at polymtl.ca (Pierre-Luc St-Charles) Date: Tue, 28 May 2013 09:27:40 -0400 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: Good question: I don't suppose it's fully working right now, as we've barely touched/tested it yet (we worked mostly locally or via Eclipse). It should be amongst the next improvement batch though; could you provide the commands you used to trigger that exact crash? I'll try to replicate it later this week. On Tue, May 28, 2013 at 8:18 AM, Ionut D. wrote: > lttng-relayd is functional? Because I want to start it and fails with: > > DEBUG3 [3661/3661]: URI string: tcp://0.0.0.0:5342 (in uri_parse() at > uri.c:250) > DEBUG3 [3661/3661]: URI dtype: 1, proto: 1, host: 0.0.0.0, subdir: , ctrl: > 5342, data: 0 (in uri_parse() at uri.c:464) > DEBUG3 [3661/3661]: URI string: tcp://0.0.0.0:5343 (in uri_parse() at > uri.c:250) > DEBUG3 [3661/3661]: URI dtype: 1, proto: 1, host: 0.0.0.0, subdir: , ctrl: > 5343, data: 0 (in uri_parse() at uri.c:464) > DEBUG1 [3661/3661]: Signal handler set for SIGTERM, SIGPIPE and SIGINT (in > set_signal_handler() at main.c:346) > DEBUG1 [3661/3661]: epoll set max size is 76382 (in > compat_epoll_set_max_size() at compat-epoll.c:270) > DEBUG1 [3661/3662]: [thread] Relay dispatcher started (in > relay_thread_dispatcher() at main.c:646) > DEBUG1 [3661/3662]: Futex n to 1 prepare done (in futex_nto1_prepare() at > futex.c:75) > DEBUG1 [3661/3662]: Woken up but nothing in the relay command queue (in > relay_thread_dispatcher() at main.c:656) > DEBUG1 [3661/3664]: [thread] Relay listener started (in > relay_thread_listener() at main.c:484) > DEBUG1 [3661/3663]: [thread] Relay worker started (in > relay_thread_worker() at main.c:1772) > DEBUG1 [3661/3664]: Listening on sock 7 (in relay_init_sock() at > main.c:430) > assertion "URCU_TLS(rcu_reader).need_mb == 0" failed: file "urcu.c", line > 435, function "rcu_register_thread_mb" > DEBUG1 [3661/3664]: Listening on sock 9 (in relay_init_sock() at > main.c:430) > DEBUG1 [3661/3664]: Listener accepting connections (in > relay_thread_listener() at main.c:517) > Segmentation fault > > > > On Fri, May 24, 2013 at 11:36 PM, Pierre-Luc St-Charles < > pierre-luc.st-charles at polymtl.ca> wrote: > >> Good news: you (most likely) won't need to recompile the whole platform >> to fix the problem! >> >> I think we bumped in a similar bitter-sweet-awful error a while back: >> after some hefty searches, we found it might have something to do with the >> Android build system globally 'fortifying' the sources against unsafe >> functions when compiling some of the most recent versions of the platform. >> I believe adding -D_FORTIFY_SOURCE=0 to the CPPFLAGS when building the >> tools solved it for us. >> >> -PL >> >> >> On Fri, May 24, 2013 at 3:04 PM, Francis Giraldeau < >> francis.giraldeau at gmail.com> wrote: >> >>> Hi, >>> >>> I got some problem compiling required libraries for lttng-tools. I did a >>> full android build within repo: >>> >>> $ source build/envsetup.sh >>> $ lunch # with full_maguro-eng >>> $ m >>> >>> Build is fine, but when trying to run configure in lttng-tools, it can't >>> find liboprofile_popt. Here is the error message in config.log: >>> >>> /home/francis/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: >>> /home/francis/android/repo/out/target/product/maguro/obj/STATIC_LIBRARIES/liboprofile_popt_intermediates/liboprofile_popt.a(popthelp.o): >>> in function singleOptionHelp.isra.4:bionic/libc/include/stdio.h:483: error: >>> undefined reference to '__sprintf_chk' >>> >>> It seems that only the static library of liboprofile_popt is compiled. >>> >>> The symbol is defined in libc.a and libc.so: >>> >>> $ nm >>> ./out/target/product/maguro/obj/SHARED_LIBRARIES/libc_intermediates/LINKED/libc.so >>> | grep -E "__strlen_chk|__sprintf_chk" >>> 0001395d T __sprintf_chk >>> 00012df1 T __strlen_chk >>> >>> I tried to compile the configtest.c file by hand and it worked, so it >>> really seems to be some kind of environment variable that make it fail. >>> >>> For the people who managed to do the configure, what arguments should be >>> supplied to configure? Or maybe it's my android build that is incomplete? >>> Should I build sub-directories in addition to the build in the root android >>> repo sources? >>> >>> Cheers! >>> >>> Francis >>> >>> >>> 2013/5/24 Pierre-Luc St-Charles >>> >>>> The required kernel configuration options for the modules are listed in >>>> the lttng-module README file, located in its project root directory. Some >>>> of the 'optional' options also listed there are simply not supported by >>>> 3.0.x ARM kernels (such as HAVE_SYSCALL_TRACEPOINTS), so you might be >>>> missing some modules compared to what you would get on a (x86 arch w/ >>>> recent kernel) platform. >>>> >>>> You can find more information on syscall tracing on ARM here: >>>> http://comments.gmane.org/gmane.linux.kernel.tracing.lttng.devel/5086 >>>> >>>> >>>> On Fri, May 24, 2013 at 6:44 AM, Ionut D. wrote: >>>> >>>>> I managed to fix it. It was not finding `lttng-consumerd`, I fixed it >>>>> by configuring the package with the right path. But, about the kernel >>>>> modules the question is still pertinent. What options should I check >>>>> in the kernel configuration? I saw that in my case not all the lttng kernel >>>>> modules have been compiled. >>>>> >>>>> >>>>> On Fri, May 24, 2013 at 11:07 AM, Ionut D. wrote: >>>>> >>>>>> Hello, >>>>>> >>>>>> Thank you for the slides. I manged to build the kernel modules and I >>>>>> insmod them manually. On the device I copied in /data/lttng following >>>>>> binaries `lttng`, `lttng-relayd` and `lttng-sessiond`. If I execute >>>>>> `./lttng list -k` it shows me a list of available kernel events. I create a >>>>>> session called mysession with `./lttng create mysession` and I enable >>>>>> tracing on all the event with `./lttng enable-event -a -k`. But here starts >>>>>> my problem. >>>>>> >>>>>> The output of the last command is the following: >>>>>> >>>>>> root at android:/data/lttng # ./lttng enable-event -a -k >>>>>> PERROR [3681/3681]: kernel start consumer exec: (null) (in >>>>>> spawn_consumerd() at main.c:2007) >>>>>> Error: Condition timed out. The consumer thread was never ready. >>>>>> Killing it >>>>>> Warning: Using pthread_kill as pthread_cancel is missing on the >>>>>> current platform >>>>>> PERROR [3608/3658]: write poll pipe: (null) (in notify_thread_pipe() >>>>>> at utils.c:43) >>>>>> Error: Events: Fatal error of the session daemon (channel channel0, >>>>>> session mysession) >>>>>> >>>>>> Do you have any idea about what could be wrong? What options should I >>>>>> check in the kernel configuration? (I checked all that is under Tracing) >>>>>> >>>>>> --Ionut >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Thu, May 23, 2013 at 6:09 PM, Charles Bri?re < >>>>>> charles.briere at polymtl.ca> wrote: >>>>>> >>>>>>> Module location doesn't really matter, we used to push them to >>>>>>> /data/... or /sdcard/... . >>>>>>> >>>>>>> Modprobe doesn't exists on Android so you'll need to use insmod. We >>>>>>> used this scriptin order to compile, push to device and load modules. >>>>>>> >>>>>>> We also made a presentation you might be interested in that can be >>>>>>> viewed on >>>>>>> https://docs.google.com/presentation/d/14lte2AchEAyxMk3WSQ53SdbBm2tfmABBFQojuUhxg7Y/pub?start=false&loop=false&delayms=3000 >>>>>>> >>>>>>> >>>>>>> On Thu, May 23, 2013 at 10:40 AM, Ionut D. wrote: >>>>>>> >>>>>>>> About the kernel modules. Where should they be located on the >>>>>>>> target? Should I have modprobe or insmod it is enough? >>>>>>>> >>>>>>>> >>>>>>>> On Thu, May 23, 2013 at 2:19 PM, Ionut D. wrote: >>>>>>>> >>>>>>>>> Sorry for my late response. At the end after different some adds >>>>>>>>> (defines in libc) I managed to compile them for ICS with NDK r7c. I was a >>>>>>>>> problem of environment. >>>>>>>>> >>>>>>>>> >>>>>>>>> On Tue, May 21, 2013 at 9:26 PM, Pierre-Luc St-Charles < >>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>> >>>>>>>>>> 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). >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Tue, May 21, 2013 at 11:29 AM, Ionut D. wrote: >>>>>>>>>> >>>>>>>>>>> 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: >>>>>>>>>>> >>>>>>>>>>> NDK: >>>>>>>>>>> #grep -r __NR_splice . >>>>>>>>>>> ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>>>>>>> __NR_splice 313 >>>>>>>>>>> ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>>>>>>> __NR_splice 313 >>>>>>>>>>> >>>>>>>>>>> bionic: >>>>>>>>>>> grep -r __NR_splice bionic >>>>>>>>>>> bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice >>>>>>>>>>> 313 >>>>>>>>>>> bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice >>>>>>>>>>> 341 >>>>>>>>>>> bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice >>>>>>>>>>> 313 >>>>>>>>>>> >>>>>>>>>>> Looking through results I see that '__NR_splice' it not in >>>>>>>>>>> unistd.h and I know this is important. >>>>>>>>>>> >>>>>>>>>>> Ionut >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < >>>>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>>>> >>>>>>>>>>>> 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. >>>>>>>>>>>> >>>>>>>>>>>> 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. >>>>>>>>>>>> >>>>>>>>>>>> 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? >>>>>>>>>>>> >>>>>>>>>>>> -PL >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On Tue, May 21, 2013 at 6:26 AM, Ionut D. wrote: >>>>>>>>>>>> >>>>>>>>>>>>> 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? >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> In file included from >>>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >>>>>>>>>>>>> In function 'splice': >>>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>>>>> error: '__NR_splice' undeclared (first use in this function) >>>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>>>>> error: (Each undeclared identifier is reported only once >>>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>>>>> error: for each function it appears in.) >>>>>>>>>>>>> In file included from >>>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >>>>>>>>>>>>> warning: "POSIX_FADV_DONTNEED" redefined >>>>>>>>>>>>> In file included from >>>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >>>>>>>>>>>>> from >>>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>>>>> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this >>>>>>>>>>>>> is the location of the previous definition >>>>>>>>>>>>> In file included from bionic/libc/include/sys/select.h:34, >>>>>>>>>>>>> from bionic/libc/include/unistd.h:34, >>>>>>>>>>>>> from >>>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h: At top level: >>>>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:27: error: >>>>>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:28: error: >>>>>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:29: error: >>>>>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>>>>> In file included from bionic/libc/include/unistd.h:34, >>>>>>>>>>>>> from >>>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>>>>>>> bionic/libc/include/sys/select.h:42: error: expected ';', ',' >>>>>>>>>>>>> or ')' before '*' token >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> On Sat, May 18, 2013 at 10:21 AM, Ionut D. < >>>>>>>>>>>>> ionut5001 at gmail.com> wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> Great informations! I will post back the results. >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>>>>>>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>>>>>>> >>>>>>>>>>>>>>> Alright, small update for all following a quick >>>>>>>>>>>>>>> (non-mailing-list) exchange: >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> 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 >>>>>>>>>>>>>>> here; >>>>>>>>>>>>>>> still not perfect). >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> 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). >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> 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). >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> 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). >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> 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. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> So, simple 'how do I put LTTng on Android' workflow would be >>>>>>>>>>>>>>> this: >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> - Compile modules (using NDK) against device's kernel, >>>>>>>>>>>>>>> making sure its config is appropriate, ship them over via ADB >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> - Compile required external libraries (using repo build >>>>>>>>>>>>>>> system) for the device, ship them over via ADB >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> - 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) >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> - Cross-compile LTTng-* for the device (using NDK), ship >>>>>>>>>>>>>>> binaries over via ADB >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Then, on the device, start up the sessiond manually & start >>>>>>>>>>>>>>> tracing. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> I think I went over everything, but if there's a part that's >>>>>>>>>>>>>>> still cloudy, don't hesitate. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> -PL >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> On May 17, 2013 1:32 AM, "Ionut D." >>>>>>>>>>>>>>> wrote: >>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> Hello all, >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> 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. >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> 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. >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> It is ok? what I am trying to do ? to integrate and build >>>>>>>>>>>>>>>> by using the Android build system. >>>>>>>>>>>>>>>> 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 ? >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> 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. >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> Would be great if you will give me a tutorial about how to >>>>>>>>>>>>>>>> do it. >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> Ionut >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>>>>> lttng-dev mailing list >>>>>>>>>>>>>>>> lttng-dev at lists.lttng.org >>>>>>>>>>>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> lttng-dev mailing list >>>>>>>> lttng-dev at lists.lttng.org >>>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>>> _______________________________________________ >>>> lttng-dev mailing list >>>> lttng-dev at lists.lttng.org >>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>> >>>> >>> >>> _______________________________________________ >>> lttng-dev mailing list >>> lttng-dev at lists.lttng.org >>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>> >>> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.desnoyers at efficios.com Tue May 28 09:50:00 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 28 May 2013 09:50:00 -0400 Subject: [lttng-dev] [PATCH 1/2] Do not call posix_fallocate() on uClibc In-Reply-To: <1369747627-21626-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1369747627-21626-1-git-send-email-thomas.petazzoni@free-electrons.com> Message-ID: <20130528135000.GA4549@Krystal> * Thomas Petazzoni (thomas.petazzoni at free-electrons.com) wrote: > uClibc does not implement posix_fallocate(), and posix_fallocate() is > mostly only an hint to the kernel that we will need such or such > amount of space inside a file. So we just don't call posix_fallocate() > when building against uClibc. please implement separately in a wrapper header, within a compat or wrapper directory. Thanks, Mathieu > > Signed-off-by: Thomas Petazzoni > --- > formats/ctf/ctf.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c > index bb94e52..77aef28 100644 > --- a/formats/ctf/ctf.c > +++ b/formats/ctf/ctf.c > @@ -43,6 +43,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -723,9 +724,11 @@ void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence) > } > pos->content_size = -1U; /* Unknown at this point */ > pos->packet_size = WRITE_PACKET_LEN; > +#ifndef __UCLIBC__ > off = posix_fallocate(pos->fd, pos->mmap_offset, > pos->packet_size / CHAR_BIT); > assert(off >= 0); > +#endif > pos->offset = 0; > } else { > read_next_packet: > -- > 1.7.9.5 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 28 13:28:24 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 28 May 2013 13:28:24 -0400 Subject: [lttng-dev] [PATCH babeltrace] Add bt_stream_pos to bt_trace_descriptor In-Reply-To: <1369712328-17921-1-git-send-email-jeremie.galarneau@efficios.com> References: <1369712328-17921-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130528172823.GA20859@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > This is intended to provide a generic way to access the bt_stream_pos API > without having to make assumptions about the output format's descriptor layout. > > Renamed format-internal.h to trace-descriptor-internal.h to make it more > representative of the interface it really contains. > > Signed-off-by: J?r?mie Galarneau [...] > --- /dev/null > +++ b/include/babeltrace/trace-descriptor.h > @@ -0,0 +1,53 @@ > +#ifndef _BABELTRACE_TRACE_DESCRIPTOR_H > +#define _BABELTRACE_TRACE_DESCRIPTOR_H > + > +/* > + * BabelTrace > + * > + * Trace Descriptor Header > + * > + * Copyright 2013 EfficiOS Inc. and Linux Foundation > + * > + * Author: J?r?mie Galarneau > + * > + * Permission is hereby granted, free of charge, to any person obtaining a copy > + * of this software and associated documentation files (the "Software"), to deal > + * in the Software without restriction, including without limitation the rights > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > + * copies of the Software, and to permit persons to whom the Software is > + * furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice shall be included in > + * all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > + * SOFTWARE. > + */ > + > +#include babeltrace/trace-descriptor.h is part of the public API. We don't want to expose glib dependency unless utterly necessary. > + > +struct bt_trace_descriptor; > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +/* > + * bt_trace_descriptor_get_stream_pos: Get the stream_pos array associated > + * with descriptor's trace > + * > + * Return: Array of pointers to struct bt_stream_pos > + */ > +extern const GPtrArray *bt_trace_descriptor_get_stream_pos( > + const struct bt_trace_descriptor *descriptor); Rather than just doing a "getter" to an internal structure, we should provide an appropriate API that abstracts this. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 28 13:29:36 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 28 May 2013 13:29:36 -0400 Subject: [lttng-dev] [PATCH babeltrace] Remove useless variable assignment In-Reply-To: <1369712328-17921-4-git-send-email-jeremie.galarneau@efficios.com> References: <1369712328-17921-1-git-send-email-jeremie.galarneau@efficios.com> <1369712328-17921-4-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130528172936.GB20859@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > Signed-off-by: J?r?mie Galarneau merged, thanks! Mathieu > --- > formats/ctf/metadata/ctf-visitor-generate-io-struct.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > index 626eb6b..664d0af 100644 > --- a/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > +++ b/formats/ctf/metadata/ctf-visitor-generate-io-struct.c > @@ -875,7 +875,6 @@ struct bt_declaration *ctf_declaration_struct_visit(FILE *fd, > ret = get_unary_unsigned(min_align, &min_align_value); > if (ret) { > fprintf(fd, "[error] %s: unexpected unary expression for structure \"align\" attribute\n", __func__); > - ret = -EINVAL; > goto error; > } > } > -- > 1.8.2.3 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 28 13:30:15 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 28 May 2013 13:30:15 -0400 Subject: [lttng-dev] [PATCH babeltrace] Fix converter code relying on the output type being ctf-text In-Reply-To: <1369712328-17921-2-git-send-email-jeremie.galarneau@efficios.com> References: <1369712328-17921-1-git-send-email-jeremie.galarneau@efficios.com> <1369712328-17921-2-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130528173015.GC20859@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > Signed-off-by: J?r?mie Galarneau > --- > converter/babeltrace.c | 92 ++++++++++++++++++++++++++------------------- > include/babeltrace/format.h | 2 +- > 2 files changed, 54 insertions(+), 40 deletions(-) > > diff --git a/converter/babeltrace.c b/converter/babeltrace.c > index d5a7040..8f09845 100644 > --- a/converter/babeltrace.c > +++ b/converter/babeltrace.c > @@ -546,25 +546,33 @@ static > int trace_pre_handler(struct bt_trace_descriptor *td_write, > struct bt_context *ctx) > { > - struct ctf_text_stream_pos *sout; > - struct trace_collection *tc; > int ret, i; > + struct trace_collection *tc = ctx->tc; > + const GPtrArray *out_streams = bt_trace_descriptor_get_stream_pos(td_write); please resubmit after fixing the bt_trace_descriptor_get_stream_pos API exposing glib. Thanks, Mathieu > > - sout = container_of(td_write, struct ctf_text_stream_pos, > - trace_descriptor); > - > - if (!sout->parent.pre_trace_cb) > - return 0; > + if (!out_streams) { > + ret = -1; > + goto end; > + } > > - tc = ctx->tc; > for (i = 0; i < tc->array->len; i++) { > - struct bt_trace_descriptor *td = > + int sout_nr; > + struct bt_trace_descriptor *in_descriptor = > g_ptr_array_index(tc->array, i); > > - ret = sout->parent.pre_trace_cb(&sout->parent, td); > - if (ret) { > - fprintf(stderr, "[error] Writing to trace pre handler failed.\n"); > - goto end; > + for (sout_nr = 0; sout_nr < out_streams->len; ++sout_nr) { > + struct bt_stream_pos *sout = > + g_ptr_array_index(out_streams, sout_nr); > + > + if (!sout->pre_trace_cb) { > + continue; > + } > + > + ret = sout->pre_trace_cb(sout, in_descriptor); > + if (ret) { > + fprintf(stderr, "[error] Writing to trace pre handler failed.\n"); > + goto end; > + } > } > } > ret = 0; > @@ -576,25 +584,28 @@ static > int trace_post_handler(struct bt_trace_descriptor *td_write, > struct bt_context *ctx) > { > - struct ctf_text_stream_pos *sout; > - struct trace_collection *tc; > int ret, i; > + struct trace_collection *tc = ctx->tc; > + const GPtrArray *out_streams = bt_trace_descriptor_get_stream_pos(td_write); > > - sout = container_of(td_write, struct ctf_text_stream_pos, > - trace_descriptor); > - > - if (!sout->parent.post_trace_cb) > - return 0; > - > - tc = ctx->tc; > for (i = 0; i < tc->array->len; i++) { > - struct bt_trace_descriptor *td = > + int sout_nr; > + struct bt_trace_descriptor *in_descriptor = > g_ptr_array_index(tc->array, i); > > - ret = sout->parent.post_trace_cb(&sout->parent, td); > - if (ret) { > - fprintf(stderr, "[error] Writing to trace post handler failed.\n"); > - goto end; > + for (sout_nr = 0; sout_nr < out_streams->len; ++sout_nr) { > + struct bt_stream_pos *sout = > + g_ptr_array_index(out_streams, sout_nr); > + > + if (!sout->pre_trace_cb) { > + continue; > + } > + > + ret = sout->post_trace_cb(sout, in_descriptor); > + if (ret) { > + fprintf(stderr, "[error] Writing to trace post handler failed.\n"); > + goto end; > + } > } > } > ret = 0; > @@ -607,16 +618,10 @@ int convert_trace(struct bt_trace_descriptor *td_write, > struct bt_context *ctx) > { > struct bt_ctf_iter *iter; > - struct ctf_text_stream_pos *sout; > struct bt_iter_pos begin_pos; > struct bt_ctf_event *ctf_event; > int ret; > - > - sout = container_of(td_write, struct ctf_text_stream_pos, > - trace_descriptor); > - > - if (!sout->parent.event_cb) > - return 0; > + const GPtrArray *out_streams = bt_trace_descriptor_get_stream_pos(td_write); > > begin_pos.type = BT_SEEK_BEGIN; > iter = bt_ctf_iter_create(ctx, &begin_pos, NULL); > @@ -625,14 +630,23 @@ int convert_trace(struct bt_trace_descriptor *td_write, > goto error_iter; > } > while ((ctf_event = bt_ctf_iter_read_event(iter))) { > - ret = sout->parent.event_cb(&sout->parent, ctf_event->parent->stream); > - if (ret) { > - fprintf(stderr, "[error] Writing event failed.\n"); > - goto end; > + int sout_nr; > + for (sout_nr = 0; sout_nr < out_streams->len; ++sout_nr) { > + struct bt_stream_pos *sout = > + g_ptr_array_index(out_streams, sout_nr); > + if (!sout->event_cb) { > + continue; > + } > + ret = sout->event_cb(sout, ctf_event->parent->stream); > + if (ret) { > + fprintf(stderr, "[error] Writing event failed.\n"); > + goto end; > + } > } > ret = bt_iter_next(bt_ctf_get_iter(iter)); > - if (ret < 0) > + if (ret < 0) { > goto end; > + } > } > ret = 0; > > diff --git a/include/babeltrace/format.h b/include/babeltrace/format.h > index 07e854f..9f3d1c8 100644 > --- a/include/babeltrace/format.h > +++ b/include/babeltrace/format.h > @@ -31,6 +31,7 @@ > > #include > #include > +#include > #include > #include > > @@ -44,7 +45,6 @@ typedef int bt_intern_str; > struct bt_stream_pos; > struct bt_context; > struct bt_trace_handle; > -struct bt_trace_descriptor; > > struct bt_mmap_stream { > int fd; > -- > 1.8.2.3 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 28 13:30:47 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 28 May 2013 13:30:47 -0400 Subject: [lttng-dev] [PATCH babeltrace] Add a format-agnostic iterator creation mechanism In-Reply-To: <1369712328-17921-3-git-send-email-jeremie.galarneau@efficios.com> References: <1369712328-17921-1-git-send-email-jeremie.galarneau@efficios.com> <1369712328-17921-3-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130528173047.GD20859@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > Iterators now expose an event providing function so that a user does not > need to know the input trace format to get "bt_ctf_event"s. > > A context can now create a specialized iterator depending on its input > trace format. Please resubmit after API update. Thanks, Mathieu > > Signed-off-by: J?r?mie Galarneau > --- > converter/babeltrace.c | 10 +++--- > formats/ctf/ctf.c | 3 ++ > formats/ctf/iterator.c | 34 +++++++++++++------- > include/babeltrace/context-internal.h | 1 + > include/babeltrace/context.h | 31 ++++++++++++++++++ > include/babeltrace/ctf/iterator.h | 6 ++-- > include/babeltrace/format.h | 14 +++++++++ > include/babeltrace/iterator-internal.h | 1 + > include/babeltrace/iterator.h | 11 +++++++ > lib/context.c | 57 ++++++++++++++++++++++++++++++++++ > lib/iterator.c | 14 +++++++++ > tests/lib/test-seeks.c | 42 ++++++++++++------------- > 12 files changed, 183 insertions(+), 41 deletions(-) > > diff --git a/converter/babeltrace.c b/converter/babeltrace.c > index 8f09845..c86df93 100644 > --- a/converter/babeltrace.c > +++ b/converter/babeltrace.c > @@ -617,19 +617,19 @@ static > int convert_trace(struct bt_trace_descriptor *td_write, > struct bt_context *ctx) > { > - struct bt_ctf_iter *iter; > + struct bt_iter *iter; > struct bt_iter_pos begin_pos; > struct bt_ctf_event *ctf_event; > int ret; > const GPtrArray *out_streams = bt_trace_descriptor_get_stream_pos(td_write); > > begin_pos.type = BT_SEEK_BEGIN; > - iter = bt_ctf_iter_create(ctx, &begin_pos, NULL); > + iter = bt_context_create_iterator(ctx, &begin_pos, NULL); > if (!iter) { > ret = -1; > goto error_iter; > } > - while ((ctf_event = bt_ctf_iter_read_event(iter))) { > + while ((ctf_event = bt_iter_get_event(iter))) { > int sout_nr; > for (sout_nr = 0; sout_nr < out_streams->len; ++sout_nr) { > struct bt_stream_pos *sout = > @@ -643,7 +643,7 @@ int convert_trace(struct bt_trace_descriptor *td_write, > goto end; > } > } > - ret = bt_iter_next(bt_ctf_get_iter(iter)); > + ret = bt_iter_next(iter); > if (ret < 0) { > goto end; > } > @@ -651,7 +651,7 @@ int convert_trace(struct bt_trace_descriptor *td_write, > ret = 0; > > end: > - bt_ctf_iter_destroy(iter); > + bt_context_destroy_iterator(ctx, iter); > error_iter: > return ret; > } > diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c > index aee80b1..c029791 100644 > --- a/formats/ctf/ctf.c > +++ b/formats/ctf/ctf.c > @@ -29,6 +29,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -144,6 +145,8 @@ struct bt_format ctf_format = { > .timestamp_begin = ctf_timestamp_begin, > .timestamp_end = ctf_timestamp_end, > .convert_index_timestamp = ctf_convert_index_timestamp, > + .iterator_create = bt_ctf_iter_create, > + .iterator_destroy = bt_ctf_iter_destroy > }; > > static > diff --git a/formats/ctf/iterator.c b/formats/ctf/iterator.c > index d2cd914..a294167 100644 > --- a/formats/ctf/iterator.c > +++ b/formats/ctf/iterator.c > @@ -30,6 +30,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -39,7 +40,7 @@ > > #include "events-private.h" > > -struct bt_ctf_iter *bt_ctf_iter_create(struct bt_context *ctx, > +struct bt_iter *bt_ctf_iter_create(struct bt_context *ctx, > const struct bt_iter_pos *begin_pos, > const struct bt_iter_pos *end_pos) > { > @@ -60,10 +61,11 @@ struct bt_ctf_iter *bt_ctf_iter_create(struct bt_context *ctx, > iter->recalculate_dep_graph = 0; > iter->main_callbacks.callback = NULL; > iter->dep_gc = g_ptr_array_new(); > - return iter; > + iter->parent.get_event = bt_ctf_iter_read_event; > + return &iter->parent; > } > > -void bt_ctf_iter_destroy(struct bt_ctf_iter *iter) > +void bt_ctf_iter_destroy(struct bt_iter *iter) > { > struct bt_stream_callbacks *bt_stream_cb; > struct bt_callback_chain *bt_chain; > @@ -71,13 +73,16 @@ void bt_ctf_iter_destroy(struct bt_ctf_iter *iter) > > assert(iter); > > + struct bt_ctf_iter *ctf_iter = > + container_of(iter, struct bt_ctf_iter, parent); > + > /* free all events callbacks */ > - if (iter->main_callbacks.callback) > - g_array_free(iter->main_callbacks.callback, TRUE); > + if (ctf_iter->main_callbacks.callback) > + g_array_free(ctf_iter->main_callbacks.callback, TRUE); > > /* free per-event callbacks */ > - for (i = 0; i < iter->callbacks->len; i++) { > - bt_stream_cb = &g_array_index(iter->callbacks, > + for (i = 0; i < ctf_iter->callbacks->len; i++) { > + bt_stream_cb = &g_array_index(ctf_iter->callbacks, > struct bt_stream_callbacks, i); > if (!bt_stream_cb || !bt_stream_cb->per_id_callbacks) > continue; > @@ -90,10 +95,10 @@ void bt_ctf_iter_destroy(struct bt_ctf_iter *iter) > } > g_array_free(bt_stream_cb->per_id_callbacks, TRUE); > } > - g_array_free(iter->callbacks, TRUE); > - g_ptr_array_free(iter->dep_gc, TRUE); > + g_array_free(ctf_iter->callbacks, TRUE); > + g_ptr_array_free(ctf_iter->dep_gc, TRUE); > > - bt_iter_fini(&iter->parent); > + bt_iter_fini(iter); > g_free(iter); > } > > @@ -158,9 +163,14 @@ stop: > return NULL; > } > > -struct bt_ctf_event *bt_ctf_iter_read_event(struct bt_ctf_iter *iter) > +struct bt_ctf_event *bt_ctf_iter_read_event(struct bt_iter *iter) > { > - return bt_ctf_iter_read_event_flags(iter, NULL); > + struct bt_ctf_iter *ctf_iter; > + if (!iter) { > + return NULL; > + } > + ctf_iter = container_of(iter, struct bt_ctf_iter, parent); > + return bt_ctf_iter_read_event_flags(ctf_iter, NULL); > } > > uint64_t bt_ctf_get_lost_events_count(struct bt_ctf_iter *iter) > diff --git a/include/babeltrace/context-internal.h b/include/babeltrace/context-internal.h > index 17d6202..7600d8d 100644 > --- a/include/babeltrace/context-internal.h > +++ b/include/babeltrace/context-internal.h > @@ -51,6 +51,7 @@ struct bt_context { > int refcount; > int last_trace_handle_id; > struct bt_iter *current_iterator; > + struct bt_format *input_trace_format; > }; > > #endif /* _BABELTRACE_CONTEXT_INTERNAL_H */ > diff --git a/include/babeltrace/context.h b/include/babeltrace/context.h > index b28df09..6455b65 100644 > --- a/include/babeltrace/context.h > +++ b/include/babeltrace/context.h > @@ -32,6 +32,7 @@ > */ > > #include > +#include > #include > > #ifdef __cplusplus > @@ -96,6 +97,36 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path, > int bt_context_remove_trace(struct bt_context *ctx, int trace_id); > > /* > + * bt_context_create_iterator: Allocate an iterator on the current trace > + * collection's events. > + * > + * begin_pos and end_pos are optional parameters to specify the position > + * at which the trace collection should be seeked upon iterator > + * creation, and the position at which iteration will start returning > + * "EOF". > + * > + * By default, if begin_pos is NULL, a BT_SEEK_CUR is performed at > + * creation. By default, if end_pos is NULL, a BT_SEEK_END (end of > + * trace) is the EOF criterion. > + * > + * Return a pointer to the newly allocated iterator. > + * > + * Only one iterator can be created against a context. If more than one > + * iterator is being created for the same context, the second creation > + * will return NULL. The previous iterator must be destroyed before > + * creation of the new iterator for this function to succeed. > + */ > +struct bt_iter *bt_context_create_iterator(struct bt_context *ctx, > + const struct bt_iter_pos *position_begin, > + const struct bt_iter_pos *position_end); > + > +/* > + * bt_context_destroy_iterator: Free a trace collection iterator. > + */ > +void bt_context_destroy_iterator(struct bt_context *ctx, > + struct bt_iter *iterator); > + > +/* > * bt_context_get and bt_context_put : increments and decrement the > * refcount of the context > * > diff --git a/include/babeltrace/ctf/iterator.h b/include/babeltrace/ctf/iterator.h > index ec6aac7..159e4a4 100644 > --- a/include/babeltrace/ctf/iterator.h > +++ b/include/babeltrace/ctf/iterator.h > @@ -59,7 +59,7 @@ struct bt_ctf_event; > * will return NULL. The previous iterator must be destroyed before > * creation of the new iterator for this function to succeed. > */ > -struct bt_ctf_iter *bt_ctf_iter_create(struct bt_context *ctx, > +struct bt_iter *bt_ctf_iter_create(struct bt_context *ctx, > const struct bt_iter_pos *begin_pos, > const struct bt_iter_pos *end_pos); > > @@ -71,7 +71,7 @@ struct bt_iter *bt_ctf_get_iter(struct bt_ctf_iter *iter); > /* > * bt_ctf_iter_destroy - Free a CTF trace collection iterator. > */ > -void bt_ctf_iter_destroy(struct bt_ctf_iter *iter); > +void bt_ctf_iter_destroy(struct bt_iter *iter); > > /* > * bt_ctf_iter_read_event: Read the iterator's current event data. > @@ -80,7 +80,7 @@ void bt_ctf_iter_destroy(struct bt_ctf_iter *iter); > * > * Return current event on success, NULL on end of trace. > */ > -struct bt_ctf_event *bt_ctf_iter_read_event(struct bt_ctf_iter *iter); > +struct bt_ctf_event *bt_ctf_iter_read_event(struct bt_iter *iter); > > /* > * bt_ctf_iter_read_event_flags: Read the iterator's current event data. > diff --git a/include/babeltrace/format.h b/include/babeltrace/format.h > index 9f3d1c8..c170d83 100644 > --- a/include/babeltrace/format.h > +++ b/include/babeltrace/format.h > @@ -45,6 +45,9 @@ typedef int bt_intern_str; > struct bt_stream_pos; > struct bt_context; > struct bt_trace_handle; > +struct bt_trace_descriptor; > +struct bt_iter; > +struct bt_iter_pos; > > struct bt_mmap_stream { > int fd; > @@ -77,6 +80,17 @@ struct bt_format { > uint64_t (*timestamp_end)(struct bt_trace_descriptor *descriptor, > struct bt_trace_handle *handle, enum bt_clock_type type); > int (*convert_index_timestamp)(struct bt_trace_descriptor *descriptor); > + > + /* > + * Only one iterator can be created against a context. If more than one > + * iterator is being created for the same context, the second creation > + * will return NULL. The previous iterator must be destroyed before > + * creation of the new iterator for this function to succeed. > + */ > + struct bt_iter *(*iterator_create)(struct bt_context *ctx, > + const struct bt_iter_pos *begin_pos, > + const struct bt_iter_pos *end_pos); > + void (*iterator_destroy)(struct bt_iter *iterator); > }; > > extern struct bt_format *bt_lookup_format(bt_intern_str qname); > diff --git a/include/babeltrace/iterator-internal.h b/include/babeltrace/iterator-internal.h > index 2b0b2f2..2008d76 100644 > --- a/include/babeltrace/iterator-internal.h > +++ b/include/babeltrace/iterator-internal.h > @@ -39,6 +39,7 @@ struct bt_iter { > struct ptr_heap *stream_heap; > struct bt_context *ctx; > const struct bt_iter_pos *end_pos; > + struct bt_ctf_event *(*get_event)(struct bt_iter *iter); > }; > > /* > diff --git a/include/babeltrace/iterator.h b/include/babeltrace/iterator.h > index 360a9c7..aa189a8 100644 > --- a/include/babeltrace/iterator.h > +++ b/include/babeltrace/iterator.h > @@ -27,6 +27,7 @@ > > #include > #include > +#include > > #ifdef __cplusplus > extern "C" { > @@ -40,6 +41,7 @@ enum { > /* Forward declarations */ > struct bt_iter; > struct bt_saved_pos; > +struct bt_ctf_event; > > /* > * bt_iter is an abstract class, each format has to implement its own > @@ -123,6 +125,15 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *pos); > struct bt_iter_pos *bt_iter_create_time_pos(struct bt_iter *iter, > uint64_t timestamp); > > +/* > + * bt_iter_get_event: Get the iterator's current event data > + * > + * @iter trace collection iterator (input). Should not be NULL. > + * > + * Return current event on success, NULL on end of trace. > + */ > +struct bt_ctf_event *bt_iter_get_event(struct bt_iter *iter); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/context.c b/lib/context.c > index dc77366..61215a3 100644 > --- a/lib/context.c > +++ b/lib/context.c > @@ -87,6 +87,12 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path, > ret = -1; > goto end; > } > + if (ctx->input_trace_format && ctx->input_trace_format != fmt) { > + fprintf(stderr, "[error] [Context] Opening traces of different formats in the same context is not supported.\n"); > + ret = -1; > + goto end; > + } > + ctx->input_trace_format = fmt; > if (path) { > td = fmt->open_trace(path, O_RDONLY, packet_seek, NULL); > if (!td) { > @@ -211,3 +217,54 @@ void bt_context_put(struct bt_context *ctx) > if (ctx->refcount == 0) > bt_context_destroy(ctx); > } > + > +struct bt_iter *bt_context_create_iterator(struct bt_context *ctx, > + const struct bt_iter_pos *position_begin, > + const struct bt_iter_pos *position_end) > +{ > + struct bt_iter *iter = NULL; > + struct bt_format *fmt; > + assert(ctx); > + > + if (!ctx->input_trace_format) { > + fprintf(stderr, "[error] No trace opened in context.\n"); > + goto end; > + } > + fmt = ctx->input_trace_format; > + if (!fmt->iterator_create) { > + fprintf(stderr, "[error] The %s format plug-in did not register an iterator creation function.\n", g_quark_to_string(fmt->name)); > + goto end; > + } > + iter = fmt->iterator_create(ctx, position_begin, position_end); > + > + if (!ctx->current_iterator) { > + fprintf(stderr, "[error] The %s format plug-in did not call bt_iter_init in its iterator creation function.\n", > + g_quark_to_string(fmt->name)); > + } > + > +end: > + return iter; > +} > + > +void bt_context_destroy_iterator(struct bt_context *ctx, > + struct bt_iter *iter) > +{ > + struct bt_format *fmt; > + assert(ctx); > + > + if (!ctx->input_trace_format) { > + fprintf(stderr, "[error] No trace opened in context.\n"); > + return; > + } > + fmt = ctx->input_trace_format; > + if (!fmt->iterator_destroy) { > + fprintf(stderr, "[error] The %s format plug-in did not register an iterator destruction function.\n", > + g_quark_to_string(fmt->name)); > + return; > + } > + fmt->iterator_destroy(iter); > + if (ctx->current_iterator) { > + fprintf(stderr, "[warn] The %s format plug-in did not call bt_iter_fini in its iterator destruction function.\n", > + g_quark_to_string(fmt->name)); > + } > +} > diff --git a/lib/iterator.c b/lib/iterator.c > index 4190e65..b838000 100644 > --- a/lib/iterator.c > +++ b/lib/iterator.c > @@ -805,3 +805,17 @@ int bt_iter_next(struct bt_iter *iter) > end: > return ret; > } > + > +struct bt_ctf_event *bt_iter_get_event(struct bt_iter *iter) > +{ > + struct bt_ctf_event *event; > + if (!iter->get_event) { > + event = NULL; > + fprintf(stderr, "[error] No get_event callback registered by the output plug-in.\n"); > + goto end; > + } > + event = iter->get_event(iter); > + > +end: > + return event; > +} > diff --git a/tests/lib/test-seeks.c b/tests/lib/test-seeks.c > index 47bb42e..69e4d4b 100644 > --- a/tests/lib/test-seeks.c > +++ b/tests/lib/test-seeks.c > @@ -37,7 +37,7 @@ > void run_seek_begin(char *path, uint64_t expected_begin) > { > struct bt_context *ctx; > - struct bt_ctf_iter *iter; > + struct bt_iter *iter; > struct bt_ctf_event *event; > struct bt_iter_pos newpos; > int ret; > @@ -51,12 +51,12 @@ void run_seek_begin(char *path, uint64_t expected_begin) > } > > /* Create iterator with null begin and end */ > - iter = bt_ctf_iter_create(ctx, NULL, NULL); > + iter = bt_context_create_iterator(ctx, NULL, NULL); > if (!iter) { > plan_skip_all("Cannot create valid iterator"); > } > > - event = bt_ctf_iter_read_event(iter); > + event = bt_iter_get_event(iter); > > ok(event, "Event valid"); > > @@ -67,7 +67,7 @@ void run_seek_begin(char *path, uint64_t expected_begin) > > /* Validate that we get the same value after a seek begin */ > newpos.type = BT_SEEK_BEGIN; > - ret = bt_iter_set_pos(bt_ctf_get_iter(iter), &newpos); > + ret = bt_iter_set_pos(iter, &newpos); > > ok(ret == 0, "Seek begin retval %d", ret); > > @@ -86,7 +86,7 @@ void run_seek_begin(char *path, uint64_t expected_begin) > void run_seek_last(char *path, uint64_t expected_last) > { > struct bt_context *ctx; > - struct bt_ctf_iter *iter; > + struct bt_iter *iter; > struct bt_ctf_event *event; > struct bt_iter_pos newpos; > int ret; > @@ -99,18 +99,18 @@ void run_seek_last(char *path, uint64_t expected_last) > } > > /* Create iterator with null last and end */ > - iter = bt_ctf_iter_create(ctx, NULL, NULL); > + iter = bt_context_create_iterator(ctx, NULL, NULL); > if (!iter) { > plan_skip_all("Cannot create valid iterator"); > } > > - event = bt_ctf_iter_read_event(iter); > + event = bt_iter_get_event(iter); > > ok(event, "Event valid at beginning"); > > /* Seek to last */ > newpos.type = BT_SEEK_LAST; > - ret = bt_iter_set_pos(bt_ctf_get_iter(iter), &newpos); > + ret = bt_iter_set_pos(iter, &newpos); > > ok(ret == 0, "Seek last retval %d", ret); > > @@ -123,11 +123,11 @@ void run_seek_last(char *path, uint64_t expected_last) > ok1(timestamp_last == expected_last); > > /* Try to read next event */ > - ret = bt_iter_next(bt_ctf_get_iter(iter)); > + ret = bt_iter_next(iter); > > ok(ret == 0, "iter next should return an error"); > > - event = bt_ctf_iter_read_event(iter); > + event = bt_iter_get_event(iter); > > ok(event == 0, "Event after last should be invalid"); > > @@ -139,7 +139,7 @@ void run_seek_cycles(char *path, > uint64_t expected_last) > { > struct bt_context *ctx; > - struct bt_ctf_iter *iter; > + struct bt_iter *iter; > struct bt_ctf_event *event; > struct bt_iter_pos newpos; > int ret; > @@ -152,22 +152,22 @@ void run_seek_cycles(char *path, > } > > /* Create iterator with null last and end */ > - iter = bt_ctf_iter_create(ctx, NULL, NULL); > + iter = bt_context_create_iterator(ctx, NULL, NULL); > if (!iter) { > plan_skip_all("Cannot create valid iterator"); > } > > - event = bt_ctf_iter_read_event(iter); > + event = bt_iter_get_event(iter); > > ok(event, "Event valid at beginning"); > > /* Seek to last */ > newpos.type = BT_SEEK_LAST; > - ret = bt_iter_set_pos(bt_ctf_get_iter(iter), &newpos); > + ret = bt_iter_set_pos(iter, &newpos); > > ok(ret == 0, "Seek last retval %d", ret); > > - event = bt_ctf_iter_read_event(iter); > + event = bt_iter_get_event(iter); > > ok(event, "Event valid at last position"); > > @@ -176,21 +176,21 @@ void run_seek_cycles(char *path, > ok1(timestamp == expected_last); > > /* Try to read next event */ > - ret = bt_iter_next(bt_ctf_get_iter(iter)); > + ret = bt_iter_next(iter); > > ok(ret == 0, "iter next should return an error"); > > - event = bt_ctf_iter_read_event(iter); > + event = bt_iter_get_event(iter); > > ok(event == 0, "Event after last should be invalid"); > > /* Seek to BEGIN */ > newpos.type = BT_SEEK_BEGIN; > - ret = bt_iter_set_pos(bt_ctf_get_iter(iter), &newpos); > + ret = bt_iter_set_pos(iter, &newpos); > > ok(ret == 0, "Seek begin retval %d", ret); > > - event = bt_ctf_iter_read_event(iter); > + event = bt_iter_get_event(iter); > > ok(event, "Event valid at first position"); > > @@ -200,11 +200,11 @@ void run_seek_cycles(char *path, > > /* Seek last again */ > newpos.type = BT_SEEK_LAST; > - ret = bt_iter_set_pos(bt_ctf_get_iter(iter), &newpos); > + ret = bt_iter_set_pos(iter, &newpos); > > ok(ret == 0, "Seek last retval %d", ret); > > - event = bt_ctf_iter_read_event(iter); > + event = bt_iter_get_event(iter); > > ok(event, "Event valid at last position"); > > -- > 1.8.2.3 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue May 28 13:32:50 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 28 May 2013 13:32:50 -0400 Subject: [lttng-dev] [PATCH 2/2] Support old compilers In-Reply-To: <1369747627-21626-2-git-send-email-thomas.petazzoni@free-electrons.com> References: <1369747627-21626-1-git-send-email-thomas.petazzoni@free-electrons.com> <1369747627-21626-2-git-send-email-thomas.petazzoni@free-electrons.com> Message-ID: <20130528173250.GE20859@Krystal> * Thomas Petazzoni (thomas.petazzoni at free-electrons.com) wrote: > Some old compilers do not use C99 as their default C language variant, > for example gcc 4.3.x, which is used on some old machines. When such a > compiler is used, by default, ULLONG_MAX is not visible. Adding > -std=gnu99 is needed to make this definition visible. > > In autoconf speak, this translates into the need of using > AC_PROC_CC_STDC instead of AC_PROG_CC. See > http://www.gnu.org/software/autoconf/manual/autoconf-2.65/html_node/C-Compiler.html > for more details. merged, thanks! Mathieu > > Signed-off-by: Thomas Petazzoni > --- > configure.ac | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/configure.ac b/configure.ac > index 83822d6..3ddcb7c 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -17,7 +17,7 @@ AC_CONFIG_HEADERS([config.h]) > AC_SYS_LARGEFILE > > # Checks for programs. > -AC_PROG_CC > +AC_PROG_CC_STDC > AC_PROG_MAKE_SET > LT_INIT > AC_PROG_YACC > -- > 1.7.9.5 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Tue May 28 16:01:49 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Tue, 28 May 2013 16:01:49 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Move include directive from CFLAGS to CPPFLAGS in examples' Makefiles Message-ID: <1369771309-1773-1-git-send-email-jeremie.galarneau@efficios.com> Fixes #537 Signed-off-by: J?r?mie Galarneau --- doc/examples/demo/Makefile | 4 ++-- doc/examples/easy-ust/Makefile | 4 ++-- doc/examples/hello-static-lib/Makefile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile index bbc8ccb..d5acd4e 100644 --- a/doc/examples/demo/Makefile +++ b/doc/examples/demo/Makefile @@ -15,12 +15,12 @@ CC = gcc LIBS = -ldl # On Linux #LIBS = -lc # On BSD -CFLAGS += -I. +CPPFLAGS += -I. # Only necessary when building from the source tree and lttng-ust is not # installed ifdef BUILD_EXAMPLES_FROM_TREE -CFLAGS += -I../../../include/ +CPPFLAGS += -I../../../include/ LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' diff --git a/doc/examples/easy-ust/Makefile b/doc/examples/easy-ust/Makefile index e20e53a..2ac5f2e 100644 --- a/doc/examples/easy-ust/Makefile +++ b/doc/examples/easy-ust/Makefile @@ -17,12 +17,12 @@ CC = gcc LIBS = -ldl -llttng-ust # On Linux #LIBS = -lc -llttng-ust # On BSD -CFLAGS += -I. +CPPFLAGS += -I. # Only necessary when building from the source tree and lttng-ust is not # installed ifdef BUILD_EXAMPLES_FROM_TREE -CFLAGS += -I../../../include/ +CPPFLAGS += -I../../../include/ LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' diff --git a/doc/examples/hello-static-lib/Makefile b/doc/examples/hello-static-lib/Makefile index dd246f7..187591b 100644 --- a/doc/examples/hello-static-lib/Makefile +++ b/doc/examples/hello-static-lib/Makefile @@ -13,14 +13,14 @@ # a program with tracepoint provider probes compiled as static libraries. CC = gcc -CFLAGS += -I. +CPPFLAGS += -I. LIBS = -ldl -llttng-ust # On Linux #LIBS = -lc -llttng-ust # On BSD # Only necessary when building from the source tree and lttng-ust is not # installed ifdef BUILD_EXAMPLES_FROM_TREE -CFLAGS += -I../../../include/ +CPPFLAGS += -I../../../include/ LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' -- 1.8.2.3 From jeremie.galarneau at efficios.com Tue May 28 18:19:18 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Tue, 28 May 2013 18:19:18 -0400 Subject: [lttng-dev] [PATCH lttng-ust v2] Move include directive from CFLAGS to LOCAL_CPPFLAGS in examples' Makefiles In-Reply-To: <1369771309-1773-1-git-send-email-jeremie.galarneau@efficios.com> References: <1369771309-1773-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <1369779558-20747-1-git-send-email-jeremie.galarneau@efficios.com> The use of LOCAL_* flags and override directives ensures that the build succeeds even if the user explicitly overrides CFLAGS/CPPFLAGS/LDFLAGS. Fixes #537 Signed-off-by: J?r?mie Galarneau --- doc/examples/demo/Makefile | 14 +++++++------- doc/examples/easy-ust/Makefile | 10 +++++----- doc/examples/hello-static-lib/Makefile | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile index bbc8ccb..27ca92b 100644 --- a/doc/examples/demo/Makefile +++ b/doc/examples/demo/Makefile @@ -15,14 +15,14 @@ CC = gcc LIBS = -ldl # On Linux #LIBS = -lc # On BSD -CFLAGS += -I. +LOCAL_CPPFLAGS += -I. # Only necessary when building from the source tree and lttng-ust is not # installed ifdef BUILD_EXAMPLES_FROM_TREE -CFLAGS += -I../../../include/ +LOCAL_CPPFLAGS += -I../../../include/ LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ -LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' +override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' # Third-party Makefiles have to define these targets to integrate with an # automake project @@ -37,22 +37,22 @@ endif all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so tp.o: tp.c ust_tests_demo.h - $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< tp2.o: tp2.c ust_tests_demo2.h - $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $^ tp3.o: tp3.c ust_tests_demo3.h - $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< lttng-ust-provider-ust-tests-demo3.so: tp3.o $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $^ demo.o: demo.c - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< demo: demo.o $(CC) -o $@ $^ $(LIBS) diff --git a/doc/examples/easy-ust/Makefile b/doc/examples/easy-ust/Makefile index e20e53a..e3546e1 100644 --- a/doc/examples/easy-ust/Makefile +++ b/doc/examples/easy-ust/Makefile @@ -17,14 +17,14 @@ CC = gcc LIBS = -ldl -llttng-ust # On Linux #LIBS = -lc -llttng-ust # On BSD -CFLAGS += -I. +LOCAL_CPPFLAGS += -I. # Only necessary when building from the source tree and lttng-ust is not # installed ifdef BUILD_EXAMPLES_FROM_TREE -CFLAGS += -I../../../include/ +LOCAL_CPPFLAGS += -I../../../include/ LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ -LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' +override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' # Third-party Makefiles have to define these targets to integrate with an # automake project @@ -42,10 +42,10 @@ sample: sample.o tp.o $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) sample.o: sample.c sample_component_provider.h - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< tp.o: tp.c sample_component_provider.h - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< html: sample_component_provider.html sample.html tp.html diff --git a/doc/examples/hello-static-lib/Makefile b/doc/examples/hello-static-lib/Makefile index dd246f7..85c64c1 100644 --- a/doc/examples/hello-static-lib/Makefile +++ b/doc/examples/hello-static-lib/Makefile @@ -13,16 +13,16 @@ # a program with tracepoint provider probes compiled as static libraries. CC = gcc -CFLAGS += -I. +LOCAL_CPPFLAGS += -I. LIBS = -ldl -llttng-ust # On Linux #LIBS = -lc -llttng-ust # On BSD # Only necessary when building from the source tree and lttng-ust is not # installed ifdef BUILD_EXAMPLES_FROM_TREE -CFLAGS += -I../../../include/ +LOCAL_CPPFLAGS += -I../../../include/ LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ -LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' +override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' # Third-party Makefiles have to define these targets to integrate with an # automake project @@ -37,13 +37,13 @@ endif all: hello lttng-ust-provider-hello.o: tp.c ust_tests_hello.h - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< lttng-ust-provider-hello.a: lttng-ust-provider-hello.o ar -rc $@ $^ hello.o: hello.c - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< hello: hello.o lttng-ust-provider-hello.a $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) -- 1.8.2.3 From mathieu.desnoyers at efficios.com Tue May 28 18:26:16 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 28 May 2013 18:26:16 -0400 Subject: [lttng-dev] [PATCH lttng-ust v2] Move include directive from CFLAGS to LOCAL_CPPFLAGS in examples' Makefiles In-Reply-To: <1369779558-20747-1-git-send-email-jeremie.galarneau@efficios.com> References: <1369771309-1773-1-git-send-email-jeremie.galarneau@efficios.com> <1369779558-20747-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130528222616.GA1347@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > The use of LOCAL_* flags and override directives ensures that the build > succeeds even if the user explicitly overrides CFLAGS/CPPFLAGS/LDFLAGS. why use LOCAL_CPPFLAGS on one hand, but "override LDFLAGS" on the other? What's the difference ? Why should it differ ? Thanks, Mathieu > > Fixes #537 > > Signed-off-by: J?r?mie Galarneau > --- > doc/examples/demo/Makefile | 14 +++++++------- > doc/examples/easy-ust/Makefile | 10 +++++----- > doc/examples/hello-static-lib/Makefile | 10 +++++----- > 3 files changed, 17 insertions(+), 17 deletions(-) > > diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile > index bbc8ccb..27ca92b 100644 > --- a/doc/examples/demo/Makefile > +++ b/doc/examples/demo/Makefile > @@ -15,14 +15,14 @@ > CC = gcc > LIBS = -ldl # On Linux > #LIBS = -lc # On BSD > -CFLAGS += -I. > +LOCAL_CPPFLAGS += -I. > > # Only necessary when building from the source tree and lttng-ust is not > # installed > ifdef BUILD_EXAMPLES_FROM_TREE > -CFLAGS += -I../../../include/ > +LOCAL_CPPFLAGS += -I../../../include/ > LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ > -LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > +override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > > # Third-party Makefiles have to define these targets to integrate with an > # automake project > @@ -37,22 +37,22 @@ endif > all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so > > tp.o: tp.c ust_tests_demo.h > - $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > > tp2.o: tp2.c ust_tests_demo2.h > - $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > > lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o > $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $^ > > tp3.o: tp3.c ust_tests_demo3.h > - $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > > lttng-ust-provider-ust-tests-demo3.so: tp3.o > $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $^ > > demo.o: demo.c > - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< > > demo: demo.o > $(CC) -o $@ $^ $(LIBS) > diff --git a/doc/examples/easy-ust/Makefile b/doc/examples/easy-ust/Makefile > index e20e53a..e3546e1 100644 > --- a/doc/examples/easy-ust/Makefile > +++ b/doc/examples/easy-ust/Makefile > @@ -17,14 +17,14 @@ > CC = gcc > LIBS = -ldl -llttng-ust # On Linux > #LIBS = -lc -llttng-ust # On BSD > -CFLAGS += -I. > +LOCAL_CPPFLAGS += -I. > > # Only necessary when building from the source tree and lttng-ust is not > # installed > ifdef BUILD_EXAMPLES_FROM_TREE > -CFLAGS += -I../../../include/ > +LOCAL_CPPFLAGS += -I../../../include/ > LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ > -LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > +override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > > # Third-party Makefiles have to define these targets to integrate with an > # automake project > @@ -42,10 +42,10 @@ sample: sample.o tp.o > $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) > > sample.o: sample.c sample_component_provider.h > - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< > > tp.o: tp.c sample_component_provider.h > - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< > > html: sample_component_provider.html sample.html tp.html > > diff --git a/doc/examples/hello-static-lib/Makefile b/doc/examples/hello-static-lib/Makefile > index dd246f7..85c64c1 100644 > --- a/doc/examples/hello-static-lib/Makefile > +++ b/doc/examples/hello-static-lib/Makefile > @@ -13,16 +13,16 @@ > # a program with tracepoint provider probes compiled as static libraries. > > CC = gcc > -CFLAGS += -I. > +LOCAL_CPPFLAGS += -I. > LIBS = -ldl -llttng-ust # On Linux > #LIBS = -lc -llttng-ust # On BSD > > # Only necessary when building from the source tree and lttng-ust is not > # installed > ifdef BUILD_EXAMPLES_FROM_TREE > -CFLAGS += -I../../../include/ > +LOCAL_CPPFLAGS += -I../../../include/ > LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ > -LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > +override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > > # Third-party Makefiles have to define these targets to integrate with an > # automake project > @@ -37,13 +37,13 @@ endif > all: hello > > lttng-ust-provider-hello.o: tp.c ust_tests_hello.h > - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< > > lttng-ust-provider-hello.a: lttng-ust-provider-hello.o > ar -rc $@ $^ > > hello.o: hello.c > - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< > > hello: hello.o lttng-ust-provider-hello.a > $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) > -- > 1.8.2.3 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Tue May 28 18:44:54 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Tue, 28 May 2013 18:44:54 -0400 Subject: [lttng-dev] [PATCH lttng-ust v2] Move include directive from CFLAGS to LOCAL_CPPFLAGS in examples' Makefiles In-Reply-To: <20130528222616.GA1347@Krystal> References: <1369771309-1773-1-git-send-email-jeremie.galarneau@efficios.com> <1369779558-20747-1-git-send-email-jeremie.galarneau@efficios.com> <20130528222616.GA1347@Krystal> Message-ID: On Tue, May 28, 2013 at 6:26 PM, Mathieu Desnoyers wrote: > * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: >> The use of LOCAL_* flags and override directives ensures that the build >> succeeds even if the user explicitly overrides CFLAGS/CPPFLAGS/LDFLAGS. > > why use LOCAL_CPPFLAGS on one hand, but "override LDFLAGS" on the other? > What's the difference ? LOCAL_CPPFLAGS is necessary to build the example in and out of the lttng-ust tree. However, the LDFLAGS modification is only necessary when building in-tree (without installing lttng-ust). > Why should it differ ? I expect people to use these Makefiles as templates for their own projects and to completely strip the "ifdef BUILD_EXAMPLES_FROM_TREE" section. I'm using "override" here to avoid introducing a superfluous variable in the intended purpose of these examples. It doesn't make a functional difference; I just want to keep these examples as dead-simple as possible :) J?r?mie > > Thanks, > > Mathieu > >> >> Fixes #537 >> >> Signed-off-by: J?r?mie Galarneau >> --- >> doc/examples/demo/Makefile | 14 +++++++------- >> doc/examples/easy-ust/Makefile | 10 +++++----- >> doc/examples/hello-static-lib/Makefile | 10 +++++----- >> 3 files changed, 17 insertions(+), 17 deletions(-) >> >> diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile >> index bbc8ccb..27ca92b 100644 >> --- a/doc/examples/demo/Makefile >> +++ b/doc/examples/demo/Makefile >> @@ -15,14 +15,14 @@ >> CC = gcc >> LIBS = -ldl # On Linux >> #LIBS = -lc # On BSD >> -CFLAGS += -I. >> +LOCAL_CPPFLAGS += -I. >> >> # Only necessary when building from the source tree and lttng-ust is not >> # installed >> ifdef BUILD_EXAMPLES_FROM_TREE >> -CFLAGS += -I../../../include/ >> +LOCAL_CPPFLAGS += -I../../../include/ >> LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ >> -LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' >> +override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' >> >> # Third-party Makefiles have to define these targets to integrate with an >> # automake project >> @@ -37,22 +37,22 @@ endif >> all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so >> >> tp.o: tp.c ust_tests_demo.h >> - $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< >> + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< >> >> tp2.o: tp2.c ust_tests_demo2.h >> - $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< >> + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< >> >> lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o >> $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $^ >> >> tp3.o: tp3.c ust_tests_demo3.h >> - $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< >> + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< >> >> lttng-ust-provider-ust-tests-demo3.so: tp3.o >> $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $^ >> >> demo.o: demo.c >> - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< >> + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< >> >> demo: demo.o >> $(CC) -o $@ $^ $(LIBS) >> diff --git a/doc/examples/easy-ust/Makefile b/doc/examples/easy-ust/Makefile >> index e20e53a..e3546e1 100644 >> --- a/doc/examples/easy-ust/Makefile >> +++ b/doc/examples/easy-ust/Makefile >> @@ -17,14 +17,14 @@ >> CC = gcc >> LIBS = -ldl -llttng-ust # On Linux >> #LIBS = -lc -llttng-ust # On BSD >> -CFLAGS += -I. >> +LOCAL_CPPFLAGS += -I. >> >> # Only necessary when building from the source tree and lttng-ust is not >> # installed >> ifdef BUILD_EXAMPLES_FROM_TREE >> -CFLAGS += -I../../../include/ >> +LOCAL_CPPFLAGS += -I../../../include/ >> LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ >> -LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' >> +override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' >> >> # Third-party Makefiles have to define these targets to integrate with an >> # automake project >> @@ -42,10 +42,10 @@ sample: sample.o tp.o >> $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) >> >> sample.o: sample.c sample_component_provider.h >> - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< >> + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< >> >> tp.o: tp.c sample_component_provider.h >> - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< >> + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< >> >> html: sample_component_provider.html sample.html tp.html >> >> diff --git a/doc/examples/hello-static-lib/Makefile b/doc/examples/hello-static-lib/Makefile >> index dd246f7..85c64c1 100644 >> --- a/doc/examples/hello-static-lib/Makefile >> +++ b/doc/examples/hello-static-lib/Makefile >> @@ -13,16 +13,16 @@ >> # a program with tracepoint provider probes compiled as static libraries. >> >> CC = gcc >> -CFLAGS += -I. >> +LOCAL_CPPFLAGS += -I. >> LIBS = -ldl -llttng-ust # On Linux >> #LIBS = -lc -llttng-ust # On BSD >> >> # Only necessary when building from the source tree and lttng-ust is not >> # installed >> ifdef BUILD_EXAMPLES_FROM_TREE >> -CFLAGS += -I../../../include/ >> +LOCAL_CPPFLAGS += -I../../../include/ >> LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ >> -LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' >> +override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' >> >> # Third-party Makefiles have to define these targets to integrate with an >> # automake project >> @@ -37,13 +37,13 @@ endif >> all: hello >> >> lttng-ust-provider-hello.o: tp.c ust_tests_hello.h >> - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< >> + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< >> >> lttng-ust-provider-hello.a: lttng-ust-provider-hello.o >> ar -rc $@ $^ >> >> hello.o: hello.c >> - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< >> + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< >> >> hello: hello.o lttng-ust-provider-hello.a >> $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) >> -- >> 1.8.2.3 >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From ionut5001 at gmail.com Wed May 29 04:52:31 2013 From: ionut5001 at gmail.com (Ionut D.) Date: Wed, 29 May 2013 11:52:31 +0300 Subject: [lttng-dev] LTTNG on Android ICS In-Reply-To: References: Message-ID: It is working. I managed to send traces on another machine. Basically you have 2 machines, machine A which is traced (it runs Android) and machine B which will receive all the logs (in my case Ubuntu 12.04). On machine B you have to start lttng-relayd with the following command `lttng-relayd -C tcp://xxx.xxx.xxx.xxx:5342 -D tcp://xxx.xxx.xxx.xxx:5343 -o /tmp/lttng` and on machine A when you have to create the session use -U net://xxx.xxx.xxx.xxx parameter and should work. Cheers! On Tue, May 28, 2013 at 4:27 PM, Pierre-Luc St-Charles < pierre-luc.st-charles at polymtl.ca> wrote: > Good question: I don't suppose it's fully working right now, as we've > barely touched/tested it yet (we worked mostly locally or via Eclipse). It > should be amongst the next improvement batch though; could you provide the > commands you used to trigger that exact crash? I'll try to replicate it > later this week. > > > On Tue, May 28, 2013 at 8:18 AM, Ionut D. wrote: > >> lttng-relayd is functional? Because I want to start it and fails with: >> >> DEBUG3 [3661/3661]: URI string: tcp://0.0.0.0:5342 (in uri_parse() at >> uri.c:250) >> DEBUG3 [3661/3661]: URI dtype: 1, proto: 1, host: 0.0.0.0, subdir: , >> ctrl: 5342, data: 0 (in uri_parse() at uri.c:464) >> DEBUG3 [3661/3661]: URI string: tcp://0.0.0.0:5343 (in uri_parse() at >> uri.c:250) >> DEBUG3 [3661/3661]: URI dtype: 1, proto: 1, host: 0.0.0.0, subdir: , >> ctrl: 5343, data: 0 (in uri_parse() at uri.c:464) >> DEBUG1 [3661/3661]: Signal handler set for SIGTERM, SIGPIPE and SIGINT >> (in set_signal_handler() at main.c:346) >> DEBUG1 [3661/3661]: epoll set max size is 76382 (in >> compat_epoll_set_max_size() at compat-epoll.c:270) >> DEBUG1 [3661/3662]: [thread] Relay dispatcher started (in >> relay_thread_dispatcher() at main.c:646) >> DEBUG1 [3661/3662]: Futex n to 1 prepare done (in futex_nto1_prepare() at >> futex.c:75) >> DEBUG1 [3661/3662]: Woken up but nothing in the relay command queue (in >> relay_thread_dispatcher() at main.c:656) >> DEBUG1 [3661/3664]: [thread] Relay listener started (in >> relay_thread_listener() at main.c:484) >> DEBUG1 [3661/3663]: [thread] Relay worker started (in >> relay_thread_worker() at main.c:1772) >> DEBUG1 [3661/3664]: Listening on sock 7 (in relay_init_sock() at >> main.c:430) >> assertion "URCU_TLS(rcu_reader).need_mb == 0" failed: file "urcu.c", line >> 435, function "rcu_register_thread_mb" >> DEBUG1 [3661/3664]: Listening on sock 9 (in relay_init_sock() at >> main.c:430) >> DEBUG1 [3661/3664]: Listener accepting connections (in >> relay_thread_listener() at main.c:517) >> Segmentation fault >> >> >> >> On Fri, May 24, 2013 at 11:36 PM, Pierre-Luc St-Charles < >> pierre-luc.st-charles at polymtl.ca> wrote: >> >>> Good news: you (most likely) won't need to recompile the whole platform >>> to fix the problem! >>> >>> I think we bumped in a similar bitter-sweet-awful error a while back: >>> after some hefty searches, we found it might have something to do with the >>> Android build system globally 'fortifying' the sources against unsafe >>> functions when compiling some of the most recent versions of the platform. >>> I believe adding -D_FORTIFY_SOURCE=0 to the CPPFLAGS when building the >>> tools solved it for us. >>> >>> -PL >>> >>> >>> On Fri, May 24, 2013 at 3:04 PM, Francis Giraldeau < >>> francis.giraldeau at gmail.com> wrote: >>> >>>> Hi, >>>> >>>> I got some problem compiling required libraries for lttng-tools. I did >>>> a full android build within repo: >>>> >>>> $ source build/envsetup.sh >>>> $ lunch # with full_maguro-eng >>>> $ m >>>> >>>> Build is fine, but when trying to run configure in lttng-tools, it >>>> can't find liboprofile_popt. Here is the error message in config.log: >>>> >>>> /home/francis/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: >>>> /home/francis/android/repo/out/target/product/maguro/obj/STATIC_LIBRARIES/liboprofile_popt_intermediates/liboprofile_popt.a(popthelp.o): >>>> in function singleOptionHelp.isra.4:bionic/libc/include/stdio.h:483: error: >>>> undefined reference to '__sprintf_chk' >>>> >>>> It seems that only the static library of liboprofile_popt is compiled. >>>> >>>> The symbol is defined in libc.a and libc.so: >>>> >>>> $ nm >>>> ./out/target/product/maguro/obj/SHARED_LIBRARIES/libc_intermediates/LINKED/libc.so >>>> | grep -E "__strlen_chk|__sprintf_chk" >>>> 0001395d T __sprintf_chk >>>> 00012df1 T __strlen_chk >>>> >>>> I tried to compile the configtest.c file by hand and it worked, so it >>>> really seems to be some kind of environment variable that make it fail. >>>> >>>> For the people who managed to do the configure, what arguments should >>>> be supplied to configure? Or maybe it's my android build that is >>>> incomplete? Should I build sub-directories in addition to the build in the >>>> root android repo sources? >>>> >>>> Cheers! >>>> >>>> Francis >>>> >>>> >>>> 2013/5/24 Pierre-Luc St-Charles >>>> >>>>> The required kernel configuration options for the modules are listed >>>>> in the lttng-module README file, located in its project root directory. >>>>> Some of the 'optional' options also listed there are simply not supported >>>>> by 3.0.x ARM kernels (such as HAVE_SYSCALL_TRACEPOINTS), so you might be >>>>> missing some modules compared to what you would get on a (x86 arch w/ >>>>> recent kernel) platform. >>>>> >>>>> You can find more information on syscall tracing on ARM here: >>>>> http://comments.gmane.org/gmane.linux.kernel.tracing.lttng.devel/5086 >>>>> >>>>> >>>>> On Fri, May 24, 2013 at 6:44 AM, Ionut D. wrote: >>>>> >>>>>> I managed to fix it. It was not finding `lttng-consumerd`, I fixed it >>>>>> by configuring the package with the right path. But, about the kernel >>>>>> modules the question is still pertinent. What options should I check >>>>>> in the kernel configuration? I saw that in my case not all the lttng kernel >>>>>> modules have been compiled. >>>>>> >>>>>> >>>>>> On Fri, May 24, 2013 at 11:07 AM, Ionut D. wrote: >>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> Thank you for the slides. I manged to build the kernel modules and I >>>>>>> insmod them manually. On the device I copied in /data/lttng following >>>>>>> binaries `lttng`, `lttng-relayd` and `lttng-sessiond`. If I execute >>>>>>> `./lttng list -k` it shows me a list of available kernel events. I create a >>>>>>> session called mysession with `./lttng create mysession` and I enable >>>>>>> tracing on all the event with `./lttng enable-event -a -k`. But here starts >>>>>>> my problem. >>>>>>> >>>>>>> The output of the last command is the following: >>>>>>> >>>>>>> root at android:/data/lttng # ./lttng enable-event -a -k >>>>>>> PERROR [3681/3681]: kernel start consumer exec: (null) (in >>>>>>> spawn_consumerd() at main.c:2007) >>>>>>> Error: Condition timed out. The consumer thread was never ready. >>>>>>> Killing it >>>>>>> Warning: Using pthread_kill as pthread_cancel is missing on the >>>>>>> current platform >>>>>>> PERROR [3608/3658]: write poll pipe: (null) (in notify_thread_pipe() >>>>>>> at utils.c:43) >>>>>>> Error: Events: Fatal error of the session daemon (channel channel0, >>>>>>> session mysession) >>>>>>> >>>>>>> Do you have any idea about what could be wrong? What options should >>>>>>> I check in the kernel configuration? (I checked all that is under Tracing) >>>>>>> >>>>>>> --Ionut >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Thu, May 23, 2013 at 6:09 PM, Charles Bri?re < >>>>>>> charles.briere at polymtl.ca> wrote: >>>>>>> >>>>>>>> Module location doesn't really matter, we used to push them to >>>>>>>> /data/... or /sdcard/... . >>>>>>>> >>>>>>>> Modprobe doesn't exists on Android so you'll need to use insmod. >>>>>>>> We used this scriptin order to compile, push to device and load modules. >>>>>>>> >>>>>>>> We also made a presentation you might be interested in that can be >>>>>>>> viewed on >>>>>>>> https://docs.google.com/presentation/d/14lte2AchEAyxMk3WSQ53SdbBm2tfmABBFQojuUhxg7Y/pub?start=false&loop=false&delayms=3000 >>>>>>>> >>>>>>>> >>>>>>>> On Thu, May 23, 2013 at 10:40 AM, Ionut D. wrote: >>>>>>>> >>>>>>>>> About the kernel modules. Where should they be located on the >>>>>>>>> target? Should I have modprobe or insmod it is enough? >>>>>>>>> >>>>>>>>> >>>>>>>>> On Thu, May 23, 2013 at 2:19 PM, Ionut D. wrote: >>>>>>>>> >>>>>>>>>> Sorry for my late response. At the end after different some adds >>>>>>>>>> (defines in libc) I managed to compile them for ICS with NDK r7c. I was a >>>>>>>>>> problem of environment. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Tue, May 21, 2013 at 9:26 PM, Pierre-Luc St-Charles < >>>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>>> >>>>>>>>>>> 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). >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Tue, May 21, 2013 at 11:29 AM, Ionut D. wrote: >>>>>>>>>>> >>>>>>>>>>>> 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: >>>>>>>>>>>> >>>>>>>>>>>> NDK: >>>>>>>>>>>> #grep -r __NR_splice . >>>>>>>>>>>> ./platforms/android-9/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>>>>>>>> __NR_splice 313 >>>>>>>>>>>> ./platforms/android-14/arch-x86/usr/include/asm/unistd_32.h:#define >>>>>>>>>>>> __NR_splice 313 >>>>>>>>>>>> >>>>>>>>>>>> bionic: >>>>>>>>>>>> grep -r __NR_splice bionic >>>>>>>>>>>> bionic/libc/kernel/arch-sh/asm/unistd_32.h:#define __NR_splice >>>>>>>>>>>> 313 >>>>>>>>>>>> bionic/libc/kernel/arch-sh/asm/unistd_64.h:#define __NR_splice >>>>>>>>>>>> 341 >>>>>>>>>>>> bionic/libc/kernel/arch-x86/asm/unistd_32.h:#define __NR_splice >>>>>>>>>>>> 313 >>>>>>>>>>>> >>>>>>>>>>>> Looking through results I see that '__NR_splice' it not in >>>>>>>>>>>> unistd.h and I know this is important. >>>>>>>>>>>> >>>>>>>>>>>> Ionut >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On Tue, May 21, 2013 at 5:15 PM, Pierre-Luc St-Charles < >>>>>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> 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. >>>>>>>>>>>>> >>>>>>>>>>>>> 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. >>>>>>>>>>>>> >>>>>>>>>>>>> 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? >>>>>>>>>>>>> >>>>>>>>>>>>> -PL >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> On Tue, May 21, 2013 at 6:26 AM, Ionut D. >>>>>>>>>>>> > wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> 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? >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> In file included from >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h: >>>>>>>>>>>>>> In function 'splice': >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>>>>>> error: '__NR_splice' undeclared (first use in this function) >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>>>>>> error: (Each undeclared identifier is reported only once >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:44: >>>>>>>>>>>>>> error: for each function it appears in.) >>>>>>>>>>>>>> In file included from >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:48:1: >>>>>>>>>>>>>> warning: "POSIX_FADV_DONTNEED" redefined >>>>>>>>>>>>>> In file included from >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/../../../src/common/compat/fcntl.h:47, >>>>>>>>>>>>>> from >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:19: >>>>>>>>>>>>>> bionic/libc/kernel/common/linux/fadvise.h:24:1: warning: this >>>>>>>>>>>>>> is the location of the previous definition >>>>>>>>>>>>>> In file included from bionic/libc/include/sys/select.h:34, >>>>>>>>>>>>>> from bionic/libc/include/unistd.h:34, >>>>>>>>>>>>>> from >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h: At top level: >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:27: error: >>>>>>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:28: error: >>>>>>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/signal.h:29: error: >>>>>>>>>>>>>> expected ';', ',' or ')' before '*' token >>>>>>>>>>>>>> In file included from bionic/libc/include/unistd.h:34, >>>>>>>>>>>>>> from >>>>>>>>>>>>>> external/lttng-tools/src/common/compat/compat-fcntl.c:20: >>>>>>>>>>>>>> bionic/libc/include/sys/select.h:42: error: expected ';', ',' >>>>>>>>>>>>>> or ')' before '*' token >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> On Sat, May 18, 2013 at 10:21 AM, Ionut D. < >>>>>>>>>>>>>> ionut5001 at gmail.com> wrote: >>>>>>>>>>>>>> >>>>>>>>>>>>>>> Great informations! I will post back the results. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> On Fri, May 17, 2013 at 4:47 PM, Pierre-Luc St-Charles < >>>>>>>>>>>>>>> pierre-luc.st-charles at polymtl.ca> wrote: >>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> Alright, small update for all following a quick >>>>>>>>>>>>>>>> (non-mailing-list) exchange: >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> 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 >>>>>>>>>>>>>>>> here; >>>>>>>>>>>>>>>> still not perfect). >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> 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). >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> 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). >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> 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). >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> 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. >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> So, simple 'how do I put LTTng on Android' workflow would >>>>>>>>>>>>>>>> be this: >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> - Compile modules (using NDK) against device's kernel, >>>>>>>>>>>>>>>> making sure its config is appropriate, ship them over via ADB >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> - Compile required external libraries (using repo build >>>>>>>>>>>>>>>> system) for the device, ship them over via ADB >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> - 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) >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> - Cross-compile LTTng-* for the device (using NDK), ship >>>>>>>>>>>>>>>> binaries over via ADB >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> Then, on the device, start up the sessiond manually & start >>>>>>>>>>>>>>>> tracing. >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> I think I went over everything, but if there's a part >>>>>>>>>>>>>>>> that's still cloudy, don't hesitate. >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> -PL >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> On May 17, 2013 1:32 AM, "Ionut D." >>>>>>>>>>>>>>>> wrote: >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> Hello all, >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> 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. >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> 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. >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> It is ok? what I am trying to do ? to integrate and build >>>>>>>>>>>>>>>>> by using the Android build system. >>>>>>>>>>>>>>>>> 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 ? >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> 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. >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> I mention that I am trying to build lttng 2.x on ICS 4.0.3. >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> Would be great if you will give me a tutorial about how to >>>>>>>>>>>>>>>>> do it. >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> Ionut >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>>>>>> lttng-dev mailing list >>>>>>>>>>>>>>>>> lttng-dev at lists.lttng.org >>>>>>>>>>>>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> lttng-dev mailing list >>>>>>>>> lttng-dev at lists.lttng.org >>>>>>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>>> _______________________________________________ >>>>> lttng-dev mailing list >>>>> lttng-dev at lists.lttng.org >>>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> lttng-dev mailing list >>>> lttng-dev at lists.lttng.org >>>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>>> >>>> >>> >>> _______________________________________________ >>> lttng-dev mailing list >>> lttng-dev at lists.lttng.org >>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From weinrea at gmail.com Thu May 30 04:51:15 2013 From: weinrea at gmail.com (Aryeh Weinreb) Date: Thu, 30 May 2013 11:51:15 +0300 Subject: [lttng-dev] linking c++ with shared object tracepoints Message-ID: Hi there, I am trying to link c++ code with c compiled tracepoints. It works when I link directly but when I put the tracepoints in a dynamic lib first I get an undefined reference to "tracepoint_dlopen". Is supported to link c++ code with c compiled tracepoints put it a dynamic lib? When I remove the hidden attribute from tracepoint_dlopen in lttng/tracepoint.h it links okay. What is the reason for declaring it hidden in the first place? Is it safe to remove it? Thanks, aryeh From jeremie.galarneau at efficios.com Thu May 30 09:42:23 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Thu, 30 May 2013 09:42:23 -0400 Subject: [lttng-dev] linking c++ with shared object tracepoints In-Reply-To: References: Message-ID: On Thu, May 30, 2013 at 4:51 AM, Aryeh Weinreb wrote: > Hi there, > > I am trying to link c++ code with c compiled tracepoints. > It works when I link directly but when I put the tracepoints in a > dynamic lib first I get an undefined reference to "tracepoint_dlopen". > Is supported to link c++ code with c compiled tracepoints put it a dynamic lib? Yes, I just tried it here. > > When I remove the hidden attribute from tracepoint_dlopen in > lttng/tracepoint.h it links okay. > What is the reason for declaring it hidden in the first place? Is it > safe to remove it? No, that wouldn't be safe. This is done to make sure loading multiple .so providers doesn't cause symbols to be overridden. The header is probably fine and I'd advise againt modifying it without careful thought. Could you provide a short example reproducing the problem? Thanks, J?r?mie > > Thanks, > aryeh > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 30 10:18:52 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 30 May 2013 10:18:52 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Fix: make hello.cxx compile with g++ In-Reply-To: <1366649058-9848-1-git-send-email-soariez@gmail.com> References: <1366649058-9848-1-git-send-email-soariez@gmail.com> Message-ID: <20130530141852.GA23476@Krystal> Merged with edits as: commit 46d522007b647e0b64d18d0ed518205c2bbad424 Author: Zifei Tong Date: Thu May 30 10:11:52 2013 -0400 Allow tracepoint providers to be compiled with g++ Move enumeration definition out of lttng_ust_lib_ring_buffer_config to make them visible at global scope for C++ compilers. Modify designated initializers: reordering initializers, add missing initializers, reformat nested initializers, in order to make g++ compile. Relevant discussion: > So each field need to be listed ? We usually don't put NULL > initialization for structures that are always in zero-initialized > memory. (coding style) This is related to a known issue of g++: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55606 (Bug 55606 - sorry, unimplemented: non-trivial designated initializers not supported). g++'s 'trivial designated initializers' means no out-of-order initialization, no missing initialization (except the fields on the tail of a struct), and nested initialization should be done in the form {.foo = {.bar = 1}} instead of {.foo.bar = 1}. That's why I made such modification. > Are those changes also compatible with the LLVM c++ compiler ? Actually, clang++ have designated initializers better supported than g++. All the modification about designated initializers are not required for clang++. No need to add NULL initialization, reorder initializations or change {.foo.bar = 1} into {.foo = {.bar = 1}}. These (ugly) hacks are just to make g++ happy. [ Updates done by Mathieu Desnoyers to fix merge conflicts. Updated README. ] Fixes #338 Signed-off-by: Mathieu Desnoyers It will be part of LTTng-UST 2.3 (not the release currently in RC, but the next one). Thanks, Mathieu * Zifei Tong (soariez at gmail.com) wrote: > > +#ifdef TRACEPOINT_CREATE_PROBES > > + > > #ifdef __cplusplus > > extern "C" { > > #endif > > > > -#ifdef TRACEPOINT_CREATE_PROBES > > - > > > > -#define TRACEPOINT_CREATE_PROBES > > - > > -#endif /* TRACEPOINT_CREATE_PROBES */ > > - > > #ifdef __cplusplus > > } > > #endif > > + > > +#define TRACEPOINT_CREATE_PROBES > > + > > +#endif /* TRACEPOINT_CREATE_PROBES */ > > > Hrm, I don't get what this is supposed to fix ? > > > > Normall > > The "extern "C" { }" part is not guarded by the TRACEPOINT_CREATE_PROBES macro. So > > > static inline void _TP_COMBINE_TOKENS(__tracepoint_provider_check_, TRACEPOINT_PROVIDER)(void) > > { > > #include TRACEPOINT_INCLUDE > > } > > will expand to something like: > > > static inline > > void __tracepoint_provider_check_ust_tests_hello(void) > > { > > __tracepoint_provider_mismatch_ust_tests_hello(); __tracepoint_provider_mismatch_ust_tests_hello(); > > extern "C" { > > } > > } > > which does not compile. > > Modified patch attached. Please review. > > Thanks. > > Zifei Tong > ---- > Move enumeration definition out of lttng_ust_lib_ring_buffer_config to > make them visible at global scope for C++ compilers. > > Modify designated initializers: reordering initializers, add missing > initializers, reformat nested initializers, in order to make g++ compile. > > Fixes #338 > > Signed-off-by: Zifei Tong > --- > include/lttng/ringbuffer-config.h | 97 +++++++++++++++++++++--------------- > include/lttng/tracepoint-event.h | 12 ++--- > include/lttng/ust-events.h | 42 ++++++++++------ > include/lttng/ust-tracepoint-event.h | 32 ++++++++---- > tests/hello.cxx/Makefile.am | 2 +- > tests/hello.cxx/tp.c | 26 ---------- > tests/hello.cxx/tp.cpp | 26 ++++++++++ > 7 files changed, 138 insertions(+), 99 deletions(-) > delete mode 100644 tests/hello.cxx/tp.c > create mode 100644 tests/hello.cxx/tp.cpp > > diff --git a/include/lttng/ringbuffer-config.h b/include/lttng/ringbuffer-config.h > index ca52fc7..42889cc 100644 > --- a/include/lttng/ringbuffer-config.h > +++ b/include/lttng/ringbuffer-config.h > @@ -134,47 +134,64 @@ struct lttng_ust_lib_ring_buffer_client_cb { > * has the responsibility to perform wakeups. > */ > #define LTTNG_UST_RING_BUFFER_CONFIG_PADDING 32 > + > +enum lttng_ust_lib_ring_buffer_alloc_types { > + RING_BUFFER_ALLOC_PER_CPU, > + RING_BUFFER_ALLOC_GLOBAL, > +}; > + > +enum lttng_ust_lib_ring_buffer_sync_types { > + RING_BUFFER_SYNC_PER_CPU, /* Wait-free */ > + RING_BUFFER_SYNC_GLOBAL, /* Lock-free */ > +}; > + > +enum lttng_ust_lib_ring_buffer_mode_types { > + RING_BUFFER_OVERWRITE, /* Overwrite when buffer full */ > + RING_BUFFER_DISCARD, /* Discard when buffer full */ > +}; > + > +enum lttng_ust_lib_ring_buffer_output_types { > + RING_BUFFER_SPLICE, > + RING_BUFFER_MMAP, > + RING_BUFFER_READ, /* TODO */ > + RING_BUFFER_ITERATOR, > + RING_BUFFER_NONE, > +}; > + > +enum lttng_ust_lib_ring_buffer_backend_types { > + RING_BUFFER_PAGE, > + RING_BUFFER_VMAP, /* TODO */ > + RING_BUFFER_STATIC, /* TODO */ > +}; > + > +enum lttng_ust_lib_ring_buffer_oops_types { > + RING_BUFFER_NO_OOPS_CONSISTENCY, > + RING_BUFFER_OOPS_CONSISTENCY, > +}; > + > +enum lttng_ust_lib_ring_buffer_ipi_types { > + RING_BUFFER_IPI_BARRIER, > + RING_BUFFER_NO_IPI_BARRIER, > +}; > + > +enum lttng_ust_lib_ring_buffer_wakeup_types { > + RING_BUFFER_WAKEUP_BY_TIMER, /* wake up performed by timer */ > + RING_BUFFER_WAKEUP_BY_WRITER, /* > + * writer wakes up reader, > + * not lock-free > + * (takes spinlock). > + */ > +}; > + > struct lttng_ust_lib_ring_buffer_config { > - enum { > - RING_BUFFER_ALLOC_PER_CPU, > - RING_BUFFER_ALLOC_GLOBAL, > - } alloc; > - enum { > - RING_BUFFER_SYNC_PER_CPU, /* Wait-free */ > - RING_BUFFER_SYNC_GLOBAL, /* Lock-free */ > - } sync; > - enum { > - RING_BUFFER_OVERWRITE, /* Overwrite when buffer full */ > - RING_BUFFER_DISCARD, /* Discard when buffer full */ > - } mode; > - enum { > - RING_BUFFER_SPLICE, > - RING_BUFFER_MMAP, > - RING_BUFFER_READ, /* TODO */ > - RING_BUFFER_ITERATOR, > - RING_BUFFER_NONE, > - } output; > - enum { > - RING_BUFFER_PAGE, > - RING_BUFFER_VMAP, /* TODO */ > - RING_BUFFER_STATIC, /* TODO */ > - } backend; > - enum { > - RING_BUFFER_NO_OOPS_CONSISTENCY, > - RING_BUFFER_OOPS_CONSISTENCY, > - } oops; > - enum { > - RING_BUFFER_IPI_BARRIER, > - RING_BUFFER_NO_IPI_BARRIER, > - } ipi; > - enum { > - RING_BUFFER_WAKEUP_BY_TIMER, /* wake up performed by timer */ > - RING_BUFFER_WAKEUP_BY_WRITER, /* > - * writer wakes up reader, > - * not lock-free > - * (takes spinlock). > - */ > - } wakeup; > + enum lttng_ust_lib_ring_buffer_alloc_types alloc; > + enum lttng_ust_lib_ring_buffer_sync_types sync; > + enum lttng_ust_lib_ring_buffer_mode_types mode; > + enum lttng_ust_lib_ring_buffer_output_types output; > + enum lttng_ust_lib_ring_buffer_backend_types backend; > + enum lttng_ust_lib_ring_buffer_oops_types oops; > + enum lttng_ust_lib_ring_buffer_ipi_types ipi; > + enum lttng_ust_lib_ring_buffer_wakeup_types wakeup; > /* > * tsc_bits: timestamp bits saved at each record. > * 0 and 64 disable the timestamp compression scheme. > diff --git a/include/lttng/tracepoint-event.h b/include/lttng/tracepoint-event.h > index 077eaa0..4630788 100644 > --- a/include/lttng/tracepoint-event.h > +++ b/include/lttng/tracepoint-event.h > @@ -20,12 +20,12 @@ > * SOFTWARE. > */ > > +#ifdef TRACEPOINT_CREATE_PROBES > + > #ifdef __cplusplus > extern "C" { > #endif > > -#ifdef TRACEPOINT_CREATE_PROBES > - > #define __tp_stringify1(x) #x > #define __tp_stringify(x) __tp_stringify1(x) > > @@ -65,10 +65,10 @@ extern "C" { > #undef TRACEPOINT_INCLUDE_FILE > #undef TRACEPOINT_INCLUDE > > -#define TRACEPOINT_CREATE_PROBES > - > -#endif /* TRACEPOINT_CREATE_PROBES */ > - > #ifdef __cplusplus > } > #endif > + > +#define TRACEPOINT_CREATE_PROBES > + > +#endif /* TRACEPOINT_CREATE_PROBES */ > diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h > index 749478a..bda0fbc 100644 > --- a/include/lttng/ust-events.h > +++ b/include/lttng/ust-events.h > @@ -89,15 +89,21 @@ struct lttng_enum_entry { > > #define __type_integer(_type, _byte_order, _base, _encoding) \ > { \ > - .atype = atype_integer, \ > - .u.basic.integer = \ > + .atype = atype_integer, \ > + .u = \ > { \ > - .size = sizeof(_type) * CHAR_BIT, \ > - .alignment = lttng_alignof(_type) * CHAR_BIT, \ > - .signedness = lttng_is_signed_type(_type), \ > - .reverse_byte_order = _byte_order != BYTE_ORDER, \ > - .base = _base, \ > - .encoding = lttng_encode_##_encoding, \ > + .basic = \ > + { \ > + .integer = \ > + { \ > + .size = sizeof(_type) * CHAR_BIT, \ > + .alignment = lttng_alignof(_type) * CHAR_BIT, \ > + .signedness = lttng_is_signed_type(_type), \ > + .reverse_byte_order = _byte_order != BYTE_ORDER, \ > + .base = _base, \ > + .encoding = lttng_encode_##_encoding, \ > + } \ > + } \ > }, \ > } \ > > @@ -123,14 +129,20 @@ struct lttng_integer_type { > > #define __type_float(_type) \ > { \ > - .atype = atype_float, \ > - .u.basic._float = \ > + .atype = atype_float, \ > + .u = \ > { \ > - .exp_dig = sizeof(_type) * CHAR_BIT \ > - - _float_mant_dig(_type), \ > - .mant_dig = _float_mant_dig(_type), \ > - .alignment = lttng_alignof(_type) * CHAR_BIT, \ > - .reverse_byte_order = BYTE_ORDER != FLOAT_WORD_ORDER, \ > + .basic = \ > + { \ > + ._float = \ > + { \ > + .exp_dig = sizeof(_type) * CHAR_BIT \ > + - _float_mant_dig(_type), \ > + .mant_dig = _float_mant_dig(_type), \ > + .alignment = lttng_alignof(_type) * CHAR_BIT, \ > + .reverse_byte_order = BYTE_ORDER != FLOAT_WORD_ORDER, \ > + } \ > + } \ > }, \ > } \ > > diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h > index e46cc1a..bf4aeb4 100644 > --- a/include/lttng/ust-tracepoint-event.h > +++ b/include/lttng/ust-tracepoint-event.h > @@ -147,11 +147,14 @@ static const char \ > .type = \ > { \ > .atype = atype_array, \ > - .u.array = \ > + .u = \ > { \ > - .length = _length, \ > - .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \ > - }, \ > + .array = \ > + { \ > + .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \ > + .length = _length, \ > + } \ > + } \ > }, \ > .nowrite = _nowrite, \ > }, > @@ -164,10 +167,13 @@ static const char \ > .type = \ > { \ > .atype = atype_sequence, \ > - .u.sequence = \ > + .u = \ > { \ > - .length_type = __type_integer(_length_type, BYTE_ORDER, 10, none), \ > - .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \ > + .sequence = \ > + { \ > + .length_type = __type_integer(_length_type, BYTE_ORDER, 10, none), \ > + .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \ > + }, \ > }, \ > }, \ > .nowrite = _nowrite, \ > @@ -180,7 +186,10 @@ static const char \ > .type = \ > { \ > .atype = atype_string, \ > - .u.basic.string.encoding = lttng_encode_UTF8, \ > + .u = \ > + { \ > + .basic = { .string = { .encoding = lttng_encode_UTF8 } } \ > + }, \ > }, \ > .nowrite = _nowrite, \ > }, > @@ -483,7 +492,7 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)); \ > static \ > void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \ > { \ > - struct lttng_event *__event = __tp_data; \ > + struct lttng_event *__event = (struct lttng_event *) __tp_data; \ > struct lttng_channel *__chan = __event->chan; \ > struct lttng_ust_lib_ring_buffer_ctx __ctx; \ > size_t __event_len, __event_align; \ > @@ -612,13 +621,14 @@ static const char * \ > __ref_model_emf_uri___##_provider##___##_name \ > __attribute__((weakref ("_model_emf_uri___" #_provider "___" #_name)));\ > const struct lttng_event_desc __event_desc___##_provider##_##_name = { \ > - .fields = __event_fields___##_provider##___##_template, \ > .name = #_provider ":" #_name, \ > .probe_callback = (void (*)(void)) &__event_probe__##_provider##___##_template,\ > + .ctx = NULL, \ > + .fields = __event_fields___##_provider##___##_template, \ > .nr_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_template), \ > .loglevel = &__ref_loglevel___##_provider##___##_name, \ > .signature = __tp_event_signature___##_provider##___##_template, \ > - .u.ext.model_emf_uri = &__ref_model_emf_uri___##_provider##___##_name, \ > + .u = { .ext = { .model_emf_uri = &__ref_model_emf_uri___##_provider##___##_name } }, \ > }; > > #include TRACEPOINT_INCLUDE > diff --git a/tests/hello.cxx/Makefile.am b/tests/hello.cxx/Makefile.am > index 897416d..5f6c615 100644 > --- a/tests/hello.cxx/Makefile.am > +++ b/tests/hello.cxx/Makefile.am > @@ -1,7 +1,7 @@ > AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -Wsystem-headers > > noinst_PROGRAMS = hello > -hello_SOURCES = hello.cpp tp.c ust_tests_hello.h > +hello_SOURCES = hello.cpp tp.cpp ust_tests_hello.h > hello_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la > > if LTTNG_UST_BUILD_WITH_LIBDL > diff --git a/tests/hello.cxx/tp.c b/tests/hello.cxx/tp.c > deleted file mode 100644 > index 4790965..0000000 > --- a/tests/hello.cxx/tp.c > +++ /dev/null > @@ -1,26 +0,0 @@ > -/* > - * tp.c > - * > - * Copyright (c) 2011 Mathieu Desnoyers > - * > - * Permission is hereby granted, free of charge, to any person obtaining a copy > - * of this software and associated documentation files (the "Software"), to deal > - * in the Software without restriction, including without limitation the rights > - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > - * copies of the Software, and to permit persons to whom the Software is > - * furnished to do so, subject to the following conditions: > - * > - * The above copyright notice and this permission notice shall be included in > - * all copies or substantial portions of the Software. > - * > - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > - * SOFTWARE. > - */ > - > -#define TRACEPOINT_CREATE_PROBES > -#include "ust_tests_hello.h" > diff --git a/tests/hello.cxx/tp.cpp b/tests/hello.cxx/tp.cpp > new file mode 100644 > index 0000000..a2099ab > --- /dev/null > +++ b/tests/hello.cxx/tp.cpp > @@ -0,0 +1,26 @@ > +/* > + * tp.cpp > + * > + * Copyright (c) 2011 Mathieu Desnoyers > + * > + * Permission is hereby granted, free of charge, to any person obtaining a copy > + * of this software and associated documentation files (the "Software"), to deal > + * in the Software without restriction, including without limitation the rights > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > + * copies of the Software, and to permit persons to whom the Software is > + * furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice shall be included in > + * all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE > + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE > + * SOFTWARE. > + */ > + > +#define TRACEPOINT_CREATE_PROBES > +#include "ust_tests_hello.h" > -- > 1.8.2.1 > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu May 30 10:33:47 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 30 May 2013 10:33:47 -0400 Subject: [lttng-dev] [PATCH lttng-ust v2] Move include directive from CFLAGS to LOCAL_CPPFLAGS in examples' Makefiles In-Reply-To: <1369779558-20747-1-git-send-email-jeremie.galarneau@efficios.com> References: <1369771309-1773-1-git-send-email-jeremie.galarneau@efficios.com> <1369779558-20747-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130530143347.GA23831@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > The use of LOCAL_* flags and override directives ensures that the build > succeeds even if the user explicitly overrides CFLAGS/CPPFLAGS/LDFLAGS. merged into master and stable-2.2. Thanks! Mathieu > > Fixes #537 > > Signed-off-by: J?r?mie Galarneau > --- > doc/examples/demo/Makefile | 14 +++++++------- > doc/examples/easy-ust/Makefile | 10 +++++----- > doc/examples/hello-static-lib/Makefile | 10 +++++----- > 3 files changed, 17 insertions(+), 17 deletions(-) > > diff --git a/doc/examples/demo/Makefile b/doc/examples/demo/Makefile > index bbc8ccb..27ca92b 100644 > --- a/doc/examples/demo/Makefile > +++ b/doc/examples/demo/Makefile > @@ -15,14 +15,14 @@ > CC = gcc > LIBS = -ldl # On Linux > #LIBS = -lc # On BSD > -CFLAGS += -I. > +LOCAL_CPPFLAGS += -I. > > # Only necessary when building from the source tree and lttng-ust is not > # installed > ifdef BUILD_EXAMPLES_FROM_TREE > -CFLAGS += -I../../../include/ > +LOCAL_CPPFLAGS += -I../../../include/ > LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ > -LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > +override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > > # Third-party Makefiles have to define these targets to integrate with an > # automake project > @@ -37,22 +37,22 @@ endif > all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so > > tp.o: tp.c ust_tests_demo.h > - $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > > tp2.o: tp2.c ust_tests_demo2.h > - $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > > lttng-ust-provider-ust-tests-demo.so: tp.o tp2.o > $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $^ > > tp3.o: tp3.c ust_tests_demo3.h > - $(CC) $(CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -fpic -c -o $@ $< > > lttng-ust-provider-ust-tests-demo3.so: tp3.o > $(CC) -shared -o $@ $(LDFLAGS) -llttng-ust $^ > > demo.o: demo.c > - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< > > demo: demo.o > $(CC) -o $@ $^ $(LIBS) > diff --git a/doc/examples/easy-ust/Makefile b/doc/examples/easy-ust/Makefile > index e20e53a..e3546e1 100644 > --- a/doc/examples/easy-ust/Makefile > +++ b/doc/examples/easy-ust/Makefile > @@ -17,14 +17,14 @@ > CC = gcc > LIBS = -ldl -llttng-ust # On Linux > #LIBS = -lc -llttng-ust # On BSD > -CFLAGS += -I. > +LOCAL_CPPFLAGS += -I. > > # Only necessary when building from the source tree and lttng-ust is not > # installed > ifdef BUILD_EXAMPLES_FROM_TREE > -CFLAGS += -I../../../include/ > +LOCAL_CPPFLAGS += -I../../../include/ > LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ > -LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > +override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > > # Third-party Makefiles have to define these targets to integrate with an > # automake project > @@ -42,10 +42,10 @@ sample: sample.o tp.o > $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) > > sample.o: sample.c sample_component_provider.h > - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< > > tp.o: tp.c sample_component_provider.h > - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< > > html: sample_component_provider.html sample.html tp.html > > diff --git a/doc/examples/hello-static-lib/Makefile b/doc/examples/hello-static-lib/Makefile > index dd246f7..85c64c1 100644 > --- a/doc/examples/hello-static-lib/Makefile > +++ b/doc/examples/hello-static-lib/Makefile > @@ -13,16 +13,16 @@ > # a program with tracepoint provider probes compiled as static libraries. > > CC = gcc > -CFLAGS += -I. > +LOCAL_CPPFLAGS += -I. > LIBS = -ldl -llttng-ust # On Linux > #LIBS = -lc -llttng-ust # On BSD > > # Only necessary when building from the source tree and lttng-ust is not > # installed > ifdef BUILD_EXAMPLES_FROM_TREE > -CFLAGS += -I../../../include/ > +LOCAL_CPPFLAGS += -I../../../include/ > LIBLTTNG_UST_PATH = ../../../liblttng-ust/.libs/ > -LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > +override LDFLAGS += -L$(LIBLTTNG_UST_PATH) -Wl,-rpath='$$ORIGIN/$(LIBLTTNG_UST_PATH)' > > # Third-party Makefiles have to define these targets to integrate with an > # automake project > @@ -37,13 +37,13 @@ endif > all: hello > > lttng-ust-provider-hello.o: tp.c ust_tests_hello.h > - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< > > lttng-ust-provider-hello.a: lttng-ust-provider-hello.o > ar -rc $@ $^ > > hello.o: hello.c > - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< > + $(CC) $(CPPFLAGS) $(LOCAL_CPPFLAGS) $(CFLAGS) -c -o $@ $< > > hello: hello.o lttng-ust-provider-hello.a > $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) > -- > 1.8.2.3 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From zhengda1936 at gmail.com Thu May 30 12:32:36 2013 From: zhengda1936 at gmail.com (Zheng Da) Date: Thu, 30 May 2013 12:32:36 -0400 Subject: [lttng-dev] lttng start error Message-ID: Hello, I just started to use lttng. I use Ubuntu 12.04 and the kernel version 3.8.12. I use a customized kernel, so the lttng package in ubuntu can't be installed correctly. I built lttng 2.0 myself. Then I followed the steps in https://lttng.org/quickstart. When I run lttng start, I got the errors: root at ubuntu:~# lttng start PERROR: sendmsg: Bad file descriptor [in lttcomm_send_unix_sock() at sessiond-comm.c:311] PERROR: send consumer channel: Bad file descriptor [in send_kconsumer_session_streams() at main.c:636] PERROR: ioctl start session: No buffer space available [in kernel_start_session() at kernel.c:397] Error: Starting kernel trace failed Someone said in the mailing list that this problem may have something to do with memory limit. But it shouldn't be my case as my machine has 512GB memory. Can anyone help me troubleshoot the problem? Thanks, Da From jeremie.galarneau at efficios.com Thu May 30 13:14:49 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Thu, 30 May 2013 13:14:49 -0400 Subject: [lttng-dev] lttng start error In-Reply-To: References: Message-ID: On Thu, May 30, 2013 at 12:32 PM, Zheng Da wrote: > Hello, > > I just started to use lttng. I use Ubuntu 12.04 and the kernel version > 3.8.12. I use a customized kernel, so the lttng package in ubuntu > can't be installed correctly. I built lttng 2.0 myself. Did you build only the lttng-modules or the complete toolchain (lttng-tools, lttng-ust, lttng-modules)? Which versions of the different packages are you using? Thanks, J?r?mie > > Then I followed the steps in https://lttng.org/quickstart. When I run > lttng start, I got the errors: > root at ubuntu:~# lttng start > PERROR: sendmsg: Bad file descriptor [in lttcomm_send_unix_sock() at > sessiond-comm.c:311] > PERROR: send consumer channel: Bad file descriptor [in > send_kconsumer_session_streams() at main.c:636] > PERROR: ioctl start session: No buffer space available [in > kernel_start_session() at kernel.c:397] > Error: Starting kernel trace failed > > Someone said in the mailing list that this problem may have something > to do with memory limit. But it shouldn't be my case as my machine has > 512GB memory. > > Can anyone help me troubleshoot the problem? > > Thanks, > Da > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Thu May 30 13:44:39 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Thu, 30 May 2013 13:44:39 -0400 Subject: [lttng-dev] using a custom channel In-Reply-To: <51A4A3B9.7010303@free.fr> References: <51A4A3B9.7010303@free.fr> Message-ID: Hi, You have to create a new channel using lttng --enable-channel MyNewChannel -k and then enable the events you wish to collect in this channel. lttng enable-event -k -a --channel MyNewChannel Hopefully this answers your question, J?r?mie On Tue, May 28, 2013 at 8:31 AM, St?phane ANCELOT wrote: > Hi, > > I finally managed to create my trace events probes... > I copied my .h header in instrumentation/event/lttng-module and create a > lttng probe module > > but now, I would like to use other channels than channel0 , how to do this, > I tried using xn_nucleus_blahblah as event name, but it has not helped , it > is seen in channel0 > > Regards, > Steph > > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Thu May 30 13:44:39 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Thu, 30 May 2013 13:44:39 -0400 Subject: [lttng-dev] using a custom channel In-Reply-To: <51A4A3B9.7010303@free.fr> References: <51A4A3B9.7010303@free.fr> Message-ID: Hi, You have to create a new channel using lttng --enable-channel MyNewChannel -k and then enable the events you wish to collect in this channel. lttng enable-event -k -a --channel MyNewChannel Hopefully this answers your question, J?r?mie On Tue, May 28, 2013 at 8:31 AM, St?phane ANCELOT wrote: > Hi, > > I finally managed to create my trace events probes... > I copied my .h header in instrumentation/event/lttng-module and create a > lttng probe module > > but now, I would like to use other channels than channel0 , how to do this, > I tried using xn_nucleus_blahblah as event name, but it has not helped , it > is seen in channel0 > > Regards, > Steph > > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From Daniel.Thibault at drdc-rddc.gc.ca Thu May 30 14:59:13 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 30 May 2013 18:59:13 +0000 Subject: [lttng-dev] Running lttng-tools tests? Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D21ECF@VAL-E-02.valcartier.drdc-rddc.gc.ca> After installing lttng-tools (2.2.0-rc2) in /usr/src, I tried this: $ cd /usr/src/lttng-tools-2.2.0-rc2/tests $ ./run.sh unit_tests And I got this: unit/test_kernel_data .............. Dubious, test returned 1 (wstat 256, 0x100) No subtests run unit/test_session .................. Dubious, test returned 1 (wstat 256, 0x100) No subtests run unit/test_uri ...................... Dubious, test returned 1 (wstat 256, 0x100) No subtests run unit/test_ust_data ................. Dubious, test returned 1 (wstat 256, 0x100) No subtests run unit/test_utils_parse_size_suffix .. Dubious, test returned 1 (wstat 256, 0x100) No subtests run Test Summary Report ------------------- unit/test_kernel_data (Wstat: 256 Tests: 0 Failed: 0) Non-zero exit status: 1 Parse errors: No plan found in TAP output unit/test_session (Wstat: 256 Tests: 0 Failed: 0) Non-zero exit status: 1 Parse errors: No plan found in TAP output unit/test_uri (Wstat: 256 Tests: 0 Failed: 0) Non-zero exit status: 1 Parse errors: No plan found in TAP output unit/test_ust_data (Wstat: 256 Tests: 0 Failed: 0) Non-zero exit status: 1 Parse errors: No plan found in TAP output unit/test_utils_parse_size_suffix (Wstat: 256 Tests: 0 Failed: 0) Non-zero exit status: 1 Parse errors: No plan found in TAP output Files=5, Tests=0, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.04 cusr 0.04 csys = 0.11 CPU) Result: FAIL There is no README in lttng-tools/tests (unlike lttng-ust, but sadly like userspace-rcu), and the script is laconic, so I can't be sure if this is a true failure (my installation works) or if I just ran the tests wrong. For userspace-rcu, I ran ' ./runtests.sh 2 2 10', but I got no PASS/FAIL evaluation so I'm not 100% sure the tests were a success. How are these tests supposed to be run? Daniel U. Thibault Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure Qu?bec QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?| Government of Canada From zhengda1936 at gmail.com Thu May 30 15:05:47 2013 From: zhengda1936 at gmail.com (Zheng Da) Date: Thu, 30 May 2013 15:05:47 -0400 Subject: [lttng-dev] lttng start error In-Reply-To: References: Message-ID: Hello, I built lttng-modules-2.0.6, lttng-tools-2.0.5 and lttng-ust-2.0.6. Best, Da On Thu, May 30, 2013 at 1:14 PM, J?r?mie Galarneau wrote: > On Thu, May 30, 2013 at 12:32 PM, Zheng Da wrote: >> Hello, >> >> I just started to use lttng. I use Ubuntu 12.04 and the kernel version >> 3.8.12. I use a customized kernel, so the lttng package in ubuntu >> can't be installed correctly. I built lttng 2.0 myself. > > Did you build only the lttng-modules or the complete toolchain > (lttng-tools, lttng-ust, lttng-modules)? Which versions of the > different packages are you using? > > Thanks, > J?r?mie > >> >> Then I followed the steps in https://lttng.org/quickstart. When I run >> lttng start, I got the errors: >> root at ubuntu:~# lttng start >> PERROR: sendmsg: Bad file descriptor [in lttcomm_send_unix_sock() at >> sessiond-comm.c:311] >> PERROR: send consumer channel: Bad file descriptor [in >> send_kconsumer_session_streams() at main.c:636] >> PERROR: ioctl start session: No buffer space available [in >> kernel_start_session() at kernel.c:397] >> Error: Starting kernel trace failed >> >> Someone said in the mailing list that this problem may have something >> to do with memory limit. But it shouldn't be my case as my machine has >> 512GB memory. >> >> Can anyone help me troubleshoot the problem? >> >> Thanks, >> Da >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > -- > J?r?mie Galarneau > EfficiOS Inc. > http://www.efficios.com From christian.babeux at efficios.com Thu May 30 15:16:08 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 30 May 2013 15:16:08 -0400 Subject: [lttng-dev] Running lttng-tools tests? In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD12D21ECF@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD12D21ECF@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: Hi Daniel, > After installing lttng-tools (2.2.0-rc2) in /usr/src, I tried this: > > $ cd /usr/src/lttng-tools-2.2.0-rc2/tests > $ ./run.sh unit_tests This is indeed the right way to run the tests. Usually I run those in the source tree _before_ installation e.g.: [...] make cd lttng-tools/tests ./run.sh unit_tests [...] Or you can run the make check target after building: [...] ./configure make make check [...] Perhaps there is an issue when the tests are installed? Make sure the tests binaries are properly compiled and are present in the installation paths. If not, we should remove any tests scripts/program installation when issuing 'make install'... Thanks, Christian On Thu, May 30, 2013 at 2:59 PM, Thibault, Daniel wrote: > After installing lttng-tools (2.2.0-rc2) in /usr/src, I tried this: > > $ cd /usr/src/lttng-tools-2.2.0-rc2/tests > $ ./run.sh unit_tests > > And I got this: > > unit/test_kernel_data .............. Dubious, test returned 1 (wstat 256, 0x100) > No subtests run > unit/test_session .................. Dubious, test returned 1 (wstat 256, 0x100) > No subtests run > unit/test_uri ...................... Dubious, test returned 1 (wstat 256, 0x100) > No subtests run > unit/test_ust_data ................. Dubious, test returned 1 (wstat 256, 0x100) > No subtests run > unit/test_utils_parse_size_suffix .. Dubious, test returned 1 (wstat 256, 0x100) > No subtests run > > Test Summary Report > ------------------- > unit/test_kernel_data (Wstat: 256 Tests: 0 Failed: 0) > Non-zero exit status: 1 > Parse errors: No plan found in TAP output > unit/test_session (Wstat: 256 Tests: 0 Failed: 0) > Non-zero exit status: 1 > Parse errors: No plan found in TAP output > unit/test_uri (Wstat: 256 Tests: 0 Failed: 0) > Non-zero exit status: 1 > Parse errors: No plan found in TAP output > unit/test_ust_data (Wstat: 256 Tests: 0 Failed: 0) > Non-zero exit status: 1 > Parse errors: No plan found in TAP output > unit/test_utils_parse_size_suffix (Wstat: 256 Tests: 0 Failed: 0) > Non-zero exit status: 1 > Parse errors: No plan found in TAP output > Files=5, Tests=0, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.04 cusr 0.04 csys = 0.11 CPU) > Result: FAIL > > There is no README in lttng-tools/tests (unlike lttng-ust, but sadly like userspace-rcu), and the script is laconic, so I can't be sure if this is a true failure (my installation works) or if I just ran the tests wrong. For userspace-rcu, I ran ' ./runtests.sh 2 2 10', but I got no PASS/FAIL evaluation so I'm not 100% sure the tests were a success. > > How are these tests supposed to be run? > > Daniel U. Thibault > Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) > Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) > R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) > 2459 route de la Bravoure > Qu?bec QC G3J 1X5 > CANADA > Vox : (418) 844-4000 x4245 > Fax : (418) 844-4538 > NAC : 918V QSDJ > Gouvernement du Canada | Government of Canada > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From Daniel.Thibault at drdc-rddc.gc.ca Thu May 30 16:52:22 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 30 May 2013 20:52:22 +0000 Subject: [lttng-dev] Running lttng-tools tests? In-Reply-To: References: <48CF5AC71E61DB46B70D0F388054EFFD12D21ECF@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D22366@VAL-E-02.valcartier.drdc-rddc.gc.ca> I tried deploying the tarball to another directory and building. The tests refuse to run ("Could not execute (unit/test_kernel_data): open3: exec of unit/test_kernmel_data failed at /usr/share/perl/5.14/TAP/Parser/Iterator/Process.pm line 168") until after the make step (naturally). This time I got: unit/test_kernel_data .............. ok unit/test_session .................. ok unit/test_uri ...................... Dubious, test returned 1 (wstat > 256, 0x100) Failed 1/11 subtests unit/test_ust_data ................. ok unit/test_utils_parse_size_suffix .. ok Test Summary Report ------------------- unit/test_uri (Wstat: 256 Tests: 11 Failed: 1) Failed test: 4 Non-zero exit status: 1 Files=5, Tests=55, 4 wallclock secs ( 0.13 usr 0.08 sys + 1.34 cusr 1.02 csys = 2.57 CPU) Result: FAIL Now I get exactly the same report in the original /usr/src/... folder if I run 'sudo ./run.sh unit_tests' instead of 'sudo ./run.sh unit_tests'. The problem is clearly one of file ownership (a lot of the /usr/src/... files are root-owned because of the way they were installed). ~~~~~~~~~~ I was looking into the babeltrace tests as well (cd babeltrace/tests/, ./runall.sh) and I was surprised that every single "succeed" test failed. Investigation revealed that the babeltrace/converter/babeltrace executable was responsible: it fails with "/usr/bin/ld: fatal error: /usr/src/babeltrace-1.1.0/converter/.libs/26622-lt-babeltrace: open: Permission denied" "collect2: ld a retourn? 1 code d'?tat d'ex?cutionn". Surprisingly, the babeltrace/converter/babeltrace executable is *different* from the /usr/local/bin/babeltrace executable (according to diff). So are the babeltrace-log executables. The timestamps are four seconds apart. The install log shows nothing strange: "libtool: install: /usr/bin/install -c .libs/babeltrace /usr/local/bin/babeltrace". /usr/bin/install is supposed to do a plain copy, no? Changing runall.sh so it runs the installed /usr/local/bin/babeltrace yields successful tests except for the succeed3 trace: $ babeltrace /usr/src/babeltrace-1.1.0/tests/ctf-traces/succeed/succeed3 [error] at line 9: token ""?\x20\o040?"": syntax error, unexpected ERROR [error] Error creating AST [warning] Unable to open trace metadata for path "/usr/src/babeltrace-1.1.0/tests/ctf-traces/succeed/succeed3". [warning] [Context] Cannot open_trace of format ctf at path /usr/src/babeltrace-1.1.0/tests/ctf-traces/succeed/succeed3. [warning] [Context] cannot open trace "/usr/src/babeltrace-1.1.0/tests/ctf-traces/succeed/succeed3" from /usr/src/babeltrace-1.1.0/tests/ctf-traces/succeed/succeed3 for reading. [error] Cannot open any trace for reading. [error] opening trace "/usr/src/babeltrace-1.1.0/tests/ctf-traces/succeed/succeed3" for reading. [error] none of the specified trace paths could be opened. Here also, ownership is responsible: running 'sudo ./runall.sh' (on the original runall.sh) yields the same successes (and the same succeed3 trace failure). So at this point I have three remaining questions: 1) Why does unit/test_uri fail one of its 11 sub-tests? 2) Why does babeltrace fail when reading the succeed3 ctf trace? 3) Why on Earth are the babeltrace executables tampered with when installed? Daniel U. Thibault Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure Qu?bec QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?| Government of Canada From Daniel.Thibault at drdc-rddc.gc.ca Fri May 31 10:34:34 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Fri, 31 May 2013 14:34:34 +0000 Subject: [lttng-dev] Dead code in lttng.c Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D2247A@VAL-E-02.valcartier.drdc-rddc.gc.ca> In lttng-tools/src/bin/lttng/lttng.c, the check_args_no_sessiond function checks the command-line arguments for "specific options and commands that must not trigger a session daemon". The function detects the options "-h", "--h" (for "--help"), "--list-options", and "--list-commands", and the commands "version" and "view". The parse_args function, on the other hand, detects "-V", "-h", "--list-commands", "--list-options" at its outset and *does not* reach the session daemon spawning check ( if (opt_no_sessiond == 0 && check_args_no_sessiond(argc, argv) == 0 && (check_sessiond() < 0)) ) in those cases. So, why is check_args_no_sessiond checking for options at all? Considering the control flow of parse_args, check_args_no_sessiond should check *only* for the "version" and "view" commands. If check_args_no_sessiond is to check the command-line options anyway (for completeness's sake, say), then it should check for the "-V"/"--version" option as well. And if the check for "--h" is satisfactory, the check for "--list-commands" and "--list-options" should be collapsed into a simple check for "--l". (These observations are based on the May 23 commit, so my apologies if these points have already been addressed) Daniel U. Thibault Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure Qu?bec QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?| Government of Canada From mathieu.desnoyers at efficios.com Fri May 31 11:35:17 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 31 May 2013 11:35:17 -0400 Subject: [lttng-dev] [RFC PATCH urcu] Implement rcu_barrier() Message-ID: <20130531153517.GA12809@Krystal> Awaits for all in-flight call_rcu handlers to complete execution before returning. Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h index f7f0f71..fb3568f 100644 --- a/urcu-call-rcu-impl.h +++ b/urcu-call-rcu-impl.h @@ -64,6 +64,16 @@ struct call_rcu_data { struct cds_list_head list; } __attribute__((aligned(CAA_CACHE_LINE_SIZE))); +struct call_rcu_completion { + int barrier_count; + int32_t futex; +}; + +struct call_rcu_completion_work { + struct rcu_head head; + struct call_rcu_completion *completion; +}; + /* * List of all call_rcu_data structures to keep valgrind happy. * Protected by call_rcu_mutex. @@ -236,6 +246,26 @@ static void call_rcu_wake_up(struct call_rcu_data *crdp) } } +static void call_rcu_completion_wait(struct call_rcu_completion *completion) +{ + /* Read completion barrier count before read futex */ + cmm_smp_mb(); + if (uatomic_read(&completion->futex) == -1) + futex_async(&completion->futex, FUTEX_WAIT, -1, + NULL, NULL, 0); +} + +static void call_rcu_completion_wake_up(struct call_rcu_completion *completion) +{ + /* Write to completion barrier count before reading/writing futex */ + cmm_smp_mb(); + if (caa_unlikely(uatomic_read(&completion->futex) == -1)) { + uatomic_set(&completion->futex, 0); + futex_async(&completion->futex, FUTEX_WAKE, 1, + NULL, NULL, 0); + } +} + /* This is the code run by each call_rcu thread. */ static void *call_rcu_thread(void *arg) @@ -604,6 +634,17 @@ static void wake_call_rcu_thread(struct call_rcu_data *crdp) call_rcu_wake_up(crdp); } +static void _call_rcu(struct rcu_head *head, + void (*func)(struct rcu_head *head), + struct call_rcu_data *crdp) +{ + cds_wfcq_node_init(&head->next); + head->func = func; + cds_wfcq_enqueue(&crdp->cbs_head, &crdp->cbs_tail, &head->next); + uatomic_inc(&crdp->qlen); + wake_call_rcu_thread(crdp); +} + /* * Schedule a function to be invoked after a following grace period. * This is the only function that must be called -- the others are @@ -618,20 +659,15 @@ static void wake_call_rcu_thread(struct call_rcu_data *crdp) * * call_rcu must be called by registered RCU read-side threads. */ - void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *head)) { struct call_rcu_data *crdp; - cds_wfcq_node_init(&head->next); - head->func = func; /* Holding rcu read-side lock across use of per-cpu crdp */ rcu_read_lock(); crdp = get_call_rcu_data(); - cds_wfcq_enqueue(&crdp->cbs_head, &crdp->cbs_tail, &head->next); - uatomic_inc(&crdp->qlen); - wake_call_rcu_thread(crdp); + _call_rcu(head, func, crdp); rcu_read_unlock(); } @@ -730,6 +766,89 @@ void free_all_cpu_call_rcu_data(void) free(crdp); } +static +void _rcu_barrier_complete(struct rcu_head *head) +{ + struct call_rcu_completion_work *work; + struct call_rcu_completion *completion; + + work = caa_container_of(head, struct call_rcu_completion_work, head); + completion = work->completion; + uatomic_dec(&completion->barrier_count); + call_rcu_completion_wake_up(completion); + free(work); +} + +/* + * Wait for all in-flight call_rcu callbacks to complete execution. + */ +void rcu_barrier(void) +{ + struct call_rcu_data *crdp; + struct call_rcu_completion completion; + int count = 0, work_count = 0; + int was_online; + + /* Put in offline state in QSBR. */ + was_online = rcu_read_ongoing(); + if (was_online) + rcu_thread_offline(); + /* + * Calling a rcu_barrier() within a RCU read-side critical + * section is an error. + */ + if (rcu_read_ongoing()) { + static int warned = 0; + + if (!warned) { + fprintf(stderr, "[error] liburcu: rcu_barrier() called from within RCU read-side critical section.\n"); + } + warned = 1; + goto online; + } + + call_rcu_lock(&call_rcu_mutex); + cds_list_for_each_entry(crdp, &call_rcu_data_list, list) + count++; + + completion.barrier_count = count; + + cds_list_for_each_entry(crdp, &call_rcu_data_list, list) { + struct call_rcu_completion_work *work; + + work = calloc(sizeof(*work), 1); + if (!work) { + static int warned = 0; + + if (!warned) { + fprintf(stderr, "[error] liburcu: unable to allocate memory for rcu_barrier()\n"); + } + warned = 1; + break; + } + work->completion = &completion; + _call_rcu(&work->head, _rcu_barrier_complete, crdp); + work_count++; + } + call_rcu_unlock(&call_rcu_mutex); + + if (work_count != count) + uatomic_sub(&completion.barrier_count, count - work_count); + + /* Wait for them */ + for (;;) { + uatomic_dec(&completion.futex); + /* Decrement futex before reading barrier_count */ + cmm_smp_mb(); + if (!uatomic_read(&completion.barrier_count)) + break; + call_rcu_completion_wait(&completion); + } +online: + if (was_online) + rcu_thread_online(); +} + /* * Acquire the call_rcu_mutex in order to ensure that the child sees * all of the call_rcu() data structures in a consistent state. Ensure diff --git a/urcu-call-rcu.h b/urcu-call-rcu.h index 997bb2f..30388c5 100644 --- a/urcu-call-rcu.h +++ b/urcu-call-rcu.h @@ -92,6 +92,8 @@ void call_rcu_before_fork(void); void call_rcu_after_fork_parent(void); void call_rcu_after_fork_child(void); +void rcu_barrier(void); + #ifdef __cplusplus } #endif diff --git a/urcu-flavor.h b/urcu-flavor.h index c04f1db..5e7f292 100644 --- a/urcu-flavor.h +++ b/urcu-flavor.h @@ -41,6 +41,8 @@ struct rcu_flavor_struct { void (*thread_online)(void); void (*register_thread)(void); void (*unregister_thread)(void); + + void (*barrier)(void); }; #define DEFINE_RCU_FLAVOR(x) \ @@ -56,6 +58,7 @@ const struct rcu_flavor_struct x = { \ .thread_online = rcu_thread_online, \ .register_thread = rcu_register_thread, \ .unregister_thread = rcu_unregister_thread,\ + .barrier = rcu_barrier, \ } extern const struct rcu_flavor_struct rcu_flavor; diff --git a/urcu/map/urcu-bp.h b/urcu/map/urcu-bp.h index 92863fe..67ba5c3 100644 --- a/urcu/map/urcu-bp.h +++ b/urcu/map/urcu-bp.h @@ -63,6 +63,7 @@ #define call_rcu_before_fork call_rcu_before_fork_bp #define call_rcu_after_fork_parent call_rcu_after_fork_parent_bp #define call_rcu_after_fork_child call_rcu_after_fork_child_bp +#define rcu_barrier rcu_barrier_bp #define defer_rcu defer_rcu_bp #define rcu_defer_register_thread rcu_defer_register_thread_bp diff --git a/urcu/map/urcu-qsbr.h b/urcu/map/urcu-qsbr.h index e3261ff..b89dd24 100644 --- a/urcu/map/urcu-qsbr.h +++ b/urcu/map/urcu-qsbr.h @@ -65,6 +65,7 @@ #define call_rcu_before_fork call_rcu_before_fork_qsbr #define call_rcu_after_fork_parent call_rcu_after_fork_parent_qsbr #define call_rcu_after_fork_child call_rcu_after_fork_child_qsbr +#define rcu_barrier rcu_barrier_qsbr #define defer_rcu defer_rcu_qsbr #define rcu_defer_register_thread rcu_defer_register_thread_qsbr diff --git a/urcu/map/urcu.h b/urcu/map/urcu.h index 77b3721..8f04caf 100644 --- a/urcu/map/urcu.h +++ b/urcu/map/urcu.h @@ -69,6 +69,7 @@ #define call_rcu_before_fork call_rcu_before_fork_memb #define call_rcu_after_fork_parent call_rcu_after_fork_parent_memb #define call_rcu_after_fork_child call_rcu_after_fork_child_memb +#define rcu_barrier rcu_barrier_memb #define defer_rcu defer_rcu_memb #define rcu_defer_register_thread rcu_defer_register_thread_memb @@ -116,6 +117,7 @@ #define call_rcu_before_fork call_rcu_before_fork_sig #define call_rcu_after_fork_parent call_rcu_after_fork_parent_sig #define call_rcu_after_fork_child call_rcu_after_fork_child_sig +#define rcu_barrier rcu_barrier_sig #define defer_rcu defer_rcu_sig #define rcu_defer_register_thread rcu_defer_register_thread_sig @@ -160,6 +162,7 @@ #define call_rcu_before_fork call_rcu_before_fork_mb #define call_rcu_after_fork_parent call_rcu_after_fork_parent_mb #define call_rcu_after_fork_child call_rcu_after_fork_child_mb +#define rcu_barrier rcu_barrier_mb #define defer_rcu defer_rcu_mb #define rcu_defer_register_thread rcu_defer_register_thread_mb -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From francis.giraldeau at gmail.com Fri May 31 11:48:17 2013 From: francis.giraldeau at gmail.com (Francis Giraldeau) Date: Fri, 31 May 2013 11:48:17 -0400 Subject: [lttng-dev] [RELEASE] Workload-kit 0.1.13 Message-ID: Workload-kit is a set of utilities to generate various kind of workloads on a system, aimed at generating traces that presents recognizable features. The generated trace set could be used as a basis to validate trace analysis algorithms. Workload-kit makes it easy to generate the trace set on any architecture in a reproducible way. Changelog: 2013-05-31 Workload-kit 0.1.13 * Add cputemp utility to trace sensor temperature with UST (contribution of Suchakra Sharma) * Add wk-pipette to show producer and consumer behavior on pipe full/empty conditions * Add 3 programs involving synchronization * wk-mutex: simple mutex hold * wk-imbalance: one thread limits the computation at a barrier * wk-pipeline: 3 stages pipeline controlled with semaphores * Modified do_hog function to be closer to the behavior of the counter function (contribution of Francois Rajotte) * lttng-simple: new option --enable-libc-wrapper * lttng-simple: increase UST buffer size to 16MB * New option to make UST optional (--disable-ust) The traceset has been generated with the following configuration: * Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz * LTTng master (2.2.0-rc2) * Linux 3.8.0-22-generic * Includes lttng-modules add-ons See this link for additional information about tracing userspace memory allocations with UST: http://multivax.blogspot.ca/2013/05/tracing-userspace-memory-allocation.html Sources: http://secretaire.dorsal.polymtl.ca/~fgiraldeau/workload-kit/ Traceset: http://secretaire.dorsal.polymtl.ca/~fgiraldeau/traceset/ Git repo: https://github.com/giraldeau/workload-kit -------------- next part -------------- An HTML attachment was scrubbed... URL: From Daniel.Thibault at drdc-rddc.gc.ca Fri May 31 12:39:48 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Fri, 31 May 2013 16:39:48 +0000 Subject: [lttng-dev] What is the point of the lttng --group option? Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D224CE@VAL-E-02.valcartier.drdc-rddc.gc.ca> In order for a user-level (non-sudoed) lttng command to be handled by the root lttng-sessiond daemon, the stars have to be properly aligned: * The root daemon has to be running * There must not be an lttng-sessiond daemon running for that user (other users' lttng-sessiond daemons are ignored) * The user must belong to the root daemon's group name ('tracing' unless the lttng-sessiond --group option was used to set it to something else) Otherwise the user-level lttng command is handled by the user's local lttng-sessiond daemon (which is spawned if not already running). Specifying the lttng --group makes no difference. Whether you belong to it or not, the success of your non-sudoed root daemon command is decided by the three bullets listed above. So what is this option supposed to be used for? Daniel U. Thibault Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure Qu?bec QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?| Government of Canada From Daniel.Thibault at drdc-rddc.gc.ca Fri May 31 15:48:15 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Fri, 31 May 2013 19:48:15 +0000 Subject: [lttng-dev] Interplay of enable-channel options Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D2256E@VAL-E-02.valcartier.drdc-rddc.gc.ca> Harking back to Mathieu's post of 3 May 2013 10:42:22, I'd like to see if I understand the options correctly. I'm pretty sure I don't. When a channel has been set to use per-UID buffering, if an event-producing user-space process dies suddenly it may create a "hole" in one of the channel's sub-buffers, temporarily preventing the consumer from getting access to the sub-buffer. Once the other event producers have filled the remaining sub-buffers, the session daemon will try to re-use the "hung" sub-buffer, at which point it will be discarded. Unrelated events in the sub-buffer will be lost. If the channel is also set to --discard, does this mean the session daemon will not flush the hung sub-buffer? This would mean the consumer daemon waits at the holed sub-buffer and never gets past it. What if --read-timer has been set to a non-zero value? Will the holed sub-buffer be flushed at that point in time? In this case the producers may not even have time to fill the remaining sub-buffers. How can the session daemon create a hole in a sub-buffer, anyway? Doesn't it get all of the event's description and payload in its own working memory before starting to write it out to the sub-buffer? Daniel U. Thibault Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure Qu?bec QC? G3J 1X5 CANADA Vox?: (418) 844-4000 x4245 Fax?: (418) 844-4538 NAC?: 918V QSDJ Gouvernement du Canada?| Government of Canada