From Andrew_Gabbasov at mentor.com Tue Apr 2 07:46:52 2013 From: Andrew_Gabbasov at mentor.com (Gabbasov, Andrew) Date: Tue, 2 Apr 2013 11:46:52 +0000 Subject: [lttng-dev] LTTng: global_dirty_limit symbol lookup failed In-Reply-To: <6C5EA58090A5ED459815C4D04C2B466F8C56DAF3@EU-MBX-01.mgc.mentorg.com> References: <20130125172448.GA694@Krystal>, <6C5EA58090A5ED459815C4D04C2B466F8C56DAF3@EU-MBX-01.mgc.mentorg.com> Message-ID: <6C5EA58090A5ED459815C4D04C2B466FD931DEDB@EU-MBX-03.mgc.mentorg.com> > From: Gabbasov, Andrew > Sent: Monday, February 18, 2013 14:14 > To: Mathieu Desnoyers > Cc: lttng-dev at lists.lttng.org > Subject: RE: LTTng: global_dirty_limit symbol lookup failed > > > Hi Andrew, > > > > Commit: > > > > commit b87700e318c27267890cbd6fb5e50b687279131b > > Author: Andrew Gabbasov > > Date: Mon Dec 10 11:14:52 2012 -0500 > > > > Add new kernel probes instrumentation > > > > Add kernel probes for btrfs, compaction, ext4, printk, random, rcu, > > regmap, rpm, sunrpc, workqueue, writeback. > > > > Signed-off-by: Andrew Gabbasov > > Signed-off-by: Mathieu Desnoyers > > > > has 2 issues: > > > > 1) it implements a wrapper around global_dirty_limit() in probes/. All > > wrappers should be in /wrapper/, without exception, otherwise the > > code will quickly become unmaintainable (we need to know what > > wrappers we can eventually remove if we remove support for older > > kernels in the future, and we need to be aware of those wrappers for > > complete testing coverage). I have no problem with having a > > probes/Makefile using a relative path (e.g. ../wrapper/somefile.o) as > > input if needed. > > > > 2) It fills my dmesg log output with: > > "LTTng: global_dirty_limit symbol lookup failed." > > messages. .config follows. > > > > Can you look into those issues ? > > > > Thanks, > > > > Mathieu > > Hi Mathieu, > > Sorry for a late response. > > I'm sending a separate e-mail with the patch to fix these issues. Here are some details: > > 1) I moved the wrapper to a separate file wrapper/writeback.h. Since it is supposed to be used > in writeback probe only, I think, using static variable will be harmless. > > 2) Since global_dirty_limit is not a function, but a global variable, its address is available > to kallsyms lookup only if CONFIG_KALLSYMS_ALL is set. In order not to introduce wrapper > related checks of this config into tracepoint definition include file, I decided not to exclude > separate tracepoints in case of this config absence, but to omit the whole probe from > building. So, writeback probe will be available only if CONFIG_KALLSYMS_ALL is set. > > 3) Additional issue that I noticed: in case of CONFIG_THUMB2_KERNEL setting for ARM, > kallsyms_lookup_funcptr modifies the address found for the symbol. In order to avoid > it for data addresses, I introduced a new kallsyms_lookup_dataptr function, that does not > do any address modifications. And this new function is used for global_dirty_limit wrapper. > > Thanks. > > Best regards, > Andrew Hi Mathieu, Any thoughts on these changes? Do you need anything else regarding it (the patch itself was sent separately on Feb 18, 2013, with a subject "[PATCH lttng-modules] Clean up using global_dirty_limit wrapper for writeback probe"). Thanks. Best regards, Andrew From mathieu.desnoyers at efficios.com Tue Apr 2 09:27:01 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 2 Apr 2013 09:27:01 -0400 Subject: [lttng-dev] [PATCH lttng-modules] Clean up using global_dirty_limit wrapper for writeback probe In-Reply-To: <1361182646-31794-1-git-send-email-andrew_gabbasov@mentor.com> References: <1361182646-31794-1-git-send-email-andrew_gabbasov@mentor.com> Message-ID: <20130402132701.GA12063@Krystal> * Andrew Gabbasov (andrew_gabbasov at mentor.com) wrote: > Move the wrapper around reading of global_dirty_limit to /wrapper/ directory. > Introduce a new kallsyms_lookup_dataptr function for obtaining the address > unchanged and use it in global_dirty_limit wrapper. > Since the data address is available only if CONFIG_KALLSYMS_ALL is set, > omit the whole probe from building if this config is missing. merged, thanks! Mathieu > > Signed-off-by: Andrew Gabbasov > --- > probes/Makefile | 2 ++ > probes/lttng-probe-writeback.c | 19 ++----------- > wrapper/kallsyms.h | 6 ++++ > wrapper/writeback.h | 61 ++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 71 insertions(+), 17 deletions(-) > create mode 100644 wrapper/writeback.h > > diff --git a/probes/Makefile b/probes/Makefile > index 088cd5f..08adad5 100644 > --- a/probes/Makefile > +++ b/probes/Makefile > @@ -189,10 +189,12 @@ endif > > obj-m += lttng-probe-workqueue.o > > +ifneq ($(CONFIG_KALLSYMS_ALL),) > obj-m += $(shell \ > if [ $(VERSION) -ge 3 \ > -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 36 \) ] ; then \ > echo "lttng-probe-writeback.o" ; fi;) > +endif > > > ifneq ($(CONFIG_KPROBES),) > diff --git a/probes/lttng-probe-writeback.c b/probes/lttng-probe-writeback.c > index 0a5c022..5e421e5 100644 > --- a/probes/lttng-probe-writeback.c > +++ b/probes/lttng-probe-writeback.c > @@ -32,27 +32,12 @@ > #include > > #include "../lttng-kernel-version.h" > +#include "../wrapper/writeback.h" > > /* #if */ > -#ifdef CONFIG_KALLSYMS > -#include "../wrapper/kallsyms.h" > > -static unsigned long *wrapper_global_dirty_limit_sym = 0; > -static inline > -unsigned long wrapper_global_dirty_limit(void) > -{ > - if (!wrapper_global_dirty_limit_sym) > - wrapper_global_dirty_limit_sym = > - (void *)kallsyms_lookup_funcptr("global_dirty_limit"); > - if (wrapper_global_dirty_limit_sym) > - return *wrapper_global_dirty_limit_sym; > - else { > - printk(KERN_WARNING "LTTng: global_dirty_limit symbol lookup failed.\n"); > - return 0; > - } > -} > #define global_dirty_limit wrapper_global_dirty_limit() > -#endif > + > /* #endif */ > > /* > diff --git a/wrapper/kallsyms.h b/wrapper/kallsyms.h > index f07788a..ad9e1f2 100644 > --- a/wrapper/kallsyms.h > +++ b/wrapper/kallsyms.h > @@ -42,4 +42,10 @@ unsigned long kallsyms_lookup_funcptr(const char *name) > #endif > return addr; > } > + > +static inline > +unsigned long kallsyms_lookup_dataptr(const char *name) > +{ > + return kallsyms_lookup_name(name); > +} > #endif /* _LTTNG_WRAPPER_KALLSYMS_H */ > diff --git a/wrapper/writeback.h b/wrapper/writeback.h > new file mode 100644 > index 0000000..818ddd6 > --- /dev/null > +++ b/wrapper/writeback.h > @@ -0,0 +1,61 @@ > +#ifndef _LTTNG_WRAPPER_WRITEBACK_H > +#define _LTTNG_WRAPPER_WRITEBACK_H > + > +/* > + * wrapper/writeback.h > + * > + * wrapper around global_dirty_limit read. Using KALLSYMS with KALLSYMS_ALL > + * to get its address when available, else we need to have a kernel that > + * exports this variable to GPL modules. > + * > + * Copyright (C) 2013 Mentor Graphics Corp. > + * > + * 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; only > + * 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 > + */ > + > +#ifdef CONFIG_KALLSYMS_ALL > + > +#include > +#include "kallsyms.h" > + > +static unsigned long *global_dirty_limit_sym = 0; > + > +static inline > +unsigned long wrapper_global_dirty_limit(void) > +{ > + if (!global_dirty_limit_sym) > + global_dirty_limit_sym = > + (void *)kallsyms_lookup_dataptr("global_dirty_limit"); > + if (global_dirty_limit_sym) > + return *global_dirty_limit_sym; > + else { > + printk(KERN_WARNING "LTTng: global_dirty_limit symbol lookup failed.\n"); > + return 0; > + } > +} > + > +#else > + > +#include > + > +static inline > +unsigned long wrapper_global_dirty_limit(void) > +{ > + return global_dirty_limit; > +} > + > +#endif > + > +#endif /* _LTTNG_WRAPPER_WRITEBACK_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 markus.weinfurtner.ext at nsn.com Tue Apr 2 09:25:08 2013 From: markus.weinfurtner.ext at nsn.com (Markus Weinfurtner) Date: Tue, 02 Apr 2013 15:25:08 +0200 Subject: [lttng-dev] add-context perf counters support in userspace Message-ID: <515ADC34.9060304@nsn.com> Hi, will perf counters in add-context for userspace be supported in the future? Does anybody currently work on this? Br, Markus From mathieu.desnoyers at efficios.com Tue Apr 2 09:28:18 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 2 Apr 2013 09:28:18 -0400 Subject: [lttng-dev] LTTng: global_dirty_limit symbol lookup failed In-Reply-To: <6C5EA58090A5ED459815C4D04C2B466FD931DEDB@EU-MBX-03.mgc.mentorg.com> References: <6C5EA58090A5ED459815C4D04C2B466F8C56DAF3@EU-MBX-01.mgc.mentorg.com> <6C5EA58090A5ED459815C4D04C2B466FD931DEDB@EU-MBX-03.mgc.mentorg.com> Message-ID: <20130402132818.GB12063@Krystal> * Gabbasov, Andrew (Andrew_Gabbasov at mentor.com) wrote: > > From: Gabbasov, Andrew > > Sent: Monday, February 18, 2013 14:14 > > To: Mathieu Desnoyers > > Cc: lttng-dev at lists.lttng.org > > Subject: RE: LTTng: global_dirty_limit symbol lookup failed > > > > > Hi Andrew, > > > > > > Commit: > > > > > > commit b87700e318c27267890cbd6fb5e50b687279131b > > > Author: Andrew Gabbasov > > > Date: Mon Dec 10 11:14:52 2012 -0500 > > > > > > Add new kernel probes instrumentation > > > > > > Add kernel probes for btrfs, compaction, ext4, printk, random, rcu, > > > regmap, rpm, sunrpc, workqueue, writeback. > > > > > > Signed-off-by: Andrew Gabbasov > > > Signed-off-by: Mathieu Desnoyers > > > > > > has 2 issues: > > > > > > 1) it implements a wrapper around global_dirty_limit() in probes/. All > > > wrappers should be in /wrapper/, without exception, otherwise the > > > code will quickly become unmaintainable (we need to know what > > > wrappers we can eventually remove if we remove support for older > > > kernels in the future, and we need to be aware of those wrappers for > > > complete testing coverage). I have no problem with having a > > > probes/Makefile using a relative path (e.g. ../wrapper/somefile.o) as > > > input if needed. > > > > > > 2) It fills my dmesg log output with: > > > "LTTng: global_dirty_limit symbol lookup failed." > > > messages. .config follows. > > > > > > Can you look into those issues ? > > > > > > Thanks, > > > > > > Mathieu > > > > Hi Mathieu, > > > > Sorry for a late response. > > > > I'm sending a separate e-mail with the patch to fix these issues. Here are some details: > > > > 1) I moved the wrapper to a separate file wrapper/writeback.h. Since it is supposed to be used > > in writeback probe only, I think, using static variable will be harmless. > > > > 2) Since global_dirty_limit is not a function, but a global variable, its address is available > > to kallsyms lookup only if CONFIG_KALLSYMS_ALL is set. In order not to introduce wrapper > > related checks of this config into tracepoint definition include file, I decided not to exclude > > separate tracepoints in case of this config absence, but to omit the whole probe from > > building. So, writeback probe will be available only if CONFIG_KALLSYMS_ALL is set. > > > > 3) Additional issue that I noticed: in case of CONFIG_THUMB2_KERNEL setting for ARM, > > kallsyms_lookup_funcptr modifies the address found for the symbol. In order to avoid > > it for data addresses, I introduced a new kallsyms_lookup_dataptr function, that does not > > do any address modifications. And this new function is used for global_dirty_limit wrapper. > > > > Thanks. > > > > Best regards, > > Andrew > > Hi Mathieu, > > Any thoughts on these changes? > Do you need anything else regarding it (the patch itself was sent > separately on Feb 18, 2013, with a subject "[PATCH lttng-modules] > Clean up using global_dirty_limit wrapper for writeback probe"). All good! Sorry for the delay, the last months have been hectic :) Thanks, Mathieu > > Thanks. > > Best regards, > Andrew -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Tue Apr 2 09:30:54 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 2 Apr 2013 09:30:54 -0400 Subject: [lttng-dev] add-context perf counters support in userspace In-Reply-To: <515ADC34.9060304@nsn.com> References: <515ADC34.9060304@nsn.com> Message-ID: <20130402133054.GC12063@Krystal> * Markus Weinfurtner (markus.weinfurtner.ext at nsn.com) wrote: > Hi, > > will perf counters in add-context for userspace be supported in the future? > Does anybody currently work on this? Hi, This is something we are contemplating, but we are expecting a Perf ABI that will expose those counters to user-space through vDSO. I know some work has been done in perf to expose those counters through system calls, but I don't know the current completion status. Short story: as soon as we have a user-space interface available to read those counters from UST, we plan to support it. Thanks, Mathieu > > Br, > Markus > > _______________________________________________ > 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 simon.marchi at polymtl.ca Tue Apr 2 16:45:14 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Tue, 2 Apr 2013 16:45:14 -0400 Subject: [lttng-dev] [PATCH lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size Message-ID: <1364935514-11042-1-git-send-email-simon.marchi@polymtl.ca> --subbuf-size accepts sizes such as: - 123 -> 123 - 123k or 123K -> 123 * 1024 - 123m or 123M -> 123 * 1024 * 1024 - 123g or 123G -> 123 * 1024 * 1024 * 1024 It uses the new parse_human_size function, which could probably be used at other places, such as tracefile size. I wanted to add some unit tests for parse_human_size, but the current test system does not make it easy. They will come later. Signed-off-by: Simon Marchi --- src/bin/lttng/commands/enable_channels.c | 18 +++++- src/bin/lttng/utils.c | 96 +++++++++++++++++++++++++++++- src/bin/lttng/utils.h | 2 + 3 files changed, 113 insertions(+), 3 deletions(-) diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index d026af4..f71bda5 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -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,21 @@ 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 (!parse_human_size(opt_arg, &chan.attr.subbuf_size)) { + ERR("Wrong format for 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/bin/lttng/utils.c b/src/bin/lttng/utils.c index b7f5170..a21f00f 100644 --- a/src/bin/lttng/utils.c +++ b/src/bin/lttng/utils.c @@ -16,9 +16,10 @@ */ #define _GNU_SOURCE -#include #include #include +#include +#include #include @@ -77,3 +78,96 @@ void list_cmd_options(FILE *ofp, struct poptOption *options) } } } + +/** + * 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. + */ +void regex_print_error(int errcode, regex_t *regex) +{ + /* Get length of error message and allocate accordingly */ + size_t length = regerror(errcode, regex, NULL, 0); + char *buffer = malloc(length); + + if (buffer) { + /* Get and print error message */ + regerror(errcode, regex, buffer, length); + ERR("%s\n", buffer); + free(buffer); + } +} + +/** + * Parse a string that represents a size in human readable format. It + * support decimal integers suffixed by 'k', 'K', 'm', 'M', g' or 'G'. + * + * The suffix multiply the integer by: + * 'k' or 'K': 1024 + * 'm' or 'M': 1024 * 1024 + * 'g' or 'G': 1024 * 1024 * 1024 + * + * @param str The string to parse. + * @param size Pointer to a size_t that will be filled with the + * resulting size. + * + * @return 1 on success, 0 on failure. + */ +uint64_t parse_human_size(char *str, size_t *size) +{ + regex_t regex; + int ret; + + if (!str) + return 0; + + /* Compile regex */ + ret = regcomp(®ex, "^[0-9][0-9]*\\([kmg]\\{0,1\\}\\)$", REG_ICASE); + + /* Check for regex error */ + if (ret != 0) { + regex_print_error(ret, ®ex); + + regfree(®ex); + return 0; + } + + const int nmatch = 2; + regmatch_t matches[nmatch]; + + /* Match regex */ + ret = regexec(®ex, str, nmatch, matches, 0); + if (ret == 0) { + /* There is a match ! */ + ret = 1; + + *size = atol(str); + + /* Check if there is a suffix */ + regmatch_t suffix_match = matches[1]; + if (suffix_match.rm_eo - suffix_match.rm_so > 0) { + switch (*(str + suffix_match.rm_so)) { + case 'k': + case 'K': + *size = *size * 1024; + break; + case 'm': + case 'M': + *size = *size * 1024 * 1024; + break; + case 'g': + case 'G': + *size = *size * 1024 * 1024 * 1024; + break; + } + } + + regfree(®ex); + return 1; + } else { + /* There is no match (or error) */ + regfree(®ex); + return 0; + } +} diff --git a/src/bin/lttng/utils.h b/src/bin/lttng/utils.h index 9f7bfcc..20ebd68 100644 --- a/src/bin/lttng/utils.h +++ b/src/bin/lttng/utils.h @@ -19,8 +19,10 @@ #define _LTTNG_UTILS_H #include +#include char *get_session_name(void); void list_cmd_options(FILE *ofp, struct poptOption *options); +uint64_t parse_human_size(char *str, size_t *size); #endif /* _LTTNG_UTILS_H */ -- 1.7.1 From christian.babeux at efficios.com Tue Apr 2 22:39:47 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Tue, 2 Apr 2013 22:39:47 -0400 Subject: [lttng-dev] [PATCH lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <1364935514-11042-1-git-send-email-simon.marchi@polymtl.ca> References: <1364935514-11042-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: Hi Simon, > I wanted to add some unit tests for parse_human_size, but the current > test system does not make it easy. They will come later. Could you describe the issues you had on a separate thread so we can further discuss it? Here a few comments on your patch: > + char *buffer = malloc(length); > + > + if (buffer) { > + /* Get and print error message */ > + regerror(errcode, regex, buffer, length); > + ERR("%s\n", buffer); > + free(buffer); > + } What if malloc() fails? Printing an error message would be appropriate to handle that case. > + /* Compile regex */ > + ret = regcomp(®ex, "^[0-9][0-9]*\\([kmg]\\{0,1\\}\\)$", REG_ICASE); This regex could be simplified to: "^[:digit:]+\\([kmg]\\)?$" > + *size = atol(str); atol() can return negative numbers and the result is stored in an unsigned (size_t). This could lead to enormous subbuffers allocated by accident. A check should be added to allow only positive numbers. Also, atol() does not detect conversion errors, returning 0 in error cases [1]. Perhaps using strtol() would be more appropriate? > + /* Check if there is a suffix */ > + regmatch_t suffix_match = matches[1]; > + if (suffix_match.rm_eo - suffix_match.rm_so > 0) { > + switch (*(str + suffix_match.rm_so)) { > + case 'k': > + case 'K': > + *size = *size * 1024; > + break; > + case 'm': > + case 'M': > + *size = *size * 1024 * 1024; > + break; > + case 'g': > + case 'G': > + *size = *size * 1024 * 1024 * 1024; > + break; > + } I think you could split the computation of the human size in two separate variables (size, computed_size perhaps?). Also, you could add checks for possible overflows/truncation in the computation/store (e.g. a user could specify 4194304K (SIZE_MAX/1024 + 1), quite unlikely but still possible!). This might be a bit overkill though... Could you also add a default case with perhaps ERR() or assert()? > + ret = 1; > [...] > + regfree(®ex); > + return 1; ret seems to be unused here. Maybe you meant return ret? You might also want to add negative numbers and large number testcases to your unit tests. Looking forward to the corrected patch + unit tests :). Thanks! Christian P.S.: This new feature seems in part related to bug #228 [1]. [1] - http://stackoverflow.com/questions/3792663/atol-v-s-strtol [2] - http://bugs.lttng.org/issues/228 On Tue, Apr 2, 2013 at 4:45 PM, Simon Marchi wrote: > > --subbuf-size accepts sizes such as: > > - 123 -> 123 > - 123k or 123K -> 123 * 1024 > - 123m or 123M -> 123 * 1024 * 1024 > - 123g or 123G -> 123 * 1024 * 1024 * 1024 > > It uses the new parse_human_size function, which could probably be used > at other places, such as tracefile size. > > I wanted to add some unit tests for parse_human_size, but the current > test system does not make it easy. They will come later. > > Signed-off-by: Simon Marchi > --- > src/bin/lttng/commands/enable_channels.c | 18 +++++- > src/bin/lttng/utils.c | 96 +++++++++++++++++++++++++++++- > src/bin/lttng/utils.h | 2 + > 3 files changed, 113 insertions(+), 3 deletions(-) > > diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c > index d026af4..f71bda5 100644 > --- a/src/bin/lttng/commands/enable_channels.c > +++ b/src/bin/lttng/commands/enable_channels.c > @@ -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,21 @@ 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 (!parse_human_size(opt_arg, &chan.attr.subbuf_size)) { > + ERR("Wrong format for 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/bin/lttng/utils.c b/src/bin/lttng/utils.c > index b7f5170..a21f00f 100644 > --- a/src/bin/lttng/utils.c > +++ b/src/bin/lttng/utils.c > @@ -16,9 +16,10 @@ > */ > > #define _GNU_SOURCE > -#include > #include > #include > +#include > +#include > > #include > > @@ -77,3 +78,96 @@ void list_cmd_options(FILE *ofp, struct poptOption *options) > } > } > } > + > +/** > + * 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. > + */ > +void regex_print_error(int errcode, regex_t *regex) > +{ > + /* Get length of error message and allocate accordingly */ > + size_t length = regerror(errcode, regex, NULL, 0); > + char *buffer = malloc(length); > + > + if (buffer) { > + /* Get and print error message */ > + regerror(errcode, regex, buffer, length); > + ERR("%s\n", buffer); > + free(buffer); > + } > +} > + > +/** > + * Parse a string that represents a size in human readable format. It > + * support decimal integers suffixed by 'k', 'K', 'm', 'M', g' or 'G'. > + * > + * The suffix multiply the integer by: > + * 'k' or 'K': 1024 > + * 'm' or 'M': 1024 * 1024 > + * 'g' or 'G': 1024 * 1024 * 1024 > + * > + * @param str The string to parse. > + * @param size Pointer to a size_t that will be filled with the > + * resulting size. > + * > + * @return 1 on success, 0 on failure. > + */ > +uint64_t parse_human_size(char *str, size_t *size) > +{ > + regex_t regex; > + int ret; > + > + if (!str) > + return 0; > + > + /* Compile regex */ > + ret = regcomp(®ex, "^[0-9][0-9]*\\([kmg]\\{0,1\\}\\)$", REG_ICASE); > + > + /* Check for regex error */ > + if (ret != 0) { > + regex_print_error(ret, ®ex); > + > + regfree(®ex); > + return 0; > + } > + > + const int nmatch = 2; > + regmatch_t matches[nmatch]; > + > + /* Match regex */ > + ret = regexec(®ex, str, nmatch, matches, 0); > + if (ret == 0) { > + /* There is a match ! */ > + ret = 1; > + > + *size = atol(str); > + > + /* Check if there is a suffix */ > + regmatch_t suffix_match = matches[1]; > + if (suffix_match.rm_eo - suffix_match.rm_so > 0) { > + switch (*(str + suffix_match.rm_so)) { > + case 'k': > + case 'K': > + *size = *size * 1024; > + break; > + case 'm': > + case 'M': > + *size = *size * 1024 * 1024; > + break; > + case 'g': > + case 'G': > + *size = *size * 1024 * 1024 * 1024; > + break; > + } > + } > + > + regfree(®ex); > + return 1; > + } else { > + /* There is no match (or error) */ > + regfree(®ex); > + return 0; > + } > +} > diff --git a/src/bin/lttng/utils.h b/src/bin/lttng/utils.h > index 9f7bfcc..20ebd68 100644 > --- a/src/bin/lttng/utils.h > +++ b/src/bin/lttng/utils.h > @@ -19,8 +19,10 @@ > #define _LTTNG_UTILS_H > > #include > +#include > > char *get_session_name(void); > void list_cmd_options(FILE *ofp, struct poptOption *options); > +uint64_t parse_human_size(char *str, size_t *size); > > #endif /* _LTTNG_UTILS_H */ > -- > 1.7.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From raphael.beamonte at polymtl.ca Tue Apr 2 22:52:54 2013 From: raphael.beamonte at polymtl.ca (=?ISO-8859-1?Q?Rapha=EBl_Beamonte?=) Date: Tue, 02 Apr 2013 22:52:54 -0400 Subject: [lttng-dev] [PATCH lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <1364935514-11042-1-git-send-email-simon.marchi@polymtl.ca> References: <1364935514-11042-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: <515B9986.7080802@polymtl.ca> On 2013-04-02 16:45, Simon Marchi wrote: > --subbuf-size accepts sizes such as: > > - 123 -> 123 > - 123k or 123K -> 123 * 1024 > - 123m or 123M -> 123 * 1024 * 1024 > - 123g or 123G -> 123 * 1024 * 1024 * 1024 I don't really like using non-SI prefixes such as "K", "m" or "g" (well, in fact "m" is an SI prefix but for milli, not mega). I think that would be better to only use "k", "M" and "G". -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: OpenPGP digital signature URL: From simon.marchi at polymtl.ca Tue Apr 2 23:37:43 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Tue, 2 Apr 2013 23:37:43 -0400 Subject: [lttng-dev] [PATCH lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: References: <1364935514-11042-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: On 2 April 2013 22:39, Christian Babeux wrote: > Hi Simon, > >> I wanted to add some unit tests for parse_human_size, but the current >> test system does not make it easy. They will come later. > > Could you describe the issues you had on a separate thread so we can > further discuss it? Will do. > Here a few comments on your patch: > >> + char *buffer = malloc(length); >> + >> + if (buffer) { >> + /* Get and print error message */ >> + regerror(errcode, regex, buffer, length); >> + ERR("%s\n", buffer); >> + free(buffer); >> + } > > What if malloc() fails? Printing an error message would be appropriate > to handle that case. Ok. >> + /* Compile regex */ >> + ret = regcomp(®ex, "^[0-9][0-9]*\\([kmg]\\{0,1\\}\\)$", REG_ICASE); > > This regex could be simplified to: "^[:digit:]+\\([kmg]\\)?$" I preferred not to use extended regex. + and ? is included in the extended posix regexes [1]. I also prefer [0-9] over [:digit:], because it is as clear and less characters, but I don't mind :). >> + *size = atol(str); > > atol() can return negative numbers and the result is stored in an > unsigned (size_t). This could lead to enormous subbuffers allocated by > accident. A check should be added to allow only positive numbers. > > Also, atol() does not detect conversion errors, returning 0 in error > cases [1]. Perhaps using strtol() would be more appropriate? True. But here, we are safe because the regex test passed We know for sure that we have a positive number that atol will correctly parse. >> + /* Check if there is a suffix */ >> + regmatch_t suffix_match = matches[1]; >> + if (suffix_match.rm_eo - suffix_match.rm_so > 0) { >> + switch (*(str + suffix_match.rm_so)) { >> + case 'k': >> + case 'K': >> + *size = *size * 1024; >> + break; >> + case 'm': >> + case 'M': >> + *size = *size * 1024 * 1024; >> + break; >> + case 'g': >> + case 'G': >> + *size = *size * 1024 * 1024 * 1024; >> + break; >> + } > > I think you could split the computation of the human size in two > separate variables (size, computed_size perhaps?). Do you want to return both values to the caller, or simply use two intermediate variables and multiply them at the end ? > Also, you could add checks for possible overflows/truncation in the > computation/store (e.g. a user could specify 4194304K (SIZE_MAX/1024 > + 1), quite unlikely but still possible!). This might be a bit > overkill though... Do you have an idea in mind on ho to do this ? > Could you also add a default case with perhaps ERR() or assert()? Like earlier, we are safe because we passed the regex test. But it's still good idea to add this default to catch eventual dev mistakes. >> + ret = 1; >> [...] >> + regfree(®ex); >> + return 1; > > ret seems to be unused here. Maybe you meant return ret? Oops. > You might also want to add negative numbers and large number testcases > to your unit tests. Of course. > Looking forward to the corrected patch + unit tests :). > > Thanks! > > Christian > > P.S.: This new feature seems in part related to bug #228 [1]. > > [1] - http://stackoverflow.com/questions/3792663/atol-v-s-strtol > [2] - http://bugs.lttng.org/issues/228 Thanks for the comments. Simon [1] http://en.wikipedia.org/wiki/Regular_expression#POSIX_Basic_Regular_Expressions From simon.marchi at polymtl.ca Tue Apr 2 23:38:29 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Tue, 2 Apr 2013 23:38:29 -0400 Subject: [lttng-dev] [PATCH lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <515B9986.7080802@polymtl.ca> References: <1364935514-11042-1-git-send-email-simon.marchi@polymtl.ca> <515B9986.7080802@polymtl.ca> Message-ID: On 2 April 2013 22:52, Rapha?l Beamonte wrote: > On 2013-04-02 16:45, Simon Marchi wrote: >> --subbuf-size accepts sizes such as: >> >> - 123 -> 123 >> - 123k or 123K -> 123 * 1024 >> - 123m or 123M -> 123 * 1024 * 1024 >> - 123g or 123G -> 123 * 1024 * 1024 * 1024 > > I don't really like using non-SI prefixes such as "K", "m" or "g" (well, > in fact "m" is an SI prefix but for milli, not mega). > I think that would be better to only use "k", "M" and "G". Agreed. I'll do that. Simon From simon.marchi at polymtl.ca Wed Apr 3 03:16:02 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 3 Apr 2013 03:16:02 -0400 Subject: [lttng-dev] lttng-tools test suite problem Message-ID: Hello LTTng protagonists, Here is a more detailled description of the problem I have with the lttng-tools test suite. Suppose I want to write a unit test for the list_cmd_options function that is found in src/bin/lttng/utils.c. Based on existing tests, I would create the file tests/unit/test_list_cmd_options.c and add the following lines to tests/unit/Makefile.am: test_list_cmd_options_SOURCES = test_list_cmd_options.c \ $(top_srcdir)/src/bin/lttng/utils.c test_list_cmd_options_LDADD = $(LIBTAP) However, when I execute ./bootstrap, I get the following error: + [ ! -e config ] + autoreconf -i tests/unit/Makefile.am: object `utils.$(OBJEXT)' created by \ `$(top_srcdir)/src/bin/lttng/utils.c' and \ `$(top_srcdir)/src/common/utils.c' autoreconf: automake failed with exit status: 1 IIUC, it is caused by the fact that other tests use the similarly named $(top_srcdir)/src/common/utils.c. Object files for the unit tests are all created in the same directory, regardless of where they come from. It results that two files with the same name will clash. I kind of see two solutions for this: A- Create a folder for each unit test. This is cumbersome, because it will require creating a Makefile in each directory, which requires to modify configure.ac. If it's hard to add a test, there will be less tests, which is baaaaad. Also, a single test that needs stuff from two files that have the same name will face the same problem as right now. B- Use of option subdir-objects [1] [2]. Looks like a good solution, but it won't work for me, it gives weird behaviours... Thanks for looking into this. Testing ftw ! Simon [1] http://www.gnu.org/software/automake/manual/html_node/Program-and-Library-Variables.html [2] http://stackoverflow.com/questions/917948/automake-and-files-with-the-same-name From christian.babeux at efficios.com Wed Apr 3 12:39:17 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Wed, 3 Apr 2013 12:39:17 -0400 Subject: [lttng-dev] [PATCH lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: References: <1364935514-11042-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: Hi Simon, > I preferred not to use extended regex. + and ? is included in the > extended posix regexes [1]. I also prefer [0-9] over [:digit:], > because it is as clear and less characters, but I don't mind :). Alright, let's go with the one using basic POSIX regexes. >> atol() can return negative numbers and the result is stored in an >> unsigned (size_t). This could lead to enormous subbuffers allocated by >> accident. A check should be added to allow only positive numbers. >> >> Also, atol() does not detect conversion errors, returning 0 in error >> cases [1]. Perhaps using strtol() would be more appropriate? > > True. But here, we are safe because the regex test passed We know for > sure that we have a positive number that atol will correctly parse. Yes, indeed. Maybe adding an assert(*size > 0) could warn developers to pay attention when eventually moving code around. But the latter point is still unadressed: an error condition cannot be distinguished from the value "0". I would recommend using strtol() instead. > Do you want to return both values to the caller, or simply use two > intermediate variables and multiply them at the end ? Use two intermediate variables in a similar fashion: --- size_t user_size, computed_size; [...] user_size = atol(str); [...] switch (*(str + suffix_match.rm_so)) { case 'k': case 'K': computed_size = user_size * 1024; /* Maybe add overflow checks on computed_size here */ ret = 1; [...] /* If no error occurred */ *size = computed_size; return ret; --- >> Also, you could add checks for possible overflows/truncation in the >> computation/store (e.g. a user could specify 4194304K (SIZE_MAX/1024 >> + 1), quite unlikely but still possible!). This might be a bit >> overkill though... > > Do you have an idea in mind on ho to do this ? You could probably detect the overflow of the multiplication with this: if (user_size != 0 && computed_size / user_size != 1024) { /* Overflow, impendent doom, abort mission */ } Here a couple more comments on the patch: - Instead of hardcoding the constants 1024, 1024*1024, 1024*1024*1024, etc. you could add some defines for them. - Perhaps in a separate patch, the lttng(1) manpage should be updated to reflect the new options added to the cli (e.g. --subbuf-size SIZE[KMG]) Thanks! Christian On Tue, Apr 2, 2013 at 11:37 PM, Simon Marchi wrote: > On 2 April 2013 22:39, Christian Babeux wrote: >> Hi Simon, >> >>> I wanted to add some unit tests for parse_human_size, but the current >>> test system does not make it easy. They will come later. >> >> Could you describe the issues you had on a separate thread so we can >> further discuss it? > > Will do. > >> Here a few comments on your patch: >> >>> + char *buffer = malloc(length); >>> + >>> + if (buffer) { >>> + /* Get and print error message */ >>> + regerror(errcode, regex, buffer, length); >>> + ERR("%s\n", buffer); >>> + free(buffer); >>> + } >> >> What if malloc() fails? Printing an error message would be appropriate >> to handle that case. > > Ok. > >>> + /* Compile regex */ >>> + ret = regcomp(®ex, "^[0-9][0-9]*\\([kmg]\\{0,1\\}\\)$", REG_ICASE); >> >> This regex could be simplified to: "^[:digit:]+\\([kmg]\\)?$" > > I preferred not to use extended regex. + and ? is included in the > extended posix regexes [1]. I also prefer [0-9] over [:digit:], > because it is as clear and less characters, but I don't mind :). > >>> + *size = atol(str); >> >> atol() can return negative numbers and the result is stored in an >> unsigned (size_t). This could lead to enormous subbuffers allocated by >> accident. A check should be added to allow only positive numbers. >> >> Also, atol() does not detect conversion errors, returning 0 in error >> cases [1]. Perhaps using strtol() would be more appropriate? > > True. But here, we are safe because the regex test passed We know for > sure that we have a positive number that atol will correctly parse. > >>> + /* Check if there is a suffix */ >>> + regmatch_t suffix_match = matches[1]; >>> + if (suffix_match.rm_eo - suffix_match.rm_so > 0) { >>> + switch (*(str + suffix_match.rm_so)) { >>> + case 'k': >>> + case 'K': >>> + *size = *size * 1024; >>> + break; >>> + case 'm': >>> + case 'M': >>> + *size = *size * 1024 * 1024; >>> + break; >>> + case 'g': >>> + case 'G': >>> + *size = *size * 1024 * 1024 * 1024; >>> + break; >>> + } >> >> I think you could split the computation of the human size in two >> separate variables (size, computed_size perhaps?). > > Do you want to return both values to the caller, or simply use two > intermediate variables and multiply them at the end ? > >> Also, you could add checks for possible overflows/truncation in the >> computation/store (e.g. a user could specify 4194304K (SIZE_MAX/1024 >> + 1), quite unlikely but still possible!). This might be a bit >> overkill though... > > Do you have an idea in mind on ho to do this ? > >> Could you also add a default case with perhaps ERR() or assert()? > > Like earlier, we are safe because we passed the regex test. But it's > still good idea to add this default to catch eventual dev mistakes. > >>> + ret = 1; >>> [...] >>> + regfree(®ex); >>> + return 1; >> >> ret seems to be unused here. Maybe you meant return ret? > > Oops. > >> You might also want to add negative numbers and large number testcases >> to your unit tests. > > Of course. > >> Looking forward to the corrected patch + unit tests :). >> >> Thanks! >> >> Christian >> >> P.S.: This new feature seems in part related to bug #228 [1]. >> >> [1] - http://stackoverflow.com/questions/3792663/atol-v-s-strtol >> [2] - http://bugs.lttng.org/issues/228 > > Thanks for the comments. > > Simon > > [1] http://en.wikipedia.org/wiki/Regular_expression#POSIX_Basic_Regular_Expressions From christian.babeux at efficios.com Wed Apr 3 12:49:42 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Wed, 3 Apr 2013 12:49:42 -0400 Subject: [lttng-dev] lttng-tools test suite problem In-Reply-To: References: Message-ID: Hi Simon, > A- Create a folder for each unit test. This is cumbersome, because it > will require creating a Makefile in each directory, which requires to > modify configure.ac. If it's hard to add a test, there will be less > tests, which is baaaaad. Also, a single test that needs stuff from two > files that have the same name will face the same problem as right now. Agreed. > B- Use of option subdir-objects [1] [2]. Looks like a good solution, > but it won't work for me, it gives weird behaviours... I would advocate for this option. Could you describe the issues you encountered using subdirs-objects? Thanks, Christian On Wed, Apr 3, 2013 at 3:16 AM, Simon Marchi wrote: > > Hello LTTng protagonists, > > Here is a more detailled description of the problem I have with the > lttng-tools test suite. > > Suppose I want to write a unit test for the list_cmd_options function > that is found in src/bin/lttng/utils.c. Based on existing tests, I > would create the file tests/unit/test_list_cmd_options.c and add the > following lines to tests/unit/Makefile.am: > > test_list_cmd_options_SOURCES = test_list_cmd_options.c \ > $(top_srcdir)/src/bin/lttng/utils.c > test_list_cmd_options_LDADD = $(LIBTAP) > > However, when I execute ./bootstrap, I get the following error: > > + [ ! -e config ] > + autoreconf -i > tests/unit/Makefile.am: object `utils.$(OBJEXT)' created by \ > `$(top_srcdir)/src/bin/lttng/utils.c' and \ > `$(top_srcdir)/src/common/utils.c' > autoreconf: automake failed with exit status: 1 > > IIUC, it is caused by the fact that other tests use the similarly > named $(top_srcdir)/src/common/utils.c. Object files for the unit > tests are all created in the same directory, regardless of where they > come from. It results that two files with the same name will clash. > > I kind of see two solutions for this: > > A- Create a folder for each unit test. This is cumbersome, because it > will require creating a Makefile in each directory, which requires to > modify configure.ac. If it's hard to add a test, there will be less > tests, which is baaaaad. Also, a single test that needs stuff from two > files that have the same name will face the same problem as right now. > B- Use of option subdir-objects [1] [2]. Looks like a good solution, > but it won't work for me, it gives weird behaviours... > > Thanks for looking into this. Testing ftw ! > > Simon > > [1] http://www.gnu.org/software/automake/manual/html_node/Program-and-Library-Variables.html > [2] http://stackoverflow.com/questions/917948/automake-and-files-with-the-same-name > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From matthew.khouzam at ericsson.com Wed Apr 3 14:06:10 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Wed, 3 Apr 2013 14:06:10 -0400 Subject: [lttng-dev] Error using add-context for perf counters In-Reply-To: <5148B66A.6080007@ericsson.com> References: <5148B66A.6080007@ericsson.com> Message-ID: <515C6F92.5060803@ericsson.com> Hi, I can confirm this bug, Has anyone else tried it? On 13-03-19 03:03 PM, Bernd Hufmann wrote: > Hello > > I cannot add contexts for perf counters using lttng-tools v2.1.1 and I > get an error (see below). When using lttng-tools 2.0.5 (on a different > computer) it works. Could somebody from lttng development team look > into that? > > Thanks > Bernd > > ---------------------------------------------------------------------- > > lttng create mySession > Session mySession created. > Traces will be written in > /home/bernd/lttng-traces/mySession-20130319-145021 > > > lttng enable-event -a -k > All kernel events are enabled in channel channel0 > > > lttng add-context -k -t perf:branch-misses -t perf:cache-misses > PERROR: add context ioctl: Invalid argument [in > kernel_add_channel_context() at kernel.c:47] > Error: perf:cache-misses: Add kernel context failed > PERROR: add context ioctl: Invalid argument [in > kernel_add_channel_context() at kernel.c:47] > Error: perf:branch-misses: Add kernel context failed > Warning: Some command(s) went wrong > > ----------------------------------------------------------------------- > My setup is: > Ubuntu 12.04 with kernel 3.2.0-38 > lttng-modules v2.1.1 > lttng-tools v2.1.1 > > > From simon.marchi at polymtl.ca Wed Apr 3 14:28:53 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 3 Apr 2013 14:28:53 -0400 Subject: [lttng-dev] lttng-tools test suite problem In-Reply-To: References: Message-ID: On 3 April 2013 12:49, Christian Babeux wrote: > I would advocate for this option. Could you describe the issues you > encountered using subdirs-objects? Let's try to add AUTOMAKE_OPTIONS = subdir-objects at the top of tests/unit/Makefile.am. ./bootstrap and ./configure go fine. When "making", here is the result: http://pastebin.com/QzcTuFpB. Notice the complain "../../src/common/.deps/error.Po: No such file or directory" ? This is what tests/unit looks like: $ tree -a tests/unit tests/unit |-- .deps | |-- test_kernel_data.Po | |-- test_session.Po | |-- test_uri.Po | `-- test_ust_data.Po |-- Makefile |-- Makefile.am |-- Makefile.in |-- test_kernel_data.c |-- test_session.c |-- test_uri.c |-- test_ust_data.c `-- $(top_srcdir) `-- src |-- bin | `-- lttng-sessiond | `-- .deps | |-- buffer-registry.Po | |-- consumer.Po | |-- fd-limit.Po | |-- health.Po | |-- session.Po | |-- trace-kernel.Po | |-- trace-ust.Po | |-- ust-app.Po | |-- ust-consumer.Po | |-- ust-metadata.Po | `-- ust-registry.Po `-- common `-- .deps |-- error.Po |-- uri.Po `-- utils.Po 8 directories, 25 files Yep, there is a directory named $(top_srcdir). It comes from the path of the files in Makefile.am that contains $(top_srcdir). And it contains the files that were not found earlier. If I do a $ cp -a tests/unit/\$\(top_srcdir\)/src . it places the files at the right place. I can do make again and it completes successfully. I then tried to replace instances of $(top_srcdir) in tests/unit/Makefile.am by "../..". The objects files will then be placed in the same directory as the source file and everything looks good. The problem I see though is that the resulting object files overwrite the objects previously built when make passed in the source folder. Maybe this can create problems if we want to compile tests with different flags than the main libs and executables. Finally, an idea just like that: instead of specifying the source file, would it be possible to specify directly the object file (e.g. $(top_srcdir)/src/bin/lttng/utils.o or ../../src/bin/lttng/utils.o) in LDADD ? So the unit test Makefile would not recompile the unit under test, but just link with the object that is already built ? Simon From simon.marchi at polymtl.ca Wed Apr 3 14:38:52 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 3 Apr 2013 14:38:52 -0400 Subject: [lttng-dev] lttng-tools test suite problem In-Reply-To: References: Message-ID: On 3 April 2013 14:28, Simon Marchi wrote: > Finally, an idea just like that: instead of specifying the source > file, would it be possible to specify directly the object file (e.g. > $(top_srcdir)/src/bin/lttng/utils.o or ../../src/bin/lttng/utils.o) in > LDADD ? So the unit test Makefile would not recompile the unit under > test, but just link with the object that is already built ? Hmm, preliminary tests indicate it would work. Example tests/unit/Makefile.am: http://paste.ubuntu.com/5674448/ From Daniel.Thibault at drdc-rddc.gc.ca Wed Apr 3 15:36:21 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Wed, 3 Apr 2013 19:36:21 +0000 Subject: [lttng-dev] [PATCH lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D04580@VAL-E-02.valcartier.drdc-rddc.gc.ca> >>> --subbuf-size accepts sizes such as: >>> >>> - 123 -> 123 >>> - 123k or 123K -> 123 * 1024 >>> - 123m or 123M -> 123 * 1024 * 1024 >>> - 123g or 123G -> 123 * 1024 * 1024 * 1024 >> >> I don't really like using non-SI prefixes such as "K", "m" or "g" >> (well, in fact "m" is an SI prefix but for milli, not mega). >> I think that would be better to only use "k", "M" and "G". > >Agreed. I'll do that. >Simon Normally I'd be the first to advocate k, M, G as powers of 10 and Ki, Mi, Gi as powers of two (ISO/IEC 80000-13:2008) but the kernel parameters use exclusively K, M, and G in the powers of two sense, and I believe just about every other part of Linux does also. We should thus, somewhat unfortunately, stick to powers of two. Just be sure to explicitly give the multipliers' values in the help. Oh, and accept just the upper-case letters, like the kernel parameters do. 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 From simon.marchi at polymtl.ca Wed Apr 3 15:55:15 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 3 Apr 2013 15:55:15 -0400 Subject: [lttng-dev] [PATCH lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD12D04580@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD12D04580@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: > Normally I'd be the first to advocate k, M, G as powers of 10 and Ki, Mi, Gi as powers of two (ISO/IEC 80000-13:2008) but the kernel parameters use exclusively K, M, and G in the powers of two sense, and I believe just about every other part of Linux does also. We should thus, somewhat unfortunately, stick to powers of two. Just be sure to explicitly give the multipliers' values in the help. Oh, and accept just the upper-case letters, like the kernel parameters do. Yeah.. we need to accept capital K for kilo (kibi) because everyone else does. Actually I was thinking of mimicking the behaviour of dd. For kilo (kibi), you can use upper and lower case (probably reeks of when there was no such things as lower case letters in computing. I look at you FORTRAN). But for mega (mibi) and giga (gibi), it's upper case only. The more I think about it, the more I think it doesn't matter if we accept upper and lower case for all... I don't know anybody who will request a buffer of 32 millibytes. From raphael.beamonte at polymtl.ca Wed Apr 3 19:13:51 2013 From: raphael.beamonte at polymtl.ca (=?ISO-8859-1?Q?Rapha=EBl_Beamonte?=) Date: Wed, 3 Apr 2013 19:13:51 -0400 Subject: [lttng-dev] [PATCH lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: References: <48CF5AC71E61DB46B70D0F388054EFFD12D04580@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: 2013/4/3 Simon Marchi > > Normally I'd be the first to advocate k, M, G as powers of 10 and Ki, > Mi, Gi as powers of two (ISO/IEC 80000-13:2008) but the kernel parameters > use exclusively K, M, and G in the powers of two sense, and I believe just > about every other part of Linux does also. We should thus, somewhat > unfortunately, stick to powers of two. Just be sure to explicitly give the > multipliers' values in the help. Oh, and accept just the upper-case > letters, like the kernel parameters do. > > Yeah.. we need to accept capital K for kilo (kibi) because everyone > else does. Actually I was thinking of mimicking the behaviour of dd. > For kilo (kibi), you can use upper and lower case (probably reeks of > when there was no such things as lower case letters in computing. I > look at you FORTRAN). But for mega (mibi) and giga (gibi), it's upper > case only. > > The more I think about it, the more I think it doesn't matter if we > accept upper and lower case for all... I don't know anybody who will > request a buffer of 32 millibytes. I guess we could follow the "dd" way of work : BLOCKS and BYTES may be followed by the following multiplicative suffixes: c =1, w =2, b =512, kB =1000, K =1024, MB =1000*1000, M =1024*1024, xM =M GB =1000*1000*1000, G =1024*1024*1024, and so on for T, P, E, Z, Y. -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.marchi at polymtl.ca Wed Apr 3 21:30:47 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 3 Apr 2013 21:30:47 -0400 Subject: [lttng-dev] [PATCH v2 lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size Message-ID: <1365039047-22417-1-git-send-email-simon.marchi@polymtl.ca> --subbuf-size accepts sizes such as: - 123 -> 123 - 123k -> 123 * 1024 - 123M -> 123 * 1024 * 1024 - 123G -> 123 * 1024 * 1024 * 1024 It uses the new parse_human_size function, which could probably be used at other places, such as tracefile size. I wanted to add some unit tests for parse_human_size, but the current test system does not make it easy. They will come later. Signed-off-by: Simon Marchi --- src/bin/lttng/commands/enable_channels.c | 21 ++++- src/bin/lttng/utils.c | 129 +++++++++++++++++++++++++++++- src/bin/lttng/utils.h | 6 ++ 3 files changed, 152 insertions(+), 4 deletions(-) diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index d026af4..c2e9c89 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 (!parse_human_size(opt_arg, &chan.attr.subbuf_size)) { + 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/bin/lttng/utils.c b/src/bin/lttng/utils.c index b7f5170..d17fa9c 100644 --- a/src/bin/lttng/utils.c +++ b/src/bin/lttng/utils.c @@ -16,9 +16,11 @@ */ #define _GNU_SOURCE -#include +#include #include #include +#include +#include #include @@ -77,3 +79,128 @@ void list_cmd_options(FILE *ofp, struct poptOption *options) } } } + +/** + * 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. + */ +void regex_print_error(int errcode, regex_t *regex) +{ + /* Get length of error message and allocate accordingly */ + size_t length = regerror(errcode, regex, NULL, 0); + char *buffer = malloc(length); + + if (buffer) { + /* Get and print error message */ + regerror(errcode, regex, buffer, length); + ERR("regex error: %s\n", buffer); + free(buffer); + } else { + ERR("regex_print_error: malloc failed"); + } +} + +/** + * Parse a string that represents a size in human readable format. It + * support decimal integers suffixed by 'k', 'M' or 'G'. + * + * The suffix multiply the integer by: + * 'k': 1024 + * 'M': 1024 * 1024 + * 'G': 1024 * 1024 * 1024 + * + * @param str The string to parse. + * @param size Pointer to a size_t that will be filled with the + * resulting size. + * + * @return 1 on success, 0 on failure. + */ +int parse_human_size(char *str, uint64_t *size) +{ + regex_t regex; + int ret; + const int nmatch = 2; + regmatch_t matches[nmatch]; + + if (!str) + return 0; + + /* Compile regex */ + ret = regcomp(®ex, "^[0-9][0-9]*\\([kKMG]\\{0,1\\}\\)$", 0); + + /* Check for regex error */ + if (ret != 0) { + regex_print_error(ret, ®ex); + + ret = 0; + goto end; + } + + /* Match regex */ + ret = regexec(®ex, str, nmatch, matches, 0); + if (ret == 0) { + /* There is a match ! */ + long long base_size; + long multiplier = 1; + errno = 0; + base_size = strtoll(str, NULL, 10); + + /* Check result of conversion */ + if (errno == ERANGE) { + ERR("parse_human_size: the value %s caused strtol to overflow. " + "Please use a smaller numerical value.", str); + ret = 0; + goto end; + } else if (errno == EINVAL) { + ERR("parse_human_size: strtol failed (%s)", str); + ret = 0; + goto end; + } + + /* We should be safe because of the regex */ + assert(base_size > 0); + + /* Check if there is a suffix */ + regmatch_t suffix_match = matches[1]; + if (suffix_match.rm_eo - suffix_match.rm_so > 0) { + switch (*(str + suffix_match.rm_so)) { + case 'K': + case 'k': + multiplier = KIBI; + break; + case 'M': + multiplier = MEBI; + break; + case 'G': + multiplier = GIBI; + break; + default: + ERR("parse_human_size: invalid suffix"); + ret = 0; + goto end; + } + } + + *size = base_size * multiplier; + + /* Check for overflow */ + if (*size / base_size != multiplier) { + ERR("parse_human_size: oops, overflow detected."); + ret = 0; + goto end; + } + + ret = 1; + goto end; + } else { + /* There is no match (or error) */ + ret = 0; + goto end; + } + +end: + regfree(®ex); + return ret; +} diff --git a/src/bin/lttng/utils.h b/src/bin/lttng/utils.h index 9f7bfcc..cb57b93 100644 --- a/src/bin/lttng/utils.h +++ b/src/bin/lttng/utils.h @@ -19,8 +19,14 @@ #define _LTTNG_UTILS_H #include +#include + +#define KIBI 1024 +#define MEBI (1024 * 1024) +#define GIBI (1024 * 1024 * 1024) char *get_session_name(void); void list_cmd_options(FILE *ofp, struct poptOption *options); +int parse_human_size(char *str, uint64_t *size); #endif /* _LTTNG_UTILS_H */ -- 1.7.1 From simon.marchi at polymtl.ca Wed Apr 3 21:33:04 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 3 Apr 2013 21:33:04 -0400 Subject: [lttng-dev] [PATCH v2 lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <1365039047-22417-1-git-send-email-simon.marchi@polymtl.ca> References: <1365039047-22417-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: Forgot to mention changes in v2: * Use single exit point * Use intermediate variables in size * Change atoll to strtoll and add error check * Changed return type to int * Change result size type to uint64_t (matches LTTng type) * Modify popt subbuf-size argument type to string Thanks, Simon On 3 April 2013 21:30, Simon Marchi wrote: > --subbuf-size accepts sizes such as: > > - 123 -> 123 > - 123k -> 123 * 1024 > - 123M -> 123 * 1024 * 1024 > - 123G -> 123 * 1024 * 1024 * 1024 > > It uses the new parse_human_size function, which could probably be used > at other places, such as tracefile size. > > I wanted to add some unit tests for parse_human_size, but the current > test system does not make it easy. They will come later. > > Signed-off-by: Simon Marchi > --- > src/bin/lttng/commands/enable_channels.c | 21 ++++- > src/bin/lttng/utils.c | 129 +++++++++++++++++++++++++++++- > src/bin/lttng/utils.h | 6 ++ > 3 files changed, 152 insertions(+), 4 deletions(-) > > diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c > index d026af4..c2e9c89 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 (!parse_human_size(opt_arg, &chan.attr.subbuf_size)) { > + 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/bin/lttng/utils.c b/src/bin/lttng/utils.c > index b7f5170..d17fa9c 100644 > --- a/src/bin/lttng/utils.c > +++ b/src/bin/lttng/utils.c > @@ -16,9 +16,11 @@ > */ > > #define _GNU_SOURCE > -#include > +#include > #include > #include > +#include > +#include > > #include > > @@ -77,3 +79,128 @@ void list_cmd_options(FILE *ofp, struct poptOption *options) > } > } > } > + > +/** > + * 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. > + */ > +void regex_print_error(int errcode, regex_t *regex) > +{ > + /* Get length of error message and allocate accordingly */ > + size_t length = regerror(errcode, regex, NULL, 0); > + char *buffer = malloc(length); > + > + if (buffer) { > + /* Get and print error message */ > + regerror(errcode, regex, buffer, length); > + ERR("regex error: %s\n", buffer); > + free(buffer); > + } else { > + ERR("regex_print_error: malloc failed"); > + } > +} > + > +/** > + * Parse a string that represents a size in human readable format. It > + * support decimal integers suffixed by 'k', 'M' or 'G'. > + * > + * The suffix multiply the integer by: > + * 'k': 1024 > + * 'M': 1024 * 1024 > + * 'G': 1024 * 1024 * 1024 > + * > + * @param str The string to parse. > + * @param size Pointer to a size_t that will be filled with the > + * resulting size. > + * > + * @return 1 on success, 0 on failure. > + */ > +int parse_human_size(char *str, uint64_t *size) > +{ > + regex_t regex; > + int ret; > + const int nmatch = 2; > + regmatch_t matches[nmatch]; > + > + if (!str) > + return 0; > + > + /* Compile regex */ > + ret = regcomp(®ex, "^[0-9][0-9]*\\([kKMG]\\{0,1\\}\\)$", 0); > + > + /* Check for regex error */ > + if (ret != 0) { > + regex_print_error(ret, ®ex); > + > + ret = 0; > + goto end; > + } > + > + /* Match regex */ > + ret = regexec(®ex, str, nmatch, matches, 0); > + if (ret == 0) { > + /* There is a match ! */ > + long long base_size; > + long multiplier = 1; > + errno = 0; > + base_size = strtoll(str, NULL, 10); > + > + /* Check result of conversion */ > + if (errno == ERANGE) { > + ERR("parse_human_size: the value %s caused strtol to overflow. " > + "Please use a smaller numerical value.", str); > + ret = 0; > + goto end; > + } else if (errno == EINVAL) { > + ERR("parse_human_size: strtol failed (%s)", str); > + ret = 0; > + goto end; > + } > + > + /* We should be safe because of the regex */ > + assert(base_size > 0); > + > + /* Check if there is a suffix */ > + regmatch_t suffix_match = matches[1]; > + if (suffix_match.rm_eo - suffix_match.rm_so > 0) { > + switch (*(str + suffix_match.rm_so)) { > + case 'K': > + case 'k': > + multiplier = KIBI; > + break; > + case 'M': > + multiplier = MEBI; > + break; > + case 'G': > + multiplier = GIBI; > + break; > + default: > + ERR("parse_human_size: invalid suffix"); > + ret = 0; > + goto end; > + } > + } > + > + *size = base_size * multiplier; > + > + /* Check for overflow */ > + if (*size / base_size != multiplier) { > + ERR("parse_human_size: oops, overflow detected."); > + ret = 0; > + goto end; > + } > + > + ret = 1; > + goto end; > + } else { > + /* There is no match (or error) */ > + ret = 0; > + goto end; > + } > + > +end: > + regfree(®ex); > + return ret; > +} > diff --git a/src/bin/lttng/utils.h b/src/bin/lttng/utils.h > index 9f7bfcc..cb57b93 100644 > --- a/src/bin/lttng/utils.h > +++ b/src/bin/lttng/utils.h > @@ -19,8 +19,14 @@ > #define _LTTNG_UTILS_H > > #include > +#include > + > +#define KIBI 1024 > +#define MEBI (1024 * 1024) > +#define GIBI (1024 * 1024 * 1024) > > char *get_session_name(void); > void list_cmd_options(FILE *ofp, struct poptOption *options); > +int parse_human_size(char *str, uint64_t *size); > > #endif /* _LTTNG_UTILS_H */ > -- > 1.7.1 > From mathieu.desnoyers at efficios.com Sat Apr 6 04:26:14 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Sat, 6 Apr 2013 04:26:14 -0400 Subject: [lttng-dev] [PATCH v2 lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <1365039047-22417-1-git-send-email-simon.marchi@polymtl.ca> References: <1365039047-22417-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: <20130406082614.GA25199@Krystal> * Simon Marchi (simon.marchi at polymtl.ca) wrote: > --subbuf-size accepts sizes such as: > > - 123 -> 123 > - 123k -> 123 * 1024 > - 123M -> 123 * 1024 * 1024 > - 123G -> 123 * 1024 * 1024 * 1024 > > It uses the new parse_human_size function, which could probably be used > at other places, such as tracefile size. > > I wanted to add some unit tests for parse_human_size, but the current > test system does not make it easy. They will come later. Please make sure the test system modifications are in place, and the tests are present, before this patch gets merged. As long as this patch is not submitted for inclusion, but rather for comments, please use [RFC PATCH lttng-tools] tag, to make it clear that it is not submitted for merge in its current state. More comments below, > > Signed-off-by: Simon Marchi > --- > src/bin/lttng/commands/enable_channels.c | 21 ++++- > src/bin/lttng/utils.c | 129 +++++++++++++++++++++++++++++- > src/bin/lttng/utils.h | 6 ++ > 3 files changed, 152 insertions(+), 4 deletions(-) > > diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c > index d026af4..c2e9c89 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 (!parse_human_size(opt_arg, &chan.attr.subbuf_size)) { parse_human_size() -> parse_size_suffix() ? > + 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/bin/lttng/utils.c b/src/bin/lttng/utils.c > index b7f5170..d17fa9c 100644 > --- a/src/bin/lttng/utils.c > +++ b/src/bin/lttng/utils.c > @@ -16,9 +16,11 @@ > */ > > #define _GNU_SOURCE > -#include > +#include > #include > #include > +#include > +#include any reason why stdlib is moved here ? > > #include > > @@ -77,3 +79,128 @@ void list_cmd_options(FILE *ofp, struct poptOption *options) > } > } > } > + > +/** > + * 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 ... > +void regex_print_error(int errcode, regex_t *regex) > +{ > + /* Get length of error message and allocate accordingly */ > + size_t length = regerror(errcode, regex, NULL, 0); > + char *buffer = malloc(length); > + > + if (buffer) { we try to minimize indentation of code. if (!buffer) { ERR("regex_print_error: malloc failed"); return; } and then continue with the OK path. > + /* Get and print error message */ > + regerror(errcode, regex, buffer, length); > + ERR("regex error: %s\n", buffer); > + free(buffer); > + } else { > + ERR("regex_print_error: malloc failed"); > + } > +} > + > +/** > + * Parse a string that represents a size in human readable format. It > + * support decimal integers suffixed by 'k', 'M' or 'G'. supports > + * > + * The suffix multiply the integer by: > + * 'k': 1024 > + * 'M': 1024 * 1024 > + * 'G': 1024 * 1024 * 1024 > + * > + * @param str The string to parse. > + * @param size Pointer to a size_t that will be filled with the > + * resulting size. > + * > + * @return 1 on success, 0 on failure. The rest of lttng-tools uses 0 for success, negative error code for failure. Please follow this style. > + */ > +int parse_human_size(char *str, uint64_t *size) > +{ > + regex_t regex; > + int ret; > + const int nmatch = 2; > + regmatch_t matches[nmatch]; > + > + if (!str) > + return 0; > + > + /* Compile regex */ > + ret = regcomp(®ex, "^[0-9][0-9]*\\([kKMG]\\{0,1\\}\\)$", 0); > + > + /* Check for regex error */ > + if (ret != 0) { > + regex_print_error(ret, ®ex); > + > + ret = 0; > + goto end; > + } > + > + /* Match regex */ > + ret = regexec(®ex, str, nmatch, matches, 0); > + if (ret == 0) { please perform error checking here, and don't indent the entire OK path afterward. > + /* There is a match ! */ > + long long base_size; > + long multiplier = 1; unsigned int shift = 0; > + errno = 0; > + base_size = strtoll(str, NULL, 10); why long long, and why strtoll ? See strtoull((3). > + > + /* Check result of conversion */ > + if (errno == ERANGE) { > + ERR("parse_human_size: the value %s caused strtol to overflow. " > + "Please use a smaller numerical value.", str); You should use PERROR() macro or something like this. > + ret = 0; > + goto end; > + } else if (errno == EINVAL) { > + ERR("parse_human_size: strtol failed (%s)", str); You should use PERROR() macro or something like this. > + ret = 0; > + goto end; > + } please print a PERROR even if a different errno is encountered, just in case. The man pages are known to sometimes have an incomplete list of error values. > + > + /* We should be safe because of the regex */ > + assert(base_size > 0); with strtoull this assert won't be needed. > + > + /* Check if there is a suffix */ > + regmatch_t suffix_match = matches[1]; > + if (suffix_match.rm_eo - suffix_match.rm_so > 0) { A check like: if (suffix_match.rm_eo - suffix_match.rm_so == 1) { would make doubly sure that we're only matching one character, and would seem more robust. > + switch (*(str + suffix_match.rm_so)) { > + case 'K': > + case 'k': > + multiplier = KIBI; shift = KIBI_LOG2; > + break; > + case 'M': > + multiplier = MEBI; shift = MEBI_LOG2; > + break; > + case 'G': > + multiplier = GIBI; shift = GIBI_LOG2; > + break; > + default: > + ERR("parse_human_size: invalid suffix"); > + ret = 0; > + goto end; > + } > + } > + > + *size = base_size * multiplier; *size = base_size << shift; > + > + /* Check for overflow */ > + if (*size / base_size != multiplier) { Divisions are painful of a number of architectures (especially embedded), and usually slow. Division and modulo should not be used unless absolutely necessary. Here, moving from multiplication/division to shift allow us to perform this check using a simple shift rather than a division: if ((*size >> shift) != base_size) { > + ERR("parse_human_size: oops, overflow detected."); > + ret = 0; > + goto end; > + } > + > + ret = 1; > + goto end; > + } else { > + /* There is no match (or error) */ > + ret = 0; > + goto end; > + } > + > +end: > + regfree(®ex); > + return ret; > +} > diff --git a/src/bin/lttng/utils.h b/src/bin/lttng/utils.h > index 9f7bfcc..cb57b93 100644 > --- a/src/bin/lttng/utils.h > +++ b/src/bin/lttng/utils.h > @@ -19,8 +19,14 @@ > #define _LTTNG_UTILS_H > > #include > +#include > + > +#define KIBI 1024 > +#define MEBI (1024 * 1024) > +#define GIBI (1024 * 1024 * 1024) #define KIBI_LOG2 10 #define MEBI_LOG2 20 #define GIBI_LOG2 30 Thanks, Mathieu > > char *get_session_name(void); > void list_cmd_options(FILE *ofp, struct poptOption *options); > +int parse_human_size(char *str, uint64_t *size); > > #endif /* _LTTNG_UTILS_H */ > -- > 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 fdeslaur at gmail.com Mon Apr 8 01:19:17 2013 From: fdeslaur at gmail.com (Francis Deslauriers) Date: Mon, 8 Apr 2013 01:19:17 -0400 Subject: [lttng-dev] [RFC-Patch 1/2] Add page fault trace event definitions Message-ID: <1365398358-23374-1-git-send-email-fdeslaur@gmail.com> Add page_fault_entry and page_fault_exit event definitions. It will allow each architecture to instrument their page faults. Signed-off-by: Francis Deslauriers Reviewed-by: Rapha?l Beamonte --- include/trace/events/fault.h | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 include/trace/events/fault.h diff --git a/include/trace/events/fault.h b/include/trace/events/fault.h new file mode 100644 index 0000000..7256b40 --- /dev/null +++ b/include/trace/events/fault.h @@ -0,0 +1,51 @@ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM fault + +#if !defined(_TRACE_FAULT_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_FAULT_H + +#include + +TRACE_EVENT(page_fault_entry, + + TP_PROTO(struct pt_regs *regs, unsigned long address, + int write_access), + + TP_ARGS(regs, address, write_access), + + TP_STRUCT__entry( + __field( unsigned long, ip ) + __field( unsigned long, addr ) + __field( int, write ) + ), + + TP_fast_assign( + __entry->ip = regs ? instruction_pointer(regs) : 0UL; + __entry->addr = address; + __entry->write = write_access; + ), + + TP_printk("ip=%lu addr=%lu write_access=%d", + __entry->ip, __entry->addr, __entry->write) +); + +TRACE_EVENT(page_fault_exit, + + TP_PROTO(int result), + + TP_ARGS(result), + + TP_STRUCT__entry( + __field( int, res ) + ), + + TP_fast_assign( + __entry->res = result; + ), + + TP_printk("result=%d", __entry->res) +); + +#endif /* _TRACE_FAULT_H */ +/* This part must be outside protection */ +#include -- 1.7.10.4 From fdeslaur at gmail.com Mon Apr 8 01:19:18 2013 From: fdeslaur at gmail.com (Francis Deslauriers) Date: Mon, 8 Apr 2013 01:19:18 -0400 Subject: [lttng-dev] [RFC-Patch 2/2] x86:Instruments page fault trace event In-Reply-To: <1365398358-23374-1-git-send-email-fdeslaur@gmail.com> References: <1365398358-23374-1-git-send-email-fdeslaur@gmail.com> Message-ID: <1365398358-23374-2-git-send-email-fdeslaur@gmail.com> Signed-off-by: Francis Deslauriers Reviewed-by: Rapha?l Beamonte --- arch/x86/mm/fault.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 2b97525..f41a5a0 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -20,6 +20,9 @@ #include /* VSYSCALL_START */ #include /* exception_enter(), ... */ +#define CREATE_TRACE_POINTS +#include /* trace_page_fault_*(), ... */ + /* * Page fault error code bits: * @@ -1183,7 +1186,9 @@ good_area: * make sure we exit gracefully rather than endlessly redo * the fault: */ + trace_page_fault_entry(regs, address, write); fault = handle_mm_fault(mm, vma, address, flags); + trace_page_fault_exit(fault); if (unlikely(fault & (VM_FAULT_RETRY|VM_FAULT_ERROR))) { if (mm_fault_error(regs, error_code, address, fault)) -- 1.7.10.4 From mathieu.desnoyers at efficios.com Mon Apr 8 06:57:58 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 8 Apr 2013 06:57:58 -0400 Subject: [lttng-dev] [RFC-Patch 1/2] Add page fault trace event definitions In-Reply-To: <1365398358-23374-1-git-send-email-fdeslaur@gmail.com> References: <1365398358-23374-1-git-send-email-fdeslaur@gmail.com> Message-ID: <20130408105758.GA24595@Krystal> * Francis Deslauriers (fdeslaur at gmail.com) wrote: > Add page_fault_entry and page_fault_exit event definitions. It will > allow each architecture to instrument their page faults. > > Signed-off-by: Francis Deslauriers > Reviewed-by: Rapha?l Beamonte > --- > include/trace/events/fault.h | 51 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 51 insertions(+) > create mode 100644 include/trace/events/fault.h > > diff --git a/include/trace/events/fault.h b/include/trace/events/fault.h > new file mode 100644 > index 0000000..7256b40 > --- /dev/null > +++ b/include/trace/events/fault.h > @@ -0,0 +1,51 @@ > +#undef TRACE_SYSTEM > +#define TRACE_SYSTEM fault > + > +#if !defined(_TRACE_FAULT_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_FAULT_H > + > +#include > + > +TRACE_EVENT(page_fault_entry, > + > + TP_PROTO(struct pt_regs *regs, unsigned long address, > + int write_access), > + > + TP_ARGS(regs, address, write_access), > + > + TP_STRUCT__entry( > + __field( unsigned long, ip ) > + __field( unsigned long, addr ) > + __field( int, write ) uint8_t, write will save some space. > + ), > + > + TP_fast_assign( > + __entry->ip = regs ? instruction_pointer(regs) : 0UL; > + __entry->addr = address; > + __entry->write = write_access; Just to be clean, if we use uint8_t: __entry->write = !!write_access; It will map zero/nonzero values to 0 and 1, and thus ensure it can be represented on a uint8_t. Thanks, Mathieu > + ), > + > + TP_printk("ip=%lu addr=%lu write_access=%d", > + __entry->ip, __entry->addr, __entry->write) > +); > + > +TRACE_EVENT(page_fault_exit, > + > + TP_PROTO(int result), > + > + TP_ARGS(result), > + > + TP_STRUCT__entry( > + __field( int, res ) > + ), > + > + TP_fast_assign( > + __entry->res = result; > + ), > + > + TP_printk("result=%d", __entry->res) > +); > + > +#endif /* _TRACE_FAULT_H */ > +/* This part must be outside protection */ > +#include > -- > 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 Mon Apr 8 06:58:54 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 8 Apr 2013 06:58:54 -0400 Subject: [lttng-dev] [RFC-Patch 2/2] x86:Instruments page fault trace event In-Reply-To: <1365398358-23374-2-git-send-email-fdeslaur@gmail.com> References: <1365398358-23374-1-git-send-email-fdeslaur@gmail.com> <1365398358-23374-2-git-send-email-fdeslaur@gmail.com> Message-ID: <20130408105854.GB24595@Krystal> * Francis Deslauriers (fdeslaur at gmail.com) wrote: > Signed-off-by: Francis Deslauriers > Reviewed-by: Rapha?l Beamonte > --- > arch/x86/mm/fault.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c > index 2b97525..f41a5a0 100644 > --- a/arch/x86/mm/fault.c > +++ b/arch/x86/mm/fault.c > @@ -20,6 +20,9 @@ > #include /* VSYSCALL_START */ > #include /* exception_enter(), ... */ > > +#define CREATE_TRACE_POINTS > +#include /* trace_page_fault_*(), ... */ > + > /* > * Page fault error code bits: > * > @@ -1183,7 +1186,9 @@ good_area: > * make sure we exit gracefully rather than endlessly redo > * the fault: > */ > + trace_page_fault_entry(regs, address, write); > fault = handle_mm_fault(mm, vma, address, flags); > + trace_page_fault_exit(fault); If you look at the lttng 0.x instrumentation, I think there are other tracepoints in get user pages too ? Thanks, Mathieu > > if (unlikely(fault & (VM_FAULT_RETRY|VM_FAULT_ERROR))) { > if (mm_fault_error(regs, error_code, address, fault)) > -- > 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 simon.marchi at polymtl.ca Mon Apr 8 10:33:49 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Mon, 8 Apr 2013 10:33:49 -0400 Subject: [lttng-dev] [PATCH v2 lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <20130406082614.GA25199@Krystal> References: <1365039047-22417-1-git-send-email-simon.marchi@polymtl.ca> <20130406082614.GA25199@Krystal> Message-ID: >> #define _GNU_SOURCE >> -#include >> +#include >> #include >> #include >> +#include >> +#include > > any reason why stdlib is moved here ? I put them in alphabetical order instead of random order. Thanks for the comments, I will make the changes. From gbastien+lttng at versatic.net Mon Apr 8 10:53:35 2013 From: gbastien+lttng at versatic.net (=?UTF-8?q?Genevi=C3=A8ve=20Bastien?=) Date: Mon, 8 Apr 2013 10:53:35 -0400 Subject: [lttng-dev] [RFC-patch] Add support of variant (raw) metadata Message-ID: <1365432815-14887-1-git-send-email-gbastien+lttng@versatic.net> Add macros to allow to specify some raw metadata for a tracepoint event field. Add macros to copy dynamic length data without the length field with it, for instance for variant event types. Signed-off-by: Genevi?ve Bastien --- lttng-events.c | 7 +++++++ lttng-events.h | 4 ++++ probes/lttng-events-reset.h | 6 ++++++ probes/lttng-events.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+) diff --git a/lttng-events.c b/lttng-events.c index 4f30904..8ceecf5 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -654,6 +654,13 @@ int _lttng_field_statedump(struct lttng_session *session, " { encoding = ASCII; }" : "", field->name); break; + case atype_raw: + /* field contains raw metadata! No guarantee it is valid */ + ret = lttng_metadata_printf(session, + " %s _%s;\n", + field->type.u.raw.raw_data, + field->name); + break; default: WARN_ON_ONCE(1); return -EINVAL; diff --git a/lttng-events.h b/lttng-events.h index 09d5618..968e2a4 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -48,6 +48,7 @@ enum abstract_types { atype_array, atype_sequence, atype_string, + atype_raw, NR_ABSTRACT_TYPES, }; @@ -116,6 +117,9 @@ struct lttng_type { struct lttng_basic_type length_type; struct lttng_basic_type elem_type; } sequence; + struct { + char *raw_data; + } raw; } u; }; diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h index 7355e18..8c9cf4d 100644 --- a/probes/lttng-events-reset.h +++ b/probes/lttng-events-reset.h @@ -35,6 +35,9 @@ #undef __string #define __string(_item, _src) +#undef __variant_raw +#define __variant_raw(_item, _raw_metadata, _length) + #undef tp_assign #define tp_assign(dest, src) @@ -44,6 +47,9 @@ #undef tp_memcpy_dyn #define tp_memcpy_dyn(dest, src, len) +#undef tp_memcpy_var +#define tp_memcpy_var(dest, src, len) + #undef tp_strcpy #define tp_strcpy(dest, src) diff --git a/probes/lttng-events.h b/probes/lttng-events.h index 33cabcf..ce5b647 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -205,6 +205,21 @@ void trace_##_name(void *__data); #define __string_from_user(_item, _src) \ __string(_item, _src) +#undef __variant_raw +#define __variant_raw(_item, _raw_metadata, _length) \ + { \ + .name = #_item, \ + .type = \ + { \ + .atype = atype_raw, \ + .u.raw.raw_data = #_raw_metadata, \ + }, \ + }, + +#undef __variant_raw_from_user +#define __variant_raw_from_user(_item, _raw_metadata, _length) \ + __variant_raw(_item, _raw_metadata, _length) + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ @@ -353,6 +368,11 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { #define __string(_item, _src) \ __event_len += __dynamic_len[__dynamic_len_idx++] = strlen(_src) + 1; +#undef __variant_raw +#define __variant_raw(_item, _raw_metadata, _length) \ + __event_len += __dynamic_len[__dynamic_len_idx++] = (_length); + + /* * strlen_user includes \0. If returns 0, it faulted, so we set size to * 1 (\0 only). @@ -459,6 +479,10 @@ static inline size_t __event_get_align__##_name(_proto) \ #define __string_from_user(_item, _src) \ __string(_item, _src) +#undef __variant_raw +#define __variant_raw(_item, _raw_metadata, _length) \ + char *_item; + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args @@ -510,6 +534,11 @@ __end_field_##_item: #define __string_from_user(_item, _src) \ __string(_item, _src) +#undef __variant_raw +#define __variant_raw(_item, _raw_metadata, _length) \ + goto __assign_##_item; \ +__end_field_##_item: + /* * Macros mapping tp_assign() to "=", tp_memcpy() to memcpy() and tp_strcpy() to * strcpy(). @@ -566,6 +595,22 @@ __assign_##dest##_2: \ #define tp_memcpy_dyn_from_user(dest, src) \ tp_memcpy_dyn_gen(event_write_from_user, dest, src) +/* variable length sequence copy, with no size in metadata */ +#undef tp_memcpy_var_gen +#define tp_memcpy_var_gen(write_ops, dest, src) \ +__assign_##dest: \ + lib_ring_buffer_align_ctx(&__ctx, 8); \ + __chan->ops->write_ops(&__ctx, src, __get_dynamic_array_len(dest)); \ + goto __end_field_##dest; + +#undef tp_memcpy_var +#define tp_memcpy_var(dest, src) \ + tp_memcpy_var_gen(event_write, dest, src) + +#undef tp_memcpy_var_from_user +#define tp_memcpy_var_from_user(dest, src) \ + tp_memcpy_var_gen(event_write_from_user, dest, src) + /* * The string length including the final \0. */ -- 1.8.2 From simon.marchi at polymtl.ca Mon Apr 8 11:20:04 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Mon, 8 Apr 2013 11:20:04 -0400 Subject: [lttng-dev] [RFC PATCH lttng-tools] Unit tests: don't rebuild units under test Message-ID: <1365434404-11002-1-git-send-email-simon.marchi@polymtl.ca> 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) -- 1.7.10.4 From simon.marchi at polymtl.ca Mon Apr 8 12:40:09 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Mon, 8 Apr 2013 12:40:09 -0400 Subject: [lttng-dev] [RFC PATCH lttng-tools v3] lttng cli: Accept human readable sizes for --subbuf-size Message-ID: <1365439209-27624-1-git-send-email-simon.marchi@polymtl.ca> --subbuf-size accepts sizes such as: - 123 -> 123 - 123k -> 123 * 1024 - 123M -> 123 * 1024 * 1024 - 123G -> 123 * 1024 * 1024 * 1024 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 v3: * Changes following Mathieu Desnoyers' comments. - Function name parse_human_size -> parse_size_suffix - Replace division for bit shift, multipliers by log2 - Coding style issues. - strtoll -> strtoull * Unit tests (depends on fix of object names clash) src/bin/lttng/commands/enable_channels.c | 21 ++++- src/bin/lttng/utils.c | 123 +++++++++++++++++++++++++++++- src/bin/lttng/utils.h | 6 ++ tests/unit/Makefile.am | 15 +++- tests/unit/test_parse_size_suffix.c | 72 +++++++++++++++++ 5 files changed, 230 insertions(+), 7 deletions(-) create mode 100644 tests/unit/test_parse_size_suffix.c diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index d026af4..dbec8ab 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 (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/bin/lttng/utils.c b/src/bin/lttng/utils.c index b7f5170..cade12f 100644 --- a/src/bin/lttng/utils.c +++ b/src/bin/lttng/utils.c @@ -16,9 +16,11 @@ */ #define _GNU_SOURCE -#include +#include #include #include +#include +#include #include @@ -77,3 +79,122 @@ void list_cmd_options(FILE *ofp, struct poptOption *options) } } } + +/** + * 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 = regerror(errcode, regex, NULL, 0); + char *buffer = malloc(length); + + if (!buffer) { + ERR("regex_print_error: malloc 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 * 1024 + * 'G': 1024 * 1024 * 1024 + * + * @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 parse_size_suffix(char *str, uint64_t *size) +{ + regex_t regex; + int ret; + const int nmatch = 2; + regmatch_t matches[nmatch]; + + if (!str) + return 0; + + /* Compile regex */ + ret = regcomp(®ex, "^[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 end; + } + + /* There is a match ! */ + unsigned long long base_size; + long shift = 0; + errno = 0; + base_size = strtoll(str, NULL, 10); + + /* Check result of conversion */ + if (errno != 0) { + PERROR("strtoull"); + ret = -1; + goto end; + } + + /* Check if there is a suffix */ + regmatch_t suffix_match = matches[1]; + 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 end; + } + } + + *size = base_size << shift; + + /* Check for overflow */ + if ((*size >> shift) != base_size) { + ERR("parse_size_suffix: oops, overflow detected."); + ret = -1; + goto end; + } + + ret = 0; + goto end; + +end: + regfree(®ex); + return ret; +} diff --git a/src/bin/lttng/utils.h b/src/bin/lttng/utils.h index 9f7bfcc..12a72be 100644 --- a/src/bin/lttng/utils.h +++ b/src/bin/lttng/utils.h @@ -19,8 +19,14 @@ #define _LTTNG_UTILS_H #include +#include + +#define KIBI_LOG2 10 +#define MEBI_LOG2 20 +#define GIBI_LOG2 30 char *get_session_name(void); void list_cmd_options(FILE *ofp, struct poptOption *options); +int parse_size_suffix(char *str, uint64_t *size); #endif /* _LTTNG_UTILS_H */ diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 67e7fe4..5b49733 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_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 +PARSE_SIZE_SUFFIX=$(top_srcdir)/src/bin/lttng/utils.o \ + $(top_srcdir)/src/bin/lttng/conf.o + +test_parse_size_suffix_SOURCES = test_parse_size_suffix.c +test_parse_size_suffix_LDADD = $(LIBTAP) +test_parse_size_suffix_LDADD += $(PARSE_SIZE_SUFFIX) diff --git a/tests/unit/test_parse_size_suffix.c b/tests/unit/test_parse_size_suffix.c new file mode 100644 index 0000000..70ccb76 --- /dev/null +++ b/tests/unit/test_parse_size_suffix.c @@ -0,0 +1,72 @@ +/* + * 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 + +/* For lttngerr.h */ +int lttng_opt_quiet = 1; +int lttng_opt_verbose = 3; + +/* Valid test cases */ +static char *valid_tests_inputs[] = { "0", "1234", "16k", "128K", "32M", "1024G" }; +static uint64_t valid_tests_expected_results[] = {0, 1234, 16384, 131072, 33554432, 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]); + +void test_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, "testing %s", valid_tests_inputs[i]); + + ret = parse_size_suffix(valid_tests_inputs[i], &result); + ok(ret == 0 && result == valid_tests_expected_results[i], name); + } + + // Test invalid cases + for (i = 0; i < num_invalid_tests; i++) { + char name[100]; + sprintf(name, "testing %s", invalid_tests_inputs[i]); + + ret = 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("parse_size_suffix tests"); + + test_parse_size_suffix(); + + return exit_status(); +} -- 1.7.10.4 From christian.babeux at efficios.com Mon Apr 8 15:40:22 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Mon, 8 Apr 2013 15:40:22 -0400 Subject: [lttng-dev] The LTTng project accepted in the Google Summer of Code 2013 Message-ID: Hi lttng-ninjas, The LTTng project has been officially accepted in the Google Summer of Code 2013 program [1]. In the upcoming weeks, prospective students will begin to interact with the LTTng community. Interested students can consult the LTTng project idea page on the Wiki [2]. We are looking forward to receive the students questions and projects proposals! Thanks, Christian [1] - https://google-melange.appspot.com/gsoc/org/google/gsoc2013/lttng [2] - http://bugs.lttng.org/projects/lttng/wiki/Google_Summer_of_Code_2013 From simarpreet007 at gmail.com Mon Apr 8 23:41:38 2013 From: simarpreet007 at gmail.com (Simarpreet Singh) Date: Mon, 8 Apr 2013 23:41:38 -0400 Subject: [lttng-dev] Bugfix: Bug #453 Message-ID: Hello everyone, This is Simar here, I'm an undergraduate student from Canada. I was going through the bugtracker for lttng-tools repo as I'm interested in working on a project for GSOC 2013 and found a bug that I could fix. It's pretty simple nothing much really. Below are the details: Bug: #453 URL: http://bugs.lttng.org/issues/453 Title: "Stoping" typo (and a few more) Fix: I currently have it on my repo, here's the link: https://github.com/simar7/lttng-tools I've forked the lttng-tools repo from github and have a working copy on my account. For the timebeing I've made the changes there. I've attached a copy of the diff file with this email. The following are my questions: 1) How do you I submit my changes to the lttng-tools repo? Do I need any kind of authorization before I can do so? 2) What timezone do you guys work in? I had a few questions to discuss regarding GSOC 2013 in details and I guess it's better to talk over IRC. I apologize if this is the wrong mailing-list to ask on, feel free to correct me! Thanks, Simar -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- diff --git src/common/error.c src/common/error.c index 4fb022c..4b9b46e 100644 --- src/common/error.c +++ src/common/error.c @@ -40,7 +40,7 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_SESS_NOT_FOUND) ] = "Session name not found", [ ERROR_INDEX(LTTNG_ERR_FATAL) ] = "Fatal error of the session daemon", [ ERROR_INDEX(LTTNG_ERR_SELECT_SESS) ] = "A session MUST be selected", - [ ERROR_INDEX(LTTNG_ERR_EXIST_SESS) ] = "Session name already exist", + [ ERROR_INDEX(LTTNG_ERR_EXIST_SESS) ] = "Session name already exists", [ ERROR_INDEX(LTTNG_ERR_NO_EVENT) ] = "Event not found", [ ERROR_INDEX(LTTNG_ERR_CONNECT_FAIL) ] = "Unable to connect to Unix socket", [ ERROR_INDEX(LTTNG_ERR_EPERM) ] = "Permission denied", @@ -58,7 +58,7 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_KERN_DISABLE_FAIL) ] = "Disable kernel event failed", [ ERROR_INDEX(LTTNG_ERR_KERN_META_FAIL) ] = "Opening metadata failed", [ ERROR_INDEX(LTTNG_ERR_KERN_START_FAIL) ] = "Starting kernel trace failed", - [ ERROR_INDEX(LTTNG_ERR_KERN_STOP_FAIL) ] = "Stoping kernel trace failed", + [ ERROR_INDEX(LTTNG_ERR_KERN_STOP_FAIL) ] = "Stopping kernel trace failed", [ ERROR_INDEX(LTTNG_ERR_KERN_CONSUMER_FAIL) ] = "Kernel consumer start failed", [ ERROR_INDEX(LTTNG_ERR_KERN_STREAM_FAIL) ] = "Kernel create stream failed", [ ERROR_INDEX(LTTNG_ERR_KERN_LIST_FAIL) ] = "Listing kernel events failed", @@ -73,7 +73,7 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_UST_DISABLE_FAIL) ] = "Disable UST event failed", [ ERROR_INDEX(LTTNG_ERR_UST_META_FAIL) ] = "Opening metadata failed", [ ERROR_INDEX(LTTNG_ERR_UST_START_FAIL) ] = "Starting UST trace failed", - [ ERROR_INDEX(LTTNG_ERR_UST_STOP_FAIL) ] = "Stoping UST trace failed", + [ ERROR_INDEX(LTTNG_ERR_UST_STOP_FAIL) ] = "Stopping UST trace failed", [ ERROR_INDEX(LTTNG_ERR_UST_CONSUMER64_FAIL) ] = "64-bit UST consumer start failed", [ ERROR_INDEX(LTTNG_ERR_UST_CONSUMER32_FAIL) ] = "32-bit UST consumer start failed", [ ERROR_INDEX(LTTNG_ERR_UST_STREAM_FAIL) ] = "UST create stream failed", @@ -82,7 +82,7 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_UST_EVENT_NOT_FOUND)] = "UST event not found", [ ERROR_INDEX(LTTNG_ERR_UST_CONTEXT_EXIST)] = "UST context already exist", [ ERROR_INDEX(LTTNG_ERR_UST_CONTEXT_INVAL)] = "UST invalid context", - [ ERROR_INDEX(LTTNG_ERR_NEED_ROOT_SESSIOND) ] = "Tracing the kernel requires a root lttng-sessiond daemon and \"tracing\" group user membership", + [ ERROR_INDEX(LTTNG_ERR_NEED_ROOT_SESSIOND) ] = "Tracing the kernel requires a root lttng-sessiond daemon or \"tracing\" group user membership", [ ERROR_INDEX(LTTNG_ERR_TRACE_ALREADY_STARTED) ] = "Tracing already started", [ ERROR_INDEX(LTTNG_ERR_TRACE_ALREADY_STOPPED) ] = "Tracing already stopped", [ ERROR_INDEX(LTTNG_ERR_KERN_EVENT_ENOSYS) ] = "Kernel event type not supported", @@ -91,7 +91,7 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_NO_KERNCONSUMERD) ] = "No kernel consumer detected", [ ERROR_INDEX(LTTNG_ERR_EVENT_EXIST_LOGLEVEL) ] = "Event already enabled with different loglevel", [ ERROR_INDEX(LTTNG_ERR_URL_DATA_MISS) ] = "Missing data path URL", - [ ERROR_INDEX(LTTNG_ERR_URL_CTRL_MISS) ] = "Missing control data path URL", + [ ERROR_INDEX(LTTNG_ERR_URL_CTRL_MISS) ] = "Missing control path URL", [ ERROR_INDEX(LTTNG_ERR_ENABLE_CONSUMER_FAIL) ] = "Enabling consumer failed", [ ERROR_INDEX(LTTNG_ERR_RELAYD_CONNECT_FAIL) ] = "Unable to connect to lttng-relayd", [ ERROR_INDEX(LTTNG_ERR_RELAYD_VERSION_FAIL) ] = "Relay daemon not compatible", From simarpreet007 at gmail.com Tue Apr 9 00:09:35 2013 From: simarpreet007 at gmail.com (Simarpreet Singh) Date: Tue, 9 Apr 2013 00:09:35 -0400 Subject: [lttng-dev] Bugfix: Bug #488 Message-ID: Hello again, Sorry for the emails guys, I fixed a bunch of other typos in the codebase, I think these shall go under Bug #488. Bug URL: http://bugs.lttng.org/issues/488 Fix: https://github.com/simar7/lttng-tools/commit/6a6df32f6fadcb85a275b8ea93306af2d498c263 I've pushed my changes on my github account, I'll try to figure out the correct way to file them in the meantime. Thanks, Simar -------------- next part -------------- An HTML attachment was scrubbed... URL: From garvits45 at gmail.com Tue Apr 9 03:26:54 2013 From: garvits45 at gmail.com (garvit sharma) Date: Tue, 9 Apr 2013 12:56:54 +0530 Subject: [lttng-dev] Participating in gsoc'13 Message-ID: Hello All, Myself Garvit Sharma doing B.tec(third year) with majors in cse. I went through the project ideas and really want to spend my summer in writing codes for lttng. programming and tools that i know : C/C++, Java, python, php, Javascript, XML, AJAX, valgrind, oprofile. OS : linux, windows. please tell me from where should i start in order to learn things. -- Regards Garvit Sharma Computer Science and Engineering UG Third year LNM IIT, Jaipur *No Body is a Scholar by birth, its only hard work and strong determination that makes him master.* * * From huxuan8218528 at gmail.com Tue Apr 9 05:38:13 2013 From: huxuan8218528 at gmail.com (Xuan Hu) Date: Tue, 9 Apr 2013 17:38:13 +0800 Subject: [lttng-dev] GSoC 2013 proposal - Babeltrace python bindings Message-ID: Hello everyone, I'm really interested in the project of `Babeltrace python bindings`. Besides I'm confident with my python skill and I'm willing to study more skills related. As far as I know, I think this is a somewhat standalone project which should create a module for python programmers to get the results which babeltrace produce. Wish potential mentor (jgalar) can judge whether it is or not. Besides I wonder to know any suggestions for me to begin with this project? -- ?? Sean.Hu ????????????2012?????? 2012, Master Degree Candidate, EECS, PKU Blog | GitHub | Twitter| Douban | Google+| Jiepang | Weibo -------------- next part -------------- An HTML attachment was scrubbed... URL: From raphael.beamonte at polymtl.ca Tue Apr 9 10:43:31 2013 From: raphael.beamonte at polymtl.ca (=?ISO-8859-1?Q?Rapha=EBl_Beamonte?=) Date: Tue, 09 Apr 2013 10:43:31 -0400 Subject: [lttng-dev] Bugfix: Bug #453 In-Reply-To: References: Message-ID: <51642913.9060904@polymtl.ca> Hello Simar, On 2013-04-08 23:41, Simarpreet Singh wrote: > 1) How do you I submit my changes to the lttng-tools repo? Do I need any > kind of authorization before I can do so? To submit your commit patches, you can use the "git send-email" functionality to send them directly to this list. After that, the concerned lttng devs will be able to give you their feedback and/after apply your patches on the main git repos. > > 2) What timezone do you guys work in? I had a few questions to discuss > regarding GSOC 2013 in details and I guess it's better to talk over IRC. Most of us are on America Eastern Time Zone. Rapha?l -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: OpenPGP digital signature URL: From Daniel.Thibault at drdc-rddc.gc.ca Tue Apr 9 11:21:33 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Tue, 9 Apr 2013 15:21:33 +0000 Subject: [lttng-dev] Google Summer of Code Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D0DC32@VAL-E-02.valcartier.drdc-rddc.gc.ca> The Google Summer of Code LTTng entry (http://bugs.lttng.org/projects/lttng/wiki/Google_Summer_of_Code_2013) is a promising initiative. May I propose another little project idea? Babeltrace support for the debugfs (/sys/kernel/debug/tracing) trace format Brief explanation: Provide a Babeltrace plug-in to allow Babeltrace to read from traces created by the debugfs service (/sys/kernel/debug/tracing/trace). Expected results: A Babeltrace plug-in, tests, examples and documentation. Skill level: Easy - Medium Prerequisite Knowledge: C, OO development Mentors: ? Even if the debugfs tracing facility is destined for eventual withdrawal from the Linux kernel, it may be of interest to some to recover older traces generated in this way -if only in order to be able to process them in the same way as CTF text dumps. Conversion to the babeltrace text format should be fairly straightforward; conversion to CTF would be trickier. Is this idea worthwhile or worthless? 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 From dgoulet at efficios.com Tue Apr 9 12:08:04 2013 From: dgoulet at efficios.com (David Goulet) Date: Tue, 09 Apr 2013 12:08:04 -0400 Subject: [lttng-dev] Bugfix: Bug #488 In-Reply-To: References: Message-ID: <51643CE4.4050902@efficios.com> Hi Simarpreet, Can you please rebase your branch on the HEAD of the master branch of lttng-tools before sending a pull request. Also, when you fix a bug in the tracker, use "Fix:" with a meaningful message, add "Fixes #xxx" at the end and finally your signed-off message like so: --- Fix: [...] [more info if necessary] Fixes #xxx Signed-off-by: YOUR_NAME --- Apart from those aesthetics fix, thanks a lot for the contribution. I'll wait for your fixes to pull back the commits. Cheers! David Simarpreet Singh: > Hello again, > > Sorry for the emails guys, I fixed a bunch of other typos in the > codebase, I think these shall go under Bug #488. > > Bug URL: http://bugs.lttng.org/issues/488 > > Fix: https://github.com/simar7/lttng-tools/commit/6a6df32f6fadcb85a275b8ea93306af2d498c263 > > I've pushed my changes on my github account, I'll try to figure out the > correct way to file them in the meantime. > > > Thanks, > Simar > > > This body part will be downloaded on demand. From christian.babeux at efficios.com Tue Apr 9 12:08:59 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Tue, 9 Apr 2013 12:08:59 -0400 Subject: [lttng-dev] Bugfix: Bug #453 In-Reply-To: <51642913.9060904@polymtl.ca> References: <51642913.9060904@polymtl.ca> Message-ID: Hello Simar, Here a few additional guidelines/tips for submitting patches: - I see in your patches that you based yourself on my personal github lttng-tools repository to prepare your patches. This repository might be lagging behind the official one, hence I would suggest using the official git repository to prepare your patch. You can find them in "Git Repositories" in the Download [1] section on the lttng website. - Add the following at the end of your commit message: Fixes #453 This will automatically close the bug #453 in the bug tracker when your patch is merged :). - Indicate in the patch subject on which project the patch is to be applied. In your particular case, the patches need to be applied on the lttng-tools tree. You can accomplish this with the '--subject-prefix' option when using the git format-patch command: git format-patch -s -1 --subject-prefix="PATCH lttng-tools" - Add your signoff in the patch. Use the '-s' option when using git format-patch. - Send the patch to the maintainer of the project and CC the list. In your case, David Goulet (dgoulet at efficios dot com) is the maintainer of lttng-tools. You can accomplish this with the following git send-email command: git send-email --to maintainer_email --cc list_email *.patch If you want to discuss a project proposal, you can join us on IRC on the OFTC network in the #lttng channel. Thanks, Christian [1] - http://lttng.org/download On Tue, Apr 9, 2013 at 10:43 AM, Rapha?l Beamonte wrote: > Hello Simar, > > On 2013-04-08 23:41, Simarpreet Singh wrote: >> 1) How do you I submit my changes to the lttng-tools repo? Do I need any >> kind of authorization before I can do so? > > To submit your commit patches, you can use the "git send-email" > functionality to send them directly to this list. After that, the > concerned lttng devs will be able to give you their feedback and/after > apply your patches on the main git repos. > >> >> 2) What timezone do you guys work in? I had a few questions to discuss >> regarding GSOC 2013 in details and I guess it's better to talk over IRC. > > Most of us are on America Eastern Time Zone. > > Rapha?l > > > _______________________________________________ > 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 Tue Apr 9 12:21:54 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Tue, 9 Apr 2013 12:21:54 -0400 Subject: [lttng-dev] Participating in gsoc'13 In-Reply-To: References: Message-ID: Hi Garvit, Are you interested by a particular project idea? In order to start with the LTTng codebase, I would suggest you try to install the related tools (lttng-tools, lttng-ust, lttng-modules, babeltrace, etc.) and try to trace a simple program or your kernel. You can find some information about the installation of LTTng on Youtube [1], the quick start [2] guide and the LTTng man-pages [3]. Thanks, Christian [1] - https://www.youtube.com/user/lttng [2] - http://lttng.org/quickstart [3] - http://lttng.org/documentation On Tue, Apr 9, 2013 at 3:26 AM, garvit sharma wrote: > Hello All, > > Myself Garvit Sharma doing B.tec(third year) with majors > in cse. I went through the project ideas and really want to spend my > summer in writing codes for lttng. > > programming and tools that i know : C/C++, Java, python, > php, Javascript, XML, AJAX, valgrind, oprofile. > > OS : linux, windows. > > please tell me from where should i start in order to learn things. > > -- > Regards > > Garvit Sharma > Computer Science and Engineering > UG Third year > LNM IIT, Jaipur > > *No Body is a Scholar by birth, its only hard work and strong determination > that makes him master.* > * > * > > _______________________________________________ > 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 Apr 9 12:56:04 2013 From: dgoulet at efficios.com (David Goulet) Date: Tue, 09 Apr 2013 12:56:04 -0400 Subject: [lttng-dev] [RFC PATCH lttng-tools v3] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <1365439209-27624-1-git-send-email-simon.marchi@polymtl.ca> References: <1365439209-27624-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: <51644824.6000505@efficios.com> I wonder if this "string parsing human readable size" should go in libcommon. I can *easily* see that code being used in sessiond and relayd if some bytes size options are used. Basically, you could simply move that code in src/common/utils.c/.h Comments below: Simon Marchi: > --subbuf-size accepts sizes such as: > > - 123 -> 123 > - 123k -> 123 * 1024 > - 123M -> 123 * 1024 * 1024 > - 123G -> 123 * 1024 * 1024 * 1024 > > 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 v3: > * Changes following Mathieu Desnoyers' comments. > - Function name parse_human_size -> parse_size_suffix > - Replace division for bit shift, multipliers by log2 > - Coding style issues. > - strtoll -> strtoull > * Unit tests (depends on fix of object names clash) > > src/bin/lttng/commands/enable_channels.c | 21 ++++- > src/bin/lttng/utils.c | 123 +++++++++++++++++++++++++++++- > src/bin/lttng/utils.h | 6 ++ > tests/unit/Makefile.am | 15 +++- > tests/unit/test_parse_size_suffix.c | 72 +++++++++++++++++ > 5 files changed, 230 insertions(+), 7 deletions(-) > create mode 100644 tests/unit/test_parse_size_suffix.c > > diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c > index d026af4..dbec8ab 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 (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/bin/lttng/utils.c b/src/bin/lttng/utils.c > index b7f5170..cade12f 100644 > --- a/src/bin/lttng/utils.c > +++ b/src/bin/lttng/utils.c > @@ -16,9 +16,11 @@ > */ > > #define _GNU_SOURCE > -#include > +#include > #include > #include > +#include > +#include > > #include > > @@ -77,3 +79,122 @@ void list_cmd_options(FILE *ofp, struct poptOption *options) > } > } > } > + > +/** > + * 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 = regerror(errcode, regex, NULL, 0); > + char *buffer = malloc(length); I know it's not _necessary_ but I would prefer to have the same std across the code. So, we usually declare the variables without assignation (that comes from a function call), then use assert() for given params (if needed) and finally used them. Here, declare length and buffer without assignation. Assert on "regex != NULL" because a NULL value seems to me that it might break (or segfault). Finally, set length, check the return error code and set buffer checking also for errors. Use zmalloc also please. > + > + if (!buffer) { > + ERR("regex_print_error: malloc 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 * 1024 > + * 'G': 1024 * 1024 * 1024 > + * > + * @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. No tabs is needed here after "return". > + */ > +int parse_size_suffix(char *str, uint64_t *size) > +{ > + regex_t regex; > + int ret; > + const int nmatch = 2; > + regmatch_t matches[nmatch]; > + > + if (!str) > + return 0; *Always* {} around if/else statement. I know... the check patch script is not detecting it right but the CodingStyle mentions it. > + > + /* Compile regex */ > + ret = regcomp(®ex, "^[0-9][0-9]*\\([kKMG]\\{0,1\\}\\)$", 0); > + > + /* Check for regex error */ > + if (ret != 0) { > + regex_print_error(ret, ®ex); > + Useless space. > + 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 end; > + } > + > + /* There is a match ! */ > + unsigned long long base_size; > + long shift = 0; > + errno = 0; Why is errno set to 0 ? > + base_size = strtoll(str, NULL, 10); I think you want "strtoUll" here. > + No space. > + /* Check result of conversion */ > + if (errno != 0) { You should check base_size == ULLONG_MAX which is the return value of an overflow meaning an error instead of errno. > + PERROR("strtoull"); > + ret = -1; > + goto end; > + } > + > + /* Check if there is a suffix */ > + regmatch_t suffix_match = matches[1]; Declare first then assign. You can do this is suffix_match was used in a smaller scope (inside a if block for instance). > + if (suffix_match.rm_eo - suffix_match.rm_so == 1) { > + switch (*(str + suffix_match.rm_so)) { > + case 'K': > + case 'k': > + shift = KIBI_LOG2; I wonder if these *_LOG2 should go in default.h ? Thoughts? > + break; > + case 'M': > + shift = MEBI_LOG2; > + break; > + case 'G': > + shift = GIBI_LOG2; > + break; > + default: > + ERR("parse_human_size: invalid suffix"); > + ret = -1; > + goto end; > + } > + } > + > + *size = base_size << shift; > + > + /* Check for overflow */ > + if ((*size >> shift) != base_size) { > + ERR("parse_size_suffix: oops, overflow detected."); > + ret = -1; > + goto end; > + } > + > + ret = 0; > + goto end; > + > +end: > + regfree(®ex); If regex was uninit like for instance on regcomp error, does this call behaves well ? Thanks! David > + return ret; > +} > diff --git a/src/bin/lttng/utils.h b/src/bin/lttng/utils.h > index 9f7bfcc..12a72be 100644 > --- a/src/bin/lttng/utils.h > +++ b/src/bin/lttng/utils.h > @@ -19,8 +19,14 @@ > #define _LTTNG_UTILS_H > > #include > +#include > + > +#define KIBI_LOG2 10 > +#define MEBI_LOG2 20 > +#define GIBI_LOG2 30 > > char *get_session_name(void); > void list_cmd_options(FILE *ofp, struct poptOption *options); > +int parse_size_suffix(char *str, uint64_t *size); > > #endif /* _LTTNG_UTILS_H */ > diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am > index 67e7fe4..5b49733 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_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 > +PARSE_SIZE_SUFFIX=$(top_srcdir)/src/bin/lttng/utils.o \ > + $(top_srcdir)/src/bin/lttng/conf.o > + > +test_parse_size_suffix_SOURCES = test_parse_size_suffix.c > +test_parse_size_suffix_LDADD = $(LIBTAP) > +test_parse_size_suffix_LDADD += $(PARSE_SIZE_SUFFIX) > diff --git a/tests/unit/test_parse_size_suffix.c b/tests/unit/test_parse_size_suffix.c > new file mode 100644 > index 0000000..70ccb76 > --- /dev/null > +++ b/tests/unit/test_parse_size_suffix.c > @@ -0,0 +1,72 @@ > +/* > + * 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 > + > +/* For lttngerr.h */ > +int lttng_opt_quiet = 1; > +int lttng_opt_verbose = 3; > + > +/* Valid test cases */ > +static char *valid_tests_inputs[] = { "0", "1234", "16k", "128K", "32M", "1024G" }; > +static uint64_t valid_tests_expected_results[] = {0, 1234, 16384, 131072, 33554432, 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]); > + > +void test_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, "testing %s", valid_tests_inputs[i]); > + > + ret = parse_size_suffix(valid_tests_inputs[i], &result); > + ok(ret == 0 && result == valid_tests_expected_results[i], name); > + } > + > + // Test invalid cases > + for (i = 0; i < num_invalid_tests; i++) { > + char name[100]; > + sprintf(name, "testing %s", invalid_tests_inputs[i]); > + > + ret = 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("parse_size_suffix tests"); > + > + test_parse_size_suffix(); > + > + return exit_status(); > +} From mathieu.desnoyers at efficios.com Tue Apr 9 14:32:20 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 9 Apr 2013 14:32:20 -0400 Subject: [lttng-dev] [RFC PATCH lttng-tools v3] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <51644824.6000505@efficios.com> References: <1365439209-27624-1-git-send-email-simon.marchi@polymtl.ca> <51644824.6000505@efficios.com> Message-ID: <20130409183220.GC14986@Krystal> * David Goulet (dgoulet at efficios.com) wrote: > I wonder if this "string parsing human readable size" should go in > libcommon. I can *easily* see that code being used in sessiond and > relayd if some bytes size options are used. > > Basically, you could simply move that code in src/common/utils.c/.h > > Comments below: > > Simon Marchi: > > --subbuf-size accepts sizes such as: > > > > - 123 -> 123 > > - 123k -> 123 * 1024 > > - 123M -> 123 * 1024 * 1024 > > - 123G -> 123 * 1024 * 1024 * 1024 > > > > 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 v3: > > * Changes following Mathieu Desnoyers' comments. > > - Function name parse_human_size -> parse_size_suffix > > - Replace division for bit shift, multipliers by log2 > > - Coding style issues. > > - strtoll -> strtoull > > * Unit tests (depends on fix of object names clash) > > > > src/bin/lttng/commands/enable_channels.c | 21 ++++- > > src/bin/lttng/utils.c | 123 +++++++++++++++++++++++++++++- > > src/bin/lttng/utils.h | 6 ++ > > tests/unit/Makefile.am | 15 +++- > > tests/unit/test_parse_size_suffix.c | 72 +++++++++++++++++ > > 5 files changed, 230 insertions(+), 7 deletions(-) > > create mode 100644 tests/unit/test_parse_size_suffix.c > > > > diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c > > index d026af4..dbec8ab 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 (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/bin/lttng/utils.c b/src/bin/lttng/utils.c > > index b7f5170..cade12f 100644 > > --- a/src/bin/lttng/utils.c > > +++ b/src/bin/lttng/utils.c > > @@ -16,9 +16,11 @@ > > */ > > > > #define _GNU_SOURCE > > -#include > > +#include > > #include > > #include > > +#include > > +#include > > > > #include > > > > @@ -77,3 +79,122 @@ void list_cmd_options(FILE *ofp, struct poptOption *options) > > } > > } > > } > > + > > +/** > > + * 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 = regerror(errcode, regex, NULL, 0); > > + char *buffer = malloc(length); > > I know it's not _necessary_ but I would prefer to have the same std > across the code. So, we usually declare the variables without > assignation (that comes from a function call), then use assert() for > given params (if needed) and finally used them. > > Here, declare length and buffer without assignation. Assert on "regex != > NULL" because a NULL value seems to me that it might break (or > segfault). Finally, set length, check the return error code and set > buffer checking also for errors. > > Use zmalloc also please. > > > + > > + if (!buffer) { > > + ERR("regex_print_error: malloc 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 * 1024 > > + * 'G': 1024 * 1024 * 1024 > > + * > > + * @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. > > No tabs is needed here after "return". > > > + */ > > +int parse_size_suffix(char *str, uint64_t *size) > > +{ > > + regex_t regex; > > + int ret; > > + const int nmatch = 2; > > + regmatch_t matches[nmatch]; > > + > > + if (!str) > > + return 0; > > *Always* {} around if/else statement. I know... the check patch script > is not detecting it right but the CodingStyle mentions it. > > > + > > + /* Compile regex */ > > + ret = regcomp(®ex, "^[0-9][0-9]*\\([kKMG]\\{0,1\\}\\)$", 0); > > + > > + /* Check for regex error */ > > + if (ret != 0) { > > + regex_print_error(ret, ®ex); > > + > > Useless space. > > > + 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 end; > > + } > > + > > + /* There is a match ! */ > > + unsigned long long base_size; > > + long shift = 0; > > + errno = 0; > > Why is errno set to 0 ? see strtoull(3). > > > + base_size = strtoll(str, NULL, 10); > > I think you want "strtoUll" here. > > > + > > No space. > > > + /* Check result of conversion */ > > + if (errno != 0) { > > You should check base_size == ULLONG_MAX which is the return value of an > overflow meaning an error instead of errno. wrong, see strtoull(3). > > > + PERROR("strtoull"); > > + ret = -1; > > + goto end; > > + } > > + > > + /* Check if there is a suffix */ > > + regmatch_t suffix_match = matches[1]; > > Declare first then assign. You can do this is suffix_match was used in a > smaller scope (inside a if block for instance). > > > + if (suffix_match.rm_eo - suffix_match.rm_so == 1) { > > + switch (*(str + suffix_match.rm_so)) { > > + case 'K': > > + case 'k': > > + shift = KIBI_LOG2; > > I wonder if these *_LOG2 should go in default.h ? Thoughts? could. no strong feeling. Thanks, Mathieu > > > + break; > > + case 'M': > > + shift = MEBI_LOG2; > > + break; > > + case 'G': > > + shift = GIBI_LOG2; > > + break; > > + default: > > + ERR("parse_human_size: invalid suffix"); > > + ret = -1; > > + goto end; > > + } > > + } > > + > > + *size = base_size << shift; > > + > > + /* Check for overflow */ > > + if ((*size >> shift) != base_size) { > > + ERR("parse_size_suffix: oops, overflow detected."); > > + ret = -1; > > + goto end; > > + } > > + > > + ret = 0; > > + goto end; > > + > > +end: > > + regfree(®ex); > > If regex was uninit like for instance on regcomp error, does this call > behaves well ? > > Thanks! > David > > > + return ret; > > +} > > diff --git a/src/bin/lttng/utils.h b/src/bin/lttng/utils.h > > index 9f7bfcc..12a72be 100644 > > --- a/src/bin/lttng/utils.h > > +++ b/src/bin/lttng/utils.h > > @@ -19,8 +19,14 @@ > > #define _LTTNG_UTILS_H > > > > #include > > +#include > > + > > +#define KIBI_LOG2 10 > > +#define MEBI_LOG2 20 > > +#define GIBI_LOG2 30 > > > > char *get_session_name(void); > > void list_cmd_options(FILE *ofp, struct poptOption *options); > > +int parse_size_suffix(char *str, uint64_t *size); > > > > #endif /* _LTTNG_UTILS_H */ > > diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am > > index 67e7fe4..5b49733 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_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 > > +PARSE_SIZE_SUFFIX=$(top_srcdir)/src/bin/lttng/utils.o \ > > + $(top_srcdir)/src/bin/lttng/conf.o > > + > > +test_parse_size_suffix_SOURCES = test_parse_size_suffix.c > > +test_parse_size_suffix_LDADD = $(LIBTAP) > > +test_parse_size_suffix_LDADD += $(PARSE_SIZE_SUFFIX) > > diff --git a/tests/unit/test_parse_size_suffix.c b/tests/unit/test_parse_size_suffix.c > > new file mode 100644 > > index 0000000..70ccb76 > > --- /dev/null > > +++ b/tests/unit/test_parse_size_suffix.c > > @@ -0,0 +1,72 @@ > > +/* > > + * 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 > > + > > +/* For lttngerr.h */ > > +int lttng_opt_quiet = 1; > > +int lttng_opt_verbose = 3; > > + > > +/* Valid test cases */ > > +static char *valid_tests_inputs[] = { "0", "1234", "16k", "128K", "32M", "1024G" }; > > +static uint64_t valid_tests_expected_results[] = {0, 1234, 16384, 131072, 33554432, 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]); > > + > > +void test_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, "testing %s", valid_tests_inputs[i]); > > + > > + ret = parse_size_suffix(valid_tests_inputs[i], &result); > > + ok(ret == 0 && result == valid_tests_expected_results[i], name); > > + } > > + > > + // Test invalid cases > > + for (i = 0; i < num_invalid_tests; i++) { > > + char name[100]; > > + sprintf(name, "testing %s", invalid_tests_inputs[i]); > > + > > + ret = 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("parse_size_suffix tests"); > > + > > + test_parse_size_suffix(); > > + > > + return exit_status(); > > +} > > _______________________________________________ > 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 Apr 9 15:37:30 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Tue, 9 Apr 2013 15:37:30 -0400 Subject: [lttng-dev] GSoC 2013 proposal - Babeltrace python bindings In-Reply-To: References: Message-ID: Hi Xuan, First, thanks for reaching out! Basically, the Babeltrace Python bindings project aims at providing Python developers with a library to read the trace formats supported by Babeltrace. I'll take the chance to detail what we had in mind with this project. The first part consists of producing Python bindings to libbabeltrace's public API. This has already been done last summer but is not yet part of the master branch. It currently lives in the "bindings/python" branch of Babeltrace's repository[1]. However, it is not completely up-to-date and lacks thorough testing. The second part, which is more of an interface design exercise, is exposing the trace data read by libbabeltrace in a "Pythonic" way. That includes implementing Python's generator-iterator interface, expressing the trace metadata using Python's data structures, etc. libbabeltrace can also be used as a trace writer so the Python interface should expose this functionality by providing a symmetric output interface. All in all, it calls for a lot more design work than actual implementation. For starters, you may want to have a look at the CTF specification[2], which is currently the only trace format supported by Babeltrace, to give you an idea of the challenges at hand. Trying out the complete LTTng toolchain will also give you a better view of this project. [1] https://bugs.lttng.org/projects/babeltrace/repository/show?rev=bindings%2Fpython [2] http://git.efficios.com/?p=ctf.git;a=blob_plain;f=common-trace-format-specification.txt;hb=master Don't hesitate to come forward and propose a tentative API or ask for clarifications. Regards, J?r?mie On Tue, Apr 9, 2013 at 5:38 AM, Xuan Hu wrote: > Hello everyone, > > I'm really interested in the project of `Babeltrace python bindings`. > Besides I'm confident with my python skill and I'm willing to study more > skills related. As far as I know, I think this is a somewhat standalone > project which should create a module for python programmers to get the > results which babeltrace produce. Wish potential mentor (jgalar) can judge > whether it is or not. Besides I wonder to know any suggestions for me to > begin with this project? > > -- > ?? Sean.Hu > > ????????????2012?????? > 2012, Master Degree Candidate, EECS, PKU > > Blog | GitHproposeub | > Twitter | Douban| > Google+ | Jiepang | > Weibo > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From simarpreet007 at gmail.com Tue Apr 9 15:41:35 2013 From: simarpreet007 at gmail.com (Simarpreet Singh) Date: Tue, 9 Apr 2013 15:41:35 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fixing a few typos in lttng-tools tree Fixes #453 Message-ID: <1365536495-8416-1-git-send-email-simarpreet007@gmail.com> Signed-off-by: Simarpreet Singh --- src/common/error.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/error.c b/src/common/error.c index 4fb022c..4b9b46e 100644 --- a/src/common/error.c +++ b/src/common/error.c @@ -40,7 +40,7 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_SESS_NOT_FOUND) ] = "Session name not found", [ ERROR_INDEX(LTTNG_ERR_FATAL) ] = "Fatal error of the session daemon", [ ERROR_INDEX(LTTNG_ERR_SELECT_SESS) ] = "A session MUST be selected", - [ ERROR_INDEX(LTTNG_ERR_EXIST_SESS) ] = "Session name already exist", + [ ERROR_INDEX(LTTNG_ERR_EXIST_SESS) ] = "Session name already exists", [ ERROR_INDEX(LTTNG_ERR_NO_EVENT) ] = "Event not found", [ ERROR_INDEX(LTTNG_ERR_CONNECT_FAIL) ] = "Unable to connect to Unix socket", [ ERROR_INDEX(LTTNG_ERR_EPERM) ] = "Permission denied", @@ -58,7 +58,7 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_KERN_DISABLE_FAIL) ] = "Disable kernel event failed", [ ERROR_INDEX(LTTNG_ERR_KERN_META_FAIL) ] = "Opening metadata failed", [ ERROR_INDEX(LTTNG_ERR_KERN_START_FAIL) ] = "Starting kernel trace failed", - [ ERROR_INDEX(LTTNG_ERR_KERN_STOP_FAIL) ] = "Stoping kernel trace failed", + [ ERROR_INDEX(LTTNG_ERR_KERN_STOP_FAIL) ] = "Stopping kernel trace failed", [ ERROR_INDEX(LTTNG_ERR_KERN_CONSUMER_FAIL) ] = "Kernel consumer start failed", [ ERROR_INDEX(LTTNG_ERR_KERN_STREAM_FAIL) ] = "Kernel create stream failed", [ ERROR_INDEX(LTTNG_ERR_KERN_LIST_FAIL) ] = "Listing kernel events failed", @@ -73,7 +73,7 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_UST_DISABLE_FAIL) ] = "Disable UST event failed", [ ERROR_INDEX(LTTNG_ERR_UST_META_FAIL) ] = "Opening metadata failed", [ ERROR_INDEX(LTTNG_ERR_UST_START_FAIL) ] = "Starting UST trace failed", - [ ERROR_INDEX(LTTNG_ERR_UST_STOP_FAIL) ] = "Stoping UST trace failed", + [ ERROR_INDEX(LTTNG_ERR_UST_STOP_FAIL) ] = "Stopping UST trace failed", [ ERROR_INDEX(LTTNG_ERR_UST_CONSUMER64_FAIL) ] = "64-bit UST consumer start failed", [ ERROR_INDEX(LTTNG_ERR_UST_CONSUMER32_FAIL) ] = "32-bit UST consumer start failed", [ ERROR_INDEX(LTTNG_ERR_UST_STREAM_FAIL) ] = "UST create stream failed", @@ -82,7 +82,7 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_UST_EVENT_NOT_FOUND)] = "UST event not found", [ ERROR_INDEX(LTTNG_ERR_UST_CONTEXT_EXIST)] = "UST context already exist", [ ERROR_INDEX(LTTNG_ERR_UST_CONTEXT_INVAL)] = "UST invalid context", - [ ERROR_INDEX(LTTNG_ERR_NEED_ROOT_SESSIOND) ] = "Tracing the kernel requires a root lttng-sessiond daemon and \"tracing\" group user membership", + [ ERROR_INDEX(LTTNG_ERR_NEED_ROOT_SESSIOND) ] = "Tracing the kernel requires a root lttng-sessiond daemon or \"tracing\" group user membership", [ ERROR_INDEX(LTTNG_ERR_TRACE_ALREADY_STARTED) ] = "Tracing already started", [ ERROR_INDEX(LTTNG_ERR_TRACE_ALREADY_STOPPED) ] = "Tracing already stopped", [ ERROR_INDEX(LTTNG_ERR_KERN_EVENT_ENOSYS) ] = "Kernel event type not supported", @@ -91,7 +91,7 @@ static const char *error_string_array[] = { [ ERROR_INDEX(LTTNG_ERR_NO_KERNCONSUMERD) ] = "No kernel consumer detected", [ ERROR_INDEX(LTTNG_ERR_EVENT_EXIST_LOGLEVEL) ] = "Event already enabled with different loglevel", [ ERROR_INDEX(LTTNG_ERR_URL_DATA_MISS) ] = "Missing data path URL", - [ ERROR_INDEX(LTTNG_ERR_URL_CTRL_MISS) ] = "Missing control data path URL", + [ ERROR_INDEX(LTTNG_ERR_URL_CTRL_MISS) ] = "Missing control path URL", [ ERROR_INDEX(LTTNG_ERR_ENABLE_CONSUMER_FAIL) ] = "Enabling consumer failed", [ ERROR_INDEX(LTTNG_ERR_RELAYD_CONNECT_FAIL) ] = "Unable to connect to lttng-relayd", [ ERROR_INDEX(LTTNG_ERR_RELAYD_VERSION_FAIL) ] = "Relay daemon not compatible", -- 1.7.9.5 From simarpreet007 at gmail.com Tue Apr 9 15:46:23 2013 From: simarpreet007 at gmail.com (Simarpreet Singh) Date: Tue, 9 Apr 2013 15:46:23 -0400 Subject: [lttng-dev] Bugfix: Bug #488 In-Reply-To: <51643CE4.4050902@efficios.com> References: <51643CE4.4050902@efficios.com> Message-ID: Hey guys, Thanks for the help, I just submitted Fix #453 for a review, hopefully I did it correct. *fingers crossed* I'll be submitting fixes for #488 in a few hours. Thanks again, Simar On Tue, Apr 9, 2013 at 12:08 PM, David Goulet wrote: > Hi Simarpreet, > > Can you please rebase your branch on the HEAD of the master branch of > lttng-tools before sending a pull request. > > Also, when you fix a bug in the tracker, use "Fix:" with a meaningful > message, add "Fixes #xxx" at the end and finally your signed-off message > like so: > > --- > > Fix: [...] > > [more info if necessary] > > Fixes #xxx > > Signed-off-by: YOUR_NAME > > --- > > Apart from those aesthetics fix, thanks a lot for the contribution. I'll > wait for your fixes to pull back the commits. > > Cheers! > David > > Simarpreet Singh: > > Hello again, > > > > Sorry for the emails guys, I fixed a bunch of other typos in the > > codebase, I think these shall go under Bug #488. > > > > Bug URL: http://bugs.lttng.org/issues/488 > > > > Fix: > https://github.com/simar7/lttng-tools/commit/6a6df32f6fadcb85a275b8ea93306af2d498c263 > > > > I've pushed my changes on my github account, I'll try to figure out the > > correct way to file them in the meantime. > > > > > > Thanks, > > Simar > > > > > > This body part will be downloaded on demand. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sami.tabibel at gmail.com Tue Apr 9 22:20:42 2013 From: sami.tabibel at gmail.com (Tabibel Sami) Date: Wed, 10 Apr 2013 04:20:42 +0200 Subject: [lttng-dev] GSoC 2013, "Instrumenting Open Source projects using UST" project. Message-ID: Hello, I am doing master degree of Cryptology and information security I have good C, Python and Scapy skills, and i am interested to work on "Instrumenting Open Source projects using UST" project this summer. I am looking for any comment about the difficulty and the content of the project, and also about my chances to be accepted if i apply for. Thanks in advance. Best Regards. From fdeslaur at gmail.com Tue Apr 9 23:59:19 2013 From: fdeslaur at gmail.com (Francis Deslauriers) Date: Tue, 9 Apr 2013 23:59:19 -0400 Subject: [lttng-dev] [RFC-Patch 1/2] Add page fault trace event definitions In-Reply-To: <1365398358-23374-1-git-send-email-fdeslaur@gmail.com> References: <1365398358-23374-1-git-send-email-fdeslaur@gmail.com> Message-ID: <1365566360-7206-1-git-send-email-fdeslaur@gmail.com> Add page_fault_entry and page_fault_exit event definitions. It will allow each architecture to instrument their page faults. Signed-off-by: Francis Deslauriers Reviewed-by: Rapha?l Beamonte --- include/trace/events/fault.h | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 include/trace/events/fault.h diff --git a/include/trace/events/fault.h b/include/trace/events/fault.h new file mode 100644 index 0000000..522ddee --- /dev/null +++ b/include/trace/events/fault.h @@ -0,0 +1,51 @@ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM fault + +#if !defined(_TRACE_FAULT_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_FAULT_H + +#include + +TRACE_EVENT(page_fault_entry, + + TP_PROTO(struct pt_regs *regs, unsigned long address, + int write_access), + + TP_ARGS(regs, address, write_access), + + TP_STRUCT__entry( + __field( unsigned long, ip ) + __field( unsigned long, addr ) + __field( uint8_t, write ) + ), + + TP_fast_assign( + __entry->ip = regs ? instruction_pointer(regs) : 0UL; + __entry->addr = address; + __entry->write = !!write_access; + ), + + TP_printk("ip=%lu addr=%lu write_access=%d", + __entry->ip, __entry->addr, __entry->write) +); + +TRACE_EVENT(page_fault_exit, + + TP_PROTO(int result), + + TP_ARGS(result), + + TP_STRUCT__entry( + __field( int, res ) + ), + + TP_fast_assign( + __entry->res = result; + ), + + TP_printk("result=%d", __entry->res) +); + +#endif /* _TRACE_FAULT_H */ +/* This part must be outside protection */ +#include -- 1.7.10.4 From fdeslaur at gmail.com Tue Apr 9 23:59:20 2013 From: fdeslaur at gmail.com (Francis Deslauriers) Date: Tue, 9 Apr 2013 23:59:20 -0400 Subject: [lttng-dev] [RFC-Patch 2/2] x86:Instruments page fault trace event In-Reply-To: <1365566360-7206-1-git-send-email-fdeslaur@gmail.com> References: <1365398358-23374-1-git-send-email-fdeslaur@gmail.com> <1365566360-7206-1-git-send-email-fdeslaur@gmail.com> Message-ID: <1365566360-7206-2-git-send-email-fdeslaur@gmail.com> Signed-off-by: Francis Deslauriers Reviewed-by: Rapha?l Beamonte --- arch/x86/mm/fault.c | 7 +++++++ mm/memory.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 2b97525..6ceaaaa 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -20,6 +20,9 @@ #include /* VSYSCALL_START */ #include /* exception_enter(), ... */ +#define CREATE_TRACE_POINTS +#include /* trace_page_fault_*(), ... */ + /* * Page fault error code bits: * @@ -754,12 +757,14 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, if (likely(show_unhandled_signals)) show_signal_msg(regs, error_code, address, tsk); + trace_page_fault_entry(regs, address, error_code & PF_WRITE); tsk->thread.cr2 = address; tsk->thread.error_code = error_code; tsk->thread.trap_nr = X86_TRAP_PF; force_sig_info_fault(SIGSEGV, si_code, address, tsk, 0); + trace_page_fault_exit(-1); return; } @@ -1183,7 +1188,9 @@ good_area: * make sure we exit gracefully rather than endlessly redo * the fault: */ + trace_page_fault_entry(regs, address, write); fault = handle_mm_fault(mm, vma, address, flags); + trace_page_fault_exit(fault); if (unlikely(fault & (VM_FAULT_RETRY|VM_FAULT_ERROR))) { if (mm_fault_error(regs, error_code, address, fault)) diff --git a/mm/memory.c b/mm/memory.c index 494526a..49a8119 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -67,6 +67,8 @@ #include #include +#include + #include "internal.h" #ifdef LAST_NID_NOT_IN_PAGE_FLAGS @@ -1828,8 +1830,11 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, if (foll_flags & FOLL_NOWAIT) fault_flags |= (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_RETRY_NOWAIT); + trace_page_fault_entry(0, start, + foll_flags & FOLL_WRITE); ret = handle_mm_fault(mm, vma, start, fault_flags); + trace_page_fault_exit(ret); if (ret & VM_FAULT_ERROR) { if (ret & VM_FAULT_OOM) -- 1.7.10.4 From huxuan8218528 at gmail.com Wed Apr 10 01:23:35 2013 From: huxuan8218528 at gmail.com (Xuan Hu) Date: Wed, 10 Apr 2013 13:23:35 +0800 Subject: [lttng-dev] GSoC 2013 proposal - Babeltrace python bindings In-Reply-To: References: Message-ID: Hi, jgalar. Thx for your detailed clarification. I will begin with looking throuth the CTF specification and investigation with the code of bing/python branch. I have one little question, where can I find the list of libbabeltrace's public API? And I also failed to find documents tends for developments and contributors. I think these would be helpful for me to get fimiliar with our projects. :-) Wish for your reply. On Wed, Apr 10, 2013 at 3:37 AM, J?r?mie Galarneau < jeremie.galarneau at efficios.com> wrote: > Hi Xuan, > > First, thanks for reaching out! > > Basically, the Babeltrace Python bindings project aims at providing Python > developers with a library to read the trace formats supported by > Babeltrace. I'll take the chance to detail what we had in mind with this > project. > > The first part consists of producing Python bindings to libbabeltrace's > public API. This has already been done last summer but is not yet part of > the master branch. It currently lives in the "bindings/python" branch of > Babeltrace's repository[1]. However, it is not completely up-to-date and > lacks thorough testing. > > The second part, which is more of an interface design exercise, is > exposing the trace data read by libbabeltrace in a "Pythonic" way. That > includes implementing Python's generator-iterator interface, expressing the > trace metadata using Python's data structures, etc. libbabeltrace can also > be used as a trace writer so the Python interface should expose this > functionality by providing a symmetric output interface. All in all, it > calls for a lot more design work than actual implementation. > > For starters, you may want to have a look at the CTF specification[2], > which is currently the only trace format supported by Babeltrace, to give > you an idea of the challenges at hand. Trying out the complete LTTng > toolchain will also give you a better view of this project. > > [1] > https://bugs.lttng.org/projects/babeltrace/repository/show?rev=bindings%2Fpython > [2] > http://git.efficios.com/?p=ctf.git;a=blob_plain;f=common-trace-format-specification.txt;hb=master > > Don't hesitate to come forward and propose a tentative API or ask for > clarifications. > > Regards, > J?r?mie > > On Tue, Apr 9, 2013 at 5:38 AM, Xuan Hu wrote: > >> Hello everyone, >> >> I'm really interested in the project of `Babeltrace python bindings`. >> Besides I'm confident with my python skill and I'm willing to study more >> skills related. As far as I know, I think this is a somewhat standalone >> project which should create a module for python programmers to get the >> results which babeltrace produce. Wish potential mentor (jgalar) can judge >> whether it is or not. Besides I wonder to know any suggestions for me to >> begin with this project? >> >> -- >> ?? Sean.Hu >> >> ????????????2012?????? >> 2012, Master Degree Candidate, EECS, PKU >> >> Blog | GitHproposeub | >> Twitter | Douban| >> Google+ | Jiepang | >> Weibo >> >> _______________________________________________ >> 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 > -- ?? Sean.Hu ????????????2012?????? 2012, Master Degree Candidate, EECS, PKU Blog | GitHub | Twitter| Douban | Google+| Jiepang | Weibo -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.glauber at gmail.com Wed Apr 10 04:40:54 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Wed, 10 Apr 2013 10:40:54 +0200 Subject: [lttng-dev] LTTng system call tracing on ARM Message-ID: <20130410084053.GB25958@hal> Hi, I want to use LTTng for system call tracing on ARM. Now lttng-modules seems to support system call tracing on ARM already since "8f4f80e LTTng Modules ARM syscall instrumentation". But I wonder how that worked since lttng-syscalls.c is only build under CONFIG_HAVE_SYSCALL_TRACEPOINTS and that was added to ARM only with kernel 3.6 (much after than the lttng-modules commit). Am I missing something? Is system call tracing working on ARM with the upstream LTTng version? thanks, Jan From pierre-luc.st-charles at polymtl.ca Wed Apr 10 08:39:12 2013 From: pierre-luc.st-charles at polymtl.ca (Pierre-Luc St-Charles) Date: Wed, 10 Apr 2013 08:39:12 -0400 Subject: [lttng-dev] LTTng system call tracing on ARM In-Reply-To: References: <20130410084053.GB25958@hal> Message-ID: Hey Jan, I cannot speak on behalf of everyone here, but during our attempt to port LTTng to Android, we also noticed that the kernels we were using (3.0.x) were nowhere near the requirements for syscall tracepoints support. I believe such support was added on x86/64 way earlier (early 3.x) than on ARM, which is why it was included in LTTng's modules a while ago. Simply put, the ARM kernel is late. There are a few actuals ways to 'enable' syscall tracepoints support on early ARM kernels, but they all including a bit of kernel hacking/patching. I could send you some links if you're interested in that. -PL On Apr 10, 2013 8:37 AM, "PLSTC" wrote: > Hey Jan, > > I cannot speak on behalf of everyone here, but during our attempt to port > LTTng to Android, we also noticed that the kernels we were using (3.0.x) > were nowhere near the requirements for syscall tracepoints support. I > believe such support was added on x86/64 way earlier (early 3.x) than on > ARM, which is why it was included in LTTng's modules a while ago. Simply > put, the ARM kernel is late. > > There are a few actuals ways to 'enable' syscall tracepoints support on > early ARM kernels, but they all including a bit of kernel hacking/patching. > I could send you some links if you're interested in that. > > -PL > On Apr 10, 2013 4:40 AM, "Jan Glauber" wrote: > >> Hi, >> >> I want to use LTTng for system call tracing on ARM. Now lttng-modules >> seems >> to support system call tracing on ARM already since >> "8f4f80e LTTng Modules ARM syscall instrumentation". >> >> But I wonder how that worked since lttng-syscalls.c is only build under >> CONFIG_HAVE_SYSCALL_TRACEPOINTS and that was added to ARM only with >> kernel 3.6 >> (much after than the lttng-modules commit). >> >> Am I missing something? Is system call tracing working on ARM with the >> upstream >> LTTng version? >> >> thanks, >> Jan >> >> _______________________________________________ >> 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 jan.glauber at gmail.com Wed Apr 10 09:02:47 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Wed, 10 Apr 2013 15:02:47 +0200 Subject: [lttng-dev] LTTng system call tracing on ARM In-Reply-To: References: <20130410084053.GB25958@hal> Message-ID: <20130410130246.GA12801@hal> On Wed, Apr 10, 2013 at 08:37:18AM -0400, PLSTC wrote: > Hey Jan, > > I cannot speak on behalf of everyone here, but during our attempt to port > LTTng to Android, we also noticed that the kernels we were using (3.0.x) > were nowhere near the requirements for syscall tracepoints support. I > believe such support was added on x86/64 way earlier (early 3.x) than on > ARM, which is why it was included in LTTng's modules a while ago. Simply > put, the ARM kernel is late. OK, so for ARM kernel version 3.6 is the minimum unless the syscall tracepoint support is backported. > There are a few actuals ways to 'enable' syscall tracepoints support on > early ARM kernels, but they all including a bit of kernel hacking/patching. > I could send you some links if you're interested in that. Yes, sure! --Jan > -PL > On Apr 10, 2013 4:40 AM, "Jan Glauber" wrote: > > > Hi, > > > > I want to use LTTng for system call tracing on ARM. Now lttng-modules seems > > to support system call tracing on ARM already since > > "8f4f80e LTTng Modules ARM syscall instrumentation". > > > > But I wonder how that worked since lttng-syscalls.c is only build under > > CONFIG_HAVE_SYSCALL_TRACEPOINTS and that was added to ARM only with kernel > > 3.6 > > (much after than the lttng-modules commit). > > > > Am I missing something? Is system call tracing working on ARM with the > > upstream > > LTTng version? > > > > thanks, > > Jan > > > > _______________________________________________ > > lttng-dev mailing list > > lttng-dev at lists.lttng.org > > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > From pierre-luc.st-charles at polymtl.ca Wed Apr 10 09:38:33 2013 From: pierre-luc.st-charles at polymtl.ca (Pierre-Luc St-Charles) Date: Wed, 10 Apr 2013 09:38:33 -0400 Subject: [lttng-dev] LTTng system call tracing on ARM In-Reply-To: <20130410130246.GA12801@hal> References: <20130410084053.GB25958@hal> <20130410130246.GA12801@hal> Message-ID: Here are the links I stashed a while back about previous patching attempts to add syscall tracepoints to the ARM kernel : Most promising: http://www.spinics.net/lists/arm-kernel/msg166419.html Earlier draft(s): http://lists.infradead.org/pipermail/linux-arm-kernel/2012-February/086974.html https://lkml.org/lkml/2011/12/1/131 http://comments.gmane.org/gmane.linux.ports.arm.kernel/141933 I believe the first link shows the most refined patch there is out there, but it might take some minor tinkering to apply it to a different kernel version. I briefly tried to apply it to the 3.0.31 kernel, but it's a bit out of my 'tinkering' range, and I never finished it. Good luck! -PL On Wed, Apr 10, 2013 at 9:02 AM, Jan Glauber wrote: > On Wed, Apr 10, 2013 at 08:37:18AM -0400, PLSTC wrote: > > Hey Jan, > > > > I cannot speak on behalf of everyone here, but during our attempt to port > > LTTng to Android, we also noticed that the kernels we were using (3.0.x) > > were nowhere near the requirements for syscall tracepoints support. I > > believe such support was added on x86/64 way earlier (early 3.x) than on > > ARM, which is why it was included in LTTng's modules a while ago. Simply > > put, the ARM kernel is late. > > OK, so for ARM kernel version 3.6 is the minimum unless the syscall > tracepoint > support is backported. > > > There are a few actuals ways to 'enable' syscall tracepoints support on > > early ARM kernels, but they all including a bit of kernel > hacking/patching. > > I could send you some links if you're interested in that. > > Yes, sure! > > --Jan > > > -PL > > On Apr 10, 2013 4:40 AM, "Jan Glauber" wrote: > > > > > Hi, > > > > > > I want to use LTTng for system call tracing on ARM. Now lttng-modules > seems > > > to support system call tracing on ARM already since > > > "8f4f80e LTTng Modules ARM syscall instrumentation". > > > > > > But I wonder how that worked since lttng-syscalls.c is only build under > > > CONFIG_HAVE_SYSCALL_TRACEPOINTS and that was added to ARM only with > kernel > > > 3.6 > > > (much after than the lttng-modules commit). > > > > > > Am I missing something? Is system call tracing working on ARM with the > > > upstream > > > LTTng version? > > > > > > thanks, > > > Jan > > > > > > _______________________________________________ > > > 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 Wed Apr 10 10:21:08 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 10 Apr 2013 10:21:08 -0400 Subject: [lttng-dev] Error using add-context for perf counters In-Reply-To: <515C6F92.5060803@ericsson.com> References: <5148B66A.6080007@ericsson.com> <515C6F92.5060803@ericsson.com> Message-ID: <20130410142108.GA5362@Krystal> please open a bug report on the bug tracker for this issue if you still see it. Please let us know if you see it in 2.2-rc1 too. * Matthew Khouzam (matthew.khouzam at ericsson.com) wrote: > Hi, I can confirm this bug, Has anyone else tried it? > > On 13-03-19 03:03 PM, Bernd Hufmann wrote: > > Hello > > > > I cannot add contexts for perf counters using lttng-tools v2.1.1 and I > > get an error (see below). When using lttng-tools 2.0.5 (on a different > > computer) it works. Could somebody from lttng development team look > > into that? > > > > Thanks > > Bernd > > > > ---------------------------------------------------------------------- > > > lttng create mySession > > Session mySession created. > > Traces will be written in > > /home/bernd/lttng-traces/mySession-20130319-145021 > > > > > lttng enable-event -a -k > > All kernel events are enabled in channel channel0 > > > > > lttng add-context -k -t perf:branch-misses -t perf:cache-misses > > PERROR: add context ioctl: Invalid argument [in > > kernel_add_channel_context() at kernel.c:47] > > Error: perf:cache-misses: Add kernel context failed > > PERROR: add context ioctl: Invalid argument [in > > kernel_add_channel_context() at kernel.c:47] > > Error: perf:branch-misses: Add kernel context failed > > Warning: Some command(s) went wrong > > > > ----------------------------------------------------------------------- > > My setup is: > > Ubuntu 12.04 with kernel 3.2.0-38 > > lttng-modules v2.1.1 > > lttng-tools v2.1.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 Wed Apr 10 10:22:23 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 10 Apr 2013 10:22:23 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix link: move -lrt at the end of the link line In-Reply-To: <1364755218-27374-1-git-send-email-simon.marchi@polymtl.ca> References: <1364755218-27374-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: <20130410142223.GA5448@Krystal> * Simon Marchi (simon.marchi at polymtl.ca) wrote: > It has to be after libconsumer.la. > why, what issue does it fix ? > Signed-off-by: Simon Marchi > --- > src/bin/lttng-consumerd/Makefile.am | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/src/bin/lttng-consumerd/Makefile.am b/src/bin/lttng-consumerd/Makefile.am > index a418eb4..d340c68 100644 > --- a/src/bin/lttng-consumerd/Makefile.am > +++ b/src/bin/lttng-consumerd/Makefile.am > @@ -4,10 +4,11 @@ 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 > + $(top_builddir)/src/common/libcommon.la \ > + -lrt > > if HAVE_LIBLTTNG_UST_CTL > lttng_consumerd_LDADD += -llttng-ust-ctl > -- > 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 Bernd.Hufmann at ericsson.com Wed Apr 10 11:16:10 2013 From: Bernd.Hufmann at ericsson.com (Bernd Hufmann) Date: Wed, 10 Apr 2013 11:16:10 -0400 Subject: [lttng-dev] Error using add-context for perf counters In-Reply-To: <20130410142108.GA5362@Krystal> References: <5148B66A.6080007@ericsson.com> <515C6F92.5060803@ericsson.com> <20130410142108.GA5362@Krystal> Message-ID: <5165823A.3020903@ericsson.com> Hi Mathieu I tried it with 2.2-rc1 and it also fails. I'll open a bug report for that. Thanks Bernd On 04/10/2013 10:21 AM, Mathieu Desnoyers wrote: > please open a bug report on the bug tracker for this issue if you still > see it. Please let us know if you see it in 2.2-rc1 too. > > * Matthew Khouzam (matthew.khouzam at ericsson.com) wrote: >> Hi, I can confirm this bug, Has anyone else tried it? >> >> On 13-03-19 03:03 PM, Bernd Hufmann wrote: >>> Hello >>> >>> I cannot add contexts for perf counters using lttng-tools v2.1.1 and I >>> get an error (see below). When using lttng-tools 2.0.5 (on a different >>> computer) it works. Could somebody from lttng development team look >>> into that? >>> >>> Thanks >>> Bernd >>> >>> ---------------------------------------------------------------------- >>>> lttng create mySession >>> Session mySession created. >>> Traces will be written in >>> /home/bernd/lttng-traces/mySession-20130319-145021 >>> >>>> lttng enable-event -a -k >>> All kernel events are enabled in channel channel0 >>> >>>> lttng add-context -k -t perf:branch-misses -t perf:cache-misses >>> PERROR: add context ioctl: Invalid argument [in >>> kernel_add_channel_context() at kernel.c:47] >>> Error: perf:cache-misses: Add kernel context failed >>> PERROR: add context ioctl: Invalid argument [in >>> kernel_add_channel_context() at kernel.c:47] >>> Error: perf:branch-misses: Add kernel context failed >>> Warning: Some command(s) went wrong >>> >>> ----------------------------------------------------------------------- >>> My setup is: >>> Ubuntu 12.04 with kernel 3.2.0-38 >>> lttng-modules v2.1.1 >>> lttng-tools v2.1.1 >>> >>> >>> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- This Communication is Confidential. We only send and receive email on the basis of the terms set out at www.ericsson.com/email_disclaimer From simon.marchi at polymtl.ca Wed Apr 10 11:44:19 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 10 Apr 2013 11:44:19 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix link: move -lrt at the end of the link line In-Reply-To: <20130410142223.GA5448@Krystal> References: <1364755218-27374-1-git-send-email-simon.marchi@polymtl.ca> <20130410142223.GA5448@Krystal> Message-ID: The problem was mentionned on the mailing list a few days ago [1]. "Recent" Ubuntus pass --as-needed to the linker [2], which makes it sensitive to the ordering of libraries on the command line. Libraries that resolve undefined symbols of other libs or objects must be specified after those other libs or objects (much like the behavior of old linkers, if I understand correctly). timer_settime is used in one of the LTTng libs and is defined in librt, so librt must be put after it. Me trying to compile lttng-tools on Ubuntu without the patch [3]. [1] http://lists.lttng.org/pipermail/lttng-dev/2013-March/019929.html [2] https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition [3] http://pastebin.com/G2pSkseF On 10 April 2013 10:22, Mathieu Desnoyers wrote: > * Simon Marchi (simon.marchi at polymtl.ca) wrote: >> It has to be after libconsumer.la. >> > > why, what issue does it fix ? > >> Signed-off-by: Simon Marchi >> --- >> src/bin/lttng-consumerd/Makefile.am | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/src/bin/lttng-consumerd/Makefile.am b/src/bin/lttng-consumerd/Makefile.am >> index a418eb4..d340c68 100644 >> --- a/src/bin/lttng-consumerd/Makefile.am >> +++ b/src/bin/lttng-consumerd/Makefile.am >> @@ -4,10 +4,11 @@ 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 >> + $(top_builddir)/src/common/libcommon.la \ >> + -lrt >> >> if HAVE_LIBLTTNG_UST_CTL >> lttng_consumerd_LDADD += -llttng-ust-ctl >> -- >> 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 Apr 10 12:01:01 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 10 Apr 2013 12:01:01 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix link: move -lrt at the end of the link line In-Reply-To: References: <1364755218-27374-1-git-send-email-simon.marchi@polymtl.ca> <20130410142223.GA5448@Krystal> Message-ID: <20130410160101.GA5945@Krystal> * Simon Marchi (simon.marchi at polymtl.ca) wrote: > The problem was mentionned on the mailing list a few days ago [1]. > > "Recent" Ubuntus pass --as-needed to the linker [2], which makes it > sensitive to the ordering of libraries on the command line. Libraries > that resolve undefined symbols of other libs or objects must be > specified after those other libs or objects (much like the behavior of > old linkers, if I understand correctly). timer_settime is used in one > of the LTTng libs and is defined in librt, so librt must be put after > it. Me trying to compile lttng-tools on Ubuntu without the patch [3]. > > [1] http://lists.lttng.org/pipermail/lttng-dev/2013-March/019929.html > [2] https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition > [3] http://pastebin.com/G2pSkseF OK, this should be added to the patch changelog. Thanks, Mathieu > > On 10 April 2013 10:22, Mathieu Desnoyers > wrote: > > * Simon Marchi (simon.marchi at polymtl.ca) wrote: > >> It has to be after libconsumer.la. > >> > > > > why, what issue does it fix ? > > > >> Signed-off-by: Simon Marchi > >> --- > >> src/bin/lttng-consumerd/Makefile.am | 5 +++-- > >> 1 file changed, 3 insertions(+), 2 deletions(-) > >> > >> diff --git a/src/bin/lttng-consumerd/Makefile.am b/src/bin/lttng-consumerd/Makefile.am > >> index a418eb4..d340c68 100644 > >> --- a/src/bin/lttng-consumerd/Makefile.am > >> +++ b/src/bin/lttng-consumerd/Makefile.am > >> @@ -4,10 +4,11 @@ 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 > >> + $(top_builddir)/src/common/libcommon.la \ > >> + -lrt > >> > >> if HAVE_LIBLTTNG_UST_CTL > >> lttng_consumerd_LDADD += -llttng-ust-ctl > >> -- > >> 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 -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jan.glauber at gmail.com Wed Apr 10 12:02:34 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Wed, 10 Apr 2013 18:02:34 +0200 Subject: [lttng-dev] LTTng system call tracing on ARM In-Reply-To: References: <20130410084053.GB25958@hal> <20130410130246.GA12801@hal> Message-ID: <20130410160233.GA17568@hal> On Wed, Apr 10, 2013 at 09:38:33AM -0400, Pierre-Luc St-Charles wrote: > Here are the links I stashed a while back about previous patching attempts > to add syscall tracepoints to the ARM kernel : > > Most promising: > http://www.spinics.net/lists/arm-kernel/msg166419.html > > Earlier draft(s): > http://lists.infradead.org/pipermail/linux-arm-kernel/2012-February/086974.html > https://lkml.org/lkml/2011/12/1/131 > http://comments.gmane.org/gmane.linux.ports.arm.kernel/141933 > > I believe the first link shows the most refined patch there is out there, > but it might take some minor tinkering to apply it to a different kernel > version. I briefly tried to apply it to the 3.0.31 kernel, but it's a bit > out of my 'tinkering' range, and I never finished it. > > > Good luck! Thanks, fortunately I'm targeting 3.4. It wasn't too hard, got the kernel running and ftrace already works. Now I'm facing something hilarious, on loading the lttng-tracer module I get: Error: could not insert module lttng-tracer.ko: Cannot allocate memory [15912.259399] alloc_vmap_area: 2 callbacks suppressed [15912.264953] vmap allocation for size 15998976 failed: use vmalloc= to increase size. [15912.273895] vmalloc: allocation failure: 15991653 bytes [15912.279602] insmod: page allocation failure: order:0, mode:0xd0 Never saw vmalloc fail on loading a kernel module before. Hmmm. Looking at the module reveals: -rw-rw-r-- 1 jang jang 16036281 Apr 10 17:48 lttng-tracer.ko Wow. 16 megs for a kernel module ?!? readelf says its all in .rodata. Doing an objdump on that Disassembly of section .rodata: 00000000 : ... 1714: 00f0a788 rscseq sl, r0, r8, lsl #15 1718: 00f0a7a0 rscseq sl, r0, r0, lsr #15 171c: 00000004 andeq r0, r0, r4 ... f00054: 00f0a860 rscseq sl, r0, r0, ror #16 f00058: 00f0a878 rscseq sl, r0, r8, ror r8 f0005c: 00000002 andeq r0, r0, r2 Now whats that? A big hole in the system call table? Digging through the various defines and headers of lttng-modules I've found: instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_integers_override.h: ... #define OVERRIDE_TABLE_32_sys_set_tls TRACE_SYSCALL_TABLE(sys_set_tls, sys_set_tls, 0xf0005, 2) Weird ARM apparently expanded the system call area above 0xf0000. I don't understand why this override logic is needed but removing that define results in a kernel module with a much more sane size. LTTng system call tracing works with that change for me. Any idea on how the override problem can be solved with the magic system calls? --Jan > -PL > > > > On Wed, Apr 10, 2013 at 9:02 AM, Jan Glauber wrote: > > > On Wed, Apr 10, 2013 at 08:37:18AM -0400, PLSTC wrote: > > > Hey Jan, > > > > > > I cannot speak on behalf of everyone here, but during our attempt to port > > > LTTng to Android, we also noticed that the kernels we were using (3.0.x) > > > were nowhere near the requirements for syscall tracepoints support. I > > > believe such support was added on x86/64 way earlier (early 3.x) than on > > > ARM, which is why it was included in LTTng's modules a while ago. Simply > > > put, the ARM kernel is late. > > > > OK, so for ARM kernel version 3.6 is the minimum unless the syscall > > tracepoint > > support is backported. > > > > > There are a few actuals ways to 'enable' syscall tracepoints support on > > > early ARM kernels, but they all including a bit of kernel > > hacking/patching. > > > I could send you some links if you're interested in that. > > > > Yes, sure! > > > > --Jan > > > > > -PL > > > On Apr 10, 2013 4:40 AM, "Jan Glauber" wrote: > > > > > > > Hi, > > > > > > > > I want to use LTTng for system call tracing on ARM. Now lttng-modules > > seems > > > > to support system call tracing on ARM already since > > > > "8f4f80e LTTng Modules ARM syscall instrumentation". > > > > > > > > But I wonder how that worked since lttng-syscalls.c is only build under > > > > CONFIG_HAVE_SYSCALL_TRACEPOINTS and that was added to ARM only with > > kernel > > > > 3.6 > > > > (much after than the lttng-modules commit). > > > > > > > > Am I missing something? Is system call tracing working on ARM with the > > > > upstream > > > > LTTng version? > > > > > > > > thanks, > > > > Jan > > > > > > > > _______________________________________________ > > > > 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 Wed Apr 10 12:09:12 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Wed, 10 Apr 2013 12:09:12 -0400 Subject: [lttng-dev] LTTng system call tracing on ARM In-Reply-To: <20130410160233.GA17568@hal> References: <20130410084053.GB25958@hal> <20130410130246.GA12801@hal> <20130410160233.GA17568@hal> Message-ID: Hi Jan, This seems related to bug #472 [1]. CCing Mathieu. Christian [1] - http://bugs.lttng.org/issues/472 On Wed, Apr 10, 2013 at 12:02 PM, Jan Glauber wrote: > On Wed, Apr 10, 2013 at 09:38:33AM -0400, Pierre-Luc St-Charles wrote: >> Here are the links I stashed a while back about previous patching attempts >> to add syscall tracepoints to the ARM kernel : >> >> Most promising: >> http://www.spinics.net/lists/arm-kernel/msg166419.html >> >> Earlier draft(s): >> http://lists.infradead.org/pipermail/linux-arm-kernel/2012-February/086974.html >> https://lkml.org/lkml/2011/12/1/131 >> http://comments.gmane.org/gmane.linux.ports.arm.kernel/141933 >> >> I believe the first link shows the most refined patch there is out there, >> but it might take some minor tinkering to apply it to a different kernel >> version. I briefly tried to apply it to the 3.0.31 kernel, but it's a bit >> out of my 'tinkering' range, and I never finished it. >> >> >> Good luck! > > Thanks, fortunately I'm targeting 3.4. It wasn't too hard, got the kernel running > and ftrace already works. > > Now I'm facing something hilarious, on loading the lttng-tracer module I get: > > Error: could not insert module lttng-tracer.ko: Cannot allocate memory > > [15912.259399] alloc_vmap_area: 2 callbacks suppressed > [15912.264953] vmap allocation for size 15998976 failed: use vmalloc= to increase size. > [15912.273895] vmalloc: allocation failure: 15991653 bytes > [15912.279602] insmod: page allocation failure: order:0, mode:0xd0 > > Never saw vmalloc fail on loading a kernel module before. Hmmm. > Looking at the module reveals: > -rw-rw-r-- 1 jang jang 16036281 Apr 10 17:48 lttng-tracer.ko > > Wow. 16 megs for a kernel module ?!? readelf says its all in .rodata. > > Doing an objdump on that > Disassembly of section .rodata: > > 00000000 : > ... > 1714: 00f0a788 rscseq sl, r0, r8, lsl #15 > 1718: 00f0a7a0 rscseq sl, r0, r0, lsr #15 > 171c: 00000004 andeq r0, r0, r4 > ... > f00054: 00f0a860 rscseq sl, r0, r0, ror #16 > f00058: 00f0a878 rscseq sl, r0, r8, ror r8 > f0005c: 00000002 andeq r0, r0, r2 > > Now whats that? A big hole in the system call table? > > Digging through the various defines and headers of lttng-modules I've found: > > instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_integers_override.h: > ... > #define OVERRIDE_TABLE_32_sys_set_tls > TRACE_SYSCALL_TABLE(sys_set_tls, sys_set_tls, 0xf0005, 2) > > Weird ARM apparently expanded the system call area above 0xf0000. I don't > understand why this override logic is needed but removing that define results > in a kernel module with a much more sane size. > > LTTng system call tracing works with that change for me. > > Any idea on how the override problem can be solved with the magic system calls? > > --Jan > >> -PL >> >> >> >> On Wed, Apr 10, 2013 at 9:02 AM, Jan Glauber wrote: >> >> > On Wed, Apr 10, 2013 at 08:37:18AM -0400, PLSTC wrote: >> > > Hey Jan, >> > > >> > > I cannot speak on behalf of everyone here, but during our attempt to port >> > > LTTng to Android, we also noticed that the kernels we were using (3.0.x) >> > > were nowhere near the requirements for syscall tracepoints support. I >> > > believe such support was added on x86/64 way earlier (early 3.x) than on >> > > ARM, which is why it was included in LTTng's modules a while ago. Simply >> > > put, the ARM kernel is late. >> > >> > OK, so for ARM kernel version 3.6 is the minimum unless the syscall >> > tracepoint >> > support is backported. >> > >> > > There are a few actuals ways to 'enable' syscall tracepoints support on >> > > early ARM kernels, but they all including a bit of kernel >> > hacking/patching. >> > > I could send you some links if you're interested in that. >> > >> > Yes, sure! >> > >> > --Jan >> > >> > > -PL >> > > On Apr 10, 2013 4:40 AM, "Jan Glauber" wrote: >> > > >> > > > Hi, >> > > > >> > > > I want to use LTTng for system call tracing on ARM. Now lttng-modules >> > seems >> > > > to support system call tracing on ARM already since >> > > > "8f4f80e LTTng Modules ARM syscall instrumentation". >> > > > >> > > > But I wonder how that worked since lttng-syscalls.c is only build under >> > > > CONFIG_HAVE_SYSCALL_TRACEPOINTS and that was added to ARM only with >> > kernel >> > > > 3.6 >> > > > (much after than the lttng-modules commit). >> > > > >> > > > Am I missing something? Is system call tracing working on ARM with the >> > > > upstream >> > > > LTTng version? >> > > > >> > > > thanks, >> > > > Jan >> > > > >> > > > _______________________________________________ >> > > > 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 mathieu.desnoyers at efficios.com Wed Apr 10 12:20:12 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 10 Apr 2013 12:20:12 -0400 Subject: [lttng-dev] LTTng system call tracing on ARM In-Reply-To: <20130410160233.GA17568@hal> References: <20130410084053.GB25958@hal> <20130410130246.GA12801@hal> <20130410160233.GA17568@hal> Message-ID: <20130410162012.GA6525@Krystal> * Jan Glauber (jan.glauber at gmail.com) wrote: > On Wed, Apr 10, 2013 at 09:38:33AM -0400, Pierre-Luc St-Charles wrote: > > Here are the links I stashed a while back about previous patching attempts > > to add syscall tracepoints to the ARM kernel : > > > > Most promising: > > http://www.spinics.net/lists/arm-kernel/msg166419.html > > > > Earlier draft(s): > > http://lists.infradead.org/pipermail/linux-arm-kernel/2012-February/086974.html > > https://lkml.org/lkml/2011/12/1/131 > > http://comments.gmane.org/gmane.linux.ports.arm.kernel/141933 > > > > I believe the first link shows the most refined patch there is out there, > > but it might take some minor tinkering to apply it to a different kernel > > version. I briefly tried to apply it to the 3.0.31 kernel, but it's a bit > > out of my 'tinkering' range, and I never finished it. > > > > > > Good luck! > > Thanks, fortunately I'm targeting 3.4. It wasn't too hard, got the kernel running > and ftrace already works. > > Now I'm facing something hilarious, on loading the lttng-tracer module I get: > > Error: could not insert module lttng-tracer.ko: Cannot allocate memory > > [15912.259399] alloc_vmap_area: 2 callbacks suppressed > [15912.264953] vmap allocation for size 15998976 failed: use vmalloc= to increase size. > [15912.273895] vmalloc: allocation failure: 15991653 bytes > [15912.279602] insmod: page allocation failure: order:0, mode:0xd0 > > Never saw vmalloc fail on loading a kernel module before. Hmmm. > Looking at the module reveals: > -rw-rw-r-- 1 jang jang 16036281 Apr 10 17:48 lttng-tracer.ko > > Wow. 16 megs for a kernel module ?!? readelf says its all in .rodata. > > Doing an objdump on that > Disassembly of section .rodata: > > 00000000 : > ... > 1714: 00f0a788 rscseq sl, r0, r8, lsl #15 > 1718: 00f0a7a0 rscseq sl, r0, r0, lsr #15 > 171c: 00000004 andeq r0, r0, r4 > ... > f00054: 00f0a860 rscseq sl, r0, r0, ror #16 > f00058: 00f0a878 rscseq sl, r0, r8, ror r8 > f0005c: 00000002 andeq r0, r0, r2 > > Now whats that? A big hole in the system call table? > > Digging through the various defines and headers of lttng-modules I've found: > > instrumentation/syscalls/headers/arm-32-syscalls-2.6.38_integers_override.h: > ... > #define OVERRIDE_TABLE_32_sys_set_tls > TRACE_SYSCALL_TABLE(sys_set_tls, sys_set_tls, 0xf0005, 2) > > Weird ARM apparently expanded the system call area above 0xf0000. I don't > understand why this override logic is needed but removing that define results > in a kernel module with a much more sane size. > > LTTng system call tracing works with that change for me. > > Any idea on how the override problem can be solved with the magic system calls? Thanks for the detailed report !! Please try with this commit: commit 11fa478f18241fedee86f7dc7820a91c629c9e7e Author: Mathieu Desnoyers Date: Wed Apr 10 12:14:38 2013 -0400 Fix: remove ARM set_tls system call override We'll need to find a better way to instrument ARM-specific system calls located at a far offset from the standard systems calls. A 16MB lttng-modules kernel module is really not acceptable. Removing this instrumentation for now. sys_set_tls will appear as sys_unknown. Fixes #472 CC: Ryan Kyser Ref: http://lists.lttng.org/pipermail/lttng-dev/2013-April/019990.html Signed-off-by: Mathieu Desnoyers 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 index 93b8674..895370f 100644 --- 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 @@ -2,7 +2,6 @@ #define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 #define OVERRIDE_TABLE_32_sys_sync_file_range2 -#define OVERRIDE_TABLE_32_sys_set_tls #ifndef CREATE_SYSCALL_TABLE @@ -38,18 +37,6 @@ SC_TRACE_EVENT(sys_sync_file_range2, TP_printk() ) -SC_TRACE_EVENT(sys_set_tls, - TP_PROTO(unsigned int tid, unsigned long tls), - TP_ARGS(tid, tls), - TP_STRUCT__entry( - __field(unsigned int, tid) - __field_hex(unsigned int, tls)), - TP_fast_assign( - tp_assign(tid, tid) - tp_assign(tls, tls)), - TP_printk() -) - #else /* CREATE_SYSCALL_TABLE */ #define OVVERRIDE_TABLE_32_sys_mmap @@ -59,9 +46,6 @@ TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) 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) -#define OVERRIDE_TABLE_32_sys_set_tls -TRACE_SYSCALL_TABLE(sys_set_tls, sys_set_tls, 0xf0005, 2) - #endif /* CREATE_SYSCALL_TABLE */ > > --Jan > > > -PL > > > > > > > > On Wed, Apr 10, 2013 at 9:02 AM, Jan Glauber wrote: > > > > > On Wed, Apr 10, 2013 at 08:37:18AM -0400, PLSTC wrote: > > > > Hey Jan, > > > > > > > > I cannot speak on behalf of everyone here, but during our attempt to port > > > > LTTng to Android, we also noticed that the kernels we were using (3.0.x) > > > > were nowhere near the requirements for syscall tracepoints support. I > > > > believe such support was added on x86/64 way earlier (early 3.x) than on > > > > ARM, which is why it was included in LTTng's modules a while ago. Simply > > > > put, the ARM kernel is late. > > > > > > OK, so for ARM kernel version 3.6 is the minimum unless the syscall > > > tracepoint > > > support is backported. > > > > > > > There are a few actuals ways to 'enable' syscall tracepoints support on > > > > early ARM kernels, but they all including a bit of kernel > > > hacking/patching. > > > > I could send you some links if you're interested in that. > > > > > > Yes, sure! > > > > > > --Jan > > > > > > > -PL > > > > On Apr 10, 2013 4:40 AM, "Jan Glauber" wrote: > > > > > > > > > Hi, > > > > > > > > > > I want to use LTTng for system call tracing on ARM. Now lttng-modules > > > seems > > > > > to support system call tracing on ARM already since > > > > > "8f4f80e LTTng Modules ARM syscall instrumentation". > > > > > > > > > > But I wonder how that worked since lttng-syscalls.c is only build under > > > > > CONFIG_HAVE_SYSCALL_TRACEPOINTS and that was added to ARM only with > > > kernel > > > > > 3.6 > > > > > (much after than the lttng-modules commit). > > > > > > > > > > Am I missing something? Is system call tracing working on ARM with the > > > > > upstream > > > > > LTTng version? > > > > > > > > > > thanks, > > > > > Jan > > > > > > > > > > _______________________________________________ > > > > > 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 jan.glauber at gmail.com Wed Apr 10 12:30:57 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Wed, 10 Apr 2013 18:30:57 +0200 Subject: [lttng-dev] LTTng system call tracing on ARM In-Reply-To: <20130410162012.GA6525@Krystal> References: <20130410084053.GB25958@hal> <20130410130246.GA12801@hal> <20130410160233.GA17568@hal> <20130410162012.GA6525@Krystal> Message-ID: <20130410163055.GA18278@hal> On Wed, Apr 10, 2013 at 12:20:12PM -0400, Mathieu Desnoyers wrote: > > Thanks for the detailed report !! > > Please try with this commit: Yes, that patch works. But I'm still curious if you can explain what the override was for ;- --Jan > commit 11fa478f18241fedee86f7dc7820a91c629c9e7e > Author: Mathieu Desnoyers > Date: Wed Apr 10 12:14:38 2013 -0400 > > Fix: remove ARM set_tls system call override > > We'll need to find a better way to instrument ARM-specific system calls > located at a far offset from the standard systems calls. A 16MB > lttng-modules kernel module is really not acceptable. > > Removing this instrumentation for now. sys_set_tls will appear as > sys_unknown. > > Fixes #472 > > CC: Ryan Kyser > Ref: http://lists.lttng.org/pipermail/lttng-dev/2013-April/019990.html > Signed-off-by: Mathieu Desnoyers > > 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 > index 93b8674..895370f 100644 > --- 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 > @@ -2,7 +2,6 @@ > > #define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 > #define OVERRIDE_TABLE_32_sys_sync_file_range2 > -#define OVERRIDE_TABLE_32_sys_set_tls > > #ifndef CREATE_SYSCALL_TABLE > > @@ -38,18 +37,6 @@ SC_TRACE_EVENT(sys_sync_file_range2, > TP_printk() > ) > > -SC_TRACE_EVENT(sys_set_tls, > - TP_PROTO(unsigned int tid, unsigned long tls), > - TP_ARGS(tid, tls), > - TP_STRUCT__entry( > - __field(unsigned int, tid) > - __field_hex(unsigned int, tls)), > - TP_fast_assign( > - tp_assign(tid, tid) > - tp_assign(tls, tls)), > - TP_printk() > -) > - > #else /* CREATE_SYSCALL_TABLE */ > > #define OVVERRIDE_TABLE_32_sys_mmap > @@ -59,9 +46,6 @@ TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) > 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) > -#define OVERRIDE_TABLE_32_sys_set_tls > -TRACE_SYSCALL_TABLE(sys_set_tls, sys_set_tls, 0xf0005, 2) > - > > #endif /* CREATE_SYSCALL_TABLE */ > > > > > > > --Jan > > > > > -PL > > > > > > > > > > > > On Wed, Apr 10, 2013 at 9:02 AM, Jan Glauber wrote: > > > > > > > On Wed, Apr 10, 2013 at 08:37:18AM -0400, PLSTC wrote: > > > > > Hey Jan, > > > > > > > > > > I cannot speak on behalf of everyone here, but during our attempt to port > > > > > LTTng to Android, we also noticed that the kernels we were using (3.0.x) > > > > > were nowhere near the requirements for syscall tracepoints support. I > > > > > believe such support was added on x86/64 way earlier (early 3.x) than on > > > > > ARM, which is why it was included in LTTng's modules a while ago. Simply > > > > > put, the ARM kernel is late. > > > > > > > > OK, so for ARM kernel version 3.6 is the minimum unless the syscall > > > > tracepoint > > > > support is backported. > > > > > > > > > There are a few actuals ways to 'enable' syscall tracepoints support on > > > > > early ARM kernels, but they all including a bit of kernel > > > > hacking/patching. > > > > > I could send you some links if you're interested in that. > > > > > > > > Yes, sure! > > > > > > > > --Jan > > > > > > > > > -PL > > > > > On Apr 10, 2013 4:40 AM, "Jan Glauber" wrote: > > > > > > > > > > > Hi, > > > > > > > > > > > > I want to use LTTng for system call tracing on ARM. Now lttng-modules > > > > seems > > > > > > to support system call tracing on ARM already since > > > > > > "8f4f80e LTTng Modules ARM syscall instrumentation". > > > > > > > > > > > > But I wonder how that worked since lttng-syscalls.c is only build under > > > > > > CONFIG_HAVE_SYSCALL_TRACEPOINTS and that was added to ARM only with > > > > kernel > > > > > > 3.6 > > > > > > (much after than the lttng-modules commit). > > > > > > > > > > > > Am I missing something? Is system call tracing working on ARM with the > > > > > > upstream > > > > > > LTTng version? > > > > > > > > > > > > thanks, > > > > > > Jan > > > > > > > > > > > > _______________________________________________ > > > > > > 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 Apr 10 12:39:50 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 10 Apr 2013 12:39:50 -0400 Subject: [lttng-dev] LTTng system call tracing on ARM In-Reply-To: <20130410163055.GA18278@hal> References: <20130410084053.GB25958@hal> <20130410130246.GA12801@hal> <20130410160233.GA17568@hal> <20130410162012.GA6525@Krystal> <20130410163055.GA18278@hal> Message-ID: <20130410163950.GA6879@Krystal> * Jan Glauber (jan.glauber at gmail.com) wrote: > On Wed, Apr 10, 2013 at 12:20:12PM -0400, Mathieu Desnoyers wrote: > > > > Thanks for the detailed report !! > > > > Please try with this commit: > > Yes, that patch works. But I'm still curious if you can explain what the > override was for ;- The "override" allows defining how to serialize the information for specific system calls. It can either replace the behavior of the "semi-automated" description of the system call (brought into lttng-modules by means of the system call extractor script), or just provide the serialization description for a system call that was not available to the system call extractor. In this case, sys_set_tls was not available for automated extraction, so the override entry has been added to it would not appear as a "sys_unknown" system call, but would rather show "sys_set_tls" along with the well-printed system call arguments. You may want to have a look at: lttng-modules/instrumentation/syscalls/README for details. If we want to handle the set_tls special-case (and same for other ARM-specific syscalls), we'll probably want to do that with a arm-specific table that will contain those system calls. Thanks, Mathieu > > --Jan > > > commit 11fa478f18241fedee86f7dc7820a91c629c9e7e > > Author: Mathieu Desnoyers > > Date: Wed Apr 10 12:14:38 2013 -0400 > > > > Fix: remove ARM set_tls system call override > > > > We'll need to find a better way to instrument ARM-specific system calls > > located at a far offset from the standard systems calls. A 16MB > > lttng-modules kernel module is really not acceptable. > > > > Removing this instrumentation for now. sys_set_tls will appear as > > sys_unknown. > > > > Fixes #472 > > > > CC: Ryan Kyser > > Ref: http://lists.lttng.org/pipermail/lttng-dev/2013-April/019990.html > > Signed-off-by: Mathieu Desnoyers > > > > 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 > > index 93b8674..895370f 100644 > > --- 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 > > @@ -2,7 +2,6 @@ > > > > #define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 > > #define OVERRIDE_TABLE_32_sys_sync_file_range2 > > -#define OVERRIDE_TABLE_32_sys_set_tls > > > > #ifndef CREATE_SYSCALL_TABLE > > > > @@ -38,18 +37,6 @@ SC_TRACE_EVENT(sys_sync_file_range2, > > TP_printk() > > ) > > > > -SC_TRACE_EVENT(sys_set_tls, > > - TP_PROTO(unsigned int tid, unsigned long tls), > > - TP_ARGS(tid, tls), > > - TP_STRUCT__entry( > > - __field(unsigned int, tid) > > - __field_hex(unsigned int, tls)), > > - TP_fast_assign( > > - tp_assign(tid, tid) > > - tp_assign(tls, tls)), > > - TP_printk() > > -) > > - > > #else /* CREATE_SYSCALL_TABLE */ > > > > #define OVVERRIDE_TABLE_32_sys_mmap > > @@ -59,9 +46,6 @@ TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) > > 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) > > -#define OVERRIDE_TABLE_32_sys_set_tls > > -TRACE_SYSCALL_TABLE(sys_set_tls, sys_set_tls, 0xf0005, 2) > > - > > > > #endif /* CREATE_SYSCALL_TABLE */ > > > > > > > > > > > > --Jan > > > > > > > -PL > > > > > > > > > > > > > > > > On Wed, Apr 10, 2013 at 9:02 AM, Jan Glauber wrote: > > > > > > > > > On Wed, Apr 10, 2013 at 08:37:18AM -0400, PLSTC wrote: > > > > > > Hey Jan, > > > > > > > > > > > > I cannot speak on behalf of everyone here, but during our attempt to port > > > > > > LTTng to Android, we also noticed that the kernels we were using (3.0.x) > > > > > > were nowhere near the requirements for syscall tracepoints support. I > > > > > > believe such support was added on x86/64 way earlier (early 3.x) than on > > > > > > ARM, which is why it was included in LTTng's modules a while ago. Simply > > > > > > put, the ARM kernel is late. > > > > > > > > > > OK, so for ARM kernel version 3.6 is the minimum unless the syscall > > > > > tracepoint > > > > > support is backported. > > > > > > > > > > > There are a few actuals ways to 'enable' syscall tracepoints support on > > > > > > early ARM kernels, but they all including a bit of kernel > > > > > hacking/patching. > > > > > > I could send you some links if you're interested in that. > > > > > > > > > > Yes, sure! > > > > > > > > > > --Jan > > > > > > > > > > > -PL > > > > > > On Apr 10, 2013 4:40 AM, "Jan Glauber" wrote: > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > I want to use LTTng for system call tracing on ARM. Now lttng-modules > > > > > seems > > > > > > > to support system call tracing on ARM already since > > > > > > > "8f4f80e LTTng Modules ARM syscall instrumentation". > > > > > > > > > > > > > > But I wonder how that worked since lttng-syscalls.c is only build under > > > > > > > CONFIG_HAVE_SYSCALL_TRACEPOINTS and that was added to ARM only with > > > > > kernel > > > > > > > 3.6 > > > > > > > (much after than the lttng-modules commit). > > > > > > > > > > > > > > Am I missing something? Is system call tracing working on ARM with the > > > > > > > upstream > > > > > > > LTTng version? > > > > > > > > > > > > > > thanks, > > > > > > > Jan > > > > > > > > > > > > > > _______________________________________________ > > > > > > > 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 -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From simon.marchi at polymtl.ca Wed Apr 10 14:23:34 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 10 Apr 2013 14:23:34 -0400 Subject: [lttng-dev] [RFC PATCH lttng-tools v3] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <51644824.6000505@efficios.com> References: <1365439209-27624-1-git-send-email-simon.marchi@polymtl.ca> <51644824.6000505@efficios.com> Message-ID: On 9 April 2013 12:56, David Goulet wrote: >> @@ -77,3 +79,122 @@ void list_cmd_options(FILE *ofp, struct poptOption *options) >> } >> } >> } >> + >> +/** >> + * 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 = regerror(errcode, regex, NULL, 0); >> + char *buffer = malloc(length); > > I know it's not _necessary_ but I would prefer to have the same std > across the code. So, we usually declare the variables without > assignation (that comes from a function call), then use assert() for > given params (if needed) and finally used them. > > Here, declare length and buffer without assignation. Assert on "regex != > NULL" because a NULL value seems to me that it might break (or > segfault). Finally, set length, check the return error code and set > buffer checking also for errors. > > Use zmalloc also please. Ok, no problem. There is nothing specified for the return value of regerror so there is nothing to check. Actually, it does abort() if you pass a wrong error code... > I wonder if these *_LOG2 should go in default.h ? Thoughts? I see default.h as a place you put default arbitrary values for buffer sizes, paths, names, etc. KIBI_LOG2 and al are not values you decide. I think they are fine in utils.h. > If regex was uninit like for instance on regcomp error, does this call > behaves well ? Good catch, changed. "Ack" for all other comments. Thanks, Simon From simon.marchi at polymtl.ca Wed Apr 10 14:52:21 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 10 Apr 2013 14:52:21 -0400 Subject: [lttng-dev] [RFC PATCH lttng-tools v4] lttng cli: Accept human readable sizes for --subbuf-size Message-ID: <1365619941-16708-1-git-send-email-simon.marchi@polymtl.ca> --subbuf-size accepts sizes such as: - 123 -> 123 - 123k -> 123 * 1024 - 123M -> 123 * 1024 * 1024 - 123G -> 123 * 1024 * 1024 * 1024 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 v4: - Changes following David Goulet's comments - Move stuff in src/common/utils.{c,h} - malloc -> zmalloc - Formatting src/bin/lttng/commands/enable_channels.c | 21 ++++- src/common/utils.c | 124 ++++++++++++++++++++++++++++++ src/common/utils.h | 8 ++ tests/unit/Makefile.am | 15 +++- tests/unit/test_parse_size_suffix.c | 73 ++++++++++++++++++ 5 files changed, 235 insertions(+), 6 deletions(-) create mode 100644 tests/unit/test_parse_size_suffix.c diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index d026af4..dbec8ab 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 (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..9e8fd9d 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -386,3 +387,126 @@ 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); + 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 * 1024 + * 'G': 1024 * 1024 * 1024 + * + * @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 parse_size_suffix(char *str, uint64_t *size) +{ + regex_t regex; + int ret; + const int nmatch = 2; + regmatch_t suffix_match, matches[nmatch]; + + if (!str) { + return 0; + } + + /* Compile regex */ + ret = regcomp(®ex, "^[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 ! */ + unsigned long long base_size; + long shift = 0; + errno = 0; + base_size = strtoull(str, NULL, 10); + /* Check result of conversion */ + if (errno != 0) { + PERROR("strtoull"); + ret = -1; + goto free; + } + + /* Check if there is a suffix */ + suffix_match = matches[1]; + 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..61faa4e 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); diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 67e7fe4..4c15731 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_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 +PARSE_SIZE_SUFFIX=$(top_srcdir)/src/common/utils.o \ + $(top_srcdir)/src/common/runas.o + +test_parse_size_suffix_SOURCES = test_parse_size_suffix.c +test_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) +test_parse_size_suffix_LDADD += $(PARSE_SIZE_SUFFIX) diff --git a/tests/unit/test_parse_size_suffix.c b/tests/unit/test_parse_size_suffix.c new file mode 100644 index 0000000..d3c3bda --- /dev/null +++ b/tests/unit/test_parse_size_suffix.c @@ -0,0 +1,73 @@ +/* + * 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; + +/* Valid test cases */ +static char *valid_tests_inputs[] = { "0", "1234", "16k", "128K", "32M", "1024G" }; +static uint64_t valid_tests_expected_results[] = {0, 1234, 16384, 131072, 33554432, 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]); + +void test_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, "testing %s", valid_tests_inputs[i]); + + ret = parse_size_suffix(valid_tests_inputs[i], &result); + ok(ret == 0 && result == valid_tests_expected_results[i], name); + } + + // Test invalid cases + for (i = 0; i < num_invalid_tests; i++) { + char name[100]; + sprintf(name, "testing %s", invalid_tests_inputs[i]); + + ret = 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("parse_size_suffix tests"); + + test_parse_size_suffix(); + + return exit_status(); +} -- 1.7.10.4 From jeremie.galarneau at efficios.com Wed Apr 10 17:28:16 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Wed, 10 Apr 2013 17:28:16 -0400 Subject: [lttng-dev] GSoC 2013 proposal - Babeltrace python bindings In-Reply-To: References: Message-ID: Hi Xuan, There is no public API list that I know of. You'll want to have a look at the public headers in the include/babeltrace folder. There is also an official Babeltrace API documentation in doc/API.txt that provides a high-level description of the interface and the terminology used. J?r?mie On Wed, Apr 10, 2013 at 1:23 AM, Xuan Hu wrote: > Hi, jgalar. > > Thx for your detailed clarification. I will begin with looking throuth the > CTF specification and investigation with the code of bing/python branch. > I have one little question, where can I find the list of libbabeltrace's > public API? And I also failed to find documents tends for developments and > contributors. I think these would be helpful for me to get fimiliar with > our projects. :-) > > Wish for your reply. > > > On Wed, Apr 10, 2013 at 3:37 AM, J?r?mie Galarneau < > jeremie.galarneau at efficios.com> wrote: > >> Hi Xuan, >> >> First, thanks for reaching out! >> >> Basically, the Babeltrace Python bindings project aims at providing >> Python developers with a library to read the trace formats supported by >> Babeltrace. I'll take the chance to detail what we had in mind with this >> project. >> >> The first part consists of producing Python bindings to libbabeltrace's >> public API. This has already been done last summer but is not yet part of >> the master branch. It currently lives in the "bindings/python" branch of >> Babeltrace's repository[1]. However, it is not completely up-to-date and >> lacks thorough testing. >> >> The second part, which is more of an interface design exercise, is >> exposing the trace data read by libbabeltrace in a "Pythonic" way. That >> includes implementing Python's generator-iterator interface, expressing the >> trace metadata using Python's data structures, etc. libbabeltrace can also >> be used as a trace writer so the Python interface should expose this >> functionality by providing a symmetric output interface. All in all, it >> calls for a lot more design work than actual implementation. >> >> For starters, you may want to have a look at the CTF specification[2], >> which is currently the only trace format supported by Babeltrace, to give >> you an idea of the challenges at hand. Trying out the complete LTTng >> toolchain will also give you a better view of this project. >> >> [1] >> https://bugs.lttng.org/projects/babeltrace/repository/show?rev=bindings%2Fpython >> [2] >> http://git.efficios.com/?p=ctf.git;a=blob_plain;f=common-trace-format-specification.txt;hb=master >> >> Don't hesitate to come forward and propose a tentative API or ask for >> clarifications. >> >> Regards, >> J?r?mie >> >> On Tue, Apr 9, 2013 at 5:38 AM, Xuan Hu wrote: >> >>> Hello everyone, >>> >>> I'm really interested in the project of `Babeltrace python bindings`. >>> Besides I'm confident with my python skill and I'm willing to study more >>> skills related. As far as I know, I think this is a somewhat standalone >>> project which should create a module for python programmers to get the >>> results which babeltrace produce. Wish potential mentor (jgalar) can judge >>> whether it is or not. Besides I wonder to know any suggestions for me to >>> begin with this project? >>> >>> -- >>> ?? Sean.Hu >>> >>> ????????????2012?????? >>> 2012, Master Degree Candidate, EECS, PKU >>> >>> Blog | GitHproposeub | >>> Twitter | Douban| >>> Google+ | Jiepang | >>> Weibo >>> >>> _______________________________________________ >>> 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 >> > > > > -- > ?? Sean.Hu > > ????????????2012?????? > 2012, Master Degree Candidate, EECS, PKU > > Blog | GitHub | Twitter| > Douban | Google+| > Jiepang | Weibo > -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeremie.galarneau at efficios.com Wed Apr 10 17:53:13 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Wed, 10 Apr 2013 17:53:13 -0400 Subject: [lttng-dev] Google Summer of Code In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD12D0DC32@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD12D0DC32@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: Certainly seems worthwhile to me although I never heard about debugfs being phased out. Could you clarify that point? J?r?mie On Tue, Apr 9, 2013 at 11:21 AM, Thibault, Daniel < Daniel.Thibault at drdc-rddc.gc.ca> wrote: > The Google Summer of Code LTTng entry ( > http://bugs.lttng.org/projects/lttng/wiki/Google_Summer_of_Code_2013) is > a promising initiative. May I propose another little project idea? > > Babeltrace support for the debugfs (/sys/kernel/debug/tracing) trace format > > Brief explanation: > Provide a Babeltrace plug-in to allow Babeltrace to read from traces > created by the debugfs service (/sys/kernel/debug/tracing/trace). > > Expected results: A Babeltrace plug-in, tests, examples and documentation. > > Skill level: Easy - Medium > > Prerequisite Knowledge: C, OO development > > Mentors: ? > > Even if the debugfs tracing facility is destined for eventual > withdrawal from the Linux kernel, it may be of interest to some to recover > older traces generated in this way -if only in order to be able to process > them in the same way as CTF text dumps. Conversion to the babeltrace text > format should be fairly straightforward; conversion to CTF would be > trickier. > > Is this idea worthwhile or worthless? > > 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 > -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.glauber at gmail.com Thu Apr 11 04:20:34 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Thu, 11 Apr 2013 10:20:34 +0200 Subject: [lttng-dev] LTTng system call tracing on ARM In-Reply-To: <20130410163950.GA6879@Krystal> References: <20130410084053.GB25958@hal> <20130410130246.GA12801@hal> <20130410160233.GA17568@hal> <20130410162012.GA6525@Krystal> <20130410163055.GA18278@hal> <20130410163950.GA6879@Krystal> Message-ID: <20130411082033.GA2314@hal> On Wed, Apr 10, 2013 at 12:39:50PM -0400, Mathieu Desnoyers wrote: > * Jan Glauber (jan.glauber at gmail.com) wrote: > > On Wed, Apr 10, 2013 at 12:20:12PM -0400, Mathieu Desnoyers wrote: > > > > > > Thanks for the detailed report !! > > > > > > Please try with this commit: > > > > Yes, that patch works. But I'm still curious if you can explain what the > > override was for ;- > > The "override" allows defining how to serialize the information for > specific system calls. It can either replace the behavior of the > "semi-automated" description of the system call (brought into > lttng-modules by means of the system call extractor script), or just > provide the serialization description for a system call that was not > available to the system call extractor. > > In this case, sys_set_tls was not available for automated extraction, so > the override entry has been added to it would not appear as a > "sys_unknown" system call, but would rather show "sys_set_tls" along > with the well-printed system call arguments. OK, thanks for explaining. So the version in instrumentation/syscalls/headers doesn't mean much, its just the starting point from where the extractor script picked up the descriptions. So we could append recent system calls without generating new headers for lets say 3.4. > You may want to have a look at: > > lttng-modules/instrumentation/syscalls/README > > for details. > > If we want to handle the set_tls special-case (and same for other > ARM-specific syscalls), we'll probably want to do that with a > arm-specific table that will contain those system calls. Yes, a seperate table would solve the issue. I don't know if ARM is the only arch doing such tricks to the system call table, so it might be worth checkingt that. Thanks, Jan > Thanks, > > Mathieu > > > > > > --Jan > > > > > commit 11fa478f18241fedee86f7dc7820a91c629c9e7e > > > Author: Mathieu Desnoyers > > > Date: Wed Apr 10 12:14:38 2013 -0400 > > > > > > Fix: remove ARM set_tls system call override > > > > > > We'll need to find a better way to instrument ARM-specific system calls > > > located at a far offset from the standard systems calls. A 16MB > > > lttng-modules kernel module is really not acceptable. > > > > > > Removing this instrumentation for now. sys_set_tls will appear as > > > sys_unknown. > > > > > > Fixes #472 > > > > > > CC: Ryan Kyser > > > Ref: http://lists.lttng.org/pipermail/lttng-dev/2013-April/019990.html > > > Signed-off-by: Mathieu Desnoyers > > > > > > 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 > > > index 93b8674..895370f 100644 > > > --- 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 > > > @@ -2,7 +2,6 @@ > > > > > > #define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 > > > #define OVERRIDE_TABLE_32_sys_sync_file_range2 > > > -#define OVERRIDE_TABLE_32_sys_set_tls > > > > > > #ifndef CREATE_SYSCALL_TABLE > > > > > > @@ -38,18 +37,6 @@ SC_TRACE_EVENT(sys_sync_file_range2, > > > TP_printk() > > > ) > > > > > > -SC_TRACE_EVENT(sys_set_tls, > > > - TP_PROTO(unsigned int tid, unsigned long tls), > > > - TP_ARGS(tid, tls), > > > - TP_STRUCT__entry( > > > - __field(unsigned int, tid) > > > - __field_hex(unsigned int, tls)), > > > - TP_fast_assign( > > > - tp_assign(tid, tid) > > > - tp_assign(tls, tls)), > > > - TP_printk() > > > -) > > > - > > > #else /* CREATE_SYSCALL_TABLE */ > > > > > > #define OVVERRIDE_TABLE_32_sys_mmap > > > @@ -59,9 +46,6 @@ TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) > > > 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) > > > -#define OVERRIDE_TABLE_32_sys_set_tls > > > -TRACE_SYSCALL_TABLE(sys_set_tls, sys_set_tls, 0xf0005, 2) > > > - > > > > > > #endif /* CREATE_SYSCALL_TABLE */ > > > > > > > > > > > > > > > > > --Jan > > > > > > > > > -PL > > > > > > > > > > > > > > > > > > > > On Wed, Apr 10, 2013 at 9:02 AM, Jan Glauber wrote: > > > > > > > > > > > On Wed, Apr 10, 2013 at 08:37:18AM -0400, PLSTC wrote: > > > > > > > Hey Jan, > > > > > > > > > > > > > > I cannot speak on behalf of everyone here, but during our attempt to port > > > > > > > LTTng to Android, we also noticed that the kernels we were using (3.0.x) > > > > > > > were nowhere near the requirements for syscall tracepoints support. I > > > > > > > believe such support was added on x86/64 way earlier (early 3.x) than on > > > > > > > ARM, which is why it was included in LTTng's modules a while ago. Simply > > > > > > > put, the ARM kernel is late. > > > > > > > > > > > > OK, so for ARM kernel version 3.6 is the minimum unless the syscall > > > > > > tracepoint > > > > > > support is backported. > > > > > > > > > > > > > There are a few actuals ways to 'enable' syscall tracepoints support on > > > > > > > early ARM kernels, but they all including a bit of kernel > > > > > > hacking/patching. > > > > > > > I could send you some links if you're interested in that. > > > > > > > > > > > > Yes, sure! > > > > > > > > > > > > --Jan > > > > > > > > > > > > > -PL > > > > > > > On Apr 10, 2013 4:40 AM, "Jan Glauber" wrote: > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > I want to use LTTng for system call tracing on ARM. Now lttng-modules > > > > > > seems > > > > > > > > to support system call tracing on ARM already since > > > > > > > > "8f4f80e LTTng Modules ARM syscall instrumentation". > > > > > > > > > > > > > > > > But I wonder how that worked since lttng-syscalls.c is only build under > > > > > > > > CONFIG_HAVE_SYSCALL_TRACEPOINTS and that was added to ARM only with > > > > > > kernel > > > > > > > > 3.6 > > > > > > > > (much after than the lttng-modules commit). > > > > > > > > > > > > > > > > Am I missing something? Is system call tracing working on ARM with the > > > > > > > > upstream > > > > > > > > LTTng version? > > > > > > > > > > > > > > > > thanks, > > > > > > > > Jan > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > 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 > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com From mathieu.desnoyers at efficios.com Thu Apr 11 09:20:30 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 11 Apr 2013 09:20:30 -0400 Subject: [lttng-dev] LTTng system call tracing on ARM In-Reply-To: <20130411082033.GA2314@hal> References: <20130410084053.GB25958@hal> <20130410130246.GA12801@hal> <20130410160233.GA17568@hal> <20130410162012.GA6525@Krystal> <20130410163055.GA18278@hal> <20130410163950.GA6879@Krystal> <20130411082033.GA2314@hal> Message-ID: <20130411132030.GA9216@Krystal> * Jan Glauber (jan.glauber at gmail.com) wrote: > On Wed, Apr 10, 2013 at 12:39:50PM -0400, Mathieu Desnoyers wrote: > > * Jan Glauber (jan.glauber at gmail.com) wrote: > > > On Wed, Apr 10, 2013 at 12:20:12PM -0400, Mathieu Desnoyers wrote: > > > > > > > > Thanks for the detailed report !! > > > > > > > > Please try with this commit: > > > > > > Yes, that patch works. But I'm still curious if you can explain what the > > > override was for ;- > > > > The "override" allows defining how to serialize the information for > > specific system calls. It can either replace the behavior of the > > "semi-automated" description of the system call (brought into > > lttng-modules by means of the system call extractor script), or just > > provide the serialization description for a system call that was not > > available to the system call extractor. > > > > In this case, sys_set_tls was not available for automated extraction, so > > the override entry has been added to it would not appear as a > > "sys_unknown" system call, but would rather show "sys_set_tls" along > > with the well-printed system call arguments. > > OK, thanks for explaining. So the version in instrumentation/syscalls/headers > doesn't mean much, its just the starting point from where the extractor > script picked up the descriptions. > > So we could append recent system calls without generating new headers for > lets say 3.4. Yes, this is one option. The other option, if we want to upgrade a system call table from e.g. 2.6.38 to 3.4, is to just replace the automatically generated header by headers generated by extracting system calls from a 3.4 kernel. This will keep the overrides in places, because they are located into a separate override file. Therefore, all work done by hand in addition to the automatically generated file does not get wasted between updates. > > > You may want to have a look at: > > > > lttng-modules/instrumentation/syscalls/README > > > > for details. > > > > If we want to handle the set_tls special-case (and same for other > > ARM-specific syscalls), we'll probably want to do that with a > > arm-specific table that will contain those system calls. > > Yes, a seperate table would solve the issue. I don't know if ARM is the > only arch doing such tricks to the system call table, so it might be worth > checkingt that. Indeed. This would probably be 2.3 material. I'm happy with showing set_tls as sys_unknown for the moment. Thanks! Mathieu > > Thanks, > Jan > > > Thanks, > > > > Mathieu > > > > > > > > > > --Jan > > > > > > > commit 11fa478f18241fedee86f7dc7820a91c629c9e7e > > > > Author: Mathieu Desnoyers > > > > Date: Wed Apr 10 12:14:38 2013 -0400 > > > > > > > > Fix: remove ARM set_tls system call override > > > > > > > > We'll need to find a better way to instrument ARM-specific system calls > > > > located at a far offset from the standard systems calls. A 16MB > > > > lttng-modules kernel module is really not acceptable. > > > > > > > > Removing this instrumentation for now. sys_set_tls will appear as > > > > sys_unknown. > > > > > > > > Fixes #472 > > > > > > > > CC: Ryan Kyser > > > > Ref: http://lists.lttng.org/pipermail/lttng-dev/2013-April/019990.html > > > > Signed-off-by: Mathieu Desnoyers > > > > > > > > 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 > > > > index 93b8674..895370f 100644 > > > > --- 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 > > > > @@ -2,7 +2,6 @@ > > > > > > > > #define OVERRIDE_TABLE_32_sys_arm_fadvise64_64 > > > > #define OVERRIDE_TABLE_32_sys_sync_file_range2 > > > > -#define OVERRIDE_TABLE_32_sys_set_tls > > > > > > > > #ifndef CREATE_SYSCALL_TABLE > > > > > > > > @@ -38,18 +37,6 @@ SC_TRACE_EVENT(sys_sync_file_range2, > > > > TP_printk() > > > > ) > > > > > > > > -SC_TRACE_EVENT(sys_set_tls, > > > > - TP_PROTO(unsigned int tid, unsigned long tls), > > > > - TP_ARGS(tid, tls), > > > > - TP_STRUCT__entry( > > > > - __field(unsigned int, tid) > > > > - __field_hex(unsigned int, tls)), > > > > - TP_fast_assign( > > > > - tp_assign(tid, tid) > > > > - tp_assign(tls, tls)), > > > > - TP_printk() > > > > -) > > > > - > > > > #else /* CREATE_SYSCALL_TABLE */ > > > > > > > > #define OVVERRIDE_TABLE_32_sys_mmap > > > > @@ -59,9 +46,6 @@ TRACE_SYSCALL_TABLE(sys_mmap, sys_mmap, 90, 6) > > > > 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) > > > > -#define OVERRIDE_TABLE_32_sys_set_tls > > > > -TRACE_SYSCALL_TABLE(sys_set_tls, sys_set_tls, 0xf0005, 2) > > > > - > > > > > > > > #endif /* CREATE_SYSCALL_TABLE */ > > > > > > > > > > > > > > > > > > > > > > --Jan > > > > > > > > > > > -PL > > > > > > > > > > > > > > > > > > > > > > > > On Wed, Apr 10, 2013 at 9:02 AM, Jan Glauber wrote: > > > > > > > > > > > > > On Wed, Apr 10, 2013 at 08:37:18AM -0400, PLSTC wrote: > > > > > > > > Hey Jan, > > > > > > > > > > > > > > > > I cannot speak on behalf of everyone here, but during our attempt to port > > > > > > > > LTTng to Android, we also noticed that the kernels we were using (3.0.x) > > > > > > > > were nowhere near the requirements for syscall tracepoints support. I > > > > > > > > believe such support was added on x86/64 way earlier (early 3.x) than on > > > > > > > > ARM, which is why it was included in LTTng's modules a while ago. Simply > > > > > > > > put, the ARM kernel is late. > > > > > > > > > > > > > > OK, so for ARM kernel version 3.6 is the minimum unless the syscall > > > > > > > tracepoint > > > > > > > support is backported. > > > > > > > > > > > > > > > There are a few actuals ways to 'enable' syscall tracepoints support on > > > > > > > > early ARM kernels, but they all including a bit of kernel > > > > > > > hacking/patching. > > > > > > > > I could send you some links if you're interested in that. > > > > > > > > > > > > > > Yes, sure! > > > > > > > > > > > > > > --Jan > > > > > > > > > > > > > > > -PL > > > > > > > > On Apr 10, 2013 4:40 AM, "Jan Glauber" wrote: > > > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > > > I want to use LTTng for system call tracing on ARM. Now lttng-modules > > > > > > > seems > > > > > > > > > to support system call tracing on ARM already since > > > > > > > > > "8f4f80e LTTng Modules ARM syscall instrumentation". > > > > > > > > > > > > > > > > > > But I wonder how that worked since lttng-syscalls.c is only build under > > > > > > > > > CONFIG_HAVE_SYSCALL_TRACEPOINTS and that was added to ARM only with > > > > > > > kernel > > > > > > > > > 3.6 > > > > > > > > > (much after than the lttng-modules commit). > > > > > > > > > > > > > > > > > > Am I missing something? Is system call tracing working on ARM with the > > > > > > > > > upstream > > > > > > > > > LTTng version? > > > > > > > > > > > > > > > > > > thanks, > > > > > > > > > Jan > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > > > > > 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 > > > > -- > > Mathieu Desnoyers > > EfficiOS Inc. > > http://www.efficios.com -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From Daniel.Thibault at drdc-rddc.gc.ca Thu Apr 11 09:20:55 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 11 Apr 2013 13:20:55 +0000 Subject: [lttng-dev] Google Summer of Code In-Reply-To: References: <48CF5AC71E61DB46B70D0F388054EFFD12D0DC32@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D0DF1C@VAL-E-02.valcartier.drdc-rddc.gc.ca> De : jeremie.galarneau at gmail.com [mailto:jeremie.galarneau at gmail.com] De la part de J?r?mie Galarneau Envoy? : 10 avril 2013 17:53 Certainly seems worthwhile to me although I never heard about debugfs being phased out. Could you clarify that point? J?r?mie > On Tue, Apr 9, 2013 at 11:21 AM, Thibault, Daniel > wrote: > Even if the debugfs tracing facility is destined for eventual withdrawal from the Linux kernel, it may be of interest to some to recover older traces generated in this way -if only in order to be able to process them in the same way as CTF text dumps. Conversion to the babeltrace text format should be fairly straightforward; conversion to CTF would be trickier. Pure speculation on my part, based on the observation that the debugfs service seems less efficient than lttng. The sentence is meant to be read "this may be of interest even if debugfs turns out to be destined to be phased out". (I'd like to know whether the debugfs facility is as signal-, thread-, and interrupt-safe as lttng) This said, do you know more about how this facility came about? LTTng 1 used debugfs for its trace control as well, so which came first? Debugfs or lttng 1? How come the tracepoint and syscall tracing achievable with debugfs is not a perfect match with lttng's (re lttng 2)? (lttng traces the kvm, lttng_statedump, and snd_soc subsystems but debugfs does not; conversely, lttng misses the drm, fs, mce, raw_syscalls, vfs, vsyscall, and xen subsystems; on the syscall side, lttng captures sys_clone, sys_execve and sys_unknown (which debugfs misses), while I haven't found debugfs syscalls that lttng misses (but I can't rule out that possibility)) 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dgoulet at efficios.com Thu Apr 11 11:16:43 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 11 Apr 2013 11:16:43 -0400 Subject: [lttng-dev] [RFC lttng-tools] Snapshot Message-ID: <5166D3DB.1000904@efficios.com> Hi everyone, This is the initial RFC for snapshot in lttng-tools. Once accepted, it will be available in "doc/proposals/0006-lttng-snapshot.txt". Any questions, comments or fixes are VERY welcome. There are probably English mistakes so feel free to point it out to me. Thanks! David -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: 0006-lttng-snapshot.txt URL: From jdesfossez at efficios.com Thu Apr 11 11:41:48 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Thu, 11 Apr 2013 11:41:48 -0400 Subject: [lttng-dev] [RFC lttng-tools] Snapshot In-Reply-To: <5166D3DB.1000904@efficios.com> References: <5166D3DB.1000904@efficios.com> Message-ID: <5166D9BC.6050201@efficios.com> Hi, > Hi everyone, > > This is the initial RFC for snapshot in lttng-tools. Once accepted, it > will be available in "doc/proposals/0006-lttng-snapshot.txt". > > Any questions, comments or fixes are VERY welcome. There are probably > English mistakes so feel free to point it out to me. It looks good, just a few comments : For the add-output command, I think we discussed adding the --max-size parameter as well to limit the size of the snapshots written to this output. For the "lttng snapshot record", I think the options should allow to specify -C/-D also since we can specify an URL. "This is a blocking call meaning that it will return only if the snapshot is completed" --> "only when the snapshot is completed or an error is returned" "For now, no-wait is not supported by we keep" --> "but we" Since it will block the caller, should we add a timeout parameter to lttng_snapshot_record ? Thanks, Julien From jeremie.galarneau at efficios.com Thu Apr 11 11:59:57 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Thu, 11 Apr 2013 11:59:57 -0400 Subject: [lttng-dev] [RFC lttng-tools] Snapshot In-Reply-To: <5166D3DB.1000904@efficios.com> References: <5166D3DB.1000904@efficios.com> Message-ID: Looks great! A few very minor points: In the "Motivation" section, English mistake: "could be particularly useful *with in* flight recorder mode" should be "could be particularly useful *in* flight recorder mode". Also, "informationS" is generally regarded as incorrect. Information has no plural form. In the "Proposed Solution" section, "the lttng command line UI new command is presented" should be "the new lttng command-line UI command is presented". I'd propose rewriting the sentence "Unlike the other lttng command, this one uses the git alike UI but in the form of the object first and action after where previous command only use action such as "enable-event" as "This new command uses a git-alike UI, but in the form of the object first followed by the desired action, whereas other commands only use actions such as "enable-event"". I'm not sure I would use an hyphen in "lttng snapshot list-output" when an output alias is present. That's an entirely subjective but it would seem more consistent with git (git remote -v, for instance). Could you clarify what the expected behavior would be when no session name is provided to "lttng snapshot record"? I guess it would capture a snapshot for every session created with the --no-output option. Also, what happens if a single URL is provided and no session name is given (with multiple active flight recorder sessions)? Thanks, J?r?mie On Thu, Apr 11, 2013 at 11:16 AM, David Goulet wrote: > > Hi everyone, > > This is the initial RFC for snapshot in lttng-tools. Once accepted, it > will be available in "doc/proposals/0006-lttng-snapshot.txt". > > Any questions, comments or fixes are VERY welcome. There are probably > English mistakes so feel free to point it out to me. > > Thanks! > David > > _______________________________________________ > 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 Thu Apr 11 12:08:07 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 11 Apr 2013 12:08:07 -0400 Subject: [lttng-dev] [RFC lttng-tools] Triggers Message-ID: <5166DFE7.8020802@efficios.com> Hi everyone, Here is the second RFC of the day. By reading this, your imagination will probably go pretty crazy with possibilities ;). The first implementation will only have one option describe in the RFC but note that with this kind of feature, the sky is the limit! and of course world domination is never far. Thanks! David -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: 0007-triggers.txt URL: From dgoulet at efficios.com Thu Apr 11 12:14:34 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 11 Apr 2013 12:14:34 -0400 Subject: [lttng-dev] [RFC lttng-tools] Snapshot In-Reply-To: <5166D9BC.6050201@efficios.com> References: <5166D3DB.1000904@efficios.com> <5166D9BC.6050201@efficios.com> Message-ID: <5166E16A.2070107@efficios.com> Julien Desfossez: > Hi, > >> Hi everyone, >> >> This is the initial RFC for snapshot in lttng-tools. Once accepted, it >> will be available in "doc/proposals/0006-lttng-snapshot.txt". >> >> Any questions, comments or fixes are VERY welcome. There are probably >> English mistakes so feel free to point it out to me. > > It looks good, just a few comments : > > For the add-output command, I think we discussed adding the --max-size > parameter as well to limit the size of the snapshots written to this output. Yup I forgot to add it. > > For the "lttng snapshot record", I think the options should allow to > specify -C/-D also since we can specify an URL. Yup! > > "This is a blocking call meaning that it will return only if the > snapshot is completed" --> "only when the snapshot is completed or an > error is returned" Fixed > > "For now, no-wait is not supported by we keep" --> "but we" Fixed > > Since it will block the caller, should we add a timeout parameter to > lttng_snapshot_record ? That would probably be a timer on the session daemon side and the health check would be the thing to use to monitor if the session daemon is stuck. On the client side, the problem is that we have NO way of knowing what will be the duration of the operation I'll send the second version soon with jgalar fixes. Thanks! David > > Thanks, > > Julien From jeremie.galarneau at efficios.com Thu Apr 11 12:14:36 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Thu, 11 Apr 2013 12:14:36 -0400 Subject: [lttng-dev] [RFC lttng-tools] Triggers In-Reply-To: <5166DFE7.8020802@efficios.com> References: <5166DFE7.8020802@efficios.com> Message-ID: I'd propose changing to since it represents a condition. No other comments; it's pretty exciting indeed :) J?r?mie On Thu, Apr 11, 2013 at 12:08 PM, David Goulet wrote: > Hi everyone, > > Here is the second RFC of the day. > > By reading this, your imagination will probably go pretty crazy with > possibilities ;). The first implementation will only have one option > describe in the RFC but note that with this kind of feature, the sky is > the limit! and of course world domination is never far. > > Thanks! > David > > _______________________________________________ > 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 Thu Apr 11 12:18:22 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 11 Apr 2013 12:18:22 -0400 Subject: [lttng-dev] [RFC lttng-tools] Snapshot In-Reply-To: References: <5166D3DB.1000904@efficios.com> Message-ID: <5166E24E.2090100@efficios.com> J?r?mie Galarneau: > Looks great! A few very minor points: > > In the "Motivation" section, English mistake: "could be particularly > useful *with in* flight recorder mode" should be "could be > particularly useful *in* flight recorder mode". Also, "informationS" > is generally regarded as incorrect. Information has no plural form. > > In the "Proposed Solution" section, "the lttng command line UI new > command is presented" should be "the new lttng command-line UI command > is presented". > > I'd propose rewriting the sentence "Unlike the other lttng command, > this one uses the git alike UI but in the form of the object first and > action after where previous command only use action such as > "enable-event" as > "This new command uses a git-alike UI, but in the form of the object > first followed by the desired action, whereas other commands only use > actions such as "enable-event"". > > I'm not sure I would use an hyphen in "lttng snapshot list-output" > when an output alias is present. That's an entirely subjective but it > would seem more consistent with git (git remote -v, for instance). What output format do you propose? > > Could you clarify what the expected behavior would be when no session > name is provided to "lttng snapshot record"? I guess it would capture > a snapshot for every session created with the --no-output option. > Also, what happens if a single URL is provided and no session name is > given (with multiple active flight recorder sessions)? lttng command always work on the current session if none is defined. I'll make it clearer in the RFC. Thanks! David > > Thanks, > J?r?mie > > On Thu, Apr 11, 2013 at 11:16 AM, David Goulet wrote: >> >> Hi everyone, >> >> This is the initial RFC for snapshot in lttng-tools. Once accepted, it >> will be available in "doc/proposals/0006-lttng-snapshot.txt". >> >> Any questions, comments or fixes are VERY welcome. There are probably >> English mistakes so feel free to point it out to me. >> >> Thanks! >> David >> >> _______________________________________________ >> 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 Apr 11 12:25:28 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Thu, 11 Apr 2013 12:25:28 -0400 Subject: [lttng-dev] [RFC lttng-tools] Snapshot In-Reply-To: <5166E24E.2090100@efficios.com> References: <5166D3DB.1000904@efficios.com> <5166E24E.2090100@efficios.com> Message-ID: On Thu, Apr 11, 2013 at 12:18 PM, David Goulet wrote: > > > J?r?mie Galarneau: >> Looks great! A few very minor points: >> >> In the "Motivation" section, English mistake: "could be particularly >> useful *with in* flight recorder mode" should be "could be >> particularly useful *in* flight recorder mode". Also, "informationS" >> is generally regarded as incorrect. Information has no plural form. >> >> In the "Proposed Solution" section, "the lttng command line UI new >> command is presented" should be "the new lttng command-line UI command >> is presented". >> >> I'd propose rewriting the sentence "Unlike the other lttng command, >> this one uses the git alike UI but in the form of the object first and >> action after where previous command only use action such as >> "enable-event" as >> "This new command uses a git-alike UI, but in the form of the object >> first followed by the desired action, whereas other commands only use >> actions such as "enable-event"". >> >> I'm not sure I would use an hyphen in "lttng snapshot list-output" >> when an output alias is present. That's an entirely subjective but it >> would seem more consistent with git (git remote -v, for instance). > > What output format do you propose? > Pretty much the same thing: [1]: file://[...] [2]: net://1.1.1.1:8762:9123 [3] ALIAS: file://[...] Then again, I don't feel strongly about it. >> >> Could you clarify what the expected behavior would be when no session >> name is provided to "lttng snapshot record"? I guess it would capture >> a snapshot for every session created with the --no-output option. >> Also, what happens if a single URL is provided and no session name is >> given (with multiple active flight recorder sessions)? > > lttng command always work on the current session if none is defined. > I'll make it clearer in the RFC. Will there be a way to snapshot every flight-recorder session (say, on a trigger) or should it be done by invoking the command with every session name? Just trying to make the RFC as precise as possible :) > > Thanks! > David > >> >> Thanks, >> J?r?mie >> >> On Thu, Apr 11, 2013 at 11:16 AM, David Goulet wrote: >>> >>> Hi everyone, >>> >>> This is the initial RFC for snapshot in lttng-tools. Once accepted, it >>> will be available in "doc/proposals/0006-lttng-snapshot.txt". >>> >>> Any questions, comments or fixes are VERY welcome. There are probably >>> English mistakes so feel free to point it out to me. >>> >>> Thanks! >>> David >>> >>> _______________________________________________ >>> 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 -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jdesfossez at efficios.com Thu Apr 11 12:30:20 2013 From: jdesfossez at efficios.com (Julien Desfossez) Date: Thu, 11 Apr 2013 12:30:20 -0400 Subject: [lttng-dev] [RFC lttng-tools] Triggers In-Reply-To: <5166DFE7.8020802@efficios.com> References: <5166DFE7.8020802@efficios.com> Message-ID: <5166E51C.4030604@efficios.com> > Hi everyone, > > Here is the second RFC of the day. > > By reading this, your imagination will probably go pretty crazy with > possibilities ;). The first implementation will only have one option > describe in the RFC but note that with this kind of feature, the sky is > the limit! and of course world domination is never far. illustrace --> illustrate "take a snapshot of the session where this" --> "take a snapshot of all the sessions where this" I would propose to add a "command" option to trigger, in order to allow to add, list and del triggers, also a trigger name/alias might become useful really soon. Maybe something like that ? $ lttng trigger [OPTIONS] {add|list|del} Thanks, Julien From Daniel.Thibault at drdc-rddc.gc.ca Thu Apr 11 12:49:23 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 11 Apr 2013 16:49:23 +0000 Subject: [lttng-dev] RFC - Triggers in lttng-tools Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D0DF8E@VAL-E-02.valcartier.drdc-rddc.gc.ca> Based on http://lists.lttng.org/pipermail/lttng-dev/attachments/20130411/7256c589/attachment-0001.txt > The main idea of triggers is for the user to be able to set an action on a > session triggered by a certain event of the system. To illustrace the concept, > here is an example that we will actually propose. [...] To illustrate the concept [...] > Let say an application is being traced and on core dump, we would like to > automatically snapshot the session and proceed to analysis later on. Let's say an [...] and, on core dump, we [...] or Say an [...] and, on core dump, we [...] > The idea would be to set a "trigger" named OnAnyCoreDump for the session. Any > coredump detected using /proc/sys/kernel/core_pattern will send a notification > to the session daemon and trigger the user defined action. [...] the user-defined action. > First, a trigger command is needed and goes as followed. [...] and goes as follows: > For the example showed in the Motivation section, the is OnAnyCoreDump > and the is to take a snapshot of the session where this trigger is > set. For the example shown in [...] > In order to use the notify socket, the message protocol is detailed as > followed. [...] detailed as follows: > Now to fire it up by being let say in a small program set in > /proc/.../core_pattern. Now to fire it up by being let's say in a small [...] 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 From mathieu.desnoyers at efficios.com Thu Apr 11 13:01:52 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 11 Apr 2013 13:01:52 -0400 Subject: [lttng-dev] [RFC PATCH lttng-tools v4] lttng cli: Accept human readable sizes for --subbuf-size In-Reply-To: <1365619941-16708-1-git-send-email-simon.marchi@polymtl.ca> References: <1365619941-16708-1-git-send-email-simon.marchi@polymtl.ca> Message-ID: <20130411170151.GA17901@Krystal> * Simon Marchi (simon.marchi at polymtl.ca) wrote: > --subbuf-size accepts sizes such as: > > - 123 -> 123 > - 123k -> 123 * 1024 > - 123M -> 123 * 1024 * 1024 * 1024^2 > - 123G -> 123 * 1024 * 1024 * 1024 * 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 v4: > - Changes following David Goulet's comments > - Move stuff in src/common/utils.{c,h} > - malloc -> zmalloc > - Formatting > > src/bin/lttng/commands/enable_channels.c | 21 ++++- > src/common/utils.c | 124 ++++++++++++++++++++++++++++++ > src/common/utils.h | 8 ++ > tests/unit/Makefile.am | 15 +++- > tests/unit/test_parse_size_suffix.c | 73 ++++++++++++++++++ > 5 files changed, 235 insertions(+), 6 deletions(-) > create mode 100644 tests/unit/test_parse_size_suffix.c > > diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c > index d026af4..dbec8ab 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 (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..9e8fd9d 100644 > --- a/src/common/utils.c > +++ b/src/common/utils.c > @@ -26,6 +26,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -386,3 +387,126 @@ 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); we should probably check if length == 0. > + 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 * 1024 1024^2 > + * 'G': 1024 * 1024 * 1024 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 parse_size_suffix(char *str, uint64_t *size) why isn't parse_size_suffix() declared in a header anywhere ? > +{ > + regex_t regex; > + int ret; > + const int nmatch = 2; > + regmatch_t suffix_match, matches[nmatch]; > + > + if (!str) { > + return 0; > + } > + > + /* Compile regex */ > + ret = regcomp(®ex, "^[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 ! */ > + unsigned long long base_size; please don't declare variables in the middle of a scope. I know C99 allows it, but not our coding style. > + long shift = 0; same here. > + errno = 0; > + base_size = strtoull(str, NULL, 10); we could use a base of "0", and thus allow stuff like 0x... to be handled. > + /* Check result of conversion */ > + if (errno != 0) { > + PERROR("strtoull"); > + ret = -1; > + goto free; > + } > + > + /* Check if there is a suffix */ > + suffix_match = matches[1]; > + 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..61faa4e 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); > diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am > index 67e7fe4..4c15731 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_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 > +PARSE_SIZE_SUFFIX=$(top_srcdir)/src/common/utils.o \ > + $(top_srcdir)/src/common/runas.o > + > +test_parse_size_suffix_SOURCES = test_parse_size_suffix.c > +test_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) > +test_parse_size_suffix_LDADD += $(PARSE_SIZE_SUFFIX) > diff --git a/tests/unit/test_parse_size_suffix.c b/tests/unit/test_parse_size_suffix.c > new file mode 100644 > index 0000000..d3c3bda > --- /dev/null > +++ b/tests/unit/test_parse_size_suffix.c > @@ -0,0 +1,73 @@ > +/* > + * 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; > + > +/* Valid test cases */ > +static char *valid_tests_inputs[] = { "0", "1234", "16k", "128K", "32M", "1024G" }; > +static uint64_t valid_tests_expected_results[] = {0, 1234, 16384, 131072, 33554432, 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_parse_size_suffix(void) > +{ > + uint64_t result; > + int ret; > + int i; > + > + // Test valid cases // -style comments should be avoided in our coding style. Please use /* */ comments for single-line comments, and /* * blah blah * rest of ... */ for multi-line comments. Thanks, Mathieu > + for (i = 0; i < num_valid_tests; i++) { > + char name[100]; > + sprintf(name, "testing %s", valid_tests_inputs[i]); > + > + ret = parse_size_suffix(valid_tests_inputs[i], &result); > + ok(ret == 0 && result == valid_tests_expected_results[i], name); > + } > + > + // Test invalid cases > + for (i = 0; i < num_invalid_tests; i++) { > + char name[100]; > + sprintf(name, "testing %s", invalid_tests_inputs[i]); > + > + ret = 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("parse_size_suffix tests"); > + > + test_parse_size_suffix(); > + > + return exit_status(); > +} > -- > 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 Apr 11 13:26:40 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 11 Apr 2013 13:26:40 -0400 Subject: [lttng-dev] [RFC lttng-tools] Triggers In-Reply-To: <5166E51C.4030604@efficios.com> References: <5166DFE7.8020802@efficios.com> <5166E51C.4030604@efficios.com> Message-ID: <5166F250.1030605@efficios.com> Julien Desfossez: >> Hi everyone, >> >> Here is the second RFC of the day. >> >> By reading this, your imagination will probably go pretty crazy with >> possibilities ;). The first implementation will only have one option >> describe in the RFC but note that with this kind of feature, the sky is >> the limit! and of course world domination is never far. > > illustrace --> illustrate > > "take a snapshot of the session where this" --> "take a snapshot of all > the sessions where this" > > I would propose to add a "command" option to trigger, in order to allow > to add, list and del triggers, also a trigger name/alias might become > useful really soon. > > Maybe something like that ? > $ lttng trigger [OPTIONS] {add|list|del} Hmmm yea, I think this will come handy in the future. > > Thanks, > > Julien From mathieu.desnoyers at efficios.com Thu Apr 11 14:17:58 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 11 Apr 2013 14:17:58 -0400 Subject: [lttng-dev] [RFC-Patch 2/2] x86:Instruments page fault trace event In-Reply-To: <1365566360-7206-2-git-send-email-fdeslaur@gmail.com> References: <1365398358-23374-1-git-send-email-fdeslaur@gmail.com> <1365566360-7206-1-git-send-email-fdeslaur@gmail.com> <1365566360-7206-2-git-send-email-fdeslaur@gmail.com> Message-ID: <20130411181758.GA21484@Krystal> * Francis Deslauriers (fdeslaur at gmail.com) wrote: > Signed-off-by: Francis Deslauriers > Reviewed-by: Rapha?l Beamonte > --- > arch/x86/mm/fault.c | 7 +++++++ > mm/memory.c | 5 +++++ > 2 files changed, 12 insertions(+) > > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c > index 2b97525..6ceaaaa 100644 > --- a/arch/x86/mm/fault.c > +++ b/arch/x86/mm/fault.c > @@ -20,6 +20,9 @@ > #include /* VSYSCALL_START */ > #include /* exception_enter(), ... */ > > +#define CREATE_TRACE_POINTS > +#include /* trace_page_fault_*(), ... */ > + > /* > * Page fault error code bits: > * > @@ -754,12 +757,14 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, > > if (likely(show_unhandled_signals)) > show_signal_msg(regs, error_code, address, tsk); > + trace_page_fault_entry(regs, address, error_code & PF_WRITE); > > tsk->thread.cr2 = address; > tsk->thread.error_code = error_code; > tsk->thread.trap_nr = X86_TRAP_PF; > > force_sig_info_fault(SIGSEGV, si_code, address, tsk, 0); maybe we should put a comment in the patch when sending to LKML, e.g.: /* * Using -1 here, since there is no VM_FAULT flag to identify * user accesses triggering SIGSEGV. */ > + trace_page_fault_exit(-1); And maybe interesting hints will come from LKML. The rest looks good, Thanks, Mathieu > > return; > } > @@ -1183,7 +1188,9 @@ good_area: > * make sure we exit gracefully rather than endlessly redo > * the fault: > */ > + trace_page_fault_entry(regs, address, write); > fault = handle_mm_fault(mm, vma, address, flags); > + trace_page_fault_exit(fault); > > if (unlikely(fault & (VM_FAULT_RETRY|VM_FAULT_ERROR))) { > if (mm_fault_error(regs, error_code, address, fault)) > diff --git a/mm/memory.c b/mm/memory.c > index 494526a..49a8119 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -67,6 +67,8 @@ > #include > #include > > +#include > + > #include "internal.h" > > #ifdef LAST_NID_NOT_IN_PAGE_FLAGS > @@ -1828,8 +1830,11 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, > if (foll_flags & FOLL_NOWAIT) > fault_flags |= (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_RETRY_NOWAIT); > > + trace_page_fault_entry(0, start, > + foll_flags & FOLL_WRITE); > ret = handle_mm_fault(mm, vma, start, > fault_flags); > + trace_page_fault_exit(ret); > > if (ret & VM_FAULT_ERROR) { > if (ret & VM_FAULT_OOM) > -- > 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 Thu Apr 11 14:19:39 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 11 Apr 2013 14:19:39 -0400 Subject: [lttng-dev] [RFC-Patch 1/2] Add page fault trace event definitions In-Reply-To: <1365566360-7206-1-git-send-email-fdeslaur@gmail.com> References: <1365398358-23374-1-git-send-email-fdeslaur@gmail.com> <1365566360-7206-1-git-send-email-fdeslaur@gmail.com> Message-ID: <20130411181939.GA21907@Krystal> * Francis Deslauriers (fdeslaur at gmail.com) wrote: > Add page_fault_entry and page_fault_exit event definitions. It will > allow each architecture to instrument their page faults. > > Signed-off-by: Francis Deslauriers > Reviewed-by: Rapha?l Beamonte Reviewed-by: Mathieu Desnoyers > --- > include/trace/events/fault.h | 51 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 51 insertions(+) > create mode 100644 include/trace/events/fault.h > > diff --git a/include/trace/events/fault.h b/include/trace/events/fault.h > new file mode 100644 > index 0000000..522ddee > --- /dev/null > +++ b/include/trace/events/fault.h > @@ -0,0 +1,51 @@ > +#undef TRACE_SYSTEM > +#define TRACE_SYSTEM fault > + > +#if !defined(_TRACE_FAULT_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_FAULT_H > + > +#include > + > +TRACE_EVENT(page_fault_entry, > + > + TP_PROTO(struct pt_regs *regs, unsigned long address, > + int write_access), > + > + TP_ARGS(regs, address, write_access), > + > + TP_STRUCT__entry( > + __field( unsigned long, ip ) > + __field( unsigned long, addr ) > + __field( uint8_t, write ) > + ), > + > + TP_fast_assign( > + __entry->ip = regs ? instruction_pointer(regs) : 0UL; > + __entry->addr = address; > + __entry->write = !!write_access; > + ), > + > + TP_printk("ip=%lu addr=%lu write_access=%d", > + __entry->ip, __entry->addr, __entry->write) > +); > + > +TRACE_EVENT(page_fault_exit, > + > + TP_PROTO(int result), > + > + TP_ARGS(result), > + > + TP_STRUCT__entry( > + __field( int, res ) > + ), > + > + TP_fast_assign( > + __entry->res = result; > + ), > + > + TP_printk("result=%d", __entry->res) > +); > + > +#endif /* _TRACE_FAULT_H */ > +/* This part must be outside protection */ > +#include > -- > 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 Thu Apr 11 14:29:39 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 11 Apr 2013 18:29:39 +0000 Subject: [lttng-dev] [RFC lttng-tools] Triggers Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D0DFCE@VAL-E-02.valcartier.drdc-rddc.gc.ca> > Maybe something like that ? > $ lttng trigger [OPTIONS] {add|list|del} The problem with this is that lttng will become confused in its expectations if the is one of "add", "list", or "del". It'd be better to use options, i.e. "--add", "--list", "--del" or "--command={add|list|del}". 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 From dgoulet at efficios.com Thu Apr 11 14:32:45 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 11 Apr 2013 14:32:45 -0400 Subject: [lttng-dev] [RFC lttng-tools] Triggers In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD12D0DFCE@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD12D0DFCE@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: <516701CD.9060000@efficios.com> Or use --name as an optional option. But indeed, the "add, del and list" command would have to be reserved meaning no "WHAT/WHERE" would be "add". David Thibault, Daniel: >> Maybe something like that ? >> $ lttng trigger [OPTIONS] {add|list|del} > > The problem with this is that lttng will become confused in its expectations if the is one of "add", "list", or "del". It'd be better to use options, i.e. "--add", "--list", "--del" or "--command={add|list|del}". > > 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 From gbastien+lttng at versatic.net Thu Apr 11 16:07:31 2013 From: gbastien+lttng at versatic.net (=?UTF-8?q?Genevi=C3=A8ve=20Bastien?=) Date: Thu, 11 Apr 2013 16:07:31 -0400 Subject: [lttng-dev] [RFC-patch] Add support of struct metadata in tracepoints Message-ID: <1365710851-1690-1-git-send-email-gbastien+lttng@versatic.net> Introduce the new macro TRACEPOINT_STRUCT to define ctf struct metadata that can be used by tracepoints using _struct as entry and tp_memcpy_struct to copy a struct field. This extra metadata is added to the metadata file only if events use it. Signed-off-by: Genevi?ve Bastien --- lttng-events.c | 134 +++++++++++++++++++++++++++++++++++++++++- lttng-events.h | 35 +++++++++++ probes/lttng-events-reset.h | 15 +++++ probes/lttng-events.h | 138 +++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 320 insertions(+), 2 deletions(-) diff --git a/lttng-events.c b/lttng-events.c index 4f30904..431a17c 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -654,6 +654,13 @@ int _lttng_field_statedump(struct lttng_session *session, " { encoding = ASCII; }" : "", field->name); break; + case atype_struct: + ret = lttng_metadata_printf(session, + " struct %s%s _%s;\n", + field->type.u.ctf_struct.provider, + field->type.u.ctf_struct.name, + field->name); + break; default: WARN_ON_ONCE(1); return -EINVAL; @@ -662,6 +669,122 @@ int _lttng_field_statedump(struct lttng_session *session, } static +int _lttng_is_extra_metadata_dumped(struct lttng_session *session, + const struct lttng_metadata *metadata) { + /* Is the metadata dumped yet ? */ + struct lttng_metadata_dumped *dumped; + int is_dumped = 0; + + dumped = session->extra_metadata[metadata->mtype]; + switch (metadata->mtype) { + case mtype_struct: + while (dumped) { + if (metadata->m.struct_desc == + dumped->dumped_ptr.struct_desc) { + is_dumped = 1; + break; + } + dumped = dumped->next; + } + break; + default: + WARN_ON_ONCE(1); + return -EINVAL; + } + return is_dumped; +} + +static int _lttng_extra_metadata_mark_dumped(struct lttng_session *session, + const struct lttng_metadata *metadata) { + /* mark this metadata as dumped */ + struct lttng_metadata_dumped *dumped, *just_dumped; + + just_dumped = kzalloc(sizeof(struct lttng_metadata_dumped), + GFP_KERNEL); + if (!just_dumped) + return -ENOMEM; + + dumped = session->extra_metadata[metadata->mtype]; + + switch (metadata->mtype) { + case mtype_struct: + just_dumped->dumped_ptr.struct_desc = metadata->m.struct_desc; + break; + default: + WARN_ON_ONCE(1); + return -EINVAL; + } + + just_dumped->next = session->extra_metadata[mtype_struct]; + session->extra_metadata[mtype_struct] = just_dumped; + return 0; +} + +static +int _lttng_event_extra_metadata_do_statedump(struct lttng_session *session, + const struct lttng_metadata *meta) +{ + int i, ret = 0; + + switch (meta->mtype) { + case mtype_struct: + + ret = lttng_metadata_printf(session, + "struct %s%s {\n", + meta->m.struct_desc->provider, meta->m.struct_desc->name + ); + if (ret) + return ret; + + /* Print fields */ + for (i = 0; i < meta->m.struct_desc->nr_fields; i++) { + const struct lttng_event_field *field; + field = &meta->m.struct_desc->fields[i]; + + ret = _lttng_field_statedump(session, field); + if (ret) + return ret; + } + + ret = lttng_metadata_printf(session, + "};\n\n"); + if (ret) + return ret; + + break; + default: + WARN_ON_ONCE(1); + return -EINVAL; + } + if (ret) + return ret; + + ret = _lttng_extra_metadata_mark_dumped(session, meta); + return ret; +} + +static +int _lttng_event_extra_metadata_statedump(struct lttng_session *session, + struct lttng_event *event) +{ + const struct lttng_event_desc *desc = event->desc; + int i, ret = 0; + + for (i = 0; i < desc->nr_metadata; i++) { + const struct lttng_metadata *meta = &desc->extra_metadata[i]; + + if (!_lttng_is_extra_metadata_dumped(session, meta)) { + ret = _lttng_event_extra_metadata_do_statedump(session, + meta); + if (ret) + return ret; + } + } + return ret; + +} + +static int _lttng_context_metadata_statedump(struct lttng_session *session, struct lttng_ctx *ctx) { @@ -710,6 +833,11 @@ int _lttng_event_metadata_statedump(struct lttng_session *session, if (chan == session->metadata) return 0; + /* Dump the extra metadata for this event */ + ret = _lttng_event_extra_metadata_statedump(session, event); + if (ret) + goto end; + ret = lttng_metadata_printf(session, "event {\n" " name = %s;\n" @@ -905,7 +1033,7 @@ int _lttng_session_metadata_statedump(struct lttng_session *session) unsigned char uuid_s[37], clock_uuid_s[BOOT_ID_LEN]; struct lttng_channel *chan; struct lttng_event *event; - int ret = 0; + int ret = 0, i; if (!ACCESS_ONCE(session->active)) return 0; @@ -1042,6 +1170,10 @@ int _lttng_session_metadata_statedump(struct lttng_session *session) if (ret) goto end; + /* Initialized undumped metadata */ + for (i = 0; i < NR_METADATA_TYPES; i++) + session->extra_metadata[i] = 0; + skip_session: list_for_each_entry(chan, &session->chan, list) { ret = _lttng_channel_metadata_statedump(session, chan); diff --git a/lttng-events.h b/lttng-events.h index 37a5db7..2cab5f3 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -47,9 +47,16 @@ enum abstract_types { atype_array, atype_sequence, atype_string, + atype_struct, NR_ABSTRACT_TYPES, }; +/* Metadata types */ +enum metadata_types { + mtype_struct, + NR_METADATA_TYPES, +}; + /* Update the string_encodings name table in lttng-types.c along with this enum */ enum lttng_string_encodings { lttng_encode_none = 0, @@ -115,6 +122,9 @@ struct lttng_type { struct lttng_basic_type length_type; struct lttng_basic_type elem_type; } sequence; + struct { + const char *name, *provider; + } ctf_struct; } u; }; @@ -161,12 +171,36 @@ struct lttng_ctx { unsigned int allocated_fields; }; +struct lttng_struct_desc { + const char *name, *provider; + const struct lttng_event_field *fields; /* fields */ + unsigned int nr_fields; + struct module *owner; +}; + +struct lttng_metadata { + enum metadata_types mtype; + union { + struct lttng_struct_desc *struct_desc; + } m; +}; + +struct lttng_metadata_dumped { + union { + struct lttng_struct_desc *struct_desc; + } dumped_ptr; + struct lttng_metadata_dumped *next; +}; + struct lttng_event_desc { const char *name; void *probe_callback; const struct lttng_event_ctx *ctx; /* context */ const struct lttng_event_field *fields; /* event payload */ + /* Extra metadata added by events */ + const struct lttng_metadata *extra_metadata; unsigned int nr_fields; + unsigned int nr_metadata; struct module *owner; }; @@ -277,6 +311,7 @@ struct lttng_session { struct list_head list; /* Session list */ unsigned int free_chan_id; /* Next chan ID to allocate */ uuid_le uuid; /* Trace session unique ID */ + struct lttng_metadata_dumped *extra_metadata[NR_METADATA_TYPES]; unsigned int metadata_dumped:1; }; diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h index 44e8ba5..bf8bbf1 100644 --- a/probes/lttng-events-reset.h +++ b/probes/lttng-events-reset.h @@ -20,6 +20,9 @@ /* Reset macros used within TRACE_EVENT to "nothing" */ +#undef TRACE_METADATA +#define TRACE_METADATA 1 + #undef __field_full #define __field_full(_type, _item, _order, _base) @@ -35,6 +38,9 @@ #undef __string #define __string(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) + #undef tp_assign #define tp_assign(dest, src) @@ -47,6 +53,9 @@ #undef tp_strcpy #define tp_strcpy(dest, src) +#undef tp_memcpy_struct +#define tp_memcpy_struct(dest, src) + #undef __get_str #define __get_str(field) @@ -65,6 +74,9 @@ #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) +#undef TP_FIELDS +#define TP_FIELDS(args...) + #undef TP_fast_assign #define TP_fast_assign(args...) @@ -94,3 +106,6 @@ #undef TRACE_EVENT_FLAGS #define TRACE_EVENT_FLAGS(name, value) + +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _fields) diff --git a/probes/lttng-events.h b/probes/lttng-events.h index 8a3a886..8465095 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -263,9 +263,31 @@ void trace_##_name(void *__data); #define __string_from_user(_item, _src) \ __string(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + { \ + .name = #_item, \ + .type = \ + { \ + .atype = atype_struct, \ + .u.ctf_struct.name = #_type, \ + .u.ctf_struct.provider = #_provider, \ + }, \ + }, + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ +#undef TP_FIELDS +#define TP_FIELDS(args...) args /* Only one used in this phase */ + +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _fields) \ + static const struct lttng_event_field \ + __struct_fields___##_provider##_name[] = { \ + _fields \ + }; + #undef DECLARE_EVENT_CLASS_NOARGS #define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ static const struct lttng_event_field __event_fields___##_name[] = { \ @@ -301,6 +323,60 @@ static void __event_probe__##_name(void *__data); #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* + * Stage 3.2 of the trace events. + * + * Create extra metadata description + */ + +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ + +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _fields) \ +static struct lttng_struct_desc __struct_desc___##_provider##_name = { \ + .fields = __struct_fields___##_provider##_name, \ + .name = #_name, \ + .provider = #_provider, \ + .nr_fields = ARRAY_SIZE(__struct_fields___##_provider##_name),\ + .owner = THIS_MODULE, \ + }; + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + +/* + * Stage 3.3 of the trace events. + * + * Associate metadata description to event or event template + */ + +/* Named field types must be defined in lttng-types.h */ + +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ + +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + { \ + .mtype = mtype_struct, \ + .m.struct_desc = &__struct_desc___##_provider##_type, \ + }, + +#undef TP_STRUCT__entry +#define TP_STRUCT__entry(args...) args /* Only one used in this phase */ + +#undef DECLARE_EVENT_CLASS_NOARGS +#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ +static const struct lttng_metadata __metadata_for__##_name[] = { \ + _tstruct \ +}; + +#undef DECLARE_EVENT_CLASS +#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ + DECLARE_EVENT_CLASS_NOARGS(_name, PARAMS(_tstruct), PARAMS(_assign), \ + PARAMS(_print)) + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + + +/* * Stage 3.9 of the trace events. * * Create event descriptions. @@ -318,9 +394,11 @@ static void __event_probe__##_name(void *__data); #define DEFINE_EVENT_MAP_NOARGS(_template, _name, _map) \ static const struct lttng_event_desc __event_desc___##_map = { \ .fields = __event_fields___##_template, \ + .extra_metadata = __metadata_for__##_template, \ .name = #_map, \ .probe_callback = (void *) TP_PROBE_CB(_template), \ .nr_fields = ARRAY_SIZE(__event_fields___##_template), \ + .nr_metadata = ARRAY_SIZE(__metadata_for__##_template), \ .owner = THIS_MODULE, \ }; @@ -420,12 +498,33 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { __event_len += __dynamic_len[__dynamic_len_idx++] = \ max_t(size_t, lttng_strlen_user_inatomic(_src), 1); +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + __event_len += __dynamic_len[__dynamic_len_idx++] = \ + __struct_get_size__##_provider##_type(__dynamic_len, _params); + #undef TP_PROTO #define TP_PROTO(args...) args #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args +#undef TP_FIELDS +#define TP_FIELDS(args...) args + +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _fields) \ +static inline size_t __struct_get_size__##_provider##_name(size_t *__dynamic_len, _proto)\ + { \ + size_t __event_len = 0; \ + unsigned int __dynamic_len_idx = 0; \ + \ + if (0) \ + (void) __dynamic_len_idx; /* don't warn if unused */\ + _fields \ + return __event_len; \ +} + #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ @@ -470,12 +569,29 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ #undef __string_from_user #define __string_from_user(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + __event_align = max_t(size_t, __event_align, \ + __struct_get_align__##_provider##_type(_params)); + #undef TP_PROTO #define TP_PROTO(args...) args #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args +#undef TP_FIELDS +#define TP_FIELDS(args...) args + +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _fields) \ +static inline size_t __struct_get_align__##_provider##_name(_proto) \ +{ \ + size_t __event_align = 1; \ + _fields \ + return __event_align; \ +} + #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ static inline size_t __event_get_align__##_name(_proto) \ @@ -517,6 +633,9 @@ static inline size_t __event_get_align__##_name(_proto) \ #define __string_from_user(_item, _src) \ __string(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) char _item; + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args @@ -568,6 +687,11 @@ __end_field_##_item: #define __string_from_user(_item, _src) \ __string(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + goto __assign_##_item; \ +__end_field_##_item: + /* * Macros mapping tp_assign() to "=", tp_memcpy() to memcpy() and tp_strcpy() to * strcpy(). @@ -624,12 +748,24 @@ __assign_##dest##_2: \ #define tp_memcpy_dyn_from_user(dest, src) \ tp_memcpy_dyn_gen(event_write_from_user, dest, src) +#undef tp_memcpy_struct_gen +#define tp_memcpy_struct_gen(write_ops, dest, src) \ +__assign_##dest: \ + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__typemap.dest));\ + __chan->ops->write_ops(&__ctx, src, \ + sizeof(__typemap.dest) * __get_dynamic_array_len(dest));\ + goto __end_field_##dest; + +#undef tp_memcpy_struct +#define tp_memcpy_struct(dest, src) \ + tp_memcpy_struct_gen(event_write, dest, src) + /* * The string length including the final \0. */ #undef tp_copy_string_from_user #define tp_copy_string_from_user(dest, src) \ - __assign_##dest: \ +__assign_##dest: \ { \ size_t __ustrlen; \ \ -- 1.8.2.1 From mathieu.desnoyers at efficios.com Thu Apr 11 16:46:44 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 11 Apr 2013 16:46:44 -0400 Subject: [lttng-dev] [RFC-patch] Add support of struct metadata in tracepoints In-Reply-To: <1365710851-1690-1-git-send-email-gbastien+lttng@versatic.net> References: <1365710851-1690-1-git-send-email-gbastien+lttng@versatic.net> Message-ID: <20130411204644.GA27227@Krystal> * Genevi?ve Bastien (gbastien+lttng at versatic.net) wrote: > Introduce the new macro TRACEPOINT_STRUCT to define ctf struct metadata > that can be used by tracepoints using _struct as entry and tp_memcpy_struct > to copy a struct field. > This extra metadata is added to the metadata file only if events use it. > > Signed-off-by: Genevi?ve Bastien > --- > lttng-events.c | 134 +++++++++++++++++++++++++++++++++++++++++- > lttng-events.h | 35 +++++++++++ > probes/lttng-events-reset.h | 15 +++++ > probes/lttng-events.h | 138 +++++++++++++++++++++++++++++++++++++++++++- > 4 files changed, 320 insertions(+), 2 deletions(-) > > diff --git a/lttng-events.c b/lttng-events.c > index 4f30904..431a17c 100644 > --- a/lttng-events.c > +++ b/lttng-events.c > @@ -654,6 +654,13 @@ int _lttng_field_statedump(struct lttng_session *session, > " { encoding = ASCII; }" : "", > field->name); > break; > + case atype_struct: > + ret = lttng_metadata_printf(session, > + " struct %s%s _%s;\n", I think an underscore is missing: " struct %s_%s _%s;\n" > + field->type.u.ctf_struct.provider, > + field->type.u.ctf_struct.name, > + field->name); > + break; > default: > WARN_ON_ONCE(1); > return -EINVAL; > @@ -662,6 +669,122 @@ int _lttng_field_statedump(struct lttng_session *session, > } > > static > +int _lttng_is_extra_metadata_dumped(struct lttng_session *session, rather than "extra_metadata", can we call this "type_metadata" ? "extra" is rather "extra vague" ;-) > + const struct lttng_metadata *metadata) { newline before { (coding style, this applies to other functions below too) > + /* Is the metadata dumped yet ? */ > + struct lttng_metadata_dumped *dumped; > + int is_dumped = 0; > + > + dumped = session->extra_metadata[metadata->mtype]; > + switch (metadata->mtype) { > + case mtype_struct: > + while (dumped) { it looks like a for() would be clearer than a while. > + if (metadata->m.struct_desc == > + dumped->dumped_ptr.struct_desc) { > + is_dumped = 1; > + break; > + } > + dumped = dumped->next; > + } > + break; > + default: > + WARN_ON_ONCE(1); > + return -EINVAL; > + } > + return is_dumped; > +} > + > +static int _lttng_extra_metadata_mark_dumped(struct lttng_session *session, > + const struct lttng_metadata *metadata) { > + /* mark this metadata as dumped */ > + struct lttng_metadata_dumped *dumped, *just_dumped; > + > + just_dumped = kzalloc(sizeof(struct lttng_metadata_dumped), > + GFP_KERNEL); > + if (!just_dumped) > + return -ENOMEM; > + > + dumped = session->extra_metadata[metadata->mtype]; > + > + switch (metadata->mtype) { > + case mtype_struct: > + just_dumped->dumped_ptr.struct_desc = metadata->m.struct_desc; > + break; > + default: > + WARN_ON_ONCE(1); memory leak of just_dumped. > + return -EINVAL; > + } > + > + just_dumped->next = session->extra_metadata[mtype_struct]; > + session->extra_metadata[mtype_struct] = just_dumped; > + return 0; > +} > + > +static > +int _lttng_event_extra_metadata_do_statedump(struct lttng_session *session, > + const struct lttng_metadata *meta) > +{ > + int i, ret = 0; > + > + switch (meta->mtype) { > + case mtype_struct: remove newline. > + > + ret = lttng_metadata_printf(session, > + "struct %s%s {\n", missing underscore ? > + meta->m.struct_desc->provider, meta->m.struct_desc->name > + ); > + if (ret) > + return ret; > + > + /* Print fields */ > + for (i = 0; i < meta->m.struct_desc->nr_fields; i++) { > + const struct lttng_event_field *field; add newline. > + field = &meta->m.struct_desc->fields[i]; remove newline. > + > + ret = _lttng_field_statedump(session, field); > + if (ret) > + return ret; > + } > + > + ret = lttng_metadata_printf(session, > + "};\n\n"); > + if (ret) > + return ret; > + > + break; > + default: > + WARN_ON_ONCE(1); > + return -EINVAL; > + } > + if (ret) > + return ret; > + > + ret = _lttng_extra_metadata_mark_dumped(session, meta); > + return ret; > +} > + > +static > +int _lttng_event_extra_metadata_statedump(struct lttng_session *session, > + struct lttng_event *event) > +{ > + const struct lttng_event_desc *desc = event->desc; > + int i, ret = 0; > + > + for (i = 0; i < desc->nr_metadata; i++) { > + const struct lttng_metadata *meta = &desc->extra_metadata[i]; > + > + if (!_lttng_is_extra_metadata_dumped(session, meta)) { if (_lttng_is_extra_metadata_dumped(session, meta)) continue; will save an indent level. > + ret = _lttng_event_extra_metadata_do_statedump(session, > + meta); > + if (ret) > + return ret; > + } > + } > + return ret; > + > +} > + > +static > int _lttng_context_metadata_statedump(struct lttng_session *session, > struct lttng_ctx *ctx) > { > @@ -710,6 +833,11 @@ int _lttng_event_metadata_statedump(struct lttng_session *session, > if (chan == session->metadata) > return 0; > > + /* Dump the extra metadata for this event */ > + ret = _lttng_event_extra_metadata_statedump(session, event); > + if (ret) > + goto end; > + > ret = lttng_metadata_printf(session, > "event {\n" > " name = %s;\n" > @@ -905,7 +1033,7 @@ int _lttng_session_metadata_statedump(struct lttng_session *session) > unsigned char uuid_s[37], clock_uuid_s[BOOT_ID_LEN]; > struct lttng_channel *chan; > struct lttng_event *event; > - int ret = 0; > + int ret = 0, i; > > if (!ACCESS_ONCE(session->active)) > return 0; > @@ -1042,6 +1170,10 @@ int _lttng_session_metadata_statedump(struct lttng_session *session) > if (ret) > goto end; > > + /* Initialized undumped metadata */ > + for (i = 0; i < NR_METADATA_TYPES; i++) > + session->extra_metadata[i] = 0; this initialisation probably belongs to lttng_session_create(). > + > skip_session: > list_for_each_entry(chan, &session->chan, list) { > ret = _lttng_channel_metadata_statedump(session, chan); > diff --git a/lttng-events.h b/lttng-events.h > index 37a5db7..2cab5f3 100644 > --- a/lttng-events.h > +++ b/lttng-events.h > @@ -47,9 +47,16 @@ enum abstract_types { > atype_array, > atype_sequence, > atype_string, > + atype_struct, > NR_ABSTRACT_TYPES, > }; > > +/* Metadata types */ > +enum metadata_types { > + mtype_struct, > + NR_METADATA_TYPES, > +}; > + > /* Update the string_encodings name table in lttng-types.c along with this enum */ > enum lttng_string_encodings { > lttng_encode_none = 0, > @@ -115,6 +122,9 @@ struct lttng_type { > struct lttng_basic_type length_type; > struct lttng_basic_type elem_type; > } sequence; > + struct { > + const char *name, *provider; > + } ctf_struct; > } u; > }; > > @@ -161,12 +171,36 @@ struct lttng_ctx { > unsigned int allocated_fields; > }; > > +struct lttng_struct_desc { > + const char *name, *provider; const char *provider, *name; seems clearer. > + const struct lttng_event_field *fields; /* fields */ > + unsigned int nr_fields; > + struct module *owner; > +}; > + > +struct lttng_metadata { > + enum metadata_types mtype; > + union { > + struct lttng_struct_desc *struct_desc; > + } m; > +}; > + > +struct lttng_metadata_dumped { > + union { > + struct lttng_struct_desc *struct_desc; > + } dumped_ptr; > + struct lttng_metadata_dumped *next; > +}; > + > struct lttng_event_desc { > const char *name; > void *probe_callback; > const struct lttng_event_ctx *ctx; /* context */ > const struct lttng_event_field *fields; /* event payload */ > + /* Extra metadata added by events */ > + const struct lttng_metadata *extra_metadata; > unsigned int nr_fields; > + unsigned int nr_metadata; > struct module *owner; > }; > > @@ -277,6 +311,7 @@ struct lttng_session { > struct list_head list; /* Session list */ > unsigned int free_chan_id; /* Next chan ID to allocate */ > uuid_le uuid; /* Trace session unique ID */ > + struct lttng_metadata_dumped *extra_metadata[NR_METADATA_TYPES]; > unsigned int metadata_dumped:1; > }; > > diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h > index 44e8ba5..bf8bbf1 100644 > --- a/probes/lttng-events-reset.h > +++ b/probes/lttng-events-reset.h > @@ -20,6 +20,9 @@ > > /* Reset macros used within TRACE_EVENT to "nothing" */ > > +#undef TRACE_METADATA > +#define TRACE_METADATA 1 > + > #undef __field_full > #define __field_full(_type, _item, _order, _base) > > @@ -35,6 +38,9 @@ > #undef __string > #define __string(_item, _src) > > +#undef __struct > +#define __struct(_provider, _type, _item, _params) > + > #undef tp_assign > #define tp_assign(dest, src) > > @@ -47,6 +53,9 @@ > #undef tp_strcpy > #define tp_strcpy(dest, src) > > +#undef tp_memcpy_struct > +#define tp_memcpy_struct(dest, src) > + > #undef __get_str > #define __get_str(field) > > @@ -65,6 +74,9 @@ > #undef TP_STRUCT__entry > #define TP_STRUCT__entry(args...) > > +#undef TP_FIELDS > +#define TP_FIELDS(args...) > + > #undef TP_fast_assign > #define TP_fast_assign(args...) > > @@ -94,3 +106,6 @@ > > #undef TRACE_EVENT_FLAGS > #define TRACE_EVENT_FLAGS(name, value) > + > +#undef TRACEPOINT_STRUCT > +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _fields) > diff --git a/probes/lttng-events.h b/probes/lttng-events.h > index 8a3a886..8465095 100644 > --- a/probes/lttng-events.h > +++ b/probes/lttng-events.h > @@ -263,9 +263,31 @@ void trace_##_name(void *__data); > #define __string_from_user(_item, _src) \ > __string(_item, _src) > > +#undef __struct > +#define __struct(_provider, _type, _item, _params) \ > + { \ > + .name = #_item, \ > + .type = \ > + { \ > + .atype = atype_struct, \ > + .u.ctf_struct.name = #_type, \ > + .u.ctf_struct.provider = #_provider, \ > + }, \ > + }, > + > #undef TP_STRUCT__entry > #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ > > +#undef TP_FIELDS > +#define TP_FIELDS(args...) args /* Only one used in this phase */ > + > +#undef TRACEPOINT_STRUCT > +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _fields) \ > + static const struct lttng_event_field \ > + __struct_fields___##_provider##_name[] = { \ > + _fields \ > + }; > + > #undef DECLARE_EVENT_CLASS_NOARGS > #define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ > static const struct lttng_event_field __event_fields___##_name[] = { \ > @@ -301,6 +323,60 @@ static void __event_probe__##_name(void *__data); > #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > > /* > + * Stage 3.2 of the trace events. > + * > + * Create extra metadata description extra -> type > + */ > + > +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ > + > +#undef TRACEPOINT_STRUCT > +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _fields) \ > +static struct lttng_struct_desc __struct_desc___##_provider##_name = { \ > + .fields = __struct_fields___##_provider##_name, \ > + .name = #_name, \ > + .provider = #_provider, \ and exchange the two lines above, again for clarity. > + .nr_fields = ARRAY_SIZE(__struct_fields___##_provider##_name),\ > + .owner = THIS_MODULE, \ > + }; > + > +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > + > +/* > + * Stage 3.3 of the trace events. > + * > + * Associate metadata description to event or event template > + */ > + > +/* Named field types must be defined in lttng-types.h */ > + > +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ > + > +#undef __struct > +#define __struct(_provider, _type, _item, _params) \ > + { \ > + .mtype = mtype_struct, \ > + .m.struct_desc = &__struct_desc___##_provider##_type, \ 2 lines above: change double-spaces to tabs ? > + }, > + > +#undef TP_STRUCT__entry > +#define TP_STRUCT__entry(args...) args /* Only one used in this phase */ > + > +#undef DECLARE_EVENT_CLASS_NOARGS > +#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ > +static const struct lttng_metadata __metadata_for__##_name[] = { \ maybe call this: __type_metadata_for__##_name > + _tstruct \ > +}; > + > +#undef DECLARE_EVENT_CLASS > +#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ > + DECLARE_EVENT_CLASS_NOARGS(_name, PARAMS(_tstruct), PARAMS(_assign), \ > + PARAMS(_print)) > + > +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > + > + > +/* > * Stage 3.9 of the trace events. > * > * Create event descriptions. > @@ -318,9 +394,11 @@ static void __event_probe__##_name(void *__data); > #define DEFINE_EVENT_MAP_NOARGS(_template, _name, _map) \ > static const struct lttng_event_desc __event_desc___##_map = { \ > .fields = __event_fields___##_template, \ > + .extra_metadata = __metadata_for__##_template, \ > .name = #_map, \ > .probe_callback = (void *) TP_PROBE_CB(_template), \ > .nr_fields = ARRAY_SIZE(__event_fields___##_template), \ > + .nr_metadata = ARRAY_SIZE(__metadata_for__##_template), \ > .owner = THIS_MODULE, \ > }; > > @@ -420,12 +498,33 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { > __event_len += __dynamic_len[__dynamic_len_idx++] = \ > max_t(size_t, lttng_strlen_user_inatomic(_src), 1); > > +#undef __struct > +#define __struct(_provider, _type, _item, _params) \ > + __event_len += __dynamic_len[__dynamic_len_idx++] = \ > + __struct_get_size__##_provider##_type(__dynamic_len, _params); > + > #undef TP_PROTO > #define TP_PROTO(args...) args > > #undef TP_STRUCT__entry > #define TP_STRUCT__entry(args...) args > > +#undef TP_FIELDS > +#define TP_FIELDS(args...) args > + > +#undef TRACEPOINT_STRUCT > +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _fields) \ what happens if a structure has a field that contains itself ? struct a { struct a blah; } > +static inline size_t __struct_get_size__##_provider##_name(size_t *__dynamic_len, _proto)\ > + { \ > + size_t __event_len = 0; \ > + unsigned int __dynamic_len_idx = 0; \ > + \ > + if (0) \ > + (void) __dynamic_len_idx; /* don't warn if unused */\ > + _fields \ > + return __event_len; \ > +} > + > #undef DECLARE_EVENT_CLASS > #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ > static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ > @@ -470,12 +569,29 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ > #undef __string_from_user > #define __string_from_user(_item, _src) > > +#undef __struct > +#define __struct(_provider, _type, _item, _params) \ > + __event_align = max_t(size_t, __event_align, \ > + __struct_get_align__##_provider##_type(_params)); > + > #undef TP_PROTO > #define TP_PROTO(args...) args > > #undef TP_STRUCT__entry > #define TP_STRUCT__entry(args...) args > > +#undef TP_FIELDS > +#define TP_FIELDS(args...) args > + > +#undef TRACEPOINT_STRUCT > +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _fields) \ > +static inline size_t __struct_get_align__##_provider##_name(_proto) \ same worry here about structure nested within itself. It might be good to first declare a function that gets the size/alignment (2 phases like you currently do), but ensure that within that function, you call a different functions is defined at later stages, which each simply call into the original function. This will ensure the compiler will issue an error if we try to nest a structure within itself. > +{ \ > + size_t __event_align = 1; \ > + _fields \ > + return __event_align; \ > +} > + > #undef DECLARE_EVENT_CLASS > #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ > static inline size_t __event_get_align__##_name(_proto) \ > @@ -517,6 +633,9 @@ static inline size_t __event_get_align__##_name(_proto) \ > #define __string_from_user(_item, _src) \ > __string(_item, _src) > > +#undef __struct > +#define __struct(_provider, _type, _item, _params) char _item; > + > #undef TP_STRUCT__entry > #define TP_STRUCT__entry(args...) args > > @@ -568,6 +687,11 @@ __end_field_##_item: > #define __string_from_user(_item, _src) \ > __string(_item, _src) > > +#undef __struct > +#define __struct(_provider, _type, _item, _params) \ > + goto __assign_##_item; \ > +__end_field_##_item: > + > /* > * Macros mapping tp_assign() to "=", tp_memcpy() to memcpy() and tp_strcpy() to > * strcpy(). > @@ -624,12 +748,24 @@ __assign_##dest##_2: \ > #define tp_memcpy_dyn_from_user(dest, src) \ > tp_memcpy_dyn_gen(event_write_from_user, dest, src) > > +#undef tp_memcpy_struct_gen > +#define tp_memcpy_struct_gen(write_ops, dest, src) \ > +__assign_##dest: \ > + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__typemap.dest));\ instead of lttng_alignof(__typemap.dest), you should probably call something that returns the same alignment result as: __struct_get_align__##_provider##_type(_params)) above. Given that a structure can contain a variant, we have to consider that its alignment should be calculated dynamically. (ref: CTF spec for Variant type). > + __chan->ops->write_ops(&__ctx, src, \ > + sizeof(__typemap.dest) * __get_dynamic_array_len(dest));\ I expect that __typemap.dest is a char *, right ? That's a very good start! Thanks, Mathieu > + goto __end_field_##dest; > + > +#undef tp_memcpy_struct > +#define tp_memcpy_struct(dest, src) \ > + tp_memcpy_struct_gen(event_write, dest, src) > + > /* > * The string length including the final \0. > */ > #undef tp_copy_string_from_user > #define tp_copy_string_from_user(dest, src) \ > - __assign_##dest: \ > +__assign_##dest: \ > { \ > size_t __ustrlen; \ > \ > -- > 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 jeremie.galarneau at efficios.com Thu Apr 11 17:19:18 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Thu, 11 Apr 2013 17:19:18 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Remove redondant "hello" test and move "hello-static-lib" to doc/examples In-Reply-To: <20130328135040.GA29485@Krystal> References: <20130328135040.GA29485@Krystal> Message-ID: <1365715158-11452-1-git-send-email-jeremie.galarneau@efficios.com> The examples are now automatically built as part of the default make target. The "hello" test verified that an application with statically embedded tracepoint providers could be built. This is now covered by "easy-ust" in doc/examples since we now build the examples. Move the "hello-static-lib" test to doc/examples. This should provide complete and easy to understand Makefile examples to users who wish to integrate tracepoint providers to their applications. Signed-off-by: J?r?mie Galarneau --- .gitignore | 6 +- README | 2 +- configure.ac | 2 - 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 | 62 ++++++++-------- tests/Makefile.am | 2 +- 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 ------------------ tests/hello/Makefile.am | 13 ---- tests/hello/Makefile.example.bsd | 8 -- tests/hello/Makefile.example.linux | 8 -- tests/hello/README | 2 - tests/hello/hello.c | 97 ------------------------- tests/hello/tp.c | 26 ------- tests/hello/ust_tests_hello.h | 76 ------------------- 26 files changed, 349 insertions(+), 492 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 delete mode 100644 tests/hello/Makefile.am delete mode 100644 tests/hello/Makefile.example.bsd delete mode 100644 tests/hello/Makefile.example.linux delete mode 100644 tests/hello/README delete mode 100644 tests/hello/hello.c delete mode 100644 tests/hello/tp.c delete mode 100644 tests/hello/ust_tests_hello.h diff --git a/.gitignore b/.gitignore index 1065aa3..e118025 100644 --- a/.gitignore +++ b/.gitignore @@ -31,7 +31,10 @@ lttng-ust.pc ustctl/ustctl ust-consumerd/ust-consumerd -tests/hello/hello +doc/examples/demo/demo +doc/examples/easy-ust/sample +doc/examples/hello-static-lib/hello + tests/hello.cxx/hello tests/same_line_tracepoint/same_line_tracepoint tests/ust-basic-tracing/ust-basic-tracing @@ -39,5 +42,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..dadcd1f 100644 --- a/README +++ b/README @@ -72,7 +72,7 @@ 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: diff --git a/configure.ac b/configure.ac index e54cfea..be392cf 100644 --- a/configure.ac +++ b/configure.ac @@ -265,8 +265,6 @@ AC_CONFIG_FILES([ liblttng-ust-cyg-profile/Makefile 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..e9ed352 --- /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 force the examples' +Makefiles to use the source tree's public header files and libraries. 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..c18fd3f --- /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 in 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..585d133 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) @@ -269,7 +269,9 @@ carefully: - 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 + - 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..8c971e3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = . hello hello-static-lib same_line_tracepoint snprintf +SUBDIRS = . same_line_tracepoint snprintf if CXX_WORKS SUBDIRS += hello.cxx 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 diff --git a/tests/hello/Makefile.am b/tests/hello/Makefile.am deleted file mode 100644 index 324c2cd..0000000 --- a/tests/hello/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -Wsystem-headers - -noinst_PROGRAMS = hello -hello_SOURCES = hello.c tp.c ust_tests_hello.h -hello_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la -hello_CFLAGS = -Werror=old-style-definition - -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/Makefile.example.bsd b/tests/hello/Makefile.example.bsd deleted file mode 100644 index 607171c..0000000 --- a/tests/hello/Makefile.example.bsd +++ /dev/null @@ -1,8 +0,0 @@ -# Example makefile for build outside of the LTTng-UST tree. - -hello: - ${CC} -O2 -I. -o hello -lc -llttng-ust hello.c tp.c - -.PHONY: clean -clean: - rm -f hello diff --git a/tests/hello/Makefile.example.linux b/tests/hello/Makefile.example.linux deleted file mode 100644 index c983f4c..0000000 --- a/tests/hello/Makefile.example.linux +++ /dev/null @@ -1,8 +0,0 @@ -# Example makefile for build outside of the LTTng-UST tree. - -hello: - ${CC} -O2 -I. -o hello -ldl -llttng-ust hello.c tp.c - -.PHONY: clean -clean: - rm -f hello diff --git a/tests/hello/README b/tests/hello/README deleted file mode 100644 index 5d5100d..0000000 --- a/tests/hello/README +++ /dev/null @@ -1,2 +0,0 @@ -This is a "hello world" application used to verify that an instrumented -program can be built successfully. \ No newline at end of file diff --git a/tests/hello/hello.c b/tests/hello/hello.c deleted file mode 100644 index 0c18c01..0000000 --- a/tests/hello/hello.c +++ /dev/null @@ -1,97 +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 -#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; - bool mybool = 123; /* should print "1" */ - - 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, mybool); - //usleep(100000); - } - fprintf(stderr, " done.\n"); - return 0; -} diff --git a/tests/hello/tp.c b/tests/hello/tp.c deleted file mode 100644 index 4790965..0000000 --- a/tests/hello/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/ust_tests_hello.h b/tests/hello/ust_tests_hello.h deleted file mode 100644 index 88f1a7f..0000000 --- a/tests/hello/ust_tests_hello.h +++ /dev/null @@ -1,76 +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 -#include - -TRACEPOINT_EVENT(ust_tests_hello, tptest, - TP_ARGS(int, anint, int, netint, long *, values, - char *, text, size_t, textlen, - double, doublearg, float, floatarg, - bool, boolarg), - 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) - ctf_integer(bool, boolfield, boolarg) - ctf_integer_nowrite(int, filterfield, anint) - ) -) - -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 From mathieu.desnoyers at efficios.com Thu Apr 11 17:54:27 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 11 Apr 2013 17:54:27 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Remove redondant "hello" test and move "hello-static-lib" to doc/examples In-Reply-To: <1365715158-11452-1-git-send-email-jeremie.galarneau@efficios.com> References: <20130328135040.GA29485@Krystal> <1365715158-11452-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130411215427.GA31573@Krystal> redondant -> redundant * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > The examples are now automatically built as part of the default make target. > > The "hello" test verified that an application with statically embedded > tracepoint providers could be built. This is now covered by "easy-ust" in > doc/examples since we now build the examples. No, hello is referenced by lttng-ust(3) manpage. Please leave it there, but move it to examples. Thanks, Mathieu > > Move the "hello-static-lib" test to doc/examples. > > This should provide complete and easy to understand Makefile examples to users > who wish to integrate tracepoint providers to their applications. > > Signed-off-by: J?r?mie Galarneau > --- > .gitignore | 6 +- > README | 2 +- > configure.ac | 2 - > 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 | 62 ++++++++-------- > tests/Makefile.am | 2 +- > 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 ------------------ > tests/hello/Makefile.am | 13 ---- > tests/hello/Makefile.example.bsd | 8 -- > tests/hello/Makefile.example.linux | 8 -- > tests/hello/README | 2 - > tests/hello/hello.c | 97 ------------------------- > tests/hello/tp.c | 26 ------- > tests/hello/ust_tests_hello.h | 76 ------------------- > 26 files changed, 349 insertions(+), 492 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 > delete mode 100644 tests/hello/Makefile.am > delete mode 100644 tests/hello/Makefile.example.bsd > delete mode 100644 tests/hello/Makefile.example.linux > delete mode 100644 tests/hello/README > delete mode 100644 tests/hello/hello.c > delete mode 100644 tests/hello/tp.c > delete mode 100644 tests/hello/ust_tests_hello.h > > diff --git a/.gitignore b/.gitignore > index 1065aa3..e118025 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -31,7 +31,10 @@ lttng-ust.pc > ustctl/ustctl > ust-consumerd/ust-consumerd > > -tests/hello/hello > +doc/examples/demo/demo > +doc/examples/easy-ust/sample > +doc/examples/hello-static-lib/hello > + > tests/hello.cxx/hello > tests/same_line_tracepoint/same_line_tracepoint > tests/ust-basic-tracing/ust-basic-tracing > @@ -39,5 +42,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..dadcd1f 100644 > --- a/README > +++ b/README > @@ -72,7 +72,7 @@ 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: > diff --git a/configure.ac b/configure.ac > index e54cfea..be392cf 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -265,8 +265,6 @@ AC_CONFIG_FILES([ > liblttng-ust-cyg-profile/Makefile > 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..e9ed352 > --- /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 force the examples' > +Makefiles to use the source tree's public header files and libraries. > 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..c18fd3f > --- /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 in 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..585d133 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) > > @@ -269,7 +269,9 @@ carefully: > - 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 > + - 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..8c971e3 100644 > --- a/tests/Makefile.am > +++ b/tests/Makefile.am > @@ -1,4 +1,4 @@ > -SUBDIRS = . hello hello-static-lib same_line_tracepoint snprintf > +SUBDIRS = . same_line_tracepoint snprintf > > if CXX_WORKS > SUBDIRS += hello.cxx > 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 > diff --git a/tests/hello/Makefile.am b/tests/hello/Makefile.am > deleted file mode 100644 > index 324c2cd..0000000 > --- a/tests/hello/Makefile.am > +++ /dev/null > @@ -1,13 +0,0 @@ > -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -Wsystem-headers > - > -noinst_PROGRAMS = hello > -hello_SOURCES = hello.c tp.c ust_tests_hello.h > -hello_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la > -hello_CFLAGS = -Werror=old-style-definition > - > -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/Makefile.example.bsd b/tests/hello/Makefile.example.bsd > deleted file mode 100644 > index 607171c..0000000 > --- a/tests/hello/Makefile.example.bsd > +++ /dev/null > @@ -1,8 +0,0 @@ > -# Example makefile for build outside of the LTTng-UST tree. > - > -hello: > - ${CC} -O2 -I. -o hello -lc -llttng-ust hello.c tp.c > - > -.PHONY: clean > -clean: > - rm -f hello > diff --git a/tests/hello/Makefile.example.linux b/tests/hello/Makefile.example.linux > deleted file mode 100644 > index c983f4c..0000000 > --- a/tests/hello/Makefile.example.linux > +++ /dev/null > @@ -1,8 +0,0 @@ > -# Example makefile for build outside of the LTTng-UST tree. > - > -hello: > - ${CC} -O2 -I. -o hello -ldl -llttng-ust hello.c tp.c > - > -.PHONY: clean > -clean: > - rm -f hello > diff --git a/tests/hello/README b/tests/hello/README > deleted file mode 100644 > index 5d5100d..0000000 > --- a/tests/hello/README > +++ /dev/null > @@ -1,2 +0,0 @@ > -This is a "hello world" application used to verify that an instrumented > -program can be built successfully. > \ No newline at end of file > diff --git a/tests/hello/hello.c b/tests/hello/hello.c > deleted file mode 100644 > index 0c18c01..0000000 > --- a/tests/hello/hello.c > +++ /dev/null > @@ -1,97 +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 > -#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; > - bool mybool = 123; /* should print "1" */ > - > - 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, mybool); > - //usleep(100000); > - } > - fprintf(stderr, " done.\n"); > - return 0; > -} > diff --git a/tests/hello/tp.c b/tests/hello/tp.c > deleted file mode 100644 > index 4790965..0000000 > --- a/tests/hello/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/ust_tests_hello.h b/tests/hello/ust_tests_hello.h > deleted file mode 100644 > index 88f1a7f..0000000 > --- a/tests/hello/ust_tests_hello.h > +++ /dev/null > @@ -1,76 +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 > -#include > - > -TRACEPOINT_EVENT(ust_tests_hello, tptest, > - TP_ARGS(int, anint, int, netint, long *, values, > - char *, text, size_t, textlen, > - double, doublearg, float, floatarg, > - bool, boolarg), > - 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) > - ctf_integer(bool, boolfield, boolarg) > - ctf_integer_nowrite(int, filterfield, anint) > - ) > -) > - > -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 jeremie.galarneau at efficios.com Thu Apr 11 18:30:35 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Thu, 11 Apr 2013 18:30:35 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Remove redondant "hello" test and move "hello-static-lib" to doc/examples In-Reply-To: <20130411215427.GA31573@Krystal> References: <20130328135040.GA29485@Krystal> <1365715158-11452-1-git-send-email-jeremie.galarneau@efficios.com> <20130411215427.GA31573@Krystal> Message-ID: On Thu, Apr 11, 2013 at 5:54 PM, Mathieu Desnoyers wrote: > redondant -> redundant Indeed, will fix. > > * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: >> The examples are now automatically built as part of the default make target. >> >> The "hello" test verified that an application with statically embedded >> tracepoint providers could be built. This is now covered by "easy-ust" in >> doc/examples since we now build the examples. > > No, hello is referenced by lttng-ust(3) manpage. > Not anymore since I also changed the manpage in this patch to reflect the change. > Please leave it there, but move it to examples. > I don't mind keeping either easy-ust or hello as examples. However, I don't see the point in keeping them both since they demonstrate the same thing; that is building an application with built-in providers. What do you think? J?r?mie > Thanks, > > Mathieu > >> >> Move the "hello-static-lib" test to doc/examples. >> >> This should provide complete and easy to understand Makefile examples to users >> who wish to integrate tracepoint providers to their applications. >> >> Signed-off-by: J?r?mie Galarneau >> --- >> .gitignore | 6 +- >> README | 2 +- >> configure.ac | 2 - >> 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 | 62 ++++++++-------- >> tests/Makefile.am | 2 +- >> 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 ------------------ >> tests/hello/Makefile.am | 13 ---- >> tests/hello/Makefile.example.bsd | 8 -- >> tests/hello/Makefile.example.linux | 8 -- >> tests/hello/README | 2 - >> tests/hello/hello.c | 97 ------------------------- >> tests/hello/tp.c | 26 ------- >> tests/hello/ust_tests_hello.h | 76 ------------------- >> 26 files changed, 349 insertions(+), 492 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 >> delete mode 100644 tests/hello/Makefile.am >> delete mode 100644 tests/hello/Makefile.example.bsd >> delete mode 100644 tests/hello/Makefile.example.linux >> delete mode 100644 tests/hello/README >> delete mode 100644 tests/hello/hello.c >> delete mode 100644 tests/hello/tp.c >> delete mode 100644 tests/hello/ust_tests_hello.h >> >> diff --git a/.gitignore b/.gitignore >> index 1065aa3..e118025 100644 >> --- a/.gitignore >> +++ b/.gitignore >> @@ -31,7 +31,10 @@ lttng-ust.pc >> ustctl/ustctl >> ust-consumerd/ust-consumerd >> >> -tests/hello/hello >> +doc/examples/demo/demo >> +doc/examples/easy-ust/sample >> +doc/examples/hello-static-lib/hello >> + >> tests/hello.cxx/hello >> tests/same_line_tracepoint/same_line_tracepoint >> tests/ust-basic-tracing/ust-basic-tracing >> @@ -39,5 +42,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..dadcd1f 100644 >> --- a/README >> +++ b/README >> @@ -72,7 +72,7 @@ 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: >> diff --git a/configure.ac b/configure.ac >> index e54cfea..be392cf 100644 >> --- a/configure.ac >> +++ b/configure.ac >> @@ -265,8 +265,6 @@ AC_CONFIG_FILES([ >> liblttng-ust-cyg-profile/Makefile >> 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..e9ed352 >> --- /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 force the examples' >> +Makefiles to use the source tree's public header files and libraries. >> 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..c18fd3f >> --- /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 in 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..585d133 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) >> >> @@ -269,7 +269,9 @@ carefully: >> - 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 >> + - 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..8c971e3 100644 >> --- a/tests/Makefile.am >> +++ b/tests/Makefile.am >> @@ -1,4 +1,4 @@ >> -SUBDIRS = . hello hello-static-lib same_line_tracepoint snprintf >> +SUBDIRS = . same_line_tracepoint snprintf >> >> if CXX_WORKS >> SUBDIRS += hello.cxx >> 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 >> diff --git a/tests/hello/Makefile.am b/tests/hello/Makefile.am >> deleted file mode 100644 >> index 324c2cd..0000000 >> --- a/tests/hello/Makefile.am >> +++ /dev/null >> @@ -1,13 +0,0 @@ >> -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -Wsystem-headers >> - >> -noinst_PROGRAMS = hello >> -hello_SOURCES = hello.c tp.c ust_tests_hello.h >> -hello_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la >> -hello_CFLAGS = -Werror=old-style-definition >> - >> -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/Makefile.example.bsd b/tests/hello/Makefile.example.bsd >> deleted file mode 100644 >> index 607171c..0000000 >> --- a/tests/hello/Makefile.example.bsd >> +++ /dev/null >> @@ -1,8 +0,0 @@ >> -# Example makefile for build outside of the LTTng-UST tree. >> - >> -hello: >> - ${CC} -O2 -I. -o hello -lc -llttng-ust hello.c tp.c >> - >> -.PHONY: clean >> -clean: >> - rm -f hello >> diff --git a/tests/hello/Makefile.example.linux b/tests/hello/Makefile.example.linux >> deleted file mode 100644 >> index c983f4c..0000000 >> --- a/tests/hello/Makefile.example.linux >> +++ /dev/null >> @@ -1,8 +0,0 @@ >> -# Example makefile for build outside of the LTTng-UST tree. >> - >> -hello: >> - ${CC} -O2 -I. -o hello -ldl -llttng-ust hello.c tp.c >> - >> -.PHONY: clean >> -clean: >> - rm -f hello >> diff --git a/tests/hello/README b/tests/hello/README >> deleted file mode 100644 >> index 5d5100d..0000000 >> --- a/tests/hello/README >> +++ /dev/null >> @@ -1,2 +0,0 @@ >> -This is a "hello world" application used to verify that an instrumented >> -program can be built successfully. >> \ No newline at end of file >> diff --git a/tests/hello/hello.c b/tests/hello/hello.c >> deleted file mode 100644 >> index 0c18c01..0000000 >> --- a/tests/hello/hello.c >> +++ /dev/null >> @@ -1,97 +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 >> -#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; >> - bool mybool = 123; /* should print "1" */ >> - >> - 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, mybool); >> - //usleep(100000); >> - } >> - fprintf(stderr, " done.\n"); >> - return 0; >> -} >> diff --git a/tests/hello/tp.c b/tests/hello/tp.c >> deleted file mode 100644 >> index 4790965..0000000 >> --- a/tests/hello/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/ust_tests_hello.h b/tests/hello/ust_tests_hello.h >> deleted file mode 100644 >> index 88f1a7f..0000000 >> --- a/tests/hello/ust_tests_hello.h >> +++ /dev/null >> @@ -1,76 +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 >> -#include >> - >> -TRACEPOINT_EVENT(ust_tests_hello, tptest, >> - TP_ARGS(int, anint, int, netint, long *, values, >> - char *, text, size_t, textlen, >> - double, doublearg, float, floatarg, >> - bool, boolarg), >> - 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) >> - ctf_integer(bool, boolfield, boolarg) >> - ctf_integer_nowrite(int, filterfield, anint) >> - ) >> -) >> - >> -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 -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From mathieu.desnoyers at efficios.com Thu Apr 11 18:42:34 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 11 Apr 2013 18:42:34 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Remove redondant "hello" test and move "hello-static-lib" to doc/examples In-Reply-To: References: <20130328135040.GA29485@Krystal> <1365715158-11452-1-git-send-email-jeremie.galarneau@efficios.com> <20130411215427.GA31573@Krystal> Message-ID: <20130411224234.GA927@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > On Thu, Apr 11, 2013 at 5:54 PM, Mathieu Desnoyers > wrote: > > redondant -> redundant > > Indeed, will fix. > > > > > * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > >> The examples are now automatically built as part of the default make target. > >> > >> The "hello" test verified that an application with statically embedded > >> tracepoint providers could be built. This is now covered by "easy-ust" in > >> doc/examples since we now build the examples. > > > > No, hello is referenced by lttng-ust(3) manpage. > > > > Not anymore since I also changed the manpage in this patch to reflect > the change. > > > Please leave it there, but move it to examples. > > > > I don't mind keeping either easy-ust or hello as examples. However, I > don't see the point in keeping them both since they demonstrate the > same thing; that is building an application with built-in providers. > What do you think? I personally use "hello" to put every type of fields that need to be tested. I notice that the other test programs don't have all the fields hello has, so we lose in coverage if we remove it. But I agree it's more for tests. So we might want to leave "hello" in tests/. Thanks, Mathieu > > J?r?mie > > > Thanks, > > > > Mathieu > > > >> > >> Move the "hello-static-lib" test to doc/examples. > >> > >> This should provide complete and easy to understand Makefile examples to users > >> who wish to integrate tracepoint providers to their applications. > >> > >> Signed-off-by: J?r?mie Galarneau > >> --- > >> .gitignore | 6 +- > >> README | 2 +- > >> configure.ac | 2 - > >> 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 | 62 ++++++++-------- > >> tests/Makefile.am | 2 +- > >> 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 ------------------ > >> tests/hello/Makefile.am | 13 ---- > >> tests/hello/Makefile.example.bsd | 8 -- > >> tests/hello/Makefile.example.linux | 8 -- > >> tests/hello/README | 2 - > >> tests/hello/hello.c | 97 ------------------------- > >> tests/hello/tp.c | 26 ------- > >> tests/hello/ust_tests_hello.h | 76 ------------------- > >> 26 files changed, 349 insertions(+), 492 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 > >> delete mode 100644 tests/hello/Makefile.am > >> delete mode 100644 tests/hello/Makefile.example.bsd > >> delete mode 100644 tests/hello/Makefile.example.linux > >> delete mode 100644 tests/hello/README > >> delete mode 100644 tests/hello/hello.c > >> delete mode 100644 tests/hello/tp.c > >> delete mode 100644 tests/hello/ust_tests_hello.h > >> > >> diff --git a/.gitignore b/.gitignore > >> index 1065aa3..e118025 100644 > >> --- a/.gitignore > >> +++ b/.gitignore > >> @@ -31,7 +31,10 @@ lttng-ust.pc > >> ustctl/ustctl > >> ust-consumerd/ust-consumerd > >> > >> -tests/hello/hello > >> +doc/examples/demo/demo > >> +doc/examples/easy-ust/sample > >> +doc/examples/hello-static-lib/hello > >> + > >> tests/hello.cxx/hello > >> tests/same_line_tracepoint/same_line_tracepoint > >> tests/ust-basic-tracing/ust-basic-tracing > >> @@ -39,5 +42,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..dadcd1f 100644 > >> --- a/README > >> +++ b/README > >> @@ -72,7 +72,7 @@ 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: > >> diff --git a/configure.ac b/configure.ac > >> index e54cfea..be392cf 100644 > >> --- a/configure.ac > >> +++ b/configure.ac > >> @@ -265,8 +265,6 @@ AC_CONFIG_FILES([ > >> liblttng-ust-cyg-profile/Makefile > >> 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..e9ed352 > >> --- /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 force the examples' > >> +Makefiles to use the source tree's public header files and libraries. > >> 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..c18fd3f > >> --- /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 in 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..585d133 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) > >> > >> @@ -269,7 +269,9 @@ carefully: > >> - 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 > >> + - 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..8c971e3 100644 > >> --- a/tests/Makefile.am > >> +++ b/tests/Makefile.am > >> @@ -1,4 +1,4 @@ > >> -SUBDIRS = . hello hello-static-lib same_line_tracepoint snprintf > >> +SUBDIRS = . same_line_tracepoint snprintf > >> > >> if CXX_WORKS > >> SUBDIRS += hello.cxx > >> 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 > >> diff --git a/tests/hello/Makefile.am b/tests/hello/Makefile.am > >> deleted file mode 100644 > >> index 324c2cd..0000000 > >> --- a/tests/hello/Makefile.am > >> +++ /dev/null > >> @@ -1,13 +0,0 @@ > >> -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -Wsystem-headers > >> - > >> -noinst_PROGRAMS = hello > >> -hello_SOURCES = hello.c tp.c ust_tests_hello.h > >> -hello_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la > >> -hello_CFLAGS = -Werror=old-style-definition > >> - > >> -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/Makefile.example.bsd b/tests/hello/Makefile.example.bsd > >> deleted file mode 100644 > >> index 607171c..0000000 > >> --- a/tests/hello/Makefile.example.bsd > >> +++ /dev/null > >> @@ -1,8 +0,0 @@ > >> -# Example makefile for build outside of the LTTng-UST tree. > >> - > >> -hello: > >> - ${CC} -O2 -I. -o hello -lc -llttng-ust hello.c tp.c > >> - > >> -.PHONY: clean > >> -clean: > >> - rm -f hello > >> diff --git a/tests/hello/Makefile.example.linux b/tests/hello/Makefile.example.linux > >> deleted file mode 100644 > >> index c983f4c..0000000 > >> --- a/tests/hello/Makefile.example.linux > >> +++ /dev/null > >> @@ -1,8 +0,0 @@ > >> -# Example makefile for build outside of the LTTng-UST tree. > >> - > >> -hello: > >> - ${CC} -O2 -I. -o hello -ldl -llttng-ust hello.c tp.c > >> - > >> -.PHONY: clean > >> -clean: > >> - rm -f hello > >> diff --git a/tests/hello/README b/tests/hello/README > >> deleted file mode 100644 > >> index 5d5100d..0000000 > >> --- a/tests/hello/README > >> +++ /dev/null > >> @@ -1,2 +0,0 @@ > >> -This is a "hello world" application used to verify that an instrumented > >> -program can be built successfully. > >> \ No newline at end of file > >> diff --git a/tests/hello/hello.c b/tests/hello/hello.c > >> deleted file mode 100644 > >> index 0c18c01..0000000 > >> --- a/tests/hello/hello.c > >> +++ /dev/null > >> @@ -1,97 +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 > >> -#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; > >> - bool mybool = 123; /* should print "1" */ > >> - > >> - 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, mybool); > >> - //usleep(100000); > >> - } > >> - fprintf(stderr, " done.\n"); > >> - return 0; > >> -} > >> diff --git a/tests/hello/tp.c b/tests/hello/tp.c > >> deleted file mode 100644 > >> index 4790965..0000000 > >> --- a/tests/hello/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/ust_tests_hello.h b/tests/hello/ust_tests_hello.h > >> deleted file mode 100644 > >> index 88f1a7f..0000000 > >> --- a/tests/hello/ust_tests_hello.h > >> +++ /dev/null > >> @@ -1,76 +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 > >> -#include > >> - > >> -TRACEPOINT_EVENT(ust_tests_hello, tptest, > >> - TP_ARGS(int, anint, int, netint, long *, values, > >> - char *, text, size_t, textlen, > >> - double, doublearg, float, floatarg, > >> - bool, boolarg), > >> - 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) > >> - ctf_integer(bool, boolfield, boolarg) > >> - ctf_integer_nowrite(int, filterfield, anint) > >> - ) > >> -) > >> - > >> -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 > > > > -- > J?r?mie Galarneau > EfficiOS Inc. > http://www.efficios.com -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From jeremie.galarneau at efficios.com Thu Apr 11 18:49:16 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Thu, 11 Apr 2013 18:49:16 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Remove redondant "hello" test and move "hello-static-lib" to doc/examples In-Reply-To: <20130411224234.GA927@Krystal> References: <20130328135040.GA29485@Krystal> <1365715158-11452-1-git-send-email-jeremie.galarneau@efficios.com> <20130411215427.GA31573@Krystal> <20130411224234.GA927@Krystal> Message-ID: On Thu, Apr 11, 2013 at 6:42 PM, Mathieu Desnoyers wrote: > * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: >> On Thu, Apr 11, 2013 at 5:54 PM, Mathieu Desnoyers >> wrote: >> > redondant -> redundant >> >> Indeed, will fix. >> >> > >> > * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: >> >> The examples are now automatically built as part of the default make target. >> >> >> >> The "hello" test verified that an application with statically embedded >> >> tracepoint providers could be built. This is now covered by "easy-ust" in >> >> doc/examples since we now build the examples. >> > >> > No, hello is referenced by lttng-ust(3) manpage. >> > >> >> Not anymore since I also changed the manpage in this patch to reflect >> the change. >> >> > Please leave it there, but move it to examples. >> > >> >> I don't mind keeping either easy-ust or hello as examples. However, I >> don't see the point in keeping them both since they demonstrate the >> same thing; that is building an application with built-in providers. >> What do you think? > > I personally use "hello" to put every type of fields that need to be > tested. I notice that the other test programs don't have all the fields > hello has, so we lose in coverage if we remove it. > Good point. > But I agree it's more for tests. So we might want to leave "hello" > in tests/. > Fair enough. I'll submit a new patch. Thanks for the comments, J?r?mie > Thanks, > > Mathieu > >> >> J?r?mie >> >> > Thanks, >> > >> > Mathieu >> > >> >> >> >> Move the "hello-static-lib" test to doc/examples. >> >> >> >> This should provide complete and easy to understand Makefile examples to users >> >> who wish to integrate tracepoint providers to their applications. >> >> >> >> Signed-off-by: J?r?mie Galarneau >> >> --- >> >> .gitignore | 6 +- >> >> README | 2 +- >> >> configure.ac | 2 - >> >> 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 | 62 ++++++++-------- >> >> tests/Makefile.am | 2 +- >> >> 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 ------------------ >> >> tests/hello/Makefile.am | 13 ---- >> >> tests/hello/Makefile.example.bsd | 8 -- >> >> tests/hello/Makefile.example.linux | 8 -- >> >> tests/hello/README | 2 - >> >> tests/hello/hello.c | 97 ------------------------- >> >> tests/hello/tp.c | 26 ------- >> >> tests/hello/ust_tests_hello.h | 76 ------------------- >> >> 26 files changed, 349 insertions(+), 492 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 >> >> delete mode 100644 tests/hello/Makefile.am >> >> delete mode 100644 tests/hello/Makefile.example.bsd >> >> delete mode 100644 tests/hello/Makefile.example.linux >> >> delete mode 100644 tests/hello/README >> >> delete mode 100644 tests/hello/hello.c >> >> delete mode 100644 tests/hello/tp.c >> >> delete mode 100644 tests/hello/ust_tests_hello.h >> >> >> >> diff --git a/.gitignore b/.gitignore >> >> index 1065aa3..e118025 100644 >> >> --- a/.gitignore >> >> +++ b/.gitignore >> >> @@ -31,7 +31,10 @@ lttng-ust.pc >> >> ustctl/ustctl >> >> ust-consumerd/ust-consumerd >> >> >> >> -tests/hello/hello >> >> +doc/examples/demo/demo >> >> +doc/examples/easy-ust/sample >> >> +doc/examples/hello-static-lib/hello >> >> + >> >> tests/hello.cxx/hello >> >> tests/same_line_tracepoint/same_line_tracepoint >> >> tests/ust-basic-tracing/ust-basic-tracing >> >> @@ -39,5 +42,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..dadcd1f 100644 >> >> --- a/README >> >> +++ b/README >> >> @@ -72,7 +72,7 @@ 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: >> >> diff --git a/configure.ac b/configure.ac >> >> index e54cfea..be392cf 100644 >> >> --- a/configure.ac >> >> +++ b/configure.ac >> >> @@ -265,8 +265,6 @@ AC_CONFIG_FILES([ >> >> liblttng-ust-cyg-profile/Makefile >> >> 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..e9ed352 >> >> --- /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 force the examples' >> >> +Makefiles to use the source tree's public header files and libraries. >> >> 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..c18fd3f >> >> --- /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 in 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..585d133 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) >> >> >> >> @@ -269,7 +269,9 @@ carefully: >> >> - 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 >> >> + - 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..8c971e3 100644 >> >> --- a/tests/Makefile.am >> >> +++ b/tests/Makefile.am >> >> @@ -1,4 +1,4 @@ >> >> -SUBDIRS = . hello hello-static-lib same_line_tracepoint snprintf >> >> +SUBDIRS = . same_line_tracepoint snprintf >> >> >> >> if CXX_WORKS >> >> SUBDIRS += hello.cxx >> >> 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 >> >> diff --git a/tests/hello/Makefile.am b/tests/hello/Makefile.am >> >> deleted file mode 100644 >> >> index 324c2cd..0000000 >> >> --- a/tests/hello/Makefile.am >> >> +++ /dev/null >> >> @@ -1,13 +0,0 @@ >> >> -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -Wsystem-headers >> >> - >> >> -noinst_PROGRAMS = hello >> >> -hello_SOURCES = hello.c tp.c ust_tests_hello.h >> >> -hello_LDADD = $(top_builddir)/liblttng-ust/liblttng-ust.la >> >> -hello_CFLAGS = -Werror=old-style-definition >> >> - >> >> -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/Makefile.example.bsd b/tests/hello/Makefile.example.bsd >> >> deleted file mode 100644 >> >> index 607171c..0000000 >> >> --- a/tests/hello/Makefile.example.bsd >> >> +++ /dev/null >> >> @@ -1,8 +0,0 @@ >> >> -# Example makefile for build outside of the LTTng-UST tree. >> >> - >> >> -hello: >> >> - ${CC} -O2 -I. -o hello -lc -llttng-ust hello.c tp.c >> >> - >> >> -.PHONY: clean >> >> -clean: >> >> - rm -f hello >> >> diff --git a/tests/hello/Makefile.example.linux b/tests/hello/Makefile.example.linux >> >> deleted file mode 100644 >> >> index c983f4c..0000000 >> >> --- a/tests/hello/Makefile.example.linux >> >> +++ /dev/null >> >> @@ -1,8 +0,0 @@ >> >> -# Example makefile for build outside of the LTTng-UST tree. >> >> - >> >> -hello: >> >> - ${CC} -O2 -I. -o hello -ldl -llttng-ust hello.c tp.c >> >> - >> >> -.PHONY: clean >> >> -clean: >> >> - rm -f hello >> >> diff --git a/tests/hello/README b/tests/hello/README >> >> deleted file mode 100644 >> >> index 5d5100d..0000000 >> >> --- a/tests/hello/README >> >> +++ /dev/null >> >> @@ -1,2 +0,0 @@ >> >> -This is a "hello world" application used to verify that an instrumented >> >> -program can be built successfully. >> >> \ No newline at end of file >> >> diff --git a/tests/hello/hello.c b/tests/hello/hello.c >> >> deleted file mode 100644 >> >> index 0c18c01..0000000 >> >> --- a/tests/hello/hello.c >> >> +++ /dev/null >> >> @@ -1,97 +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 >> >> -#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; >> >> - bool mybool = 123; /* should print "1" */ >> >> - >> >> - 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, mybool); >> >> - //usleep(100000); >> >> - } >> >> - fprintf(stderr, " done.\n"); >> >> - return 0; >> >> -} >> >> diff --git a/tests/hello/tp.c b/tests/hello/tp.c >> >> deleted file mode 100644 >> >> index 4790965..0000000 >> >> --- a/tests/hello/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/ust_tests_hello.h b/tests/hello/ust_tests_hello.h >> >> deleted file mode 100644 >> >> index 88f1a7f..0000000 >> >> --- a/tests/hello/ust_tests_hello.h >> >> +++ /dev/null >> >> @@ -1,76 +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 >> >> -#include >> >> - >> >> -TRACEPOINT_EVENT(ust_tests_hello, tptest, >> >> - TP_ARGS(int, anint, int, netint, long *, values, >> >> - char *, text, size_t, textlen, >> >> - double, doublearg, float, floatarg, >> >> - bool, boolarg), >> >> - 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) >> >> - ctf_integer(bool, boolfield, boolarg) >> >> - ctf_integer_nowrite(int, filterfield, anint) >> >> - ) >> >> -) >> >> - >> >> -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 >> >> >> >> -- >> J?r?mie Galarneau >> EfficiOS Inc. >> http://www.efficios.com > > -- > Mathieu Desnoyers > EfficiOS Inc. > http://www.efficios.com -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From jp_ikaheimonen at mentor.com Fri Apr 12 01:50:07 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Fri, 12 Apr 2013 05:50:07 +0000 Subject: [lttng-dev] [Babeltrace ] New option for specifiying time stamp offsets in nanoseconds Message-ID: <009B25148989C6458484484699278506E5371E1A@EU-MBX-03.mgc.mentorg.com> Hi, in our work we are synchronizing traces from several sources. For that purpose, we found that we need to set a nanosecond-resolution offset to make the traces compatible. Babeltrace has an option --clock-offset that can add a value for each timestamp. However, that option only accepts full seconds. We've added a new option --clock-offset-ns which allows the user to give a new offset, this time in nanoseconds. A patch with the implementation will follow. 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. From xiaonahappy13 at gmail.com Fri Apr 12 01:50:23 2013 From: xiaonahappy13 at gmail.com (Xiaona Han) Date: Fri, 12 Apr 2013 13:50:23 +0800 Subject: [lttng-dev] GSoC 2013 idea: support a new language binding for lttng Message-ID: Dear all, I am very interested in lttng of GSoC 2013. I find that current lttng only supports python. I want to support another language binding for lttng. I am familiar with Lua and SWIG. By adding Lua language support, lttng could be used by Lua developers and users. Are there anyone interested in mentoring me about this idea? Thanks. Best regards, Xiaona Han. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jp_ikaheimonen at mentor.com Fri Apr 12 01:52:23 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Fri, 12 Apr 2013 05:52:23 +0000 Subject: [lttng-dev] [Babeltrace PATCH] Add new option --clock-offset-ns Message-ID: <009B25148989C6458484484699278506E5371E30@EU-MBX-03.mgc.mentorg.com> 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 From mathieu.desnoyers at efficios.com Fri Apr 12 09:21:58 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 12 Apr 2013 09:21:58 -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: <20130412132158.GA27890@Krystal> * 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 Sounds like a nice feature. One comment below, > > --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) { Why test *endptr != '\0' and str == endptr ? From my understanding of strtoull(3), just: errno = 0; opt_clock_offset_ns = strtoull(str, NULL, 0); if (errno != 0) { handle error... } should be enough.. ? If not, I'd really like to know what I am missing. Thanks, Mathieu > + 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 jeremie.galarneau at efficios.com Fri Apr 12 11:26:31 2013 From: jeremie.galarneau at efficios.com (=?UTF-8?q?J=C3=A9r=C3=A9mie=20Galarneau?=) Date: Fri, 12 Apr 2013 11:26:31 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Move "hello-static-lib" to doc/examples and add non-automake Makefiles In-Reply-To: <20130411224234.GA927@Krystal> References: <20130411224234.GA927@Krystal> Message-ID: <1365780391-16997-1-git-send-email-jeremie.galarneau@efficios.com> 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. 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 From christian.babeux at efficios.com Fri Apr 12 11:48:10 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Fri, 12 Apr 2013 11:48:10 -0400 Subject: [lttng-dev] GSoC 2013, "Instrumenting Open Source projects using UST" project. In-Reply-To: References: Message-ID: Hi, Do you have a specific open-source project in mind that you would like to instrument with LTTng? Instrumenting should be straightforward (add tracepoints to the application source code), the challenge will reside in finding the appropriates sites to instruments to get useful data out of the application. Thanks, Christian On Tue, Apr 9, 2013 at 10:20 PM, Tabibel Sami wrote: > Hello, > I am doing master degree of Cryptology and information security > I have good C, Python and Scapy skills, and i am interested to work on > "Instrumenting Open Source projects using UST" project this summer. > > I am looking for any comment about the difficulty and the content of > the project, and also about my chances to be accepted if i apply for. > > Thanks in advance. > Best Regards. > > _______________________________________________ > 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 Fri Apr 12 11:50:55 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Fri, 12 Apr 2013 11:50:55 -0400 Subject: [lttng-dev] GSoC 2013 idea: support a new language binding for lttng In-Reply-To: References: Message-ID: Hi Xiaona, This could be feasible. I don't know how the others LTTng developers would feel about adding other language bindings. Thoughts? Christian On Fri, Apr 12, 2013 at 1:50 AM, Xiaona Han wrote: > Dear all, > I am very interested in lttng of GSoC 2013. I find that current lttng > only supports python. I want to support another language binding for lttng. > I am familiar with Lua and SWIG. By adding Lua language support, lttng could > be used by Lua developers and users. Are there anyone interested in > mentoring me about this idea? Thanks. > > > Best regards, > Xiaona Han. > > _______________________________________________ > 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 Fri Apr 12 11:59:03 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Fri, 12 Apr 2013 11:59:03 -0400 Subject: [lttng-dev] GSoC 2013 idea: support a new language binding for lttng In-Reply-To: References: Message-ID: My main concern is that I don't know if any current LTTng contributor is proficient in Lua and will be able to provide the necessary guidance. That also raises the important question of finding someone who will maintain the bindings after GSoC. J?r?mie On Fri, Apr 12, 2013 at 11:50 AM, Christian Babeux wrote: > Hi Xiaona, > > This could be feasible. I don't know how the others LTTng developers > would feel about adding other language bindings. > > Thoughts? > > Christian > > On Fri, Apr 12, 2013 at 1:50 AM, Xiaona Han wrote: >> Dear all, >> I am very interested in lttng of GSoC 2013. I find that current lttng >> only supports python. I want to support another language binding for lttng. >> I am familiar with Lua and SWIG. By adding Lua language support, lttng could >> be used by Lua developers and users. Are there anyone interested in >> mentoring me about this idea? Thanks. >> >> >> Best regards, >> Xiaona Han. >> >> _______________________________________________ >> 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 -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From dgoulet at efficios.com Fri Apr 12 12:03:45 2013 From: dgoulet at efficios.com (David Goulet) Date: Fri, 12 Apr 2013 12:03:45 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fixing a few typos in lttng-tools tree Fixes #453 In-Reply-To: <1365536495-8416-1-git-send-email-simarpreet007@gmail.com> References: <1365536495-8416-1-git-send-email-simarpreet007@gmail.com> Message-ID: <51683061.3070907@efficios.com> Merged! Thanks! Simarpreet Singh: > Signed-off-by: Simarpreet Singh > --- > src/common/error.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/src/common/error.c b/src/common/error.c > index 4fb022c..4b9b46e 100644 > --- a/src/common/error.c > +++ b/src/common/error.c > @@ -40,7 +40,7 @@ static const char *error_string_array[] = { > [ ERROR_INDEX(LTTNG_ERR_SESS_NOT_FOUND) ] = "Session name not found", > [ ERROR_INDEX(LTTNG_ERR_FATAL) ] = "Fatal error of the session daemon", > [ ERROR_INDEX(LTTNG_ERR_SELECT_SESS) ] = "A session MUST be selected", > - [ ERROR_INDEX(LTTNG_ERR_EXIST_SESS) ] = "Session name already exist", > + [ ERROR_INDEX(LTTNG_ERR_EXIST_SESS) ] = "Session name already exists", > [ ERROR_INDEX(LTTNG_ERR_NO_EVENT) ] = "Event not found", > [ ERROR_INDEX(LTTNG_ERR_CONNECT_FAIL) ] = "Unable to connect to Unix socket", > [ ERROR_INDEX(LTTNG_ERR_EPERM) ] = "Permission denied", > @@ -58,7 +58,7 @@ static const char *error_string_array[] = { > [ ERROR_INDEX(LTTNG_ERR_KERN_DISABLE_FAIL) ] = "Disable kernel event failed", > [ ERROR_INDEX(LTTNG_ERR_KERN_META_FAIL) ] = "Opening metadata failed", > [ ERROR_INDEX(LTTNG_ERR_KERN_START_FAIL) ] = "Starting kernel trace failed", > - [ ERROR_INDEX(LTTNG_ERR_KERN_STOP_FAIL) ] = "Stoping kernel trace failed", > + [ ERROR_INDEX(LTTNG_ERR_KERN_STOP_FAIL) ] = "Stopping kernel trace failed", > [ ERROR_INDEX(LTTNG_ERR_KERN_CONSUMER_FAIL) ] = "Kernel consumer start failed", > [ ERROR_INDEX(LTTNG_ERR_KERN_STREAM_FAIL) ] = "Kernel create stream failed", > [ ERROR_INDEX(LTTNG_ERR_KERN_LIST_FAIL) ] = "Listing kernel events failed", > @@ -73,7 +73,7 @@ static const char *error_string_array[] = { > [ ERROR_INDEX(LTTNG_ERR_UST_DISABLE_FAIL) ] = "Disable UST event failed", > [ ERROR_INDEX(LTTNG_ERR_UST_META_FAIL) ] = "Opening metadata failed", > [ ERROR_INDEX(LTTNG_ERR_UST_START_FAIL) ] = "Starting UST trace failed", > - [ ERROR_INDEX(LTTNG_ERR_UST_STOP_FAIL) ] = "Stoping UST trace failed", > + [ ERROR_INDEX(LTTNG_ERR_UST_STOP_FAIL) ] = "Stopping UST trace failed", > [ ERROR_INDEX(LTTNG_ERR_UST_CONSUMER64_FAIL) ] = "64-bit UST consumer start failed", > [ ERROR_INDEX(LTTNG_ERR_UST_CONSUMER32_FAIL) ] = "32-bit UST consumer start failed", > [ ERROR_INDEX(LTTNG_ERR_UST_STREAM_FAIL) ] = "UST create stream failed", > @@ -82,7 +82,7 @@ static const char *error_string_array[] = { > [ ERROR_INDEX(LTTNG_ERR_UST_EVENT_NOT_FOUND)] = "UST event not found", > [ ERROR_INDEX(LTTNG_ERR_UST_CONTEXT_EXIST)] = "UST context already exist", > [ ERROR_INDEX(LTTNG_ERR_UST_CONTEXT_INVAL)] = "UST invalid context", > - [ ERROR_INDEX(LTTNG_ERR_NEED_ROOT_SESSIOND) ] = "Tracing the kernel requires a root lttng-sessiond daemon and \"tracing\" group user membership", > + [ ERROR_INDEX(LTTNG_ERR_NEED_ROOT_SESSIOND) ] = "Tracing the kernel requires a root lttng-sessiond daemon or \"tracing\" group user membership", > [ ERROR_INDEX(LTTNG_ERR_TRACE_ALREADY_STARTED) ] = "Tracing already started", > [ ERROR_INDEX(LTTNG_ERR_TRACE_ALREADY_STOPPED) ] = "Tracing already stopped", > [ ERROR_INDEX(LTTNG_ERR_KERN_EVENT_ENOSYS) ] = "Kernel event type not supported", > @@ -91,7 +91,7 @@ static const char *error_string_array[] = { > [ ERROR_INDEX(LTTNG_ERR_NO_KERNCONSUMERD) ] = "No kernel consumer detected", > [ ERROR_INDEX(LTTNG_ERR_EVENT_EXIST_LOGLEVEL) ] = "Event already enabled with different loglevel", > [ ERROR_INDEX(LTTNG_ERR_URL_DATA_MISS) ] = "Missing data path URL", > - [ ERROR_INDEX(LTTNG_ERR_URL_CTRL_MISS) ] = "Missing control data path URL", > + [ ERROR_INDEX(LTTNG_ERR_URL_CTRL_MISS) ] = "Missing control path URL", > [ ERROR_INDEX(LTTNG_ERR_ENABLE_CONSUMER_FAIL) ] = "Enabling consumer failed", > [ ERROR_INDEX(LTTNG_ERR_RELAYD_CONNECT_FAIL) ] = "Unable to connect to lttng-relayd", > [ ERROR_INDEX(LTTNG_ERR_RELAYD_VERSION_FAIL) ] = "Relay daemon not compatible", From christian.babeux at efficios.com Fri Apr 12 12:10:41 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Fri, 12 Apr 2013 12:10:41 -0400 Subject: [lttng-dev] GSoC 2013, "Instrumenting Open Source projects using UST" project. In-Reply-To: References: Message-ID: Reply from Tabibel Sami: ---------- Forwarded message ---------- From: Tabibel Sami Date: Fri, Apr 12, 2013 at 11:59 AM Subject: Re: [lttng-dev] GSoC 2013, "Instrumenting Open Source projects using UST" project. To: Christian Babeux On Fri, Apr 12, 2013 at 5:48 PM, Christian Babeux wrote: > Hi, > > Do you have a specific open-source project in mind that you would like > to instrument with LTTng? I have studied little of wpa_supplicant source code lately, I understand a little of its operation Principe, I have some backgrounds on 802.1x authentication. and i am khow working on implementation of EAP-SIM supplicant, It will be good thing if i can work on this software . > Instrumenting should be straightforward (add tracepoints to the > application source code), the challenge will reside in finding the > appropriates sites to instruments to get useful data out of the > application. > > Thanks, > Thanks Regards! -- Sami On Fri, Apr 12, 2013 at 11:48 AM, Christian Babeux wrote: > Hi, > > Do you have a specific open-source project in mind that you would like > to instrument with LTTng? > > Instrumenting should be straightforward (add tracepoints to the > application source code), the challenge will reside in finding the > appropriates sites to instruments to get useful data out of the > application. > > Thanks, > > Christian > > On Tue, Apr 9, 2013 at 10:20 PM, Tabibel Sami wrote: >> Hello, >> I am doing master degree of Cryptology and information security >> I have good C, Python and Scapy skills, and i am interested to work on >> "Instrumenting Open Source projects using UST" project this summer. >> >> I am looking for any comment about the difficulty and the content of >> the project, and also about my chances to be accepted if i apply for. >> >> Thanks in advance. >> Best Regards. >> >> _______________________________________________ >> 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 Fri Apr 12 12:39:44 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Fri, 12 Apr 2013 12:39:44 -0400 Subject: [lttng-dev] GSoC 2013, "Instrumenting Open Source projects using UST" project. In-Reply-To: References: Message-ID: That certainly is an interesting project! You should probably approach the subject with the wpa_supplicant's developers to gauge their interest in integrating UST tracepoints into their codebase. I have never looked at their code; maybe they already have a logging or tracing infrastructure in place which would make the modifications less invasive. This, of course, applies to any project you'd like to instrument. Determining the developers' level of interest in LTTng is a crucial part of such proposals since we don't want to maintain patchsets for external projects (at least, I'd advocate against it). Looking forward to hearing from you, J?r?mie On Fri, Apr 12, 2013 at 12:10 PM, Christian Babeux wrote: > Reply from Tabibel Sami: > > ---------- Forwarded message ---------- > From: Tabibel Sami > Date: Fri, Apr 12, 2013 at 11:59 AM > Subject: Re: [lttng-dev] GSoC 2013, "Instrumenting Open Source > projects using UST" project. > To: Christian Babeux > > > On Fri, Apr 12, 2013 at 5:48 PM, Christian Babeux > wrote: >> Hi, >> >> Do you have a specific open-source project in mind that you would like >> to instrument with LTTng? > > I have studied little of wpa_supplicant source code lately, I > understand a little of its operation Principe, I have some backgrounds > on 802.1x authentication. and i am khow working on implementation of > EAP-SIM supplicant, It will be good thing if i can work on this > software . > >> Instrumenting should be straightforward (add tracepoints to the >> application source code), the challenge will reside in finding the >> appropriates sites to instruments to get useful data out of the >> application. >> >> Thanks, >> > Thanks > Regards! > -- > Sami > > On Fri, Apr 12, 2013 at 11:48 AM, Christian Babeux > wrote: >> Hi, >> >> Do you have a specific open-source project in mind that you would like >> to instrument with LTTng? >> >> Instrumenting should be straightforward (add tracepoints to the >> application source code), the challenge will reside in finding the >> appropriates sites to instruments to get useful data out of the >> application. >> >> Thanks, >> >> Christian >> >> On Tue, Apr 9, 2013 at 10:20 PM, Tabibel Sami wrote: >>> Hello, >>> I am doing master degree of Cryptology and information security >>> I have good C, Python and Scapy skills, and i am interested to work on >>> "Instrumenting Open Source projects using UST" project this summer. >>> >>> I am looking for any comment about the difficulty and the content of >>> the project, and also about my chances to be accepted if i apply for. >>> >>> Thanks in advance. >>> Best Regards. >>> >>> _______________________________________________ >>> 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 -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From simon.marchi at polymtl.ca Fri Apr 12 17:15:12 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Fri, 12 Apr 2013 17:15:12 -0400 Subject: [lttng-dev] [PATCH v5 lttng-tools] lttng cli: Accept human readable sizes for --subbuf-size Message-ID: <1365801312-6401-1-git-send-email-simon.marchi@polymtl.ca> --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 From olteanu.claudiu at ymail.com Fri Apr 12 06:15:41 2013 From: olteanu.claudiu at ymail.com (Claudiu Olteanu) Date: Fri, 12 Apr 2013 03:15:41 -0700 (PDT) Subject: [lttng-dev] [GSoC 2013] projects information Message-ID: <1365761741.59268.YahooMailNeo@web122204.mail.ne1.yahoo.com> Hi there! My name is Claudiu Olteanu, I'm from Bucharest, Romania and I study at the University 'Politehnica' of Bucharest, the Faculty of Automatic Control and Computers Science. I'm a third year student and I would like to participate to GSoC this summer. After I took a look at the projects list I decided that it would be interesting and motivating to work on one of these projects : ?- Trace probe support in C++ ?- Development of an strace-alike wrapper I will appreciate it if you give me more details about them and some advice that can put me on track. You can find my CV here[1] in case you want to know more about me. Regards, Claudiu [1] - https://docs.google.com/file/d/0BwSntkUS-WYzVUVoZkYxdzNvNmc/edit?usp=sharing -------------- next part -------------- An HTML attachment was scrubbed... URL: From xiaonahappy13 at gmail.com Sat Apr 13 03:10:50 2013 From: xiaonahappy13 at gmail.com (Xiaona Han) Date: Sat, 13 Apr 2013 15:10:50 +0800 Subject: [lttng-dev] GSoC 2013 idea: support a new language binding for lttng In-Reply-To: References: Message-ID: Hi J?r?mie, There is no need for current LTTng contributor to be proficient in Lua. During the summer, a mentor just provides guidance on the LTTng side and I will sort out the Lua side, making the binding is suitable and native for Lua users. For your second concern, if there is no one would maintain the bindings after GSoC, I would like to continue working on it. Lua is a lightweight scripting language and is easy to be maintained. Thanks. Best Regards, Xiaona Han. 2013/4/12 J?r?mie Galarneau > My main concern is that I don't know if any current LTTng contributor > is proficient in Lua and will be able to provide the necessary > guidance. That also raises the important question of finding someone > who will maintain the bindings after GSoC. > > J?r?mie > > On Fri, Apr 12, 2013 at 11:50 AM, Christian Babeux > wrote: > > Hi Xiaona, > > > > This could be feasible. I don't know how the others LTTng developers > > would feel about adding other language bindings. > > > > Thoughts? > > > > Christian > > > > On Fri, Apr 12, 2013 at 1:50 AM, Xiaona Han > wrote: > >> Dear all, > >> I am very interested in lttng of GSoC 2013. I find that current > lttng > >> only supports python. I want to support another language binding for > lttng. > >> I am familiar with Lua and SWIG. By adding Lua language support, lttng > could > >> be used by Lua developers and users. Are there anyone interested in > >> mentoring me about this idea? Thanks. > >> > >> > >> Best regards, > >> Xiaona Han. > >> > >> _______________________________________________ > >> 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 > > > > -- > J?r?mie Galarneau > EfficiOS Inc. > http://www.efficios.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From AMITM at il.ibm.com Sun Apr 14 06:49:55 2013 From: AMITM at il.ibm.com (Amit Margalit) Date: Sun, 14 Apr 2013 13:49:55 +0300 Subject: [lttng-dev] Limitations on subbuf_size / num_subbuf? Message-ID: Hello, Sorry for the noob question. I seem to be unable to define the total of subbuf_size * num_subbuf higher than 4MB. I am getting ~30% discarded tracepoint data. Any assistance would be greatly appreciated. Amit Margalit IBM XIV - Storage Reinvented XIV-NAS Development Team Tel. 03-689-7774 Fax. 03-689-7230 -------------- next part -------------- An HTML attachment was scrubbed... URL: From yannick.brosseau at gmail.com Sun Apr 14 20:38:37 2013 From: yannick.brosseau at gmail.com (Brosseau, Yannick) Date: Sun, 14 Apr 2013 20:38:37 -0400 Subject: [lttng-dev] GSoC 2013 idea: support a new language binding for lttng In-Reply-To: References: Message-ID: Hi, I have some experience with Lua, so I could probably act as a mentor on this one. It would be interesting to find a specific use case to instrument that is applied to the Lua language. Lot of games use this language, so I can see some use at least there. Yannick On Sat, Apr 13, 2013 at 3:10 AM, Xiaona Han wrote: > Hi J?r?mie, > There is no need for current LTTng contributor to be proficient in Lua. > During the summer, a mentor just provides guidance on the LTTng side and I > will sort out the Lua side, making the binding is suitable and native for > Lua users. > For your second concern, if there is no one would maintain the bindings > after GSoC, I would like to continue working on it. Lua is a lightweight > scripting language and is easy to be maintained. Thanks. > > Best Regards, > Xiaona Han. > > > 2013/4/12 J?r?mie Galarneau > >> My main concern is that I don't know if any current LTTng contributor >> is proficient in Lua and will be able to provide the necessary >> guidance. That also raises the important question of finding someone >> who will maintain the bindings after GSoC. >> >> J?r?mie >> >> On Fri, Apr 12, 2013 at 11:50 AM, Christian Babeux >> wrote: >> > Hi Xiaona, >> > >> > This could be feasible. I don't know how the others LTTng developers >> > would feel about adding other language bindings. >> > >> > Thoughts? >> > >> > Christian >> > >> > On Fri, Apr 12, 2013 at 1:50 AM, Xiaona Han >> wrote: >> >> Dear all, >> >> I am very interested in lttng of GSoC 2013. I find that current >> lttng >> >> only supports python. I want to support another language binding for >> lttng. >> >> I am familiar with Lua and SWIG. By adding Lua language support, lttng >> could >> >> be used by Lua developers and users. Are there anyone interested in >> >> mentoring me about this idea? Thanks. >> >> >> >> >> >> Best regards, >> >> Xiaona Han. >> >> >> >> _______________________________________________ >> >> 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 >> >> >> >> -- >> 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 > > -- Yannick Brosseau yannickbrosseau.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jp_ikaheimonen at mentor.com Mon Apr 15 01:28:28 2013 From: jp_ikaheimonen at mentor.com (Ikaheimonen, JP) Date: Mon, 15 Apr 2013 05:28:28 +0000 Subject: [lttng-dev] [Babeltrace PATCH] Add new option --clock-offset-ns In-Reply-To: <20130412132158.GA27890@Krystal> References: <009B25148989C6458484484699278506E5371E30@EU-MBX-03.mgc.mentorg.com> <20130412132158.GA27890@Krystal> Message-ID: <009B25148989C6458484484699278506E53720DA@EU-MBX-03.mgc.mentorg.com> Hi Mathieu, you ponder: > + opt_clock_offset_ns = strtoull(str, &endptr, 0); > + if (*endptr != '\0' || str == endptr || errno != 0) { >Why test *endptr != '\0' and str == endptr ? This check has been copied verbatim from the similar handler for option OPT_CLOCK_ OFFSET. To me, the check for *endptr != '\0' has some value. stroull(3) will report success if the argument starts with a valid number, and the test makes sure that the entire argument was used in converting the number (that is, there are no trailing bad characters). Likewise, the check str==endptr checks if any conversion occurred at all, although this should be covered by the error case of EINVAL. However, the manual only treats this error case as a possibility ('may return'), so the check is necessary to make sure of the fact in all library implementations. 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 matthew.khouzam at ericsson.com Mon Apr 15 10:23:28 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Mon, 15 Apr 2013 10:23:28 -0400 Subject: [lttng-dev] Limitations on subbuf_size / num_subbuf? In-Reply-To: References: Message-ID: <516C0D60.1050503@ericsson.com> Not at all a n00b question, but could you give some more info? what is your version of LTTng tools, are you using UST or kernel tracing? How much ram is on your system? Kernel version? I actually have the patched lttng that has standard subbuffer sizes of 4 mb, so I have not personnaly seen that problem. But the first thing I would do is upgrade to the latest stable. On 13-04-14 06:49 AM, Amit Margalit wrote: > Hello, > > Sorry for the noob question. I seem to be unable to define the total > of subbuf_size * num_subbuf higher than 4MB. I am getting ~30% > discarded tracepoint data. > > Any assistance would be greatly appreciated. > > Amit Margalit > IBM XIV - /Storage Reinvented/ > XIV-NAS Development Team > Tel. 03-689-7774 > Fax. 03-689-7230 > > > _______________________________________________ > 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 xiaonahappy13 at gmail.com Mon Apr 15 10:25:15 2013 From: xiaonahappy13 at gmail.com (Xiaona Han) Date: Mon, 15 Apr 2013 22:25:15 +0800 Subject: [lttng-dev] GSoC 2013 idea: support a new language binding for lttng In-Reply-To: References: Message-ID: Hi Yannick Thanks for your encouragement. I take a quick look at the source code of lttng and find that lttng-tools has python bindings code. It means that support Lua bindings mainly need finish the code, documentations and tests for the lttng-tools. What about babeltrace? Do we need support Lua bindings for babeltrace APIs in this project? 2013/4/15 Brosseau, Yannick > Hi, > > I have some experience with Lua, so I could probably act as a mentor on > this one. > It would be interesting to find a specific use case to instrument that is > applied to the Lua language. Lot of games use this language, so I can see > some use at least there. > > Yannick > > > On Sat, Apr 13, 2013 at 3:10 AM, Xiaona Han wrote: > >> Hi J?r?mie, >> There is no need for current LTTng contributor to be proficient in >> Lua. During the summer, a mentor just provides guidance on the LTTng side >> and I will sort out the Lua side, making the binding is suitable and >> native for Lua users. >> For your second concern, if there is no one would maintain the >> bindings after GSoC, I would like to continue working on it. Lua is a >> lightweight scripting language and is easy to be maintained. Thanks. >> >> Best Regards, >> Xiaona Han. >> >> >> 2013/4/12 J?r?mie Galarneau >> >>> My main concern is that I don't know if any current LTTng contributor >>> is proficient in Lua and will be able to provide the necessary >>> guidance. That also raises the important question of finding someone >>> who will maintain the bindings after GSoC. >>> >>> J?r?mie >>> >>> On Fri, Apr 12, 2013 at 11:50 AM, Christian Babeux >>> wrote: >>> > Hi Xiaona, >>> > >>> > This could be feasible. I don't know how the others LTTng developers >>> > would feel about adding other language bindings. >>> > >>> > Thoughts? >>> > >>> > Christian >>> > >>> > On Fri, Apr 12, 2013 at 1:50 AM, Xiaona Han >>> wrote: >>> >> Dear all, >>> >> I am very interested in lttng of GSoC 2013. I find that current >>> lttng >>> >> only supports python. I want to support another language binding for >>> lttng. >>> >> I am familiar with Lua and SWIG. By adding Lua language support, >>> lttng could >>> >> be used by Lua developers and users. Are there anyone interested in >>> >> mentoring me about this idea? Thanks. >>> >> >>> >> >>> >> Best regards, >>> >> Xiaona Han. >>> >> >>> >> _______________________________________________ >>> >> 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 >>> >>> >>> >>> -- >>> 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 >> >> > > > -- > Yannick Brosseau > yannickbrosseau.com > -- Best Regards, Xiaona Han -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.khouzam at ericsson.com Mon Apr 15 10:36:34 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Mon, 15 Apr 2013 10:36:34 -0400 Subject: [lttng-dev] [RFC lttng-tools] Triggers In-Reply-To: <5166DFE7.8020802@efficios.com> References: <5166DFE7.8020802@efficios.com> Message-ID: <516C1072.9030902@ericsson.com> Hey tracing architects, Just a thought of consistency. we have lttng add-context (you can have many) lttng disable-context lttng enable-consumer (you can only have one) lttng disable-consumer I would suggest lttng add-trigger (you can have many) lttng disable-trigger lttng modify-trigger ??? TLDR: there should be a naming convention for lttng commands, there probably are but I have not seen them, or maybe I have but I do not remember seeing them. TLDR-TLDR: name things the same way please. :) On 13-04-11 12:08 PM, David Goulet wrote: > Hi everyone, > > Here is the second RFC of the day. > > By reading this, your imagination will probably go pretty crazy with > possibilities ;). The first implementation will only have one option > describe in the RFC but note that with this kind of feature, the sky is > the limit! and of course world domination is never far. > > Thanks! > David > > > _______________________________________________ > 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 dgoulet at efficios.com Mon Apr 15 10:54:06 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 15 Apr 2013 10:54:06 -0400 Subject: [lttng-dev] [RFC lttng-tools] Triggers In-Reply-To: <516C1072.9030902@ericsson.com> References: <5166DFE7.8020802@efficios.com> <516C1072.9030902@ericsson.com> Message-ID: <516C148E.50907@efficios.com> FYI, disable and enable-consumer are gone in 2.2-rc1. That's an interesting discussion to have. For the last years, we've used "lttng ACTION OPTIONS" scheme. Now, we choose to change that for the triggers and snapshots (RFC) is to have less commands and focus on the "object semantic" like "lttng OBJECT ACTION OPTIONS" mainly because we are pretty sure that more options and possibilities will come in the future with these complex commands. So, the main reasons is that instead of creating 3+ more commands, we go for one command that allows the user to use triggers with all the different options under the same "roof". It's a bit like "git commit" and "git remote". Git is still very usable but commands are simply different. Hope that it clarifies why we propose this new scheme. David Matthew Khouzam: > Hey tracing architects, > Just a thought of consistency. > we have > lttng add-context (you can have many) > lttng disable-context > lttng enable-consumer (you can only have one) > lttng disable-consumer > I would suggest > lttng add-trigger (you can have many) > lttng disable-trigger > lttng modify-trigger ??? > > > TLDR: there should be a naming convention for lttng commands, there > probably are but I have not seen them, or maybe I have but I do not > remember seeing them. > > TLDR-TLDR: name things the same way please. :) > > On 13-04-11 12:08 PM, David Goulet wrote: >> Hi everyone, >> >> Here is the second RFC of the day. >> >> By reading this, your imagination will probably go pretty crazy with >> possibilities ;). The first implementation will only have one option >> describe in the RFC but note that with this kind of feature, the sky is >> the limit! and of course world domination is never far. >> >> Thanks! >> David >> >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev > > > > This body part will be downloaded on demand. From dgoulet at efficios.com Mon Apr 15 11:02:43 2013 From: dgoulet at efficios.com (David Goulet) Date: Mon, 15 Apr 2013 11:02:43 -0400 Subject: [lttng-dev] [GSoC 2013] projects information In-Reply-To: <1365761741.59268.YahooMailNeo@web122204.mail.ne1.yahoo.com> References: <1365761741.59268.YahooMailNeo@web122204.mail.ne1.yahoo.com> Message-ID: <516C1693.7020908@efficios.com> Hi Claudiu, I can give you more details for the strace-alike wrapper. The lttng command line is a git alike such as "lttng create [...]" or "lttng enable-event [...]". What we are looking to do is a "lttng trace [...]" that behaves like strace meaning it will activate syscall tracing, live mode and/or the application tracepoints if available. Now, by the end of July, we are expecting to have the live feature meaning that you can see a trace while it's being written. We'll also need filtering in lttng-modules (available in UST) so only syscalls made by the application are recorded. Furthermore, per-PID tracing in UST would be awesome to complement "lttng trace" with the application's tracepoints. As you can see, there is a lot to do but the end result will be a very useful tool which is "strace" type of tool that does NOT use PTRACE and change the behavior of your application :). (with greater performance). Kernel filtering, per-PID tracing in UST, "lttng trace" command... pick your choice :) Thanks! David Claudiu Olteanu: > Hi there! > > My name is Claudiu Olteanu, I'm from Bucharest, Romania and I study at > the University 'Politehnica' of Bucharest, the Faculty of Automatic > Control and Computers Science. I'm a third year student and I would like > to participate to GSoC this summer. After I took a look at the projects > list I decided that it would be interesting and motivating to work on > one of these projects : > - Trace probe support in C++ > - Development of an strace-alike wrapper > > I will appreciate it if you give me more details about them and some > advice that can put me on track. > > You can find my CV here[1] in case you want to know more about me. > > Regards, > Claudiu > > [1] - > https://docs.google.com/file/d/0BwSntkUS-WYzVUVoZkYxdzNvNmc/edit?usp=sharing > > > > This body part will be downloaded on demand. From jeremie.galarneau at efficios.com Mon Apr 15 12:44:13 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 15 Apr 2013 12:44:13 -0400 Subject: [lttng-dev] [GSoC 2013] projects information In-Reply-To: <1365761741.59268.YahooMailNeo@web122204.mail.ne1.yahoo.com> References: <1365761741.59268.YahooMailNeo@web122204.mail.ne1.yahoo.com> Message-ID: Hi Claudiu, I'm the mentor assigned to the prospective "Trace probe support in C++" project. I'd recommend you get familiar with one of the lttng-ust example application (in doc/examples), compile and run it, and read back the resulting trace using Babeltrace. This will give you an idea of how tracepoints are integrated in an application to be instrumented. I have recently proposed a patch that adds example applications and plain, automake-less, Makefiles to lttng-ust[1]. Clone my personal development branch[2] to find it already applied. You will also want to have a look at "tests/hello.cxx" in lttng-ust's source tree which demonstrates that a C++ application can be compiled even though a tracepoint header file is included. As explained in that test's README, the tracepoint provider is compiled as a C library and then linked into an application compiled as C++. The objective of this project is to eliminate this intermediate step and let C++ developers build them directly into their application as-is. I can only suggest you try to compile your test application and providers as C++ and work your way through the errors and warnings. You'll never let anyone tell you C and C++ are the same again! Thanks for reaching out, J?r?mie [1] http://lists.lttng.org/pipermail/lttng-dev/2013-April/020029.html [2] git clone -b documentation git://github.com/jgalar/lttng-ust.git On Fri, Apr 12, 2013 at 6:15 AM, Claudiu Olteanu wrote: > Hi there! > > My name is Claudiu Olteanu, I'm from Bucharest, Romania and I study at the > University 'Politehnica' of Bucharest, the Faculty of Automatic Control and > Computers Science. I'm a third year student and I would like to participate > to GSoC this summer. After I took a look at the projects list I decided that > it would be interesting and motivating to work on one of these projects : > - Trace probe support in C++ > - Development of an strace-alike wrapper > > I will appreciate it if you give me more details about them and some advice > that can put me on track. > > You can find my CV here[1] in case you want to know more about me. > > Regards, > Claudiu > > [1] - > https://docs.google.com/file/d/0BwSntkUS-WYzVUVoZkYxdzNvNmc/edit?usp=sharing > > > _______________________________________________ > 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 aspear at vmware.com Mon Apr 15 17:14:07 2013 From: aspear at vmware.com (Aaron Spear) Date: Mon, 15 Apr 2013 14:14:07 -0700 (PDT) Subject: [lttng-dev] Java code for CTF trace writing? In-Reply-To: <1979434593.1654651.1366060059638.JavaMail.root@vmware.com> Message-ID: <383930718.1659598.1366060447359.JavaMail.root@vmware.com> Hi all, I was wondering if anyone knew of some open source Java library that could WRITE CTF traces? I am using the linuxtools/TMF plugins to read CTF traces, but now need to write them from Java as well. I have a use case where I have an "event bus" in the Java app world and I would like to persist this event stream as a CTF trace. In this particular use case, the speed/low intrusiveness of LTTng UST is not as important as the portability, so a pure Java solution is ideal, though not strictly required. Also, please let me know if there are others out there who are interested in collaborating in writing such a library. regards, Aaron Spear From philippe.proulx at polymtl.ca Mon Apr 15 18:01:40 2013 From: philippe.proulx at polymtl.ca (Philippe Proulx) Date: Mon, 15 Apr 2013 18:01:40 -0400 Subject: [lttng-dev] Java code for CTF trace writing? Message-ID: Actually, that was the exact purpose of my internship at Ericsson last summer. I designed a new architecture for the CTF part of TMF, but it is still not merged/integrated with mainline TMF (I don't even know if it's still planned). See . This new architecture is able to read _and write_ CTF packets in a generic way. The "Javeltrace" name is just a portmanteau of Java and Babeltrace, although should this refined library be integrated into TMF, it's not planned to be named like this. However, there exist a command-line tool that I made which is officially named Javeltrace and uses the aforementioned library. It is described here: . As explained on the webpage, the main goal of this utility is to test my work interactively. Keep in mind that everything mentioned here is not thoroughly tested and for sure there are a few bugs remaining. Also, the code didn't evolve with the latest CTF versions, so there must be incompatibility at some level. The main use case at Ericsson was to synthesize a precise fake trace from scratch using a human readable input format that could be versioned. The generated CTF traces would then be used to exercise parts of TMF to test specific behaviours without having to produce an actual real trace. After a few discussions, we chose JSON as an interchange format. So you will see lots of JSON related code out there. The command-line Javeltrace utility is able to translate from/to binary CTF. At the end of my internship, I started writing docs for what I did. It's here: . It's not finished, but almost, so it should be up-to-date with my Git codebase. I also made this as a proof of concept: (see all Mug*.java files). MugTracer is a simple Java tracer that produces native CTF without even using the rest of my library since CTF is so easy to *write*. It has a consumer thread and worked well, although I didn't run any benchmark and I believe it's really slow compared to UST. Feel free to contact me, should you have any question about this. On 15 April 2013 17:14, Aaron Spear wrote: > Hi all, > > I was wondering if anyone knew of some open source Java library that could WRITE CTF traces? I am using the linuxtools/TMF plugins to read CTF traces, but now need to write them from Java as well. > > I have a use case where I have an "event bus" in the Java app world and I would like to persist this event stream as a CTF trace. In this particular use case, the speed/low intrusiveness of LTTng UST is not as important as the portability, so a pure Java solution is ideal, though not strictly required. > > Also, please let me know if there are others out there who are interested in collaborating in writing such a library. > > regards, > Aaron Spear > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From Hari.Prasad at radisys.com Tue Apr 16 10:46:04 2013 From: Hari.Prasad at radisys.com (Hari Prasad Kalavakunta) Date: Tue, 16 Apr 2013 14:46:04 +0000 Subject: [lttng-dev] Processor support for user space tracer (ppc64) Message-ID: <05E83BDD0E1F054FA73F00F6970F05C60608EA@CH1PRD0810MB394.namprd08.prod.outlook.com> Hello lttng-dev, Good morning and very short question. Is user space tracer not supported yet for ppc64? URL http://lttng.org/comparison-systemtap-and-dtrace lists only x86 for User Space tracing. Could you please confirm the same. processor support Kernel tracer: x86-32, x86-64, SPARC, SPARC64, ppc, ppc64, sh, sh64, ia64, s390, MIPS 32/64, ARM, (arch-agnostic core) Userspace tracer: x86-32, x86-64 Regards, Hari -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.desnoyers at efficios.com Tue Apr 16 11:10:47 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 16 Apr 2013 11:10:47 -0400 Subject: [lttng-dev] Processor support for user space tracer (ppc64) In-Reply-To: <05E83BDD0E1F054FA73F00F6970F05C60608EA@CH1PRD0810MB394.namprd08.prod.outlook.com> References: <05E83BDD0E1F054FA73F00F6970F05C60608EA@CH1PRD0810MB394.namprd08.prod.outlook.com> Message-ID: <20130416151047.GA22323@Krystal> Yes, ppc64 should work fine with lttng-ust. This list is not up to date. CCing Christian so he can update it. * Hari Prasad Kalavakunta (Hari.Prasad at radisys.com) wrote: > Hello lttng-dev, > > Good morning and very short question. > > Is user space tracer not supported yet for ppc64? > > URL http://lttng.org/comparison-systemtap-and-dtrace lists only x86 for User Space tracing. Could you please confirm the same. > > processor support > > Kernel tracer: x86-32, x86-64, SPARC, SPARC64, ppc, ppc64, sh, sh64, ia64, s390, MIPS 32/64, ARM, (arch-agnostic core) > Userspace tracer: x86-32, x86-64 > > > Regards, > Hari > _______________________________________________ > 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 Hari.Prasad at radisys.com Tue Apr 16 15:38:52 2013 From: Hari.Prasad at radisys.com (Hari Prasad Kalavakunta) Date: Tue, 16 Apr 2013 19:38:52 +0000 Subject: [lttng-dev] linux 3.4.3 and LTTNG patch files Message-ID: <05E83BDD0E1F054FA73F00F6970F05C6060B7D@CH1PRD0810MB394.namprd08.prod.outlook.com> Hello and greetings, Good morning and very quick query. Can I use LTTNG for linux kernel 3.4.3? Could you please let me know if LTTNG patch files are available for linux 3.4.3. URL: http://lttng.org/files/lttng/ appears to have patch files for linux 2.6.xx. Are there patch files available for linux 3.4.3? Sorry for this trouble :( Regards, Hari -------------- next part -------------- An HTML attachment was scrubbed... URL: From raphael.beamonte at polymtl.ca Tue Apr 16 15:45:26 2013 From: raphael.beamonte at polymtl.ca (=?ISO-8859-1?Q?Rapha=EBl_Beamonte?=) Date: Tue, 16 Apr 2013 15:45:26 -0400 Subject: [lttng-dev] linux 3.4.3 and LTTNG patch files In-Reply-To: <05E83BDD0E1F054FA73F00F6970F05C6060B7D@CH1PRD0810MB394.namprd08.prod.outlook.com> References: <05E83BDD0E1F054FA73F00F6970F05C6060B7D@CH1PRD0810MB394.namprd08.prod.outlook.com> Message-ID: Hello Hari, You should look at lttng 2.x instead of lttng 0.x : http://lttng.org/download Rapha?l 2013/4/16 Hari Prasad Kalavakunta > Hello and greetings,**** > > ** ** > > Good morning and very quick query.**** > > ** ** > > Can I use LTTNG for linux kernel 3.4.3? Could you please let me know if > LTTNG patch files are available for linux 3.4.3.**** > > ** ** > > URL: http://lttng.org/files/lttng/ appears to have patch files for linux > 2.6.xx. Are there patch files available for linux 3.4.3?**** > > ** ** > > Sorry for this trouble :(**** > > ** ** > > Regards,**** > > Hari**** > > _______________________________________________ > 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 Apr 16 16:11:33 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 16 Apr 2013 16:11:33 -0400 Subject: [lttng-dev] linux 3.4.3 and LTTNG patch files In-Reply-To: References: <05E83BDD0E1F054FA73F00F6970F05C6060B7D@CH1PRD0810MB394.namprd08.prod.outlook.com> Message-ID: <20130416201132.GA27612@Krystal> ... and no patches are needed for your kernel version. You just need to build the modules following the README instructions. Thanks, Mathieu * Rapha?l Beamonte (raphael.beamonte at polymtl.ca) wrote: > Hello Hari, > > You should look at lttng 2.x instead of lttng 0.x : > http://lttng.org/download > > Rapha?l > > 2013/4/16 Hari Prasad Kalavakunta > > > Hello and greetings,**** > > > > ** ** > > > > Good morning and very quick query.**** > > > > ** ** > > > > Can I use LTTNG for linux kernel 3.4.3? Could you please let me know if > > LTTNG patch files are available for linux 3.4.3.**** > > > > ** ** > > > > URL: http://lttng.org/files/lttng/ appears to have patch files for linux > > 2.6.xx. Are there patch files available for linux 3.4.3?**** > > > > ** ** > > > > Sorry for this trouble :(**** > > > > ** ** > > > > Regards,**** > > > > Hari**** > > > > _______________________________________________ > > 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 raphael.beamonte at polymtl.ca Tue Apr 16 16:22:24 2013 From: raphael.beamonte at polymtl.ca (=?ISO-8859-1?Q?Rapha=EBl_Beamonte?=) Date: Tue, 16 Apr 2013 16:22:24 -0400 Subject: [lttng-dev] linux 3.4.3 and LTTNG patch files In-Reply-To: <05E83BDD0E1F054FA73F00F6970F05C6060DA6@CH1PRD0810MB394.namprd08.prod.outlook.com> References: <05E83BDD0E1F054FA73F00F6970F05C6060B7D@CH1PRD0810MB394.namprd08.prod.outlook.com> <05E83BDD0E1F054FA73F00F6970F05C6060DA6@CH1PRD0810MB394.namprd08.prod.outlook.com> Message-ID: Hello Hari, 2013/4/16 Hari Prasad Kalavakunta > Could you please let me know if these installation can be done without > patching the kernel (unlike lttng 0.x) > With LTTng 2.x, you just have to build and install the kernel modules (lttng-modules) for kernel tracing, you don't need to patch the kernel like it was necessary for LTTng 0.x. Sorry again for taking your time. I am just getting started :( > No problem, just don't forget to add the lttng-dev list in copy when you answer ! Rapha?l 2013/4/16 Hari Prasad Kalavakunta > Hi Rapha?l**** > > ** ** > > I have referred incorrectly to 0.x while looking at LTTNG Quick Start > Guide. **** > > ** ** > > I have now looked at download page http://lttng.org/download**** > > ** ** > > Below section and links appears to be relevant for me. **** > LTTng 2.1 "Basse Messe" - Tracer > toolchain**** > > *LTTng-tools 2.1.1 > *(Changelog) > **** > > the trace control client**** > > *LTTng-modules 2.1.1 > *(Changelog) > **** > > the kernel modules (requires at least Linux 2.6.38)**** > > *LTTng-UST 2.1.2 > *(Changelog) > **** > > the userspace tracing library**** > > ** ** > > Could you please let me know if these installation can be done without > patching the kernel (unlike lttng 0.x)**** > > ** ** > > Sorry again for taking your time. I am just getting started :(**** > > ** ** > > Regards,**** > > Hari**** > > ** ** > > *From:* nashii at gmail.com [mailto:nashii at gmail.com] *On Behalf Of *Rapha?l > Beamonte > *Sent:* Wednesday, April 17, 2013 1:15 AM > *To:* Hari Prasad Kalavakunta > *Cc:* lttng-dev at lists.lttng.org > *Subject:* Re: [lttng-dev] linux 3.4.3 and LTTNG patch files**** > > ** ** > > Hello Hari, > > You should look at lttng 2.x instead of lttng 0.x : > http://lttng.org/download > > Rapha?l**** > > 2013/4/16 Hari Prasad Kalavakunta **** > > Hello and greetings,**** > > **** > > Good morning and very quick query.**** > > **** > > Can I use LTTNG for linux kernel 3.4.3? Could you please let me know if > LTTNG patch files are available for linux 3.4.3.**** > > **** > > URL: http://lttng.org/files/lttng/ appears to have patch files for linux > 2.6.xx. Are there patch files available for linux 3.4.3?**** > > **** > > Sorry for this trouble :(**** > > **** > > Regards,**** > > Hari**** > > > _______________________________________________ > 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 Hari.Prasad at radisys.com Tue Apr 16 16:26:25 2013 From: Hari.Prasad at radisys.com (Hari Prasad Kalavakunta) Date: Tue, 16 Apr 2013 20:26:25 +0000 Subject: [lttng-dev] linux 3.4.3 and LTTNG patch files In-Reply-To: References: <05E83BDD0E1F054FA73F00F6970F05C6060B7D@CH1PRD0810MB394.namprd08.prod.outlook.com> <05E83BDD0E1F054FA73F00F6970F05C6060DA6@CH1PRD0810MB394.namprd08.prod.outlook.com> Message-ID: <05E83BDD0E1F054FA73F00F6970F05C6060DCB@CH1PRD0810MB394.namprd08.prod.outlook.com> Thanks, Rapha?l "With LTTng 2.x, you just have to build and install the kernel modules (lttng-modules) for kernel tracing," I hope you meat for both User Space Tracing and Kernel Tracing !!! Regards, Hari From: nashii at gmail.com [mailto:nashii at gmail.com] On Behalf Of Rapha?l Beamonte Sent: Wednesday, April 17, 2013 1:52 AM To: Hari Prasad Kalavakunta Cc: lttng-dev at lists.lttng.org Subject: Re: [lttng-dev] linux 3.4.3 and LTTNG patch files Hello Hari, 2013/4/16 Hari Prasad Kalavakunta > Could you please let me know if these installation can be done without patching the kernel (unlike lttng 0.x) With LTTng 2.x, you just have to build and install the kernel modules (lttng-modules) for kernel tracing, you don't need to patch the kernel like it was necessary for LTTng 0.x. Sorry again for taking your time. I am just getting started :( No problem, just don't forget to add the lttng-dev list in copy when you answer ! Rapha?l 2013/4/16 Hari Prasad Kalavakunta > Hi Rapha?l I have referred incorrectly to 0.x while looking at LTTNG Quick Start Guide. I have now looked at download page http://lttng.org/download Below section and links appears to be relevant for me. LTTng 2.1 "Basse Messe" - Tracer toolchain LTTng-tools 2.1.1 (Changelog) the trace control client LTTng-modules 2.1.1 (Changelog) the kernel modules (requires at least Linux 2.6.38) LTTng-UST 2.1.2 (Changelog) the userspace tracing library Could you please let me know if these installation can be done without patching the kernel (unlike lttng 0.x) Sorry again for taking your time. I am just getting started :( Regards, Hari From: nashii at gmail.com [mailto:nashii at gmail.com] On Behalf Of Rapha?l Beamonte Sent: Wednesday, April 17, 2013 1:15 AM To: Hari Prasad Kalavakunta Cc: lttng-dev at lists.lttng.org Subject: Re: [lttng-dev] linux 3.4.3 and LTTNG patch files Hello Hari, You should look at lttng 2.x instead of lttng 0.x : http://lttng.org/download Rapha?l 2013/4/16 Hari Prasad Kalavakunta > Hello and greetings, Good morning and very quick query. Can I use LTTNG for linux kernel 3.4.3? Could you please let me know if LTTNG patch files are available for linux 3.4.3. URL: http://lttng.org/files/lttng/ appears to have patch files for linux 2.6.xx. Are there patch files available for linux 3.4.3? Sorry for this trouble :( Regards, Hari _______________________________________________ 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 raphael.beamonte at polymtl.ca Tue Apr 16 16:57:39 2013 From: raphael.beamonte at polymtl.ca (=?ISO-8859-1?Q?Rapha=EBl_Beamonte?=) Date: Tue, 16 Apr 2013 16:57:39 -0400 Subject: [lttng-dev] linux 3.4.3 and LTTNG patch files In-Reply-To: <05E83BDD0E1F054FA73F00F6970F05C6060DCB@CH1PRD0810MB394.namprd08.prod.outlook.com> References: <05E83BDD0E1F054FA73F00F6970F05C6060B7D@CH1PRD0810MB394.namprd08.prod.outlook.com> <05E83BDD0E1F054FA73F00F6970F05C6060DA6@CH1PRD0810MB394.namprd08.prod.outlook.com> <05E83BDD0E1F054FA73F00F6970F05C6060DCB@CH1PRD0810MB394.namprd08.prod.outlook.com> Message-ID: 2013/4/16 Hari Prasad Kalavakunta > I hope you meat for both User Space Tracing and Kernel Tracing !!! > lttng-modules only provides the kernel tracing. You'll have to install lttng-ust (UserSpace Tracing) for the userspace, and lttng-tools to control them both. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Daniel.Thibault at drdc-rddc.gc.ca Tue Apr 16 16:59:36 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Tue, 16 Apr 2013 20:59:36 +0000 Subject: [lttng-dev] linux 3.4.3 and LTTNG patch files Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D0E691@VAL-E-02.valcartier.drdc-rddc.gc.ca> > I have now looked at download page http://lttng.org/download > > Below section and links appears to be relevant for me. > LTTng 2.1 "Basse Messe" - Tracer toolchain > LTTng-tools 2.1.1 (Changelog) > the trace control client > LTTng-modules 2.1.1 (Changelog) the kernel modules (requires at least Linux 2.6.38) > LTTng-UST 2.1.2 (Changelog) > the userspace tracing library > > Could you please let me know if these installation can be done without patching the kernel (unlike lttng 0.x) > > Sorry again for taking your time. I am just getting started :( Absolutely: no patching required. 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 From Hari.Prasad at radisys.com Wed Apr 17 13:28:22 2013 From: Hari.Prasad at radisys.com (Hari Prasad Kalavakunta) Date: Wed, 17 Apr 2013 17:28:22 +0000 Subject: [lttng-dev] LTTNG UST configure error (lttng-ust-2.1.2) Message-ID: <05E83BDD0E1F054FA73F00F6970F05C60618B3@CH1PRD0810MB394.namprd08.prod.outlook.com> Hi lttng-dev, I am struck with the following road block. Could you please help me. While cross-compiling LTTNG UST for ppc32 I choose --disable-libtool-linkdep-fixup (https://bugs.lttng.org/issues/321) for configure to avoid dependency on libuuid as shown below. CFLAGS="-m32 -g -O2" ./configure --disable-libtool-linkdep-fixup --prefix=/home/xxx/linux-3.4.3/ --host=powerpc-linux --with-sysroot=/home/xxx/linux-3.4.3/ Yet, the dependencies are not completely removed. I am cross compiling LTTNG UST for PPC32. It did not look like I need libuuid. Could you please let me know how to overcome it. Or do I need libuuid for PPC32? I have successfully cross compiled and installed userspace-rcu for ppc32. Please let me know if I need to provide any additional details. Regards, Hari -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.marchi at polymtl.ca Wed Apr 17 13:50:52 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Wed, 17 Apr 2013 13:50:52 -0400 Subject: [lttng-dev] LTTNG UST configure error (lttng-ust-2.1.2) In-Reply-To: <05E83BDD0E1F054FA73F00F6970F05C60618B3@CH1PRD0810MB394.namprd08.prod.outlook.com> References: <05E83BDD0E1F054FA73F00F6970F05C60618B3@CH1PRD0810MB394.namprd08.prod.outlook.com> Message-ID: Hi Hari, libuuid is indeed required in order to build LTTng-UST for every platform. The usual way to install it is through a package manager (package uuid-dev on debian/ubuntu, for example). If this is not an option, you will have to build it from source. It is part of the util-linux package [1][2]. util-linux contains a lot of tools though, try to see if you can only build and install libuuid from it. Simon [1] http://git.kernel.org/cgit/utils/util-linux/util-linux.git [2] ftp://ftp.kernel.org/pub/linux/utils/util-linux/ On 17 April 2013 13:28, Hari Prasad Kalavakunta wrote: > Hi lttng-dev, > > > > I am struck with the following road block. Could you please help me. > > > > While cross-compiling LTTNG UST for ppc32 I choose > --disable-libtool-linkdep-fixup (https://bugs.lttng.org/issues/321) for > configure to avoid dependency on libuuid as shown below. > > > > CFLAGS="-m32 -g -O2" ./configure --disable-libtool-linkdep-fixup > --prefix=/home/xxx/linux-3.4.3/ --host=powerpc-linux > --with-sysroot=/home/xxx/linux-3.4.3/ > > > > Yet, the dependencies are not completely removed. I am cross compiling LTTNG > UST for PPC32. It did not look like I need libuuid. Could you please let me > know how to overcome it. Or do I need libuuid for PPC32? > > > > I have successfully cross compiled and installed userspace-rcu for ppc32. > > > > Please let me know if I need to provide any additional details. > > > > Regards, > > Hari > > > > > _______________________________________________ > 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 Apr 17 13:55:37 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Wed, 17 Apr 2013 13:55:37 -0400 Subject: [lttng-dev] LTTNG UST configure error (lttng-ust-2.1.2) In-Reply-To: <05E83BDD0E1F054FA73F00F6970F05C60618B3@CH1PRD0810MB394.namprd08.prod.outlook.com> References: <05E83BDD0E1F054FA73F00F6970F05C60618B3@CH1PRD0810MB394.namprd08.prod.outlook.com> Message-ID: <20130417175537.GA13557@Krystal> * Hari Prasad Kalavakunta (Hari.Prasad at radisys.com) wrote: > Hi lttng-dev, > > I am struck with the following road block. Could you please help me. > > While cross-compiling LTTNG UST for ppc32 I choose > --disable-libtool-linkdep-fixup (https://bugs.lttng.org/issues/321) > for configure to avoid dependency on libuuid as shown below. The option --disable-libtool-linkdep-fixup has nothing to do with libuuid. See ./configure --help for details. > > CFLAGS="-m32 -g -O2" ./configure --disable-libtool-linkdep-fixup --prefix=/home/xxx/linux-3.4.3/ --host=powerpc-linux --with-sysroot=/home/xxx/linux-3.4.3/ > > Yet, the dependencies are not completely removed. I am cross compiling > LTTNG UST for PPC32. It did not look like I need libuuid. Could you > please let me know how to overcome it. Or do I need libuuid for PPC32? For lttng-ust 2.1.x, you need libuuid. Note that for the newer lttng-ust 2.2-rc, libuuid is not needed anymore for lttng-ust. However, you seem to be building with lttng-ust 2.1.x. Thanks, Mathieu > > I have successfully cross compiled and installed userspace-rcu for ppc32. > > Please let me know if I need to provide any additional details. > > Regards, > Hari > > _______________________________________________ > 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 AMITM at il.ibm.com Thu Apr 18 02:11:07 2013 From: AMITM at il.ibm.com (Amit Margalit) Date: Thu, 18 Apr 2013 09:11:07 +0300 Subject: [lttng-dev] Limitations on subbuf_size / num_subbuf? In-Reply-To: <516C0D60.1050503@ericsson.com> References: <516C0D60.1050503@ericsson.com> Message-ID: Hi, Thank for the quick response. Here is the missing data: UST 2.6.32.12-205 (I had to make a tiny patch to make it compile) MemTotal: 24628852 kB lttng-ust-2.1.2 lttng-tools-2.1.1 lttng-modules-2.1.1 babeltrace-1.1.0 userspace-rcu-0.7.6 Which patch for 4MB? Thanks, Amit Margalit IBM XIV - Storage Reinvented XIV-NAS Development Team Tel. 03-689-7774 Fax. 03-689-7230 From: Matthew Khouzam To: Date: 04/15/2013 05:24 PM Subject: Re: [lttng-dev] Limitations on subbuf_size / num_subbuf? Not at all a n00b question, but could you give some more info? what is your version of LTTng tools, are you using UST or kernel tracing? How much ram is on your system? Kernel version? I actually have the patched lttng that has standard subbuffer sizes of 4 mb, so I have not personnaly seen that problem. But the first thing I would do is upgrade to the latest stable. On 13-04-14 06:49 AM, Amit Margalit wrote: Hello, Sorry for the noob question. I seem to be unable to define the total of subbuf_size * num_subbuf higher than 4MB. I am getting ~30% discarded tracepoint data. Any assistance would be greatly appreciated. Amit Margalit IBM XIV - Storage Reinvented XIV-NAS Development Team Tel. 03-689-7774 Fax. 03-689-7230 _______________________________________________ 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 dror at reduxio.com Thu Apr 18 11:55:05 2013 From: dror at reduxio.com (Dror Granot) Date: Thu, 18 Apr 2013 18:55:05 +0300 Subject: [lttng-dev] Help needed in getting first ust event running Message-ID: Hi, I'm trying to add a simple ust event to my project, but I keep getting segmentation violation. I would really appreciate help in understanding what am I'm doing wrong. I'm running Ubuntu 12.04LTS and got lttng from git. I've ran the lttng with verbose but couldn't see anything valuable there. I'm using dynamic linkage (but the problem occurs also in static) and is as follows: Program received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) where #0 0x0000000000000000 in ?? () #1 0x000000000041b03f in __tracepoints__ptrs_init () at /usr/local/include/lttng/tracepoint.h:349 #2 0x000000000043e95d in __libc_csu_init () #3 0x00007ffff71f1700 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6 #4 0x00000000004039e9 in _start () increasing the debug level shows: ibust[6455/6455]: LTT : ltt ring buffer client "relay-metadata-mmap" init (in lttng_ring_buffer_metadata_client_init() at lttng-ring-buffer-metadata-client.h:313) libust[6455/6455]: LTT : ltt ring buffer client "relay-overwrite-mmap" init (in lttng_ring_buffer_client_overwrite_init() at lttng-ring-buffer-client.h:562) libust[6455/6455]: LTT : ltt ring buffer client "relay-overwrite-rt-mmap" init (in lttng_ring_buffer_client_overwrite_rt_init() at lttng-ring-buffer-client.h:562) libust[6455/6455]: LTT : ltt ring buffer client "relay-discard-mmap" init (in lttng_ring_buffer_client_discard_init() at lttng-ring-buffer-client.h:562) libust[6455/6455]: LTT : ltt ring buffer client "relay-discard-rt-mmap" init (in lttng_ring_buffer_client_discard_rt_init() at lttng-ring-buffer-client.h:562) libust[6455/6457]: Info: sessiond not accepting connections to local apps socket (in ust_listener_thread() at lttng-ust-comm.c:939) libust[6455/6457]: Waiting for local apps sessiond (in wait_for_sessiond() at lttng-ust-comm.c:849) libust[6455/6456]: Message Received "Get Tracer Version", Handle "root" (0) (in print_cmd() at lttng-ust-comm.c:216) libust[6455/6456]: Return value: 0 (in handle_message() at lttng-ust-comm.c:589) libust[6455/6456]: message successfully sent (in send_reply() at lttng-ust-comm.c:331) libust[6455/6456]: Message Received "Registration Done", Handle "root" (0) (in print_cmd() at lttng-ust-comm.c:216) libust[6455/6456]: Return value: 0 (in handle_message() at lttng-ust-comm.c:589) libust[6455/6456]: message successfully sent (in send_reply() at lttng-ust-comm.c:331) libust[6455/6455]: adding probe tgtd_project containing 1 events to lazy registration list (in lttng_probe_register() at lttng-probes.c:179) [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". libust[6455/6455]: LTT : ltt ring buffer client "relay-metadata-mmap" init (in lttng_ring_buffer_metadata_client_init() at lttng-ring-buffer-metadata-client.h:313) libust[6455/6455]: LTT : ltt ring buffer client "relay-overwrite-mmap" init (in lttng_ring_buffer_client_overwrite_init() at lttng-ring-buffer-client.h:562) libust[6455/6455]: LTT : ltt ring buffer client "relay-overwrite-rt-mmap" init (in lttng_ring_buffer_client_overwrite_rt_init() at lttng-ring-buffer-client.h:562) libust[6455/6455]: LTT : ltt ring buffer client "relay-discard-mmap" init (in lttng_ring_buffer_client_discard_init() at lttng-ring-buffer-client.h:562) libust[6455/6455]: LTT : ltt ring buffer client "relay-discard-rt-mmap" init (in lttng_ring_buffer_client_discard_rt_init() at lttng-ring-buffer-client.h:562) [New Thread 0x7ffff653a700 (LWP 6458)] [New Thread 0x7ffff5d39700 (LWP 6459)] libust[6455/6459]: Info: sessiond not accepting connections to local apps socket (in ust_listener_thread() at lttng-ust-comm.c:939) libust[6455/6459]: Waiting for local apps sessiond (in wait_for_sessiond() at lttng-ust-comm.c:849) libust[6455/6458]: Message Received "Get Tracer Version", Handle "root" (0) (in print_cmd() at lttng-ust-comm.c:216) libust[6455/6458]: Return value: 0 (in handle_message() at lttng-ust-comm.c:589) libust[6455/6458]: message successfully sent (in send_reply() at lttng-ust-comm.c:331) libust[6455/6458]: Message Received "Registration Done", Handle "root" (0) (in print_cmd() at lttng-ust-comm.c:216) libust[6455/6458]: Return value: 0 (in handle_message() at lttng-ust-comm.c:589) libust[6455/6458]: message successfully sent (in send_reply() at lttng-ust-comm.c:331) libust[6455/6455]: adding probe check_project containing 1 events to lazy registration list (in lttng_probe_register() at lttng-probes.c:179) and then it fails. The segmentation violations seems to be due to the fact that the tracepoint_register_lib is not initialized, but I don't understand what I'm missing... print tracepoint_dlopen $1 = {liblttngust_handle = 0x7ffff7ff6030, tracepoint_register_lib = 0, tracepoint_unregister_lib = 0, rcu_read_lock_sym_bp = 0, rcu_read_unlock_sym_bp = 0, rcu_dereference_sym_bp = 0} Thanks Dror -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.desnoyers at efficios.com Thu Apr 18 12:29:46 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 18 Apr 2013 12:29:46 -0400 Subject: [lttng-dev] Help needed in getting first ust event running In-Reply-To: References: Message-ID: <20130418162946.GA30164@Krystal> It looks like you caught a bug in lttng-ust 2.2-rc1. I pushed the following commit that should take care of it: commit 99234da69ab197050d3d28ea428c54e08539667c Author: Mathieu Desnoyers Date: Thu Apr 18 12:21:55 2013 -0400 Fix: tracepoint.h incorrect assumption about constructor order Incorrect assumption about constructor execution order can trigger a segfault when trying to execute tracepoint_register_lib. Signed-off-by: Mathieu Desnoyers You'll need to recompile your application and your probe provider. Feedback is welcome, Thanks! Mathieu * Dror Granot (dror at reduxio.com) wrote: > Hi, > I'm trying to add a simple ust event to my project, but I keep getting > segmentation violation. I would really appreciate help in understanding > what am I'm doing wrong. I'm running Ubuntu 12.04LTS and got lttng from > git. I've ran the lttng with verbose but couldn't see anything valuable > there. I'm using dynamic linkage (but the problem occurs also in static) > and is as follows: > > Program received signal SIGSEGV, Segmentation fault. > 0x0000000000000000 in ?? () > (gdb) where > #0 0x0000000000000000 in ?? () > #1 0x000000000041b03f in __tracepoints__ptrs_init () at > /usr/local/include/lttng/tracepoint.h:349 > #2 0x000000000043e95d in __libc_csu_init () > #3 0x00007ffff71f1700 in __libc_start_main () from > /lib/x86_64-linux-gnu/libc.so.6 > #4 0x00000000004039e9 in _start () > > > increasing the debug level shows: > > ibust[6455/6455]: LTT : ltt ring buffer client "relay-metadata-mmap" init > (in lttng_ring_buffer_metadata_client_init() at > lttng-ring-buffer-metadata-client.h:313) > libust[6455/6455]: LTT : ltt ring buffer client "relay-overwrite-mmap" init > (in lttng_ring_buffer_client_overwrite_init() at > lttng-ring-buffer-client.h:562) > libust[6455/6455]: LTT : ltt ring buffer client "relay-overwrite-rt-mmap" > init > (in lttng_ring_buffer_client_overwrite_rt_init() at > lttng-ring-buffer-client.h:562) > libust[6455/6455]: LTT : ltt ring buffer client "relay-discard-mmap" init > (in lttng_ring_buffer_client_discard_init() at > lttng-ring-buffer-client.h:562) > libust[6455/6455]: LTT : ltt ring buffer client "relay-discard-rt-mmap" init > (in lttng_ring_buffer_client_discard_rt_init() at > lttng-ring-buffer-client.h:562) > libust[6455/6457]: Info: sessiond not accepting connections to local apps > socket (in ust_listener_thread() at lttng-ust-comm.c:939) > libust[6455/6457]: Waiting for local apps sessiond (in wait_for_sessiond() > at lttng-ust-comm.c:849) > libust[6455/6456]: Message Received "Get Tracer Version", Handle "root" (0) > (in print_cmd() at lttng-ust-comm.c:216) > libust[6455/6456]: Return value: 0 (in handle_message() at > lttng-ust-comm.c:589) > libust[6455/6456]: message successfully sent (in send_reply() at > lttng-ust-comm.c:331) > libust[6455/6456]: Message Received "Registration Done", Handle "root" (0) > (in print_cmd() at lttng-ust-comm.c:216) > libust[6455/6456]: Return value: 0 (in handle_message() at > lttng-ust-comm.c:589) > libust[6455/6456]: message successfully sent (in send_reply() at > lttng-ust-comm.c:331) > libust[6455/6455]: adding probe tgtd_project containing 1 events to lazy > registration list (in lttng_probe_register() at lttng-probes.c:179) > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". > libust[6455/6455]: LTT : ltt ring buffer client "relay-metadata-mmap" init > (in lttng_ring_buffer_metadata_client_init() at > lttng-ring-buffer-metadata-client.h:313) > libust[6455/6455]: LTT : ltt ring buffer client "relay-overwrite-mmap" init > (in lttng_ring_buffer_client_overwrite_init() at > lttng-ring-buffer-client.h:562) > libust[6455/6455]: LTT : ltt ring buffer client "relay-overwrite-rt-mmap" > init > (in lttng_ring_buffer_client_overwrite_rt_init() at > lttng-ring-buffer-client.h:562) > libust[6455/6455]: LTT : ltt ring buffer client "relay-discard-mmap" init > (in lttng_ring_buffer_client_discard_init() at > lttng-ring-buffer-client.h:562) > libust[6455/6455]: LTT : ltt ring buffer client "relay-discard-rt-mmap" init > (in lttng_ring_buffer_client_discard_rt_init() at > lttng-ring-buffer-client.h:562) > [New Thread 0x7ffff653a700 (LWP 6458)] > [New Thread 0x7ffff5d39700 (LWP 6459)] > libust[6455/6459]: Info: sessiond not accepting connections to local apps > socket (in ust_listener_thread() at lttng-ust-comm.c:939) > libust[6455/6459]: Waiting for local apps sessiond (in wait_for_sessiond() > at lttng-ust-comm.c:849) > libust[6455/6458]: Message Received "Get Tracer Version", Handle "root" (0) > (in print_cmd() at lttng-ust-comm.c:216) > libust[6455/6458]: Return value: 0 (in handle_message() at > lttng-ust-comm.c:589) > libust[6455/6458]: message successfully sent (in send_reply() at > lttng-ust-comm.c:331) > libust[6455/6458]: Message Received "Registration Done", Handle "root" (0) > (in print_cmd() at lttng-ust-comm.c:216) > libust[6455/6458]: Return value: 0 (in handle_message() at > lttng-ust-comm.c:589) > libust[6455/6458]: message successfully sent (in send_reply() at > lttng-ust-comm.c:331) > libust[6455/6455]: adding probe check_project containing 1 events to lazy > registration list (in lttng_probe_register() at lttng-probes.c:179) > > and then it fails. > The segmentation violations seems to be due to the fact that the > tracepoint_register_lib is not initialized, but I don't understand what I'm > missing... > > print tracepoint_dlopen > $1 = {liblttngust_handle = 0x7ffff7ff6030, tracepoint_register_lib = 0, > tracepoint_unregister_lib = 0, rcu_read_lock_sym_bp = 0, > rcu_read_unlock_sym_bp = 0, > rcu_dereference_sym_bp = 0} > > Thanks > Dror > _______________________________________________ > 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 alexmonthy at voxpopuli.im Thu Apr 18 12:51:29 2013 From: alexmonthy at voxpopuli.im (Alexandre Montplaisir) Date: Thu, 18 Apr 2013 12:51:29 -0400 Subject: [lttng-dev] Limitations on subbuf_size / num_subbuf? In-Reply-To: References: <516C0D60.1050503@ericsson.com> Message-ID: <51702491.1000007@voxpopuli.im> On 13-04-18 02:11 AM, Amit Margalit wrote: > Hi, > > Thank for the quick response. Here is the missing data: > > UST > 2.6.32.12-205 (I had to make a tiny patch to make it compile) > MemTotal: 24628852 kB > lttng-ust-2.1.2 > lttng-tools-2.1.1 > lttng-modules-2.1.1 > babeltrace-1.1.0 > userspace-rcu-0.7.6 > > Which patch for 4MB? Hi, Not sure if it's specifically this one that Matthew was talking about, but we have such a patch in the PPA packages. See: http://bazaar.launchpad.net/~lttng/lttng-tools/packaging-daily/view/head:/patches/0002-Increase-default-subbuffer-size-to-4MB.patch > > Thanks, > > Amit Margalit > IBM XIV - Storage Reinvented > XIV-NAS Development Team > Tel. 03-689-7774 > Fax. 03-689-7230 > > > > From: Matthew Khouzam > To: > Date: 04/15/2013 05:24 PM > Subject: Re: [lttng-dev] Limitations on subbuf_size / num_subbuf? > > > > Not at all a n00b question, but could you give some more info? what is > your version of LTTng tools, are you using UST or kernel tracing? How much > ram is on your system? Kernel version? > > I actually have the patched lttng that has standard subbuffer sizes of 4 > mb, so I have not personnaly seen that problem. But the first thing I > would do is upgrade to the latest stable. > > On 13-04-14 06:49 AM, Amit Margalit wrote: > Hello, > > Sorry for the noob question. I seem to be unable to define the total of > subbuf_size * num_subbuf higher than 4MB. I am getting ~30% discarded > tracepoint data. > > Any assistance would be greatly appreciated. > > Amit Margalit > IBM XIV - Storage Reinvented > XIV-NAS Development Team > Tel. 03-689-7774 > Fax. 03-689-7230 From mathieu.desnoyers at efficios.com Thu Apr 18 13:07:48 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 18 Apr 2013 13:07:48 -0400 Subject: [lttng-dev] Limitations on subbuf_size / num_subbuf? In-Reply-To: <51702491.1000007@voxpopuli.im> References: <516C0D60.1050503@ericsson.com> <51702491.1000007@voxpopuli.im> Message-ID: <20130418170748.GA32330@Krystal> * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > On 13-04-18 02:11 AM, Amit Margalit wrote: > > Hi, > > > > Thank for the quick response. Here is the missing data: > > > > UST > > 2.6.32.12-205 (I had to make a tiny patch to make it compile) > > MemTotal: 24628852 kB > > lttng-ust-2.1.2 > > lttng-tools-2.1.1 > > lttng-modules-2.1.1 > > babeltrace-1.1.0 > > userspace-rcu-0.7.6 > > > > Which patch for 4MB? > > Hi, > > Not sure if it's specifically this one that Matthew was talking about, > but we have such a patch in the PPA packages. See: > http://bazaar.launchpad.net/~lttng/lttng-tools/packaging-daily/view/head:/patches/0002-Increase-default-subbuffer-size-to-4MB.patch First, it should be noted that lttng enable-channel allow overriding the subbuffer size. It should be noted that lttng-modules 2.2 is going to output even _more_ events, so I don't think just making the buffers larger by default is the right approach. I think we need to port the "loglevel" from UST to lttng-modules ASAP, and assign a "debug" loglevel to events we don't care about by default. Thoughts ? Thanks, Mathieu > > > > > Thanks, > > > > Amit Margalit > > IBM XIV - Storage Reinvented > > XIV-NAS Development Team > > Tel. 03-689-7774 > > Fax. 03-689-7230 > > > > > > > > From: Matthew Khouzam > > To: > > Date: 04/15/2013 05:24 PM > > Subject: Re: [lttng-dev] Limitations on subbuf_size / num_subbuf? > > > > > > > > Not at all a n00b question, but could you give some more info? what is > > your version of LTTng tools, are you using UST or kernel tracing? How much > > ram is on your system? Kernel version? > > > > I actually have the patched lttng that has standard subbuffer sizes of 4 > > mb, so I have not personnaly seen that problem. But the first thing I > > would do is upgrade to the latest stable. > > > > On 13-04-14 06:49 AM, Amit Margalit wrote: > > Hello, > > > > Sorry for the noob question. I seem to be unable to define the total of > > subbuf_size * num_subbuf higher than 4MB. I am getting ~30% discarded > > tracepoint data. > > > > Any assistance would be greatly appreciated. > > > > Amit Margalit > > IBM XIV - Storage Reinvented > > XIV-NAS Development Team > > Tel. 03-689-7774 > > Fax. 03-689-7230 > > > _______________________________________________ > 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 Apr 18 13:11:20 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 18 Apr 2013 13:11:20 -0400 Subject: [lttng-dev] Limitations on subbuf_size / num_subbuf? In-Reply-To: <20130418170748.GA32330@Krystal> References: <516C0D60.1050503@ericsson.com> <51702491.1000007@voxpopuli.im> <20130418170748.GA32330@Krystal> Message-ID: <20130418171120.GA460@Krystal> * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: > * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > > On 13-04-18 02:11 AM, Amit Margalit wrote: > > > Hi, > > > > > > Thank for the quick response. Here is the missing data: > > > > > > UST > > > 2.6.32.12-205 (I had to make a tiny patch to make it compile) > > > MemTotal: 24628852 kB > > > lttng-ust-2.1.2 > > > lttng-tools-2.1.1 > > > lttng-modules-2.1.1 > > > babeltrace-1.1.0 > > > userspace-rcu-0.7.6 > > > > > > Which patch for 4MB? > > > > Hi, > > > > Not sure if it's specifically this one that Matthew was talking about, > > but we have such a patch in the PPA packages. See: > > http://bazaar.launchpad.net/~lttng/lttng-tools/packaging-daily/view/head:/patches/0002-Increase-default-subbuffer-size-to-4MB.patch > > First, it should be noted that lttng enable-channel allow overriding the > subbuffer size. > > It should be noted that lttng-modules 2.2 is going to output even _more_ > events, so I don't think just making the buffers larger by default is > the right approach. Oh, and I notice that the PPA changes the UST default to 4MB per subbuffer too. That's not going to be pretty for per-pid tracing (which is the default) on a system with 16 CPUs, tracing 100 processes with UST. 4x4MBx16x100 = 25600 MB (25GB) of buffers just for UST. Messing with defaults in packaging seems odd. Mathieu > > I think we need to port the "loglevel" from UST to lttng-modules ASAP, > and assign a "debug" loglevel to events we don't care about by default. > > Thoughts ? > > Thanks, > > Mathieu > > > > > > > > > Thanks, > > > > > > Amit Margalit > > > IBM XIV - Storage Reinvented > > > XIV-NAS Development Team > > > Tel. 03-689-7774 > > > Fax. 03-689-7230 > > > > > > > > > > > > From: Matthew Khouzam > > > To: > > > Date: 04/15/2013 05:24 PM > > > Subject: Re: [lttng-dev] Limitations on subbuf_size / num_subbuf? > > > > > > > > > > > > Not at all a n00b question, but could you give some more info? what is > > > your version of LTTng tools, are you using UST or kernel tracing? How much > > > ram is on your system? Kernel version? > > > > > > I actually have the patched lttng that has standard subbuffer sizes of 4 > > > mb, so I have not personnaly seen that problem. But the first thing I > > > would do is upgrade to the latest stable. > > > > > > On 13-04-14 06:49 AM, Amit Margalit wrote: > > > Hello, > > > > > > Sorry for the noob question. I seem to be unable to define the total of > > > subbuf_size * num_subbuf higher than 4MB. I am getting ~30% discarded > > > tracepoint data. > > > > > > Any assistance would be greatly appreciated. > > > > > > Amit Margalit > > > IBM XIV - Storage Reinvented > > > XIV-NAS Development Team > > > Tel. 03-689-7774 > > > Fax. 03-689-7230 > > > > > > _______________________________________________ > > 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 alexmonthy at voxpopuli.im Thu Apr 18 13:17:19 2013 From: alexmonthy at voxpopuli.im (Alexandre Montplaisir) Date: Thu, 18 Apr 2013 13:17:19 -0400 Subject: [lttng-dev] Limitations on subbuf_size / num_subbuf? In-Reply-To: <20130418170748.GA32330@Krystal> References: <516C0D60.1050503@ericsson.com> <51702491.1000007@voxpopuli.im> <20130418170748.GA32330@Krystal> Message-ID: <51702A9F.2010803@voxpopuli.im> On 13-04-18 01:07 PM, Mathieu Desnoyers wrote: > * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: >> On 13-04-18 02:11 AM, Amit Margalit wrote: >>> Hi, >>> >>> Thank for the quick response. Here is the missing data: >>> >>> UST >>> 2.6.32.12-205 (I had to make a tiny patch to make it compile) >>> MemTotal: 24628852 kB >>> lttng-ust-2.1.2 >>> lttng-tools-2.1.1 >>> lttng-modules-2.1.1 >>> babeltrace-1.1.0 >>> userspace-rcu-0.7.6 >>> >>> Which patch for 4MB? >> Hi, >> >> Not sure if it's specifically this one that Matthew was talking about, >> but we have such a patch in the PPA packages. See: >> http://bazaar.launchpad.net/~lttng/lttng-tools/packaging-daily/view/head:/patches/0002-Increase-default-subbuffer-size-to-4MB.patch > First, it should be noted that lttng enable-channel allow overriding the > subbuffer size. True that. But the value needs to be a power of two (which is not immediately obvious to new users). And if it's not exactly a power of two, it gets rejected, instead of simply rounding to the closest one. We have a patch for that too. ;) > It should be noted that lttng-modules 2.2 is going to output even _more_ > events, so I don't think just making the buffers larger by default is > the right approach. If it's gonna output more events, don't we want larger sizes? > > I think we need to port the "loglevel" from UST to lttng-modules ASAP, > and assign a "debug" loglevel to events we don't care about by default. This sounds like a good idea. My main concern was that most users don't read the man pages, don't fiddle with custom flags, etc. They just run enable-event -a, then start tracing. In this setup, they should not expect dropped events. Cheers, Alex > > Thoughts ? > > Thanks, > > Mathieu > >>> Thanks, >>> >>> Amit Margalit >>> IBM XIV - Storage Reinvented >>> XIV-NAS Development Team >>> Tel. 03-689-7774 >>> Fax. 03-689-7230 >>> >>> >>> >>> From: Matthew Khouzam >>> To: >>> Date: 04/15/2013 05:24 PM >>> Subject: Re: [lttng-dev] Limitations on subbuf_size / num_subbuf? >>> >>> >>> >>> Not at all a n00b question, but could you give some more info? what is >>> your version of LTTng tools, are you using UST or kernel tracing? How much >>> ram is on your system? Kernel version? >>> >>> I actually have the patched lttng that has standard subbuffer sizes of 4 >>> mb, so I have not personnaly seen that problem. But the first thing I >>> would do is upgrade to the latest stable. >>> >>> On 13-04-14 06:49 AM, Amit Margalit wrote: >>> Hello, >>> >>> Sorry for the noob question. I seem to be unable to define the total of >>> subbuf_size * num_subbuf higher than 4MB. I am getting ~30% discarded >>> tracepoint data. >>> >>> Any assistance would be greatly appreciated. >>> >>> Amit Margalit >>> IBM XIV - Storage Reinvented >>> XIV-NAS Development Team >>> Tel. 03-689-7774 >>> Fax. 03-689-7230 >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From alexmonthy at voxpopuli.im Thu Apr 18 13:18:39 2013 From: alexmonthy at voxpopuli.im (Alexandre Montplaisir) Date: Thu, 18 Apr 2013 13:18:39 -0400 Subject: [lttng-dev] Limitations on subbuf_size / num_subbuf? In-Reply-To: <20130418171120.GA460@Krystal> References: <516C0D60.1050503@ericsson.com> <51702491.1000007@voxpopuli.im> <20130418170748.GA32330@Krystal> <20130418171120.GA460@Krystal> Message-ID: <51702AEF.7010508@voxpopuli.im> On 13-04-18 01:11 PM, Mathieu Desnoyers wrote: > * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: >> * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: >>> On 13-04-18 02:11 AM, Amit Margalit wrote: >>>> Hi, >>>> >>>> Thank for the quick response. Here is the missing data: >>>> >>>> UST >>>> 2.6.32.12-205 (I had to make a tiny patch to make it compile) >>>> MemTotal: 24628852 kB >>>> lttng-ust-2.1.2 >>>> lttng-tools-2.1.1 >>>> lttng-modules-2.1.1 >>>> babeltrace-1.1.0 >>>> userspace-rcu-0.7.6 >>>> >>>> Which patch for 4MB? >>> Hi, >>> >>> Not sure if it's specifically this one that Matthew was talking about, >>> but we have such a patch in the PPA packages. See: >>> http://bazaar.launchpad.net/~lttng/lttng-tools/packaging-daily/view/head:/patches/0002-Increase-default-subbuffer-size-to-4MB.patch >> First, it should be noted that lttng enable-channel allow overriding the >> subbuffer size. >> >> It should be noted that lttng-modules 2.2 is going to output even _more_ >> events, so I don't think just making the buffers larger by default is >> the right approach. > Oh, and I notice that the PPA changes the UST default to 4MB per > subbuffer too. > > That's not going to be pretty for per-pid tracing (which is the default) > on a system with 16 CPUs, tracing 100 processes with UST. 4x4MBx16x100 = > 25600 MB (25GB) of buffers just for UST. Ok good to know, we will have to update it then. > Messing with defaults in packaging seems odd. Actually, it's a pretty common practice ;) Cheers, Alex > > Mathieu > >> I think we need to port the "loglevel" from UST to lttng-modules ASAP, >> and assign a "debug" loglevel to events we don't care about by default. >> >> Thoughts ? >> >> Thanks, >> >> Mathieu >> >>>> Thanks, >>>> >>>> Amit Margalit >>>> IBM XIV - Storage Reinvented >>>> XIV-NAS Development Team >>>> Tel. 03-689-7774 >>>> Fax. 03-689-7230 >>>> >>>> >>>> >>>> From: Matthew Khouzam >>>> To: >>>> Date: 04/15/2013 05:24 PM >>>> Subject: Re: [lttng-dev] Limitations on subbuf_size / num_subbuf? >>>> >>>> >>>> >>>> Not at all a n00b question, but could you give some more info? what is >>>> your version of LTTng tools, are you using UST or kernel tracing? How much >>>> ram is on your system? Kernel version? >>>> >>>> I actually have the patched lttng that has standard subbuffer sizes of 4 >>>> mb, so I have not personnaly seen that problem. But the first thing I >>>> would do is upgrade to the latest stable. >>>> >>>> On 13-04-14 06:49 AM, Amit Margalit wrote: >>>> Hello, >>>> >>>> Sorry for the noob question. I seem to be unable to define the total of >>>> subbuf_size * num_subbuf higher than 4MB. I am getting ~30% discarded >>>> tracepoint data. >>>> >>>> Any assistance would be greatly appreciated. >>>> >>>> Amit Margalit >>>> IBM XIV - Storage Reinvented >>>> XIV-NAS Development Team >>>> Tel. 03-689-7774 >>>> Fax. 03-689-7230 >>> >>> _______________________________________________ >>> 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 mathieu.desnoyers at efficios.com Thu Apr 18 13:23:39 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 18 Apr 2013 13:23:39 -0400 Subject: [lttng-dev] Limitations on subbuf_size / num_subbuf? In-Reply-To: <51702A9F.2010803@voxpopuli.im> References: <516C0D60.1050503@ericsson.com> <51702491.1000007@voxpopuli.im> <20130418170748.GA32330@Krystal> <51702A9F.2010803@voxpopuli.im> Message-ID: <20130418172339.GA3151@Krystal> * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > On 13-04-18 01:07 PM, Mathieu Desnoyers wrote: > > * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > >> On 13-04-18 02:11 AM, Amit Margalit wrote: > >>> Hi, > >>> > >>> Thank for the quick response. Here is the missing data: > >>> > >>> UST > >>> 2.6.32.12-205 (I had to make a tiny patch to make it compile) > >>> MemTotal: 24628852 kB > >>> lttng-ust-2.1.2 > >>> lttng-tools-2.1.1 > >>> lttng-modules-2.1.1 > >>> babeltrace-1.1.0 > >>> userspace-rcu-0.7.6 > >>> > >>> Which patch for 4MB? > >> Hi, > >> > >> Not sure if it's specifically this one that Matthew was talking about, > >> but we have such a patch in the PPA packages. See: > >> http://bazaar.launchpad.net/~lttng/lttng-tools/packaging-daily/view/head:/patches/0002-Increase-default-subbuffer-size-to-4MB.patch > > First, it should be noted that lttng enable-channel allow overriding the > > subbuffer size. > > True that. But the value needs to be a power of two (which is not > immediately obvious to new users). And if it's not exactly a power of > two, it gets rejected, instead of simply rounding to the closest one. We > have a patch for that too. ;) I've never seen it on lttng-dev. Please share it, don't be shy :) > > > It should be noted that lttng-modules 2.2 is going to output even _more_ > > events, so I don't think just making the buffers larger by default is > > the right approach. > > If it's gonna output more events, don't we want larger sizes? No, because at some point, you want the default to take into account typical HW configuration limitations. Usually, systems should not be expected to be dedicated to tracing: whatever memory the tracer reserves is less memory available for page cache and application, and therefore more impact on the system. > > > > > I think we need to port the "loglevel" from UST to lttng-modules ASAP, > > and assign a "debug" loglevel to events we don't care about by default. > > This sounds like a good idea. > > My main concern was that most users don't read the man pages, don't > fiddle with custom flags, etc. They just run enable-event -a, then start > tracing. In this setup, they should not expect dropped events. Yep. Having loglevels should take care of that: debug-level events would not be enabled unless a specific loglevel is specified. Thanks, Mathieu > > Cheers, > Alex > > > > > Thoughts ? > > > > Thanks, > > > > Mathieu > > > >>> Thanks, > >>> > >>> Amit Margalit > >>> IBM XIV - Storage Reinvented > >>> XIV-NAS Development Team > >>> Tel. 03-689-7774 > >>> Fax. 03-689-7230 > >>> > >>> > >>> > >>> From: Matthew Khouzam > >>> To: > >>> Date: 04/15/2013 05:24 PM > >>> Subject: Re: [lttng-dev] Limitations on subbuf_size / num_subbuf? > >>> > >>> > >>> > >>> Not at all a n00b question, but could you give some more info? what is > >>> your version of LTTng tools, are you using UST or kernel tracing? How much > >>> ram is on your system? Kernel version? > >>> > >>> I actually have the patched lttng that has standard subbuffer sizes of 4 > >>> mb, so I have not personnaly seen that problem. But the first thing I > >>> would do is upgrade to the latest stable. > >>> > >>> On 13-04-14 06:49 AM, Amit Margalit wrote: > >>> Hello, > >>> > >>> Sorry for the noob question. I seem to be unable to define the total of > >>> subbuf_size * num_subbuf higher than 4MB. I am getting ~30% discarded > >>> tracepoint data. > >>> > >>> Any assistance would be greatly appreciated. > >>> > >>> Amit Margalit > >>> IBM XIV - Storage Reinvented > >>> XIV-NAS Development Team > >>> Tel. 03-689-7774 > >>> Fax. 03-689-7230 > >> > >> _______________________________________________ > >> 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 Apr 18 13:24:20 2013 From: dgoulet at efficios.com (David Goulet) Date: Thu, 18 Apr 2013 13:24:20 -0400 Subject: [lttng-dev] Limitations on subbuf_size / num_subbuf? In-Reply-To: <51702AEF.7010508@voxpopuli.im> References: <516C0D60.1050503@ericsson.com> <51702491.1000007@voxpopuli.im> <20130418170748.GA32330@Krystal> <20130418171120.GA460@Krystal> <51702AEF.7010508@voxpopuli.im> Message-ID: <51702C44.8090505@efficios.com> Alexandre Montplaisir: > On 13-04-18 01:11 PM, Mathieu Desnoyers wrote: >> * Mathieu Desnoyers (mathieu.desnoyers at efficios.com) wrote: >>> * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: >>>> On 13-04-18 02:11 AM, Amit Margalit wrote: >>>>> Hi, >>>>> >>>>> Thank for the quick response. Here is the missing data: >>>>> >>>>> UST >>>>> 2.6.32.12-205 (I had to make a tiny patch to make it compile) >>>>> MemTotal: 24628852 kB >>>>> lttng-ust-2.1.2 >>>>> lttng-tools-2.1.1 >>>>> lttng-modules-2.1.1 >>>>> babeltrace-1.1.0 >>>>> userspace-rcu-0.7.6 >>>>> >>>>> Which patch for 4MB? >>>> Hi, >>>> >>>> Not sure if it's specifically this one that Matthew was talking about, >>>> but we have such a patch in the PPA packages. See: >>>> http://bazaar.launchpad.net/~lttng/lttng-tools/packaging-daily/view/head:/patches/0002-Increase-default-subbuffer-size-to-4MB.patch >>> First, it should be noted that lttng enable-channel allow overriding the >>> subbuffer size. >>> >>> It should be noted that lttng-modules 2.2 is going to output even _more_ >>> events, so I don't think just making the buffers larger by default is >>> the right approach. >> Oh, and I notice that the PPA changes the UST default to 4MB per >> subbuffer too. >> >> That's not going to be pretty for per-pid tracing (which is the default) >> on a system with 16 CPUs, tracing 100 processes with UST. 4x4MBx16x100 = >> 25600 MB (25GB) of buffers just for UST. > > Ok good to know, we will have to update it then. > >> Messing with defaults in packaging seems odd. > > Actually, it's a pretty common practice ;) Well... maybe but at least *please* inform the maintainers when you do that because when bugs are received, it is pretty important for us (at least for me) to know what are the difference(s) between the dev tree and what is actually in production. Thanks! David > > > Cheers, > Alex > >> >> Mathieu >> >>> I think we need to port the "loglevel" from UST to lttng-modules ASAP, >>> and assign a "debug" loglevel to events we don't care about by default. >>> >>> Thoughts ? >>> >>> Thanks, >>> >>> Mathieu >>> >>>>> Thanks, >>>>> >>>>> Amit Margalit >>>>> IBM XIV - Storage Reinvented >>>>> XIV-NAS Development Team >>>>> Tel. 03-689-7774 >>>>> Fax. 03-689-7230 >>>>> >>>>> >>>>> >>>>> From: Matthew Khouzam >>>>> To: >>>>> Date: 04/15/2013 05:24 PM >>>>> Subject: Re: [lttng-dev] Limitations on subbuf_size / num_subbuf? >>>>> >>>>> >>>>> >>>>> Not at all a n00b question, but could you give some more info? what is >>>>> your version of LTTng tools, are you using UST or kernel tracing? How much >>>>> ram is on your system? Kernel version? >>>>> >>>>> I actually have the patched lttng that has standard subbuffer sizes of 4 >>>>> mb, so I have not personnaly seen that problem. But the first thing I >>>>> would do is upgrade to the latest stable. >>>>> >>>>> On 13-04-14 06:49 AM, Amit Margalit wrote: >>>>> Hello, >>>>> >>>>> Sorry for the noob question. I seem to be unable to define the total of >>>>> subbuf_size * num_subbuf higher than 4MB. I am getting ~30% discarded >>>>> tracepoint data. >>>>> >>>>> Any assistance would be greatly appreciated. >>>>> >>>>> Amit Margalit >>>>> IBM XIV - Storage Reinvented >>>>> XIV-NAS Development Team >>>>> Tel. 03-689-7774 >>>>> Fax. 03-689-7230 >>>> >>>> _______________________________________________ >>>> 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 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From alexmonthy at voxpopuli.im Thu Apr 18 13:34:52 2013 From: alexmonthy at voxpopuli.im (Alexandre Montplaisir) Date: Thu, 18 Apr 2013 13:34:52 -0400 Subject: [lttng-dev] Limitations on subbuf_size / num_subbuf? In-Reply-To: <20130418172339.GA3151@Krystal> References: <516C0D60.1050503@ericsson.com> <51702491.1000007@voxpopuli.im> <20130418170748.GA32330@Krystal> <51702A9F.2010803@voxpopuli.im> <20130418172339.GA3151@Krystal> Message-ID: <51702EBC.6040801@voxpopuli.im> On 13-04-18 01:23 PM, Mathieu Desnoyers wrote: > * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: >> On 13-04-18 01:07 PM, Mathieu Desnoyers wrote: >>> * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: >>>> On 13-04-18 02:11 AM, Amit Margalit wrote: >>>>> Hi, >>>>> >>>>> Thank for the quick response. Here is the missing data: >>>>> >>>>> UST >>>>> 2.6.32.12-205 (I had to make a tiny patch to make it compile) >>>>> MemTotal: 24628852 kB >>>>> lttng-ust-2.1.2 >>>>> lttng-tools-2.1.1 >>>>> lttng-modules-2.1.1 >>>>> babeltrace-1.1.0 >>>>> userspace-rcu-0.7.6 >>>>> >>>>> Which patch for 4MB? >>>> Hi, >>>> >>>> Not sure if it's specifically this one that Matthew was talking about, >>>> but we have such a patch in the PPA packages. See: >>>> http://bazaar.launchpad.net/~lttng/lttng-tools/packaging-daily/view/head:/patches/0002-Increase-default-subbuffer-size-to-4MB.patch >>> First, it should be noted that lttng enable-channel allow overriding the >>> subbuffer size. >> True that. But the value needs to be a power of two (which is not >> immediately obvious to new users). And if it's not exactly a power of >> two, it gets rejected, instead of simply rounding to the closest one. We >> have a patch for that too. ;) > I've never seen it on lttng-dev. Please share it, don't be shy :) Granted, it wasn't on lttng-dev. But an initial version was posted on Redmine at: https://bugs.lttng.org/issues/228 > >>> It should be noted that lttng-modules 2.2 is going to output even _more_ >>> events, so I don't think just making the buffers larger by default is >>> the right approach. >> If it's gonna output more events, don't we want larger sizes? > No, because at some point, you want the default to take into account > typical HW configuration limitations. Usually, systems should not be > expected to be dedicated to tracing: whatever memory the tracer reserves > is less memory available for page cache and application, and therefore > more impact on the system. I think 4 MB isn't anywhere close to hardware limitations (at least for desktop users, which are the main audience of the Ubuntu PPA packages). Cheers, Alex >>> I think we need to port the "loglevel" from UST to lttng-modules ASAP, >>> and assign a "debug" loglevel to events we don't care about by default. >> This sounds like a good idea. >> >> My main concern was that most users don't read the man pages, don't >> fiddle with custom flags, etc. They just run enable-event -a, then start >> tracing. In this setup, they should not expect dropped events. > Yep. Having loglevels should take care of that: debug-level events would > not be enabled unless a specific loglevel is specified. > > Thanks, > > Mathieu > >> Cheers, >> Alex >> >>> Thoughts ? >>> >>> Thanks, >>> >>> Mathieu >>> >>>>> Thanks, >>>>> >>>>> Amit Margalit >>>>> IBM XIV - Storage Reinvented >>>>> XIV-NAS Development Team >>>>> Tel. 03-689-7774 >>>>> Fax. 03-689-7230 >>>>> >>>>> >>>>> >>>>> From: Matthew Khouzam >>>>> To: >>>>> Date: 04/15/2013 05:24 PM >>>>> Subject: Re: [lttng-dev] Limitations on subbuf_size / num_subbuf? >>>>> >>>>> >>>>> >>>>> Not at all a n00b question, but could you give some more info? what is >>>>> your version of LTTng tools, are you using UST or kernel tracing? How much >>>>> ram is on your system? Kernel version? >>>>> >>>>> I actually have the patched lttng that has standard subbuffer sizes of 4 >>>>> mb, so I have not personnaly seen that problem. But the first thing I >>>>> would do is upgrade to the latest stable. >>>>> >>>>> On 13-04-14 06:49 AM, Amit Margalit wrote: >>>>> Hello, >>>>> >>>>> Sorry for the noob question. I seem to be unable to define the total of >>>>> subbuf_size * num_subbuf higher than 4MB. I am getting ~30% discarded >>>>> tracepoint data. >>>>> >>>>> Any assistance would be greatly appreciated. >>>>> >>>>> Amit Margalit >>>>> IBM XIV - Storage Reinvented >>>>> XIV-NAS Development Team >>>>> Tel. 03-689-7774 >>>>> Fax. 03-689-7230 >>>> _______________________________________________ >>>> 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 Apr 18 13:43:12 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 18 Apr 2013 13:43:12 -0400 Subject: [lttng-dev] Limitations on subbuf_size / num_subbuf? In-Reply-To: <51702EBC.6040801@voxpopuli.im> References: <516C0D60.1050503@ericsson.com> <51702491.1000007@voxpopuli.im> <20130418170748.GA32330@Krystal> <51702A9F.2010803@voxpopuli.im> <20130418172339.GA3151@Krystal> <51702EBC.6040801@voxpopuli.im> Message-ID: <20130418174312.GA11520@Krystal> * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > On 13-04-18 01:23 PM, Mathieu Desnoyers wrote: > > * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > >> On 13-04-18 01:07 PM, Mathieu Desnoyers wrote: > >>> * Alexandre Montplaisir (alexmonthy at voxpopuli.im) wrote: > >>>> On 13-04-18 02:11 AM, Amit Margalit wrote: > >>>>> Hi, > >>>>> > >>>>> Thank for the quick response. Here is the missing data: > >>>>> > >>>>> UST > >>>>> 2.6.32.12-205 (I had to make a tiny patch to make it compile) > >>>>> MemTotal: 24628852 kB > >>>>> lttng-ust-2.1.2 > >>>>> lttng-tools-2.1.1 > >>>>> lttng-modules-2.1.1 > >>>>> babeltrace-1.1.0 > >>>>> userspace-rcu-0.7.6 > >>>>> > >>>>> Which patch for 4MB? > >>>> Hi, > >>>> > >>>> Not sure if it's specifically this one that Matthew was talking about, > >>>> but we have such a patch in the PPA packages. See: > >>>> http://bazaar.launchpad.net/~lttng/lttng-tools/packaging-daily/view/head:/patches/0002-Increase-default-subbuffer-size-to-4MB.patch > >>> First, it should be noted that lttng enable-channel allow overriding the > >>> subbuffer size. > >> True that. But the value needs to be a power of two (which is not > >> immediately obvious to new users). And if it's not exactly a power of > >> two, it gets rejected, instead of simply rounding to the closest one. We > >> have a patch for that too. ;) > > I've never seen it on lttng-dev. Please share it, don't be shy :) > > Granted, it wasn't on lttng-dev. But an initial version was posted on > Redmine at: > https://bugs.lttng.org/issues/228 Yep, and I thoroughly reviewed it, and no new version has been sent since then. > > > > >>> It should be noted that lttng-modules 2.2 is going to output even _more_ > >>> events, so I don't think just making the buffers larger by default is > >>> the right approach. > >> If it's gonna output more events, don't we want larger sizes? > > No, because at some point, you want the default to take into account > > typical HW configuration limitations. Usually, systems should not be > > expected to be dedicated to tracing: whatever memory the tracer reserves > > is less memory available for page cache and application, and therefore > > more impact on the system. > > I think 4 MB isn't anywhere close to hardware limitations (at least for > desktop users, which are the main audience of the Ubuntu PPA packages). 4 MB * nr cpus * nr processes traced can be closer to HW limitations, even of desktops. Thanks, Mathieu > > > Cheers, > Alex > > >>> I think we need to port the "loglevel" from UST to lttng-modules ASAP, > >>> and assign a "debug" loglevel to events we don't care about by default. > >> This sounds like a good idea. > >> > >> My main concern was that most users don't read the man pages, don't > >> fiddle with custom flags, etc. They just run enable-event -a, then start > >> tracing. In this setup, they should not expect dropped events. > > Yep. Having loglevels should take care of that: debug-level events would > > not be enabled unless a specific loglevel is specified. > > > > Thanks, > > > > Mathieu > > > >> Cheers, > >> Alex > >> > >>> Thoughts ? > >>> > >>> Thanks, > >>> > >>> Mathieu > >>> > >>>>> Thanks, > >>>>> > >>>>> Amit Margalit > >>>>> IBM XIV - Storage Reinvented > >>>>> XIV-NAS Development Team > >>>>> Tel. 03-689-7774 > >>>>> Fax. 03-689-7230 > >>>>> > >>>>> > >>>>> > >>>>> From: Matthew Khouzam > >>>>> To: > >>>>> Date: 04/15/2013 05:24 PM > >>>>> Subject: Re: [lttng-dev] Limitations on subbuf_size / num_subbuf? > >>>>> > >>>>> > >>>>> > >>>>> Not at all a n00b question, but could you give some more info? what is > >>>>> your version of LTTng tools, are you using UST or kernel tracing? How much > >>>>> ram is on your system? Kernel version? > >>>>> > >>>>> I actually have the patched lttng that has standard subbuffer sizes of 4 > >>>>> mb, so I have not personnaly seen that problem. But the first thing I > >>>>> would do is upgrade to the latest stable. > >>>>> > >>>>> On 13-04-14 06:49 AM, Amit Margalit wrote: > >>>>> Hello, > >>>>> > >>>>> Sorry for the noob question. I seem to be unable to define the total of > >>>>> subbuf_size * num_subbuf higher than 4MB. I am getting ~30% discarded > >>>>> tracepoint data. > >>>>> > >>>>> Any assistance would be greatly appreciated. > >>>>> > >>>>> Amit Margalit > >>>>> IBM XIV - Storage Reinvented > >>>>> XIV-NAS Development Team > >>>>> Tel. 03-689-7774 > >>>>> Fax. 03-689-7230 > >>>> _______________________________________________ > >>>> 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 gbastien+lttng at versatic.net Thu Apr 18 14:20:57 2013 From: gbastien+lttng at versatic.net (=?UTF-8?q?Genevi=C3=A8ve=20Bastien?=) Date: Thu, 18 Apr 2013 14:20:57 -0400 Subject: [lttng-dev] [RFC-patch] Add support of struct metadata in tracepoints Message-ID: <1366309257-17855-1-git-send-email-gbastien+lttng@versatic.net> Introduce the new macro TRACEPOINT_STRUCT to define ctf struct metadata that can be used by tracepoints using _struct as entry and tp_memcpy_struct to copy a struct field. Struct metadata can contain nested structs. This extra metadata is added to the metadata file only if events use it. Signed-off-by: Genevi?ve Bastien --- lttng-events.c | 166 ++++++++++++++++++++++++++++++++++- lttng-events.h | 44 ++++++++++ probes/lttng-events-reset.h | 15 ++++ probes/lttng-events.h | 206 ++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 421 insertions(+), 10 deletions(-) diff --git a/lttng-events.c b/lttng-events.c index 4f30904..b332c29 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -61,6 +61,7 @@ void synchronize_trace(void) struct lttng_session *lttng_session_create(void) { struct lttng_session *session; + int i; mutex_lock(&sessions_mutex); session = kzalloc(sizeof(struct lttng_session), GFP_KERNEL); @@ -70,6 +71,11 @@ struct lttng_session *lttng_session_create(void) INIT_LIST_HEAD(&session->events); uuid_le_gen(&session->uuid); list_add(&session->list, &sessions); + /* Initialize dumped metadata */ + for (i = 0; i < NR_METADATA_TYPES; i++) { + session->dumped_metadata[i].nr_metadata = 0; + session->dumped_metadata[i].next = 0; + } mutex_unlock(&sessions_mutex); return session; } @@ -78,7 +84,8 @@ void lttng_session_destroy(struct lttng_session *session) { struct lttng_channel *chan, *tmpchan; struct lttng_event *event, *tmpevent; - int ret; + struct lttng_metadata_dumped_data *dumped; + int ret, i, j; mutex_lock(&sessions_mutex); ACCESS_ONCE(session->active) = 0; @@ -96,6 +103,15 @@ void lttng_session_destroy(struct lttng_session *session) list_for_each_entry_safe(chan, tmpchan, &session->chan, list) _lttng_channel_destroy(chan); list_del(&session->list); + /* Destroy dumped metadata */ + for (i = 0; i < NR_METADATA_TYPES; i++) { + dumped = session->dumped_metadata[i].next; + for (j = 0; j < session->dumped_metadata[i].nr_metadata; j++) { + dumped = dumped->next; + kfree(dumped); + } + + } mutex_unlock(&sessions_mutex); kfree(session); } @@ -654,6 +670,13 @@ int _lttng_field_statedump(struct lttng_session *session, " { encoding = ASCII; }" : "", field->name); break; + case atype_struct: + ret = lttng_metadata_printf(session, + " struct %s_%s _%s;\n", + field->type.u.ctf_struct.provider, + field->type.u.ctf_struct.name, + field->name); + break; default: WARN_ON_ONCE(1); return -EINVAL; @@ -662,6 +685,141 @@ int _lttng_field_statedump(struct lttng_session *session, } static +int _lttng_is_type_metadata_dumped(struct lttng_session *session, + const struct lttng_metadata *metadata) +{ + /* Is the metadata dumped yet ? */ + struct lttng_metadata_dumped_data *dumped; + int is_dumped = 0, i; + + dumped = session->dumped_metadata[metadata->mtype].next; + switch (metadata->mtype) { + case mtype_struct: + for (i = 0; i < session->dumped_metadata[metadata->mtype].nr_metadata; i++) { + if (metadata->m.ctf_st.struct_desc == + dumped->dumped_ptr.struct_desc) { + is_dumped = 1; + break; + } + dumped = dumped->next; + } + break; + default: + WARN_ON_ONCE(1); + return -EINVAL; + } + return is_dumped; +} + +static int _lttng_type_metadata_mark_dumped(struct lttng_session *session, + const struct lttng_metadata *metadata) +{ + /* mark this metadata as dumped */ + struct lttng_metadata_dumped_data *dumped; + + dumped = kzalloc(sizeof(struct lttng_metadata_dumped_data), + GFP_KERNEL); + if (!dumped) + return -ENOMEM; + + switch (metadata->mtype) { + case mtype_struct: + dumped->dumped_ptr.struct_desc = metadata->m.ctf_st.struct_desc; + break; + default: + WARN_ON_ONCE(1); + return -EINVAL; + } + + dumped->next = session->dumped_metadata[metadata->mtype].next; + session->dumped_metadata[metadata->mtype].next = dumped; + session->dumped_metadata[metadata->mtype].nr_metadata++; + return 0; +} + +static +int _lttng_type_metadata_statedump(struct lttng_session *session, + const struct lttng_metadata *metadata, unsigned int nr_metadata); + +static +int _lttng_type_metadata_do_statedump(struct lttng_session *session, + const struct lttng_metadata *meta) +{ + int i, ret = 0; + + switch (meta->mtype) { + case mtype_struct: + ret = _lttng_type_metadata_statedump(session, + meta->m.ctf_st.type_metadata, + meta->m.ctf_st.nr_metadata); + if (ret) + return ret; + + ret = lttng_metadata_printf(session, + "struct %s_%s {\n", + meta->m.ctf_st.struct_desc->provider, + meta->m.ctf_st.struct_desc->name + ); + if (ret) + return ret; + + /* Print fields */ + for (i = 0; i < meta->m.ctf_st.struct_desc->nr_fields; i++) { + const struct lttng_event_field *field; + + field = &meta->m.ctf_st.struct_desc->fields[i]; + ret = _lttng_field_statedump(session, field); + if (ret) + return ret; + } + ret = lttng_metadata_printf(session, + "};\n\n"); + if (ret) + return ret; + break; + default: + WARN_ON_ONCE(1); + return -EINVAL; + } + if (ret) + return ret; + + ret = _lttng_type_metadata_mark_dumped(session, meta); + return ret; +} + +static +int _lttng_type_metadata_statedump(struct lttng_session *session, + const struct lttng_metadata *metadata, unsigned int nr_metadata) +{ + int i, ret = 0; + + for (i = 0; i < nr_metadata; i++) { + const struct lttng_metadata *meta = &metadata[i]; + + if (_lttng_is_type_metadata_dumped(session, meta)) + continue; + + ret = _lttng_type_metadata_do_statedump(session, meta); + if (ret) + return ret; + } + return ret; +} + +static +int _lttng_event_type_metadata_statedump(struct lttng_session *session, + struct lttng_event *event) +{ + int ret = 0; + const struct lttng_event_desc *desc = event->desc; + + ret = _lttng_type_metadata_statedump(session, + desc->type_metadata, desc->nr_metadata); + return ret; +} + +static int _lttng_context_metadata_statedump(struct lttng_session *session, struct lttng_ctx *ctx) { @@ -710,6 +868,11 @@ int _lttng_event_metadata_statedump(struct lttng_session *session, if (chan == session->metadata) return 0; + /* Dump the type metadata for this event */ + ret = _lttng_event_type_metadata_statedump(session, event); + if (ret) + goto end; + ret = lttng_metadata_printf(session, "event {\n" " name = %s;\n" @@ -746,7 +909,6 @@ int _lttng_event_metadata_statedump(struct lttng_session *session, ret = _lttng_fields_metadata_statedump(session, event); if (ret) goto end; - /* * LTTng space reservation can only reserve multiples of the * byte size. diff --git a/lttng-events.h b/lttng-events.h index 37a5db7..67c49f1 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -47,9 +47,16 @@ enum abstract_types { atype_array, atype_sequence, atype_string, + atype_struct, NR_ABSTRACT_TYPES, }; +/* Metadata types */ +enum metadata_types { + mtype_struct, + NR_METADATA_TYPES, +}; + /* Update the string_encodings name table in lttng-types.c along with this enum */ enum lttng_string_encodings { lttng_encode_none = 0, @@ -115,6 +122,9 @@ struct lttng_type { struct lttng_basic_type length_type; struct lttng_basic_type elem_type; } sequence; + struct { + const char *name, *provider; + } ctf_struct; } u; }; @@ -161,12 +171,45 @@ struct lttng_ctx { unsigned int allocated_fields; }; +struct lttng_struct_desc { + const char *provider, *name; + const struct lttng_event_field *fields; /* fields */ + unsigned int nr_fields; + struct module *owner; +}; + +struct lttng_metadata { + enum metadata_types mtype; + union { + struct { + const struct lttng_struct_desc *struct_desc; + const struct lttng_metadata *type_metadata; + unsigned int nr_metadata; + } ctf_st; + } m; +}; + +struct lttng_metadata_dumped_data { + union { + const struct lttng_struct_desc *struct_desc; + } dumped_ptr; + struct lttng_metadata_dumped_data *next; +}; + +struct lttng_metadata_dumped { + unsigned int nr_metadata; + struct lttng_metadata_dumped_data *next; +}; + struct lttng_event_desc { const char *name; void *probe_callback; const struct lttng_event_ctx *ctx; /* context */ const struct lttng_event_field *fields; /* event payload */ + /* type metadata added by events */ + const struct lttng_metadata *type_metadata; unsigned int nr_fields; + unsigned int nr_metadata; struct module *owner; }; @@ -277,6 +320,7 @@ struct lttng_session { struct list_head list; /* Session list */ unsigned int free_chan_id; /* Next chan ID to allocate */ uuid_le uuid; /* Trace session unique ID */ + struct lttng_metadata_dumped dumped_metadata[NR_METADATA_TYPES]; unsigned int metadata_dumped:1; }; diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h index 44e8ba5..dd60ca6 100644 --- a/probes/lttng-events-reset.h +++ b/probes/lttng-events-reset.h @@ -20,6 +20,9 @@ /* Reset macros used within TRACE_EVENT to "nothing" */ +#undef TRACE_METADATA +#define TRACE_METADATA 1 + #undef __field_full #define __field_full(_type, _item, _order, _base) @@ -35,6 +38,9 @@ #undef __string #define __string(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) + #undef tp_assign #define tp_assign(dest, src) @@ -47,6 +53,9 @@ #undef tp_strcpy #define tp_strcpy(dest, src) +#undef tp_memcpy_struct +#define tp_memcpy_struct(provider, name, dest, src) + #undef __get_str #define __get_str(field) @@ -65,6 +74,9 @@ #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) +#undef TP_FIELDS +#define TP_FIELDS(args...) + #undef TP_fast_assign #define TP_fast_assign(args...) @@ -94,3 +106,6 @@ #undef TRACE_EVENT_FLAGS #define TRACE_EVENT_FLAGS(name, value) + +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) diff --git a/probes/lttng-events.h b/probes/lttng-events.h index 8a3a886..93f4abc 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -263,9 +263,31 @@ void trace_##_name(void *__data); #define __string_from_user(_item, _src) \ __string(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + { \ + .name = #_item, \ + .type = \ + { \ + .atype = atype_struct, \ + .u.ctf_struct.provider = #_provider, \ + .u.ctf_struct.name = #_type, \ + }, \ + }, + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ +#undef TP_FIELDS +#define TP_FIELDS(args...) args /* Only one used in this phase */ + +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ + static const struct lttng_event_field \ + __struct_fields___##_provider##_##_name[] = { \ + _fields \ + }; + #undef DECLARE_EVENT_CLASS_NOARGS #define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ static const struct lttng_event_field __event_fields___##_name[] = { \ @@ -301,6 +323,74 @@ static void __event_probe__##_name(void *__data); #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* + * Stage 3.2 of the trace events. + * + * Create type metadata description + */ + +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ + +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ +static struct lttng_struct_desc __struct_desc___##_provider##_##_name = {\ + .fields = __struct_fields___##_provider##_##_name, \ + .nr_fields = ARRAY_SIZE(__struct_fields___##_provider##_##_name),\ + .provider = #_provider, \ + .name = #_name, \ + .owner = THIS_MODULE, \ + }; + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + +/* + * Stage 3.3 of the trace events. + * + * Associate metadata description to event or event template or other struct + */ + +/* Named field types must be defined in lttng-types.h */ + +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ + +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + { \ + .mtype = mtype_struct, \ + .m.ctf_st.struct_desc = &__struct_desc___##_provider##_##_type,\ + .m.ctf_st.type_metadata = __type_metadata_for__##_provider##_##_type,\ + .m.ctf_st.nr_metadata = ARRAY_SIZE(__type_metadata_for__##_provider##_##_type),\ + }, + + +#undef TP_STRUCT__entry +#define TP_STRUCT__entry(args...) args /* Only one used in this phase */ + +#undef TP_FIELDS +#define TP_FIELDS(args...) args + +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ +static const struct lttng_metadata __type_metadata_for__##_provider##_##_name[] = {\ + _fields \ +}; + + + +#undef DECLARE_EVENT_CLASS_NOARGS +#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ +static const struct lttng_metadata __type_metadata_for__##_name[] = { \ + _tstruct \ +}; + +#undef DECLARE_EVENT_CLASS +#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ + DECLARE_EVENT_CLASS_NOARGS(_name, PARAMS(_tstruct), PARAMS(_assign), \ + PARAMS(_print)) + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + + +/* * Stage 3.9 of the trace events. * * Create event descriptions. @@ -318,9 +408,11 @@ static void __event_probe__##_name(void *__data); #define DEFINE_EVENT_MAP_NOARGS(_template, _name, _map) \ static const struct lttng_event_desc __event_desc___##_map = { \ .fields = __event_fields___##_template, \ + .type_metadata = __type_metadata_for__##_template, \ .name = #_map, \ .probe_callback = (void *) TP_PROBE_CB(_template), \ .nr_fields = ARRAY_SIZE(__event_fields___##_template), \ + .nr_metadata = ARRAY_SIZE(__type_metadata_for__##_template), \ .owner = THIS_MODULE, \ }; @@ -379,9 +471,12 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { #undef TP_ID /* - * Stage 6 of the trace events. + * Stage 6.0 of the trace events. * * Create static inline function that calculates event size. + * + * First stage creates function to calculate sizes of sub-metadata + * (with no effect on the dynamic length values) */ #include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ @@ -403,6 +498,57 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(u32)); \ __event_len += sizeof(u32); \ __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ + __event_len += sizeof(_type) * (_length); \ + +#undef __string +#define __string(_item, _src) \ + __event_len += strlen(_src) + 1; + +/* + * strlen_user includes \0. If returns 0, it faulted, so we set size to + * 1 (\0 only). + */ +#undef __string_from_user +#define __string_from_user(_item, _src) \ + __event_len += max_t(size_t, lttng_strlen_user_inatomic(_src), 1); + +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + __event_len += __struct_get_size__##_provider##_##_type(_params);\ + +#undef TP_PROTO +#define TP_PROTO(args...) args + +#undef TP_STRUCT__entry +#define TP_STRUCT__entry(args...) args + +#undef TP_FIELDS +#define TP_FIELDS(args...) args + +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ +static inline size_t __struct_get_size__##_provider##_##_name(_proto) \ + { \ + size_t __event_len = 0; \ + \ + _fields \ + return __event_len; \ +} + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + +/* + * Stage 6.1 of the trace events. + * + * Create static inline function that calculates event size, this time adding + * the size to the dynamic_len array + */ + +#undef __dynamic_array_enc_ext +#define __dynamic_array_enc_ext(_type, _item, _length, _order, _base, _encoding)\ + __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(u32)); \ + __event_len += sizeof(u32); \ + __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type));\ __dynamic_len[__dynamic_len_idx] = (_length); \ __event_len += sizeof(_type) * __dynamic_len[__dynamic_len_idx]; \ __dynamic_len_idx++; @@ -420,11 +566,13 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { __event_len += __dynamic_len[__dynamic_len_idx++] = \ max_t(size_t, lttng_strlen_user_inatomic(_src), 1); -#undef TP_PROTO -#define TP_PROTO(args...) args +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + __event_len += __dynamic_len[__dynamic_len_idx++] = \ + __struct_get_size__##_provider##_##_type(_params); -#undef TP_STRUCT__entry -#define TP_STRUCT__entry(args...) args +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ @@ -470,12 +618,36 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ #undef __string_from_user #define __string_from_user(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + __event_align = max_t(size_t, __event_align, \ + __instruct_get_align__##_provider##_##_type(_params)); + #undef TP_PROTO #define TP_PROTO(args...) args +#undef TP_ARGS +#define TP_ARGS(args...) args + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args +#undef TP_FIELDS +#define TP_FIELDS(args...) args + +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ +static inline size_t __struct_get_align__##_provider##_##_name(_proto) \ +{ \ + size_t __event_align = 1; \ + _fields \ + return __event_align; \ +} \ +static inline size_t __instruct_get_align__##_provider##_##_name(_proto)\ +{ \ + return __struct_get_align__##_provider##_##_name(_args); \ +} + #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ static inline size_t __event_get_align__##_name(_proto) \ @@ -487,7 +659,6 @@ static inline size_t __event_get_align__##_name(_proto) \ #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) - /* * Stage 8 of the trace events. * @@ -517,6 +688,9 @@ static inline size_t __event_get_align__##_name(_proto) \ #define __string_from_user(_item, _src) \ __string(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) char _item; + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args @@ -528,7 +702,6 @@ struct __event_typemap__##_name { \ #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) - /* * Stage 9 of the trace events. * @@ -568,6 +741,11 @@ __end_field_##_item: #define __string_from_user(_item, _src) \ __string(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + goto __assign_##_item; \ +__end_field_##_item: + /* * Macros mapping tp_assign() to "=", tp_memcpy() to memcpy() and tp_strcpy() to * strcpy(). @@ -624,12 +802,24 @@ __assign_##dest##_2: \ #define tp_memcpy_dyn_from_user(dest, src) \ tp_memcpy_dyn_gen(event_write_from_user, dest, src) +#undef tp_memcpy_struct_gen +#define tp_memcpy_struct_gen(write_ops, provider, name, dest, src) \ +__assign_##dest: \ + lib_ring_buffer_align_ctx(&__ctx, __struct_get_align__##provider##_##name(src));\ + __chan->ops->write_ops(&__ctx, src, \ + sizeof(__typemap.dest) * __get_dynamic_array_len(dest));\ + goto __end_field_##dest; + +#undef tp_memcpy_struct +#define tp_memcpy_struct(provider, name, dest, src) \ + tp_memcpy_struct_gen(event_write, provider, name, dest, src) + /* * The string length including the final \0. */ #undef tp_copy_string_from_user #define tp_copy_string_from_user(dest, src) \ - __assign_##dest: \ +__assign_##dest: \ { \ size_t __ustrlen; \ \ -- 1.8.2.1 From Daniel.Thibault at drdc-rddc.gc.ca Thu Apr 18 15:26:20 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 18 Apr 2013 19:26:20 +0000 Subject: [lttng-dev] lttng-dev Digest, Vol 60, Issue 31 In-Reply-To: References: Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D0EEDE@VAL-E-02.valcartier.drdc-rddc.gc.ca> > Absolutely: no patching required. I decided to find out if the lttng-modules were required at all if one needs to do only user-space tracing. I installed (on an otherwise lttng-virgin system) just the userspace-rcu, lttng-ust, and lttng-tools packages. The lttng commands fail for the usual "can't find /usr/local/lib" reason, so I need to do not: $ lttng list -u but rather $ LD_PRELOAD=/usr/local/lib/liblttng-ctl.so:/usr/local/lib/liblttng-ust-ctl.so lttng list -u or $ LD_LIBRARY_PATH=/usr/local/lib lttng list -u However, once I made the lttng-ust/doc/examples/easy-ust sample, I get a segmentation fault/core dump after starting the trace. $ LD_LIBRARY_PATH=/usr/local/lib lttng create usttrace Session usttrace created. Traces will be written in /home/daniel/lttng-traces/usttrace-20130418-150106 $ LD_LIBRARY_PATH=/usr/local/lib lttng enable-event -u --all All UST events are enabled in channel channel0 $ LD_LIBRARY_PATH=/usr/local/lib lttng start Tracing started for session usttrace $ LD_LIBRARY_PATH=/usr/local/lib ./sample Segmentation fault (core dumped) Is this supposed to work or are the kernel modules required even when doing just pure user-space tracing? I did get a partial trace on disk (just the channel0_0 and metadata files, no events in them). 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 From jeremie.galarneau at efficios.com Thu Apr 18 16:15:32 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Thu, 18 Apr 2013 16:15:32 -0400 Subject: [lttng-dev] lttng-dev Digest, Vol 60, Issue 31 In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD12D0EEDE@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD12D0EEDE@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: Hi Daniel, The kernel modules are indeed not needed for userspace tracing. I'm guessing you installed from source since the lttng libs don't seem present in your path. Could tell us on which revision this is happening? Also, perhaps you could try Mathieu's recently commited fix? It may be related.[1] Regards, J?r?mie [1] http://lists.lttng.org/pipermail/lttng-dev/2013-April/020064.html On Thu, Apr 18, 2013 at 3:26 PM, Thibault, Daniel wrote: >> Absolutely: no patching required. > > I decided to find out if the lttng-modules were required at all if one needs to do only user-space tracing. > > I installed (on an otherwise lttng-virgin system) just the userspace-rcu, lttng-ust, and lttng-tools packages. The lttng commands fail for the usual "can't find /usr/local/lib" reason, so I need to do not: > > $ lttng list -u > > but rather > > $ LD_PRELOAD=/usr/local/lib/liblttng-ctl.so:/usr/local/lib/liblttng-ust-ctl.so lttng list -u > > or > > $ LD_LIBRARY_PATH=/usr/local/lib lttng list -u > > However, once I made the lttng-ust/doc/examples/easy-ust sample, I get a segmentation fault/core dump after starting the trace. > > $ LD_LIBRARY_PATH=/usr/local/lib lttng create usttrace > Session usttrace created. > Traces will be written in /home/daniel/lttng-traces/usttrace-20130418-150106 > $ LD_LIBRARY_PATH=/usr/local/lib lttng enable-event -u --all > All UST events are enabled in channel channel0 > $ LD_LIBRARY_PATH=/usr/local/lib lttng start > Tracing started for session usttrace > $ LD_LIBRARY_PATH=/usr/local/lib ./sample > Segmentation fault (core dumped) > > Is this supposed to work or are the kernel modules required even when doing just pure user-space tracing? I did get a partial trace on disk (just the channel0_0 and metadata files, no events in them). > > 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 -- J?r?mie Galarneau EfficiOS Inc. http://www.efficios.com From Daniel.Thibault at drdc-rddc.gc.ca Thu Apr 18 16:27:38 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 18 Apr 2013 20:27:38 +0000 Subject: [lttng-dev] Help needed in getting first ust event running (was Re: lttng-dev Digest, Vol 60, Issue 31) Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D0EF0F@VAL-E-02.valcartier.drdc-rddc.gc.ca> > The kernel modules are indeed not needed for userspace tracing. > > I'm guessing you installed from source since the lttng libs don't seem > present in your path. Could tell us on which revision this is > happening? > > Also, perhaps you could try Mathieu's recently commited fix? It may be related.[1] > [1] http://lists.lttng.org/pipermail/lttng-dev/2013-April/020064.html Yup, it was the same problem. I've just rebuilt using the latest userspace-ust and lttng-ust, and the user-space-only trace was generated without a hitch on a system without lttng-modules. I've checked both the static and dynamic easy-ust samples. 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 From mathieu.desnoyers at efficios.com Thu Apr 18 16:32:43 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 18 Apr 2013 16:32:43 -0400 Subject: [lttng-dev] Help needed in getting first ust event running (was Re: lttng-dev Digest, Vol 60, Issue 31) In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD12D0EF0F@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD12D0EF0F@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: <20130418203243.GA1135@Krystal> * Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote: > > The kernel modules are indeed not needed for userspace tracing. > > > > I'm guessing you installed from source since the lttng libs don't seem > > present in your path. Could tell us on which revision this is > > happening? > > > > Also, perhaps you could try Mathieu's recently commited fix? It may be related.[1] > > [1] http://lists.lttng.org/pipermail/lttng-dev/2013-April/020064.html > > Yup, it was the same problem. I've just rebuilt using the latest > userspace-ust and lttng-ust, and the user-space-only trace was > generated without a hitch on a system without lttng-modules. I've > checked both the static and dynamic easy-ust samples. did you run ldconfig on the machine without lttng-modules ? does this machine recognise libraries in /usr/local automatically (see /etc/ld.so.conf) ? lttng-modules is completely unrelated to user-space tracing. 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 Daniel.Thibault at drdc-rddc.gc.ca Thu Apr 18 16:55:42 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 18 Apr 2013 20:55:42 +0000 Subject: [lttng-dev] Help needed in getting first ust event running Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D0EF40@VAL-E-02.valcartier.drdc-rddc.gc.ca> > did you run ldconfig on the machine without lttng-modules ? Not the first time, I must admit. I had forgotten, silly me. That was why I had to use LD_LIBRARY_PATH or LD_PRELOAD. With ldconfig done, there is no need to do so. > does this machine recognise libraries in /usr/local automatically (see /etc/ld.so.conf) ? Yes, Ubuntu has /etc/ld.so.conf "include /etc/ld.so.conf.d/*.conf", and that includes libc.conf "/usr/local/lib". > lttng-modules is completely unrelated to user-space tracing. Indeed, I just wanted to prove it by trial. (It also allowed me to make sure "make uninstall" worked properly) 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 From soariez at gmail.com Fri Apr 19 01:38:31 2013 From: soariez at gmail.com (Zifei Tong) Date: Fri, 19 Apr 2013 13:38:31 +0800 Subject: [lttng-dev] GSoC 2013, "C++ probe support" project and more Message-ID: Hello all, I am interested in participating GSoC 2013 with lttng. For the "C++ probe support" project, I did some research and find out that it is easier than I thought. I managed to make it compile with clang++, here is the commit: https://github.com/5kg/lttng-ust/commit/0b54098a2cc6443662b287d4b77d2f1b61e4cfb6. While for g++, since it does not support C's designated initializer (clang++ does), further work shall be done. All remaining errors are related to this struct initializer issue (https://gist.github.com/5kg/5417850), can anyone suggest a clean hack to workaround this? Besides the C++ support project, I'd like to work on the 'strace-alike wrapper'. It takes me a fair amount of time to try the demo of lttng. A 'strace-alike wrapper' is much more simpler to me. Can this be done by a simple shell/python wrapper of lttng-tools? "Improvement of liblttng-ust-libc-wrapper's coverage of libc's functions" looks interesting to me, however I need some time to be familiar with Dyninst. Looking forward to your reply. PS: My name is Zifei Tong. I am a first-year MS student in CS form Zhejiang University in China. -- Best Regards, ??? (Zifei Tong) College of Computer Science and Technology, Zhejiang University soariez at gmail.com / tongzifei at zju.edu.cn From jan.glauber at gmail.com Fri Apr 19 06:20:28 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Fri, 19 Apr 2013 12:20:28 +0200 Subject: [lttng-dev] [RFC PATCH 0/2] babeltrace legacy LTT 2.6 converter Message-ID: Hi list, I've written a converter that can read LTT's 2.6 trace format and convert it to a CTF trace format. This was discussed before on the list: http://lists.lttng.org/pipermail/lttng-dev/2011-June/015995.html and I roughly followed the guidance given by Mathieu there. Roughly because I did not create plugins but followed the approach of babeltrace-log. How it works: - babeltrace legacy converter gets a directory containing a LTT 2.6 trace and a target directory where it will create the converted trace - it scans the metadata_N files and creates a CTF which fits the old trace data - it scans all trace files and creates CTF headers but copies the trace data - empty files which contain only headers are not copied Is there any interest in picking up this code for babeltrace (or is it just too obscure :) ? Best regards, Jan Glauber Harman Becker Automotive GmbH System Profiling & Optimizing Team Jan Glauber (2): Resurrect LTT type parser babeltrace legacy LTT 2.6 -> CTF 1.8 converter converter/babeltrace-legacy.c | 1184 ++++++++++++++++++++++++++++++++++ converter/ltt-type-parser.c | 303 +++++++++ include/babeltrace/ltt-type-parser.h | 17 + 3 files changed, 1504 insertions(+) create mode 100644 converter/babeltrace-legacy.c create mode 100644 converter/ltt-type-parser.c create mode 100644 include/babeltrace/ltt-type-parser.h -- 1.7.9.5 From jan.glauber at gmail.com Fri Apr 19 06:20:29 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Fri, 19 Apr 2013 12:20:29 +0200 Subject: [lttng-dev] [RFC PATCH 1/2] Resurrect LTT type parser In-Reply-To: References: Message-ID: <3401d96aafec4a5e2ca84879d0fe2d84599ccf6c.1366364119.git.jan.glauber@gmail.com> 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. + * + * 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 From jan.glauber at gmail.com Fri Apr 19 06:20:30 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Fri, 19 Apr 2013 12:20:30 +0200 Subject: [lttng-dev] [RFC PATCH 2/2] babeltrace legacy LTT 2.6 -> CTF 1.8 converter In-Reply-To: References: Message-ID: <1845d3d1367a0442a40ddb9e373ead879543eba4.1366364119.git.jan.glauber@gmail.com> Add a standalone converter that can read LTT 2.6 trace format and convert it to CTF 1.8. - complete conversion of LTT metadata to a custom CTF which is readable by babeltrace / Eclipse - exploit CTF streams to avoid conversion of old format event IDs - converting a 32 bit trace on a 64 bit host is possible - conversion of event file headers but direct copy of event data so conversion is reasonable fast - maintains CPU information by creating CTF headers for event data - conversion of UST trace data Signed-off-by: Jan Glauber --- converter/babeltrace-legacy.c | 1184 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1184 insertions(+) create mode 100644 converter/babeltrace-legacy.c diff --git a/converter/babeltrace-legacy.c b/converter/babeltrace-legacy.c new file mode 100644 index 0000000..e542a37 --- /dev/null +++ b/converter/babeltrace-legacy.c @@ -0,0 +1,1184 @@ +/* + * babeltrace-legacy.c + * + * BabelTrace - Convert legacy LTT 2.6 to CTF + * + * Copyright 2013 Harman Becker Automotive Systems GmbH + * Author: Jan Glauber + * + * 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 + * the Free Software Foundation; under 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. + * + * Requires the parse_format function from LTT. + */ + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "babeltrace/ltt-type-parser.h" + +#define LTT_MAGIC_NUMBER_LE 0x00D6B7ED +#define LTT_MAGIC_NUMBER_BE 0xEDB7D600 + +#define TSC_SHIFT 27 +#define TSC_MASK ((1UL << TSC_SHIFT) - 1) +#define CTF_PACKET_SIZE PAGE_SIZE +#define CTF_PACKET_MASK (CTF_PACKET_SIZE - 1) +#define CTF_METADATA_MAGIC 0x75d11d57; +#define CTF_TRACEDATA_MAGIC 0xc1fc1fc1; +#define MAX_NR_STREAMS 1000 +#define MAX_CHANNEL_NAME 50 + +/* + * The default is to assume the trace data is from a 32 bit system. This works + * regardless if the host is 32 bit or 64 bit. You need to remove the define + * only if _both_ host and target are 64 bit. Note that the conversion of + * 64 bit target to 32 bit host is not supported. + */ +#define CONVERT_FROM_32BIT + +char current_channel[MAX_CHANNEL_NAME]; + +int babeltrace_debug, babeltrace_verbose; +static char *s_inputname; +static char *s_outputname; +static int s_help; +static unsigned char s_uuid[BABELTRACE_UUID_LEN]; + +void *map; /* mapped file object, only one is accessed at once */ +size_t map_len; /* needed for munmap */ +int nr_events; +int nr_streams; +size_t written; +int ltt_size_int, ltt_size_long, ltt_size_ptr, ltt_size_size_t; + +char zero_page[4096]; + +/* + * If compiling under -m64 the struct must be packed, otherwise gcc pads up to + * the next 8 byte boundary and the struct ends on a 4 byte boundary... + */ +struct ltt_subbuffer_header { + uint64_t cycle_count_begin; /* Cycle count at subbuffer start */ + uint64_t cycle_count_end; /* Cycle count at subbuffer end */ + uint32_t magic_number; /* + * Trace magic number. + * contains endianness information. + */ + uint8_t major_version; + uint8_t minor_version; + uint8_t arch_size; /* Architecture pointer size */ + uint8_t alignment; /* LTT data alignment */ + uint64_t start_time_sec; /* NTP-corrected start time */ + uint64_t start_time_usec; + uint64_t start_freq; /* + * Frequency at trace start, + * used all along the trace. + */ + uint32_t freq_scale; /* Frequency scaling (divisor) */ + uint32_t data_size; /* Size of data in subbuffer */ + uint32_t sb_size; /* Subbuffer size (including padding) */ + uint32_t events_lost; /* + * Events lost in this subbuffer since + * the beginning of the trace. + * (may overflow) + */ + uint32_t subbuf_corrupt; /* + * Corrupted (lost) subbuffers since + * the begginig of the trace. + * (may overflow) + */ + uint8_t header_end[0]; /* End of header */ +} __attribute__ ((packed)); + +struct ltt_subbuffer_header ltt_hdr; + +/* the large ltt event header */ +struct ltt_event_header { + uint32_t packed; /* 5 bit id, 27 bit tsc */ + uint16_t event_id; + uint16_t event_size; + uint32_t packet_size; + uint64_t timestamp; +} __attribute__ ((aligned(4), packed)); + +struct ltt_event_info { + char *channel_name; + char *event_name; + uint16_t event_id; + uint8_t size_int; + uint8_t size_long; + uint8_t size_ptr; + uint8_t size_size_t; + uint8_t align; + char *format; +} __attribute__ ((packed)); + +struct lttng_metadata_header { + uint32_t magic; + uint8_t uuid[16]; + uint32_t checksum; + uint32_t content_size; + uint32_t packet_size; + uint8_t compr_scheme; + uint8_t enc_scheme; + uint8_t checksum_scheme; + uint8_t major; + uint8_t minor; +} __attribute__ ((packed)); + +struct lttng_packet_header { + uint32_t magic; + uint8_t uuid[16]; + uint32_t stream_id; +} __attribute__ ((packed)); + +struct lttng_packet_context { + uint64_t timestamp_begin; + uint64_t timestamp_end; + uint64_t content_size; + uint64_t packet_size; +#ifdef CONVERT_FROM_32BIT /* 32 bit trace is converted */ + uint32_t events_discarded; +#else + unsigned long events_discarded; +#endif + uint32_t cpu_id; +}; + +struct lttng_tracedata_header { + struct lttng_packet_header ph; + struct lttng_packet_context pc; +}; + +/* Metadata format string */ +static const char metadata_fmt[] = +"/* CTF 1.8 */\n" +"typealias integer { size = 8; align = 8; signed = false; } := uint8_t;\n" +"typealias integer { size = 16; align = 8; signed = false; } := uint16_t;\n" +"typealias integer { size = 32; align = 8; signed = false; } := uint32_t;\n" +"typealias integer { size = 64; align = 8; signed = false; } := uint64_t;\n" +"typealias integer { size = 64; align = 8; signed = false; } := unsigned long;\n" +"typealias integer { size = 5; align = 1; signed = false; } := uint5_t;\n" +"typealias integer { size = 27; align = 1; signed = false; } := uint27_t;\n" +"\n" +"trace {\n" +" major = 1;\n" +" minor = 8;\n" +" uuid = \"%s\";\n" /* UUID */ +" byte_order = %s;\n" /* be or le */ +" packet.header := struct {\n" +" uint32_t magic;\n" +" uint8_t uuid[16];\n" +" uint32_t stream_id;\n" +" };\n" +"};\n" +"\n" +"env {\n" +" hostname = \"%s\";\n" +" domain = \"kernel\";\n" /* default is kernel */ +" sysname = \"Linux\";\n" +" kernel_release = \"%s\";\n" /* uname -r */ +" kernel_version = \"%s\";\n" /* uname -v */ +" tracer_name = \"ltt\";\n" +" tracer_major = %u;\n" +" tracer_minor = %u;\n" +" tracer_patchlevel = 0;\n" +"};\n" +"\n" +"clock {\n" +" name = monotonic;\n" +" uuid = \"2f580cb3-5650-40e7-9dde-796e33b39143\";\n" +" description = \"Monotonic Clock\";\n" +" freq = %llu; /* Frequency, in Hz */\n" /* frequency from ltt */ +" /* clock value offset from Epoch is: offset * (1/freq) */\n" +" offset = %llu;\n" +"};\n" +"\n" +"typealias integer {\n" +" size = 27; align = 1; signed = false;\n" +" map = clock.monotonic.value;\n" +"} := uint27_clock_monotonic_t;\n" +"\n" +"typealias integer {\n" +" size = 32; align = 8; signed = false;\n" +" map = clock.monotonic.value;\n" +"} := uint32_clock_monotonic_t;\n" +"\n" +"typealias integer {\n" +" size = 64; align = 8; signed = false;\n" +" map = clock.monotonic.value;\n" +"} := uint64_clock_monotonic_t;\n" +"\n" +"struct packet_context {\n" +" uint64_clock_monotonic_t timestamp_begin;\n" +" uint64_clock_monotonic_t timestamp_end;\n" +" uint64_t content_size;\n" +" uint64_t packet_size;\n" +#ifdef CONVERT_FROM_32BIT /* 32 bit trace is converted */ +" uint32_t events_discarded;\n" +#else +" unsigned long events_discarded;\n" +#endif +" uint32_t cpu_id;\n" +"};\n" +"\n" +"struct event_header_ltt {\n" +" uint27_clock_monotonic_t timestamp;\n" +" enum : uint5_t { id = 0 ...28, id_size_tsc = 29, id_size = 30, id_only = 31 } id;\n" +" variant {\n" +" struct { } id;\n" +" struct {\n" +" uint16_t id;\n" +" enum : uint16_t { packet_size = 0 ... 65534, extended = 65535 } packet_size;\n" +" variant {\n" +" struct { } packet_size;\n" +" struct {\n" +" uint32_t packet_size;\n" +" } extended;\n" +" } vst;\n" +" uint64_clock_monotonic_t timestamp;\n" +" } id_size_tsc;\n" +" struct {\n" +" uint16_t id;\n" +" enum : uint16_t { packet_size = 0 ... 65534, extended = 65535 } packet_size;\n" +" variant {\n" +" struct { } packet_size;\n" +" struct {\n" +" uint32_t packet_size;\n" +" } extended;\n" +" } vs;\n" +" } id_size;\n" +" struct {\n" +" uint16_t id;\n" +" } id_only;\n" +" } v;\n" +"}%s;\n" +"\n"; + +static int _write(int fd, const void *buf, size_t len) +{ + int ret; + + ret = write(fd, buf, len); + if (ret < 0) { + perror("write"); + exit(EXIT_FAILURE); + } + if (ret != len) { + fprintf(stderr, "incomplete write\n"); + exit(EXIT_FAILURE); + } + return len; +} + +static int _zero(int fd, size_t pad_len) +{ + int len, bytes = 0; + + while (pad_len > 0) { + len = pad_len; + if (len > PAGE_SIZE) + len = PAGE_SIZE; + _write(fd, zero_page, len); + pad_len -= len; + bytes += len; + } + return bytes; +} + +int write_event_format(char *p, char trace_size, char c_size, + enum ltt_type c_type, char base, char *name) +{ + char *start = p; + int align = (trace_size > ltt_hdr.alignment) ? ltt_hdr.alignment : trace_size; + char *fix; + + /* + * Userspace header can contain alignmenent = 0. Work around since + * alignment of 0 is not allowed by CTF + */ + if (!align) + align = 1; + + /* userspace ltt can mess up the name by adding a ":", remove that */ + fix = rindex(name, ':'); + if (fix) + *fix = 0; + + /* + * Events may have additional description after the name like: + * _rw(...). Don't know how to process this with CTF so remove + * everything in brackets. + */ + fix = index(name, '('); + if (fix) + *fix = 0; + + switch (c_type) { + case LTT_TYPE_STRING: + /* string _filename; */ + p += sprintf(p, " "); + p += sprintf(p, "string _%s;\n", name); + break; + case LTT_TYPE_SIGNED_INT: + /* integer { size = 32; align = 8; signed = 1; encoding = none; base = 10; } _pid; */ + p += sprintf(p, " "); + p += sprintf(p, "integer { size = %d; ", trace_size * 8); + p += sprintf(p, "align = %d; ", align * 8); + p += sprintf(p, "signed = 1; encoding = none; "); + p += sprintf(p, "base = %d; } _%s;\n", base, name); + break; + case LTT_TYPE_UNSIGNED_INT: + /* integer { size = 64; align = 8; signed = 0; encoding = none; base = 16; } _start; */ + p += sprintf(p, " "); + p += sprintf(p, "integer { size = %d; ", trace_size * 8); + p += sprintf(p, "align = %d; ", align * 8); + p += sprintf(p, "signed = 0; encoding = none; "); + p += sprintf(p, "base = %d; } _%s;\n", base, name); + break; + default: + printf("BUG\n"); + } + return p - start; +} + +static int map_file(int fd) +{ + struct stat sbuf; + int ret; + + ret = fstat(fd, &sbuf); + if (ret < 0) { + perror("fstat"); + return ret; + } + + map_len = sbuf.st_size; + map = mmap(NULL, map_len, PROT_READ, MAP_PRIVATE, fd, 0); + if (map == MAP_FAILED) { + perror("mmap"); + return -EINVAL; + } + return 0; +} + +static void align_pos(int *pos, int align) +{ + if (!align) + return; + if (*pos & (align - 1)) + *pos += align - (*pos & (align - 1)); +} + +static int read_trace_header(struct ltt_subbuffer_header *hdr, void *addr) +{ + memcpy(hdr, addr, sizeof(struct ltt_subbuffer_header)); + printf_verbose("Start TSC: %llx Stop TSC: %llx\n", + (unsigned long long) hdr->cycle_count_begin, + (unsigned long long) hdr->cycle_count_end); + printf_verbose("Start sec: %llx Start usex: %llx\n", + (unsigned long long) hdr->start_time_sec, + (unsigned long long) hdr->start_time_usec); + printf_verbose("Start freq: %llx Freq_scale: %lx\n", + (unsigned long long) hdr->start_freq, + (unsigned long) hdr->freq_scale); + return sizeof(struct ltt_subbuffer_header); +} + +static int parse_var_event_header(struct ltt_event_header *eh, void *addr) +{ + int len = sizeof(uint32_t); + + eh->packed = *(uint32_t *) addr; + addr += sizeof(eh->packed); + eh->timestamp = eh->packed & TSC_MASK; + eh->event_id = eh->packed >> TSC_SHIFT; + + switch (eh->event_id) { + case 29: + eh->event_id = *(uint16_t *) addr; + addr += sizeof(eh->event_id); + len += sizeof(eh->event_id); + eh->event_size = *(uint16_t *) addr; + addr += sizeof(eh->event_size); + len += sizeof(eh->event_size); + if (eh->event_size == 0xffff) { + eh->packet_size = *(uint32_t *) addr; + addr += sizeof(eh->packet_size); + len += sizeof(eh->packet_size); + } + eh->timestamp = *(uint64_t *) addr; + addr += sizeof(eh->timestamp); + len += sizeof(eh->timestamp); + break; + case 30: + eh->event_id = *(uint16_t *) addr; + addr += sizeof(eh->event_id); + len += sizeof(eh->event_id); + eh->event_size = *(uint16_t *) addr; + addr += sizeof(eh->event_size); + len += sizeof(eh->event_size); + if (eh->event_size == 0xffff) { + eh->packet_size = *(uint32_t *) addr; + addr += sizeof(eh->packet_size); + len += sizeof(eh->packet_size); + } + break; + case 31: + eh->event_id = *(uint16_t *) addr; + addr += sizeof(eh->event_id); + len += sizeof(eh->event_id); + break; + } + return len; +} + +static int read_event_header(struct ltt_event_header *eh, void *addr) +{ + memset(eh, 0, sizeof(*eh)); + return parse_var_event_header(eh, addr); +} + +static int is_empty_event_header(struct ltt_event_header *eh) +{ + struct ltt_event_header zero_eh; + + memset(&zero_eh, 0, sizeof(zero_eh)); + if (memcmp(eh, &zero_eh, sizeof(*eh)) == 0) + return 1; + else + return 0; +} +static int write_tracedata_header(int fd, uint32_t csize, uint32_t psize, int cpu) +{ + struct lttng_tracedata_header th; + ENTRY e, *eptr; + + /* find stream id */ + e.key = strdup(current_channel); + eptr = hsearch(e, FIND); + if (!eptr) + fprintf(stderr, "error: channel name not found\n"); + + memset(&th, 0, sizeof(th)); + th.ph.magic = CTF_TRACEDATA_MAGIC; + memcpy(&th.ph.uuid, s_uuid, BABELTRACE_UUID_LEN); + th.ph.stream_id = (int) (unsigned long) eptr->data; + + if (csize) /* in bits... */ + th.pc.content_size = csize * 8; + else + th.pc.content_size = CTF_PACKET_SIZE * 8; + if (psize) /* in bits... */ + th.pc.packet_size = psize * 8; + else + th.pc.packet_size = CTF_PACKET_SIZE * 8; + + /* copy timestamps */ + th.pc.timestamp_begin = ltt_hdr.cycle_count_begin; + th.pc.timestamp_end = ltt_hdr.cycle_count_end; + + th.pc.events_discarded = ltt_hdr.events_lost; + th.pc.cpu_id = cpu; + + return _write(fd, &th, sizeof(th)); +} + +static void print_event_header(struct ltt_event_header *eh) +{ + printf_verbose("Event header type: %d\n", eh->packed >> TSC_SHIFT); + printf_verbose(" timestamp short: %lx\n", eh->packed & TSC_MASK); + printf_verbose(" event id: %d\n", eh->event_id); + printf_verbose(" event size: %d\n", eh->event_size); + printf_verbose(" timestamp: %llx\n", (unsigned long long) eh->timestamp); + printf_verbose("\n"); +} + +static int copy_event_data(int fd, struct ltt_subbuffer_header *lh, + void *addr, int cpu, int old_hdr_len) +{ + int new_hdr_len = sizeof(struct lttng_tracedata_header); + uint32_t psize, dsize, esize; + size_t pad_len; + off_t pos; + + /* size must be adjusted to fit the new header size */ + esize = lh->sb_size - old_hdr_len; /* includes padding, just copy it over to avoid manual padding */ + dsize = lh->data_size - old_hdr_len + new_hdr_len; + + psize = lh->sb_size - old_hdr_len + new_hdr_len; + printf_debug("new psize: %x\n", psize); + psize = (psize + CTF_PACKET_SIZE) & ~CTF_PACKET_MASK; + printf_debug("aligned psize: %x\n", psize); + + printf_debug("trace_header: packet_size: %x data_size: %x event size: %x\n", psize, dsize, esize); + write_tracedata_header(fd, dsize, psize, cpu); + + /* copy event data from the input file */ + _write(fd, addr, esize); + addr += esize; + printf_debug("copied 0x%lx data bytes\n", (unsigned long) esize); + + /* now look where we are and zero pad until packet_size */ + pos = lseek(fd, 0, SEEK_CUR); + printf_debug("events copied up to 0x%lx\n", pos); + + pad_len = CTF_PACKET_SIZE - (pos & CTF_PACKET_MASK); + printf_debug("starting next header at: 0x%lx padding size: %zu\n", pos + pad_len, pad_len); + _zero(fd, pad_len); + return esize; +} + +static int get_cpu_from_filename(const char *fname) +{ + char *start = rindex(fname, '_') + 1; + + if (!start) + fprintf(stderr, "malformed file name: %s\n", fname); + return atoi(start); +} + +static void set_current_channel_name(const char *fname) +{ + char *end = rindex(fname, '_'); + int len; + + if (!end) + fprintf(stderr, "malformed file name\n"); + len = end - fname; + + memset(current_channel, 0, MAX_CHANNEL_NAME); + strncpy(current_channel, fname, len); + printf_debug("set current name to: %s\n", current_channel); +} + +static int parse_data_file(int in_dir_fd, char *src, char *dst, char *fname) +{ + int ret, in_fd, out_fd, cpu, events = 0; + struct ltt_event_header eh; + size_t pad_len; + void *addr; + + /* skip special unrelated file */ + if (strcmp("wrsv.filelist", fname) == 0) + return 0; + + in_fd = openat(in_dir_fd, src, O_RDONLY); + if (in_fd < 0) { + perror("openat"); + return -ENOENT; + } + + ret = map_file(in_fd); + if (ret < 0) + goto out_map; + + addr = map; + cpu = get_cpu_from_filename(fname); + set_current_channel_name(fname); + + out_fd = open(dst, O_RDWR|O_CREAT, + S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); + if (out_fd < 0) { + perror("open"); + ret = out_fd; + goto out_open; + } + + while (1) { + void *old_hdr_start = addr; + + if (addr - map > map_len || addr + sizeof(ltt_hdr) - map > map_len) + break; + + addr += read_trace_header(<t_hdr, addr); + + read_event_header(&eh, addr); + if (is_empty_event_header(&eh)) + break; + print_event_header(&eh); + events++; + + addr += copy_event_data(out_fd, <t_hdr, addr, cpu, addr - old_hdr_start); + } + + /* no events in the trace file -> get rid of it */ + if (!events) { + close(out_fd); + unlink(dst); + printf("Skipping empty data file %s\n", src); + goto out_open; + } else + printf("Converting data file %s -> %s\n", src, dst); + + /* the final header */ + write_tracedata_header(out_fd, sizeof(struct lttng_tracedata_header), 0, cpu); + /* pad header page with zeros */ + pad_len = CTF_PACKET_SIZE - sizeof(struct lttng_tracedata_header); + _zero(out_fd, pad_len); + + close(out_fd); +out_open: + ret = munmap(map, map_len); + if (ret) + perror("munmap"); +out_map: + close(in_fd); + return ret; +} + +static void parse_data_files(int in_dir_fd, DIR *in_dir, DIR *out_dir) +{ + char in_path[PATH_MAX], out_path[PATH_MAX]; + struct dirent *dentry; + struct stat sbuf; + int len, ret; + + while ((dentry = readdir(in_dir)) != NULL) { + if (dentry->d_name[0] == '.') + continue; + len = strlen(dentry->d_name); + if (!len) + continue; + /* don't copy metadata files! */ + if (len >= 8 && !strncmp(dentry->d_name, "metadata", 8)) + continue; + + strcpy(in_path, s_inputname); + strcpy(in_path + strlen(in_path), "/"); + strcpy(in_path + strlen(in_path), dentry->d_name); + strcpy(out_path, s_outputname); + strcpy(out_path + strlen(out_path), "/"); + strcpy(out_path + strlen(out_path), dentry->d_name); + + ret = stat(in_path, &sbuf); + if (ret) { + perror("stat"); + continue; + } + + if (S_ISREG(sbuf.st_mode)) + parse_data_file(in_dir_fd, in_path, out_path, dentry->d_name); + } +} + +static void write_stream_metadata(DIR *in_dir, int fd) +{ + int len, dist, ret, i, streams, cpus = 0, files = 0; + struct dirent *dentry; + struct stat sbuf; + char fname[PATH_MAX]; + char buf[8 * PAGE_SIZE]; + char *p = buf; + char *pos; + + /* + * We need to declare the streams _before_ we parse the events from + * all files. nr_streams is still zero so we need another way to detect + * the number of streams... + */ + memset(fname, 0, sizeof(fname)); + sprintf(fname, "%s/metadata_0", s_inputname); + pos = rindex(fname, '_'); + + while (42) { + ret = stat(fname, &sbuf); + if (ret < 0) + break; + cpus++; + sprintf(pos + 1, "%d", cpus); + } + + /* count the number of regular input files wo. special files */ + while ((dentry = readdir(in_dir)) != NULL) { + memset(fname, 0, sizeof(fname)); + if (dentry->d_name[0] == '.') + continue; + + len = strlen(dentry->d_name); + if (strcmp(dentry->d_name, "wrsv.filelist") == 0) + continue; + + strcpy(fname, s_inputname); + strcpy(fname + strlen(fname), "/"); + strcpy(fname + strlen(fname), dentry->d_name); + + ret = stat(fname, &sbuf); + if (ret) { + perror("stat"); + continue; + } + + if (S_ISREG(sbuf.st_mode)) + files++; + } + /* reset dir stream position to beginning for subsequent use */ + rewinddir(in_dir); + + printf_debug("cpus: %d files: %d\n", cpus, files); + streams = files / cpus; + for (i = 0; i < streams; i++) { + p += sprintf(p, "stream {\n"); + p += sprintf(p, " id = %u;\n", i); + p += sprintf(p, " event.header := struct event_header_ltt;\n"); + p += sprintf(p, " packet.context := struct packet_context;\n"); + p += sprintf(p, "};\n"); + p += sprintf(p, "\n"); + } + + /* get len of event data */ + len = p - buf; + + /* now check if we cross the packet_size border */ + dist = written % CTF_PACKET_SIZE; + dist = CTF_PACKET_SIZE - dist; + if (dist >= len) { + written += _write(fd, buf, len); + return; + } + + /* not enough space until border */ + written += _write(fd, buf, dist); + + /* rest of event data */ + written += _write(fd, buf + dist, len - dist); +} + +static void write_event_metadata(struct ltt_event_info *ec, int fd) +{ + char buf[PAGE_SIZE]; /* should be enough for any event */ + char *p = buf; + ENTRY e, *eptr; + int len, dist; + + /* find stream id */ + e.key = strdup(ec->channel_name); + eptr = hsearch(e, FIND); + if (!eptr) + fprintf(stderr, "error: channel name not found\n"); + + p += sprintf(p, "event {\n"); + p += sprintf(p, " name = %s_%s;\n", ec->channel_name, ec->event_name); + p += sprintf(p, " id = %u;\n", ec->event_id); + p += sprintf(p, " stream_id = %u;\n", (int) (unsigned long) eptr->data); + p += sprintf(p, " fields := struct {\n"); + + if (ec->format) + p += parse_format(p, ec->format, ltt_hdr.arch_size, ltt_size_long, + ltt_size_size_t, write_event_format); + p += sprintf(p, " };\n"); + p += sprintf(p, "};\n"); + p += sprintf(p, "\n"); + + /* get len of event data */ + len = p - buf; + + /* now check if we cross the packet_size border */ + dist = written % CTF_PACKET_SIZE; + dist = CTF_PACKET_SIZE - dist; + if (dist >= len) { + written += _write(fd, buf, len); + return; + } + + /* not enough space until border */ + written += _write(fd, buf, dist); + + /* rest of event data */ + written += _write(fd, buf + dist, len - dist); +} + +static void *parse_events(void *addr, int out_fd) +{ + int len, pos = 0; + struct ltt_event_header eh; + struct ltt_event_info *ec; + ENTRY e, *eptr; + + printf_debug("reading ehdr from: %p\n", addr); + pos += read_event_header(&eh, addr); + + if (is_empty_event_header(&eh)) + return NULL; + print_event_header(&eh); + + ec = malloc(sizeof(*ec)); + if (!ec) { + perror("malloc"); + return NULL; + } + memset(ec, 0, sizeof(*ec)); + + /* channel name string */ + len = strlen(addr + pos); + if (!len) + return NULL; + + ec->channel_name = malloc(len + 1); + memset(ec->channel_name, 0, len + 1); + strcpy(ec->channel_name, addr + pos); + pos += len + 1; + + /* try to add to stream hash */ + e.key = strdup(ec->channel_name); + + eptr = hsearch(e, FIND); + if (!eptr) { + /* not yet cached, add it */ + e.data = (void *) (unsigned long) (nr_streams++); + eptr = hsearch(e, ENTER); + if (!eptr) + fprintf(stderr, "hash table full\n"); + printf_debug("hashing channel: %s -> stream_id: %u\n", + eptr ? e.key : NULL, eptr ? (int) (unsigned long) (e.data) : 0); + } else { + /* nothing to do */ + printf_debug("channel: %s already hashed to stream_id %u\n", e.key, (int) (unsigned long) eptr->data); + free(e.key); + } + + /* event name string */ + len = strlen(addr + pos); + if (!len) + return NULL; + + ec->event_name = malloc(len + 1); + memset(ec->event_name, 0, len + 1); + strcpy(ec->event_name, addr + pos); + pos += len + 1; + printf_debug("event: %s\n", ec->event_name); + nr_events++; + + /* event id */ + if (ltt_hdr.alignment) + align_pos(&pos, sizeof(uint16_t)); + ec->event_id = *(uint16_t *) (addr + pos); + printf_verbose("Event channel: %s name: %s id: %d\n", + ec->channel_name, ec->event_name, ec->event_id); + pos += 2; + + /* size values */ + ltt_size_int = *(uint8_t *) (addr + pos); + pos++; + ltt_size_long = *(uint8_t *) (addr + pos); + pos++; + ltt_size_ptr = *(uint8_t *) (addr + pos); + pos++; + ltt_size_size_t = *(uint8_t *) (addr + pos); + pos++; + + /* get align value */ + ec->align = *(uint8_t *) (addr + pos); + pos++; + + align_pos(&pos, ec->align); + + pos += parse_var_event_header(&eh, addr + pos); + print_event_header(&eh); + + /* skip channel string repeated */ + pos += strlen(ec->channel_name) + 1; + + /* skip event string repeated */ + pos += strlen(ec->event_name) + 1; + + /* format string, empty strings are possible! */ + len = strlen(addr + pos); + + if (len) { + ec->format = malloc(len + 1); + memset(ec->format, 0, len + 1); + strcpy(ec->format, addr + pos); + } + printf_debug("format: %s\n", ec->format); + pos += len + 1; + + align_pos(&pos, ec->align); + + /* append event description to metadata */ + write_event_metadata(ec, out_fd); + + if (len) + free(ec->format); + free(ec->event_name); + free(ec->channel_name); + free(ec); + return addr + pos; +} + +static int read_trace_header_fd(int in_dir_fd, char *name) +{ + int ret, fd; + + fd = openat(in_dir_fd, name, O_RDONLY); + if (fd < 0) { + perror("openat"); + return fd; + } + + ret = map_file(fd); + if (ret < 0) + goto out; + memcpy(<t_hdr, map, sizeof(struct ltt_subbuffer_header)); + + ret = munmap(map, map_len); + if (ret) + perror("munmap"); +out: + close(fd); + return ret; +} + +static int parse_input_metadata(int in_dir_fd, int out_fd) +{ + int ret, fd, nr = 0; + char name[12]; + void *addr; + +next: + memset(name, 0, sizeof(name)); + sprintf(name, "metadata_%d", nr); + + fd = openat(in_dir_fd, name, O_RDONLY); + if (fd < 0) + /* only an error for metadata_0 which is checked before */ + return -ENOENT; + + ret = map_file(fd); + if (ret < 0) { + close(fd); + return 0; + } + + addr = map; + addr += read_trace_header(<t_hdr, addr); + + printf("Parsing metadata from file %s\n", name); + printf_verbose("Version %d:%d\n", ltt_hdr.major_version, ltt_hdr.minor_version); + printf_verbose("Start TSC: %llx Stop TSC: %llx\n", + (unsigned long long) ltt_hdr.cycle_count_begin, + (unsigned long long) ltt_hdr.cycle_count_end); + + /* now fetch the events */ + do { + addr = parse_events(addr, out_fd); + } while (addr); + + ret = munmap(map, map_len); + if (ret) + perror("munmap"); + ret = close(fd); + if (ret) + perror("close"); + nr++; + goto next; +} + +static void print_metadata(FILE *fp) +{ + char uuid_str[BABELTRACE_UUID_STR_LEN]; + unsigned int major = 0, minor = 0; + int le, ret; + + if (ltt_hdr.magic_number == LTT_MAGIC_NUMBER_LE) + le = 1; + else if (ltt_hdr.magic_number == LTT_MAGIC_NUMBER_BE) + le = 0; + else { + fprintf(stderr, "failed to parse ltt magic number\n"); + exit(EXIT_FAILURE); + } + + ret = sscanf(VERSION, "%u.%u", &major, &minor); + if (ret != 2) + fprintf(stderr, "[warning] Incorrect babeltrace version format\n."); + babeltrace_uuid_unparse(s_uuid, uuid_str); + fprintf(fp, metadata_fmt, + uuid_str, + le ? "le" : "be", + "none", + "3.4", + "unknown", + ltt_hdr.major_version, + ltt_hdr.minor_version, + (unsigned long long) ltt_hdr.start_freq, + (unsigned long long) ltt_hdr.start_time_sec * 1000000000 + ltt_hdr.start_time_usec, + ltt_hdr.alignment ? " align(32)" : ""); +} + +static void usage(FILE *fp) +{ + fprintf(fp, "BabelTrace Legacy Converter %s\n", VERSION); + fprintf(fp, "\n"); + fprintf(fp, "Convert from LTT 2.6 to CTF 1.8 format.\n"); + fprintf(fp, "\n"); + fprintf(fp, "usage : babeltrace-legacy [OPTIONS] INPUT OUTPUT\n"); + fprintf(fp, "\n"); + fprintf(fp, " INPUT Input trace path\n"); + fprintf(fp, "\n"); + fprintf(fp, " OUTPUT Output trace path\n"); + fprintf(fp, "\n"); + fprintf(fp, " -d Debug mode\n"); + fprintf(fp, "\n"); + fprintf(fp, " -v Verbose mode\n"); + fprintf(fp, "\n"); +} + +static int parse_args(int argc, char **argv) +{ + int i; + + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i], "-h")) { + s_help = 1; + return 0; + } else if (!strcmp(argv[i], "-d")) { + babeltrace_debug = 1; + } else if (!strcmp(argv[i], "-v")) { + babeltrace_verbose = 1; + } else if (argv[i][0] == '-') { + return -EINVAL; + } else if (!s_inputname) { + s_inputname = argv[i]; + } else if (!s_outputname) { + s_outputname = argv[i]; + } + } + if (!s_inputname || !s_outputname) + return -EINVAL; + return 0; +} + +int main(int argc, char **argv) +{ + int out_metadata_fd, ret; + DIR *in_dir, *out_dir; + int in_dir_fd, out_dir_fd; + FILE *out_metadata_fp; + off_t pos; + + ret = parse_args(argc, argv); + if (ret) { + fprintf(stderr, "Error: invalid argument.\n"); + usage(stderr); + goto error; + } + + if (s_help) { + usage(stdout); + exit(EXIT_SUCCESS); + } + + babeltrace_uuid_generate(s_uuid); + + hcreate(MAX_NR_STREAMS); + + in_dir = opendir(s_inputname); + if (!in_dir) { + perror("opendir"); + goto error; + } + in_dir_fd = dirfd(in_dir); + if (in_dir_fd < 0) { + perror("dirfd"); + goto error_closedirin; + } + + ret = mkdir(s_outputname, S_IRWXU|S_IRWXG); + if (ret) { + perror("mkdir"); + goto error_mkdir; + } + + out_dir = opendir(s_outputname); + if (!out_dir) { + perror("opendir"); + goto error_rmdir; + } + out_dir_fd = dirfd(out_dir); + if (out_dir_fd < 0) { + perror("dirfd"); + goto error_closedir; + } + + out_metadata_fd = openat(out_dir_fd, "metadata", O_RDWR|O_CREAT, + S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); + if (out_metadata_fd < 0) { + perror("openat"); + goto error_closedatastream; + } + + out_metadata_fp = fdopen(out_metadata_fd, "aw"); + if (!out_metadata_fp) { + perror("fdopen"); + goto error_closemetadatafd; + } + + read_trace_header_fd(in_dir_fd, "metadata_0"); + + print_metadata(out_metadata_fp); + fflush(out_metadata_fp); + + lseek(out_metadata_fd, 0 , SEEK_SET); + pos = lseek(out_metadata_fd, 0, SEEK_END); /* make sure writing to out_metadata_fd goes to the end */ + if (pos < 0) + perror("lseek"); + /* reset written to pos otherwise we miss the metadata_fmt fprint */ + written = pos; + + write_stream_metadata(in_dir, out_metadata_fd); + parse_input_metadata(in_dir_fd, out_metadata_fd); + + /* data files */ + parse_data_files(in_dir_fd, in_dir, out_dir); + + printf("\nTotal events converted: %d\n", nr_events); + hdestroy(); + exit(EXIT_SUCCESS); + +error_closemetadatafd: + close(out_metadata_fd); +error_closedatastream: + close(out_dir_fd); +error_closedir: + closedir(out_dir); +error_rmdir: + ret = rmdir(s_outputname); + if (ret) + perror("rmdir"); +error_mkdir: + close(in_dir_fd); +error_closedirin: + closedir(in_dir); +error: + hdestroy(); + exit(EXIT_FAILURE); +} -- 1.7.9.5 From matthew.khouzam at ericsson.com Fri Apr 19 11:03:39 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Fri, 19 Apr 2013 11:03:39 -0400 Subject: [lttng-dev] [RFC PATCH 0/2] babeltrace legacy LTT 2.6 converter In-Reply-To: References: Message-ID: <51715CCB.90009@ericsson.com> Hi Jan, I have a few questions about the patch: Does it handle lost events? I think we would need to bring in a state system for this Is there a reason lttng2.0 is not working for you? kernel? install base? other? Do you want just a list of the events or analysis on the trace later on. Can you post an example of a converted trace? Thanks Matthew On 13-04-19 06:20 AM, Jan Glauber wrote: > Hi list, > > I've written a converter that can read LTT's 2.6 trace format and convert it > to a CTF trace format. This was discussed before on the list: > > http://lists.lttng.org/pipermail/lttng-dev/2011-June/015995.html > > and I roughly followed the guidance given by Mathieu there. Roughly because > I did not create plugins but followed the approach of babeltrace-log. > > How it works: > - babeltrace legacy converter gets a directory containing a LTT 2.6 trace > and a target directory where it will create the converted trace > - it scans the metadata_N files and creates a CTF which fits the old trace data > - it scans all trace files and creates CTF headers but copies the trace data > - empty files which contain only headers are not copied > > Is there any interest in picking up this code for babeltrace (or is it just > too obscure :) ? > > Best regards, > > Jan Glauber > Harman Becker Automotive GmbH > System Profiling & Optimizing Team > > Jan Glauber (2): > Resurrect LTT type parser > babeltrace legacy LTT 2.6 -> CTF 1.8 converter > > converter/babeltrace-legacy.c | 1184 ++++++++++++++++++++++++++++++++++ > converter/ltt-type-parser.c | 303 +++++++++ > include/babeltrace/ltt-type-parser.h | 17 + > 3 files changed, 1504 insertions(+) > create mode 100644 converter/babeltrace-legacy.c > create mode 100644 converter/ltt-type-parser.c > create mode 100644 include/babeltrace/ltt-type-parser.h > From Hari.Prasad at radisys.com Fri Apr 19 11:47:59 2013 From: Hari.Prasad at radisys.com (Hari Prasad Kalavakunta) Date: Fri, 19 Apr 2013 15:47:59 +0000 Subject: [lttng-dev] lttng-tools-2.1.1 for linux-3.4.3 Message-ID: <05E83BDD0E1F054FA73F00F6970F05C6062F72@CH1PRD0810MB394.namprd08.prod.outlook.com> Hello lttng-dev, When cross compiling lttng-tools-2.1.1 for PowerPC-32 bit, I am running into few issues. Could you please let me know what is wrong here. First, there was a problem using EPOLL feature. $ CFLAGS="-m32 -g -O2" ./configure --prefix=/home/xxx/linux-3.4.3/ --host=powerpc-linux $ make make[3]: Entering directory `/home/xxx/lttng2.1/lttng-tools-2.1.1/src/common/compat' CC compat-epoll.lo In file included from compat-epoll.c:31: poll.h:76: error: 'EPOLL_CLOEXEC' undeclared here (not in a function) To go past this problem, I have chosen not to use EPOLL through ax_have_epoll_cppflags flag $ export ax_have_epoll_cppflags=no $ CFLAGS="-m32 -g -O2" ./configure --prefix=/home/xxx/linux-3.4.3/ --host=powerpc-linux $ make YACC filter-parser.c /home/xxx/lttng2.1/lttng-tools-2.1.1/src/lib/lttng-ctl/filter/filter-parser.y:299.9-16: syntax error, unexpected identifier, expecting string This time parser appears have some kind of issue. Also, there are few warnings as shown below that indicates to me that configure is not done in the correct way. consumer.c: In function 'write_relayd_stream_header': consumer.c:749: warning: implicit declaration of function 'htobe64' consumer.c:750: warning: implicit declaration of function 'htobe32' Could you please let me know what could be wrong here. Your help is appreciated. Except of lttng-tools, all other components have be successfully build and installed. Regards, Hari -------------- next part -------------- An HTML attachment was scrubbed... URL: From gbastien+lttng at versatic.net Fri Apr 19 13:51:04 2013 From: gbastien+lttng at versatic.net (=?UTF-8?q?Genevi=C3=A8ve=20Bastien?=) Date: Fri, 19 Apr 2013 13:51:04 -0400 Subject: [lttng-dev] [RFC-patch] Add support of enum metadata in tracepoints Message-ID: <1366393864-10809-1-git-send-email-gbastien+lttng@versatic.net> Introduce the new macro TRACEPOINT_ENUM to globally define ctf enum metadata that can be used in tracepoints using field_enum as entry and the tp_assign assignation macro. Signed-off-by: Genevi?ve Bastien --- lttng-events.c | 61 ++++++++++++++++++++++++- lttng-events.h | 4 ++ probes/lttng-events-reset.h | 6 +++ probes/lttng-events.h | 108 +++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 176 insertions(+), 3 deletions(-) diff --git a/lttng-events.c b/lttng-events.c index b332c29..dc2b425 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -586,7 +586,8 @@ int _lttng_field_statedump(struct lttng_session *session, break; case atype_enum: ret = lttng_metadata_printf(session, - " %s _%s;\n", + " enum enum_%s_%s _%s;\n", + field->type.u.basic.enumeration.provider, field->type.u.basic.enumeration.name, field->name); break; @@ -704,6 +705,16 @@ int _lttng_is_type_metadata_dumped(struct lttng_session *session, dumped = dumped->next; } break; + case mtype_enum: + for (i = 0; i < session->dumped_metadata[metadata->mtype].nr_metadata; i++) { + if (metadata->m.ctf_enum == + dumped->dumped_ptr.ctf_enum) { + is_dumped = 1; + break; + } + dumped = dumped->next; + } + break; default: WARN_ON_ONCE(1); return -EINVAL; @@ -726,6 +737,9 @@ static int _lttng_type_metadata_mark_dumped(struct lttng_session *session, case mtype_struct: dumped->dumped_ptr.struct_desc = metadata->m.ctf_st.struct_desc; break; + case mtype_enum: + dumped->dumped_ptr.ctf_enum = metadata->m.ctf_enum; + break; default: WARN_ON_ONCE(1); return -EINVAL; @@ -777,6 +791,51 @@ int _lttng_type_metadata_do_statedump(struct lttng_session *session, if (ret) return ret; break; + case mtype_enum: + ret = lttng_metadata_printf(session, + "enum %s : integer { size = %u; align = %u; signed = %u; base = %u;%s } {\n", + meta->m.ctf_enum->name, + meta->m.ctf_enum->container_type.u.basic.integer.size, + meta->m.ctf_enum->container_type.u.basic.integer.alignment, + meta->m.ctf_enum->container_type.u.basic.integer.signedness, + meta->m.ctf_enum->container_type.u.basic.integer.base, +#ifdef __BIG_ENDIAN + meta->m.ctf_enum->container_type.u.basic.integer.reverse_byte_order ? " byte_order = le;" : "" +#else + meta->m.ctf_enum->container_type.u.basic.integer.reverse_byte_order ? " byte_order = be;" : "" +#endif + ); + if (ret) + return ret; + + /* Print enumerations */ + for (i = 0; i < meta->m.ctf_enum->len; i++) { + const struct lttng_enum_entry *entry; + + entry = &meta->m.ctf_enum->entries[i]; + if (entry->start == entry->end) { + ret = lttng_metadata_printf(session, + "%s = %d,\n", + entry->string, + entry->start + ); + } else { + ret = lttng_metadata_printf(session, + "%s = %d ... %d,\n", + entry->string, + entry->start, + entry->end + ); + } + + if (ret) + return ret; + } + ret = lttng_metadata_printf(session, + "};\n\n"); + if (ret) + return ret; + break; default: WARN_ON_ONCE(1); return -EINVAL; diff --git a/lttng-events.h b/lttng-events.h index 67c49f1..9f098be 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -54,6 +54,7 @@ enum abstract_types { /* Metadata types */ enum metadata_types { mtype_struct, + mtype_enum, NR_METADATA_TYPES, }; @@ -96,6 +97,7 @@ struct lttng_integer_type { union _lttng_basic_type { struct lttng_integer_type integer; struct { + const char *provider; const char *name; } enumeration; struct { @@ -186,12 +188,14 @@ struct lttng_metadata { const struct lttng_metadata *type_metadata; unsigned int nr_metadata; } ctf_st; + const struct lttng_enum *ctf_enum; } m; }; struct lttng_metadata_dumped_data { union { const struct lttng_struct_desc *struct_desc; + const struct lttng_enum *ctf_enum; } dumped_ptr; struct lttng_metadata_dumped_data *next; }; diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h index dd60ca6..6d533d1 100644 --- a/probes/lttng-events-reset.h +++ b/probes/lttng-events-reset.h @@ -26,6 +26,9 @@ #undef __field_full #define __field_full(_type, _item, _order, _base) +#undef __field_enum +#define __field_enum(_provider, _type, _item) + #undef __array_enc_ext #define __array_enc_ext(_type, _item, _length, _order, _base, _encoding) @@ -109,3 +112,6 @@ #undef TRACEPOINT_STRUCT #define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) + +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) diff --git a/probes/lttng-events.h b/probes/lttng-events.h index 93f4abc..c7f1bf9 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -157,6 +157,31 @@ void trace_##_name(void *__data); #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* + * Stage 1.9 of the trace events. + * + * Unfold enum entries + */ + +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ + +/* Named field types must be defined in lttng-types.h */ + +#undef TP_ENUM +#define TP_ENUM(args...) args /* Only one used in this phase */ + +#define STAGE_EXPORT_ENUMS +#include "lttng-types.h" + +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ + TRACE_EVENT_ENUM(enum_##_provider##_##_name, _enum) + +#undef STAGE_EXPORT_ENUMS + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + + +/* * Stage 2 of the trace events. * * Create event field type metadata section. @@ -275,6 +300,18 @@ void trace_##_name(void *__data); }, \ }, +#undef __field_enum +#define __field_enum(_provider, _type, _data_type, _item) \ + { \ + .name = #_item, \ + .type = \ + { \ + .atype = atype_enum, \ + .u.basic.enumeration.provider = #_provider, \ + .u.basic.enumeration.name = #_type, \ + }, \ + }, + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ @@ -340,6 +377,19 @@ static struct lttng_struct_desc __struct_desc___##_provider##_##_name = {\ .owner = THIS_MODULE, \ }; +#undef TP_TYPE +#define TP_TYPE(_type) _type + +#define STAGE_EXPORT_TYPES +#include "lttng-types.h" + +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ +static const struct lttng_enum __enum_field__##_provider##_##_name[] = {\ + TRACE_EVENT_TYPE___enum(enum_##_provider##_##_name, _type)}; + +#undef STAGE_EXPORT_TYPES + #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* @@ -361,6 +411,12 @@ static struct lttng_struct_desc __struct_desc___##_provider##_##_name = {\ .m.ctf_st.nr_metadata = ARRAY_SIZE(__type_metadata_for__##_provider##_##_type),\ }, +#undef __field_enum +#define __field_enum(_provider, _type, _data_type, _item) \ + { \ + .mtype = mtype_enum, \ + .m.ctf_enum = &__enum_field__##_provider##_##_type[0] \ + }, #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ @@ -374,8 +430,6 @@ static const struct lttng_metadata __type_metadata_for__##_provider##_##_name[] _fields \ }; - - #undef DECLARE_EVENT_CLASS_NOARGS #define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ static const struct lttng_metadata __type_metadata_for__##_name[] = { \ @@ -516,6 +570,10 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { #define __struct(_provider, _type, _item, _params) \ __event_len += __struct_get_size__##_provider##_##_type(_params);\ +#undef __field_enum +#define __field_enum(_provider, _type, _data_type, _item) \ + __event_len += __enum_get_size__##_provider##_##_type(); + #undef TP_PROTO #define TP_PROTO(args...) args @@ -525,6 +583,9 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { #undef TP_FIELDS #define TP_FIELDS(args...) args +#undef TP_TYPE +#define TP_TYPE(_type) _type + #undef TRACEPOINT_STRUCT #define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ static inline size_t __struct_get_size__##_provider##_##_name(_proto) \ @@ -535,6 +596,13 @@ static inline size_t __struct_get_size__##_provider##_##_name(_proto) \ return __event_len; \ } +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ +static inline size_t __enum_get_size__##_provider##_##_name(void) \ +{ \ + return sizeof(_type); \ +} \ + #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* @@ -574,6 +642,9 @@ static inline size_t __struct_get_size__##_provider##_##_name(_proto) \ #undef TRACEPOINT_STRUCT #define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) + #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ @@ -623,6 +694,11 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ __event_align = max_t(size_t, __event_align, \ __instruct_get_align__##_provider##_##_type(_params)); +#undef __field_enum +#define __field_enum(_provider, _type, _data_type, _item) \ + __event_align = max_t(size_t, __event_align, \ + __enum_get_align__##_provider##_##_type()); + #undef TP_PROTO #define TP_PROTO(args...) args @@ -635,6 +711,9 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ #undef TP_FIELDS #define TP_FIELDS(args...) args +#undef TP_TYPE +#define TP_TYPE(type) type + #undef TRACEPOINT_STRUCT #define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ static inline size_t __struct_get_align__##_provider##_##_name(_proto) \ @@ -648,6 +727,13 @@ static inline size_t __instruct_get_align__##_provider##_##_name(_proto)\ return __struct_get_align__##_provider##_##_name(_args); \ } +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ +static inline size_t __enum_get_align__##_provider##_##_name(void) \ +{ \ + return lttng_alignof(_type); \ +} + #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ static inline size_t __event_get_align__##_name(_proto) \ @@ -691,6 +777,10 @@ static inline size_t __event_get_align__##_name(_proto) \ #undef __struct #define __struct(_provider, _type, _item, _params) char _item; +#undef __field_enum +#define __field_enum(_provider, _type, _data_type, _item) \ + _data_type _item; + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args @@ -700,6 +790,15 @@ struct __event_typemap__##_name { \ _tstruct \ }; +#undef TP_TYPE +#define TP_TYPE(type) type + +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ +struct __enum_struct__##_provider##_##_name { \ + _type item; \ +}; + #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* @@ -746,6 +845,11 @@ __end_field_##_item: goto __assign_##_item; \ __end_field_##_item: +#undef __field_enum +#define __field_enum(_provider, _type, _data_type, _item) \ + goto __assign_##_item; \ +__end_field_##_item: + /* * Macros mapping tp_assign() to "=", tp_memcpy() to memcpy() and tp_strcpy() to * strcpy(). -- 1.8.2.1 From Hari.Prasad at radisys.com Fri Apr 19 20:34:38 2013 From: Hari.Prasad at radisys.com (Hari Prasad Kalavakunta) Date: Sat, 20 Apr 2013 00:34:38 +0000 Subject: [lttng-dev] lttng-tools-2.1.1 for linux-3.4.3 Message-ID: <05E83BDD0E1F054FA73F00F6970F05C606310B@CH1PRD0810MB394.namprd08.prod.outlook.com> Hello lttng-dev, Bison version upgrade to 2.4 took care of the earlier blocker. Undefined references to htobe64 and htobe32 are thrown. Could you please direct me if this is known one. ../../../src/common/.libs/libconsumer.a(consumer.o): In function `write_relayd_metadata_id': /root/lttng2.1/lttng-tools-2.1.1/src/common/consumer.c:1290: undefined reference to `htobe64' /root/lttng2.1/lttng-tools-2.1.1/src/common/consumer.c:1291: undefined reference to `htobe32' Regards, Hari From: Hari Prasad Kalavakunta Sent: Friday, April 19, 2013 9:18 PM To: lttng-dev at lists.lttng.org Subject: lttng-tools-2.1.1 for linux-3.4.3 Hello lttng-dev, When cross compiling lttng-tools-2.1.1 for PowerPC-32 bit, I am running into few issues. Could you please let me know what is wrong here. First, there was a problem using EPOLL feature. $ CFLAGS="-m32 -g -O2" ./configure --prefix=/home/xxx/linux-3.4.3/ --host=powerpc-linux $ make make[3]: Entering directory `/home/xxx/lttng2.1/lttng-tools-2.1.1/src/common/compat' CC compat-epoll.lo In file included from compat-epoll.c:31: poll.h:76: error: 'EPOLL_CLOEXEC' undeclared here (not in a function) To go past this problem, I have chosen not to use EPOLL through ax_have_epoll_cppflags flag $ export ax_cv_have_epoll =no $ CFLAGS="-m32 -g -O2" ./configure --prefix=/home/xxx/linux-3.4.3/ --host=powerpc-linux $ make YACC filter-parser.c /home/xxx/lttng2.1/lttng-tools-2.1.1/src/lib/lttng-ctl/filter/filter-parser.y:299.9-16: syntax error, unexpected identifier, expecting string This time parser appears have some kind of issue. Also, there are few warnings as shown below that indicates to me that configure is not done in the correct way. consumer.c: In function 'write_relayd_stream_header': consumer.c:749: warning: implicit declaration of function 'htobe64' consumer.c:750: warning: implicit declaration of function 'htobe32' Could you please let me know what could be wrong here. Your help is appreciated. Except of lttng-tools, all other components have be successfully build and installed. Regards, Hari -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierre-luc.st-charles at polymtl.ca Fri Apr 19 21:33:02 2013 From: pierre-luc.st-charles at polymtl.ca (Pierre-Luc St-Charles) Date: Fri, 19 Apr 2013 21:33:02 -0400 Subject: [lttng-dev] lttng-tools-2.1.1 for linux-3.4.3 In-Reply-To: <05E83BDD0E1F054FA73F00F6970F05C606310B@CH1PRD0810MB394.namprd08.prod.outlook.com> References: <05E83BDD0E1F054FA73F00F6970F05C606310B@CH1PRD0810MB394.namprd08.prod.outlook.com> Message-ID: Forgot to forward to mailing list again; Hey Hari, While working on porting LTTng to Android, we did fall on similar problems regarding undefined low level kernel functions; these all seemed to be very platform-specific, and in this case you'll most likely find the calls you need in your platform's include/endian.h or include/sys/endian.h header files (most likely under slightly different names). On our end, we ended up 'patching' these problems by adding config verifications for the missing functions, and when those failed we simply redefined them in-code via #define macros using whatever was defined in the platform headers. In any case, we'll be sending our patches in for review soon, but for now, I hope this leads you somwhere. -PL On Fri, Apr 19, 2013 at 8:34 PM, Hari Prasad Kalavakunta < Hari.Prasad at radisys.com> wrote: > Hello lttng-dev,**** > > ** ** > > Bison version upgrade to 2.4 took care of the earlier blocker. **** > > ** ** > > Undefined references to htobe64 and htobe32 are thrown. Could you please > direct me if this is known one.**** > > ** ** > > ../../../src/common/.libs/libconsumer.a(consumer.o): In function > `write_relayd_metadata_id':**** > > /root/lttng2.1/lttng-tools-2.1.1/src/common/consumer.c:1290: undefined > reference to `htobe64'**** > > /root/lttng2.1/lttng-tools-2.1.1/src/common/consumer.c:1291: undefined > reference to `htobe32'**** > > ** ** > > Regards,**** > > Hari**** > > ** ** > > *From:* Hari Prasad Kalavakunta > *Sent:* Friday, April 19, 2013 9:18 PM > *To:* lttng-dev at lists.lttng.org > *Subject:* lttng-tools-2.1.1 for linux-3.4.3**** > > ** ** > > Hello lttng-dev,**** > > ** ** > > When cross compiling lttng-tools-2.1.1 for PowerPC-32 bit, I am running > into few issues. Could you please let me know what is wrong here.**** > > ** ** > > First, there was a problem using EPOLL feature.**** > > ** ** > > $ CFLAGS="-m32 -g -O2" ./configure --prefix=/home/xxx/linux-3.4.3/ > --host=powerpc-linux**** > > $ make**** > > ** ** > > make[3]: Entering directory > `/home/xxx/lttng2.1/lttng-tools-2.1.1/src/common/compat'**** > > CC compat-epoll.lo**** > > In file included from compat-epoll.c:31:**** > > poll.h:76: error: 'EPOLL_CLOEXEC' undeclared here (not in a function)**** > > ** ** > > ** ** > > To go past this problem, I have chosen not to use EPOLL through > ax_have_epoll_cppflags flag**** > > ** ** > > $ export ax_cv_have_epoll =no**** > > $ CFLAGS="-m32 -g -O2" ./configure --prefix=/home/xxx/linux-3.4.3/ > --host=powerpc-linux**** > > $ make**** > > ** ** > > YACC filter-parser.c**** > > /home/xxx/lttng2.1/lttng-tools-2.1.1/src/lib/lttng-ctl/filter/filter-parser.y:299.9-16: > syntax error, unexpected identifier, expecting string**** > > ** ** > > ** ** > > This time parser appears have some kind of issue. Also, there are few > warnings as shown below that indicates to me that configure is not done in > the correct way.**** > > consumer.c: In function 'write_relayd_stream_header':**** > > consumer.c:749: warning: implicit declaration of function 'htobe64'**** > > consumer.c:750: warning: implicit declaration of function 'htobe32'**** > > ** ** > > Could you please let me know what could be wrong here. Your help is > appreciated. Except of lttng-tools, all other components have be > successfully build and installed.**** > > ** ** > > Regards,**** > > Hari**** > > _______________________________________________ > 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 soariez at gmail.com Sat Apr 20 08:29:17 2013 From: soariez at gmail.com (Zifei Tong) Date: Sat, 20 Apr 2013 20:29:17 +0800 Subject: [lttng-dev] GSoC 2013, "C++ probe support" project and more In-Reply-To: References: Message-ID: On Fri, Apr 19, 2013 at 1:38 PM, Zifei Tong wrote: > While for g++, since it does not support C's designated initializer > (clang++ does), further work shall be done. All remaining errors are > related to this struct initializer issue > (https://gist.github.com/5kg/5417850), can anyone suggest a clean hack > to workaround this? I did some research on designated initializer today, and finally made g++ compile 'hello.cxx' example. G++ do support designated initializer, however only 'trivial designated initializers' are supported, otherwise it will complain: 'sorry, unimplemented: non-trivial designated initializers not supported'. After some trial-and-error, it seems that 'trivial designated initializers' means no out-of-order initialization and 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}. So I reordered some initializers, add some fields, and change nested initializations in the above odd form to make g++ happy. I've uploaded a patch to: http://bugs.lttng.org/issues/338 Could you please review it? Thanks. -- Best Regards, ??? (Zifei Tong) College of Computer Science and Technology, Zhejiang University soariez at gmail.com / tongzifei at zju.edu.cn From christian.babeux at efficios.com Sat Apr 20 14:44:12 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Sat, 20 Apr 2013 14:44:12 -0400 Subject: [lttng-dev] GSoC 2013, "C++ probe support" project and more In-Reply-To: References: Message-ID: Hi Zifei, > Besides the C++ support project, I'd like to work on the 'strace-alike > wrapper'. It takes me a fair amount of time to try the demo of lttng. > A 'strace-alike wrapper' is much more simpler to me. Can this be done > by a simple shell/python wrapper of lttng-tools? I do think so. Maybe David can chime-in here? > "Improvement of liblttng-ust-libc-wrapper's coverage of libc's > functions" looks interesting to me, however I need some time to be > familiar with Dyninst. The improvement of liblttng-ust-libc has nothing to do with dyninst. Maybe you meant the dynamic instrumentation project? > I've uploaded a patch to: http://bugs.lttng.org/issues/338 Could you post your patch to this mailing list following these guidelines: - Indicate in the patch subject on which project the patch is to be applied. In your particular case, the patches need to be applied on the lttng-ust tree. You can accomplish this with the '--subject-prefix' option when using the git format-patch command: git format-patch -s -1 --subject-prefix="PATCH lttng-ust" - Add your signoff in the patch. Use the '-s' option when using git format-patch. - Send the patch to the maintainer of the project and CC the list. In your case, Mathieu Desnoyers (mathieu dot desnoyers at efficios dot com) is the maintainer of lttng-ust. You can accomplish this with the following git send-email command: git send-email --to maintainer_email --cc list_email *.patch I have a few minor comments on your patch, I will wait for the patch to be posted on the mailing list so I can comment inline. Thanks! Christian On Sat, Apr 20, 2013 at 8:29 AM, Zifei Tong wrote: > > On Fri, Apr 19, 2013 at 1:38 PM, Zifei Tong wrote: > > While for g++, since it does not support C's designated initializer > > (clang++ does), further work shall be done. All remaining errors are > > related to this struct initializer issue > > (https://gist.github.com/5kg/5417850), can anyone suggest a clean hack > > to workaround this? > > I did some research on designated initializer today, and finally made > g++ compile 'hello.cxx' example. > > G++ do support designated initializer, however only 'trivial > designated initializers' are supported, otherwise it will complain: > 'sorry, unimplemented: non-trivial designated initializers not > supported'. > > After some trial-and-error, it seems that 'trivial designated > initializers' means no out-of-order initialization and 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}. > > So I reordered some initializers, add some fields, and change nested > initializations in the above odd form to make g++ happy. > > I've uploaded a patch to: http://bugs.lttng.org/issues/338 > > Could you please review it? > > Thanks. > -- > Best Regards, > ??? (Zifei Tong) > College of Computer Science and Technology, Zhejiang University > > soariez at gmail.com / tongzifei at zju.edu.cn > > _______________________________________________ > 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 Sat Apr 20 14:50:19 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Sat, 20 Apr 2013 14:50:19 -0400 Subject: [lttng-dev] Processor support for user space tracer (ppc64) In-Reply-To: <20130416151047.GA22323@Krystal> References: <05E83BDD0E1F054FA73F00F6970F05C60608EA@CH1PRD0810MB394.namprd08.prod.outlook.com> <20130416151047.GA22323@Krystal> Message-ID: Website has been updated. Basically, lttng-ust should be compatible with all the architectures supported by userspace-rcu, right? On Tue, Apr 16, 2013 at 11:10 AM, Mathieu Desnoyers wrote: > Yes, ppc64 should work fine with lttng-ust. This list is not up to date. > > CCing Christian so he can update it. > > * Hari Prasad Kalavakunta (Hari.Prasad at radisys.com) wrote: >> Hello lttng-dev, >> >> Good morning and very short question. >> >> Is user space tracer not supported yet for ppc64? >> >> URL http://lttng.org/comparison-systemtap-and-dtrace lists only x86 for User Space tracing. Could you please confirm the same. >> >> processor support >> >> Kernel tracer: x86-32, x86-64, SPARC, SPARC64, ppc, ppc64, sh, sh64, ia64, s390, MIPS 32/64, ARM, (arch-agnostic core) >> Userspace tracer: x86-32, x86-64 >> >> >> Regards, >> Hari > >> _______________________________________________ >> 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 Apr 20 14:53:45 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Sat, 20 Apr 2013 14:53:45 -0400 Subject: [lttng-dev] Processor support for user space tracer (ppc64) In-Reply-To: References: <05E83BDD0E1F054FA73F00F6970F05C60608EA@CH1PRD0810MB394.namprd08.prod.outlook.com> <20130416151047.GA22323@Krystal> Message-ID: <20130420185345.GA32236@Krystal> * Christian Babeux (christian.babeux at efficios.com) wrote: > Website has been updated. Basically, lttng-ust should be compatible > with all the architectures supported by userspace-rcu, right? Yes. However, we should probably make a dinstinction between architectures that should "theoretically work" and the ones we have direct access to for testing. > > On Tue, Apr 16, 2013 at 11:10 AM, Mathieu Desnoyers > wrote: > > Yes, ppc64 should work fine with lttng-ust. This list is not up to date. > > > > CCing Christian so he can update it. > > > > * Hari Prasad Kalavakunta (Hari.Prasad at radisys.com) wrote: > >> Hello lttng-dev, > >> > >> Good morning and very short question. > >> > >> Is user space tracer not supported yet for ppc64? > >> > >> URL http://lttng.org/comparison-systemtap-and-dtrace lists only x86 for User Space tracing. Could you please confirm the same. > >> > >> processor support > >> > >> Kernel tracer: x86-32, x86-64, SPARC, SPARC64, ppc, ppc64, sh, sh64, ia64, s390, MIPS 32/64, ARM, (arch-agnostic core) > >> Userspace tracer: x86-32, x86-64 > >> > >> > >> Regards, > >> Hari > > > >> _______________________________________________ > >> 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 soariez at gmail.com Sat Apr 20 22:24:01 2013 From: soariez at gmail.com (Zifei Tong) Date: Sun, 21 Apr 2013 10:24:01 +0800 Subject: [lttng-dev] [PATCH lttng-ust] Fix: make 'hello.cxx' compile with g++ Message-ID: <1366511041-28805-1-git-send-email-soariez@gmail.com> Fixes #338 Signed-off-by: Zifei Tong --- include/lttng/ringbuffer-config.h | 5 +++++ include/lttng/tracepoint-event.h | 12 ++++++------ include/lttng/ust-events.h | 8 ++++---- include/lttng/ust-tracepoint-event.h | 19 ++++++++++--------- tests/hello.cxx/Makefile.am | 2 +- tests/hello.cxx/tp.c | 26 -------------------------- tests/hello.cxx/tp.cpp | 26 ++++++++++++++++++++++++++ 7 files changed, 52 insertions(+), 46 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..bb01eab 100644 --- a/include/lttng/ringbuffer-config.h +++ b/include/lttng/ringbuffer-config.h @@ -347,8 +347,13 @@ int lib_ring_buffer_check_config(const struct lttng_ust_lib_ring_buffer_config * unsigned int switch_timer_interval, unsigned int read_timer_interval) { + #ifdef __cplusplus + if (config->alloc == lttng_ust_lib_ring_buffer_config::RING_BUFFER_ALLOC_GLOBAL + && config->sync == lttng_ust_lib_ring_buffer_config::RING_BUFFER_SYNC_PER_CPU + #else if (config->alloc == RING_BUFFER_ALLOC_GLOBAL && config->sync == RING_BUFFER_SYNC_PER_CPU + #endif && switch_timer_interval) return -EINVAL; return 0; 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..4ef918b 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -90,7 +90,7 @@ struct lttng_enum_entry { #define __type_integer(_type, _byte_order, _base, _encoding) \ { \ .atype = atype_integer, \ - .u.basic.integer = \ + .u = {.basic = {.integer = \ { \ .size = sizeof(_type) * CHAR_BIT, \ .alignment = lttng_alignof(_type) * CHAR_BIT, \ @@ -98,7 +98,7 @@ struct lttng_enum_entry { .reverse_byte_order = _byte_order != BYTE_ORDER, \ .base = _base, \ .encoding = lttng_encode_##_encoding, \ - }, \ + }}}, \ } \ #define LTTNG_UST_INTEGER_TYPE_PADDING 24 @@ -124,14 +124,14 @@ struct lttng_integer_type { #define __type_float(_type) \ { \ .atype = atype_float, \ - .u.basic._float = \ + .u = {.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, \ - }, \ + }}}, \ } \ #define LTTNG_UST_FLOAT_TYPE_PADDING 24 diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index e46cc1a..f8df87c 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -147,12 +147,12 @@ static const char \ .type = \ { \ .atype = atype_array, \ - .u.array = \ + .u = {.array = \ { \ - .length = _length, \ .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \ + .length = _length, \ }, \ - }, \ + }}, \ .nowrite = _nowrite, \ }, @@ -164,11 +164,11 @@ static const char \ .type = \ { \ .atype = atype_sequence, \ - .u.sequence = \ + .u = {.sequence = \ { \ .length_type = __type_integer(_length_type, BYTE_ORDER, 10, none), \ .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \ - }, \ + }}, \ }, \ .nowrite = _nowrite, \ }, @@ -180,7 +180,7 @@ 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 +483,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 +612,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 From mathieu.desnoyers at efficios.com Sun Apr 21 09:37:53 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Sun, 21 Apr 2013 09:37:53 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Fix: make 'hello.cxx' compile with g++ In-Reply-To: <1366511041-28805-1-git-send-email-soariez@gmail.com> References: <1366511041-28805-1-git-send-email-soariez@gmail.com> Message-ID: <20130421133753.GA26620@Krystal> Hi, Thanks for submitting this patch. Here are a couple of comments to improve it. * Zifei Tong (soariez at gmail.com) wrote: > Fixes #338 Are those changes also compatible with the LLVM c++ compiler ? By the way, we should add a "-Wc++-compat" when compiling those headers under C, so we quickly spot the changes that are not compatible across both C and C++. > > Signed-off-by: Zifei Tong > --- > include/lttng/ringbuffer-config.h | 5 +++++ > include/lttng/tracepoint-event.h | 12 ++++++------ > include/lttng/ust-events.h | 8 ++++---- > include/lttng/ust-tracepoint-event.h | 19 ++++++++++--------- > tests/hello.cxx/Makefile.am | 2 +- > tests/hello.cxx/tp.c | 26 -------------------------- > tests/hello.cxx/tp.cpp | 26 ++++++++++++++++++++++++++ > 7 files changed, 52 insertions(+), 46 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..bb01eab 100644 > --- a/include/lttng/ringbuffer-config.h > +++ b/include/lttng/ringbuffer-config.h > @@ -347,8 +347,13 @@ int lib_ring_buffer_check_config(const struct lttng_ust_lib_ring_buffer_config * > unsigned int switch_timer_interval, > unsigned int read_timer_interval) > { > + #ifdef __cplusplus > + if (config->alloc == lttng_ust_lib_ring_buffer_config::RING_BUFFER_ALLOC_GLOBAL > + && config->sync == lttng_ust_lib_ring_buffer_config::RING_BUFFER_SYNC_PER_CPU > + #else > if (config->alloc == RING_BUFFER_ALLOC_GLOBAL > && config->sync == RING_BUFFER_SYNC_PER_CPU > + #endif inlined precompiler directives like this make the function hard to follow (mix of #if/#else/#endif and if/else). We should find a better way to encapsulate this change. Why is this lttng_ust_lib_ring_buffer_config:: scoping needed in c++ ? > && switch_timer_interval) > return -EINVAL; > return 0; > 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..4ef918b 100644 > --- a/include/lttng/ust-events.h > +++ b/include/lttng/ust-events.h > @@ -90,7 +90,7 @@ struct lttng_enum_entry { > #define __type_integer(_type, _byte_order, _base, _encoding) \ > { \ > .atype = atype_integer, \ > - .u.basic.integer = \ > + .u = {.basic = {.integer = \ > { \ > .size = sizeof(_type) * CHAR_BIT, \ > .alignment = lttng_alignof(_type) * CHAR_BIT, \ > @@ -98,7 +98,7 @@ struct lttng_enum_entry { > .reverse_byte_order = _byte_order != BYTE_ORDER, \ > .base = _base, \ > .encoding = lttng_encode_##_encoding, \ > - }, \ > + }}}, \ > } \ > > #define LTTNG_UST_INTEGER_TYPE_PADDING 24 > @@ -124,14 +124,14 @@ struct lttng_integer_type { > #define __type_float(_type) \ > { \ > .atype = atype_float, \ > - .u.basic._float = \ > + .u = {.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, \ > - }, \ > + }}}, \ changes to this file (above) do not respect coding style. Missing spaces before ".", missing newlines and indendation for added { }. > } \ > > #define LTTNG_UST_FLOAT_TYPE_PADDING 24 > diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h > index e46cc1a..f8df87c 100644 > --- a/include/lttng/ust-tracepoint-event.h > +++ b/include/lttng/ust-tracepoint-event.h > @@ -147,12 +147,12 @@ static const char \ > .type = \ > { \ > .atype = atype_array, \ > - .u.array = \ > + .u = {.array = \ > { \ > - .length = _length, \ > .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \ > + .length = _length, \ > }, \ > - }, \ > + }}, \ > .nowrite = _nowrite, \ > }, > > @@ -164,11 +164,11 @@ static const char \ > .type = \ > { \ > .atype = atype_sequence, \ > - .u.sequence = \ > + .u = {.sequence = \ > { \ > .length_type = __type_integer(_length_type, BYTE_ORDER, 10, none), \ > .elem_type = __type_integer(_type, BYTE_ORDER, 10, _encoding), \ > - }, \ > + }}, \ > }, \ > .nowrite = _nowrite, \ > }, > @@ -180,7 +180,7 @@ static const char \ > .type = \ > { \ > .atype = atype_string, \ > - .u.basic.string.encoding = lttng_encode_UTF8, \ > + .u = {.basic = {.string = {.encoding = lttng_encode_UTF8}}}, \ > }, \ > .nowrite = _nowrite, \ same above about coding style. > }, > @@ -483,7 +483,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; \ coding style: space before * > struct lttng_channel *__chan = __event->chan; \ > struct lttng_ust_lib_ring_buffer_ctx __ctx; \ > size_t __event_len, __event_align; \ > @@ -612,13 +612,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, \ 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) > + .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}},\ coding style (missing spaces). Thanks, Mathieu > }; > > #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 Sun Apr 21 09:50:06 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Sun, 21 Apr 2013 09:50:06 -0400 Subject: [lttng-dev] [RFC-patch] Add support of struct metadata in tracepoints In-Reply-To: <1366309257-17855-1-git-send-email-gbastien+lttng@versatic.net> References: <1366309257-17855-1-git-send-email-gbastien+lttng@versatic.net> Message-ID: <20130421135006.GA27816@Krystal> * Genevi?ve Bastien (gbastien+lttng at versatic.net) wrote: > Introduce the new macro TRACEPOINT_STRUCT to define ctf struct metadata > that can be used by tracepoints using _struct as entry and tp_memcpy_struct > to copy a struct field. > Struct metadata can contain nested structs. > This extra metadata is added to the metadata file only if events use it. Have you tried nesting structures into a sequence or array ? What changes would be needed to support this ? More comments below, > > Signed-off-by: Genevi?ve Bastien > --- > lttng-events.c | 166 ++++++++++++++++++++++++++++++++++- > lttng-events.h | 44 ++++++++++ > probes/lttng-events-reset.h | 15 ++++ > probes/lttng-events.h | 206 ++++++++++++++++++++++++++++++++++++++++++-- > 4 files changed, 421 insertions(+), 10 deletions(-) > > diff --git a/lttng-events.c b/lttng-events.c > index 4f30904..b332c29 100644 > --- a/lttng-events.c > +++ b/lttng-events.c > @@ -61,6 +61,7 @@ void synchronize_trace(void) > struct lttng_session *lttng_session_create(void) > { > struct lttng_session *session; > + int i; > > mutex_lock(&sessions_mutex); > session = kzalloc(sizeof(struct lttng_session), GFP_KERNEL); > @@ -70,6 +71,11 @@ struct lttng_session *lttng_session_create(void) > INIT_LIST_HEAD(&session->events); > uuid_le_gen(&session->uuid); > list_add(&session->list, &sessions); > + /* Initialize dumped metadata */ > + for (i = 0; i < NR_METADATA_TYPES; i++) { > + session->dumped_metadata[i].nr_metadata = 0; > + session->dumped_metadata[i].next = 0; > + } > mutex_unlock(&sessions_mutex); > return session; > } > @@ -78,7 +84,8 @@ void lttng_session_destroy(struct lttng_session *session) > { > struct lttng_channel *chan, *tmpchan; > struct lttng_event *event, *tmpevent; > - int ret; > + struct lttng_metadata_dumped_data *dumped; > + int ret, i, j; int ret, i; > > mutex_lock(&sessions_mutex); > ACCESS_ONCE(session->active) = 0; > @@ -96,6 +103,15 @@ void lttng_session_destroy(struct lttng_session *session) > list_for_each_entry_safe(chan, tmpchan, &session->chan, list) > _lttng_channel_destroy(chan); > list_del(&session->list); > + /* Destroy dumped metadata */ > + for (i = 0; i < NR_METADATA_TYPES; i++) { int j; (limit scope) > + dumped = session->dumped_metadata[i].next; > + for (j = 0; j < session->dumped_metadata[i].nr_metadata; j++) { > + dumped = dumped->next; > + kfree(dumped); > + } > + > + } > mutex_unlock(&sessions_mutex); > kfree(session); > } [...] > diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h > index 44e8ba5..dd60ca6 100644 > --- a/probes/lttng-events-reset.h > +++ b/probes/lttng-events-reset.h > @@ -20,6 +20,9 @@ > > /* Reset macros used within TRACE_EVENT to "nothing" */ > > +#undef TRACE_METADATA > +#define TRACE_METADATA 1 What is TRACE_METADATA used for ? > + > #undef __field_full > #define __field_full(_type, _item, _order, _base) > > @@ -35,6 +38,9 @@ > #undef __string > #define __string(_item, _src) > > +#undef __struct > +#define __struct(_provider, _type, _item, _params) > + > #undef tp_assign > #define tp_assign(dest, src) > > @@ -47,6 +53,9 @@ > #undef tp_strcpy > #define tp_strcpy(dest, src) > > +#undef tp_memcpy_struct > +#define tp_memcpy_struct(provider, name, dest, src) > + > #undef __get_str > #define __get_str(field) > > @@ -65,6 +74,9 @@ > #undef TP_STRUCT__entry > #define TP_STRUCT__entry(args...) > > +#undef TP_FIELDS > +#define TP_FIELDS(args...) > + > #undef TP_fast_assign > #define TP_fast_assign(args...) > > @@ -94,3 +106,6 @@ > > #undef TRACE_EVENT_FLAGS > #define TRACE_EVENT_FLAGS(name, value) > + > +#undef TRACEPOINT_STRUCT > +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) > diff --git a/probes/lttng-events.h b/probes/lttng-events.h > index 8a3a886..93f4abc 100644 > --- a/probes/lttng-events.h > +++ b/probes/lttng-events.h > @@ -263,9 +263,31 @@ void trace_##_name(void *__data); > #define __string_from_user(_item, _src) \ > __string(_item, _src) > > +#undef __struct > +#define __struct(_provider, _type, _item, _params) \ > + { \ > + .name = #_item, \ > + .type = \ > + { \ > + .atype = atype_struct, \ > + .u.ctf_struct.provider = #_provider, \ > + .u.ctf_struct.name = #_type, \ > + }, \ > + }, > + > #undef TP_STRUCT__entry > #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ > > +#undef TP_FIELDS > +#define TP_FIELDS(args...) args /* Only one used in this phase */ > + > +#undef TRACEPOINT_STRUCT > +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ > + static const struct lttng_event_field \ > + __struct_fields___##_provider##_##_name[] = { \ > + _fields \ > + }; > + > #undef DECLARE_EVENT_CLASS_NOARGS > #define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ > static const struct lttng_event_field __event_fields___##_name[] = { \ > @@ -301,6 +323,74 @@ static void __event_probe__##_name(void *__data); > #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > > /* > + * Stage 3.2 of the trace events. > + * > + * Create type metadata description > + */ > + > +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ > + > +#undef TRACEPOINT_STRUCT > +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ > +static struct lttng_struct_desc __struct_desc___##_provider##_##_name = {\ > + .fields = __struct_fields___##_provider##_##_name, \ > + .nr_fields = ARRAY_SIZE(__struct_fields___##_provider##_##_name),\ > + .provider = #_provider, \ > + .name = #_name, \ > + .owner = THIS_MODULE, \ > + }; > + > +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > + > +/* > + * Stage 3.3 of the trace events. > + * > + * Associate metadata description to event or event template or other struct > + */ > + > +/* Named field types must be defined in lttng-types.h */ > + > +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ > + > +#undef __struct > +#define __struct(_provider, _type, _item, _params) \ > + { \ > + .mtype = mtype_struct, \ > + .m.ctf_st.struct_desc = &__struct_desc___##_provider##_##_type,\ > + .m.ctf_st.type_metadata = __type_metadata_for__##_provider##_##_type,\ > + .m.ctf_st.nr_metadata = ARRAY_SIZE(__type_metadata_for__##_provider##_##_type),\ > + }, > + > + > +#undef TP_STRUCT__entry > +#define TP_STRUCT__entry(args...) args /* Only one used in this phase */ > + > +#undef TP_FIELDS > +#define TP_FIELDS(args...) args > + > +#undef TRACEPOINT_STRUCT > +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ > +static const struct lttng_metadata __type_metadata_for__##_provider##_##_name[] = {\ > + _fields \ > +}; > + > + > + > +#undef DECLARE_EVENT_CLASS_NOARGS > +#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ > +static const struct lttng_metadata __type_metadata_for__##_name[] = { \ > + _tstruct \ > +}; > + > +#undef DECLARE_EVENT_CLASS > +#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ > + DECLARE_EVENT_CLASS_NOARGS(_name, PARAMS(_tstruct), PARAMS(_assign), \ > + PARAMS(_print)) > + > +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > + > + > +/* > * Stage 3.9 of the trace events. > * > * Create event descriptions. > @@ -318,9 +408,11 @@ static void __event_probe__##_name(void *__data); > #define DEFINE_EVENT_MAP_NOARGS(_template, _name, _map) \ > static const struct lttng_event_desc __event_desc___##_map = { \ > .fields = __event_fields___##_template, \ > + .type_metadata = __type_metadata_for__##_template, \ > .name = #_map, \ > .probe_callback = (void *) TP_PROBE_CB(_template), \ > .nr_fields = ARRAY_SIZE(__event_fields___##_template), \ > + .nr_metadata = ARRAY_SIZE(__type_metadata_for__##_template), \ > .owner = THIS_MODULE, \ > }; > > @@ -379,9 +471,12 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { > #undef TP_ID > > /* > - * Stage 6 of the trace events. > + * Stage 6.0 of the trace events. > * > * Create static inline function that calculates event size. > + * > + * First stage creates function to calculate sizes of sub-metadata > + * (with no effect on the dynamic length values) This approach seems to only consider the case where you memcpy a struct directly into the buffers, no ? How does it deal with copying field-by-field into the structure's fields ? On a different point, I see nothing here that documents where/how recursion that could happen by nesting an array within itself is handled. Thanks, Mathieu > */ > > #include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ > @@ -403,6 +498,57 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { > __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(u32)); \ > __event_len += sizeof(u32); \ > __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ > + __event_len += sizeof(_type) * (_length); \ > + > +#undef __string > +#define __string(_item, _src) \ > + __event_len += strlen(_src) + 1; > + > +/* > + * strlen_user includes \0. If returns 0, it faulted, so we set size to > + * 1 (\0 only). > + */ > +#undef __string_from_user > +#define __string_from_user(_item, _src) \ > + __event_len += max_t(size_t, lttng_strlen_user_inatomic(_src), 1); > + > +#undef __struct > +#define __struct(_provider, _type, _item, _params) \ > + __event_len += __struct_get_size__##_provider##_##_type(_params);\ > + > +#undef TP_PROTO > +#define TP_PROTO(args...) args > + > +#undef TP_STRUCT__entry > +#define TP_STRUCT__entry(args...) args > + > +#undef TP_FIELDS > +#define TP_FIELDS(args...) args > + > +#undef TRACEPOINT_STRUCT > +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ > +static inline size_t __struct_get_size__##_provider##_##_name(_proto) \ > + { \ > + size_t __event_len = 0; \ > + \ > + _fields \ > + return __event_len; \ > +} > + > +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > + > +/* > + * Stage 6.1 of the trace events. > + * > + * Create static inline function that calculates event size, this time adding > + * the size to the dynamic_len array > + */ > + > +#undef __dynamic_array_enc_ext > +#define __dynamic_array_enc_ext(_type, _item, _length, _order, _base, _encoding)\ > + __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(u32)); \ > + __event_len += sizeof(u32); \ > + __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type));\ > __dynamic_len[__dynamic_len_idx] = (_length); \ > __event_len += sizeof(_type) * __dynamic_len[__dynamic_len_idx]; \ > __dynamic_len_idx++; > @@ -420,11 +566,13 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { > __event_len += __dynamic_len[__dynamic_len_idx++] = \ > max_t(size_t, lttng_strlen_user_inatomic(_src), 1); > > -#undef TP_PROTO > -#define TP_PROTO(args...) args > +#undef __struct > +#define __struct(_provider, _type, _item, _params) \ > + __event_len += __dynamic_len[__dynamic_len_idx++] = \ > + __struct_get_size__##_provider##_##_type(_params); > > -#undef TP_STRUCT__entry > -#define TP_STRUCT__entry(args...) args > +#undef TRACEPOINT_STRUCT > +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) > > #undef DECLARE_EVENT_CLASS > #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ > @@ -470,12 +618,36 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ > #undef __string_from_user > #define __string_from_user(_item, _src) > > +#undef __struct > +#define __struct(_provider, _type, _item, _params) \ > + __event_align = max_t(size_t, __event_align, \ > + __instruct_get_align__##_provider##_##_type(_params)); > + > #undef TP_PROTO > #define TP_PROTO(args...) args > > +#undef TP_ARGS > +#define TP_ARGS(args...) args > + > #undef TP_STRUCT__entry > #define TP_STRUCT__entry(args...) args > > +#undef TP_FIELDS > +#define TP_FIELDS(args...) args > + > +#undef TRACEPOINT_STRUCT > +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ > +static inline size_t __struct_get_align__##_provider##_##_name(_proto) \ > +{ \ > + size_t __event_align = 1; \ > + _fields \ > + return __event_align; \ > +} \ > +static inline size_t __instruct_get_align__##_provider##_##_name(_proto)\ > +{ \ > + return __struct_get_align__##_provider##_##_name(_args); \ > +} > + > #undef DECLARE_EVENT_CLASS > #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ > static inline size_t __event_get_align__##_name(_proto) \ > @@ -487,7 +659,6 @@ static inline size_t __event_get_align__##_name(_proto) \ > > #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > > - > /* > * Stage 8 of the trace events. > * > @@ -517,6 +688,9 @@ static inline size_t __event_get_align__##_name(_proto) \ > #define __string_from_user(_item, _src) \ > __string(_item, _src) > > +#undef __struct > +#define __struct(_provider, _type, _item, _params) char _item; > + > #undef TP_STRUCT__entry > #define TP_STRUCT__entry(args...) args > > @@ -528,7 +702,6 @@ struct __event_typemap__##_name { \ > > #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) > > - > /* > * Stage 9 of the trace events. > * > @@ -568,6 +741,11 @@ __end_field_##_item: > #define __string_from_user(_item, _src) \ > __string(_item, _src) > > +#undef __struct > +#define __struct(_provider, _type, _item, _params) \ > + goto __assign_##_item; \ > +__end_field_##_item: > + > /* > * Macros mapping tp_assign() to "=", tp_memcpy() to memcpy() and tp_strcpy() to > * strcpy(). > @@ -624,12 +802,24 @@ __assign_##dest##_2: \ > #define tp_memcpy_dyn_from_user(dest, src) \ > tp_memcpy_dyn_gen(event_write_from_user, dest, src) > > +#undef tp_memcpy_struct_gen > +#define tp_memcpy_struct_gen(write_ops, provider, name, dest, src) \ > +__assign_##dest: \ > + lib_ring_buffer_align_ctx(&__ctx, __struct_get_align__##provider##_##name(src));\ > + __chan->ops->write_ops(&__ctx, src, \ > + sizeof(__typemap.dest) * __get_dynamic_array_len(dest));\ > + goto __end_field_##dest; > + > +#undef tp_memcpy_struct > +#define tp_memcpy_struct(provider, name, dest, src) \ > + tp_memcpy_struct_gen(event_write, provider, name, dest, src) > + > /* > * The string length including the final \0. > */ > #undef tp_copy_string_from_user > #define tp_copy_string_from_user(dest, src) \ > - __assign_##dest: \ > +__assign_##dest: \ > { \ > size_t __ustrlen; \ > \ > -- > 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 soariez at gmail.com Sun Apr 21 13:07:51 2013 From: soariez at gmail.com (Zifei Tong) Date: Mon, 22 Apr 2013 01:07:51 +0800 Subject: [lttng-dev] [PATCH lttng-ust] Fix: make 'hello.cxx' compile with g++ In-Reply-To: <20130421133753.GA26620@Krystal> References: <1366511041-28805-1-git-send-email-soariez@gmail.com> <20130421133753.GA26620@Krystal> Message-ID: Hi, Thanks for your review. > Why is this lttng_ust_lib_ring_buffer_config:: scoping needed in c++ ? C++ will hide enumeration defined inside class/struct. Quote from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf, page 158: > An enumerator declared in class scope can be referred to using the class member access > operators (::, . (dot) and -> (arrow)) [Example: > struct X { > enum direction { left=?l?, right=?r? }; > }; > void g(X* p) { > int i; > i = p->f(left); // error: left not in scope > i = p->f(X::right); // OK > } > ? end example ] > inlined precompiler directives like this make the function hard to > follow (mix of #if/#else/#endif and if/else). I agree inlined precompiler directives is bad style. Could you suggest a way to remove the mix of #if/#else/#endif and if/else? > 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. Cleaned-up patch attached. Thanks. >From 36930fdfa25a6ea67de551300263dee353df43e5 Mon Sep 17 00:00:00 2001 From: Zifei Tong Date: Sat, 20 Apr 2013 19:38:39 +0800 Subject: [PATCH lttng-ust] Fix: make 'hello.cxx' compile with g++ Fixes #338 Signed-off-by: Zifei Tong --- include/lttng/ringbuffer-config.h | 5 +++++ 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, 86 insertions(+), 59 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..bb01eab 100644 --- a/include/lttng/ringbuffer-config.h +++ b/include/lttng/ringbuffer-config.h @@ -347,8 +347,13 @@ int lib_ring_buffer_check_config(const struct lttng_ust_lib_ring_buffer_config * unsigned int switch_timer_interval, unsigned int read_timer_interval) { + #ifdef __cplusplus + if (config->alloc == lttng_ust_lib_ring_buffer_config::RING_BUFFER_ALLOC_GLOBAL + && config->sync == lttng_ust_lib_ring_buffer_config::RING_BUFFER_SYNC_PER_CPU + #else if (config->alloc == RING_BUFFER_ALLOC_GLOBAL && config->sync == RING_BUFFER_SYNC_PER_CPU + #endif && switch_timer_interval) return -EINVAL; return 0; 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..e97cc1b 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..3aa946d 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 -- Best Regards, ??? (Zifei Tong) College of Computer Science and Technology, Zhejiang University soariez at gmail.com / tongzifei at zju.edu.cn -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.desnoyers at efficios.com Sun Apr 21 17:36:22 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Sun, 21 Apr 2013 17:36:22 -0400 Subject: [lttng-dev] [PATCH lttng-ust] Fix: make 'hello.cxx' compile with g++ In-Reply-To: References: <1366511041-28805-1-git-send-email-soariez@gmail.com> <20130421133753.GA26620@Krystal> Message-ID: <20130421213622.GA24632@Krystal> * Zifei Tong (soariez at gmail.com) wrote: > Hi, > > Thanks for your review. > > > Why is this lttng_ust_lib_ring_buffer_config:: scoping needed in c++ ? > > C++ will hide enumeration defined inside class/struct. > > Quote from http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf, > page 158: > > An enumerator declared in class scope can be referred to using the class > member access > > operators (::, . (dot) and -> (arrow)) [Example: > > struct X { > > enum direction { left=?l?, right=?r? }; > > }; > > void g(X* p) { > > int i; > > i = p->f(left); // error: left not in scope > > i = p->f(X::right); // OK > > } > > ? end example ] > > > > inlined precompiler directives like this make the function hard to > > follow (mix of #if/#else/#endif and if/else). > > I agree inlined precompiler directives is bad style. Could you suggest a > way to remove the mix of #if/#else/#endif and if/else? Maybe we could simply left the numeration outside of the structure declaration ? This would make its scope global in both c and c++. Please try making this change, and make sure you keep this documentation on the reasons why we need to do this change in the patch changelog. It will be useful for future reference. > > > 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. OK, this justifies the style to coding style. Please document in the patch changelog. > > > 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. ok, good to know. > > Cleaned-up patch attached. More comments below, > > Thanks. > > From 36930fdfa25a6ea67de551300263dee353df43e5 Mon Sep 17 00:00:00 2001 > From: Zifei Tong > Date: Sat, 20 Apr 2013 19:38:39 +0800 > Subject: [PATCH lttng-ust] Fix: make 'hello.cxx' compile with g++ > > Fixes #338 > > Signed-off-by: Zifei Tong > --- > include/lttng/ringbuffer-config.h | 5 +++++ > 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, 86 insertions(+), 59 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..bb01eab 100644 > --- a/include/lttng/ringbuffer-config.h > +++ b/include/lttng/ringbuffer-config.h > @@ -347,8 +347,13 @@ int lib_ring_buffer_check_config(const struct > lttng_ust_lib_ring_buffer_config * > unsigned int switch_timer_interval, > unsigned int read_timer_interval) > { > + #ifdef __cplusplus > + if (config->alloc == > lttng_ust_lib_ring_buffer_config::RING_BUFFER_ALLOC_GLOBAL > + && config->sync == > lttng_ust_lib_ring_buffer_config::RING_BUFFER_SYNC_PER_CPU > + #else > if (config->alloc == RING_BUFFER_ALLOC_GLOBAL > && config->sync == RING_BUFFER_SYNC_PER_CPU > + #endif > && switch_timer_interval) > return -EINVAL; > return 0; > 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 */ Hrm, I don't get what this is supposed to fix ? Normall > - > #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..e97cc1b 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 = \ > + { \ Please ensure that each nested "{" has its own indent level. I also think your mail client turned tabs into spaces. Thanks, Mathieu > + .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..3aa946d 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 > > -- > 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 SIDDHARTH.VERMA at radisys.com Mon Apr 22 01:20:15 2013 From: SIDDHARTH.VERMA at radisys.com (SIDDHARTH VERMA) Date: Mon, 22 Apr 2013 05:20:15 +0000 Subject: [lttng-dev] FW: LTTNG-Tools-2.1.1 Support for PPC-32Bit/64bit; Unable to Resolve the Dependencies Message-ID: Hi Lttng-Support, I used following commands to compile and install the LTTng on PPC Board:: 1. ./configure --host=powerpc-linux CC=/usr/bin/ppc-linux-gcc CFLAGS="-m32 -g -O2" 2. make 3. make install 4. ldconfig ------------------------ Error Logs for LTTng-Tools-2.1.1 && lttng-ust-2.2.0-rc1 && userspace-rcu-0.7.2:: ------------------------ liburcu & lttng-ust installed but getting below error while trying to make LTTng-Tools ------------------------ ------------------------ [root at 172.27.4.128]# make Making all in src make[1]: Entering directory `/root/siverma/2.1.1/lttng-tools-2.2.0-rc1/src' Making all in common make[2]: Entering directory `/root/siverma/2.1.1/lttng-tools-2.2.0-rc1/src/common' Making all in compat make[3]: Entering directory `/root/siverma/2.1.1/lttng-tools-2.2.0-rc1/src/common/compat' CC compat-fcntl.lo CC compat-epoll.lo In file included from compat-epoll.c:31: poll.h:72: error: 'EPOLLRDHUP' undeclared here (not in a function) poll.h:74: error: 'EPOLL_CLOEXEC' undeclared here (not in a function) compat-epoll.c: In function 'compat_epoll_create': compat-epoll.c:77: warning: implicit declaration of function 'epoll_create1' make[3]: *** [compat-epoll.lo] Error 1 make[3]: Leaving directory `/root/siverma/2.1.1/lttng-tools-2.2.0-rc1/src/common/compat' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/root/siverma/2.1.1/lttng-tools-2.2.0-rc1/src/common' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/root/siverma/2.1.1/lttng-tools-2.2.0-rc1/src' make: *** [all-recursive] Error 1 ------------------------------------ I also tried with the previous version of the tool liburcu installed but getting below dependencies while trying to configure for lttng-ust ------------------------------------ Error Logs lttng-ust-1.9.2 && lttng-tools-2.0.0-rc1 && userspace-rcu-0.6.6 :: ------------------------------------ ------------------------------------ checking for GNU libc compatible malloc... yes checking for gettimeofday... yes checking for munmap... yes checking for socket... yes checking for strerror... yes checking for strtol... yes checking for makeinfo... no configure: error: Please install the 'texinfo' program and make sure 'makeinfo' is in the PATH. -------------------------------------------------------- -------------------------------------------------------- It seems there are many dependencies involved in the installation of the LTTng, some of them are as follows; Texinfo Makeinfo kernel image to 2.6.38 or higher librc libpotp > 1.13 tcltk libasprintf gettext gc++ glib 2.34.0 and some more packages. Do we have to download and cross compile them all for ppc or we can get some help from standard package managers for the same? As of now the kernel used in machine is "3.4.3-rt13" [root at 172.27.4.128]# uname -a Linux 172.27.4.128 3.4.3-rt13 #1 SMP PREEMPT RT Sat Feb 23 09:46:06 CST 2013 ppc ppc ppc GNU/Linux As per my observations it may take a lot of time to resolve them all as we have to decide all the correct supporting packages with the correct releases in order to make them work for a particular Linux image, though its easy to resolve it by using standard package managers in latest Linux e.g. UBUNTU. Please suggest on the same. Regards Siddharth Verma Mobile: +91-9880621252 siddharth.verma at radisys.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From madhu.b77 at gmail.com Mon Apr 22 01:30:20 2013 From: madhu.b77 at gmail.com (Madhusudan Bhat) Date: Mon, 22 Apr 2013 11:00:20 +0530 Subject: [lttng-dev] supporting new processor Message-ID: Hi All, I need to support lttng tools, I have new MIPS based multi core processor on which 3.7 linux kernel boots up. To support lttng tools, does it require any drivers/kernel hook ups to new processor? Or is it independent of processor architecture? For ex, to support Oprofile tools, we need to provide oprofile driver which is specific to particular processor. In similar ways,any thing is required to support lttng tools? thanks, Madhu. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.glauber at gmail.com Mon Apr 22 08:55:47 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Mon, 22 Apr 2013 14:55:47 +0200 Subject: [lttng-dev] [RFC PATCH 0/2] babeltrace legacy LTT 2.6 converter In-Reply-To: <51715CCB.90009@ericsson.com> References: <51715CCB.90009@ericsson.com> Message-ID: <20130422125536.GA8755@hal> On Fri, Apr 19, 2013 at 11:03:39AM -0400, Matthew Khouzam wrote: > Hi Jan, > > I have a few questions about the patch: > Does it handle lost events? > I think we would need to bring in a state system for this Hi Matthew, Not sure what you mean there. I thought lost events are not recorded so there is nothing to convert. What I do convert is the events_lost counter of LTT. The value is copied to the events_discarded of LTTng. At least that looked reasonable to me. Can you elaborate why we would need a state machine there? > Is there a reason lttng2.0 is not working for you? kernel? install base? > other? The reason is that we have multiple install bases and some are on LTT with no option of upgrading them to LTTng. > Do you want just a list of the events or analysis on the trace later on. We would like to analyse traces from different sources with Eclipse and especially using the CTF classes. > Can you post an example of a converted trace? Sure, here's a short snapshot of the converted trace viewed with babeltrace, somewhere in the middle of a not too spectacular trace but at least with events from some different components: [10:42:48.534746510] (+0.000001741) none kernel_syscall_entry: { cpu_id = 1 }, { ip = 716048728, syscall_id = 263 } [10:42:48.534748034] (+0.000001524) none fs_pollfd: { cpu_id = 0 }, { fd = 27 } [10:42:48.534748132] (+0.000000098) none kernel_syscall_exit: { cpu_id = 1 }, { ret = 0 } [10:42:48.534751362] (+0.000003230) none fs_pollfd: { cpu_id = 0 }, { fd = 28 } [10:42:48.534754469] (+0.000003107) none fs_pollfd: { cpu_id = 0 }, { fd = 29 } [10:42:48.534757482] (+0.000003013) none fs_pollfd: { cpu_id = 0 }, { fd = 20 } [10:42:48.534761354] (+0.000003872) none fs_pollfd: { cpu_id = 0 }, { fd = 22 } [10:42:48.534764045] (+0.000002691) none fs_pollfd: { cpu_id = 0 }, { fd = 30 } [10:42:48.534767272] (+0.000003227) none fs_pollfd: { cpu_id = 0 }, { fd = 31 } [10:42:48.534770512] (+0.000003240) none fs_pollfd: { cpu_id = 0 }, { fd = 32 } [10:42:48.534774102] (+0.000003590) none fs_pollfd: { cpu_id = 0 }, { fd = 33 } [10:42:48.534777510] (+0.000003408) none fs_pollfd: { cpu_id = 0 }, { fd = 35 } [10:42:48.534781767] (+0.000004257) none fs_pollfd: { cpu_id = 0 }, { fd = 36 } [10:42:48.534785282] (+0.000003515) none fs_pollfd: { cpu_id = 0 }, { fd = 37 } [10:42:48.534788669] (+0.000003387) none fs_pollfd: { cpu_id = 0 }, { fd = 34 } [10:42:48.534791977] (+0.000003308) none fs_pollfd: { cpu_id = 0 }, { fd = 38 } [10:42:48.534795069] (+0.000003092) none fs_pollfd: { cpu_id = 0 }, { fd = 39 } [10:42:48.534798194] (+0.000003125) none fs_pollfd: { cpu_id = 0 }, { fd = 40 } [10:42:48.534801197] (+0.000003003) none fs_pollfd: { cpu_id = 0 }, { fd = 41 } [10:42:48.534804389] (+0.000003192) none fs_pollfd: { cpu_id = 0 }, { fd = 42 } [10:42:48.534807827] (+0.000003438) none fs_pollfd: { cpu_id = 0 }, { fd = 43 } [10:42:48.534811137] (+0.000003310) none fs_pollfd: { cpu_id = 0 }, { fd = 44 } [10:42:48.534814215] (+0.000003078) none fs_pollfd: { cpu_id = 0 }, { fd = 45 } [10:42:48.534817354] (+0.000003139) none fs_pollfd: { cpu_id = 0 }, { fd = 46 } [10:42:48.534820489] (+0.000003135) none fs_pollfd: { cpu_id = 0 }, { fd = 47 } [10:42:48.534823479] (+0.000002990) none fs_pollfd: { cpu_id = 0 }, { fd = 48 } [10:42:48.534826875] (+0.000003396) none fs_pollfd: { cpu_id = 0 }, { fd = 49 } [10:42:48.534830315] (+0.000003440) none fs_pollfd: { cpu_id = 0 }, { fd = 50 } [10:42:48.534834449] (+0.000004134) none fs_pollfd: { cpu_id = 0 }, { fd = 51 } [10:42:48.534837717] (+0.000003268) none fs_pollfd: { cpu_id = 0 }, { fd = 52 } [10:42:48.534841064] (+0.000003347) none fs_pollfd: { cpu_id = 0 }, { fd = 53 } [10:42:48.534844754] (+0.000003690) none fs_pollfd: { cpu_id = 0 }, { fd = 54 } [10:42:48.534849177] (+0.000004423) none fs_pollfd: { cpu_id = 0 }, { fd = 55 } [10:42:48.534892997] (+0.000043820) none mm_page_free: { cpu_id = 0 }, { pfn = 158205, order = 0 } [10:42:48.534993555] (+0.000100558) none kernel_syscall_entry: { cpu_id = 1 }, { ip = 716868028, syscall_id = 296 } [10:42:48.535000284] (+0.000006729) none net_socket_recvmsg: { cpu_id = 0 }, { sock = 0xB5F324E0, msg = 0x983FFF74, size = 2048, flags = 1073741888, ret = 660 } [10:42:48.535011094] (+0.000010810) none net_socket_sendmsg: { cpu_id = 1 }, { sock = 0xB5CE8B20, msg = 0xB6031F74, size = 463, ret = 463 } [10:42:48.535013404] (+0.000002310) none kernel_syscall_exit: { cpu_id = 1 }, { ret = 463 } [10:42:48.535202519] (+0.000189115) none net_socket_recvmsg: { cpu_id = 0 }, { sock = 0xB5F324E0, msg = 0x983FFF74, size = 2048, flags = 1073741888, ret = -11 } [10:42:48.535231537] (+0.000029018) none kernel_sched_try_wakeup: { cpu_id = 1 }, { pid = 68, cpu_id = 1, state = 256 } [10:42:48.535243069] (+0.000011532) none kernel_sched_schedule: { cpu_id = 1 }, { prev_pid = 1, next_pid = 68, prev_state = 0 } [10:42:48.535258092] (+0.000015023) none fs_pollfd: { cpu_id = 1 }, { fd = 5 } [10:42:48.535264639] (+0.000006547) none fs_pollfd: { cpu_id = 1 }, { fd = 9 } [10:42:48.535269929] (+0.000005290) none kernel_syscall_exit: { cpu_id = 1 }, { ret = 1 } [10:42:48.535278789] (+0.000008860) none kernel_syscall_entry: { cpu_id = 1 }, { ip = 717849364, syscall_id = 3 } [10:42:48.535299225] (+0.000020436) none fs_read: { cpu_id = 1 }, { count = 1, fd = 9 } [10:42:48.535300645] (+0.000001420) none kernel_syscall_exit: { cpu_id = 1 }, { ret = 0 } [10:42:48.535306709] (+0.000006064) none kernel_syscall_entry: { cpu_id = 1 }, { ip = 717837844, syscall_id = 240 } [10:42:48.535309234] (+0.000002525) none fs_ioctl: { cpu_id = 0 }, { fd = 4, cmd = 1075866368, arg = 745629032 } [10:42:48.535324412] (+0.000015178) none kernel_sched_migrate_task: { cpu_id = 1 }, { pid = 67, state = 256, dest_cpu = 0 } [10:42:48.535331534] (+0.000007122) none kernel_syscall_exit: { cpu_id = 1 }, { ret = 1 } [10:42:48.535335210] (+0.000003676) none kernel_syscall_entry: { cpu_id = 1 }, { ip = 718693652, syscall_id = 168 } Regards, Jan > Thanks > Matthew > > > On 13-04-19 06:20 AM, Jan Glauber wrote: > > Hi list, > > > > I've written a converter that can read LTT's 2.6 trace format and convert it > > to a CTF trace format. This was discussed before on the list: > > > > http://lists.lttng.org/pipermail/lttng-dev/2011-June/015995.html > > > > and I roughly followed the guidance given by Mathieu there. Roughly because > > I did not create plugins but followed the approach of babeltrace-log. > > > > How it works: > > - babeltrace legacy converter gets a directory containing a LTT 2.6 trace > > and a target directory where it will create the converted trace > > - it scans the metadata_N files and creates a CTF which fits the old trace data > > - it scans all trace files and creates CTF headers but copies the trace data > > - empty files which contain only headers are not copied > > > > Is there any interest in picking up this code for babeltrace (or is it just > > too obscure :) ? > > > > Best regards, > > > > Jan Glauber > > Harman Becker Automotive GmbH > > System Profiling & Optimizing Team > > > > Jan Glauber (2): > > Resurrect LTT type parser > > babeltrace legacy LTT 2.6 -> CTF 1.8 converter > > > > converter/babeltrace-legacy.c | 1184 ++++++++++++++++++++++++++++++++++ > > converter/ltt-type-parser.c | 303 +++++++++ > > include/babeltrace/ltt-type-parser.h | 17 + > > 3 files changed, 1504 insertions(+) > > create mode 100644 converter/babeltrace-legacy.c > > create mode 100644 converter/ltt-type-parser.c > > create mode 100644 include/babeltrace/ltt-type-parser.h > > > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Jan Glauber --- Harman Becker Automotive GmbH System Profiling & Optimizing Team From jeremie.galarneau at efficios.com Mon Apr 22 10:17:30 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 22 Apr 2013 10:17:30 -0400 Subject: [lttng-dev] supporting new processor In-Reply-To: References: Message-ID: Hi, Generally speaking, URCU is the most architecture-specific library of the project and it does support MIPS. Once it is compiled and installed, you should be able to build lttng-ust, lttng-tools and the kernel modules. I'd recommend running each project's test suite since I don't think that architecture has been thoroughly tested. Let us know if you encounter any problem on your particular architecture. Regards, J?r?mie On Mon, Apr 22, 2013 at 1:30 AM, Madhusudan Bhat wrote: > Hi All, > > I need to support lttng tools, I have new MIPS based multi core processor on > which 3.7 linux kernel boots up. > > To support lttng tools, does it require any drivers/kernel hook ups to new > processor? Or is it independent of processor architecture? > > For ex, to support Oprofile tools, we need to provide oprofile driver which > is specific to particular processor. In similar ways,any thing is required > to support lttng tools? > > thanks, > Madhu. > > _______________________________________________ > 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 jbernard at debian.org Mon Apr 22 11:24:17 2013 From: jbernard at debian.org (Jon Bernard) Date: Mon, 22 Apr 2013 11:24:17 -0400 Subject: [lttng-dev] Fwd: Bug#705827: babeltrace: FTBFS on GNU/kFreeBSD Message-ID: <20130422152417.GA13418@quintessa> Hello all, I received this request over the weekend and wanted to pass it on. ----- Forwarded message from Petr Salinger ----- Date: Sat, 20 Apr 2013 19:19:11 +0200 (CEST) From: Petr Salinger To: submit at bugs.debian.org Subject: Bug#705827: babeltrace: FTBFS on GNU/kFreeBSD Package: babeltrace Version: 1.1.0-1 Severity: serious Tags: patch User: debian-bsd at lists.debian.org Usertags: kfreebsd Hi, the current version fails to build on GNU/kFreeBSD. The value ENODATA is linux specific, please use some general error number, like shown bellow. It would also be nice if you can inform upstream about this. Thanks Petr --- formats/ctf/ctf.c +++ formats/ctf/ctf.c @@ -1032,7 +1032,7 @@ buflen = strlen(*buf); if (!buflen) { *fp = NULL; - return -ENODATA; + return -ENOENT; } *fp = babeltrace_fmemopen(*buf, buflen, "rb"); if (!*fp) { ----- End forwarded message ----- -- Jon From jeremie.galarneau at efficios.com Mon Apr 22 11:31:43 2013 From: jeremie.galarneau at efficios.com (=?ISO-8859-1?Q?J=E9r=E9mie_Galarneau?=) Date: Mon, 22 Apr 2013 11:31:43 -0400 Subject: [lttng-dev] FW: LTTNG-Tools-2.1.1 Support for PPC-32Bit/64bit; Unable to Resolve the Dependencies In-Reply-To: References: Message-ID: On Mon, Apr 22, 2013 at 1:20 AM, SIDDHARTH VERMA wrote: > Hi Lttng-Support, > > > > I used following commands to compile and install the LTTng on PPC Board:: > > > > 1. ./configure --host=powerpc-linux CC=/usr/bin/ppc-linux-gcc CFLAGS="-m32 > -g -O2" > > 2. make > > 3. make install > > 4. ldconfig > > > > ------------------------ > > Error Logs for LTTng-Tools-2.1.1 && lttng-ust-2.2.0-rc1 && > userspace-rcu-0.7.2:: > > ------------------------ Is there a reason you are using the stable 2.1 lttng-tools and the 2.2-rc release of lttng-ust? I'd recommend you use stable 2.1 releases of both projects since they have been tested a lot more than the 2.2 release candidates. > > liburcu & lttng-ust installed but getting below error while trying to make > LTTng-Tools > > ------------------------ > > ------------------------ > > [root at 172.27.4.128]# make > > Making all in src > > make[1]: Entering directory `/root/siverma/2.1.1/lttng-tools-2.2.0-rc1/src' > > Making all in common > > make[2]: Entering directory > `/root/siverma/2.1.1/lttng-tools-2.2.0-rc1/src/common' > > Making all in compat > > make[3]: Entering directory > `/root/siverma/2.1.1/lttng-tools-2.2.0-rc1/src/common/compat' > > CC compat-fcntl.lo > > CC compat-epoll.lo > > In file included from compat-epoll.c:31: > > poll.h:72: error: 'EPOLLRDHUP' undeclared here (not in a function) > > poll.h:74: error: 'EPOLL_CLOEXEC' undeclared here (not in a function) > > compat-epoll.c: In function 'compat_epoll_create': > > compat-epoll.c:77: warning: implicit declaration of function 'epoll_create1' > > make[3]: *** [compat-epoll.lo] Error 1 > > make[3]: Leaving directory > `/root/siverma/2.1.1/lttng-tools-2.2.0-rc1/src/common/compat' > > make[2]: *** [all-recursive] Error 1 > > make[2]: Leaving directory > `/root/siverma/2.1.1/lttng-tools-2.2.0-rc1/src/common' > > make[1]: *** [all-recursive] Error 1 > > make[1]: Leaving directory `/root/siverma/2.1.1/lttng-tools-2.2.0-rc1/src' > > make: *** [all-recursive] Error 1 > > > > ------------------------------------ > > I also tried with the previous version of the tool > > liburcu installed but getting below dependencies while trying to configure > for lttng-ust > > ------------------------------------ > > > > Error Logs lttng-ust-1.9.2 && lttng-tools-2.0.0-rc1 && userspace-rcu-0.6.6 > :: > > ------------------------------------ > > ------------------------------------ > > checking for GNU libc compatible malloc... yes > > checking for gettimeofday... yes > > checking for munmap... yes > > checking for socket... yes > > checking for strerror... yes > > checking for strtol... yes > > checking for makeinfo... no > > configure: error: Please install the 'texinfo' program and make sure > 'makeinfo' is in the PATH. > > > > -------------------------------------------------------- > > -------------------------------------------------------- > > > > It seems there are many dependencies involved in the installation of the > LTTng, some of them are as follows; > > > > Texinfo > > Makeinfo > > kernel image to 2.6.38 or higher > > librc > > libpotp > 1.13 > > tcltk > > libasprintf > > gettext > > gc++ > > glib 2.34.0 and some more packages. > > > > Do we have to download and cross compile them all for ppc or we can get some > help from standard package managers for the same? You'll have to cross-compile the dependencies for your target system. > > As of now the kernel used in machine is ?3.4.3-rt13? > > > > [root at 172.27.4.128]# uname -a > > Linux 172.27.4.128 3.4.3-rt13 #1 SMP PREEMPT RT Sat Feb 23 09:46:06 CST 2013 > ppc ppc ppc GNU/Linux > > > > As per my observations it may take a lot of time to resolve them all as we > have to decide all the correct supporting packages > > with the correct releases in order to make them work for a particular Linux > image, though its easy to resolve it by using > > standard package managers in latest Linux e.g. UBUNTU. > > > > Please suggest on the same. > Christian Babeux submitted a guide to cross-compiling LTTng on StackOverflow[1]. I'd suggest you have a look. You will, however, have to install the cross-compiled dependencies to your target root as your first step. Regards, J?r?mie [1] http://stackoverflow.com/questions/13774455/how-do-i-build-and-deploy-lttng-to-an-embedded-linux-system > > > Regards > > Siddharth Verma > > Mobile: +91-9880621252 > > siddharth.verma at radisys.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 yannick.brosseau at gmail.com Mon Apr 22 11:41:24 2013 From: yannick.brosseau at gmail.com (Yannick Brosseau) Date: Mon, 22 Apr 2013 11:41:24 -0400 Subject: [lttng-dev] supporting new processor In-Reply-To: References: Message-ID: <51755A24.6020905@gmail.com> For the kernel module, from what I've seen, you'll be missing the syscall tracing, but the rest of the tracepoints should work. Syscall tracing requires some architecture specific code in the kernel itself. On 2013-04-22 10:17, J?r?mie Galarneau wrote: > Hi, > > Generally speaking, URCU is the most architecture-specific library of > the project and it does support MIPS. Once it is compiled and > installed, you should be able to build lttng-ust, lttng-tools and the > kernel modules. > > I'd recommend running each project's test suite since I don't think > that architecture has been thoroughly tested. Let us know if you > encounter any problem on your particular architecture. > > Regards, > J?r?mie > > On Mon, Apr 22, 2013 at 1:30 AM, Madhusudan Bhat wrote: >> Hi All, >> >> I need to support lttng tools, I have new MIPS based multi core processor on >> which 3.7 linux kernel boots up. >> >> To support lttng tools, does it require any drivers/kernel hook ups to new >> processor? Or is it independent of processor architecture? >> >> For ex, to support Oprofile tools, we need to provide oprofile driver which >> is specific to particular processor. In similar ways,any thing is required >> to support lttng tools? >> >> thanks, >> Madhu. >> >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev at lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >> > > From gbastien at versatic.net Mon Apr 22 11:25:33 2013 From: gbastien at versatic.net (=?ISO-8859-1?Q?Genevi=E8ve_Bastien?=) Date: Mon, 22 Apr 2013 11:25:33 -0400 Subject: [lttng-dev] [RFC-patch] Add support of struct metadata in tracepoints In-Reply-To: <20130421135006.GA27816@Krystal> References: <1366309257-17855-1-git-send-email-gbastien+lttng@versatic.net> <20130421135006.GA27816@Krystal> Message-ID: <5175566D.9080106@versatic.net> On 04/21/2013 09:50 AM, Mathieu Desnoyers wrote: > * Genevi?ve Bastien (gbastien+lttng at versatic.net) wrote: >> Introduce the new macro TRACEPOINT_STRUCT to define ctf struct metadata >> that can be used by tracepoints using _struct as entry and tp_memcpy_struct >> to copy a struct field. >> Struct metadata can contain nested structs. >> This extra metadata is added to the metadata file only if events use it. > Have you tried nesting structures into a sequence or array ? What > changes would be needed to support this ? No I haven't tried. And supporting this wouldn't be trivial. Sequences and arrays are associated with basic types (in the lttng_type struct) and use assign functions memcpy to assign the data. That supposes the elements of the array or sequence are sequential in memory themselves. That assumption does not work for struct (and variants), especially those whose fields are already not sequential (field-by-field copy, see comment below). Supporting that would mean changes to many of the structs in /lttng-events.h. And an extra level of macro to indicate how to loop for each element of the array or sequence. To illustrate, here is more or less what it could be like. TRACEPOINT_STRUCT(provider, name, TP_PROTO(struct foo *one, struct bar *loop), [...]) TRACE_EVENT([...], TP_STRUCT__entry( __array(STRUCT(provider, name, one, loop), arr_struct, 5) ), TP_fast_assign( tp_assign_array(arr_struct, one, TP_LOOP(loop)) // where loop[i] is a struct bar * ) ) > > More comments below, > >> Signed-off-by: Genevi?ve Bastien >> --- >> lttng-events.c | 166 ++++++++++++++++++++++++++++++++++- >> lttng-events.h | 44 ++++++++++ >> probes/lttng-events-reset.h | 15 ++++ >> probes/lttng-events.h | 206 ++++++++++++++++++++++++++++++++++++++++++-- >> 4 files changed, 421 insertions(+), 10 deletions(-) >> [...] >> diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h >> index 44e8ba5..dd60ca6 100644 >> --- a/probes/lttng-events-reset.h >> +++ b/probes/lttng-events-reset.h >> @@ -20,6 +20,9 @@ >> >> /* Reset macros used within TRACE_EVENT to "nothing" */ >> >> +#undef TRACE_METADATA >> +#define TRACE_METADATA 1 > What is TRACE_METADATA used for ? The type metadata macros must be enclosed between #ifdef TRACE_METADATA #endif, otherwise they are preprocessed in a first pass by the linux/include/tracepoint.h file and since those macros are not defined there they are copied as is and give error. > >> + >> #undef __field_full >> #define __field_full(_type, _item, _order, _base) >> >> @@ -35,6 +38,9 @@ >> #undef __string >> #define __string(_item, _src) >> >> +#undef __struct >> +#define __struct(_provider, _type, _item, _params) >> + >> #undef tp_assign >> #define tp_assign(dest, src) >> >> @@ -47,6 +53,9 @@ >> #undef tp_strcpy >> #define tp_strcpy(dest, src) >> >> +#undef tp_memcpy_struct >> +#define tp_memcpy_struct(provider, name, dest, src) >> + >> #undef __get_str >> #define __get_str(field) >> >> @@ -65,6 +74,9 @@ >> #undef TP_STRUCT__entry >> #define TP_STRUCT__entry(args...) >> >> +#undef TP_FIELDS >> +#define TP_FIELDS(args...) >> + >> #undef TP_fast_assign >> #define TP_fast_assign(args...) >> >> @@ -94,3 +106,6 @@ >> >> #undef TRACE_EVENT_FLAGS >> #define TRACE_EVENT_FLAGS(name, value) >> + >> +#undef TRACEPOINT_STRUCT >> +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) >> diff --git a/probes/lttng-events.h b/probes/lttng-events.h >> index 8a3a886..93f4abc 100644 >> --- a/probes/lttng-events.h >> +++ b/probes/lttng-events.h >> @@ -263,9 +263,31 @@ void trace_##_name(void *__data); >> #define __string_from_user(_item, _src) \ >> __string(_item, _src) >> >> +#undef __struct >> +#define __struct(_provider, _type, _item, _params) \ >> + { \ >> + .name = #_item, \ >> + .type = \ >> + { \ >> + .atype = atype_struct, \ >> + .u.ctf_struct.provider = #_provider, \ >> + .u.ctf_struct.name = #_type, \ >> + }, \ >> + }, >> + >> #undef TP_STRUCT__entry >> #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ >> >> +#undef TP_FIELDS >> +#define TP_FIELDS(args...) args /* Only one used in this phase */ >> + >> +#undef TRACEPOINT_STRUCT >> +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ >> + static const struct lttng_event_field \ >> + __struct_fields___##_provider##_##_name[] = { \ >> + _fields \ >> + }; >> + >> #undef DECLARE_EVENT_CLASS_NOARGS >> #define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ >> static const struct lttng_event_field __event_fields___##_name[] = { \ >> @@ -301,6 +323,74 @@ static void __event_probe__##_name(void *__data); >> #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) >> >> /* >> + * Stage 3.2 of the trace events. >> + * >> + * Create type metadata description >> + */ >> + >> +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ >> + >> +#undef TRACEPOINT_STRUCT >> +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ >> +static struct lttng_struct_desc __struct_desc___##_provider##_##_name = {\ >> + .fields = __struct_fields___##_provider##_##_name, \ >> + .nr_fields = ARRAY_SIZE(__struct_fields___##_provider##_##_name),\ >> + .provider = #_provider, \ >> + .name = #_name, \ >> + .owner = THIS_MODULE, \ >> + }; >> + >> +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) >> + >> +/* >> + * Stage 3.3 of the trace events. >> + * >> + * Associate metadata description to event or event template or other struct >> + */ >> + >> +/* Named field types must be defined in lttng-types.h */ >> + >> +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ >> + >> +#undef __struct >> +#define __struct(_provider, _type, _item, _params) \ >> + { \ >> + .mtype = mtype_struct, \ >> + .m.ctf_st.struct_desc = &__struct_desc___##_provider##_##_type,\ >> + .m.ctf_st.type_metadata = __type_metadata_for__##_provider##_##_type,\ >> + .m.ctf_st.nr_metadata = ARRAY_SIZE(__type_metadata_for__##_provider##_##_type),\ >> + }, >> + >> + >> +#undef TP_STRUCT__entry >> +#define TP_STRUCT__entry(args...) args /* Only one used in this phase */ >> + >> +#undef TP_FIELDS >> +#define TP_FIELDS(args...) args >> + >> +#undef TRACEPOINT_STRUCT >> +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields) \ >> +static const struct lttng_metadata __type_metadata_for__##_provider##_##_name[] = {\ >> + _fields \ >> +}; >> + >> + >> + >> +#undef DECLARE_EVENT_CLASS_NOARGS >> +#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ >> +static const struct lttng_metadata __type_metadata_for__##_name[] = { \ >> + _tstruct \ >> +}; >> + >> +#undef DECLARE_EVENT_CLASS >> +#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ >> + DECLARE_EVENT_CLASS_NOARGS(_name, PARAMS(_tstruct), PARAMS(_assign), \ >> + PARAMS(_print)) >> + >> +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) >> + >> + >> +/* >> * Stage 3.9 of the trace events. >> * >> * Create event descriptions. >> @@ -318,9 +408,11 @@ static void __event_probe__##_name(void *__data); >> #define DEFINE_EVENT_MAP_NOARGS(_template, _name, _map) \ >> static const struct lttng_event_desc __event_desc___##_map = { \ >> .fields = __event_fields___##_template, \ >> + .type_metadata = __type_metadata_for__##_template, \ >> .name = #_map, \ >> .probe_callback = (void *) TP_PROBE_CB(_template), \ >> .nr_fields = ARRAY_SIZE(__event_fields___##_template), \ >> + .nr_metadata = ARRAY_SIZE(__type_metadata_for__##_template), \ >> .owner = THIS_MODULE, \ >> }; >> >> @@ -379,9 +471,12 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { >> #undef TP_ID >> >> /* >> - * Stage 6 of the trace events. >> + * Stage 6.0 of the trace events. >> * >> * Create static inline function that calculates event size. >> + * >> + * First stage creates function to calculate sizes of sub-metadata >> + * (with no effect on the dynamic length values) > This approach seems to only consider the case where you memcpy a struct > directly into the buffers, no ? Indeed this is the implemented case here (and the easiest for a start). It is useful when what you want is to copy a C struct and have its fields available directly in the metadata. For this case, I'll change the macro name to TRACEPOINT_STRUCT_RAW to indicate that it is just field description, no field-by-field copy. > > How does it deal with copying field-by-field into the structure's fields ? The TRACEPOINT_STRUCT macro should do it by adding an extra argument: TP_fast_assign that would be like the one for the events. A function would be created for it, similar to __event_probe__#_eventname and would be called by the macro tp_struct_assign(...) inside a TP_fast_assign. That extension should be fairly easy to implement. But I wouldn't do it in the scope of this patch. > > On a different point, I see nothing here that documents where/how > recursion that could happen by nesting an array within itself is > handled. I will add those comments where necessary. Thanks, Genevi?ve [...] From matthew.khouzam at ericsson.com Mon Apr 22 11:51:33 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Mon, 22 Apr 2013 11:51:33 -0400 Subject: [lttng-dev] [RFC PATCH 0/2] babeltrace legacy LTT 2.6 converter In-Reply-To: <20130422125536.GA8755@hal> References: <51715CCB.90009@ericsson.com> <20130422125536.GA8755@hal> Message-ID: <51755C85.3070803@ericsson.com> On 13-04-22 08:55 AM, Jan Glauber wrote: > On Fri, Apr 19, 2013 at 11:03:39AM -0400, Matthew Khouzam wrote: >> Hi Jan, >> >> I have a few questions about the patch: >> Does it handle lost events? >> I think we would need to bring in a state system for this > Hi Matthew, > > Not sure what you mean there. I thought lost events are not recorded so there is > nothing to convert. What I do convert is the events_lost counter of LTT. The > value is copied to the events_discarded of LTTng. At least that looked reasonable > to me. Can you elaborate why we would need a state machine there? In lttv, the control flow view and company needs a state system. The events in lttng 0.x and 2.0 are slightly different, so we won't see stuff like the current TID and file statuses. I'm just giving you the heads up that it may be not so trivial to get the info. The best thing to do IMO is look up events in LTTng 2.0 and try to match the ones you have in babeltrace to them. That way, it will work with lttv and eclipse. I honestly feel I am being unclear, don't hesitate to ask for more precisions. > >> Is there a reason lttng2.0 is not working for you? kernel? install base? >> other? > The reason is that we have multiple install bases and some are on LTT with no > option of upgrading them to LTTng. > >> Do you want just a list of the events or analysis on the trace later on. > We would like to analyse traces from different sources with Eclipse and > especially using the CTF classes. > >> Can you post an example of a converted trace? > Sure, here's a short snapshot of the converted trace viewed with babeltrace, > somewhere in the middle of a not too spectacular trace but at least with events > from some different components: > > [10:42:48.534746510] (+0.000001741) none kernel_syscall_entry: { cpu_id = 1 }, { ip = 716048728, syscall_id = 263 } > [10:42:48.534748034] (+0.000001524) none fs_pollfd: { cpu_id = 0 }, { fd = 27 } > [10:42:48.534748132] (+0.000000098) none kernel_syscall_exit: { cpu_id = 1 }, { ret = 0 } > [10:42:48.534751362] (+0.000003230) none fs_pollfd: { cpu_id = 0 }, { fd = 28 } > [10:42:48.534754469] (+0.000003107) none fs_pollfd: { cpu_id = 0 }, { fd = 29 } > [10:42:48.534757482] (+0.000003013) none fs_pollfd: { cpu_id = 0 }, { fd = 20 } > [10:42:48.534761354] (+0.000003872) none fs_pollfd: { cpu_id = 0 }, { fd = 22 } > [10:42:48.534764045] (+0.000002691) none fs_pollfd: { cpu_id = 0 }, { fd = 30 } > [10:42:48.534767272] (+0.000003227) none fs_pollfd: { cpu_id = 0 }, { fd = 31 } > [10:42:48.534770512] (+0.000003240) none fs_pollfd: { cpu_id = 0 }, { fd = 32 } > [10:42:48.534774102] (+0.000003590) none fs_pollfd: { cpu_id = 0 }, { fd = 33 } > [10:42:48.534777510] (+0.000003408) none fs_pollfd: { cpu_id = 0 }, { fd = 35 } > [10:42:48.534781767] (+0.000004257) none fs_pollfd: { cpu_id = 0 }, { fd = 36 } > [10:42:48.534785282] (+0.000003515) none fs_pollfd: { cpu_id = 0 }, { fd = 37 } > [10:42:48.534788669] (+0.000003387) none fs_pollfd: { cpu_id = 0 }, { fd = 34 } > [10:42:48.534791977] (+0.000003308) none fs_pollfd: { cpu_id = 0 }, { fd = 38 } > [10:42:48.534795069] (+0.000003092) none fs_pollfd: { cpu_id = 0 }, { fd = 39 } > [10:42:48.534798194] (+0.000003125) none fs_pollfd: { cpu_id = 0 }, { fd = 40 } > [10:42:48.534801197] (+0.000003003) none fs_pollfd: { cpu_id = 0 }, { fd = 41 } > [10:42:48.534804389] (+0.000003192) none fs_pollfd: { cpu_id = 0 }, { fd = 42 } > [10:42:48.534807827] (+0.000003438) none fs_pollfd: { cpu_id = 0 }, { fd = 43 } > [10:42:48.534811137] (+0.000003310) none fs_pollfd: { cpu_id = 0 }, { fd = 44 } > [10:42:48.534814215] (+0.000003078) none fs_pollfd: { cpu_id = 0 }, { fd = 45 } > [10:42:48.534817354] (+0.000003139) none fs_pollfd: { cpu_id = 0 }, { fd = 46 } > [10:42:48.534820489] (+0.000003135) none fs_pollfd: { cpu_id = 0 }, { fd = 47 } > [10:42:48.534823479] (+0.000002990) none fs_pollfd: { cpu_id = 0 }, { fd = 48 } > [10:42:48.534826875] (+0.000003396) none fs_pollfd: { cpu_id = 0 }, { fd = 49 } > [10:42:48.534830315] (+0.000003440) none fs_pollfd: { cpu_id = 0 }, { fd = 50 } > [10:42:48.534834449] (+0.000004134) none fs_pollfd: { cpu_id = 0 }, { fd = 51 } > [10:42:48.534837717] (+0.000003268) none fs_pollfd: { cpu_id = 0 }, { fd = 52 } > [10:42:48.534841064] (+0.000003347) none fs_pollfd: { cpu_id = 0 }, { fd = 53 } > [10:42:48.534844754] (+0.000003690) none fs_pollfd: { cpu_id = 0 }, { fd = 54 } > [10:42:48.534849177] (+0.000004423) none fs_pollfd: { cpu_id = 0 }, { fd = 55 } > [10:42:48.534892997] (+0.000043820) none mm_page_free: { cpu_id = 0 }, { pfn = 158205, order = 0 } > [10:42:48.534993555] (+0.000100558) none kernel_syscall_entry: { cpu_id = 1 }, { ip = 716868028, syscall_id = 296 } > [10:42:48.535000284] (+0.000006729) none net_socket_recvmsg: { cpu_id = 0 }, { sock = 0xB5F324E0, msg = 0x983FFF74, size = 2048, flags = 1073741888, ret = 660 } > [10:42:48.535011094] (+0.000010810) none net_socket_sendmsg: { cpu_id = 1 }, { sock = 0xB5CE8B20, msg = 0xB6031F74, size = 463, ret = 463 } > [10:42:48.535013404] (+0.000002310) none kernel_syscall_exit: { cpu_id = 1 }, { ret = 463 } > [10:42:48.535202519] (+0.000189115) none net_socket_recvmsg: { cpu_id = 0 }, { sock = 0xB5F324E0, msg = 0x983FFF74, size = 2048, flags = 1073741888, ret = -11 } > [10:42:48.535231537] (+0.000029018) none kernel_sched_try_wakeup: { cpu_id = 1 }, { pid = 68, cpu_id = 1, state = 256 } > [10:42:48.535243069] (+0.000011532) none kernel_sched_schedule: { cpu_id = 1 }, { prev_pid = 1, next_pid = 68, prev_state = 0 } > [10:42:48.535258092] (+0.000015023) none fs_pollfd: { cpu_id = 1 }, { fd = 5 } > [10:42:48.535264639] (+0.000006547) none fs_pollfd: { cpu_id = 1 }, { fd = 9 } > [10:42:48.535269929] (+0.000005290) none kernel_syscall_exit: { cpu_id = 1 }, { ret = 1 } > [10:42:48.535278789] (+0.000008860) none kernel_syscall_entry: { cpu_id = 1 }, { ip = 717849364, syscall_id = 3 } > [10:42:48.535299225] (+0.000020436) none fs_read: { cpu_id = 1 }, { count = 1, fd = 9 } > [10:42:48.535300645] (+0.000001420) none kernel_syscall_exit: { cpu_id = 1 }, { ret = 0 } > [10:42:48.535306709] (+0.000006064) none kernel_syscall_entry: { cpu_id = 1 }, { ip = 717837844, syscall_id = 240 } > [10:42:48.535309234] (+0.000002525) none fs_ioctl: { cpu_id = 0 }, { fd = 4, cmd = 1075866368, arg = 745629032 } > [10:42:48.535324412] (+0.000015178) none kernel_sched_migrate_task: { cpu_id = 1 }, { pid = 67, state = 256, dest_cpu = 0 } > [10:42:48.535331534] (+0.000007122) none kernel_syscall_exit: { cpu_id = 1 }, { ret = 1 } > [10:42:48.535335210] (+0.000003676) none kernel_syscall_entry: { cpu_id = 1 }, { ip = 718693652, syscall_id = 168 } > > Regards, > Jan > >> Thanks >> Matthew >> >> >> On 13-04-19 06:20 AM, Jan Glauber wrote: >>> Hi list, >>> >>> I've written a converter that can read LTT's 2.6 trace format and convert it >>> to a CTF trace format. This was discussed before on the list: >>> >>> http://lists.lttng.org/pipermail/lttng-dev/2011-June/015995.html >>> >>> and I roughly followed the guidance given by Mathieu there. Roughly because >>> I did not create plugins but followed the approach of babeltrace-log. >>> >>> How it works: >>> - babeltrace legacy converter gets a directory containing a LTT 2.6 trace >>> and a target directory where it will create the converted trace >>> - it scans the metadata_N files and creates a CTF which fits the old trace data >>> - it scans all trace files and creates CTF headers but copies the trace data >>> - empty files which contain only headers are not copied >>> >>> Is there any interest in picking up this code for babeltrace (or is it just >>> too obscure :) ? >>> >>> Best regards, >>> >>> Jan Glauber >>> Harman Becker Automotive GmbH >>> System Profiling & Optimizing Team >>> >>> Jan Glauber (2): >>> Resurrect LTT type parser >>> babeltrace legacy LTT 2.6 -> CTF 1.8 converter >>> >>> converter/babeltrace-legacy.c | 1184 ++++++++++++++++++++++++++++++++++ >>> converter/ltt-type-parser.c | 303 +++++++++ >>> include/babeltrace/ltt-type-parser.h | 17 + >>> 3 files changed, 1504 insertions(+) >>> create mode 100644 converter/babeltrace-legacy.c >>> create mode 100644 converter/ltt-type-parser.c >>> create mode 100644 include/babeltrace/ltt-type-parser.h >>> >> >> _______________________________________________ >> 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 Mon Apr 22 11:55:59 2013 From: yannick.brosseau at gmail.com (Yannick Brosseau) Date: Mon, 22 Apr 2013 11:55:59 -0400 Subject: [lttng-dev] [RFC PATCH 0/2] babeltrace legacy LTT 2.6 converter In-Reply-To: <51755C85.3070803@ericsson.com> References: <51715CCB.90009@ericsson.com> <20130422125536.GA8755@hal> <51755C85.3070803@ericsson.com> Message-ID: <51755D8F.7070304@gmail.com> On 2013-04-22 11:51, Matthew Khouzam wrote: > On 13-04-22 08:55 AM, Jan Glauber wrote: >> On Fri, Apr 19, 2013 at 11:03:39AM -0400, Matthew Khouzam wrote: >>> Hi Jan, >>> >>> I have a few questions about the patch: >>> Does it handle lost events? >>> I think we would need to bring in a state system for this >> Hi Matthew, >> >> Not sure what you mean there. I thought lost events are not recorded so there is >> nothing to convert. What I do convert is the events_lost counter of LTT. The >> value is copied to the events_discarded of LTTng. At least that looked reasonable >> to me. Can you elaborate why we would need a state machine there? > In lttv, the control flow view and company needs a state system. The > events in lttng 0.x and 2.0 are slightly different, so we won't see > stuff like the current TID and file statuses. I'm just giving you the > heads up that it may be not so trivial to get the info. The best thing > to do IMO is look up events in LTTng 2.0 and try to match the ones you > have in babeltrace to them. > That way, it will work with lttv and eclipse. > I'm not sure either that I understand what you mean. The goal is just to convert traces, not create a whole state system. When we will be able to get a converted trace, the viewers could adjust to support them. Yannick From mathieu.desnoyers at efficios.com Mon Apr 22 12:14:42 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 22 Apr 2013 12:14:42 -0400 Subject: [lttng-dev] Fwd: Bug#705827: babeltrace: FTBFS on GNU/kFreeBSD In-Reply-To: <20130422152417.GA13418@quintessa> References: <20130422152417.GA13418@quintessa> Message-ID: <20130422161442.GA17918@Krystal> Fixed by: commit 493330cb8cd73be8a598308b78f0fc1d4912843a Author: Mathieu Desnoyers Date: Mon Apr 22 12:12:50 2013 -0400 Fix kFreeBSD build Use general error numbers available on kFreeBSD. Reported-by: Petr Salinger Signed-off-by: Mathieu Desnoyers Thanks for reporting, Mathieu * Jon Bernard (jbernard at debian.org) wrote: > Hello all, I received this request over the weekend and wanted to pass it on. > > ----- Forwarded message from Petr Salinger ----- > > Date: Sat, 20 Apr 2013 19:19:11 +0200 (CEST) > From: Petr Salinger > To: submit at bugs.debian.org > Subject: Bug#705827: babeltrace: FTBFS on GNU/kFreeBSD > > Package: babeltrace > Version: 1.1.0-1 > Severity: serious > Tags: patch > User: debian-bsd at lists.debian.org > Usertags: kfreebsd > > Hi, > > the current version fails to build on GNU/kFreeBSD. > > The value ENODATA is linux specific, > please use some general error number, like shown bellow. > > It would also be nice if you can inform upstream about this. > > Thanks > Petr > > --- formats/ctf/ctf.c > +++ formats/ctf/ctf.c > @@ -1032,7 +1032,7 @@ > buflen = strlen(*buf); > if (!buflen) { > *fp = NULL; > - return -ENODATA; > + return -ENOENT; > } > *fp = babeltrace_fmemopen(*buf, buflen, "rb"); > if (!*fp) { > > ----- End forwarded message ----- > > -- > 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 soariez at gmail.com Mon Apr 22 12:44:18 2013 From: soariez at gmail.com (Zifei Tong) Date: Tue, 23 Apr 2013 00:44:18 +0800 Subject: [lttng-dev] [PATCH lttng-ust] Fix: make hello.cxx compile with g++ Message-ID: <1366649058-9848-1-git-send-email-soariez@gmail.com> > +#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 From christian.babeux at efficios.com Mon Apr 22 20:29:50 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Mon, 22 Apr 2013 20:29:50 -0400 Subject: [lttng-dev] Maintenance downtime of ci.lttng.org Message-ID: Hi all, Just a heads up that we will be taking down the continuous infrastructure host at ci.lttng.org beginning at 10 pm (Eastern time) tonight for maintenance. The host should come back online tomorrow (April 23) as soon as possible. Thanks, Christian From jan.glauber at gmail.com Tue Apr 23 08:14:03 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Tue, 23 Apr 2013 14:14:03 +0200 Subject: [lttng-dev] [RFC PATCH 0/2] babeltrace legacy LTT 2.6 converter In-Reply-To: <51755D8F.7070304@gmail.com> References: <51715CCB.90009@ericsson.com> <20130422125536.GA8755@hal> <51755C85.3070803@ericsson.com> <51755D8F.7070304@gmail.com> Message-ID: <20130423121401.GA14913@hal> On Mon, Apr 22, 2013 at 11:55:59AM -0400, Yannick Brosseau wrote: > On 2013-04-22 11:51, Matthew Khouzam wrote: > > On 13-04-22 08:55 AM, Jan Glauber wrote: > >> On Fri, Apr 19, 2013 at 11:03:39AM -0400, Matthew Khouzam wrote: > >>> Hi Jan, > >>> > >>> I have a few questions about the patch: > >>> Does it handle lost events? > >>> I think we would need to bring in a state system for this > >> Hi Matthew, > >> > >> Not sure what you mean there. I thought lost events are not recorded so there is > >> nothing to convert. What I do convert is the events_lost counter of LTT. The > >> value is copied to the events_discarded of LTTng. At least that looked reasonable > >> to me. Can you elaborate why we would need a state machine there? > > In lttv, the control flow view and company needs a state system. The > > events in lttng 0.x and 2.0 are slightly different, so we won't see > > stuff like the current TID and file statuses. I'm just giving you the > > heads up that it may be not so trivial to get the info. The best thing > > to do IMO is look up events in LTTng 2.0 and try to match the ones you > > have in babeltrace to them. > > That way, it will work with lttv and eclipse. > > > I'm not sure either that I understand what you mean. > > The goal is just to convert traces, not create a whole state system. > When we will be able to get a converted trace, the viewers could adjust > to support them. Yannick is right, these patches are just for converting the raw trace data. Interpreting the converted trace data is then up to LTTV or Eclipse. Conversion of the trace data to the concrete CTF description LTTng 2.x is using would be quite hard and require also to convert the trace data itself (which I avoided so far...). -- Jan > Yannick -- Jan Glauber --- Harman Becker Automotive GmbH System Profiling & Optimizing Team From yannick.brosseau at gmail.com Tue Apr 23 08:39:06 2013 From: yannick.brosseau at gmail.com (Yannick Brosseau) Date: Tue, 23 Apr 2013 08:39:06 -0400 Subject: [lttng-dev] GSoC 2013 idea: support a new language binding for lttng In-Reply-To: References: Message-ID: <517680EA.50203@gmail.com> On 2013-04-15 10:25, Xiaona Han wrote: > Hi Yannick > Thanks for your encouragement. I take a quick look at the source > code of lttng and find that lttng-tools has python bindings code. It > means that support Lua bindings mainly need finish the code, > documentations and tests for the lttng-tools. What about babeltrace? > Do we need support Lua bindings for babeltrace APIs in this project? Hi Xiaona, I taken a look at your proposal for GSoC. As you say here, looking at the babeltrace API could also be interesting and could fit very well in the time frame. Last year, we had an intern doing the binding for Python and i fitted well in 4 months. I would also suggest, that you add some exploration for the addition of UST tracepoint to the lua language. This one is probably more complicated, so it might be added to the description as an additionnal item if time permit. Yannick From hrshtagrawal14 at gmail.com Tue Apr 23 07:31:37 2013 From: hrshtagrawal14 at gmail.com (harshit agrawal) Date: Tue, 23 Apr 2013 17:01:37 +0530 Subject: [lttng-dev] GSOC -2013 Project Discussion Message-ID: *Student- Harshit Agrawal* * * *Project Interested- ANDROID PORT* *University- Uttar Pradesh Technical University* Hello sir,* * Hope you are doing well. I am a student of graduation final year in India(Delhi). During my graduation i have completed many projects based on technology like* java, Javascript, html and android,struts,c++and python. *I have also done projects for Microsoft as i am Microsoft student partner in India. I have developed mobile applications also that are currently published on google play and blackberry mobile store also. I have developed applications- *Droid Camera*- https://play.google.com/store/apps/details?id=com.appworld.cameraeffects *Why Open Source*-First I like the Open Source software model and I believe in it, and I am also interested in security, so mixing open source with security will be really cool for me and getting paid for open source development will be a dream, and let me tell you that I have abandoned my previous work (which uses android, Windows ... etc) and I have returned to the university to a have a chance to work in the open source field by doing open source embedded development and security research. Sir, I am keen interested in this project as this project suits my technical skills and it will be a part of honor to me to be a part of such open source contribution with your organization. *About the security tool- * - *Improve startup time*. We can use AsyncTask so that many services and activities can run in background while start up - *Reduce runtime size.*We can make data of .class file as more time efficient and compact so that while shipping to the devices it will take lesser time than previous. - *Straight-line performance.* For this we can minimize the resources taken by the application. so that it can be environmental friendly for maximum android devices. - *JIT compilation*.JIT builds upon two earlier ideas in run-time environments: bytecode compilation and dynamic compilation. It converts code at runtime prior to executing it natively, for example bytecode into native machine code. so that we can use jit compliation for faster execution of program. - *AOT compilation.* AOT in most cases produces machine optimized code, just like a 'standard' native compiler. AOT compilation is mostly beneficial in cases where the interpreter (which is small) is too slow or JIT is too complex or introduces undesirable latencies. so that we can use this for better and faster execution. I am keen interested in this project so please review my application for further work. Hoping for a positive reply Thankyou Regards- Harshit Agrawal -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.khouzam at ericsson.com Tue Apr 23 11:05:16 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Tue, 23 Apr 2013 11:05:16 -0400 Subject: [lttng-dev] [Announcement][Eclipse viewer][CTF] Better error messages Message-ID: <5176A32C.5050009@ericsson.com> Hi tracing luchadores and luchadorettes, this is a small feature but I know some of you are making your own CTF traces. I am just giving a heads up that the eclipse viewer as of yesterday has improved error messages. The messages before: "The trace was invalid" Now: General "File not found: xxx" General "xxx is not a directory, expecting a directory" General "xxx is not a file, expecting a file" TSDL "Mismatched token: expecting X, found Y on line ###" TSDL "Only one trace block is allowed" TSDL "Missing trace block" TSDL "Trace byte order not set" TSDL "Left side of CTF assignment must be a string" ... Sorry, this list is rather exhaustive. You can get it on the nightly builds for eclipse, or in a few months in the Kepler release. From matthew.khouzam at ericsson.com Tue Apr 23 11:38:34 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Tue, 23 Apr 2013 11:38:34 -0400 Subject: [lttng-dev] Java code for CTF trace writing? In-Reply-To: References: Message-ID: <5176AAFA.8060905@ericsson.com> Hi all, Just to mention, everything Philippe said was 100% true, we just right now are too stretched to add the trace writer to eclipse. It will be integrated fairly soon, I think. Matt On 13-04-15 06:01 PM, Philippe Proulx wrote: > Actually, that was the exact purpose of my internship at Ericsson last summer. > > I designed a new architecture for the CTF part of TMF, but it is still > not merged/integrated with mainline TMF (I don't even know if it's > still planned). See > . > > This new architecture is able to read _and write_ CTF packets in a > generic way. The "Javeltrace" name is just a portmanteau of Java and > Babeltrace, although should this refined library be integrated into > TMF, it's not planned to be named like this. However, there exist a > command-line tool that I made which is officially named Javeltrace and > uses the aforementioned library. It is described here: > . As explained on > the webpage, the main goal of this utility is to test my work > interactively. > > Keep in mind that everything mentioned here is not thoroughly tested > and for sure there are a few bugs remaining. Also, the code didn't > evolve with the latest CTF versions, so there must be incompatibility > at some level. > > The main use case at Ericsson was to synthesize a precise fake trace > from scratch using a human readable input format that could be > versioned. The generated CTF traces would then be used to exercise > parts of TMF to test specific behaviours without having to produce an > actual real trace. After a few discussions, we chose JSON as an > interchange format. So you will see lots of JSON related code out > there. The command-line Javeltrace utility is able to translate > from/to binary CTF. > > At the end of my internship, I started writing docs for what I did. > It's here: . > It's not finished, but almost, so it should be up-to-date with my Git > codebase. > > I also made this as a proof of concept: > > (see all Mug*.java files). MugTracer is a simple Java tracer that > produces native CTF without even using the rest of my library since > CTF is so easy to *write*. It has a consumer thread and worked well, > although I didn't run any benchmark and I believe it's really slow > compared to UST. > > Feel free to contact me, should you have any question about this. > > On 15 April 2013 17:14, Aaron Spear wrote: >> Hi all, >> >> I was wondering if anyone knew of some open source Java library that could WRITE CTF traces? I am using the linuxtools/TMF plugins to read CTF traces, but now need to write them from Java as well. >> >> I have a use case where I have an "event bus" in the Java app world and I would like to persist this event stream as a CTF trace. In this particular use case, the speed/low intrusiveness of LTTng UST is not as important as the portability, so a pure Java solution is ideal, though not strictly required. >> >> Also, please let me know if there are others out there who are interested in collaborating in writing such a library. >> >> regards, >> Aaron Spear >> >> _______________________________________________ >> 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 osdepend at gmail.com Tue Apr 23 12:50:16 2013 From: osdepend at gmail.com (OSDepend) Date: Wed, 24 Apr 2013 00:50:16 +0800 Subject: [lttng-dev] kprobe timestamp Message-ID: <201304240050144491467@gmail.com> 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? I'm a little confused, please help me out! Best, Chen 2013-04-24 zhengchen -------------- next part -------------- An HTML attachment was scrubbed... URL: From aspear at vmware.com Tue Apr 23 14:21:37 2013 From: aspear at vmware.com (Aaron Spear) Date: Tue, 23 Apr 2013 11:21:37 -0700 (PDT) Subject: [lttng-dev] Java code for CTF trace writing? In-Reply-To: <5176AAFA.8060905@ericsson.com> References: <5176AAFA.8060905@ericsson.com> Message-ID: <1962635283.7490228.1366741297558.JavaMail.root@vmware.com> ----- Original Message ----- > Hi all, > Just to mention, everything Philippe said was 100% true, we just right > now are too stretched to add the trace writer to eclipse. It will be > integrated fairly soon, I think. > Matt Hi Matthew, Sounds very good, do you have a ball park estimate when "fairly soon" is? Also, who is planning to do the work? I would be happy to assist if I can. As I at least implied, I am happy to collaborate on this. Right now my prototype is writing out events to a text log file, which is vastly less than ideal. In short order I am going to need to be able to do two things: 1) write CTF traces from Java code 2) be able to append to this trace dynamically while it is being analyzed. Ideally the view registers a listener with the model and perhaps also specifying some hysteresis (so it is notified on a block of events, not every event), and then when it is notified it can update (optionally subject to an "update policy" selected in the view, as is often done with debugging) cheers, Aaron From stefan at codesourcery.com Tue Apr 23 13:44:48 2013 From: stefan at codesourcery.com (Stefan Seefeld) Date: Tue, 23 Apr 2013 13:44:48 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Add --with-lttng-ust-prefix config option. Message-ID: <5176C890.6060607@codesourcery.com> 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 ]] ) +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] ) ]) -- 1.8.1.4 -- Stefan Seefeld CodeSourcery / Mentor Graphics stefan at codesourcery.com From yannick.brosseau at gmail.com Tue Apr 23 14:40:08 2013 From: yannick.brosseau at gmail.com (Yannick Brosseau) Date: Tue, 23 Apr 2013 14:40:08 -0400 Subject: [lttng-dev] kprobe timestamp In-Reply-To: <201304240050144491467@gmail.com> References: <201304240050144491467@gmail.com> Message-ID: <5176D588.5010307@gmail.com> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.khouzam at ericsson.com Tue Apr 23 14:39:18 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Tue, 23 Apr 2013 14:39:18 -0400 Subject: [lttng-dev] Java code for CTF trace writing? In-Reply-To: <1962635283.7490228.1366741297558.JavaMail.root@vmware.com> References: <5176AAFA.8060905@ericsson.com> <1962635283.7490228.1366741297558.JavaMail.root@vmware.com> Message-ID: <5176D556.8040801@ericsson.com> On 13-04-23 02:21 PM, Aaron Spear wrote: > > ----- Original Message ----- >> Hi all, >> Just to mention, everything Philippe said was 100% true, we just right >> now are too stretched to add the trace writer to eclipse. It will be >> integrated fairly soon, I think. >> Matt > Hi Matthew, > > Sounds very good, do you have a ball park estimate when "fairly soon" is? I will probably start after the feature freeze in eclipse. June sounds +- right. > > Also, who is planning to do the work? I would be happy to assist if I can. Me probably. ;) > > As I at least implied, I am happy to collaborate on this. Right now my prototype is writing out events to a text log file, which is vastly less than ideal. In short order I am going to need to be able to do two things: > > 1) write CTF traces from Java code Same objective here. > 2) be able to append to this trace dynamically while it is being analyzed. Ideally the view registers a listener with the model and perhaps also specifying some hysteresis (so it is notified on a block of events, not every event), and then when it is notified it can update (optionally subject to an "update policy" selected in the view, as is often done with debugging) We don't support "Live" trace reading yet. I'm not saying it won't work, but it has not been tested. When would you be available to work on this feature, I would love to sync up our efforts for this. > > cheers, > Aaron From aspear at vmware.com Tue Apr 23 16:50:33 2013 From: aspear at vmware.com (Aaron Spear) Date: Tue, 23 Apr 2013 13:50:33 -0700 (PDT) Subject: [lttng-dev] Java code for CTF trace writing? In-Reply-To: <5176D556.8040801@ericsson.com> References: <5176AAFA.8060905@ericsson.com> <1962635283.7490228.1366741297558.JavaMail.root@vmware.com> <5176D556.8040801@ericsson.com> Message-ID: <1218416875.7614701.1366750233878.JavaMail.root@vmware.com> > 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 From matthew.khouzam at ericsson.com Tue Apr 23 17:11:33 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Tue, 23 Apr 2013 17:11:33 -0400 Subject: [lttng-dev] [RFC PATCH 0/2] babeltrace legacy LTT 2.6 converter In-Reply-To: <20130423121401.GA14913@hal> References: <51715CCB.90009@ericsson.com> <20130422125536.GA8755@hal> <51755C85.3070803@ericsson.com> <51755D8F.7070304@gmail.com> <20130423121401.GA14913@hal> Message-ID: <5176F905.4040109@ericsson.com> No problems here. I was inquiring about this so that nobody is surprised if all trace viewers features are not supported. On 13-04-23 08:14 AM, Jan Glauber wrote: > On Mon, Apr 22, 2013 at 11:55:59AM -0400, Yannick Brosseau wrote: >> On 2013-04-22 11:51, Matthew Khouzam wrote: >>> On 13-04-22 08:55 AM, Jan Glauber wrote: >>>> On Fri, Apr 19, 2013 at 11:03:39AM -0400, Matthew Khouzam wrote: >>>>> Hi Jan, >>>>> >>>>> I have a few questions about the patch: >>>>> Does it handle lost events? >>>>> I think we would need to bring in a state system for this >>>> Hi Matthew, >>>> >>>> Not sure what you mean there. I thought lost events are not recorded so there is >>>> nothing to convert. What I do convert is the events_lost counter of LTT. The >>>> value is copied to the events_discarded of LTTng. At least that looked reasonable >>>> to me. Can you elaborate why we would need a state machine there? >>> In lttv, the control flow view and company needs a state system. The >>> events in lttng 0.x and 2.0 are slightly different, so we won't see >>> stuff like the current TID and file statuses. I'm just giving you the >>> heads up that it may be not so trivial to get the info. The best thing >>> to do IMO is look up events in LTTng 2.0 and try to match the ones you >>> have in babeltrace to them. >>> That way, it will work with lttv and eclipse. >>> >> I'm not sure either that I understand what you mean. >> >> The goal is just to convert traces, not create a whole state system. >> When we will be able to get a converted trace, the viewers could adjust >> to support them. > Yannick is right, these patches are just for converting the raw trace data. > Interpreting the converted trace data is then up to LTTV or Eclipse. > > Conversion of the trace data to the concrete CTF description LTTng 2.x is > using would be quite hard and require also to convert the trace data itself > (which I avoided so far...). > > -- Jan > > >> Yannick From stefan at codesourcery.com Tue Apr 23 17:14:57 2013 From: stefan at codesourcery.com (Stefan Seefeld) Date: Tue, 23 Apr 2013 17:14:57 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Add --version command-line option to lttng. Message-ID: <5176F9D1.8010907@codesourcery.com> This patch adds a --version option to the 'lttng' tool, making it easier for users to check the version, and with that, the set of features supported. (It would also be useful to canonicalize and document the version string grammar so it can be easily parsed and converted to a numeric value for comparison.) Signed-off-by: Stefan Seefeld --- src/bin/lttng/lttng.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng/lttng.c b/src/bin/lttng/lttng.c index 79a28ba..3848a0d 100644 --- a/src/bin/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -47,6 +47,7 @@ enum { /* Getopt options. No first level command. */ static struct option long_options[] = { + {"version", 0, NULL, 'V'}, {"help", 0, NULL, 'h'}, {"group", 1, NULL, 'g'}, {"verbose", 0, NULL, 'v'}, @@ -85,6 +86,7 @@ static void usage(FILE *ofp) fprintf(ofp, "usage: lttng [OPTIONS] []\n"); fprintf(ofp, "\n"); fprintf(ofp, "Options:\n"); + fprintf(ofp, " -V, --version Show version\n"); fprintf(ofp, " -h, --help Show this help\n"); fprintf(ofp, " --list-options Simple listing of lttng options\n"); fprintf(ofp, " --list-commands Simple listing of lttng commands\n"); @@ -116,6 +118,10 @@ static void usage(FILE *ofp) fprintf(ofp, "See http://lttng.org for updates, bug reports and news.\n"); } +static void version(FILE *ofp) +{ + fprintf(ofp, "lttng (LTTng Trace Control) " VERSION" - " VERSION_NAME"\n\n"); +} /* * list_options * @@ -426,8 +432,12 @@ static int parse_args(int argc, char **argv) clean_exit(EXIT_FAILURE); } - while ((opt = getopt_long(argc, argv, "+hnvqg:", long_options, NULL)) != -1) { + while ((opt = getopt_long(argc, argv, "+Vhnvqg:", long_options, NULL)) != -1) { switch (opt) { + case 'V': + version(stdout); + ret = 0; + goto end; case 'h': usage(stdout); ret = 0; -- 1.8.1.4 -- Stefan Seefeld CodeSourcery / Mentor Graphics stefan at codesourcery.com From osdepend at gmail.com Wed Apr 24 01:57:49 2013 From: osdepend at gmail.com (OSDepend) Date: Wed, 24 Apr 2013 13:57:49 +0800 Subject: [lttng-dev] kprobe timestamp References: <201304240050144491467@gmail.com>, <5176D588.5010307@gmail.com> Message-ID: <201304241357471345277@gmail.com> > 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? Best, Chen From soariez at gmail.com Wed Apr 24 11:45:59 2013 From: soariez at gmail.com (Zifei Tong) Date: Wed, 24 Apr 2013 23:45:59 +0800 Subject: [lttng-dev] GSoC 2013, "C++ probe support" project and more In-Reply-To: References: Message-ID: Hi Christian, On Sun, Apr 21, 2013 at 2:44 AM, Christian Babeux wrote: > The improvement of liblttng-ust-libc has nothing to do with dyninst. > Maybe you meant the dynamic instrumentation project? I played with dyninst today. Here is a minimal working example: https://gist.github.com/5kg/5451894 Dyninst is a really cool project (after struggling to get it work), and I am more confident that the "Dynamic instrumentation support in UST" project is doable as a GSoC project. The systemtap project is a great reference [1]. Expected results might be somthing like this: http://sourceware.org/systemtap/SystemTap_Beginners_Guide/userspace-probing.html . [1] http://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=tree;f=stapdyn;hb=HEAD [2] http://lists.lttng.org/pipermail/lttng-dev/2013-February/019636.html -- Best Regards, Zifei Tong From gbastien+lttng at versatic.net Wed Apr 24 16:14:15 2013 From: gbastien+lttng at versatic.net (=?UTF-8?q?Genevi=C3=A8ve=20Bastien?=) Date: Wed, 24 Apr 2013 16:14:15 -0400 Subject: [lttng-dev] [RFC-patch 0/5] Add support of more CTF metadata in lttng-modules Message-ID: <1366834460-25567-1-git-send-email-gbastien+lttng@versatic.net> Hi list, This series of patches add a few new macros to support the following CTF metadata: variants, structures and named enumerations. The use case it is applied to is to add packet header data to the net_* tracepoints, when available, for network protocol IP and IPv6 and transport protocol TCP. Best regards, Genevi?ve --------------------- Genevi?ve Bastien (5): Add support of struct metadata in tracepoints Add support of enum metadata in tracepoints Add support of variant metadata in tracepoints Add some extra data to net_* tracepoints Add macros to copy struct metadata field by field instrumentation/events/lttng-module/net.h | 244 +++++++++- lttng-events.c | 279 +++++++++++- lttng-events.h | 65 +++ probes/lttng-events-reset.h | 50 +++ probes/lttng-events.h | 712 ++++++++++++++++++++++++++++-- probes/lttng-type-list.h | 12 +- probes/lttng-types.h | 61 ++- 7 files changed, 1378 insertions(+), 45 deletions(-) -- 1.8.2.1 From gbastien+lttng at versatic.net Wed Apr 24 16:14:16 2013 From: gbastien+lttng at versatic.net (=?UTF-8?q?Genevi=C3=A8ve=20Bastien?=) Date: Wed, 24 Apr 2013 16:14:16 -0400 Subject: [lttng-dev] [RFC-patch 1/5] Add support of struct metadata in tracepoints In-Reply-To: <1366834460-25567-1-git-send-email-gbastien+lttng@versatic.net> References: <1366834460-25567-1-git-send-email-gbastien+lttng@versatic.net> Message-ID: <1366834460-25567-2-git-send-email-gbastien+lttng@versatic.net> Introduce the new macro TRACEPOINT_STRUCT_RAW to define ctf struct metadata that can be used by tracepoints using _struct as entry and tp_memcpy_struct to copy a struct field. Struct metadata can contain nested structs. This extra metadata is added to the metadata file only if events use it. Signed-off-by: Genevi?ve Bastien --- lttng-events.c | 168 ++++++++++++++++++++++++++++++++++- lttng-events.h | 44 +++++++++ probes/lttng-events-reset.h | 20 +++++ probes/lttng-events.h | 212 ++++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 434 insertions(+), 10 deletions(-) diff --git a/lttng-events.c b/lttng-events.c index 4f30904..fa92222 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -61,6 +61,7 @@ void synchronize_trace(void) struct lttng_session *lttng_session_create(void) { struct lttng_session *session; + int i; mutex_lock(&sessions_mutex); session = kzalloc(sizeof(struct lttng_session), GFP_KERNEL); @@ -70,6 +71,11 @@ struct lttng_session *lttng_session_create(void) INIT_LIST_HEAD(&session->events); uuid_le_gen(&session->uuid); list_add(&session->list, &sessions); + /* Initialize dumped metadata */ + for (i = 0; i < NR_METADATA_TYPES; i++) { + session->dumped_metadata[i].nr_metadata = 0; + session->dumped_metadata[i].next = 0; + } mutex_unlock(&sessions_mutex); return session; } @@ -78,7 +84,8 @@ void lttng_session_destroy(struct lttng_session *session) { struct lttng_channel *chan, *tmpchan; struct lttng_event *event, *tmpevent; - int ret; + struct lttng_metadata_dumped_data *dumped; + int ret, i; mutex_lock(&sessions_mutex); ACCESS_ONCE(session->active) = 0; @@ -96,6 +103,17 @@ void lttng_session_destroy(struct lttng_session *session) list_for_each_entry_safe(chan, tmpchan, &session->chan, list) _lttng_channel_destroy(chan); list_del(&session->list); + /* Destroy dumped metadata */ + for (i = 0; i < NR_METADATA_TYPES; i++) { + int j; + + dumped = session->dumped_metadata[i].next; + for (j = 0; j < session->dumped_metadata[i].nr_metadata; j++) { + dumped = dumped->next; + kfree(dumped); + } + + } mutex_unlock(&sessions_mutex); kfree(session); } @@ -654,6 +672,13 @@ int _lttng_field_statedump(struct lttng_session *session, " { encoding = ASCII; }" : "", field->name); break; + case atype_struct: + ret = lttng_metadata_printf(session, + " struct %s_%s _%s;\n", + field->type.u.ctf_struct.provider, + field->type.u.ctf_struct.name, + field->name); + break; default: WARN_ON_ONCE(1); return -EINVAL; @@ -662,6 +687,141 @@ int _lttng_field_statedump(struct lttng_session *session, } static +int _lttng_is_type_metadata_dumped(struct lttng_session *session, + const struct lttng_metadata *metadata) +{ + /* Is the metadata dumped yet ? */ + struct lttng_metadata_dumped_data *dumped; + int is_dumped = 0, i; + + dumped = session->dumped_metadata[metadata->mtype].next; + switch (metadata->mtype) { + case mtype_struct: + for (i = 0; i < session->dumped_metadata[metadata->mtype].nr_metadata; i++) { + if (metadata->m.ctf_st.struct_desc == + dumped->dumped_ptr.struct_desc) { + is_dumped = 1; + break; + } + dumped = dumped->next; + } + break; + default: + WARN_ON_ONCE(1); + return -EINVAL; + } + return is_dumped; +} + +static int _lttng_type_metadata_mark_dumped(struct lttng_session *session, + const struct lttng_metadata *metadata) +{ + /* mark this metadata as dumped */ + struct lttng_metadata_dumped_data *dumped; + + dumped = kzalloc(sizeof(struct lttng_metadata_dumped_data), + GFP_KERNEL); + if (!dumped) + return -ENOMEM; + + switch (metadata->mtype) { + case mtype_struct: + dumped->dumped_ptr.struct_desc = metadata->m.ctf_st.struct_desc; + break; + default: + WARN_ON_ONCE(1); + return -EINVAL; + } + + dumped->next = session->dumped_metadata[metadata->mtype].next; + session->dumped_metadata[metadata->mtype].next = dumped; + session->dumped_metadata[metadata->mtype].nr_metadata++; + return 0; +} + +static +int _lttng_type_metadata_statedump(struct lttng_session *session, + const struct lttng_metadata *metadata, unsigned int nr_metadata); + +static +int _lttng_type_metadata_do_statedump(struct lttng_session *session, + const struct lttng_metadata *meta) +{ + int i, ret = 0; + + switch (meta->mtype) { + case mtype_struct: + ret = _lttng_type_metadata_statedump(session, + meta->m.ctf_st.type_metadata, + meta->m.ctf_st.nr_metadata); + if (ret) + return ret; + + ret = lttng_metadata_printf(session, + "struct %s_%s {\n", + meta->m.ctf_st.struct_desc->provider, + meta->m.ctf_st.struct_desc->name + ); + if (ret) + return ret; + + /* Print fields */ + for (i = 0; i < meta->m.ctf_st.struct_desc->nr_fields; i++) { + const struct lttng_event_field *field; + + field = &meta->m.ctf_st.struct_desc->fields[i]; + ret = _lttng_field_statedump(session, field); + if (ret) + return ret; + } + ret = lttng_metadata_printf(session, + "};\n\n"); + if (ret) + return ret; + break; + default: + WARN_ON_ONCE(1); + return -EINVAL; + } + if (ret) + return ret; + + ret = _lttng_type_metadata_mark_dumped(session, meta); + return ret; +} + +static +int _lttng_type_metadata_statedump(struct lttng_session *session, + const struct lttng_metadata *metadata, unsigned int nr_metadata) +{ + int i, ret = 0; + + for (i = 0; i < nr_metadata; i++) { + const struct lttng_metadata *meta = &metadata[i]; + + if (_lttng_is_type_metadata_dumped(session, meta)) + continue; + + ret = _lttng_type_metadata_do_statedump(session, meta); + if (ret) + return ret; + } + return ret; +} + +static +int _lttng_event_type_metadata_statedump(struct lttng_session *session, + struct lttng_event *event) +{ + int ret = 0; + const struct lttng_event_desc *desc = event->desc; + + ret = _lttng_type_metadata_statedump(session, + desc->type_metadata, desc->nr_metadata); + return ret; +} + +static int _lttng_context_metadata_statedump(struct lttng_session *session, struct lttng_ctx *ctx) { @@ -710,6 +870,11 @@ int _lttng_event_metadata_statedump(struct lttng_session *session, if (chan == session->metadata) return 0; + /* Dump the type metadata for this event */ + ret = _lttng_event_type_metadata_statedump(session, event); + if (ret) + goto end; + ret = lttng_metadata_printf(session, "event {\n" " name = %s;\n" @@ -746,7 +911,6 @@ int _lttng_event_metadata_statedump(struct lttng_session *session, ret = _lttng_fields_metadata_statedump(session, event); if (ret) goto end; - /* * LTTng space reservation can only reserve multiples of the * byte size. diff --git a/lttng-events.h b/lttng-events.h index 37a5db7..fa9aba4 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -47,9 +47,16 @@ enum abstract_types { atype_array, atype_sequence, atype_string, + atype_struct, NR_ABSTRACT_TYPES, }; +/* Metadata types */ +enum metadata_types { + mtype_struct, + NR_METADATA_TYPES, +}; + /* Update the string_encodings name table in lttng-types.c along with this enum */ enum lttng_string_encodings { lttng_encode_none = 0, @@ -115,6 +122,9 @@ struct lttng_type { struct lttng_basic_type length_type; struct lttng_basic_type elem_type; } sequence; + struct { + const char *provider, *name; + } ctf_struct; } u; }; @@ -161,12 +171,45 @@ struct lttng_ctx { unsigned int allocated_fields; }; +struct lttng_struct_desc { + const char *provider, *name; + const struct lttng_event_field *fields; /* fields */ + unsigned int nr_fields; + struct module *owner; +}; + +struct lttng_metadata { + enum metadata_types mtype; + union { + struct { + const struct lttng_struct_desc *struct_desc; + const struct lttng_metadata *type_metadata; + unsigned int nr_metadata; + } ctf_st; + } m; +}; + +struct lttng_metadata_dumped_data { + union { + const struct lttng_struct_desc *struct_desc; + } dumped_ptr; + struct lttng_metadata_dumped_data *next; +}; + +struct lttng_metadata_dumped { + unsigned int nr_metadata; + struct lttng_metadata_dumped_data *next; +}; + struct lttng_event_desc { const char *name; void *probe_callback; const struct lttng_event_ctx *ctx; /* context */ const struct lttng_event_field *fields; /* event payload */ + /* type metadata added by events */ + const struct lttng_metadata *type_metadata; unsigned int nr_fields; + unsigned int nr_metadata; struct module *owner; }; @@ -277,6 +320,7 @@ struct lttng_session { struct list_head list; /* Session list */ unsigned int free_chan_id; /* Next chan ID to allocate */ uuid_le uuid; /* Trace session unique ID */ + struct lttng_metadata_dumped dumped_metadata[NR_METADATA_TYPES]; unsigned int metadata_dumped:1; }; diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h index 44e8ba5..17a8419 100644 --- a/probes/lttng-events-reset.h +++ b/probes/lttng-events-reset.h @@ -20,6 +20,14 @@ /* Reset macros used within TRACE_EVENT to "nothing" */ +/* + * This enables the type metadata macros (struct, enums, variant) at this stage + * otherwise, the macros are just copied in a previous pass of the tracepoint + * file by the linux/include/tracepoint.h and give preprocessor errors. + */ +#undef TRACE_METADATA +#define TRACE_METADATA 1 + #undef __field_full #define __field_full(_type, _item, _order, _base) @@ -35,6 +43,9 @@ #undef __string #define __string(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) + #undef tp_assign #define tp_assign(dest, src) @@ -47,6 +58,9 @@ #undef tp_strcpy #define tp_strcpy(dest, src) +#undef tp_memcpy_struct +#define tp_memcpy_struct(provider, name, dest, src) + #undef __get_str #define __get_str(field) @@ -65,6 +79,9 @@ #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) +#undef TP_FIELDS +#define TP_FIELDS(args...) + #undef TP_fast_assign #define TP_fast_assign(args...) @@ -94,3 +111,6 @@ #undef TRACE_EVENT_FLAGS #define TRACE_EVENT_FLAGS(name, value) + +#undef TRACEPOINT_STRUCT_RAW +#define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) diff --git a/probes/lttng-events.h b/probes/lttng-events.h index 8a3a886..5976f61 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -263,9 +263,31 @@ void trace_##_name(void *__data); #define __string_from_user(_item, _src) \ __string(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + { \ + .name = #_item, \ + .type = \ + { \ + .atype = atype_struct, \ + .u.ctf_struct.provider = #_provider, \ + .u.ctf_struct.name = #_type, \ + }, \ + }, + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ +#undef TP_FIELDS +#define TP_FIELDS(args...) args /* Only one used in this phase */ + +#undef TRACEPOINT_STRUCT_RAW +#define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) \ + static const struct lttng_event_field \ + __struct_fields___##_provider##_##_name[] = { \ + _fields \ + }; + #undef DECLARE_EVENT_CLASS_NOARGS #define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ static const struct lttng_event_field __event_fields___##_name[] = { \ @@ -301,6 +323,74 @@ static void __event_probe__##_name(void *__data); #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* + * Stage 3.2 of the trace events. + * + * Create type metadata description + */ + +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ + +#undef TRACEPOINT_STRUCT_RAW +#define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) \ +static struct lttng_struct_desc __struct_desc___##_provider##_##_name = {\ + .fields = __struct_fields___##_provider##_##_name, \ + .nr_fields = ARRAY_SIZE(__struct_fields___##_provider##_##_name),\ + .provider = #_provider, \ + .name = #_name, \ + .owner = THIS_MODULE, \ + }; + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + +/* + * Stage 3.3 of the trace events. + * + * Associate metadata description to event or event template or other struct + */ + +/* Named field types must be defined in lttng-types.h */ + +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ + +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + { \ + .mtype = mtype_struct, \ + .m.ctf_st.struct_desc = &__struct_desc___##_provider##_##_type,\ + .m.ctf_st.type_metadata = __type_metadata_for__##_provider##_##_type,\ + .m.ctf_st.nr_metadata = ARRAY_SIZE(__type_metadata_for__##_provider##_##_type),\ + }, + + +#undef TP_STRUCT__entry +#define TP_STRUCT__entry(args...) args /* Only one used in this phase */ + +#undef TP_FIELDS +#define TP_FIELDS(args...) args + +#undef TRACEPOINT_STRUCT_RAW +#define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) \ +static const struct lttng_metadata __type_metadata_for__##_provider##_##_name[] = {\ + _fields \ +}; + + + +#undef DECLARE_EVENT_CLASS_NOARGS +#define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ +static const struct lttng_metadata __type_metadata_for__##_name[] = { \ + _tstruct \ +}; + +#undef DECLARE_EVENT_CLASS +#define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ + DECLARE_EVENT_CLASS_NOARGS(_name, PARAMS(_tstruct), PARAMS(_assign), \ + PARAMS(_print)) + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + + +/* * Stage 3.9 of the trace events. * * Create event descriptions. @@ -318,9 +408,11 @@ static void __event_probe__##_name(void *__data); #define DEFINE_EVENT_MAP_NOARGS(_template, _name, _map) \ static const struct lttng_event_desc __event_desc___##_map = { \ .fields = __event_fields___##_template, \ + .type_metadata = __type_metadata_for__##_template, \ .name = #_map, \ .probe_callback = (void *) TP_PROBE_CB(_template), \ .nr_fields = ARRAY_SIZE(__event_fields___##_template), \ + .nr_metadata = ARRAY_SIZE(__type_metadata_for__##_template), \ .owner = THIS_MODULE, \ }; @@ -379,9 +471,12 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { #undef TP_ID /* - * Stage 6 of the trace events. + * Stage 6.0 of the trace events. * * Create static inline function that calculates event size. + * + * First stage creates function to calculate sizes of sub-metadata + * (with no effect on the dynamic length values) */ #include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ @@ -403,6 +498,57 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(u32)); \ __event_len += sizeof(u32); \ __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \ + __event_len += sizeof(_type) * (_length); \ + +#undef __string +#define __string(_item, _src) \ + __event_len += strlen(_src) + 1; + +/* + * strlen_user includes \0. If returns 0, it faulted, so we set size to + * 1 (\0 only). + */ +#undef __string_from_user +#define __string_from_user(_item, _src) \ + __event_len += max_t(size_t, lttng_strlen_user_inatomic(_src), 1); + +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + __event_len += __struct_get_size__##_provider##_##_type(_params);\ + +#undef TP_PROTO +#define TP_PROTO(args...) args + +#undef TP_STRUCT__entry +#define TP_STRUCT__entry(args...) args + +#undef TP_FIELDS +#define TP_FIELDS(args...) args + +#undef TRACEPOINT_STRUCT_RAW +#define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) \ +static inline size_t __struct_get_size__##_provider##_##_name(_proto) \ + { \ + size_t __event_len = 0; \ + \ + _fields \ + return __event_len; \ +} + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + +/* + * Stage 6.1 of the trace events. + * + * Create static inline function that calculates event size, this time adding + * the size to the dynamic_len array + */ + +#undef __dynamic_array_enc_ext +#define __dynamic_array_enc_ext(_type, _item, _length, _order, _base, _encoding)\ + __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(u32)); \ + __event_len += sizeof(u32); \ + __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type));\ __dynamic_len[__dynamic_len_idx] = (_length); \ __event_len += sizeof(_type) * __dynamic_len[__dynamic_len_idx]; \ __dynamic_len_idx++; @@ -420,11 +566,13 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { __event_len += __dynamic_len[__dynamic_len_idx++] = \ max_t(size_t, lttng_strlen_user_inatomic(_src), 1); -#undef TP_PROTO -#define TP_PROTO(args...) args +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + __event_len += __dynamic_len[__dynamic_len_idx++] = \ + __struct_get_size__##_provider##_##_type(_params); -#undef TP_STRUCT__entry -#define TP_STRUCT__entry(args...) args +#undef TRACEPOINT_STRUCT_RAW +#define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ @@ -470,12 +618,42 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ #undef __string_from_user #define __string_from_user(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + __event_align = max_t(size_t, __event_align, \ + __instruct_get_align__##_provider##_##_type(_params)); + #undef TP_PROTO #define TP_PROTO(args...) args +#undef TP_ARGS +#define TP_ARGS(args...) args + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args +#undef TP_FIELDS +#define TP_FIELDS(args...) args + +/* + * The 2 functions __struct... and __instruct... are here to avoid nesting + * a struct within itself. If one tries to put a struct within itself + * the compiler will throw an error here because the __instruct... function + * is not defined when first called in __struct... + */ +#undef TRACEPOINT_STRUCT_RAW +#define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) \ +static inline size_t __struct_get_align__##_provider##_##_name(_proto) \ +{ \ + size_t __event_align = 1; \ + _fields \ + return __event_align; \ +} \ +static inline size_t __instruct_get_align__##_provider##_##_name(_proto)\ +{ \ + return __struct_get_align__##_provider##_##_name(_args); \ +} + #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ static inline size_t __event_get_align__##_name(_proto) \ @@ -487,7 +665,6 @@ static inline size_t __event_get_align__##_name(_proto) \ #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) - /* * Stage 8 of the trace events. * @@ -517,6 +694,9 @@ static inline size_t __event_get_align__##_name(_proto) \ #define __string_from_user(_item, _src) \ __string(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) char _item; + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args @@ -528,7 +708,6 @@ struct __event_typemap__##_name { \ #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) - /* * Stage 9 of the trace events. * @@ -568,6 +747,11 @@ __end_field_##_item: #define __string_from_user(_item, _src) \ __string(_item, _src) +#undef __struct +#define __struct(_provider, _type, _item, _params) \ + goto __assign_##_item; \ +__end_field_##_item: + /* * Macros mapping tp_assign() to "=", tp_memcpy() to memcpy() and tp_strcpy() to * strcpy(). @@ -624,12 +808,24 @@ __assign_##dest##_2: \ #define tp_memcpy_dyn_from_user(dest, src) \ tp_memcpy_dyn_gen(event_write_from_user, dest, src) +#undef tp_memcpy_struct_gen +#define tp_memcpy_struct_gen(write_ops, provider, name, dest, src) \ +__assign_##dest: \ + lib_ring_buffer_align_ctx(&__ctx, __struct_get_align__##provider##_##name(src));\ + __chan->ops->write_ops(&__ctx, src, \ + sizeof(__typemap.dest) * __get_dynamic_array_len(dest));\ + goto __end_field_##dest; + +#undef tp_memcpy_struct +#define tp_memcpy_struct(provider, name, dest, src) \ + tp_memcpy_struct_gen(event_write, provider, name, dest, src) + /* * The string length including the final \0. */ #undef tp_copy_string_from_user #define tp_copy_string_from_user(dest, src) \ - __assign_##dest: \ +__assign_##dest: \ { \ size_t __ustrlen; \ \ -- 1.8.2.1 From gbastien+lttng at versatic.net Wed Apr 24 16:14:17 2013 From: gbastien+lttng at versatic.net (=?UTF-8?q?Genevi=C3=A8ve=20Bastien?=) Date: Wed, 24 Apr 2013 16:14:17 -0400 Subject: [lttng-dev] [RFC-patch 2/5] Add support of enum metadata in tracepoints In-Reply-To: <1366834460-25567-1-git-send-email-gbastien+lttng@versatic.net> References: <1366834460-25567-1-git-send-email-gbastien+lttng@versatic.net> Message-ID: <1366834460-25567-3-git-send-email-gbastien+lttng@versatic.net> Introduce the new macro TRACEPOINT_ENUM to globally define ctf enum metadata that can be used in tracepoints using field_enum as entry and the tp_assign assignation macro. In the TRACE_EVENT_ENUM macro, values and ranges now have to be expressed without commas because it is easier to add commas where necessary than to remove them when a loop through the arguments is necessary. Signed-off-by: Genevi?ve Bastien --- lttng-events.c | 61 +++++++++++++++- lttng-events.h | 4 ++ probes/lttng-events-reset.h | 6 ++ probes/lttng-events.h | 169 +++++++++++++++++++++++++++++++++++++++++++- probes/lttng-type-list.h | 12 ++-- probes/lttng-types.h | 61 +++++++++++++++- 6 files changed, 302 insertions(+), 11 deletions(-) diff --git a/lttng-events.c b/lttng-events.c index fa92222..56ff6a6 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -588,7 +588,8 @@ int _lttng_field_statedump(struct lttng_session *session, break; case atype_enum: ret = lttng_metadata_printf(session, - " %s _%s;\n", + " enum enum_%s_%s _%s;\n", + field->type.u.basic.enumeration.provider, field->type.u.basic.enumeration.name, field->name); break; @@ -706,6 +707,16 @@ int _lttng_is_type_metadata_dumped(struct lttng_session *session, dumped = dumped->next; } break; + case mtype_enum: + for (i = 0; i < session->dumped_metadata[metadata->mtype].nr_metadata; i++) { + if (metadata->m.ctf_enum == + dumped->dumped_ptr.ctf_enum) { + is_dumped = 1; + break; + } + dumped = dumped->next; + } + break; default: WARN_ON_ONCE(1); return -EINVAL; @@ -728,6 +739,9 @@ static int _lttng_type_metadata_mark_dumped(struct lttng_session *session, case mtype_struct: dumped->dumped_ptr.struct_desc = metadata->m.ctf_st.struct_desc; break; + case mtype_enum: + dumped->dumped_ptr.ctf_enum = metadata->m.ctf_enum; + break; default: WARN_ON_ONCE(1); return -EINVAL; @@ -779,6 +793,51 @@ int _lttng_type_metadata_do_statedump(struct lttng_session *session, if (ret) return ret; break; + case mtype_enum: + ret = lttng_metadata_printf(session, + "enum %s : integer { size = %u; align = %u; signed = %u; base = %u;%s } {\n", + meta->m.ctf_enum->name, + meta->m.ctf_enum->container_type.u.basic.integer.size, + meta->m.ctf_enum->container_type.u.basic.integer.alignment, + meta->m.ctf_enum->container_type.u.basic.integer.signedness, + meta->m.ctf_enum->container_type.u.basic.integer.base, +#ifdef __BIG_ENDIAN + meta->m.ctf_enum->container_type.u.basic.integer.reverse_byte_order ? " byte_order = le;" : "" +#else + meta->m.ctf_enum->container_type.u.basic.integer.reverse_byte_order ? " byte_order = be;" : "" +#endif + ); + if (ret) + return ret; + + /* Print enumerations */ + for (i = 0; i < meta->m.ctf_enum->len; i++) { + const struct lttng_enum_entry *entry; + + entry = &meta->m.ctf_enum->entries[i]; + if (entry->start == entry->end) { + ret = lttng_metadata_printf(session, + " _%s = %d,\n", + entry->string, + entry->start + ); + } else { + ret = lttng_metadata_printf(session, + " _%s = %d ... %d,\n", + entry->string, + entry->start, + entry->end + ); + } + + if (ret) + return ret; + } + ret = lttng_metadata_printf(session, + "};\n\n"); + if (ret) + return ret; + break; default: WARN_ON_ONCE(1); return -EINVAL; diff --git a/lttng-events.h b/lttng-events.h index fa9aba4..f4b5c6e 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -54,6 +54,7 @@ enum abstract_types { /* Metadata types */ enum metadata_types { mtype_struct, + mtype_enum, NR_METADATA_TYPES, }; @@ -96,6 +97,7 @@ struct lttng_integer_type { union _lttng_basic_type { struct lttng_integer_type integer; struct { + const char *provider; const char *name; } enumeration; struct { @@ -186,12 +188,14 @@ struct lttng_metadata { const struct lttng_metadata *type_metadata; unsigned int nr_metadata; } ctf_st; + const struct lttng_enum *ctf_enum; } m; }; struct lttng_metadata_dumped_data { union { const struct lttng_struct_desc *struct_desc; + const struct lttng_enum *ctf_enum; } dumped_ptr; struct lttng_metadata_dumped_data *next; }; diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h index 17a8419..94046b2 100644 --- a/probes/lttng-events-reset.h +++ b/probes/lttng-events-reset.h @@ -31,6 +31,9 @@ #undef __field_full #define __field_full(_type, _item, _order, _base) +#undef __field_enum +#define __field_enum(_provider, _type, _item) + #undef __array_enc_ext #define __array_enc_ext(_type, _item, _length, _order, _base, _encoding) @@ -114,3 +117,6 @@ #undef TRACEPOINT_STRUCT_RAW #define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) + +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) diff --git a/probes/lttng-events.h b/probes/lttng-events.h index 5976f61..15d07d8 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -157,6 +157,92 @@ void trace_##_name(void *__data); #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* + * Stage 1.7 of the trace events. + * + * Create enum for tracepoint enum strings + */ + +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ + +/* Named field types must be defined in lttng-types.h */ + +#undef TP_ENUM +#define TP_ENUM(args...) args /* Only one used in this phase */ + +#define STAGE_EXPORT_ENUM_ENUM +#include "lttng-types.h" + +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ + TRACE_EVENT_ENUM(enum_##_provider##_##_name, _enum) + +#undef STAGE_EXPORT_ENUM_ENUM + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + +/* + * Stage 1.8 of the trace events. + * + * Create function to return C enum value from a long value + */ + +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ + +/* Named field types must be defined in lttng-types.h */ + +#undef TP_ENUM +#define TP_ENUM(...) __VA_ARGS__ /* Only one used in this phase */ + +#undef TP_TYPE +#define TP_TYPE(_type) _type + +#define STAGE_EXPORT_ENUM_FCT +#include "lttng-types.h" + +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ +static inline enum __trace_enum__enum_##_provider##_##_name __enum_get_value__##_provider##_##_name(_type value)\ +{ \ + enum __trace_enum__enum_##_provider##_##_name ret; \ + ret = NR_ENUM_DATA_enum_##_provider##_##_name; \ + _enum \ +end: \ + return ret; \ +} + +#undef STAGE_EXPORT_ENUM_FCT + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + +/* + * Stage 1.9 of the trace events. + * + * Unfold enum entries + */ + +#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ + +/* Named field types must be defined in lttng-types.h */ + +#undef TP_ENUM +#define TP_ENUM(args...) args /* Only one used in this phase */ + +#undef TP_TYPE +#define TP_TYPE(_type) + +#define STAGE_EXPORT_ENUMS +#include "lttng-types.h" + +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ + TRACE_EVENT_ENUM(enum_##_provider##_##_name, _enum) + +#undef STAGE_EXPORT_ENUMS + +#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) + + +/* * Stage 2 of the trace events. * * Create event field type metadata section. @@ -275,6 +361,18 @@ void trace_##_name(void *__data); }, \ }, +#undef __field_enum +#define __field_enum(_provider, _type, _data_type, _item) \ + { \ + .name = #_item, \ + .type = \ + { \ + .atype = atype_enum, \ + .u.basic.enumeration.provider = #_provider, \ + .u.basic.enumeration.name = #_type, \ + }, \ + }, + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ @@ -340,6 +438,19 @@ static struct lttng_struct_desc __struct_desc___##_provider##_##_name = {\ .owner = THIS_MODULE, \ }; +#undef TP_TYPE +#define TP_TYPE(_type) _type + +#define STAGE_EXPORT_TYPES +#include "lttng-types.h" + +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ +static const struct lttng_enum __enum_field__##_provider##_##_name[] = {\ + TRACE_EVENT_TYPE___enum(enum_##_provider##_##_name, _type)}; + +#undef STAGE_EXPORT_TYPES + #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* @@ -361,6 +472,12 @@ static struct lttng_struct_desc __struct_desc___##_provider##_##_name = {\ .m.ctf_st.nr_metadata = ARRAY_SIZE(__type_metadata_for__##_provider##_##_type),\ }, +#undef __field_enum +#define __field_enum(_provider, _type, _data_type, _item) \ + { \ + .mtype = mtype_enum, \ + .m.ctf_enum = &__enum_field__##_provider##_##_type[0], \ + }, #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ @@ -374,8 +491,6 @@ static const struct lttng_metadata __type_metadata_for__##_provider##_##_name[] _fields \ }; - - #undef DECLARE_EVENT_CLASS_NOARGS #define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ static const struct lttng_metadata __type_metadata_for__##_name[] = { \ @@ -516,6 +631,10 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { #define __struct(_provider, _type, _item, _params) \ __event_len += __struct_get_size__##_provider##_##_type(_params);\ +#undef __field_enum +#define __field_enum(_provider, _type, _data_type, _item) \ + __event_len += __enum_get_size__##_provider##_##_type(); + #undef TP_PROTO #define TP_PROTO(args...) args @@ -525,6 +644,9 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { #undef TP_FIELDS #define TP_FIELDS(args...) args +#undef TP_TYPE +#define TP_TYPE(_type) _type + #undef TRACEPOINT_STRUCT_RAW #define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) \ static inline size_t __struct_get_size__##_provider##_##_name(_proto) \ @@ -535,6 +657,13 @@ static inline size_t __struct_get_size__##_provider##_##_name(_proto) \ return __event_len; \ } +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ +static inline size_t __enum_get_size__##_provider##_##_name(void) \ +{ \ + return sizeof(_type); \ +} + #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* @@ -574,6 +703,9 @@ static inline size_t __struct_get_size__##_provider##_##_name(_proto) \ #undef TRACEPOINT_STRUCT_RAW #define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) + #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ @@ -623,6 +755,11 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ __event_align = max_t(size_t, __event_align, \ __instruct_get_align__##_provider##_##_type(_params)); +#undef __field_enum +#define __field_enum(_provider, _type, _data_type, _item) \ + __event_align = max_t(size_t, __event_align, \ + __enum_get_align__##_provider##_##_type()); + #undef TP_PROTO #define TP_PROTO(args...) args @@ -641,6 +778,9 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ * the compiler will throw an error here because the __instruct... function * is not defined when first called in __struct... */ +#undef TP_TYPE +#define TP_TYPE(type) type + #undef TRACEPOINT_STRUCT_RAW #define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) \ static inline size_t __struct_get_align__##_provider##_##_name(_proto) \ @@ -654,6 +794,13 @@ static inline size_t __instruct_get_align__##_provider##_##_name(_proto)\ return __struct_get_align__##_provider##_##_name(_args); \ } +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ +static inline size_t __enum_get_align__##_provider##_##_name(void) \ +{ \ + return lttng_alignof(_type); \ +} + #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ static inline size_t __event_get_align__##_name(_proto) \ @@ -697,6 +844,10 @@ static inline size_t __event_get_align__##_name(_proto) \ #undef __struct #define __struct(_provider, _type, _item, _params) char _item; +#undef __field_enum +#define __field_enum(_provider, _type, _data_type, _item) \ + _data_type _item; + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args @@ -706,6 +857,15 @@ struct __event_typemap__##_name { \ _tstruct \ }; +#undef TP_TYPE +#define TP_TYPE(type) type + +#undef TRACEPOINT_ENUM +#define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ +struct __enum_struct__##_provider##_##_name { \ + _type item; \ +}; + #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* @@ -752,6 +912,11 @@ __end_field_##_item: goto __assign_##_item; \ __end_field_##_item: +#undef __field_enum +#define __field_enum(_provider, _type, _data_type, _item) \ + goto __assign_##_item; \ +__end_field_##_item: + /* * Macros mapping tp_assign() to "=", tp_memcpy() to memcpy() and tp_strcpy() to * strcpy(). diff --git a/probes/lttng-type-list.h b/probes/lttng-type-list.h index 564a13f..ef8cefa 100644 --- a/probes/lttng-type-list.h +++ b/probes/lttng-type-list.h @@ -22,12 +22,12 @@ /* Enumerations */ TRACE_EVENT_ENUM(hrtimer_mode, - V(HRTIMER_MODE_ABS), - V(HRTIMER_MODE_REL), - V(HRTIMER_MODE_PINNED), - V(HRTIMER_MODE_ABS_PINNED), - V(HRTIMER_MODE_REL_PINNED), - R(HRTIMER_MODE_UNDEFINED, 0x04, 0x20), /* Example (to remove) */ + V(HRTIMER_MODE_ABS) + V(HRTIMER_MODE_REL) + V(HRTIMER_MODE_PINNED) + V(HRTIMER_MODE_ABS_PINNED) + V(HRTIMER_MODE_REL_PINNED) + R(HRTIMER_MODE_UNDEFINED, 0x04, 0x20) /* Example (to remove) */ ) TRACE_EVENT_TYPE(hrtimer_mode, enum, unsigned char) diff --git a/probes/lttng-types.h b/probes/lttng-types.h index 9376066..057bb91 100644 --- a/probes/lttng-types.h +++ b/probes/lttng-types.h @@ -50,12 +50,12 @@ /* Enumeration entry (single value) */ #undef V -#define V(_string) { _string, _string, #_string} +#define V(_string) { _string, _string, #_string}, /* Enumeration entry (range) */ #undef R #define R(_string, _range_start, _range_end) \ - { _range_start, _range_end, #_string } + { _range_start, _range_end, #_string }, #endif /* STAGE_EXPORT_ENUMS */ @@ -82,3 +82,60 @@ #define TRACE_EVENT_ENUM(_name, _entries...) #endif /* STAGE_EXPORT_TYPES */ + +/* Creates a C enum with the names of the ctf enumeration */ + +#ifdef STAGE_EXPORT_ENUM_ENUM + +#undef TRACE_EVENT_TYPE +#define TRACE_EVENT_TYPE(_name, _abstract_type, args...) + +#undef TRACE_EVENT_ENUM +#define TRACE_EVENT_ENUM(_name, _entries...) \ +enum __trace_enum__##_name { \ + _entries \ + NR_ENUM_DATA_##_name, \ +}; + +/* Enumeration entry (single value) */ +#undef V +#define V(_string) enum_##_string, + +/* Enumeration entry (range) */ +#undef R +#define R(_string, _range_start, _range_end) \ + enum_##_string, + +#endif /* STAGE_EXPORT_ENUM_ENUM */ + +/* + * Creates a function that will return the C enum value given a long value + * (useful for variants) + */ + +#ifdef STAGE_EXPORT_ENUM_FCT + +#undef TRACE_EVENT_TYPE +#define TRACE_EVENT_TYPE(_name, _abstract_type, args...) + +#undef TRACE_EVENT_ENUM +#define TRACE_EVENT_ENUM(_name, _entries...) + +/* Enumeration entry (single value) */ +#undef V +#define V(_string) \ + if (value == _string) { \ + ret = enum_##_string; \ + goto end; \ + } + + +/* Enumeration entry (range) */ +#undef R +#define R(_string, _range_start, _range_end) \ + if ((value >= _range_start) && (value <= _range_end)) { \ + ret = enum_##_string; \ + goto end; \ + } + +#endif /* STAGE_EXPORT_ENUM_FCT */ -- 1.8.2.1 From gbastien+lttng at versatic.net Wed Apr 24 16:14:18 2013 From: gbastien+lttng at versatic.net (=?UTF-8?q?Genevi=C3=A8ve=20Bastien?=) Date: Wed, 24 Apr 2013 16:14:18 -0400 Subject: [lttng-dev] [RFC-patch 3/5] Add support of variant metadata in tracepoints In-Reply-To: <1366834460-25567-1-git-send-email-gbastien+lttng@versatic.net> References: <1366834460-25567-1-git-send-email-gbastien+lttng@versatic.net> Message-ID: <1366834460-25567-4-git-send-email-gbastien+lttng@versatic.net> Add the new macro TRACEPOINT_VARIANT to globally define ctf variants that can be used in tracepoints using the __variant macro for field definition and one of tp_memcpy_variant (copy the memory for the length of the variant's selection) or tp_assign_variant (different treatments for each possible selection) assignation macro. In the __event_probe... function, references to &__ctx are changed to a ctxptr so that the ring buffer ctx can be passed to variant assignation functions. Signed-off-by: Genevi?ve Bastien --- lttng-events.c | 50 +++++++++ lttng-events.h | 17 +++ probes/lttng-events-reset.h | 21 ++++ probes/lttng-events.h | 260 ++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 327 insertions(+), 21 deletions(-) diff --git a/lttng-events.c b/lttng-events.c index 56ff6a6..b0aea34 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -680,6 +680,14 @@ int _lttng_field_statedump(struct lttng_session *session, field->type.u.ctf_struct.name, field->name); break; + case atype_variant: + ret = lttng_metadata_printf(session, + " variant %s_%s <_%s> _%s;\n", + field->type.u.variant.provider, + field->type.u.variant.name, + field->type.u.variant.enum_field, + field->name); + break; default: WARN_ON_ONCE(1); return -EINVAL; @@ -717,6 +725,16 @@ int _lttng_is_type_metadata_dumped(struct lttng_session *session, dumped = dumped->next; } break; + case mtype_variant: + for (i = 0; i < session->dumped_metadata[metadata->mtype].nr_metadata; i++) { + if (metadata->m.ctf_var.variant_desc == + dumped->dumped_ptr.variant_desc) { + is_dumped = 1; + break; + } + dumped = dumped->next; + } + break; default: WARN_ON_ONCE(1); return -EINVAL; @@ -742,6 +760,9 @@ static int _lttng_type_metadata_mark_dumped(struct lttng_session *session, case mtype_enum: dumped->dumped_ptr.ctf_enum = metadata->m.ctf_enum; break; + case mtype_variant: + dumped->dumped_ptr.variant_desc = metadata->m.ctf_var.variant_desc; + break; default: WARN_ON_ONCE(1); return -EINVAL; @@ -838,6 +859,35 @@ int _lttng_type_metadata_do_statedump(struct lttng_session *session, if (ret) return ret; break; + case mtype_variant: + ret = _lttng_type_metadata_statedump(session, + meta->m.ctf_var.type_metadata, + meta->m.ctf_var.nr_metadata); + if (ret) + return ret; + + ret = lttng_metadata_printf(session, + "variant %s_%s {\n", + meta->m.ctf_var.variant_desc->provider, + meta->m.ctf_var.variant_desc->name + ); + if (ret) + return ret; + + /* Print fields */ + for (i = 0; i < meta->m.ctf_var.variant_desc->nr_fields; i++) { + const struct lttng_event_field *field; + + field = &meta->m.ctf_var.variant_desc->fields[i]; + ret = _lttng_field_statedump(session, field); + if (ret) + return ret; + } + ret = lttng_metadata_printf(session, + "};\n\n"); + if (ret) + return ret; + break; default: WARN_ON_ONCE(1); return -EINVAL; diff --git a/lttng-events.h b/lttng-events.h index f4b5c6e..6a077ee 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -48,6 +48,7 @@ enum abstract_types { atype_sequence, atype_string, atype_struct, + atype_variant, NR_ABSTRACT_TYPES, }; @@ -55,6 +56,7 @@ enum abstract_types { enum metadata_types { mtype_struct, mtype_enum, + mtype_variant, NR_METADATA_TYPES, }; @@ -127,6 +129,10 @@ struct lttng_type { struct { const char *provider, *name; } ctf_struct; + struct { + const char *provider, *name; + const char *enum_field; + } variant; } u; }; @@ -144,6 +150,11 @@ struct lttng_event_field { struct lttng_type type; }; +struct lttng_variant_field { + const char *name; + struct lttng_event_field field; +}; + /* * We need to keep this perf counter field separately from struct * lttng_ctx_field because cpu hotplug needs fixed-location addresses. @@ -189,6 +200,11 @@ struct lttng_metadata { unsigned int nr_metadata; } ctf_st; const struct lttng_enum *ctf_enum; + struct { + const struct lttng_struct_desc *variant_desc; + const struct lttng_metadata *type_metadata; + unsigned int nr_metadata; + } ctf_var; } m; }; @@ -196,6 +212,7 @@ struct lttng_metadata_dumped_data { union { const struct lttng_struct_desc *struct_desc; const struct lttng_enum *ctf_enum; + const struct lttng_struct_desc *variant_desc; } dumped_ptr; struct lttng_metadata_dumped_data *next; }; diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h index 94046b2..f115d5e 100644 --- a/probes/lttng-events-reset.h +++ b/probes/lttng-events-reset.h @@ -49,6 +49,9 @@ #undef __struct #define __struct(_provider, _type, _item, _params) +#undef __variant +#define __variant(_provider, _type, _item, _enum_field, _enum, _src...) + #undef tp_assign #define tp_assign(dest, src) @@ -64,6 +67,9 @@ #undef tp_memcpy_struct #define tp_memcpy_struct(provider, name, dest, src) +#undef tp_memcpy_variant +#define tp_memcpy_variant(provider, name, dest, enum_value, src...) + #undef __get_str #define __get_str(field) @@ -85,6 +91,18 @@ #undef TP_FIELDS #define TP_FIELDS(args...) +#undef TP_VARIANTS +#define TP_VARIANTS(args...) + +#undef TP_VARIANT +#define TP_VARIANT(_value, _field) + +#undef TP_variants_assign +#define TP_variants_assign(args...) + +#undef TP_variant_assign +#define TP_variant_assign(_value, _field) + #undef TP_fast_assign #define TP_fast_assign(args...) @@ -120,3 +138,6 @@ #undef TRACEPOINT_ENUM #define TRACEPOINT_ENUM(_provider, _name, _type, _enum) + +#undef TRACEPOINT_VARIANT +#define TRACEPOINT_VARIANT(_provider, _name, _proto, _args, _enum_provider, _enum_name, _earg, _variants, _assign) diff --git a/probes/lttng-events.h b/probes/lttng-events.h index 15d07d8..7e3a5b0 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -373,12 +373,31 @@ end: \ }, \ }, +#undef __variant +#define __variant(_provider, _type, _item, _enum_field, _enum, _src...) \ + { \ + .name = #_item, \ + .type = \ + { \ + .atype = atype_variant, \ + .u.variant.provider = #_provider, \ + .u.variant.name = #_type, \ + .u.variant.enum_field = #_enum_field, \ + }, \ + }, + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ #undef TP_FIELDS #define TP_FIELDS(args...) args /* Only one used in this phase */ +#undef TP_VARIANTS +#define TP_VARIANTS(args...) args + +#undef TP_VARIANT +#define TP_VARIANT(_value, _field) _field + #undef TRACEPOINT_STRUCT_RAW #define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) \ static const struct lttng_event_field \ @@ -386,6 +405,13 @@ end: \ _fields \ }; +#undef TRACEPOINT_VARIANT +#define TRACEPOINT_VARIANT(_provider, _name, _proto, _args, _enum_provider, _enum_name, _earg, _variants, _assign)\ +static const struct lttng_event_field \ + __variant_fields___##_provider##_##_name[] = { \ + _variants \ +}; + #undef DECLARE_EVENT_CLASS_NOARGS #define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ static const struct lttng_event_field __event_fields___##_name[] = { \ @@ -451,6 +477,16 @@ static const struct lttng_enum __enum_field__##_provider##_##_name[] = {\ #undef STAGE_EXPORT_TYPES +#undef TRACEPOINT_VARIANT +#define TRACEPOINT_VARIANT(_provider, _name, _proto, _args, _enum_provider, _enum_name, _earg, _variants, _assign)\ +static struct lttng_struct_desc __variant_desc__##_provider##_##_name = {\ + .fields = __variant_fields___##_provider##_##_name, \ + .nr_fields = ARRAY_SIZE(__variant_fields___##_provider##_##_name),\ + .provider = #_provider, \ + .name = #_name, \ + .owner = THIS_MODULE, \ + }; + #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* @@ -479,18 +515,39 @@ static const struct lttng_enum __enum_field__##_provider##_##_name[] = {\ .m.ctf_enum = &__enum_field__##_provider##_##_type[0], \ }, +#undef __variant +#define __variant(_provider, _type, _item, _enum_field, _enum, _src...) \ + { \ + .mtype = mtype_variant, \ + .m.ctf_var.variant_desc = &__variant_desc__##_provider##_##_type,\ + .m.ctf_var.type_metadata = __type_metadata_for_var__##_provider##_##_type,\ + .m.ctf_var.nr_metadata = ARRAY_SIZE(__type_metadata_for_var__##_provider##_##_type),\ + }, + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args /* Only one used in this phase */ #undef TP_FIELDS #define TP_FIELDS(args...) args +#undef TP_VARIANTS +#define TP_VARIANTS(args...) args + +#undef TP_VARIANT +#define TP_VARIANT(_value, _field) _field + #undef TRACEPOINT_STRUCT_RAW #define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) \ static const struct lttng_metadata __type_metadata_for__##_provider##_##_name[] = {\ _fields \ }; +#undef TRACEPOINT_VARIANT +#define TRACEPOINT_VARIANT(_provider, _name, _proto, _args, _enum_provider, _enum_name, _earg, _variants, _assign)\ +static const struct lttng_metadata __type_metadata_for_var__##_provider##_##_name[] = {\ + _variants \ +}; + #undef DECLARE_EVENT_CLASS_NOARGS #define DECLARE_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \ static const struct lttng_metadata __type_metadata_for__##_name[] = { \ @@ -635,6 +692,10 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { #define __field_enum(_provider, _type, _data_type, _item) \ __event_len += __enum_get_size__##_provider##_##_type(); +#undef __variant +#define __variant(_provider, _type, _item, _enum_field, _enum, _src...) \ + __event_len += __variant_get_size__##_provider##_##_type(_enum, _src); + #undef TP_PROTO #define TP_PROTO(args...) args @@ -664,6 +725,27 @@ static inline size_t __enum_get_size__##_provider##_##_name(void) \ return sizeof(_type); \ } +#undef TP_VARIANTS +#define TP_VARIANTS(args...) args + +#undef TP_VARIANT +#define TP_VARIANT(_value, _field) \ +case _value: \ + _field \ + break; + +#undef TRACEPOINT_VARIANT +#define TRACEPOINT_VARIANT(_provider, _name, _proto, _args, _enum_provider, _enum_name, _earg, _variants, _assign)\ +static inline size_t __variant_get_size__##_provider##_##_name(_proto) \ + { \ + size_t __event_len = 0; \ + \ + switch (_earg) { \ + _variants \ + } \ + return __event_len; \ +} + #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) /* @@ -700,12 +782,42 @@ static inline size_t __enum_get_size__##_provider##_##_name(void) \ __event_len += __dynamic_len[__dynamic_len_idx++] = \ __struct_get_size__##_provider##_##_type(_params); +#undef __variant +#define __variant(_provider, _type, _item, _enum_field, _enum, _src...) \ + __event_len += __dynamic_len[__dynamic_len_idx++] = \ + __variant_get_size__##_provider##_##_type(_enum, _src); + #undef TRACEPOINT_STRUCT_RAW #define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) #undef TRACEPOINT_ENUM #define TRACEPOINT_ENUM(_provider, _name, _type, _enum) +#undef TP_VARIANTS +#define TP_VARIANTS(args...) args + +#undef TP_VARIANT +#define TP_VARIANT(_value, _field) \ +case _value: \ + _field \ + break; + +#undef TRACEPOINT_VARIANT +#define TRACEPOINT_VARIANT(_provider, _name, _proto, _args, _enum_provider, _enum_name, _earg, _variants, _assign)\ +static inline size_t __variant_get_size_full__##_provider##_##_name(size_t *__dynamic_len, _proto) \ + { \ + size_t __event_len = 0; \ + unsigned int __dynamic_len_idx = 0; \ + \ + if (0) \ + (void) __dynamic_len_idx; /* don't warn if unused */\ + \ + switch (_earg) { \ + _variants \ + } \ + return __event_len; \ +} + #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ @@ -760,6 +872,11 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ __event_align = max_t(size_t, __event_align, \ __enum_get_align__##_provider##_##_type()); +#undef __variant +#define __variant(_provider, _type, _item, _enum_field, _enum, _src...) \ + __event_align = max_t(size_t, __event_align, \ + __invar_get_align__##_provider##_##_type(_enum, _src)); + #undef TP_PROTO #define TP_PROTO(args...) args @@ -801,6 +918,19 @@ static inline size_t __enum_get_align__##_provider##_##_name(void) \ return lttng_alignof(_type); \ } +#undef TRACEPOINT_VARIANT +#define TRACEPOINT_VARIANT(_provider, _name, _proto, _args, _enum_provider, _enum_name, _earg, _variants, _assign)\ +static inline size_t __variant_get_align__##_provider##_##_name(_proto) \ +{ \ + size_t __event_align = 1; \ + _variants \ + return __event_align; \ +} \ +static inline size_t __invar_get_align__##_provider##_##_name(_proto)\ +{ \ + return __variant_get_align__##_provider##_##_name(_earg, _args);\ +} + #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ static inline size_t __event_get_align__##_name(_proto) \ @@ -848,9 +978,25 @@ static inline size_t __event_get_align__##_name(_proto) \ #define __field_enum(_provider, _type, _data_type, _item) \ _data_type _item; +#undef __variant +#define __variant(_provider, _type, _item, _enum_field, _enum, _src...) \ + char _item; + #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args +#undef TP_VARIANTS +#define TP_VARIANTS(args...) args + +#undef TP_VARIANT +#define TP_VARIANT(_value, _field) _field + +#undef TRACEPOINT_VARIANT +#define TRACEPOINT_VARIANT(_provider, _name, _proto, _args, _enum_provider, _enum_name, _earg, _variants, _assign)\ +struct __variant_typemap__##_provider##_##_name { \ + _variants \ +}; + #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ struct __event_typemap__##_name { \ @@ -917,6 +1063,11 @@ __end_field_##_item: goto __assign_##_item; \ __end_field_##_item: +#undef __variant +#define __variant(_provider, _type, _item, _enum_field, _enum, _src...) \ + goto __assign_##_item; \ +__end_field_##_item: + /* * Macros mapping tp_assign() to "=", tp_memcpy() to memcpy() and tp_strcpy() to * strcpy(). @@ -926,8 +1077,8 @@ __end_field_##_item: __assign_##dest: \ { \ __typeof__(__typemap.dest) __tmp = (src); \ - lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp)); \ - __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp));\ + lib_ring_buffer_align_ctx(__ctxptr, lttng_alignof(__tmp));\ + __chan->ops->event_write(__ctxptr, &__tmp, sizeof(__tmp));\ } \ goto __end_field_##dest; @@ -937,8 +1088,8 @@ __assign_##dest: \ __assign_##dest: \ if (0) \ (void) __typemap.dest; \ - lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__typemap.dest)); \ - __chan->ops->write_ops(&__ctx, src, len); \ + lib_ring_buffer_align_ctx(__ctxptr, lttng_alignof(__typemap.dest));\ + __chan->ops->write_ops(__ctxptr, src, len); \ goto __end_field_##dest; #undef tp_memcpy @@ -955,13 +1106,13 @@ __assign_##dest: \ __assign_##dest##_1: \ { \ u32 __tmpl = __dynamic_len[__dynamic_len_idx]; \ - lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(u32)); \ - __chan->ops->event_write(&__ctx, &__tmpl, sizeof(u32)); \ + lib_ring_buffer_align_ctx(__ctxptr, lttng_alignof(u32));\ + __chan->ops->event_write(__ctxptr, &__tmpl, sizeof(u32));\ } \ goto __end_field_##dest##_1; \ __assign_##dest##_2: \ - lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__typemap.dest)); \ - __chan->ops->write_ops(&__ctx, src, \ + lib_ring_buffer_align_ctx(__ctxptr, lttng_alignof(__typemap.dest));\ + __chan->ops->write_ops(__ctxptr, src, \ sizeof(__typemap.dest) * __get_dynamic_array_len(dest));\ goto __end_field_##dest##_2; @@ -976,8 +1127,8 @@ __assign_##dest##_2: \ #undef tp_memcpy_struct_gen #define tp_memcpy_struct_gen(write_ops, provider, name, dest, src) \ __assign_##dest: \ - lib_ring_buffer_align_ctx(&__ctx, __struct_get_align__##provider##_##name(src));\ - __chan->ops->write_ops(&__ctx, src, \ + lib_ring_buffer_align_ctx(__ctxptr, __struct_get_align__##provider##_##name(src));\ + __chan->ops->write_ops(__ctxptr, src, \ sizeof(__typemap.dest) * __get_dynamic_array_len(dest));\ goto __end_field_##dest; @@ -986,6 +1137,31 @@ __assign_##dest: \ tp_memcpy_struct_gen(event_write, provider, name, dest, src) /* + * This supposes that the variant field is at the same place (same src) for + * each variant, which is not the case most of the time. + */ +#undef tp_memcpy_variant_gen +#define tp_memcpy_variant_gen(write_ops, provider, name, dest, enum_value, src...)\ +__assign_##dest: \ + lib_ring_buffer_align_ctx(__ctxptr, __variant_get_align__##provider##_##name(enum_value, src));\ + __chan->ops->write_ops(__ctxptr, src, \ + sizeof(__typemap.dest) * __get_dynamic_array_len(dest));\ + goto __end_field_##dest; + +#undef tp_memcpy_variant +#define tp_memcpy_variant(provider, name, dest, enum_value, src...) \ + tp_memcpy_variant_gen(event_write, provider, name, dest, enum_value, src) + +/* Still have to consume the array len of this field */ +#undef tp_assign_variant +#define tp_assign_variant(provider, name, dest, enum_value, src...) \ +__assign_##dest: \ + __dynamic_len_idx++; \ + __variant_assign__##provider##_##name(__ctxptr, __chan, enum_value, src);\ + goto __end_field_##dest; + + +/* * The string length including the final \0. */ #undef tp_copy_string_from_user @@ -996,13 +1172,13 @@ __assign_##dest: \ \ if (0) \ (void) __typemap.dest; \ - lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__typemap.dest));\ + lib_ring_buffer_align_ctx(__ctxptr, lttng_alignof(__typemap.dest));\ __ustrlen = __get_dynamic_array_len(dest); \ if (likely(__ustrlen > 1)) { \ - __chan->ops->event_write_from_user(&__ctx, src, \ + __chan->ops->event_write_from_user(__ctxptr, src,\ __ustrlen - 1); \ } \ - __chan->ops->event_memset(&__ctx, 0, 1); \ + __chan->ops->event_memset(__ctxptr, 0, 1); \ } \ goto __end_field_##dest; #undef tp_strcpy @@ -1034,6 +1210,46 @@ __assign_##dest: \ #define TP_fast_assign(args...) args /* + * Create a function to assign a variant's values + */ + +#undef TP_variants_assign +#define TP_variants_assign(args...) args + +#undef TP_variant_assign +#define TP_variant_assign(_value, _field) \ +case enum_##_value: \ + goto __assign_##_value; \ + _field \ +__end_field_##_value: \ + break; + +#undef TRACEPOINT_VARIANT +#define TRACEPOINT_VARIANT(_provider, _name, _proto, _args, _enum_provider, _enum_name, _earg, _variants, _assign)\ +static void __variant_assign__##_provider##_##_name(struct lib_ring_buffer_ctx *__ctxptr,\ + struct lttng_channel *__chan, _proto) \ +{ \ + enum __trace_enum__enum_##_enum_provider##_##_enum_name __enum_val = __enum_get_value__##_enum_provider##_##_enum_name(_earg);\ + struct __variant_typemap__##_provider##_##_name __typemap; \ + size_t __variant_len, __variant_align; \ + size_t __dynamic_len_idx = 0; \ + size_t __dynamic_len[ARRAY_SIZE(__variant_fields___##_provider##_##_name)];\ + \ + if (0) { \ + (void) __dynamic_len_idx; /* don't warn if unused */\ + (void) __variant_len; /* don't warn if unused */\ + (void) __variant_align; \ + } \ + __variant_len = __variant_get_size_full__##_provider##_##_name(__dynamic_len, _earg, _args);\ + __variant_align = __variant_get_align__##_provider##_##_name(_earg, _args);\ + switch (__enum_val) { \ + _assign \ + default: \ + break; \ + } \ +} + +/* * For state dump, check that "session" argument (mandatory) matches the * session this event belongs to. Ensures that we write state dump data only * into the started session, not into all sessions. @@ -1050,7 +1266,7 @@ static void __event_probe__##_name(void *__data, _proto) \ { \ struct lttng_event *__event = __data; \ struct lttng_channel *__chan = __event->chan; \ - struct lib_ring_buffer_ctx __ctx; \ + struct lib_ring_buffer_ctx __ctx, *__ctxptr; \ size_t __event_len, __event_align; \ size_t __dynamic_len_idx = 0; \ size_t __dynamic_len[ARRAY_SIZE(__event_fields___##_name)]; \ @@ -1071,14 +1287,15 @@ static void __event_probe__##_name(void *__data, _proto) \ return; \ __event_len = __event_get_size__##_name(__dynamic_len, _args); \ __event_align = __event_get_align__##_name(_args); \ - lib_ring_buffer_ctx_init(&__ctx, __chan->chan, __event, __event_len, \ + __ctxptr = &__ctx; \ + lib_ring_buffer_ctx_init(__ctxptr, __chan->chan, __event, __event_len,\ __event_align, -1); \ - __ret = __chan->ops->event_reserve(&__ctx, __event->id); \ + __ret = __chan->ops->event_reserve(__ctxptr, __event->id); \ if (__ret < 0) \ return; \ /* Control code (field ordering) */ \ _tstruct \ - __chan->ops->event_commit(&__ctx); \ + __chan->ops->event_commit(__ctxptr); \ return; \ /* Copy code, steered by control code */ \ _assign \ @@ -1090,7 +1307,7 @@ static void __event_probe__##_name(void *__data) \ { \ struct lttng_event *__event = __data; \ struct lttng_channel *__chan = __event->chan; \ - struct lib_ring_buffer_ctx __ctx; \ + struct lib_ring_buffer_ctx __ctx, *__ctxptr; \ size_t __event_len, __event_align; \ int __ret; \ \ @@ -1104,14 +1321,15 @@ static void __event_probe__##_name(void *__data) \ return; \ __event_len = 0; \ __event_align = 1; \ - lib_ring_buffer_ctx_init(&__ctx, __chan->chan, __event, __event_len, \ + __ctxptr = &__ctx; \ + lib_ring_buffer_ctx_init(__ctxptr, __chan->chan, __event, __event_len,\ __event_align, -1); \ - __ret = __chan->ops->event_reserve(&__ctx, __event->id); \ + __ret = __chan->ops->event_reserve(__ctxptr, __event->id); \ if (__ret < 0) \ return; \ /* Control code (field ordering) */ \ _tstruct \ - __chan->ops->event_commit(&__ctx); \ + __chan->ops->event_commit(__ctxptr); \ return; \ /* Copy code, steered by control code */ \ _assign \ -- 1.8.2.1 From gbastien+lttng at versatic.net Wed Apr 24 16:14:19 2013 From: gbastien+lttng at versatic.net (=?UTF-8?q?Genevi=C3=A8ve=20Bastien?=) Date: Wed, 24 Apr 2013 16:14:19 -0400 Subject: [lttng-dev] [RFC-patch 4/5] Add some extra data to net_* tracepoints In-Reply-To: <1366834460-25567-1-git-send-email-gbastien+lttng@versatic.net> References: <1366834460-25567-1-git-send-email-gbastien+lttng@versatic.net> Message-ID: <1366834460-25567-5-git-send-email-gbastien+lttng@versatic.net> Add some packet header information to the tracepoint when available: * ipv4/ipv6 network header * tcp transport header Signed-off-by: Genevi?ve Bastien --- instrumentation/events/lttng-module/net.h | 244 +++++++++++++++++++++++++++++- 1 file changed, 237 insertions(+), 7 deletions(-) diff --git a/instrumentation/events/lttng-module/net.h b/instrumentation/events/lttng-module/net.h index e552cf7..b31aea4 100644 --- a/instrumentation/events/lttng-module/net.h +++ b/instrumentation/events/lttng-module/net.h @@ -7,8 +7,74 @@ #include #include #include +#include +#include #include #include +#include + +#ifndef _TRACE_NET_DEF_ +#define _TRACE_NET_DEF_ + +enum network_header_types { + nhtype_none, + nhtype_ip, + nhtype_ip6, + NR_NH_TYPES, +}; + +enum transport_header_types { + thtype_none, + thtype_tcp, + NR_TH_TYPES, +}; + +static inline unsigned char __get_send_network_header_type(struct sk_buff *skb) +{ + if (skb->sk) { + if (skb->sk->sk_family == PF_INET) + return nhtype_ip; + else if (skb->sk->sk_family == PF_INET6) + return nhtype_ip6; + } + return nhtype_none; +} + +static inline unsigned char __get_send_transport_header_type(struct sk_buff *skb) +{ + if (skb->sk) { + if (skb->sk->sk_protocol == IPPROTO_TCP) + return thtype_tcp; + } + return thtype_none; +} + +static inline unsigned char __get_recv_network_header_type(struct sk_buff *skb) +{ + if (skb_network_header(skb) != skb->head) { + if (skb->protocol == htons(ETH_P_IPV6)) + return nhtype_ip6; + else if (skb->protocol == htons(ETH_P_IP)) + return nhtype_ip; + } + return nhtype_none; +} + +static inline unsigned char __get_recv_transport_header_type(struct sk_buff *skb) +{ + if (skb_network_header(skb) != skb->head) { + if (!(skb->transport_header <= skb->network_header)) { + if ((skb->protocol == htons(ETH_P_IP) && + (ip_hdr(skb)->protocol == IPPROTO_TCP)) || + (skb->protocol == htons(ETH_P_IPV6) && + (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP))) + return thtype_tcp; + } + } + return thtype_none; +} + +#endif /* _TRACE_NET_DEF_ */ TRACE_EVENT(net_dev_xmit, @@ -57,43 +123,207 @@ TRACE_EVENT(net_dev_xmit, __get_str(name), __entry->skbaddr, __entry->len, __entry->rc) ) -DECLARE_EVENT_CLASS(net_dev_template, +#ifdef TRACE_METADATA + +TRACEPOINT_ENUM(net, network_header, TP_TYPE(unsigned char), + TP_ENUM( + V(nhtype_none) + V(nhtype_ip) + V(nhtype_ip6) + ) +) + +TRACEPOINT_ENUM(net, transport_header, TP_TYPE(unsigned char), + TP_ENUM( + V(thtype_none) + V(thtype_tcp) + ) +) + +TRACEPOINT_STRUCT_RAW(net, empty_struct, + + TP_PROTO(struct sk_buff *skb), + + TP_ARGS(skb), + + TP_FIELDS( + ) +) + +TRACEPOINT_STRUCT_RAW(net, ip_fields, + + TP_PROTO(struct iphdr *hdr), + + TP_ARGS(hdr), + + TP_FIELDS(__field_hex(unsigned char, ihl_version) + __field_network(unsigned char, tos) + __field_network(unsigned short, tot_len) + __field_network_hex(unsigned short, id) + __field_network(unsigned short, frag_off) + __field_network(unsigned char, ttl) + __field_network_hex(unsigned char, protocol) + __field_network_hex(unsigned short, checksum) + __field_network_hex(unsigned int, saddr) + __field_network_hex(unsigned int, daddr) + ) +) + +TRACEPOINT_STRUCT_RAW(net, ipv6_fields, + + TP_PROTO(struct ipv6hdr *hdr), + + TP_ARGS(hdr), + + TP_FIELDS(__field_hex(unsigned char, prio_version) + __array(char, flow_lbl, 3) + __field_network(unsigned short, payload_len) + __field_network_hex(unsigned char, nexthdr) + __field_network(unsigned char, hop_limit) + __array_hex(unsigned short, saddr, 8) + __array_hex(unsigned short, daddr, 8) + ) +) + +TRACEPOINT_STRUCT_RAW(net, tcp_fields, + + TP_PROTO(struct tcphdr *hdr), + + TP_ARGS(hdr), + + TP_FIELDS(__field_network(unsigned short, source) + __field_network(unsigned short, dest) + __field_network_hex(unsigned int, seq) + __field_network_hex(unsigned int, ack_seq) + __field_network_hex(unsigned short, flags) + __field_network_hex(unsigned short, window) + __field_network_hex(unsigned short, check) + __field_network_hex(unsigned short, urg_ptr) + ) +) + +TRACEPOINT_VARIANT(net, network, + + TP_PROTO(unsigned char enum_val, struct sk_buff *skb), + + TP_ARGS(skb), + + net, network_header, enum_val, + + TP_VARIANTS( + TP_VARIANT(nhtype_none, __struct(net, empty_struct, nhtype_none, skb)) + TP_VARIANT(nhtype_ip, __struct(net, ip_fields, nhtype_ip, ip_hdr(skb))) + TP_VARIANT(nhtype_ip6, __struct(net, ipv6_fields, nhtype_ip6, ipv6_hdr(skb))) + ), + + TP_fast_assign( + TP_variants_assign( + TP_variant_assign(nhtype_none, tp_memcpy_struct(net, empty_struct, nhtype_none, skb)) + TP_variant_assign(nhtype_ip, tp_memcpy_struct(net, ip_fields, nhtype_ip, ip_hdr(skb))) + TP_variant_assign(nhtype_ip6, tp_memcpy_struct(net, ipv6_fields, nhtype_ip6, ipv6_hdr(skb))) + ) + ) +) + +TRACEPOINT_VARIANT(net, transport, + + TP_PROTO(unsigned char enum_val, struct sk_buff *skb), + + TP_ARGS(skb), + + net, transport_header, enum_val, + + TP_VARIANTS( + TP_VARIANT(thtype_none, __struct(net, empty_struct, thtype_none, skb)) + TP_VARIANT(thtype_tcp, __struct(net, tcp_fields, thtype_tcp, tcp_hdr(skb))) + ), + + TP_fast_assign( + TP_variants_assign( + TP_variant_assign(thtype_none, tp_memcpy_struct(net, empty_struct, thtype_none, skb)) + TP_variant_assign(thtype_tcp, tp_memcpy_struct(net, tcp_fields, thtype_tcp, tcp_hdr(skb))) + ) + ) +) + +#endif + +DECLARE_EVENT_CLASS(net_dev_template_send, TP_PROTO(struct sk_buff *skb), TP_ARGS(skb), TP_STRUCT__entry( - __field( void *, skbaddr ) - __field( unsigned int, len ) - __string( name, skb->dev->name ) + __field(void *, skbaddr) + __field(unsigned int, len) + __string(name, skb->dev->name) + __field_enum(net, network_header, unsigned char, network_header) + __variant(net, network, network_fields, network_header, __get_send_network_header_type(skb), skb) + __field_enum(net, transport_header, unsigned char, transport_header) + __variant(net, transport, transport_fields, transport_header, __get_send_transport_header_type(skb), skb) + ), + + TP_fast_assign( + tp_assign(skbaddr, skb) + tp_assign(len, skb->len) + tp_strcpy(name, skb->dev->name) + tp_assign(network_header, __get_send_network_header_type(skb)) + tp_assign_variant(net, network, network_fields, __get_send_network_header_type(skb), skb) + tp_assign(transport_header, __get_send_transport_header_type(skb)) + tp_assign_variant(net, transport, transport_fields, __get_send_transport_header_type(skb), skb) + ), + + TP_printk("dev=%s skbaddr=%p len=%u", + __get_str(name), __entry->skbaddr, __entry->len) +) + +DECLARE_EVENT_CLASS(net_dev_template_recv, + + TP_PROTO(struct sk_buff *skb), + + TP_ARGS(skb), + + TP_STRUCT__entry( + __field(void *, skbaddr) + __field(unsigned int, len) + __string(name, skb->dev->name) + __field_enum(net, network_header, unsigned char, network_header) + __variant(net, network, network_fields, network_header, __get_recv_network_header_type(skb), skb) + __field_enum(net, transport_header, unsigned char, transport_header) + __variant(net, transport, transport_fields, transport_header, __get_recv_transport_header_type(skb), skb) + ), TP_fast_assign( tp_assign(skbaddr, skb) tp_assign(len, skb->len) tp_strcpy(name, skb->dev->name) + tp_assign(network_header, __get_recv_network_header_type(skb)) + tp_assign_variant(net, network, network_fields, __get_recv_network_header_type(skb), skb) + tp_assign(transport_header, __get_recv_transport_header_type(skb)) + tp_assign_variant(net, transport, transport_fields, __get_recv_transport_header_type(skb), skb) ), TP_printk("dev=%s skbaddr=%p len=%u", __get_str(name), __entry->skbaddr, __entry->len) ) -DEFINE_EVENT(net_dev_template, net_dev_queue, +DEFINE_EVENT(net_dev_template_send, net_dev_queue, TP_PROTO(struct sk_buff *skb), TP_ARGS(skb) ) -DEFINE_EVENT(net_dev_template, netif_receive_skb, +DEFINE_EVENT(net_dev_template_recv, netif_receive_skb, TP_PROTO(struct sk_buff *skb), TP_ARGS(skb) ) -DEFINE_EVENT(net_dev_template, netif_rx, +DEFINE_EVENT(net_dev_template_recv, netif_rx, TP_PROTO(struct sk_buff *skb), -- 1.8.2.1 From gbastien+lttng at versatic.net Wed Apr 24 16:14:20 2013 From: gbastien+lttng at versatic.net (=?UTF-8?q?Genevi=C3=A8ve=20Bastien?=) Date: Wed, 24 Apr 2013 16:14:20 -0400 Subject: [lttng-dev] [RFC-patch 5/5] Add macros to copy struct metadata field by field In-Reply-To: <1366834460-25567-1-git-send-email-gbastien+lttng@versatic.net> References: <1366834460-25567-1-git-send-email-gbastien+lttng@versatic.net> Message-ID: <1366834460-25567-6-git-send-email-gbastien+lttng@versatic.net> Just like DECLARE_EVENT_CLASS and TRACE_EVENT, the TRACEPOINT_STRUCT macro takes a TP_fast_assign parameter to allow to copy a struct data field by field. Signed-off-by: Genevi?ve Bastien --- probes/lttng-events-reset.h | 5 ++- probes/lttng-events.h | 95 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 91 insertions(+), 9 deletions(-) diff --git a/probes/lttng-events-reset.h b/probes/lttng-events-reset.h index f115d5e..0ed685a 100644 --- a/probes/lttng-events-reset.h +++ b/probes/lttng-events-reset.h @@ -47,7 +47,7 @@ #define __string(_item, _src) #undef __struct -#define __struct(_provider, _type, _item, _params) +#define __struct(_provider, _type, _item, _params...) #undef __variant #define __variant(_provider, _type, _item, _enum_field, _enum, _src...) @@ -136,6 +136,9 @@ #undef TRACEPOINT_STRUCT_RAW #define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields, _assign) + #undef TRACEPOINT_ENUM #define TRACEPOINT_ENUM(_provider, _name, _type, _enum) diff --git a/probes/lttng-events.h b/probes/lttng-events.h index 7e3a5b0..a49d7a0 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -350,7 +350,7 @@ end: \ __string(_item, _src) #undef __struct -#define __struct(_provider, _type, _item, _params) \ +#define __struct(_provider, _type, _item, _params...) \ { \ .name = #_item, \ .type = \ @@ -405,6 +405,11 @@ end: \ _fields \ }; +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields, _assign)\ + TRACEPOINT_STRUCT_RAW(_provider, _name, PARAMS(_proto), \ + PARAMS(_args), PARAMS(_fields)) + #undef TRACEPOINT_VARIANT #define TRACEPOINT_VARIANT(_provider, _name, _proto, _args, _enum_provider, _enum_name, _earg, _variants, _assign)\ static const struct lttng_event_field \ @@ -464,6 +469,11 @@ static struct lttng_struct_desc __struct_desc___##_provider##_##_name = {\ .owner = THIS_MODULE, \ }; +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields, _assign)\ + TRACEPOINT_STRUCT_RAW(_provider, _name, PARAMS(_proto), \ + PARAMS(_args), PARAMS(_fields)) + #undef TP_TYPE #define TP_TYPE(_type) _type @@ -500,7 +510,7 @@ static struct lttng_struct_desc __variant_desc__##_provider##_##_name = {\ #include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */ #undef __struct -#define __struct(_provider, _type, _item, _params) \ +#define __struct(_provider, _type, _item, _params...) \ { \ .mtype = mtype_struct, \ .m.ctf_st.struct_desc = &__struct_desc___##_provider##_##_type,\ @@ -542,6 +552,11 @@ static const struct lttng_metadata __type_metadata_for__##_provider##_##_name[] _fields \ }; +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields, _assign)\ + TRACEPOINT_STRUCT_RAW(_provider, _name, PARAMS(_proto), \ + PARAMS(_args), PARAMS(_fields)) + #undef TRACEPOINT_VARIANT #define TRACEPOINT_VARIANT(_provider, _name, _proto, _args, _enum_provider, _enum_name, _earg, _variants, _assign)\ static const struct lttng_metadata __type_metadata_for_var__##_provider##_##_name[] = {\ @@ -685,7 +700,7 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { __event_len += max_t(size_t, lttng_strlen_user_inatomic(_src), 1); #undef __struct -#define __struct(_provider, _type, _item, _params) \ +#define __struct(_provider, _type, _item, _params...) \ __event_len += __struct_get_size__##_provider##_##_type(_params);\ #undef __field_enum @@ -718,6 +733,11 @@ static inline size_t __struct_get_size__##_provider##_##_name(_proto) \ return __event_len; \ } +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields, _assign)\ + TRACEPOINT_STRUCT_RAW(_provider, _name, PARAMS(_proto), \ + PARAMS(_args), PARAMS(_fields)) + #undef TRACEPOINT_ENUM #define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ static inline size_t __enum_get_size__##_provider##_##_name(void) \ @@ -778,7 +798,7 @@ static inline size_t __variant_get_size__##_provider##_##_name(_proto) \ max_t(size_t, lttng_strlen_user_inatomic(_src), 1); #undef __struct -#define __struct(_provider, _type, _item, _params) \ +#define __struct(_provider, _type, _item, _params...) \ __event_len += __dynamic_len[__dynamic_len_idx++] = \ __struct_get_size__##_provider##_##_type(_params); @@ -790,6 +810,19 @@ static inline size_t __variant_get_size__##_provider##_##_name(_proto) \ #undef TRACEPOINT_STRUCT_RAW #define TRACEPOINT_STRUCT_RAW(_provider, _name, _proto, _args, _fields) +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields, _assign)\ +static inline size_t __struct_get_size_full__##_provider##_##_name(size_t *__dynamic_len, _proto) \ + { \ + size_t __event_len = 0; \ + unsigned int __dynamic_len_idx = 0; \ + \ + if (0) \ + (void) __dynamic_len_idx; /* don't warn if unused */\ + _fields \ + return __event_len; \ +} + #undef TRACEPOINT_ENUM #define TRACEPOINT_ENUM(_provider, _name, _type, _enum) @@ -863,7 +896,7 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ #define __string_from_user(_item, _src) #undef __struct -#define __struct(_provider, _type, _item, _params) \ +#define __struct(_provider, _type, _item, _params...) \ __event_align = max_t(size_t, __event_align, \ __instruct_get_align__##_provider##_##_type(_params)); @@ -911,6 +944,11 @@ static inline size_t __instruct_get_align__##_provider##_##_name(_proto)\ return __struct_get_align__##_provider##_##_name(_args); \ } +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields, _assign)\ + TRACEPOINT_STRUCT_RAW(_provider, _name, PARAMS(_proto), \ + PARAMS(_args), PARAMS(_fields)) + #undef TRACEPOINT_ENUM #define TRACEPOINT_ENUM(_provider, _name, _type, _enum) \ static inline size_t __enum_get_align__##_provider##_##_name(void) \ @@ -972,7 +1010,7 @@ static inline size_t __event_get_align__##_name(_proto) \ __string(_item, _src) #undef __struct -#define __struct(_provider, _type, _item, _params) char _item; +#define __struct(_provider, _type, _item, _params...) char _item; #undef __field_enum #define __field_enum(_provider, _type, _data_type, _item) \ @@ -985,6 +1023,9 @@ static inline size_t __event_get_align__##_name(_proto) \ #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args +#undef TP_FIELDS +#define TP_FIELDS(args...) args + #undef TP_VARIANTS #define TP_VARIANTS(args...) args @@ -997,6 +1038,12 @@ struct __variant_typemap__##_provider##_##_name { \ _variants \ }; +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields, _assign)\ +struct __struct_typemap__##_provider##_##_name { \ + _fields \ +}; + #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \ struct __event_typemap__##_name { \ @@ -1054,7 +1101,7 @@ __end_field_##_item: __string(_item, _src) #undef __struct -#define __struct(_provider, _type, _item, _params) \ +#define __struct(_provider, _type, _item, _params...) \ goto __assign_##_item; \ __end_field_##_item: @@ -1136,6 +1183,14 @@ __assign_##dest: \ #define tp_memcpy_struct(provider, name, dest, src) \ tp_memcpy_struct_gen(event_write, provider, name, dest, src) +/* Still have to consume the array len of this field */ +#undef tp_assign_struct +#define tp_assign_struct(provider, name, dest, src...) \ +__assign_##dest: \ + __dynamic_len_idx++; \ + __struct_assign__##provider##_##name(__ctxptr, __chan, src); \ + goto __end_field_##dest; + /* * This supposes that the variant field is at the same place (same src) for * each variant, which is not the case most of the time. @@ -1160,7 +1215,6 @@ __assign_##dest: \ __variant_assign__##provider##_##name(__ctxptr, __chan, enum_value, src);\ goto __end_field_##dest; - /* * The string length including the final \0. */ @@ -1206,6 +1260,9 @@ __assign_##dest: \ #undef TP_STRUCT__entry #define TP_STRUCT__entry(args...) args +#undef TP_FIELDS +#define TP_FIELDS(args...) args + #undef TP_fast_assign #define TP_fast_assign(args...) args @@ -1224,6 +1281,28 @@ case enum_##_value: \ __end_field_##_value: \ break; +#undef TRACEPOINT_STRUCT +#define TRACEPOINT_STRUCT(_provider, _name, _proto, _args, _fields, _assign)\ +static void __struct_assign__##_provider##_##_name(struct lib_ring_buffer_ctx *__ctxptr,\ + struct lttng_channel *__chan, _proto) \ +{ \ + struct __struct_typemap__##_provider##_##_name __typemap; \ + size_t __struct_len, __struct_align; \ + size_t __dynamic_len_idx = 0; \ + size_t __dynamic_len[ARRAY_SIZE(__struct_fields___##_provider##_##_name)];\ + \ + if (0) { \ + (void) __dynamic_len_idx; /* don't warn if unused */ \ + (void) __struct_len; /* don't warn if unused */ \ + (void) __struct_align; \ + } \ + __struct_len = __struct_get_size_full__##_provider##_##_name(__dynamic_len, _args);\ + __struct_align = __struct_get_align__##_provider##_##_name(_args);\ + _fields \ + return; \ + _assign \ +} + #undef TRACEPOINT_VARIANT #define TRACEPOINT_VARIANT(_provider, _name, _proto, _args, _enum_provider, _enum_name, _earg, _variants, _assign)\ static void __variant_assign__##_provider##_##_name(struct lib_ring_buffer_ctx *__ctxptr,\ -- 1.8.2.1 From jistone at redhat.com Wed Apr 24 16:32:09 2013 From: jistone at redhat.com (Josh Stone) Date: Wed, 24 Apr 2013 13:32:09 -0700 Subject: [lttng-dev] GSoC 2013, "C++ probe support" project and more In-Reply-To: References: Message-ID: <51784149.3020500@redhat.com> On 04/24/2013 08:45 AM, Zifei Tong wrote: > Hi Christian, > > On Sun, Apr 21, 2013 at 2:44 AM, Christian Babeux > wrote: >> The improvement of liblttng-ust-libc has nothing to do with dyninst. >> Maybe you meant the dynamic instrumentation project? > > I played with dyninst today. Here is a minimal working example: > https://gist.github.com/5kg/5451894 > > Dyninst is a really cool project (after struggling to get it work), > and I am more confident that the "Dynamic instrumentation support in > UST" project is doable as a GSoC project. The systemtap project is a > great reference [1]. Thanks! Please feel free to ask questions about that code on the systemtap list. And of course I'm still learning Dyninst myself, so if you come you come across any way to improve things that stapdyn is doing, I'd love that feedback too. > > Expected results might be somthing like this: > http://sourceware.org/systemtap/SystemTap_Beginners_Guide/userspace-probing.html > . > > [1] http://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=tree;f=stapdyn;hb=HEAD > [2] http://lists.lttng.org/pipermail/lttng-dev/2013-February/019636.html > > -- > Best Regards, > Zifei Tong > > _______________________________________________ > 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 Wed Apr 24 17:25:36 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Wed, 24 Apr 2013 21:25:36 +0000 Subject: [lttng-dev] checkinstall and lttng-ust with Java/JNI support Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D10094@VAL-E-02.valcartier.drdc-rddc.gc.ca> I was fooling around with checkinstall in order to create installation packages for lttng-modules, userspace-rcu, etc., when I ran into what seems a very obscure bug (googling for the error message "unable to create `/proc/self/coredump_filter.dpkg-new'" brings up nothing). It occurs when building the Debian package for lttng-ust, but only if Java/JNI support was requested. That is to say, building lttng-ust with no extra support or with just systemtap support packages just fine. But when I build it with JNI/Java support, the 'sudo checkinstall make install' runs into this at the end: Selecting previously unselected package lttng-ust-java. (Reading database ... 147274 files and directories currently installed.) Unpacking lttng-ust-java (from .../lttng-ust-java_2.2.0-rc1-12_amd64.deb) ... dpkg: error processing /home/daniel/Documents/git.lttng.org/lttng-ust-2.2.0-rc1+-a16877a-Java/lttng-ust-java_2.2.0-rc1-12_amd64.deb (--install): unable to create `/proc/self/coredump_filter.dpkg-new' (while processing `./proc/self/coredump_filter'): No such file or directory Processing triggers for man-db ... Errors were encountered while processing: /home/daniel/Documents/git.lttng.org/lttng-ust-2.2.0-rc1+-a16877a-Java/lttng-ust-java_2.2.0-rc1-12_amd64.deb Note that the install supervised by checkinstall worked fine, and the package was built successfully: the problem occurs when the package is fed to apt, it seems. The resulting package will cause the same error when run through the Ubuntu Software Centre, for instance, meaning it is unusable. Any clues as to what is failing here? 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 From alexmonthy at voxpopuli.im Wed Apr 24 17:48:21 2013 From: alexmonthy at voxpopuli.im (Alexandre Montplaisir) Date: Wed, 24 Apr 2013 17:48:21 -0400 Subject: [lttng-dev] checkinstall and lttng-ust with Java/JNI support In-Reply-To: <48CF5AC71E61DB46B70D0F388054EFFD12D10094@VAL-E-02.valcartier.drdc-rddc.gc.ca> References: <48CF5AC71E61DB46B70D0F388054EFFD12D10094@VAL-E-02.valcartier.drdc-rddc.gc.ca> Message-ID: <51785325.3030509@voxpopuli.im> Hi Daniel, On 13-04-24 05:25 PM, Thibault, Daniel wrote: > I was fooling around with checkinstall in order to create installation packages for lttng-modules, userspace-rcu, etc., when I ran into what seems a very obscure bug (googling for the error message "unable to create `/proc/self/coredump_filter.dpkg-new'" brings up nothing). > > It occurs when building the Debian package for lttng-ust, but only if Java/JNI support was requested. That is to say, building lttng-ust with no extra support or with just systemtap support packages just fine. > > But when I build it with JNI/Java support, the 'sudo checkinstall make install' runs into this at the end: > > Selecting previously unselected package lttng-ust-java. > (Reading database ... 147274 files and directories currently installed.) > Unpacking lttng-ust-java (from .../lttng-ust-java_2.2.0-rc1-12_amd64.deb) ... > dpkg: error processing /home/daniel/Documents/git.lttng.org/lttng-ust-2.2.0-rc1+-a16877a-Java/lttng-ust-java_2.2.0-rc1-12_amd64.deb (--install): > unable to create `/proc/self/coredump_filter.dpkg-new' (while processing `./proc/self/coredump_filter'): No such file or directory > Processing triggers for man-db ... > Errors were encountered while processing: > /home/daniel/Documents/git.lttng.org/lttng-ust-2.2.0-rc1+-a16877a-Java/lttng-ust-java_2.2.0-rc1-12_amd64.deb > > Note that the install supervised by checkinstall worked fine, and the package was built successfully: the problem occurs when the package is fed to apt, it seems. The resulting package will cause the same error when run through the Ubuntu Software Centre, for instance, meaning it is unusable. > > Any clues as to what is failing here? checkinstall has always been kind of sloppy. You could get some insight by printing the contents of the package (by doing "dpkg-deb --contents .deb"), it could be an invalid character somewhere, a path it doesn't recognize, etc. But if you want to build .deb packages to install on something other than your own machine, you should really use dpkg-buildpackage or, even better, pbuilder. Those require proper packaging information in a debian/ sub-directory. You can look at the debian/ directories in the Ubuntu packages (which you can get with "apt-get source lttng-ust"), it should be straightforward to tweak it to your needs. Cheers, Alexandre > > 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 From suchakrapani.sharma at polymtl.ca Wed Apr 24 23:21:34 2013 From: suchakrapani.sharma at polymtl.ca (Suchakrapani Datt Sharma) Date: Wed, 24 Apr 2013 23:21:34 -0400 Subject: [lttng-dev] GSoC 2013, "C++ probe support" project and more In-Reply-To: References: Message-ID: <1366860094.5178a13e78f12@www.imp.polymtl.ca> Hi Zifei, Quoting Zifei Tong : > I played with dyninst today. Here is a minimal working example: > https://gist.github.com/5kg/5451894 Nice! I have done something similar here and I was able to build and insert code snippets. But then I am more inclined towards analysing performance of dyninst. You may also want to look at DynC API to build complex code snippets in a C like syntax for dyninst. > Dyninst is a really cool project (after struggling to get it work)... Yeah it took sometime to understand their nomenclature and analysing the assembly to see how it really mutates the binary. You might also be interested in 'fast tracepoint' infrastructure and normal tracepoints provided by gdb. I ran some tests with fast tracepoints using gdb on a same 'mutatee' code (as dyninst) and it performed quite better than just dyninst. (a million runs of traced function(with no 'action' performed by gdb on tracepoint hit) showed a 1.46% overhead - better tests are under way) But getting gdb's infra for dynamic tracing with UST may be somewhat a serious hack. Also, as you suggest stapdyn is also a good start to explore. I have not done that yet. I am going to start with getting elementary Dyninst+UST hack working from next week for continuing my tests/analysis and its gonna be good to hear from you about trials at your end. -- Suchakra From xiaonahappy13 at gmail.com Thu Apr 25 04:01:09 2013 From: xiaonahappy13 at gmail.com (Xiaona Han) Date: Thu, 25 Apr 2013 16:01:09 +0800 Subject: [lttng-dev] GSoC 2013 idea: support a new language binding for lttng In-Reply-To: <517680EA.50203@gmail.com> References: <517680EA.50203@gmail.com> Message-ID: Hi Yannick, 2013/4/23 Yannick Brosseau > On 2013-04-15 10:25, Xiaona Han wrote: > > Hi Yannick > > Thanks for your encouragement. I take a quick look at the source > > code of lttng and find that lttng-tools has python bindings code. It > > means that support Lua bindings mainly need finish the code, > > documentations and tests for the lttng-tools. What about babeltrace? > > Do we need support Lua bindings for babeltrace APIs in this project? > Hi Xiaona, > > I taken a look at your proposal for GSoC. As you say here, looking at > the babeltrace API could also be interesting and could fit very well in > the time frame. Last year, we had an intern doing the binding for Python > and i fitted well in 4 months. > I would also suggest, that you add some exploration for the addition of > UST tracepoint to the lua language. This one is probably more > complicated, so it might be added to the description as an additionnal > item if time permit. > Done. The main change of the proposal is the timeline part. Thanks. Xiaona Han Best regards. > > Yannick > -------------- next part -------------- An HTML attachment was scrubbed... URL: From liljegren.mats2 at gmail.com Thu Apr 25 04:23:02 2013 From: liljegren.mats2 at gmail.com (Mats Liljegren) Date: Thu, 25 Apr 2013 10:23:02 +0200 Subject: [lttng-dev] Changed scheduling when using lttng Message-ID: I'm doing a benchmark application which intends to benchmark the effects of using the full nohz mode. I initially tried ftrace, but it had too much overhead, so I tried lttng instead. While I'm happy with the overhead in lttng, it has another problem: My application never executes in full nohz mode. In my investigation of why, I came up with the following two logs, first using ftrace with sched_switch event enabled: testapp-2048 [001] d... 50744.932281: sched_switch: prev_comm=testapp prev_pid=2048 prev_prio=139 prev_state=R ==> next_comm=kworker/1:1 next_pid=25 next_prio=120 kworker/1:1-25 [001] d... 50744.932312: sched_switch: prev_comm=kworker/1:1 prev_pid=25 prev_prio=120 prev_state=S ==> next_comm=ksoftirqd/1 next_pid=14 next_prio=120 >>> ksoftirqd/1-14 [001] d... 50744.932343: sched_switch: prev_comm=ksoftirqd/1 prev_pid=14 prev_prio=120 prev_state=S ==> next_comm=testapp next_pid=2048 next_prio=139 <<< testapp-2048 [001] d... 50747.789948: sched_switch: prev_comm=testapp prev_pid=2048 prev_prio=139 prev_state=D ==> next_comm=kworker/1:1 next_pid=25 next_prio=120 kworker/1:1-25 [001] d... 50747.789978: sched_switch: prev_comm=kworker/1:1 prev_pid=25 prev_prio=120 prev_state=S ==> next_comm=testapp next_pid=2048 next_prio=139 testapp-2048 [001] d... 50747.799103: sched_switch: prev_comm=testapp prev_pid=2048 prev_prio=139 prev_state=R ==> next_comm=kworker/1:1 next_pid=25 next_prio=120 The line ">>>" is when the testapp is starting its benchmarking, and "<<<" when it has finished. As can be seen, the execution is done uninterrupted by any schedule switched for the whole 30s period. The second test was with lttng with sched_switch tracepoint enabled: [07:20:04.813293457] (+0.000823975) pandaboard sched_switch: { cpu_id = 1 }, { prev_comm = "swapper/1", prev_tid = 0, prev_prio = 20, prev_state = 0, next_comm = "testapp", next_tid = 3027, next_prio = 39 } [07:20:05.062438964] (+0.159973144) pandaboard sched_switch: { cpu_id = 1 }, { prev_comm = "testapp", prev_tid = 3027, prev_prio = 39, prev_state = 0, next_comm = "ksoftirqd/1", next_tid = 14, next_prio = 20 } [07:20:05.062469482] (+0.000030518) pandaboard sched_switch: { cpu_id = 1 }, { prev_comm = "ksoftirqd/1", prev_tid = 14, prev_prio = 20, prev_state = 1, next_comm = "testapp", next_tid = 3027, next_prio = 39 } [07:20:05.312438964] (+0.249969482) pandaboard sched_switch: { cpu_id = 1 }, { prev_comm = "testapp", prev_tid = 3027, prev_prio = 39, prev_state = 0, next_comm = "ksoftirqd/1", next_tid = 14, next_prio = 20 } [07:20:05.312438964] (+0.000000000) pandaboard sched_switch: { cpu_id = 1 }, { prev_comm = "ksoftirqd/1", prev_tid = 14, prev_prio = 20, prev_state = 1, next_comm = "testapp", next_tid = 3027, next_prio = 39 } [07:20:05.682434082] (+0.369995118) pandaboard sched_switch: { cpu_id = 1 }, { prev_comm = "testapp", prev_tid = 3027, prev_prio = 39, prev_state = 0, next_comm = "kworker/1:1", next_tid = 25, next_prio = 20 } [07:20:05.682464599] (+0.000030517) pandaboard sched_switch: { cpu_id = 1 }, { prev_comm = "kworker/1:1", prev_tid = 25, prev_prio = 20, prev_state = 1, next_comm = "testapp", next_tid = 3027, next_prio = 39 } [07:20:06.282440185] (+0.569976807) pandaboard sched_switch: { cpu_id = 1 }, { prev_comm = "testapp", prev_tid = 3027, prev_prio = 39, prev_state = 0, next_comm = "ksoftirqd/1", next_tid = 14, next_prio = 20 } [07:20:06.282440185] (+0.000000000) pandaboard sched_switch: { cpu_id = 1 }, { prev_comm = "ksoftirqd/1", prev_tid = 14, prev_prio = 20, prev_state = 1, next_comm = "testapp", next_tid = 3027, next_prio = 39 } [07:20:06.682434082] (+0.399993897) pandaboard sched_switch: { cpu_id = 1 }, { prev_comm = "testapp", prev_tid = 3027, prev_prio = 39, prev_state = 0, next_comm = "kworker/1:1", next_tid = 25, next_prio = 20 } [07:20:06.682464599] (+0.000030517) pandaboard sched_switch: { cpu_id = 1 }, { prev_comm = "kworker/1:1", prev_tid = 25, prev_prio = 20, prev_state = 1, next_comm = "testapp", next_tid = 3027, next_prio = 39 } and so on... As can be seen, the scheduling is changed when lttng runs. It seems like lttng makes the non-migratable kthreads kworker/1:1 and ksoftirq/1 busy which totally destroyes measurements in my application since nohz mode is never entered. Is there a way around this? What is causing this behavior? /Mats From Daniel.Thibault at drdc-rddc.gc.ca Thu Apr 25 09:41:20 2013 From: Daniel.Thibault at drdc-rddc.gc.ca (Thibault, Daniel) Date: Thu, 25 Apr 2013 13:41:20 +0000 Subject: [lttng-dev] checkinstall and lttng-ust with Java/JNI support In-Reply-To: <51785325.3030509@voxpopuli.im> References: <48CF5AC71E61DB46B70D0F388054EFFD12D10094@VAL-E-02.valcartier.drdc-rddc.gc.ca> <51785325.3030509@voxpopuli.im> Message-ID: <48CF5AC71E61DB46B70D0F388054EFFD12D10183@VAL-E-02.valcartier.drdc-rddc.gc.ca> -----Message d'origine----- De?: Alexandre Montplaisir [mailto:alexmonthy at voxpopuli.im] Envoy??: 24 avril 2013 17:48 > On 13-04-24 05:25 PM, Thibault, Daniel wrote: >> dpkg: error processing /home/daniel/Documents/git.lttng.org/lttng-ust-2.2.0-rc1+-a16877a-Java/lttng-ust-java_2.2.0-rc1-12_amd64.deb (--install): >> unable to create `/proc/self/coredump_filter.dpkg-new' (while >> processing `./proc/self/coredump_filter'): No such file or directory Processing triggers for man-db ... >> Errors were encountered while processing: > > checkinstall has always been kind of sloppy. You could get some insight by printing the contents of the package (by doing "dpkg-deb --contents .deb"), it could be an invalid character somewhere, a path it doesn't recognize, etc. Comparison with the other two packages shows the problem is that checkinstall somehow included ./proc/self/coredump_filter in the contents. The installer fails when trying to create this, of course. A bug has been filed against checkinstall with Ubuntu Launchpad (#1172711). Fixing this turns out to be very simple: I deployed the deb's contents using the "Extract Here" contextual menu, renamed the old deb to *.original, deleted the offending proc subdirectory from the deployed contents, and finally repackaged the contents with 'dpkg --build '. Worked like a charm. > But if you want to build .deb packages to install on something other than your own machine, you should really use dpkg-buildpackage or, even better, pbuilder. Those require proper packaging information in a debian/ sub-directory. You can look at the debian/ directories in the Ubuntu packages (which you can get with "apt-get source lttng-ust"), it should be straightforward to tweak it to your needs. Thanks for the tip. I'll look into those. 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 From christian.babeux at efficios.com Thu Apr 25 09:51:20 2013 From: christian.babeux at efficios.com (Christian Babeux) Date: Thu, 25 Apr 2013 09:51:20 -0400 Subject: [lttng-dev] GSoC 2013, "C++ probe support" project and more In-Reply-To: References: Message-ID: Hi Zifei, The dynamic instrumentation project is very interesting indeed. I also think it could be doable as a GSoC project. Do you have any plan on how you would integrate dyninst with UST? Also, a quick reminder that the GSoC application for student is open until May 3rd. Don't forget to send us your proposal :)! Thanks, Christian On Wed, Apr 24, 2013 at 11:45 AM, Zifei Tong wrote: > Hi Christian, > > On Sun, Apr 21, 2013 at 2:44 AM, Christian Babeux > wrote: >> The improvement of liblttng-ust-libc has nothing to do with dyninst. >> Maybe you meant the dynamic instrumentation project? > > I played with dyninst today. Here is a minimal working example: > https://gist.github.com/5kg/5451894 > > Dyninst is a really cool project (after struggling to get it work), > and I am more confident that the "Dynamic instrumentation support in > UST" project is doable as a GSoC project. The systemtap project is a > great reference [1]. > > Expected results might be somthing like this: > http://sourceware.org/systemtap/SystemTap_Beginners_Guide/userspace-probing.html > . > > [1] http://sourceware.org/git/gitweb.cgi?p=systemtap.git;a=tree;f=stapdyn;hb=HEAD > [2] http://lists.lttng.org/pipermail/lttng-dev/2013-February/019636.html > > -- > Best Regards, > Zifei Tong From mathieu.desnoyers at efficios.com Thu Apr 25 11:12:13 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Thu, 25 Apr 2013 11:12:13 -0400 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: References: Message-ID: <20130425151213.GC7970@Krystal> Hi Mats, The ring buffer uses the standard "timers" in the kernel to flush the buffers periodically, which prevents your kernel from going into nohz. Originally, when implemented as a patch on the Linux kernel, the ring buffer design had hooks in the nohz kernel events to disable this timer when going to nohz. Now, given LTTng is a kernel module, it cannot modify the kernel code, and no callback mechanism exists for nohz. There are two ways to work around this issue that does not require modifying the Linux kernel: 1) Implement RING_BUFFER_WAKEUP_BY_WRITER within lttng-modules ring buffer. it should become used by default if the following is specified at channel creation: lttng enable-channel mychan -k --read-timer 0 It can be an issue if you want to trace page fault, and instrument code sensitive to lock usage (when using WAKEUP_BY_WRITER, the tracer is not lock-free anymore). It's the main reason why I have not implemented this mode yet: making sure the tracer never breaks the kernel in this mode is trickier. 2) use deferrable timers. It's a hack, but it should allow our timers to be inhibited when the cpus go in nohz. Sorry, low-impact on nohz has not really been on our sponsor's priority lists so far. Thanks, Mathieu * Mats Liljegren (liljegren.mats2 at gmail.com) wrote: > I'm doing a benchmark application which intends to benchmark the > effects of using the full nohz mode. I initially tried ftrace, but it > had too much overhead, so I tried lttng instead. While I'm happy with > the overhead in lttng, it has another problem: My application never > executes in full nohz mode. > > In my investigation of why, I came up with the following two logs, > first using ftrace with sched_switch event enabled: > > testapp-2048 [001] d... 50744.932281: sched_switch: > prev_comm=testapp prev_pid=2048 prev_prio=139 prev_state=R ==> > next_comm=kworker/1:1 next_pid=25 next_prio=120 > kworker/1:1-25 [001] d... 50744.932312: sched_switch: > prev_comm=kworker/1:1 prev_pid=25 prev_prio=120 prev_state=S ==> > next_comm=ksoftirqd/1 next_pid=14 next_prio=120 > >>> ksoftirqd/1-14 [001] d... 50744.932343: sched_switch: prev_comm=ksoftirqd/1 prev_pid=14 prev_prio=120 prev_state=S ==> next_comm=testapp next_pid=2048 next_prio=139 > <<< testapp-2048 [001] d... 50747.789948: sched_switch: > prev_comm=testapp prev_pid=2048 prev_prio=139 prev_state=D ==> > next_comm=kworker/1:1 next_pid=25 next_prio=120 > kworker/1:1-25 [001] d... 50747.789978: sched_switch: > prev_comm=kworker/1:1 prev_pid=25 prev_prio=120 prev_state=S ==> > next_comm=testapp next_pid=2048 next_prio=139 > testapp-2048 [001] d... 50747.799103: sched_switch: > prev_comm=testapp prev_pid=2048 prev_prio=139 prev_state=R ==> > next_comm=kworker/1:1 next_pid=25 next_prio=120 > > The line ">>>" is when the testapp is starting its benchmarking, and > "<<<" when it has finished. As can be seen, the execution is done > uninterrupted by any schedule switched for the whole 30s period. > > The second test was with lttng with sched_switch tracepoint enabled: > > [07:20:04.813293457] (+0.000823975) pandaboard sched_switch: { cpu_id > = 1 }, { prev_comm = "swapper/1", prev_tid = 0, prev_prio = 20, > prev_state = 0, next_comm = "testapp", next_tid = 3027, next_prio = 39 > } > [07:20:05.062438964] (+0.159973144) pandaboard sched_switch: { cpu_id > = 1 }, { prev_comm = "testapp", prev_tid = 3027, prev_prio = 39, > prev_state = 0, next_comm = "ksoftirqd/1", next_tid = 14, next_prio = > 20 } > [07:20:05.062469482] (+0.000030518) pandaboard sched_switch: { cpu_id > = 1 }, { prev_comm = "ksoftirqd/1", prev_tid = 14, prev_prio = 20, > prev_state = 1, next_comm = "testapp", next_tid = 3027, next_prio = 39 > } > [07:20:05.312438964] (+0.249969482) pandaboard sched_switch: { cpu_id > = 1 }, { prev_comm = "testapp", prev_tid = 3027, prev_prio = 39, > prev_state = 0, next_comm = "ksoftirqd/1", next_tid = 14, next_prio = > 20 } > [07:20:05.312438964] (+0.000000000) pandaboard sched_switch: { cpu_id > = 1 }, { prev_comm = "ksoftirqd/1", prev_tid = 14, prev_prio = 20, > prev_state = 1, next_comm = "testapp", next_tid = 3027, next_prio = 39 > } > [07:20:05.682434082] (+0.369995118) pandaboard sched_switch: { cpu_id > = 1 }, { prev_comm = "testapp", prev_tid = 3027, prev_prio = 39, > prev_state = 0, next_comm = "kworker/1:1", next_tid = 25, next_prio = > 20 } > [07:20:05.682464599] (+0.000030517) pandaboard sched_switch: { cpu_id > = 1 }, { prev_comm = "kworker/1:1", prev_tid = 25, prev_prio = 20, > prev_state = 1, next_comm = "testapp", next_tid = 3027, next_prio = 39 > } > [07:20:06.282440185] (+0.569976807) pandaboard sched_switch: { cpu_id > = 1 }, { prev_comm = "testapp", prev_tid = 3027, prev_prio = 39, > prev_state = 0, next_comm = "ksoftirqd/1", next_tid = 14, next_prio = > 20 } > [07:20:06.282440185] (+0.000000000) pandaboard sched_switch: { cpu_id > = 1 }, { prev_comm = "ksoftirqd/1", prev_tid = 14, prev_prio = 20, > prev_state = 1, next_comm = "testapp", next_tid = 3027, next_prio = 39 > } > [07:20:06.682434082] (+0.399993897) pandaboard sched_switch: { cpu_id > = 1 }, { prev_comm = "testapp", prev_tid = 3027, prev_prio = 39, > prev_state = 0, next_comm = "kworker/1:1", next_tid = 25, next_prio = > 20 } > [07:20:06.682464599] (+0.000030517) pandaboard sched_switch: { cpu_id > = 1 }, { prev_comm = "kworker/1:1", prev_tid = 25, prev_prio = 20, > prev_state = 1, next_comm = "testapp", next_tid = 3027, next_prio = 39 > } > > and so on... > > As can be seen, the scheduling is changed when lttng runs. It seems > like lttng makes the non-migratable kthreads kworker/1:1 and > ksoftirq/1 busy which totally destroyes measurements in my application > since nohz mode is never entered. > > Is there a way around this? What is causing this behavior? > > /Mats > > _______________________________________________ > 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 liljegren.mats2 at gmail.com Fri Apr 26 04:40:34 2013 From: liljegren.mats2 at gmail.com (Mats Liljegren) Date: Fri, 26 Apr 2013 10:40:34 +0200 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: <20130425151213.GC7970@Krystal> References: <20130425151213.GC7970@Krystal> Message-ID: On Thu, Apr 25, 2013 at 5:12 PM, Mathieu Desnoyers wrote: > Hi Mats, > > The ring buffer uses the standard "timers" in the kernel to flush the > buffers periodically, which prevents your kernel from going into nohz. > Originally, when implemented as a patch on the Linux kernel, the ring > buffer design had hooks in the nohz kernel events to disable this timer > when going to nohz. Now, given LTTng is a kernel module, it cannot > modify the kernel code, and no callback mechanism exists for nohz. > > There are two ways to work around this issue that does not require > modifying the Linux kernel: > > 1) Implement RING_BUFFER_WAKEUP_BY_WRITER within lttng-modules ring > buffer. > > it should become used by default if the following is specified at > channel creation: > > lttng enable-channel mychan -k --read-timer 0 > > It can be an issue if you want to trace page fault, and instrument > code sensitive to lock usage (when using WAKEUP_BY_WRITER, the tracer > is not lock-free anymore). It's the main reason why I have not > implemented this mode yet: making sure the tracer never breaks the > kernel in this mode is trickier. > > 2) use deferrable timers. It's a hack, but it should allow our timers to > be inhibited when the cpus go in nohz. > > Sorry, low-impact on nohz has not really been on our sponsor's priority > lists so far. > > Thanks, > > Mathieu I tried number 1 using --read-timer 0, but "lttng stop" hanged at "Waiting for data availability", producing lots of dots... Would it be possible to let some other (not using nohz mode) CPU to flush the buffers? /Mats From mathieu.desnoyers at efficios.com Fri Apr 26 09:26:39 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 26 Apr 2013 09:26:39 -0400 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: References: <20130425151213.GC7970@Krystal> Message-ID: <20130426132639.GA1468@Krystal> * Mats Liljegren (liljegren.mats2 at gmail.com) wrote: > On Thu, Apr 25, 2013 at 5:12 PM, Mathieu Desnoyers > wrote: > > Hi Mats, > > > > The ring buffer uses the standard "timers" in the kernel to flush the > > buffers periodically, which prevents your kernel from going into nohz. > > Originally, when implemented as a patch on the Linux kernel, the ring > > buffer design had hooks in the nohz kernel events to disable this timer > > when going to nohz. Now, given LTTng is a kernel module, it cannot > > modify the kernel code, and no callback mechanism exists for nohz. > > > > There are two ways to work around this issue that does not require > > modifying the Linux kernel: > > > > 1) Implement RING_BUFFER_WAKEUP_BY_WRITER within lttng-modules ring > > buffer. > > > > it should become used by default if the following is specified at > > channel creation: > > > > lttng enable-channel mychan -k --read-timer 0 > > > > It can be an issue if you want to trace page fault, and instrument > > code sensitive to lock usage (when using WAKEUP_BY_WRITER, the tracer > > is not lock-free anymore). It's the main reason why I have not > > implemented this mode yet: making sure the tracer never breaks the > > kernel in this mode is trickier. > > > > 2) use deferrable timers. It's a hack, but it should allow our timers to > > be inhibited when the cpus go in nohz. > > > > Sorry, low-impact on nohz has not really been on our sponsor's priority > > lists so far. > > > > Thanks, > > > > Mathieu > > I tried number 1 using --read-timer 0, but "lttng stop" hanged at > "Waiting for data availability", producing lots of dots... As I said, we'd need to implement RING_BUFFER_WAKEUP_BY_WRITER when read-timer is set to 0. It's not implemented currently. > > Would it be possible to let some other (not using nohz mode) CPU to > flush the buffers? I guess that would be option 3) : Another option would be to let a single thread in the consumer handle the read-timer for all streams of the channel, like we do for UST. Thanks, Mathieu > > /Mats -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From liljegren.mats2 at gmail.com Fri Apr 26 10:26:10 2013 From: liljegren.mats2 at gmail.com (Mats Liljegren) Date: Fri, 26 Apr 2013 16:26:10 +0200 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: <20130426132639.GA1468@Krystal> References: <20130425151213.GC7970@Krystal> <20130426132639.GA1468@Krystal> Message-ID: On Fri, Apr 26, 2013 at 3:26 PM, Mathieu Desnoyers wrote: > * Mats Liljegren (liljegren.mats2 at gmail.com) wrote: >> On Thu, Apr 25, 2013 at 5:12 PM, Mathieu Desnoyers >> wrote: >> > Hi Mats, >> > >> > The ring buffer uses the standard "timers" in the kernel to flush the >> > buffers periodically, which prevents your kernel from going into nohz. >> > Originally, when implemented as a patch on the Linux kernel, the ring >> > buffer design had hooks in the nohz kernel events to disable this timer >> > when going to nohz. Now, given LTTng is a kernel module, it cannot >> > modify the kernel code, and no callback mechanism exists for nohz. >> > >> > There are two ways to work around this issue that does not require >> > modifying the Linux kernel: >> > >> > 1) Implement RING_BUFFER_WAKEUP_BY_WRITER within lttng-modules ring >> > buffer. >> > >> > it should become used by default if the following is specified at >> > channel creation: >> > >> > lttng enable-channel mychan -k --read-timer 0 >> > >> > It can be an issue if you want to trace page fault, and instrument >> > code sensitive to lock usage (when using WAKEUP_BY_WRITER, the tracer >> > is not lock-free anymore). It's the main reason why I have not >> > implemented this mode yet: making sure the tracer never breaks the >> > kernel in this mode is trickier. >> > >> > 2) use deferrable timers. It's a hack, but it should allow our timers to >> > be inhibited when the cpus go in nohz. >> > >> > Sorry, low-impact on nohz has not really been on our sponsor's priority >> > lists so far. >> > >> > Thanks, >> > >> > Mathieu >> >> I tried number 1 using --read-timer 0, but "lttng stop" hanged at >> "Waiting for data availability", producing lots of dots... > > As I said, we'd need to implement RING_BUFFER_WAKEUP_BY_WRITER when > read-timer is set to 0. It's not implemented currently. > >> >> Would it be possible to let some other (not using nohz mode) CPU to >> flush the buffers? > > I guess that would be option 3) : > > Another option would be to let a single thread in the consumer handle > the read-timer for all streams of the channel, like we do for UST. Ehm, well, you did say something about implement... Sorry for missing that. I guess now the question is which option that gives best characteristics for least amount of work... Without knowing the design of lttng-module, I'd believe that simply having the timer on another CPU should be a good candidate. Is there anything to watch out for with this solution? Are there any documents describing lttng-module design, or is it "join the force, use the source"? I've seen some high-level description showing how tools/libs/modules fit together, but I haven't found anything that describes how lttng-modules is designed. /Mats From mathieu.desnoyers at efficios.com Fri Apr 26 11:14:45 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 26 Apr 2013 11:14:45 -0400 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: References: <20130425151213.GC7970@Krystal> <20130426132639.GA1468@Krystal> Message-ID: <20130426151444.GA2260@Krystal> * Mats Liljegren (liljegren.mats2 at gmail.com) wrote: > On Fri, Apr 26, 2013 at 3:26 PM, Mathieu Desnoyers > wrote: > > * Mats Liljegren (liljegren.mats2 at gmail.com) wrote: > >> On Thu, Apr 25, 2013 at 5:12 PM, Mathieu Desnoyers > >> wrote: > >> > Hi Mats, > >> > > >> > The ring buffer uses the standard "timers" in the kernel to flush the > >> > buffers periodically, which prevents your kernel from going into nohz. > >> > Originally, when implemented as a patch on the Linux kernel, the ring > >> > buffer design had hooks in the nohz kernel events to disable this timer > >> > when going to nohz. Now, given LTTng is a kernel module, it cannot > >> > modify the kernel code, and no callback mechanism exists for nohz. > >> > > >> > There are two ways to work around this issue that does not require > >> > modifying the Linux kernel: > >> > > >> > 1) Implement RING_BUFFER_WAKEUP_BY_WRITER within lttng-modules ring > >> > buffer. > >> > > >> > it should become used by default if the following is specified at > >> > channel creation: > >> > > >> > lttng enable-channel mychan -k --read-timer 0 > >> > > >> > It can be an issue if you want to trace page fault, and instrument > >> > code sensitive to lock usage (when using WAKEUP_BY_WRITER, the tracer > >> > is not lock-free anymore). It's the main reason why I have not > >> > implemented this mode yet: making sure the tracer never breaks the > >> > kernel in this mode is trickier. > >> > > >> > 2) use deferrable timers. It's a hack, but it should allow our timers to > >> > be inhibited when the cpus go in nohz. > >> > > >> > Sorry, low-impact on nohz has not really been on our sponsor's priority > >> > lists so far. > >> > > >> > Thanks, > >> > > >> > Mathieu > >> > >> I tried number 1 using --read-timer 0, but "lttng stop" hanged at > >> "Waiting for data availability", producing lots of dots... > > > > As I said, we'd need to implement RING_BUFFER_WAKEUP_BY_WRITER when > > read-timer is set to 0. It's not implemented currently. > > > >> > >> Would it be possible to let some other (not using nohz mode) CPU to > >> flush the buffers? > > > > I guess that would be option 3) : > > > > Another option would be to let a single thread in the consumer handle > > the read-timer for all streams of the channel, like we do for UST. > > Ehm, well, you did say something about implement... Sorry for missing that. > > I guess now the question is which option that gives best > characteristics for least amount of work... Without knowing the design > of lttng-module, I'd believe that simply having the timer on another > CPU should be a good candidate. Is there anything to watch out for > with this solution? > > Are there any documents describing lttng-module design, or is it "join > the force, use the source"? I've seen some high-level description > showing how tools/libs/modules fit together, but I haven't found > anything that describes how lttng-modules is designed. Papers on the ring buffer design exist, but not on lttng-modules per se. I think the best solution in the shortest amount of time would be (2): using deferrable timers. It's just flags to pass to timer creation. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From liljegren.mats2 at gmail.com Fri Apr 26 11:31:47 2013 From: liljegren.mats2 at gmail.com (Mats Liljegren) Date: Fri, 26 Apr 2013 17:31:47 +0200 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: <20130426151444.GA2260@Krystal> References: <20130425151213.GC7970@Krystal> <20130426132639.GA1468@Krystal> <20130426151444.GA2260@Krystal> Message-ID: >> >> I tried number 1 using --read-timer 0, but "lttng stop" hanged at >> >> "Waiting for data availability", producing lots of dots... >> > >> > As I said, we'd need to implement RING_BUFFER_WAKEUP_BY_WRITER when >> > read-timer is set to 0. It's not implemented currently. >> > >> >> >> >> Would it be possible to let some other (not using nohz mode) CPU to >> >> flush the buffers? >> > >> > I guess that would be option 3) : >> > >> > Another option would be to let a single thread in the consumer handle >> > the read-timer for all streams of the channel, like we do for UST. >> >> Ehm, well, you did say something about implement... Sorry for missing that. >> >> I guess now the question is which option that gives best >> characteristics for least amount of work... Without knowing the design >> of lttng-module, I'd believe that simply having the timer on another >> CPU should be a good candidate. Is there anything to watch out for >> with this solution? >> >> Are there any documents describing lttng-module design, or is it "join >> the force, use the source"? I've seen some high-level description >> showing how tools/libs/modules fit together, but I haven't found >> anything that describes how lttng-modules is designed. > > Papers on the ring buffer design exist, but not on lttng-modules per se. > > I think the best solution in the shortest amount of time would be (2): > using deferrable timers. It's just flags to pass to timer creation. Doesn't that require that the system is idle from time to time? My application will occupy 100% CPU until finished, and expects there are no ticks during that time. /Mats From mathieu.desnoyers at efficios.com Fri Apr 26 11:38:20 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 26 Apr 2013 11:38:20 -0400 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: References: <20130425151213.GC7970@Krystal> <20130426132639.GA1468@Krystal> <20130426151444.GA2260@Krystal> Message-ID: <20130426153819.GA3026@Krystal> * Mats Liljegren (liljegren.mats2 at gmail.com) wrote: > >> >> I tried number 1 using --read-timer 0, but "lttng stop" hanged at > >> >> "Waiting for data availability", producing lots of dots... > >> > > >> > As I said, we'd need to implement RING_BUFFER_WAKEUP_BY_WRITER when > >> > read-timer is set to 0. It's not implemented currently. > >> > > >> >> > >> >> Would it be possible to let some other (not using nohz mode) CPU to > >> >> flush the buffers? > >> > > >> > I guess that would be option 3) : > >> > > >> > Another option would be to let a single thread in the consumer handle > >> > the read-timer for all streams of the channel, like we do for UST. > >> > >> Ehm, well, you did say something about implement... Sorry for missing that. > >> > >> I guess now the question is which option that gives best > >> characteristics for least amount of work... Without knowing the design > >> of lttng-module, I'd believe that simply having the timer on another > >> CPU should be a good candidate. Is there anything to watch out for > >> with this solution? > >> > >> Are there any documents describing lttng-module design, or is it "join > >> the force, use the source"? I've seen some high-level description > >> showing how tools/libs/modules fit together, but I haven't found > >> anything that describes how lttng-modules is designed. > > > > Papers on the ring buffer design exist, but not on lttng-modules per se. > > > > I think the best solution in the shortest amount of time would be (2): > > using deferrable timers. It's just flags to pass to timer creation. > > Doesn't that require that the system is idle from time to time? My > application will occupy 100% CPU until finished, and expects there are > no ticks during that time. AFAIU, your initial question was about not preventing the CPU from going to low power mode when tracing. The deferred timers should do just that. Indeed, the timers will fire on CPUs that are active. I guess what you want there is no intrusiveness for CPU shielding. Indeed, for this kind of use-case, you may need to centralise the timer handling into lttng-consumerd. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From liljegren.mats2 at gmail.com Fri Apr 26 12:11:23 2013 From: liljegren.mats2 at gmail.com (Mats Liljegren) Date: Fri, 26 Apr 2013 18:11:23 +0200 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: <20130426153819.GA3026@Krystal> References: <20130425151213.GC7970@Krystal> <20130426132639.GA1468@Krystal> <20130426151444.GA2260@Krystal> <20130426153819.GA3026@Krystal> Message-ID: On Fri, Apr 26, 2013 at 5:38 PM, Mathieu Desnoyers wrote: > * Mats Liljegren (liljegren.mats2 at gmail.com) wrote: >> >> >> I tried number 1 using --read-timer 0, but "lttng stop" hanged at >> >> >> "Waiting for data availability", producing lots of dots... >> >> > >> >> > As I said, we'd need to implement RING_BUFFER_WAKEUP_BY_WRITER when >> >> > read-timer is set to 0. It's not implemented currently. >> >> > >> >> >> >> >> >> Would it be possible to let some other (not using nohz mode) CPU to >> >> >> flush the buffers? >> >> > >> >> > I guess that would be option 3) : >> >> > >> >> > Another option would be to let a single thread in the consumer handle >> >> > the read-timer for all streams of the channel, like we do for UST. >> >> >> >> Ehm, well, you did say something about implement... Sorry for missing that. >> >> >> >> I guess now the question is which option that gives best >> >> characteristics for least amount of work... Without knowing the design >> >> of lttng-module, I'd believe that simply having the timer on another >> >> CPU should be a good candidate. Is there anything to watch out for >> >> with this solution? >> >> >> >> Are there any documents describing lttng-module design, or is it "join >> >> the force, use the source"? I've seen some high-level description >> >> showing how tools/libs/modules fit together, but I haven't found >> >> anything that describes how lttng-modules is designed. >> > >> > Papers on the ring buffer design exist, but not on lttng-modules per se. >> > >> > I think the best solution in the shortest amount of time would be (2): >> > using deferrable timers. It's just flags to pass to timer creation. >> >> Doesn't that require that the system is idle from time to time? My >> application will occupy 100% CPU until finished, and expects there are >> no ticks during that time. > > AFAIU, your initial question was about not preventing the CPU from going > to low power mode when tracing. The deferred timers should do just that. > > Indeed, the timers will fire on CPUs that are active. > > I guess what you want there is no intrusiveness for CPU shielding. > Indeed, for this kind of use-case, you may need to centralise the timer > handling into lttng-consumerd. I realize I didn't express myself very clearly: There is a distinction between "full nohz" and "nohz idle". Full nohz means that if there are no competing threads there is no reason to have ticks, so turn ticks off. POSIX timers complicates things, but this was the simplistic view of it... This is currently implemented as an extension of nohz idle although they are quite orthogonal. Full nohz has been called "full dynticks" and "extended nohz", quite a lot of naming confusion here. I need to read up on the code to see what seems to be the best design. I thought just changing lib_ring_buffer_start_switch_timer() so that it used "add_timer_on(&buff->switch_timer, 0)" would do the trick, perhaps by using some kind of config for this case... But things are usually not as simple as they first appear to be. /Mats From mathieu.desnoyers at efficios.com Fri Apr 26 12:14:39 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 26 Apr 2013 12:14:39 -0400 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: References: <20130425151213.GC7970@Krystal> <20130426132639.GA1468@Krystal> <20130426151444.GA2260@Krystal> <20130426153819.GA3026@Krystal> Message-ID: <20130426161439.GA5547@Krystal> * Mats Liljegren (liljegren.mats2 at gmail.com) wrote: > On Fri, Apr 26, 2013 at 5:38 PM, Mathieu Desnoyers > wrote: > > * Mats Liljegren (liljegren.mats2 at gmail.com) wrote: > >> >> >> I tried number 1 using --read-timer 0, but "lttng stop" hanged at > >> >> >> "Waiting for data availability", producing lots of dots... > >> >> > > >> >> > As I said, we'd need to implement RING_BUFFER_WAKEUP_BY_WRITER when > >> >> > read-timer is set to 0. It's not implemented currently. > >> >> > > >> >> >> > >> >> >> Would it be possible to let some other (not using nohz mode) CPU to > >> >> >> flush the buffers? > >> >> > > >> >> > I guess that would be option 3) : > >> >> > > >> >> > Another option would be to let a single thread in the consumer handle > >> >> > the read-timer for all streams of the channel, like we do for UST. > >> >> > >> >> Ehm, well, you did say something about implement... Sorry for missing that. > >> >> > >> >> I guess now the question is which option that gives best > >> >> characteristics for least amount of work... Without knowing the design > >> >> of lttng-module, I'd believe that simply having the timer on another > >> >> CPU should be a good candidate. Is there anything to watch out for > >> >> with this solution? > >> >> > >> >> Are there any documents describing lttng-module design, or is it "join > >> >> the force, use the source"? I've seen some high-level description > >> >> showing how tools/libs/modules fit together, but I haven't found > >> >> anything that describes how lttng-modules is designed. > >> > > >> > Papers on the ring buffer design exist, but not on lttng-modules per se. > >> > > >> > I think the best solution in the shortest amount of time would be (2): > >> > using deferrable timers. It's just flags to pass to timer creation. > >> > >> Doesn't that require that the system is idle from time to time? My > >> application will occupy 100% CPU until finished, and expects there are > >> no ticks during that time. > > > > AFAIU, your initial question was about not preventing the CPU from going > > to low power mode when tracing. The deferred timers should do just that. > > > > Indeed, the timers will fire on CPUs that are active. > > > > I guess what you want there is no intrusiveness for CPU shielding. > > Indeed, for this kind of use-case, you may need to centralise the timer > > handling into lttng-consumerd. > > I realize I didn't express myself very clearly: There is a distinction > between "full nohz" and "nohz idle". Full nohz means that if there are > no competing threads there is no reason to have ticks, so turn ticks > off. POSIX timers complicates things, but this was the simplistic view > of it... This is currently implemented as an extension of nohz idle > although they are quite orthogonal. Full nohz has been called "full > dynticks" and "extended nohz", quite a lot of naming confusion here. > > I need to read up on the code to see what seems to be the best design. > I thought just changing lib_ring_buffer_start_switch_timer() so that > it used "add_timer_on(&buff->switch_timer, 0)" would do the trick, > perhaps by using some kind of config for this case... But things are > usually not as simple as they first appear to be. If you go for this approach, I would recommend having a single timer handler per channel (rather than per buffer). Within the handler, you can iterate on each buffer. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From soariez at gmail.com Fri Apr 26 14:47:36 2013 From: soariez at gmail.com (Zifei Tong) Date: Sat, 27 Apr 2013 02:47:36 +0800 Subject: [lttng-dev] GSoC 2013, "C++ probe support" project and more In-Reply-To: <1366860094.5178a13e78f12@www.imp.polymtl.ca> References: <1366860094.5178a13e78f12@www.imp.polymtl.ca> Message-ID: Hi Suchakra and Christian > Nice! I have done something similar here and I was able to build and insert code > snippets. But then I am more inclined towards analysing performance of dyninst. According the document and my test, turn 'BPatch::setTrampRecursive(true)' on will reduce the 'mutatee' instrumentation overhead a lot. > You might also be interested in 'fast tracepoint' infrastructure and normal tracepoints provided by gdb. > But getting gdb's infra for dynamic tracing with UST may be somewhat a serious hack. Thanks for pointing out gdb's 'fast tracepoint' feature. I just compiled gdb and got 'ftrace' work. > Quote form gdb document [1]: "At present, the UST (LTTng Userspace Tracer, http://lttng.org/ust) tracing engine is supported." So does it mean the dynamic instrumentation project is already done by the gdb guys? > The dynamic instrumentation project is very interesting indeed. I also > think it could be doable as a GSoC project. Do you have any plan on > how you would integrate dyninst with UST? > Also, a quick reminder that the GSoC application for student is open > until May 3rd. Don't forget to send us your proposal :)! I will finish my proposal as soon possible. Thanks. [1] http://sourceware.org/gdb/current/onlinedocs/gdb/Server.html#Server -- Best Regards, ??? (Zifei Tong) From mathieu.desnoyers at efficios.com Fri Apr 26 15:18:38 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Fri, 26 Apr 2013 15:18:38 -0400 Subject: [lttng-dev] [RFC PATCH] Fix: per-uid buffers should only be flushed once on stop Message-ID: <20130426191838.GA21939@Krystal> They were flushed once per application previously, causing workload with many applications to trigger too many flush on stop, which in turn caused buffer padding bloat. * The pseudo-code for stop behavior on per-uid buffers was: flush session's buffers for each application: - stop tracing - wait quiescent - flush buffers - push metadata Now doing, for per-uid buffers: for each application: - stop tracing - wait quiescent - push metadata flush session's buffers * And for per-pid buffers: Previously: for each application: - stop tracing - wait quiescent - flush buffers - push metadata Now: for each application: - stop tracing - wait quiescent - push metadata for each application: - flush buffers Refs: #497 Signed-off-by: Mathieu Desnoyers --- diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 9bd622d..9bd4e69 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -3550,6 +3550,7 @@ int ust_app_create_event_glb(struct ltt_ust_session *usess, /* * Start tracing for a specific UST session and app. */ +static int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) { int ret = 0; @@ -3642,12 +3643,11 @@ error_unlock: /* * Stop tracing for a specific UST session and app. */ +static int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app) { int ret = 0; - struct lttng_ht_iter iter; struct ust_app_session *ua_sess; - struct ust_app_channel *ua_chan; struct ust_registry_session *registry; DBG("Stopping tracing for ust app pid %d", app->pid); @@ -3700,6 +3700,52 @@ int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app) health_code_update(); + registry = get_session_registry(ua_sess); + assert(registry); + /* Push metadata for application before freeing the application. */ + (void) push_metadata(registry, ua_sess->consumer); + + pthread_mutex_unlock(&ua_sess->lock); +end_no_session: + rcu_read_unlock(); + health_code_update(); + return 0; + +error_rcu_unlock: + pthread_mutex_unlock(&ua_sess->lock); + rcu_read_unlock(); + health_code_update(); + return -1; +} + +/* + * Flush buffers for a specific UST session and app. + */ +static +int ust_app_flush_trace(struct ltt_ust_session *usess, struct ust_app *app) +{ + int ret = 0; + struct lttng_ht_iter iter; + struct ust_app_session *ua_sess; + struct ust_app_channel *ua_chan; + + DBG("Flushing buffers for ust app pid %d", app->pid); + + rcu_read_lock(); + + if (!app->compatible) { + goto end_no_session; + } + + ua_sess = lookup_session_by_app(usess, app); + if (ua_sess == NULL) { + goto end_no_session; + } + + pthread_mutex_lock(&ua_sess->lock); + + health_code_update(); + /* Flushing buffers */ cds_lfht_for_each_entry(ua_sess->channels->ht, &iter.iter, ua_chan, node.node) { @@ -3723,22 +3769,11 @@ int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app) health_code_update(); - registry = get_session_registry(ua_sess); - assert(registry); - /* Push metadata for application before freeing the application. */ - (void) push_metadata(registry, ua_sess->consumer); - pthread_mutex_unlock(&ua_sess->lock); end_no_session: rcu_read_unlock(); health_code_update(); return 0; - -error_rcu_unlock: - pthread_mutex_unlock(&ua_sess->lock); - rcu_read_unlock(); - health_code_update(); - return -1; } /* @@ -3823,9 +3858,21 @@ int ust_app_stop_trace_all(struct ltt_ust_session *usess) rcu_read_lock(); - /* Flush all per UID buffers associated to that session. */ - if (usess->buffer_type == LTTNG_BUFFER_PER_UID) { + cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) { + ret = ust_app_stop_trace(usess, app); + if (ret < 0) { + /* Continue to next apps even on error */ + continue; + } + } + + /* Flush buffers */ + switch (usess->buffer_type) { + case LTTNG_BUFFER_PER_UID: + { struct buffer_reg_uid *reg; + + /* Flush all per UID buffers associated to that session. */ cds_list_for_each_entry(reg, &usess->buffer_reg_uid_list, lnode) { struct buffer_reg_channel *reg_chan; struct consumer_socket *socket; @@ -3848,14 +3895,20 @@ int ust_app_stop_trace_all(struct ltt_ust_session *usess) (void) consumer_flush_channel(socket, reg_chan->consumer_key); } } + break; } - - cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) { - ret = ust_app_stop_trace(usess, app); - if (ret < 0) { - /* Continue to next apps even on error */ - continue; + case LTTNG_BUFFER_PER_PID: + cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) { + ret = ust_app_flush_trace(usess, app); + if (ret < 0) { + /* Continue to next apps even on error */ + continue; + } } + break; + default: + assert(0); + break; } rcu_read_unlock(); diff --git a/src/bin/lttng-sessiond/ust-app.h b/src/bin/lttng-sessiond/ust-app.h index e0aa17a..255a75c 100644 --- a/src/bin/lttng-sessiond/ust-app.h +++ b/src/bin/lttng-sessiond/ust-app.h @@ -257,8 +257,6 @@ int ust_app_register_done(int sock) int ust_app_version(struct ust_app *app); void ust_app_unregister(int sock); unsigned long ust_app_list_count(void); -int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app); -int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app); int ust_app_start_trace_all(struct ltt_ust_session *usess); int ust_app_stop_trace_all(struct ltt_ust_session *usess); int ust_app_destroy_trace_all(struct ltt_ust_session *usess); -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From suchakrapani.sharma at polymtl.ca Fri Apr 26 19:16:24 2013 From: suchakrapani.sharma at polymtl.ca (Suchakrapani Datt Sharma) Date: Fri, 26 Apr 2013 19:16:24 -0400 Subject: [lttng-dev] GSoC 2013, "C++ probe support" project and more In-Reply-To: References: <1366860094.5178a13e78f12@www.imp.polymtl.ca> Message-ID: <1367018184.517b0ac898ae3@www.imp.polymtl.ca> Hi, Quoting Zifei Tong : > 'BPatch::setTrampRecursive(true)' on will reduce the 'mutatee' > instrumentation overhead a lot. Hmm..interesting. I should look into it too. I think I missed it. > > Quote form gdb document [1]: "At present, the UST (LTTng Userspace Tracer, > http://lttng.org/ust) tracing engine is supported." > > So does it mean the dynamic instrumentation project is already done by > the gdb guys? This is for static tracepoint support with IPA and not dynamic one. Support for dynamic tracing in GDB is independent of UST still. -- Suchakra From AMITM at il.ibm.com Sun Apr 28 09:51:35 2013 From: AMITM at il.ibm.com (Amit Margalit) Date: Sun, 28 Apr 2013 16:51:35 +0300 Subject: [lttng-dev] Is there a way to make LTTng use the same subbuffers for multiple processes? Message-ID: Hi, We're considering using LTTng as a logging / tracing solution for a multi-process application, which spawns many sub-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? If not - how difficult would it be to add such support? Thanks, Amit Margalit IBM XIV - Storage Reinvented XIV-NAS Development Team Tel. 03-689-7774 Fax. 03-689-7230 -------------- next part -------------- An HTML attachment was scrubbed... URL: From michel.dagenais at polymtl.ca Sun Apr 28 21:32:29 2013 From: michel.dagenais at polymtl.ca (Michel Dagenais) Date: Sun, 28 Apr 2013 21:32:29 -0400 (EDT) Subject: [lttng-dev] Is there a way to make LTTng use the same subbuffers for multiple processes? In-Reply-To: Message-ID: <1871619348.1882721367199149384.JavaMail.root@srv11.zimbra.polymtl.ca> > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From AMITM at il.ibm.com Mon Apr 29 02:00:51 2013 From: AMITM at il.ibm.com (Amit Margalit) Date: Mon, 29 Apr 2013 09:00:51 +0300 Subject: [lttng-dev] Is there a way to make LTTng use the same subbuffers for multiple processes? In-Reply-To: <1871619348.1882721367199149384.JavaMail.root@srv11.zimbra.polymtl.ca> References: <1871619348.1882721367199149384.JavaMail.root@srv11.zimbra.polymtl.ca> Message-ID: This is excellent. We'll give it a try. Thank you, 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From liljegren.mats2 at gmail.com Mon Apr 29 02:53:04 2013 From: liljegren.mats2 at gmail.com (Mats Liljegren) Date: Mon, 29 Apr 2013 08:53:04 +0200 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: <20130426161439.GA5547@Krystal> References: <20130425151213.GC7970@Krystal> <20130426132639.GA1468@Krystal> <20130426151444.GA2260@Krystal> <20130426153819.GA3026@Krystal> <20130426161439.GA5547@Krystal> Message-ID: On Fri, Apr 26, 2013 at 6:14 PM, Mathieu Desnoyers wrote: >> > AFAIU, your initial question was about not preventing the CPU from going >> > to low power mode when tracing. The deferred timers should do just that. >> > >> > Indeed, the timers will fire on CPUs that are active. >> > >> > I guess what you want there is no intrusiveness for CPU shielding. >> > Indeed, for this kind of use-case, you may need to centralise the timer >> > handling into lttng-consumerd. >> >> I realize I didn't express myself very clearly: There is a distinction >> between "full nohz" and "nohz idle". Full nohz means that if there are >> no competing threads there is no reason to have ticks, so turn ticks >> off. POSIX timers complicates things, but this was the simplistic view >> of it... This is currently implemented as an extension of nohz idle >> although they are quite orthogonal. Full nohz has been called "full >> dynticks" and "extended nohz", quite a lot of naming confusion here. >> >> I need to read up on the code to see what seems to be the best design. >> I thought just changing lib_ring_buffer_start_switch_timer() so that >> it used "add_timer_on(&buff->switch_timer, 0)" would do the trick, >> perhaps by using some kind of config for this case... But things are >> usually not as simple as they first appear to be. > > If you go for this approach, I would recommend having a single timer > handler per channel (rather than per buffer). Within the handler, you > can iterate on each buffer. Thanks for the advice! I'll dive into the code and see if I can make something that works. /Mats From andreb at stud.fh-dortmund.de Mon Apr 29 06:40:56 2013 From: andreb at stud.fh-dortmund.de (Andre Bette) Date: Mon, 29 Apr 2013 12:40:56 +0200 Subject: [lttng-dev] Using the additional Eclipse Kernel Trace Plugin Views (Control flow, Resources) Message-ID: <517E4E38.6030507@stud.fh-dortmund.de> 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. )? Best Regards, Andre From simon.marchi at polymtl.ca Mon Apr 29 09:58:01 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Mon, 29 Apr 2013 09:58:01 -0400 Subject: [lttng-dev] UST tracepoints, same provider, different files Message-ID: Hello ! I am trying to add two tracepoints to a simple test application. If I put both tracepoints in different compilation units (two .c files), UST crashes when the application starts with the following message: test: /usr/local/include/lttng/ust-tracepoint-event.h:685: __lttng_events_init__my_project: Assertion `!ret' failed. I made an example [1] so you can simply run "make && ./test". I am using the latest git versions, on Ubuntu 13.04 x86_64. Thanks ! Simon [1] http://git.dorsal.polymtl.ca/~smarchi?p=ust-test.git;a=summary From simon.marchi at polymtl.ca Mon Apr 29 09:59:43 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Mon, 29 Apr 2013 09:59:43 -0400 Subject: [lttng-dev] UST tracepoints, same provider, different files In-Reply-To: References: Message-ID: Just to add a precision, it happens only when both tracepoints use the same provider. On 29 April 2013 09:58, Simon Marchi wrote: > Hello ! > > I am trying to add two tracepoints to a simple test application. If I > put both tracepoints in different compilation units (two .c files), > UST crashes when the application starts with the following message: > > test: /usr/local/include/lttng/ust-tracepoint-event.h:685: > __lttng_events_init__my_project: Assertion `!ret' failed. > > I made an example [1] so you can simply run "make && ./test". I am > using the latest git versions, on Ubuntu 13.04 x86_64. > > Thanks ! > > Simon > > [1] http://git.dorsal.polymtl.ca/~smarchi?p=ust-test.git;a=summary From AMITM at il.ibm.com Mon Apr 29 10:15:40 2013 From: AMITM at il.ibm.com (Amit Margalit) Date: Mon, 29 Apr 2013 17:15:40 +0300 Subject: [lttng-dev] Is there a way to make LTTng use the same subbuffers for multiple processes? In-Reply-To: <1871619348.1882721367199149384.JavaMail.root@srv11.zimbra.polymtl.ca> References: <1871619348.1882721367199149384.JavaMail.root@srv11.zimbra.polymtl.ca> Message-ID: 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? 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.khouzam at ericsson.com Mon Apr 29 12:02:36 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Mon, 29 Apr 2013 12:02:36 -0400 Subject: [lttng-dev] Using the additional Eclipse Kernel Trace Plugin Views (Control flow, Resources) In-Reply-To: <517E4E38.6030507@stud.fh-dortmund.de> References: <517E4E38.6030507@stud.fh-dortmund.de> Message-ID: <517E999C.7010108@ericsson.com> On 13-04-29 06:40 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 will expand upon, YES! 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. ;) Matthew > > > > Best Regards, > Andre > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev From michel.dagenais at polymtl.ca Mon Apr 29 12:08:23 2013 From: michel.dagenais at polymtl.ca (Michel Dagenais) Date: Mon, 29 Apr 2013 12:08:23 -0400 (EDT) Subject: [lttng-dev] Is there a way to make LTTng use the same subbuffers for multiple processes? In-Reply-To: <1704772455.1950411367251637542.JavaMail.root@srv11.zimbra.polymtl.ca> Message-ID: <1506315467.1950571367251703283.JavaMail.root@srv11.zimbra.polymtl.ca> > 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? The parent is running as root and the child processes are using seteuid? I am not sure about how this is handled. David or Mathieu can tell you more about the new architecture for sharing buffers. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathieu.desnoyers at efficios.com Mon Apr 29 12:25:37 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 29 Apr 2013 12:25:37 -0400 Subject: [lttng-dev] UST tracepoints, same provider, different files In-Reply-To: References: Message-ID: <20130429162537.GA17859@Krystal> You should not create two compilation units with the same provider name in your application. This assertion is there to check just that. * Simon Marchi (simon.marchi at polymtl.ca) wrote: > Hello ! > > I am trying to add two tracepoints to a simple test application. If I > put both tracepoints in different compilation units (two .c files), > UST crashes when the application starts with the following message: > > test: /usr/local/include/lttng/ust-tracepoint-event.h:685: > __lttng_events_init__my_project: Assertion `!ret' failed. > > I made an example [1] so you can simply run "make && ./test". I am > using the latest git versions, on Ubuntu 13.04 x86_64. > > Thanks ! > > Simon > > [1] http://git.dorsal.polymtl.ca/~smarchi?p=ust-test.git;a=summary > > _______________________________________________ > 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 Apr 29 12:27:52 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 29 Apr 2013 12:27:52 -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> Message-ID: <20130429162752.GB17859@Krystal> * 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 From jan.glauber at gmail.com Mon Apr 29 12:28:58 2013 From: jan.glauber at gmail.com (Jan Glauber) Date: Mon, 29 Apr 2013 18:28:58 +0200 Subject: [lttng-dev] [PATCH lttng-modules] Update ARM (32 bit) syscall tracepoints to 3.4 Message-ID: <1367252939-24274-1-git-send-email-jan.glauber@gmail.com> 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 From alexmonthy at voxpopuli.im Mon Apr 29 13:05:29 2013 From: alexmonthy at voxpopuli.im (Alexandre Montplaisir) Date: Mon, 29 Apr 2013 13:05:29 -0400 Subject: [lttng-dev] Using the additional Eclipse Kernel Trace Plugin Views (Control flow, Resources) In-Reply-To: <517E4E38.6030507@stud.fh-dortmund.de> References: <517E4E38.6030507@stud.fh-dortmund.de> Message-ID: <517EA859.5010203@voxpopuli.im> On 13-04-29 06:40 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. )? Hi Andre, This is definitely possible, the idea will be to build a custom state system provider to populate your view. This seems to be a hot topic recently! Here's a copy of an email I sent internally last week on the subject. (just note that we are currently in the process of cleaning up our APIs. So if you pull from master later this week, IStateChangeInput should be renamed to ITmfStateProvider, and CtfKernelStateInput to LttngKernelStateProvider. But the functionality will remain the same.) Hi all, Unfortunately we don't really have any complete documentation about the state system and its usage (we had some at some point but it quickly became outdated...) Our goal is to move to state providers defined in external files, like XML files, instead of being done programmatically for every trace type. This will make it easier for people to implement their own. It's still at the early stages now though, but you can follow / comment on this discussion on the linuxtools-dev mailing list: http://dev.eclipse.org/mhonarc/lists/linuxtools-dev/msg02500.html (and the follow-ups). But for now, if you want to use a state system and related views in your own plugins, you will have to define the state provider in Java code. The idea of this class is to indicate which trace events will cause which *state changes*. Which is why it's called IStateChangeInput, it's an input of state changes. For example, in Linux kernel traces, the "sched_switch" event will change a process from the "running" state to the "idle" state, and another process from "idle" to "running". You can look at CtfKernelStateInput.java in the TMF git tree, it shows you how we do it for our LTTng-kernel trace analysis. You can also look at CtfKernelTrace#buildStateSystem to see how to tell a given trace type to use a given state input. With that done, once you load your trace in TMF and assign it your trace type, it should index and build the requested state system. Views will now be able to query it. You can look for example at ControlFlowView.java and search for "getStateSystems().get(CtfKernelTrace.STATE_ID)" and the following lines. You'll see how the view queries the state system for information. Finally, you can look at an old blog post I made at http://www.dorsal.polymtl.ca/blog/alexandre-montplaisir/introduction-state-history It explains in particular the notion of attribute, state change, current state, etc. "Event handler" is now what we call the "state provider" or "state change input". This is just a high-level overview, if you have any other question or if something is not clear, don't hesitate to contact me! Cheers, Alexandre > > > > Best Regards, > Andre > From simon.marchi at polymtl.ca Mon Apr 29 13:56:32 2013 From: simon.marchi at polymtl.ca (Simon Marchi) Date: Mon, 29 Apr 2013 13:56:32 -0400 Subject: [lttng-dev] UST tracepoints, same provider, different files In-Reply-To: <20130429162537.GA17859@Krystal> References: <20130429162537.GA17859@Krystal> Message-ID: Ok. When trying to instrument a bigger application (memcached) with the same pattern, I witnessed a different behavior. No crash on assert, but only one tracepoint would get correctly registered at the application startup (as I mentionned on IRC this weekend). So the behavior when doing this seems undefined. Maybe this restriction should be documented ? It seemed natural to me at first to put each tracepoint in its own .tp file. On 29 April 2013 12:25, Mathieu Desnoyers wrote: > You should not create two compilation units with the same provider name > in your application. This assertion is there to check just that. > > * Simon Marchi (simon.marchi at polymtl.ca) wrote: >> Hello ! >> >> I am trying to add two tracepoints to a simple test application. If I >> put both tracepoints in different compilation units (two .c files), >> UST crashes when the application starts with the following message: >> >> test: /usr/local/include/lttng/ust-tracepoint-event.h:685: >> __lttng_events_init__my_project: Assertion `!ret' failed. >> >> I made an example [1] so you can simply run "make && ./test". I am >> using the latest git versions, on Ubuntu 13.04 x86_64. >> >> Thanks ! >> >> Simon >> >> [1] http://git.dorsal.polymtl.ca/~smarchi?p=ust-test.git;a=summary >> >> _______________________________________________ >> 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 mathieu.desnoyers at efficios.com Mon Apr 29 14:11:37 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Mon, 29 Apr 2013 14:11:37 -0400 Subject: [lttng-dev] UST tracepoints, same provider, different files In-Reply-To: References: <20130429162537.GA17859@Krystal> Message-ID: <20130429181137.GA3044@Krystal> yes, please open a bug on bugs.lttng.org * Simon Marchi (simon.marchi at polymtl.ca) wrote: > Ok. > > When trying to instrument a bigger application (memcached) with the > same pattern, I witnessed a different behavior. No crash on assert, > but only one tracepoint would get correctly registered at the > application startup (as I mentionned on IRC this weekend). So the > behavior when doing this seems undefined. Maybe this restriction > should be documented ? It seemed natural to me at first to put each > tracepoint in its own .tp file. > > On 29 April 2013 12:25, Mathieu Desnoyers > wrote: > > You should not create two compilation units with the same provider name > > in your application. This assertion is there to check just that. > > > > * Simon Marchi (simon.marchi at polymtl.ca) wrote: > >> Hello ! > >> > >> I am trying to add two tracepoints to a simple test application. If I > >> put both tracepoints in different compilation units (two .c files), > >> UST crashes when the application starts with the following message: > >> > >> test: /usr/local/include/lttng/ust-tracepoint-event.h:685: > >> __lttng_events_init__my_project: Assertion `!ret' failed. > >> > >> I made an example [1] so you can simply run "make && ./test". I am > >> using the latest git versions, on Ubuntu 13.04 x86_64. > >> > >> Thanks ! > >> > >> Simon > >> > >> [1] http://git.dorsal.polymtl.ca/~smarchi?p=ust-test.git;a=summary > >> > >> _______________________________________________ > >> 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 andreb at stud.fh-dortmund.de Tue Apr 30 05:21:06 2013 From: andreb at stud.fh-dortmund.de (Andre Bette) Date: Tue, 30 Apr 2013 11:21:06 +0200 Subject: [lttng-dev] Using the additional Eclipse Kernel Trace Plugin Views (Control flow, Resources) Message-ID: <517F8D02.4090202@stud.fh-dortmund.de> 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 )? Best Regards, Andre From liljegren.mats2 at gmail.com Tue Apr 30 09:19:59 2013 From: liljegren.mats2 at gmail.com (Mats Liljegren) Date: Tue, 30 Apr 2013 15:19:59 +0200 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: References: <20130425151213.GC7970@Krystal> <20130426132639.GA1468@Krystal> <20130426151444.GA2260@Krystal> <20130426153819.GA3026@Krystal> <20130426161439.GA5547@Krystal> Message-ID: I've done some code diving now, and I feel stupid... I thought I could get global buffers in kernel traces using option --buffers-global, as the help text seemed to indicate this: $ lttng enable-channel --help usage: lttng enable-channel NAME[,NAME2,...] [-u|-k] [OPTIONS] Options: -h, --help Show this help --list-options Simple listing of options -s, --session NAME Apply to session name -k, --kernel Apply to the kernel tracer -u, --userspace Apply to the user-space tracer Channel options: --discard Discard event when buffers are full (default) --overwrite Flight recorder mode --subbuf-size SIZE Subbuffer size in bytes (default: 4096, kernel default: 262144) Needs to be a power of 2 for kernel and ust tracers --num-subbuf NUM Number of subbufers (default: 4) Needs to be a power of 2 for kernel and ust tracers --switch-timer USEC Switch timer interval in usec (default: 0) --read-timer USEC Read timer interval in usec (UST default: 0, kernel default: 200000) --output TYPE Channel output type (Values: mmap, splice) --buffers-uid Use per UID buffer (-u only) --buffers-pid Use per PID buffer (-u only) --buffers-global Use shared buffer for the whole system (-k only) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -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? Thanks Mats From mathieu.desnoyers at efficios.com Tue Apr 30 10:43:24 2013 From: mathieu.desnoyers at efficios.com (Mathieu Desnoyers) Date: Tue, 30 Apr 2013 10:43:24 -0400 Subject: [lttng-dev] Changed scheduling when using lttng In-Reply-To: References: <20130426132639.GA1468@Krystal> <20130426151444.GA2260@Krystal> <20130426153819.GA3026@Krystal> <20130426161439.GA5547@Krystal> Message-ID: <20130430144323.GB31980@Krystal> * Mats Liljegren (liljegren.mats2 at gmail.com) wrote: > I've done some code diving now, and I feel stupid... > > I thought I could get global buffers in kernel traces using option > --buffers-global, as the help text seemed to indicate this: > $ lttng enable-channel --help > usage: lttng enable-channel NAME[,NAME2,...] [-u|-k] [OPTIONS] > > Options: > -h, --help Show this help > --list-options Simple listing of options > -s, --session NAME Apply to session name > -k, --kernel Apply to the kernel tracer > -u, --userspace Apply to the user-space tracer > > Channel options: > --discard Discard event when buffers are full (default) > --overwrite Flight recorder mode > --subbuf-size SIZE Subbuffer size in bytes > (default: 4096, kernel default: 262144) > Needs to be a power of 2 for > kernel and ust tracers > --num-subbuf NUM Number of subbufers > (default: 4) > Needs to be a power of 2 for > kernel and ust tracers > --switch-timer USEC Switch timer interval in usec (default: 0) > --read-timer USEC Read timer interval in usec (UST default: > 0, kernel default: 200000) > --output TYPE Channel output type (Values: mmap, splice) > --buffers-uid Use per UID buffer (-u only) > --buffers-pid Use per PID buffer (-u only) > --buffers-global Use shared buffer for the whole system (-k only) This option would be clearer as "--buffers-per-cpu" maybe ? > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > -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. Thanks, Mathieu > > Thanks > Mats -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com From matthew.khouzam at ericsson.com Tue Apr 30 13:52:54 2013 From: matthew.khouzam at ericsson.com (Matthew Khouzam) Date: Tue, 30 Apr 2013 13:52:54 -0400 Subject: [lttng-dev] Using the additional Eclipse Kernel Trace Plugin Views (Control flow, Resources) In-Reply-To: <517F8D02.4090202@stud.fh-dortmund.de> References: <517F8D02.4090202@stud.fh-dortmund.de> Message-ID: <518004F6.5040202@ericsson.com> 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! 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 From alexmonthy at voxpopuli.im Tue Apr 30 14:37:27 2013 From: alexmonthy at voxpopuli.im (Alexandre Montplaisir) Date: Tue, 30 Apr 2013 14:37:27 -0400 Subject: [lttng-dev] Using the additional Eclipse Kernel Trace Plugin Views (Control flow, Resources) In-Reply-To: <518004F6.5040202@ericsson.com> References: <517F8D02.4090202@stud.fh-dortmund.de> <518004F6.5040202@ericsson.com> Message-ID: <51800F67.9040407@voxpopuli.im> 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